Skip to content

Commit

Permalink
Clean up code
Browse files Browse the repository at this point in the history
  • Loading branch information
foivospro committed Oct 4, 2024
1 parent 4bec880 commit 8022fa1
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 57 deletions.
Binary file modified db/blockly_unix_database.db
Binary file not shown.
1 change: 0 additions & 1 deletion public/blocks/chmodBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,3 @@ var chmodBlock = {
};

Blockly.defineBlocksWithJsonArray([chmodBlock]);
//
1 change: 0 additions & 1 deletion public/blocks/chownBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,3 @@ var chownBlock = {
};

Blockly.defineBlocksWithJsonArray([chownBlock]);
//
24 changes: 12 additions & 12 deletions public/blocks/grepBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,55 +24,55 @@ var grepBlock = {
{
type: 'field_checkbox',
name: 'regex',
checked: false // by default it's disabled
checked: false
}
],
message2: '%{BKY_GREP_CASE_INSENSITIVE}',
args2: [
{
type: 'field_checkbox',
name: 'case_ins',
checked: false // by default it's disabled
checked: false
}
],
message3: '%{BKY_GREP_WHOLE_WORD_SEARCH}',
args3: [
{
type: 'field_checkbox',
name: 'whole_word',
checked: false // by default it's disabled
checked: false
}
],
message4: '%{BKY_GREP_COUNT_MATCHES}',
args4: [
{
type: 'field_checkbox',
name: 'count_lines',
checked: false // by default it's disabled
checked: false
}
],
message5: '%{BKY_GREP_PATTERN_NEGATION}',
args5: [
{
type: 'field_checkbox',
name: 'inverted',
checked: false // by default it's disabled
checked: false
}
],
message6: '%{BKY_GREP_RECURSIVE_SEARCH}',
args6: [
{
type: 'field_checkbox',
name: 'recursive',
checked: false // by default it's disabled
checked: false
}
],
message7: '%{BKY_GREP_DISPLAY_LINE_NUMBERS}',
args7: [
{
type: 'field_checkbox',
name: 'show_line_nums',
checked: false // by default it's disabled
checked: false
}
],
message8: '%{BKY_GREP_STOP_AFTER_NUM_MATCHES}',
Expand All @@ -88,15 +88,15 @@ var grepBlock = {
{
type: 'field_checkbox',
name: 'show_line_nums',
checked: false // by default it's disabled
checked: false
}
],
message10: '%{BKY_GREP_SHOW_FILENAME}',
args10: [
{
type: 'field_checkbox',
name: 'showFiles',
checked: false // by default it's disabled
checked: false
}
],
message11: '%{BKY_GREP_PATTERN_DEFINE}',
Expand All @@ -116,7 +116,7 @@ var grepBlock = {
},
{
type: 'field_checkbox',
checked: false // by default it's disabled
checked: false
}
],
message13: '%{BKY_GREP_PRINT_CONTEXT_AFTER_MATCH}',
Expand All @@ -128,14 +128,14 @@ var grepBlock = {
},
{
type: 'field_checkbox',
checked: false // by default it's disabled
checked: false
}
],
style: 'Text Processing',
previousStatement: 'Action',
nextStatement: 'Action',
tooltip: 'search in a file with a pattern',
helpUrl: '' // URL to further information or documentation.
helpUrl: ''
};

Blockly.defineBlocksWithJsonArray([grepBlock]);
6 changes: 3 additions & 3 deletions public/blocks/gzipBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var gzipBlock = {
{
type: 'field_checkbox',
name: 'keep',
checked: true // by default it's disabled
checked: true
}
],
message2: '%{BKY_GZIP_LEVEL_OF_COMPRESSION}',
Expand All @@ -59,15 +59,15 @@ var gzipBlock = {
{
type: 'field_input',
name: 'suffix',
text: '' // empty text for user to define path
text: ''
}
],
style: 'Other Commands',
extensions: ['integer_validation'],
previousStatement: 'Action',
nextStatement: 'Action',
tooltip: '%{BKY_GZIP_TOOLTIP}',
helpUrl: '' // URL to further information or documentation.
helpUrl: ''
};

Blockly.defineBlocksWithJsonArray([gzipBlock]);
Empty file removed public/blocks/journalBlock.js
Empty file.
1 change: 0 additions & 1 deletion public/blocks/killBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ var killBlock = {
};

Blockly.defineBlocksWithJsonArray([killBlock]);
//
24 changes: 1 addition & 23 deletions public/blocks/touchBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,29 +58,7 @@ var touchBlock = {
extensions: ['validate_touch_time_d', 'restrict_touch_to_argumentsCreate'],
style: 'Filesystem Operations',
tooltip: '%{BKY_TOUCH_TOOLTIP}',
helpUrl: '%{BKY_TOUCH_HELPURL}', // URL to further information or documentation.
generateCommand: function (block) {
let touchCommand = 'touch'; // Start with the basic touch command

// Check each option and append to the command if selected
const notCreateFile = block.getFieldValue('not_create_file') === 'TRUE';
const changeAccessTime = block.getFieldValue('access_time') === 'TRUE';
const changeModificationTime =
block.getFieldValue('modification_time') === 'TRUE';
const rawTimestamp = block.getFieldValue('change_time_d');
const argumentBlock = block.getInputTargetBlock('argument');

if (notCreateFile) touchCommand += ' -c';
if (changeAccessTime) touchCommand += ' -a';
if (changeModificationTime) touchCommand += ' -m';
if (rawTimestamp) {
const formattedTimestamp = rawTimestamp.replace(' ', 'T');
touchCommand += ` -d ${formattedTimestamp}`;
}
generatedCommand =
touchCommand + ' ' + handleArgumentsBlocks(argumentBlock);
return generatedCommand;
}
helpUrl: '%{BKY_TOUCH_HELPURL}' // URL to further information or documentation.
};

Blockly.defineBlocksWithJsonArray([touchBlock]);
Expand Down
12 changes: 0 additions & 12 deletions public/css/homePage.css
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,6 @@ body {
font-family: 'Roboto', Arial, sans-serif;
}

.d-flex {
display: flex;
}

.flex-column {
flex-direction: column;
}

.min-vh-100 {
min-height: 100vh;
}

.flex-fill {
flex: 1;
}
Expand Down
4 changes: 0 additions & 4 deletions public/css/login.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

/* General styling */
body {
margin: 0;
padding: 0;
font-family: 'Raleway', sans-serif;
color: #fff;
background-color: #f2f2f2;
}

/* Animations for smooth transitions */
Expand Down

0 comments on commit 8022fa1

Please sign in to comment.