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
/** | |
* KO: Collects and cache pointers to elements. | |
* @param {string|object} Binding value. | |
* @config {string} The pointer's id. | |
* @config {object} | |
* {obArray} [ob=pointers] | |
* Observable Array to store cache. | |
* {string} [id] The pointer's id. | |
* @example | |
* // View |
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
/** | |
* KO: Google Analytics data pusher. | |
* @param {array|object} Binding value. | |
* @config {array} GA track data. | |
* @config {object} | |
* {array} [track] GA track data. | |
* {string} [eventName='click'] Event name. | |
* @requires GA Tracker <ga.js> | |
* @example | |
* // View |
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> | |
<html> | |
<head> | |
<title>KnockoutJS Custom Binding: animation</title> | |
<style> | |
/* WARNING: Only webkit animation defined */ | |
@-webkit-keyframes zigzag { | |
0% { top: 0px; left: 0px; } | |
25% { top: 200px; left: 200px; } | |
50% { top: 0px; left: 400px; } |
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> | |
<html> | |
<head> | |
<title>KnockoutJS Custom Binding: transitions</title> | |
<style> | |
/* WARNING: Only webkit transition defined */ | |
.transitions { | |
position: absolute; | |
width: 200px; | |
height: 200px; |
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
/** | |
* Conditional Custom Events | |
* jQuery Plugin | |
* based on setInterval() | |
*/ | |
;(function ($, window, undefined) { | |
// Define conditional events | |
function defineCondEvents(element, events) { | |
var intervals = []; | |
var delay = 10; |
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
/** | |
* Prime numbers generator | |
* @constructor | |
*/ | |
function Prime() { | |
this.primes = [1]; | |
} | |
/** | |
* Test for primality |
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> | |
<html> | |
<head> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | |
<style> | |
.filename { width: 150px; margin: 5px 10px; padding: 5px 10px; border:1px solid #000; overflow: hidden; } | |
</style> | |
</head> | |
<body> |