r63192 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63191‎ | r63192 | r63193 >
Date:00:43, 3 March 2010
Author:nimishg
Status:deferred
Tags:
Comment:
using spans with images so everything clicks right
Modified paths:
  • /trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.html (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.templateEditor.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.templateEditor.js
@@ -161,16 +161,12 @@
162162 .prependTo( $template );
163163
164164 var $templateExpand = $( '<span />' )
165 - .addClass( 'wikiEditor-template-expand wikiEditor-noinclude' )
166 - .append( '<img src="' + $.wikiEditor.autoIcon( 'templateEditor/expand.png' ) + '" width="12" height="16" />' )
167 - .append( '<img src="' + $.wikiEditor.autoIcon( 'templateEditor/collapse.png' ) + '" width="12" height="16" style="display:none;" />' )
 165+ .addClass( 'wikiEditor-template-expand wikiEditor-noinclude wikiEditor-template-expand-collapsed' )
168166 .mousedown( toggleWikiTextEditor )
169167 .prependTo( $template );
170168
171169 var $templateDialog = $( '<span />' )
172 - .addClass( 'wikiEditor-template-dialog wikiEditor-noinclude' )
173 - .append( '<img src="' + $.wikiEditor.autoIcon( 'templateEditor/dialog-collapsed.png' ) + '" width="22" height="16" />' )
174 - .append( '<img src="' + $.wikiEditor.autoIcon( 'templateEditor/dialog-expanded.png' ) + '" width="22" height="16" style="display:none;" />' )
 170+ .addClass( 'wikiEditor-template-dialog wikiEditor-noinclude wikiEditor-template-dialog-collapsed' )
175171 .mousedown( function() { createDialog( $template ); return false; } )
176172 .insertAfter( $templateName );
177173
@@ -179,12 +175,18 @@
180176 var $template = $( this ).closest( '.wikiEditor-template' );
181177 $template
182178 .toggleClass( 'wikiEditor-template-expanded' )
183 - .toggleClass( 'wikiEditor-template-collapsed' )
184 - .find( 'img' )
185 - .each( function() {
186 - $( this ).toggle();
187 - } );
 179+ .toggleClass( 'wikiEditor-template-collapsed' );
 180+ var $templateExpand = $template.find('.wikiEditor-template-expand');
 181+ var $templateDialog = $template.find('.wikiEditor-template-dialog');
188182 var $wikitext = $template.children( '.wikiEditor-template-text' );
 183+
 184+ $templateExpand
 185+ .toggleClass('wikiEditor-template-expand-collapsed')
 186+ .toggleClass('wikiEditor-template-expand-expanded');
 187+ $templateDialog
 188+ .toggleClass('wikiEditor-template-dialog-collapsed')
 189+ .toggleClass('wikiEditor-template-dialog-expanded');
 190+
189191 $wikitext.toggleClass( 'wikiEditor-nodisplay' );
190192
191193 //if we just collapsed this
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.html
@@ -60,7 +60,32 @@
6161 text-decoration:none;
6262 border:1px solid #d9d9d9;
6363 border-right: none;
 64+ cursor: pointer;
6465 }
 66+ .wikiEditor-template-expand{
 67+ cursor: pointer;
 68+ padding-left: 6px;
 69+ padding-right: 6px;
 70+ background-position: 50%; /*FF3*/
 71+ }
 72+ .wikiEditor-template-dialog{
 73+ cursor: pointer;
 74+ padding-left: 11px;
 75+ padding-right: 11px;
 76+ background-position: 50%; /*FF3*/
 77+ }
 78+ .wikiEditor-template-expand-collapsed{
 79+ background-image: url(../../images/wikiEditor/templateEditor/expand.png);
 80+ }
 81+ .wikiEditor-template-expand-expanded{
 82+ background-image: url(../../images/wikiEditor/templateEditor/collapse.png);
 83+ }
 84+ .wikiEditor-template-dialog-expanded{
 85+ background-image: url(../../images/wikiEditor/templateEditor/dialog-expanded.png);
 86+ }
 87+ .wikiEditor-template-dialog-collapsed{
 88+ background-image: url(../../images/wikiEditor/templateEditor/dialog-collapsed.png);
 89+ }
6590 .wikiEditor-template-expanded img,
6691 .wikiEditor-template-collapsed img {
6792 vertical-align: top;

Follow-up revisions

RevisionCommit summaryAuthorDate
r63208UsabilityInitiative: Redo r63192 in a saner way, using descendant selectors i...catrope15:30, 3 March 2010

Status & tagging log