From: James D. Forrester Date: Thu, 5 Jun 2014 00:11:56 +0000 (-0700) Subject: Update OOjs UI to v0.1.0-pre (cbc62ac803) X-Git-Tag: 1.31.0-rc.0~15468 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=77f9979e9b6d3d80e019c057230bf726dd92223c;p=lhc%2Fweb%2Fwiklou.git Update OOjs UI to v0.1.0-pre (cbc62ac803) 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 --- diff --git a/resources/lib/oojs-ui/i18n/gl.json b/resources/lib/oojs-ui/i18n/gl.json index 949b0345c7..a4b6787c45 100644 --- a/resources/lib/oojs-ui/i18n/gl.json +++ b/resources/lib/oojs-ui/i18n/gl.json @@ -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" } diff --git a/resources/lib/oojs-ui/i18n/hr.json b/resources/lib/oojs-ui/i18n/hr.json index afc727cd91..f16f984010 100644 --- a/resources/lib/oojs-ui/i18n/hr.json +++ b/resources/lib/oojs-ui/i18n/hr.json @@ -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" } diff --git a/resources/lib/oojs-ui/i18n/ia.json b/resources/lib/oojs-ui/i18n/ia.json index bdd8fdf17f..f1c9ced37b 100644 --- a/resources/lib/oojs-ui/i18n/ia.json +++ b/resources/lib/oojs-ui/i18n/ia.json @@ -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" } diff --git a/resources/lib/oojs-ui/i18n/sr-ec.json b/resources/lib/oojs-ui/i18n/sr-ec.json index 08bbb59c0a..308ed848ae 100644 --- a/resources/lib/oojs-ui/i18n/sr-ec.json +++ b/resources/lib/oojs-ui/i18n/sr-ec.json @@ -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": "Откажи" } diff --git a/resources/lib/oojs-ui/i18n/sr-el.json b/resources/lib/oojs-ui/i18n/sr-el.json index 1f2da2de85..889b0f6801 100644 --- a/resources/lib/oojs-ui/i18n/sr-el.json +++ b/resources/lib/oojs-ui/i18n/sr-el.json @@ -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?" } diff --git a/resources/lib/oojs-ui/oojs-ui.js b/resources/lib/oojs-ui/oojs-ui.js index cf680f58a1..1f2da19e8a 100644 --- a/resources/lib/oojs-ui/oojs-ui.js +++ b/resources/lib/oojs-ui/oojs-ui.js @@ -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.$( '
' ).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. diff --git a/resources/lib/oojs-ui/oojs-ui.svg.css b/resources/lib/oojs-ui/oojs-ui.svg.css index f50be3021c..1f787b37db 100644 --- a/resources/lib/oojs-ui/oojs-ui.svg.css +++ b/resources/lib/oojs-ui/oojs-ui.svg.css @@ -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 */