Update OOjs UI to v0.1.0-pre (cbc62ac803)
authorJames D. Forrester <jforrester@wikimedia.org>
Thu, 5 Jun 2014 00:11:56 +0000 (17:11 -0700)
committerJames D. Forrester <jforrester@wikimedia.org>
Thu, 5 Jun 2014 00:11:56 +0000 (17:11 -0700)
New changes:
47b147e [BREAKING CHANGE] Use promises for confirmation dialog instead of done event
bcbf56b Localisation updates from https://translatewiki.net.
997292b Localisation updates from https://translatewiki.net.

Change-Id: Iafee3075f79f064d2eb9f5528e7d0bf7c1c52c11

resources/lib/oojs-ui/i18n/gl.json
resources/lib/oojs-ui/i18n/hr.json
resources/lib/oojs-ui/i18n/ia.json
resources/lib/oojs-ui/i18n/sr-ec.json
resources/lib/oojs-ui/i18n/sr-el.json
resources/lib/oojs-ui/oojs-ui.js
resources/lib/oojs-ui/oojs-ui.svg.css

index 949b034..a4b6787 100644 (file)
@@ -10,5 +10,9 @@
        "ooui-outline-control-move-down": "Mover o elemento abaixo",
        "ooui-outline-control-move-up": "Mover o elemento arriba",
        "ooui-outline-control-remove": "Eliminar o elemento",
-       "ooui-toolbar-more": "Máis"
+       "ooui-toolbar-more": "Máis",
+       "ooui-dialog-confirm-title": "Confirmar",
+       "ooui-dialog-confirm-default-prompt": "Está seguro?",
+       "ooui-dialog-confirm-default-ok": "Aceptar",
+       "ooui-dialog-confirm-default-cancel": "Cancelar"
 }
index afc727c..f16f984 100644 (file)
@@ -9,5 +9,6 @@
        "ooui-dialog-action-close": "zatvori",
        "ooui-outline-control-move-down": "Premjesti stavku dolje",
        "ooui-outline-control-move-up": "Premjesti stavku gore",
+       "ooui-outline-control-remove": "Ukloni",
        "ooui-toolbar-more": "Više mogućnosti"
 }
index bdd8fdf..f1c9ced 100644 (file)
@@ -11,5 +11,6 @@
        "ooui-toolbar-more": "Plus",
        "ooui-dialog-confirm-title": "Confirmation",
        "ooui-dialog-confirm-default-prompt": "Es tu secur?",
+       "ooui-dialog-confirm-default-ok": "OK",
        "ooui-dialog-confirm-default-cancel": "Cancellar"
 }
index 08bbb59..308ed84 100644 (file)
@@ -12,6 +12,7 @@
        "ooui-outline-control-remove": "Уклони ставку",
        "ooui-toolbar-more": "Више",
        "ooui-dialog-confirm-title": "Потврди",
+       "ooui-dialog-confirm-default-prompt": "Јесте ли сигурни?",
        "ooui-dialog-confirm-default-ok": "У реду",
        "ooui-dialog-confirm-default-cancel": "Откажи"
 }
index 1f2da2d..889b0f6 100644 (file)
@@ -8,5 +8,6 @@
        "ooui-outline-control-move-down": "Premesti stavku na dole",
        "ooui-outline-control-move-up": "Premesti stavku na gore",
        "ooui-outline-control-remove": "Ukloni stavku",
-       "ooui-toolbar-more": "Više"
+       "ooui-toolbar-more": "Više",
+       "ooui-dialog-confirm-default-prompt": "Jeste li sigurni?"
 }
index cf680f5..1f2da19 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (6379e76bf5)
+ * OOjs UI v0.1.0-pre (cbc62ac803)
  * https://www.mediawiki.org/wiki/OOjs_UI
  *
  * Copyright 2011–2014 OOjs Team and other contributors.
  * Released under the MIT license
  * http://oojs.mit-license.org
  *
- * Date: Mon Jun 02 2014 17:52:03 GMT-0700 (PDT)
+ * Date: Wed Jun 04 2014 17:11:52 GMT-0700 (PDT)
  */
 ( function ( OO ) {
 
@@ -1314,7 +1314,7 @@ OO.ui.Window.prototype.getTeardownProcess = function () {
 /**
  * Open window.
  *
- * Do not override this method. Use #geSetupProcess to do something each time the window closes.
+ * Do not override this method. Use #getSetupProcess to do something each time the window closes.
  *
  * @param {Object} [data] Window opening data
  * @fires initialize
@@ -2099,10 +2099,10 @@ OO.ui.ConfirmationDialog.prototype.initialize = function () {
        this.$promptContainer = this.$( '<div>' ).addClass( 'oo-ui-dialog-confirm-promptContainer' );
 
        this.cancelButton = new OO.ui.ButtonWidget();
-       this.cancelButton.connect( this, { 'click': [ 'emit', 'done', 'cancel' ] } );
+       this.cancelButton.connect( this, { 'click': [ 'close', 'cancel' ] } );
 
        this.okButton = new OO.ui.ButtonWidget();
-       this.okButton.connect( this, { 'click': [ 'emit', 'done', 'ok' ] } );
+       this.okButton.connect( this, { 'click': [ 'close', 'ok' ] } );
 
        // Make the buttons
        contentLayout.$element.append( this.$promptContainer );
@@ -2113,14 +2113,11 @@ OO.ui.ConfirmationDialog.prototype.initialize = function () {
                this.cancelButton.$element
        );
 
-       this.connect( this, {
-               'done': 'close',
-               'close': [ 'emit', 'cancel' ]
-       } );
+       this.connect( this, { 'close': [ 'close', 'cancel' ] } );
 };
 
 /*
- * Open a confirmation dialog.
+ * Setup a confirmation dialog.
  *
  * @param {Object} [data] Window opening data including text of the dialog and text for the buttons
  * @param {jQuery|string} [data.prompt] Text to display or list of nodes to use as content of the dialog.
@@ -2128,25 +2125,42 @@ OO.ui.ConfirmationDialog.prototype.initialize = function () {
  * @param {jQuery|string|Function|null} [data.cancelLabel] Label of the cancel button
  * @param {string|string[]} [data.okFlags="constructive"] Flags for the OK button
  * @param {string|string[]} [data.cancelFlags="destructive"] Flags for the cancel button
+ * @return {OO.ui.Process} Setup process
  */
-OO.ui.ConfirmationDialog.prototype.setup = function ( data ) {
+OO.ui.ConfirmationDialog.prototype.getSetupProcess = function ( data ) {
        // Parent method
-       OO.ui.Dialog.prototype.setup.call( this, data );
-
-       var prompt = data.prompt || OO.ui.deferMsg( 'ooui-dialog-confirm-default-prompt' ),
-               okLabel = data.okLabel || OO.ui.deferMsg( 'ooui-dialog-confirm-default-ok' ),
-               cancelLabel = data.cancelLabel || OO.ui.deferMsg( 'ooui-dialog-confirm-default-cancel' ),
-               okFlags = data.okFlags || 'constructive',
-               cancelFlags = data.cancelFlags || 'destructive';
+       return OO.ui.ConfirmationDialog.super.prototype.getSetupProcess.call( this, data )
+               .next( function () {
+                       var prompt = data.prompt || OO.ui.deferMsg( 'ooui-dialog-confirm-default-prompt' ),
+                               okLabel = data.okLabel || OO.ui.deferMsg( 'ooui-dialog-confirm-default-ok' ),
+                               cancelLabel = data.cancelLabel || OO.ui.deferMsg( 'ooui-dialog-confirm-default-cancel' ),
+                               okFlags = data.okFlags || 'constructive',
+                               cancelFlags = data.cancelFlags || 'destructive';
+
+                       if ( typeof prompt === 'string' ) {
+                               this.$promptContainer.text( prompt );
+                       } else {
+                               this.$promptContainer.empty().append( prompt );
+                       }
 
-       if ( typeof prompt === 'string' ) {
-               this.$promptContainer.text( prompt );
-       } else {
-               this.$promptContainer.empty().append( prompt );
-       }
+                       this.okButton.setLabel( okLabel ).clearFlags().setFlags( okFlags );
+                       this.cancelButton.setLabel( cancelLabel ).clearFlags().setFlags( cancelFlags );
+               }, this );
+};
 
-       this.okButton.setLabel( okLabel ).clearFlags().setFlags( okFlags );
-       this.cancelButton.setLabel( cancelLabel ).clearFlags().setFlags( cancelFlags );
+/**
+ * @inheritdoc
+ */
+OO.ui.ConfirmationDialog.prototype.getTeardownProcess = function ( data ) {
+       // Parent method
+       return OO.ui.ConfirmationDialog.super.prototype.getTeardownProcess.call( this, data )
+               .first( function () {
+                       if ( data === 'ok' ) {
+                               this.opened.resolve();
+                       } else if ( data === 'cancel' ) {
+                               this.opened.reject();
+                       }
+               }, this );
 };
 /**
  * Element with a button.
index f50be30..1f787b3 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (6379e76bf5)
+ * OOjs UI v0.1.0-pre (cbc62ac803)
  * https://www.mediawiki.org/wiki/OOjs_UI
  *
  * Copyright 2011–2014 OOjs Team and other contributors.
  * Released under the MIT license
  * http://oojs.mit-license.org
  *
- * Date: Mon Jun 02 2014 17:52:03 GMT-0700 (PDT)
+ * Date: Wed Jun 04 2014 17:11:52 GMT-0700 (PDT)
  */
 
 /* Textures */