Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toolbar.js |
— | — | @@ -568,24 +568,24 @@ |
569 | 569 | // placeholder for drag control creation code |
570 | 570 | /* |
571 | 571 | $dragControl = $( '<div />' ).addClass( 'tab' ).attr( 'id', 'wikiEditor-ui-toc-resize-grip' ) |
572 | | - .append( '<a href="#" title="Drag to resize"></a>' ) |
573 | | - .bind( 'mousedown', function() { |
574 | | - $( '#wikiEditor-ui-toc' ) |
575 | | - .data( 'openWidth', $( '#wikiEditor-ui-toc' ).width() ); |
576 | | - $() |
577 | | - .bind( 'mousemove', context, $.wikiEditor.modules.toc.fn.drag ) |
578 | | - .bind( 'mouseup', context, $.wikiEditor.modules.toc.fn.stopDrag ); |
579 | | - $(context.$iframe[0].contentWindow.document) |
580 | | - .bind( 'mousemove', function() { |
581 | | - parent.top.$j().trigger("mousemove", e.pageX); |
| 572 | + .append( '<a href="#" title="Drag to resize"></a>' ) |
| 573 | + .mousedown( function() { |
| 574 | + context.modules.$toc |
| 575 | + .data( 'openWidth', $( '#wikiEditor-ui-toc' ).width() ); |
| 576 | + $() |
| 577 | + .bind( 'mousemove', context, $.wikiEditor.modules.toc.fn.drag ) |
| 578 | + .bind( 'mouseup', context, $.wikiEditor.modules.toc.fn.stopDrag ); |
| 579 | + $( context.$iframe[0].contentWindow.document ) |
| 580 | + .mousemove( function() { |
| 581 | + parent.top.$j().trigger( 'mousemove', e.pageX ); |
| 582 | + return false; |
| 583 | + } ) |
| 584 | + .mouseup( function() { |
| 585 | + parent.top.$j().trigger( 'mouseup' ); |
| 586 | + return false; |
| 587 | + }); |
582 | 588 | return false; |
583 | | - } ) |
584 | | - .bind( 'mouseup', function() { |
585 | | - parent.top.$j().trigger("mouseup"); |
586 | | - return false; |
587 | | - }); |
588 | | - return false; |
589 | | - }) |
| 589 | + }) |
590 | 590 | context.modules.$toolbar.append( $dragControl ); |
591 | 591 | */ |
592 | 592 | } |
— | — | @@ -610,8 +610,7 @@ |
611 | 611 | $.eachAsync( sectionQueue, { |
612 | 612 | 'bulk' : 0, |
613 | 613 | 'end' : function() { |
614 | | - // HACK: Opera doesn't seem to want to redraw after |
615 | | - // these bits |
| 614 | + // HACK: Opera doesn't seem to want to redraw after these bits |
616 | 615 | // are added to the DOM, so we can just FORCE it! |
617 | 616 | $( 'body' ).css( 'position', 'static' ); |
618 | 617 | $( 'body' ).css( 'position', 'relative' ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toc.js |
— | — | @@ -56,6 +56,7 @@ |
57 | 57 | // Add the TOC to the document |
58 | 58 | $.wikiEditor.modules.toc.fn.build( context, config ); |
59 | 59 | context.$textarea |
| 60 | + // FIXME: magic iframe integration |
60 | 61 | .delayedBind( 250, 'mouseup scrollToPosition focus keyup encapsulateSelection change', |
61 | 62 | function( event ) { |
62 | 63 | var context = $(this).data( 'wikiEditor-context' ); |
— | — | @@ -130,16 +131,16 @@ |
131 | 132 | $toc.data( 'openWidth', $toc.width() ); |
132 | 133 | } |
133 | 134 | context.$ui.find( '.tab-toc' ) |
134 | | - .unbind( 'click', $.wikiEditor.modules.toc.fn.collapse ) |
135 | | - .bind( 'click', context, $.wikiEditor.modules.toc.fn.expand ) |
136 | | - .children( 'a' ) |
137 | | - .text( gM( 'wikieditor-toc-show' ) ); |
| 135 | + .unbind( 'click', $.wikiEditor.modules.toc.fn.collapse ) |
| 136 | + .bind( 'click', context, $.wikiEditor.modules.toc.fn.expand ) |
| 137 | + .children( 'a' ) |
| 138 | + .text( gM( 'wikieditor-toc-show' ) ); |
138 | 139 | |
139 | 140 | $toc |
140 | | - //.animate( { 'width': '1px' }, 'fast', function() { $(this).hide(); } ) |
141 | | - .animate( { 'width': 1 }, 'fast' ); |
142 | | - //.prev() |
143 | | - //.animate( {'marginRight': '1px'}, 'fast', function() { $(this).css('marginRight', '-1px'); } ); |
| 141 | + //.animate( { 'width': '1px' }, 'fast', function() { $(this).hide(); } ) |
| 142 | + .animate( { 'width': 1 }, 'fast' ); |
| 143 | + //.prev() |
| 144 | + //.animate( {'marginRight': '1px'}, 'fast', function() { $(this).css('marginRight', '-1px'); } ); |
144 | 145 | $.cookie( 'wikiEditor-' + context.instance + '-toc-width', 1 ); |
145 | 146 | return false; |
146 | 147 | }, |
— | — | @@ -152,18 +153,18 @@ |
153 | 154 | expand: function( event) { |
154 | 155 | var context = event.data; |
155 | 156 | context.$ui.find( '.tab-toc' ) |
156 | | - .unbind( 'click', $.wikiEditor.modules.toc.fn.expand ) |
157 | | - .bind( 'click', context, $.wikiEditor.modules.toc.fn.collapse ) |
158 | | - .children( 'a' ) |
159 | | - .text( gM( 'wikieditor-toc-hide' ) ); |
| 157 | + .unbind( 'click', $.wikiEditor.modules.toc.fn.expand ) |
| 158 | + .bind( 'click', context, $.wikiEditor.modules.toc.fn.collapse ) |
| 159 | + .children( 'a' ) |
| 160 | + .text( gM( 'wikieditor-toc-hide' ) ); |
160 | 161 | context.modules.$toc |
161 | | - .show() |
162 | | - .animate( { 'width': context.modules.$toc.data( 'openWidth' ) }, 'fast' ); |
163 | | - //.animate( { 'width': context.modules.$toc.data( 'openWidth' )}, 'fast', function() { |
164 | | - // $( '#wikiEditor-ui-text textarea' ).trigger( 'mouseup' ); |
165 | | - //} ) |
166 | | - //.prev() |
167 | | - //.animate( { 'marginRight': context.modules.$toc.data( 'openWidth' ) }, 'fast' ); |
| 162 | + .show() |
| 163 | + .animate( { 'width': context.modules.$toc.data( 'openWidth' ) }, 'fast' ); |
| 164 | + //.animate( { 'width': context.modules.$toc.data( 'openWidth' )}, 'fast', function() { |
| 165 | + // $( '#wikiEditor-ui-text textarea' ).trigger( 'mouseup' ); |
| 166 | + //} ) |
| 167 | + //.prev() |
| 168 | + //.animate( { 'marginRight': context.modules.$toc.data( 'openWidth' ) }, 'fast' ); |
168 | 169 | $.cookie( 'wikiEditor-' + context.instance + '-toc-width', context.modules.$toc.data( 'openWidth' ) ); |
169 | 170 | return false; |
170 | 171 | }, |
— | — | @@ -187,7 +188,7 @@ |
188 | 189 | if( mR < 26 || mR > context.$ui.find( '.wikiEditor-ui-left' ).width() - 250) |
189 | 190 | return false; |
190 | 191 | context.$ui.find( '.wikiEditor-ui-left' ).css( 'marginRight', -mR ) |
191 | | - .children().css('marginRight', mR); |
| 192 | + .children().css( 'marginRight', mR ); |
192 | 193 | context.$ui.find( '.wikiEditor-ui-right' ).css( 'width', mR ); |
193 | 194 | return false; |
194 | 195 | }, |
— | — | @@ -201,7 +202,7 @@ |
202 | 203 | $() |
203 | 204 | .unbind( 'mousemove', $.wikiEditor.modules.toc.fn.drag ) |
204 | 205 | .unbind( 'mouseup', $.wikiEditor.modules.toc.fn.stopDrag ); |
205 | | - $(context.$iframe[0].contentWindow.document) |
| 206 | + $( context.$iframe[0].contentWindow.document ) |
206 | 207 | .unbind( 'mousemove' ) |
207 | 208 | .unbind( 'mouseup' ); |
208 | 209 | if( context.$ui.find( '.wikiEditor-ui-right' ).width() < 50 && wgNavigableTOCCollapseEnable ) { |
— | — | @@ -209,7 +210,7 @@ |
210 | 211 | } else { |
211 | 212 | context.$ui.find( '.wikiEditor-ui-left' ).trigger( 'mouseup' ); |
212 | 213 | context.$ui.find( '.wikiEditor-ui-right' ) |
213 | | - .data( 'openWidth', context.$ui.find( '.wikiEditor-ui-right' ).width() ); |
| 214 | + .data( 'openWidth', context.$ui.find( '.wikiEditor-ui-right' ).width() ); |
214 | 215 | $.cookie( 'wikiEditor-' + context.instance + '-toc-width', |
215 | 216 | context.$ui.find( '.wikiEditor-ui-right' ).width() ); |
216 | 217 | } |
— | — | @@ -280,12 +281,11 @@ |
281 | 282 | .addClass( 'wikiEditor-ui-toc-collapse-open' ) |
282 | 283 | .attr( 'id', 'wikiEditor-ui-toc-collapse' ) |
283 | 284 | .data( 'openWidth', $.wikiEditor.modules.toc.defaultWidth ) |
284 | | - .bind( 'mouseup', function() { |
| 285 | + .mouseup( function() { |
285 | 286 | var $e = $(this); |
286 | 287 | var close = $e.hasClass( 'wikiEditor-ui-toc-collapse-open' ); |
287 | 288 | if( close ) { |
288 | | - $e |
289 | | - .removeClass( 'wikiEditor-ui-toc-collapse-open' ); |
| 289 | + $e.removeClass( 'wikiEditor-ui-toc-collapse-open' ); |
290 | 290 | $e.parent() |
291 | 291 | .animate( { 'width': $e.outerWidth() }, 'fast', function() { |
292 | 292 | $(this).find( 'ul:first' ).hide(); |
— | — | @@ -296,15 +296,13 @@ |
297 | 297 | .addClass( 'wikiEditor-ui-toc-collapse-closed' ); |
298 | 298 | }); |
299 | 299 | } else { |
300 | | - $e |
301 | | - .removeClass( 'wikiEditor-ui-toc-collapse-closed' ); |
| 300 | + $e.removeClass( 'wikiEditor-ui-toc-collapse-closed' ); |
302 | 301 | $e.siblings().show() |
303 | 302 | .parent() |
304 | 303 | .animate( { 'width': $e.data( 'openWidth' ) }, 'fast' ) |
305 | 304 | .prev() |
306 | 305 | .animate( { 'marginRight': $e.data( 'openWidth' ) }, 'fast', function() { |
307 | | - $e |
308 | | - .addClass( 'wikiEditor-ui-toc-collapse-open' ); |
| 306 | + $e.addClass( 'wikiEditor-ui-toc-collapse-open' ); |
309 | 307 | }); |
310 | 308 | } |
311 | 309 | |
— | — | @@ -313,33 +311,33 @@ |
314 | 312 | } |
315 | 313 | function buildResizeControls() { |
316 | 314 | var $resizeControlVertical = $( '<div />' ) |
317 | | - .attr( 'id', 'wikiEditor-ui-toc-resize-vertical') |
318 | | - .bind( 'mousedown', function() { |
319 | | - context.modules.$toc |
320 | | - .data( 'openWidth', context.modules.$toc.width() ); |
321 | | - $() |
322 | | - .bind( 'mousemove', context, $.wikiEditor.modules.toc.fn.drag ) |
323 | | - .bind( 'mouseup', context, $.wikiEditor.modules.toc.fn.stopDrag ); |
324 | | - $(context.$iframe[0].contentWindow.document) |
325 | | - .bind( 'mousemove', function( e ) { |
326 | | - parent.top.$j().trigger("mousemove", e.pageX); |
327 | | - return false; |
328 | | - } ) |
329 | | - .bind( 'mouseup', function() { |
330 | | - parent.top.$j().trigger("mouseup"); |
| 315 | + .attr( 'id', 'wikiEditor-ui-toc-resize-vertical') |
| 316 | + .mousedown( function() { |
| 317 | + context.modules.$toc |
| 318 | + .data( 'openWidth', context.modules.$toc.width() ); |
| 319 | + $() |
| 320 | + .bind( 'mousemove', context, $.wikiEditor.modules.toc.fn.drag ) |
| 321 | + .bind( 'mouseup', context, $.wikiEditor.modules.toc.fn.stopDrag ); |
| 322 | + $( context.$iframe[0].contentWindow.document ) |
| 323 | + .mousemove( function( e ) { |
| 324 | + parent.top.$j().trigger( 'mousemove', e.pageX ); |
| 325 | + return false; |
| 326 | + } ) |
| 327 | + .bind( 'mouseup', function() { |
| 328 | + parent.top.$j().trigger( 'mouseup' ); |
| 329 | + return false; |
| 330 | + }); |
331 | 331 | return false; |
332 | 332 | }); |
333 | | - return false; |
334 | | - }); |
335 | 333 | |
336 | 334 | var $collapseControl = $( '<div />' ).addClass( 'tab' ).addClass( 'tab-toc' ) |
337 | 335 | .append( '<a href="#" />' ); |
338 | 336 | if( $.cookie( 'wikiEditor-' + context.instance + '-toc-width' ) != 1 ) { |
339 | 337 | $collapseControl.bind( 'click', context, $.wikiEditor.modules.toc.fn.collapse ) |
340 | | - .find( 'a' ).text( gM( 'wikieditor-toc-hide' ) ); |
| 338 | + .find( 'a' ).text( gM( 'wikieditor-toc-hide' ) ); |
341 | 339 | } else { |
342 | 340 | $collapseControl.bind( 'click', context, $.wikiEditor.modules.toc.fn.expand ) |
343 | | - .find( 'a' ).text( gM( 'wikieditor-toc-show' ) ); |
| 341 | + .find( 'a' ).text( gM( 'wikieditor-toc-show' ) ); |
344 | 342 | } |
345 | 343 | $collapseControl.insertBefore( context.modules.$toc ); |
346 | 344 | |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -2480,24 +2480,24 @@ |
2481 | 2481 | // placeholder for drag control creation code |
2482 | 2482 | /* |
2483 | 2483 | $dragControl = $( '<div />' ).addClass( 'tab' ).attr( 'id', 'wikiEditor-ui-toc-resize-grip' ) |
2484 | | - .append( '<a href="#" title="Drag to resize"></a>' ) |
2485 | | - .bind( 'mousedown', function() { |
2486 | | - $( '#wikiEditor-ui-toc' ) |
2487 | | - .data( 'openWidth', $( '#wikiEditor-ui-toc' ).width() ); |
2488 | | - $() |
2489 | | - .bind( 'mousemove', context, $.wikiEditor.modules.toc.fn.drag ) |
2490 | | - .bind( 'mouseup', context, $.wikiEditor.modules.toc.fn.stopDrag ); |
2491 | | - $(context.$iframe[0].contentWindow.document) |
2492 | | - .bind( 'mousemove', function() { |
2493 | | - parent.top.$j().trigger("mousemove", e.pageX); |
| 2484 | + .append( '<a href="#" title="Drag to resize"></a>' ) |
| 2485 | + .mousedown( function() { |
| 2486 | + context.modules.$toc |
| 2487 | + .data( 'openWidth', $( '#wikiEditor-ui-toc' ).width() ); |
| 2488 | + $() |
| 2489 | + .bind( 'mousemove', context, $.wikiEditor.modules.toc.fn.drag ) |
| 2490 | + .bind( 'mouseup', context, $.wikiEditor.modules.toc.fn.stopDrag ); |
| 2491 | + $( context.$iframe[0].contentWindow.document ) |
| 2492 | + .mousemove( function() { |
| 2493 | + parent.top.$j().trigger( 'mousemove', e.pageX ); |
| 2494 | + return false; |
| 2495 | + } ) |
| 2496 | + .mouseup( function() { |
| 2497 | + parent.top.$j().trigger( 'mouseup' ); |
| 2498 | + return false; |
| 2499 | + }); |
2494 | 2500 | return false; |
2495 | | - } ) |
2496 | | - .bind( 'mouseup', function() { |
2497 | | - parent.top.$j().trigger("mouseup"); |
2498 | | - return false; |
2499 | | - }); |
2500 | | - return false; |
2501 | | - }) |
| 2501 | + }) |
2502 | 2502 | context.modules.$toolbar.append( $dragControl ); |
2503 | 2503 | */ |
2504 | 2504 | } |
— | — | @@ -2522,8 +2522,7 @@ |
2523 | 2523 | $.eachAsync( sectionQueue, { |
2524 | 2524 | 'bulk' : 0, |
2525 | 2525 | 'end' : function() { |
2526 | | - // HACK: Opera doesn't seem to want to redraw after |
2527 | | - // these bits |
| 2526 | + // HACK: Opera doesn't seem to want to redraw after these bits |
2528 | 2527 | // are added to the DOM, so we can just FORCE it! |
2529 | 2528 | $( 'body' ).css( 'position', 'static' ); |
2530 | 2529 | $( 'body' ).css( 'position', 'relative' ); |
— | — | @@ -2598,6 +2597,7 @@ |
2599 | 2598 | // Add the TOC to the document |
2600 | 2599 | $.wikiEditor.modules.toc.fn.build( context, config ); |
2601 | 2600 | context.$textarea |
| 2601 | + // FIXME: magic iframe integration |
2602 | 2602 | .delayedBind( 250, 'mouseup scrollToPosition focus keyup encapsulateSelection change', |
2603 | 2603 | function( event ) { |
2604 | 2604 | var context = $(this).data( 'wikiEditor-context' ); |
— | — | @@ -2672,16 +2672,16 @@ |
2673 | 2673 | $toc.data( 'openWidth', $toc.width() ); |
2674 | 2674 | } |
2675 | 2675 | context.$ui.find( '.tab-toc' ) |
2676 | | - .unbind( 'click', $.wikiEditor.modules.toc.fn.collapse ) |
2677 | | - .bind( 'click', context, $.wikiEditor.modules.toc.fn.expand ) |
2678 | | - .children( 'a' ) |
2679 | | - .text( gM( 'wikieditor-toc-show' ) ); |
| 2676 | + .unbind( 'click', $.wikiEditor.modules.toc.fn.collapse ) |
| 2677 | + .bind( 'click', context, $.wikiEditor.modules.toc.fn.expand ) |
| 2678 | + .children( 'a' ) |
| 2679 | + .text( gM( 'wikieditor-toc-show' ) ); |
2680 | 2680 | |
2681 | 2681 | $toc |
2682 | | - //.animate( { 'width': '1px' }, 'fast', function() { $(this).hide(); } ) |
2683 | | - .animate( { 'width': 1 }, 'fast' ); |
2684 | | - //.prev() |
2685 | | - //.animate( {'marginRight': '1px'}, 'fast', function() { $(this).css('marginRight', '-1px'); } ); |
| 2682 | + //.animate( { 'width': '1px' }, 'fast', function() { $(this).hide(); } ) |
| 2683 | + .animate( { 'width': 1 }, 'fast' ); |
| 2684 | + //.prev() |
| 2685 | + //.animate( {'marginRight': '1px'}, 'fast', function() { $(this).css('marginRight', '-1px'); } ); |
2686 | 2686 | $.cookie( 'wikiEditor-' + context.instance + '-toc-width', 1 ); |
2687 | 2687 | return false; |
2688 | 2688 | }, |
— | — | @@ -2694,18 +2694,18 @@ |
2695 | 2695 | expand: function( event) { |
2696 | 2696 | var context = event.data; |
2697 | 2697 | context.$ui.find( '.tab-toc' ) |
2698 | | - .unbind( 'click', $.wikiEditor.modules.toc.fn.expand ) |
2699 | | - .bind( 'click', context, $.wikiEditor.modules.toc.fn.collapse ) |
2700 | | - .children( 'a' ) |
2701 | | - .text( gM( 'wikieditor-toc-hide' ) ); |
| 2698 | + .unbind( 'click', $.wikiEditor.modules.toc.fn.expand ) |
| 2699 | + .bind( 'click', context, $.wikiEditor.modules.toc.fn.collapse ) |
| 2700 | + .children( 'a' ) |
| 2701 | + .text( gM( 'wikieditor-toc-hide' ) ); |
2702 | 2702 | context.modules.$toc |
2703 | | - .show() |
2704 | | - .animate( { 'width': context.modules.$toc.data( 'openWidth' ) }, 'fast' ); |
2705 | | - //.animate( { 'width': context.modules.$toc.data( 'openWidth' )}, 'fast', function() { |
2706 | | - // $( '#wikiEditor-ui-text textarea' ).trigger( 'mouseup' ); |
2707 | | - //} ) |
2708 | | - //.prev() |
2709 | | - //.animate( { 'marginRight': context.modules.$toc.data( 'openWidth' ) }, 'fast' ); |
| 2703 | + .show() |
| 2704 | + .animate( { 'width': context.modules.$toc.data( 'openWidth' ) }, 'fast' ); |
| 2705 | + //.animate( { 'width': context.modules.$toc.data( 'openWidth' )}, 'fast', function() { |
| 2706 | + // $( '#wikiEditor-ui-text textarea' ).trigger( 'mouseup' ); |
| 2707 | + //} ) |
| 2708 | + //.prev() |
| 2709 | + //.animate( { 'marginRight': context.modules.$toc.data( 'openWidth' ) }, 'fast' ); |
2710 | 2710 | $.cookie( 'wikiEditor-' + context.instance + '-toc-width', context.modules.$toc.data( 'openWidth' ) ); |
2711 | 2711 | return false; |
2712 | 2712 | }, |
— | — | @@ -2729,7 +2729,7 @@ |
2730 | 2730 | if( mR < 26 || mR > context.$ui.find( '.wikiEditor-ui-left' ).width() - 250) |
2731 | 2731 | return false; |
2732 | 2732 | context.$ui.find( '.wikiEditor-ui-left' ).css( 'marginRight', -mR ) |
2733 | | - .children().css('marginRight', mR); |
| 2733 | + .children().css( 'marginRight', mR ); |
2734 | 2734 | context.$ui.find( '.wikiEditor-ui-right' ).css( 'width', mR ); |
2735 | 2735 | return false; |
2736 | 2736 | }, |
— | — | @@ -2743,7 +2743,7 @@ |
2744 | 2744 | $() |
2745 | 2745 | .unbind( 'mousemove', $.wikiEditor.modules.toc.fn.drag ) |
2746 | 2746 | .unbind( 'mouseup', $.wikiEditor.modules.toc.fn.stopDrag ); |
2747 | | - $(context.$iframe[0].contentWindow.document) |
| 2747 | + $( context.$iframe[0].contentWindow.document ) |
2748 | 2748 | .unbind( 'mousemove' ) |
2749 | 2749 | .unbind( 'mouseup' ); |
2750 | 2750 | if( context.$ui.find( '.wikiEditor-ui-right' ).width() < 50 && wgNavigableTOCCollapseEnable ) { |
— | — | @@ -2751,7 +2751,7 @@ |
2752 | 2752 | } else { |
2753 | 2753 | context.$ui.find( '.wikiEditor-ui-left' ).trigger( 'mouseup' ); |
2754 | 2754 | context.$ui.find( '.wikiEditor-ui-right' ) |
2755 | | - .data( 'openWidth', context.$ui.find( '.wikiEditor-ui-right' ).width() ); |
| 2755 | + .data( 'openWidth', context.$ui.find( '.wikiEditor-ui-right' ).width() ); |
2756 | 2756 | $.cookie( 'wikiEditor-' + context.instance + '-toc-width', |
2757 | 2757 | context.$ui.find( '.wikiEditor-ui-right' ).width() ); |
2758 | 2758 | } |
— | — | @@ -2822,12 +2822,11 @@ |
2823 | 2823 | .addClass( 'wikiEditor-ui-toc-collapse-open' ) |
2824 | 2824 | .attr( 'id', 'wikiEditor-ui-toc-collapse' ) |
2825 | 2825 | .data( 'openWidth', $.wikiEditor.modules.toc.defaultWidth ) |
2826 | | - .bind( 'mouseup', function() { |
| 2826 | + .mouseup( function() { |
2827 | 2827 | var $e = $(this); |
2828 | 2828 | var close = $e.hasClass( 'wikiEditor-ui-toc-collapse-open' ); |
2829 | 2829 | if( close ) { |
2830 | | - $e |
2831 | | - .removeClass( 'wikiEditor-ui-toc-collapse-open' ); |
| 2830 | + $e.removeClass( 'wikiEditor-ui-toc-collapse-open' ); |
2832 | 2831 | $e.parent() |
2833 | 2832 | .animate( { 'width': $e.outerWidth() }, 'fast', function() { |
2834 | 2833 | $(this).find( 'ul:first' ).hide(); |
— | — | @@ -2838,15 +2837,13 @@ |
2839 | 2838 | .addClass( 'wikiEditor-ui-toc-collapse-closed' ); |
2840 | 2839 | }); |
2841 | 2840 | } else { |
2842 | | - $e |
2843 | | - .removeClass( 'wikiEditor-ui-toc-collapse-closed' ); |
| 2841 | + $e.removeClass( 'wikiEditor-ui-toc-collapse-closed' ); |
2844 | 2842 | $e.siblings().show() |
2845 | 2843 | .parent() |
2846 | 2844 | .animate( { 'width': $e.data( 'openWidth' ) }, 'fast' ) |
2847 | 2845 | .prev() |
2848 | 2846 | .animate( { 'marginRight': $e.data( 'openWidth' ) }, 'fast', function() { |
2849 | | - $e |
2850 | | - .addClass( 'wikiEditor-ui-toc-collapse-open' ); |
| 2847 | + $e.addClass( 'wikiEditor-ui-toc-collapse-open' ); |
2851 | 2848 | }); |
2852 | 2849 | } |
2853 | 2850 | |
— | — | @@ -2855,33 +2852,33 @@ |
2856 | 2853 | } |
2857 | 2854 | function buildResizeControls() { |
2858 | 2855 | var $resizeControlVertical = $( '<div />' ) |
2859 | | - .attr( 'id', 'wikiEditor-ui-toc-resize-vertical') |
2860 | | - .bind( 'mousedown', function() { |
2861 | | - context.modules.$toc |
2862 | | - .data( 'openWidth', context.modules.$toc.width() ); |
2863 | | - $() |
2864 | | - .bind( 'mousemove', context, $.wikiEditor.modules.toc.fn.drag ) |
2865 | | - .bind( 'mouseup', context, $.wikiEditor.modules.toc.fn.stopDrag ); |
2866 | | - $(context.$iframe[0].contentWindow.document) |
2867 | | - .bind( 'mousemove', function( e ) { |
2868 | | - parent.top.$j().trigger("mousemove", e.pageX); |
2869 | | - return false; |
2870 | | - } ) |
2871 | | - .bind( 'mouseup', function() { |
2872 | | - parent.top.$j().trigger("mouseup"); |
| 2856 | + .attr( 'id', 'wikiEditor-ui-toc-resize-vertical') |
| 2857 | + .mousedown( function() { |
| 2858 | + context.modules.$toc |
| 2859 | + .data( 'openWidth', context.modules.$toc.width() ); |
| 2860 | + $() |
| 2861 | + .bind( 'mousemove', context, $.wikiEditor.modules.toc.fn.drag ) |
| 2862 | + .bind( 'mouseup', context, $.wikiEditor.modules.toc.fn.stopDrag ); |
| 2863 | + $( context.$iframe[0].contentWindow.document ) |
| 2864 | + .mousemove( function( e ) { |
| 2865 | + parent.top.$j().trigger( 'mousemove', e.pageX ); |
| 2866 | + return false; |
| 2867 | + } ) |
| 2868 | + .bind( 'mouseup', function() { |
| 2869 | + parent.top.$j().trigger( 'mouseup' ); |
| 2870 | + return false; |
| 2871 | + }); |
2873 | 2872 | return false; |
2874 | 2873 | }); |
2875 | | - return false; |
2876 | | - }); |
2877 | 2874 | |
2878 | 2875 | var $collapseControl = $( '<div />' ).addClass( 'tab' ).addClass( 'tab-toc' ) |
2879 | 2876 | .append( '<a href="#" />' ); |
2880 | 2877 | if( $.cookie( 'wikiEditor-' + context.instance + '-toc-width' ) != 1 ) { |
2881 | 2878 | $collapseControl.bind( 'click', context, $.wikiEditor.modules.toc.fn.collapse ) |
2882 | | - .find( 'a' ).text( gM( 'wikieditor-toc-hide' ) ); |
| 2879 | + .find( 'a' ).text( gM( 'wikieditor-toc-hide' ) ); |
2883 | 2880 | } else { |
2884 | 2881 | $collapseControl.bind( 'click', context, $.wikiEditor.modules.toc.fn.expand ) |
2885 | | - .find( 'a' ).text( gM( 'wikieditor-toc-show' ) ); |
| 2882 | + .find( 'a' ).text( gM( 'wikieditor-toc-show' ) ); |
2886 | 2883 | } |
2887 | 2884 | $collapseControl.insertBefore( context.modules.$toc ); |
2888 | 2885 | |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -174,8 +174,8 @@ |
175 | 175 | div.html(' ');var item=$('<li />').append(div);if(structure[i].sections!==undefined){item.append(buildList(structure[i].sections));} |
176 | 176 | list.append(item);} |
177 | 177 | return list;} |
178 | | -function buildCollapseBar(){context.modules.$toc.find('ul:first').css('width','147px').css('margin-left','19px').css('border-left','1px solid #DDDDDD');var $collapseBar=$('<div />').addClass('wikiEditor-ui-toc-collapse-open').attr('id','wikiEditor-ui-toc-collapse').data('openWidth',$.wikiEditor.modules.toc.defaultWidth).bind('mouseup',function(){var $e=$(this);var close=$e.hasClass('wikiEditor-ui-toc-collapse-open');if(close){$e.removeClass('wikiEditor-ui-toc-collapse-open');$e.parent().animate({'width':$e.outerWidth()},'fast',function(){$(this).find('ul:first').hide();}).prev().animate({'marginRight':$e.outerWidth()+1},'fast',function(){$e.addClass('wikiEditor-ui-toc-collapse-closed');});}else{$e.removeClass('wikiEditor-ui-toc-collapse-closed');$e.siblings().show().parent().animate({'width':$e.data('openWidth')},'fast').prev().animate({'marginRight':$e.data('openWidth')},'fast',function(){$e.addClass('wikiEditor-ui-toc-collapse-open');});}});return $collapseBar;} |
179 | | -function buildResizeControls(){var $resizeControlVertical=$('<div />').attr('id','wikiEditor-ui-toc-resize-vertical').bind('mousedown',function(){context.modules.$toc.data('openWidth',context.modules.$toc.width());$().bind('mousemove',context,$.wikiEditor.modules.toc.fn.drag).bind('mouseup',context,$.wikiEditor.modules.toc.fn.stopDrag);$(context.$iframe[0].contentWindow.document).bind('mousemove',function(e){parent.top.$j().trigger("mousemove",e.pageX);return false;}).bind('mouseup',function(){parent.top.$j().trigger("mouseup");return false;});return false;});var $collapseControl=$('<div />').addClass('tab').addClass('tab-toc').append('<a href="#" />');if($.cookie('wikiEditor-'+context.instance+'-toc-width')!=1){$collapseControl.bind('click',context,$.wikiEditor.modules.toc.fn.collapse).find('a').text(gM('wikieditor-toc-hide'));}else{$collapseControl.bind('click',context,$.wikiEditor.modules.toc.fn.expand).find('a').text(gM('wikieditor-toc-show'));} |
| 178 | +function buildCollapseBar(){context.modules.$toc.find('ul:first').css('width','147px').css('margin-left','19px').css('border-left','1px solid #DDDDDD');var $collapseBar=$('<div />').addClass('wikiEditor-ui-toc-collapse-open').attr('id','wikiEditor-ui-toc-collapse').data('openWidth',$.wikiEditor.modules.toc.defaultWidth).mouseup(function(){var $e=$(this);var close=$e.hasClass('wikiEditor-ui-toc-collapse-open');if(close){$e.removeClass('wikiEditor-ui-toc-collapse-open');$e.parent().animate({'width':$e.outerWidth()},'fast',function(){$(this).find('ul:first').hide();}).prev().animate({'marginRight':$e.outerWidth()+1},'fast',function(){$e.addClass('wikiEditor-ui-toc-collapse-closed');});}else{$e.removeClass('wikiEditor-ui-toc-collapse-closed');$e.siblings().show().parent().animate({'width':$e.data('openWidth')},'fast').prev().animate({'marginRight':$e.data('openWidth')},'fast',function(){$e.addClass('wikiEditor-ui-toc-collapse-open');});}});return $collapseBar;} |
| 179 | +function buildResizeControls(){var $resizeControlVertical=$('<div />').attr('id','wikiEditor-ui-toc-resize-vertical').mousedown(function(){context.modules.$toc.data('openWidth',context.modules.$toc.width());$().bind('mousemove',context,$.wikiEditor.modules.toc.fn.drag).bind('mouseup',context,$.wikiEditor.modules.toc.fn.stopDrag);$(context.$iframe[0].contentWindow.document).mousemove(function(e){parent.top.$j().trigger('mousemove',e.pageX);return false;}).bind('mouseup',function(){parent.top.$j().trigger('mouseup');return false;});return false;});var $collapseControl=$('<div />').addClass('tab').addClass('tab-toc').append('<a href="#" />');if($.cookie('wikiEditor-'+context.instance+'-toc-width')!=1){$collapseControl.bind('click',context,$.wikiEditor.modules.toc.fn.collapse).find('a').text(gM('wikieditor-toc-hide'));}else{$collapseControl.bind('click',context,$.wikiEditor.modules.toc.fn.expand).find('a').text(gM('wikieditor-toc-show'));} |
180 | 180 | $collapseControl.insertBefore(context.modules.$toc);if(!context.modules.$toc.data('openWidth')){context.modules.$toc.data('openWidth',context.initialWidth==1?$.wikiEditor.modules.toc.defaultWidth:context.initialWidth);} |
181 | 181 | if(context.initialWidth==1) |
182 | 182 | $.wikiEditor.modules.toc.fn.collapse({data:context});return $resizeControlVertical;} |