where to store the JS files of extensions ?

hi,

my question is about how to handle extension files.
where i have to place my JS config file about an extension to not lose it after each phpmaker generate process ?

exemple, for a extension (such tinymce), i modify the extension js eweditor.js from my local server.


i noticed, some extensions have there own tab “advanced” in phpmaker interface, so we can configure some options there.
but not all extension have his phpmaker tab to store specials options, so we have to write it in the code : the eweditor.js by example.

once i redo a generation process, i lose my changes in it !
so, where i have to store in under my phpmaker project to not lose it?

Best regards

To change tinymce config you better use the “create” event triggered by the extension, e.g.

$(document).on(“create.editor”, function(args) {
if (args.id == “x_myfield”) {
args.settings.xxx = “…”;

}
});

You may put your code in the page’s Client Script.

thank you for your advice, it is kind to help.

but if i want to change the whole configs of all fields in any tables, is there a way to do that in one time ? (that is why i alter the eweditor.js directly)

Then just put code in global Client Script and don’t check field, that is, remove the condition: if (args.id == “x_myfield”).

hi again,

so i can’t manage to do it myself.
so i find another way :
modify directly the js file into the zip extension.

it would have be good if each plugins have it own external .js file from phpmaker interface…

or a external js file (like the css one) which would gather all setting from plugins.
changing a setting is very “hard” because you have to re-generate each time again and again…
and the final rendered js is not good-loooking (all the code compacted in one-single line without indent) wo you can test-it in real time using F5 key in the browser…

  1. If you modify the eweditor.js in the extension, there is no need to generate again at all,
  2. You may click Tools → Advanced Settings, disable “Compress project .js” if you don’t want compressed .js.