Index: trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.init.js |
— | — | @@ -1 +1,5 @@ |
2 | | -mw.loader.using( 'ext.wikiLove.local', jQuery.wikiLove.init ); |
| 2 | +mw.loader.using( 'ext.wikiLove.local', function() { |
| 3 | + jQuery( document ).ready( function() { |
| 4 | + jQuery.wikiLove.init(); |
| 5 | + } ); |
| 6 | +} ); |
Index: trunk/extensions/Translate/resources/ext.translate.special.languagestats.js |
— | — | @@ -73,17 +73,19 @@ |
74 | 74 | // When hovering a row, adjust brightness of the last two custom-colored cells as well |
75 | 75 | // See also translate.langstats.css for the highlighting for the other normal rows |
76 | 76 | mw.loader.using( 'jquery.colorUtil' , function() { |
77 | | - $( '.mw-sp-translate-table.wikitable tr' ).hover( function() { |
78 | | - $( '> td.hover-color', this ) |
79 | | - // 30% more brightness |
80 | | - .css( 'background-color', function( i, val ) { |
81 | | - return $.colorUtil.getColorBrightness( val, +0.3 ); |
| 77 | + jQuery( document ).ready( function( $ ) { |
| 78 | + $( '.mw-sp-translate-table.wikitable tr' ).hover( function() { |
| 79 | + $( '> td.hover-color', this ) |
| 80 | + // 30% more brightness |
| 81 | + .css( 'background-color', function( i, val ) { |
| 82 | + return $.colorUtil.getColorBrightness( val, +0.3 ); |
| 83 | + } ); |
| 84 | + }, function() { |
| 85 | + $( '> td.hover-color', this ) |
| 86 | + // 30% less brightness |
| 87 | + .css( 'background-color', function( i, val ) { |
| 88 | + return $.colorUtil.getColorBrightness( val, -0.3 ); |
| 89 | + } ); |
82 | 90 | } ); |
83 | | - }, function() { |
84 | | - $( '> td.hover-color', this ) |
85 | | - // 30% less brightness |
86 | | - .css( 'background-color', function( i, val ) { |
87 | | - return $.colorUtil.getColorBrightness( val, -0.3 ); |
88 | | - } ); |
89 | 91 | } ); |
90 | 92 | } ); |
Index: trunk/extensions/PageSchemas/PageSchemas.js |
— | — | @@ -6,8 +6,8 @@ |
7 | 7 | */ |
8 | 8 | |
9 | 9 | |
10 | | -var fieldNum = jQuery('.fieldBox:visible').length; |
11 | | -var templateNum = jQuery('.templateBox:visible').length; |
| 10 | +var fieldNum; |
| 11 | +var templateNum; |
12 | 12 | |
13 | 13 | jQuery.fn.editSchemaMakeTemplateDeleter = function() { |
14 | 14 | jQuery(this).click( function() { |
— | — | @@ -80,6 +80,9 @@ |
81 | 81 | } |
82 | 82 | |
83 | 83 | jQuery(document).ready(function() { |
| 84 | + fieldNum = jQuery('.fieldBox:visible').length; |
| 85 | + templateNum = jQuery('.templateBox:visible').length; |
| 86 | + |
84 | 87 | // Add and delete buttons |
85 | 88 | jQuery(".deleteTemplate").editSchemaMakeTemplateDeleter(); |
86 | 89 | jQuery(".editSchemaAddTemplate").editSchemaMakeTemplateAdder(); |
Index: trunk/extensions/RecordAdmin/recordadmin.js |
— | — | @@ -22,4 +22,6 @@ |
23 | 23 | } |
24 | 24 | } |
25 | 25 | }; |
26 | | -jQuery( '#editform' ).submit( raRecordForms ); |
| 26 | +jQuery( document ).ready( function( $ ) { |
| 27 | + $( '#editform' ).submit( raRecordForms ); |
| 28 | +} ); |
Index: trunk/extensions/SignupAPI/includes/verification.js |
— | — | @@ -1,78 +1,81 @@ |
2 | 2 | //setup verification fields on the form |
3 | 3 | |
4 | | -function validateInput( fieldtype,fieldid ) { |
5 | | - var inputVal = document.getElementById(fieldid).value; |
6 | | - var valresult = document.getElementById(fieldid+'val'); |
7 | | - $.ajax({ |
8 | | - type: "POST", |
9 | | - url: mw.util.wikiScript('api'), |
10 | | - data: {'action':'validatesignup', 'format':'json', 'field':fieldtype, 'inputVal':inputVal }, |
11 | | - dataType: 'json', |
12 | | - success: function( jsondata ){ |
13 | | - var image = "<img src='"+ imagePath + jsondata.signup.icon +"'>"; |
14 | | - var message = jsondata.signup.result; |
15 | | - valresult.innerHTML = image+message; |
16 | | - } |
17 | | - }); |
18 | | -} |
| 4 | +jQuery( document ).ready( function( $ ) { |
19 | 5 | |
20 | | -function passwordStrength() { |
21 | | - var strength = document.getElementById('wpPassword2val'); |
22 | | - var strongRegex = new RegExp("^(?=.{8,})(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*\\W).*$", "g"); |
23 | | - var mediumRegex = new RegExp("^(?=.{7,})(((?=.*[A-Z])(?=.*[a-z]))|((?=.*[A-Z])(?=.*[0-9]))|((?=.*[a-z])(?=.*[0-9]))).*$", "g"); |
24 | | - var enoughRegex = new RegExp("(?=.{6,}).*", "g"); |
25 | | - var pwd = document.getElementById("wpPassword2"); |
| 6 | + function validateInput( fieldtype,fieldid ) { |
| 7 | + var inputVal = document.getElementById(fieldid).value; |
| 8 | + var valresult = document.getElementById(fieldid+'val'); |
| 9 | + $.ajax({ |
| 10 | + type: "POST", |
| 11 | + url: mw.util.wikiScript('api'), |
| 12 | + data: {'action':'validatesignup', 'format':'json', 'field':fieldtype, 'inputVal':inputVal }, |
| 13 | + dataType: 'json', |
| 14 | + success: function( jsondata ){ |
| 15 | + var image = "<img src='"+ imagePath + jsondata.signup.icon +"'>"; |
| 16 | + var message = jsondata.signup.result; |
| 17 | + valresult.innerHTML = image+message; |
| 18 | + } |
| 19 | + }); |
| 20 | + } |
26 | 21 | |
27 | | - if (pwd.value.length==0) { |
28 | | - strength.innerHTML = mw.message( 'signupapi-enterpassword' ); |
29 | | - } else if (pwd.value.length<minlength) { |
30 | | - strength.innerHTML = mw.message( 'signupapi-passwordtooshort', minlength ); |
31 | | - $("#progress").progressbar({value: 10}); |
32 | | - $("div.ui-progressbar-value").css("background","red"); |
33 | | - } else if (strongRegex.test(pwd.value)) { |
34 | | - strength.innerHTML = '<span style="color:green">'+mw.message( 'signupapi-strong' )+'</span>'; |
35 | | - $("#progress").progressbar({value: 100}); |
36 | | - $("div.ui-progressbar-value").css("background","green"); |
37 | | - } else if (mediumRegex.test(pwd.value)) { |
38 | | - strength.innerHTML = '<span style="color:orange">'+mw.message( 'signupapi-medium' )+'</span>'; |
39 | | - $("#progress").progressbar({value: 60}); |
40 | | - $("div.ui-progressbar-value").css("background","orange"); |
41 | | - } else { |
42 | | - strength.innerHTML = '<span style="color:red">'+mw.message( 'signupapi-weak' )+'</span>'; |
43 | | - $("#progress").progressbar({value: 30}); |
44 | | - $("div.ui-progressbar-value").css("background","red"); |
| 22 | + function passwordStrength() { |
| 23 | + var strength = document.getElementById('wpPassword2val'); |
| 24 | + var strongRegex = new RegExp("^(?=.{8,})(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*\\W).*$", "g"); |
| 25 | + var mediumRegex = new RegExp("^(?=.{7,})(((?=.*[A-Z])(?=.*[a-z]))|((?=.*[A-Z])(?=.*[0-9]))|((?=.*[a-z])(?=.*[0-9]))).*$", "g"); |
| 26 | + var enoughRegex = new RegExp("(?=.{6,}).*", "g"); |
| 27 | + var pwd = document.getElementById("wpPassword2"); |
| 28 | + |
| 29 | + if (pwd.value.length==0) { |
| 30 | + strength.innerHTML = mw.message( 'signupapi-enterpassword' ); |
| 31 | + } else if (pwd.value.length<minlength) { |
| 32 | + strength.innerHTML = mw.message( 'signupapi-passwordtooshort', minlength ); |
| 33 | + $("#progress").progressbar({value: 10}); |
| 34 | + $("div.ui-progressbar-value").css("background","red"); |
| 35 | + } else if (strongRegex.test(pwd.value)) { |
| 36 | + strength.innerHTML = '<span style="color:green">'+mw.message( 'signupapi-strong' )+'</span>'; |
| 37 | + $("#progress").progressbar({value: 100}); |
| 38 | + $("div.ui-progressbar-value").css("background","green"); |
| 39 | + } else if (mediumRegex.test(pwd.value)) { |
| 40 | + strength.innerHTML = '<span style="color:orange">'+mw.message( 'signupapi-medium' )+'</span>'; |
| 41 | + $("#progress").progressbar({value: 60}); |
| 42 | + $("div.ui-progressbar-value").css("background","orange"); |
| 43 | + } else { |
| 44 | + strength.innerHTML = '<span style="color:red">'+mw.message( 'signupapi-weak' )+'</span>'; |
| 45 | + $("#progress").progressbar({value: 30}); |
| 46 | + $("div.ui-progressbar-value").css("background","red"); |
| 47 | + } |
45 | 48 | } |
46 | | -} |
47 | 49 | |
48 | | -function checkRetype( pass,retype ) { |
49 | | - var valresult = document.getElementById('wpRetypeval'); |
50 | | - var image = ""; |
51 | | - var message = ""; |
52 | | - if ( pass==retype ) { |
53 | | - image = "<img src='"+ imagePath +"MW-Icon-CheckMark.png'>"; |
54 | | - message = mw.message( 'signupapi-passwordsmatch' ); |
55 | | - }else { |
56 | | - image = "<img src='"+ imagePath +"MW-Icon-NoMark.png'>"; |
57 | | - message = mw.message( 'signupapi-badretype' ); |
| 50 | + function checkRetype( pass,retype ) { |
| 51 | + var valresult = document.getElementById('wpRetypeval'); |
| 52 | + var image = ""; |
| 53 | + var message = ""; |
| 54 | + if ( pass==retype ) { |
| 55 | + image = "<img src='"+ imagePath +"MW-Icon-CheckMark.png'>"; |
| 56 | + message = mw.message( 'signupapi-passwordsmatch' ); |
| 57 | + }else { |
| 58 | + image = "<img src='"+ imagePath +"MW-Icon-NoMark.png'>"; |
| 59 | + message = mw.message( 'signupapi-badretype' ); |
| 60 | + } |
| 61 | + valresult.innerHTML = image+message; |
58 | 62 | } |
59 | | - valresult.innerHTML = image+message; |
60 | | -} |
61 | 63 | |
62 | | -$('#wpName2').change(function() {validateInput("username","wpName2");}); |
63 | | -$('#wpPassword2').keyup(function() {passwordStrength();}); |
64 | | -$('#wpRetype').change(function() {checkRetype(document.getElementById("wpPassword2").value,document.getElementById("wpRetype").value);}); |
65 | | -$('#wpEmail').change(function() {validateInput( "email","wpEmail" );}); |
| 64 | + $('#wpName2').change(function() {validateInput("username","wpName2");}); |
| 65 | + $('#wpPassword2').keyup(function() {passwordStrength();}); |
| 66 | + $('#wpRetype').change(function() {checkRetype(document.getElementById("wpPassword2").value,document.getElementById("wpRetype").value);}); |
| 67 | + $('#wpEmail').change(function() {validateInput( "email","wpEmail" );}); |
66 | 68 | |
67 | | -$('#wpName2').after('<span id="wpName2val" class="wpName2val"></span>'); |
68 | | -$('#wpPassword2').after('<span id="wpPassword2val"></span><div id="progress" class="progress" style="width:30%; float: right;"></div>'); |
69 | | -$('#wpRetype').after('<span id="wpRetypeval" class="wpRetypeval"></span>'); |
70 | | -$('#wpEmail').after('<span id="wpEmailval" class="wpEmailval"></span>'); |
| 69 | + $('#wpName2').after('<span id="wpName2val" class="wpName2val"></span>'); |
| 70 | + $('#wpPassword2').after('<span id="wpPassword2val"></span><div id="progress" class="progress" style="width:30%; float: right;"></div>'); |
| 71 | + $('#wpRetype').after('<span id="wpRetypeval" class="wpRetypeval"></span>'); |
| 72 | + $('#wpEmail').after('<span id="wpEmailval" class="wpEmailval"></span>'); |
71 | 73 | |
72 | | -$("#progress").progressbar(); |
73 | | -console.log(); |
74 | | -$('div.ui-progressbar').css('background','#F2F5F7'); |
| 74 | + $("#progress").progressbar(); |
| 75 | + console.log(); |
| 76 | + $('div.ui-progressbar').css('background','#F2F5F7'); |
75 | 77 | |
76 | | -var imagePath = window.wgServer+window.wgExtensionAssetsPath + "/SignupAPI/includes/images/"; |
77 | | -var minlength = window.wgMinimalPasswordLength; |
| 78 | + var imagePath = window.wgServer+window.wgExtensionAssetsPath + "/SignupAPI/includes/images/"; |
| 79 | + var minlength = window.wgMinimalPasswordLength; |
78 | 80 | |
| 81 | +} ); |
79 | 82 | |