Skip to content

Commit 38d36d2

Browse files
authored
Merge pull request #34 from GeorgeKarandreas/georkarandreas-branch
Minor website tweaks
2 parents 12dcad7 + 89b4ae0 commit 38d36d2

File tree

4 files changed

+23
-4
lines changed

4 files changed

+23
-4
lines changed

index.html

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,17 @@
287287
Results will appear here...
288288
</div>
289289

290-
<button id="copyButton" class="btn btn-light">
290+
<button
291+
id="copyButton"
292+
class="btn btn-light"
293+
onclick="showCopiedMessage()"
294+
>
291295
<i class="fas fa-copy"></i>
296+
<span
297+
id="copiedMsg"
298+
style="display: none; color: green; margin-left: 10px"
299+
>Copied!</span
300+
>
292301
</button>
293302
</div>
294303
</div>
@@ -756,6 +765,16 @@
756765
const crossTabCopyPaste = new CrossTabCopyPaste();
757766
crossTabCopyPaste.init(crossTabCopyPasteOptions, () => {});
758767

768+
// show "Copied!" message when result is copied
769+
function showCopiedMessage() {
770+
const msg = document.getElementById('copiedMsg');
771+
msg.style.display = 'inline';
772+
773+
setTimeout(() => {
774+
msg.style.display = 'none';
775+
}, 1500);
776+
}
777+
759778
// Optional: Remove the duplication command from Blockly's context menu
760779
Blockly.ContextMenuRegistry.registry.unregister('blockDuplicate');
761780

public/js/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ function saveWorkspaceLocally() {
426426
* Copies the generated command text to the clipboard.
427427
*/
428428
function copyToClipboard() {
429-
const text = document.getElementById('resultsArea').innerText;
429+
const text = document.getElementById('resultsText').innerText;
430430
navigator.clipboard.writeText(text).catch((err) => {
431431
console.error('Unable to copy:', err);
432432
alert('Failed to copy text.');

server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ app.post(
199199
],
200200
function (err) {
201201
if (err) {
202-
req.flash('error', 'Registration failed.');
202+
req.flash('error', 'Username and/or Email already in use.');
203203
return res.redirect('/register');
204204
}
205205
req.logIn(newUser, (err) => {

views/homePage.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@
352352
<h4>Links</h4>
353353
<ul>
354354
<li><i class="bx bx-chevron-right"></i> <a href="#">Home</a></li>
355-
<li><i class="bx bx-chevron-right"></i> <a href="/index.html">Ublocks</a></li>
355+
<li><i class="bx bx-chevron-right"></i> <a href="/blockly_unix">Ublocks</a></li>
356356
<li><i class="bx bx-chevron-right"></i> <a href="/tutorials">Tutorials</a></li>
357357
</ul>
358358
</div>

0 commit comments

Comments
 (0)