Skip to content

Customize plugin with conf/userscript.js #19

@suedunham

Description

@suedunham

Please forgive a javascript noob. Working with the newest Greebo version, I'd like to customize the plugin by changing the fill opacity. This can be done by modifying the line fillOpacity: 0.1, in lib/plugins/imagemapping/script.js, but that is susceptible to being overwritten by new versions of the plugin. Alternately, I can copy the contents of that file into conf/userscript.js, make that change there, and redirect the include in the first line by changing it to /* DOKUWIKI:include_once ../lib/plugins/imagemapping/jquery.imagemapster.js */. However, this only works if I also rename the script.js file to something else so that both files do not load. Otherwise, errors like the following occur, with property '0' being the first area in the map, property '1' the second, etc.

js.php?t=bootstrap3&tseed=65a13deae29e496ab72baeefd4aa8b21:1 Uncaught TypeError: Cannot read property '1' of null
    at u.MapData.getAllDataForArea (js.php?t=bootstrap3&tseed=65a13deae29e496ab72baeefd4aa8b21:1)
    at HTMLAreaElement.r (js.php?t=bootstrap3&tseed=65a13deae29e496ab72baeefd4aa8b21:1)
    at HTMLAreaElement.n.mouseover (js.php?t=bootstrap3&tseed=65a13deae29e496ab72baeefd4aa8b21:1)
    at HTMLAreaElement.dispatch (jquery.php?tseed=23f888679b4f1dc26eef34902aca964f:3)
    at HTMLAreaElement.q.handle (jquery.php?tseed=23f888679b4f1dc26eef34902aca964f:3)

Obviously, there's something fundamental I don't understand about using conf/userscript.js. I'm hoping to load my script over the plugin's script and so replace it, but either I'm not yet doing it right or that's just now how this is supposed to be used.

What should I put in conf/userscript.js to interact with lib/plugins/imagemapping/script.js without conflicting with it? Does Hogfather change anything about this?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions