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

log off; מינימאלע אפטימיזאציעס
אין תקציר עריכה
(log off; מינימאלע אפטימיזאציעס)
 
(2 צווישנדיגע ווערסיעס פונעם זעלבן באַניצער נישט געוויזן)
שורה 1: שורה 1:
if ($.inArray(mw.config.get('wgAction'), ['edit', 'submit']) + 1) {
    console.log("Current action:", mw.config.get('wgAction'));
    console.log($('#wpTextbox1').length);
     $('#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(),
שורה 21: שורה 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'),
שורה 41: שורה 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('');
                 };
                 };
שורה 58: שורה 45:
         });
         });
     });
     });
     $(function () {
     $(function () {
         var action = $('[rel=reference]').data('action'),
         mw.hook('wikiEditor.toolbarReady').add(function ($textarea) {
            var action = $('[rel=reference]').data('action'),
                options = (action || {}).options;
            if (options) {
                options.pre = '{{הערה|1=';
                options.post = '}}';
            }
            action = $('[rel=newline]').data('action');
             options = (action || {}).options;
             options = (action || {}).options;
        console.log("Reference action:", action);
             if (options)
        console.log("Reference options:", options);
                options.pre = '{{ש}}\n';
        if (options) {
            else
             options.pre = '{{הערה|1=';
                $('#wpTextbox1').on('wikiEditor-toolbar-buildSection-advanced', function (e, d) {
            options.post = '}}';
                    d.groups.format.tools.newline.action.options.pre = '{{ש}}\n';
        }
                });
        action = $('[rel=newline]').data('action');
        });
        console.log("Newline action:", action);
    });
        options = (action || {}).options;
        console.log("Newline options:", options);
        if (options)
            options.pre = '{{ש}}\n';
        else
            $('#wpTextbox1').on('wikiEditor-toolbar-buildSection-advanced', function (e, d) {
                d.groups.format.tools.newline.action.options.pre = '{{ש}}\n';
            });
    })
}