Skip to content

Commit

Permalink
Improve blocks, tutorials, and fix minor bug in the resultsArea box.
Browse files Browse the repository at this point in the history
  • Loading branch information
simosathan9 committed Sep 15, 2024
1 parent 4423885 commit 8c2a3f9
Show file tree
Hide file tree
Showing 16 changed files with 53 additions and 55 deletions.
2 changes: 0 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,6 @@
{ kind: 'block', type: 'wc' },
{ kind: 'block', type: 'sort' },
{ kind: 'block', type: 'uniq' },
{ kind: 'block', type: 'findDuplicates' },
{ kind: 'block', type: 'showUniqs' },
{ kind: 'block', type: 'cut' },
{ kind: 'block', type: 'sed' }
]
Expand Down
18 changes: 0 additions & 18 deletions public/blocks/findDuplicatesBlock.js

This file was deleted.

18 changes: 0 additions & 18 deletions public/blocks/showUniqsBlock.js

This file was deleted.

2 changes: 1 addition & 1 deletion public/blocks/sortBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var sortBlock = {
desc: '-r',
numeric_sorting: '-n',
sort_delimiter: "-t'str'",
sort_column: '-k',
sort_column: '-k ',
uniq_elements: '-u',
ignore_nonPrintable: '-i',
ignore_leading_blanks: '-b'
Expand Down
30 changes: 28 additions & 2 deletions public/blocks/uniqBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ var uniqBlock = {
{
none: '',
occurencies: '-c',
caseInsensitive: '-i'
caseInsensitive: '-i',
outputNonRepeatedLines: '-u',
outputSingleCopyOfRepeatedLines: '-d',
skipChars: '-s str'
}
],

Expand All @@ -26,7 +29,30 @@ var uniqBlock = {
checked: false // by default it's disabled
}
],

message3: '%{BKY_UNIQ_OUTPUT_NON_REPEATED_LINES}',
args3: [
{
type: 'field_checkbox',
name: 'outputNonRepeatedLines',
checked: false // by default it's disabled
}
],
message4: '%{BKY_UNIQ_OUTPUT_SINGLE_COPY_OF_REPEATED_LINES}',
args4: [
{
type: 'field_checkbox',
name: 'outputSingleCopyOfRepeatedLines',
checked: false // by default it's disabled
}
],
message5: '%{BKY_UNIQ_SKIP_CHARS}',
args5: [
{
type: 'field_input',
name: 'skipChars',
text: ''
}
],
style: 'Text Processing',
previousStatement: 'Action',
nextStatement: 'Action',
Expand Down
Binary file modified public/img/blockly_photo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/img/combine_files.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/img/convert_domains.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/img/extract_columns.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/img/filter_rows_and_count_lines.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/img/remove_duplicate_lines_and_sort.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 9 additions & 3 deletions public/js/el.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ Blockly.Msg['CONDITION_OUTPUT_HELPURL'] = 'https://www.google.com/';
Blockly.Msg['CUT'] = 'Αποκοπή σε αρχείο ή συμβολοσειρά';
Blockly.Msg['CUT_DELIMITER'] = 'Διαχωριστικό';
Blockly.Msg['CUT_DEFINE_COLUMNS'] = 'Ορισμός στηλών';
Blockly.Msg['CUT_START'] = 'Έναρξη υποσυμβολοσειράς';
Blockly.Msg['CUT_END'] = 'Τέλος';
Blockly.Msg['CUT_START'] = 'Έναρξη υποσυμβολοσειράς : ';
Blockly.Msg['CUT_END'] = 'Τέλος : ';
Blockly.Msg['CUT_TOOLTIP'] =
'Αποκοπή σε ένα αρχείο ή μια συμβολοσειρά.\nΓια συνεχόμενες αποκοπές χρησιμοποιήστε κόμμα(,) , για αποκοπές εύρους χρησιμοποιήστε παύλα (-)';
Blockly.Msg['CUT_HELPURL'] = 'https://www.google.com/';
Expand Down Expand Up @@ -127,7 +127,7 @@ Blockly.Msg['LS_MESSAGE'] = 'Λίστα αρχείων & καταλόγων';
Blockly.Msg['LS_SHOW_DETAILS'] = 'Εμφάνιση λεπτομερειών %1';
Blockly.Msg['LS_SUBDIRECTORIES'] = 'Αναζήτηση σε όλους τους υποκαταλόγους %1';
Blockly.Msg['LS_HIDDEN'] = 'Εμφάνιση κρυφών αρχείων %1';
Blockly.Msg['LS_REVERSE_ORDER'] = '%1 Εμφάνιση σε αντίστροφη σειρά';
Blockly.Msg['LS_REVERSE_ORDER'] = 'Εμφάνιση σε αντίστροφη σειρά %1';
Blockly.Msg['LS_TOOLTIP'] = 'Λίστα περιεχομένων καταλόγου';
Blockly.Msg['LS_HELPURL'] = 'https://www.google.com/';
Blockly.Msg['LN_MESSAGE'] = 'Σύνδεση αρχείων';
Expand Down Expand Up @@ -921,6 +921,12 @@ Blockly.Msg['UNIQ'] = 'Αφαίρεση διπλότυπων γραμμών στ
Blockly.Msg['UNIQ_COUNT'] =
'Μέτρηση των εμφανίσεων των \n γραμμών που αφαιρέθηκαν %1';
Blockly.Msg['UNIQ_CASE'] = ' Χωρίς διάκριση πεζών-κεφαλαίων %1';
Blockly.Msg['UNIQ_OUTPUT_NON_REPEATED_LINES'] =
'Εμφάνιση μόνο μη επαναλαμβανόμενων γραμμών %1';
Blockly.Msg['UNIQ_OUTPUT_SINGLE_COPY_OF_REPEATED_LINES'] =
'Εμφάνιση μόνο ενός αντίγραφου των επαναλαμβανόμενων γραμμών %1';
Blockly.Msg['UNIQ_SKIP_CHARS'] =
'Παράλειψη των πρώτων %1 χαρακτήρων κάθε γραμμής';
Blockly.Msg['UNIQ_TOOLTIP'] =
'Αναφορά ή φιλτράρισμα επαναλαμβανόμενων γραμμών σε ένα αρχείο';
Blockly.Msg['UNIQ_HELPURL'] = 'https://www.google.com/';
Expand Down
13 changes: 9 additions & 4 deletions public/js/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Blockly.Msg['AWK_VARIABLE_INPUT'] = 'Variable input';
Blockly.Msg['AWK_BEGIN'] = 'Execute once before data is processed';
Blockly.Msg['AWK_ACTION'] = 'Action';
Blockly.Msg['AWK_END'] = 'Execute once after data is processed';
Blockly.Msg['AWK_PRINT'] = 'columns to print';
Blockly.Msg['AWK_PRINT'] = 'Columns to print';
Blockly.Msg['AWK_TOOLTIP'] =
'pattern-directed scanning and processing language';
Blockly.Msg['AWK_HELPURL'] = 'https://www.google.com/';
Expand Down Expand Up @@ -48,8 +48,8 @@ Blockly.Msg['CONDITION_OUTPUT_HELPURL'] = 'https://www.google.com/';
Blockly.Msg['CUT'] = 'Cut out in file or string';
Blockly.Msg['CUT_DELIMITER'] = 'Delimiter';
Blockly.Msg['CUT_DEFINE_COLUMNS'] = 'Define columns';
Blockly.Msg['CUT_START'] = 'substring start';
Blockly.Msg['CUT_END'] = 'end';
Blockly.Msg['CUT_START'] = 'Substring start : ';
Blockly.Msg['CUT_END'] = 'End : ';
Blockly.Msg['CUT_TOOLTIP'] =
'Cut out in a file or a string.\nFor consecutive cuts use comma(,) , for range cuts use hyphen (-)';
Blockly.Msg['CUT_HELPURL'] = 'https://www.google.com/';
Expand Down Expand Up @@ -124,7 +124,7 @@ Blockly.Msg['LS_MESSAGE'] = 'List files & directories';
Blockly.Msg['LS_SHOW_DETAILS'] = 'Show details %1';
Blockly.Msg['LS_SUBDIRECTORIES'] = 'Search in all subdirectories %1';
Blockly.Msg['LS_HIDDEN'] = 'Show hidden files %1';
Blockly.Msg['LS_REVERSE_ORDER'] = '%1 Show in reverse order';
Blockly.Msg['LS_REVERSE_ORDER'] = 'Show in reverse order %1';
Blockly.Msg['LS_TOOLTIP'] = 'List directory contents';
Blockly.Msg['LS_HELPURL'] = 'https://www.google.com/';
Blockly.Msg['LN_MESSAGE'] = 'Link files';
Expand Down Expand Up @@ -892,6 +892,11 @@ Blockly.Msg['UNIQ'] = 'Remove duplicate lines in file\n';
Blockly.Msg['UNIQ_COUNT'] =
'Count the occurencies of \n duplicates lines removed %1';
Blockly.Msg['UNIQ_CASE'] = 'Case sensitive %1';
Blockly.Msg['UNIQ_OUTPUT_NON_REPEATED_LINES'] =
'Output only non-repeated lines %1';
Blockly.Msg['UNIQ_OUTPUT_SINGLE_COPY_OF_REPEATED_LINES'] =
'Output only one copy of repeated lines %1';
Blockly.Msg['UNIQ_SKIP_CHARS'] = 'Skip first %1 characters of each line';
Blockly.Msg['UNIQ_TOOLTIP'] = 'Report or filter out repeated lines in a file';
Blockly.Msg['UNIQ_HELPURL'] = 'https://www.google.com/';

Expand Down
6 changes: 5 additions & 1 deletion public/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,11 @@ document
generatedCommand = replaceKeywords(generatedCommand);

// Combine the constructed UNIX command and filename
document.getElementById('resultsText').innerText = generatedCommand;
if (generatedCommand.length > 0) {
document.getElementById('resultsText').innerText = generatedCommand;
} else {
document.getElementById('resultsText').innerText = '\n'; // Insert a newline character if the command is empty so that the results area does not shrink
}

console.log('Generated command:', generatedCommand);
if (blockCount > 0) {
Expand Down
5 changes: 0 additions & 5 deletions views/register.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,6 @@
</div>
<input id="password" name="password" placeholder="Password" type="password" required class="validate" autocomplete="on">
</div>
<!-- Checkbox for data usage agreement -->
<div class="form-group" style="margin-top: 20px; text-align: center;">
<input type="checkbox" id="dataAgreement" name="dataAgreement" value="agree" required>
<label for="dataAgreement" style="font-size: 0.9em; margin-left: 5px;">I agree to allow my data to be used for research purposes</label>
</div>
<input type="submit" value="Register" />
</form>
<!-- Divider with text -->
Expand Down
2 changes: 1 addition & 1 deletion views/tutorials.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
<img src="img/blockly_photo.png" alt="Blockly Unix" class="img-fluid" style="width: 700px; height: auto;">
</div>
<p>
The corresponding Unix command for this task is: <strong>awk -F';' ' $3 == "empt" ' test.txt | sort -r -k2 | uniq -c | head -n 50 > newFile.txt</strong>
The corresponding Unix command for this task is: <strong>awk -F';' ' $3 == "empt" ' test.txt | sort -r -k 2 | uniq -c | head -n 50 > newFile.txt</strong>
</p>
</div>
</li>
Expand Down

0 comments on commit 8c2a3f9

Please sign in to comment.