Jump to content

User:Jj137/france.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
// <nowiki><pre>
function france()
{
  var f = document.editform, t = f.wpTextbox1;
  t.value = "{{'+'WikiProject France" + "|class=Stub" + "|importance=Low" + "|commune=yes}}" + '\n' + t.value;
  t.value = t.value.split('{{'+'WikiProject France|class=Stub|importance=Low}}').join('{{'+'WikiProject France|class=Stub|importance=Low|commune=yes}}');
  t.value = t.value.split('{{'+'WikiProject French communes|class=Stub|importance=Low}}').join('');
  t.value = t.value.split('{{'+'WikiProject French communes|class=Stub|importance=Mid}}').join('');
  t.value = t.value.split('{{'+'WikiProject France|class=stub|importance=Low}}').join('{{'+'WikiProject France|class=Stub|importance=Low|commune=yes}}');
  t.value = t.value.split('{{'+'WikiProject French communes|class=stub|importance=Low}}').join('');
  t.value = t.value.split('{{'+'WikiProject French communes|class=stub|importance=Mid}}').join('');
  t.value = t.value.split('{{'+'WikiProject France|class=Stub|importance=low}}').join('{{'+'WikiProject France|class=Stub|importance=Low|commune=yes}}');
  t.value = t.value.split('{{'+'WikiProject French communes|class=Stub|importance=low}}').join('');
  t.value = t.value.split('{{'+'WikiProject French communes|class=Stub|importance=lid}}').join('');
  t.value = t.value.split('{{'+'WikiProject France|class=stub|importance=low}}').join('{{'+'WikiProject France|class=Stub|importance=Low|commune=yes}}');
  t.value = t.value.split('{{'+'WikiProject French communes|class=stub|importance=low}}').join('');
  t.value = t.value.split('{{'+'WikiProject French communes|class=stub|importance=mid}}').join('');
  f.wpSummary.value = "Updating templates.";
  document.editform.submit();
}

function francetab()
{
  // Only add for pages with the right string somewhere in the title
  if (document.title.indexOf("Editing Talk:") != -1)
    {
      mw.util.addPortletLink('p-cactions', 'javascript:france()', "france");
    }
}
 
$(francetab);
 
// </pre></nowiki>