Simple Machines Community Forum

SMF Development => Feature Requests => Applied or Declined Requests => Topic started by: camelwalk on September 21, 2004, 05:52:13 PM

Title: Text selected stays after using YaBB code button
Post by: camelwalk 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.

Title: Re: Text selected stays after using YaBB code button
Post by: [Unknown] 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]
Title: Re: Text selected stays after using YaBB code button
Post by: Saint_3k 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.
Title: Re: Text selected stays after using YaBB code button
Post by: [Unknown] 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]
Title: Re: Text selected stays after using YaBB code button
Post by: Anguz on December 31, 2004, 05:44:01 PM
[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?
Title: Re: Text selected stays after using YaBB code button
Post by: Peter Duggan on December 31, 2004, 05:49:37 PM
Quote from: Saint_3k on December 31, 2004, 11:12:39 AM
a crying shame

Isn't that a bit OTT? ???
Title: Re: Text selected stays after using YaBB code button
Post by: Jerry on December 31, 2004, 06:46:21 PM
Omg

Seems to work in firefox. ..
Title: Re: Text selected stays after using YaBB code button
Post by: Trekkie101 on December 31, 2004, 07:21:40 PM
Testing in IE

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

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

Title: Re: Text selected stays after using YaBB code button
Post by: Jerry 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. . .
Title: Re: Text selected stays after using YaBB code button
Post by: Trekkie101 on December 31, 2004, 08:17:31 PM
Oh well someone can search im too tired to.
Title: Re: Text selected stays after using YaBB code button
Post by: smd on December 31, 2004, 08:18:16 PM
yo
[/size][/font][/color]
works for me in IE  ;D
Title: Re: Text selected stays after using YaBB code button
Post by: [Unknown] on December 31, 2004, 08:21:46 PM
Quote from: Trekkie101 on December 31, 2004, 07:21:40 PM
Testing in IE

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

QuoteVersion: 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]
Title: Re: Text selected stays after using YaBB code button
Post by: Anno 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:

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



Title: Re: Text selected stays after using YaBB code button
Post by: Peter Duggan on January 01, 2005, 03:22:27 PM
Quote from: Anno on January 01, 2005, 03:07:49 PM
n = text1.length + text2.length + lenght;

Haven't looked at this code, but I'm guessing that last should be 'length'?
Title: Re: Text selected stays after using YaBB code button
Post by: Anno 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.
Title: Re: Text selected stays after using YaBB code button
Post by: Elijah Bliss 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...
[b]works in FireFox[/b]

unfortunately this doesn't work in Safari, I get this instead:
works in FireFox[b][/b]

Is there any way to make this work in Safari?
Title: Re: Text selected stays after using YaBB code button
Post by: [Unknown] 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]
Title: Re: Text selected stays after using YaBB code button
Post by: Elijah Bliss on January 01, 2005, 11:17:13 PM
Quote from: [Unknown] 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]

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?
Title: Re: Text selected stays after using YaBB code button
Post by: [Unknown] 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]