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"); //enabletextareatab code function enabletextareatab___onkeydown(t){var e=t.keyCode||t.which;if(9==e){t.preventDefault;for(var s=$(this).get(0).selectionStart,n=$(this).get(0).selectionEnd,i=$(this).val.substring(s,n).split("\n"),a=i.length,o=s==n,l=0;l<i.length;l++)t.shiftKey?o?"	"==$(this).val.substring(s-1,s)&&s--:i[l].startsWith("	")&&(i[l]=i[l].substring(1)):i[l]="	"+i[l];i=i.join("\n"),$(this).val($(this).val.substring(0,s)+i+$(this).val.substring(n)),t.shiftKey?o?s!=n&&($(this).get(0).selectionStart=s,$(this).get(0).selectionEnd=n-1):($(this).get(0).selectionStart=s,$(this).get(0).selectionEnd=n-a):o?($(this).get(0).selectionStart=s+1,$(this).get(0).selectionEnd=n+1):($(this).get(0).selectionStart=s,$(this).get(0).selectionEnd=n+a)}}function enabletextareatab(t){t||(t="textarea"),$(t).css("-moz-tab-size","4"),$(t).css("-o-tab-size","4"),$(t).css("tab-size","4"),$(t).unbind("keydown",enabletextareatab___onkeydown),$(t).bind("keydown",enabletextareatab___onkeydown)} }(jQuery, mediaWiki));

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