upgrading tinymce editor and tinymce plugins in zotero standalone

226 views
Skip to first unread message

dl6...@gmail.com

unread,
Sep 16, 2016, 5:27:02 AM9/16/16
to zotero-dev
I was hoping that the forthcoming release of zotero version 5.0 might upgrade the tinymce editor so that additional plugins might be installed.
However, inspecting tiny_mce.js in the downloaded zotero-5.0-alpha.xpi I see no change in tinymce version.

var tinymce = {
 majorVersion
: '3',
 minorVersion
: '5.7',
 releaseDate
: '2012-09-20',

And the original file tiny_mce.js was extensively edited by Dan S.

After I read this very old thread (2009) ...

https://forums.zotero.org/discussion/8784/howto-enable-additional-tinymce-note-editor-functionality/

I decided to experiment to see if I could manually upgrade tinymce (3.5.7) to latest version 4.4.3.
Anyone following this experiment should note that some of the tinymce paths described in above thread have been changed .. e.g. “js” folder is now “jscripts”

I got as far as upgrading tinymce in zotero.jar (in zotero standalone) but on launching zotero the notes window is completely blank. 
This is to be expected since the (Dan S.) zotero edits have not yet been applied to tinymce.min.js (which I beautified to be tinymce.max.js).

For now I am not using the jQuery wrapper in jquery.tinymce.min.js.

I know that I could try the dated plugins which are archived here ...

http://archive.tinymce.com/download/older.php

In fact I downloaded tinymce_3.5.8.zip to view the old plugins folder. (version 3.5.7 used by zotero is not listed in tinymce archives).

But I would like to try a more up to date library of tinymce plugins integrated into Zotero standalone.

My questions: 

Is it feasible to migrate the js edits from tinymce version 3.5.7 to version 4.4.3 to allow latest plugins to be used in notes editor in zotero 5.0?

Could Dan S. migrate the 3.5.7 edits into 4.4.3 javascript?   Or at least explain what edits are needed in tinymce.max.js?

D L

unread,
Sep 17, 2016, 2:30:57 PM9/17/16
to zotero-dev

I have made some progress.   I have hacked zotero.jar so that the tinymce editor shown in Zotero is now latest version 4.4.3.

I can add text to the tinymce window, but when I click on "Edit in separate window" in Zotero window only a default tinymce editor window opens (i.e. no edited content).

And there seems to be no communication between tinymce window and Zotero by javascript.  The edited note content is not saved by Zotero.

My guess is that I am missing some edits in either tinymce.min.js or note.html, noteview.html, integration.html. What is the function of noteview.html, integration.html?

Some pointers to the javascript communication protocol needed between tinymce and Zotero standalone would help to crack this.




D L

unread,
Oct 1, 2016, 11:39:16 AM10/1/16
to zotero-dev
I'll close this thread by explaining what I did.

(a) I gave up trying to understand how amend the javascript in tiny_mce.js introduced by author Dan S.

(b) Instead I edited /resource/tinymce/note.html panel to have a button to launch a new window.

(c) In the popup window I introduced a later version of tinymce editor (4.4.3)

(d) I was able to copy contents of tinymce 3.5.7 text editor into tinymce 4.4.3text  editor in the popup window.

(e) The added programs (tiny 4.4.3 and others) are placed in new folder /resource/external_apps

(f) Now I can develop plugins to go into tinymce 4.4.3 to apply to the text content

(g) when finished the edited content is copied back into tinymce 3.5.7 window and the note disappears into the zotero ecosystem.

....

This work around allows me to develop added functionality in a sandbox which runs in a separate window. Minimal changes to Zotero required.

For example I want to extend further the PDF annotations held in notes.


Reply all
Reply to author
Forward
0 new messages