[ Index ] |
PHP Cross Reference of MediaWiki-1.24.0 |
[Summary view] [Print] [Text view]
1 /*======================================================================*\ 2 || #################################################################### || 3 || # Asirra module for ConfirmEdit by Bachsau # || 4 || # ---------------------------------------------------------------- # || 5 || # This code is released into public domain, in the hope that it # || 6 || # will be useful, but without any warranty. # || 7 || # ------------ YOU CAN DO WITH IT WHATEVER YOU LIKE! ------------- # || 8 || #################################################################### || 9 \*======================================================================*/ 10 11 jQuery( function( $ ) { 12 // Selectors for create account, login, and page edit forms. 13 var asirraform = $( 'form#userlogin2, #userloginForm form, form#editform' ); 14 var submitButtonClicked = document.createElement("input"); 15 var passThroughFormSubmit = false; 16 17 function PrepareSubmit() { 18 submitButtonClicked.type = "hidden"; 19 var inputFields = asirraform.find( "input" ); 20 for (var i=0; i<inputFields.length; i++) { 21 if (inputFields[i].type === "submit") { 22 inputFields[i].onclick = function(event) { 23 submitButtonClicked.name = this.name; 24 submitButtonClicked.value = this.value; 25 } 26 } 27 } 28 29 asirraform.submit( function() { 30 return MySubmitForm(); 31 } ); 32 } 33 34 function MySubmitForm() { 35 if (passThroughFormSubmit) { 36 return true; 37 } 38 Asirra_CheckIfHuman(HumanCheckComplete); 39 return false; 40 } 41 42 function HumanCheckComplete(isHuman) { 43 if (!isHuman) { 44 window.alert( mediaWiki.msg( 'asirra-failed' ) ); 45 } else { 46 asirraform.append(submitButtonClicked); 47 passThroughFormSubmit = true; 48 asirraform.submit(); 49 } 50 } 51 52 PrepareSubmit(); 53 54 } );
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Fri Nov 28 14:03:12 2014 | Cross-referenced by PHPXref 0.7.1 |