Text style editor
Posted by hoowoo
Re: Text style editor August 03, 2005 01:07PM |
Admin Registered: 21 years ago Posts: 9,240 |
some enhancement first ...
I changed the preg from the first part to this more reliable thing:
And I've added the default to the color-selectbox too:
as otherwise you can't select black as it seems.
and a question (sorry, I can't work with your js-code as I don't even understand the variable names ;)) ...
For the select-boxes (color and size in my case) would it be possible to put in the close tags too if there is no text selected? Otherwise I don't see a way to close those tags with a click (beside entering it ;)).
Thomas Seifert
I changed the preg from the first part to this more reliable thing:
if(phorum_page == 'read') $formarea = "body"; if(phorum_page == 'post') $formarea = "body"; if(phorum_page == 'moderation') $formarea = "body"; if(phorum_page == 'control') $formarea = "message"; if(phorum_page == 'edit') $formarea = "body";
And I've added the default to the color-selectbox too:
<OPTION VALUE="default">- <?php echo $TE_lang['TE_sizedef']?> -</OPTION>
as otherwise you can't select black as it seems.
and a question (sorry, I can't work with your js-code as I don't even understand the variable names ;)) ...
For the select-boxes (color and size in my case) would it be possible to put in the close tags too if there is no text selected? Otherwise I don't see a way to close those tags with a click (beside entering it ;)).
Thomas Seifert
Re: Text style editor August 03, 2005 01:29PM |
Registered: 20 years ago Posts: 683 |
Hi Thomas,
> For the select-boxes (color and size in my case)
> would it be possible to put in the close tags too
> if there is no text selected? Otherwise I don't
> see a way to close those tags with a click (beside
> entering it ;)).
Just hit the Button a second time - it's magic !
;-)
pat
> For the select-boxes (color and size in my case)
> would it be possible to put in the close tags too
> if there is no text selected? Otherwise I don't
> see a way to close those tags with a click (beside
> entering it ;)).
Just hit the Button a second time - it's magic !
;-)
pat
Re: Text style editor August 03, 2005 01:30PM |
Admin Registered: 21 years ago Posts: 9,240 |
Re: Text style editor August 03, 2005 01:36PM |
Registered: 20 years ago Posts: 683 |
Re: Text style editor August 08, 2005 03:33AM |
Registered: 19 years ago Posts: 49 |
> and a question (sorry, I can't work with your
> js-code as I don't even understand the variable
> names ;)) ...
> For the select-boxes (color and size in my case)
> would it be possible to put in the close tags too
> if there is no text selected? Otherwise I don't
> see a way to close those tags with a click (beside
> entering it ;)).
Try it pls, in the same way as buttons: select a color (without selecting a text), then write a text and then select "black". This choise doesn't insert a color (I do not make a difference between the default and the black color, it doesn't matter for common visitor I think) but simply closes a color tag - you get a default color.
Well I see, this could be really enhanced - for anybody who makes his phorum default text color different from black, isn't 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 08/08/2005 04:05AM by hoowoo.
> js-code as I don't even understand the variable
> names ;)) ...
> For the select-boxes (color and size in my case)
> would it be possible to put in the close tags too
> if there is no text selected? Otherwise I don't
> see a way to close those tags with a click (beside
> entering it ;)).
Try it pls, in the same way as buttons: select a color (without selecting a text), then write a text and then select "black". This choise doesn't insert a color (I do not make a difference between the default and the black color, it doesn't matter for common visitor I think) but simply closes a color tag - you get a default color.
Well I see, this could be really enhanced - for anybody who makes his phorum default text color different from black, isn't 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 08/08/2005 04:05AM by hoowoo.
Re: Text style editor August 08, 2005 05:53AM |
Admin Registered: 21 years ago Posts: 9,240 |
Heh, yes. I've changed that behaviour too, so that users can add "black text" too.
Any simple option to add the opening and closing tag if no text is selected?
I don't want to force this on everyone so I would have no problem if its a change which I only do on my forums ;).
Thomas Seifert
Any simple option to add the opening and closing tag if no text is selected?
I don't want to force this on everyone so I would have no problem if its a change which I only do on my forums ;).
Thomas Seifert
Re: Text style editor August 09, 2005 08:08AM |
Registered: 19 years ago Posts: 49 |
Well, I understand: you want to insert a tag wherever you place a cursor, both you have a marked text or not, or at the beginning or at the middle or at the end of a message.
It is possible for FF and Mozilla:
1. find the mozWrap js function and modify the condition of if (s2!='') -> to -> if ((s3)||(s2!='')) then you get a code line
if ((s3)||(s2!='')) { txtarea.value = s1 + lft + s2 + rgt + s3; donecode = false; }
2. Find a script description "// add anchor" and then delete the same condition if (s2!='') with all the corresponding bars both () and {} below.
Unfortunately, for MSIE users (most of all users) I just do not sense the way how to arrange it.
************
> if(phorum_page == 'read') $formarea = "body";
> if(phorum_page == 'post') $formarea = "body";
> if(phorum_page == 'moderation') $formarea = "body";
> if(phorum_page == 'control') $formarea = "message";
> if(phorum_page == 'edit') $formarea = "body";
Oh, that's nice:-) You can use this simple shape probably too (until any sudden Phorum changes don't appear):
$formarea = "body";
if(phorum_page == 'control') $formarea = "message";
Honza*), fórum o bylinkách a taky o křesťanském duchovním životě - [hoowoo.euweb.cz]
Edited 3 time(s). Last edit at 08/10/2005 08:20AM by hoowoo.
It is possible for FF and Mozilla:
1. find the mozWrap js function and modify the condition of if (s2!='') -> to -> if ((s3)||(s2!='')) then you get a code line
if ((s3)||(s2!='')) { txtarea.value = s1 + lft + s2 + rgt + s3; donecode = false; }
2. Find a script description "// add anchor" and then delete the same condition if (s2!='') with all the corresponding bars both () and {} below.
Unfortunately, for MSIE users (most of all users) I just do not sense the way how to arrange it.
************
> if(phorum_page == 'read') $formarea = "body";
> if(phorum_page == 'post') $formarea = "body";
> if(phorum_page == 'moderation') $formarea = "body";
> if(phorum_page == 'control') $formarea = "message";
> if(phorum_page == 'edit') $formarea = "body";
Oh, that's nice:-) You can use this simple shape probably too (until any sudden Phorum changes don't appear):
$formarea = "body";
if(phorum_page == 'control') $formarea = "message";
Honza*), fórum o bylinkách a taky o křesťanském duchovním životě - [hoowoo.euweb.cz]
Edited 3 time(s). Last edit at 08/10/2005 08:20AM by hoowoo.
Re: Text style editor August 13, 2005 08:19AM |
Registered: 19 years ago Posts: 49 |
Wow, it's made!
Everybody (FF, MSIE users) are allowed to insert tags into the message (also empty tags without a pre-marked text) everywhere they wish (and place the cursor). Tx to Fred (http://diskuse.jakpsatweb.cz/). It seems working right:-)
The basic editor so far, the enhanced one will come soon.
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 08/14/2005 05:35AM by hoowoo.
Everybody (FF, MSIE users) are allowed to insert tags into the message (also empty tags without a pre-marked text) everywhere they wish (and place the cursor). Tx to Fred (http://diskuse.jakpsatweb.cz/). It seems working right:-)
The basic editor so far, the enhanced one will come soon.
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 08/14/2005 05:35AM by hoowoo.
Re: Text style editor August 14, 2005 05:34AM |
Registered: 19 years ago Posts: 49 |
The editor tested and fit to the Opera browser.
It operates with Phorum 5.0.16 right. Still I cannot manage to run the Ph 5.1.0 so I cannot say how it works with it.
The basic editor.
Honza*), fórum o bylinkách a taky o křesťanském duchovním životě - [hoowoo.euweb.cz]
It operates with Phorum 5.0.16 right. Still I cannot manage to run the Ph 5.1.0 so I cannot say how it works with it.
The basic editor.
Honza*), fórum o bylinkách a taky o křesťanském duchovním životě - [hoowoo.euweb.cz]
Re: Text style editor August 14, 2005 05:55AM |
Registered: 19 years ago Posts: 49 |
The enhanced editor tested and fit to the Opera browser, tested with the Phorum 5.0.16. In addition to the basic one, you can select whether unregistered users may use the editor, and registered users can manage their own policy.
"Forms named" and "Getforms" files are modified to use with an other module with its own form (such as the poll module). The message area is better specified there. If the "Getforms" does't operate, you should use the "Forms named" (you will need to work with it more but do not be afraid about it :-) ).
Be cool to use the simple enhanced editor (or the basic one if you do not need to select users for the editor) if you use a single text editor, or try it if you are not sure about the reason for the special ones.
Honza*), fórum o bylinkách a taky o křesťanském duchovním životě - [hoowoo.euweb.cz]
"Forms named" and "Getforms" files are modified to use with an other module with its own form (such as the poll module). The message area is better specified there. If the "Getforms" does't operate, you should use the "Forms named" (you will need to work with it more but do not be afraid about it :-) ).
Be cool to use the simple enhanced editor (or the basic one if you do not need to select users for the editor) if you use a single text editor, or try it if you are not sure about the reason for the special ones.
Honza*), fórum o bylinkách a taky o křesťanském duchovním životě - [hoowoo.euweb.cz]
Sorry, only registered users may post in this forum.