Úsáideoir:Spacebirdy/custom.js
Tugtar faoi deara: Tar éis duit athruithe a shábháil, caithfear gabháil thar thaisce do bhrabhsálaí chun iad a fheiceáil. Internet Explorer: cliceáil ar an gcnaipe Athnuaigh nó Athlódáil, agus an eochair Ctrl á bhrú agat. Firefox: cliceáil ar Athlódáil, agus an eochair Iomlaoid á bhrú agat (nó brúigh Ctrl-Iomlaoid-R). Opera: caithfear d'úsáideoirí a dtaiscí a ghlanadh trí Uirlisí→Sainroghanna. Ní mór d'úsáideoirí Konqueror nó Safari ach cliceáil ar an gcnaipe Athlódáil.
/* <pre><noinclude> */
/*</pre>
__TOC__
== Javascript to perform the CSS insertions ==
<pre> */
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 } \n');
//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&dontcountme=s');
} //end of popups
// takes characters from MediaWiki:Edittools
if ( $.cookie('WiktionaryPreferencesKeyPad') == 'true' ) {
mw.loader.load('http://ga.wiktionary.org/w/index.php?title=User:Spacebirdy//eochairchlár.js&action=raw&ctype=text/javascript&dontcountme=s');
}
// End of If (UsePreferences) block
}
//array of images
enWiktPrefButtons = [] ;
/* </pre>
== wiktAddButton ==
<pre> */
// 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;
}
/* </pre>
== CustomizePreferencesPage==
<pre> */
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.
wiktAddButton( 'WiktionaryUseJSPreferences', 'Use preferences on this page');
wiktAddButton( 'WiktionaryPreferencesHideSiteNotice', 'Hide Site Notice');
//TODO: Add color selections for all box-things.
// [[User:Lupin/popups.js]]
wiktAddButton( 'WiktionaryPreferencesPopUps', 'Use [[w:User:Lupin/popups.js]] (Originally for Wikipedia)');
//See [[MediaWiki:Common.js]]
wiktAddButton( 'WiktionaryPreferencesShowNav', 'Leave ALL translation sections expanded (and similar hidden sections) - Default is to leave them collapsed');
// Allow special characters in [Search] input (takes characters from editools)
wiktAddButton( 'WiktionaryPreferencesKeyPad', 'Allow special characters to be input input the search box');
}
jQuery(document).ready( CustomizePreferencesPage );
/* </pre> */