User:Fbstj/gadget/history-test.js

From The Coppermind
< User:Fbstj
Revision as of 18:46, 21 November 2017 by Fbstj (talk | contribs) (tweak for now)
Jump to navigation Jump to search

Note: After saving, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
/* add links to edit box */
$(function () {

function A(url, text) {
 const el = document.createElement('a');
 el.setAttribute('href', url);
 el.innerText = text;
 return el;
};

const pagename = mw.config.get('wgPageName');

const edit_box = document.querySelector('.editButtons');
edit_box.appendChild(A('https://wob.coppermind.net/basic_search/?query='+ pagename, 'search Arcanum for "'+ pagename +'"'));
edit_box.appendChild(A('http://search.coppermind.net/?search='+ pagename, 'search books for "'+ pagename +'"'));

});