Permanently save customization of the zotero.jar (tinyMCE)

I customized some files in the zotero.jar but I have to do it again after each update because I loose all my change (partial update fails each time, maybe because of the edits).
So my question is: is there a way to save this change permanently?

I customized these files:

+ zotero.jar\resource\tinymce\note.html
I added a custom plugin that add keyboard shortcut with e.addShortcut (font color/size, highlight… ) and that create a mouse hover tooltip. I follow this code: https://github.com/Gettyk/TinyMCE-plugin/tree/master/custom_plug

+ zotero.jar\resource\tinymce\css\note-ui.css :
I added new css rules to be able to move the "search and replace pop up" around ex:
.mce-window {
width: 300px; /* xedit was set to : auto !important; */
background: none !important;
position: fixed; /* xedit*/
top: 0; /* xedit*/
right: 0; /* xedit*/

}

+ zotero.jar\resource\tinymce\tinymce.js
I modified the removeformat and the subscript and superscript:
- I added a font-size rule for the subscript and superscript ( I tried to add subscript {font-size: 70%} in extensions.zotero.note.css of about:config but it did not work )
- I added these html tags in "selector" of removeformat: h1, h2, h3, h4, h5, h6 (I don't know how to add it to about:config)

Is there a way to save this change in the profile folder or as an external plugin or any other solution that doesn't require me to rewrite them after each udpdate?
  • The canonical way to do this on macOS or Linux would be with a shell script and some command-line utilities: 'diff', 'patch', 'zip', 'unzip'. If you're on Windows, you could get those by installing Cygwin.

    Basically, you'd generate a diff with some additional context lines, and then you'd have a script that unzipped the .jar file, applied the patch, and rezipped it. So when a new release came out, it would just take a second to update it with your changes.

    That's not something we can help with, but it would be trivial to set up for someone comfortable with command-line tools.
  • Here is a python script I've used in the past to make similar changes inside the zotero.jar file:
    https://gist.github.com/bwiernik/45f514da37af92491893f2f7212710f9
  • Thanks a lot dstillman and bwiernik! I wasn't able to make it work with 'diff' and 'patch', but bwiernik, your python script is a gem!

    Here is what I ended up doing : https://pastebin.com/vU8FXiDy

    I am so happy, no more struggle with copy/find the code/paste!
Sign In or Register to comment.