الفرق بين المراجعتين لصفحة: «ميدياويكي:Common.js»

تم حذف المحتوى تمت إضافة المحتوى
update
Removed redundant, useless and obsolete code; minor cleanups
سطر 1:
/* الجافاسكريبت الموضوع هنا سيتم تحميله لكل المستخدمين مع كل تحميل للصفحة. */
/* {{interwiki-all|Mediawiki:Common.js}}
<pre dir="ltr">
*/
 
// import scripts for Interwiki Transclusion from //wikisource.org/wiki/Wikisource:Shared_Scripts
السطر 8 ⟵ 5:
mw.loader.load('//wikisource.org/w/index.php?title=MediaWiki:InterWikiTransclusion.js&action=raw&ctype=text/javascript');
 
/* plus tab for beer parlour and tea room */
 
function addPlusToBeerParlour() {
// get page title
var pagetitle = document.getElementById('content').getElementsByTagName('h1').item(0).firstChild.nodeValue;
 
// is this the beer parlour (in normal mode)?
if ((pagetitle.search(/^Wiktionary:Beer parlour$/) != -1) || (pagetitle.search(/^Wiktionary:Tea room$/) != -1)) {
 
// find the spot to add our new tab
var edittabli = document.getElementById('ca-edit');
 
// create the plus tab
var plustabli = document.createElement('li');
plustabli.id = 'ca-addsection';
var plustablink = document.createElement('a');
 
plustablink.href = '/w/index.php?title=' + pagetitle + '&action=edit&section=new';
plustablink.appendChild(document.createTextNode('+'));
plustabli.appendChild(plustablink);
 
// add the plus tab
edittabli.className = 'istalk';
edittabli.parentNode.insertBefore(plustabli, edittabli.nextSibling);
}
}
 
 
/* select subsection of special characters */
 
function chooseCharSubset(s) {
var l = document.getElementById('editpage-specialchars').getElementsByTagName('p');
for (var i = 0; i < l.length ; i++) {
l[i].style.display = i == s ? 'inline' : 'none';
l[i].style.visibility = i == s ? 'visible' : 'hidden';
}
}
 
/* do any Wiktionary-specific customizations */
function customizeWiktionary() {
addPlusToBeerParlour();
 
//this throws a javascript error because the function does not exist. I'm just commenting it out 'cause I don't know what it's for
//addCharSubsetMenu();
}
 
jQuery(document).ready(customizeWiktionary);
 
/* Remember to keep [[MediaWiki:Standard.js]] in sync with this, for classic style! */
السطر 176 ⟵ 126:
}
 
aOnloadFunctions[aOnloadFunctions.length]$( =document ).ready( createNavigationBarToggleButton );
 
// END Dynamic Navigation Bars
السطر 324 ⟵ 274:
}
 
addOnloadHook$( document ).ready( DisplayFooter );
/* Footnotes as tooltip - from wikisource.org */
addOnloadHook$( document ).ready( function ()
{
sups = document.getElementsByTagName("sup");