-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from shawnbot/v2
merge v2
- Loading branch information
Showing
36 changed files
with
2,933 additions
and
1,386 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*.sw? | ||
node_modules | ||
.DS_Store |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
[submodule "js/es5-shim"] | ||
path = js/es5-shim | ||
url = https://github.com/es-shims/es5-shim.git | ||
[submodule "css/pie"] | ||
path = css/pie | ||
url = https://github.com/lojjic/PIE.git | ||
[submodule "js/classList"] | ||
path = js/classList | ||
url = https://github.com/eligrey/classList.js.git | ||
[submodule "lib/ie8"] | ||
path = lib/ie8 | ||
url = [email protected]:shawnbot/ie8.git | ||
[submodule "lib/dom4"] | ||
path = lib/dom4 | ||
url = [email protected]:shawnbot/dom4.git | ||
[submodule "lib/es5-shim"] | ||
path = lib/es5-shim | ||
url = [email protected]:es-shims/es5-shim.git | ||
[submodule "lib/html5shiv"] | ||
path = lib/html5shiv | ||
url = https://github.com/aFarkas/html5shiv.git |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
language: node_js | ||
node_js: | ||
- '0.10' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ui: qunit | ||
browsers: | ||
- name: ie | ||
version: 8..9 |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,27 @@ | ||
JS_FILES = \ | ||
js/aight.js \ | ||
js/classList/classList.js \ | ||
js/es5-shim/es5-shim.js \ | ||
js/computed-style.js \ | ||
js/css-properties.js \ | ||
js/element-createElementNS.js \ | ||
js/element-events.js \ | ||
js/element-properties.js | ||
src/start.js \ | ||
lib/es5-shim/es5-shim.js \ | ||
lib/es5-shim/es5-sham.js \ | ||
src/aight.js \ | ||
src/before-ie8.js \ | ||
lib/ie8/src/ie8.js \ | ||
src/after-ie8.js \ | ||
lib/dom4/src/dom4.js \ | ||
lib/html5shiv/src/html5shiv.js \ | ||
src/css-om.js \ | ||
src/createElementNS.js \ | ||
src/end.js | ||
|
||
JS_COMPILER ?= uglifyjs | ||
|
||
all: aight.js aight.min.js aight.d3.min.js | ||
|
||
clean: | ||
rm -f aight.js aight.min.js | ||
all: aight.js aight.min.js | ||
# TODO aight.d3.min.js | ||
|
||
aight.js: $(JS_FILES) | ||
cat $(JS_FILES) > $@ | ||
|
||
%.min.js: %.js | ||
$(JS_COMPILER) $< > $@ | ||
|
||
clean: | ||
rm -f aight.js aight.min.js |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,68 @@ | ||
(function(exports) { | ||
|
||
aight.d3 = {}; | ||
|
||
if (aight.browser.ie8) { | ||
function mapped(property, format, parse) { | ||
var read = function(p) { | ||
var value = this.node().style[property]; | ||
return parse | ||
? parse.call(this, value, p) | ||
: value; | ||
}, | ||
write = function(p, value) { | ||
return this.each(function() { | ||
var v = (typeof value === "function") | ||
? value.apply(this, arguments) | ||
: value; | ||
this.style[property] = format | ||
? format.call(this, v, p) | ||
: v; | ||
}); | ||
}; | ||
return function() { | ||
return arguments.length > 1 | ||
? write.apply(this, arguments) | ||
: read.call(this); | ||
}; | ||
} | ||
|
||
var aight_d3_style = { | ||
"background-image": mapped("backgroundImage"), | ||
"background-repeat": mapped("backgroundRepeat"), | ||
"background-position": mapped("backgroundPosition"), | ||
"background-color": mapped("backgroundColor"), | ||
|
||
"opacity": mapped("filter", | ||
function opacity_to_filter(opacity) { | ||
return ["alpha(opacity=", Math.round(opacity * 100), ")"].join(""); | ||
}, | ||
function filter_to_opacity(filter) { | ||
var opacity = (filter || "").match(/opacity=(\d+)/)[1] || 100; | ||
return opacity / 100; | ||
}) | ||
}; | ||
|
||
aight.d3.style = aight_d3_style; | ||
aight.d3 = {}; | ||
|
||
var d3_style = d3.selection.prototype.style; | ||
d3.selection.prototype.style = function(prop) { | ||
var style = aight_d3_style.hasOwnProperty(prop) | ||
? aight_d3_style[prop] | ||
: d3_style; | ||
return style.apply(this, arguments); | ||
if (aight.browser.ie8) { | ||
function mappedProperty(property, format, parse) { | ||
var read = function(p) { | ||
var value = this.node().style[property]; | ||
return parse | ||
? parse.call(this, value, p) | ||
: value; | ||
}, | ||
write = function(p, value) { | ||
if (value === null) { | ||
return this.style(property, null); | ||
} | ||
return this.each(function() { | ||
var v = (typeof value === "function") | ||
? value.apply(this, arguments) | ||
: value; | ||
if (v === null) { | ||
this.style.removeProperty(property); | ||
} else { | ||
this.style[property] = format | ||
? format.call(this, v, p) | ||
: v; | ||
} | ||
}); | ||
}; | ||
return function() { | ||
return arguments.length > 1 | ||
? write.apply(this, arguments) | ||
: read.call(this); | ||
}; | ||
} | ||
|
||
var aight_d3_style = { | ||
// background styles need to be mapped explicitly | ||
"background-image": mappedProperty("backgroundImage"), | ||
"background-repeat": mappedProperty("backgroundRepeat"), | ||
"background-position": mappedProperty("backgroundPosition"), | ||
"background-color": mappedProperty("backgroundColor"), | ||
|
||
"opacity": mappedProperty("filter", | ||
function opacity_to_filter(opacity) { | ||
return isNaN(opacity) | ||
? null | ||
: ["alpha(opacity=", Math.round(opacity * 100), ")"].join(""); | ||
}, | ||
function filter_to_opacity(filter) { | ||
var match = (filter || "").match(/alpha\(opacity=(\d+)\)/); | ||
return match ? match[1] / 100 : 1; | ||
}) | ||
}; | ||
|
||
aight.d3.style = aight_d3_style; | ||
|
||
var d3_style = d3.selection.prototype.style; | ||
d3.selection.prototype.style = function(prop) { | ||
var style = aight_d3_style.hasOwnProperty(prop) | ||
? aight_d3_style[prop] | ||
: d3_style; | ||
return style.apply(this, arguments); | ||
}; | ||
|
||
} | ||
|
||
})(this); |
Oops, something went wrong.