User:Ignis/mytemplate.js

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
addOnloadHook(function() {
  if(!document.getElementById('editform')) return;
 
  var html = '';
  var f = document.getElementById("editform");
  html += '<a onclick="insertTags(\'{{user:ignis/tag|\',\'|01\/Jan.\/2007}}\',\'\');return false" href="#">tag</a><br>';
  html += 'prime [<a onclick="insertTags(\'{{user:ignis/Canon/EOS350D/EF50F1.4}}\',\'\',\'\');return false" href="#">50f/1.4</a>]';
  html += ' [<a onclick="insertTags(\'{{user:ignis/Canon/EOS350D/EF50F1.8}}\',\'\',\'\');return false" href="#">50f/1.8</a>]';
  html += ' [<a onclick="insertTags(\'{{user:ignis/Canon/EOS350D/EF135F2L}}\',\'\',\'\');return false" href="#">135f/2</a>]';
  html += ' [<a onclick="insertTags(\'{{user:ignis/Canon/EOS350D/TS-E24F3.5L}}\',\'\',\'\');return false" href="#">24f/3.5</a>]<br>';
  html += 'zoom [<a onclick="insertTags(\'{{user:ignis/Canon/EOS350D/EF-S10-22F3.5-4.5}}\',\'\',\'\');return false" href="#">10-22</a>]';
  html += ' [<a onclick="insertTags(\'{{user:ignis/Canon/EOS350D/EF-S18-55F3.5-5.6}}\',\'\',\'\');return false" href="#">18-55</a>]';
  html += ' [<a onclick="insertTags(\'{{user:ignis/Canon/EOS350D/EF24-85F3.5-4.5}}\',\'\',\'\');return false" href="#">24-85</a>]';
  html += ' [<a onclick="insertTags(\'{{user:ignis/Canon/EOS350D/EF28-135F3.5-5.6IS}}\',\'\',\'\');return false" href="#">28-135</a>]';
  html += ' [<a onclick="insertTags(\'{{user:ignis/Canon/EOS350D/EF70-200F4L}}\',\'\',\'\');return false" href="#">70-200</a>]<br>';
  html += 'Location [<a onclick="insertTags(\'{{Location|\',\'|region:FR_type:landmark}}\',\'\');return false" href="#">FR</a>]';
  html += ' [<a onclick="insertTags(\'{{Location|\',\'|region:JP_type:landmark}}\',\'\');return false" href="#">JP</a>]<br>';
  html += ' vote[<a onclick="insertTags(\'{{vk}}\',\'\',\'\');return false" href="#">keep</a>]';
  html += ' [<a onclick="insertTags(\'{{vd}}\',\'\',\'\');return false" href="#">delete</a>]';
  html += ' [<a onclick="insertTags(\'{{comment}}\',\'\',\'\');return false" href="#">comment</a>]<br>';
  var p = document.createElement('p');
  p.innerHTML = html;
  f.parentNode.insertBefore(p, f);

  var p = document.createElement('p');
//  p.appendChild(b);
  var s = document.getElementById('contentSub');
  s.parentNode.insertBefore(p, s.nextSibling);
});