Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2 #38

Merged
merged 69 commits into from
Jan 26, 2015
Merged

v2 #38

Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
07ce28c
clean up template
shawnbot Sep 11, 2014
799a734
add ie8 and dom4 submodules
shawnbot Sep 11, 2014
56d2c48
remove the old shims/shams/polyfills
shawnbot Sep 11, 2014
d633a0c
add back es5-shim
shawnbot Sep 11, 2014
6f775b1
rename js -> src
shawnbot Sep 11, 2014
27b1fff
source files
shawnbot Sep 13, 2014
89fa10e
CSS OM patches
shawnbot Sep 13, 2014
d6dcb92
tweaked template
shawnbot Sep 13, 2014
4f2fa8c
the old createElementNS()
shawnbot Sep 13, 2014
1357114
CSS OM patches
shawnbot Sep 13, 2014
fa16e42
with new polyfills and patches
shawnbot Sep 13, 2014
584e04d
better opacity shim, null values remove mapped CSS properties
shawnbot Sep 13, 2014
1e7473c
v2.0.0
shawnbot Sep 13, 2014
d03a657
first 2.0.0 build
shawnbot Sep 13, 2014
f24077d
move d3.html from examples/ to test/, tweak
shawnbot Sep 13, 2014
bda59aa
initial unit tests with QUnit
shawnbot Sep 13, 2014
5e9f2e2
latest es5-shim
shawnbot Sep 19, 2014
ef8b0e4
latest ie8, per #38
shawnbot Sep 19, 2014
d35fc43
some basic jQuery tests
Nov 21, 2014
e453924
ignore stuff
Jan 14, 2015
f2e0d09
update dom4 to v1.2.1
Jan 16, 2015
2e758cb
update ie8 to v0.2.3
Jan 16, 2015
9b3282a
new build
Jan 21, 2015
3be4fbf
accommodate IE9's Document, AKA HTMLDocument
Jan 21, 2015
a3d20e4
export aight to window the right way
Jan 21, 2015
26a1cc0
add inexorabletash/polyfill shims
Jan 21, 2015
649838e
flesh out classList tests, make it work with zuul
Jan 21, 2015
6945e19
no h1
Jan 21, 2015
7e43c15
patch ie8.js for zuul
Jan 21, 2015
52daa6c
ignore patched ie8.js
Jan 21, 2015
3145751
include es5-sham.js
Jan 21, 2015
2e7b924
new build
Jan 21, 2015
c16a181
zuul configuration
Jan 21, 2015
bc948bb
we have npm
Jan 21, 2015
778ce0c
now with html5shiv
Jan 21, 2015
ca0416f
add watch scripts
Jan 26, 2015
72e29b3
move es5-shim down
Jan 26, 2015
7d2ab2c
remove css/pie submodule
Jan 26, 2015
1f08811
jump through some hoops for zuul
Jan 26, 2015
786288a
export the right way for zuul
Jan 26, 2015
aff414f
don't monkeypatch ie8.js
Jan 26, 2015
7488588
do exports right for zuul
Jan 26, 2015
89073ba
alias some DOM interfaces for IE9
Jan 26, 2015
d1f97bf
assume that the HTMLDocument interface exists
Jan 26, 2015
81b173c
new build
Jan 26, 2015
c8850fc
ditch inexorabletash/polyfill
Jan 26, 2015
93b4604
use my forks of ie8 and dom4 for now
Jan 26, 2015
1a146d4
use my ie9 branch
Jan 26, 2015
4f1ad62
don't ignore /src/ie8.js anymore
Jan 26, 2015
f5b65e9
fix createElementNS() shim
Jan 26, 2015
d670123
add createElementNS() test
Jan 26, 2015
c9b0c18
new build
Jan 26, 2015
cafdbc5
new commits
Jan 26, 2015
58721c1
Merge pull request #47 from shawnbot/zuul
shawnbot Jan 26, 2015
16cac56
ditch lib/polyfill
Jan 26, 2015
fb45807
update README and template to deal with IE9
Jan 26, 2015
1152dfc
pre- and post-ie8.js bits
Jan 26, 2015
1b08341
wrap ie8.js in IE8 conditional
Jan 26, 2015
dc38e4c
new build
Jan 26, 2015
50fa127
use master branch for ie8
Jan 26, 2015
e8f6930
new build
Jan 26, 2015
0745f65
add some keywords
Jan 26, 2015
a83e001
Merge pull request #48 from shawnbot/simpler-ie9-support
shawnbot Jan 26, 2015
f6bb2b7
new commits for ie8
Jan 26, 2015
14ed9ef
travis config w/encrypted sauce creds
Jan 26, 2015
f303af0
remove encrypted sauce creds from .travis.yml
Jan 26, 2015
7284c57
new commits for ie8.js
Jan 26, 2015
60bc7fe
update LICENSE with ie8 and dom4
Jan 26, 2015
9bd6758
downgrade to v2.0.0a
Jan 26, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions .gitmodules
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 = git@github.com:WebReflection/ie8.git
[submodule "lib/dom4"]
path = lib/dom4
url = git@github.com:WebReflection/dom4.git
[submodule "lib/es5-shim"]
path = lib/es5-shim
url = git@github.com:es-shims/es5-shim.git
19 changes: 10 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
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 \
src/aight.js \
lib/ie8/src/ie8.js \
lib/dom4/src/dom4.js \
lib/es5-shim/es5-shim.js \
src/createElementNS.js \
src/css-om.js \
src/end.js

JS_COMPILER ?= uglifyjs

all: aight.js aight.min.js aight.d3.min.js
all: aight.js aight.min.js
# XXX aight.d3.min.js

clean:
rm -f aight.js aight.min.js
Expand Down
111 changes: 61 additions & 50 deletions aight.d3.js
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);
Loading