Revision as of 22:31, 27 April 2009 view sourceAFigureOfBlue (talk | contribs)Edit filter managers, Administrators53,878 edits Fixes← Previous edit | Revision as of 22:42, 27 April 2009 view source AFigureOfBlue (talk | contribs)Edit filter managers, Administrators53,878 edits WhitespaceNext edit → | ||
Line 2: | Line 2: | ||
if( typeof( easyEdMinor ) == 'undefined' ) { //CONFIGURATION | if( typeof( easyEdMinor ) == 'undefined' ) { //CONFIGURATION | ||
easyEdMinor = true; | |||
} | } | ||
Line 31: | Line 31: | ||
if(queryString('easyedfromview')) addOnloadHook(function() { easyedfromview(); }) //Part of next function | if(queryString('easyedfromview')) addOnloadHook(function() { easyedfromview(); }) //Part of next function | ||
function easyedfromview() { //Initiates EasyEd if you are viewing the article without currently editing it | function easyedfromview() { //Initiates EasyEd if you are viewing the article without currently editing it | ||
var txt = document.getElementById('wpTextbox1'); | var txt = document.getElementById('wpTextbox1'); | ||
if(!txt) return; | if(!txt) return; | ||
easyEdFunctions(); | easyEdFunctions(); | ||
document.getElementById('wpSummary').value += 'Cleaned up using ]'; | document.getElementById('wpSummary').value += 'Cleaned up using ]'; | ||
document.editform.wpMinoredit.checked = easyEdMinor; | document.editform.wpMinoredit.checked = easyEdMinor; | ||
document.editform.wpDiff.click() | document.editform.wpDiff.click() | ||
} | } | ||
function queryString(p) { //Allows URI to be properly decoded so that easyedfromview() works properly | function queryString(p) { //Allows URI to be properly decoded so that easyedfromview() works properly | ||
var re = RegExp('' + p + '=(*)'); | var re = RegExp('' + p + '=(*)'); | ||
var matches; | var matches; | ||
if (matches = re.exec(document.location)) { | if (matches = re.exec(document.location)) { | ||
try { | try { | ||
return decodeURI(matches); | return decodeURI(matches); | ||
} catch (e) { | } catch (e) { | ||
} | |||
} | } | ||
⚫ | return null; | ||
} | |||
⚫ | return null; | ||
} | } | ||
Revision as of 22:42, 27 April 2009
//
if( typeof( easyEdMinor ) == 'undefined' ) { //CONFIGURATION easyEdMinor = true; } function easyEdFunctions() { //MAIN FUNCTION describes list of fixes var txt = document.editform.wpTextbox1; var page_name = wgPageName.replace('_',' '); txt.value = txt.value.replace(new RegExp('ISBN-10:|ISBN-13:|ISBN-10|ISBN-13|ISBN:', 'gi'), 'ISBN'); } function easyedinedit() { //Initiates EasyEd if you are already in edit mode easyEdFunctions(); // Add a tag to the summary box var txt = document.editform.wpSummary; var summary = "Cleaned up using ]"; if (txt.value.indexOf(summary) == -1) { if (txt.value.match(/?\s*$/)) { txt.value += " | "; } txt.value += summary; } document.editform.wpMinoredit.checked = easyEdMinor; document.editform.wpDiff.click() } if(queryString('easyedfromview')) addOnloadHook(function() { easyedfromview(); }) //Part of next function function easyedfromview() { //Initiates EasyEd if you are viewing the article without currently editing it var txt = document.getElementById('wpTextbox1'); if(!txt) return; easyEdFunctions(); document.getElementById('wpSummary').value += 'Cleaned up using ]'; document.editform.wpMinoredit.checked = easyEdMinor; document.editform.wpDiff.click() } function queryString(p) { //Allows URI to be properly decoded so that easyedfromview() works properly var re = RegExp('' + p + '=(*)'); var matches; if (matches = re.exec(document.location)) { try { return decodeURI(matches); } catch (e) { } } return null; } addOnloadHook(function () { //Adds "easy ed" tabs to page. if(wgCanonicalNamespace == "" || wgCanonicalNamespace == "Image" || wgCanonicalNamespace == "File" || wgCanonicalNamespace == "User" || wgCanonicalNamespace == "Template" || wgCanonicalNamespace == "Project" || wgCanonicalNamespace == "Portal"){ if(document.forms.editform) { addPortletLink('p-cactions', 'javascript:easyedinedit()', 'easy ed', 'ca-easyed', 'Run EasyEd', '', document.getElementById('ca-move')); } //End editform if if(wgAction == "view"){ var url = wgServer + wgScript + '?title=' + encodeURIComponent(wgPageName) + '&action=edit'; addPortletLink('p-cactions',url + '&easyedfromview=true', 'easy ed','ca-easyed', 'Run EasyEd', '', document.getElementById('ca-move')); } //End pageview if }//End namespace if }); //