jenkins-bot has submitted this change and it was merged. Change subject: Update OOjs UI to v0.1.0-pre (49cf241725) ......................................................................
Update OOjs UI to v0.1.0-pre (49cf241725) Change-Id: I0a1faef11a1e7e6ea3e44275c85f2efafae4dc9a --- M lib/oojs-ui/images/icons/add-item.png M lib/oojs-ui/images/icons/add-item.svg M lib/oojs-ui/images/icons/check.png M lib/oojs-ui/images/icons/check.svg M lib/oojs-ui/images/icons/remove-item.png M lib/oojs-ui/images/icons/remove-item.svg R lib/oojs-ui/images/indicators/down.png R lib/oojs-ui/images/indicators/down.svg R lib/oojs-ui/images/indicators/up.png R lib/oojs-ui/images/indicators/up.svg M lib/oojs-ui/oojs-ui.js M lib/oojs-ui/oojs-ui.svg.css 12 files changed, 137 insertions(+), 52 deletions(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/oojs-ui/images/icons/add-item.png b/lib/oojs-ui/images/icons/add-item.png index e7bbbd6..aa36cd0 100644 --- a/lib/oojs-ui/images/icons/add-item.png +++ b/lib/oojs-ui/images/icons/add-item.png Binary files differ diff --git a/lib/oojs-ui/images/icons/add-item.svg b/lib/oojs-ui/images/icons/add-item.svg index b623910..ff95399 100644 --- a/lib/oojs-ui/images/icons/add-item.svg +++ b/lib/oojs-ui/images/icons/add-item.svg @@ -1,8 +1,8 @@ -<?xml version="1.0" encoding="iso-8859-1"?> +<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="12px" - height="12px" viewBox="0 0 12 12" style="enable-background:new 0 0 12 12;" xml:space="preserve"> -<g id="add-item" style="opacity:0.75;"> - <polygon id="plus" style="fill-rule:evenodd;clip-rule:evenodd;" points="7,2 5,2 5,5 2,5 2,7 5,7 5,10 7,10 7,7 10,7 10,5 7,5"/> -</g> +<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="24" height="24" viewBox="0, 0, 24, 24"> + <g id="add-item"> + <path d="M13,8 L11,8 L11,11 L8,11 L8,13 L11,13 L11,16 L13,16 L13,13 L16,13 L16,11 L13,11 z" fill="#000000"/> + </g> + <defs/> </svg> diff --git a/lib/oojs-ui/images/icons/check.png b/lib/oojs-ui/images/icons/check.png index cd90080..82c3cb4 100644 --- a/lib/oojs-ui/images/icons/check.png +++ b/lib/oojs-ui/images/icons/check.png Binary files differ diff --git a/lib/oojs-ui/images/icons/check.svg b/lib/oojs-ui/images/icons/check.svg index bec30a3..e67cd6c 100644 --- a/lib/oojs-ui/images/icons/check.svg +++ b/lib/oojs-ui/images/icons/check.svg @@ -1,8 +1,8 @@ -<?xml version="1.0" encoding="iso-8859-1"?> +<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="12px" - height="12px" viewBox="0 0 12 12" style="enable-background:new 0 0 12 12;" xml:space="preserve"> -<g id="check" style="opacity:0.75;"> - <polygon id="check_mark" points="1.105,7.473 2.527,6.05 4.428,7.952 9.238,1 10.895,2.148 4.635,11"/> -</g> +<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="24" height="24" viewBox="0, 0, 24, 24"> + <g id="check"> + <path d="M7.105,13.473 L8.527,12.05 L10.428,13.952 L15.238,7 L16.895,8.148 L10.635,17 z" fill="#000000"/> + </g> + <defs/> </svg> diff --git a/lib/oojs-ui/images/icons/remove-item.png b/lib/oojs-ui/images/icons/remove-item.png index f62dfe6..2f11db3 100644 --- a/lib/oojs-ui/images/icons/remove-item.png +++ b/lib/oojs-ui/images/icons/remove-item.png Binary files differ diff --git a/lib/oojs-ui/images/icons/remove-item.svg b/lib/oojs-ui/images/icons/remove-item.svg index ca657a5..b95e7d3 100644 --- a/lib/oojs-ui/images/icons/remove-item.svg +++ b/lib/oojs-ui/images/icons/remove-item.svg @@ -1,8 +1,8 @@ -<?xml version="1.0" encoding="iso-8859-1"?> +<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="12px" - height="12px" viewBox="0 0 12 12" style="enable-background:new 0 0 12 12;" xml:space="preserve"> -<g id="remove-item" style="opacity:0.75;"> - <rect id="minus" x="2" y="5" style="fill-rule:evenodd;clip-rule:evenodd;" width="8" height="2"/> -</g> +<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="24" height="24" viewBox="0, 0, 24, 24"> + <g id="remove-item"> + <path d="M8,11 L16,11 L16,13 L8,13 z" fill="#000000"/> + </g> + <defs/> </svg> diff --git a/lib/oojs-ui/images/icons/down.png b/lib/oojs-ui/images/indicators/down.png similarity index 100% rename from lib/oojs-ui/images/icons/down.png rename to lib/oojs-ui/images/indicators/down.png Binary files differ diff --git a/lib/oojs-ui/images/icons/down.svg b/lib/oojs-ui/images/indicators/down.svg similarity index 100% rename from lib/oojs-ui/images/icons/down.svg rename to lib/oojs-ui/images/indicators/down.svg diff --git a/lib/oojs-ui/images/icons/up.png b/lib/oojs-ui/images/indicators/up.png similarity index 100% rename from lib/oojs-ui/images/icons/up.png rename to lib/oojs-ui/images/indicators/up.png Binary files differ diff --git a/lib/oojs-ui/images/icons/up.svg b/lib/oojs-ui/images/indicators/up.svg similarity index 100% rename from lib/oojs-ui/images/icons/up.svg rename to lib/oojs-ui/images/indicators/up.svg diff --git a/lib/oojs-ui/oojs-ui.js b/lib/oojs-ui/oojs-ui.js index c88bce4..4070a66 100644 --- a/lib/oojs-ui/oojs-ui.js +++ b/lib/oojs-ui/oojs-ui.js @@ -1,12 +1,12 @@ /*! - * OOjs UI v0.1.0-pre (04754daaa9) + * OOjs UI v0.1.0-pre (49cf241725) * https://www.mediawiki.org/wiki/OOjs_UI * - * Copyright 2011-2013 OOjs Team and other contributors. + * Copyright 2011–2014 OOjs Team and other contributors. * Released under the MIT license * http://oojs.mit-license.org * - * Date: Thu Dec 19 2013 20:18:08 GMT+0100 (CET) + * Date: Mon Jan 13 2014 18:25:05 GMT-0800 (PST) */ ( function () { @@ -2038,6 +2038,57 @@ this.icon = icon; } } + this.$element.toggleClass( 'oo-ui-iconedElement', !!this.icon ); + + return this; +}; +/** + * Element containing an indicator. + * + * @class + * @abstract + * + * @constructor + * @param {jQuery} $indicator Indicator node, assigned to #$indicator + * @param {Object} [config] Configuration options + * @cfg {string} [indicator=''] Symbolic indicator name + */ +OO.ui.IndicatedElement = function OoUiIndicatedElement( $indicator, config ) { + // Config intialization + config = config || {}; + + // Properties + this.$indicator = $indicator; + this.indicator = null; + + // Initialization + this.$indicator.addClass( 'oo-ui-indicatedElement-indicator' ); + this.setIndicator( config.indicator ); +}; + +/* Methods */ + +/** + * Set the indicator. + * + * @method + * @param {string} [value] Symbolic name of indicator to use + * @chainable + */ +OO.ui.IndicatedElement.prototype.setIndicator = function ( value ) { + if ( this.indicator ) { + this.$indicator.removeClass( 'oo-ui-indicator-' + this.indicator ); + this.indicator = null; + } + if ( typeof value === 'string' ) { + value = value.trim(); + if ( value.length ) { + this.$indicator.addClass( 'oo-ui-indicator-' + value ); + this.indicator = value; + } + } + this.$element.toggleClass( 'oo-ui-indicatedElement', !!this.indicator ); + return this; }; /** @@ -3856,6 +3907,7 @@ * @abstract * @extends OO.ui.ToolGroup * @mixins OO.ui.IconedElement + * @mixins OO.ui.IndicatedElement * @mixins OO.ui.LabeledElement * @mixins OO.ui.ClippableElement * @@ -3865,7 +3917,7 @@ */ OO.ui.PopupToolGroup = function OoUiPopupToolGroup( toolbar, config ) { // Configuration initialization - config = $.extend( { 'icon': 'down' }, config ); + config = config || {}; // Parent constructor OO.ui.ToolGroup.call( this, toolbar, config ); @@ -3873,6 +3925,7 @@ // Mixin constructors OO.ui.IconedElement.call( this, this.$( '<span>' ), config ); OO.ui.LabeledElement.call( this, this.$( '<span>' ) ); + OO.ui.IndicatedElement.call( this, this.$( '<span>' ), config ); OO.ui.ClippableElement.call( this, this.$group ); // Properties @@ -3890,7 +3943,7 @@ // Initialization this.$handle .addClass( 'oo-ui-popupToolGroup-handle' ) - .append( this.$label, this.$icon ); + .append( this.$icon, this.$label, this.$indicator ); this.$element .addClass( 'oo-ui-popupToolGroup' ) .prepend( this.$handle ); @@ -3902,6 +3955,7 @@ OO.inheritClass( OO.ui.PopupToolGroup, OO.ui.ToolGroup ); OO.mixinClass( OO.ui.PopupToolGroup, OO.ui.IconedElement ); +OO.mixinClass( OO.ui.PopupToolGroup, OO.ui.IndicatedElement ); OO.mixinClass( OO.ui.PopupToolGroup, OO.ui.LabeledElement ); OO.mixinClass( OO.ui.PopupToolGroup, OO.ui.ClippableElement ); @@ -4022,6 +4076,9 @@ * @param {Object} [config] Configuration options */ OO.ui.MenuToolGroup = function OoUiMenuToolGroup( toolbar, config ) { + // Configuration initialization + config = config || {}; + // Parent constructor OO.ui.PopupToolGroup.call( this, toolbar, config ); diff --git a/lib/oojs-ui/oojs-ui.svg.css b/lib/oojs-ui/oojs-ui.svg.css index 6cef14b..e38231b 100644 --- a/lib/oojs-ui/oojs-ui.svg.css +++ b/lib/oojs-ui/oojs-ui.svg.css @@ -1,12 +1,12 @@ /*! - * OOjs UI v0.1.0-pre-svg (04754daaa9) + * OOjs UI v0.1.0-pre-svg (49cf241725) * https://www.mediawiki.org/wiki/OOjs_UI * - * Copyright 2011-2013 OOjs Team and other contributors. + * Copyright 2011–2014 OOjs Team and other contributors. * Released under the MIT license * http://oojs.mit-license.org * - * Date: Thu Dec 19 2013 20:18:08 GMT+0100 (CET) + * Date: Mon Jan 13 2014 18:25:05 GMT-0800 (PST) */ /*csslint vendor-prefix:false */ @@ -518,7 +518,11 @@ .oo-ui-popupToolGroup { position: relative; height: 2em; - min-width: 2em; + min-width: 2.5em; +} + +.oo-ui-popupToolGroup.oo-ui-indicatedElement.oo-ui-iconedElement { + min-width: 3.5em; } .oo-ui-popupToolGroup-handle { @@ -526,21 +530,37 @@ cursor: pointer; } +.oo-ui-popupToolGroup-handle .oo-ui-indicatedElement-indicator, .oo-ui-popupToolGroup-handle .oo-ui-iconedElement-icon { position: absolute; top: 0; - right: 0; - height: 2em; width: 2em; + height: 2em; background-position: center center; background-repeat: no-repeat; opacity: 0.8; } +.oo-ui-popupToolGroup-handle .oo-ui-indicatedElement-indicator { + right: 0; +} + +.oo-ui-popupToolGroup-handle .oo-ui-iconedElement-icon { + left: 0.25em; +} + .oo-ui-popupToolGroup-handle .oo-ui-labeledElement-label { line-height: 2.6em; font-size: 0.8em; - margin: 0 2.25em 0 1em; + margin: 0 1em; +} + +.oo-ui-popupToolGroup.oo-ui-iconedElement .oo-ui-popupToolGroup-handle .oo-ui-labeledElement-label { + margin-left: 3.25em; +} + +.oo-ui-popupToolGroup.oo-ui-indicatedElement .oo-ui-popupToolGroup-handle .oo-ui-labeledElement-label { + margin-right: 2.25em; } .oo-ui-popupToolGroup-handle .oo-ui-labeledElement-empty { @@ -594,7 +614,7 @@ /* OO.ui.ListToolGroup */ .oo-ui-listToolGroup .oo-ui-toolGroup-tools { - padding: 0.5em; + padding: 0.25em; } .oo-ui-listToolGroup .oo-ui-tool { @@ -604,7 +624,7 @@ -moz-box-sizing: border-box; box-sizing: border-box; border: solid 1px transparent; - margin: -1px 0 -1px -1px; + margin: -1px 0; } .oo-ui-listToolGroup .oo-ui-tool-link { @@ -1529,6 +1549,8 @@ top: 0; left: 0; } +/* Icons */ + .oo-ui-icon-add-item { /* @embed */ background-image: url(images/icons/add-item.png); @@ -1567,11 +1589,6 @@ .oo-ui-icon-comment { /* @embed */ background-image: url(images/icons/comment.png); -} - -.oo-ui-icon-down { - /* @embed */ - background-image: url(images/icons/down.png); } .oo-ui-icon-expand { @@ -1639,15 +1656,24 @@ background-image: url(images/icons/arched-arrow-rtl.png); } -.oo-ui-icon-up { - /* @embed */ - background-image: url(images/icons/up.png); -} - .oo-ui-icon-window { /* @embed */ background-image: url(images/icons/window.png); } + +/* Indicators */ + +.oo-ui-indicator-down { + /* @embed */ + background-image: url(images/indicators/down.png); +} + +.oo-ui-indicator-up { + /* @embed */ + background-image: url(images/indicators/up.png); +} +/* Icons */ + .oo-ui-icon-add-item { /* @embed */ background-image: url(images/icons/add-item.svg); @@ -1686,11 +1712,6 @@ .oo-ui-icon-comment { /* @embed */ background-image: url(images/icons/comment.svg); -} - -.oo-ui-icon-down { - /* @embed */ - background-image: url(images/icons/down.svg); } .oo-ui-icon-expand { @@ -1758,12 +1779,19 @@ background-image: url(images/icons/arched-arrow-rtl.svg); } -.oo-ui-icon-up { - /* @embed */ - background-image: url(images/icons/up.svg); -} - .oo-ui-icon-window { /* @embed */ background-image: url(images/icons/window.svg); } + +/* Indicators */ + +.oo-ui-indicator-down { + /* @embed */ + background-image: url(images/indicators/down.svg); +} + +.oo-ui-indicator-up { + /* @embed */ + background-image: url(images/indicators/up.svg); +} -- To view, visit https://gerrit.wikimedia.org/r/107262 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0a1faef11a1e7e6ea3e44275c85f2efafae4dc9a Gerrit-PatchSet: 3 Gerrit-Project: VisualEditor/VisualEditor Gerrit-Branch: master Gerrit-Owner: Trevor Parscal <[email protected]> Gerrit-Reviewer: Catrope <[email protected]> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
