r104641 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104640‎ | r104641 | r104642 >
Date:01:23, 30 November 2011
Author:tparscal
Status:deferred
Tags:
Comment:
* Using DOM for more of the icon style
* Fixed double-selection rendering issue
Modified paths:
  • /trunk/extensions/VisualEditor/modules/es/es.Surface.css (modified) (history)
  • /trunk/extensions/VisualEditor/modules/es/images/arrow-down.png (added) (history)
  • /trunk/extensions/VisualEditor/modules/es/images/arrow-up.png (added) (history)
  • /trunk/extensions/VisualEditor/modules/es/images/arrow.psd (added) (history)
  • /trunk/extensions/VisualEditor/modules/es/images/context-icon-down-hover.png (deleted) (history)
  • /trunk/extensions/VisualEditor/modules/es/images/context-icon-down.png (deleted) (history)
  • /trunk/extensions/VisualEditor/modules/es/images/context-icon-up-hover.png (deleted) (history)
  • /trunk/extensions/VisualEditor/modules/es/images/context-icon-up.png (deleted) (history)
  • /trunk/extensions/VisualEditor/modules/es/images/context-icon.psd (deleted) (history)
  • /trunk/extensions/VisualEditor/modules/es/views/es.ContentView.js (modified) (history)
  • /trunk/extensions/VisualEditor/modules/es/views/es.ContextView.js (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/modules/es/es.Surface.css
@@ -42,32 +42,45 @@
4343
4444 .es-contextView-icon {
4545 position: absolute;
46 - background-position: top left;
4746 background-repeat: no-repeat;
48 - width: 31px;
49 - height: 31px;
 47+ width: 15px;
 48+ height: 15px;
5049 display: none;
5150 cursor: pointer;
 51+ border: solid 1px #cccccc;
 52+ -webkit-border-radius: 1em;
 53+ -moz-border-radius: 1em;
 54+ -o-border-radius: 1em;
 55+ border-radius: 1em;
 56+ background-color: white;
 57+ -webkit-box-shadow: 0 0.25em 1em 0 rgba(0,0,0,0.25);
 58+ -moz-box-shadow: 0 0.25em 1em 0 rgba(0,0,0,0.25);
 59+ box-shadow: 0 0.25em 1em 0 rgba(0,0,0,0.25);
5260 }
5361
 62+.es-contextView-position-start .es-contextView-icon {
 63+ top: -12px;
 64+ left: -8px;
 65+}
 66+
 67+.es-contextView-position-end .es-contextView-icon {
 68+ top: -6px;
 69+ left: -8px;
 70+}
 71+
5472 .es-contextView-position-above .es-contextView-icon {
55 - background-image: url(images/context-icon-up.png);
56 - top: -24px;
57 - left: -15px;
 73+ background-image: url(images/arrow-up.png);
 74+ background-position: 4px 4px;
5875 }
5976
6077 .es-contextView-position-below .es-contextView-icon {
61 - background-image: url(images/context-icon-down.png);
62 - top: -7px;
63 - left: -16px;
 78+ background-image: url(images/arrow-down.png);
 79+ background-position: 4px 5px;
6480 }
6581
66 -.es-contextView-position-above .es-contextView-icon:hover {
67 - background-image: url(images/context-icon-up-hover.png);
68 -}
69 -
 82+.es-contextView-position-above .es-contextView-icon:hover,
7083 .es-contextView-position-below .es-contextView-icon:hover {
71 - background-image: url(images/context-icon-down-hover.png);
 84+ border-color: #b3d6f6;
7285 }
7386
7487 .es-contextView-menu {
@@ -118,10 +131,10 @@
119132 height: 1em;
120133 padding: 0.25em;
121134 border: solid 1px white;
122 - -webkit-border-radius: 0.25em;
123 - -moz-border-radius: 0.25em;
124 - -o-border-radius: 0.25em;
125 - border-radius: 0.25em;
 135+ -webkit-border-radius: 0.125em;
 136+ -moz-border-radius: 0.125em;
 137+ -o-border-radius: 0.125em;
 138+ border-radius: 0.125em;
126139 background-position: center center;
127140 background-position: no-repeat;
128141 cursor: pointer;
Index: trunk/extensions/VisualEditor/modules/es/images/context-icon-up.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: trunk/extensions/VisualEditor/modules/es/images/context-icon-down-hover.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: trunk/extensions/VisualEditor/modules/es/images/context-icon.psd
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: trunk/extensions/VisualEditor/modules/es/images/context-icon-up-hover.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: trunk/extensions/VisualEditor/modules/es/images/context-icon-down.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: trunk/extensions/VisualEditor/modules/es/images/arrow.psd
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/extensions/VisualEditor/modules/es/images/arrow.psd
___________________________________________________________________
Added: svn:mime-type
129142 + application/octet-stream
Index: trunk/extensions/VisualEditor/modules/es/images/arrow-down.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/extensions/VisualEditor/modules/es/images/arrow-down.png
___________________________________________________________________
Added: svn:mime-type
130143 + application/octet-stream
Index: trunk/extensions/VisualEditor/modules/es/images/arrow-up.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/extensions/VisualEditor/modules/es/images/arrow-up.png
___________________________________________________________________
Added: svn:mime-type
131144 + application/octet-stream
Index: trunk/extensions/VisualEditor/modules/es/views/es.ContextView.js
@@ -37,12 +37,12 @@
3838 es.ContextView.prototype.set = function() {
3939 this.$.removeClass(
4040 'es-contextView-position-below es-contextView-position-above ' +
41 - 'es-contextView-position-left es-contextView-position-right'
 41+ 'es-contextView-position-left es-contextView-position-right' +
 42+ 'es-contextView-position-start es-contextView-position-end'
4243 );
4344 var selection = this.surfaceView.getModel().getSelection(),
4445 position,
45 - offset,
46 - bias;
 46+ offset;
4747 if ( selection.from < selection.to ) {
4848 var $lastRange = this.surfaceView.$.find( '.es-contentView-range:visible:last' );
4949 if ( $lastRange.length ) {
@@ -50,14 +50,14 @@
5151 position = new es.Position(
5252 offset.left + $lastRange.width(), offset.top + $lastRange.height()
5353 );
54 - this.$.addClass( 'es-contextView-position-below' );
 54+ this.$.addClass( 'es-contextView-position-end' );
5555 }
5656 } else if ( selection.from > selection.to ) {
5757 var $firstRange = this.surfaceView.$.find( '.es-contentView-range:visible:first' );
5858 if ( $firstRange.length ) {
5959 offset = $firstRange.offset();
6060 position = new es.Position( offset.left, offset.top );
61 - this.$.addClass( 'es-contextView-position-above' );
 61+ this.$.addClass( 'es-contextView-position-start' );
6262 }
6363 }
6464 if ( position ) {
@@ -66,6 +66,11 @@
6767 } else {
6868 this.$.addClass( 'es-contextView-position-right' );
6969 }
 70+ if ( position.top + this.$menu.height() < $( window ).height() ) {
 71+ this.$.addClass( 'es-contextView-position-below' );
 72+ } else {
 73+ this.$.addClass( 'es-contextView-position-above' );
 74+ }
7075 this.$.css( { 'left': position.left, 'top': position.top } );
7176 this.$icon.fadeIn( 'fast' );
7277 }
Index: trunk/extensions/VisualEditor/modules/es/views/es.ContentView.js
@@ -253,6 +253,8 @@
254254 'width': toPosition.left,
255255 'height': toPosition.bottom - toPosition.top
256256 } ).show();
 257+ } else {
 258+ this.$rangeEnd.hide();
257259 }
258260 if ( fromLineIndex + 1 < toLineIndex ) {
259261 this.$rangeFill.css( {

Status & tagging log