Index: trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.js |
— | — | @@ -779,11 +779,14 @@ |
780 | 780 | init: function() { |
781 | 781 | function isExternalLink( s ) { |
782 | 782 | // The following things are considered to be external links: |
783 | | - // * Starts with one or more letters followed by :// |
| 783 | + // * Starts a URL protocol |
784 | 784 | // * Starts with www. |
785 | 785 | // * Ends with a . followed by two or more letters |
786 | 786 | // * Contains a . followed by two or more letters followed by / |
787 | | - return s.match( /(^[a-z]+:\/\/)|(^www\.)|([^.]\.[a-z]{2,}($|\/))/i ); |
| 787 | + if ( typeof arguments.callee.regex == 'undefined' ) |
| 788 | + // Cache the regex |
| 789 | + arguments.callee.regex = new RegExp( "(^(" + urlprotocols + "))|(^www\\.)|([^.]\\.[a-z]{2,}($|\\/))", 'i'); |
| 790 | + return s.match( arguments.callee.regex ); |
788 | 791 | } |
789 | 792 | // Updates the UI to show if the page title being inputed by the user exists or not |
790 | 793 | function updateExistence() { |
Index: trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.php |
— | — | @@ -19,7 +19,7 @@ |
20 | 20 | /* Configuration */ |
21 | 21 | |
22 | 22 | // Bump the version number every time you change any of the .css/.js files |
23 | | -$wgEditToolbarStyleVersion = 60; |
| 23 | +$wgEditToolbarStyleVersion = 61; |
24 | 24 | |
25 | 25 | // Set this to true to simply override the stock toolbar for everyone |
26 | 26 | $wgEditToolbarGlobalEnable = false; |