User:Chomtana/global.js

importArticles({   type: "script",    articles: [        //'User:Chomtana/AdvanceEditor.js'        //'w:c:dev:HTMLNoLimit/code.js'    ] });

//importScriptPage('PurgeButton/code.js', 'dev');

(function ($, mw) {   'use strict';

console.log("Chomtana Private Init Script Executed"); console.log(encodeURIComponent( mw.config.get( 'wgPageName' ) )); }(jQuery, mediaWiki));

//Section:AdvanceEditor (function ($, mw) {   var action = mw.config.get("wgAction");    console.log("Action: "+action);

$("#ca-ve-edit").click(function {       var interval = setInterval(function  { if($(".oo-ui-tool-name-wikiaSourceMode").length) { $(".oo-ui-tool-name-wikiaSourceMode").click(function {                    setTimeout(function{ enabletextareatab(".ui-autocomplete-input"); },2000);               });                clearInterval(interval); }       },1000);    });    console.log("AdvanceEditor loaded"); function enabletextareatab(selector) { if(!selector) {selector = 'textarea';} $(selector).css("-moz-tab-size",'4'); $(selector).css("-o-tab-size",'4'); $(selector).css("tab-size",'4'); $(selector).bind('keydown',function (e) {           var keyCode = e.keyCode || e.which;            if (keyCode == 9) {                e.preventDefault;                var start = $(this).get(0).selectionStart;                var end = $(this).get(0).selectionEnd;                var text = $(this).val.substring(start, end).split("\n"); //selection text                var linecount = text.length;                for(var i = 0;i<text.length;i++) {                    text[i] = "\t"+text[i];                }                text = text.join("\n");                $(this).val($(this).val.substring(0, start) //before selection + text //selection + $(this).val.substring(end)); //after selection               // put caret at right position again                $(this).get(0).selectionStart = start;                $(this).get(0).selectionEnd = end + linecount;            }        }); } }(jQuery, mediaWiki));

/*(function ($, mw) {	$('.html').each(function(index) { $(this).html(); $(this).append($(this).attr("data-html")); }); }(jQuery, mediaWiki));*/