From 0902bc967f8ce730f108164789b28663e704bed0 Mon Sep 17 00:00:00 2001 From: simosathan9 Date: Thu, 22 Aug 2024 19:23:10 +0300 Subject: [PATCH] Add changes on grep block and style changes --- public/blocks/grepBlock.js | 60 ++++++++++++++++++++++++++++++++++---- public/js/el.js | 8 +++++ public/js/en.js | 7 +++++ public/styledark.css | 23 ++++++++++----- public/styles.css | 2 +- 5 files changed, 86 insertions(+), 14 deletions(-) diff --git a/public/blocks/grepBlock.js b/public/blocks/grepBlock.js index 0785b36..0e0cc8c 100644 --- a/public/blocks/grepBlock.js +++ b/public/blocks/grepBlock.js @@ -10,9 +10,13 @@ var grepBlock = { inverted: '-v', recursive: '-r', show_line_nums: '-n', + stop_after_num_matches: '-m ', multiple_patterns: '-e', regPattern: '"patt"', - showFiles: '-H' + showFiles: '-H', + print_context_before_match: '-B ', + print_context_after_match: '-A ', + print_context_around_match: '-C ' } ], message0: '%{BKY_GREP}', @@ -72,30 +76,74 @@ var grepBlock = { checked: false // by default it's disabled } ], - message8: '%{BKY_GREP_MULTIPLE_PATTERN_SEARCH}', + message8: '%{BKY_GREP_STOP_AFTER_NUM_MATCHES}', args8: [ + { + type: 'field_number', + name: 'stop_after_num_matches', + value: 0 + } + ], + message9: '%{BKY_GREP_MULTIPLE_PATTERN_SEARCH}', + args9: [ { type: 'field_checkbox', name: 'show_line_nums', checked: false // by default it's disabled } ], - message9: '%{BKY_GREP_SHOW_FILENAME}', - args9: [ + message10: '%{BKY_GREP_SHOW_FILENAME}', + args10: [ { type: 'field_checkbox', name: 'showFiles', checked: false // by default it's disabled } ], - message10: '%{BKY_GREP_PATTERN_DEFINE}', - args10: [ + message11: '%{BKY_GREP_PATTERN_DEFINE}', + args11: [ { type: 'input_value', name: 'regPattern', check: 'String' } ], + message12: '%{BKY_GREP_PRINT_CONTEXT_BEFORE_MATCH}', + args12: [ + { + type: 'field_number', + name: 'print_context_before_match', + value: 0 + }, + { + type: 'field_checkbox', + checked: false // by default it's disabled + } + ], + message13: '%{BKY_GREP_PRINT_CONTEXT_AFTER_MATCH}', + args13: [ + { + type: 'field_number', + name: 'print_context_after_match', + value: 0 + }, + { + type: 'field_checkbox', + checked: false // by default it's disabled + } + ], + message14: '%{BKY_GREP_PRINT_CONTEXT_AROUND_MATCH}', + args14: [ + { + type: 'field_number', + name: 'print_context_around_match', + value: 0 + }, + { + type: 'field_checkbox', + checked: false // by default it's disabled + } + ], style: 'Data Processing', previousStatement: 'Action', nextStatement: 'Action', diff --git a/public/js/el.js b/public/js/el.js index c716dcd..7f10925 100644 --- a/public/js/el.js +++ b/public/js/el.js @@ -96,7 +96,15 @@ Blockly.Msg['GREP_PATTERN_NEGATION'] = 'εμφάνιση γραμμών που δεν ταιριάζουν στο μοτίβο %1'; Blockly.Msg['GREP_RECURSIVE_SEARCH'] = 'αναζήτηση αναδρομικά %1'; Blockly.Msg['GREP_DISPLAY_LINE_NUMBERS'] = 'εμφάνιση αριθμών γραμμών %1'; +Blockly.Msg['GREP_STOP_AFTER_NUM_MATCHES'] = + 'σταμάτησε μετά από %1 αντιστοιχίες'; Blockly.Msg['GREP_MULTIPLE_PATTERN_SEARCH'] = 'Αναζήτηση με πολλαπλά μοτίβα %1'; +Blockly.Msg['GREP_PRINT_CONTEXT_BEFORE_MATCH'] = + 'Εκτύπωση %1 γραμμών πριν από την αντιστοιχία %2'; +Blockly.Msg['GREP_PRINT_CONTEXT_AFTER_MATCH'] = + 'Εκτύπωση %1 γραμμών μετά την αντιστοιχία %2'; +Blockly.Msg['GREP_PRINT_CONTEXT_AROUND_MATCH'] = + 'Εκτύπωση %1 γραμμών γύρω από την αντιστοιχία %2'; Blockly.Msg['GREP_SHOW_FILENAME'] = 'Εμφάνιση ονόματος αρχείου %1'; Blockly.Msg['GREP_TOOLTIP'] = 'αναζήτηση σε αρχείο με μοτίβο'; Blockly.Msg['GREP_HELPURL'] = 'https://www.google.com/'; diff --git a/public/js/en.js b/public/js/en.js index 297acd8..358a4ed 100644 --- a/public/js/en.js +++ b/public/js/en.js @@ -93,9 +93,16 @@ Blockly.Msg['GREP_COUNT_MATCHES'] = 'count the matches %1'; Blockly.Msg['GREP_PATTERN_NEGATION'] = "show lines that don't match pattern %1"; Blockly.Msg['GREP_RECURSIVE_SEARCH'] = 'search recursively %1'; Blockly.Msg['GREP_DISPLAY_LINE_NUMBERS'] = 'show line numbers %1'; +Blockly.Msg['GREP_STOP_AFTER_NUM_MATCHES'] = 'stop after %1 matches'; Blockly.Msg['GREP_MULTIPLE_PATTERN_SEARCH'] = 'Search with multiple patterns %1'; Blockly.Msg['GREP_SHOW_FILENAME'] = 'Show filename %1'; +Blockly.Msg['GREP_PRINT_CONTEXT_BEFORE_MATCH'] = + 'Print %1 lines of context before match %2'; +Blockly.Msg['GREP_PRINT_CONTEXT_AFTER_MATCH'] = + 'Print %1 lines of context after match %2'; +Blockly.Msg['GREP_PRINT_CONTEXT_AROUND_MATCH'] = + 'Print %1 lines of context around match %2'; Blockly.Msg['GREP_TOOLTIP'] = 'search in a file with a pattern'; Blockly.Msg['GREP_HELPURL'] = 'https://www.google.com/'; Blockly.Msg['GZIP_FILE'] = '%1 file'; diff --git a/public/styledark.css b/public/styledark.css index 8b4521a..89f1134 100644 --- a/public/styledark.css +++ b/public/styledark.css @@ -54,7 +54,7 @@ body { height: 25px; overflow-y: hidden; border-radius: 8px; - color: rgb(208, 208, 208); /* White text for results area */ + color: #fff; /* White text for results area */ } .blockly-minimap { @@ -64,9 +64,18 @@ body { height: 150px; top: 50px; left: 258px; - overflow: hidden; border-radius: 3px; - background-color: #2a2a2a; /* Dark background for minimap */ + background-color: #252526; +} + +.blockly-focus-region { + background-color: #252526; /* Applies to HTML elements */ + fill: #252526; /* Applies to SVG elements */ + border: none; /* Ensures no border is applied */ +} + +.svg { + fill: #252526; /* Applies to SVG elements */ } #copyButton { @@ -78,7 +87,7 @@ body { outline: none !important; /* Αφαίρεση του outline (αν υπάρχει) */ box-shadow: none !important; /* Αφαίρεση σκιάς (αν υπάρχει) */ border-radius: 0%; /* Καμία στρογγυλοποίηση στις γωνίες */ - color: rgb(208, 208, 208); /* Λευκό χρώμα για το εικονίδιο */ + color: #fff; /* Λευκό χρώμα για το εικονίδιο */ } .icon-button:hover { @@ -87,7 +96,7 @@ body { .icon-button i { font-size: 16px; /* Icon size */ - color: #d0d0d0; /* Light gray for icons */ + color: #fff; /* Light gray for icons */ } #executeButton { @@ -152,7 +161,7 @@ button { border: 1px solid #555; /* Darker border for buttons */ font-size: large; background-color: #444; /* Dark background for buttons */ - color: #d0d0d0; /* Light gray text */ + color: #fff; /* Light gray text */ cursor: pointer; padding: 1px 10px; margin: 1px 5px; @@ -163,7 +172,7 @@ button { border: 1px solid #555; /* Darker border for dropdown */ font-size: large; background-color: #444; /* Dark background for dropdown */ - color: #d0d0d0; /* Light gray text */ + color: #fff; /* Light gray text */ cursor: pointer; padding: 5px 10px; margin: 1px 5px; diff --git a/public/styles.css b/public/styles.css index 2abba42..8f745a5 100644 --- a/public/styles.css +++ b/public/styles.css @@ -49,7 +49,7 @@ body { background: #fff; height: 25px; overflow-y: hidden; - border-radius: 8px; + border-radius: 3px; } .blockly-minimap {