har 0.0.1.dev
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/.rspec +1 -0
- data/Gemfile +4 -0
- data/LICENSE +24 -0
- data/README.mdown +36 -0
- data/Rakefile +28 -0
- data/bin/har +4 -0
- data/har.gemspec +27 -0
- data/lib/har.rb +32 -0
- data/lib/har/archive.rb +135 -0
- data/lib/har/page.rb +19 -0
- data/lib/har/schema_type.rb +78 -0
- data/lib/har/schemas/browserType +19 -0
- data/lib/har/schemas/cacheEntryType +25 -0
- data/lib/har/schemas/cacheType +15 -0
- data/lib/har/schemas/contentType +26 -0
- data/lib/har/schemas/cookieType +32 -0
- data/lib/har/schemas/creatorType +18 -0
- data/lib/har/schemas/entryType +46 -0
- data/lib/har/schemas/logType +40 -0
- data/lib/har/schemas/pageTimingsType +17 -0
- data/lib/har/schemas/pageType +29 -0
- data/lib/har/schemas/postDataType +38 -0
- data/lib/har/schemas/recordType +17 -0
- data/lib/har/schemas/requestType +53 -0
- data/lib/har/schemas/responseType +51 -0
- data/lib/har/schemas/timingsType +43 -0
- data/lib/har/serializable.rb +22 -0
- data/lib/har/version.rb +3 -0
- data/lib/har/viewer.rb +99 -0
- data/lib/har/viewer/css/SyntaxHighlighter.css +1 -0
- data/lib/har/viewer/css/aboutTab.css +1 -0
- data/lib/har/viewer/css/domTab.css +1 -0
- data/lib/har/viewer/css/domTree.css +1 -0
- data/lib/har/viewer/css/harPreview.css +1 -0
- data/lib/har/viewer/css/harView.css +1 -0
- data/lib/har/viewer/css/harViewer.css +1 -0
- data/lib/har/viewer/css/homeTab.css +1 -0
- data/lib/har/viewer/css/images/ajax-loader.gif +0 -0
- data/lib/har/viewer/css/images/bg-button.gif +0 -0
- data/lib/har/viewer/css/images/blank.gif +0 -0
- data/lib/har/viewer/css/images/button-background.png +0 -0
- data/lib/har/viewer/css/images/checkmark.gif +0 -0
- data/lib/har/viewer/css/images/checkmark.png +0 -0
- data/lib/har/viewer/css/images/close-sprites.png +0 -0
- data/lib/har/viewer/css/images/contextMenuTarget.png +0 -0
- data/lib/har/viewer/css/images/contextMenuTargetHover.png +0 -0
- data/lib/har/viewer/css/images/download-sprites.png +0 -0
- data/lib/har/viewer/css/images/downloadButtons-aero.png +0 -0
- data/lib/har/viewer/css/images/group.gif +0 -0
- data/lib/har/viewer/css/images/loading_16.gif +0 -0
- data/lib/har/viewer/css/images/menu/Thumbs.db +0 -0
- data/lib/har/viewer/css/images/menu/shadowAlpha.png +0 -0
- data/lib/har/viewer/css/images/menu/tabMenuCheckbox.png +0 -0
- data/lib/har/viewer/css/images/menu/tabMenuPin.png +0 -0
- data/lib/har/viewer/css/images/menu/tabMenuRadio.png +0 -0
- data/lib/har/viewer/css/images/netBarBlocking.gif +0 -0
- data/lib/har/viewer/css/images/netBarBlocking2.gif +0 -0
- data/lib/har/viewer/css/images/netBarCached.gif +0 -0
- data/lib/har/viewer/css/images/netBarConnecting.gif +0 -0
- data/lib/har/viewer/css/images/netBarLoaded.gif +0 -0
- data/lib/har/viewer/css/images/netBarReceiving.gif +0 -0
- data/lib/har/viewer/css/images/netBarResolving.gif +0 -0
- data/lib/har/viewer/css/images/netBarResponded.gif +0 -0
- data/lib/har/viewer/css/images/netBarSending.gif +0 -0
- data/lib/har/viewer/css/images/netBarWaiting.gif +0 -0
- data/lib/har/viewer/css/images/page-timeline.png +0 -0
- data/lib/har/viewer/css/images/save.png +0 -0
- data/lib/har/viewer/css/images/spriteArrows.gif +0 -0
- data/lib/har/viewer/css/images/spriteArrows.png +0 -0
- data/lib/har/viewer/css/images/tabEnabled.png +0 -0
- data/lib/har/viewer/css/images/timeline-sprites.png +0 -0
- data/lib/har/viewer/css/images/tooltipConnectorUp.png +0 -0
- data/lib/har/viewer/css/images/twisty-sprites.png +0 -0
- data/lib/har/viewer/css/images/twistyClosed.png +0 -0
- data/lib/har/viewer/css/images/twistyOpen.png +0 -0
- data/lib/har/viewer/css/infoTip.css +1 -0
- data/lib/har/viewer/css/pageList.css +1 -0
- data/lib/har/viewer/css/pageStats.css +1 -0
- data/lib/har/viewer/css/pageTimeline.css +1 -0
- data/lib/har/viewer/css/popupMenu.css +1 -0
- data/lib/har/viewer/css/previewTab.css +1 -0
- data/lib/har/viewer/css/requestBody.css +1 -0
- data/lib/har/viewer/css/requestList.css +1 -0
- data/lib/har/viewer/css/schemaTab.css +1 -0
- data/lib/har/viewer/css/tabView.css +1 -0
- data/lib/har/viewer/css/toolTip.css +1 -0
- data/lib/har/viewer/css/toolbar.css +1 -0
- data/lib/har/viewer/css/xhrSpy.css +1 -0
- data/lib/har/viewer/index.html +13 -0
- data/lib/har/viewer/scripts/app.build.js +0 -0
- data/lib/har/viewer/scripts/core/cookies.js +2 -0
- data/lib/har/viewer/scripts/core/lib.js +23 -0
- data/lib/har/viewer/scripts/core/trace.js +26 -0
- data/lib/har/viewer/scripts/domplate/domTree.js +5 -0
- data/lib/har/viewer/scripts/domplate/domplate.js +263 -0
- data/lib/har/viewer/scripts/domplate/infoTip.js +4 -0
- data/lib/har/viewer/scripts/domplate/popupMenu.js +14 -0
- data/lib/har/viewer/scripts/domplate/tabView.js +6 -0
- data/lib/har/viewer/scripts/domplate/toolTip.js +3 -0
- data/lib/har/viewer/scripts/domplate/toolbar.js +3 -0
- data/lib/har/viewer/scripts/downloadify/LICENSE.txt +22 -0
- data/lib/har/viewer/scripts/downloadify/README.textile +89 -0
- data/lib/har/viewer/scripts/downloadify/js/downloadify.min.js +6 -0
- data/lib/har/viewer/scripts/downloadify/js/swfobject.js +18 -0
- data/lib/har/viewer/scripts/downloadify/media/downloadify.swf +0 -0
- data/lib/har/viewer/scripts/downloadify/src/Downloadify.as +162 -0
- data/lib/har/viewer/scripts/downloadify/src/downloadify.js +6 -0
- data/lib/har/viewer/scripts/excanvas/excanvas.js +21 -0
- data/lib/har/viewer/scripts/harPreview.js +149 -0
- data/lib/har/viewer/scripts/harViewer.js +244 -0
- data/lib/har/viewer/scripts/jquery-plugins/jquery.json.js +6 -0
- data/lib/har/viewer/scripts/nls/harViewer.js +1 -0
- data/lib/har/viewer/scripts/nls/homeTab.js +1 -0
- data/lib/har/viewer/scripts/nls/pageStats.js +2 -0
- data/lib/har/viewer/scripts/nls/pageTimeline.js +1 -0
- data/lib/har/viewer/scripts/nls/previewTab.js +1 -0
- data/lib/har/viewer/scripts/nls/requestBody.js +1 -0
- data/lib/har/viewer/scripts/nls/requestList.js +2 -0
- data/lib/har/viewer/scripts/preview/harModel.js +7 -0
- data/lib/har/viewer/scripts/preview/harSchema.js +308 -0
- data/lib/har/viewer/scripts/preview/jsonSchema.js +7 -0
- data/lib/har/viewer/scripts/preview/pageList.js +4 -0
- data/lib/har/viewer/scripts/preview/ref.js +5 -0
- data/lib/har/viewer/scripts/preview/requestBody.js +11 -0
- data/lib/har/viewer/scripts/preview/requestList.js +27 -0
- data/lib/har/viewer/scripts/requireplugins-jquery-1.4.2.js +204 -0
- data/lib/har/viewer/scripts/syntax-highlighter/README.txt +9 -0
- data/lib/har/viewer/scripts/syntax-highlighter/shCore.js +20 -0
- data/lib/har/viewer/scripts/tabs/aboutTab.html +93 -0
- data/lib/har/viewer/scripts/tabs/aboutTab.js +2 -0
- data/lib/har/viewer/scripts/tabs/domTab.js +1 -0
- data/lib/har/viewer/scripts/tabs/homeTab.html +34 -0
- data/lib/har/viewer/scripts/tabs/homeTab.js +5 -0
- data/lib/har/viewer/scripts/tabs/pageStats.js +14 -0
- data/lib/har/viewer/scripts/tabs/pageTimeline.js +10 -0
- data/lib/har/viewer/scripts/tabs/previewTab.js +6 -0
- data/lib/har/viewer/scripts/tabs/schemaTab.js +2 -0
- data/lib/har/viewer/scripts/xhr-spy/spy.js +2 -0
- data/lib/har/viewer/scripts/xhr-spy/spy.php +13 -0
- data/lib/har/viewer/scripts/xhr-spy/xhr.js +6 -0
- data/lib/har/viewer/scripts/xhr-spy/xhrSpyBookmarklet.js +1 -0
- data/schema.json +201 -0
- data/spec/fixtures/entry1.json +124 -0
- data/spec/fixtures/hars/bad.har +2563 -0
- data/spec/fixtures/hars/browser-blocking-time.har +2567 -0
- data/spec/fixtures/hars/google.com.har +612 -0
- data/spec/fixtures/hars/inline-scripts-block.har +1066 -0
- data/spec/fixtures/hars/softwareishard.com.har +5323 -0
- data/spec/har/archive_spec.rb +130 -0
- data/spec/har/entry_spec.rb +16 -0
- data/spec/har/page_spec.rb +24 -0
- data/spec/har/viewer_spec.rb +17 -0
- data/spec/spec_helper.rb +34 -0
- metadata +283 -0
@@ -0,0 +1,244 @@
|
|
1
|
+
/*
|
2
|
+
RequireJS i18n Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
|
3
|
+
Available via the MIT, GPL or new BSD license.
|
4
|
+
see: http://github.com/jrburke/requirejs for details
|
5
|
+
RequireJS text Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
|
6
|
+
Available via the MIT, GPL or new BSD license.
|
7
|
+
see: http://github.com/jrburke/requirejs for details
|
8
|
+
*/
|
9
|
+
(function(){function n(h,a){a=a.nlsWaiting;return a[h]||(a[h]=a[a.push({_name:h})-1])}function c(h,a,d,b){var e,l,m,f,k,o,p="root";l=d.split("-");m=[];f=n(h,b);for(e=l.length;e>-1;e--){k=e?l.slice(0,e).join("-"):"root";if(o=a[k]){if(d===b.config.locale&&!f._match)f._match=k;if(p==="root")p=k;f[k]=k;if(o===true){o=h.split("/");o.splice(-1,0,k);o=o.join("/");!b.specified[o]&&!(o in b.loaded)&&!b.defined[o]&&m.push(o)}}}if(p!==d)if(b.defined[p])b.defined[d]=b.defined[p];else f[d]=p;m.length&&b.defined.require(m)}
|
10
|
+
var g=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/,j={};require.plugin({prefix:"i18n",require:function(h,a,d,b){var e,l=b.defined[h];e=g.exec(h);if(e[5]){h=e[1]+e[5];a=n(h,b);a[e[4]]=e[4];a=b.nls[h];if(!a){b.defined.require([h]);a=b.nls[h]={}}a[e[4]]=d}else{if(a=b.nls[h])require.mixin(a,l);else a=b.nls[h]=l;b.nlsRootLoaded[h]=true;if(e=b.nlsToLoad[h]){delete b.nlsToLoad[h];for(d=0;d<e.length;d++)c(h,a,e[d],b)}c(h,a,b.config.locale,b)}},newContext:function(h){require.mixin(h,{nlsWaiting:[],nls:{},nlsRootLoaded:{},
|
11
|
+
nlsToLoad:{}});if(!h.config.locale)h.config.locale=typeof navigator==="undefined"?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase()},load:function(h,a){var d=require.s.contexts[a],b=g.exec(h),e=b[4];if(b[5]){h=b[1]+b[5];a=d.nls[h];if(d.nlsRootLoaded[h]&&a)c(h,a,e,d);else{(d.nlsToLoad[h]||(d.nlsToLoad[h]=[])).push(e);d.defined.require([h])}}else d.nlsRootLoaded[h]||require.load(h,a)},checkDeps:function(){},isWaiting:function(h){return!!h.nlsWaiting.length},orderDeps:function(h){var a,
|
12
|
+
d,b,e,l,m,f,k,o,p,u,v,w=h.nlsWaiting,q;h.nlsWaiting=[];h.nlsToLoad={};for(a=0;e=w[a];a++){b=e._name;l=h.nls[b];u=null;m=b.split("/");o=m.slice(0,m.length-1).join("/");f=m[m.length-1];for(p in e)if(p!=="_name"&&!(p in j))if(p==="_match")u=e[p];else if(e[p]!==p)(q||(q={}))[p]=e[p];else{k={};m=p.split("-");for(d=m.length;d>0;d--){v=m.slice(0,d).join("-");v!=="root"&&l[v]&&require.mixin(k,l[v])}l.root&&require.mixin(k,l.root);h.defined[o+"/"+p+"/"+f]=k}h.defined[b]=h.defined[o+"/"+u+"/"+f];if(q)for(p in q)p in
|
13
|
+
j||(h.defined[o+"/"+p+"/"+f]=h.defined[o+"/"+q[p]+"/"+f])}}})})();
|
14
|
+
(function(){var n=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],c=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,g=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im;if(!require.textStrip)require.textStrip=function(j){if(j){j=j.replace(c,"");var h=j.match(g);if(h)j=h[1]}else j="";return j};if(!require.getXhr)require.getXhr=function(){var j,h,a;if(typeof XMLHttpRequest!=="undefined")return new XMLHttpRequest;else for(h=0;h<3;h++){a=n[h];try{j=new ActiveXObject(a)}catch(d){}if(j){n=[a];
|
15
|
+
break}}if(!j)throw new Error("require.getXhr(): XMLHttpRequest not available");return j};if(!require.fetchText)require.fetchText=function(j,h){var a=require.getXhr();a.open("GET",j,true);a.onreadystatechange=function(){a.readyState===4&&h(a.responseText)};a.send(null)};require.plugin({prefix:"text",require:function(){},newContext:function(j){require.mixin(j,{text:{},textWaiting:[]})},load:function(j,h){var a=false,d=null,b,e=j.indexOf("."),l=j.substring(0,e),m=j.substring(e+1,j.length),f=require.s.contexts[h],
|
16
|
+
k=f.textWaiting;e=m.indexOf("!");if(e!==-1){a=m.substring(e+1,m.length);m=m.substring(0,e);e=a.indexOf("!");if(e!==-1&&a.substring(0,e)==="strip"){d=a.substring(e+1,a.length);a="strip"}else if(a!=="strip"){d=a;a=null}}b=l+"!"+m;e=a?b+"!"+a:b;if(d!==null&&!f.text[b])f.defined[j]=f.text[b]=d;else if(!f.text[b]&&!f.textWaiting[b]&&!f.textWaiting[e]){k[e]||(k[e]=k[k.push({name:j,key:b,fullKey:e,strip:!!a})-1]);a=require.nameToUrl(l,"."+m,h);f.loaded[j]=false;require.fetchText(a,function(o){f.text[b]=
|
17
|
+
o;f.loaded[j]=true;require.checkLoaded(h)})}},checkDeps:function(){},isWaiting:function(j){return!!j.textWaiting.length},orderDeps:function(j){var h,a,d,b=j.textWaiting;j.textWaiting=[];for(h=0;a=b[h];h++){d=j.text[a.key];j.defined[a.name]=a.strip?require.textStrip(d):d}}})})();require.pause();
|
18
|
+
require.def("domplate/tabView",["domplate/domplate","core/lib","core/trace"],function(n,c,g){with(n){var j=domplate({tag:TABLE({"class":"tabView",cellpadding:0,cellspacing:0,_repObject:"$tabView"},TBODY(TR({"class":"tabViewRow"},TD({"class":"tabViewCol",valign:"top"},TAG("$tabList",{tabView:"$tabView"}))))),tabList:DIV({"class":"tabViewBody",onclick:"$onClickTab"},DIV({"class":"$tabView.id\\Bar tabBar"}),DIV({"class":"$tabView.id\\Bodies tabBodies"})),tabHeaderTag:A({"class":"$tab.id\\Tab tab",view:"$tab.id",
|
19
|
+
_repObject:"$tab"},"$tab.label"),tabBodyTag:DIV({"class":"tab$tab.id\\Body tabBody",_repObject:"$tab"}),hideTab:function(){return false},onClickTab:function(h){h=$.event.fix(h||window.event);this.getTabView(h.target).onClickTab(h)},getTabView:function(h){return c.getAncestorByClass(h,"tabView").repObject}});n=function(h){this.id=h;this.tabs=[];this.listeners=[]};n.prototype={appendTab:function(h){this.tabs.push(h);h.tabView=this;return h},getTab:function(h){return(h=c.getElementByClass(this.element,
|
20
|
+
h+"Tab"))?h.repObject:null},selectTabByName:function(h){(h=c.getElementByClass(this.element,h+"Tab"))&&this.selectTab(h)},addListener:function(h){this.listeners.push(h)},removeListener:function(h){c.remove(this.listeners,h)},onClickTab:function(h){(h=c.getAncestorByClass(h.target,"tab"))&&this.selectTab(h)},selectTab:function(h){if(c.hasClass(h,"tab"))if(!c.hasClass(h,"selected")){var a=h.getAttribute("view");if(a){var d=c.getAncestorByClass(h,"tabViewBody");if(d.selectedTab){d.selectedTab.removeAttribute("selected");
|
21
|
+
d.selectedBody.removeAttribute("selected");c.removeClass(d.selectedTab,"selected");c.removeClass(d.selectedBody,"selected")}var b=c.getElementByClass(d,"tab"+a+"Body");b||g.error("TabView.selectTab; Missing tab body",h);d.selectedTab=h;d.selectedBody=b;d.selectedTab.setAttribute("selected","true");d.selectedBody.setAttribute("selected","true");c.setClass(d.selectedBody,"selected");c.setClass(d.selectedTab,"selected");this.updateTabBody(d,a)}}},updateTabBody:function(h){h=h.selectedTab.repObject;if(!h._body._updated){h._body._updated=
|
22
|
+
true;h.bodyTag&&h.bodyTag.replace({tab:h},h._body);h&&h.onUpdateBody&&h.onUpdateBody(this,h._body);for(var a=0;a<this.listeners.length;a++){var d=this.listeners[a];d.onUpdateBody&&d.onUpdateBody(this,h._body)}}},render:function(h){this.element=j.tag.replace({tabView:this},h,j);c.setClass(this.element,this.id);for(var a in this.tabs){var d=this.tabs[a],b=d.tabHeaderTag?d.tabHeaderTag:j.tabHeaderTag,e=d.tabBodyTag?d.tabBodyTag:j.tabBodyTag;try{d._header=b.append({tab:d},c.$(h,"tabBar"));d._body=e.append({tab:d},
|
23
|
+
c.$(h,"tabBodies"))}catch(l){g.exception("TabView.appendTab; Exception ",l)}}return this.element}};n.Tab=function(){};n.Tab.prototype={invalidate:function(){this._updated=false},select:function(){this.tabView.selectTabByName(this.id)}};return n}});
|
24
|
+
require.def("harViewer",["domplate/tabView","tabs/homeTab","tabs/aboutTab","tabs/previewTab","tabs/schemaTab","tabs/domTab","preview/harModel","i18n!nls/harViewer","core/lib","core/trace"],function(n,c,g,j,h,a,d,b,e,l){function m(f){this.id="harView";this.model=new d;this.homeTab=this.appendTab(new c);this.previewTab=this.appendTab(new j(this.model));this.domTab=this.appendTab(new a);this.aboutTab=this.appendTab(new g);this.schemaTab=this.appendTab(new h);this.initialize(f)}m.prototype=e.extend(new n,
|
25
|
+
{initialize:function(f){this.version=f.getAttribute("version");this.harSpecURL="http://groups.google.com/group/http-archive-specification/web/har-1-2-spec";this.render(f);this.selectTabByName("Home");f=e.bind(this.appendPreview,this);var k=e.bind(this.onLoadError,this);d.Loader.run(f,k)&&this.homeTab.loadInProgress(true)},appendPreview:function(f){try{var k=$("#validate").attr("checked"),o=d.parse(f,k);this.model.append(o);this.previewTab.select();this.previewTab.append(o);this.domTab.append(o)}catch(p){l.exception("HarView.appendPreview; EXCEPTION ",
|
26
|
+
p);p.errors&&this.previewTab.appendError(p)}this.previewTab.select();this.homeTab.loadInProgress(false)},onLoadError:function(f,k){this.homeTab.loadInProgress(true,f.statusText);l.error("harModule.loadRemoteArchive; ERROR ",f,k)}});n=document.getElementById("content");b=new m(n);e.fireEvent(n,"onViewerInit",[b]);l.log("HarViewer; initialized OK")});
|
27
|
+
require.def("core/lib",["core/trace"],function(n){var c={},g=navigator.userAgent.toLowerCase();c.isFirefox=/firefox/.test(g);c.isOpera=/opera/.test(g);c.isSafari=/webkit/.test(g);c.isIE=/msie/.test(g)&&!/opera/.test(g);c.isIE6=/msie 6/i.test(navigator.appVersion);c.browserVersion=(g.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1];c.isIElt8=c.isIE&&c.browserVersion-0<8;c.extend=function(a,d){var b={};c.append(b,a);c.append(b,d);return b};c.append=function(a,d){for(var b in d)a[b]=d[b];return a};
|
28
|
+
c.bind=function(){var a=c.cloneArray(arguments),d=a.shift(),b=a.shift();return function(){return d.apply(b,c.arrayInsert(c.cloneArray(a),0,arguments))}};c.bindFixed=function(){var a=c.cloneArray(arguments),d=a.shift(),b=a.shift();return function(){return d.apply(b,a)}};c.dispatch=function(a,d,b){for(var e=0;a&&e<a.length;e++){var l=a[e];if(l[d])try{l[d].apply(l,b)}catch(m){n.exception(m)}}};c.dispatch2=function(a,d,b){for(var e=0;e<a.length;e++){var l=a[e];if(l[d])try{var m=l[d].apply(l,b);if(m)return m}catch(f){n.exception(f)}}};
|
29
|
+
var j=Object.prototype.toString,h=/^\s*function(\s+[\w_$][\w\d_$]*)?\s*\(/;c.isArray=function(a){return j.call(a)==="[object Array]"};c.isFunction=function(a){if(!a)return false;return j.call(a)==="[object Function]"||c.isIE&&typeof a!="string"&&h.test(""+a)};c.isAncestor=function(a,d){for(a=a;a;a=a.parentNode)if(a==d)return true;return false};c.fixEvent=function(a){return $.event.fix(a||window.event)};c.fireEvent=function(a,d){if(document.createEvent){var b=document.createEvent("Events");b.initEvent(d,
|
30
|
+
true,false);return!a.dispatchEvent(b)}};c.cancelEvent=function(a){a=c.fixEvent(a);a.stopPropagation();a.preventDefault()};c.addEventListener=function(a,d,b,e){e=e||false;a.addEventListener?a.addEventListener(d,b,e):a.attachEvent("on"+d,b)};c.removeEventListener=function(a,d,b,e){e=e||false;a.removeEventListener?a.removeEventListener(d,b,e):a.detachEvent("on"+d,b)};c.isLeftClick=function(a){return a.button==0&&c.noKeyModifiers(a)};c.noKeyModifiers=function(a){return!a.ctrlKey&&!a.shiftKey&&!a.altKey&&
|
31
|
+
!a.metaKey};c.isControlClick=function(a){return a.button==0&&c.isControl(a)};c.isShiftClick=function(a){return a.button==0&&c.isShift(a)};c.isControl=function(a){return(a.metaKey||a.ctrlKey)&&!a.shiftKey&&!a.altKey};c.isAlt=function(a){return a.altKey&&!a.ctrlKey&&!a.shiftKey&&!a.metaKey};c.isAltClick=function(a){return a.button==0&&c.isAlt(a)};c.isControlShift=function(a){return(a.metaKey||a.ctrlKey)&&a.shiftKey&&!a.altKey};c.isShift=function(a){return a.shiftKey&&!a.metaKey&&!a.ctrlKey&&!a.altKey};
|
32
|
+
c.inflateRect=function(a,d,b){return{top:a.top-b,left:a.left-d,height:a.height+2*b,width:a.width+2*d}};c.pointInRect=function(a,d,b){return b>=a.top&&b<=a.top+a.height&&d>=a.left&&d<=a.left+a.width};c.cloneArray=function(a,d){var b=[];if(d)for(var e=0;e<a.length;++e)b.push(d(a[e]));else for(e=0;e<a.length;++e)b.push(a[e]);return b};c.arrayInsert=function(a,d,b){for(var e=0;e<b.length;++e)a.splice(e+d,0,b[e]);return a};c.remove=function(a,d){for(var b=0;b<a.length;++b)if(a[b]==d){a.splice(b,1);break}};
|
33
|
+
c.formatSize=function(a){var d=1;d=d>2?2:d;d=d<-1?-1:d;if(d==-1)return a+" B";d=Math.pow(10,d);return a==-1||a==undefined?"?":a==0?"0":a<1024?a+" B":a<1048576?Math.round(a/1024*d)/d+" KB":Math.round(a/1048576*d)/d+" MB"};c.formatTime=function(a){return a==-1?"-":a<1E3?a+"ms":a<6E4?Math.ceil(a/10)/100+"s":Math.ceil(a/6E4*100)/100+"m"};c.formatNumber=function(a){a+="";var d=a.split(".");a=d[0];d=d.length>1?"."+d[1]:"";for(var b=/(\d+)(\d{3})/;b.test(a);)a=a.replace(b,"$1,$2");return a+d};c.formatString=
|
34
|
+
function(a){var d=c.cloneArray(arguments);a=d.shift();for(var b=0;b<d.length;b++){var e=d[b].toString();a=a.replace("%S",e)}return a};c.parseISO8601=function(a){return(a=c.fromISOString(a))?a.getTime():null};c.fromISOString=function(a){if(!a)return null;a=a.toString().match(new RegExp(/(\d\d\d\d)(-)?(\d\d)(-)?(\d\d)(T)?(\d\d)(:)?(\d\d)(:)?(\d\d)(\.\d+)?(Z|([+-])(\d\d)(:)?(\d\d))/));if(!a)return null;var d=new Date;d.setUTCDate(1);d.setUTCFullYear(parseInt(a[1],10));d.setUTCMonth(parseInt(a[3],10)-
|
35
|
+
1);d.setUTCDate(parseInt(a[5],10));d.setUTCHours(parseInt(a[7],10));d.setUTCMinutes(parseInt(a[9],10));d.setUTCSeconds(parseInt(a[11],10));a[12]?d.setUTCMilliseconds(parseFloat(a[12])*1E3):d.setUTCMilliseconds(0);if(a[13]!="Z"){var b=a[15]*60+parseInt(a[17],10);b*=a[14]=="-"?-1:1;d.setTime(d.getTime()-b*60*1E3)}return d};c.getFileName=function(a){return c.splitURLBase(a).name};c.getFileExtension=function(a){if(!a)return null;var d=a.indexOf("?");if(d!=-1)a=a.substr(0,d);d=a.lastIndexOf(".");return a.substr(d+
|
36
|
+
1)};c.splitURLBase=function(a){if(c.isDataURL(a))return c.splitDataURL(a);return c.splitURLTrue(a)};c.isDataURL=function(a){return a&&a.substr(0,5)=="data:"};c.splitDataURL=function(a){var d=a.indexOf(":",3);if(d!=4)return false;var b=a.indexOf(",",d+1);if(b<d)return false;var e={encodedContent:a.substr(b+1)};a=a.substr(d+1,b).split(";");for(d=0;d<a.length;d++){b=a[d].split("=");if(b.length==2)e[b[0]]=b[1]}if(e.hasOwnProperty("fileName")){a=decodeURIComponent(e.fileName);a=c.splitURLTrue(a);if(e.hasOwnProperty("baseLineNumber")){e.path=
|
37
|
+
a.path;e.line=e.baseLineNumber;a=decodeURIComponent(e.encodedContent.substr(0,200)).replace(/\s*$/,"");e.name="eval->"+a}else{e.name=a.name;e.path=a.path}}else{e.hasOwnProperty("path")||(e.path="data:");e.hasOwnProperty("name")||(e.name=decodeURIComponent(e.encodedContent.substr(0,200)).replace(/\s*$/,""))}return e};c.splitURLTrue=function(a){var d=/:\/{1,3}(.*?)\/([^\/]*?)\/?($|\?.*)/.exec(a);return d?d[2]?{path:d[1],name:d[2]+d[3]}:{path:d[1],name:d[1]}:{name:a,path:a}};c.getURLParameter=function(a){for(var d=
|
38
|
+
window.location.search.substring(1).split("&"),b=0;b<d.length;b++){var e=d[b].split("=");if(e[0]==a)return unescape(e[1])}return null};c.getURLParameters=function(a){for(var d=[],b=window.location.search.substring(1).split("&"),e=0;e<b.length;e++){var l=b[e].split("=");l[0]==a&&d.push(unescape(l[1]))}return d};c.parseURLParams=function(a){var d=a?a.indexOf("?"):-1;if(d==-1)return[];a=a.substr(d+1);d=a.lastIndexOf("#");if(d!=-1)a=a.substr(0,d);if(!a)return[];return c.parseURLEncodedText(a)};c.parseURLEncodedText=
|
39
|
+
function(a,d){function b(p){try{return decodeURIComponent(p)}catch(u){return decodeURIComponent(unescape(p))}}var e=[];if(a=="")return e;a=a.replace(/\+/g," ");a=a.split("&");for(var l=0;l<a.length;++l)try{var m=a[l].indexOf("=");if(m!=-1){var f=a[l].substring(0,m),k=a[l].substring(m+1);if(k.length>25E3&&!d)k=c.$STR("LargeData");e.push({name:b(f),value:b(k)})}else{f=a[l];e.push({name:b(f),value:""})}}catch(o){}e.sort(function(p,u){return p.name<=u.name?-1:1});return e};c.getBody=function(a){if(a.body)return a.body;
|
40
|
+
if(a=a.getElementsByTagName("body")[0])return a;return null};c.getHead=function(a){return a.getElementsByTagName("head")[0]};c.getAncestorByClass=function(a,d){for(a=a;a;a=a.parentNode)if(c.hasClass(a,d))return a;return null};c.$=function(){return c.getElementByClass.apply(this,arguments)};c.getElementByClass=function(a){if(!a)return null;var d=c.cloneArray(arguments);d.splice(0,1);for(var b=a.firstChild;b;b=b.nextSibling){var e=c.cloneArray(d);e.unshift(b);if(c.hasClass.apply(this,e))return b;else if(e=
|
41
|
+
c.getElementByClass.apply(this,e))return e}return null};c.getElementsByClass=function(a){function d(l,m,f){for(l=l.firstChild;l;l=l.nextSibling){var k=c.cloneArray(m);k.unshift(l);c.hasClass.apply(null,k)&&f.push(l);d(l,m,f)}}var b=[],e=c.cloneArray(arguments);e.shift();d(a,e,b);return b};c.getChildByClass=function(a){for(var d=1;d<arguments.length;++d){var b=arguments[d],e=a.firstChild;for(a=null;e;e=e.nextSibling)if(c.hasClass(e,b)){a=e;break}}return a};c.eraseNode=function(a){for(;a.lastChild;)a.removeChild(a.lastChild)};
|
42
|
+
c.clearNode=function(a){a.innerHTML=""};c.hasClass=function(a,d){if(!a||a.nodeType!=1)return false;else{for(var b=1;b<arguments.length;++b){d=arguments[b];var e=a.className;if(!e||e.indexOf(d+" ")==-1)return false}return true}};c.setClass=function(a,d){if(a&&!c.hasClass(a,d))a.className+=" "+d+" "};c.removeClass=function(a,d){if(a&&a.className){var b=a.className.indexOf(d);if(b>=0){d=d.length;a.className=a.className.substr(0,b-1)+a.className.substr(b+d)}}};c.toggleClass=function(a,d){if(c.hasClass(a,
|
43
|
+
d)){c.removeClass(a,d);return false}else{c.setClass(a,d);return true}};c.trim=function(a){return a.replace(/^\s*|\s*$/g,"")};c.wrapText=function(a,d){var b=/[^A-Za-z_$0-9'"-]/,e=[];a=c.splitLines(a);for(var l=0;l<a.length;++l){for(var m=a[l];m.length>100;){var f=b.exec(m.substr(100,100));f=100+(f?f.index:0);var k=m.substr(0,f);m=m.substr(f);d||e.push("<pre>");e.push(d?k:c.escapeHTML(k));d||e.push("</pre>")}d||e.push("<pre>");e.push(d?m:c.escapeHTML(m));d||e.push("</pre>")}return e.join(d?"\n":"")};
|
44
|
+
c.insertWrappedText=function(a,d,b){d.innerHTML="<pre>"+c.wrapText(a,b)+"</pre>"};c.splitLines=function(a){var d=/\r\n|\r|\n/;if(a){if(a.split)return a.split(d)}else return[];return(a+"").split(d)};c.getPrettyDomain=function(a){return(a=/[^:]+:\/{1,3}(www\.)?([^\/]+)/.exec(a))?a[2]:""};c.escapeHTML=function(a){function d(b){switch(b){case "<":return"<";case ">":return">";case "&":return"&";case "'":return"'";case '"':return"""}return"?"}return String(a).replace(/[<>&"']/g,d)};c.cropString=
|
45
|
+
function(a,d){a+="";var b=d?d/2:50;return a.length>d?c.escapeNewLines(a.substr(0,b)+"..."+a.substr(a.length-b)):c.escapeNewLines(a)};c.escapeNewLines=function(a){return a.replace(/\r/g,"\\r").replace(/\n/g,"\\n")};c.cloneJSON=function(a){if(a==null||typeof a!="object")return a;try{var d=a.constructor();for(var b in a)d[b]=cloneJSON(a[b]);return d}catch(e){n.exception(a)}return null};c.getOverflowParent=function(a){for(a=a.parentNode;a;a=a.offsetParent)if(a.scrollHeight>a.offsetHeight)return a};c.getElementBox=
|
46
|
+
function(a){var d={};if(a.getBoundingClientRect){a=a.getBoundingClientRect();var b=c.isIE?document.body.clientTop||document.documentElement.clientTop:0,e=c.getWindowScrollPosition();d.top=Math.round(a.top-b+e.top);d.left=Math.round(a.left-b+e.left);d.height=Math.round(a.bottom-a.top);d.width=Math.round(a.right-a.left)}else{b=c.getElementPosition(a);d.top=b.top;d.left=b.left;d.height=a.offsetHeight;d.width=a.offsetWidth}return d};c.getElementPosition=function(a){var d=0,b=0;do{d+=a.offsetLeft;b+=a.offsetTop}while(a=
|
47
|
+
a.offsetParent);return{left:d,top:b}};c.getWindowSize=function(){var a=0,d=0,b;if(typeof window.innerWidth=="number"){a=window.innerWidth;d=window.innerHeight}else if((b=document.documentElement)&&(b.clientHeight||b.clientWidth)){a=b.clientWidth;d=b.clientHeight}else if((b=document.body)&&(b.clientHeight||b.clientWidth)){a=b.clientWidth;d=b.clientHeight}return{width:a,height:d}};c.getWindowScrollSize=function(){var a=0,d=0,b;if(!c.isIEQuiksMode&&(b=document.documentElement)&&(b.scrollHeight||b.scrollWidth)){a=
|
48
|
+
b.scrollWidth;d=b.scrollHeight}if((b=document.body)&&(b.scrollHeight||b.scrollWidth)&&(b.scrollWidth>a||b.scrollHeight>d)){a=b.scrollWidth;d=b.scrollHeight}return{width:a,height:d}};c.getWindowScrollPosition=function(){var a=0,d=0,b;if(typeof window.pageYOffset=="number"){a=window.pageYOffset;d=window.pageXOffset}else if((b=document.body)&&(b.scrollTop||b.scrollLeft)){a=b.scrollTop;d=b.scrollLeft}else if((b=document.documentElement)&&(b.scrollTop||b.scrollLeft)){a=b.scrollTop;d=b.scrollLeft}return{top:a,
|
49
|
+
left:d}};c.addStyleSheet=function(a,d){if(!a.getElementById(d)){var b=a.createElement("link");b.type="text/css";b.rel="stylesheet";b.href=d;b.setAttribute("id",d);c.getHead(a).appendChild(b)}};return c});
|
50
|
+
require.def("core/cookies",["core/lib"],function(n){return{getCookie:function(c){for(var g=document.cookie.split(";"),j=0;j<g.length;j++){var h=g[j].split("=");if(n.trim(h[0])==c)return h[1].length?unescape(n.trim(h[1])):null}},setCookie:function(c,g,j,h,a,d){var b=new Date;b.setTime(b.getTime());if(j)j=j*1E3*60*60*24;b=new Date(b.getTime()+j);document.cookie=c+"="+escape(g)+(j?";expires="+b.toGMTString():"")+(h?";path="+h:"")+(a?";domain="+a:"")+(d?";secure":"")},removeCookie:function(c,g,j){if(this.getCookie(c))document.cookie=
|
51
|
+
c+"="+(g?";path="+g:"")+(j?";domain="+j:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT"}}});
|
52
|
+
require.def("tabs/homeTab",["domplate/domplate","domplate/tabView","core/lib","core/cookies","core/trace","i18n!nls/homeTab",'text!tabs/homeTab.html!<div>\r\n<ul style="padding-left: 20px; line-height: 20px; margin-top: 0px">\r\n<li>Paste <a href="@HAR_SPEC_URL@">HAR</a>\r\nlog into the text box below and\r\npress the <b>Preview</b> button.</li>\r\n<li>Or drop <span class="red">*.har</span> file(s) anywhere on the page (if your browser supports that).</li>\r\n</ul>\r\n<table cellpadding="0" cellspacing="4">\r\n <tr>\r\n <td><input type="checkbox" id="validate" checked="true"></input></td>\r\n <td style="vertical-align:middle;padding-bottom: 1px;">Validate data before processing?</td>\r\n </tr>\r\n</table>\r\n<textarea id="sourceEditor" class="sourceEditor" cols="80" rows="5"></textarea>\r\n<p><table cellpadding="0" cellspacing="0">\r\n <tr>\r\n <td><button id="appendPreview">Preview</button></td>\r\n </tr>\r\n</table></p>\r\n<br/>\r\n<h3>HAR Log Examples</h3>\r\n<ul style="line-height:20px;">\r\n<li><span id="example1" class="link example" path="examples/inline-scripts-block.har">\r\nInline scripts block</span> - Inline scripts block the page load.</li>\r\n<li><span id="example2" class="link example" path="examples/browser-blocking-time.har">\r\nBlocking time</span> - Impact of a limit of max number of parallel connections.</li>\r\n<li><span id="example3" class="link example" path="examples/softwareishard.com.har">\r\nBrowser cache</span> - Impact of the browser cache on page load (the same page loaded three times).</li>\r\n<li><span id="example4" class="link example" path="examples/google.com.har">\r\nSingle page</span> - Single page load (empty cache).</li>\r\n</ul>\r\n<br/>\r\n<p><i>This viewer supports HAR 1.2 (see the <span class="linkAbout link">About</span> tab).<br/></i></p>\r\n</div>\r\n',"preview/harModel"],
|
53
|
+
function(n,c,g,j,h,a,d){with(n){n=function(){};n.prototype=g.extend(c.Tab.prototype,{id:"Home",label:a.homeTabLabel,bodyTag:DIV({"class":"homeBody"}),onUpdateBody:function(b,e){e=this.bodyTag.replace({},e);e.innerHTML=d.replace("@HAR_SPEC_URL@",b.harSpecURL,"g");$("#appendPreview").click(g.bindFixed(this.onAppendPreview,this));$(".linkAbout").click(g.bind(this.onAbout,this));b=$("#content");b.bind("dragenter",g.bind(g.cancelEvent,g));b.bind("dragover",g.bind(g.cancelEvent,g));b.bind("drop",g.bind(this.onDrop,
|
54
|
+
this));this.validateNode=$("#validate");if(b=j.getCookie("validate"))this.validateNode.attr("checked",b=="false"?false:true);this.validateNode.change(g.bind(this.onValidationChange,this));$(".example").click(g.bind(this.onLoadExample,this))},onAppendPreview:function(b){b||(b=$("#sourceEditor").val());b&&this.tabView.appendPreview(b)},onAbout:function(){this.tabView.selectTabByName("About")},onValidationChange:function(){var b=this.validateNode.attr("checked");j.setCookie("validate",b)},onLoadExample:function(b){b=
|
55
|
+
$.event.fix(b||window.event).target.getAttribute("path");var e=document.location.href,l=e.indexOf("?");document.location=e.substr(0,l)+"?path="+b;j.setCookie("timeline",true);j.setCookie("stats",true)},onDrop:function(b){var e=$.event.fix(b||window.event);g.cancelEvent(e);try{this.handleDrop(b.originalEvent.dataTransfer)}catch(l){h.exception("HomeTab.onDrop EXCEPTION",l)}},handleDrop:function(b){if(!b)return false;if(b=b.files)for(var e=0;e<b.length;e++)this.onAppendPreview(b[e].getAsText(""))},loadInProgress:function(b,
|
56
|
+
e){$("#sourceEditor").val(b?e?e:a.loadingHar:"")}});return n}});require.def("i18n!nls/homeTab",{root:{homeTabLabel:"Home",loadingHar:"Loading..."}});
|
57
|
+
require.def("preview/jsonSchema",[],function(){return{validate:function(n,c){return this._validate(n,c,false)},checkPropertyChange:function(n,c,g){return this._validate(n,c,g||"property")},_validate:function(n,c,g){function j(d,b,e,l){function m(u){a.push({property:e,message:u})}function f(u,v){if(u){if(typeof u=="string"&&u!="any"&&(u=="null"?v!==null:typeof v!=u)&&!(v instanceof Array&&u=="array")&&!(u=="integer"&&v%1===0))return[{property:e,message:typeof v+" value found, but a "+u+" is required"}];
|
58
|
+
if(u instanceof Array){for(var w=[],q=0;q<u.length;q++)if(!(w=f(u[q],v)).length)break;if(w.length)return w}else if(typeof u=="object"){w=a;a=[];j(v,u,e);u=a;a=w;return u}}return[]}var k;e+=e?typeof l=="number"?"["+l+"]":typeof l=="undefined"?"":"."+l:l;if((typeof b!="object"||b instanceof Array)&&(e||typeof b!="function")){if(typeof b=="function")d instanceof b||m("is not an instance of the class/constructor "+b.name);else b&&m("Invalid schema/property definition "+b);return null}g&&b.readonly&&m("is a readonly field, it can not be changed");
|
59
|
+
b["extends"]&&j(d,b["extends"],e,l);if(d===undefined)b.optional||m("is missing and it is not optional");else{a=a.concat(f(b.type,d));b.disallow&&!f(b.disallow,d).length&&m(" disallowed value was matched");if(d!==null){if(d instanceof Array){if(b.items)if(b.items instanceof Array){l=0;for(k=d.length;l<k;l++)a.concat(j(d[l],b.items[l],e,l))}else{l=0;for(k=d.length;l<k;l++)a.concat(j(d[l],b.items,e,l))}b.minItems&&d.length<b.minItems&&m("There must be a minimum of "+b.minItems+" in the array");b.maxItems&&
|
60
|
+
d.length>b.maxItems&&m("There must be a maximum of "+b.maxItems+" in the array")}else b.properties&&a.concat(h(d,b.properties,e,b.additionalProperties));b.pattern&&typeof d=="string"&&!d.match(b.pattern)&&m("does not match the regex pattern "+b.pattern);b.maxLength&&typeof d=="string"&&d.length>b.maxLength&&m("may only be "+b.maxLength+" characters long");b.minLength&&typeof d=="string"&&d.length<b.minLength&&m("must be at least "+b.minLength+" characters long");typeof b.minimum!==undefined&&typeof d==
|
61
|
+
typeof b.minimum&&b.minimum>d&&m("must have a minimum value of "+b.minimum);typeof b.maximum!==undefined&&typeof d==typeof b.maximum&&b.maximum<d&&m("must have a maximum value of "+b.maximum);if(b["enum"]){l=b["enum"];k=l.length;for(var o,p=0;p<k;p++)if(l[p]===d){o=1;break}o||m("does not have a value in the enumeration "+l.join(", "))}typeof b.maxDecimal=="number"&&d.toString().match(new RegExp("\\.[0-9]{"+(b.maxDecimal+1)+",}"))&&m("may only have "+b.maxDecimal+" digits of decimal places")}}return null}
|
62
|
+
function h(d,b,e,l){if(typeof b=="object"){if(typeof d!="object"||d instanceof Array)a.push({property:e,message:"an object is required"});for(var m in b)if(b.hasOwnProperty(m)&&!(m.charAt(0)=="_"&&m.charAt(1)=="_")){var f=d[m];j(f,b[m],e,m)}}for(m in d){d.hasOwnProperty(m)&&!(m.charAt(0)=="_"&&m.charAt(1)=="_")&&b&&!b[m]&&l===false&&a.push({property:e,message:typeof f+"The property "+m+" is not defined in the schema and the schema does not allow additional properties"});(f=b&&b[m]&&b[m].requires)&&
|
63
|
+
!(f in d)&&a.push({property:e,message:"the presence of the property "+m+" requires that "+f+" also be present"});f=d[m];b&&typeof b=="object"&&!(m in b)&&j(f,l,e,m);if(!g&&f&&f.$schema)a=a.concat(j(f,f.$schema,e,m))}return a}var a=[];if(c)j(n,c,"",g||"");!g&&n&&n.$schema&&j(n,n.$schema,"","");return{valid:!a.length,errors:a}}}});
|
64
|
+
require.def("preview/harModel",["core/lib","preview/jsonSchema","preview/ref","preview/harSchema","core/cookies","core/trace","jquery-plugins/jquery.json"],function(n,c,g,j,h,a){function d(){this.input=null}function b(){var e={};for(var l in this)if(l!="toJSON")e[l]=this[l];if(!this.text)return e;e.text=Array.map(this.text,function(m){var f=m.charCodeAt(0);if(f>=32&&f<127||f==10||f==13)return m.charAt(0);for(m=f.toString(16).toUpperCase();m.length<4;)m="0"+m;return"\\u"+m}).join("");return e}d.prototype=
|
65
|
+
{append:function(e){if(e){if(this.input)if(e.log.pages)for(var l=0;l<e.log.pages.length;l++)this.importPage(e.log.pages[l],e.log.entries);else{a.error("Import of additional data without a page is not yet supported.");return null}else this.input=e;return this.input}else a.error("HarModel.append; Trying to append null input!")},getPages:function(){if(!this.input)return[];return this.input.log.pages?this.input.log.pages:[]},getFirstPage:function(){var e=this.getPages();return e.length>0?e[0]:null},getPageEntries:function(e){return d.getPageEntries(this.input,
|
66
|
+
e)},getAllEntries:function(){return this.input?this.input.log.entries:[]},getParentPage:function(e){return d.getParentPage(this.input,e)},importPage:function(e,l){var m=this.getUniquePageID(e.id),f=e.id;e.id=m;this.input.log.pages.push(e);for(e=0;e<l.length;e++){var k=l[e];if(k.pageref==f){k.pageref=m;this.input.log.entries.push(k)}}},getUniquePageID:function(e){for(var l=this.input.log.pages,m={},f=0;f<l.length;f++)m[l[f].id]=true;if(!m[e])return e;for(l=1;;){f=e+l;if(!m[f])return f;l++}},toJSON:function(e){if(!e)e=
|
67
|
+
this.input;if(!e)return"";e=this.input.log.entries;for(var l=0;l<e.length;l++){var m=e[l];if(m.response.content.text)m.response.content.toJSON=b}return $.jSONToString(this.input,null,"\t").replace(/\\\\u/g,"\\u")},getSize:function(e){if(!e)e=this.input;if(!e)return 0;return dojo.toJson(e,true).length}};d.parse=function(e,l){var m=e;try{if(typeof e==="string")m=jQuery.toJSON(e)}catch(f){console.exception("HarModel.parse; EXCEPTION",f);throw{errors:[{message:"Failed to parse JSON",property:"JSON evaluation"}]};
|
68
|
+
}if(!l)return m;e=g.resolveJson(j);e=c.validate(m,e.logType);if(e.valid)return m;throw e;};d.getPageEntries=function(e,l){var m=[];e=e.log.entries;if(!e)return m;for(var f=0;f<e.length;f++){var k=e[f];!k.pageref&&!l&&m.push(k);l&&k.pageref==l.id&&m.push(k)}return m};d.getParentPage=function(e,l){e=e.log.pages;if(!e)return null;for(var m=0;m<e.length;m++)if(e[m].id==l.pageref)return e[m];return null};d.Loader={run:function(e,l){var m=n.getURLParameter("baseUrl");if(m&&m[m.length-1]!="/")m+="/";var f=
|
69
|
+
n.getURLParameters("path"),k=n.getURLParameter("callback"),o=n.getURLParameter("inputUrl"),p=[];for(var u in f)p.push(m?m+f[u]:f[u]);o&&p.push(o);if((m||o)&&p.length>0)return this.loadRemoteArchive(p,k,e,l);if(m=n.getURLParameter("path"))return this.loadLocalArchive(m,e,l)},loadExample:function(e){var l=document.location.href,m=l.indexOf("?");document.location=l.substr(0,m)+"?path="+e;h.setCookie("timeline",true);h.setCookie("stats",true)},loadLocalArchive:function(e,l,m){$.ajax({url:e,context:this,
|
70
|
+
success:function(f){l(f)},error:function(f,k){m(f,k)}});return true},loadRemoteArchive:function(e,l,m,f){if(!e.length)return false;var k=e.shift();l||(l="onInputData");$.ajax({url:k,context:this,dataType:"jsonp",jsonp:"callback",jsonpCallback:l,success:function(o){m(o);if(e.length){var p=this;setTimeout(function(){p.loadRemoteArchive(e,l,m,f)},300)}},error:function(o,p){f(o,p)}});return true}};return d});
|
71
|
+
require.def("preview/ref",["core/lib"],function(n){return{resolveJson:function(c,g){function j(p,u,v,w,q){var y,t;v=h in p?p[h]:v;if(v!==undefined)v=(a+v).replace(f,"$2$3");q=q||p;if(v!==undefined){if(d)p.__id=v;if(g.schemas&&!(p instanceof Array)&&(t=v.match(/^(.+\/)[^\.\[]*$/)))w=g.schemas[t[1]];if(b[v]&&p instanceof Array==b[v]instanceof Array){q=b[v];delete q.$ref;y=true}else if(t=w&&w.prototype){o.prototype=t;q=new o}b[v]=q;if(e)e[v]=g.time}w=w&&w.properties;var C=p.length;for(var x in p){if(x==
|
72
|
+
C)break;if(p.hasOwnProperty(x)){t=p[x];var H=w&&w[x];if(H&&H.format=="date-time"&&typeof t=="string")t=n.fromISOString(t);else if(typeof t=="object"&&t&&!(t instanceof Date))if(l=t.$ref){delete p[x];var F=l.replace(/(#)([^\.\[])/,"$1.$2").match(/(^([^\[]*\/)?[^#\.\[]*)#?([\.\[].*)?/);if(l=F[1]=="$"||F[1]=="this"||F[1]==""?c:b[(a+F[1]).replace(f,"$2$3")])F[3]&&F[3].replace(/(\[([^\]]+)\])|(\.?([^\.\[]+))/g,function(P,V,M,W,Q){l=l&&l[M?M.replace(/[\"\'\\]/,""):Q]});if(l)t=l;else if(u){t=j(t,false,t.$ref,
|
73
|
+
H);t._loadObject=g.loader}else{var E;E||m.push(q);E=true}}else u||(t=j(t,m==p,v&&k(v,x),H,q!=p&&typeof q[x]=="object"&&q[x]));p[x]=t;if(q!=p&&!q.__isDirty){H=q[x];q[x]=t;y&&t!==H&&!q._loadObject&&!(t instanceof Date&&H instanceof Date&&t.getTime()==H.getTime())&&!(typeof t=="function"&&typeof H=="function"&&t.toString()==H.toString())&&b.onUpdate&&b.onUpdate(q,x,H,t)}}}if(y)for(x in q){if(!q.__isDirty&&q.hasOwnProperty(x)&&!p.hasOwnProperty(x)&&x!="__id"&&x!="__clientId"&&!(q instanceof Array&&isNaN(x))){b.onUpdate&&
|
74
|
+
x!="_loadObject"&&x!="_idAttr"&&b.onUpdate(q,x,q[x],undefined);for(delete q[x];q instanceof Array&&q.length&&q[q.length-1]===undefined;)q.length--}}else b.onLoad&&b.onLoad(q);return q}g=g||{};var h=g.idAttribute||"id",a=g.idPrefix||"",d=g.assignAbsoluteIds,b=g.index||{},e=g.timeStamps,l,m=[],f=/^(.*\/)?(\w+:\/\/)|[^\/\.]+\/\.\.\/|^.*\/(\/)/,k=this._addProp,o=function(){};if(c&&typeof c=="object"){c=j(c,false,g.defaultId);j(m,false)}return c},_addProp:function(c,g){return c+(c.match(/#/)?c.length==
|
75
|
+
1?"":".":"#")+g}}});
|
76
|
+
require.def("preview/harSchema",[],function(){function n(){}var c=/^(\d{4})(-)?(\d\d)(-)?(\d\d)(T)?(\d\d)(:)?(\d\d)(:)?(\d\d)(\.\d+)?(Z|([+-])(\d\d)(:)?(\d\d))/,g={pageType:{id:"pageType",description:"Exported web page",optional:true,properties:{startedDateTime:{type:"string",format:"date-time",pattern:c},id:{type:"string",unique:true},title:{type:"string"},pageTimings:{$ref:"pageTimingsType"},comment:{type:"string",optional:true}}}};c={entryType:{id:"entryType",description:"Request and Response related info",optional:true,
|
77
|
+
properties:{pageref:{type:"string",optional:true},startedDateTime:{type:"string",format:"date-time",pattern:c},time:{type:"integer",min:0},request:{$ref:"requestType"},response:{$ref:"responseType"},cache:{$ref:"cacheType"},timings:{$ref:"timingsType"},serverIPAddress:{type:"string",optional:true},connection:{type:"string",optional:true},comment:{type:"string",optional:true}}}};n.prototype={registerType:function(){var h=function(a,d){for(name in d)if(d.hasOwnProperty(name)&&name!="prototype")a[name]=
|
78
|
+
d[name]};for(i=0;i<arguments.length;i+=1)h(this,arguments[i])}};var j=new n;j.registerType({logType:{id:"logType",description:"HTTP Archive structure.",type:"object",properties:{log:{type:"object",properties:{version:{type:"string"},creator:{$ref:"creatorType"},browser:{$ref:"browserType"},pages:{type:"array",optional:true,items:{$ref:"pageType"}},entries:{type:"array",items:{$ref:"entryType"}},comment:{type:"string",optional:true}}}}}},{creatorType:{id:"creatorType",description:"Name and version info of the log creator app.",
|
79
|
+
type:"object",properties:{name:{type:"string"},version:{type:"string"},comment:{type:"string",optional:true}}}},{browserType:{id:"browserType",description:"Name and version info of used browser.",type:"object",optional:true,properties:{name:{type:"string"},version:{type:"string"},comment:{type:"string",optional:true}}}},g,{pageTimingsType:{id:"pageTimingsType",description:"Timing info about page load",properties:{onContentLoad:{type:"number",optional:true,min:-1},onLoad:{type:"number",optional:true,
|
80
|
+
min:-1},comment:{type:"string",optional:true}}}},c,{requestType:{id:"requestType",description:"Monitored request",properties:{method:{type:"string"},url:{type:"string"},httpVersion:{type:"string"},cookies:{type:"array",items:{$ref:"cookieType"}},headers:{type:"array",items:{$ref:"recordType"}},queryString:{type:"array",items:{$ref:"recordType"}},postData:{$ref:"postDataType"},headersSize:{type:"integer"},bodySize:{type:"integer"},comment:{type:"string",optional:true}}}},{recordType:{id:"recordType",
|
81
|
+
description:"Helper name-value pair structure.",properties:{name:{type:"string"},value:{type:"string"},comment:{type:"string",optional:true}}}},{responseType:{id:"responseType",description:"Monitored Response.",properties:{status:{type:"integer"},statusText:{type:"string"},httpVersion:{type:"string"},cookies:{type:"array",items:{$ref:"cookieType"}},headers:{type:"array",items:{$ref:"recordType"}},content:{$ref:"contentType"},redirectURL:{type:"string"},headersSize:{type:"integer"},bodySize:{type:"integer"},
|
82
|
+
comment:{type:"string",optional:true}}}},{postDataType:{id:"postDataType",description:"Posted data info.",optional:true,properties:{mimeType:{type:"string"},text:{type:"string",optional:true},params:{type:"array",optional:true,properties:{name:{type:"string"},value:{type:"string",optional:true},fileName:{type:"string",optional:true},contentType:{type:"string",optional:true},comment:{type:"string",optional:true}}},comment:{type:"string",optional:true}}}},{contentType:{id:"contentType",description:"Response content",
|
83
|
+
properties:{size:{type:"integer"},compression:{type:"integer",optional:true},mimeType:{type:"string"},text:{type:"string",optional:true},encoding:{type:"string",optional:true},comment:{type:"string",optional:true}}}},{cacheType:{id:"cacheType",description:"Info about a response coming from the cache.",properties:{beforeRequest:{$ref:"cacheEntryType"},afterRequest:{$ref:"cacheEntryType"},comment:{type:"string",optional:true}}}},{cacheEntryType:{id:"cacheEntryType",optional:true,description:"Info about cache entry.",
|
84
|
+
properties:{expires:{type:"string",optional:"true"},lastAccess:{type:"string"},eTag:{type:"string"},hitCount:{type:"integer"},comment:{type:"string",optional:true}}}},{timingsType:{id:"timingsType",description:"Info about request-response timing.",properties:{dns:{type:"integer",min:-1},connect:{type:"integer",min:-1},blocked:{type:"integer",min:-1},send:{type:"integer",min:-1},wait:{type:"integer",min:-1},receive:{type:"integer",min:-1},ssl:{type:"integer",optional:true,min:-1},comment:{type:"string",
|
85
|
+
optional:true}}}});return j});require.def("i18n!nls/harViewer",{root:{aboutTabLabel:"About",schemaTabLabel:"Schema",domTabLabel:"HAR"}});
|
86
|
+
require.def("tabs/aboutTab",["domplate/domplate","domplate/tabView","core/lib","i18n!nls/harViewer"],function(n,c,g,j){with(n){n=function(){};n.prototype={id:"About",label:j.aboutTabLabel,tabHeaderTag:A({"class":"$tab.id\\Tab tab",view:"$tab.id",_repObject:"$tab"},"$tab.label",SPAN(" "),SPAN({"class":"version"},"$tab.tabView.version")),bodyTag:DIV({"class":"aboutBody"}),onUpdateBody:function(h,a){a=this.bodyTag.replace({},a);require(['text!tabs/AboutTab.html!<div>\r\n<h2>HTTP Archive Viewer @VERSION@</h2>\r\n<i>Author: Jan Odvarko, odvarko@gmail.com</i>\r\n<br/><br/>\r\n<table style="width:600px;">\r\n\r\n<tr><td>\r\n<p>The purpose of this online tool is to visualize\r\n<a href="@HAR_SPEC_URL@">\r\n HTTP Archive (HAR)</a>\r\nlog files (JSON) created by HTTP tracking tools. These files contain log of HTTP\r\nclient/server conversation and can be used for an additional analysis of e.g. \r\npage load performance.</p>\r\n\r\n<p>User interface of this tool is composed from the following tabs:</p>\r\n<ul>\r\n<li><b>Home</b> - Paste content of a log file into the text box in this tab.</li>\r\n<li><b>Preview</b> - Switch to this tab if you want to see visualised HTTP traffic.</li>\r\n<li><b>HAR</b> - Use this tab to see structure of the input JSON data as an expandable tree.</li>\r\n<li><b>Schema</b> - Explore format of the input log in this tab.</li>\r\n</ul>\r\n</td></tr>\r\n\r\n<tr><td>\r\n<h3>Discussion Group</h3>\r\n<p>Feedback: <a href="http://groups.google.com/group/http-archive-specification">\r\n http://groups.google.com/group/http-archive-specification</a></p>\r\n<p>Report issue: <a href="http://code.google.com/p/harviewer/issues/list">\r\n http://code.google.com/p/harviewer/issues/list</a></p>\r\n</td></tr>\r\n\r\n<tr><td>\r\n<h3>Create Logs using Firebug 1.5</h3>\r\nOne of the tools you can use to log data transfered over HTTP protocol\r\nis <b>Firebug</b>. To do this you have to also install Firebug extension\r\ncalled <b>NetExport.</b>\r\n\r\n<p>Recommended configurations:</p>\r\n<ul>\r\n <li><a href="http://getfirebug.com/releases/firebug/1.5/">\r\n Firebug 1.5</a> +\r\n <a href="http://getfirebug.com/releases/netexport/">NetExport 0.8</a>\r\n </li>\r\n</ul>\r\n</td></tr>\r\n\r\n<tr><td>\r\n<h3>HTTP Archive Specification</h3>\r\n<p>Required\r\n<a href="@HAR_SPEC_URL@">\r\nstructure</a> of the input HTTP Archive file (*.har) is described using\r\n<a href="http://www.json.com/json-schema-proposal/">JSON Schema</a>.\r\nYou can explore the current schema definition within the <b>Shema</b>\r\ntab on this page.</p>\r\n</td></tr>\r\n\r\n<tr><td>\r\n<h3>Request Timing Fields</h3>\r\n<p>Part of the HTTP log is also a timing info about network request executions.\r\nHere is a description of individual request/response phases:</p>\r\n<ul>\r\n<li><i>Blocking</i> - Time spent in a queue waiting for a network connection.</li>\r\n<li><i>DNS Lookup</i> - DNS resolution time. The time required to resolve a host name.</li>\r\n<li><i>Connecting</i> - Time required to create TCP connection.</li>\r\n<li><i>Sending</i> - Time required to send HTTP request to the server.</li>\r\n<li><i>Waiting</i> - Waiting for a response from the server.</li>\r\n<li><i>Receiving</i> - Time required to read entire response from the server (or cache).</li>\r\n</ul>\r\n</td></tr>\r\n\r\n<tr><td>\r\n<h3>Online Log Files</h3>\r\n<p>HAR Viewer also support JSONP and so it\'s possible to load log files \r\nfrom differet domains. This allows to link your online logs and preview them\r\nautomaticaly within the viewer. See live\r\n<a href="?inputUrl=http://www.janodvarko.cz/har/viewer/examples/inline-scripts-block.harp">example</a>.\r\n</p>\r\n\r\n<p><i>1. The Content of a *.har file must be enclosed within a callback function:</i></p>\r\n<code>onInputData({ "log": { ... } })</code>\r\n\r\n<p><i>2. The link displaying a *.har file (using this viewer) must specify URL of\r\nthe file in <b>inputUrl</b> parameter:</i></p>\r\n<code>http://www.softwareishard.com/har/viewer/?inputUrl=http://www.example.com/netData.har</code>\r\n\r\n<p><i>3. A custom name of the callback function can be specified in a <b>callback</b> parameter\r\n(by default it\'s <b>onInputData</b>):</i></p>\r\n<code>http://www.softwareishard.com/har/viewer/?inputUrl=http://www.example.com/netData.har&callback=onInputData</code>\r\n<br/><br/>\r\n</td></tr>\r\n\r\n</table>\r\n</div>\r\n'],
|
87
|
+
function(d){d=d.replace("@VERSION@",h.version,"g");d=d.replace("@HAR_SPEC_URL@",h.harSpecURL,"g");a.innerHTML=d})}};return n}});
|
88
|
+
require.def("i18n!nls/previewTab",{root:{previewTabLabel:"Preview",showTimelineButton:"Show Page Timeline",hideTimelineButton:"Hide Page Timeline",showTimelineTooltip:"Show/hide statistic preview for selected pages in the timeline.",showStatsButton:"Show Statistics",hideStatsButton:"Hide Statistics",showStatsTooltip:"Show/hide page timeline.",clearButton:"Clear",clearTooltip:"Remove all HAR logs from the viewer",downloadTooltip:"Download all current data in one HAR file.",downloadError:"Failed to save HAR data"}});
|
89
|
+
require.def("tabs/previewTab",["domplate/domplate","domplate/tabView","core/lib","i18n!nls/previewTab","domplate/toolbar","tabs/pageTimeline","tabs/pageStats","preview/pageList","core/cookies","downloadify/js/swfobject","downloadify/src/downloadify"],function(n,c,g,j,h,a,d,b,e){with(n){n=function(l){this.model=l;this.toolbar=new h;this.timeline=new a;this.stats=new d(l,this.timeline);l=this.getToolbarButtons();for(var m=0;m<l.length;m++)this.toolbar.addButton(l[m])};n.prototype=g.extend(c.Tab.prototype,
|
90
|
+
{id:"Preview",label:j.previewTabLabel,tabBodyTag:DIV({"class":"tab$tab.id\\Body tabBody",_repObject:"$tab"},DIV({"class":"previewToolbar"}),DIV({"class":"previewTimeline"}),DIV({"class":"previewStats"}),DIV({"class":"previewList"})),errorTable:TABLE({"class":"errorTable",cellpadding:0,cellspacing:5},TBODY(FOR("error","$errors",TR({"class":"errorRow",_repObject:"$error"},TD({"class":"errorProperty"},SPAN("$error.property")),TD(" "),TD({"class":"errorMessage"},SPAN("$error.message")))))),onUpdateBody:function(l,
|
91
|
+
m){this.toolbar.render(g.$(m,"previewToolbar"));this.stats.render(g.$(m,"previewStats"));this.timeline.render(g.$(m,"previewTimeline"));(l=this.model.input)&&e.getCookie("timeline")=="true"&&this.onTimeline(false);l&&e.getCookie("stats")=="true"&&this.onStats(false);var f=this.model;$(".harDownloadButton").downloadify({filename:function(){return"netData.har"},data:function(){return f?f.toJSON():""},onComplete:function(){},onCancel:function(){},onError:function(){alert(j.downloadError)},swf:"scripts/downloadify/media/downloadify.swf",
|
92
|
+
downloadImage:"css/images/download-sprites.png",width:16,height:16,transparent:true,append:false})},getToolbarButtons:function(){var l=[{id:"showTimeline",label:j.showTimelineButton,tooltiptext:j.showTimelineTooltip,command:g.bindFixed(this.onTimeline,this,true)},{id:"showStats",label:j.showStatsButton,tooltiptext:j.showStatsTooltip,command:g.bindFixed(this.onStats,this,true)},{label:j.clearButton,tooltiptext:j.clearTooltip,command:g.bindFixed(this.onClear,this)}];$.browser.mozilla&&l.push({tooltiptext:j.downloadTooltip,
|
93
|
+
className:"harDownloadButton"});return l},onTimeline:function(l){this.timeline.toggle(l);l=this.toolbar.getButton("showTimeline");var m=this.timeline.isVisible();l.label=j[m?"hideTimelineButton":"showTimelineButton"];this.toolbar.render();e.setCookie("timeline",m)},onStats:function(l){this.stats.toggle(l);l=this.toolbar.getButton("showStats");var m=this.stats.isVisible();l.label=j[m?"hideStatsButton":"showStatsButton"];this.toolbar.render();e.setCookie("stats",m)},onClear:function(){var l=document.location.href,
|
94
|
+
m=l.indexOf("?");document.location=l.substr(0,m)},append:function(l){(new b(l)).append(g.$(this._body,"previewList"));this.timeline.append(l)},appendError:function(l){l.errors&&this.errorTable.append(l,g.$(this._body,"previewList"))}});return n}});
|
95
|
+
require.def("domplate/toolbar",["domplate/domplate","core/lib","core/trace"],function(n,c){with(n){var g=domplate({tag:DIV({"class":"toolbar",onclick:"$onClick"}),buttonTag:SPAN({"class":"$button.className toolbarButton",title:"$button.tooltiptext",$text:"$button|hasLabel",onclick:"$button|getCommand"},"$button|getLabel"),separatorTag:SPAN({"class":"toolbarSeparator",style:"color: gray;"},"|"),hasLabel:function(j){return j.label?true:false},getLabel:function(j){return j.label?j.label:""},getCommand:function(j){return j.command?
|
96
|
+
j.command:function(){}},onClick:function(j){j=$.event.fix(j||window.event);c.cancelEvent(j)}});n=function(){this.buttons=[]};n.prototype={addButton:function(j){j.tooltiptext||(tooltiptext="");this.buttons.push(j)},getButton:function(j){for(var h=0;h<this.buttons.length;h++)if(this.buttons[h].id==j)return this.buttons[h]},render:function(j){if(this.element)j=this.element.parentNode;this.element=g.tag.replace({},j);for(j=0;j<this.buttons.length;j++){var h=this.buttons[j];(h.tag?h.tag:g.buttonTag).append({button:h},
|
97
|
+
this.element);j<this.buttons.length-1&&g.separatorTag.append({},this.element)}return this.element}};return n}});require.def("i18n!nls/pageTimeline",{root:{pageLoad:"Page Load",request:"Request",requests:"Requests",pageBarTooltip:"Click to select and include in statistics preview."}});
|
98
|
+
require.def("tabs/pageTimeline",["domplate/domplate","core/lib","core/trace","i18n!nls/pageTimeline","preview/harModel"],function(n,c,g,j,h){with(n){var a=function(){this.listeners=[];this.element=null;this.maxElapsedTime=-1;this.lastSelectedBar=null};a.prototype=domplate({graphCols:FOR("page","$input|getPages",TD({"class":"pageTimelineCol"},DIV({"class":"pageBar",_input:"$input",_page:"$page",title:j.pageBarTooltip,style:"height: $page|getHeight\\px",onmousemove:"$onMouseMove",onclick:"$onClick"}))),
|
99
|
+
pageGraph:TABLE({"class":"pageTimelineTable",cellpadding:0,cellspacing:0},TBODY(TR({"class":"pageTimelineRow"},TAG("$graphCols",{input:"$input"})))),tag:DIV({"class":"pageTimelineBody",style:"height: auto; display: none"},TABLE({style:"margin: 7px;",cellpadding:0,cellspacing:0},TBODY(TR(TD(TAG("$pageGraph",{input:"$input"}))),TR(TD({"class":"pageDescContainer",colspan:2}))))),getHeight:function(b){var e=1;b=b.pageTimings.onLoad;if(b>0&&this.maxElapsedTime>0)e=Math.round(b/this.maxElapsedTime*100);
|
100
|
+
return Math.max(1,e)},onClick:function(b){var e=$.event.fix(b||window.event);b=e.target;if(c.hasClass(b,"pageBar")){var l=c.isControlClick(e);e=c.isShiftClick(e);var m=c.getAncestorByClass(b,"pageTimelineRow");!l&&!e&&d.unselectAll(m,b);d.toggle(b);this.selectionChanged()}},onMouseMove:function(b){b=$.event.fix(b||window.event).target;if(c.hasClass(b,"pageBar"))if(this.highlightedPage!=b.page){this.highlightedPage=b.page;var e=c.getElementByClass(this.element,"pageDescContainer");a.Desc.render(e,
|
101
|
+
b)}},getPages:function(b){return b.log.pages?b.log.pages:[]},getPageBar:function(b){if(this.element)for(var e=c.getElementByClass(this.element,"pageTimelineTable").firstChild.firstChild.firstChild;e;){if(e.firstChild.page==b)return e.firstChild;e=e.nextSibling}},recalcLayout:function(){for(var b=this.maxElapsedTime=0,e=c.getElementsByClass(this.element,"pageBar"),l=0;l<e.length;l++){var m=e[l].page.pageTimings.onLoad;if(m>0&&this.maxElapsedTime<m)this.maxElapsedTime=m}if(b!=this.maxElapsedTime)for(l=
|
102
|
+
0;l<e.length;l++)e[l].style.height=this.getHeight(e[l].page)+"px"},updateDesc:function(){if(this.isVisible())if(!this.highlightedPage){var b=c.getElementByClass(this.element,"pageBar");b&&c.fireEvent(b,"mousemove")}},addListener:function(b){this.listeners.push(b)},removeListener:function(b){remove(this.listeners,b)},selectionChanged:function(){var b=this.getSelection();c.dispatch(this.listeners,"onSelectionChange",[b])},removeSelection:function(){if(this.element){var b=c.getElementByClass(this.element,
|
103
|
+
"pageTimelineRow");d.unselectAll(b);this.selectionChanged()}},getSelection:function(){if(!this.isVisible())return[];var b=c.getElementByClass(this.element,"pageTimelineRow");return d.getSelection(b)},show:function(b){if(!this.isVisible()){if(!b||$.browser.msie)this.element.style.display="block";else $(this.element).slideDown();c.setClass(this.element,"opened");this.updateDesc()}},hide:function(b){if(this.isVisible()){if(!b||$.browser.msie)this.element.style.display="none";else $(this.element).slideUp();
|
104
|
+
c.removeClass(this.element,"opened");this.removeSelection()}},isVisible:function(){return c.hasClass(this.element,"opened")},toggle:function(b){this.isVisible()?this.hide(b):this.show(b)},render:function(b){this.element=this.tag.replace({input:{log:{pages:[]}}},b,this);this.recalcLayout();return this.element},append:function(b){if(this.element){var e=c.getElementByClass(this.element,"pageTimelineRow");this.graphCols.insertCols({input:b},e,this);this.recalcLayout();this.updateDesc()}}});a.Desc=domplate({tag:DIV({"class":"pageDescBox"},
|
105
|
+
DIV({"class":"connector"}),DIV({"class":"desc"},SPAN({"class":"summary"},"$object|getSummary"),SPAN({"class":"time"},"$object.page|getTime"),SPAN({"class":"title"},"$object.page|getTitle"),PRE({"class":"comment"},"$object.page|getComment"))),getSummary:function(b){var e="",l=b.page.pageTimings.onLoad;if(l>0)e+=j.pageLoad+": "+c.formatTime(l)+", ";b=h.getPageEntries(b.input,b.page).length;e+=b+" "+(b==1?j.request:j.requests);return e},getTime:function(b){b=c.parseISO8601(b.startedDateTime);return(new Date(b)).toLocaleString()},
|
106
|
+
getTitle:function(b){return b.title},getComment:function(b){return b.comment?b.comment:""},render:function(b,e){b=this.tag.replace({object:{input:e.input,page:e.page}},b);c.$(b,"connector").style.marginLeft=e.parentNode.offsetLeft+"px";return b}});var d={isSelected:function(b){return c.hasClass(b,"selected")},toggle:function(b){c.toggleClass(b,"selected")},select:function(b){this.isSelected(b)||c.setClass(b,"selected")},unselect:function(b){this.isSelected(b)&&c.removeClass(b,"selected")},getSelection:function(b){var e=
|
107
|
+
[];b=c.getElementsByClass(b,"pageBar");for(var l=0;l<b.length;l++){var m=b[l];this.isSelected(m)&&e.push(m.page)}return e},unselectAll:function(b,e){b=c.getElementsByClass(b,"pageBar");for(var l=0;l<b.length;l++)e!=b[l]&&this.unselect(b[l])}};return a}});
|
108
|
+
require.def("i18n!nls/pageStats",{root:{pieLabelDNS:"DNS",pieLabelSSL:"SSL/TLS",pieLabelConnect:"Connect",pieLabelBlocked:"Blocked",pieLabelSend:"Send",pieLabelWait:"Wait",pieLabelReceive:"Receive",pieLabelHTMLText:"HTML/Text",pieLabelJavaScript:"JavaScript",pieLabelCSS:"CSS",pieLabelImage:"Image",pieLabelFlash:"Flash",pieLabelOthers:"Others",pieLabelHeadersSent:"Headers Sent",pieLabelBodiesSent:"Bodies Sent",pieLabelHeadersReceived:"Headers Received",pieLabelBodiesReceived:"Bodies Received",pieLabelDownloaded:"Downloaded",
|
109
|
+
pieLabelPartial:"Partial",pieLabelFromCache:"From Cache"}});
|
110
|
+
require.def("tabs/pageStats",["domplate/domplate","core/lib","i18n!nls/pageStats","preview/harSchema","preview/harModel","core/cookies","domplate/infoTip","core/trace"],function(n,c,g,j,h,a,d){with(n){var b=function(){};b.prototype={data:[],title:"",getLabelTooltipText:function(q){return q.label+": "+c.formatSize(q.value)},cleanUp:function(){for(var q=0;q<this.data.length;q++){this.data[q].value=0;this.data[q].count=0}}};n=function(){};n.prototype=c.extend(b.prototype,{title:"Summary of request times.",
|
111
|
+
data:[{value:0,label:g.pieLabelDNS,color:"rgb(119, 192, 203)"},{value:0,label:g.pieLabelSSL,color:"rgb(168, 196, 173)"},{value:0,label:g.pieLabelConnect,color:"rgb(179, 222, 93)"},{value:0,label:g.pieLabelBlocked,color:"rgb(228, 214, 193)"},{value:0,label:g.pieLabelSend,color:"rgb(224, 171, 157)"},{value:0,label:g.pieLabelWait,color:"rgb(163, 150, 190)"},{value:0,label:g.pieLabelReceive,color:"rgb(194, 194, 194)"}],getLabelTooltipText:function(q){return q.label+": "+c.formatTime(q.value)}});j=function(){};
|
112
|
+
j.prototype=c.extend(b.prototype,{title:"Summary of content types.",data:[{value:0,label:g.pieLabelHTMLText,color:"rgb(174, 234, 218)"},{value:0,label:g.pieLabelJavaScript,color:"rgb(245, 230, 186)"},{value:0,label:g.pieLabelCSS,color:"rgb(212, 204, 219)"},{value:0,label:g.pieLabelImage,color:"rgb(220, 171, 181)"},{value:0,label:g.pieLabelFlash,color:"rgb(166, 156, 222)"},{value:0,label:g.pieLabelOthers,color:"rgb(229, 171, 255)"}],getLabelTooltipText:function(q){return q.count+"x "+q.label+": "+
|
113
|
+
c.formatSize(q.value)}});h=function(){};h.prototype=c.extend(b.prototype,{title:"Summary of sent and received bodies & headers.",data:[{value:0,label:g.pieLabelHeadersSent,color:"rgb(247, 179, 227)"},{value:0,label:g.pieLabelBodiesSent,color:"rgb(226, 160, 241)"},{value:0,label:g.pieLabelHeadersReceived,color:"rgb(166, 232, 166)"},{value:0,label:g.pieLabelBodiesReceived,color:"rgb(168, 196, 173)"}]});a=function(){};a.prototype=c.extend(b.prototype,{title:"Comparison of downloaded data from the server and browser cache.",
|
114
|
+
data:[{value:0,label:g.pieLabelDownloaded,color:"rgb(182, 182, 182)"},{value:0,label:g.pieLabelPartial,color:"rgb(218, 218, 218)"},{value:0,label:g.pieLabelFromCache,color:"rgb(239, 239, 239)"}],getLabelTooltipText:function(q){return q.count+"x "+q.label+": "+c.formatSize(q.value)}});var e=new n,l=new j,m=new h,f=new a,k={"text/javascript":1,"text/jscript":1,"application/javascript":1,"application/x-javascript":1,"text/js":1},o={"text/plain":1,"text/html":1},p={"text/css":1},u={"image/png":1,"image/jpeg":1},
|
115
|
+
v={"application/x-shockwave-flash":1};g=function(q,y){this.model=q;this.timeline=y;this.timeline.addListener(this)};g.prototype=domplate({element:null,tag:DIV({"class":"pageStatsBody",style:"height: auto; display: none"}),update:function(q){if(this.isVisible()){this.cleanUp();q.length||q.push(null);for(var y=0;y<q.length;y++){var t=q[y];t=t?this.model.getPageEntries(t):this.model.getAllEntries();for(var C=0;C<t.length;C++){var x=t[C];e.data[0].value+=x.timings.dns;e.data[1].value+=x.timings.ssl?x.timings.ssl:
|
116
|
+
-1;e.data[2].value+=x.timings.connect;e.data[3].value+=x.timings.blocked;e.data[4].value+=x.timings.send;e.data[5].value+=x.timings.wait;e.data[6].value+=x.timings.receive;if(x.timings.ssl>0)e.data[2].value-=x.timings.ssl;var H=x.response,F=H.bodySize>0?H.bodySize:0,E=H.content.mimeType;E=(E=E?E.match(/^([^;]+)/)[1]:null)?E:H.content.mimeType;if(o[E]){l.data[0].value+=F;l.data[0].count++}else if(k[E]){l.data[1].value+=F;l.data[1].count++}else if(p[E]){l.data[2].value+=F;l.data[2].count++}else if(u[E]){l.data[3].value+=
|
117
|
+
F;l.data[3].count++}else if(v[E]){l.data[4].value+=F;l.data[4].count++}else{l.data[5].value+=F;l.data[5].count++}m.data[0].value+=x.request.headersSize>0?x.request.headersSize:0;m.data[1].value+=x.request.bodySize>0?x.request.bodySize:0;m.data[2].value+=x.response.headersSize>0?x.response.headersSize:0;m.data[3].value+=F;if(x.response.status==206){f.data[1].value+=F;f.data[1].count++}else if(x.response.status==304){f.data[2].value+=F;f.data[2].count++}else if(F>0){f.data[0].value+=F;f.data[0].count++}}}b.draw(c.$(this.timingPie,
|
118
|
+
"pieGraph"),e);b.draw(c.$(this.contentPie,"pieGraph"),l);b.draw(c.$(this.trafficPie,"pieGraph"),m);b.draw(c.$(this.cachePie,"pieGraph"),f)}},cleanUp:function(){e.cleanUp();l.cleanUp();m.cleanUp();f.cleanUp()},showInfoTip:function(q,y,t,C){return b.showInfoTip(q,y,t,C)},onSelectionChange:function(q){this.update(q)},show:function(q){if(!this.isVisible()){d.addListener(this);c.setClass(this.element,"opened");if(!q||$.browser.msie)this.element.style.display="block";else $(this.element).slideDown();this.update(this.timeline.getSelection())}},
|
119
|
+
hide:function(q){if(this.isVisible()){d.removeListener(this);c.removeClass(this.element,"opened");if(!q||$.browser.msie)this.element.style.display="none";else $(this.element).slideUp()}},isVisible:function(){return c.hasClass(this.element,"opened")},toggle:function(q){this.isVisible()?this.hide(q):this.show(q)},render:function(q){this.element=this.tag.replace({},q);this.timingPie=b.render(e,this.element);this.contentPie=b.render(l,this.element);this.trafficPie=b.render(m,this.element);this.cachePie=
|
120
|
+
b.render(f,this.element);this.cachePie.style.borderRight=0;return this.element}});b=domplate({tag:TABLE({"class":"pagePieTable",cellpadding:0,cellspacing:0,_repObject:"$pie"},TBODY(TR(TD({"class":"pieBox",title:"$pie.title"}),TD(FOR("item","$pie.data",DIV({"class":"pieLabel",_repObject:"$item"},SPAN({"class":"box",style:"background-color: $item.color"}," "),SPAN({"class":"label"},"$item.label"))))))),render:function(q,y){q=this.tag.append({pie:q},y);y=c.$(q,"pieBox");var t=document.createElement("canvas");
|
121
|
+
t.setAttribute("class","pieGraph ");t.setAttribute("height","100");t.setAttribute("width","100");y.appendChild(t);typeof G_vmlCanvasManager!="undefined"&&G_vmlCanvasManager.initElement(t);return q},draw:function(q,y){if(q&&q.getContext){var t=q.getContext("2d"),C=Math.min(q.width,q.height)/2,x=[q.width/2,q.height/2];t.clearRect(0,0,q.width,q.height);q=0;y=y.data;var H=0;for(var F in y)H+=y[F].value;if(H)for(F=0;F<y.length;F++){var E=y[F].value/H;t.beginPath();t.moveTo(x[0],x[1]);t.arc(x[0],x[1],C,
|
122
|
+
Math.PI*(-0.5+2*q),Math.PI*(-0.5+2*(q+E)),false);t.lineTo(x[0],x[1]);t.closePath();t.fillStyle=y[F].color;t.fill();q+=E}else{t.beginPath();t.moveTo(x[0],x[1]);t.arc(x[0],x[1],C,0,Math.PI*2,false);t.closePath();t.fillStyle="rgb(229,236,238)";t.lineStyle="lightgray";t.fill()}}},showInfoTip:function(q,y){var t=c.getAncestorByClass(y,"pagePieTable");if(!t)return false;if(y=c.getAncestorByClass(y,"pieLabel")){w.render(t.repObject,y.repObject,q);return true}}});var w=domplate({tag:DIV({"class":"pieLabelInfoTip"},
|
123
|
+
"$text"),getText:function(q){return q.label+": "+formatTime(q.value)},render:function(q,y,t){this.tag.replace({text:q.getLabelTooltipText(y)},t)}});return g}});
|
124
|
+
require.def("domplate/infoTip",["domplate/domplate","core/lib","core/trace"],function(n,c){with(n){n=c.extend({listeners:[],maxWidth:100,maxHeight:80,infoTipMargin:10,infoTipWindowPadding:25,tags:domplate({infoTipTag:DIV({"class":"infoTip"})}),initialize:function(){if(!$.browser.msie){var g=$("body");g.bind("mouseover",c.bind(this.onMouseMove,this));g.bind("mouseout",c.bind(this.onMouseOut,this));g.bind("mousemove",c.bind(this.onMouseMove,this));return this.infoTip=this.tags.infoTipTag.append({},
|
125
|
+
c.getBody(document))}},showInfoTip:function(g,j,h,a,d,b){var e=c.getOverflowParent(j);if(c.dispatch2(this.listeners,"showInfoTip",[g,j,h+(e?e.scrollLeft:0),a,d,b])){d=g.ownerDocument.documentElement;j=d.clientWidth;d=d.clientHeight;if(h+g.offsetWidth+this.infoTipMargin>j-this.infoTipWindowPadding){g.style.left="auto";g.style.right=j-h+this.infoTipMargin+"px"}else{g.style.left=h+this.infoTipMargin+"px";g.style.right="auto"}g.style.top=a+g.offsetHeight+this.infoTipMargin>d?Math.max(0,d-(g.offsetHeight+
|
126
|
+
this.infoTipMargin))+"px":a+this.infoTipMargin+"px";g.style.bottom="auto";g.setAttribute("active","true")}else this.hideInfoTip(g)},hideInfoTip:function(g){g&&g.removeAttribute("active")},onMouseOut:function(g){g.relatedTarget||this.hideInfoTip(this.infoTip)},onMouseMove:function(g){this.infoTip.setAttribute("multiline",false);this.showInfoTip(this.infoTip,g.target,g.clientX,g.clientY,g.rangeParent,g.rangeOffset)},populateTimingInfoTip:function(g,j){this.tags.colorTag.replace({rgbValue:j},g);return true},
|
127
|
+
addListener:function(g){this.listeners.push(g)},removeListener:function(g){c.remove(this.listeners,g)}});n.initialize();return n}});
|
128
|
+
require.def("i18n!nls/requestList",{root:{fromCache:"From Cache",menuBreakLayout:"Break Timeline Layout",menuOpenRequestInWindow:"Open Request in New Window",menuOpenResponseInWindow:"Open Response in New Window",request:"Request",requests:"Requests",tooltipSize:"%S (%S bytes)",tooltipZippedSize:"%S (%S bytes) - compressed",tooltipUnzippedSize:"%S (%S bytes) - uncompressed","request.Started":"Started","request.phase.Resolving":"DNS Lookup","request.phase.Connecting":"Connecting","request.phase.Blocking":"Blocking",
|
129
|
+
"request.phase.Sending":"Sending","request.phase.Waiting":"Waiting","request.phase.Receiving":"Receiving",ContentLoad:"DOM Loaded",WindowLoad:"Page Loaded","page.event.Load":"Page Loaded",menuBreakTimeline:"Break Timeline Layout",menuOpenRequest:"Open Request in New Window",menuOpenResponse:"Open Response in New Window"}});
|
130
|
+
require.def("preview/requestList",["domplate/domplate","core/lib","i18n!nls/requestList","preview/harModel","core/cookies","preview/requestBody","domplate/infoTip","domplate/popupMenu"],function(n,c,g,j,h,a,d,b){with(n){n=function(f){this.input=f;d.addListener(this)};n.prototype=domplate({tableTag:TABLE({"class":"netTable",cellpadding:0,cellspacing:0,onclick:"$onClick"},TBODY(TR(TD({width:"20%"}),TD({width:"10%"}),TD({width:"10%"}),TD({width:"10%"}),TD({width:"50%"}),TD({width:"15px"})))),fileTag:FOR("file",
|
131
|
+
"$files",TR({"class":"netRow loaded",$hasHeaders:"$file|hasResponseHeaders",$responseError:"$file|isError",$fromCache:"$file|isFromCache"},TD({"class":"netHrefCol netCol"},DIV({"class":"netHrefLabel netLabel",style:"margin-left: $file|getIndent\\px"},"$file|getHref"),DIV({"class":"netFullHrefLabel netHrefLabel netLabel",style:"margin-left: $file|getIndent\\px"},"$file|getFullHref")),TD({"class":"netStatusCol netCol"},DIV({"class":"netStatusLabel netLabel"},"$file|getStatus")),TD({"class":"netDomainCol netCol"},
|
132
|
+
DIV({"class":"netDomainLabel netLabel"},"$file|getDomain")),TD({"class":"netSizeCol netCol"},DIV({"class":"netSizeLabel netLabel"},"$file|getSize")),TD({"class":"netTimeCol netCol"},DIV({"class":"netTimelineBar"}," ",DIV({"class":"netResolvingBar netBar",style:"left: $file.offset"}),DIV({"class":"netConnectingBar netBar",style:"left: $file.offset"}),DIV({"class":"netBlockingBar netBar",style:"left: $file.offset"}),DIV({"class":"netSendingBar netBar",style:"left: $file.offset"}),DIV({"class":"netWaitingBar netBar",
|
133
|
+
style:"left: $file.offset"}),DIV({"class":"netContentLoadBar netBar",style:"left: $file.offset"}),DIV({"class":"netWindowLoadBar netBar",style:"left: $file.offset"}),DIV({"class":"netReceivingBar netBar",style:"left: $file.offset; width: $file.width"},SPAN({"class":"netTimeLabel"},"$file|getElapsedTime")))),TD({"class":"netOptionsCol netCol"},DIV({"class":"netOptionsLabel netLabel",onclick:"$onOpenOptions"})))),headTag:TR({"class":"netHeadRow"},TD({"class":"netHeadCol",colspan:6},DIV({"class":"netHeadLabel"},
|
134
|
+
"$doc.rootFile.href"))),netInfoTag:TR({"class":"netInfoRow"},TD({"class":"netInfoCol",colspan:6})),summaryTag:TR({"class":"netRow netSummaryRow"},TD({"class":"netCol",colspan:3},DIV({"class":"netCountLabel netSummaryLabel"},"-")),TD({"class":"netTotalSizeCol netCol"},DIV({"class":"netTotalSizeLabel netSummaryLabel"},"0KB")),TD({"class":"netTotalTimeCol netCol"},DIV({"class":"",style:"width: 100%"},DIV({"class":"netCacheSizeLabel netSummaryLabel"},"(",SPAN("0KB"),SPAN(" "+g.fromCache),")"),DIV({"class":"netTimeBar"},
|
135
|
+
SPAN({"class":"netTotalTimeLabel netSummaryLabel"},"0ms")))),TD({"class":"netCol"})),getIndent:function(){return 0},isError:function(f){f=Math.floor(f.response.status/100);return f==4||f==5},isFromCache:function(f){return f.cache&&f.cache.afterRequest},getHref:function(f){return f.request.method+" "+c.getFileName(this.getFullHref(f))},getFullHref:function(f){return f.request.url},getStatus:function(f){return(f.response.status>0?f.response.status+" ":"")+f.response.statusText},getDomain:function(f){return c.getPrettyDomain(f.request.url)},
|
136
|
+
getSize:function(f){var k=f.response.bodySize;return this.formatSize(k&&k!=-1?k:f.response.content.size)},hasResponseHeaders:function(){return true},formatSize:function(f){return c.formatSize(f)},getElapsedTime:function(f){return c.formatTime(f.time)},onClick:function(f){var k=$.event.fix(f||window.event);if(c.isLeftClick(f))if(k=c.getAncestorByClass(k.target,"netRow")){this.toggleHeadersRow(k);c.cancelEvent(f)}},toggleHeadersRow:function(f){if(c.hasClass(f,"hasHeaders")){var k=f.repObject;c.toggleClass(f,
|
137
|
+
"opened");if(c.hasClass(f,"opened")){var o=this.netInfoTag.insertRows({},f)[0];o.repObject=k;(new a).render(o.firstChild,k)}else{o=f.nextSibling;c.getElementByClass(o,"netInfoBody");f.parentNode.removeChild(o)}}},onOpenOptions:function(f){var k=$.event.fix(f||window.event);c.cancelEvent(f);if(c.isLeftClick(f)){f=k.target;k=this.getOptionsMenuItems(c.getAncestorByClass(f,"netRow"));(new b({id:"requestContextMenu",items:k})).showPopup(f)}},getOptionsMenuItems:function(f){var k=f.repObject;return[{label:g.menuBreakTimeline,
|
138
|
+
type:"checkbox",disabled:false,checked:f.phase.files[0]==k,command:c.bind(this.breakLayout,this,f)},"-",{label:g.menuOpenRequest,command:c.bind(this.openRequest,this,k)},{label:g.menuOpenResponse,disabled:!k.response.content.text,command:c.bind(this.openResponse,this,k)}]},openRequest:function(f,k){window.open(k.request.url)},openResponse:function(f,k){f=k.response.content.mimeType;var o=k.response.content.encoding;window.open("data:"+(f?f:"")+";"+(o?o:"")+","+k.response.content.text)},breakLayout:function(f,
|
139
|
+
k){f=k.repObject;k.breakLayout=k.phase.files[0]!=f;k=c.getAncestorByClass(k,"netTable");f=j.getParentPage(this.input,f);this.updateLayout(k,f)},updateLayout:function(f,k){var o=j.getPageEntries(this.input,k);this.table=f;f=this.firstRow=this.table.firstChild.firstChild.nextSibling;this.phases=[];var p=h.getCookie("phaseInterval");p||(p=1E3);var u=null,v=k?c.parseISO8601(k.startedDateTime):null,w=0,q=0;if(k&&k.pageTimings){q=k.pageTimings;w=q.onLoad>0?q.onLoad:0;q=q.onContentLoad>0?q.onContentLoad:
|
140
|
+
0}for(var y=0;y<o.length;y++){var t=o[y];if(c.hasClass(f,"netInfoRow"))f=f.nextSibling;f.repObject=t;v||(v=c.parseISO8601(t.startedDateTime));var C=c.parseISO8601(t.startedDateTime),x=u?c.parseISO8601(u.getLastStartTime()):0;x=C-x>=p&&C>v+w;if(typeof f.breakLayout=="boolean")if(!u||f.breakLayout)u=this.startPhase(t);else u.addFile(t);else if(!u||x)u=this.startPhase(t);else u.addFile(t);if(u.startTime==undefined||u.startTime>C)u.startTime=C;if(u.endTime==undefined||u.endTime<C+t.time)u.endTime=C+t.time;
|
141
|
+
if(t.phase==this.phases[0]&&u.endTime<v+w)u.endTime=v+w;if(t.phase==this.phases[0]&&u.endTime<v+q)u.endTime=v+q;f=f.nextSibling}this.updateTimeline(k);this.updateSummaries(k)},startPhase:function(f){f=new e(f);this.phases.push(f);return f},calculateFileTimes:function(f,k,o){if(o!=k.phase){o=k.phase;this.phaseStartTime=o.startTime;this.phaseEndTime=o.endTime;this.phaseElapsed=this.phaseEndTime-o.startTime}var p=k.timings.dns<0?0:k.timings.dns,u=p+(k.timings.connect<0?0:k.timings.connect),v=u+(k.timings.blocked<
|
142
|
+
0?0:k.timings.blocked),w=v+(k.timings.send<0?0:k.timings.send),q=w+(k.timings.wait<0?0:k.timings.wait),y=q+(k.timings.receive<0?0:k.timings.receive);this.barOffset=((c.parseISO8601(k.startedDateTime)-this.phaseStartTime)/this.phaseElapsed*100).toFixed(3);this.barResolvingWidth=(p/this.phaseElapsed*100).toFixed(3);this.barConnectingWidth=(u/this.phaseElapsed*100).toFixed(3);this.barBlockingWidth=(v/this.phaseElapsed*100).toFixed(3);this.barSendingWidth=(w/this.phaseElapsed*100).toFixed(3);this.barWaitingWidth=
|
143
|
+
(q/this.phaseElapsed*100).toFixed(3);this.barReceivingWidth=(y/this.phaseElapsed*100).toFixed(3);if(f){p=c.parseISO8601(f.startedDateTime);u=f.pageTimings.onContentLoad;if(k.phase==this.phases[0]&&u>0)this.contentLoadBarOffset=((p+u-o.startTime)/this.phaseElapsed*100).toFixed(3);f=f.pageTimings.onLoad;if(k.phase==this.phases[0]&&f>0)this.windowLoadBarOffset=((p+f-o.startTime)/this.phaseElapsed*100).toFixed(3)}return o},updateTimeline:function(f){for(var k,o=this.firstRow;o;o=o.nextSibling){var p=
|
144
|
+
o.repObject;if(p)if(!c.hasClass(o,"netInfoRow")){k=this.calculateFileTimes(f,p,k);o.phase=p.phase;delete p.phase;p=c.getElementByClass(o,"netResolvingBar");var u=p.nextSibling,v=u.nextSibling,w=v.nextSibling,q=w.nextSibling,y=q.nextSibling,t=y.nextSibling,C=t.nextSibling;p.style.left=u.style.left=v.style.left=w.style.left=q.style.left=C.style.left=this.barOffset+"%";p.style.width=this.barResolvingWidth+"%";u.style.width=this.barConnectingWidth+"%";v.style.width=this.barBlockingWidth+"%";w.style.width=
|
145
|
+
this.barSendingWidth+"%";q.style.width=this.barWaitingWidth+"%";C.style.width=this.barReceivingWidth+"%";if(this.contentLoadBarOffset){y.style.left=this.contentLoadBarOffset+"%";y.style.display="block";this.contentLoadBarOffset=null}if(this.windowLoadBarOffset){t.style.left=this.windowLoadBarOffset+"%";t.style.display="block";this.windowLoadBarOffset=null}}}},updateSummaries:function(f){for(var k=this.phases,o=0,p=0,u=0,v=0,w=0;w<k.length;++w){var q=k[w];q.invalidPhase=false;q=this.summarizePhase(q);
|
146
|
+
o+=q.fileCount;p+=q.totalSize;u+=q.cachedSize;v+=q.totalTime}if(k=this.summaryRow){c.getElementByClass(k,"netCountLabel").firstChild.nodeValue=this.formatRequestCount(o);o=c.getElementByClass(k,"netTotalSizeLabel");o.setAttribute("totalSize",p);o.firstChild.nodeValue=c.formatSize(p);p=c.getElementByClass(k,"netCacheSizeLabel");p.setAttribute("collapsed",u==0);p.childNodes[1].firstChild.nodeValue=c.formatSize(u);u=c.getElementByClass(k,"netTotalTimeLabel");v=c.formatTime(v);if(f&&f.pageTimings.onLoad>
|
147
|
+
0)v+=" (onload: "+c.formatTime(f.pageTimings.onLoad)+")";u.innerHTML=v}},formatRequestCount:function(f){return f+" "+(f==1?g.request:g.requests)},summarizePhase:function(f){var k=0,o=0,p="all";if(p=="all")p=null;for(var u=0,v=0,w=0,q=0;q<f.files.length;q++){var y=f.files[q],t=c.parseISO8601(y.startedDateTime);if(!p||y.category==p){++u;var C=y.response.bodySize;C=C&&C!=-1?C:y.response.content.size;o+=C;if(y.response.status==304)k+=C;if(!v||t<v)v=t;y=t+y.time;if(y>w)w=y}}return{cachedSize:k,totalSize:o,
|
148
|
+
totalTime:w-v,fileCount:u}},showInfoTip:function(f,k){var o=c.getAncestorByClass(k,"netRow");if(o)if(c.getAncestorByClass(k,"netBar")){f.setAttribute("multiline",true);this.infoTipURL=k=o.repObject.startedDateTime+"-nettime";return this.populateTimeInfoTip(f,o)}else if(c.hasClass(k,"netSizeLabel")){this.infoTipURL=k=o.repObject.startedDateTime+"-netsize";return this.populateSizeInfoTip(f,o)}},populateTimeInfoTip:function(f,k){l.render(this.input,k,f);return true},populateSizeInfoTip:function(f,k){m.render(this.input,
|
149
|
+
k,f);return true},render:function(f,k){var o=j.getPageEntries(this.input,k);if(o.length){this.table=this.tableTag.replace({},f,this);this.summaryRow=this.summaryTag.insertRows({},this.table.firstChild)[0];this.fileTag.insertRows({files:o},this.table.firstChild.lastChild.previousSibling,this);this.updateLayout(this.table,k)}}});var e=function(f){this.files=[];this.addFile(f)};e.prototype={addFile:function(f){this.files.push(f);f.phase=this},getLastStartTime:function(){return this.files[this.files.length-
|
150
|
+
1].startedDateTime}};var l=domplate({tableTag:TABLE({"class":"timeInfoTip"},TBODY()),timingsTag:FOR("time","$timings",TR({"class":"timeInfoTipRow",$collapsed:"$time|hideBar"},TD({"class":"$time|getBarClass timeInfoTipBar",$loaded:"$time.loaded",$fromCache:"$time.fromCache"}),TD({"class":"timeInfoTipCell startTime"},"$time.start|formatStartTime"),TD({"class":"timeInfoTipCell elapsedTime"},"$time.elapsed|formatTime"),TD("$time|getLabel"))),startTimeTag:TR(TD(),TD("$startTime.time|formatStartTime"),
|
151
|
+
TD({colspan:2},"$startTime|getLabel")),separatorTag:TR(TD({colspan:4,height:"10px"})),eventsTag:FOR("event","$events",TR({"class":"timeInfoTipEventRow"},TD({"class":"timeInfoTipBar",align:"center"},DIV({"class":"$event|getBarClass timeInfoTipEventBar"})),TD("$event.start|formatStartTime"),TD({colspan:2},"$event|getLabel"))),hideBar:function(f){return!f.elapsed&&f.bar=="request.phase.Blocking"},getBarClass:function(f){return"net"+f.bar.substr(f.bar.lastIndexOf(".")+1)+"Bar"},formatTime:function(f){return c.formatTime(f)},
|
152
|
+
formatStartTime:function(f){var k=f>0,o=c.formatTime(Math.abs(f));if(!f)return o;return(k>0?"+":"-")+o},getLabel:function(f){return g[f.bar]},render:function(f,k,o){var p=k.repObject;var u=(f=j.getParentPage(f,p))?c.parseISO8601(f.startedDateTime):null,v=c.parseISO8601(p.startedDateTime);o=l.tableTag.replace({},o);var w={};w.time=v-k.phase.startTime;w.bar="request.Started";this.startTimeTag.insertRows({startTime:w},o.firstChild);this.separatorTag.insertRows({},o.firstChild);k=0;w=[];var q=p.timings.dns,
|
153
|
+
y=p.timings.connect,t=p.timings.blocked,C=p.timings.send,x=p.timings.wait,H=p.timings.receive;q>=0&&w.push({bar:"request.phase.Resolving",elapsed:q,start:k});if(y>=0)w.push({bar:"request.phase.Connecting",elapsed:y,start:k+=q<0?0:q});if(t>=0)w.push({bar:"request.phase.Blocking",elapsed:t,start:k+=y<0?0:y});if(C>=0)w.push({bar:"request.phase.Sending",elapsed:C,start:k+=t<0?0:t});if(x>=0)w.push({bar:"request.phase.Waiting",elapsed:x,start:k+=C<0?0:C});if(H>=0)w.push({bar:"request.phase.Receiving",elapsed:H,
|
154
|
+
start:k+(x<0?0:x),loaded:p.loaded,fromCache:p.fromCache});this.timingsTag.insertRows({timings:w},o.firstChild);p=[];f&&f.pageTimings.onContentLoad>0&&p.push({bar:"ContentLoad",start:u+f.pageTimings.onContentLoad-v});f&&f.pageTimings.onLoad>0&&p.push({bar:"WindowLoad",start:u+f.pageTimings.onLoad-v});if(p.length){this.separatorTag.insertRows({},o.firstChild);this.eventsTag.insertRows({events:p},o.firstChild);return true}}}),m=domplate({tag:DIV({"class":"sizeInfoTip"},"$file|getSize"),zippedTag:DIV(DIV({"class":"sizeInfoTip"},
|
155
|
+
"$file|getBodySize"),DIV({"class":"sizeInfoTip"},"$file|getContentSize")),getSize:function(f){f=f.response.bodySize;return c.formatString(g.tooltipSize,[c.formatSize(f),f.size<0?"?":c.formatNumber(f)])},getBodySize:function(f){f=f.response.bodySize;return c.formatString(g.tooltipZippedSize,[c.formatSize(f),f.size<0?"?":c.formatNumber(f)])},getContentSize:function(f){f=f.response.content.size;return c.formatString(g.tooltipUnzippedSize,[c.formatSize(f),f.size<0?"?":c.formatNumber(f)])},render:function(f,
|
156
|
+
k,o){f=k.repObject;if(f.response.bodySize==f.response.content.size)return this.tag.replace({file:f},o);return this.zippedTag.replace({file:f},o)}});return n}});
|
157
|
+
require.def("preview/pageList",["domplate/domplate","core/lib","core/trace","preview/requestList"],function(n,c,g,j){with(n){n=function(h){this.input=h};n.prototype=domplate({tableTag:TABLE({"class":"pageTable",cellpadding:0,cellspacing:0,onclick:"$onClick",_repObject:"$input"},TBODY(TAG("$rowTag",{groups:"$input.log.pages"}))),rowTag:FOR("group","$groups",TR({"class":"pageRow",_repObject:"$group"},TD({"class":"groupName pageCol"},SPAN({"class":"pageName"},"$group|getPageTitle")))),bodyTag:TR({"class":"pageInfoRow",
|
158
|
+
style:"height:auto;"},TD({"class":"pageInfoCol"})),getPageTitle:function(h){return c.cropString(h.title,100)},getPageID:function(h){return"["+h.id+"]"},onClick:function(h){var a=$.event.fix(h||window.event);if(c.isLeftClick(h))if(a=c.getAncestorByClass(a.target,"pageRow")){this.toggleRow(a);c.cancelEvent(h)}},toggleRow:function(h,a){if(!(c.hasClass(h,"opened")&&a)){c.toggleClass(h,"opened");if(c.hasClass(h,"opened")){a=this.bodyTag.insertRows({},h)[0];(new j(this.input)).render(a.firstChild,h.repObject)}else{a=
|
159
|
+
h.nextSibling;h.parentNode.removeChild(a)}}},expandAll:function(h){for(h=h.firstChild.firstChild;h;){hasClass(h,"pageRow")&&this.toggleRow(h,true);h=h.nextSibling}},getPageRow:function(h){for(var a=c.getElementsByClass(this.element.parentNode,"pageRow"),d=0;d<a.length;d++){var b=a[d];if(b.repObject==h)return b}},togglePage:function(h){this.toggleRow(this.getPageRow(h))},expandPage:function(h){this.toggleRow(this.getPageRow(h),true)},collapsePage:function(h){h=this.getPageRow(h);c.hasClass(h,"opened")&&
|
160
|
+
this.toggleRow(h)},append:function(h){(new j(this.input)).render(h,null);var a=this.input.log.pages;if(a&&a.length){h=this.tableTag.append({input:this.input},h,this);h.firstChild.childNodes.length==1&&h.parentNode.childNodes.length==1&&this.toggleRow(h.firstChild.firstChild)}},render:function(h){this.append(h)}});return n}});
|
161
|
+
require.def("i18n!nls/requestBody",{root:{RequestHeaders:"Request Headers",ResponseHeaders:"Response Headers",RequestCookies:"Request Cookies",ResponseCookies:"Response Cookies",URLParameters:"Params",Headers:"Headers",Post:"Post",Put:"Put",Cookies:"Cookies",Response:"Response",Cache:"Cache",HTML:"HTML"}});
|
162
|
+
require.def("preview/requestBody",["domplate/domplate","i18n!nls/requestBody","core/lib","domplate/tabView","syntax-highlighter/shCore"],function(n,c,g,j,h){with(n){n=function(){};n.prototype=domplate({render:function(f,k){var o=new j("requestBody");o.appendTab(new a(k));k.request.queryString&&k.request.queryString.length&&o.appendTab(new b(k));k.request.postData&&o.appendTab(new e(k,k.request.method));k.response.content.size>0&&o.appendTab(new d(k));this.showCache(k)&&o.appendTab(new l(k));this.showHtml(k)&&
|
163
|
+
o.appendTab(new m(k));f=o.render(f);o.selectTabByName("Headers");return f},showCache:function(f){if(!f.cache)return false;if(!f.cache.afterRequest)return false;if(f.category=="image")return false;return true},showHtml:function(f){return f.response.content.mimeType=="text/html"||f.mimeType=="application/xhtml+xml"}});var a=function(f){this.file=f};a.prototype=domplate(j.Tab.prototype,{id:"Headers",label:c.Headers,bodyTag:TABLE({"class":"netInfoHeadersText netInfoText netInfoHeadersTable",cellpadding:0,
|
164
|
+
cellspacing:0},TBODY(TR({"class":"netInfoResponseHeadersTitle"},TD({colspan:2},DIV({"class":"netInfoHeadersGroup"},c.ResponseHeaders))),TR({"class":"netInfoRequestHeadersTitle"},TD({colspan:2},DIV({"class":"netInfoHeadersGroup"},c.RequestHeaders))))),headerDataTag:FOR("param","$headers",TR(TD({"class":"netInfoParamName"},"$param.name"),TD({"class":"netInfoParamValue"},PRE("$param|getParamValue")))),getParamValue:function(f){return g.wrapText(f.value,true)},onUpdateBody:function(f,k){this.file.response.headers&&
|
165
|
+
this.insertHeaderRows(k,this.file.response.headers,"Headers","ResponseHeaders");this.file.request.headers&&this.insertHeaderRows(k,this.file.request.headers,"Headers","RequestHeaders")},insertHeaderRows:function(f,k,o,p){o=g.getElementByClass(f,"netInfo"+o+"Table");p=g.getElementByClass(o,"netInfo"+p+"Title");if(k.length){this.headerDataTag.insertRows({headers:k},p?p:f);g.removeClass(p,"collapsed")}else g.setClass(p,"collapsed")}});var d=function(f){this.file=f};d.prototype=domplate(j.Tab.prototype,
|
166
|
+
{id:"Response",label:c.Response,bodyTag:DIV({"class":"netInfoResponseText netInfoText"},PRE({"class":"javascript:nocontrols:nogutter:",name:"code"})),onUpdateBody:function(f,k){f=g.getElementByClass(k,"netInfoResponseText");if(this.file.category=="image"){g.clearNode(f);k=k.ownerDocument.createElement("img");k.src=this.file.href;f.appendChild(k,f)}else{g.clearNode(f.firstChild);k=this.file.response.content.text;var o=this.file.response.content.mimeType;if(o=="application/javascript"||o=="text/javascript"||
|
167
|
+
o=="application/x-javascript"||o=="text/ecmascript"||o=="application/ecmascript"){f.firstChild.innerHTML=k;h.SyntaxHighlighter.HighlightAll(f.firstChild)}else g.insertWrappedText(k,f.firstChild)}}});var b=function(f){this.file=f};b.prototype=domplate(a.prototype,{id:"Params",label:c.URLParameters,bodyTag:TABLE({"class":"netInfoParamsText netInfoText netInfoParamsTable",cellpadding:0,cellspacing:0},TBODY()),onUpdateBody:function(f,k){this.file.request.queryString&&this.insertHeaderRows(g.getElementByClass(k,
|
168
|
+
"netInfoParamsText"),this.file.request.queryString,"Params")}});var e=function(f,k){k=k.charAt(0).toUpperCase()+k.slice(1).toLowerCase();this.file=f;this.id=k;this.label=c[k]};e.prototype=domplate(a.prototype,{bodyTag:DIV({"class":"netInfo$tab.id\\Text netInfoText"},TABLE({"class":"netInfo$tab.id\\Table",cellpadding:0,cellspacing:0},TBODY())),onUpdateBody:function(f,k){if(f=this.file.request.postData){k=g.getElementByClass(k,"netInfo"+this.id+"Text");f.mimeType=="application/x-www-form-urlencoded"?
|
169
|
+
this.insertHeaderRows(k,f.params,this.id):g.insertWrappedText(f.text,k)}}});(function(f){this.file=f}).prototype=domplate(a.prototype,{id:"Cookies",label:c.Cookies,bodyTag:DIV({"class":"netInfoCookiesText netInfoText"},TABLE({"class":"netInfoCookiesTable",cellpadding:0,cellspacing:0},TBODY(TR({"class":"netInfoResponseCookiesTitle"},TD({colspan:2},DIV({"class":"netInfoCookiesGroup"},c.ResponseCookies))),TR({"class":"netInfoRequestCookiesTitle"},TD({colspan:2},DIV({"class":"netInfoCookiesGroup"},c.RequestCookies)))))),
|
170
|
+
onUpdateBody:function(f,k){if(file.response.cookies){f=g.getElementByClass(k,"netInfoParamsText");this.insertHeaderRows(f,file.response.cookies,"Cookies","ResponseCookies")}if(file.request.cookies){f=g.getElementByClass(k,"netInfoParamsText");this.insertHeaderRows(f,file.request.cookies,"Cookies","RequestCookies")}}});var l=function(f){this.file=f};l.prototype=domplate(a.prototype,{id:"Cache",label:c.Cache,bodyTag:DIV({"class":"netInfoCacheText netInfoText"},TABLE({"class":"netInfoCacheTable",cellpadding:0,
|
171
|
+
cellspacing:0},TBODY())),onUpdateBody:function(f,k){if(this.file.cache&&this.file.cache.afterRequest){f=this.file.cache.afterRequest;var o=[];for(var p in f)o.push({name:p,value:f[p]});this.insertHeaderRows(k,o,"Cache")}}});var m=function(f){this.file=f};m.prototype=domplate(a.prototype,{id:"HTML",label:c.HTML,bodyTag:DIV({"class":"netInfoHtmlText netInfoText"},IFRAME({"class":"netInfoHtmlPreview"})),onUpdateBody:function(f,k){g.getElementByClass(k,"netInfoHtmlPreview").contentWindow.document.body.innerHTML=
|
172
|
+
this.file.response.content.text}});return n}});
|
173
|
+
require.def("syntax-highlighter/shCore",[],function(){var n={sh:{Toolbar:{},Utils:{},RegexLib:{},Brushes:{},Strings:{AboutDialog:'<html><head><title>About...</title></head><body class="dp-about"><table cellspacing="0"><tr><td class="copy"><p class="title">dp.SyntaxHighlighter</div><div class="para">Version: {V}</p><p><a href="http://www.dreamprojections.com/syntaxhighlighter/?ref=about" target="_blank">http://www.dreamprojections.com/syntaxhighlighter</a></p>©2004-2007 Alex Gorbatchev.</td></tr><tr><td class="footer"><input type="button" class="close" value="OK" onClick="window.close()"/></td></tr></table></body></html>'},ClipboardSwf:null,
|
174
|
+
Version:"1.5.1"}};n.SyntaxHighlighter=n.sh;n.sh.Toolbar.Commands={ExpandSource:{label:"+ expand source",check:function(c){return c.collapse},func:function(c,g){c.parentNode.removeChild(c);g.div.className=g.div.className.replace("collapsed","")}},ViewSource:{label:"view plain",func:function(c,g){c=n.sh.Utils.FixForBlogger(g.originalCode).replace(/</g,"<");g=window.open("","_blank","width=750, height=400, location=0, resizable=1, menubar=0, scrollbars=0");g.document.write('<textarea style="width:99%;height:99%">'+
|
175
|
+
c+"</textarea>");g.document.close()}},CopyToClipboard:{label:"copy to clipboard",check:function(){return window.clipboardData!=null||n.sh.ClipboardSwf!=null},func:function(c,g){c=n.sh.Utils.FixForBlogger(g.originalCode).replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&");if(window.clipboardData)window.clipboardData.setData("text",c);else if(n.sh.ClipboardSwf!=null){var j=g.flashCopier;if(j==null){j=document.createElement("div");g.flashCopier=j;g.div.appendChild(j)}j.innerHTML='<embed src="'+
|
176
|
+
n.sh.ClipboardSwf+'" FlashVars="clipboard='+encodeURIComponent(c)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>'}alert("The code is in your clipboard now")}},PrintSource:{label:"print",func:function(c,g){c=document.createElement("IFRAME");var j=null;c.style.cssText="position:absolute;width:0px;height:0px;left:-500px;top:-500px;";document.body.appendChild(c);j=c.contentWindow.document;n.sh.Utils.CopyStyles(j,window.document);j.write('<div class="'+g.div.className.replace("collapsed",
|
177
|
+
"")+' printing">'+g.div.innerHTML+"</div>");j.close();c.contentWindow.focus();c.contentWindow.print();alert("Printing...");document.body.removeChild(c)}},About:{label:"?",func:function(){var c=window.open("","_blank","dialog,width=300,height=150,scrollbars=0"),g=c.document;n.sh.Utils.CopyStyles(g,window.document);g.write(n.sh.Strings.AboutDialog.replace("{V}",n.sh.Version));g.close();c.focus()}}};n.sh.Toolbar.Create=function(c){var g=document.createElement("DIV");g.className="tools";for(var j in n.sh.Toolbar.Commands){var h=
|
178
|
+
n.sh.Toolbar.Commands[j];h.check!=null&&!h.check(c)||(g.innerHTML+='<a href="#" onclick="dp.sh.Toolbar.Command(\''+j+"',this);return false;\">"+h.label+"</a>")}return g};n.sh.Toolbar.Command=function(c,g){for(var j=g;j!=null&&j.className.indexOf("dp-highlighter")==-1;)j=j.parentNode;j!=null&&n.sh.Toolbar.Commands[c].func(g,j.highlighter)};n.sh.Utils.CopyStyles=function(c,g){g=g.getElementsByTagName("link");for(var j=0;j<g.length;j++)g[j].rel.toLowerCase()=="stylesheet"&&c.write('<link type="text/css" rel="stylesheet" href="'+
|
179
|
+
g[j].href+'"></link>')};n.sh.Utils.FixForBlogger=function(c){return n.sh.isBloggerMode==true?c.replace(/<br\s*\/?>|<br\s*\/?>/gi,"\n"):c};n.sh.RegexLib={MultiLineCComments:new RegExp("/\\*[\\s\\S]*?\\*/","gm"),SingleLineCComments:new RegExp("//.*$","gm"),SingleLinePerlComments:new RegExp("#.*$","gm"),DoubleQuotedString:new RegExp('"(?:\\.|(\\\\\\")|[^\\""\\n])*"',"g"),SingleQuotedString:new RegExp("'(?:\\.|(\\\\\\')|[^\\''\\n])*'","g")};n.sh.Match=function(c,g,j){this.value=c;this.index=g;this.length=
|
180
|
+
c.length;this.css=j};n.sh.Highlighter=function(){this.noGutter=false;this.addControls=true;this.collapse=false;this.tabsToSpaces=true;this.wrapColumn=80;this.showColumns=true};n.sh.Highlighter.SortCallback=function(c,g){if(c.index<g.index)return-1;else if(c.index>g.index)return 1;else if(c.length<g.length)return-1;else if(c.length>g.length)return 1;return 0};n.sh.Highlighter.prototype.CreateElement=function(c){c=document.createElement(c);c.highlighter=this;return c};n.sh.Highlighter.prototype.GetMatches=
|
181
|
+
function(c,g){for(var j=null;(j=c.exec(this.code))!=null;)this.matches[this.matches.length]=new n.sh.Match(j[0],j.index,g)};n.sh.Highlighter.prototype.AddBit=function(c,g){if(!(c==null||c.length==0)){var j=this.CreateElement("SPAN");c=c.replace(/ /g," ");c=c.replace(/</g,"<");c=c.replace(/\n/gm," <br>");if(g!=null)if(/br/gi.test(c)){c=c.split(" <br>");for(var h=0;h<c.length;h++){j=this.CreateElement("SPAN");j.className=g;j.innerHTML=c[h];this.div.appendChild(j);h+1<c.length&&this.div.appendChild(this.CreateElement("BR"))}}else{j.className=
|
182
|
+
g;j.innerHTML=c;this.div.appendChild(j)}else{j.innerHTML=c;this.div.appendChild(j)}}};n.sh.Highlighter.prototype.IsInside=function(c){if(c==null||c.length==0)return false;for(var g=0;g<this.matches.length;g++){var j=this.matches[g];if(j!=null)if(c.index>j.index&&c.index<j.index+j.length)return true}return false};n.sh.Highlighter.prototype.ProcessRegexList=function(){for(var c=0;c<this.regexList.length;c++)this.GetMatches(this.regexList[c].regex,this.regexList[c].css)};n.sh.Highlighter.prototype.ProcessSmartTabs=
|
183
|
+
function(c){function g(b,e,l){var m=b.substr(0,e);b=b.substr(e+1,b.length);e="";for(var f=0;f<l;f++)e+=" ";return m+e+b}function j(b,e){if(b.indexOf(a)==-1)return b;for(var l=0;(l=b.indexOf(a))!=-1;)b=g(b,l,e-l%e);return b}c=c.split("\n");for(var h="",a="\t",d=0;d<c.length;d++)h+=j(c[d],4)+"\n";return h};n.sh.Highlighter.prototype.SwitchToList=function(){var c=this.div.innerHTML.replace(/<(br)\/?>/gi,"\n").split("\n");this.addControls==true&&this.bar.appendChild(n.sh.Toolbar.Create(this));if(this.showColumns){for(var g=
|
184
|
+
this.CreateElement("div"),j=this.CreateElement("div"),h=1;h<=150;)if(h%10==0){g.innerHTML+=h;h+=(h+"").length}else{g.innerHTML+="·";h++}j.className="columns";j.appendChild(g);this.bar.appendChild(j)}h=0;for(g=this.firstLine;h<c.length-1;h++,g++){j=this.CreateElement("LI");var a=this.CreateElement("SPAN");j.className=h%2==0?"alt":"";a.innerHTML=c[h]+" ";j.appendChild(a);this.ol.appendChild(j)}this.div.innerHTML=""};n.sh.Highlighter.prototype.Highlight=function(c){function g(e){return e.replace(/^\s*(.*?)[\s\n]*$/g,
|
185
|
+
"$1")}function j(e){return e.replace(/\n*$/,"").replace(/^\n*/,"")}function h(e){e=n.sh.Utils.FixForBlogger(e).split("\n");for(var l=new RegExp("^\\s*","g"),m=1E3,f=0;f<e.length&&m>0;f++)if(g(e[f]).length!=0){var k=l.exec(e[f]);if(k!=null&&k.length>0)m=Math.min(k[0].length,m)}if(m>0)for(f=0;f<e.length;f++)e[f]=e[f].substr(m);return e.join("\n")}function a(e,l,m){return e.substr(l,m-l)}var d=0;if(c==null)c="";this.originalCode=c;this.code=j(h(c));this.div=this.CreateElement("DIV");this.bar=this.CreateElement("DIV");
|
186
|
+
this.ol=this.CreateElement("OL");this.matches=[];this.div.className="dp-highlighter";this.div.highlighter=this;this.bar.className="bar";this.ol.start=this.firstLine;if(this.CssClass!=null)this.ol.className=this.CssClass;if(this.collapse)this.div.className+=" collapsed";if(this.noGutter)this.div.className+=" nogutter";if(this.tabsToSpaces==true)this.code=this.ProcessSmartTabs(this.code);this.ProcessRegexList();if(this.matches.length==0)this.AddBit(this.code,null);else{this.matches=this.matches.sort(n.sh.Highlighter.SortCallback);
|
187
|
+
for(c=0;c<this.matches.length;c++)if(this.IsInside(this.matches[c]))this.matches[c]=null;for(c=0;c<this.matches.length;c++){var b=this.matches[c];if(!(b==null||b.length==0)){this.AddBit(a(this.code,d,b.index),null);this.AddBit(b.value,b.css);d=b.index+b.length}}this.AddBit(this.code.substr(d),null)}this.SwitchToList();this.div.appendChild(this.bar);this.div.appendChild(this.ol)};n.sh.Highlighter.prototype.GetKeywords=function(c){return"\\b"+c.replace(/ /g,"\\b|\\b")+"\\b"};n.sh.BloggerMode=function(){n.sh.isBloggerMode=
|
188
|
+
true};n.sh.HighlightAll=function(c,g,j,h,a,d){function b(){for(var y=arguments,t=0;t<y.length;t++)if(y[t]!=null){if(typeof y[t]=="string"&&y[t]!="")return y[t]+"";if(typeof y[t]=="object"&&y[t].value!="")return y[t].value+""}return null}function e(y,t){for(var C=0;C<t.length;C++)if(t[C]==y)return true;return false}function l(y,t,C){y=new RegExp("^"+y+"\\[(\\w+)\\]$","gi");for(var x=null,H=0;H<t.length;H++)if((x=y.exec(t[H]))!=null)return x[1];return C}function m(y,t,C){C=document.getElementsByTagName(C);
|
189
|
+
for(var x=0;x<C.length;x++)C[x].getAttribute("name")==t&&y.push(C[x])}var f=[],k=null,o={};if(typeof c=="string"){m(f,c,"pre");m(f,c,"textarea")}else f.push(c);if(f.length!=0){for(var p in n.sh.Brushes){k=n.sh.Brushes[p].Aliases;if(k!=null)for(c=0;c<k.length;c++)o[k[c]]=p}for(c=0;c<f.length;c++){p=f[c];var u=b(p.attributes["class"],p.className,p.attributes.language,p.language);k="";if(u!=null){u=u.split(":");k=u[0].toLowerCase();if(o[k]!=null){k=new n.sh.Brushes[o[k]];p.style.display="none";k.noGutter=
|
190
|
+
g==null?e("nogutter",u):!g;k.addControls=j==null?!e("nocontrols",u):j;k.collapse=h==null?e("collapse",u):h;k.showColumns=d==null?e("showcolumns",u):d;var v=document.getElementsByTagName("head")[0];if(k.Style&&v){var w=document.createElement("style");w.setAttribute("type","text/css");if(w.styleSheet)w.styleSheet.cssText=k.Style;else{var q=document.createTextNode(k.Style);w.appendChild(q)}v.appendChild(w)}k.firstLine=a==null?parseInt(l("firstline",u,1)):a;k.Highlight(p.innerHTML);k.source=p;p.parentNode.insertBefore(k.div,
|
191
|
+
p)}}}}};n.sh.Brushes.JScript=function(){this.regexList=[{regex:n.sh.RegexLib.SingleLineCComments,css:"comment"},{regex:n.sh.RegexLib.MultiLineCComments,css:"comment"},{regex:n.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:n.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("^\\s*#.*","gm"),css:"preprocessor"},{regex:new RegExp(this.GetKeywords("abstract boolean break byte case catch char class const continue debugger default delete do double else enum export extends false final finally float for function goto if implements import in instanceof int interface long native new null package private protected public return short static super switch synchronized this throw throws transient true try typeof var void volatile while with"),
|
192
|
+
"gm"),css:"keyword"}];this.CssClass="dp-c"};n.sh.Brushes.JScript.prototype=new n.sh.Highlighter;n.sh.Brushes.JScript.Aliases=["js","jscript","javascript"];return n});
|
193
|
+
require.def("domplate/popupMenu",["domplate/domplate","core/lib","core/trace"],function(n,c){with(n){var g={controllers:[],controllerContext:{label:"controller context"},initialize:function(d){this.controllers=[];this.controllerContext=d||this.controllerContext},shutdown:function(){this.removeControllers()},addController:function(){for(var d=0,b;b=arguments[d];d++){if(typeof b[0]=="string")b[0]=$$(b[0],this.controllerContext);var e=b[2];b[2]=c.bind(e,this);b[3]=e;this.controllers.push(b);c.addEventListener.apply(this,
|
194
|
+
b)}},removeController:function(){for(var d=0,b;b=arguments[d];d++)for(var e=0,l;l=this.controllers[e];e++)b[0]==l[0]&&b[1]==l[1]&&b[2]==l[3]&&c.removeEventListener.apply(this,l)},removeControllers:function(){for(var d=0,b;b=this.controllers[d];d++)c.removeEventListener.apply(this,b)}};n={"class":"$item.className",type:"$item.type",value:"$item.value",_command:"$item.command"};if(c.isIE6)n.href="javascript:void(0)";var j=domplate({tag:DIV({"class":"popupMenu popupMenuShadow"},DIV({"class":"popupMenuContent popupMenuShadowContent"},
|
195
|
+
FOR("item","$object.items|memberIterator",TAG("$item.tag",{item:"$item"})))),itemTag:A(n,"$item.label"),checkBoxTag:A(c.extend(n,{checked:"$item.checked"}),"$item.label"),radioButtonTag:A(c.extend(n,{selected:"$item.selected"}),"$item.label"),groupTag:A(c.extend(n,{child:"$item.child"}),"$item.label"),shortcutTag:A(n,"$item.label",SPAN({"class":"popupMenuShortcutKey"},"$item.key")),separatorTag:SPAN({"class":"popupMenuSeparator"}),memberIterator:function(d){for(var b=[],e=0,l=d.length;e<l;e++){var m=
|
196
|
+
d[e];if(typeof m=="string"&&m.indexOf("-")==0)b.push({tag:this.separatorTag});else{m=c.extend(m,{});m.type=m.type||"";m.value=m.value||"";var f=m.type;m.tag=this.itemTag;var k=m.className||"";k+="popupMenuOption ";if(f=="checkbox"){k+="popupMenuCheckBox ";m.tag=this.checkBoxTag}else if(f=="radio"){k+="popupMenuRadioButton ";m.tag=this.radioButtonTag}else if(f=="group"){k+="popupMenuGroup ";m.tag=this.groupTag}else if(f=="shortcut"){k+="popupMenuShortcut ";m.tag=this.shortcutTag}if(m.checked)k+="popupMenuChecked ";
|
197
|
+
else if(m.selected)k+="popupMenuRadioSelected ";if(m.disabled)k+="popupMenuDisabled ";m.className=k;m.label=m.label;b.push(m)}}return b}}),h=function(d){if(!d.element){if(d.getItems)d.items=d.getItems();var b=c.getBody(document);d.element=j.tag.append({object:d},b,j)}c.append(this,d);if(typeof this.element=="string"){this.id=this.element;this.element=$(this.id)}else if(this.id)this.element.id=this.id;this.elementStyle=this.element.style;this.isVisible=false;this.handleMouseDown=c.bind(this.handleMouseDown,
|
198
|
+
this);this.handleMouseOver=c.bind(this.handleMouseOver,this);this.handleMouseOut=c.bind(this.handleMouseOut,this);this.handleWindowMouseDown=c.bind(this.handleWindowMouseDown,this)},a={};h.prototype=c.extend(g,{initialize:function(){g.initialize.call(this);this.addController([this.element,"mousedown",this.handleMouseDown],[this.element,"mouseover",this.handleMouseOver])},destroy:function(){this.hide();if(this.parentMenu)this.parentMenu.childMenu=null;this.element.parentNode.removeChild(this.element);
|
199
|
+
this.parentTarget=this.parentMenu=this.elementStyle=this.element=null},shutdown:function(){g.shutdown.call(this)},showPopup:function(d){var b=c.isIE6?1:-4;d=c.getElementBox(d);var e={top:0,left:0};this.show(d.left+b-e.left,d.top+d.height-5-e.top)},show:function(d,b){this.initialize();if(!this.isVisible){d=d||0;b=b||0;if(this.parentMenu){var e=this.parentMenu.childMenu;e&&e!=this&&e.destroy();this.parentMenu.childMenu=this}else c.addEventListener(document,"mousedown",this.handleWindowMouseDown);this.elementStyle.display=
|
200
|
+
"block";this.elementStyle.visibility="hidden";e=c.getWindowSize();d=Math.min(d,e.width-this.element.clientWidth-10);d=Math.max(d,0);b=Math.min(b,e.height-this.element.clientHeight-10);b=Math.max(b,0);this.elementStyle.left=d+"px";this.elementStyle.top=b+"px";this.elementStyle.visibility="visible";this.isVisible=true;c.isFunction(this.onShow)&&this.onShow.apply(this,arguments)}},hide:function(){this.clearHideTimeout();this.clearShowChildTimeout();if(this.isVisible){this.elementStyle.display="none";
|
201
|
+
if(this.childMenu){this.childMenu.destroy();this.childMenu=null}this.parentTarget&&c.removeClass(this.parentTarget,"popupMenuGroupSelected");this.isVisible=false;this.shutdown();c.isFunction(this.onHide)&&this.onHide.apply(this,arguments)}},showChildMenu:function(d){var b=d.getAttribute("child"),e=this;d=d;this.showChildTimeout=window.setTimeout(function(){var l=c.getElementBox(d),m=a.hasOwnProperty(b)?a[b]:{element:$(b)};(new h(c.extend(m,{parentMenu:e,parentTarget:d}))).show(l.left+l.width+(c.isIE6?
|
202
|
+
-1:-6),l.top-6);c.setClass(d,"popupMenuGroupSelected")},350)},clearHideTimeout:function(){if(this.hideTimeout){window.clearTimeout(this.hideTimeout);delete this.hideTimeout}},clearShowChildTimeout:function(){if(this.showChildTimeout){window.clearTimeout(this.showChildTimeout);this.showChildTimeout=null}},handleMouseDown:function(d){c.cancelEvent(d,true);for(var b=this;b.parentMenu;)b=b.parentMenu;d=d.target||d.srcElement;d=c.getAncestorByClass(d,"popupMenuOption");if(!d||c.hasClass(d,"popupMenuGroup"))return false;
|
203
|
+
if(d&&!c.hasClass(d,"popupMenuDisabled")){var e=d.getAttribute("type");if(e=="checkbox"){d.getAttribute("checked");var l=d.getAttribute("value"),m=c.hasClass(d,"popupMenuChecked");if(m){c.removeClass(d,"popupMenuChecked");d.setAttribute("checked","")}else{c.setClass(d,"popupMenuChecked");d.setAttribute("checked","true")}c.isFunction(this.onCheck)&&this.onCheck.call(this,d,l,!m)}if(e=="radiobutton"){e=c.getElementsByClass(d.parentNode,"popupMenuRadioSelected");l=d.getAttribute("group");m=0;for(var f=
|
204
|
+
e.length;m<f;m++){radio=e[m];if(radio.getAttribute("group")==l){c.removeClass(radio,"popupMenuRadioSelected");radio.setAttribute("selected","")}}c.setClass(d,"popupMenuRadioSelected");d.setAttribute("selected","true")}e=null;l=d.command;if(c.isFunction(l))e=l;else if(typeof l=="string")e=this[l];l=true;if(e)l=e.call(this,d)!==false;l&&b.hide()}return false},handleWindowMouseDown:function(d){d=d.target||d.srcElement;d=c.getAncestorByClass(d,"popupMenu");if(!d){c.removeEventListener(document,"mousedown",
|
205
|
+
this.handleWindowMouseDown);this.destroy()}},handleMouseOver:function(d){this.clearHideTimeout();this.clearShowChildTimeout();d=d.target||d.srcElement;if(d=c.getAncestorByClass(d,"popupMenuOption")){var b=this.childMenu;if(b){c.removeClass(b.parentTarget,"popupMenuGroupSelected");if(b.parentTarget!=d&&b.isVisible){b.clearHideTimeout();b.hideTimeout=window.setTimeout(function(){b.destroy()},300)}}c.hasClass(d,"popupMenuGroup")&&this.showChildMenu(d)}}});c.append(h,{register:function(d){a[d.id]=d},
|
206
|
+
check:function(d){c.setClass(d,"popupMenuChecked");d.setAttribute("checked","true")},uncheck:function(d){c.removeClass(d,"popupMenuChecked");d.setAttribute("checked","")},disable:function(d){c.setClass(d,"popupMenuDisabled")},enable:function(d){c.removeClass(d,"popupMenuDisabled")}});return h}});
|
207
|
+
require.def("tabs/schemaTab",["domplate/domplate","domplate/tabView","core/lib","i18n!nls/harViewer","syntax-highlighter/shCore","core/trace"],function(n,c,g,j,h,a){with(n){n=function(){};n.prototype={id:"Schema",label:j.schemaTabLabel,bodyTag:PRE({"class":"javascript:nocontrols:",name:"code"}),onUpdateBody:function(d,b){$.ajax({url:"scripts/preview/harSchema.js",context:this,success:function(e){var l=b.firstChild;l.innerHTML=e;h.SyntaxHighlighter.HighlightAll(l)},error:function(e){a.error("SchemaTab.onUpdateBody; ERROR ",
|
208
|
+
e)}})}};return n}});
|
209
|
+
require.def("domplate/domTree",["domplate/domplate","core/lib"],function(n,c){with(n){n=function(j){this.input=j};n.prototype=domplate({tag:TABLE({"class":"domTable",cellpadding:0,cellspacing:0,onclick:"$onClick"},TBODY(FOR("member","$object|memberIterator",TAG("$member|getRowTag",{member:"$member"})))),rowTag:TR({"class":"memberRow $member.open $member.type\\Row $member|hasChildren",$hasChildren:"$member|hasChildren",_repObject:"$member",level:"$member.level"},TD({"class":"memberLabelCell",style:"padding-left: $member.indent\\px"},
|
210
|
+
SPAN({"class":"memberLabel $member.type\\Label"},"$member.name")),TD({"class":"memberValueCell"},TAG("$member.tag",{object:"$member.value"}))),valueTag:SPAN({"class":"objectTitle"},"$object|getTitle"),loop:FOR("member","$members",TAG("$member|getRowTag",{member:"$member"})),hasChildren:function(j){return j.hasChildren?"hasChildren":""},memberIterator:function(j){return this.getMembers(j)},getRowTag:function(){return this.rowTag},getTitle:function(j){if(jQuery.isArray(j))return"Array";j=g(j);var h=
|
211
|
+
/\[object (.*?)\]/.exec(j);return h?h[1]:j},onClick:function(j){j=$.event.fix(j||window.event);if(c.isLeftClick(j)){var h=c.getAncestorByClass(j.target,"memberRow");c.getAncestorByClass(j.target,"memberLabel")&&c.hasClass(h,"hasChildren")&&this.toggleRow(h)}},toggleRow:function(j){var h=parseInt(j.getAttribute("level"));if(c.hasClass(j,"opened")){c.removeClass(j,"opened");for(var a=j.parentNode,d=j.nextSibling;d;d=j.nextSibling){if(parseInt(d.getAttribute("level"))<=h)break;a.removeChild(d)}}else{c.setClass(j,
|
212
|
+
"opened");if(a=j.repObject)(h=this.getMembers(a.value,h+1))&&this.loop.insertRows({members:h},j)}},getMembers:function(j,h){h||(h=0);var a=[];for(var d in j){var b=j[d];typeof b!="function"&&a.push(this.createMember("dom",d,b,h))}return a},createMember:function(j,h,a,d){var b=typeof a;b=this.hasProperties(a)&&b=="object";return{name:h,value:a,type:j,rowClass:"memberRow-"+j,open:"",level:d,indent:d*16,hasChildren:b,tag:this.valueTag}},hasProperties:function(j){for(var h in j)return true;return false},
|
213
|
+
append:function(j){j=this.tag.append({object:this.input},j);j.firstChild.firstChild&&this.toggleRow(j.firstChild.firstChild)}});var g=function(j){try{return j.toString()}catch(h){return""}};return n}});
|
214
|
+
require.def("tabs/domTab",["domplate/domplate","domplate/tabView","core/lib","i18n!nls/harViewer","domplate/domTree"],function(n,c,g,j,h){with(n){n=function(){};n.prototype=g.extend(c.Tab.prototype,{id:"DOM",label:j.domTabLabel,separator:DIV({"class":"separator"}),onUpdateBody:function(){},append:function(a){(new h(a)).append(this._body);this.separator.append({},this._body)}});return n}});
|
215
|
+
(function(n){if(!c)var c={};(function(){function g(f){return f<10?"0"+f:f}function j(f){d.lastIndex=0;return d.test(f)?'"'+f.replace(d,function(k){var o=l[k];return typeof o==="string"?o:"\\u"+("0000"+k.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+f+'"'}function h(f,k){var o,p,u=b,v,w=k[f];if(w&&typeof w==="object"&&typeof w.toJSON==="function")w=w.toJSON(f);if(typeof m==="function")w=m.call(k,f,w);switch(typeof w){case "string":return j(w);case "number":return isFinite(w)?String(w):"null";case "boolean":case "null":return String(w);
|
216
|
+
case "object":if(!w)return"null";b+=e;v=[];if(Object.prototype.toString.apply(w)==="[object Array]"){p=w.length;for(f=0;f<p;f+=1)v[f]=h(f,w)||"null";k=v.length===0?"[]":b?"[\n"+b+v.join(",\n"+b)+"\n"+u+"]":"["+v.join(",")+"]";b=u;return k}if(m&&typeof m==="object"){p=m.length;for(f=0;f<p;f+=1){o=m[f];if(typeof o==="string")if(k=h(o,w))v.push(j(o)+(b?": ":":")+k)}}else for(o in w)if(Object.hasOwnProperty.call(w,o))if(k=h(o,w))v.push(j(o)+(b?": ":":")+k);k=v.length===0?"{}":b?"{\n"+b+v.join(",\n"+b)+
|
217
|
+
"\n"+u+"}":"{"+v.join(",")+"}";b=u;return k}}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(){return this.getUTCFullYear()+"-"+g(this.getUTCMonth()+1)+"-"+g(this.getUTCDate())+"T"+g(this.getUTCHours())+":"+g(this.getUTCMinutes())+":"+g(this.getUTCSeconds())+"Z"};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}}var a=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
|
218
|
+
d=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,b,e,l={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},m;if(typeof c.stringify!=="function")c.stringify=function(f,k,o){var p;e=b="";if(typeof o==="number")for(p=0;p<o;p+=1)e+=" ";else if(typeof o==="string")e=o;if((m=k)&&typeof k!=="function"&&(typeof k!=="object"||typeof k.length!=="number"))throw new Error("JSON.stringify");return h("",
|
219
|
+
{"":f})};if(typeof c.parse!=="function")c.parse=function(f,k){function o(p,u){var v,w,q=p[u];if(q&&typeof q==="object")for(v in q)if(Object.hasOwnProperty.call(q,v)){w=o(q,v);if(w!==undefined)q[v]=w;else delete q[v]}return k.call(p,u,q)}a.lastIndex=0;if(a.test(f))f=f.replace(a,function(p){return"\\u"+("0000"+p.charCodeAt(0).toString(16)).slice(-4)});if(/^[\],:{}\s]*$/.test(f.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
|
220
|
+
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){f=eval("("+f+")");return typeof k==="function"?o({"":f},""):f}throw new SyntaxError("JSON.parse");}})();n.toJSON=function(g,j){if(typeof j=="undefined")j=null;return c.parse(g,j)};n.jSONToString=function(g,j,h){if(typeof j=="undefined")j=null;if(typeof h=="undefined")h=null;return c.stringify(g,j,h)}})(jQuery);require.def("jquery-plugins/jquery.json",function(){});
|
221
|
+
var swfobject=function(){function n(){if(X.readyState=="complete"){X.parentNode.removeChild(X);c()}}function c(){if(!Z){if(D.ie&&D.win){var r=p("span");try{var s=E.getElementsByTagName("body")[0].appendChild(r);s.parentNode.removeChild(s)}catch(z){return}}Z=true;if(aa){clearInterval(aa);aa=null}r=V.length;for(s=0;s<r;s++)V[s]()}}function g(r){if(Z)r();else V[V.length]=r}function j(r){if(typeof F.addEventListener!=t)F.addEventListener("load",r,false);else if(typeof E.addEventListener!=t)E.addEventListener("load",
|
222
|
+
r,false);else if(typeof F.attachEvent!=t)u(F,"onload",r);else if(typeof F.onload=="function"){var s=F.onload;F.onload=function(){s();r()}}else F.onload=r}function h(){for(var r=M.length,s=0;s<r;s++){var z=M[s].id;if(D.pv[0]>0){var B=o(z);if(B){M[s].width=B.getAttribute("width")?B.getAttribute("width"):"0";M[s].height=B.getAttribute("height")?B.getAttribute("height"):"0";if(v(M[s].swfVersion)){D.webkit&&D.webkit<312&&a(B);q(z,true)}else M[s].expressInstall&&!R&&v("6.0.65")&&(D.win||D.mac)?d(M[s]):
|
223
|
+
b(B)}}else q(z,true)}}function a(r){var s=r.getElementsByTagName(C)[0];if(s){var z=p("embed"),B=s.attributes;if(B)for(var G=B.length,J=0;J<G;J++)B[J].nodeName=="DATA"?z.setAttribute("src",B[J].nodeValue):z.setAttribute(B[J].nodeName,B[J].nodeValue);if(s=s.childNodes){B=s.length;for(G=0;G<B;G++)s[G].nodeType==1&&s[G].nodeName=="PARAM"&&z.setAttribute(s[G].getAttribute("name"),s[G].getAttribute("value"))}r.parentNode.replaceChild(z,r)}}function d(r){R=true;var s=o(r.id);if(s){if(r.altContentId){var z=
|
224
|
+
o(r.altContentId);if(z){S=z;ba=r.altContentId}}else S=e(s);if(!/%$/.test(r.width)&&parseInt(r.width,10)<310)r.width="310";if(!/%$/.test(r.height)&&parseInt(r.height,10)<137)r.height="137";E.title=E.title.slice(0,47)+" - Flash Player Installation";z="MMredirectURL="+F.location+"&MMplayerType="+(D.ie&&D.win?"ActiveX":"PlugIn")+"&MMdoctitle="+E.title;var B=r.id;if(D.ie&&D.win&&s.readyState!=4){var G=p("div");B+="SWFObjectNew";G.setAttribute("id",B);s.parentNode.insertBefore(G,s);s.style.display="none";
|
225
|
+
u(F,"onload",function(){s.parentNode.removeChild(s)})}l({data:r.expressInstall,id:H,width:r.width,height:r.height},{flashvars:z},B)}}function b(r){if(D.ie&&D.win&&r.readyState!=4){var s=p("div");r.parentNode.insertBefore(s,r);s.parentNode.replaceChild(e(r),s);r.style.display="none";u(F,"onload",function(){r.parentNode.removeChild(r)})}else r.parentNode.replaceChild(e(r),r)}function e(r){var s=p("div");if(D.win&&D.ie)s.innerHTML=r.innerHTML;else if(r=r.getElementsByTagName(C)[0])if(r=r.childNodes)for(var z=
|
226
|
+
r.length,B=0;B<z;B++)!(r[B].nodeType==1&&r[B].nodeName=="PARAM")&&r[B].nodeType!=8&&s.appendChild(r[B].cloneNode(true));return s}function l(r,s,z){var B,G=o(z);if(G){if(typeof r.id==t)r.id=z;if(D.ie&&D.win){var J="";for(var K in r)if(r[K]!=Object.prototype[K])if(K.toLowerCase()=="data")s.movie=r[K];else if(K.toLowerCase()=="styleclass")J+=' class="'+r[K]+'"';else if(K.toLowerCase()!="classid")J+=" "+K+'="'+r[K]+'"';K="";for(var I in s)if(s[I]!=Object.prototype[I])K+='<param name="'+I+'" value="'+
|
227
|
+
s[I]+'" />';G.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+J+">"+K+"</object>";W[W.length]=r.id;B=o(r.id)}else if(D.webkit&&D.webkit<312){I=p("embed");I.setAttribute("type",x);for(J in r)if(r[J]!=Object.prototype[J])if(J.toLowerCase()=="data")I.setAttribute("src",r[J]);else if(J.toLowerCase()=="styleclass")I.setAttribute("class",r[J]);else J.toLowerCase()!="classid"&&I.setAttribute(J,r[J]);for(var N in s)s[N]!=Object.prototype[N]&&N.toLowerCase()!="movie"&&I.setAttribute(N,
|
228
|
+
s[N]);G.parentNode.replaceChild(I,G);B=I}else{I=p(C);I.setAttribute("type",x);for(var L in r)if(r[L]!=Object.prototype[L])if(L.toLowerCase()=="styleclass")I.setAttribute("class",r[L]);else L.toLowerCase()!="classid"&&I.setAttribute(L,r[L]);for(var O in s)s[O]!=Object.prototype[O]&&O.toLowerCase()!="movie"&&m(I,O,s[O]);G.parentNode.replaceChild(I,G);B=I}}return B}function m(r,s,z){var B=p("param");B.setAttribute("name",s);B.setAttribute("value",z);r.appendChild(B)}function f(r){var s=o(r);if(s&&(s.nodeName==
|
229
|
+
"OBJECT"||s.nodeName=="EMBED"))if(D.ie&&D.win)s.readyState==4?k(r):F.attachEvent("onload",function(){k(r)});else s.parentNode.removeChild(s)}function k(r){if(r=o(r)){for(var s in r)if(typeof r[s]=="function")r[s]=null;r.parentNode.removeChild(r)}}function o(r){var s=null;try{s=E.getElementById(r)}catch(z){}return s}function p(r){return E.createElement(r)}function u(r,s,z){r.attachEvent(s,z);Q[Q.length]=[r,s,z]}function v(r){var s=D.pv;r=r.split(".");r[0]=parseInt(r[0],10);r[1]=parseInt(r[1],10)||
|
230
|
+
0;r[2]=parseInt(r[2],10)||0;return s[0]>r[0]||s[0]==r[0]&&s[1]>r[1]||s[0]==r[0]&&s[1]==r[1]&&s[2]>=r[2]?true:false}function w(r,s){if(!(D.ie&&D.mac)){var z=E.getElementsByTagName("head")[0],B=p("style");B.setAttribute("type","text/css");B.setAttribute("media","screen");!(D.ie&&D.win)&&typeof E.createTextNode!=t&&B.appendChild(E.createTextNode(r+" {"+s+"}"));z.appendChild(B);if(D.ie&&D.win&&typeof E.styleSheets!=t&&E.styleSheets.length>0){z=E.styleSheets[E.styleSheets.length-1];typeof z.addRule==C&&
|
231
|
+
z.addRule(r,s)}}}function q(r,s){s=s?"visible":"hidden";if(Z&&o(r))o(r).style.visibility=s;else w("#"+r,"visibility:"+s)}function y(r){return/[\\\"<>\.;]/.exec(r)!=null?encodeURIComponent(r):r}var t="undefined",C="object",x="application/x-shockwave-flash",H="SWFObjectExprInst",F=window,E=document,P=navigator,V=[],M=[],W=[],Q=[],X,aa=null,S=null,ba=null,Z=false,R=false,D=function(){var r=typeof E.getElementById!=t&&typeof E.getElementsByTagName!=t&&typeof E.createElement!=t,s=[0,0,0],z=null;if(typeof P.plugins!=
|
232
|
+
t&&typeof P.plugins["Shockwave Flash"]==C){if((z=P.plugins["Shockwave Flash"].description)&&!(typeof P.mimeTypes!=t&&P.mimeTypes[x]&&!P.mimeTypes[x].enabledPlugin)){z=z.replace(/^.*\s+(\S+\s+\S+$)/,"$1");s[0]=parseInt(z.replace(/^(.*)\..*$/,"$1"),10);s[1]=parseInt(z.replace(/^.*\.(.*)\s.*$/,"$1"),10);s[2]=/r/.test(z)?parseInt(z.replace(/^.*r(.*)$/,"$1"),10):0}}else if(typeof F.ActiveXObject!=t){var B=null,G=false;try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(J){try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
|
233
|
+
s=[6,0,21];B.AllowScriptAccess="always"}catch(K){if(s[0]==6)G=true}if(!G)try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(I){}}if(!G&&B)try{if(z=B.GetVariable("$version")){z=z.split(" ")[1].split(",");s=[parseInt(z[0],10),parseInt(z[1],10),parseInt(z[2],10)]}}catch(N){}}G=P.userAgent.toLowerCase();var L=P.platform.toLowerCase();z=/webkit/.test(G)?parseFloat(G.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false;B=L?/win/.test(L):/win/.test(G);G=L?/mac/.test(L):/mac/.test(G);return{w3cdom:r,
|
234
|
+
pv:s,webkit:z,ie:false,win:B,mac:G}}();(function(){if(D.w3cdom){g(h);if(D.ie&&D.win)try{E.write("<script id=__ie_ondomload defer=true src=//:><\/script>");(X=o("__ie_ondomload"))&&u(X,"onreadystatechange",n)}catch(r){}if(D.webkit&&typeof E.readyState!=t)aa=setInterval(function(){/loaded|complete/.test(E.readyState)&&c()},10);typeof E.addEventListener!=t&&E.addEventListener("DOMContentLoaded",c,null);j(c)}})();(function(){D.ie&&D.win&&window.attachEvent("onunload",function(){for(var r=Q.length,s=0;s<
|
235
|
+
r;s++)Q[s][0].detachEvent(Q[s][1],Q[s][2]);r=W.length;for(s=0;s<r;s++)f(W[s]);for(var z in D)D[z]=null;D=null;for(var B in swfobject)swfobject[B]=null;swfobject=null})})();return{registerObject:function(r,s,z){if(!(!D.w3cdom||!r||!s)){var B={};B.id=r;B.swfVersion=s;B.expressInstall=z?z:false;M[M.length]=B;q(r,false)}},getObjectById:function(r){var s=null;if(D.w3cdom)if(r=o(r)){var z=r.getElementsByTagName(C)[0];if(!z||z&&typeof r.SetVariable!=t)s=r;else if(typeof z.SetVariable!=t)s=z}return s},embedSWF:function(r,
|
236
|
+
s,z,B,G,J,K,I,N){if(!(!D.w3cdom||!r||!s||!z||!B||!G)){z+="";B+="";if(v(G)){q(s,false);var L={};if(N&&typeof N===C)for(var O in N)if(N[O]!=Object.prototype[O])L[O]=N[O];L.data=r;L.width=z;L.height=B;var Y={};if(I&&typeof I===C)for(var ca in I)if(I[ca]!=Object.prototype[ca])Y[ca]=I[ca];if(K&&typeof K===C)for(var T in K)if(K[T]!=Object.prototype[T])if(typeof Y.flashvars!=t)Y.flashvars+="&"+T+"="+K[T];else Y.flashvars=T+"="+K[T];g(function(){l(L,Y,s);L.id==s&&q(s,true)})}else if(J&&!R&&v("6.0.65")&&(D.win||
|
237
|
+
D.mac)){R=true;q(s,false);g(function(){var U={};U.id=U.altContentId=s;U.width=z;U.height=B;U.expressInstall=J;d(U)})}}},getFlashPlayerVersion:function(){return{major:D.pv[0],minor:D.pv[1],release:D.pv[2]}},hasFlashPlayerVersion:v,createSWF:function(r,s,z){if(D.w3cdom)return l(r,s,z)},removeSWF:function(r){D.w3cdom&&f(r)},createCSS:function(r,s){D.w3cdom&&w(r,s)},addDomLoadEvent:g,addLoadEvent:j,getQueryParamValue:function(r){var s=E.location.search||E.location.hash;if(r==null)return y(s);if(s){s=
|
238
|
+
s.substring(1).split("&");for(var z=0;z<s.length;z++)if(s[z].substring(0,s[z].indexOf("="))==r)return y(s[z].substring(s[z].indexOf("=")+1))}return""},expressInstallCallback:function(){if(R&&S){var r=o(H);if(r){r.parentNode.replaceChild(S,r);if(ba){q(ba,true);if(D.ie&&D.win)S.style.display="block"}ba=S=null;R=false}}}}}();require.def("downloadify/js/swfobject",function(){});
|
239
|
+
(function(){Downloadify=window.Downloadify={queue:{},uid:(new Date).getTime(),getTextForSave:function(n){if(n=Downloadify.queue[n])return n.getData();return""},getFileNameForSave:function(n){if(n=Downloadify.queue[n])return n.getFilename();return""},saveComplete:function(n){(n=Downloadify.queue[n])&&n.complete();return true},saveCancel:function(n){(n=Downloadify.queue[n])&&n.cancel();return true},saveError:function(n){(n=Downloadify.queue[n])&&n.error();return true},addToQueue:function(n){Downloadify.queue[n.queue_name]=
|
240
|
+
n},getUID:function(n){if(n.id=="")n.id="downloadify_"+Downloadify.uid++;return n.id}};Downloadify.create=function(n,c){n=typeof n=="string"?document.getElementById(n):n;return new Downloadify.Container(n,c)};Downloadify.Container=function(n,c){var g=this;g.el=n;g.enabled=true;g.dataCallback=null;g.filenameCallback=null;g.data=null;g.filename=null;g.enable=function(){document.getElementById(g.flashContainer.id).setEnabled(true);g.enabled=true};g.disable=function(){document.getElementById(g.flashContainer.id).setEnabled(false);
|
241
|
+
g.enabled=false};g.getData=function(){if(!g.enabled)return"";return g.dataCallback?g.dataCallback():g.data?g.data:""};g.getFilename=function(){return g.filenameCallback?g.filenameCallback():g.filename?g.filename:""};g.complete=function(){typeof g.options.onComplete==="function"&&g.options.onComplete()};g.cancel=function(){typeof g.options.onCancel==="function"&&g.options.onCancel()};g.error=function(){typeof g.options.onError==="function"&&g.options.onError()};(function(){g.options=c;if(!g.options.append)g.el.innerHTML=
|
242
|
+
"";g.flashContainer=document.createElement("span");g.el.appendChild(g.flashContainer);g.queue_name=Downloadify.getUID(g.flashContainer);if(typeof g.options.filename==="function")g.filenameCallback=g.options.filename;else if(g.options.filename)g.filename=g.options.filename;if(typeof g.options.data==="function")g.dataCallback=g.options.data;else if(g.options.data)g.data=g.options.data;var j={queue_name:g.queue_name,width:g.options.width,height:g.options.height},h={allowScriptAccess:"always"},a={id:g.flashContainer.id,
|
243
|
+
name:g.flashContainer.id};if(g.options.enabled===false)g.enabled=false;if(g.options.transparent===true)h.wmode="transparent";if(g.options.downloadImage)j.downloadImage=g.options.downloadImage;swfobject.embedSWF(g.options.swf,g.flashContainer.id,g.options.width,g.options.height,"10",null,j,h,a);Downloadify.addToQueue(g)})()};Downloadify.defaultOptions={swf:"media/downloadify.swf",downloadImage:"images/download.png",width:100,height:30,transparent:true,append:false}})();
|
244
|
+
typeof jQuery!="undefined"&&function(n){n.fn.downloadify=function(c){return this.each(function(){c=n.extend({},Downloadify.defaultOptions,c);var g=Downloadify.create(this,c);n(this).data("Downloadify",g)})}}(jQuery);require.def("downloadify/src/downloadify",function(){});require.resume();
|
@@ -0,0 +1,6 @@
|
|
1
|
+
(function(r){if(!l)var l={};(function(){function i(a){return a<10?"0"+a:a}function h(a){p.lastIndex=0;return p.test(a)?'"'+a.replace(p,function(c){var d=s[c];return typeof d==="string"?d:"\\u"+("0000"+c.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function j(a,c){var d,f,m=g,e,b=c[a];if(b&&typeof b==="object"&&typeof b.toJSON==="function")b=b.toJSON(a);if(typeof n==="function")b=n.call(c,a,b);switch(typeof b){case "string":return h(b);case "number":return isFinite(b)?String(b):"null";case "boolean":case "null":return String(b);
|
2
|
+
case "object":if(!b)return"null";g+=o;e=[];if(Object.prototype.toString.apply(b)==="[object Array]"){f=b.length;for(a=0;a<f;a+=1)e[a]=j(a,b)||"null";c=e.length===0?"[]":g?"[\n"+g+e.join(",\n"+g)+"\n"+m+"]":"["+e.join(",")+"]";g=m;return c}if(n&&typeof n==="object"){f=n.length;for(a=0;a<f;a+=1){d=n[a];if(typeof d==="string")if(c=j(d,b))e.push(h(d)+(g?": ":":")+c)}}else for(d in b)if(Object.hasOwnProperty.call(b,d))if(c=j(d,b))e.push(h(d)+(g?": ":":")+c);c=e.length===0?"{}":g?"{\n"+g+e.join(",\n"+g)+
|
3
|
+
"\n"+m+"}":"{"+e.join(",")+"}";g=m;return c}}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(){return this.getUTCFullYear()+"-"+i(this.getUTCMonth()+1)+"-"+i(this.getUTCDate())+"T"+i(this.getUTCHours())+":"+i(this.getUTCMinutes())+":"+i(this.getUTCSeconds())+"Z"};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}}var q=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
|
4
|
+
p=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,g,o,s={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},n;if(typeof l.stringify!=="function")l.stringify=function(a,c,d){var f;o=g="";if(typeof d==="number")for(f=0;f<d;f+=1)o+=" ";else if(typeof d==="string")o=d;if((n=c)&&typeof c!=="function"&&(typeof c!=="object"||typeof c.length!=="number"))throw new Error("JSON.stringify");return j("",
|
5
|
+
{"":a})};if(typeof l.parse!=="function")l.parse=function(a,c){function d(f,m){var e,b,k=f[m];if(k&&typeof k==="object")for(e in k)if(Object.hasOwnProperty.call(k,e)){b=d(k,e);if(b!==undefined)k[e]=b;else delete k[e]}return c.call(f,m,k)}q.lastIndex=0;if(q.test(a))a=a.replace(q,function(f){return"\\u"+("0000"+f.charCodeAt(0).toString(16)).slice(-4)});if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
|
6
|
+
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){a=eval("("+a+")");return typeof c==="function"?d({"":a},""):a}throw new SyntaxError("JSON.parse");}})();r.toJSON=function(i,h){if(typeof h=="undefined")h=null;return l.parse(i,h)};r.jSONToString=function(i,h,j){if(typeof h=="undefined")h=null;if(typeof j=="undefined")j=null;return l.stringify(i,h,j)}})(jQuery);
|
@@ -0,0 +1 @@
|
|
1
|
+
require.def("i18n!nls/harViewer",{root:{aboutTabLabel:"About",schemaTabLabel:"Schema",domTabLabel:"HAR"}});
|
@@ -0,0 +1 @@
|
|
1
|
+
require.def("i18n!nls/homeTab",{root:{homeTabLabel:"Home",loadingHar:"Loading..."}});
|
@@ -0,0 +1,2 @@
|
|
1
|
+
require.def("i18n!nls/pageStats",{root:{pieLabelDNS:"DNS",pieLabelSSL:"SSL/TLS",pieLabelConnect:"Connect",pieLabelBlocked:"Blocked",pieLabelSend:"Send",pieLabelWait:"Wait",pieLabelReceive:"Receive",pieLabelHTMLText:"HTML/Text",pieLabelJavaScript:"JavaScript",pieLabelCSS:"CSS",pieLabelImage:"Image",pieLabelFlash:"Flash",pieLabelOthers:"Others",pieLabelHeadersSent:"Headers Sent",pieLabelBodiesSent:"Bodies Sent",pieLabelHeadersReceived:"Headers Received",pieLabelBodiesReceived:"Bodies Received",pieLabelDownloaded:"Downloaded",
|
2
|
+
pieLabelPartial:"Partial",pieLabelFromCache:"From Cache"}});
|
@@ -0,0 +1 @@
|
|
1
|
+
require.def("i18n!nls/pageTimeline",{root:{pageLoad:"Page Load",request:"Request",requests:"Requests",pageBarTooltip:"Click to select and include in statistics preview."}});
|
@@ -0,0 +1 @@
|
|
1
|
+
require.def("i18n!nls/previewTab",{root:{previewTabLabel:"Preview",showTimelineButton:"Show Page Timeline",hideTimelineButton:"Hide Page Timeline",showTimelineTooltip:"Show/hide statistic preview for selected pages in the timeline.",showStatsButton:"Show Statistics",hideStatsButton:"Hide Statistics",showStatsTooltip:"Show/hide page timeline.",clearButton:"Clear",clearTooltip:"Remove all HAR logs from the viewer",downloadTooltip:"Download all current data in one HAR file.",downloadError:"Failed to save HAR data"}});
|
@@ -0,0 +1 @@
|
|
1
|
+
require.def("i18n!nls/requestBody",{root:{RequestHeaders:"Request Headers",ResponseHeaders:"Response Headers",RequestCookies:"Request Cookies",ResponseCookies:"Response Cookies",URLParameters:"Params",Headers:"Headers",Post:"Post",Put:"Put",Cookies:"Cookies",Response:"Response",Cache:"Cache",HTML:"HTML"}});
|
@@ -0,0 +1,2 @@
|
|
1
|
+
require.def("i18n!nls/requestList",{root:{fromCache:"From Cache",menuBreakLayout:"Break Timeline Layout",menuOpenRequestInWindow:"Open Request in New Window",menuOpenResponseInWindow:"Open Response in New Window",request:"Request",requests:"Requests",tooltipSize:"%S (%S bytes)",tooltipZippedSize:"%S (%S bytes) - compressed",tooltipUnzippedSize:"%S (%S bytes) - uncompressed","request.Started":"Started","request.phase.Resolving":"DNS Lookup","request.phase.Connecting":"Connecting","request.phase.Blocking":"Blocking",
|
2
|
+
"request.phase.Sending":"Sending","request.phase.Waiting":"Waiting","request.phase.Receiving":"Receiving",ContentLoad:"DOM Loaded",WindowLoad:"Page Loaded","page.event.Load":"Page Loaded",menuBreakTimeline:"Break Timeline Layout",menuOpenRequest:"Open Request in New Window",menuOpenResponse:"Open Response in New Window"}});
|
@@ -0,0 +1,7 @@
|
|
1
|
+
require.def("preview/harModel",["core/lib","preview/jsonSchema","preview/ref","preview/harSchema","core/cookies","core/trace","jquery-plugins/jquery.json"],function(i,m,n,o,j,k){function f(){this.input=null}function p(){var a={};for(var c in this)if(c!="toJSON")a[c]=this[c];if(!this.text)return a;a.text=Array.map(this.text,function(b){var d=b.charCodeAt(0);if(d>=32&&d<127||d==10||d==13)return b.charAt(0);for(b=d.toString(16).toUpperCase();b.length<4;)b="0"+b;return"\\u"+b}).join("");return a}f.prototype=
|
2
|
+
{append:function(a){if(a){if(this.input)if(a.log.pages)for(var c=0;c<a.log.pages.length;c++)this.importPage(a.log.pages[c],a.log.entries);else{k.error("Import of additional data without a page is not yet supported.");return null}else this.input=a;return this.input}else k.error("HarModel.append; Trying to append null input!")},getPages:function(){if(!this.input)return[];return this.input.log.pages?this.input.log.pages:[]},getFirstPage:function(){var a=this.getPages();return a.length>0?a[0]:null},getPageEntries:function(a){return f.getPageEntries(this.input,
|
3
|
+
a)},getAllEntries:function(){return this.input?this.input.log.entries:[]},getParentPage:function(a){return f.getParentPage(this.input,a)},importPage:function(a,c){var b=this.getUniquePageID(a.id),d=a.id;a.id=b;this.input.log.pages.push(a);for(a=0;a<c.length;a++){var e=c[a];if(e.pageref==d){e.pageref=b;this.input.log.entries.push(e)}}},getUniquePageID:function(a){for(var c=this.input.log.pages,b={},d=0;d<c.length;d++)b[c[d].id]=true;if(!b[a])return a;for(c=1;;){d=a+c;if(!b[d])return d;c++}},toJSON:function(a){if(!a)a=
|
4
|
+
this.input;if(!a)return"";a=this.input.log.entries;for(var c=0;c<a.length;c++){var b=a[c];if(b.response.content.text)b.response.content.toJSON=p}return $.jSONToString(this.input,null,"\t").replace(/\\\\u/g,"\\u")},getSize:function(a){if(!a)a=this.input;if(!a)return 0;return dojo.toJson(a,true).length}};f.parse=function(a,c){var b=a;try{if(typeof a==="string")b=jQuery.toJSON(a)}catch(d){console.exception("HarModel.parse; EXCEPTION",d);throw{errors:[{message:"Failed to parse JSON",property:"JSON evaluation"}]};
|
5
|
+
}if(!c)return b;a=n.resolveJson(o);a=m.validate(b,a.logType);if(a.valid)return b;throw a;};f.getPageEntries=function(a,c){var b=[];a=a.log.entries;if(!a)return b;for(var d=0;d<a.length;d++){var e=a[d];!e.pageref&&!c&&b.push(e);c&&e.pageref==c.id&&b.push(e)}return b};f.getParentPage=function(a,c){a=a.log.pages;if(!a)return null;for(var b=0;b<a.length;b++)if(a[b].id==c.pageref)return a[b];return null};f.Loader={run:function(a,c){var b=i.getURLParameter("baseUrl");if(b&&b[b.length-1]!="/")b+="/";var d=
|
6
|
+
i.getURLParameters("path"),e=i.getURLParameter("callback"),h=i.getURLParameter("inputUrl"),g=[];for(var l in d)g.push(b?b+d[l]:d[l]);h&&g.push(h);if((b||h)&&g.length>0)return this.loadRemoteArchive(g,e,a,c);if(b=i.getURLParameter("path"))return this.loadLocalArchive(b,a,c)},loadExample:function(a){var c=document.location.href,b=c.indexOf("?");document.location=c.substr(0,b)+"?path="+a;j.setCookie("timeline",true);j.setCookie("stats",true)},loadLocalArchive:function(a,c,b){$.ajax({url:a,context:this,
|
7
|
+
success:function(d){c(d)},error:function(d,e){b(d,e)}});return true},loadRemoteArchive:function(a,c,b,d){if(!a.length)return false;var e=a.shift();c||(c="onInputData");$.ajax({url:e,context:this,dataType:"jsonp",jsonp:"callback",jsonpCallback:c,success:function(h){b(h);if(a.length){var g=this;setTimeout(function(){g.loadRemoteArchive(a,c,b,d)},300)}},error:function(h,g){d(h,g)}});return true}};return f});
|
@@ -0,0 +1,308 @@
|
|
1
|
+
/* See license.txt for terms of usage */
|
2
|
+
|
3
|
+
require.def("preview/harSchema", [], function() {
|
4
|
+
|
5
|
+
// ************************************************************************************************
|
6
|
+
// HAR Schema Definition
|
7
|
+
|
8
|
+
// Date time fields use ISO8601 (YYYY-MM-DDThh:mm:ss.sTZD, e.g. 2009-07-24T19:20:30.45+01:00)
|
9
|
+
var dateTimePattern = /^(\d{4})(-)?(\d\d)(-)?(\d\d)(T)?(\d\d)(:)?(\d\d)(:)?(\d\d)(\.\d+)?(Z|([+-])(\d\d)(:)?(\d\d))/;
|
10
|
+
|
11
|
+
/**
|
12
|
+
* Root HTML Archive type.
|
13
|
+
*/
|
14
|
+
var logType = {
|
15
|
+
"logType": {
|
16
|
+
"id": "logType",
|
17
|
+
"description": "HTTP Archive structure.",
|
18
|
+
"type": "object",
|
19
|
+
"properties": {
|
20
|
+
"log": {
|
21
|
+
"type": "object",
|
22
|
+
"properties": {
|
23
|
+
"version": {"type": "string"},
|
24
|
+
"creator": {"$ref": "creatorType"},
|
25
|
+
"browser": {"$ref": "browserType"},
|
26
|
+
"pages": {"type": "array", "optional": true, "items": {"$ref": "pageType"}},
|
27
|
+
"entries": {"type": "array", "items": {"$ref": "entryType"}},
|
28
|
+
"comment": {"type": "string", "optional": true}
|
29
|
+
}
|
30
|
+
}
|
31
|
+
}
|
32
|
+
}
|
33
|
+
};
|
34
|
+
|
35
|
+
var creatorType = {
|
36
|
+
"creatorType": {
|
37
|
+
"id": "creatorType",
|
38
|
+
"description": "Name and version info of the log creator app.",
|
39
|
+
"type": "object",
|
40
|
+
"properties": {
|
41
|
+
"name": {"type": "string"},
|
42
|
+
"version": {"type": "string"},
|
43
|
+
"comment": {"type": "string", "optional": true}
|
44
|
+
}
|
45
|
+
}
|
46
|
+
};
|
47
|
+
|
48
|
+
var browserType = {
|
49
|
+
"browserType": {
|
50
|
+
"id": "browserType",
|
51
|
+
"description": "Name and version info of used browser.",
|
52
|
+
"type": "object",
|
53
|
+
"optional": true,
|
54
|
+
"properties": {
|
55
|
+
"name": {"type": "string"},
|
56
|
+
"version": {"type": "string"},
|
57
|
+
"comment": {"type": "string", "optional": true}
|
58
|
+
}
|
59
|
+
}
|
60
|
+
};
|
61
|
+
|
62
|
+
var pageType = {
|
63
|
+
"pageType": {
|
64
|
+
"id": "pageType",
|
65
|
+
"description": "Exported web page",
|
66
|
+
"optional": true,
|
67
|
+
"properties": {
|
68
|
+
"startedDateTime": {"type": "string", "format": "date-time", "pattern": dateTimePattern},
|
69
|
+
"id": {"type": "string", "unique": true},
|
70
|
+
"title": {"type": "string"},
|
71
|
+
"pageTimings": {"$ref": "pageTimingsType"},
|
72
|
+
"comment": {"type": "string", "optional": true}
|
73
|
+
}
|
74
|
+
}
|
75
|
+
};
|
76
|
+
|
77
|
+
var pageTimingsType = {
|
78
|
+
"pageTimingsType": {
|
79
|
+
"id": "pageTimingsType",
|
80
|
+
"description": "Timing info about page load",
|
81
|
+
"properties": {
|
82
|
+
"onContentLoad": {"type": "number", "optional": true, "min": -1},
|
83
|
+
"onLoad": {"type": "number", "optional": true, "min": -1},
|
84
|
+
"comment": {"type": "string", "optional": true}
|
85
|
+
}
|
86
|
+
}
|
87
|
+
};
|
88
|
+
|
89
|
+
var entryType = {
|
90
|
+
"entryType": {
|
91
|
+
"id": "entryType",
|
92
|
+
"description": "Request and Response related info",
|
93
|
+
"optional": true,
|
94
|
+
"properties": {
|
95
|
+
"pageref": {"type": "string", "optional": true},
|
96
|
+
"startedDateTime": {"type": "string", "format": "date-time", "pattern": dateTimePattern},
|
97
|
+
"time": {"type": "integer", "min": 0},
|
98
|
+
"request" : {"$ref": "requestType"},
|
99
|
+
"response" : {"$ref": "responseType"},
|
100
|
+
"cache" : {"$ref": "cacheType"},
|
101
|
+
"timings" : {"$ref": "timingsType"},
|
102
|
+
"serverIPAddress" : {"type": "string", "optional": true},
|
103
|
+
"connection" : {"type": "string", "optional": true},
|
104
|
+
"comment": {"type": "string", "optional": true}
|
105
|
+
}
|
106
|
+
}
|
107
|
+
};
|
108
|
+
|
109
|
+
var requestType = {
|
110
|
+
"requestType": {
|
111
|
+
"id": "requestType",
|
112
|
+
"description": "Monitored request",
|
113
|
+
"properties": {
|
114
|
+
"method": {"type": "string"},
|
115
|
+
"url": {"type": "string"},
|
116
|
+
"httpVersion": {"type" : "string"},
|
117
|
+
"cookies" : {"type": "array", "items": {"$ref": "cookieType"}},
|
118
|
+
"headers" : {"type": "array", "items": {"$ref": "recordType"}},
|
119
|
+
"queryString" : {"type": "array", "items": {"$ref": "recordType"}},
|
120
|
+
"postData" : {"$ref": "postDataType"},
|
121
|
+
"headersSize" : {"type": "integer"},
|
122
|
+
"bodySize" : {"type": "integer"},
|
123
|
+
"comment": {"type": "string", "optional": true}
|
124
|
+
}
|
125
|
+
}
|
126
|
+
};
|
127
|
+
|
128
|
+
var recordType = {
|
129
|
+
"recordType": {
|
130
|
+
"id": "recordType",
|
131
|
+
"description": "Helper name-value pair structure.",
|
132
|
+
"properties": {
|
133
|
+
"name": {"type": "string"},
|
134
|
+
"value": {"type": "string"},
|
135
|
+
"comment": {"type": "string", "optional": true}
|
136
|
+
}
|
137
|
+
}
|
138
|
+
};
|
139
|
+
|
140
|
+
var responseType = {
|
141
|
+
"responseType": {
|
142
|
+
"id": "responseType",
|
143
|
+
"description": "Monitored Response.",
|
144
|
+
"properties": {
|
145
|
+
"status": {"type": "integer"},
|
146
|
+
"statusText": {"type": "string"},
|
147
|
+
"httpVersion": {"type": "string"},
|
148
|
+
"cookies" : {"type": "array", "items": {"$ref": "cookieType"}},
|
149
|
+
"headers" : {"type": "array", "items": {"$ref": "recordType"}},
|
150
|
+
"content" : {"$ref": "contentType"},
|
151
|
+
"redirectURL" : {"type": "string"},
|
152
|
+
"headersSize" : {"type": "integer"},
|
153
|
+
"bodySize" : {"type": "integer"},
|
154
|
+
"comment": {"type": "string", "optional": true}
|
155
|
+
}
|
156
|
+
}
|
157
|
+
};
|
158
|
+
|
159
|
+
var cookieType = {
|
160
|
+
"cookieType": {
|
161
|
+
"id": "cookieType",
|
162
|
+
"description": "Cookie description.",
|
163
|
+
"properties": {
|
164
|
+
"name": {"type": "string"},
|
165
|
+
"value": {"type": "string"},
|
166
|
+
"path": {"type": "string", "optional": true},
|
167
|
+
"domain" : {"type": "string", "optional": true},
|
168
|
+
"expires" : {"type": "string", "optional": true},
|
169
|
+
"httpOnly" : {"type": "boolean", "optional": true},
|
170
|
+
"secure" : {"type": "boolean", "optional": true},
|
171
|
+
"comment": {"type": "string", "optional": true}
|
172
|
+
}
|
173
|
+
}
|
174
|
+
}
|
175
|
+
|
176
|
+
var postDataType = {
|
177
|
+
"postDataType": {
|
178
|
+
"id": "postDataType",
|
179
|
+
"description": "Posted data info.",
|
180
|
+
"optional": true,
|
181
|
+
"properties": {
|
182
|
+
"mimeType": {"type": "string"},
|
183
|
+
"text": {"type": "string", "optional": true},
|
184
|
+
"params": {
|
185
|
+
"type": "array",
|
186
|
+
"optional": true,
|
187
|
+
"properties": {
|
188
|
+
"name": {"type": "string"},
|
189
|
+
"value": {"type": "string", "optional": true},
|
190
|
+
"fileName": {"type": "string", "optional": true},
|
191
|
+
"contentType": {"type": "string", "optional": true},
|
192
|
+
"comment": {"type": "string", "optional": true}
|
193
|
+
}
|
194
|
+
},
|
195
|
+
"comment": {"type": "string", "optional": true}
|
196
|
+
}
|
197
|
+
}
|
198
|
+
};
|
199
|
+
|
200
|
+
var contentType = {
|
201
|
+
"contentType": {
|
202
|
+
"id": "contentType",
|
203
|
+
"description": "Response content",
|
204
|
+
"properties": {
|
205
|
+
"size": {"type": "integer"},
|
206
|
+
"compression": {"type": "integer", "optional": true},
|
207
|
+
"mimeType": {"type": "string"},
|
208
|
+
"text": {"type": "string", "optional": true},
|
209
|
+
"encoding": {"type": "string", "optional": true},
|
210
|
+
"comment": {"type": "string", "optional": true}
|
211
|
+
}
|
212
|
+
}
|
213
|
+
};
|
214
|
+
|
215
|
+
var cacheType = {
|
216
|
+
"cacheType": {
|
217
|
+
"id": "cacheType",
|
218
|
+
"description": "Info about a response coming from the cache.",
|
219
|
+
"properties": {
|
220
|
+
"beforeRequest": {"$ref": "cacheEntryType"},
|
221
|
+
"afterRequest": {"$ref": "cacheEntryType"},
|
222
|
+
"comment": {"type": "string", "optional": true}
|
223
|
+
}
|
224
|
+
}
|
225
|
+
};
|
226
|
+
|
227
|
+
var cacheEntryType = {
|
228
|
+
"cacheEntryType": {
|
229
|
+
"id": "cacheEntryType",
|
230
|
+
"optional": true,
|
231
|
+
"description": "Info about cache entry.",
|
232
|
+
"properties": {
|
233
|
+
"expires": {"type": "string", optional: "true"},
|
234
|
+
"lastAccess": {"type": "string"},
|
235
|
+
"eTag": {"type": "string"},
|
236
|
+
"hitCount": {"type": "integer"},
|
237
|
+
"comment": {"type": "string", "optional": true}
|
238
|
+
}
|
239
|
+
}
|
240
|
+
};
|
241
|
+
|
242
|
+
var timingsType = {
|
243
|
+
"timingsType": {
|
244
|
+
"id": "timingsType",
|
245
|
+
"description": "Info about request-response timing.",
|
246
|
+
"properties": {
|
247
|
+
"dns": {"type": "integer", "min": -1},
|
248
|
+
"connect": {"type": "integer", "min": -1},
|
249
|
+
"blocked": {"type": "integer", "min": -1},
|
250
|
+
"send": {"type": "integer", "min": -1},
|
251
|
+
"wait": {"type": "integer", "min": -1},
|
252
|
+
"receive": {"type": "integer", "min": -1},
|
253
|
+
"ssl": {"type": "integer", "optional": true, "min": -1},
|
254
|
+
"comment": {"type": "string", "optional": true}
|
255
|
+
}
|
256
|
+
}
|
257
|
+
};
|
258
|
+
|
259
|
+
// ************************************************************************************************
|
260
|
+
// Helper schema object
|
261
|
+
|
262
|
+
function Schema() {}
|
263
|
+
Schema.prototype =
|
264
|
+
{
|
265
|
+
registerType: function()
|
266
|
+
{
|
267
|
+
var doIt = function(my, obj){
|
268
|
+
for (name in obj) {
|
269
|
+
if (obj.hasOwnProperty(name) && name != "prototype") {
|
270
|
+
my[name] = obj[name];
|
271
|
+
}
|
272
|
+
}
|
273
|
+
}
|
274
|
+
var that = this;
|
275
|
+
for(i=0; i < arguments.length; i +=1) {
|
276
|
+
doIt(that, arguments[i]);
|
277
|
+
};
|
278
|
+
}
|
279
|
+
};
|
280
|
+
|
281
|
+
// ************************************************************************************************
|
282
|
+
// Registration
|
283
|
+
|
284
|
+
// Register all defined types into the final schema object.
|
285
|
+
var schema = new Schema();
|
286
|
+
schema.registerType(
|
287
|
+
logType,
|
288
|
+
creatorType,
|
289
|
+
browserType,
|
290
|
+
pageType,
|
291
|
+
pageTimingsType,
|
292
|
+
entryType,
|
293
|
+
requestType,
|
294
|
+
recordType,
|
295
|
+
responseType,
|
296
|
+
postDataType,
|
297
|
+
contentType,
|
298
|
+
cacheType,
|
299
|
+
cacheEntryType,
|
300
|
+
timingsType
|
301
|
+
);
|
302
|
+
|
303
|
+
// ************************************************************************************************
|
304
|
+
|
305
|
+
return schema;
|
306
|
+
|
307
|
+
// ************************************************************************************************
|
308
|
+
});
|