/** * The Indexmenu Wizard * * @author Gerrit Uitslag * based on Linkwiz by * @author Andreas Gohr * @author Pierre Spring * and the concepts of the old indexmenu wizard */ const indexmenu_wiz = { $wiz: null, timer: null, textArea: null, defaulttheme: 'default', fields: { div1: { elems: { jstoggle: {label: 'js'} } }, div2: { tlbclass: 'jsitem theme', elems: { el1: {headerid: 'theme'} } }, div3: { elems: { el2: {headerid: 'navigation'}, navbar: {}, context: {}, nocookie: {tlbclass: 'jsitem'}, noscroll: {tlbclass: 'jsitem'}, notoc: {tlbclass: 'jsitem'} } }, div4: { elems: { el3: {headerid: 'sort'}, tsort: {}, dsort: {}, msort: {}, hsort: {}, rsort: {}, nsort: {} } }, div5: { elems: { el4: {headerid: 'filter'}, nons: {}, nopg: {} } }, div6: { tlbclass: 'jsitem', elems: { el5: {headerid: 'performance'}, max: {tlbclass: 'jsitem', numberinput: ['maxn', 'maxm']}, maxjs: {tlbclass: 'jsitem', numberinput: ['maxjsn']}, id: {tlbclass: 'jsitem', numberinput: ['idn']} } } }, /** * Initialize the indexmenu_wiz by creating the needed HTML * and attaching the eventhandlers */ init: function ($editor) { // position relative to the text area const pos = $editor.position(); // create HTML Structure indexmenu_wiz.$wiz = jQuery(document.createElement('div')) .dialog({ autoOpen: false, draggable: true, title: LANG.plugins.indexmenu.indexmenuwizard, resizable: false }) .html( '
' + LANG.plugins.indexmenu.index + '' + '
' + '
' + '
' + '
' + LANG.plugins.indexmenu.options + '' + '
' + '' + '
' + '' + '' + '
' ) .parent() .attr('id', 'indexmenu__wiz') .css({ 'position': 'absolute', 'top': (pos.top + 20) + 'px', 'left': (pos.left + 80) + 'px' }) .hide() .appendTo('.dokuwiki:first'); indexmenu_wiz.textArea = $editor[0]; let $opt_fieldset = jQuery('#indexmenu__wiz fieldset.indexmenu_options'); jQuery.each(indexmenu_wiz.fields, function (i, section) { let div = jQuery('
').addClass(section.tlbclass); jQuery.each(section.elems, function (elid, props) { if (props.headerid) { div.append('' + LANG.plugins.indexmenu[props.headerid] + '
'); } else { let label = props.label || elid; //checkbox jQuery("