lib/har/viewer/har.js in har-0.1.0 vs lib/har/viewer/har.js in har-0.1.1

- old
+ new

@@ -1,2 +1,4 @@ -(function(){function d(a,b,c,d){d=d||!1,a.addEventListener?a.addEventListener(b,c,d):a.attachEvent("on"+b,c)}function c(){var b=[];if(document.getElementsByClassName)b=document.getElementsByClassName("har");else if(document.getElementsByTagName){var c=document.getElementsByTagName("div");for(var d=0;d<c.length;d++){var e=c[d].className;e&&e.match(a)&&b.push(c[d])}}var f=[];for(var d=0;d<b.length;d++)f.push(b[d]);return f}function b(b){var c=b.className.replace(a," ");b.className=c.replace(/^\s*|\s*$/g,"")}window.harInitialize=function(){var a=document.getElementById("har"),d=a.src.lastIndexOf("/"),e=a.src.substr(0,d+1),f=c();for(var g=0;g<f.length;g++){var h=f[g],i=h.getAttribute("data-har");if(!i)continue;var j=h.getAttribute("width"),k=h.getAttribute("height"),l=h.getAttribute("expand"),m=h.getAttribute("validate"),n="?"+(i.indexOf("http:")==0?"inputUrl":"path")+"="+i;l!="false"&&(n+="&expand="+(l?l:"true")),m=="false"&&(n+="&validate=false");var o=document.createElement("iframe");o.setAttribute("style","border: 1px solid lightgray;"),o.setAttribute("frameborder","0"),o.setAttribute("width",j?j:"100%"),o.setAttribute("height",k?k:"150px"),o.setAttribute("src",e+"preview.php"+n),h.appendChild(o),b(h)}};var a=new RegExp("(^|\\s)har(\\s|$)","g");harInitialize(),d(window,"load",harInitialize,!1)})() +/* See license.txt for terms of usage */ + +(function(){function t(t){var n=t.className.replace(e," ");t.className=n.replace(/^\s*|\s*$/g,"")}function n(){var t=[];if(document.getElementsByClassName)t=document.getElementsByClassName("har");else if(document.getElementsByTagName){var n=document.getElementsByTagName("div");for(var r=0;r<n.length;r++){var i=n[r].className;i&&i.match(e)&&t.push(n[r])}}var s=[];for(var r=0;r<t.length;r++)s.push(t[r]);return s}function r(e,t,n,r){r=r||!1,e.addEventListener?e.addEventListener(t,n,r):e.attachEvent("on"+t,n)}window.harInitialize=function(){var e=document.getElementById("har"),r=e.src.lastIndexOf("/"),i=e.src.substr(0,r+1),s=n();for(var o=0;o<s.length;o++){var u=s[o],a=u.getAttribute("data-har");if(!a)continue;var f=u.getAttribute("data-callback"),l=u.getAttribute("width"),c=u.getAttribute("height"),h=u.getAttribute("expand"),p=u.getAttribute("validate"),d="?"+(a.indexOf("http:")==0?"inputUrl":"path")+"="+encodeURIComponent(a);h!="false"&&(d+="&expand="+(h?h:"true")),p=="false"&&(d+="&validate=false"),f&&(d+="&callback="+f);var v=document.createElement("iframe");v.setAttribute("style","border: 1px solid lightgray;"),v.setAttribute("frameborder","0"),v.setAttribute("width",l?l:"100%"),v.setAttribute("height",c?c:"150px"),v.setAttribute("src",i+"preview.php"+d),u.appendChild(v),t(u)}};var e=new RegExp("(^|\\s)har(\\s|$)","g");harInitialize(),r(window,"load",harInitialize,!1)})(); \ No newline at end of file