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
{ | |
"name": "Test", | |
"version": "0.1", | |
"manifest_version": 2, | |
"description": "Test", | |
"permissions": [ | |
"history" | |
], | |
"background": { | |
"scripts": [ |
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
/** | |
* jQuery.readDataAttr | |
* | |
* Gets html5 data attributes without type coercion. | |
* If called with no parameters, returns an object with all | |
* current data-* values. | |
* | |
* @param {String} [key] Optional; if set, return only this | |
* value | |
* @return {*} Return either all values, or the value at key |
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
// inspired by: | |
// http://snipplr.com/view.php?codeview&id=15214 | |
(function ($) { | |
$.maxZ = function () { | |
var $all = $("body > *"); | |
return Math.max.apply(Math, $.map($all, function (el) { | |
var $el = $(el); | |
var z = 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
/** | |
* http://jsbin.com/opibuk/13/edit | |
*/ | |
(function (window) { | |
"use strict"; | |
// shortcuts | |
var location = window.location; | |
var setInterval = window.setInterval; |
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
/** | |
* ngbs.u.anchor - A URL parsing utility | |
*/ | |
/*global ngbs */ | |
var ngbs = ngbs || {}; | |
ngbs.u = ngbs.u || {}; | |
ngbs.u.anchor = (function (window, document, location) { | |
"use strict"; |
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
/** | |
* Anchor - A URL parsing utility | |
* | |
* Copyright 2012, Matthew Cobbs | |
* MIT licensed | |
* | |
* Methods: | |
* | |
* getSearchVars - returns a key-value object with the parameters in the URL search | |
* setSearchVars(o) - sets parameters using a key-value object in the URL search |
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
Copyright (c) 2011, Matthew Cobbs | |
Permission is hereby granted, free of charge, to any person obtaining | |
a copy of this software and associated documentation files (the | |
"Software"), to deal in the Software without restriction, including | |
without limitation the rights to use, copy, modify, merge, publish, | |
distribute, sublicense, and/or sell copies of the Software, and to | |
permit persons to whom the Software is furnished to do so, subject to | |
the following conditions: |
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
/* | |
* This has essentially turned into Resig's Simple JavaScript Inheritance | |
* with some minor modifications for class names and use strict, | |
* and getters ans setters | |
* http://ejohn.org/blog/simple-javascript-inheritance/ | |
* http://ejohn.org/blog/javascript-getters-and-setters/ | |
*/ | |
(function (window) { | |
"use strict"; |
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 list = "me.jpg,me.png,me.txt,me.zip,me.apple".split(","); | |
var re = /.+\.(?!jpg|jpeg|gif|png)/i; | |
list.forEach(function (v, i) { | |
console.log(v, re.test(v)); | |
}); |
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 Node ( val, parent ) { | |
this.value = val; | |
this.setParent( parent ); | |
this.children = []; | |
} | |
Node.prototype = { | |
addChild: function ( val ) { | |
var node = val instanceof Node ? val : new Node( val ); | |
node.setParent( this ); |