مستخدم:WOSlinker/common.js
![]() | الملف المصاحب .css لهذا المظهر يمكن إضافته إلى في مستخدم:WOSlinker/common.css. |
ملاحظة: بعد الحفظ، قد يلزمك إفراغ الكاش لرؤية التغييرات.
function font_queryString(p) {
var re = RegExp('[&?]' + p + '=([^&]*)');
var matches;
if (matches = re.exec(document.location)) {
try {
return decodeURI(matches[1]);
} catch (e) { }
}
return null;
}
//Add a 'font edit' tab
if(mw.config.get('wgArticleId') != 0 ) {
$( function fontEditButton() {
mw.util.addPortletLink('p-cactions',
mw.util.getUrl(null,{action:'edit',font:true}),
'font',
'p-font',
'font edit6');
}
)}
if(mw.config.get('wgAction') == 'edit' && font_queryString('font') == 'true') {
$(function font() {
var myContent = document.getElementById('wpTextbox1').value;
myContent = myContent.replace(/\<font *color *\= *\" *[Bb]lack *\"\>\[\[([^\]]*?)\|([^\]]*?)\]\]\<\/font\>/g,'[[$1|$2]]');
myContent = myContent.replace(/\<font *color *\= *\" *[Bb]lack *\"\>\[\[([^\]]*?)\]\]\<\/font\>/g,'[[$1]]');
myContent = myContent.replace(/\<font *color *\= *\" *[Bb]lack *\"\>\[\[([^\]]*?)\|([^\]]*?)\]\]\n/g,'[[$1|$2]]\n');
myContent = myContent.replace(/\<font *color *\= *\" *[Bb]lack *\"\>\[\[([^\]]*?)\]\]\n/g,'[[$1]]\n');
myContent = myContent.replace(/\<font *color *\= *\" *[Bb]lack *\"\>([^\]]*?)\n/g,'$1\n');
myContent = myContent.replace(/\<font *color *\= *\"\#([\d\w]*)\"\>\[\[([^\]]*?)\|([^\]]*?)\]\]\<\/font\>/g,'[[$2|<font color="#$1">$3</font>]]');
myContent = myContent.replace(/\<font *color *\= *\"\#([\d\w]*)\"\>\[\[([^\]]*?)\]\]\<\/font\>/g,'[[$2|<font color="#$1">$2</font>]]');
myContent = myContent.replace(/\<font *color *\= *\#([\d\w]*)\>\[\[([^\]]*?)\|([^\]]*?)\]\]\<\/font\>/g,'[[$2|<font color="#$1">$3</font>]]');
myContent = myContent.replace(/\<font *color *\= *\#([\d\w]*)\>\[\[([^\]]*?)\]\]\<\/font\>/g,'[[$2|<font color="#$1">$2</font>]]');
myContent = myContent.replace(/\<font *color *\= *\"([\w ]*)\"\>\[\[([^\]]*?)\|([^\]]*?)\]\]\<\/font\>/g,'[[$2|<font color="$1">$3</font>]]');
myContent = myContent.replace(/\<font *color *\= *\"([\w ]*)\"\>\[\[([^\]]*?)\]\]\<\/font\>/g,'[[$2|<font color="$1">$2</font>]]');
myContent = myContent.replace(/\<font *color *\= *([\w]*)\>\[\[([^\]]*?)\|([^\]]*?)\]\]\<\/font\>/g,'[[$2|<font color=$1>$3</font>]]');
myContent = myContent.replace(/\<font *color *\= *([\w]*)\>\[\[([^\]]*?)\]\]\<\/font\>/g,'[[$2|<font color=$1>$2</font>]]');
myContent = myContent.replace(/\<font *color *\= *\"\#([\d\w]*)\"\>\[\[([^\]]*?)\|([^\]]*?)\]\]\n/g,'[[$2|<font color="#$1">$3</font>]]\n');
myContent = myContent.replace(/\<font *color *\= *\"\#([\d\w]*)\"\>\[\[([^\]]*?)\]\]\n/g,'[[$2|<font color="#$1">$2</font>]]\n');
myContent = myContent.replace(/\<font *color *\= *\#([\d\w]*)\>\[\[([^\]]*?)\|([^\]]*?)\]\]\n/g,'[[$2|<font color="#$1">$3</font>]]\n');
myContent = myContent.replace(/\<font *color *\= *\#([\d\w]*)\>\[\[([^\]]*?)\]\]\n/g,'[[$2|<font color="#$1">$2</font>]]\n');
myContent = myContent.replace(/\<font *color *\= *\"([\w ]*)\"\>\[\[([^\]]*?)\|([^\]]*?)\]\]\n/g,'[[$2|<font color="$1">$3</font>]]\n');
myContent = myContent.replace(/\<font *color *\= *\"([\w ]*)\"\>\[\[([^\]]*?)\]\]\n/g,'[[$2|<font color="$1">$2</font>]]\n');
myContent = myContent.replace(/\<font *color *\= *([\w]*)\>\[\[([^\]]*?)\|([^\]]*?)\]\]\n/g,'[[$2|<font color=$1>$3</font>]]\n');
myContent = myContent.replace(/\<font *color *\= *([\w]*)\>\[\[([^\]]*?)\]\]\n/g,'[[$2|<font color=$1>$2</font>]]\n');
if(document.getElementById('wpTextbox1').value != myContent) {
document.getElementById('wpTextbox1').value=myContent;
document.getElementById('wpSummary').value='font [[Special:LintErrors/tidy-font-bug|lint]]';
document.getElementById('wpMinoredit').checked = true;
}
}
)}