From c78e271d90a0f5e7db3a82b15ea7fcb7b643f7b9 Mon Sep 17 00:00:00 2001 From: foiv Date: Sat, 12 Oct 2024 10:00:42 +0300 Subject: [PATCH] Rebrading to Ublocks --- .gitignore | 3 +- bin/pre-commit | 102 ++++++++++++++++---------------- db/blockly_unix_database.db | Bin 245760 -> 299008 bytes public/blocks/findBlock.js | 4 +- public/blocks/grepBlock.js | 2 +- public/blocks/regAnyOneBlock.js | 10 ++-- public/js/block.js | 16 ++--- views/homePage.ejs | 49 ++++++++------- 8 files changed, 97 insertions(+), 89 deletions(-) mode change 100755 => 100644 bin/pre-commit diff --git a/.gitignore b/.gitignore index 8bb97eb..1edd27c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ node_modules .DS_Store npm-debug.log .env -.history \ No newline at end of file +.history +bin/pre-commit diff --git a/bin/pre-commit b/bin/pre-commit old mode 100755 new mode 100644 index 26980b7..00797b1 --- a/bin/pre-commit +++ b/bin/pre-commit @@ -1,52 +1,52 @@ -#!/bin/sh - -# Run npm run check to perform checks before committing -npm run format-check - -# If npm run check fails (returns non-zero exit code), exit with error -if [ $? -ne 0 ]; then - echo "npm run check failed, aborting commit." - echo "Run 'npm run prettier-fix' to fix formatting issues." - exit 1 -fi - -if git rev-parse --verify HEAD >/dev/null 2>&1 -then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=$(git hash-object -t tree /dev/null) -fi - -# If you want to allow non-ASCII filenames set this variable to true. -allownonascii=$(git config --type=bool hooks.allownonascii) - -# Redirect output to stderr. -exec 1>&2 - -# Cross platform projects tend to avoid non-ASCII filenames; prevent -# them from being added to the repository. We exploit the fact that the -# printable range starts at the space character and ends with tilde. -if [ "$allownonascii" != "true" ] && - # Note that the use of brackets around a tr range is ok here, (it's - # even required, for portability to Solaris 10's /usr/bin/tr), since - # the square bracket bytes happen to fall in the designated range. - test $(git diff --cached --name-only --diff-filter=A -z $against | - LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 -then - cat <<\EOF -Error: Attempt to add a non-ASCII file name. - -This can cause problems if you want to work with people on other platforms. - -To be portable it is advisable to rename the file. - -If you know what you are doing you can disable this check using: - - git config hooks.allownonascii true -EOF - exit 1 -fi - -# If there are whitespace errors, print the offending file names and fail. +#!/bin/sh + +# Run npm run check to perform checks before committing +npm run format-check + +# If npm run check fails (returns non-zero exit code), exit with error +if [ $? -ne 0 ]; then + echo "npm run check failed, aborting commit." + echo "Run 'npm run prettier-fix' to fix formatting issues." + exit 1 +fi + +if git rev-parse --verify HEAD >/dev/null 2>&1 +then + against=HEAD +else + # Initial commit: diff against an empty tree object + against=$(git hash-object -t tree /dev/null) +fi + +# If you want to allow non-ASCII filenames set this variable to true. +allownonascii=$(git config --type=bool hooks.allownonascii) + +# Redirect output to stderr. +exec 1>&2 + +# Cross platform projects tend to avoid non-ASCII filenames; prevent +# them from being added to the repository. We exploit the fact that the +# printable range starts at the space character and ends with tilde. +if [ "$allownonascii" != "true" ] && + # Note that the use of brackets around a tr range is ok here, (it's + # even required, for portability to Solaris 10's /usr/bin/tr), since + # the square bracket bytes happen to fall in the designated range. + test $(git diff --cached --name-only --diff-filter=A -z $against | + LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 +then + cat <<\EOF +Error: Attempt to add a non-ASCII file name. + +This can cause problems if you want to work with people on other platforms. + +To be portable it is advisable to rename the file. + +If you know what you are doing you can disable this check using: + + git config hooks.allownonascii true +EOF + exit 1 +fi + +# If there are whitespace errors, print the offending file names and fail. exec git diff-index --check --cached $against -- \ No newline at end of file diff --git a/db/blockly_unix_database.db b/db/blockly_unix_database.db index 22a2269f2a1183142f90df1755b54b4645561fe2..13760eb11ffe82e9a1d2a7bd3235d364009c3e31 100644 GIT binary patch delta 15461 zcmeHOX>c3odEQ+TyeUc~NFAgO9F%wyd*E6M0>Kj?3EnqN5&%z-1c;0GF~W+H+(wbh zuH|oFOT0DfcrT?9er4ud@T}!V;aS5C!n2y|gl84k1kXy&0?!Jr z0-h$W44&m215YDY1kV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ci;)iIDH!#uU(he`yc1^aC_U`eHIS1&! zeck>MH{Bjw#WPSj1Ad1qDZ8?USDZ0%e8R0gW(Hwy1?HkiaT)hbEcF9e#!bbuk_6%- z?3?Ss>j_XKMt2m6oIQ#Zjn+G3!klIwsuUBNE0u5~2L=GHypv#o;R6Jq(gA>>9RN=3 z?gD=OUyh2LazE@(idP352PRzwy4$~8>EWUcJ1U$d(00FnIKmz} zoS4v~DRJwDy@sX!WAg7OPQ>dZam0t%YwN*lLSnjhSZ1%p)S~bA;+ed0{8O|KaUoox z)`I-0=;d#(hxbXoaDihoYWe$Jm_p~Q5^mza0Knxsp)NQN3;^6p7cNncA0Plyh{3Th z9l&vs>_c-B|5+j?aUz_a8^IS6g}n4cjcK3r61HPPR7@X~e7HFy-0*UL+47S`mq1-o GtNtG&D3$F1 delta 99 zcmZozAk@&nKS7!`nSp`9W}<>UWAes?0)Ixn%@_TR1vo_cdw}8$T9bJKv^EP0I52H5 zV`3EJZSKi$@5yJ}-jmN%p&-D<7RbQ+gC~M(2d4yk1zR9cp)Ff`;54S~fzz1RYXSf; CJR2GS diff --git a/public/blocks/findBlock.js b/public/blocks/findBlock.js index 0f0f487..287f3c2 100644 --- a/public/blocks/findBlock.js +++ b/public/blocks/findBlock.js @@ -22,7 +22,7 @@ var findBlock = { subdirs: '-maxdepth 1', file: '-type f', directory: '-type d', - regPattern: '"patt"', + Pattern: '-regex "str"', both: '' } ], @@ -151,7 +151,7 @@ var findBlock = { args9: [ { type: 'input_statement', - name: 'regPattern', + name: 'Pattern', check: 'String' } ], diff --git a/public/blocks/grepBlock.js b/public/blocks/grepBlock.js index 046a319..181ffb4 100644 --- a/public/blocks/grepBlock.js +++ b/public/blocks/grepBlock.js @@ -12,7 +12,7 @@ var grepBlock = { show_line_nums: '-n', stop_after_num_matches: '-m ', multiple_patterns: '-e', - regPattern: '"patt"', + regPattern: "-E 'patt'", showFiles: '-H', print_context_before_match: '-B ', print_context_after_match: '-A ' diff --git a/public/blocks/regAnyOneBlock.js b/public/blocks/regAnyOneBlock.js index 60bf4bd..73316ba 100644 --- a/public/blocks/regAnyOneBlock.js +++ b/public/blocks/regAnyOneBlock.js @@ -3,17 +3,17 @@ var regAnyOneBlock = { category: 'Regular Expressions', unix_description: [ { - regPattern: '[stm]', - notMatch: '[^stm]' + Pattern: '[patt]', + notMatch: '[^patt]' } ], message0: '%{BKY_REGANYONE} \n %{BKY_REGANYONE_NOT}', args0: [ { - type: 'input_statement', - name: 'regPattern', - check: 'String' + type: 'field_input', + name: 'Pattern', + text: 'String' }, { diff --git a/public/js/block.js b/public/js/block.js index a664ed2..c0fc0ae 100644 --- a/public/js/block.js +++ b/public/js/block.js @@ -197,14 +197,17 @@ function handleMainBlocks( field.getValue() ); } else if (field instanceof Blockly.FieldNumber) { - value = + if ( blockDefinition.unix_description[0][field.name] == null && field.getValue() != 0 - ? field.getValue() - : field.getValue() == 0 - ? '' - : blockDefinition.unix_description[0][field.name] + - field.getValue(); + ) { + value = field.getValue(); + } else if (field.getValue() == 0) { + value = ''; + } else { + value = + blockDefinition.unix_description[0][field.name] + field.getValue(); + } } else if (input.type === Blockly.INPUT_VALUE) { if ( block.getInputTargetBlock(input.name) && @@ -232,7 +235,6 @@ function handleMainBlocks( inputValueStr = getMultiplePrints(inputBlock); if (inputValueStr !== '' && inputValue == null) { inputValue = inputValueStr; - //console.log("handleMainBlocks - after inputValue:", inputValue); } value = diff --git a/views/homePage.ejs b/views/homePage.ejs index f77735c..1479834 100644 --- a/views/homePage.ejs +++ b/views/homePage.ejs @@ -3,7 +3,7 @@ - Blockly Unix + Ublocks @@ -50,7 +50,7 @@

- Blockly Unix + Ublocks
-

Blockly for Unix in Web

+

Ublocks: Blockly for Unix in Web

  • Lightweight and efficient
  • Compatible with all major browsers
  • -
  • Blockly for Unix is nearly 100% client-side
  • +
  • Ublocks is nearly 100% client-side
@@ -138,7 +138,7 @@
-

Create Your Unix Pipelines with Blockly Unix

+

Create Your Unix Pipelines with Ublocks

Creating Unix pipelines has never been easier!

@@ -157,9 +157,9 @@
-

Why Blockly Unix

+

Why Ublocks


-

Blockly Unix is the perfect starting point for those looking to learn Unix. It combines the power of Unix tools with an intuitive, block-based interface, making it easier than ever to grasp the fundamentals of Unix while building real-world data processing pipelines.

+

Ublocks is the perfect starting point for those looking to learn Unix. It combines the power of Unix tools with an intuitive, block-based interface, making it easier than ever to grasp the fundamentals of Unix while building real-world data processing pipelines.



@@ -188,7 +188,7 @@
Lorem Ipsum

Cross-platform

-

Blockly for Unix provides cross-platform support, allowing users to create and execute commands across different operating systems without limitations.

+

Ublocks provides cross-platform support, allowing users to create and execute commands across different operating systems without limitations.

@@ -197,7 +197,7 @@
Lorem Ipsum

Visual interface

-

Blockly for Unix offers a visual interface, enabling users to build and execute commands easily without the need for complex scripting.

+

Ublocks offers a visual interface, enabling users to build and execute commands easily without the need for complex scripting.

@@ -219,7 +219,7 @@

- Whether you are a student, educator, or professional interested in learning Unix, Blockly Unix offers an intuitive, block-based approach to mastering Unix fundamentals. + Whether you are a student, educator, or professional interested in learning Unix, Ublocks offers an intuitive, block-based approach to mastering Unix fundamentals.

@@ -258,13 +258,13 @@
@@ -275,7 +275,7 @@

Links

@@ -297,7 +297,7 @@
@@ -308,10 +308,10 @@
- Designed by BootstrapMade | Powered by GitHub + Designed by AUEB-BALab
@@ -321,18 +321,23 @@