MediaWiki:Gadget-DotsSyntaxHighlighter.js: Difference between revisions

m
no edit summary
mNo edit summary
mNo edit summary
Line 1: Line 1:
$(function() {
$(function() {
    //enable the highlighter only when editing wikitext pages
    //in the future a separate parser could be added for CSS and JS pages
    //blacklist Internet Explorer and Edge, they're just too broken
    var wgAction = mw.config.get("wgAction");
    var layoutEngine = $.client.profile().layout;
    if ((wgAction == "edit" || wgAction == "submit") && mw.config.get("wgPageContentModel") == "wikitext" && layoutEngine != "trident" && layoutEngine != "edge")
    {
        setup();
    }
    else
    {
        return;
    }
     //variables that are preserved between function calls
     //variables that are preserved between function calls
     var wpTextbox0;
     var wpTextbox0;
Line 652: Line 638:
         highlightSyntaxIfNeededIntervalID = setInterval(highlightSyntaxIfNeeded, 500);
         highlightSyntaxIfNeededIntervalID = setInterval(highlightSyntaxIfNeeded, 500);
         highlightSyntax();
         highlightSyntax();
    }
    //enable the highlighter only when editing wikitext pages
    //in the future a separate parser could be added for CSS and JS pages
    //blacklist Internet Explorer and Edge, they're just too broken
    var wgAction = mw.config.get("wgAction");
    var layoutEngine = $.client.profile().layout;
    if ((wgAction == "edit" || wgAction == "submit") && mw.config.get("wgPageContentModel") == "wikitext" && layoutEngine != "trident" && layoutEngine != "edge")
    {
        setup();
    }
    else
    {
        return;
     }
     }
});
});