Jump to content

User:Jj137/frcominfobox.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.
// <pre>

function doQinfobox() {
  var f = document.editform, t = f.wpTextbox1;
  document.editform.wpTextbox1.value = '{{Infobox French commune\n' + '|name            =' + ' {{' + 'subst:BASEPAGENAME' + '}}\n' + '|image           =\n' + '|region          =\n' + '|department      =\n' + '|arrondissement  =\n' + '|canton          =\n' + '|intercomm       =\n' + '|mayor           =\n' + '|term            =\n' + '|longitude       =\n' + '|latitude        =\n' + '|elevation_m     =\n' + '|elevation_min_m =\n' + '|elevation_max_m =\n' + '|area_km2        =\n' + '|population      =\n' + '|date-population =\n' + '|density_km2     =\n' + '|insee           =\n' + '|postal_code     =\n' + '}}\n\n' + document.editform.wpTextbox1.value;
  document.editform.wpSummary.value = 'Added infobox to French commune article.';
  document.editform.submit();
}
 
$(function() {
  if (wgCanonicalNamespace == "User" || wgCanonicalNamespace == "User_talk") {
     return;
  }
  if (document.editform) {
     mw.util.addPortletLink("p-cactions", "javascript:doQinfobox()", "infobox", "ca-infobox", "Add French commune blank infobox", "");
  }
});
 
// </pre>