Skip to content
This repository has been archived by the owner on Apr 15, 2022. It is now read-only.

Commit

Permalink
using tiny-cdn. Fixed jshint gotchas
Browse files Browse the repository at this point in the history
  • Loading branch information
WebReflection committed Mar 10, 2016
1 parent ffcdbaa commit 1419934
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 18 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ build:
# make node
# make amd
# make test
# make hint
make hint
make size

# build generic version
Expand Down Expand Up @@ -66,9 +66,9 @@ clean:
test:
npm test

# launch polpetta (ctrl+click to open the page)
# launch tiny-cdn (ctrl+click to open the page)
web:
node node_modules/polpetta/build/polpetta ./
./node_modules/.bin/tiny-cdn run ./

# markdown the readme and view it
preview:
Expand Down Expand Up @@ -103,7 +103,7 @@ dependencies:
rm -rf node_modules
mkdir node_modules
npm install wru
npm install polpetta
npm install tiny-cdn
npm install uglify-js@1
npm install jshint
npm install markdown
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The file can be either the [full version](build/ie8.max.js) or [the minified one
It is now possible to include this file through [cdnjs](http://www.cdnjs.com)
```html
<!--[if IE 8]><script
src="//cdnjs.cloudflare.com/ajax/libs/ie8/0.3.2/ie8.js"
src="//cdnjs.cloudflare.com/ajax/libs/ie8/0.3.3/ie8.js"
></script><![endif]-->
```

Expand All @@ -46,6 +46,12 @@ This polyfill normalize the [EventTarget interface](http://www.w3.org/TR/DOM-Lev
This shim normalizes the DOM Level 2 [Event interface](http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-interface) too, adding an **extra** DOM Level 3 [.stopImmediatePropagation()](http://www.w3.org/TR/DOM-Level-3-Events/#events-event-type-stopImmediatePropagation) as bonus.


#### W3C DOM Level.next
If you'd like to upgrade even more IE8 capabilities, consider adding [dom4](https://github.com/WebReflection/dom4#dom4) polyfills **after** `ie8.js` file.

That would provide enough horse-powers to hazard [CustomElement](https://github.com/WebReflection/document-register-element#document-register-element) polyfill on top.


### known gotchas
Here a humble list of things what won't probably ever be fixed in IE8

Expand Down
2 changes: 1 addition & 1 deletion build/ie8.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 10 additions & 5 deletions build/ie8.max.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ THE SOFTWARE.

function commonEventLoop(currentTarget, e, $handlers, synthetic) {
for(var
handler,
continuePropagation,
handlers = $handlers.slice(),
evt = enrich(e, currentTarget),
Expand Down Expand Up @@ -184,6 +185,7 @@ THE SOFTWARE.
while ((node = this.lastChild)) {
this.removeChild(node);
}
/*jshint eqnull:true */
if (textContent != null) {
this.appendChild(document.createTextNode(textContent));
}
Expand All @@ -197,7 +199,7 @@ THE SOFTWARE.
e.target = e.srcElement || e.fromElement || document;
}
if (!e.timeStamp) {
e.timeStamp = (new Date).getTime();
e.timeStamp = (new Date()).getTime();
}
return e;
}
Expand Down Expand Up @@ -373,16 +375,17 @@ THE SOFTWARE.
// added to any other node, fireEvent might
// behave very weirdly (read: trigger unspecified errors)
if (self.nodeType != 9) {
/*jshint eqnull:true */
if (self.parentNode == null) {
div.appendChild(self);
}
if (attr = self.getAttribute(ontype)) {
if ((attr = self.getAttribute(ontype))) {
removeAttribute.call(self, ontype);
}
}
self.fireEvent(ontype, e);
types[ontype] = true;
} catch(e) {
} catch(meh) {
types[ontype] = false;
while (div.hasChildNodes()) {
div.removeChild(div.firstChild);
Expand All @@ -397,7 +400,7 @@ THE SOFTWARE.
types[ontype] = false;
}
}
if (currentType.n = types[ontype]) {
if ((currentType.n = types[ontype])) {
self.attachEvent(ontype, currentType.w);
}
}
Expand Down Expand Up @@ -575,6 +578,7 @@ THE SOFTWARE.
) {
DUNNOABOUTDOMLOADED = false;
self.attachEvent(ONREADYSTATECHANGE, onReadyState);
/* global top */
if (window == top) {
(function gonna(e){try{
self.documentElement.doScroll('left');
Expand All @@ -591,7 +595,7 @@ THE SOFTWARE.
var e;
if (Class !== 'Event') throw new Error('unsupported ' + Class);
e = document.createEventObject();
e.timeStamp = (new Date).getTime();
e.timeStamp = (new Date()).getTime();
return e;
}}
}
Expand Down Expand Up @@ -640,6 +644,7 @@ THE SOFTWARE.
runtimeStyle.left = rtLeft;
}
}
/*jshint eqnull:true */
return result == null ?
result : ((result + '') || 'auto');
};
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.3.2",
"version": "0.3.3",
"name": "ie8",
"description": "some damn DOM fix for this damned browser",
"homepage": "https://github.com/WebReflection/ie8",
Expand All @@ -23,7 +23,7 @@
"devDependencies": {
"jshint": "^2.9.1",
"markdown": "^0.5.0",
"polpetta": "^0.3.10",
"tiny-cdn": "^0.5.2",
"uglify-js": "^1.3.5",
"wru": "^0.2.7"
}
Expand Down
Loading

0 comments on commit 1419934

Please sign in to comment.