UNPKG

zingchart

Version:

Our JavaScript charting library is a commercial product. But the full branded version is free to try, forever.

8 lines (7 loc) 6.32 kB
/* All of the code within the ZingChart software is developed and copyrighted by ZingChart, Inc., and may not be copied, replicated, or used in any other software or application without prior permission from ZingChart. All usage must coincide with the ZingChart End User License Agreement which can be requested by email at support@zingchart.com. Build 2.9.11 */ ZC.A8W={},ZC.WG.push("debug"),ZC.AQ.WV=function(e){for(var r,c="",t=!1,o=!1,a=0,s="",i=0,n=(e=e.replace(/\t|\r|\n/g,"")).length;i<n;i++)switch(r=e.substr(i,1)){case'"':t=!t,c+=e.substr(i,1),s=r;break;case"{":c+=e.substr(i,1),t||(c+="\n"+new Array(a+1).join(" "),a++,s=r);break;case"}":t||(c+="\n"+new Array(a).join(" "),a--,s=r),c+=e.substr(i,1);break;case"[":var u=e.indexOf("]",i),l=e.indexOf("}",i);l=-1===l?999999:l;var p=e.indexOf("{",i);p=-1===p?999999:p,u<ZC.CY(l,p)?(o=!0,c+=e.substr(i,1)):(o=!1,c+=e.substr(i,1),c+="\n"+new Array(a+1).join(" "),a++),s=r;break;case"]":o&&(o=!1),"}"===s&&(a--,c+="\n"+new Array(a).join(" ")),c+=e.substr(i,1),s=r;break;case" ":t&&(c+=e.substr(i,1),s=r);break;case",":c+=e.substr(i,1),t||o||(c+="\n"+new Array(a).join(" ")),s=r;break;default:c+=e.substr(i,1),s=r}return c},ZC.Q4.prototype.A5X=function(){var e=this;ZC.AQ.C0("source_show",e,e.FF());var r=ZC.Q.I4({cls:"zc-abs zc-viewsource zc-style",id:e.K+"-viewsource",p:ZC.AL(e.K+"-top"),wh:e.I-(ZC.quirks?0:10)+"/"+(e.F-(ZC.quirks?0:10))});r.style.zIndex=99,r.innerHTML=ZC._h_('<div class="zc-form-row-label zc-form-s1">&nbsp;<a href="javascript:void(0)" id="'+e.K+'-viewsource-originalsource" class="zc-tab-active">'+ZC.HL["viewsource-originalsource"]+'</a>&nbsp;<a href="javascript:void(0)" id="'+e.K+'-viewsource-jsonsource" class="zc-tab-inactive">'+ZC.HL["viewsource-jsonsource"]+'</a></div><div class="zc-form-row-element"><textarea id="'+e.K+'-viewsource-json" style="width:'+(e.I-35)+"px;height:"+(e.F-95)+'px;"></textarea></div><div class="zc-form-row-element zc-form-row-last" id="'+e.K+'-viewsource-actions"><input type="button" value="'+ZC.HL["viewsource-close"]+'" id="'+e.K+'-viewsource-close" /></div>'),zingchart.EDITSOURCE&&(ZC.AL(e.K+"-viewsource-actions").innerHTML+='<input type="button" value="'+ZC.HL["viewsource-apply"]+'" id="'+e.K+'-viewsource-apply" />'),ZC.A5("#"+e.K+"-viewsource-json").val(ZC.AQ.WV(e.E.source)),ZC.A5("#"+e.K+"-viewsource-jsonsource").bind("click",function(){ZC.AL(e.K+"-viewsource-jsonsource").className="zc-tab-active",ZC.AL(e.K+"-viewsource-originalsource").className="zc-tab-inactive",ZC.A5("#"+e.K+"-viewsource-json").val(ZC.AQ.WV(e.E.json))}),ZC.A5("#"+e.K+"-viewsource-originalsource").bind("click",function(){ZC.AL(e.K+"-viewsource-jsonsource").className="zc-tab-inactive",ZC.AL(e.K+"-viewsource-originalsource").className="zc-tab-active",ZC.A5("#"+e.K+"-viewsource-json").val(ZC.AQ.WV(e.E.source))}),ZC.A5("#"+e.K+"-viewsource-close").bind("click",function(){ZC.AQ.C0("source_hide",e,e.FF()),ZC.Q.EV(e.K+"-viewsource")}),zingchart.EDITSOURCE&&ZC.A5("#"+e.K+"-viewsource-apply").bind("click",function(){ZC.AQ.C0("source_hide",e,e.FF());var r=ZC.A5("#"+e.K+"-viewsource-json").val();ZC.Q.EV(e.K+"-viewsource"),zingchart.exec(e.K,"setdata",{data:r})})},ZC.Q4.prototype.A70=function(){var e=this;if(e.I<300||e.F<300)window.open("http://www.zingchart.com/support/","","");else{var r=ZC.Q.I4({cls:"zc-abs zc-bugreport zc-style",id:e.K+"-bugreport",p:ZC.AL(e.K+"-top"),wh:e.I-(ZC.quirks?0:10)+"/"+(e.F-(ZC.quirks?0:10))}),c="";c+='<div class="zc-form-row-label zc-form-s0">'+ZC.HL["bugreport-header"]+'</div><div class="zc-form-row-label"><input type="checkbox" id="'+e.K+'-chkdata" checked="checked" /><label for="'+e.K+'-chkdata">'+ZC.HL["bugreport-senddata"]+"</label>",ZC.canvas&&(c+='&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" id="'+e.K+'-chkcapture" checked="checked" /><label for="'+e.K+'-chkcapture">'+ZC.HL["bugreport-sendcapture"]+"</label>"),c+='</div><div class="zc-form-row-label zc-form-s1">'+ZC.HL["bugreport-yourcomment"]+'</div><div class="zc-form-row-element"><textarea id="'+e.K+'-bugreport-comment" style="width:'+(e.I-35)+"px;height:"+((e.F-300)/2-10)+'px;"></textarea></div><div class="zc-form-row-label zc-form-s1">'+ZC.HL["bugreport-jsondata"]+'</div><div class="zc-form-row-element"><textarea id="'+e.K+'-bugreport-json" style="width:'+(e.I-35)+"px;height:"+(e.F-210)/2+'px;"></textarea></div><div class="zc-form-row-label zc-form-s1">'+ZC.HL["bugreport-youremail"]+(e.I>=510?" <span>("+ZC.HL["bugreport-infoemail"]+")</span>":"")+'</div><div class="zc-form-row-element"><input type="text" id="'+e.K+'-bugreport-email" style="width:'+(e.I-35)+'px;" /></div><div class="zc-form-row-element zc-form-row-last"><input type="button" value="'+ZC.HL["bugreport-submit"]+'" id="'+e.K+'-bugreport-submit" /><input type="button" value="'+ZC.HL["bugreport-cancel"]+'" id="'+e.K+'-bugreport-cancel" /></div>',r.innerHTML=ZC._h_(c),ZC.A5("#"+e.K+"-bugreport-json").val("PARSED\n----------\n"+ZC.AQ.WV(e.E.json)+"\n\nORIGINAL\n----------\n"+ZC.AQ.WV(e.E.source)),ZC.A5("#"+e.K+"-bugreport-cancel").bind("click",function(){ZC.Q.EV(e.K+"-bugreport")}),ZC.A5("#"+e.K+"-bugreport-submit").bind("click",function(){var r=ZC.A5("#"+e.K+"-bugreport-email"),c="",t=function(){var t=("Parsed:"+e.E.json+" Original:"+e.E.source).replace(/\r|\n|\t|(\s{2,})/g,""),o="",a=[];ZC.A5("#"+e.K+"-chkcapture").attr("checked")&&a.push("****IMAGE:",c),ZC.A5("#"+e.K+"-chkdata").attr("checked")&&a.push("****JSON:",t),a.push("****COMMENT:",ZC.A5("#"+e.K+"-bugreport-comment").val(),"****EMAIL:",r.val(),"****VERSION:",ZC.VERSION,"****WIDTH:",e.I,"****HEIGHT:",e.F,"****URL:",window.location.href,"****UA:",navigator.userAgent,"****RENDER:",e.AC.toUpperCase(),"****RESOLUTION:",screen.width+"x"+screen.height);for(var s=0;s<a.length-1;s+=2)o+=a[s]+encodeURIComponent(a[s+1]);o+="****END";var i=ZC.Q.ABB(ZC.AL(e.K+"-bugreport")),n=i.createElement("FORM");n.action=document.location.protocol+"//www.zingchart.com/support/submitreportH5.php",n.method="post",i.body.appendChild(n);var u=i.createElement("INPUT");u.type="text",u.name="data",u.value=o,n.appendChild(u),n.submit(),window.setTimeout(function(){alert(ZC.HL["bugreport-confirm"]),ZC.Q.EV(e.K+"-bugreport")},1e3)};"canvas"===e.AC?(c=zingchart.exec(e.K,"getimagedata",{}),t()):c=zingchart.exec(e.K,"getimagedata",{callback:function(e){c=e,t()}})})}};