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 isAnimatedGif(src, cb) { | |
var request = new XMLHttpRequest(); | |
request.open('GET', src, true); | |
request.responseType = 'arraybuffer'; | |
request.addEventListener('load', function () { | |
var arr = new Uint8Array(request.response), | |
i, len, length = arr.length, frames = 0; | |
// make sure it's a gif (GIF8) | |
if (arr[0] !== 0x47 || arr[1] !== 0x49 || |
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
TEXT_DISPLAY_TIME = 10000 | |
delay = (ms, fn) -> setTimeout fn, ms | |
class NoContexts | |
constructor: -> | |
@next() | |
refreshData: (cb) -> | |
@noContexts = [] |
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
// @author Rob W http://stackoverflow.com/users/938089/rob-w | |
// @name getTextBoundingRect | |
// @param input Required HTMLElement with `value` attribute | |
// @param selectionStart Optional number: Start offset. Default 0 | |
// @param selectionEnd Optional number: End offset. Default selectionStart | |
// @param debug Optional boolean. If true, the created test layer | |
// will not be removed. | |
function getTextBoundingRect(input, selectionStart, selectionEnd, debug) { | |
// Basic parameter validation | |
if(!input || !('value' in input)) return input; |
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
$ make test | |
NODE_PATH="`pwd`:" ./node_modules/.bin/mocha test/specs | tee test/results/tests.log | |
path.existsSync is now called `fs.existsSync`. | |
mocha example (using framework) | |
Array | |
#indexOf() | |
✓ should return -1 when the value is not present |
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 importNode(node, allChildren, doc) { | |
var a, i, il; | |
doc = doc || document; | |
try { | |
return doc.importNode(node, allChildren); | |
} catch (e) { | |
switch (node.nodeType) { | |
case document.ELEMENT_NODE: | |
var newNode = doc.createElementNS(node.namespaceURI, node.nodeName); | |
if (node.attributes && node.attributes.length > 0) { |
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> | |
<meta charset="utf-8"> | |
<title>Demo</title> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | |
<script src="CSSMatrix.js"></script> | |
<style> | |
body { | |
background-color: #282828; |
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
/* ... */ | |
.page-transitions .page-layer { | |
/* cheating a bit and adding a transition to "all" properties */ | |
transition: all 0.3s; | |
} | |
.page-layer:first-child, | |
.page-exploded .page-layer { | |
background: rgba(255,255,255,0.03); |
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 Page($el) { | |
// we need a new variable to determine if we should use | |
// 3d or 2d mode | |
var affine = !browserSupports3dTransforms(); | |
/* ... */ | |
// small changes to updateLayers and applyTransform | |
updateLayers = function () { | |
// detect if the page is flipped backwards |
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 ($) { | |
"use strict"; | |
if (window.XDomainRequest) { | |
$.ajaxTransport(function(s) { | |
if (s.crossDomain && s.async) { | |
if (s.timeout) { | |
s.xdrTimeout = s.timeout; | |
delete s.timeout; | |
} | |
var xdr; |
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
/* ... */ | |
.crocodoc-page-svg { | |
width: 100%; | |
height: 100%; | |
position: absolute; | |
top: 0; | |
left: 0; | |
} |
OlderNewer