1/* DOKUWIKI:include_once jquery.imagemapster.js */
2/* DOKUWIKI:include ImageMappingEditor.js */
3
4(function ($) {
5
6    $(function () {
7        $('img[usemap]').mapster({
8            fillColor: 'ffffff',
9            fillOpacity: 0.1,
10            wrapClass: true,
11            wrapCss: true,
12            stroke: true,
13            strokeColor: "3320FF",
14            strokeOpacity: 0.8,
15            strokeWidth: 4,
16            clickNavigate: true
17        });
18    });
19
20    $(window).resize(function () {
21        $('img[usemap]').each(function () {
22            $(this).mapster('resize', $(this.offsetParent).width());
23        });
24    });
25
26})(jQuery);
27
28
29
30function addBtnActionImagemap(btn, props, edid) {
31    jQuery(btn).on('click', function () {
32        // get current selection
33        const area = document.getElementById(edid);
34        const sel = DWgetSelection(area);
35        new ImageMappingEditor(sel);
36    });
37}
38