Mercurial > hg > Papers > 2013 > sugi-sigos
diff presen/js/polyfills/dataset.min.js @ 10:5c57e35e19b6
add presen
author | sugi |
---|---|
date | Tue, 23 Apr 2013 23:31:26 +0900 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/presen/js/polyfills/dataset.min.js Tue Apr 23 23:31:26 2013 +0900 @@ -0,0 +1,2 @@ +(function(){function c(){d=!0;this.removeEventListener("DOMAttrModified",c,!1)}function g(b){return b.replace(h,function(b,a){return a.toUpperCase()})}function e(){var b={};i.call(this.attributes,function(a){if(f=a.name.match(j))b[g(f[1])]=a.value});return b}var i=[].forEach,j=/^data-(.+)/,h=/\-([a-z])/ig,a=document.createElement("div"),d=!1,f;a.dataset==void 0&&(a.addEventListener("DOMAttrModified",c,!1),a.setAttribute("foo","bar"),Element.prototype.__defineGetter__("dataset",d?function(){if(!this._datasetCache)this._datasetCache= +e.call(this);return this._datasetCache}:e),document.addEventListener("DOMAttrModified",function(a){delete a.target._datasetCache},!1))})(); \ No newline at end of file