User:Connel MacKenzie/setpreferences.js

From Wiktionary, the free dictionary
Jump to navigation Jump to search

Note – after saving, you may have to bypass your browser’s cache to see the changes.

  • Mozilla / Firefox / Safari: hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (Command-R on a Macintosh);
  • Konqueror and Chrome: click Reload or press F5;
  • Opera: clear the cache in Tools → Preferences;
  • Internet Explorer: hold Ctrl while clicking Refresh, or press Ctrl-F5.

/*
Originally, this was going to "silently" open a link, create/edit the page [[Special:Mypage/Preferences]], etc.  Now, instead, I'll just link to the page desired.  If this javascript detects that we are at that page, in edit mode, it will save the page.  If this javascript detects that we are at that page, not in edit mode, it will attempt to close the window.  That way, I don't mess with any of the quazi-encryption stuff.

get pagetitle
 if (pagetitle.search(/Preferences/g) != -1 ) {

loop through button objects <form name="createbox"...
  find preload name 2nd child <input name="preload" value="Wiktionary..."
    find cookie value
      set inputbox's input box's value = cookie value as TRUE/FALSE <input class="CreateboxInput" value=""
    find button action <input name="create">
      set the object's onclick() action to toggle that cookie
}
*/


function saveMyWiktPref() {
  return;
}

$( saveMyWiktPref );