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() { | |
var svgns = "http://www.w3.org/2000/svg"; | |
function forceTextWrappingOn(node, width) { | |
console.log(node); | |
var chars = node.firstChild.nodeValue.split(' '), | |
x = parseInt(node.getAttribute('x'), 10), | |
y = parseInt(node.getAttribute('y'), 10), | |
index = 0, | |
tspan, tspanWidth, textNode |
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(exports){ | |
// When the DOM is ready... | |
$(function(){ | |
// ...Find any elements that have a data-view attribute | |
$('[data-view]').each(function(){ | |
// Store a reference to the node and the data-view attribute value. | |
var $node = $(this), attr = $node.data('view'); | |
// Create an instance of a class with a name that matches the value of attr, | |
// pass the node as a parameter to the constructor, and then store the instance | |
// in the node's data hash. |
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
$.fn.alphabetize = function(options){ | |
var $list = this, | |
$item = this.children(); | |
options = options || {}; | |
$item.sort(function(a,b){ | |
var x = (options.on && $(a).find(options.on) || $(a)).text(), | |
y = (options.on && $(b).find(options.on) || $(b)).text(); |
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
/* `Utilities | |
/******************************/ | |
/* Gilder/Levin & Phark image replacement */ | |
a.ir, a.phark { cursor:pointer; text-decoration:none } | |
a.ir:active, a.phark:active { outline:0 } | |
.ir, .phark { display:block; position:relative; overflow:hidden } | |
.ir span { display:block; height:100%; width:100%; position:absolute; top:0; left:0; background:no-repeat 0 0 } | |
.phark{text-indent:-999em} |
NewerOlder