MediaWiki:Common.js: Unterschied zwischen den Versionen

Aus Wiki The-West DE
Zur Navigation springen
Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Zeile 4: Zeile 4:


importScript_ = importScript;
importScript_ = importScript;
if ($("#input_level").length==1){
  $("#input_level").append('Level : ');
  var input_level=$('<input type="number" value="0" min="0" max="150">').bind("propertychange keyup input paste", function (){
  if(this.value>150){this.value=150;}else if(this.value<0){this.value=0;}
  $( ".calc" ).each(function() {if (input_level.val()==0){
    $(this).html(this.id);
    $('.per_level_off').addClass('per_level').removeClass('per_level_off')
  }else{
    $(this).html(Math.ceil(Number(this.id)*input_level.val()));
    $('.per_level').addClass('per_level_off').removeClass('per_level')
  }
  });
  }).appendTo($("#input_level"));
}

Version vom 19. November 2016, 19:12 Uhr

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

document.write("<script src='/index.php?title=Global.js&action=raw&smaxage=0&ctype=text/javascript' type='text/javascript'></script>");

importScript_ = importScript;
if ($("#input_level").length==1){
   $("#input_level").append('Level : ');
   var input_level=$('<input type="number" value="0" min="0" max="150">').bind("propertychange keyup input paste", function (){
  if(this.value>150){this.value=150;}else if(this.value<0){this.value=0;}
  $( ".calc" ).each(function() {if (input_level.val()==0){
    $(this).html(this.id);
    $('.per_level_off').addClass('per_level').removeClass('per_level_off')
   }else{
    $(this).html(Math.ceil(Number(this.id)*input_level.val()));
    $('.per_level').addClass('per_level_off').removeClass('per_level')
   }
  });
   }).appendTo($("#input_level"));
}