User:Daask/scripts/Some MOSNUM dates.js

This is an old revision of this page, as edited by Daask (talk | contribs) at 20:26, 27 March 2017 (Write basic script). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
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.
// This code needs further testing and development before it's ready to go.

alert('here we go');
toolbar_items = $('p-tb//li');
alert(toolbar_items);
// https://en.wikipedia.org/wiki/User:Ohconfucius/script/MOSNUM_dates
importScript('User:Ohconfucius/script/MOSNUM dates.js');
new_items = $('p-tb//li') - toolbar_items;
alert(new_items);
keep_items = ['dmy-unitfixer', 'mdy-unitfixer'];
hidden_items = new_items - keep_items.map(function(){$(this)});
alert(hidden_items);
for (let i of hidden_items) {
  i.hide();
}