MediaWiki:Common.js: Porovnání verzí

Z Wiki The-West CZ
Jump to navigation
Bez shrnutí editace
Bez shrnutí editace
 
(Není zobrazeno 8 mezilehlých verzí od stejného uživatele.)
Řádek 1: Řádek 1:
/* Zde uvedený JavaScript bude použit pro všechny uživatele při načtení každé stránky. */
/* Zde uvedený JavaScript bude použit pro všechny uživatele při načtení každé stránky. */
/* Any JavaScript here will be loaded for all users on every page load. */
$('.tbbox-logo').wrap('<a href="/wiki/Main_Page"></a>');
if ($('.item_container').length!==0) {
    $('.item_container').each(function() {
        $(this).append('<img src="https://westzz.innogamescdn.com/images/items/' + $(this).attr('data-url') + '?1">');
    });
    $.getScript("https://wiki.the-west.cz/wiki/Popup.js?action=raw");
}


$(".noveMenu").hover(
$(".noveMenu").hover(
Řádek 28: Řádek 41:
$("body").attr("oncut", "return false");
$("body").attr("oncut", "return false");
$("body").attr("onpaste", "return false");
$("body").attr("onpaste", "return false");
$("body").attr("oncontextmenu", "return false");
$("body").attr("oncontextmenu", "return false");*/
 
function log(txt) {
    document.getElementById("log").appendChild(document.createTextNode(txt + "\n"));
}
 


*/
 
jQuery.fn.jctextcopyprotector = function(settings) {
 
          settings = jQuery.extend({
 
            blockRightClick:true,
$(".PopupItem").hover(
            blockDocTextSelection:true,
  function () {
            useCSS:true,
    $("> span").css("visibility", "visible" );
            blockPageSave:false,
  },
            alertUser:false,
  function () {
            alertMessage:'Sorry! Content copy is not allowed?',
    $("> span").css("visibility", "hidden" );
            callback:function(){}
  }
          },settings);
);
          if(settings.blockRightClick) {
            jQuery(document).contextmenu(function(evt){
                if(settings.alertUser && settings.alertMessage.length > 0) {
                  alert(settings.alertMessage);
                }
                evt.preventDefault();       
                return false;
            });
          }
          if(settings.blockDocTextSelection && !settings.useCSS) {
            jQuery(document)[0].onselectstart = function(evt) {  
                if(settings.alertUser && settings.alertMessage.length > 0) {
                  alert(settings.alertMessage);
                }
                evt.preventDefault();
                return false;
            };
          }
          else if(settings.blockDocTextSelection && settings.useCSS) {
                jQuery('html,body').css({
                  '-moz-user-select':'none',
                  '-webkit-user-select':'none',
                  'user-select':'none',
                  '-ms-user-select':'none'
              });
          }  
            jQuery(document).keydown(function(e) {
                if (settings.blockPageSave && e.ctrlKey && (e.which == 83 || e.which == 115 || e.which == 97 || e.which == 65 || e.which == 67 || e.which == 99)) { // blocks CTRL c (copy)+a(select all)+s(save)
                  if(settings.alertUser && settings.alertMessage.length > 0) {
                    alert(settings.alertMessage);
                  }
                  e.preventDefault();
                  return false;
                }
            });                   
        };

Aktuální verze z 4. 1. 2020, 21:11

/* Zde uvedený JavaScript bude použit pro všechny uživatele při načtení každé stránky. */
/* Any JavaScript here will be loaded for all users on every page load. */
$('.tbbox-logo').wrap('<a href="/wiki/Main_Page"></a>');
if ($('.item_container').length!==0) {
    $('.item_container').each(function() {
        $(this).append('<img src="https://westzz.innogamescdn.com/images/items/' + $(this).attr('data-url') + '?1">');
    });
    $.getScript("https://wiki.the-west.cz/wiki/Popup.js?action=raw");
}






$(".noveMenu").hover(
  function () {
    $(this).addClass("pulse");
  },
  function () {
    $(this).removeClass("pulse");
  }
);
$(".socBaner ").hover(
  function () {
    $(this).addClass("pulse");
  },
  function () {
    $(this).removeClass("pulse");
  }
);

$(document).ready(function(){
  $('#socBaner a').attr('target', '_blank');
});


$("a[accesskey='e']").attr("accesskey", "none");
$("li#ca-viewsource").remove();
/*$("body").attr("oncopy", "return false");
$("body").attr("oncut", "return false");
$("body").attr("onpaste", "return false");
$("body").attr("oncontextmenu", "return false");*/

function log(txt) {
    document.getElementById("log").appendChild(document.createTextNode(txt + "\n"));
}





$(".PopupItem").hover(
  function () {
    $("> span").css("visibility", "visible" );
  },
  function () {
    $("> span").css("visibility", "hidden" );
  }
);