Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/xinha/public_html/r.f/include/parser.php on line 774

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/xinha/public_html/r.f/include/parser.php on line 774

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/xinha/public_html/r.f/include/parser.php on line 774

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/xinha/public_html/r.f/include/parser.php on line 774

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/xinha/public_html/r.f/include/parser.php on line 774

#1 2005-05-02 15:16:55

willeffects
Xinha Authority
Registered: 2005-03-19
Posts: 130

how do i move the find/replace icon?

I've loaded the findreplace plugin but I want to move the icon as defined by my custom config:

["inserttable","toggleborders","separator","codebox","FR-findreplace"]

however, that only duplicates the icon and does not get rid of the one to the left of format block.  How do I customize the location?

Thanks,
Will

Offline


Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/xinha/public_html/r.f/include/parser.php on line 774

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/xinha/public_html/r.f/include/parser.php on line 774

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/xinha/public_html/r.f/include/parser.php on line 774

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/xinha/public_html/r.f/include/parser.php on line 774

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/xinha/public_html/r.f/include/parser.php on line 774

#2 2005-05-02 16:35:32

kimss
Xinha Pro
From: Sweden
Registered: 2005-04-05
Posts: 99
Website

Re: how do i move the find/replace icon?

The button is inserted by the plugin itself, so you adding an extra button doesnt really help you very much. Look at my post here :

http://xinha.gogo.co.nz/punbb/viewtopic.php?id=185

If you have any problems adopting the code I might be able to have a look at it for you.

Offline

#3 2005-05-02 23:40:36

willeffects
Xinha Authority
Registered: 2005-03-19
Posts: 130

Re: how do i move the find/replace icon?

thanks man.

I was able to hack the findreplace.js and delete all the lines they had with this

var joincfg = cfg.toolbar[0].join("|");

then i just call "FR-replace" button where I wanted in the config file.

Last edited by willeffects (2005-05-02 23:43:11)

Offline

#4 2005-05-03 00:00:41

willeffects
Xinha Authority
Registered: 2005-03-19
Posts: 130

Re: how do i move the find/replace icon?

I couldnt seem to do the same procedure for spell-checker.js , anyone know what I need to delete in that file?

Offline

#5 2005-05-03 01:42:15

niko
Xinha Authority
From: Salzburg/Austria
Registered: 2005-02-14
Posts: 338

Re: how do i move the find/replace icon?

an idea:
the plugins should only add their button if it doesn't yet exist in the toolbar!
so you can add the FR-replace - button where you need it and the plugin will use the button.
if you don't add the FR-replace to cfg.toolbar the plugin will do it for you.

all plugins would have to be rewritten, perhaps a general function would be needed.


Niko

Offline

#6 2005-05-03 03:26:08

willeffects
Xinha Authority
Registered: 2005-03-19
Posts: 130

Re: how do i move the find/replace icon?

that works i think

Offline


Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/xinha/public_html/r.f/include/parser.php on line 717

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/xinha/public_html/r.f/include/parser.php on line 774

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/xinha/public_html/r.f/include/parser.php on line 774

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/xinha/public_html/r.f/include/parser.php on line 774

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/xinha/public_html/r.f/include/parser.php on line 774

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/xinha/public_html/r.f/include/parser.php on line 774

#7 2005-05-03 04:40:15

kimss
Xinha Pro
From: Sweden
Registered: 2005-04-05
Posts: 99
Website

Re: how do i move the find/replace icon?

niko wrote:

an idea:
the plugins should only add their button if it doesn't yet exist in the toolbar!
so you can add the FR-replace - button where you need it and the plugin will use the button.
if you don't add the FR-replace to cfg.toolbar the plugin will do it for you.

all plugins would have to be rewritten, perhaps a general function would be needed.

To create a general function would be great, since the different plugins uses different
approaches...

I would think the function should :
  - Check if button already exist, and replace
  - If not, search the button array and place button infront or after
  - If all fails, add the button cowardly at the end or beginning.

I might have forgotten something, but I would think this sounds like a correct way.
Could be called like :

PlaceTheButton(buttonName,potentialReplaceNameofOtherBtn,nameOfSearchBtn,[before/after]);

Using all the parameters every time would make it very bulletproof, and easy for the
logif for the plugins. The most important thing is that the function is optimized and fast, that
it doesnt use alot of CPU cycles. But I guess scanning the button array doesnt use any CPU
anyways, and Im just not that familiar with JS and therefore is extra carefull, hehe.

Just an idea, smile

Offline

#8 2005-05-03 05:37:41

niko
Xinha Authority
From: Salzburg/Austria
Registered: 2005-02-14
Posts: 338

Re: how do i move the find/replace icon?

yep, exactly like that!
but do we really need the 2nd parameter? (potentialReplaceNameofOtherBtn)
imho it would be enough to use just the first one!

...would you create a ticket for that? or would you even start coding big_smile


Niko

Offline

#9 2005-05-03 06:27:02

kimss
Xinha Pro
From: Sweden
Registered: 2005-04-05
Posts: 99
Website

Re: how do i move the find/replace icon?

Ill create a ticket for that and I might try coding it, but my lack of really understanding the JS and the way things are buildt up Ill probably end up with a sollution that works, but could have been done much smarter. But as mentioned, I might try something later tonight, smile

regarding the second parameter I think we really do, correct me if Im wrong. Say I create a new plugin with the name "MyPlugin".

I would place the button like this as an example:

PlaceTheButton('myplugin','insertimage','before');

The pseudo logic applied would be :

We check if another button with the name myplugin exists and replace it, return true
If true; end;
If false:
  We check if we can find the button insertimage, return true
If true:
  Insert myplugin button before, end
If false:
  Insert button at the beginning of the button array, end

So as far as I can see we do need the second parameter to make this function flexible. I usually dont
config the button array, I modify the main .js file (I know, dumb). The most important is to be flexible in
my opinion.

Offline

#10 2005-05-03 12:21:06

niko
Xinha Authority
From: Salzburg/Austria
Registered: 2005-02-14
Posts: 338

Re: how do i move the find/replace icon?

yep, thats it,
start coding! big_smile
(learning by doing - or try 'n error - however you like to call it)
but the function should not be too difficult i guess...

you might want to add this function in htmlarea.js:

HTMLArea.Config.prototype.addButton = function(id, where, position) {
}

...and it should be possible that where is null so we can insert a button just at the end/beginning of the toolbar
perhaps it would be an idea to allow for the 2nd parameter an array - so the function tries to find every items in this array and stops at the first found.


Niko

Offline

#11 2005-05-05 07:51:16

onlyabill
New member
Registered: 2005-05-05
Posts: 3

Re: how do i move the find/replace icon?

While you are at it, how about support for adding a linebreak as well?  smile

Offline

Board footer

Powered by FluxBB