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
var NS = NS || {}; | |
/* | |
requires | |
- underscore js | |
- external event subscriber | |
- external AJAX Hanlder | |
*/ | |
NS.infiniteScroll = function (target,callback) { |
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
function eliminateDuplicates(arr) { | |
var i, | |
len=arr.length, | |
out=[], | |
obj={}; | |
for (i=0;i<len;i++) { | |
obj[arr[i]]=0; | |
} | |
for (i in obj) { |
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
var SDM = SDM || {}; | |
SDM.track = function (args) { | |
args = args || {}; | |
var category = args.category, | |
action = args.action, | |
label = args.label, | |
value = args.value || null; |
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
fireAJAXRequest = function(method, url, async, callback) { | |
var httpRequest, | |
start= new Date().getTime(), | |
end; | |
if (window.XMLHttpRequest) { | |
httpRequest = new XMLHttpRequest(); | |
} else if (window.ActiveXObject) { | |
// Internet Explorer is stupid | |
httpRequest = new ActiveXObject("Microsoft.XMLHTTP"); |
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
var track = function (args) { | |
args = args || {}; | |
var category = args.category, | |
action = args.action, | |
label = args.label, | |
value = args.value || null; | |
if (_gaq) { | |
_gaq.push(['_trackEvent', category, action, label, value]); |
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
function getParameterByName(name) | |
{ | |
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); | |
var regexS = "[\\?&]" + name + "=([^&#]*)"; | |
var regex = new RegExp(regexS); | |
var results = regex.exec(window.location.search); | |
if(results == null) | |
return ""; | |
else | |
return decodeURIComponent(results[1].replace(/\+/g, " ")); |
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
<h2>Tabs</h2> | |
<ul id="tab_list"> | |
<li><a href="#tab01">tab 01</a></li> | |
<li><a href="#tab02">tab 02</a></li> | |
<li><a href="#tab03">tab 03</a></li> | |
</ul> | |
<div id="tab_content_container"> | |
<div id="tab01" class="tab_content"> | |
<h1>tab 01</h1> | |
<br> |
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
var input = '<iframe width="560" height="315" src="http://www.youtube.com/embed/_QtoHqZPkk0" frameborder="0" allowfullscreen></iframe>', | |
rawurl = new String(input).match(/src=["']?((?:.(?!["']?\s+(?:\S+)=|[>"']))+.)["']?/)[1]; |
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
fileUploadPreview = function () { | |
var self = this, | |
uploader = document.getElementById("files"), | |
output = document.getElementById('preview_image'), | |
initialise = function() { | |
uploader.addEventListener('change', handleFileSelect, false); |
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
<body> | |
<a href="#linkToTsnCs" class="showTerms">terms & conditions</a> | |
<body> |