Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -67,16 +67,16 @@ |
68 | 68 | array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 12 ), |
69 | 69 | array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 12 ), |
70 | 70 | array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 4 ), |
71 | | - array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 18 ), |
| 71 | + array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 19 ), |
72 | 72 | // FIXME: jQuery UI doesn't belong here, should move to no_js2 |
73 | 73 | // once we figure out how to do jQuery UI properly in JS2 |
74 | 74 | array( 'src' => 'js/js2/jquery-ui-1.7.2.js', 'version' => '1.7.2y' ), |
75 | 75 | ), |
76 | 76 | 'combined' => array( |
77 | | - array( 'src' => 'js/plugins.combined.js', 'version' => 41 ), |
| 77 | + array( 'src' => 'js/plugins.combined.js', 'version' => 42 ), |
78 | 78 | ), |
79 | 79 | 'minified' => array( |
80 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 41 ), |
| 80 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 42 ), |
81 | 81 | ), |
82 | 82 | ), |
83 | 83 | ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toc.js |
— | — | @@ -182,7 +182,7 @@ |
183 | 183 | var position = wikitext.indexOf( text, offset ); |
184 | 184 | // Update offset to avoid stumbling on duplicate headings |
185 | 185 | if ( position >= offset ) { |
186 | | - offset = position + 1; |
| 186 | + offset = position + text.length; |
187 | 187 | } else if ( position == -1 ) { |
188 | 188 | // Not sure this is possible, or what should happen |
189 | 189 | continue; |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -2279,7 +2279,7 @@ |
2280 | 2280 | var position = wikitext.indexOf( text, offset ); |
2281 | 2281 | // Update offset to avoid stumbling on duplicate headings |
2282 | 2282 | if ( position >= offset ) { |
2283 | | - offset = position + 1; |
| 2283 | + offset = position + text.length; |
2284 | 2284 | } else if ( position == -1 ) { |
2285 | 2285 | // Not sure this is possible, or what should happen |
2286 | 2286 | continue; |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -152,7 +152,7 @@ |
153 | 153 | function buildList(structure){var list=$('<ul />');for(i in structure){var item=$('<li />').append($('<a />').attr('href','#').addClass('section-'+structure[i].index).data('textbox',context.$textarea).data('position',structure[i].position).click(function(event){$(this).data('textbox').focus().setSelection($(this).data('position')).scrollToCaretPosition(true);event.preventDefault();}).text(structure[i].text));if(structure[i].sections!==undefined){item.append(buildList(structure[i].sections));} |
154 | 154 | list.append(item);} |
155 | 155 | return list;} |
156 | | -var outline=[];var wikitext=$.wikiEditor.fixOperaBrokenness(context.$textarea.val());var headings=wikitext.match(/^={1,6}.+={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+1;}else if(position==-1){continue;} |
| 156 | +var outline=[];var wikitext=$.wikiEditor.fixOperaBrokenness(context.$textarea.val());var headings=wikitext.match(/^={1,6}.+={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;} |
157 | 157 | var startLevel=0;for(var c=0;c<text.length;c++){if(text.charAt(c)=='='){startLevel++;}else{break;}} |
158 | 158 | var endLevel=0;for(var c=text.length-1;c>=0;c--){if(text.charAt(c)=='='){endLevel++;}else{break;}} |
159 | 159 | var level=Math.min(startLevel,endLevel);text=$.trim(text.substr(level,text.length-(level*2)));outline[h]={'text':text,'position':position,'level':level,'index':h+1};} |
Index: trunk/extensions/UsabilityInitiative/Makefile |
— | — | @@ -4,26 +4,17 @@ |
5 | 5 | # For more info on JSMin, see: http://www.crockford.com/javascript/jsmin.html |
6 | 6 | # |
7 | 7 | |
8 | | -all: css/combined.css\ |
9 | | - css/combined.min.css\ |
10 | | - js/js2.combined.js\ |
11 | | - js/js2.combined.min.js\ |
12 | | - js/plugins.combined.js\ |
13 | | - js/plugins.combined.min.js |
| 8 | +CSS := css/suggestions.css\ |
| 9 | + css/wikiEditor.css\ |
| 10 | + css/wikiEditor.dialogs.css\ |
| 11 | + css/wikiEditor.toc.css\ |
| 12 | + css/wikiEditor.toolbar.css |
14 | 13 | |
15 | | -css/combined.css: |
16 | | - cat css/*.css > css/combined.css |
17 | | - |
18 | | -js/js2.combined.js: |
19 | | - cat\ |
20 | | - js/js2/jquery-1.3.2.js\ |
| 14 | +JS2 := js/js2/jquery-1.3.2.js\ |
21 | 15 | js/js2/jquery-ui-1.7.2.js\ |
22 | | - js/js2/js2.js\ |
23 | | - > js/js2.combined.js |
| 16 | + js/js2/js2.js |
24 | 17 | |
25 | | -js/plugins.combined.js: |
26 | | - cat\ |
27 | | - js/plugins/jquery.async.js\ |
| 18 | +PLUGINS := js/plugins/jquery.async.js\ |
28 | 19 | js/plugins/jquery.autoEllipse.js\ |
29 | 20 | js/plugins/jquery.browser.js\ |
30 | 21 | js/plugins/jquery.cookie.js\ |
— | — | @@ -34,9 +25,24 @@ |
35 | 26 | js/plugins/jquery.wikiEditor.js\ |
36 | 27 | js/plugins/jquery.wikiEditor.dialogs.js\ |
37 | 28 | js/plugins/jquery.wikiEditor.toolbar.js\ |
38 | | - js/plugins/jquery.wikiEditor.toc.js\ |
39 | | - > js/plugins.combined.js |
| 29 | + js/plugins/jquery.wikiEditor.toc.js |
40 | 30 | |
| 31 | +all: css/combined.css\ |
| 32 | + css/combined.min.css\ |
| 33 | + js/js2.combined.js\ |
| 34 | + js/js2.combined.min.js\ |
| 35 | + js/plugins.combined.js\ |
| 36 | + js/plugins.combined.min.js |
| 37 | + |
| 38 | +css/combined.css: $(CSS) |
| 39 | + cat $(CSS) > css/combined.css |
| 40 | + |
| 41 | +js/js2.combined.js: $(JS2) |
| 42 | + cat $(JS2) > js/js2.combined.js |
| 43 | + |
| 44 | +js/plugins.combined.js: $(PLUGINS) |
| 45 | + cat $(PLUGINS) > js/plugins.combined.js |
| 46 | + |
41 | 47 | js/js2.combined.min.js : js/js2.combined.js |
42 | 48 | jsmin < js/js2.combined.js > js/js2.combined.min.js |
43 | 49 | |