אונטערשייד צווישן ווערסיעס פון "מעדיעוויקי:Ref2template.js"

log off; מינימאלע אפטימיזאציעס
(log)
(log off; מינימאלע אפטימיזאציעס)
 
שורה 1: שורה 1:
if ($.inArray(mw.config.get('wgAction'), ['edit', 'submit']) + 1) {
    console.log("Current action:", mw.config.get('wgAction'));
     $('#wpTextbox1').on('wikiEditor-dialogs-loaded-insert-reference', function () {
     $('#wpTextbox1').on('wikiEditor-dialogs-loaded-insert-reference', function () {
        console.log("WikiEditor dialog loaded");
         $('#wikieditor-toolbar-reference-dialog').on('dialogopen', function () {
         $('#wikieditor-toolbar-reference-dialog').on('dialogopen', function () {
            console.log("Reference dialog opened");
             var
             var
                 dialog = $(this).parent(),
                 dialog = $(this).parent(),
שורה 20: שורה 16:
                             + ($.trim(refName) ? 'שם=' + refName + '|' : '')
                             + ($.trim(refName) ? 'שם=' + refName + '|' : '')
                             + (/=/.test(refContent) ? '1=' : '');
                             + (/=/.test(refContent) ? '1=' : '');
                    console.log("Reference content:", refContent);
                    console.log("Reference name:", refName);
                    console.log("Whitespace:", whitespace);
                    console.log("Attributes:", attributes);
                    console.log("Reference prefix:", refPrefix);
                     // Close the dialog
                     // Close the dialog
                     $this.dialog('close');
                     $this.dialog('close');
                    console.log("Dialog closed");
                     $.wikiEditor.modules.toolbar.fn.doAction(
                     $.wikiEditor.modules.toolbar.fn.doAction(
                         $this.data('context'),
                         $this.data('context'),
שורה 40: שורה 30:
                         $this
                         $this
                     );
                     );
                    console.log("Action performed");
                     // Restore form state
                     // Restore form state
                     $('#wikieditor-toolbar-reference-text').val('');
                     $('#wikieditor-toolbar-reference-text').val('');
                    console.log("Form state restored");
                     $('#' + refnameId).val('');
                     $('#' + refnameId).val('');
                 };
                 };
שורה 60: שורה 48:
     $(function () {
     $(function () {
         mw.hook('wikiEditor.toolbarReady').add(function ($textarea) {
         mw.hook('wikiEditor.toolbarReady').add(function ($textarea) {
        console.log("Toolbar ready");
             var action = $('[rel=reference]').data('action'),
             var action = $('[rel=reference]').data('action'),
                 options = (action || {}).options;
                 options = (action || {}).options;
            console.log("Reference action:", action);
            console.log("Reference options:", options);
             if (options) {
             if (options) {
                 options.pre = '{{הערה|1=';
                 options.pre = '{{הערה|1=';
שורה 70: שורה 55:
             }
             }
             action = $('[rel=newline]').data('action');
             action = $('[rel=newline]').data('action');
            console.log("Newline action:", action);
             options = (action || {}).options;
             options = (action || {}).options;
            console.log("Newline options:", options);
             if (options)
             if (options)
                 options.pre = '{{ש}}\n';
                 options.pre = '{{ש}}\n';
שורה 80: שורה 63:
                 });
                 });
         });
         });
     })
     });
}