Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,9 @@
Results will appear here...
</div>

<button id="copyButton" class="btn btn-light">
<button id="copyButton" class="btn btn-light" onclick="showCopiedMessage()">
<i class="fas fa-copy"></i>
<span id="copiedMsg" style="display: none; color: green; margin-left: 10px;">Copied!</span>
</button>
</div>
</div>
Expand Down Expand Up @@ -756,6 +757,16 @@
const crossTabCopyPaste = new CrossTabCopyPaste();
crossTabCopyPaste.init(crossTabCopyPasteOptions, () => {});

// show "Copied!" message when result is copied
function showCopiedMessage() {
const msg = document.getElementById("copiedMsg");
msg.style.display = "inline";

setTimeout(() => {
msg.style.display = "none";
}, 1500);
}

// Optional: Remove the duplication command from Blockly's context menu
Blockly.ContextMenuRegistry.registry.unregister('blockDuplicate');

Expand Down
2 changes: 1 addition & 1 deletion public/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ function saveWorkspaceLocally() {
* Copies the generated command text to the clipboard.
*/
function copyToClipboard() {
const text = document.getElementById('resultsArea').innerText;
const text = document.getElementById('resultsText').innerText;
navigator.clipboard.writeText(text).catch((err) => {
console.error('Unable to copy:', err);
alert('Failed to copy text.');
Expand Down
2 changes: 1 addition & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ app.post(
],
function (err) {
if (err) {
req.flash('error', 'Registration failed.');
req.flash('error', 'Username and/or Email already in use.');
return res.redirect('/register');
}
req.logIn(newUser, (err) => {
Expand Down
2 changes: 1 addition & 1 deletion views/homePage.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,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">Ublocks</a></li>
<li><i class="bx bx-chevron-right"></i> <a href="/blockly_unix">Ublocks</a></li>
<li><i class="bx bx-chevron-right"></i> <a href="/tutorials">Tutorials</a></li>
</ul>
</div>
Expand Down
Loading