Jump to content

User:シ/copyeditor.js: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
m fix
m escape?
Line 8: Line 8:
function initEdit() {
function initEdit() {
var contentComponentTwo = document.editform.wpTextbox1.value
var contentComponentTwo = document.editform.wpTextbox1.value
var contentComponentOne = "<!--In Use By League Of Copyeditors Tag Added by CopyEditor.js by QwerpQwertus - Please remove the tag and comments when it is finished--> {{Subst:User:QwerpQwertus/copyeditor/inuseTag}}<!--Did some thing go wrong adding this tag? - Please leave a bug report at User:QwerpQwertus/copyeditor! Thanks!-->";
var contentComponentOne = /"<!--In Use By League Of Copyeditors Tag Added by CopyEditor.js by QwerpQwertus - Please remove the tag and comments when it is finished-->{{Subst:User:QwerpQwertus/copyeditor/inuseTag}}<!--Did some thing go wrong adding this tag? - Please leave a bug report at User:QwerpQwertus/copyeditor! Thanks!-->"\;
document.editform.wpSummary.value = "Tagging as being copyedited by the [[WP:GOCE|Guild of Copy Editors]] - using '''[[User:QwerpQwertus/copyeditor|CopyEditor]] by [[User:QwerpQwertus]]";
document.editform.wpSummary.value = "Tagging as being copyedited by the [[WP:GOCE|Guild of Copy Editors]] - using '''[[User:QwerpQwertus/copyeditor|CopyEditor]] by [[User:QwerpQwertus]]";
document.editform.wpMinoredit.checked = true ;
document.editform.wpMinoredit.checked = true ;

Revision as of 00:30, 1 September 2010

//t.replace(/\{\{\s*([Uu]ncat(egori[sz]ed)?|[Nn]ocat|[Nn]eedscategory|[Cc]ategori[sz]e)[^}]*\}\}/g, "");
//<pre>
function initNorm() {
 var article=prompt("Welcome to CopyEditor.js, by QwerpQwertus - Please enter the name of the article you'd like to copyedit.");
 var parsedarticle=escape(article);
 window.location.href="http://en.wikipedia.org/enwiki/w/index.php?title=" + parsedarticle + "&action=edit&section=0&copyedit=true&act=tag"
};
function initEdit() {
 var contentComponentTwo = document.editform.wpTextbox1.value
 var contentComponentOne = /"<!--In Use By League Of Copyeditors Tag Added by CopyEditor.js by QwerpQwertus - Please remove the tag and comments when it is finished-->{{Subst:User:QwerpQwertus/copyeditor/inuseTag}}<!--Did some thing go wrong adding this tag? - Please leave a bug report at User:QwerpQwertus/copyeditor! Thanks!-->"\;
 document.editform.wpSummary.value = "Tagging as being copyedited by the [[WP:GOCE|Guild of Copy Editors]] - using '''[[User:QwerpQwertus/copyeditor|CopyEditor]] by [[User:QwerpQwertus]]";
 document.editform.wpMinoredit.checked = true ;
 var bodyContentId = document.getElementById("bodyContent") //monobook skin
 || document.getElementById("mw_contentholder")   // modern skin
 || document.getElementById ("article");          // classic skin
 bodyContentId.style.display = "none";
 document.editform.wpTextbox1.value = contentComponentOne + content + contentComponentTwo;
 document.editform.submit();
};

addOnloadHook(function () {
  if(wgAction == 'edit' || (wgAction == 'submit' && document.getElementById('wikiDiff')) ){
    addPortletLink('p-tb', 'javascript:initEdit()', 'CopyEdit', 't-copy-edit', 'Leave and remove tags that the article is was being copyedited and get some auto spelling and grammar fixes', '', '');
    document.getElementById("t-copy-edit").firstChild.style.cssText = "color:red;"
  }
  else if(wgAction == 'view' || wgAction == 'submit' || wgAction == 'purge'){
    addPortletLink('p-tb', 'javascript:initNorm()', 'CopyEdit', 't-copy-edit', 'Leave and remove tags that the article is was being copyedited and get some auto spelling and grammar fixes', '', '');
    document.getElementById("t-copy-edit").firstChild.style.cssText = "color:green;"
  }
});