Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.hooks.php |
— | — | @@ -16,14 +16,14 @@ |
17 | 17 | array( 'src' => 'Modules/Preview/Preview.js', 'version' => 6 ), |
18 | 18 | array( 'src' => 'Modules/Publish/Publish.js', 'version' => 6 ), |
19 | 19 | array( 'src' => 'Modules/Toc/Toc.js', 'version' => 7 ), |
20 | | - array( 'src' => 'Modules/Toolbar/Toolbar.js', 'version' => 39 ), |
| 20 | + array( 'src' => 'Modules/Toolbar/Toolbar.js', 'version' => 40 ), |
21 | 21 | array( 'src' => 'Modules/TemplateEditor/TemplateEditor.js', 'version' => 4 ), |
22 | 22 | ), |
23 | 23 | 'combined' => array( |
24 | | - array( 'src' => 'WikiEditor.combined.js', 'version' => 41 ), |
| 24 | + array( 'src' => 'WikiEditor.combined.js', 'version' => 42 ), |
25 | 25 | ), |
26 | 26 | 'minified' => array( |
27 | | - array( 'src' => 'WikiEditor.combined.min.js', 'version' => 41 ), |
| 27 | + array( 'src' => 'WikiEditor.combined.min.js', 'version' => 42 ), |
28 | 28 | ), |
29 | 29 | ); |
30 | 30 | static $messages = array( |
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.js |
— | — | @@ -1184,13 +1184,16 @@ |
1185 | 1185 | buttons: { |
1186 | 1186 | 'wikieditor-toolbar-tool-link-insert': function() { |
1187 | 1187 | function escapeInternalText( s ) { |
| 1188 | + // FIXME: Should this escape [[ too? Seems to work without that |
1188 | 1189 | return s.replace( /(]{2,})/g, '<nowiki>$1</nowiki>' ); |
1189 | 1190 | } |
1190 | 1191 | function escapeExternalTarget( s ) { |
1191 | 1192 | return s.replace( / /g, '%20' ) |
| 1193 | + .replace( /\[/g, '%5B' ) |
1192 | 1194 | .replace( /]/g, '%5D' ); |
1193 | 1195 | } |
1194 | 1196 | function escapeExternalText( s ) { |
| 1197 | + // FIXME: Should this escape [ too? Seems to work without that |
1195 | 1198 | return s.replace( /(]+)/g, '<nowiki>$1</nowiki>' ); |
1196 | 1199 | } |
1197 | 1200 | var insertText = ''; |
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.min.js |
— | — | @@ -54,7 +54,7 @@ |
55 | 55 | var cache=$j(this).data('suggcache');if(typeof cache[title]!='undefined'){$j(this).suggestions('suggestions',cache[title]);return;} |
56 | 56 | var request=$j.ajax({url:wgScriptPath+'/api.php',data:{'action':'opensearch','search':title,'namespace':0,'suggest':'','format':'json'},dataType:'json',success:function(data){cache[title]=data[1];$j(that).suggestions('suggestions',data[1]);}});$j(this).data('request',request);},cancel:function(){var request=$j(this).data('request');if(request) |
57 | 57 | request.abort();}});},dialog:{width:500,dialogClass:'wikiEditor-toolbar-dialog',buttons:{'wikieditor-toolbar-tool-link-insert':function(){function escapeInternalText(s){return s.replace(/(]{2,})/g,'<nowiki>$1</nowiki>');} |
58 | | -function escapeExternalTarget(s){return s.replace(/ /g,'%20').replace(/]/g,'%5D');} |
| 58 | +function escapeExternalTarget(s){return s.replace(/ /g,'%20').replace(/\[/g,'%5B').replace(/]/g,'%5D');} |
59 | 59 | function escapeExternalText(s){return s.replace(/(]+)/g,'<nowiki>$1</nowiki>');} |
60 | 60 | var insertText='';var whitespace=$j('#wikieditor-toolbar-link-dialog').data('whitespace');var target=$j('#wikieditor-toolbar-link-int-target').val();var text=$j('#wikieditor-toolbar-link-int-text').val();var u=mw.usability;if(target==''){alert(u.getMsg('wikieditor-toolbar-tool-link-empty'));return;} |
61 | 61 | if($j.trim(text)==''){text='';} |
Index: trunk/extensions/UsabilityInitiative/WikiEditor/Modules/Toolbar/Toolbar.js |
— | — | @@ -1135,13 +1135,16 @@ |
1136 | 1136 | buttons: { |
1137 | 1137 | 'wikieditor-toolbar-tool-link-insert': function() { |
1138 | 1138 | function escapeInternalText( s ) { |
| 1139 | + // FIXME: Should this escape [[ too? Seems to work without that |
1139 | 1140 | return s.replace( /(]{2,})/g, '<nowiki>$1</nowiki>' ); |
1140 | 1141 | } |
1141 | 1142 | function escapeExternalTarget( s ) { |
1142 | 1143 | return s.replace( / /g, '%20' ) |
| 1144 | + .replace( /\[/g, '%5B' ) |
1143 | 1145 | .replace( /]/g, '%5D' ); |
1144 | 1146 | } |
1145 | 1147 | function escapeExternalText( s ) { |
| 1148 | + // FIXME: Should this escape [ too? Seems to work without that |
1146 | 1149 | return s.replace( /(]+)/g, '<nowiki>$1</nowiki>' ); |
1147 | 1150 | } |
1148 | 1151 | var insertText = ''; |