This file contains 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
<script type="javascript"> | |
(function($){ | |
var params, source; | |
params = function(name) { | |
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); | |
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), | |
results = regex.exec(location.search); | |
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); | |
} | |
source = params('source') | |
if(source != '') | |
{ | |
$('a[href^="https://ti.to"]').each(function(index, item){ | |
url = $(item).attr('href') + '?source=' + source; | |
$(item).attr('href', url); | |
}) | |
} | |
})(jQuery) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Good stuff! Just tweaked the script to work with the new beta.tito.io link. Are you going to add a new gist? Cheers