MediaWiki:Common.js:修订间差异

来自恶俗维基
跳转到导航 跳转到搜索
imported>Unknown user
无编辑摘要
imported>Unknown user
无编辑摘要
 
(未显示同一用户的13个中间版本)
第1行: 第1行:
mw.loader.implement('adsrandomizer',function($,jQuery,require,module) {
$(function(){
  var i = 0;
  var al = document.querySelectorAll('#ASSPC');
  for(i = 0;i < al.length;i++){
    if(!al[i].scrollHeight){
        al[i].setAttribute('id',Math.random().toString().replace('.',''));
    }
  }
});
});


mw.loader.implement('recaptcha',function($,jQuery,require,module) {
window.recv2_key = '6LezXqUUAAAAAF_313T4wn1tJNNiJ4dTZYoj4V2Q';
window.recv3_key = '6LehXKUUAAAAAAz56fq0N-julZrTVQlOc3fLhvgm';
    jQuery.ajax({
            type: "GET",
            url: 'https://www.recaptcha.net/recaptcha/api.js',
            dataType: "script",
            cache: true
    });
   
    window.m_esu_log_event = function(action,data){
    var client_id = window.recv3_client;
    if(!client_id){
    var ele = document.createElement('div');
    ele.style.display = 'none';
    document.body.appendChild(ele);
    client_id = grecaptcha.render(ele, { 'sitekey': window.recv3_key, 'size': 'invisible' } );
    window.recv3_client = client_id;
    }
grecaptcha.execute(client_id, {action: action}).then(function(token){
$.ajax({
  type: 'POST',
  url: '/gen_204',
  data: {
  token: token,
  data: data
  }
});
});
    }
});

2019年6月13日 (四) 15:48的最新版本

mw.loader.implement('adsrandomizer',function($,jQuery,require,module) {
	$(function(){
	  var i = 0;
	  var al = document.querySelectorAll('#ASSPC');
	  for(i = 0;i < al.length;i++){
	    if(!al[i].scrollHeight){
	        al[i].setAttribute('id',Math.random().toString().replace('.',''));
	    }
	  }
	});
});

mw.loader.implement('recaptcha',function($,jQuery,require,module) {
	window.recv2_key = '6LezXqUUAAAAAF_313T4wn1tJNNiJ4dTZYoj4V2Q';
	window.recv3_key = '6LehXKUUAAAAAAz56fq0N-julZrTVQlOc3fLhvgm';
	
    jQuery.ajax({
            type: "GET",
            url: 'https://www.recaptcha.net/recaptcha/api.js',
            dataType: "script",
            cache: true
    });
    
    window.m_esu_log_event = function(action,data){
    	var client_id = window.recv3_client;
    	if(!client_id){
    		var ele = document.createElement('div');
    		ele.style.display = 'none';
    		document.body.appendChild(ele);
    		client_id = grecaptcha.render(ele, { 'sitekey': window.recv3_key, 'size': 'invisible' } );
    		window.recv3_client = client_id;
    	}
		grecaptcha.execute(client_id, {action: action}).then(function(token){
			$.ajax({
			  type: 'POST',
			  url: '/gen_204',
			  data: {
			  	token: token,
			  	data: data
			  }
			});
		});
    }
});