Difference between revisions of "MediaWiki:Common.js"

From Ryzom Commons

Jump to: navigation, search
m
m
Line 2: Line 2:
 
/* <nowiki> */
 
/* <nowiki> */
 
function FillUploadForm() {
 
function FillUploadForm() {
 +
if(wgCanonicalSpecialPageName == "Upload") {
 
uploadDesc = document.getElementById('wpUploadDescription');
 
uploadDesc = document.getElementById('wpUploadDescription');
 
uploadDesc.rows = 14;
 
uploadDesc.rows = 14;
 
uploadDesc.cols = 90;
 
uploadDesc.cols = 90;
if(wgCanonicalSpecialPageName == "Upload" && document.getElementById('wpDestFile').value == "") {
+
if(document.getElementById('wpDestFile').value == "") {
 
uploadDesc.innerHTML = "<!-- Please categorize your uploads! -->\n<!-- An example is right below; just uncomment it to get started! -->\n<!-- [[Category:Ryzom Forge images]] -->\n\n{{Information\n|description=\n|source=\n|date=\n|author=\n|permission=\n|other_versions=\n|tags=\n}}";
 
uploadDesc.innerHTML = "<!-- Please categorize your uploads! -->\n<!-- An example is right below; just uncomment it to get started! -->\n<!-- [[Category:Ryzom Forge images]] -->\n\n{{Information\n|description=\n|source=\n|date=\n|author=\n|permission=\n|other_versions=\n|tags=\n}}";
 +
}
 
}
 
}
 
}
 
}
 
addOnloadHook( FillUploadForm );
 
addOnloadHook( FillUploadForm );
 
/* </nowiki> */
 
/* </nowiki> */

Revision as of 03:57, 6 August 2014

/* Any JavaScript here will be loaded for all users on every page load. */
/* <nowiki> */
function FillUploadForm() {
if(wgCanonicalSpecialPageName == "Upload") {
uploadDesc = document.getElementById('wpUploadDescription');
uploadDesc.rows = 14;
uploadDesc.cols = 90;
if(document.getElementById('wpDestFile').value == "") {
uploadDesc.innerHTML = "<!-- Please categorize your uploads! -->\n<!-- An example is right below; just uncomment it to get started! -->\n<!-- [[Category:Ryzom Forge images]] -->\n\n{{Information\n|description=\n|source=\n|date=\n|author=\n|permission=\n|other_versions=\n|tags=\n}}";
}
}
}
addOnloadHook( FillUploadForm );
/* </nowiki> */