This file contains hidden or 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 EventUtil = { | |
addHandler: function(element, type, handler) { | |
if (element.addEventListener) { | |
element.addEventListener(type, handler, false); | |
} else if (element.attachEvent) { | |
element.attachEvent("on" + type, handler); | |
} else { | |
element["on" + type] = handler; | |
} | |
}, |
This file contains hidden or 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
// create a one-time event | |
function onetime(node, type, callback) { | |
// create event | |
node.addEventListener(type, function(e) { | |
// remove event | |
e.target.removeEventListener(e.type, arguments.callee); | |
// call handler | |
return callback(e); | |
}); |
This file contains hidden or 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
// Avoid `console` errors in browsers that lack a console. | |
// via http://django.is/ | |
(function() { | |
var method; | |
var noop = function () {}; | |
var methods = [ | |
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', | |
'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', | |
'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd', | |
'timeStamp', 'trace', 'warn' |
This file contains hidden or 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
'use strict'; | |
const | |
fs = require('fs'), | |
spawn = require('child_process').spawn; | |
fs.watch(filename, function(){ | |
let ls = spawn('ls', ['-lh', filename]); | |
ls.stdout.pipe(process.stdout); | |
}); |
This file contains hidden or 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 grunt = require('grunt'); | |
var path = require('path'); | |
var ncp = require('ncp').ncp; | |
//grunt.file.copy(path.normalize(__dirname + '/tasks/copy_all_docs.js'), path.normalize(__dirname + '/tasks2/copy_all_docs.js')); | |
grunt.file.mkdir(path.normalize(__dirname + '/.tmp/docs/rp1')); | |
ncp(path.normalize(__dirname + '/test/fixtures/repos/rp1/docs'), '.tmp/docs/rp1', function(err) { | |
if (err) { | |
return console.error(err); |
This file contains hidden or 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
/* | |
* grunt-copy-all-docs | |
* | |
*/ | |
'use strict'; | |
module.exports = function(grunt) { | |
var fs = require('fs'), |
This file contains hidden or 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
'use strict'; | |
var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet; | |
var proxySnippet = require('grunt-connect-proxy/lib/utils').proxyRequest; | |
var path = require('path'); | |
var mountFolder = function(connect, dir) { | |
return connect.static(require('path').resolve(dir)); | |
}; | |
module.exports = function(grunt) { | |
// load all grunt tasks |
This file contains hidden or 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
<input type="file" name="image" accept="image/*" capture> |
This file contains hidden or 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
describe('myDir directive', function () { | |
var element, scope; | |
beforeEach(module('myDirModule')); | |
beforeEach(inject(function ($compile, $rootScope) { | |
var linkingFn = $compile('<my-dir></my-dir>'); | |
scope = $rootScope; | |
element = linkingFn(scope); | |
})); |
This file contains hidden or 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 setEqualHeight = function(){ | |
"use strict"; | |
function init(){ | |
var obj = $(".setEqualHeight"); | |
obj.each(function(){ | |
var $that = $(this), | |
itemToSetHeight = $that.attr('data-itemToSetHeight'), | |
elementsToCompare = $that.attr('data-elementsToCompare'); |