From f6d65e533c62f6deb21342d4901ece24497b433e Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 4 Jun 2015 07:31:04 +0200 Subject: Update to MediaWiki 1.25.1 --- .../resources/ext.confirmEdit.fancyCaptcha.css | 41 +++++++++++++++++++++ .../resources/ext.confirmEdit.fancyCaptcha.js | 37 +++++++++++++++++++ .../resources/images/ajax-loader-10x10.gif | Bin 0 -> 6147 bytes .../resources/images/fancycaptcha-reload-icon.png | Bin 0 -> 307 bytes 4 files changed, 78 insertions(+) create mode 100644 extensions/ConfirmEdit/FancyCaptcha/resources/ext.confirmEdit.fancyCaptcha.css create mode 100644 extensions/ConfirmEdit/FancyCaptcha/resources/ext.confirmEdit.fancyCaptcha.js create mode 100644 extensions/ConfirmEdit/FancyCaptcha/resources/images/ajax-loader-10x10.gif create mode 100644 extensions/ConfirmEdit/FancyCaptcha/resources/images/fancycaptcha-reload-icon.png (limited to 'extensions/ConfirmEdit/FancyCaptcha/resources') diff --git a/extensions/ConfirmEdit/FancyCaptcha/resources/ext.confirmEdit.fancyCaptcha.css b/extensions/ConfirmEdit/FancyCaptcha/resources/ext.confirmEdit.fancyCaptcha.css new file mode 100644 index 00000000..96e4dd6a --- /dev/null +++ b/extensions/ConfirmEdit/FancyCaptcha/resources/ext.confirmEdit.fancyCaptcha.css @@ -0,0 +1,41 @@ +.fancycaptcha-wrapper { + display: table; + background-color: #FFF; +} + +/* Prevents the size of the container from changing, affecting page +layout, for normal CAPTCHA sizes. */ +.fancycaptcha-image-container { + min-height: 95px; + position: relative; /* to position Reload link within this */ + display: inline-block; +} + +.client-nojs .fancycaptcha-reload { + display: none; +} + +.fancycaptcha-reload { + /* @embed */ + background: url(images/fancycaptcha-reload-icon.png) no-repeat scroll left center transparent; + + margin: 0 0 0 3px; + padding: 1px 2px 1px 12px; + color: #0645AD; + cursor: pointer; + cursor: hand; +} + +.fancycaptcha-reload:hover { + text-decoration: underline; +} +.fancycaptcha-reload-loading { + /* @embed */ + background: url(images/ajax-loader-10x10.gif) no-repeat scroll left center transparent; +} + +.fancycaptcha-image-container .fancycaptcha-reload { + position: absolute; + bottom: 0; + right: 4px; +} diff --git a/extensions/ConfirmEdit/FancyCaptcha/resources/ext.confirmEdit.fancyCaptcha.js b/extensions/ConfirmEdit/FancyCaptcha/resources/ext.confirmEdit.fancyCaptcha.js new file mode 100644 index 00000000..a8db7218 --- /dev/null +++ b/extensions/ConfirmEdit/FancyCaptcha/resources/ext.confirmEdit.fancyCaptcha.js @@ -0,0 +1,37 @@ +( function ( $, mw ) { + var api = new mw.Api(); + $( document ).on( 'click', '.fancycaptcha-reload', function () { + var $this = $( this ), $captchaImage; + + $this.addClass( 'fancycaptcha-reload-loading' ); + + $captchaImage = $( '.fancycaptcha-image' ); + + // AJAX request to get captcha index key + api.post( { + action: 'fancycaptchareload', + format: 'xml' + }, { + dataType: 'xml' + } ) + .done( function ( xmldata ) { + var imgSrc, captchaIndex; + captchaIndex = $( xmldata ).find( 'fancycaptchareload' ).attr( 'index' ); + if ( typeof captchaIndex === 'string' ) { + // replace index key with a new one for captcha image + imgSrc = $captchaImage.attr( 'src' ) + .replace( /(wpCaptchaId=)\w+/, '$1' + captchaIndex ); + $captchaImage.attr( 'src', imgSrc ); + + // replace index key with a new one for hidden tag + $( '#wpCaptchaId' ).val( captchaIndex ); + $( '#wpCaptchaWord' ).val( '' ).focus(); + } + } ) + .always( function () { + $this.removeClass( 'fancycaptcha-reload-loading' ); + } ); + + return false; + } ); +} )( jQuery, mediaWiki ); diff --git a/extensions/ConfirmEdit/FancyCaptcha/resources/images/ajax-loader-10x10.gif b/extensions/ConfirmEdit/FancyCaptcha/resources/images/ajax-loader-10x10.gif new file mode 100644 index 00000000..772e9a55 Binary files /dev/null and b/extensions/ConfirmEdit/FancyCaptcha/resources/images/ajax-loader-10x10.gif differ diff --git a/extensions/ConfirmEdit/FancyCaptcha/resources/images/fancycaptcha-reload-icon.png b/extensions/ConfirmEdit/FancyCaptcha/resources/images/fancycaptcha-reload-icon.png new file mode 100644 index 00000000..6cbde303 Binary files /dev/null and b/extensions/ConfirmEdit/FancyCaptcha/resources/images/fancycaptcha-reload-icon.png differ -- cgit v1.2.3-54-g00ecf