Created
October 9, 2013 19:42
-
-
Save jdubwelch/6907067 to your computer and use it in GitHub Desktop.
IDX Bookmarklet to swap the URL from dev.lan to idxsandbox.com for easy environment switching.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript:(function(){var e=location.href;var t={sbx:"idxsandbox.com",dev:"dev.lan"};var n=e.match(t.sbx);var r=e.match(t.dev);if(n||r){var i,s;if(n){s=t.dev;i=t.sbx}else{i=t.dev;s=t.sbx}window.location=e.replace(i,s)}})() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript:(function(){ | |
| var href = location.href; | |
| var check = { | |
| sbx: 'idxsandbox.com', | |
| dev: 'dev.lan' | |
| }; | |
| var sbx = href.match(check.sbx); | |
| var dev = href.match(check.dev); | |
| if (sbx || dev) { | |
| var search, replace; | |
| if (sbx) { | |
| replace = check.dev; | |
| search = check.sbx; | |
| } | |
| else { | |
| search = check.dev; | |
| replace = check.sbx; | |
| } | |
| window.location = href.replace(search,replace); | |
| } | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment