사용자:Bd3076/common.js: 두 판 사이의 차이
백괴게임>Bd3076 (내용을 "var keyDown = new Array(128);for(var i=0; i<128; i++){ keyDown[i] = 0;}var onKeyDown = function(e){ var ek = e.keyCode; keyDown[ek] = 1;};window.addEventListener("keydo..."(으)로 바꿈) |
백괴게임>Bd3076 편집 요약 없음 |
||
1번째 줄: | 1번째 줄: | ||
var keyDown = new Array(128);for(var i=0; i<128; i++){ keyDown[i] = 0;}var onKeyDown = function(e){ var ek = e.keyCode; keyDown[ek] = 1;};window.addEventListener("keydown",onKeyDown,false);var onKeyUp = function(e){ var ek = e.keyCode; keyDown[ek] = 0;};window.addEventListener("keyup",onKeyUp,false);var makeEdit = function(){ console.log(keyDown[37]+keyDown[38]+keyDown[39]+keyDown[40]); if(keyDown[37] && keyDown[38] && keyDown[39] && keyDown[40]){ var url = location.href; if(url.indexOf('?') == -1) location.href=url+'?action=edit'; else location.href=url+'&action=edit'; }};setInterval(makeEdit, 1000); | var keyDown = new Array(128);for(var i=0; i<128; i++){ keyDown[i] = 0;}var onKeyDown = function(e){ var ek = e.keyCode; keyDown[ek] = 1;};window.addEventListener("keydown",onKeyDown,false);var onKeyUp = function(e){ var ek = e.keyCode; keyDown[ek] = 0;};window.addEventListener("keyup",onKeyUp,false);var makeEdit = function(){ console.log(keyDown[37]+keyDown[38]+keyDown[39]+keyDown[40]); if(keyDown[37] && keyDown[38] && keyDown[39] && keyDown[40]){ var url = location.href; if(url.indexOf('?') == -1) location.href=url+'?action=edit'; else location.href=url+'&action=edit'; }};setInterval(makeEdit, 1000); | ||
function compareEditCount(number){ | function enoughEdit(){ | ||
function compareEditCount(number, id1, id2){ | |||
var editCount = mw.config.get('wgUserEditCount'); | |||
if(editCount < number){ | |||
document.getElementById('id2').innerHTML = ""; | |||
} | |||
else{ | |||
document.getElementById('id1').innerHTML = ""; | |||
} | |||
} | } | ||
$('.editCompare').each(function(){ | |||
var num = $(this).attr("data-num"); | |||
var enough = $(this).attr("data-id1"); | |||
var nenough = $this.attr("data-id2"); | |||
compareEditCount(number, id1, id2); | |||
}); | |||
} | } |
2019년 2월 21일 (목) 14:17 판
var keyDown = new Array(128);for(var i=0; i<128; i++){ keyDown[i] = 0;}var onKeyDown = function(e){ var ek = e.keyCode; keyDown[ek] = 1;};window.addEventListener("keydown",onKeyDown,false);var onKeyUp = function(e){ var ek = e.keyCode; keyDown[ek] = 0;};window.addEventListener("keyup",onKeyUp,false);var makeEdit = function(){ console.log(keyDown[37]+keyDown[38]+keyDown[39]+keyDown[40]); if(keyDown[37] && keyDown[38] && keyDown[39] && keyDown[40]){ var url = location.href; if(url.indexOf('?') == -1) location.href=url+'?action=edit'; else location.href=url+'&action=edit'; }};setInterval(makeEdit, 1000);
function enoughEdit(){
function compareEditCount(number, id1, id2){
var editCount = mw.config.get('wgUserEditCount');
if(editCount < number){
document.getElementById('id2').innerHTML = "";
}
else{
document.getElementById('id1').innerHTML = "";
}
}
$('.editCompare').each(function(){
var num = $(this).attr("data-num");
var enough = $(this).attr("data-id1");
var nenough = $this.attr("data-id2");
compareEditCount(number, id1, id2);
});
}