Sha256: 9d5f10c5a967d4eba8977413ab6f4f0652ecf4c12038b50b9882240624a4a038
Contents?: true
Size: 1.6 KB
Versions: 2
Compression:
Stored size: 1.6 KB
Contents
// For discussion and comments, see: http://remysharp.com/2009/01/07/html5-enabling-script/ (function(){if(!0)return;var e="abbr,article,aside,audio,canvas,datalist,details,eventsource,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,time,video".split(','),i=e.length;while(i--){document.createElement(e[i])}})()var html5=new function(){var me=this;me.getAttributeByName=function(obj,attrName){var i;var attributes=obj.attributes;for(i=0;i<attributes.length;i++){var attr=attributes[i]if(attr.nodeName==attrName&&attr.specified){return attr}}return null}me.getAttributeValue=function(obj,attrName){var attr=me.getAttributeByName(obj,attrName);if(attr!=null){return attr.nodeValue}else{return null}}me.setAttributeValue=function(obj,attrName,attrValue){var attr=me.getAttributeByName(obj,attrName);if(attr!=null){attr.nodeValue=attrValue}else{return}}me.getDefinedAttributes=function(obj){var attrs=obj.attributes;var r=new Array();for(var i=0;i<attrs.length;i++){attr=attrs[i];if(attr.specified){r[attr.name]=attr.value}}return r}me.getDataset=function(obj){var r=new Array();var attributes=me.getDefinedAttributes(obj);for(var i=0;i<attributes.length;i++){var attr=attributes[i];if(attr.indexOf('data-')==0){var name=attr.substring(5);r[name]=attr.value}}return r}me.getDatasetItem=function(obj,name){var r=me.getAttributeValue(obj,'data-'+name);if(!r){r=me.getAttributeValue(obj,'data-'+name.toLowerCase())}return r}me.setDatasetItem=function(obj,name,value){var attrName='data-'+name.toLowerCase();var val=me.setAttributeValue(obj,attrName,value);if(me.getAttributeValue(obj,attrName)==null){obj[attrName]=value}}}
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
html5forms-rails-0.1.4 | vendor/assets/javascripts/html5forms/html5.min.js |
html5forms-rails-0.1.3 | vendor/assets/javascripts/html5forms/html5.min.js |