Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -22,16 +22,16 @@ |
23 | 23 | array( 'src' => 'css/wikiEditor.css', 'version' => 6 ), |
24 | 24 | array( 'src' => 'css/wikiEditor.toolbar.css', 'version' => 7 ), |
25 | 25 | array( 'src' => 'css/wikiEditor.dialogs.css', 'version' => 2 ), |
26 | | - array( 'src' => 'css/wikiEditor.toc.css', 'version' => 16 ), |
| 26 | + array( 'src' => 'css/wikiEditor.toc.css', 'version' => 18 ), |
27 | 27 | array( 'src' => 'css/wikiEditor.preview.css', 'version' => 1 ), |
28 | 28 | array( 'src' => 'css/vector/jquery-ui-1.7.2.css', 'version' => '1.7.2y' ), |
29 | 29 | ), |
30 | 30 | 'combined' => array( |
31 | | - array( 'src' => 'css/combined.css', 'version' => 24 ), |
| 31 | + array( 'src' => 'css/combined.css', 'version' => 25 ), |
32 | 32 | array( 'src' => 'css/vector/jquery-ui-1.7.2.css', 'version' => '1.7.2y' ), |
33 | 33 | ), |
34 | 34 | 'minified' => array( |
35 | | - array( 'src' => 'css/combined.min.css', 'version' => 24 ), |
| 35 | + array( 'src' => 'css/combined.min.css', 'version' => 25 ), |
36 | 36 | array( 'src' => 'css/vector/jquery-ui-1.7.2.css', 'version' => '1.7.2y' ), |
37 | 37 | ), |
38 | 38 | ) |
— | — | @@ -73,14 +73,14 @@ |
74 | 74 | array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 17 ), |
75 | 75 | array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 29 ), |
76 | 76 | array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 9 ), |
77 | | - array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 36 ), |
| 77 | + array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 37 ), |
78 | 78 | array( 'src' => 'js/plugins/jquery.wikiEditor.preview.js', 'version' => 3 ), |
79 | 79 | ), |
80 | 80 | 'combined' => array( |
81 | | - array( 'src' => 'js/plugins.combined.js', 'version' => 78 ), |
| 81 | + array( 'src' => 'js/plugins.combined.js', 'version' => 79 ), |
82 | 82 | ), |
83 | 83 | 'minified' => array( |
84 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 78 ), |
| 84 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 79 ), |
85 | 85 | ), |
86 | 86 | ), |
87 | 87 | ); |
Index: trunk/extensions/UsabilityInitiative/css/wikiEditor.css |
— | — | @@ -47,6 +47,7 @@ |
48 | 48 | } |
49 | 49 | .wikiEditor-ui .wikiEditor-ui-right { |
50 | 50 | float: right; |
| 51 | + overflow:hidden; |
51 | 52 | } |
52 | 53 | .wikiEditor-wikitext { |
53 | 54 | float: left; |
— | — | @@ -61,4 +62,4 @@ |
62 | 63 | .wikiEditor-buttons { |
63 | 64 | float: right; |
64 | 65 | width: 50%; |
65 | | -} |
\ No newline at end of file |
| 66 | +} */ |
\ No newline at end of file |
Index: trunk/extensions/UsabilityInitiative/css/wikiEditor.toc.css |
— | — | @@ -1,11 +1,7 @@ |
2 | 2 | /* wikiEditor toc module */ |
3 | | - |
4 | | -.wikiEditor-ui-text { |
5 | | - /*border-right: solid silver 1px;*/ |
6 | | -} |
7 | 3 | body.rtl .wikiEditor-ui-text { |
8 | | - /*border-right: none;*/ |
9 | | - /*border-left: solid silver 1px;*/ |
| 4 | + border-right: none; |
| 5 | + border-left: solid silver 1px; |
10 | 6 | } |
11 | 7 | .wikiEditor-ui-toc { |
12 | 8 | /* height and width are set dynamically */ |
— | — | @@ -23,6 +19,7 @@ |
24 | 20 | */ |
25 | 21 | } |
26 | 22 | .wikiEditor-ui-toc ul { |
| 23 | + border-left: solid silver 1px; |
27 | 24 | padding: 0; |
28 | 25 | margin: 0; |
29 | 26 | list-style: none; |
— | — | @@ -32,6 +29,10 @@ |
33 | 30 | list-style-type: none; |
34 | 31 | width: 100%; |
35 | 32 | } |
| 33 | +body.rtl .wikiEditor-ui-toc ul { |
| 34 | + border-left: none; |
| 35 | + border-right: solid silver 1px; |
| 36 | +} |
36 | 37 | .tab-toc { |
37 | 38 | /* Should match the toolbar */ |
38 | 39 | background-image: url(../images/wikiEditor/toolbar/base.png); |
— | — | @@ -42,6 +43,8 @@ |
43 | 44 | line-height: 26px; |
44 | 45 | padding-left: 1em; |
45 | 46 | border-bottom: solid 1px silver; |
| 47 | + white-space:nowrap; |
| 48 | + overflow:hidden; |
46 | 49 | } |
47 | 50 | .tab-toc a{ |
48 | 51 | outline:none; |
— | — | @@ -126,7 +129,8 @@ |
127 | 130 | } |
128 | 131 | |
129 | 132 | /* Resizing Changes */ |
130 | | -#wikiEditor-ui-toc-resize-vertical{ |
| 133 | +.wikiEditor-ui-toc-resize-vertical, |
| 134 | +.ui-resizable-w{ |
131 | 135 | width:4px; |
132 | 136 | position:absolute; |
133 | 137 | top:0; |
— | — | @@ -134,22 +138,32 @@ |
135 | 139 | height:100%; |
136 | 140 | cursor:ew-resize; |
137 | 141 | } |
138 | | -#wikiEditor-ui-toc-resize-grip{ |
| 142 | +.wikiEditor-ui .wikiEditor-ui-right { |
| 143 | + overflow:visible; |
| 144 | +} |
| 145 | +.wikiEditor-ui-right .ui-resizable-w{ |
| 146 | + left: 0px !important; |
| 147 | +} |
| 148 | + |
| 149 | +.wikiEditor-ui-right .wikiEditor-ui-toc-resize-grip{ |
139 | 150 | width:5px; |
140 | 151 | height:12px; |
141 | 152 | padding:3px; |
142 | 153 | position:absolute; |
143 | 154 | top:7px; |
144 | | - right:2px; |
| 155 | + left:-12px !important; |
145 | 156 | cursor:ew-resize; |
146 | 157 | background:url(../images/wikiEditor/toc/grip.png) 50% 50% no-repeat; |
147 | 158 | } |
148 | | -#wikiEditor-ui-toolbar .tab-toc{ |
| 159 | +.wikiEditor-ui-toolbar .tab-toc{ |
149 | 160 | float:right; |
150 | 161 | margin:3px 16px 3px 3px; |
151 | 162 | line-height:26px; |
152 | 163 | } |
153 | | -#wikiEditor-ui-text textarea{ |
| 164 | +.wikiEditor-ui-text textarea{ |
154 | 165 | resize:none; |
155 | 166 | } |
156 | | -#wikiEditor-ui-text textarea:focus {outline:none;} |
\ No newline at end of file |
| 167 | +.wikiEditor-ui-text textarea:focus {outline:none;} |
| 168 | +.wikiEditor-ui-right{ |
| 169 | + left: 0px !important; |
| 170 | +} |
Index: trunk/extensions/UsabilityInitiative/css/combined.css |
— | — | @@ -97,6 +97,7 @@ |
98 | 98 | } |
99 | 99 | .wikiEditor-ui .wikiEditor-ui-right { |
100 | 100 | float: right; |
| 101 | + overflow:hidden; |
101 | 102 | } |
102 | 103 | .wikiEditor-wikitext { |
103 | 104 | float: left; |
— | — | @@ -111,7 +112,7 @@ |
112 | 113 | .wikiEditor-buttons { |
113 | 114 | float: right; |
114 | 115 | width: 50%; |
115 | | -}/* wikiEditor dialogs module */ |
| 116 | +} *//* wikiEditor dialogs module */ |
116 | 117 | |
117 | 118 | .ui-widget table { |
118 | 119 | margin-top: 0.75em; |
— | — | @@ -127,13 +128,9 @@ |
128 | 129 | z-index: 1099; |
129 | 130 | } |
130 | 131 | /* wikiEditor toc module */ |
131 | | - |
132 | | -.wikiEditor-ui-text { |
133 | | - /*border-right: solid silver 1px;*/ |
134 | | -} |
135 | 132 | body.rtl .wikiEditor-ui-text { |
136 | | - /*border-right: none;*/ |
137 | | - /*border-left: solid silver 1px;*/ |
| 133 | + border-right: none; |
| 134 | + border-left: solid silver 1px; |
138 | 135 | } |
139 | 136 | .wikiEditor-ui-toc { |
140 | 137 | /* height and width are set dynamically */ |
— | — | @@ -151,6 +148,7 @@ |
152 | 149 | */ |
153 | 150 | } |
154 | 151 | .wikiEditor-ui-toc ul { |
| 152 | + border-left: solid silver 1px; |
155 | 153 | padding: 0; |
156 | 154 | margin: 0; |
157 | 155 | list-style: none; |
— | — | @@ -160,6 +158,10 @@ |
161 | 159 | list-style-type: none; |
162 | 160 | width: 100%; |
163 | 161 | } |
| 162 | +body.rtl .wikiEditor-ui-toc ul { |
| 163 | + border-left: none; |
| 164 | + border-right: solid silver 1px; |
| 165 | +} |
164 | 166 | .tab-toc { |
165 | 167 | /* Should match the toolbar */ |
166 | 168 | background-image: url(../images/wikiEditor/toolbar/base.png); |
— | — | @@ -170,6 +172,8 @@ |
171 | 173 | line-height: 26px; |
172 | 174 | padding-left: 1em; |
173 | 175 | border-bottom: solid 1px silver; |
| 176 | + white-space:nowrap; |
| 177 | + overflow:hidden; |
174 | 178 | } |
175 | 179 | .tab-toc a{ |
176 | 180 | outline:none; |
— | — | @@ -254,7 +258,8 @@ |
255 | 259 | } |
256 | 260 | |
257 | 261 | /* Resizing Changes */ |
258 | | -#wikiEditor-ui-toc-resize-vertical{ |
| 262 | +.wikiEditor-ui-toc-resize-vertical, |
| 263 | +.ui-resizable-w{ |
259 | 264 | width:4px; |
260 | 265 | position:absolute; |
261 | 266 | top:0; |
— | — | @@ -262,25 +267,36 @@ |
263 | 268 | height:100%; |
264 | 269 | cursor:ew-resize; |
265 | 270 | } |
266 | | -#wikiEditor-ui-toc-resize-grip{ |
| 271 | +.wikiEditor-ui .wikiEditor-ui-right { |
| 272 | + overflow:visible; |
| 273 | +} |
| 274 | +.wikiEditor-ui-right .ui-resizable-w{ |
| 275 | + left: 0px !important; |
| 276 | +} |
| 277 | + |
| 278 | +.wikiEditor-ui-right .wikiEditor-ui-toc-resize-grip{ |
267 | 279 | width:5px; |
268 | 280 | height:12px; |
269 | 281 | padding:3px; |
270 | 282 | position:absolute; |
271 | 283 | top:7px; |
272 | | - right:2px; |
| 284 | + left:-12px !important; |
273 | 285 | cursor:ew-resize; |
274 | 286 | background:url(../images/wikiEditor/toc/grip.png) 50% 50% no-repeat; |
275 | 287 | } |
276 | | -#wikiEditor-ui-toolbar .tab-toc{ |
| 288 | +.wikiEditor-ui-toolbar .tab-toc{ |
277 | 289 | float:right; |
278 | 290 | margin:3px 16px 3px 3px; |
279 | 291 | line-height:26px; |
280 | 292 | } |
281 | | -#wikiEditor-ui-text textarea{ |
| 293 | +.wikiEditor-ui-text textarea{ |
282 | 294 | resize:none; |
283 | 295 | } |
284 | | -#wikiEditor-ui-text textarea:focus {outline:none;}/* wikiEditor toolbar module */ |
| 296 | +.wikiEditor-ui-text textarea:focus {outline:none;} |
| 297 | +.wikiEditor-ui-right{ |
| 298 | + left: 0px !important; |
| 299 | +} |
| 300 | +/* wikiEditor toolbar module */ |
285 | 301 | |
286 | 302 | .wikiEditor-ui-toolbar { |
287 | 303 | position: relative; |
Index: trunk/extensions/UsabilityInitiative/css/combined.min.css |
— | — | @@ -90,6 +90,7 @@ |
91 | 91 | } |
92 | 92 | .wikiEditor-ui .wikiEditor-ui-right{ |
93 | 93 | float:right; |
| 94 | +overflow:hidden; |
94 | 95 | } |
95 | 96 | .wikiEditor-wikitext{ |
96 | 97 | float:left; |
— | — | @@ -104,7 +105,7 @@ |
105 | 106 | .wikiEditor-buttons{ |
106 | 107 | float:right; |
107 | 108 | width:50%; |
108 | | -} |
| 109 | +} */ |
109 | 110 | .ui-widget table{ |
110 | 111 | margin-top:0.75em; |
111 | 112 | } |
— | — | @@ -116,9 +117,9 @@ |
117 | 118 | div.suggestions{ |
118 | 119 | z-index:1099; |
119 | 120 | } |
120 | | -.wikiEditor-ui-text{ |
121 | | -} |
122 | 121 | body.rtl .wikiEditor-ui-text{ |
| 122 | +border-right:none; |
| 123 | +border-left:solid silver 1px; |
123 | 124 | } |
124 | 125 | .wikiEditor-ui-toc{ |
125 | 126 | padding:0; |
— | — | @@ -134,6 +135,7 @@ |
135 | 136 | */ |
136 | 137 | } |
137 | 138 | .wikiEditor-ui-toc ul{ |
| 139 | +border-left:solid silver 1px; |
138 | 140 | padding:0; |
139 | 141 | margin:0; |
140 | 142 | list-style:none; |
— | — | @@ -142,6 +144,10 @@ |
143 | 145 | list-style-type:none; |
144 | 146 | width:100%; |
145 | 147 | } |
| 148 | +body.rtl .wikiEditor-ui-toc ul{ |
| 149 | +border-left:none; |
| 150 | +border-right:solid silver 1px; |
| 151 | +} |
146 | 152 | .tab-toc{ |
147 | 153 | background-image:url(../images/wikiEditor/toolbar/base.png); |
148 | 154 | background-position:left top; |
— | — | @@ -151,6 +157,8 @@ |
152 | 158 | line-height:26px; |
153 | 159 | padding-left:1em; |
154 | 160 | border-bottom:solid 1px silver; |
| 161 | +white-space:nowrap; |
| 162 | +overflow:hidden; |
155 | 163 | } |
156 | 164 | .tab-toc a{ |
157 | 165 | outline:none; |
— | — | @@ -228,7 +236,8 @@ |
229 | 237 | .wikiEditor-ui-toc-collapse-closed{ |
230 | 238 | background:#f3f3f3 url(../images/wikiEditor/toc/open.png) 4px 50% no-repeat; |
231 | 239 | } |
232 | | -#wikiEditor-ui-toc-resize-vertical{ |
| 240 | +.wikiEditor-ui-toc-resize-vertical, |
| 241 | +.ui-resizable-w{ |
233 | 242 | width:4px; |
234 | 243 | position:absolute; |
235 | 244 | top:0; |
— | — | @@ -236,25 +245,34 @@ |
237 | 246 | height:100%; |
238 | 247 | cursor:ew-resize; |
239 | 248 | } |
240 | | -#wikiEditor-ui-toc-resize-grip{ |
| 249 | +.wikiEditor-ui .wikiEditor-ui-right{ |
| 250 | +overflow:visible; |
| 251 | +} |
| 252 | +.wikiEditor-ui-right .ui-resizable-w{ |
| 253 | +left:0px !important; |
| 254 | +} |
| 255 | +.wikiEditor-ui-right .wikiEditor-ui-toc-resize-grip{ |
241 | 256 | width:5px; |
242 | 257 | height:12px; |
243 | 258 | padding:3px; |
244 | 259 | position:absolute; |
245 | 260 | top:7px; |
246 | | -right:2px; |
| 261 | +left:-12px !important; |
247 | 262 | cursor:ew-resize; |
248 | 263 | background:url(../images/wikiEditor/toc/grip.png) 50% 50% no-repeat; |
249 | 264 | } |
250 | | -#wikiEditor-ui-toolbar .tab-toc{ |
| 265 | +.wikiEditor-ui-toolbar .tab-toc{ |
251 | 266 | float:right; |
252 | 267 | margin:3px 16px 3px 3px; |
253 | 268 | line-height:26px; |
254 | 269 | } |
255 | | -#wikiEditor-ui-text textarea{ |
| 270 | +.wikiEditor-ui-text textarea{ |
256 | 271 | resize:none; |
257 | 272 | } |
258 | | -#wikiEditor-ui-text textarea:focus{outline:none;} |
| 273 | +.wikiEditor-ui-text textarea:focus{outline:none;} |
| 274 | +.wikiEditor-ui-right{ |
| 275 | +left:0px !important; |
| 276 | +} |
259 | 277 | .wikiEditor-ui-toolbar{ |
260 | 278 | position:relative; |
261 | 279 | width:100%; |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toolbar.js |
— | — | @@ -478,12 +478,15 @@ |
479 | 479 | $(this).data( 'context' ).$ui.find( '.section-' + $(this).parent().attr( 'rel' ) ); |
480 | 480 | var show = $section.css( 'display' ) == 'none'; |
481 | 481 | $previousSections = $section.parent().find( '.section:visible' ); |
| 482 | + var dH = $previousSections.outerHeight(); |
482 | 483 | $previousSections.css( 'position', 'absolute' ); |
483 | 484 | $previousSections.fadeOut( 'fast', function() { $(this).css( 'position', 'relative' ); } ); |
484 | 485 | $(this).parent().parent().find( 'a' ).removeClass( 'current' ); |
485 | 486 | $sections.css('overflow', 'hidden'); |
486 | 487 | if ( show ) { |
487 | 488 | $section.fadeIn( 'fast' ); |
| 489 | + dH = $section.outerHeight() - dH; |
| 490 | + context.modules.$toc.animate({'height': "+="+dH}, $section.outerHeight() * 2); |
488 | 491 | $sections.animate( { 'height': $section.outerHeight() }, $section.outerHeight() * 2, function() { |
489 | 492 | $(this).css('overflow', 'visible').css('height', 'auto'); |
490 | 493 | } ); |
— | — | @@ -493,6 +496,7 @@ |
494 | 497 | .animate( { 'height': 0 }, $section.outerHeight() * 2, function() { |
495 | 498 | $(this).css('overflow', 'visible'); |
496 | 499 | } ); |
| 500 | + context.modules.$toc.animate({'height': "-="+$section.outerHeight()}, $section.outerHeight() * 2); |
497 | 501 | } |
498 | 502 | // Click tracking |
499 | 503 | if($.trackAction != undefined){ |
— | — | @@ -562,33 +566,6 @@ |
563 | 567 | }, |
564 | 568 | build : function( context, config ) { |
565 | 569 | var $tabs = $( '<div />' ).addClass( 'tabs' ).appendTo( context.modules.$toolbar ); |
566 | | - /* |
567 | | - if( wgNavigableTOCCollapseEnable ) { |
568 | | - // FIXME: This code is duplicated from the TOC plugin and doesn't belong here; |
569 | | - // the TOC drag thingy should be in the TOC plugin instead |
570 | | - // placeholder for drag control creation code |
571 | | - $dragControl = $( '<div />' ).addClass( 'tab' ).attr( 'id', 'wikiEditor-ui-toc-resize-grip' ) |
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 | | - }); |
588 | | - return false; |
589 | | - }) |
590 | | - context.modules.$toolbar.append( $dragControl ); |
591 | | - } |
592 | | - */ |
593 | 570 | var $sections = $( '<div />' ).addClass( 'sections' ).appendTo( context.modules.$toolbar ); |
594 | 571 | context.modules.$toolbar.append( $( '<div />' ).css( 'clear', 'both' ) ); |
595 | 572 | var sectionQueue = []; |
— | — | @@ -619,7 +596,12 @@ |
620 | 597 | s.$sections.append( $.wikiEditor.modules.toolbar.fn.buildSection( s.context, s.id, s.config ) ); |
621 | 598 | var $section = s.$sections.find( '.section:visible' ); |
622 | 599 | if ( $section.size() ) { |
623 | | - $sections.animate( { 'height': $section.outerHeight() }, $section.outerHeight() * 2 ); |
| 600 | + $sections.animate( { 'height': $section.outerHeight() }, $section.outerHeight() * 2, function( ) { |
| 601 | + context.modules.$toc.height( |
| 602 | + context.$ui.find( '.wikiEditor-ui-left' ) |
| 603 | + .outerHeight() - context.$ui.find( '.tab-toc' ).outerHeight() |
| 604 | + ); |
| 605 | + } ); |
624 | 606 | } |
625 | 607 | } |
626 | 608 | } ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toc.js |
— | — | @@ -125,6 +125,8 @@ |
126 | 126 | * @param {Object} event Event object with context as data |
127 | 127 | */ |
128 | 128 | collapse: function( event ) { |
| 129 | + /* |
| 130 | + FIXME: Needs rewritten to deal with all of the recent changes |
129 | 131 | var context = event.data; |
130 | 132 | var $toc = context.modules.$toc; |
131 | 133 | if( !$toc.data( 'openWidth' ) ) { |
— | — | @@ -142,6 +144,7 @@ |
143 | 145 | //.prev() |
144 | 146 | //.animate( {'marginRight': '1px'}, 'fast', function() { $(this).css('marginRight', '-1px'); } ); |
145 | 147 | $.cookie( 'wikiEditor-' + context.instance + '-toc-width', 1 ); |
| 148 | + */ |
146 | 149 | return false; |
147 | 150 | }, |
148 | 151 | |
— | — | @@ -151,6 +154,8 @@ |
152 | 155 | * @param {Object} event Event object with context as data |
153 | 156 | */ |
154 | 157 | expand: function( event) { |
| 158 | + /* |
| 159 | + FIXME: Needs rewritten to deal with all of the recent changes |
155 | 160 | var context = event.data; |
156 | 161 | context.$ui.find( '.tab-toc' ) |
157 | 162 | .unbind( 'click', $.wikiEditor.modules.toc.fn.expand ) |
— | — | @@ -166,8 +171,18 @@ |
167 | 172 | //.prev() |
168 | 173 | //.animate( { 'marginRight': context.modules.$toc.data( 'openWidth' ) }, 'fast' ); |
169 | 174 | $.cookie( 'wikiEditor-' + context.instance + '-toc-width', context.modules.$toc.data( 'openWidth' ) ); |
| 175 | + */ |
170 | 176 | return false; |
171 | 177 | }, |
| 178 | + startResize: function ( event, ui ){ |
| 179 | + |
| 180 | + }, |
| 181 | + resize: function( event, ui ) { |
| 182 | + |
| 183 | + }, |
| 184 | + stopResize: function( event, ui ){ |
| 185 | + |
| 186 | + }, |
172 | 187 | /** |
173 | 188 | * Handles drag events on the contents module |
174 | 189 | * |
— | — | @@ -180,10 +195,13 @@ |
181 | 196 | // returned NaN in some cases. Even this seems to be buggy in that .offset().left |
182 | 197 | // is sometimes 0. |
183 | 198 | // FIXME: We should ditch the whole thing and use jQuery UI Resizable if possible |
| 199 | + |
| 200 | + |
184 | 201 | if ( pageX ) |
185 | 202 | mR = pageX; |
186 | 203 | else |
187 | 204 | mR = e.pageX - context.$ui.find( '.wikiEditor.ui-left' ).offset().left; |
| 205 | + console.log(mR); |
188 | 206 | mR = context.$ui.find( '.wikiEditor-ui-left' ).width() - mR; |
189 | 207 | if( mR < 26 || mR > context.$ui.find( '.wikiEditor-ui-left' ).width() - 250) |
190 | 208 | return false; |
— | — | @@ -274,10 +292,10 @@ |
275 | 293 | return list; |
276 | 294 | } |
277 | 295 | function buildCollapseBar() { |
278 | | - // FIXME: Move this to a .css file |
| 296 | + /* FIXME: Move this to a .css file |
279 | 297 | context.modules.$toc.find( 'ul:first' ).css( 'width', '147px' ) |
280 | | - .css( 'margin-left', '19px' ).css( 'border-left', '1px solid #DDDDDD' ); |
281 | | - var $collapseBar = $( '<div />' ) |
| 298 | + .css( 'margin-left', '19px' ).css( 'border-left', '1px solid #DDDDDD' ); */ |
| 299 | + return $( '<div />' ) |
282 | 300 | .addClass( 'wikiEditor-ui-toc-collapse-open' ) |
283 | 301 | .attr( 'id', 'wikiEditor-ui-toc-collapse' ) |
284 | 302 | .data( 'openWidth', $.wikiEditor.modules.toc.defaultWidth ) |
— | — | @@ -307,29 +325,13 @@ |
308 | 326 | } |
309 | 327 | |
310 | 328 | }); |
311 | | - return $collapseBar; |
312 | 329 | } |
313 | 330 | function buildResizeControls() { |
314 | | - var $resizeControlVertical = $( '<div />' ) |
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 | | - return false; |
332 | | - }); |
333 | | - |
| 331 | + context.$ui.find( '.ui-resizable-e' ) |
| 332 | + .removeClass( 'ui-resizable-e' ) |
| 333 | + .addClass( 'ui-resizable-w' ) |
| 334 | + .addClass( 'wikiEditor-ui-toc-resize-grip' ) |
| 335 | + .appendTo(context.$ui.find( '.wikiEditor-ui-right' )); |
334 | 336 | var $collapseControl = $( '<div />' ).addClass( 'tab' ).addClass( 'tab-toc' ) |
335 | 337 | .append( '<a href="#" />' ); |
336 | 338 | if( $.cookie( 'wikiEditor-' + context.instance + '-toc-width' ) != 1 ) { |
— | — | @@ -347,7 +349,7 @@ |
348 | 350 | } |
349 | 351 | if ( context.initialWidth == 1 ) |
350 | 352 | $.wikiEditor.modules.toc.fn.collapse( { data: context } ); |
351 | | - return $resizeControlVertical; |
| 353 | + return ""; |
352 | 354 | } |
353 | 355 | |
354 | 356 | // Build outline from wikitext |
— | — | @@ -409,11 +411,38 @@ |
410 | 412 | 'wrapper': div } ); |
411 | 413 | } |
412 | 414 | context.modules.$toc.html( buildList( structure ) ); |
413 | | - |
414 | 415 | if(wgNavigableTOCResizable) { |
| 416 | + context.$ui.find( '.wikiEditor-ui-right' ) |
| 417 | + .data( 'wikiEditor-ui-left', context.$ui.find( '.wikiEditor-ui-left' )) |
| 418 | + .resizable( {handles: 'w,e', minWidth: 50, |
| 419 | + start: function( e, ui ) { |
| 420 | + $( '<div />' ).addClass( 'wikiEditor-ui-resize-mask' ) |
| 421 | + .css( 'position', 'absolute' ) |
| 422 | + .css( 'z-index', 2 ) |
| 423 | + .css( 'left', 0 ).css( 'top', 0 ).css( 'bottom', 0 ).css( 'right', 0 ) |
| 424 | + .appendTo(context.$ui.find( '.wikiEditor-ui-left' )); |
| 425 | + }, |
| 426 | + resize: function( e, ui ) { |
| 427 | + /* |
| 428 | + * FIXME: Currently setting a heigh property on the resizable with ever mousemove event |
| 429 | + * which breaks our height resizing code in jquery.wikiEditor.toolbar.js |
| 430 | + */ |
| 431 | + |
| 432 | + // for some odd reason, ui.size.width seems a step ahead of what the *actual* width of |
| 433 | + // the resizable is |
| 434 | + $( this ).css( 'width' , ui.size.width ) |
| 435 | + .data( 'wikiEditor-ui-left' ).css( 'marginRight', ( -1 * ui.size.width ) ) |
| 436 | + .children( ).css( 'marginRight', ui.size.width ); |
| 437 | + }, |
| 438 | + stop: function ( e, ui ) { |
| 439 | + context.$ui.find( '.wikiEditor-ui-resize-mask' ).remove(); |
| 440 | + if( ui.size.width < 70 ){ |
| 441 | + // collapse |
| 442 | + } |
| 443 | + } |
| 444 | + }); |
| 445 | + |
415 | 446 | context.modules.$toc.append( buildResizeControls() ); |
416 | | - } else if(wgNavigableTOCCollapseEnable) { |
417 | | - context.modules.$toc.append( buildCollapseBar() ); |
418 | 447 | } |
419 | 448 | context.modules.$toc.find( 'div' ).autoEllipse( { 'position': 'right', 'tooltip': true } ); |
420 | 449 | // Cache the outline for later use |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -2390,12 +2390,15 @@ |
2391 | 2391 | $(this).data( 'context' ).$ui.find( '.section-' + $(this).parent().attr( 'rel' ) ); |
2392 | 2392 | var show = $section.css( 'display' ) == 'none'; |
2393 | 2393 | $previousSections = $section.parent().find( '.section:visible' ); |
| 2394 | + var dH = $previousSections.outerHeight(); |
2394 | 2395 | $previousSections.css( 'position', 'absolute' ); |
2395 | 2396 | $previousSections.fadeOut( 'fast', function() { $(this).css( 'position', 'relative' ); } ); |
2396 | 2397 | $(this).parent().parent().find( 'a' ).removeClass( 'current' ); |
2397 | 2398 | $sections.css('overflow', 'hidden'); |
2398 | 2399 | if ( show ) { |
2399 | 2400 | $section.fadeIn( 'fast' ); |
| 2401 | + dH = $section.outerHeight() - dH; |
| 2402 | + context.modules.$toc.animate({'height': "+="+dH}, $section.outerHeight() * 2); |
2400 | 2403 | $sections.animate( { 'height': $section.outerHeight() }, $section.outerHeight() * 2, function() { |
2401 | 2404 | $(this).css('overflow', 'visible').css('height', 'auto'); |
2402 | 2405 | } ); |
— | — | @@ -2405,6 +2408,7 @@ |
2406 | 2409 | .animate( { 'height': 0 }, $section.outerHeight() * 2, function() { |
2407 | 2410 | $(this).css('overflow', 'visible'); |
2408 | 2411 | } ); |
| 2412 | + context.modules.$toc.animate({'height': "-="+$section.outerHeight()}, $section.outerHeight() * 2); |
2409 | 2413 | } |
2410 | 2414 | // Click tracking |
2411 | 2415 | if($.trackAction != undefined){ |
— | — | @@ -2531,7 +2535,12 @@ |
2532 | 2536 | s.$sections.append( $.wikiEditor.modules.toolbar.fn.buildSection( s.context, s.id, s.config ) ); |
2533 | 2537 | var $section = s.$sections.find( '.section:visible' ); |
2534 | 2538 | if ( $section.size() ) { |
2535 | | - $sections.animate( { 'height': $section.outerHeight() }, $section.outerHeight() * 2 ); |
| 2539 | + $sections.animate( { 'height': $section.outerHeight() }, $section.outerHeight() * 2, function( ) { |
| 2540 | + context.modules.$toc.height( |
| 2541 | + context.$ui.find( '.wikiEditor-ui-left' ) |
| 2542 | + .outerHeight() - context.$ui.find( '.tab-toc' ).outerHeight() |
| 2543 | + ); |
| 2544 | + } ); |
2536 | 2545 | } |
2537 | 2546 | } |
2538 | 2547 | } ); |
— | — | @@ -2587,8 +2596,9 @@ |
2588 | 2597 | .css( 'width', $.wikiEditor.modules.toc.defaultWidth ) |
2589 | 2598 | .append( context.modules.$toc ); |
2590 | 2599 | context.modules.$toc.height( |
2591 | | - context.$ui.find( '.wikiEditor-ui-left' ).height() |
| 2600 | + context.$ui.find( '.wikiEditor-ui-left' ).height() - 1 |
2592 | 2601 | ); |
| 2602 | + context.modules.$toc |
2593 | 2603 | context.$ui.find( '.wikiEditor-ui-left' ) |
2594 | 2604 | .css( 'marginRight', "-" + $.wikiEditor.modules.toc.defaultWidth ) |
2595 | 2605 | .children() |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -146,7 +146,7 @@ |
147 | 147 | $.wikiEditor.autoMsg(row[cell],['html','text'])+'</span></td>';} |
148 | 148 | html+='</tr>';return html;},buildCharacter:function(character,actions){if(typeof character=='string'){character={'label':character,'action':{'type':'encapsulate','options':{'pre':character}}};}else if(0 in character&&1 in character){character={'label':character[0],'action':{'type':'encapsulate','options':{'pre':character[1]}}};} |
149 | 149 | if('action'in character&&'label'in character){actions[character.label]=character.action;return'<a rel="'+character.label+'" href="#">'+character.label+'</a>';}},buildTab:function(context,id,section){var selected=$.cookie('wikiEditor-'+context.instance+'-toolbar-section');return $('<span />').attr({'class':'tab tab-'+id,'rel':id}).append($('<a />').addClass(selected==id?'current':null).attr('href','#').text($.wikiEditor.autoMsg(section,'label')).data('context',context).bind('mouseup',function(e){$(this).blur();}).bind('mousedown',function(e){if(e.button!==0&&(e.button&1)==0){return true;} |
150 | | -var $sections=$(this).data('context').$ui.find('.sections');var $section=$(this).data('context').$ui.find('.section-'+$(this).parent().attr('rel'));var show=$section.css('display')=='none';$previousSections=$section.parent().find('.section:visible');$previousSections.css('position','absolute');$previousSections.fadeOut('fast',function(){$(this).css('position','relative');});$(this).parent().parent().find('a').removeClass('current');$sections.css('overflow','hidden');if(show){$section.fadeIn('fast');$sections.animate({'height':$section.outerHeight()},$section.outerHeight()*2,function(){$(this).css('overflow','visible').css('height','auto');});$(this).addClass('current');}else{$sections.css('height',$section.outerHeight()).animate({'height':0},$section.outerHeight()*2,function(){$(this).css('overflow','visible');});} |
| 150 | +var $sections=$(this).data('context').$ui.find('.sections');var $section=$(this).data('context').$ui.find('.section-'+$(this).parent().attr('rel'));var show=$section.css('display')=='none';$previousSections=$section.parent().find('.section:visible');var dH=$previousSections.outerHeight();$previousSections.css('position','absolute');$previousSections.fadeOut('fast',function(){$(this).css('position','relative');});$(this).parent().parent().find('a').removeClass('current');$sections.css('overflow','hidden');if(show){$section.fadeIn('fast');dH=$section.outerHeight()-dH;context.modules.$toc.animate({'height':"+="+dH},$section.outerHeight()*2);$sections.animate({'height':$section.outerHeight()},$section.outerHeight()*2,function(){$(this).css('overflow','visible').css('height','auto');});$(this).addClass('current');}else{$sections.css('height',$section.outerHeight()).animate({'height':0},$section.outerHeight()*2,function(){$(this).css('overflow','visible');});context.modules.$toc.animate({'height':"-="+$section.outerHeight()},$section.outerHeight()*2);} |
151 | 151 | if($.trackAction!=undefined){$.trackAction($section.attr('rel')+'.'+(show?'show':'hide'));} |
152 | 152 | $.cookie('wikiEditor-'+$(this).data('context').instance+'-toolbar-section',show?$section.attr('rel'):null);}).click(function(){return false;}));},buildSection:function(context,id,section){context.$textarea.trigger('wikiEditor-toolbar-buildSection-'+id,[section]);var selected=$.cookie('wikiEditor-'+context.instance+'-toolbar-section');var $section;switch(section.type){case'toolbar':var $section=$('<div />').attr({'class':'toolbar section section-'+id,'rel':id});if('groups'in section){for(group in section.groups){$section.append($.wikiEditor.modules.toolbar.fn.buildGroup(context,group,section.groups[group]));}} |
153 | 153 | break;case'booklet':var $pages=$('<div />').addClass('pages');var $index=$('<div />').addClass('index');if('pages'in section){for(page in section.pages){$pages.append($.wikiEditor.modules.toolbar.fn.buildPage(context,page,section.pages[page]));$index.append($.wikiEditor.modules.toolbar.fn.buildBookmark(context,page,section.pages[page]));}} |
— | — | @@ -154,9 +154,10 @@ |
155 | 155 | if($section!==null&&id!=='main'){var show=selected==id;$section.css('display',show?'block':'none');} |
156 | 156 | return $section;},updateBookletSelection:function(context,id,$pages,$index){var cookie='wikiEditor-'+context.instance+'-booklet-'+id+'-page';var selected=$.cookie(cookie);var $selectedIndex=$index.find('*[rel='+selected+']');if($selectedIndex.size()==0){selected=$index.children().eq(0).attr('rel');$.cookie(cookie,selected);} |
157 | 157 | $pages.children().hide();$pages.find('*[rel='+selected+']').show();$index.children().removeClass('current');$selectedIndex.addClass('current');},build:function(context,config){var $tabs=$('<div />').addClass('tabs').appendTo(context.modules.$toolbar);var $sections=$('<div />').addClass('sections').appendTo(context.modules.$toolbar);context.modules.$toolbar.append($('<div />').css('clear','both'));var sectionQueue=[];for(section in config){if(section=='main'){context.modules.$toolbar.prepend($.wikiEditor.modules.toolbar.fn.buildSection(context,section,config[section]));}else{sectionQueue.push({'$sections':$sections,'context':context,'id':section,'config':config[section]});$tabs.append($.wikiEditor.modules.toolbar.fn.buildTab(context,section,config[section]));}} |
158 | | -$.eachAsync(sectionQueue,{'bulk':0,'end':function(){$('body').css('position','static');$('body').css('position','relative');},'loop':function(i,s){s.$sections.append($.wikiEditor.modules.toolbar.fn.buildSection(s.context,s.id,s.config));var $section=s.$sections.find('.section:visible');if($section.size()){$sections.animate({'height':$section.outerHeight()},$section.outerHeight()*2);}}});}}};})(jQuery);(function($){$.wikiEditor.modules.toc={api:{},defaultWidth:'13em',fn:{create:function(context,config){if('$toc'in context.modules){return;} |
| 158 | +$.eachAsync(sectionQueue,{'bulk':0,'end':function(){$('body').css('position','static');$('body').css('position','relative');},'loop':function(i,s){s.$sections.append($.wikiEditor.modules.toolbar.fn.buildSection(s.context,s.id,s.config));var $section=s.$sections.find('.section:visible');if($section.size()){$sections.animate({'height':$section.outerHeight()},$section.outerHeight()*2,function(){context.modules.$toc.height(context.$ui.find('.wikiEditor-ui-left').outerHeight()-context.$ui.find('.tab-toc').outerHeight());});}}});}}};})(jQuery);(function($){$.wikiEditor.modules.toc={api:{},defaultWidth:'13em',fn:{create:function(context,config){if('$toc'in context.modules){return;} |
159 | 159 | context.initialWidth=$.wikiEditor.modules.toc.defaultWidth;if(wgNavigableTOCResizable){if(!$.cookie('wikiEditor-'+context.instance+'-toc-width')){$.cookie('wikiEditor-'+context.instance+'-toc-width',$.wikiEditor.modules.toc.defaultWidth);}else{context.initialWidth=$.cookie('wikiEditor-'+context.instance+'-toc-width');}} |
160 | | -var height=context.$ui.find('.wikiEditor-ui-left').height();context.modules.$toc=$('<div />').addClass('wikiEditor-ui-toc').data('context',context);context.$ui.find('.wikiEditor-ui-right').css('width',$.wikiEditor.modules.toc.defaultWidth).append(context.modules.$toc);context.modules.$toc.height(context.$ui.find('.wikiEditor-ui-left').height());context.$ui.find('.wikiEditor-ui-left').css('marginRight',"-"+$.wikiEditor.modules.toc.defaultWidth).children().css('marginRight',$.wikiEditor.modules.toc.defaultWidth);$.wikiEditor.modules.toc.fn.build(context,config);context.$textarea.delayedBind(250,'mouseup scrollToPosition focus keyup encapsulateSelection change',function(event){var context=$(this).data('wikiEditor-context');$(this).eachAsync({bulk:0,loop:function(){$.wikiEditor.modules.toc.fn.build(context);$.wikiEditor.modules.toc.fn.update(context);}});}).blur(function(){var context=$(this).data('wikiEditor-context');context.$textarea.delayedBindCancel(250,'mouseup scrollToPosition focus keyup encapsulateSelection change');$.wikiEditor.modules.toc.fn.unhighlight(context);});},unhighlight:function(context){context.modules.$toc.find('div').removeClass('current');},update:function(context){$.wikiEditor.modules.toc.fn.unhighlight(context);var position=context.$textarea.textSelection('getCaretPosition');var section=0;if(context.data.outline.length>0){if(!(position<context.data.outline[0].position-1)){while(section<context.data.outline.length&&context.data.outline[section].position-1<position){section++;} |
| 160 | +var height=context.$ui.find('.wikiEditor-ui-left').height();context.modules.$toc=$('<div />').addClass('wikiEditor-ui-toc').data('context',context);context.$ui.find('.wikiEditor-ui-right').css('width',$.wikiEditor.modules.toc.defaultWidth).append(context.modules.$toc);context.modules.$toc.height(context.$ui.find('.wikiEditor-ui-left').height()-1);context.modules.$toc |
| 161 | +context.$ui.find('.wikiEditor-ui-left').css('marginRight',"-"+$.wikiEditor.modules.toc.defaultWidth).children().css('marginRight',$.wikiEditor.modules.toc.defaultWidth);$.wikiEditor.modules.toc.fn.build(context,config);context.$textarea.delayedBind(250,'mouseup scrollToPosition focus keyup encapsulateSelection change',function(event){var context=$(this).data('wikiEditor-context');$(this).eachAsync({bulk:0,loop:function(){$.wikiEditor.modules.toc.fn.build(context);$.wikiEditor.modules.toc.fn.update(context);}});}).blur(function(){var context=$(this).data('wikiEditor-context');context.$textarea.delayedBindCancel(250,'mouseup scrollToPosition focus keyup encapsulateSelection change');$.wikiEditor.modules.toc.fn.unhighlight(context);});},unhighlight:function(context){context.modules.$toc.find('div').removeClass('current');},update:function(context){$.wikiEditor.modules.toc.fn.unhighlight(context);var position=context.$textarea.textSelection('getCaretPosition');var section=0;if(context.data.outline.length>0){if(!(position<context.data.outline[0].position-1)){while(section<context.data.outline.length&&context.data.outline[section].position-1<position){section++;} |
161 | 162 | section=Math.max(0,section);} |
162 | 163 | var sectionLink=context.modules.$toc.find('div.section-'+section);sectionLink.addClass('current');var relTop=sectionLink.offset().top-context.modules.$toc.offset().top;var scrollTop=context.modules.$toc.scrollTop();var divHeight=context.modules.$toc.height();var sectionHeight=sectionLink.height();if(relTop<0) |
163 | 164 | context.modules.$toc.scrollTop(scrollTop+relTop);else if(relTop+sectionHeight>divHeight) |