Using the JS include statement in plugins

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Sat Feb 25 08:18:06 UTC 2017


Hi!

On Thu, 23 Feb 2017 19:20:48 +0100
Alfredo Sánchez Alberca <asalber at ceu.es> wrote:
> I'm having some trouble following the indications of
> https://api.kde.org/doc/ rkwardplugins/include_js.html to include a
> generic javascript file inside the javascript file of a plugin.
> 
> Just to illustrate the problem, assume you have a plugin foo.

Have you actually tried your minimal example? For me it just works.

If there is an error finding / loading the included file itself, you
should get an error message for that, when starting the plugin. You can
test this very easily by trying to include a non-sense file name.

However, I suspect the problem is that the include statement never gets
run at all. While factoring out common code between several
similar plugins (which is the whole point of the include statement),
it's easy to look at the wrong file without noting... Another common
trap is to be working on a local working copy of a plugin, while rkward
is loading a different version of the plugin from an installed
location. If unsure, try inserting some code that will have a visible
effect (such as producing an error).

Regards
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://mail.kde.org/pipermail/rkward-devel/attachments/20170225/6645d62d/attachment.sig>


More information about the rkward-devel mailing list