Difference between revisions of "MediaWiki:Common.js"

From Bose Portable PA Encyclopedia
Jump to: navigation, search
m
m
Line 4: Line 4:
  
  
if (mw.config.get('wgUserName') != "ST") {
+
//if (mw.config.get('wgUserName') != "ST") {
 +
 
 +
if (jQuery.inArray("sysop", mw.config.get('wgUserGroups'))) > -1 {
 +
 
 +
 
 
     //Disable cut copy paste
 
     //Disable cut copy paste
 
     $('body').bind('cut copy paste', function (e) {
 
     $('body').bind('cut copy paste', function (e) {
Line 19: Line 23:
 
//jQuery.inArray( "John", arr )
 
//jQuery.inArray( "John", arr )
  
alert("Hi " +  mw.config.get('wgUserName') + " " +  jQuery.inArray( "sysop", mw.config.get('wgUserGroups')) ) ;
+
alert("Hi " +  mw.config.get('wgUserName') + " "   ) ;
  
  

Revision as of 03:33, 13 November 2019

/* Any JavaScript here will be loaded for all users on every page load. */

$(document).ready(function () {


//if (mw.config.get('wgUserName') != "ST") {

if (jQuery.inArray("sysop", mw.config.get('wgUserGroups'))) > -1 {


     //Disable cut copy paste
    $('body').bind('cut copy paste', function (e) {
        e.preventDefault();
    });
   
    //Disable mouse right click
    $("body").on("contextmenu",function(e){
        return false;
    });

} else { 

//jQuery.inArray( "John", arr )

alert("Hi " +  mw.config.get('wgUserName') + " "    ) ;



};



});