Update OOjs UI to v0.1.0-pre (e4f6ce0156)
authorJames D. Forrester <jforrester@wikimedia.org>
Thu, 6 Mar 2014 00:08:51 +0000 (16:08 -0800)
committerJames D. Forrester <jforrester@wikimedia.org>
Thu, 6 Mar 2014 00:08:51 +0000 (16:08 -0800)
New changes:
b19e296 Localisation updates from https://translatewiki.net.
4813d30 WindowSet: Add support for overriding the creation a window
218d29f Localisation updates from https://translatewiki.net.
50fd396 Add more dialog sizes and make them switchable
22f405e Make it possible to toggle the outline in a booklet layout
e4f6ce0 Hack for preventing opacity-related rendering glitches

Change-Id: If55568c69333d4749b285408d27fa6e9e42a7f37

13 files changed:
resources/oojs-ui/i18n/ast.json
resources/oojs-ui/i18n/hy.json
resources/oojs-ui/i18n/is.json
resources/oojs-ui/i18n/ko.json
resources/oojs-ui/i18n/lb.json
resources/oojs-ui/i18n/lt.json
resources/oojs-ui/i18n/nl.json
resources/oojs-ui/i18n/sq.json
resources/oojs-ui/i18n/sv.json
resources/oojs-ui/i18n/uk.json
resources/oojs-ui/oojs-ui-apex.css
resources/oojs-ui/oojs-ui.js
resources/oojs-ui/oojs-ui.svg.css

index 959ea23..fe6ea0a 100644 (file)
@@ -9,5 +9,6 @@
     "ooui-dialog-action-close": "Zarrar",
     "ooui-outline-control-move-down": "Mover abaxo l'elementu",
     "ooui-outline-control-move-up": "Mover arriba l'elementu",
+    "ooui-outline-control-remove": "Desaniciar elementu",
     "ooui-toolbar-more": "Más"
 }
\ No newline at end of file
index f6cb90b..4cb8821 100644 (file)
@@ -8,5 +8,6 @@
     "ooui-dialog-action-close": "Փակել",
     "ooui-outline-control-move-down": "Իջեցնել կետը",
     "ooui-outline-control-move-up": "Բարձրացնել կետը",
+    "ooui-outline-control-remove": "Հեռացնել տարրը",
     "ooui-toolbar-more": "Ավելին"
 }
\ No newline at end of file
index efe0e67..fbdb5d1 100644 (file)
@@ -6,7 +6,7 @@
         ]
     },
     "ooui-dialog-action-close": "Loka",
-    "ooui-outline-control-move-down": "Færa atriða niður",
-    "ooui-outline-control-move-up": "Færa atriða upp",
+    "ooui-outline-control-move-down": "Færa atriði niður",
+    "ooui-outline-control-move-up": "Færa atriði upp",
     "ooui-toolbar-more": "Fleira"
 }
\ No newline at end of file
index f1f61df..25749ce 100644 (file)
@@ -11,5 +11,6 @@
     "ooui-dialog-action-close": "닫기",
     "ooui-outline-control-move-down": "항목을 아래로 옮기기",
     "ooui-outline-control-move-up": "항목을 위로 옮기기",
+    "ooui-outline-control-remove": "항목 지우기",
     "ooui-toolbar-more": "더 보기"
 }
\ No newline at end of file
index a18894e..6359026 100644 (file)
@@ -13,5 +13,6 @@
     "ooui-dialog-action-close": "Zoumaachen",
     "ooui-outline-control-move-down": "Element erof réckelen",
     "ooui-outline-control-move-up": "Element erop réckelen",
+    "ooui-outline-control-remove": "Element ewechhuelen",
     "ooui-toolbar-more": "Méi"
 }
\ No newline at end of file
index b3a16e8..db679bc 100644 (file)
@@ -2,8 +2,10 @@
     "@metadata": {
         "authors": [
             "Audriusa",
-            "Eitvys200"
+            "Eitvys200",
+            "Mantak111"
         ]
     },
-    "ooui-dialog-action-close": "Uždaryti"
+    "ooui-dialog-action-close": "Uždaryti",
+    "ooui-outline-control-remove": "Šalinti elementus"
 }
\ No newline at end of file
index 75db0a7..549fad2 100644 (file)
             "Saruman",
             "Siebrand",
             "Southparkfan",
-            "सरोज कुमार ढकाल"
+            "सरोज कुमार ढकाल",
+            "Sjoerddebruin"
         ]
     },
     "ooui-dialog-action-close": "Sluiten",
     "ooui-outline-control-move-down": "Item omlaag verplaatsen",
     "ooui-outline-control-move-up": "Item omhoog verplaatsen",
+    "ooui-outline-control-remove": "Item verwijderen",
     "ooui-toolbar-more": "Meer"
 }
\ No newline at end of file
index 424f1be..6c31c93 100644 (file)
@@ -1,11 +1,13 @@
 {
     "@metadata": {
         "authors": [
-            "Euriditi"
+            "Euriditi",
+            "Kushtrim"
         ]
     },
     "ooui-dialog-action-close": "Mbylle",
     "ooui-outline-control-move-down": "Zhvendose artikullin më poshtë",
     "ooui-outline-control-move-up": "Zhvendose artikullin më lart",
+    "ooui-outline-control-remove": "Largoje artikullin",
     "ooui-toolbar-more": "Më tepër..."
 }
\ No newline at end of file
index 74d654b..f7d6f04 100644 (file)
             "Per",
             "Sendelbach",
             "Skalman",
-            "WikiPhoenix"
+            "WikiPhoenix",
+            "Lokal Profil"
         ]
     },
     "ooui-dialog-action-close": "Stäng",
     "ooui-outline-control-move-down": "Flytta ned objekt",
     "ooui-outline-control-move-up": "Flytta upp objekt",
+    "ooui-outline-control-remove": "Ta bort objekt",
     "ooui-toolbar-more": "Mer"
 }
\ No newline at end of file
index 9a47ad7..42487c9 100644 (file)
@@ -20,5 +20,6 @@
     "ooui-dialog-action-close": "Закрити",
     "ooui-outline-control-move-down": "Перемістити елемент униз",
     "ooui-outline-control-move-up": "Перемістити елемент вгору",
+    "ooui-outline-control-remove": "Видалити елемент",
     "ooui-toolbar-more": "Більше"
 }
\ No newline at end of file
index 468c78a..7144ecb 100644 (file)
   box-shadow: none;
 }
 
+.oo-ui-bookletLayout > .oo-ui-gridLayout > .oo-ui-panelLayout {
+  -webkit-transition: width 250ms ease-in-out, height 250ms ease-in-out, top 250ms ease-in-out, left 250ms ease-in-out;
+     -moz-transition: width 250ms ease-in-out, height 250ms ease-in-out, top 250ms ease-in-out, left 250ms ease-in-out;
+      -ms-transition: width 250ms ease-in-out, height 250ms ease-in-out, top 250ms ease-in-out, left 250ms ease-in-out;
+       -o-transition: width 250ms ease-in-out, height 250ms ease-in-out, top 250ms ease-in-out, left 250ms ease-in-out;
+          transition: width 250ms ease-in-out, height 250ms ease-in-out, top 250ms ease-in-out, left 250ms ease-in-out;
+}
+
 .oo-ui-bookletLayout-outlinePanel {
   border-right: solid 1px #ddd;
 }
index 39406bb..58785f0 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (8ac38a5c31)
+ * OOjs UI v0.1.0-pre (e4f6ce0156)
  * 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: Tue Mar 04 2014 11:26:29 GMT-0800 (PST)
+ * Date: Wed Mar 05 2014 16:08:46 GMT-0800 (PST)
  */
 ( function () {
 
@@ -1454,12 +1454,22 @@ OO.ui.WindowSet.prototype.getWindow = function ( name ) {
                throw new Error( 'Unknown window: ' + name );
        }
        if ( !( name in this.windows ) ) {
-               win = this.windows[name] = this.factory.create( name, this, { '$': this.$ } );
+               win = this.windows[name] = this.createWindow( name );
                this.addWindow( win );
        }
        return this.windows[name];
 };
 
+/**
+ * Create a window for use in this window set.
+ *
+ * @param {string} name Symbolic name of window
+ * @return {OO.ui.Window} Window with specified name
+ */
+OO.ui.WindowSet.prototype.createWindow = function ( name ) {
+       return this.factory.create( name, { '$': this.$ } );
+};
+
 /**
  * Add a given window to this window set.
  *
@@ -1493,11 +1503,11 @@ OO.ui.WindowSet.prototype.addWindow = function ( win ) {
  * @constructor
  * @param {Object} [config] Configuration options
  * @cfg {boolean} [footless] Hide foot
- * @cfg {boolean} [small] Make the dialog small
+ * @cfg {string} [size='large'] Symbolic name of dialog size, `small`, `medium` or `large`
  */
 OO.ui.Dialog = function OoUiDialog( config ) {
        // Configuration initialization
-       config = config || {};
+       config = $.extend( { 'size': 'large' }, config );
 
        // Parent constructor
        OO.ui.Window.call( this, config );
@@ -1505,7 +1515,7 @@ OO.ui.Dialog = function OoUiDialog( config ) {
        // Properties
        this.visible = false;
        this.footless = !!config.footless;
-       this.small = !!config.small;
+       this.size = null;
        this.onWindowMouseWheelHandler = OO.ui.bind( this.onWindowMouseWheel, this );
        this.onDocumentKeyDownHandler = OO.ui.bind( this.onDocumentKeyDown, this );
 
@@ -1515,6 +1525,7 @@ OO.ui.Dialog = function OoUiDialog( config ) {
 
        // Initialization
        this.$element.addClass( 'oo-ui-dialog' );
+       this.setSize( config.size );
 };
 
 /* Inheritance */
@@ -1533,6 +1544,18 @@ OO.inheritClass( OO.ui.Dialog, OO.ui.Window );
  */
 OO.ui.Dialog.static.name = '';
 
+/**
+ * Map of symbolic size names and CSS classes.
+ *
+ * @static
+ * @property {Object}
+ */
+OO.ui.Dialog.static.sizeCssClasses = {
+       'small': 'oo-ui-dialog-small',
+       'medium': 'oo-ui-dialog-medium',
+       'large': 'oo-ui-dialog-large'
+};
+
 /* Methods */
 
 /**
@@ -1593,6 +1616,29 @@ OO.ui.Dialog.prototype.onOpening = function () {
        this.$element.addClass( 'oo-ui-dialog-open' );
 };
 
+/**
+ * Set dialog size.
+ *
+ * @param {string} [size='large'] Symbolic name of dialog size, `small`, `medium` or `large`
+ */
+OO.ui.Dialog.prototype.setSize = function ( size ) {
+       var name, state, cssClass,
+               sizeCssClasses = OO.ui.Dialog.static.sizeCssClasses;
+
+       if ( !sizeCssClasses[size] ) {
+               size = 'large';
+       }
+       this.size = size;
+       for ( name in sizeCssClasses ) {
+               state = name === size;
+               cssClass = sizeCssClasses[name];
+               this.$element.toggleClass( cssClass, state );
+               if ( this.frame.$content ) {
+                       this.frame.$content.toggleClass( cssClass, state );
+               }
+       }
+};
+
 /**
  * @inheritdoc
  */
@@ -1617,9 +1663,6 @@ OO.ui.Dialog.prototype.initialize = function () {
        if ( this.footless ) {
                this.frame.$content.addClass( 'oo-ui-dialog-content-footless' );
        }
-       if ( this.small ) {
-               this.$frame.addClass( 'oo-ui-window-frame-small' );
-       }
        this.closeButton.$element.addClass( 'oo-ui-window-closeButton' );
        this.$head.append( this.closeButton.$element );
 };
@@ -3842,6 +3885,7 @@ OO.ui.BookletLayout = function OoUiBookletLayout( config ) {
        this.ignoreFocus = false;
        this.stackLayout = new OO.ui.StackLayout( { '$': this.$, 'continuous': !!config.continuous } );
        this.autoFocus = !!config.autoFocus;
+       this.outlineVisible = false;
        this.outlined = !!config.outlined;
        if ( this.outlined ) {
                this.editable = !!config.editable;
@@ -3852,6 +3896,7 @@ OO.ui.BookletLayout = function OoUiBookletLayout( config ) {
                this.gridLayout = new OO.ui.GridLayout(
                        [this.outlinePanel, this.stackLayout], { '$': this.$, 'widths': [1, 2] }
                );
+               this.outlineVisible = true;
                if ( this.editable ) {
                        this.outlineControlsWidget = new OO.ui.OutlineControlsWidget(
                                this.outlineWidget,
@@ -3986,6 +4031,32 @@ OO.ui.BookletLayout.prototype.isEditable = function () {
        return this.editable;
 };
 
+/**
+ * Check if booklet has editing controls.
+ *
+ * @method
+ * @returns {boolean} Booklet is outlined
+ */
+OO.ui.BookletLayout.prototype.isOutlineVisible = function () {
+       return this.outlined && this.outlineVisible;
+};
+
+/**
+ * Hide or show the outline.
+ *
+ * @param {boolean} [show] Show outline, omit to invert current state
+ * @chainable
+ */
+OO.ui.BookletLayout.prototype.toggleOutline = function ( show ) {
+       if ( this.outlined ) {
+               show = show === undefined ? !this.outlineVisible : !!show;
+               this.outlineVisible = show;
+               this.gridLayout.layout( show ? [ 1, 2 ] : [ 0, 1 ], [ 1 ] );
+       }
+
+       return this;
+};
+
 /**
  * Get the outline widget.
  *
index 5609496..8cf4f64 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (8ac38a5c31)
+ * OOjs UI v0.1.0-pre (e4f6ce0156)
  * 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: Tue Mar 04 2014 11:26:29 GMT-0800 (PST)
+ * Date: Wed Mar 05 2014 16:08:46 GMT-0800 (PST)
  */
 
 /* Textures */
   left: 0;
   padding: 1em;
   line-height: 1em;
+  /* Fix for strange opacity-related rendering issues.
+          CAUTION: -webkit-backface-visibility: hidden; is EXTREMELY DANGEROUS.
+          If applied to a VE surface directly, it will break selection of
+          FocusableNodes, and in the past it's caused transparent PNGs to
+          render as opaque black images. For some reason applying it to the dialog
+          wrapper in the main document fixes opacity-related behavior in the iframe
+          document, but doesn't break the surface inside the iframe. */
+
+  -webkit-backface-visibility: hidden;
+          backface-visibility: hidden;
 }
 
 .oo-ui-dialog .oo-ui-window-frame {
   right: 0;
   bottom: 1em;
   left: 0;
-  width: 800px;
-  max-height: 600px;
   min-height: 12em;
   margin: auto;
   overflow: hidden;
 }
 
-.oo-ui-dialog .oo-ui-window-frame-small {
-  max-width: 600px;
+.oo-ui-dialog-small .oo-ui-window-frame {
+  width: 400px;
+  max-height: 200px;
+}
+
+.oo-ui-dialog-medium .oo-ui-window-frame {
+  width: 600px;
   max-height: 400px;
 }
 
+.oo-ui-dialog-large .oo-ui-window-frame {
+  width: 800px;
+  max-height: 600px;
+}
+
 .oo-ui-dialog .oo-ui-frame {
   width: 100%;
   height: 100%;