Skip to content

Commit

Permalink
Rebrading to Ublocks
Browse files Browse the repository at this point in the history
  • Loading branch information
foivospro committed Oct 12, 2024
1 parent 4074225 commit c78e271
Show file tree
Hide file tree
Showing 8 changed files with 97 additions and 89 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ node_modules
.DS_Store
npm-debug.log
.env
.history
.history
bin/pre-commit
102 changes: 51 additions & 51 deletions bin/pre-commit
100755 → 100644
Original file line number Diff line number Diff line change
@@ -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 --
Binary file modified db/blockly_unix_database.db
Binary file not shown.
4 changes: 2 additions & 2 deletions public/blocks/findBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var findBlock = {
subdirs: '-maxdepth 1',
file: '-type f',
directory: '-type d',
regPattern: '"patt"',
Pattern: '-regex "str"',
both: ''
}
],
Expand Down Expand Up @@ -151,7 +151,7 @@ var findBlock = {
args9: [
{
type: 'input_statement',
name: 'regPattern',
name: 'Pattern',
check: 'String'
}
],
Expand Down
2 changes: 1 addition & 1 deletion public/blocks/grepBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 '
Expand Down
10 changes: 5 additions & 5 deletions public/blocks/regAnyOneBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
},

{
Expand Down
16 changes: 9 additions & 7 deletions public/js/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) &&
Expand Down Expand Up @@ -232,7 +235,6 @@ function handleMainBlocks(
inputValueStr = getMultiplePrints(inputBlock);
if (inputValueStr !== '' && inputValue == null) {
inputValue = inputValueStr;
//console.log("handleMainBlocks - after inputValue:", inputValue);
}

value =
Expand Down
49 changes: 27 additions & 22 deletions views/homePage.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Blockly Unix</title>
<title>Ublocks</title>
<!-- Link to Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
Expand Down Expand Up @@ -50,7 +50,7 @@
<div class="container-fluid">
<span class="navbar-brand d-flex align-items-center">
<img src="img/blockly_72.png" alt="" class="me-2">
<a class="navbar-brand" href="/">Blockly Unix</a>
<a class="navbar-brand" href="/">Ublocks</a>
</span>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
Expand All @@ -61,7 +61,7 @@
<a class="nav-link active" aria-current="page" href="/">Home</a>
</li>
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="/blockly_unix">Blockly</a>
<a class="nav-link active" aria-current="page" href="/blockly_unix">Ublocks</a>
</li>
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="/tutorials">Tutorials</a>
Expand Down Expand Up @@ -115,14 +115,14 @@
</div>
<div class="col-lg-6 d-flex flex-column justify-contents-center" data-aos="fade-left">
<div class="content pt-6 pt-lg-4">
<h3>Blockly for Unix in Web</h3>
<h3>Ublocks: Blockly for Unix in Web</h3>
<p class="fst-italic">

</p>
<ul>
<li><i class="bi bi-check-circle"></i> Lightweight and efficient</li>
<li><i class="bi bi-check-circle"></i> Compatible with all major browsers</li>
<li><i class="bi bi-check-circle"></i> Blockly for Unix is nearly 100% client-side</li>
<li><i class="bi bi-check-circle"></i> Ublocks is nearly 100% client-side</li>
</ul>
</div>
</div>
Expand All @@ -138,7 +138,7 @@

<div class="text-center">
<div class="text-center">
<h1 >Create Your Unix Pipelines with Blockly Unix</h1>
<h1 >Create Your Unix Pipelines with Ublocks</h1>
<p class="lead">Creating Unix pipelines has never been easier!</p>
</div>
<!-- Image Container -->
Expand All @@ -157,9 +157,9 @@
<div class="container">

<div class="section-title text-center" data-aos="fade-up">
<h1>Why Blockly Unix</h1>
<h1>Why Ublocks</h1>
<br>
<p>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.</p>
<p>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.</p>
</div>
<br>
<br>
Expand Down Expand Up @@ -188,7 +188,7 @@
<div class="icon"><i class="bx bx-tachometer"></i></div>
<img src="https://developers.google.com/static/blockly/images/icons/cross-platform.png" alt="Lorem Ipsum" style="width: 50px; height: 50px;"/>
<h4 class="title"><a href="">Cross-platform</a></h4>
<p class="description">Blockly for Unix provides cross-platform support, allowing users to create and execute commands across different operating systems without limitations.</p>
<p class="description">Ublocks provides cross-platform support, allowing users to create and execute commands across different operating systems without limitations.</p>
</div>
</div>

Expand All @@ -197,7 +197,7 @@
<div class="icon"><i class="bx bx-world"></i></div>
<img src="https://developers.google.com/static/blockly/images/icons/codelabs.svg" alt="Lorem Ipsum" style="width: 50px; height: 50px;"/>
<h4 class="title"><a href="">Visual interface</a></h4>
<p class="description">Blockly for Unix offers a visual interface, enabling users to build and execute commands easily without the need for complex scripting.</p>
<p class="description">Ublocks offers a visual interface, enabling users to build and execute commands easily without the need for complex scripting.</p>
</div>
</div>
</div>
Expand All @@ -219,7 +219,7 @@
<i class="bi bi-chevron-down icon-show"></i><i class="bi bi-chevron-up icon-close"></i></a>
<div id="faq1" class="collapse" data-bs-parent=".faq-list">
<p>
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.
</p>
</div>
</li>
Expand Down Expand Up @@ -258,13 +258,13 @@
<!-- About Section -->
<div class="col-lg-3 col-md-6 mb-4">
<div class="footer-info">
<h3>Blockly Unix</h3>
<h3>Ublocks</h3>
<p>
An open-source project designed to make learning Unix easy and accessible through block-based coding.
</p>
<p>
<strong>Location:</strong> 76 Patision Street, Athens<br>
<strong>Email:</strong> <a href="mailto:blocklyunix@aueb.gr">@aueb.gr</a><br>
<strong>Email:</strong> <a href="mailto:ublocks.balab.aueb.gr">ublocks.balab.aueb.gr</a><br>
</p>
</div>
</div>
Expand All @@ -275,7 +275,7 @@
<h4>Links</h4>
<ul>
<li><i class="bx bx-chevron-right"></i> <a href="#">Home</a></li>
<li><i class="bx bx-chevron-right"></i> <a href="/index.html">Blockly Unix</a></li>
<li><i class="bx bx-chevron-right"></i> <a href="/index.html">Ublocks</a></li>
<li><i class="bx bx-chevron-right"></i> <a href="/tutorials">Tutorials</a></li>
</ul>
</div>
Expand All @@ -297,7 +297,7 @@
<div class="col-lg-3 col-md-6 mb-4">
<div class="footer-newsletter">
<h4><i class="bx bxl-github"></i> Contribute on GitHub</h4>
<p>Blockly Unix is an open-source project. Visit our <a href="https://github.com/AUEB-BALab/blockly_unix">GitHub repository</a> to explore the source code, report issues, and contribute to the project.</p>
<p>Ublocks is an open-source project. Visit our <a href="https://github.com/AUEB-BALab/blockly_unix">GitHub repository</a> to explore the source code, report issues, and contribute to the project.</p>
<a href="https://github.com/AUEB-BALab/blockly_unix" class="btn btn-outline-primary">Visit GitHub</a>
</div>
</div>
Expand All @@ -308,10 +308,10 @@

<div class="container text-center">
<div class="copyright">
&copy; <strong>Blockly Unix</strong>. All Rights Reserved
&copy; <strong>Ublocks</strong>. All Rights Reserved
</div>
<div class="credits">
Designed by <a href="https://bootstrapmade.com/">BootstrapMade</a> | Powered by GitHub
Designed by <a href="https://www.balab.aueb.gr/">AUEB-BALab</a>
</div>
</div>
</footer><!-- End Footer -->
Expand All @@ -321,18 +321,23 @@
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="creatorsModalLabel">Creators of Blockly Unix</h5>
<h5 class="modal-title" id="creatorsModalLabel">Creators of Ublocks</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p>This project was developed by students and researchers at the Business Analytics Lab of the Athens University of Economics and Business (AUEB). Its aim is to offer an interactive and educational tool designed to teach Unix through block-based coding, making learning more accessible and engaging for users of all levels.</p>
<p>Team Members:</p>

<p><strong>Scientific Supervisor:</strong></p>
<ul>
<li>Diomidis Spinellis - Professor</li>
</ul>

<p><strong>Developers:</strong></p>
<ul>
<li><a href="https://github.com/simosathan9" target="_blank">Athanasiadis Simos - Undergraduate student</a></li>
<li><a href="https://github.com/vcipi" target="_blank">Cipi Klenti - Graduate student</a></li>
<li><a href="https://github.com/Pantelis325" target="_blank">Kakavas Pantelis - Graduate student</a></li>
<li><a href="https://github.com/foivospro" target="_blank">Proestakis Foivos - Undergraduate student</a></li>

</ul>
</div>
<div class="modal-footer">
Expand All @@ -351,9 +356,9 @@
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p>By using Blockly Unix, you agree that the data generated in the workspace through the use of blocks will be utilized for academic research and the improvement of the application. All data collected will be anonymized and strictly used for educational, development, and research purposes.</p>
<p>By using Ublocks, you agree that the data generated in the workspace through the use of blocks will be utilized for academic research and the improvement of the application. All data collected will be anonymized and strictly used for educational, development, and research purposes.</p>
<p>This data helps us enhance the user experience and contribute to academic studies focused on the development of educational tools.</p>
<p>For further information regarding data privacy, please contact us at <a href="mailto:blocklyunix@aueb.gr">@aueb.gr</a>.</p>
<p>For further information regarding data privacy, please contact us at <a href="mailto:ublocks.balab.aueb.gr">ublocks.balab.aueb.gr</a>.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
Expand Down

0 comments on commit c78e271

Please sign in to comment.