Topic: Anyone worked with tinyMCE plugins? (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=29933" title="Pages that link to Topic: Anyone worked with tinyMCE plugins? (Page 1 of 1)" rel="nofollow" >Topic: Anyone worked with tinyMCE plugins? <span class="small">(Page 1 of 1)</span>\

 
paritycheck
Bipolar (III) Inmate

From: you tell me
Insane since: Mar 2004

posted posted 01-29-2008 09:50

Hi guys, new issue... anyone here has any idea on creating plugins for the tinyMCE editor? I need to replicate the format painter function in microsoft outlook for tinyMCE so I'm wokring on a plug in for it.

The format painter function basically what you do is that you make a selection, and then when you click on the format painter option the style/formatting of first character/element of the selection is applied to the entire selection.

I got the how to make a selction part right but right now I'm hammering my head on trying to find out:

1. How to get the first style/formatting of the first charcter/element in the selection
2. How to apply it to the rest of the selection - (ok I kinda have an idea of how this part is doen but unless I figure out part one of the process its no point going futher.)

Any ideas guys

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 01-29-2008 10:19

I have had experience with tinyMce plugins in the past,
but your question is kind of out there somewhere way in left field .


Doesn't tiny have this 'show current tag path' plugin? You could leaverage that to get the current tag,
then retrieve it's styles, and everything should be in there, shouldn't it? (If in doubt, check how the bold button
works... it must write to the styles, mustn't it?)

So long,

->Tyberius Prime

paritycheck
Bipolar (III) Inmate

From: you tell me
Insane since: Mar 2004

posted posted 01-29-2008 10:34

Well thats the thing which bugs me... the bold button and the italic button doesn't write any style but instead they enclose the selected text in <b> or <i> tags....

So basically formatting here is a muddle of font tags and bold tags.. its terribly messed up if you ask me :-S. I was wondering why the getStyle function of teh engine woudl return an array length of over 112 elements - even though the content wsn't being set by styles at all...

Doesn't seem to be much that can be done normally...

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 01-29-2008 11:15

Life is bullshit.


If I remember correctly, tiny shouldn't use much more than <span> with class, and <b>, <i> and <u>, be default
(though that really should be <strong>, etc...). So can't you use that 'path' I talked about to get those,
than insert them appropriatly for the marked selection (and then call the tiny clean up command)?

paritycheck
Bipolar (III) Inmate

From: you tell me
Insane since: Mar 2004

posted posted 01-29-2008 11:44

The only place where tiny uses spans with classes are when you select a predefined class from the classes drop down list. However for font sizes and font colors and font faces it leaves around a huge mess of font tags. The only place where an inline tsyle is even used is either when you align the text then he puts it in a div or when you set teh background color of some text.

Just checked around and it seems that tiny invokes the DOM execCommand function for changing fonts and all... seems like this is a darn browser issue...

I can't quite see any get current tag plugin here...plus I don't know what kind of clean up the clean up messy code function does? The html is still as cluttered as ever no matter how much you click the clean up messy code button?

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 01-29-2008 11:52

depends on the settings, I believe. At least it's supposed to remove ugly ms office code .

there's an option, or a plugin that makes tiny show the current tag path... (you can then click the tag name show,
and it selects that tag in the editor...).

Honestly, you have entered a world of pain. I'm sure you're being payed to do it, but you're probably better off in the tinyMCE
forums - they actually might have a clue instead of me just guessing around from the back of my head

paritycheck
Bipolar (III) Inmate

From: you tell me
Insane since: Mar 2004

posted posted 01-29-2008 12:52

To be honest I've been lounging on the tinyMCE forums for almost half a year and so far I've managed to get no more than one reply and that too wasn't something I didn't know... I was hoping if there was any one in the asylum who had and prior experience with tinyMCE. Haven't had much luck there so to speak... its not very active with respect to replying to users queries unfortunately.

quote:
Honestly, you have entered a world of pain



You said it oh so well my friend... I wonder if there are others who have it as hard as I do...

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 01-29-2008 13:32

sure... just don't get met started about the horros of marrying kerberos and apache and ad...



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu