Index: trunk/extensions/UsabilityInitiative/css/wikiEditor.toc.css |
— | — | @@ -78,10 +78,16 @@ |
79 | 79 | |
80 | 80 | /* these first two should probably be conditionally applied */ |
81 | 81 | /* suggestions for doing that welcome */ |
| 82 | +.wikiEditor-ui-toc { |
| 83 | + overflow-y:hidden; |
| 84 | + position:relative; |
| 85 | +} |
82 | 86 | .wikiEditor-ui-toc ul { |
83 | | - width:132px; |
84 | | - float:left; |
| 87 | + overflow-y:auto; |
| 88 | + overflow-x:hidden; |
| 89 | + height:100%; |
85 | 90 | } |
| 91 | + |
86 | 92 | .wikiEditor-ui-toc ul ul { |
87 | 93 | float:none; |
88 | 94 | width:auto; |
— | — | @@ -89,7 +95,9 @@ |
90 | 96 | #wikiEditor-ui-toc-collapse { |
91 | 97 | height:100%; |
92 | 98 | width:18px; |
93 | | - float:left; |
| 99 | + position:absolute; |
| 100 | + top:0; |
| 101 | + left:0; |
94 | 102 | } |
95 | 103 | .wikiEditor-ui-toc-collapse-open { |
96 | 104 | background:#f3f3f3 url(../images/wikiEditor/toc/close.png) 4px 50% no-repeat; |
Index: trunk/extensions/UsabilityInitiative/css/combined.css |
— | — | @@ -183,10 +183,16 @@ |
184 | 184 | |
185 | 185 | /* these first two should probably be conditionally applied */ |
186 | 186 | /* suggestions for doing that welcome */ |
| 187 | +.wikiEditor-ui-toc { |
| 188 | + overflow-y:hidden; |
| 189 | + position:relative; |
| 190 | +} |
187 | 191 | .wikiEditor-ui-toc ul { |
188 | | - width:132px; |
189 | | - float:left; |
| 192 | + overflow-y:auto; |
| 193 | + overflow-x:hidden; |
| 194 | + height:100%; |
190 | 195 | } |
| 196 | + |
191 | 197 | .wikiEditor-ui-toc ul ul { |
192 | 198 | float:none; |
193 | 199 | width:auto; |
— | — | @@ -194,7 +200,9 @@ |
195 | 201 | #wikiEditor-ui-toc-collapse { |
196 | 202 | height:100%; |
197 | 203 | width:18px; |
198 | | - float:left; |
| 204 | + position:absolute; |
| 205 | + top:0; |
| 206 | + left:0; |
199 | 207 | } |
200 | 208 | .wikiEditor-ui-toc-collapse-open { |
201 | 209 | background:#f3f3f3 url(../images/wikiEditor/toc/close.png) 4px 50% no-repeat; |
Index: trunk/extensions/UsabilityInitiative/css/combined.min.css |
— | — | @@ -165,9 +165,14 @@ |
166 | 166 | padding-bottom:0.5em; |
167 | 167 | border-bottom:solid 1px #DDDDDD; |
168 | 168 | } |
| 169 | +.wikiEditor-ui-toc{ |
| 170 | +overflow-y:hidden; |
| 171 | +position:relative; |
| 172 | +} |
169 | 173 | .wikiEditor-ui-toc ul{ |
170 | | -width:132px; |
171 | | -float:left; |
| 174 | +overflow-y:auto; |
| 175 | +overflow-x:hidden; |
| 176 | +height:100%; |
172 | 177 | } |
173 | 178 | .wikiEditor-ui-toc ul ul{ |
174 | 179 | float:none; |
— | — | @@ -176,7 +181,9 @@ |
177 | 182 | #wikiEditor-ui-toc-collapse{ |
178 | 183 | height:100%; |
179 | 184 | width:18px; |
180 | | -float:left; |
| 185 | +position:absolute; |
| 186 | +top:0; |
| 187 | +left:0; |
181 | 188 | } |
182 | 189 | .wikiEditor-ui-toc-collapse-open{ |
183 | 190 | background:#f3f3f3 url(../images/wikiEditor/toc/close.png) 4px 50% no-repeat; |
— | — | @@ -500,4 +507,4 @@ |
501 | 508 | background-color:white; |
502 | 509 | text-decoration:none; |
503 | 510 | border-color:#a8d7f9; |
504 | | -} |
\ No newline at end of file |
| 511 | +} |
Index: trunk/extensions/UsabilityInitiative/NavigableTOC/NavigableTOC.php |
— | — | @@ -30,7 +30,7 @@ |
31 | 31 | $wgNavigableTOCCollapseEnable = true; |
32 | 32 | |
33 | 33 | // Bump the version number every time you change any of the .css/.js files |
34 | | -$wgNavigableTOCStyleVersion = 4; |
| 34 | +$wgNavigableTOCStyleVersion = 5; |
35 | 35 | |
36 | 36 | /* Setup */ |
37 | 37 | |
Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -22,15 +22,15 @@ |
23 | 23 | array( 'src' => 'css/wikiEditor.css', 'version' => 4 ), |
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' => 8 ), |
| 26 | + array( 'src' => 'css/wikiEditor.toc.css', 'version' => 9 ), |
27 | 27 | array( 'src' => 'css/vector/jquery-ui-1.7.2.css', 'version' => '1.7.2' ), |
28 | 28 | ), |
29 | 29 | 'combined' => array( |
30 | | - array( 'src' => 'css/combined.css', 'version' => 14 ), |
| 30 | + array( 'src' => 'css/combined.css', 'version' => 15 ), |
31 | 31 | array( 'src' => 'css/vector/jquery-ui-1.7.2.css', 'version' => '1.7.2' ), |
32 | 32 | ), |
33 | 33 | 'minified' => array( |
34 | | - array( 'src' => 'css/combined.min.css', 'version' => 14 ), |
| 34 | + array( 'src' => 'css/combined.min.css', 'version' => 15 ), |
35 | 35 | array( 'src' => 'css/vector/jquery-ui-1.7.2.css', 'version' => '1.7.2' ), |
36 | 36 | ), |
37 | 37 | ) |
— | — | @@ -72,7 +72,7 @@ |
73 | 73 | array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 12 ), |
74 | 74 | array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 18 ), |
75 | 75 | array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 8 ), |
76 | | - array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 25 ), |
| 76 | + array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 26 ), |
77 | 77 | array( 'src' => 'js/plugins/jquery.wikiEditor.code.js', 'version' => 1 ), |
78 | 78 | ), |
79 | 79 | 'combined' => array( |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toc.js |
— | — | @@ -162,6 +162,7 @@ |
163 | 163 | return list; |
164 | 164 | } |
165 | 165 | function buildCollapseBar() { |
| 166 | + $('.wikiEditor-ui-toc ul').css('width', '148px').css('margin-left', '19px').css('border-left', '1px solid #DDDDDD'); |
166 | 167 | var $collapseBar = $( '<div />' ) |
167 | 168 | .addClass( 'wikiEditor-ui-toc-collapse-open' ) |
168 | 169 | .attr( 'id', 'wikiEditor-ui-toc-collapse' ) |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -2395,6 +2395,7 @@ |
2396 | 2396 | return list; |
2397 | 2397 | } |
2398 | 2398 | function buildCollapseBar() { |
| 2399 | + $('.wikiEditor-ui-toc ul').css('width', '148px').css('margin-left', '19px').css('border-left', '1px solid #DDDDDD'); |
2399 | 2400 | var $collapseBar = $( '<div />' ) |
2400 | 2401 | .addClass( 'wikiEditor-ui-toc-collapse-open' ) |
2401 | 2402 | .attr( 'id', 'wikiEditor-ui-toc-collapse' ) |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -154,7 +154,7 @@ |
155 | 155 | div.html(' ');var item=$('<li></li>').append(div);if(structure[i].sections!==undefined){item.append(buildList(structure[i].sections));} |
156 | 156 | list.append(item);} |
157 | 157 | return list;} |
158 | | -function buildCollapseBar(){var $collapseBar=$('<div />').addClass('wikiEditor-ui-toc-collapse-open').attr('id','wikiEditor-ui-toc-collapse').data('oWidth',$.wikiEditor.modules.toc.defaults.width).bind('mouseup',function(){var $e=$(this);var close=$e.hasClass('wikiEditor-ui-toc-collapse-open');if(close){$('#wikiEditor-ui-toc-collapse').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(){$('#wikiEditor-ui-toc-collapse').addClass('wikiEditor-ui-toc-collapse-closed');});}else{$('#wikiEditor-ui-toc-collapse').removeClass('wikiEditor-ui-toc-collapse-closed');$e.siblings().show().parent().animate({'width':$e.data('oWidth')},'fast').prev().animate({'marginRight':$e.data('oWidth')},'fast',function(){$('#wikiEditor-ui-toc-collapse').addClass('wikiEditor-ui-toc-collapse-open');});}});return $collapseBar;} |
| 158 | +function buildCollapseBar(){$('.wikiEditor-ui-toc ul').css('width','148px').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('oWidth',$.wikiEditor.modules.toc.defaults.width).bind('mouseup',function(){var $e=$(this);var close=$e.hasClass('wikiEditor-ui-toc-collapse-open');if(close){$('#wikiEditor-ui-toc-collapse').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(){$('#wikiEditor-ui-toc-collapse').addClass('wikiEditor-ui-toc-collapse-closed');});}else{$('#wikiEditor-ui-toc-collapse').removeClass('wikiEditor-ui-toc-collapse-closed');$e.siblings().show().parent().animate({'width':$e.data('oWidth')},'fast').prev().animate({'marginRight':$e.data('oWidth')},'fast',function(){$('#wikiEditor-ui-toc-collapse').addClass('wikiEditor-ui-toc-collapse-open');});}});return $collapseBar;} |
159 | 159 | var outline=[];var wikitext=$.wikiEditor.fixOperaBrokenness(context.$textarea.val());var headings=wikitext.match(/^={1,6}[^=\n][^\n]*={1,6}\s*$/gm);var offset=0;headings=$.makeArray(headings);for(var h=0;h<headings.length;h++){text=$.trim(headings[h]);var position=wikitext.indexOf(text,offset);if(position>=offset){offset=position+text.length;}else if(position==-1){continue;} |
160 | 160 | var startLevel=0;for(var c=0;c<text.length;c++){if(text.charAt(c)=='='){startLevel++;}else{break;}} |
161 | 161 | var endLevel=0;for(var c=text.length-1;c>=0;c--){if(text.charAt(c)=='='){endLevel++;}else{break;}} |