Melding:Wikiorðabók-Stillingar.js
Útlit
Athugaðu: Eftir útgáfu kann að vera að þú þurfir að komast hjá skyndiminni vafrans þíns til að sjá breytingarnar.
- Firefox / Safari: Haltu Shift samtímis og þú smellir á Endurhlaða (Reload), eða ýttu á annaðhvort Ctrl-F5 eða Ctrl-R (⌘-R á Mac)
- Google Chrome: Ýttu á Ctrl-Shift-R (⌘-Shift-R á Mac)
- Internet Explorer / Edge: Haltu Ctrl samtímis og þú smellir á Endurnýja (Refresh), eða ýttu á Ctrl-F5
- Opera: Farðu í Verkfæri (Tools) → Stillingar (Preferences) og svo Friðhelgi og öryggi (Privacy & security) → Hreinsa vafragögn (Clear browsing data) → Myndir og skrár í skyndiminni (Chached images and files)
/*
== Javascript to perform the CSS insertions ==
*/
if ( $.cookie('WiktionaryUseJSPreferences') == 'true' ) {
// CSS Insertions
if ( $.cookie('WiktionaryPreferencesHideSiteNotice') == 'true' ) mw.util.addCSS('#siteNotice { display: none; } ');
//no button for this yet...
mw.util.addCSS('#bodyContent .allpagesredirect { text-decoration:line-through }');
//Additional optional JavaScript insertions
if ( $.cookie('WiktionaryPreferencesPopUps') == 'true' ) {
// [[w:User:Lupin/popups.js]]
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Lupin/popups.js&action=raw&ctype=text/javascript');
} //end of popups
//if ( $.cookie('WiktionaryPreferencesKeyPad') == 'true' ) mw.loader.load('//is.wiktionary.org/w/index.php?title=Notandi:Spacebirdy/keypad.js&action=raw&ctype=text/javascript>');
// End of If (UsePreferences) block
}
//array of images
enWiktPrefButtons = [] ;
/*
== wiktAddButton ==
*/
// generate buttons
function wiktAddButton(cookieToToggle, speedTip) {
var checkbox = document.createElement("input");
checkbox.type = 'checkbox';
checkbox.name = cookieToToggle;
checkbox.onclick = function() {
if ( $.cookie(this.name) != 'true' ) {
$.cookie(this.name, 'true');
} else {
$.cookie(this.name, 'false');
}
}
if ( 'true' == $.cookie( cookieToToggle ) ) {
checkbox.checked = true ;
}
var isPreferencePage = document.getElementById('isPreferencePage');
isPreferencePage.appendChild( checkbox );
if ( 'true' == $.cookie( cookieToToggle ) ) {
checkbox.checked = true ;
}
var text = document.createTextNode( speedTip );
isPreferencePage.appendChild( text );
var text = document.createElement( 'br' );
isPreferencePage.appendChild( text );
return true;
}
//not used just yet
function wiktAddTextBox(cookieToInput, speedTip) {
var textbox = document.createElement("input");
textbox.type = 'text';
textbox.width = 10;
textbox.name = cookieToInput;
textbox.onchange = function() {
$.cookie(this.name, this.value);
}
textbox.value = $.cookie( cookieToInput );
isPreferencePage.appendChild( textbox );
var text = document.createTextNode( speedTip );
isPreferencePage.appendChild( text );
return true;
}
function wiktAddSeparator(wiktSepText) {
var txtnod = document.createTextNode( wiktSepText );
var isPreferencePage = document.getElementById('isPreferencePage');
isPreferencePage.appendChild( txtnod );
txtnod = document.createElement( 'hr' );
isPreferencePage.appendChild( txtnod );
}
/*
== CustomizePreferencesPage==
*/
function CustomizePreferencesPage() {
var isPreferencePage = document.getElementById('isPreferencePage');
if ( !isPreferencePage ) return;
//OK, so now we know we are on
//the Set EnglishWiktionary-specific Preferences page (or impersonation thereof)
// http://tools.wikimedia.de/~cmackenzie/make_buttons.html
// crop image to 21 pixels vertical, whatever horizontal.
wiktAddSeparator('');
wiktAddButton( 'WiktionaryUseJSPreferences', 'Nota stillingar á þessari síðu');
wiktAddSeparator('');
wiktAddButton( 'WiktionaryPreferencesHideSiteNotice', 'Fela auglýsingar');
//TODO: Add color selections for all box-things.
// [[User:Lupin/popups.js]]
wiktAddButton( 'WiktionaryPreferencesPopUps', 'Nota [[w:User:Lupin/popups.js]] (Upprunalega frá Wikipedia)');
//See [[MediaWiki:Monobook.js]]
wiktAddButton( 'WiktionaryPreferencesHideNav', 'Láta alla þýðingarhluta falla sama (og eins með falda hluta) - Þeir eru útbreiddir sjálfkrafa');
//See [[MediaWiki:Monobook.js]]
wiktAddButton( 'WiktionaryPreferencesShowNav', 'Láta alla þýðingarhluta breiða út sér (og eins með falda hluta) - Þeir eru útbreiddir sjálfkrafa');
// Allow special characters in [Search] input
// wiktAddButton( 'WiktionaryPreferencesKeyPad', 'Leyfa sértákn í leitinni');
//Disable the javascript redirect between pages that differ only in case.
wiktAddButton( 'WiktionaryDisableAutoRedirect', 'Gera sjálf-tilvísanir óvirkar.');
}
$( CustomizePreferencesPage );