Merge "jquery.confirmable: Add a space between buttons"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sun, 21 Sep 2014 05:10:38 +0000 (05:10 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sun, 21 Sep 2014 05:10:38 +0000 (05:10 +0000)
resources/Resources.php
resources/src/jquery/jquery.confirmable.js
resources/src/jquery/jquery.confirmable.mediawiki.js

index c634d9d..70905fb 100644 (file)
@@ -200,6 +200,7 @@ return array(
                        'confirmable-confirm',
                        'confirmable-yes',
                        'confirmable-no',
+                       'word-separator',
                ),
                'styles' => 'resources/src/jquery/jquery.confirmable.css',
                'dependencies' => 'mediawiki.jqueryMsg',
index 4b80d95..339e65a 100644 (file)
@@ -36,6 +36,7 @@
         * @param {Function} [options.handler] Callback to fire when the action is confirmed (user clicks
         *     the 'Yes' button).
         * @param {string} [options.i18n] Text to use for interface elements.
+        * @param {string} [options.i18n.space] Word separator to place between the three text messages.
         * @param {string} [options.i18n.confirm] Text to use for the confirmation question.
         * @param {string} [options.i18n.yes] Text to use for the 'Yes' button.
         * @param {string} [options.i18n.no] Text to use for the 'No' button.
 
                                $interface = $( '<span>' )
                                        .addClass( 'jquery-confirmable-interface' )
-                                       .append( $text, $buttonYes, $buttonNo );
+                                       .append( $text, options.i18n.space, $buttonYes, options.i18n.space, $buttonNo );
                                $interface = options.wrapperCallback( $interface );
 
                                // Render offscreen to measure real width
                buttonCallback: identity,
                handler: null,
                i18n: {
+                       space: ' ',
                        confirm: 'Are you sure?',
                        yes: 'Yes',
                        no: 'No'
index 7ac04f4..d4a106e 100644 (file)
@@ -6,6 +6,7 @@
 
 ( function ( mw, $ ) {
        $.fn.confirmable.defaultOptions.i18n = {
+               space: mw.message( 'word-separator' ).text(),
                confirm: mw.message( 'confirmable-confirm', mw.user ).text(),
                yes: mw.message( 'confirmable-yes' ).text(),
                no: mw.message( 'confirmable-no' ).text()