Advertisement:

Author Topic: Text selected stays after using YaBB code button  (Read 12763 times)

Offline camelwalk

  • Semi-Newbie
  • *
  • Posts: 12
Text selected stays after using YaBB code button
« on: September 21, 2004, 05:52:13 PM »
I don't know if anyone has mentioned this, but in YaBB SE you could highlight some text and quickly add multiple YaBB codes to it using the buttons above. For example, I post a lot of articles, and I bold, size, and url the title. In YaBB SE the text stayed selected even after you added the first code, but in SMF 1.0 it does not.


Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Text selected stays after using YaBB code button
« Reply #1 on: September 22, 2004, 02:32:14 AM »
You sure?  It didn't do that to me, that I can remember... can you point me to a YaBB SE forum that does it?

I just tested it with a 100% genuine YaBB SE forum and it didn't.

-[Unknown]

Offline Saint_3k

  • Semi-Newbie
  • *
  • Posts: 30
Re: Text selected stays after using YaBB code button
« Reply #2 on: December 31, 2004, 11:12:39 AM »
I agree with Canelwalk, YabbSE and virtually ANY other forum software allows you to quickly add tags to highlighted text without having to rehighlight the text between adding tags. SMF doesnt work this way, however, which is a crying shame. I have reported this on several occasions.

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Text selected stays after using YaBB code button
« Reply #3 on: December 31, 2004, 11:17:07 AM »
Something must be broken with your browser if they behave that differently.  Everything works fine for me here, better than ever with YaBB SE.

-[Unknown]

Offline Anguz

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,430
  • Gender: Male
    • cristianlavaque.com
Re: Text selected stays after using YaBB code button
« Reply #4 on: December 31, 2004, 05:44:01 PM »
Code: [Select]
[s][u][i][b]test[/b][/i][/u][/s]
Just did that selecting only once and clicking on the code buttons one after the other...

I'm using Firefox, what browser are you using, camelwalk?
« Last Edit: December 31, 2004, 05:46:21 PM by Anguz »
Cristián Lávaque http://cristianlavaque.com

Offline Peter Duggan

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,663
  • Gender: Male
    • Peat Stack or Pete's Tack?
Re: Text selected stays after using YaBB code button
« Reply #5 on: December 31, 2004, 05:49:37 PM »
a crying shame

Isn't that a bit OTT? ???

Offline Jerry

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,903
  • Gender: Male
  • What? I can't hear you over my awesomeness!!
    • PlanetSMF
Re: Text selected stays after using YaBB code button
« Reply #6 on: December 31, 2004, 06:46:21 PM »
Omg

Seems to work in firefox. ..
- Jerry
Find me on:
Facebook
Twitter
PlanetSMF

"If all you look for is the negative in things, you will never see the positive."

Offline Trekkie101

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,157
  • Gender: Male
  • Ad Astra!
    • https://www.facebook.com/DLRPRoundup on Facebook
    • @dlrproundup on Twitter
    • DLRP Roundup
Re: Text selected stays after using YaBB code button
« Reply #7 on: December 31, 2004, 07:21:40 PM »
Testing in IE

Doesnt work, hmm there correct in what they said atleast in IE.

Quote
Version: 6.0.2900.2180.xpsp_sp2_rtm.040803-2158IS
Cipher Strength: 128-bit
Product ID:76477-OEM-0011903-00109
Update Versions:; SP2;



Offline Jerry

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,903
  • Gender: Male
  • What? I can't hear you over my awesomeness!!
    • PlanetSMF
Re: Text selected stays after using YaBB code button
« Reply #8 on: December 31, 2004, 07:32:48 PM »
I think there was a fix for this posted awhile ago, but I cant remember the topic name or or how to fix it. ... it was to do with the script.js. . .
- Jerry
Find me on:
Facebook
Twitter
PlanetSMF

"If all you look for is the negative in things, you will never see the positive."

Offline Trekkie101

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,157
  • Gender: Male
  • Ad Astra!
    • https://www.facebook.com/DLRPRoundup on Facebook
    • @dlrproundup on Twitter
    • DLRP Roundup
Re: Text selected stays after using YaBB code button
« Reply #9 on: December 31, 2004, 08:17:31 PM »
Oh well someone can search im too tired to.

Offline smd

  • Semi-Newbie
  • *
  • Posts: 49
Re: Text selected stays after using YaBB code button
« Reply #10 on: December 31, 2004, 08:18:16 PM »
yo
[/size][/font][/color]
works for me in IE  ;D

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Text selected stays after using YaBB code button
« Reply #11 on: December 31, 2004, 08:21:46 PM »
Testing in IE

Doesnt work, hmm there correct in what they said atleast in IE.

Quote
Version: 6.0.2900.2180.xpsp_sp2_rtm.040803-2158IS
Cipher Strength: 128-bit
Product ID:76477-OEM-0011903-00109
Update Versions:; SP2;

Like I said in another topic, it seems as if something was changed in Internet Explorer 6 or SP1 because it stops working around there *HOWEVER*, it also doesn't work for YaBB SE forums.

-[Unknown]

Offline Anno

  • Semi-Newbie
  • *
  • Posts: 16
  • Gender: Male
    • grow mushrooms from spores
Re: Text selected stays after using YaBB code button
« Reply #12 on: January 01, 2005, 03:07:49 PM »
The fix:

In /Themes/default/script.js in the function surroundText, as a second if option(in the IE part), insert this:

Code: [Select]
if (temp_length > 0){
    n = text1.length + text2.length + temp_length;
    caretPos.moveStart("character", -n);
    caretPos.select();
   }


« Last Edit: January 01, 2005, 03:51:06 PM by Anno »
www.fungifun.org [nofollow]

Offline Peter Duggan

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,663
  • Gender: Male
    • Peat Stack or Pete's Tack?
Re: Text selected stays after using YaBB code button
« Reply #13 on: January 01, 2005, 03:22:27 PM »
n = text1.length + text2.length + lenght;

Haven't looked at this code, but I'm guessing that last should be 'length'?

Offline Anno

  • Semi-Newbie
  • *
  • Posts: 16
  • Gender: Male
    • grow mushrooms from spores
Re: Text selected stays after using YaBB code button
« Reply #14 on: January 01, 2005, 03:39:14 PM »
actually it should be caretPos.text.length

no, the function changed here in the last few days.
The variable previously named length  is now named temp_length , I edited it above.
« Last Edit: January 01, 2005, 03:52:06 PM by Anno »
www.fungifun.org [nofollow]

Offline Elijah Bliss

  • Sophist Member
  • *****
  • Posts: 1,340
Re: Text selected stays after using YaBB code button
« Reply #15 on: January 01, 2005, 09:59:19 PM »
I tried this out in FireFox and this is cool!

here's what I get in firefox when I highlight the text and click the "bold" button...
Code: [Select]
[b]works in FireFox[/b]
unfortunately this doesn't work in Safari, I get this instead:
Code: [Select]
works in FireFox[b][/b]
Is there any way to make this work in Safari?

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Text selected stays after using YaBB code button
« Reply #16 on: January 01, 2005, 10:56:38 PM »
No.  It may be possible in later versions of Safari, but the necessary JavaScript just isn't available in the current version.  Same with Opera, if I remember right.

-[Unknown]

Offline Elijah Bliss

  • Sophist Member
  • *****
  • Posts: 1,340
Re: Text selected stays after using YaBB code button
« Reply #17 on: January 01, 2005, 11:17:13 PM »
No.  It may be possible in later versions of Safari, but the necessary JavaScript just isn't available in the current version.  Same with Opera, if I remember right.

-[Unknown]

that sucks.

If I were to submit a bug report/feature request to Apple (Safari has a bug report feature built in) what would I call this shortcoming so i could report it properly?

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Text selected stays after using YaBB code button
« Reply #18 on: January 01, 2005, 11:25:21 PM »
In JavaSscript, the "textarea" object does not have either the properties selectionStart/selectionEnd/setSelectionRange or createTextRange.  Because of this, changing (or detecting) the current selection within a textarea is impossible.

-[Unknown]