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
// ----------------------------------------------------------------- | |
// To be added to CmdUtils API | |
// ----------------------------------------------------------------- | |
// ** {{{ CmdUtils.getUbiquity( ) }}} ** | |
// | |
// Get a reference to Ubiquity. This is used by | |
// {{{ CmdUtils.closeUbiquity() }}} and {{{ CmdUtils.getCommandByName() }}}, but | |
// probably doesn't need to be used directly by command feeds. | |
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(jQuery){ | |
// This shortTermMemory will contain the last parsed simple selector. | |
// To be usefull it needs to be accessed faster than it would take to re-parse the selector. | |
// Selectors are to complex to serve as keys of a hash, and a bi-dimensional array would be too slow. | |
// I'm wondering if .data() would be fast enough for that purpose. | |
var shortTermMemory = []; | |
jQuery.fn.extend({ | |
closest: function( selector, context ) { |
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(jQuery){ | |
var parsedCache = [], | |
_filter = jQuery.filter; | |
jQuery.filter = jQuery.multiFilter = function( expr, elems, not ) { | |
var parsed = [], split, re, matches = [], match, l, i; | |
// We are looking for simple selectors of the form "div", ".class" or "div.class" | |
// We'll try to minimize the extra-processing for complex selectors | |
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 http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<title>Over and Out test page</title> | |
<link rel="stylesheet" type="text/css" media="all" href="shCore.css" /> | |
<link rel="stylesheet" type="text/css" media="all" href="shThemeFadeToGrey.css" /> | |
<style> | |
.deco { | |
padding: 5px; |
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
Index: event.js | |
=================================================================== | |
--- event.js (revision 6582) | |
+++ event.js (working copy) | |
@@ -7,7 +7,7 @@ | |
// Bind an event to an element | |
// Original by Dean Edwards | |
- add: function( elem, types, handler, data ) { | |
+ add: function( elem, types, handler, data, noSpecial ) { |
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 http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<title>Bubbling test</title> | |
<style> | |
.test li { | |
margin-left: 3em; | |
width: 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
var | |
abs = Math.abs, | |
sqrt = Math.sqrt, | |
floor = Math.floor, | |
min = Math.min, | |
V3 = function(x, y, z) { | |
this.x = x; | |
this.y = y; | |
this.z = z; |
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
// Minimalist class (className) manipulation library | |
var klass = { | |
has: function(elem, name) { | |
return (' '+elem.className+' ').indexOf(' '+name+' ') != -1; | |
}, | |
add: function(elem, name) { | |
if(!klass.has(elem, name)) { | |
elem.className += ' '+name; | |
} | |
}, |
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 div = document.createElement('div'), | |
divStyle = div.style, | |
support = $.support, | |
rmatrixFilter = /M\d{2}=([\d+.\-]+)/g; | |
support.transform = | |
divStyle.MozTransform === ''? 'MozTransform' : | |
(divStyle.WebkitTransform === ''? 'WebkitTransform' : |
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
/* | |
* margin-top or marginTop? | |
* When to use lower-case and camel-case property names in JavaScript. | |
*/ | |
// Setting style: camel-case | |
elem.style.marginTop = '10px'; | |
// Getting style: camel-case | |
var value = elem.style.marginTop; |
OlderNewer