Permalink
Browse files

Removed classlist polyfill from kis-lite.js

  • Loading branch information...
1 parent a0d0941 commit 19ab4751e4cd32c44b40163b4e469519655d6ad9 @timw4mail timw4mail committed Jan 24, 2012
Showing with 1,205 additions and 1,218 deletions.
  1. +1 −1 README.md
  2. 0 docs/code.css
  3. 0 docs/css/all.css
  4. BIN docs/css/fonts/mplus-1m-bold-webfont.eot
  5. 0 docs/css/fonts/mplus-1m-bold-webfont.svg
  6. BIN docs/css/fonts/mplus-1m-bold-webfont.ttf
  7. BIN docs/css/fonts/mplus-1m-bold-webfont.woff
  8. BIN docs/css/fonts/mplus-1m-regular-webfont.eot
  9. 0 docs/css/fonts/mplus-1m-regular-webfont.svg
  10. BIN docs/css/fonts/mplus-1m-regular-webfont.ttf
  11. BIN docs/css/fonts/mplus-1m-regular-webfont.woff
  12. 0 docs/css/handheld.css
  13. 0 docs/css/screen.css
  14. 0 docs/default.css
  15. 0 docs/files.html
  16. BIN docs/images/bg.png
  17. BIN docs/images/class_default_obj.png
  18. BIN docs/images/class_obj.png
  19. BIN docs/images/collapsebtn.gif
  20. BIN docs/images/expandbtn.gif
  21. BIN docs/images/field_private_obj.png
  22. BIN docs/images/field_public_obj.png
  23. BIN docs/images/file_obj.png
  24. BIN docs/images/method_private_obj.png
  25. BIN docs/images/method_public_obj.png
  26. BIN docs/images/minus.gif
  27. BIN docs/images/namespace_function_obj.png
  28. BIN docs/images/namespace_obj.png
  29. BIN docs/images/never_translate.png
  30. BIN docs/images/plus.gif
  31. 0 docs/index.html
  32. 0 docs/javascript/all.js
  33. 0 docs/javascript/html5.js
  34. 0 docs/jproton.js
  35. 0 docs/sh.css
  36. 0 docs/sh.js
  37. 0 docs/symbols/$_.dom.html
  38. 0 docs/symbols/$_.event.html
  39. 0 docs/symbols/$_.html
  40. 0 docs/symbols/$_.store.html
  41. 0 docs/symbols/$_.template.html
  42. 0 docs/symbols/$_.util.html
  43. 0 docs/symbols/_global_.html
  44. 0 docs/symbols/src/kis-js_src_core.js.html
  45. +526 −359 docs/symbols/src/kis-js_src_modules_DOM.js.html
  46. 0 docs/symbols/src/kis-js_src_modules_ajax.js.html
  47. 0 docs/symbols/src/kis-js_src_modules_event.js.html
  48. 0 docs/symbols/src/kis-js_src_modules_store.js.html
  49. 0 docs/symbols/src/kis-js_src_modules_template.js.html
  50. 0 docs/symbols/src/kis-js_src_modules_util.js.html
  51. 0 docs/ui.js
  52. +160 −162 kis-all.js
  53. +168 −170 kis-lite-dom-min.js
  54. +168 −170 kis-lite-dom.js
  55. +9 −12 kis-lite-min.js
  56. +1 −170 kis-lite.js
  57. +4 −4 kis-min.js
  58. 0 src/core.js
  59. +167 −0 src/modules/DOM.js
  60. 0 src/modules/ajax.js
  61. 0 src/modules/event.js
  62. 0 src/modules/store.js
  63. 0 src/modules/template.js
  64. 0 src/modules/util.js
  65. +1 −170 src/polyfill.js
  66. 0 tests/index.html
  67. 0 tests/tests/ajax.js
  68. 0 tests/tests/core.js
  69. 0 tests/tests/dom.js
  70. 0 tests/tests/event.js
  71. 0 tests/tests/store.js
  72. 0 tests/tests/template.js
  73. 0 tests/tests/util.js
View
@@ -51,7 +51,7 @@ Browser support: IE8+, Latest versions of Firefox, Chrome, Safari, Opera
Have a look at the /docs folder included with the library for documentation on the included modules. The development version of the documentation is avaliable at
-[http://dev.timshomepage.net/github/kis-js/docs/](http://dev.timshomepage.net/github/kis-js/docs/)
+[http://github.timshomepage.net/kis-js/docs/](http://github.timshomepage.net/kis-js/docs/)
#### Lite Versions ####
View
0 docs/code.css 100644 → 100755
No changes.
View
0 docs/css/all.css 100644 → 100755
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
0 docs/css/handheld.css 100644 → 100755
No changes.
View
0 docs/css/screen.css 100644 → 100755
No changes.
View
0 docs/default.css 100644 → 100755
No changes.
View
0 docs/files.html 100644 → 100755
No changes.
View
0 docs/images/bg.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 docs/images/class_default_obj.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 docs/images/class_obj.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 docs/images/collapsebtn.gif 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 docs/images/expandbtn.gif 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 docs/images/field_private_obj.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 docs/images/field_public_obj.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 docs/images/file_obj.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 docs/images/method_public_obj.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 docs/images/minus.gif 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 docs/images/namespace_obj.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 docs/images/never_translate.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 docs/images/plus.gif 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 docs/index.html 100644 → 100755
No changes.
View
0 docs/javascript/all.js 100644 → 100755
No changes.
View
0 docs/javascript/html5.js 100644 → 100755
No changes.
View
0 docs/jproton.js 100644 → 100755
No changes.
View
0 docs/sh.css 100644 → 100755
No changes.
View
0 docs/sh.js 100644 → 100755
No changes.
View
0 docs/symbols/$_.dom.html 100644 → 100755
No changes.
View
0 docs/symbols/$_.event.html 100644 → 100755
No changes.
View
0 docs/symbols/$_.html 100644 → 100755
No changes.
View
0 docs/symbols/$_.store.html 100644 → 100755
No changes.
View
0 docs/symbols/$_.template.html 100644 → 100755
No changes.
View
0 docs/symbols/$_.util.html 100644 → 100755
No changes.
View
0 docs/symbols/_global_.html 100644 → 100755
No changes.
View
No changes.
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
No changes.
View
No changes.
View
No changes.
No changes.
View
No changes.
View
0 docs/ui.js 100644 → 100755
No changes.
View
@@ -242,197 +242,195 @@
return this.replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, "");
};
}
-
+
// --------------------------------------------------------------------------
- //This is used so IE 8 can use the classList api
- /*
- * classList.js: Cross-browser full element.classList implementation.
- * 2011-06-15
- *
- * By Eli Grey, http://eligrey.com
- * Public Domain.
- * NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
+ /**
+ * event.preventDefault/e.stopPropagation polyfill
+ * @private
*/
-
- if (typeof document !== "undefined" && !("classList" in document.createElement("a")))
+ if(typeof Event.preventDefault === "undefined" && typeof window.event !== "undefined")
{
- (function (view){
-
- var classListProp = "classList",
- protoProp = "prototype",
- elemCtrProto = (view.HTMLElement || view.Element)[protoProp],
- objCtr = Object,
- strTrim = String[protoProp].trim ||
- function ()
- {
- return this.replace(/^\s+|\s+$/g, "");
- },
- arrIndexOf = Array[protoProp].indexOf ||
- function (item)
+ Event.prototype.preventDefault = function()
+ {
+ window.event.stop();
+ },
+ Event.prototype.stopPropagation = function()
+ {
+ window.event.returnValue = false;
+ }
+ }
+
+}());
+
+// --------------------------------------------------------------------------
+
+//This is used so IE 8 can use the classList api
+/*
+ * classList.js: Cross-browser full element.classList implementation.
+ * 2011-06-15
+ *
+ * By Eli Grey, http://eligrey.com
+ * Public Domain.
+ * NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
+ */
+
+if (typeof document !== "undefined" && !("classList" in document.createElement("a")))
+{
+ (function (view){
+
+ var classListProp = "classList",
+ protoProp = "prototype",
+ elemCtrProto = (view.HTMLElement || view.Element)[protoProp],
+ objCtr = Object,
+ strTrim = String[protoProp].trim ||
+ function ()
+ {
+ return this.replace(/^\s+|\s+$/g, "");
+ },
+ arrIndexOf = Array[protoProp].indexOf ||
+ function (item)
+ {
+ var
+ i = 0,
+ len = this.length;
+ for (; i < len; i++)
{
- var
- i = 0,
- len = this.length;
- for (; i < len; i++)
+ if (i in this && this[i] === item)
{
- if (i in this && this[i] === item)
- {
- return i;
- }
+ return i;
}
- return -1;
}
- // Vendors: please allow content code to instantiate DOMExceptions
- ,
- /**
- * @private
- */
- DOMEx = function (type, message)
- {
- this.name = type;
- this.code = DOMException[type];
- this.message = message;
- },
- /**
- * @private
- */
- checkTokenAndGetIndex = function (classList, token)
- {
- if (token === "")
- {
- throw new DOMEx("SYNTAX_ERR", "An invalid or illegal string was specified");
- }
- if (/\s/.test(token))
- {
- throw new DOMEx("INVALID_CHARACTER_ERR", "String contains an invalid character");
- }
- return arrIndexOf.call(classList, token);
- },
- /**
- * @private
- */
- ClassList = function (elem)
- {
- var
- trimmedClasses = strTrim.call(elem.className),
- classes = trimmedClasses ? trimmedClasses.split(/\s+/) : [],
- i = 0,
- len = classes.length;
- for (; i < len; i++)
- {
- this.push(classes[i]);
- }
- this._updateClassName = function ()
- {
- elem.className = this.toString();
- };
- },
- classListProto = ClassList[protoProp] = [],
- /**
- * @private
- */
- classListGetter = function ()
- {
- return new ClassList(this);
- };
- // Most DOMException implementations don't allow calling DOMException's toString()
- // on non-DOMExceptions. Error's toString() is sufficient here.
- DOMEx[protoProp] = Error[protoProp];
- classListProto.item = function (i)
+ return -1;
+ }
+ // Vendors: please allow content code to instantiate DOMExceptions
+ ,
+ /**
+ * @private
+ */
+ DOMEx = function (type, message)
{
- return this[i] || null;
- };
- classListProto.contains = function (token)
+ this.name = type;
+ this.code = DOMException[type];
+ this.message = message;
+ },
+ /**
+ * @private
+ */
+ checkTokenAndGetIndex = function (classList, token)
{
- token += "";
- return checkTokenAndGetIndex(this, token) !== -1;
- };
- classListProto.add = function (token)
- {
- token += "";
- if (checkTokenAndGetIndex(this, token) === -1)
+ if (token === "")
{
- this.push(token);
- this._updateClassName();
+ throw new DOMEx("SYNTAX_ERR", "An invalid or illegal string was specified");
}
- };
- classListProto.remove = function (token)
- {
- token += "";
- var index = checkTokenAndGetIndex(this, token);
- if (index !== -1)
+ if (/\s/.test(token))
{
- this.splice(index, 1);
- this._updateClassName();
+ throw new DOMEx("INVALID_CHARACTER_ERR", "String contains an invalid character");
}
- };
- classListProto.toggle = function (token)
+ return arrIndexOf.call(classList, token);
+ },
+ /**
+ * @private
+ */
+ ClassList = function (elem)
{
- token += "";
- if (checkTokenAndGetIndex(this, token) === -1)
+ var
+ trimmedClasses = strTrim.call(elem.className),
+ classes = trimmedClasses ? trimmedClasses.split(/\s+/) : [],
+ i = 0,
+ len = classes.length;
+ for (; i < len; i++)
{
- this.add(token);
+ this.push(classes[i]);
}
- else
+ this._updateClassName = function ()
{
- this.remove(token);
- }
+ elem.className = this.toString();
+ };
+ },
+ classListProto = ClassList[protoProp] = [],
+ /**
+ * @private
+ */
+ classListGetter = function ()
+ {
+ return new ClassList(this);
};
- classListProto.toString = function ()
+ // Most DOMException implementations don't allow calling DOMException's toString()
+ // on non-DOMExceptions. Error's toString() is sufficient here.
+ DOMEx[protoProp] = Error[protoProp];
+ classListProto.item = function (i)
+ {
+ return this[i] || null;
+ };
+ classListProto.contains = function (token)
+ {
+ token += "";
+ return checkTokenAndGetIndex(this, token) !== -1;
+ };
+ classListProto.add = function (token)
+ {
+ token += "";
+ if (checkTokenAndGetIndex(this, token) === -1)
{
- return this.join(" ");
+ this.push(token);
+ this._updateClassName();
+ }
+ };
+ classListProto.remove = function (token)
+ {
+ token += "";
+ var index = checkTokenAndGetIndex(this, token);
+ if (index !== -1)
+ {
+ this.splice(index, 1);
+ this._updateClassName();
+ }
+ };
+ classListProto.toggle = function (token)
+ {
+ token += "";
+ if (checkTokenAndGetIndex(this, token) === -1)
+ {
+ this.add(token);
+ }
+ else
+ {
+ this.remove(token);
+ }
+ };
+ classListProto.toString = function ()
+ {
+ return this.join(" ");
+ };
+
+ if (objCtr.defineProperty)
+ {
+ var classListPropDesc = {
+ get: classListGetter,
+ enumerable: true,
+ configurable: true
};
-
- if (objCtr.defineProperty)
+ try
{
- var classListPropDesc = {
- get: classListGetter,
- enumerable: true,
- configurable: true
- };
- try
+ objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);
+ }
+ catch (ex)
+ { // IE 8 doesn't support enumerable:true
+ if (ex.number === -0x7FF5EC54)
{
+ classListPropDesc.enumerable = false;
objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);
}
- catch (ex)
- { // IE 8 doesn't support enumerable:true
- if (ex.number === -0x7FF5EC54)
- {
- classListPropDesc.enumerable = false;
- objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);
- }
- }
- }
- else if (objCtr[protoProp].__defineGetter__)
- {
- elemCtrProto.__defineGetter__(classListProp, classListGetter);
}
-
- }(self));
- }
-
- // --------------------------------------------------------------------------
-
- /**
- * event.preventDefault/e.stopPropagation polyfill
- * @private
- */
- if(typeof Event.preventDefault === "undefined" && typeof window.event !== "undefined")
- {
- Event.prototype.preventDefault = function()
- {
- window.event.stop();
- },
- Event.prototype.stopPropagation = function()
+ }
+ else if (objCtr[protoProp].__defineGetter__)
{
- window.event.returnValue = false;
+ elemCtrProto.__defineGetter__(classListProp, classListGetter);
}
- }
-
-}());
-// --------------------------------------------------------------------------
+ }(self));
+}
/**
* DOM
Oops, something went wrong.

0 comments on commit 19ab475

Please sign in to comment.