Bots, Bureaucrats, Comment administrators, Interface administrators, Moderators, Suppressors, Administrators
4,017
edits
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
/* Any JavaScript here will be loaded for all users on every page load. */ | /* Any JavaScript here will be loaded for all users on every page load. */ | ||
$('#mw-content-text').not(":has('#editform')").each(function(){ | $('#mw-content-text').not(":has('#editform')").each(function(){ | ||
$(this).html(farsi_number($(this).html())); | |||
}) | }) | ||
function farsi_number(html_string){ | function farsi_number(html_string){ | ||
html_array=html_string.split(""); | |||
var in_tag=false; | |||
if(html_array){ | |||
for(var x in html_array){ | |||
character=html_array[x]; | |||
if(character=='<'){ | |||
in_tag=true;continue; | |||
} | |||
if(character==">"){ | |||
in_tag=false;continue; | |||
} | |||
if(!in_tag){ | |||
character=num۲fa(character); | |||
html_array[x]=character; | |||
} | |||
} | |||
html_string=html_array.join(""); | |||
} | |||
return html_string; | |||
} | } | ||
function num۲fa(string){ | function num۲fa(string){ | ||
farsi_array=new Array("۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"); | |||
english_array=new Array("0","1","2","3","4","5","6","7","8","9"); | |||
for(var x in english_array){ | |||
string=string.replace(new RegExp(english_array[x],"g"),farsi_array[x]); | |||
} | |||
return string; | |||
} | } | ||
Line 244: | Line 244: | ||
$( createNavigationBarToggleButton ); | $( createNavigationBarToggleButton ); | ||
$(window).on('load', function(){ | |||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | |||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | |||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); | |||
ga('create', 'UA-85669311-1', 'auto'); | |||
ga('send', 'pageview'); | |||
}) |