Bitcoin Forum
July 10, 2026, 09:34:33 PM *
News: Latest Bitcoin Core release: 31.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: Why is it impossible to Undo (CTRL+Z) Smiley and Bulletin board codes?  (Read 564 times)
logfiles (OP)
Copper Member
Legendary
*
Offline

Activity: 2772
Merit: 2352


WQEVOZY9F0S5


View Profile WWW
May 19, 2025, 04:17:12 PM
Merited by dkbit98 (3), PowerGlove (3), joker_josue (2), vapourminer (1), ABCbits (1), TypoTonic (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: 3458
Merit: 1276



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 
| 🏀
 
🏈 🏓
 
🎯 🥊
 
 🎾
 
 🏐
 
🏏 🏎️
|


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

....HIGHEST....
VIP REWARDS

  G U A R A N T E E D  
| 
 🜲 
KING OF
THE CASTLE

$200K in prizes
| 
..PLAY NOW..
BitcoinGirl.Club
Legendary
*
Offline

Activity: 3304
Merit: 2845


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: 1064
Merit: 1361


Don't tell anyone


View Profile WWW
May 19, 2025, 08:40:02 PM
Merited by vapourminer (1)
 #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: 4480
Merit: 3698


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: 1078
Merit: 632


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: 1134
Merit: 2242


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: 4102
Merit: 22256


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: 703
Merit: 7210



View Profile
May 30, 2025, 02:17:38 PM
Merited by LoyceV (8), vapourminer (6), hosemary (6), dkbit98 (3), logfiles (3), joker_josue (3), Cyrus (2), ABCbits (2), hugeblack (2), nc50lc (1), TypoTonic (1)
 #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: 1078
Merit: 632


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: 2772
Merit: 2352


WQEVOZY9F0S5


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: 2772
Merit: 2352


WQEVOZY9F0S5


View Profile WWW
May 29, 2026, 10:38:21 PM
Merited by vapourminer (1), Cyrus (1), PowerGlove (1)
 #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%    
NotATether
Legendary
*
Offline

Activity: 2394
Merit: 9869


┻┻ ︵㇏(°□°㇏)


View Profile WWW
May 31, 2026, 02:05:05 PM
 #13

Why stop at smilies? I for one would like to have the ability to undo everything. Tables, lists, bold/italics/underline, horizontal break, and anything else.

It shouldn't be too difficult as PowerGlove made a patch for the smilies, but I don't know if this applies to all codes as well.

 
 b1exch.to 
  ETH      DAI   
  BTC      LTC   
  USDT     XMR    
.███████████▄▀▄▀
█████████▄█▄▀
███████████
███████▄█▀
█▀█
▄▄▀░░██▄▄
▄▀██▄▀█████▄
██▄▀░▄██████
███████░█████
█░████░█████████
█░█░█░████░█████
█░█░█░██░█████
▀▀▀▄█▄████▀▀▀
logfiles (OP)
Copper Member
Legendary
*
Offline

Activity: 2772
Merit: 2352


WQEVOZY9F0S5


View Profile WWW
May 31, 2026, 10:55:07 PM
Merited by PowerGlove (1)
 #14

Why stop at smilies? I for one would like to have the ability to undo everything. Tables, lists, bold/italics/underline, horizontal break, and anything else.

It shouldn't be too difficult as PowerGlove made a patch for the smilies, but I don't know if this applies to all codes as well.
That why I said "... and Bulletin Board codes"  Smiley

And it's really stressful when it comes to table. Any small mistake and you are going to spend a few couple of minutes trying to remove the codes that were wrongly added. PowerGlove made a patch for all the Bulletin board codes so he has got us covered on that. Now we are just waiting for a decision from the forum boss.

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

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

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

Activity: 2884
Merit: 1351



View Profile
June 01, 2026, 03:18:31 AM
Merited by vapourminer (1)
 #15

And it's really stressful when it comes to table. Any small mistake and you are going to spend a few couple of minutes trying to remove the codes that were wrongly added.
You can try with your archive posts for avoiding mistakes turn your previous working table to an error one.

Alternatively you can try this tool [Site and Add-On] Table Generator - Custom Styled Tables for Bitcointalk!
https://signatools.net/tabgen/index.php

PowerGlove
Hero Member
*****
hacker
Offline

Activity: 703
Merit: 7210



View Profile
July 08, 2026, 06:55:27 PM
Merited by hosemary (6), vapourminer (4), LoyceV (4), Cyrus (2), logfiles (2), TypoTonic (2), joker_josue (1), promise444c5 (1)
 #16

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
Thanks for bumping it. (I appreciate it when someone besides me nudges theymos about this kind of thing.) Cheesy

I've been thinking about this one, and something that I think might be giving theymos pause is that the diff I posted earlier is now out-of-date (that is, the code it touches has since been changed). Also, the diff was a bit confusing to begin with (that is, it's not clear by looking at it that two functions are being changed).

So, I split the fix into two diffs and re-based them against what's currently in /Themes/default/script.js. First, the replaceText change:

Code:
--- baseline/Themes/default/script.js	2026-07-08 14:57:20.000000000 +0000
+++ modified/Themes/default/script.js 2026-07-08 16:11:31.000000000 +0000
@@ -115,6 +115,13 @@
 // 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)
  {

Then, the surroundText change (probably it makes sense to comment-out rather than remove the lines subtracted by this diff):

Code:
--- baseline/Themes/default/script.js	2026-07-08 14:57:20.000000000 +0000
+++ modified/Themes/default/script.js 2026-07-08 16:12:25.000000000 +0000
@@ -169,13 +169,11 @@
  // Mozilla text range wrap.
  else if (typeof(textarea.$selection) != "undefined")
  {
- var begin = textarea.value.substr(0, textarea.$selection.start);
  var selection = textarea.value.substr(textarea.$selection.start, textarea.$selection.end - textarea.$selection.start);
- var end = textarea.value.substr(textarea.$selection.end);
  var newCursorPos = textarea.$selection.start;
  var scrollPos = textarea.scrollTop;
 
- textarea.value = begin + text1 + selection + text2 + end;
+ replaceText(text1 + selection + text2, textarea);
 
  if (textarea.setSelectionRange)
  {

(These changes seem to work well for me in Tor Browser on Linux, but that's the extent of my testing and I haven't thought about this code in a good while. Still, I think these changes are worth applying. If it turns out that I've broken something for someone then we can go back to the old code and I'll try to come up with a better fix.)



If anyone wants to test these changes locally, one way to do that would be to open a page that includes a BBCode editor (like this one), and then, while on that page, use your browser's developer console (Ctrl+Shift+K, for me) to execute the following:

Code:
(function() {

replaceText = function(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)
{
var caretPos = textarea.caretPos;

caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
caretPos.select();
}
// Mozilla text range replace.
else if (typeof(textarea.$selection) != "undefined")
{
var begin = textarea.value.substr(0, textarea.$selection.start);
var end = textarea.value.substr(textarea.$selection.end);
var scrollPos = textarea.scrollTop;

textarea.value = begin + text + end;

if (textarea.setSelectionRange)
{
textarea.focus();
textarea.setSelectionRange(begin.length + text.length, begin.length + text.length);
}
textarea.scrollTop = scrollPos;
}
// Just put it on the end.
else
{
textarea.value += text;
textarea.focus(/*textarea.value.length - 1*/);
}
};

surroundText = function(text1, text2, textarea)
{
// Can a text range be created?
if (typeof(textarea.caretPos) != "undefined" && textarea.createTextRange)
{
var caretPos = textarea.caretPos, temp_length = caretPos.text.length;

caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text1 + caretPos.text + text2 + ' ' : text1 + caretPos.text + text2;

if (temp_length == 0)
{
caretPos.moveStart("character", -text2.length);
caretPos.moveEnd("character", -text2.length);
caretPos.select();
}
else
textarea.focus(caretPos);
}
// Mozilla text range wrap.
else if (typeof(textarea.$selection) != "undefined")
{
var selection = textarea.value.substr(textarea.$selection.start, textarea.$selection.end - textarea.$selection.start);
var newCursorPos = textarea.$selection.start;
var scrollPos = textarea.scrollTop;

replaceText(text1 + selection + text2, textarea);

if (textarea.setSelectionRange)
{
if (selection.length == 0)
textarea.setSelectionRange(newCursorPos + text1.length, newCursorPos + text1.length);
else
textarea.setSelectionRange(newCursorPos, newCursorPos + text1.length + selection.length + text2.length);
textarea.focus();
}
textarea.scrollTop = scrollPos;
}
// Just put them on the end, then.
else
{
textarea.value += text1 + text2;
textarea.focus(/*textarea.value.length - 1*/);
}
};
})();
shahzadafzal
Copper Member
Legendary
*
Offline

Activity: 2240
Merit: 3397



View Profile
July 09, 2026, 02:15:33 PM
Merited by vapourminer (1), logfiles (1)
 #17

Thanks for bumping it. (I appreciate it when someone besides me nudges theymos about this kind of thing.) Cheesy

I've been thinking about this one, and something that I think might be giving theymos pause is that the diff I posted earlier is now out-of-date.

While we're at it, let's let the forum wizards do their magic. 😄

We all know that sometimes one year isn't really that long when it's worth waiting. Smiley

Until these changes make it into the forum, you can try the Google Chrome extension I originally created for myself:

https://chromewebstore.google.com/detail/bitcointalk-bbcode-extens/dideaiffmajfhncjddefaaadncekodia



It covers most of the requested functionality while we wait for a native implementation.

Some of the features you can use while writing a post, including in the Quick Reply editor:

Bold & Italic:
- Ctrl+B
- Ctrl+I

Increase / Decrease Font Size:
- Ctrl+Up
- Ctrl+Down

Undo:
The latest version also supports undoing toolbar actions.
- Ctrl+Z

Additional bonus:
The main reason I created this extension was to change the default merit value to [1].
Yes, it's debatable, but I like it because around 90% of the time I send just one merit. For me, it makes more sense to start at 1 instead of 0.

░░░░▄▄████████████▄
▄████████████████▀
▄████████████████▀▄█▄
▄██████▀▀░░▄███▀▄████▄
▄██████▀░░░▄███▀▀██████▄
██████▀░░▄████▄░░░▀██████
██████░░▀▀▀▀▄▄▄▄░░██████
██████▄░░░▀████▀░░▄██████
▀██████▄▄███▀░░░▄██████▀
▀████▀▄████░░▄▄███████▀
▀█▀▄████████████████▀
▄████████████████▀
▀████████████▀▀░░░░
 
 CCECASH 
joker_josue
Legendary
*
Offline

Activity: 2450
Merit: 7257


**In BTC since 2013**


View Profile WWW
July 09, 2026, 05:51:10 PM
Merited by PowerGlove (1)
 #18

When someone discovers these little "glitches", the PowerGlove always pops up.

I had never noticed that. Or if I noticed, I thought it was something from my browser.

But, presto, it is identified, and with a possible solution.

Thank you PowerGlove

 
 b1exch.to 
  ETH      DAI   
  BTC      LTC   
  USDT     XMR    
.███████████▄▀▄▀
█████████▄█▄▀
███████████
███████▄█▀
█▀█
▄▄▀░░██▄▄
▄▀██▄▀█████▄
██▄▀░▄██████
███████░█████
█░████░█████████
█░█░█░████░█████
█░█░█░██░█████
▀▀▀▄█▄████▀▀▀
TypoTonic
Sr. Member
****
Offline

Activity: 364
Merit: 581


When words fail, action speaks.


View Profile WWW
Today at 04:36:48 AM
Merited by PowerGlove (1)
 #19

(These changes seem to work well for me in Tor Browser on Linux, but that's the extent of my testing and I haven't thought about this code in a good while. Still, I think these changes are worth applying. If it turns out that I've broken something for someone then we can go back to the old code and I'll try to come up with a better fix.)
I was curious if this would affect my personal script (in which I made use of those two functions), so I decided to test it. The changes don't seem to break anything, and in fact, it works really well. This is going to be quite handy for designing signatures. Grin

████
██









██
████



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









██
████
████
██









██
████

🍒
████
██









██
████
████
██









██
████

⚽️
████
██









██
████
████
██









██
████
 
 IIIIIFASTEST GROWING CASINO & SPORTSBOOK  [ Play Now ]
████
██









██
████
ImGenius
Full Member
***
Offline

Activity: 588
Merit: 136


Let’s get in good shape


View Profile
Today at 06:07:15 AM
 #20

Currently I am using Android to access this forum. I use gboard which has an inbuilt undo button. It is very helpful for undoing or redoing any type of text. Basically I don't need any script or modification in forum code to undo anything.


Pages: [1] 2 »  All
  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!