Bitcoin Forum
May 31, 2026, 01:11:11 AM *
News: Latest Bitcoin Core release: 31.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Why is it impossible to Undo (CTRL+Z) Smiley and Bulletin board codes?  (Read 222 times)
logfiles (OP)
Copper Member
Legendary
*
Offline

Activity: 2730
Merit: 2290



View Profile WWW
May 19, 2025, 04:17:12 PM
Merited by dkbit98 (3), PowerGlove (3), ABCbits (1)
 #1

This has got me scratching my bald head for a while now  Grin
Why is it not possible to undo smiley or BB codes that one may have clicked on accidentally in a post they are trying to create? With CTRL+Z It's sort of convenient, you know, especially if you have been used to typing in different sorts of apps on PC.

Was the undo (CTRL+Z) option disabled on purpose? Or can our script guy (PowerGlove) make some patch?  Smiley


▄▄████████████████████▄▄
▄███████▀▀██████▀▀███████▄
████████████████████████
████████▄▄██████▄▄██████

████████████████████████
██▄▄█████████████▄▄██████
██▀▀██████████████████▄▄██
██████▀▀██████████████▀▀██
██████████████████████████
██████▀▀██████▀▀████████
████████████████████████
▀███████▄▄██████▄▄███████▀
▀▀████████████████████▀▀
 
 DΞX.fo 
▄▄██████
█████████
██████████
█████████
██████████
█████████
▀▀██████

▄███████
▄██████████
████████████
█████████████
█████████████
|
▄▄█
▄████▀
▄███▀
▄██▀▄██
█████▀▀
███████
████████
▀██▄████
▄████▄▄
▄█████▀███
▄█████▀████
█████▀███████
▀██▀█████████
|  BTC     XMR  
  DAI     LTC  
   Fees  0.8%    
Fortify
Legendary
*
Offline

Activity: 3416
Merit: 1270



View Profile WWW
May 19, 2025, 08:05:25 PM
 #2

This has got me scratching my bald head for a while now  Grin
Why is it not possible to undo smiley or BB codes that one may have clicked on accidentally in a post they are trying to create? With CTRL+Z It's sort of convenient, you know, especially if you have been used to typing in different sorts of apps on PC.

Was the undo (CTRL+Z) option disabled on purpose? Or can our script guy (PowerGlove) make some patch?  Smiley

If you think about it slightly differently.. what's wrong with just hitting the back space key? That's actually less effort than having to hit two separate keys and achieves the same result. While it is minuscule and can likely be cached by browser software, it's better to have as little code as possible on a website in order to minimize the bandwidth usage across all the views per day. It also has the potential to introduce a new attack vector - however small the possibility may be, so better to leave it for truly essential requirements and reduce the surface area for bugs to hide in.

▄▄███████████████████▄▄
▄███████████████████████▄
████████████████████████
█████████████████████████
████████████████████████
████████████▀██████▀████
████████████████████████
█████████▄▄▄▄███████████
██████████▄▄▄████████████
████████████████████████
████████████████▀▀███████
▀███████████████████████▀
▀▀███████████████████▀▀
 
 EARNBET 
██
██
██
██
██
██
██
██
██
██
██
██
██
███████▄▄███████████
████▄██████████████████
██▀▀███████████████▀▀███
▄████████████████████████
▄▄████████▀▀▀▀▀████████▄▄██
███████████████████████████
█████████▌██▀████████████
███████████████████████████
▀▀███████▄▄▄▄▄█████████▀▀██
▀█████████████████████▀██
██▄▄███████████████▄▄███
████▀██████████████████
███████▀▀███████████
██
██
██
██
██
██
██
██
██
██
██
██
██


▄▄▄
▄▄▄███████▐███▌███████▄▄▄
█████████████████████████
▀████▄▄▄███████▄▄▄████▀
█████████████████████
▐███████████████████▌
███████████████████
███████████████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

 King of The Castle 
 $200,000 in prizes
██
██
██
██
██
██
██
██
██
██
██
██
██

 62.5% 

 
RAKEBACK
BONUS
BitcoinGirl.Club
Legendary
*
Offline

Activity: 3276
Merit: 2843


The voice of the community w/o a gang


View Profile WWW
May 19, 2025, 08:09:15 PM
 #3

This has got me scratching my bald head for a while now  Grin
Why is it not possible to undo smiley or BB codes that one may have clicked on accidentally in a post they are trying to create? With CTRL+Z It's sort of convenient, you know, especially if you have been used to typing in different sorts of apps on PC.

Was the undo (CTRL+Z) option disabled on purpose? Or can our script guy (PowerGlove) make some patch?  Smiley
Interesting that someone decided to ask about it LOL. It's sometimes very painful.
I will assume it's a default setting with SMF software. You will experience it with any other forum that has SMF running. Looks like you just challenged PowerGlove 😂

.
 SHIT HAPPENS - just gotta DUST IT OFF, SPARK A LITTLE JOKE, and keep it steppin’ 
Ambatman
Legendary
*
Offline

Activity: 1022
Merit: 1323


Don't tell anyone


View Profile WWW
May 19, 2025, 08:40:02 PM
 #4

This is common in SMF software as stated by Bitcoingirl.club.
The core editor remains basic, with Ctrl+Z typically only undoing text input, not UI-driven actions like inserting smileys or BBCode tags.

Quote
Was the undo (CTRL+Z) option disabled on purpose?
No, It's the default of the forum software.
Quote
Or can our script guy (PowerGlove) make some patch
Yes he can but I don't believe is worth the work(could be wrong) .
An extension would be better in my opinion

███████████████████████████
███████▄████████████▄██████
████████▄████████▄████████
███▀█████▀▄███▄▀█████▀███
█████▀█▀▄██▀▀▀██▄▀█▀█████
███████▄███████████▄███████
███████████████████████████
███████▀███████████▀███████
████▄██▄▀██▄▄▄██▀▄██▄████
████▄████▄▀███▀▄████▄████
██▄███▀▀█▀██████▀█▀███▄███
██▀█▀████████████████▀█▀███
███████████████████████████
.
.Duelbits PREDICT..
█████████████████████████
█████████████████████████
███████████▀▀░░░░▀▀██████
██████████░░▄████▄░░████
█████████░░████████░░████
█████████░░████████░░████
█████████▄▀██████▀▄████
████████▀▀░░░▀▀▀▀░░▄█████
██████▀░░░░██▄▄▄▄████████
████▀░░░░▄███████████████
█████▄▄█████████████████
█████████████████████████
█████████████████████████
.
.WHERE EVERYTHING IS A MARKET..
█████
██
██







██
██
██████
Will Bitcoin hit $200,000
before January 1st 2027?

    No @1.15         Yes @6.00    
█████
██
██







██
██
██████

  CHECK MORE > 
Vod
Legendary
*
Offline

Activity: 4452
Merit: 3675


Licking my boob since 1970


View Profile WWW
May 19, 2025, 10:07:03 PM
 #5

An extension would be better in my opinion

What do you mean by extension?  Don't count on the forum software itself to be modified, and I doubt you'll find a ready made add-on that works with the custom upgrades here.

I've learned a lot about event handling recently, but I think this software is too old for that.  I'm sure PG could disable the CTRL-Z restriction in just a few lines once he verifies it doesn't affect any background processes.

███████████████████████████
███████▄████████████▄██████
████████▄████████▄████████
███▀█████▀▄███▄▀█████▀███
█████▀█▀▄██▀▀▀██▄▀█▀█████
███████▄███████████▄███████
███████████████████████████
███████▀███████████▀███████
████▄██▄▀██▄▄▄██▀▄██▄████
████▄████▄▀███▀▄████▄████
██▄███▀▀█▀██████▀█▀███▄███
██▀█▀████████████████▀█▀███
███████████████████████████
.
.Duelbits PREDICT..
█████████████████████████
█████████████████████████
███████████▀▀░░░░▀▀██████
██████████░░▄████▄░░████
█████████░░████████░░████
█████████░░████████░░████
█████████▄▀██████▀▄████
████████▀▀░░░▀▀▀▀░░▄█████
██████▀░░░░██▄▄▄▄████████
████▀░░░░▄███████████████
█████▄▄█████████████████
█████████████████████████
█████████████████████████
.
.WHERE EVERYTHING IS A MARKET..
█████
██
██







██
██
██████
Will Bitcoin hit $200,000
before January 1st 2027?

    No @1.15         Yes @6.00    
█████
██
██







██
██
██████

  CHECK MORE > 
Perfectbaby
Hero Member
*****
Offline

Activity: 1036
Merit: 626


Spinly.io - Next-gen Crypto iGaming Platform


View Profile WWW
May 20, 2025, 10:34:14 PM
 #6

Was the undo (CTRL+Z) option disabled on purpose? Or can our script guy (PowerGlove) make some patch?  Smiley
I don't think this should keep making you still scratch your bald head, like last I used PC I mistakenly select a text on this environment and all what did lost I had to go and use my undo and everything Popup back as previous. Again, another  thing you should do is to keep previewing  your post whenever you typed in some words this would help you alot. You should be that used to the entire system how it operates by now.


░▄████████████▀▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▄██
████████████░█▀
████░▄▄▄███████
████▄▄▄▄▄▄▄▄░▄██
▀▀▀▀▀▀▀▀████░███
████████████░███
████████████░█▀

░▄████████████▀▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▄██
████████████░███
████████████░███
████████████░███
████▄▄▄▄████░██▀
████▀▀▀▀▀▀▀▀░▀
████░█▀

░▄████████████▀▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▄██
████████████░█▀
█████████░▄▄▄
█████████░███
░▄░██████░██▀██
▀▀░██████░▀██▄██
████████████░█▀

░▄███████▀░▄██▀▄
▀▀▀▀▀▀▀▀██▀▀▀▄██
████████████░███
████████████░███
██░▄░███████░███
██░█░███████░███
████████████░███
████████████░█▀

░▄██████▀▄
▀▀▀▀▀▀▀▄██
██████░███
██████░███
██████░███
██████░███████▀▄
██████░▀▀▀▀▀▀▄██
████████████░█▀

░▄████▀██▄█████▀▄
▀▀▀▀▀███▀▀▀▀▀▀▄██
█████████████░███
█████░█░█████░███
█████░▀░█████░███
█████████████░█▀
██████████░▄▄▄
██████████░█▀
 
.....  Next−Gen Crypto iGaming  .....
| 
     Play now      
Mia Chloe
Legendary
*
Online Online

Activity: 1092
Merit: 2206


Contact me for your designs...


View Profile
May 21, 2025, 07:33:19 AM
 #7

I don't think this should keep making you still scratch your bald head, like last I used PC I mistakenly select a text on this environment and all what did lost I had to go and use my undo and everything Popup back as previous. Again, another  thing you should do is to keep previewing  your post whenever you typed in some words this would help you alot. You should be that used to the entire system how it operates by now.
I fell victim of this particular frustrating event too many times that I actually got acostomed to making use of my notepad before transferring it to the forum especially if it's a bulky post I'm trying to compile. As a designer sometimes you forget you can't actually use the undo button every time lol...

This is common in SMF software as stated by Bitcoingirl.club.
The core editor remains basic, with Ctrl+Z typically only undoing text input, not UI-driven actions like inserting smileys or BBCode tags.

Quote
Was the undo (CTRL+Z) option disabled on purpose?
No, It's the default of the forum software.
Quote
Or can our script guy (PowerGlove) make some patch
Yes he can but I don't believe is worth the work(could be wrong) .
An extension would be better in my opinion
Well you do have a point however I'm quite curious about it still, because those smileys are actually text inputs or character inputs that eventually displays as smileys when recognized by the forum's SMF system.

███████████████████████████
███████▄████████████▄██████
████████▄████████▄████████
███▀█████▀▄███▄▀█████▀███
█████▀█▀▄██▀▀▀██▄▀█▀█████
███████▄███████████▄███████
███████████████████████████
███████▀███████████▀███████
████▄██▄▀██▄▄▄██▀▄██▄████
████▄████▄▀███▀▄████▄████
██▄███▀▀█▀██████▀█▀███▄███
██▀█▀████████████████▀█▀███
███████████████████████████
.
.Duelbits PREDICT..
█████████████████████████
█████████████████████████
███████████▀▀░░░░▀▀██████
██████████░░▄████▄░░████
█████████░░████████░░████
█████████░░████████░░████
█████████▄▀██████▀▄████
████████▀▀░░░▀▀▀▀░░▄█████
██████▀░░░░██▄▄▄▄████████
████▀░░░░▄███████████████
█████▄▄█████████████████
█████████████████████████
█████████████████████████
.
.WHERE EVERYTHING IS A MARKET..
█████
██
██







██
██
██████
Will Bitcoin hit $200,000
before January 1st 2027?

    No @1.15         Yes @6.00    
█████
██
██







██
██
██████

  CHECK MORE > 
LoyceV
Legendary
*
Offline

Activity: 4060
Merit: 21938


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
May 21, 2025, 08:09:27 AM
 #8

I don't think this has anything to do with the forum software. "Undo" is a keyboard/browser or even OS feature. It kinda makes sense to break it once there's external input in your text, and I'd rather not have the forum mess with this. It comes close to messing with the clipboard.

¡uʍop ǝpᴉsdn pɐǝɥ ɹnoʎ ɥʇᴉʍ ʎuunɟ ʞool no⅄
PowerGlove
Hero Member
*****
hacker
Offline

Activity: 699
Merit: 7092



View Profile
May 30, 2025, 02:17:38 PM
Merited by LoyceV (8), dkbit98 (3), logfiles (3), Cyrus (2), ABCbits (2), hugeblack (2)
 #9

Why is it not possible to undo smiley or BB codes that one may have clicked on accidentally in a post they are trying to create?
Hmm... I've never noticed that before, but, it makes sense to me now that I consider it (what's happening is that the undo history of the textarea is being cleared/reset each time its contents are changed programmatically: when you insert something into a post/PM by using the toolbar, then either an SMF-provided JavaScript function named replaceText or one named surroundText is invoked, and, in either case, the textarea gets modified in such a way that the undo history is wiped; though, strictly speaking, I'm only considering the non-IE paths, and so maybe undo/redo did actually work correctly back in the day on Internet Explorer, but, that's neither here nor there).
 
Or can our script guy (PowerGlove) make some patch?  Smiley
I can. Smiley



Code:
--- baseline/Themes/default/script.js	2006-11-01 07:46:11.000000000 +0000
+++ modified/Themes/default/script.js 2025-05-30 10:34:10.000000000 +0000
@@ -113,6 +113,14 @@
 // Replaces the currently selected text with the passed text.
 function replaceText(text, textarea)
 {
+ // First, attempt to use the execCommand interface (it's deprecated, but, it doesn't wipe the undo history, which is nice).
+ if (typeof(document.execCommand) != "undefined")
+ {
+ textarea.focus();
+ if (document.execCommand("insertText", false, text))
+ return;
+ }
+
  // Attempt to create a text range (IE).
  if (typeof(textarea.caretPos) != "undefined" && textarea.createTextRange)
  {
@@ -167,13 +175,11 @@
  // Mozilla text range wrap.
  else if (typeof(textarea.selectionStart) != "undefined")
  {
- var begin = textarea.value.substr(0, textarea.selectionStart);
  var selection = textarea.value.substr(textarea.selectionStart, textarea.selectionEnd - textarea.selectionStart);
- var end = textarea.value.substr(textarea.selectionEnd);
  var newCursorPos = textarea.selectionStart;
  var scrollPos = textarea.scrollTop;
 
- textarea.value = begin + text1 + selection + text2 + end;
+ replaceText(text1 + selection + text2, textarea);
 
  if (textarea.setSelectionRange)
  {

(Between the three different ways that I can think of to fix this, I think the above way makes the most sense in the context of the existing code. It's not perfect, but, it's much lighter than trying to spoof input events or maintain a non-native undo history, and, if the deprecated interface that it relies on does actually get removed at some point, then the logic will just more-or-less return to the state that it's currently in.)

(I'm not going to bug theymos with a PM about this one, so, hopefully he bumps into this post naturally. I didn't test this change very carefully, because that's always the most time-consuming part of the process, and it doesn't make much sense for me to allocate a huge block of time to doing cross-browser testing for a proposed change that theymos might never even see, let alone merge. If he merges it and it turns out that I've overlooked something, like maybe selection-preservation not working exactly how it used to, then the change can be undone and I'll attempt to revise/improve it at that point.)
Perfectbaby
Hero Member
*****
Offline

Activity: 1036
Merit: 626


Spinly.io - Next-gen Crypto iGaming Platform


View Profile WWW
May 30, 2025, 08:10:07 PM
Merited by Orpichukwu (2)
 #10

I don't think this should keep making you still scratch your bald head, like last I used PC I mistakenly select a text on this environment and all what did lost I had to go and use my undo and everything Popup back as previous. Again, another  thing you should do is to keep previewing  your post whenever you typed in some words this would help you alot. You should be that used to the entire system how it operates by now.
I fell victim of this particular frustrating event too many times that I actually got acostomed to making use of my notepad before transferring it to the forum especially if it's a bulky post I'm trying to compile. As a designer sometimes you forget you can't actually use the undo button every time lol...
After I learnt my lesson I become used to regularly preview my post at all times before I do other task or maybe even minimize my browser because sometimes I usually close my active tabs without me having to submit my post.
And Yes, if you aren't that smart enough working on the window you wouldn't know you exist the window so quickly or even lose all your post.


░▄████████████▀▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▄██
████████████░█▀
████░▄▄▄███████
████▄▄▄▄▄▄▄▄░▄██
▀▀▀▀▀▀▀▀████░███
████████████░███
████████████░█▀

░▄████████████▀▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▄██
████████████░███
████████████░███
████████████░███
████▄▄▄▄████░██▀
████▀▀▀▀▀▀▀▀░▀
████░█▀

░▄████████████▀▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▄██
████████████░█▀
█████████░▄▄▄
█████████░███
░▄░██████░██▀██
▀▀░██████░▀██▄██
████████████░█▀

░▄███████▀░▄██▀▄
▀▀▀▀▀▀▀▀██▀▀▀▄██
████████████░███
████████████░███
██░▄░███████░███
██░█░███████░███
████████████░███
████████████░█▀

░▄██████▀▄
▀▀▀▀▀▀▀▄██
██████░███
██████░███
██████░███
██████░███████▀▄
██████░▀▀▀▀▀▀▄██
████████████░█▀

░▄████▀██▄█████▀▄
▀▀▀▀▀███▀▀▀▀▀▀▄██
█████████████░███
█████░█░█████░███
█████░▀░█████░███
█████████████░█▀
██████████░▄▄▄
██████████░█▀
 
.....  Next−Gen Crypto iGaming  .....
| 
     Play now      
logfiles (OP)
Copper Member
Legendary
*
Offline

Activity: 2730
Merit: 2290



View Profile WWW
May 30, 2025, 11:34:35 PM
Merited by PowerGlove (1)
 #11

<...>
(I'm not going to bug theymos with a PM about this one, so, hopefully he bumps into this post naturally. I didn't test this change very carefully, because that's always the most time-consuming part of the process, and it doesn't make much sense for me to allocate a huge block of time to doing cross-browser testing for a proposed change that theymos might never even see, let alone merge. If he merges it and it turns out that I've overlooked something, like maybe selection-preservation not working exactly how it used to, then the change can be undone and I'll attempt to revise/improve it at that point.)
Thanks for the work @PowerGlove. Since there is no newer forum software development to worry about, I believe it's not a bad idea to improve on what we have right now.
Let's wait and see if admin can pick up interest regarding this and add some changes, or perhaps he will be reluctant due to the recent merit source mess? Time will tell.

▄▄████████████████████▄▄
▄███████▀▀██████▀▀███████▄
████████████████████████
████████▄▄██████▄▄██████

████████████████████████
██▄▄█████████████▄▄██████
██▀▀██████████████████▄▄██
██████▀▀██████████████▀▀██
██████████████████████████
██████▀▀██████▀▀████████
████████████████████████
▀███████▄▄██████▄▄███████▀
▀▀████████████████████▀▀
 
 DΞX.fo 
▄▄██████
█████████
██████████
█████████
██████████
█████████
▀▀██████

▄███████
▄██████████
████████████
█████████████
█████████████
|
▄▄█
▄████▀
▄███▀
▄██▀▄██
█████▀▀
███████
████████
▀██▄████
▄████▄▄
▄█████▀███
▄█████▀████
█████▀███████
▀██▀█████████
|  BTC     XMR  
  DAI     LTC  
   Fees  0.8%    
logfiles (OP)
Copper Member
Legendary
*
Offline

Activity: 2730
Merit: 2290



View Profile WWW
May 29, 2026, 10:38:21 PM
 #12

BTCump

It is exactly a year today since our guy PowerGlove got for us some fix for what I talked about in the OP. So I am bumping this once again in case Theymos never saw it the other time round. If the script can be added minus messing up anything, then why not?  Smiley

It would be nice to finally be able to undo smiley or BB codes that one may have clicked on accidentally in a post minus having to manually look for individual tags for deletion.

▄▄████████████████████▄▄
▄███████▀▀██████▀▀███████▄
████████████████████████
████████▄▄██████▄▄██████

████████████████████████
██▄▄█████████████▄▄██████
██▀▀██████████████████▄▄██
██████▀▀██████████████▀▀██
██████████████████████████
██████▀▀██████▀▀████████
████████████████████████
▀███████▄▄██████▄▄███████▀
▀▀████████████████████▀▀
 
 DΞX.fo 
▄▄██████
█████████
██████████
█████████
██████████
█████████
▀▀██████

▄███████
▄██████████
████████████
█████████████
█████████████
|
▄▄█
▄████▀
▄███▀
▄██▀▄██
█████▀▀
███████
████████
▀██▄████
▄████▄▄
▄█████▀███
▄█████▀████
█████▀███████
▀██▀█████████
|  BTC     XMR  
  DAI     LTC  
   Fees  0.8%    
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!