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 (window, n) { | |
'use strict'; | |
var storage = window.localStorage; | |
var count = parseInt(storage.getItem('gkcounter'), 10) || 0; | |
if (count >= n) { | |
alert('Create a new instance of gesturekit'); | |
return; | |
} |
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
<!--[if lte IE 9]><script src="http://code.jquery.com/jquery-1.11.0.min.js"></script><![endif]--> | |
<!--[if gt IE 9]><!--><script src="http://cdnjs.cloudflare.com/ajax/libs/zepto/1.1.3/zepto.min.js"></script><!--<![endif]--> |
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
<!doctype html> | |
<!-- Conditional comment for mobile ie7 http://blogs.msdn.com/b/iemobile/ --> | |
<!--[if IEMobile 7 ]><html class="iem7"><![endif]--> | |
<!--[if IE 8]><html class="ie8 lt-ie10"><![endif]--> | |
<!--[if IE 9]><html class="ie9 lt-ie10"><![endif]--> | |
<!--[if gt IE 9]><!--><html><!--<![endif]--> |
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 fileInput = document.getElementById('file'); | |
fileInput.addEventListener('change', function () { | |
var img = document.createElement('img'); | |
img.width = "200"; | |
img.src = URL.createObjectURL(fileInput.files[0]); | |
document.body.appendChild(img); | |
}); |
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
// Ajax |
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 parseScript(code) { | |
var script = document.createElement('script'); | |
// script.insertAdjacentText('beforeend', code); Don't work on FF | |
script.innerHTML = code; | |
document.body.appendChild(script); | |
} |
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
<!-- content to be placed inside <body>…</body> --> |
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
/* | |
* Component | |
*/ | |
(function (win) { | |
'use strict'; | |
/** | |
* Component definition | |
*/ |
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="text/html" id="item_tmpl"> | |
<div id="<%=id%>" class="<%=(i % 2 == 1 ? " even" : "")%>"> | |
<div class="grid_1 alpha right"> | |
<img class="righted" src="<%=profile_image_url%>"/> | |
</div> | |
<div class="grid_6 omega contents"> | |
<p><b><a href="/<%=from_user%>"><%=from_user%></a>:</b> <%=text%></p> | |
</div> | |
</div> | |
</script> |
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
/** | |
* Singleton Pattern | |
*/ | |
function Singleton(options) { | |
if (!(this instanceof Singleton) && Singleton.getInstance === undefined) { | |
Singleton.getInstance = new Singleton(); | |
return Singleton.getInstance; | |
} |