Firefox PHP

Text style editor

Posted by hoowoo 
Re: Text style editor
June 20, 2005 04:52PM
It could be useful if most of the BBcode Firefox extension (v. 0.4.1.1, [jedbrown.net]) is supported by the BBcode module, isn't it? (both basic and enhanced editor)

Sorry, files deleted from this post because of sick archives. The next post's files are OK.

Honza*), fórum o bylinkách a taky o křesťanském duchovním životě - [hoowoo.euweb.cz]



Edited 1 time(s). Last edit at 06/20/2005 05:08PM by hoowoo.
Re: Text style editor
June 20, 2005 05:03PM
The 2nd attempt, the basic and the enhanced BBcode editor. Search for files below, please:-)

Honza*), fórum o bylinkách a taky o křesťanském duchovním životě - [hoowoo.euweb.cz]



Edited 1 time(s). Last edit at 07/04/2005 10:16AM by hoowoo.
Re: Text style editor
June 20, 2005 05:04PM
hoowoo Wrote:
-------------------------------------------------------
> It could be useful if most of the BBcode Firefox
> extension (v. 0.4.1.1, ) is supported by the
> BBcode module, isn't it? (both basic and enhanced
> editor)

Well, the reference that his site points to has a list of tags. The only one we don't support at all is
Re: Text style editor
June 20, 2005 05:16PM
brianlmoon Wrote:
-------------------------------------------------------
>
> Well, the reference that his site points to has a
> list of tags. The only one we don't support at
> all is
    . We don't fully support
    Quote

    in 5.0. It is
    > supported in 5.1
    >
    > Brian.
    > Phorum Hacker

    That's right:
      and
    • codes (and also the
       tag but I think it doesn't matter too) are added to the BBcode of the style editor.  Is there any serious reason not to support the list?  Honza*), fórum o bylinkách a taky o křesťanském duchovním životě - [hoowoo.euweb.cz]    Edited 2 time(s). Last edit at 06/20/2005 05:21PM by hoowoo.
Re: Text style editor
June 30, 2005 08:29PM
would be nice if emoticons would be inserted at the caret location rather than at the end os the message.

to do that, you need to replace

function smajlici (ktery)
{
document.formular.body.value += ' '+ktery+' ';
document.formular.body.focus();
}

with something a little more elaborated:

function setSelectedText(text) {
var ta = document.formular.body;

if( typeof(ta.selectionStart) != "undefined" ) { // Netscape, Mozilla, Firefox
var start_selection = Math.min(ta.selectionStart, ta.selectionEnd),
end_selection = Math.max(ta.selectionStart, ta.selectionEnd),
scrollTop = ta.scrollTop;
ta.value = ta.value.slice(0, start_selection) + text + ta.value.slice(end_selection);
ta.selectionStart = ta.selectionEnd = start_selection + text.length;
ta.focus();
ta.scrollTop = scrollTop;
} else if( ta.createTextRange ) {
ta.focus( ta.caretPos );
ta.caretPos = document.selection.createRange().duplicate();
ta.caretPos.text = text;
ta.caretPos.moveStart( "character", text.length * -1 );
} else // opera and such
ta.value += text;
}
Re: Text style editor
July 02, 2005 10:04AM
I found a bug. If the text content two or more equally word, style editor will aplly formating to the previous word, for example try this text:

"test ;worgwrouih 983ru 4rl;42ui5h 098"
then select last digits 98, and try for example to made the, bold, you'll get such result

"test ;worgwrouih 983ru 4rl;42ui5h 098"

i've checked this even on your site[hoowoo.euweb.cz]

:))

wait for your answer...



Edited 1 time(s). Last edit at 07/02/2005 10:05AM by Avdoshyn.
Re: Text style editor
July 04, 2005 08:35AM
Oh! It is a bug of MSIE, Firefox is OK, I'll try to work about it. TX!

Honza*), fórum o bylinkách a taky o křesťanském duchovním životě - [hoowoo.euweb.cz]
Re: Text style editor
July 04, 2005 10:14AM
Fixed the bug Avdoshyn wrote about (it appeared with an adding of URL's too, both basic and enhanced editor). TX!

Look for the file below...

Honza*), fórum o bylinkách a taky o křesťanském duchovním životě - [hoowoo.euweb.cz]



Edited 2 time(s). Last edit at 08/14/2005 05:58AM by hoowoo.
Re: Text style editor
July 05, 2005 04:27AM
Thanks it really fixed - can you tell what was the reason and in what way you've fixed it?



Edited 2 time(s). Last edit at 07/05/2005 04:53AM by Avdoshyn.
Re: Text style editor
July 05, 2005 04:11PM
Avdoshyn Wrote:
-------------------------------------------------------
> Thanks it really fixed - can you tell what was the
> reason and in what way you've fixed it?
>
> Edited 2 times. Last edit at 07/05/05 09:53AM by
> Avdoshyn.

The old version found the marked text of message with string.indexOf() which returns the first position of a defined substring - and this is the bug if the substring is repeated. Unfortunately I didn't find a simple operation with a whole string of a message which could return just the marked text. Or it was too complicated ([interforum.interval.cz]).

Eventually I find out the document.selection.createRange().text can be due modified, e.g.:

myselection = document.selection.createRange().text;
document.selection.createRange().text = "Hallo " + myselection + "!";

That's it :-))

Honza*), fórum o bylinkách a taky o křesťanském duchovním životě - [hoowoo.euweb.cz]



Edited 1 time(s). Last edit at 07/07/2005 04:08AM by hoowoo.
Sorry, only registered users may post in this forum.

Click here to login