MediaWiki:Common.js: Unterschied zwischen den Versionen

Aus Watch-Wiki
Zur Navigation springen Zur Suche springen
(+ Uhrwerke)
Zeile 1: Zeile 1:
 
/* Das folgende JavaScript wird für alle Benutzer geladen. */
 
/* Das folgende JavaScript wird für alle Benutzer geladen. */
  
 +
/* ------------------------ */
 
/* Extra Sysop-Script laden */
 
/* Extra Sysop-Script laden */
 +
/* ------------------------ */
 +
 
if (window.wgUserGroups)
 
if (window.wgUserGroups)
 
   {
 
   {
Zeile 14: Zeile 17:
 
   }
 
   }
  
 +
/* --------------------- */
 
/* Kategorien ausblenden */
 
/* Kategorien ausblenden */
 +
/* --------------------- */
 +
 
addOnloadHook( function () {
 
addOnloadHook( function () {
  
Zeile 60: Zeile 66:
 
}
 
}
 
});
 
});
 +
 +
/* ------------------ */
 +
/* Standardfunktionen */
 +
/* ------------------ */
 +
 +
function GetTimeStamp() {
 +
 +
    var t_now = new Date();
 +
   
 +
    t_GetTimeStamp = ('0000'+t_now.getFullYear()).substr(String(t_now.getFullYear()).length,4)+'-'+('00'+(t_now.getMonth()+1)).substr(String((t_now.getMonth()+1)).length,2)+'-'+('00'+t_now.getDate()).substr(String(t_now.getDate()).length,2)+'T'+
 +
('00'+t_now.getHours()).substr(String(t_now.getHours()).length,2)+':'+('00'+t_now.getMinutes()).substr(String(t_now.getMinutes()).length,2)+':'+('00'+t_now.getSeconds()).substr(String(t_now.getSeconds()).length,2)+'Z';
 +
   
 +
    return t_GetTimeStamp;
 +
}
 +
 +
function TransFormText( t_text ) {
 +
return t_text.replace(/\&/g, "&amp;").replace(/\</g, "&lt;").replace(/\>/g, "&gt;");
 +
}

Version vom 15. September 2010, 07:47 Uhr

/* Das folgende JavaScript wird für alle Benutzer geladen. */

/* ------------------------ */
/* Extra Sysop-Script laden */
/* ------------------------ */

if (window.wgUserGroups)
  {
   for (var i = 0; i < wgUserGroups.length; i++)
      {
       if (wgUserGroups[i] === 'sysop')
         {
          importScript('MediaWiki:CommonSysop.js');
          importStylesheet('MediaWiki:CommonSysop.css');
         }
      }
  }

/* --------------------- */
/* Kategorien ausblenden */
/* --------------------- */

addOnloadHook( function () {

	if ( document.getElementById( 'mw-normal-catlinks' ) && wgUserName && wgCanonicalNamespace == 'File' &&
	      ( wgUserLanguage == 'de' ||
		wgUserLanguage == 'en' ||
		wgUserLanguage == 'es' ||
		wgUserLanguage == 'nl' ||
		wgUserLanguage == 'ru' ) ) {
		catsstring = document.getElementById( 'mw-normal-catlinks' ).innerHTML.split( ': ' );
		if ( catsstring.length > 1 ) {
			cats = catsstring[1].split( ' | ' );
			catsstring[0] += ': ';
			for ( var i = 0; i < cats.length; i++ ) {
				if ( cats[i].indexOf( "Kategorie:Bildgalerie Uhrenmodelle" ) != -1 ||
				     cats[i].indexOf( "Kategorie:Bildgalerie Uhrwerke" ) != -1 ||
				     cats[i].indexOf( "Kategorie:Bildgalerie Archiv" ) != -1 ) {
					if ( wgUserLanguage == 'de' ) catsstring[0] += cats[i] + ' | ';
				} else
				if ( cats[i].indexOf( "Kategorie:Picture gallery watch models" ) != -1 ||
				     cats[i].indexOf( "Kategorie:Picture gallery movements" ) != -1 ||
				     cats[i].indexOf( "Kategorie:Picture gallery archive" ) != -1 ) {
					if ( wgUserLanguage == 'en' ) catsstring[0] += cats[i] + ' | ';
				} else
				if ( cats[i].indexOf( "Kategorie:Galería de imagenes de modelos de relojes" ) != -1 ||
				     cats[i].indexOf( "Kategorie:Galería de imagenes de mecanismos de relojes" ) != -1 ||
				     cats[i].indexOf( "Kategorie:Galería de imagenes archivo" ) != -1 ) {
					if ( wgUserLanguage == 'es' ) catsstring[0] += cats[i] + ' | ';
				} else
				if ( cats[i].indexOf( "Kategorie:Afbeeldingen galerij uurwerkmodellen" ) != -1 ||
				     cats[i].indexOf( "Kategorie:Afbeeldingen galerij uurwerken" ) != -1 ||
				     cats[i].indexOf( "Kategorie:Afbeeldingen galerij archief" ) != -1 ) {
					if ( wgUserLanguage == 'nl' ) catsstring[0] += cats[i] + ' | ';
				} else
				if ( cats[i].indexOf( "Kategorie:Фотогалерея Модели часов" ) != -1 ||
				     cats[i].indexOf( "Kategorie:Фотогалерея Часовые механизмы" ) != -1 ||
				     cats[i].indexOf( "Kategorie:Фотогалерея Архив" ) != -1 ) {
					if ( wgUserLanguage == 'ru' ) catsstring[0] += cats[i] + ' | ';
				} else {
					catsstring[0] += cats[i] + ' | ';
				}
			}
			document.getElementById( 'mw-normal-catlinks' ).innerHTML = catsstring[0].substring( 0, catsstring[0].length - 3 );
		}
	}
});

/* ------------------ */
/* Standardfunktionen */
/* ------------------ */

function GetTimeStamp() {

    var t_now = new Date();
    
    t_GetTimeStamp = ('0000'+t_now.getFullYear()).substr(String(t_now.getFullYear()).length,4)+'-'+('00'+(t_now.getMonth()+1)).substr(String((t_now.getMonth()+1)).length,2)+'-'+('00'+t_now.getDate()).substr(String(t_now.getDate()).length,2)+'T'+
('00'+t_now.getHours()).substr(String(t_now.getHours()).length,2)+':'+('00'+t_now.getMinutes()).substr(String(t_now.getMinutes()).length,2)+':'+('00'+t_now.getSeconds()).substr(String(t_now.getSeconds()).length,2)+'Z';
    
    return t_GetTimeStamp;
}

function TransFormText( t_text ) {
	return t_text.replace(/\&/g, "&amp;").replace(/\</g, "&lt;").replace(/\>/g, "&gt;");
}