Difference between revisions of "MediaWiki:Common.js"

From Animation Luzern Wiki
(Der Seiteninhalt wurde durch einen anderen Text ersetzt: «console.log("common.js");»)
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
console.log("common.js");
+
/* Change the upload Link */
 +
$( function () {
 +
  $( '#t-upload a' ).attr("href", "/index.php?title=Special:BatchUpload");
 +
 
 +
    /* Open menus on mouse over, don't do anything on touch-devices. */
 +
 
 +
    window.IsTouchDevice = false;
 +
    window.addEventListener('touchstart', function onFirstTouch() {
 +
        window.IsTouchDevice = true;
 +
        window.removeEventListener('touchstart', onFirstTouch, false);
 +
    }, false);
 +
$('ul.navbar-nav li.dropdown').hover(function() {
 +
  if (!window.IsTouchDevice)
 +
    $(this).find('.dropdown-menu').stop(true, true).delay(50).fadeIn(200);
 +
}, function() {
 +
  if (!window.IsTouchDevice)
 +
    $(this).find('.dropdown-menu').stop(true, true).delay(200).fadeOut(200);
 +
});
 +
});

Latest revision as of 01:34, 17 January 2018

/* Change the upload Link */
$( function () {
  $( '#t-upload a' ).attr("href", "/index.php?title=Special:BatchUpload");

    /* Open menus on mouse over, don't do anything on touch-devices. */

    window.IsTouchDevice = false;
    window.addEventListener('touchstart', function onFirstTouch() {
        window.IsTouchDevice = true;
        window.removeEventListener('touchstart', onFirstTouch, false);
    }, false);
$('ul.navbar-nav li.dropdown').hover(function() {
  if (!window.IsTouchDevice)
    $(this).find('.dropdown-menu').stop(true, true).delay(50).fadeIn(200);
}, function() {
  if (!window.IsTouchDevice)
    $(this).find('.dropdown-menu').stop(true, true).delay(200).fadeOut(200);
});
});