Index: trunk/tools/bookmarklets/bookmarklets.html |
— | — | @@ -1,4 +1,4 @@ |
2 | 2 | <h1>Handy bookmarklets</h1> |
3 | 3 | <ul> |
4 | | -<li><a href="javascript:function swapUrl(base) { var specials = "meta|commons|office|internal|collab"; if (base[4] == 's') { base = base.replace( /^https:\/\/secure\.wikimedia\.org\/(.*?)\/(.*?)\/(.*)$/, "http://$2.$1.org/$3"); base = base.replace( "http://mediawiki.wikipedia", "http://www.mediawiki"); base = base.replace( new RegExp("^http:\/\/(" + specials + ")\.wikipedia"), "http://$1.wikimedia"); } else { base = base.replace( "http://www.mediawiki", "http://mediawiki.wikipedia"); base = base.replace( new RegExp("^http:\/\/(" + specials + ")\.wikimedia"), "http://$1.wikipedia"); base = base.replace( /^http:\/\/(.*?)\.(.*?)\.org\/(.*)$/, "https://secure.wikimedia.org/$2/$1/$3"); } return base; } document.location=swapUrl(document.location.toString());">secure-switch</a></li> |
| 4 | +<li><a href="javascript:function swapUrl(base) { var specials = "meta|commons|office|internal|collab|usability"; if (base[4] == 's') { base = base.replace( /^https:\/\/secure\.wikimedia\.org\/(.*?)\/(.*?)\/(.*)$/, "http://$2.$1.org/$3"); base = base.replace( "http://mediawiki.wikipedia", "http://www.mediawiki"); base = base.replace( new RegExp("^http:\/\/(" + specials + ")\.wikipedia"), "http://$1.wikimedia"); } else { base = base.replace( "http://www.mediawiki", "http://mediawiki.wikipedia"); base = base.replace( new RegExp("^http:\/\/(" + specials + ")\.wikimedia"), "http://$1.wikipedia"); base = base.replace( /^http:\/\/(.*?)\.(.*?)\.org\/(.*)$/, "https://secure.wikimedia.org/$2/$1/$3"); } return base; } document.location=swapUrl(document.location.toString());">secure-switch</a></li> |
5 | 5 | </ul> |
Index: trunk/tools/bookmarklets/secure-switch.js |
— | — | @@ -1,5 +1,5 @@ |
2 | 2 | function swapUrl(base) { |
3 | | - var specials = "meta|commons|office|internal|collab"; |
| 3 | + var specials = "meta|commons|office|internal|collab|usability"; |
4 | 4 | if (base[4] == 's') { |
5 | 5 | base = base.replace( |
6 | 6 | /^https:\/\/secure\.wikimedia\.org\/(.*?)\/(.*?)\/(.*)$/, |