xref: /plugin/struct/script.js (revision eed15625baa434b1d90c798eef01cd22f51693b2)
1jQuery(function(){
2    'use strict';
3
4    jQuery('input.struct_date').datepicker({
5        dateFormat: 'yy-mm-dd'
6    });
7
8    jQuery('button.struct_img').click(function (event) {
9        var input_id = event.target.id.substr(0,event.target.id.length-'Button'.length);
10        window.open(
11            DOKU_BASE+"lib/exe/mediamanager.php?ns=:"+'&edid='+encodeURIComponent(input_id) + '&onselect=insertStructImage',
12            'mediaselect',
13            'width=750,height=500,left=20,top=20,scrollbars=yes,resizable=yes'); //
14    });
15
16    window.insertStructImage = function(edid, mediaid, opts, align) {
17        jQuery('#'+edid).val(mediaid).change();
18    };
19});
20