MediaWiki:Gadget-I18n-js.js: Difference between revisions

From Tardis Wiki, the free Doctor Who reference
no edit summary
(remove cache entries older than two days on start (don't need to worry about checking timestamp when loading cache any more))
No edit summary
Line 410: Line 410:
             // [url text] -> [$1 $2]
             // [url text] -> [$1 $2]
         var urlRgx = /\[((?:https?:)?\/\/.+?) (.+?)\]/g,
         var urlRgx = /\[((?:https?:)?\/\/.+?) (.+?)\]/g,
            // http(s)://foo.com
            httpRgx = /(\s*)(https?:\/\/[^\s]+)(\s*)/g,
             // [[pagename]] -> [[$1]]
             // [[pagename]] -> [[$1]]
             simplePageRgx = /\[\[([^|]*?)\]\]/g,
             simplePageRgx = /\[\[([^|]*?)\]\]/g,
Line 426: Line 428:
             .replace(urlRgx, function (_match, href, text) {
             .replace(urlRgx, function (_match, href, text) {
                 return makeLink(href, text, true);
                 return makeLink(href, text, true);
            })
            .replace(httpRgx, function (_match, before, href, after) {
                return before + makeLink(href, href, true) + after;
             })
             })
             .replace(simplePageRgx, function (_match, href) {
             .replace(simplePageRgx, function (_match, href) {
Cookies help us deliver our services. By using our services, you agree to our use of cookies.