Usuario:BicScope/custom.js

De Wikcionario, el diccionario libre

Nota: Después de publicar, quizás necesite actualizar la caché de su navegador para ver los cambios.

  • Firefox/Safari: Mantenga presionada la tecla Shift mientras pulsa el botón Actualizar, o presiona Ctrl+F5 o Ctrl+R (⌘+R en Mac)
  • Google Chrome: presione Ctrl+Shift+R (⌘+Shift+R en Mac)
  • Internet Explorer/Edge: mantenga presionada Ctrl mientras pulsa Actualizar, o presione Ctrl+F5
  • Opera: Presiona Ctrl+F5.
 // von [[:en:User:Connel MacKenzie/custom.js]]
/* <pre><noinclude> */
 
/*</pre>
__TOC__
== Javascript to perform the CSS insertions ==
<pre> */
 
if ( getCookie('WiktionaryUseJSPreferences') == 'true' ) {
 
// CSS Insertions
 
 document.write('<style>');
 
 if ( getCookie('WiktionaryPreferencesHideSiteNotice') == 'true' ) document.write('#siteNotice { display: none; } ');
 
 //no button for this yet...
 document.write('#bodyContent .allpagesredirect { text-decoration:line-through } \n');
 
 document.write('</style>');
 
//Additional optional JavaScript insertions
 
 if ( getCookie('WiktionaryPreferencesPopUps') == 'true' ) {
    // [[w:User:Lupin/popups.js]]
    document.write('<script type="text/javascript" src="' 
             + 'http://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js' 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></' 
             + 'script>');
    } //end of popups
 
 if ( getCookie('WiktionaryPreferencesKeyPad') == 'true' ) document.write('<script ' 
            + 'type="text/javascript" src="http://es.wiktionary.org/w/index.php?title=Usuario:Spacebirdy' 
            + '/keypad.js&action=raw&ctype=text/javascript"><\/' 
            + 'script>');
 
// 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 ( getCookie(this.name) != 'true' ) {
                   setCookie(this.name, 'true');
                } else {
                   setCookie(this.name, 'false');
                }
	} 
       if ( 'true' == getCookie( cookieToToggle ) ) {
         checkbox.checked = true ;
        }
       var isPreferencePage = document.getElementById('isPreferencePage');
       isPreferencePage.appendChild( checkbox ); 
       if ( 'true' == getCookie( 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() {
            setCookie(this.name, this.value);
        }
        textbox.value = getCookie( 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', 'Utilizar las preferencias de esta página');
 
  wiktAddButton( 'WiktionaryPreferencesHideSiteNotice', 'Esconder mensaje del sitio');
 
  //TODO: Add color selections for all box-things.
 
  // [[User:Lupin/popups.js]]
  wiktAddButton( 'WiktionaryPreferencesPopUps', 'Utiliza [[w:User:Lupin/popups.js]]');
 
  //See [[MediaWiki:Monobook.js]]
  wiktAddButton( 'WiktionaryPreferencesHideNav', 'Esconder TODAS las traducciones (y secciones similares) - están abiertos por defecto');
 
  //See [[MediaWiki:Monobook.js]]
  wiktAddButton( 'WiktionaryPreferencesShowNav', 'Mostrar TODAS las traducciones (y secciones similares) - están abiertos por defecto');
 
  // Allow special characters in [Search] input
  wiktAddButton( 'WiktionaryPreferencesKeyPad', 'Permite insertar carácteres especiales en la busqueda');
}
 
addLoadEvent( CustomizePreferencesPage );
 
/* </pre> */