Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -72,13 +72,13 @@ |
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' => 24 ), |
| 76 | + array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 25 ), |
77 | 77 | ), |
78 | 78 | 'combined' => array( |
79 | | - array( 'src' => 'js/plugins.combined.js', 'version' => 56 ), |
| 79 | + array( 'src' => 'js/plugins.combined.js', 'version' => 57 ), |
80 | 80 | ), |
81 | 81 | 'minified' => array( |
82 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 56 ), |
| 82 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 57 ), |
83 | 83 | ), |
84 | 84 | ), |
85 | 85 | ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toc.js |
— | — | @@ -166,29 +166,31 @@ |
167 | 167 | .addClass( 'wikiEditor-ui-toc-collapse-open' ) |
168 | 168 | .attr( 'id', 'wikiEditor-ui-toc-collapse' ) |
169 | 169 | .data( 'oWidth', $.wikiEditor.modules.toc.defaults.width) |
170 | | - .bind('mouseup', function(){ |
| 170 | + .bind( 'mouseup', function() { |
171 | 171 | var $e = $(this); |
172 | | - var close = $e.hasClass('wikiEditor-ui-toc-collapse-open'); |
173 | | - if(close) { |
| 172 | + var close = $e.hasClass( 'wikiEditor-ui-toc-collapse-open' ); |
| 173 | + if( close ) { |
| 174 | + $( '#wikiEditor-ui-toc-collapse' ) |
| 175 | + .removeClass( 'wikiEditor-ui-toc-collapse-open' ); |
174 | 176 | $e.parent() |
175 | | - .animate( {'width': $e.outerWidth()}, 'fast', function() { |
176 | | - $(this).find('ul:first').hide(); |
| 177 | + .animate( { 'width': $e.outerWidth() }, 'fast', function() { |
| 178 | + $(this).find( 'ul:first' ).hide(); |
177 | 179 | } ) |
178 | 180 | .prev() |
179 | | - .animate( {'marginRight': $e.outerWidth() + 1 }, 'fast', function(){ |
180 | | - $('#wikiEditor-ui-toc-collapse') |
181 | | - .removeClass('wikiEditor-ui-toc-collapse-open') |
182 | | - .addClass('wikiEditor-ui-toc-collapse-closed'); |
| 181 | + .animate( { 'marginRight': $e.outerWidth() + 1 }, 'fast', function() { |
| 182 | + $( '#wikiEditor-ui-toc-collapse' ) |
| 183 | + .addClass( 'wikiEditor-ui-toc-collapse-closed' ); |
183 | 184 | }); |
184 | 185 | } else { |
| 186 | + $( '#wikiEditor-ui-toc-collapse' ) |
| 187 | + .removeClass( 'wikiEditor-ui-toc-collapse-closed' ); |
185 | 188 | $e.siblings().show() |
186 | 189 | .parent() |
187 | | - .animate( {'width': $e.data('oWidth')}, 'fast' ) |
| 190 | + .animate( { 'width': $e.data('oWidth') }, 'fast' ) |
188 | 191 | .prev() |
189 | | - .animate( {'marginRight': $e.data('oWidth')}, 'fast', function(){ |
190 | | - $('#wikiEditor-ui-toc-collapse') |
191 | | - .removeClass('wikiEditor-ui-toc-collapse-closed') |
192 | | - .addClass('wikiEditor-ui-toc-collapse-open'); |
| 192 | + .animate( { 'marginRight': $e.data('oWidth') }, 'fast', function() { |
| 193 | + $( '#wikiEditor-ui-toc-collapse' ) |
| 194 | + .addClass( 'wikiEditor-ui-toc-collapse-open' ); |
193 | 195 | }); |
194 | 196 | } |
195 | 197 | |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -2393,29 +2393,31 @@ |
2394 | 2394 | .addClass( 'wikiEditor-ui-toc-collapse-open' ) |
2395 | 2395 | .attr( 'id', 'wikiEditor-ui-toc-collapse' ) |
2396 | 2396 | .data( 'oWidth', $.wikiEditor.modules.toc.defaults.width) |
2397 | | - .bind('mouseup', function(){ |
| 2397 | + .bind( 'mouseup', function() { |
2398 | 2398 | var $e = $(this); |
2399 | | - var close = $e.hasClass('wikiEditor-ui-toc-collapse-open'); |
2400 | | - if(close) { |
| 2399 | + var close = $e.hasClass( 'wikiEditor-ui-toc-collapse-open' ); |
| 2400 | + if( close ) { |
| 2401 | + $( '#wikiEditor-ui-toc-collapse' ) |
| 2402 | + .removeClass( 'wikiEditor-ui-toc-collapse-open' ); |
2401 | 2403 | $e.parent() |
2402 | | - .animate( {'width': $e.outerWidth()}, 'fast', function() { |
2403 | | - $(this).find('ul:first').hide(); |
| 2404 | + .animate( { 'width': $e.outerWidth() }, 'fast', function() { |
| 2405 | + $(this).find( 'ul:first' ).hide(); |
2404 | 2406 | } ) |
2405 | 2407 | .prev() |
2406 | | - .animate( {'marginRight': $e.outerWidth() + 1 }, 'fast', function(){ |
2407 | | - $('#wikiEditor-ui-toc-collapse') |
2408 | | - .removeClass('wikiEditor-ui-toc-collapse-open') |
2409 | | - .addClass('wikiEditor-ui-toc-collapse-closed'); |
| 2408 | + .animate( { 'marginRight': $e.outerWidth() + 1 }, 'fast', function() { |
| 2409 | + $( '#wikiEditor-ui-toc-collapse' ) |
| 2410 | + .addClass( 'wikiEditor-ui-toc-collapse-closed' ); |
2410 | 2411 | }); |
2411 | 2412 | } else { |
| 2413 | + $( '#wikiEditor-ui-toc-collapse' ) |
| 2414 | + .removeClass( 'wikiEditor-ui-toc-collapse-closed' ); |
2412 | 2415 | $e.siblings().show() |
2413 | 2416 | .parent() |
2414 | | - .animate( {'width': $e.data('oWidth')}, 'fast' ) |
| 2417 | + .animate( { 'width': $e.data('oWidth') }, 'fast' ) |
2415 | 2418 | .prev() |
2416 | | - .animate( {'marginRight': $e.data('oWidth')}, 'fast', function(){ |
2417 | | - $('#wikiEditor-ui-toc-collapse') |
2418 | | - .removeClass('wikiEditor-ui-toc-collapse-closed') |
2419 | | - .addClass('wikiEditor-ui-toc-collapse-open'); |
| 2419 | + .animate( { 'marginRight': $e.data('oWidth') }, 'fast', function() { |
| 2420 | + $( '#wikiEditor-ui-toc-collapse' ) |
| 2421 | + .addClass( 'wikiEditor-ui-toc-collapse-open' ); |
2420 | 2422 | }); |
2421 | 2423 | } |
2422 | 2424 | |
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){$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').removeClass('wikiEditor-ui-toc-collapse-open').addClass('wikiEditor-ui-toc-collapse-closed');});}else{$e.siblings().show().parent().animate({'width':$e.data('oWidth')},'fast').prev().animate({'marginRight':$e.data('oWidth')},'fast',function(){$('#wikiEditor-ui-toc-collapse').removeClass('wikiEditor-ui-toc-collapse-closed').addClass('wikiEditor-ui-toc-collapse-open');});}});return $collapseBar;} |
| 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;} |
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;}} |