사용자:Bd3076/common.js: 두 판 사이의 차이

리버티게임, 모두가 만들어가는 자유로운 게임
백괴게임>Bd3076
편집 요약 없음
백괴게임>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 enoughEdit(){
function compareEditCount(number, id1, id2){
var editCount = mw.config.get('wgUserEditCount');
console.log(number + ', ' + id1 + ', ' + id2 + ', ' + editCount);
if(editCount < number){
document.getElementById(id2).innerHTML = "";
}
else{
document.getElementById(id1).innerHTML = "";
}
}
$('.editCompare').each(function(){
console.log(1);
var num = $(this).attr("data-num");
var enough = $(this).attr("data-id1");
var nenough = $(this).attr("data-id2");
compareEditCount(num, enough, nenough);
});
}
$(enoughEdit());

2019년 2월 21일 (목) 14:45 판

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);