Hi BJ

> To add and extension to ckeditor, the extensions js may refer to an
external file for the icon image, this must be removed

I think the two code samples are the same?

> Maybe a 'patch' field (in the tiddler to be patched) could be used,
containing a regular expression, that the deserialiser would run against
the tiddler's text?

I'd be concerned that that solution is a bit hacky. Could you perhaps
override CKEDITOR.plugins.add to patch the init method and then, when it is
called, override hackButton()?

Best wishes

Jeremy





On Wed, Mar 26, 2014 at 11:11 AM, BJ <[email protected]> wrote:

>
>
> To add and extension to ckeditor, the extensions js may refer to an
> external file for the icon image, this must be removed
>
> ------
>
> replace
>
>             editor.ui.addButton('oembed', {
>                 label: editor.lang.oembed.button,
>
>                 command: 'oembed',
>
>                 icon: this.path + "icons/" + (CKEDITOR.env.hidpi ?
> "hidpi/" : "") + "oembed.png"
>             });
>
> with
>
>             myhack(editor.ui.addButton,'oembed', {
>                 label: editor.lang.oembed.button,
>
>                 command: 'oembed',
>
>                 icon: this.path + "icons/" + (CKEDITOR.env.hidpi ?
> "hidpi/" : "") + "oembed.png"
>             });
>
> and in my code
>
> function myhack(truefunc, params)
> {
> //delete icon entry then
> truefunc.call(this, params)
> }
>
>
> the structure 'editor.ui' is passed into the init function (from the
> ckeditor lib), which makes it difficult to override:
>
> (function () {
>     CKEDITOR.plugins.add('oembed', {
>         icons: 'oembed',
>         hidpi: true,
>         requires: 'widget,dialog',
>         lang: ['de', 'en', 'fr', 'nl', 'pl', 'pt-br', 'ru'],
>         version: 1.13,
>         init: function (editor) {
>
>
> I can call my patch function from within my plug, but would rather there
> was a 'core' patch mechanism
>
>  --
> You received this message because you are subscribed to the Google Groups
> "TiddlyWikiDev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/tiddlywikidev.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Jeremy Ruston
mailto:[email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/d/optout.

Reply via email to