Found this malicious javascript in a file...what does it do? [closed] - javascript

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I was editing a PHP file when I found this javascript code linked to an external js file at the end of my file:
!function(n,e,t){function r(t,i){if(!e[t]){if(!n[t]){var a="function"==typeof __nr_require&&__nr_require;if(!i&&a)return a(t,!0);if(o)return o(t,!0);throw new Error("Cannot find module '"+t+"'")}var s=e[t]={exports:{}};n[t][0].call(s.exports,function(e){var o=n[t][1][e];return r(o||e)},s,s.exports)}return e[t].exports}for(var o="function"==typeof __nr_require&&__nr_require,i=0;i<t.length;i++)r(t[i]);return r}({1:[function(n,e,t){e.exports=function(n,e){return"addEventListener"in window?addEventListener(n,e,!1):"attachEvent"in window?attachEvent("on"+n,e):void 0}},{}],2:[function(n,e,t){function r(n,e,t,r){p("bstAgg",[n,e,t,r]),l[n]||(l[n]={});var i=l[n][e];return i||(i=l[n][e]={params:t||{}}),i.metrics=o(r,i.metrics),i}function o(n,e){return e||(e={count:0}),e.count+=1,c(n,function(n,t){e[n]=i(t,e[n])}),e}function i(n,e){return e?(e&&!e.c&&(e={t:e.t,min:e.t,max:e.t,sos:e.t*e.t,c:1}),e.c+=1,e.t+=n,e.sos+=n*n,n>e.max&&(e.max=n),n<e.min&&(e.min=n),e):{t:n}}function a(n,e){return e?l[n]&&l[n][e]:l[n]}function s(n){for(var e={},t="",r=!1,o=0;o<n.length;o++)t=n[o],e[t]=u(l[t]),e[t].length&&(r=!0),delete l[t];return r?e:null}function u(n){return"object"!=typeof n?[]:c(n,f)}function f(n,e){return e}var c=n(30),p=n("handle"),l={};e.exports={store:r,take:s,get:a}},{}],3:[function(n,e,t){function r(n,e,t){"string"==typeof e&&("/"!==e.charAt(0)&&(e="/"+e),d.customTransaction=(t||"http://custom.transaction")+e)}function o(n,e){var t=e||n;f.store("cm","finished",{name:"finished"},{time:t-d.offset}),i(n,{name:"finished",start:t,origin:"nr"}),m("api-addPageAction",[t,"finished"])}function i(n,e){if(e&&"object"==typeof e&&e.name&&e.start){var t={n:e.name,s:e.start-d.offset,e:(e.end||e.start)-d.offset,o:e.origin||"",t:"api"};m("bstApi",[t])}}function a(n,e,t,r,o,i,a){if(e=window.encodeURIComponent(e),v+=1,d.info.beacon){var s=d.proto+d.info.beacon+"/1/"+d.info.licenseKey;s+="?a="+d.info.applicationID+"&",s+="t="+e+"&",s+="qt="+~~t+"&",s+="ap="+~~r+"&",s+="be="+~~o+"&",s+="dc="+~~i+"&",s+="fe="+~~a+"&",s+="c="+v,p.img(s)}}var s=n(14),u=n(9),f=n(2),c=n(16),p=n(8),l=n(30),d=n("loader"),m=n("handle"),v=0;u.on("jserrors",function(){return{body:f.take(["cm"])}});var h={finished:c(o),setPageViewName:r,addToTrace:i,inlineHit:a};l(h,function(n,e){s("api-"+n,e,"api")})},{}],4:[function(n,e,t){var r=/#|\?/,o=/#.*|$/;e.exports=function(n,e){var t=n.split(r)[0];return e?t+o.exec(n)[0]:t}},{}],5:[function(n,e,t){function r(n,e){var t=n[1];i(e[t],function(e,t){var r=n[0],o=t[0];if(o===r){var i=t[1],a=n[3],s=n[2];i.apply(a,s)}})}var o=n("ee"),i=n(30),a=n(14).handlers;e.exports=function(n){var e=o.backlog[n],t=a[n];if(t){for(var s=0;e&&s<e.length;++s)r(e[s],t);i(t,function(n,e){i(e,function(e,t){t[0].on(n,t[1])})})}delete a[n],o.backlog[n]=null}},{}],6:[function(n,e,t){function r(n){return c[n]}function o(n){return null===n||void 0===n?"null":encodeURIComponent(n).replace(l,r)}function i(n,e){for(var t=0,r=0;r<n.length;r++)if(t+=n[r].length,t>e)return n.slice(0,r).join("");return n.join("")}function a(n,e){var t=0,r="";return u(n,function(n,i){var a,s,u=[];if("string"==typeof i)a="&"+n+"="+o(i),t+=a.length,r+=a;else if(i.length){for(t+=9,s=0;s<i.length&&(a=o(f(i[s])),t+=a.length,!("undefined"!=typeof e&&t>=e));s++)u.push(a);r+="&"+n+"=%5B"+u.join(",")+"%5D"}}),r}function s(n,e){return e&&"string"==typeof e?"&"+n+"="+o(e):""}var u=n(30),f=n(19),c={"%2C":",","%3A":":","%2F":"/","%40":"#","%24":"$","%3B":";"},p=u(c,function(n){return n}),l=new RegExp(p.join("|"),"g");e.exports={obj:a,fromArray:i,qs:o,param:s}},{}],7:[function(n,e,t){var r=n(30),o=n("ee"),i=n(5);e.exports=function(n){n&&"object"==typeof n&&(r(n,function(n,e){e&&!a[n]&&(o.emit("feat-"+n,[]),a[n]=!0)}),i("feature"))};var a=e.exports.active={}},{}],8:[function(n,e,t){var r=e.exports={};r.jsonp=function(n,e){var t=document.createElement("script");t.type="text/javascript",t.src=n+"&jsonp="+e;var r=document.getElementsByTagName("script")[0];return r.parentNode.insertBefore(t,r),t},r.xhr=function(n,e){var t=new XMLHttpRequest;return t.open("POST",n,!0),"withCredentials"in t&&(t.withCredentials=!0),t.setRequestHeader("content-type","text/plain"),t.send(e),t},r.img=function(n){var e=new Image;return e.src=n,e},r.beacon=function(n,e){return navigator.sendBeacon(n,e)}},{}],9:[function(n,e,t){function r(n){if(n.info.beacon){n.info.queueTime&&b.store("measures","qt",{value:n.info.queueTime}),n.info.applicationTime&&b.store("measures","ap",{value:n.info.applicationTime}),k.measure("be","starttime","firstbyte"),k.measure("fe","firstbyte","onload"),k.measure("dc","firstbyte","domContent");var e=b.get("measures"),t=v(e,function(n,e){return"&"+n+"="+e.params.value}).join("");if(t){var r="1",o=[l(n)];if(o.push(t),o.push(g.param("tt",n.info.ttGuid)),o.push(g.param("us",n.info.user)),o.push(g.param("ac",n.info.account)),o.push(g.param("pr",n.info.product)),o.push(g.param("af",v(n.features,function(n){return n}).join(","))),window.performance&&"undefined"!=typeof window.performance.timing){var i={timing:h.addPT(window.performance.timing,{}),navigation:h.addPN(window.performance.navigation,{})};o.push(g.param("perf",y(i)))}o.push(g.param("xx",n.info.extra)),o.push(g.param("ua",n.info.userAttributes)),o.push(g.param("at",n.info.atts));var a=y(n.info.jsAttributes);o.push(g.param("ja","{}"===a?null:a));var s=g.fromArray(o,n.maxBytes);w.jsonp(n.proto+n.info.beacon+"/"+r+"/"+n.info.licenseKey+s,T)}}}function o(n){var e=v(A,function(e){return a(e,n,{unload:!0})});return x(e,i)}function i(n,e){return n||e}function a(n,e,t){return u(e,n,s(n),t||{})}function s(n){for(var e=d({}),t=d({}),r=A[n]||[],o=0;o<r.length;o++){var i=r[o]();i.body&&v(i.body,e),i.qs&&v(i.qs,t)}return{body:e(),qs:t()}}function u(n,e,t,r){if(!n.info.errorBeacon||!t.body)return!1;var o="https://"+n.info.errorBeacon+"/"+e+"/1/"+n.info.licenseKey+l(n);t.qs&&(o+=g.obj(t.qs,n.maxBytes));var i,a,s;switch(e){case"jserrors":a=!1,i=q?w.beacon:w.img;break;default:if(r.needResponse)a=!0,i=w.xhr;else if(r.unload)a=q,i=q?w.beacon:w.img;else if(q)a=!0,i=w.beacon;else if(L)a=!0,i=w.xhr;else{if("events"!==e)return!1;i=w.img}}return a&&"events"===e?s=t.body.e:a?s=y(t.body):o+=g.obj(t.body,n.maxBytes),i(o,s)}function f(n){if(n&&n.info&&n.info.errorBeacon&&n.ieVersion){var e="https://"+n.info.errorBeacon+"/jserrors/ping/"+n.info.licenseKey+l(n);w.img(e)}}function c(n){return n.info.transactionName?g.param("to",n.info.transactionName):g.param("t",n.info.tNamePlain||"Unnamed Transaction")}function p(n,e){var t=A[n]||(A[n]=[]);t.push(e)}function l(n){return["?a="+n.info.applicationID,g.param("sa",n.info.sa?""+n.info.sa:""),g.param("v",S),c(n),g.param("ct",n.customTransaction),"&rst="+((new Date).getTime()-n.offset),g.param("ref",E(n.origin))].join("")}function d(n){var e=!1;return function(t,r){return r&&r.length&&(n[t]=r,e=!0),e?n:void 0}}var m=n(16),v=n(30),h=n(13),g=n(6),y=n(19),w=n(8),x=n(32),b=n(2),k=n(18),j=n("loader"),E=n(4),S="943.9bd99bf",T="NREUM.setToken",A={},q=!!navigator.sendBeacon;n(10);var L=j.xhrWrappable&&(j.ieVersion>9||0===j.ieVersion);e.exports={sendBeacon:m(r),sendFinal:o,pingErrors:f,sendX:a,on:p,xhrUsable:L}},{}],10:[function(n,e,t){var r=n("loader"),o=document.createElement("div");o.innerHTML="<!--[if lte IE 6]><div></div><![endif]--><!--[if lte IE 7]><div></div><![endif]--><!--[if lte IE 8]><div></div><![endif]--><!--[if lte IE 9]><div></div><![endif]-->";var i=o.getElementsByTagName("div").length;4===i?r.ieVersion=6:3===i?r.ieVersion=7:2===i?r.ieVersion=8:1===i?r.ieVersion=9:r.ieVersion=0,e.exports=r.ieVersion},{}],11:[function(n,e,t){function r(n){f.sendFinal(l,!1),a.navCookie&&(document.cookie="NREUM=s="+Number(new Date)+"&r="+o(document.location.href)+"&p="+o(document.referrer)+"; path=/")}var o=n(15),i=n(1),a=n(17),s=n(18),u=n(16),f=n(9),c=n(14),p=n(7),l=n("loader"),d=n(29),m=n(5);n(3);var v="undefined"!=typeof window.NREUM.autorun?window.NREUM.autorun:!0;window.NREUM.setToken=p,6===n(10)?l.maxBytes=2e3:l.maxBytes=3e4;var h=u(r);!d||navigator.sendBeacon?i("pagehide",h):i("beforeunload",h),i("unload",h),c("mark",s.mark,"api"),s.mark("done"),m("api"),v&&f.sendBeacon(l)},{}],12:[function(n,e,t){e.exports=function(n,e){setTimeout(function t(){try{n()}finally{setTimeout(t,e)}},e)}},{}],13:[function(n,e,t){function r(n,e){var t=n.navigationStart;return e.of=t,i(n.navigationStart,t,e,"n"),i(n.unloadEventStart,t,e,"u"),i(n.unloadEventEnd,t,e,"ue"),i(n.domLoading,t,e,"dl"),i(n.domInteractive,t,e,"di"),i(n.domContentLoadedEventStart,t,e,"ds"),i(n.domContentLoadedEventEnd,t,e,"de"),i(n.domComplete,t,e,"dc"),i(n.loadEventStart,t,e,"l"),i(n.loadEventEnd,t,e,"le"),i(n.redirectStart,t,e,"r"),i(n.redirectEnd,t,e,"re"),i(n.fetchStart,t,e,"f"),i(n.domainLookupStart,t,e,"dn"),i(n.domainLookupEnd,t,e,"dne"),i(n.connectStart,t,e,"c"),i(n.connectEnd,t,e,"ce"),i(n.secureConnectionStart,t,e,"s"),i(n.requestStart,t,e,"rq"),i(n.responseStart,t,e,"rp"),i(n.responseEnd,t,e,"rpe"),e}function o(n,e){return i(n.type,0,e,"ty"),i(n.redirectCount,0,e,"rc"),e}function i(n,e,t,r){"number"==typeof n&&n>0&&(t[r]=Math.round(n-e))}e.exports={addPT:r,addPN:o}},{}],14:[function(n,e,t){function r(n,e,t,r){o(r||i,n,e,t)}function o(n,e,t,r){r||(r="feature"),n||(n=i);var o=a[r]=a[r]||{},s=o[e]=o[e]||[];s.push([n,t])}var i=n("handle").ee;e.exports=r,r.on=o;var a=r.handlers={}},{}],15:[function(n,e,t){function r(n){var e,t=0;for(e=0;e<n.length;e++)t+=(e+1)*n.charCodeAt(e);return Math.abs(t)}e.exports=r},{}],16:[function(n,e,t){function r(n){var e,t=!1;return function(){return t?e:(t=!0,e=n.apply(this,o(arguments)))}}var o=n(31);e.exports=r},{}],17:[function(n,e,t){function r(){var n=o()||i();n&&(s.mark("starttime",n),u.offset=n)}function o(){return f&&9>f?void 0:"undefined"!=typeof window.performance&&window.performance.timing&&"undefined"!=typeof window.performance.timing.navigationStart?(e.exports.navCookie=!1,window.performance.timing.navigationStart):void 0}function i(){for(var n=document.cookie.split(" "),e=0;e<n.length;e++)if(0===n[e].indexOf("NREUM=")){for(var t,r,o,i,s=n[e].substring("NREUM=".length).split("&"),u=0;u<s.length;u++)0===s[u].indexOf("s=")?o=s[u].substring(2):0===s[u].indexOf("p=")?(r=s[u].substring(2),";"===r.charAt(r.length-1)&&(r=r.substr(0,r.length-1))):0===s[u].indexOf("r=")&&(t=s[u].substring(2),";"===t.charAt(t.length-1)&&(t=t.substr(0,t.length-1)));if(t){var f=a(document.referrer);i=f==t,i||(i=a(document.location.href)==t&&f==r)}if(i&&o){var c=(new Date).getTime();if(c-o>6e4)return;return o}}}var a=n(15),s=n(18),u=n("loader"),f=n(29);e.exports={navCookie:!0},r()},{}],18:[function(n,e,t){function r(n,e){"undefined"==typeof e&&(e=(new Date).getTime()),a[n]=e}function o(n,e,t){var r=a[e],o=a[t];"undefined"!=typeof r&&"undefined"!=typeof o&&i.store("measures",n,{value:o-r})}var i=n(2),a={};e.exports={mark:r,measure:o}},{}],19:[function(n,e,t){function r(n){try{return i("",{"":n})}catch(e){try{s.emit("internal-error",[e])}catch(t){}}}function o(n){return u.lastIndex=0,u.test(n)?'"'+n.replace(u,function(n){var e=f[n];return"string"==typeof e?e:"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+n+'"'}function i(n,e){var t=e[n];switch(typeof t){case"string":return o(t);case"number":return isFinite(t)?String(t):"null";case"boolean":return String(t);case"object":if(!t)return"null";var r=[];if("[object Array]"===Object.prototype.toString.apply(t)){for(var s=t.length,u=0;s>u;u+=1)r[u]=i(u,t)||"null";return 0===r.length?"[]":"["+r.join(",")+"]"}return a(t,function(n){var e=i(n,t);e&&r.push(o(n)+":"+e)}),0===r.length?"{}":"{"+r.join(",")+"}"}}var a=n(30),s=n("ee"),u=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};e.exports=r},{}],20:[function(n,e,t){function r(n){if(n){var e=n.match(o);return e?e[1]:void 0}}var o=/([a-z0-9]+)$/i;e.exports=r},{}],21:[function(n,e,t){function r(n){var e=null;try{if(e=p(n))return e}catch(t){if(h)throw t}try{if(e=o(n))return e}catch(t){if(h)throw t}try{if(e=l(n))return e}catch(t){if(h)throw t}try{if(e=s(n))return e}catch(t){if(h)throw t}try{if(e=u(n))return e}catch(t){if(h)throw t}return{mode:"failed",stackString:"",frames:[]}}function o(n){if(!n.stack)return null;var e=d(n.stack.split("\n"),i,{frames:[],stackLines:[],wrapperSeen:!1});return e.frames.length?{mode:"stack",name:n.name||f(n),message:n.message,stackString:m(e.stackLines),frames:e.frames}:null}function i(n,e){var t=a(e);return t?(c(t.func)?n.wrapperSeen=!0:n.stackLines.push(e),n.wrapperSeen||n.frames.push(t),n):(n.stackLines.push(e),n)}function a(n){var e=n.match(w);return e||(e=n.match(y)),e?{url:e[2],func:"Anonymous function"!==e[1]&&e[1]||null,line:+e[3],column:e[4]?+e[4]:null}:n.match(x)||n.match(b)||"anonymous"===n?{func:"evaluated code"}:void 0}function s(n){if(!("line"in n))return null;var e=n.name||f(n);if(!n.sourceURL)return{mode:"sourceline",name:e,message:n.message,stackString:f(n)+": "+n.message+"\n in evaluated code",frames:[{func:"evaluated code"}]};var t=e+": "+n.message+"\n at "+n.sourceURL;return n.line&&(t+=":"+n.line,n.column&&(t+=":"+n.column)),{mode:"sourceline",name:e,message:n.message,stackString:t,frames:[{url:n.sourceURL,line:n.line,column:n.column}]}}function u(n){var e=n.name||f(n);return e?{mode:"nameonly",name:e,message:n.message,stackString:e+": "+n.message,frames:[]}:null}function f(n){var e=g.exec(String(n.constructor));return e&&e.length>1?e[1]:"unknown"}function c(n){return n&&n.indexOf("nrWrapper")>=0}function p(n){for(var e,t=n.stacktrace,r=/ line (\d+), column (\d+) in (?:<anonymous function: ([^>]+)>|([^\)]+))\(.*\) in (.*):\s*$/i,o=t.split("\n"),i=[],a=[],s=!1,u=0,p=o.length;p>u;u+=2)if(e=r.exec(o[u])){var l={line:+e[1],column:+e[2],func:e[3]||e[4],url:e[5]};c(l.func)?s=!0:a.push(o[u]),s||i.push(l)}else a.push(o[u]);return i.length?{mode:"stacktrace",name:n.name||f(n),message:n.message,stackString:m(a),frames:i}:null}function l(n){var e=n.message.split("\n");if(e.length<4)return null;var t,r,o,i=/^\s*Line (\d+) of linked script ((?:file|http|https)\S+)(?:: in function (\S+))?\s*$/i,a=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|http|https)\S+)(?:: in function (\S+))?\s*$/i,s=/^\s*Line (\d+) of function script\s*$/i,u=[],p=[],l=document.getElementsByTagName("script"),d=[],h=!1;for(r in l)v.call(l,r)&&!l[r].src&&d.push(l[r]);for(r=2,o=e.length;o>r;r+=2){var g=null;if(t=i.exec(e[r]))g={url:t[2],func:t[3],line:+t[1]};else if(t=a.exec(e[r]))g={url:t[3],func:t[4]};else if(t=s.exec(e[r])){var y=window.location.href.replace(/#.*$/,""),w=t[1];g={url:y,line:w,func:""}}g&&(c(g.func)?h=!0:p.push(e[r]),h||u.push(g))}return u.length?{mode:"multiline",name:n.name||f(n),message:e[0],stackString:m(p),frames:u}:null}var d=n(32),m=n(22),v=Object.prototype.hasOwnProperty,h=!1,g=/function (.+?)\s*\(/,y=/^\s*at (?:((?:\[object object\])?(?:[^(]*\([^)]*\))*[^()]*(?: \[as \S+\])?) )?\(?((?:file|http|https|chrome-extension):.*?)?:(\d+)(?::(\d+))?\)?\s*$/i,w=/^\s*(?:(\S*)(?:\(.*?\))?#)?((?:file|http|https|chrome|safari-extension).*?):(\d+)(?::(\d+))?\s*$/i,x=/^\s*at .+ \(eval at \S+ \((?:(?:file|http|https):[^)]+)?\)(?:, [^:]*:\d+:\d+)?\)$/i,b=/^\s*at Function code \(Function code:\d+:\d+\)\s*/i;e.exports=r},{}],22:[function(n,e,t){var r=/^\n+|\n+$/g;e.exports=function(n){var e;if(n.length>100){var t=n.length-100;e=n.slice(0,50).join("\n"),e+="\n< ...truncated "+t+" lines... >\n",e+=n.slice(-50).join("\n")}else e=n.join("\n");return e.replace(r,"")}},{}],23:[function(n,e,t){function r(n){return l(n.exceptionClass)^n.stackHash}function o(n,e){if("string"!=typeof n)return"";var t=c(n);return t===e?"<inline>":t}function i(n,e){for(var t="",r=0;r<n.frames.length;r++){var o=n.frames[r],i=f(o.func);t&&(t+="\n"),i&&(t+=i+"#"),"string"==typeof o.url&&(t+=o.url),o.line&&(t+=":"+o.line)}return t}function a(n){for(var e=c(d.origin),t=0;t<n.frames.length;t++){var r=n.frames[t],i=r.url,a=o(i,e);a&&a!==r.url&&(r.url=a,n.stackString=n.stackString.split(i).join(a))}return n}function s(n,e,t){e||(e=(new Date).getTime());var o=a(p(n)),s=i(o),f={stackHash:l(s),exceptionClass:o.name,request_uri:window.location.pathname};o.message&&(f.message=""+o.message),v[f.stackHash]?f.browser_stack_hash=l(o.stackString):(v[f.stackHash]=!0,f.stack_trace=o.stackString);var c=r(f);h[c]||(f.pageview=1,h[c]=!0),u.store(t?"ierr":"err",c,f,{time:e-d.offset})}var u=n(2),f=n(20),c=n(4),p=n(21),l=n(24),d=n("loader"),m=n("ee"),v={},h={},g=n(14),y=n(9),w=n(12);if(n(17),d.features.err){var x=!1;y.on("jserrors",function(){var n=u.take(["err","ierr"]),e={body:n};return n&&n.err&&n.err.length&&!x&&(e.qs={pve:"1"},x=!0),e}),y.pingErrors(d),w(function(){var n=y.sendX("jserrors",d);n||y.pingErrors(d)},6e4),m.on("feat-err",function(){g("err",s),g("ierr",s)}),e.exports=s}},{}],24:[function(n,e,t){function r(n){var e,t=0;if(!n||!n.length)return t;for(var r=0;r<n.length;r++)e=n.charCodeAt(r),t=(t<<5)-t+e,t=0|t;return t}e.exports=r},{}],25:[function(n,e,t){function r(n,e,t){function r(n,e){t[n]||(t[n]=e)}if(!(g.length>=h)){e||(e=""),t&&"object"==typeof t||(t={});var o,a;"undefined"!=typeof window&&window.document&&window.document.documentElement&&(o=window.document.documentElement.clientWidth,a=window.document.documentElement.clientHeight);var c={timestamp:n,timeSinceLoad:(n-s.offset)/1e3,browserWidth:o,browserHeight:a,referrerUrl:i,currentUrl:l(""+location),pageUrl:l(s.origin),eventType:"PageAction"};u(y,r),u(c,r),t.actionName=e,u(t,function(n,e){e&&"object"==typeof e&&(t[n]=f(e))}),g.push(t)}}function o(n,e,t){y[e]=t}var i,a=n("ee"),s=n("loader"),u=n(30),f=n(19),c=n(14),p=n(9),l=n(4),d=n(12),m=120,v=10,h=m*v/60,g=[],y=s.info.jsAttributes={};document.referrer&&(i=l(document.referrer)),c("api-setCustomAttribute",o,"api"),a.on("feat-ins",function(){c("api-addPageAction",r),p.on("ins",function(){return{qs:{ua:s.info.userAttributes,at:s.info.atts},body:{ins:g.splice(0)}}}),d(function(){p.sendX("ins",s)},1e3*v),p.sendX("ins",s)})},{}],26:[function(n,e,t){function r(n){var e,t,r,o=Date.now();for(e in n)t=n[e],"number"==typeof t&&t>0&&o>t&&(r=n[e]-w.offset,p({n:e,s:r,e:r,o:"document",t:"timing"}))}function o(n,e,t,r){var o="timer";"requestAnimationFrame"===r&&(o=r);var i={n:r,s:e-w.offset,e:t-w.offset,o:"window",t:o};p(i)}function i(n,e,t,r){if(n.type in L)return!1;var o={n:a(n.type),s:t-w.offset,e:r-w.offset,o:s(n.target,e),t:"event"};p(o)}function a(n){var e=n;return k(C,function(t,r){n in r&&(e=t)}),e}function s(n,e){var t="unknown";if(n&&n instanceof XMLHttpRequest){var r=R.context(n).params;t=r.status+" "+r.method+": "+r.host+r.pathname}else n&&"string"==typeof n.tagName&&(t=n.tagName.toLowerCase(),n.id&&(t+="#"+n.id),n.className&&(t+="."+S(n.classList).join(".")));return"unknown"===t&&(e===document?t="document":e===window?t="window":e instanceof FileReader&&(t="FileReader")),t}function u(n,e,t){var r={n:"history.pushState",s:t-w.offset,e:t-w.offset,o:n,t:e};p(r)}function f(n){n.forEach(function(n){var e=T(n.name),t={n:n.initiatorType,s:0|n.fetchStart,e:0|n.responseEnd,o:e.protocol+"://"+e.hostname+":"+e.port+e.pathname,t:n.entryType};t.s<U||(U=t.s,p(t))})}function c(n,e,t,r){var o=null;"err"===n?o={n:"error",s:r.time,e:r.time,o:t.message,t:t.stackHash}:"xhr"===n&&(o={n:"Ajax",s:r.time,e:r.time+r.duration,o:t.status+" "+t.method+": "+t.host+t.pathname,t:"ajax"}),o&&p(o)}function p(n){var e=B[n.n];e||(e=B[n.n]=[]),e.push(n)}function l(n){var e=!0;return function(){return e||q?(e=!1,n()):{}}}function d(){f(window.performance.getEntriesByType("resource"));var n=j(k(B,function(n,e){return n in N?j(k(j(e.sort(m),v(n),{}),h),g,[]):e}),g,[]);if(0===n.length)return{};B={};var e={qs:{st:""+w.offset,ptid:q},body:{res:n}};if(!q){e.qs.ua=w.info.userAttributes,e.qs.at=w.info.atts;var t=E(w.info.jsAttributes);e.qs.ja="{}"===t?null:t}return e}function m(n,e){return n.s-e.s}function v(n){var e=N[n][0],t=N[n][1],r={};return function(o,i){var a=o[i.o];a||(a=o[i.o]=[]);var s=r[i.o];return"scrolling"!==n||y(i)?s&&i.s-s.s<t&&s.e>i.s-e?s.e=i.e:(r[i.o]=i,a.push(i)):(r[i.o]=null,i.n="scroll",a.push(i)),o}}function h(n,e){return e}function g(n,e){return n.concat(e)}function y(n){var e=4;return!!(n&&"number"==typeof n.e&&"number"==typeof n.s&&n.e-n.s<e)}var w=n("loader"),x=n(14),b=n(9),k=n(30),j=n(32),E=n(19),S=n(31),T=n(28),A=n(12);if(b.xhrUsable){var q="",L={mouseup:!0,mousedown:!0},N={typing:[1e3,2e3],scrolling:[100,1e3],mousing:[1e3,2e3],touching:[1e3,2e3]},C={typing:{keydown:!0,keyup:!0,keypress:!0},mousing:{mousemove:!0,mouseenter:!0,mouseleave:!0,mouseover:!0,mouseout:!0},scrolling:{scroll:!0},touching:{touchstart:!0,touchmove:!0,touchend:!0,touchcancel:!0,touchenter:!0,touchleave:!0}},B={},R=n("ee");if(e.exports={_takeSTNs:d},n(17),w.features.stn){R.on("feat-stn",function(){r(window.performance.timing),b.on("resources",l(d));var n=b.sendX("resources",w,{needResponse:!0});n.addEventListener("load",function(){q=this.responseText},!1),x("bst",i),x("bstTimer",o),x("bstResource",f),x("bstHist",u),x("bstAgg",c),x("bstApi",p),A(function(){var n=0;return Date.now()-w.offset>9e5?void(B={}):(k(B,function(e,t){t&&t.length&&(n+=t.length)}),n>30&&b.sendX("resources",w),void(n>1e3&&(B={})))},1e4)});var U=0}}},{}],27:[function(n,e,t){function r(n,e,t){e.time=t-u.offset,n.cat?o.store("xhr",s([n.status,n.cat]),n,e):o.store("xhr",s([n.status,n.host,n.pathname]),n,e)}var o=n(2),i=n(14),a=n(9),s=n(19),u=n("loader"),f=n("ee");u.features.xhr&&(a.on("jserrors",function(){return{body:o.take(["xhr"])}}),f.on("feat-err",function(){i("xhr",r)}),e.exports=r)},{}],28:[function(n,e,t){e.exports=function(n){var e=document.createElement("a"),t=window.location,r={};e.href=n,r.port=e.port;var o=e.href.split("://");!r.port&&o[1]&&(r.port=o[1].split("/")[0].split("#").pop().split(":")[1]),r.port&&"0"!==r.port||(r.port="https"===o[0]?"443":"80"),r.hostname=e.hostname||t.hostname,r.pathname=e.pathname,r.protocol=o[0],"/"!==r.pathname.charAt(0)&&(r.pathname="/"+r.pathname);var i=!e.protocol||":"===e.protocol||e.protocol===t.protocol,a=e.hostname===document.domain&&e.port===t.port;return r.sameOrigin=i&&(!e.hostname||a),r}},{}],29:[function(n,e,t){var r=0,o=navigator.userAgent.match(/Firefox[\/\s](\d+\.\d+)/);o&&(r=+o[1]),e.exports=r},{}],30:[function(n,e,t){function r(n,e){var t=[],r="",i=0;for(r in n)o.call(n,r)&&(t[i]=e(r,n[r]),i+=1);return t}var o=Object.prototype.hasOwnProperty;e.exports=r},{}],31:[function(n,e,t){function r(n,e,t){e||(e=0),"undefined"==typeof t&&(t=n?n.length:0);for(var r=-1,o=t-e||0,i=Array(0>o?0:o);++r<o;)i[r]=n[e+r];return i}e.exports=r},{}],32:[function(n,e,t){function r(n,e,t){var r=0;for("undefined"==typeof t&&(t=n[0],r=1),r;r<n.length;r++)t=e(t,n[r]);return t}e.exports=r},{}]},{},[23,27,26,25,11]);
This definitely seems malicious but I don't know what it is doing. Can anyone please tell me what this piece of code does?

This code looks like a normal part of New Relic's application performance analytics. It doesn't appear to be malicious.

Related

How to take an unformatted list and make it formatted for Javascript [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I have a very large list that I copied from a text file of about 180 items. The list, however, is not formatted to work in Javascript as it doesn't contain any commas. I'm very new to Javascript, so this maybe a very easy fix. Right now the list looks like this :
Bulbasaur
Ivysaur
Venusaur
Charmander
Charmeleon
Charizard
Squirtle
Wartortle
Blastoise
Caterpie
Metapod
Butterfree
Weedle
Kakuna
Beedrill
Pidgey
Pidgeotto
Pidgeot
Rattata
Raticate
Spearow
Fearow
Ekans
Arbok
Pikachu
Raichu
Sandshrew
Sandslash
Nidoran♀
Nidorina
Nidoqueen
Nidoran♂
Nidorino
Nidoking
Clefairy
Clefable
Vulpix
Ninetales
Jigglypuff
Wigglytuff
Zubat
Golbat
Oddish
Gloom
Vileplume
Paras
Parasect
Venonat
Venomoth
Diglett
Dugtrio
Meowth
Persian
Psyduck
Golduck
Mankey
Primeape
Growlithe
Arcanine
Poliwag
Poliwhirl
Poliwrath
Abra
Kadabra
Alakazam
Machop
Machoke
Machamp
Bellsprout
Weepinbell
Victreebel
Tentacool
Tentacruel
Geodude
Graveler
Golem
Ponyta
Rapidash
Slowpoke
Slowbro
Magnemite
Magneton
Farfetch'd
Doduo
Dodrio
Seel
Dewgong
Grimer
Muk
Shellder
Cloyster
Gastly
Haunter
Gengar
Onix
Drowzee
Hypno
Krabby
Kingler
Voltorb
Electrode
Exeggcute
Exeggutor
Cubone
Marowak
Hitmonlee
Hitmonchan
Lickitung
Koffing
Weezing
Rhyhorn
Rhydon
Chansey
Tangela
Kangaskhan
Horsea
Seadra
Goldeen
Seaking
Staryu
Starmie
Mr. Mime
Scyther
Jynx
Electabuzz
Magmar
Pinsir
Tauros
Magikarp
Gyarados
Lapras
Ditto
Eevee
Vaporeon
Jolteon
Flareon
Porygon
Omanyte
Omastar
Kabuto
Kabutops
Aerodactyl
Snorlax
Articuno
Zapdos
Moltres
Dratini
Dragonair
Dragonite
Mewtwo
Mew
How would I convert this into a working list or array in Javascript?
Here's one way, put it into a hidden element and parse it out. Since the list you show already has line breaks, you can't put it into a variable as is.
let list = document.querySelector('#pokemon').innerText.split("\n").join(",");
console.log(list);
#pokemon{
display:none;
}
<div id='pokemon'>
Bulbasaur
Ivysaur
Venusaur
Charmander
Charmeleon
Charizard
Squirtle
Wartortle
Blastoise
Caterpie
Metapod
Butterfree
Weedle
Kakuna
Beedrill
Pidgey
Pidgeotto
Pidgeot
Rattata
Raticate
Spearow
Fearow
Ekans
Arbok
Pikachu
Raichu
Sandshrew
Sandslash
Nidoran♀
Nidorina
Nidoqueen
Nidoran♂
Nidorino
Nidoking
Clefairy
Clefable
Vulpix
Ninetales
Jigglypuff
Wigglytuff
Zubat
Golbat
Oddish
Gloom
Vileplume
Paras
Parasect
Venonat
Venomoth
Diglett
Dugtrio
Meowth
Persian
Psyduck
Golduck
Mankey
Primeape
Growlithe
Arcanine
Poliwag
Poliwhirl
Poliwrath
Abra
Kadabra
Alakazam
Machop
Machoke
Machamp
Bellsprout
Weepinbell
Victreebel
Tentacool
Tentacruel
Geodude
Graveler
Golem
Ponyta
Rapidash
Slowpoke
Slowbro
Magnemite
Magneton
Farfetch'd
Doduo
Dodrio
Seel
Dewgong
Grimer
Muk
Shellder
Cloyster
Gastly
Haunter
Gengar
Onix
Drowzee
Hypno
Krabby
Kingler
Voltorb
Electrode
Exeggcute
Exeggutor
Cubone
Marowak
Hitmonlee
Hitmonchan
Lickitung
Koffing
Weezing
Rhyhorn
Rhydon
Chansey
Tangela
Kangaskhan
Horsea
Seadra
Goldeen
Seaking
Staryu
Starmie
Mr. Mime
Scyther
Jynx
Electabuzz
Magmar
Pinsir
Tauros
Magikarp
Gyarados
Lapras
Ditto
Eevee
Vaporeon
Jolteon
Flareon
Porygon
Omanyte
Omastar
Kabuto
Kabutops
Aerodactyl
Snorlax
Articuno
Zapdos
Moltres
Dratini
Dragonair
Dragonite
Mewtwo
Mew
</div>
`Bulbasaur
Ivysaur
Venusaur
Charmander
Charmeleon
Charizard
Squirtle`.split('\n').join(',');

Is my backbone.js compromised?

I am using Magento and they recently released a security scan tool. I had a file that was flagged as compromised. Here is the file-
// Backbone.js 0.9.2
// (c) 2010-2012 Jeremy Ashkenas, DocumentCloud Inc.
// Backbone may be freely distributed under the MIT license.
// For all details and documentation:
// http://backbonejs.org
(function(){var l=this,y=l.Backbone,z=Array.prototype.slice,A=Array.prototype.splice,g;g="undefined"!==typeof exports?exports:l.Backbone={};g.VERSION="0.9.2";var f=l._;!f&&"undefined"!==typeof require&&(f=require("underscore"));var i=l.jQuery||l.Zepto||l.ender;g.setDomLibrary=function(a){i=a};g.noConflict=function(){l.Backbone=y;return this};g.emulateHTTP=!1;g.emulateJSON=!1;var p=/\s+/,k=g.Events={on:function(a,b,c){var d,e,f,g,j;if(!b)return this;a=a.split(p);for(d=this._callbacks||(this._callbacks=
{});e=a.shift();)f=(j=d[e])?j.tail:{},f.next=g={},f.context=c,f.callback=b,d[e]={tail:g,next:j?j.next:f};return this},off:function(a,b,c){var d,e,h,g,j,q;if(e=this._callbacks){if(!a&&!b&&!c)return delete this._callbacks,this;for(a=a?a.split(p):f.keys(e);d=a.shift();)if(h=e[d],delete e[d],h&&(b||c))for(g=h.tail;(h=h.next)!==g;)if(j=h.callback,q=h.context,b&&j!==b||c&&q!==c)this.on(d,j,q);return this}},trigger:function(a){var b,c,d,e,f,g;if(!(d=this._callbacks))return this;f=d.all;a=a.split(p);for(g=
z.call(arguments,1);b=a.shift();){if(c=d[b])for(e=c.tail;(c=c.next)!==e;)c.callback.apply(c.context||this,g);if(c=f){e=c.tail;for(b=[b].concat(g);(c=c.next)!==e;)c.callback.apply(c.context||this,b)}}return this}};k.bind=k.on;k.unbind=k.off;var o=g.Model=function(a,b){var c;a||(a={});b&&b.parse&&(a=this.parse(a));if(c=n(this,"defaults"))a=f.extend({},c,a);b&&b.collection&&(this.collection=b.collection);this.attributes={};this._escapedAttributes={};this.cid=f.uniqueId("c");this.changed={};this._silent=
{};this._pending={};this.set(a,{silent:!0});this.changed={};this._silent={};this._pending={};this._previousAttributes=f.clone(this.attributes);this.initialize.apply(this,arguments)};f.extend(o.prototype,k,{changed:null,_silent:null,_pending:null,idAttribute:"id",initialize:function(){},toJSON:function(){return f.clone(this.attributes)},get:function(a){return this.attributes[a]},escape:function(a){var b;if(b=this._escapedAttributes[a])return b;b=this.get(a);return this._escapedAttributes[a]=f.escape(null==
b?"":""+b)},has:function(a){return null!=this.get(a)},set:function(a,b,c){var d,e;f.isObject(a)||null==a?(d=a,c=b):(d={},d[a]=b);c||(c={});if(!d)return this;d instanceof o&&(d=d.attributes);if(c.unset)for(e in d)d[e]=void 0;if(!this._validate(d,c))return!1;this.idAttribute in d&&(this.id=d[this.idAttribute]);var b=c.changes={},h=this.attributes,g=this._escapedAttributes,j=this._previousAttributes||{};for(e in d){a=d[e];if(!f.isEqual(h[e],a)||c.unset&&f.has(h,e))delete g[e],(c.silent?this._silent:
b)[e]=!0;c.unset?delete h[e]:h[e]=a;!f.isEqual(j[e],a)||f.has(h,e)!=f.has(j,e)?(this.changed[e]=a,c.silent||(this._pending[e]=!0)):(delete this.changed[e],delete this._pending[e])}c.silent||this.change(c);return this},unset:function(a,b){(b||(b={})).unset=!0;return this.set(a,null,b)},clear:function(a){(a||(a={})).unset=!0;return this.set(f.clone(this.attributes),a)},fetch:function(a){var a=a?f.clone(a):{},b=this,c=a.success;a.success=function(d,e,f){if(!b.set(b.parse(d,f),a))return!1;c&&c(b,d)};
a.error=g.wrapError(a.error,b,a);return(this.sync||g.sync).call(this,"read",this,a)},save:function(a,b,c){var d,e;f.isObject(a)||null==a?(d=a,c=b):(d={},d[a]=b);c=c?f.clone(c):{};if(c.wait){if(!this._validate(d,c))return!1;e=f.clone(this.attributes)}a=f.extend({},c,{silent:!0});if(d&&!this.set(d,c.wait?a:c))return!1;var h=this,i=c.success;c.success=function(a,b,e){b=h.parse(a,e);if(c.wait){delete c.wait;b=f.extend(d||{},b)}if(!h.set(b,c))return false;i?i(h,a):h.trigger("sync",h,a,c)};c.error=g.wrapError(c.error,
h,c);b=this.isNew()?"create":"update";b=(this.sync||g.sync).call(this,b,this,c);c.wait&&this.set(e,a);return b},destroy:function(a){var a=a?f.clone(a):{},b=this,c=a.success,d=function(){b.trigger("destroy",b,b.collection,a)};if(this.isNew())return d(),!1;a.success=function(e){a.wait&&d();c?c(b,e):b.trigger("sync",b,e,a)};a.error=g.wrapError(a.error,b,a);var e=(this.sync||g.sync).call(this,"delete",this,a);a.wait||d();return e},url:function(){var a=n(this,"urlRoot")||n(this.collection,"url")||t();
return this.isNew()?a:a+("/"==a.charAt(a.length-1)?"":"/")+encodeURIComponent(this.id)},parse:function(a){return a},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return null==this.id},change:function(a){a||(a={});var b=this._changing;this._changing=!0;for(var c in this._silent)this._pending[c]=!0;var d=f.extend({},a.changes,this._silent);this._silent={};for(c in d)this.trigger("change:"+c,this,this.get(c),a);if(b)return this;for(;!f.isEmpty(this._pending);){this._pending=
{};this.trigger("change",this,a);for(c in this.changed)!this._pending[c]&&!this._silent[c]&&delete this.changed[c];this._previousAttributes=f.clone(this.attributes)}this._changing=!1;return this},hasChanged:function(a){return!arguments.length?!f.isEmpty(this.changed):f.has(this.changed,a)},changedAttributes:function(a){if(!a)return this.hasChanged()?f.clone(this.changed):!1;var b,c=!1,d=this._previousAttributes,e;for(e in a)if(!f.isEqual(d[e],b=a[e]))(c||(c={}))[e]=b;return c},previous:function(a){return!arguments.length||
!this._previousAttributes?null:this._previousAttributes[a]},previousAttributes:function(){return f.clone(this._previousAttributes)},isValid:function(){return!this.validate(this.attributes)},_validate:function(a,b){if(b.silent||!this.validate)return!0;var a=f.extend({},this.attributes,a),c=this.validate(a,b);if(!c)return!0;b&&b.error?b.error(this,c,b):this.trigger("error",this,c,b);return!1}});var r=g.Collection=function(a,b){b||(b={});b.model&&(this.model=b.model);b.comparator&&(this.comparator=b.comparator);
this._reset();this.initialize.apply(this,arguments);a&&this.reset(a,{silent:!0,parse:b.parse})};f.extend(r.prototype,k,{model:o,initialize:function(){},toJSON:function(a){return this.map(function(b){return b.toJSON(a)})},add:function(a,b){var c,d,e,g,i,j={},k={},l=[];b||(b={});a=f.isArray(a)?a.slice():[a];c=0;for(d=a.length;c<d;c++){if(!(e=a[c]=this._prepareModel(a[c],b)))throw Error("Can't add an invalid model to a collection");g=e.cid;i=e.id;j[g]||this._byCid[g]||null!=i&&(k[i]||this._byId[i])?
l.push(c):j[g]=k[i]=e}for(c=l.length;c--;)a.splice(l[c],1);c=0;for(d=a.length;c<d;c++)(e=a[c]).on("all",this._onModelEvent,this),this._byCid[e.cid]=e,null!=e.id&&(this._byId[e.id]=e);this.length+=d;A.apply(this.models,[null!=b.at?b.at:this.models.length,0].concat(a));this.comparator&&this.sort({silent:!0});if(b.silent)return this;c=0;for(d=this.models.length;c<d;c++)if(j[(e=this.models[c]).cid])b.index=c,e.trigger("add",e,this,b);return this},remove:function(a,b){var c,d,e,g;b||(b={});a=f.isArray(a)?
a.slice():[a];c=0;for(d=a.length;c<d;c++)if(g=this.getByCid(a[c])||this.get(a[c]))delete this._byId[g.id],delete this._byCid[g.cid],e=this.indexOf(g),this.models.splice(e,1),this.length--,b.silent||(b.index=e,g.trigger("remove",g,this,b)),this._removeReference(g);return this},push:function(a,b){a=this._prepareModel(a,b);this.add(a,b);return a},pop:function(a){var b=this.at(this.length-1);this.remove(b,a);return b},unshift:function(a,b){a=this._prepareModel(a,b);this.add(a,f.extend({at:0},b));return a},
shift:function(a){var b=this.at(0);this.remove(b,a);return b},get:function(a){return null==a?void 0:this._byId[null!=a.id?a.id:a]},getByCid:function(a){return a&&this._byCid[a.cid||a]},at:function(a){return this.models[a]},where:function(a){return f.isEmpty(a)?[]:this.filter(function(b){for(var c in a)if(a[c]!==b.get(c))return!1;return!0})},sort:function(a){a||(a={});if(!this.comparator)throw Error("Cannot sort a set without a comparator");var b=f.bind(this.comparator,this);1==this.comparator.length?
this.models=this.sortBy(b):this.models.sort(b);a.silent||this.trigger("reset",this,a);return this},pluck:function(a){return f.map(this.models,function(b){return b.get(a)})},reset:function(a,b){a||(a=[]);b||(b={});for(var c=0,d=this.models.length;c<d;c++)this._removeReference(this.models[c]);this._reset();this.add(a,f.extend({silent:!0},b));b.silent||this.trigger("reset",this,b);return this},fetch:function(a){a=a?f.clone(a):{};void 0===a.parse&&(a.parse=!0);var b=this,c=a.success;a.success=function(d,
e,f){b[a.add?"add":"reset"](b.parse(d,f),a);c&&c(b,d)};a.error=g.wrapError(a.error,b,a);return(this.sync||g.sync).call(this,"read",this,a)},create:function(a,b){var c=this,b=b?f.clone(b):{},a=this._prepareModel(a,b);if(!a)return!1;b.wait||c.add(a,b);var d=b.success;b.success=function(e,f){b.wait&&c.add(e,b);d?d(e,f):e.trigger("sync",a,f,b)};a.save(null,b);return a},parse:function(a){return a},chain:function(){return f(this.models).chain()},_reset:function(){this.length=0;this.models=[];this._byId=
{};this._byCid={}},_prepareModel:function(a,b){b||(b={});a instanceof o?a.collection||(a.collection=this):(b.collection=this,a=new this.model(a,b),a._validate(a.attributes,b)||(a=!1));return a},_removeReference:function(a){this==a.collection&&delete a.collection;a.off("all",this._onModelEvent,this)},_onModelEvent:function(a,b,c,d){("add"==a||"remove"==a)&&c!=this||("destroy"==a&&this.remove(b,d),b&&a==="change:"+b.idAttribute&&(delete this._byId[b.previous(b.idAttribute)],this._byId[b.id]=b),this.trigger.apply(this,
arguments))}});f.each("forEach,each,map,reduce,reduceRight,find,detect,filter,select,reject,every,all,some,any,include,contains,invoke,max,min,sortBy,sortedIndex,toArray,size,first,initial,rest,last,without,indexOf,shuffle,lastIndexOf,isEmpty,groupBy".split(","),function(a){r.prototype[a]=function(){return f[a].apply(f,[this.models].concat(f.toArray(arguments)))}});var u=g.Router=function(a){a||(a={});a.routes&&(this.routes=a.routes);this._bindRoutes();this.initialize.apply(this,arguments)},B=/:\w+/g,
C=/\*\w+/g,D=/[-[\]{}()+?.,\\^$|#\s]/g;f.extend(u.prototype,k,{initialize:function(){},route:function(a,b,c){g.history||(g.history=new m);f.isRegExp(a)||(a=this._routeToRegExp(a));c||(c=this[b]);g.history.route(a,f.bind(function(d){d=this._extractParameters(a,d);c&&c.apply(this,d);this.trigger.apply(this,["route:"+b].concat(d));g.history.trigger("route",this,b,d)},this));return this},navigate:function(a,b){g.history.navigate(a,b)},_bindRoutes:function(){if(this.routes){var a=[],b;for(b in this.routes)a.unshift([b,
this.routes[b]]);b=0;for(var c=a.length;b<c;b++)this.route(a[b][0],a[b][1],this[a[b][1]])}},_routeToRegExp:function(a){a=a.replace(D,"\\$&").replace(B,"([^/]+)").replace(C,"(.*?)");return RegExp("^"+a+"$")},_extractParameters:function(a,b){return a.exec(b).slice(1)}});var m=g.History=function(){this.handlers=[];f.bindAll(this,"checkUrl")},s=/^[#\/]/,E=/msie [\w.]+/;m.started=!1;f.extend(m.prototype,k,{interval:50,getHash:function(a){return(a=(a?a.location:window.location).href.match(/#(.*)$/))?a[1]:
""},getFragment:function(a,b){if(null==a)if(this._hasPushState||b){var a=window.location.pathname,c=window.location.search;c&&(a+=c)}else a=this.getHash();a.indexOf(this.options.root)||(a=a.substr(this.options.root.length));return a.replace(s,"")},start:function(a){if(m.started)throw Error("Backbone.history has already been started");m.started=!0;this.options=f.extend({},{root:"/"},this.options,a);this._wantsHashChange=!1!==this.options.hashChange;this._wantsPushState=!!this.options.pushState;this._hasPushState=
!(!this.options.pushState||!window.history||!window.history.pushState);var a=this.getFragment(),b=document.documentMode;if(b=E.exec(navigator.userAgent.toLowerCase())&&(!b||7>=b))this.iframe=i('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow,this.navigate(a);this._hasPushState?i(window).bind("popstate",this.checkUrl):this._wantsHashChange&&"onhashchange"in window&&!b?i(window).bind("hashchange",this.checkUrl):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,
this.interval));this.fragment=a;a=window.location;b=a.pathname==this.options.root;if(this._wantsHashChange&&this._wantsPushState&&!this._hasPushState&&!b)return this.fragment=this.getFragment(null,!0),window.location.replace(this.options.root+"#"+this.fragment),!0;this._wantsPushState&&this._hasPushState&&b&&a.hash&&(this.fragment=this.getHash().replace(s,""),window.history.replaceState({},document.title,a.protocol+"//"+a.host+this.options.root+this.fragment));if(!this.options.silent)return this.loadUrl()},
stop:function(){i(window).unbind("popstate",this.checkUrl).unbind("hashchange",this.checkUrl);clearInterval(this._checkUrlInterval);m.started=!1},route:function(a,b){this.handlers.unshift({route:a,callback:b})},checkUrl:function(){var a=this.getFragment();a==this.fragment&&this.iframe&&(a=this.getFragment(this.getHash(this.iframe)));if(a==this.fragment)return!1;this.iframe&&this.navigate(a);this.loadUrl()||this.loadUrl(this.getHash())},loadUrl:function(a){var b=this.fragment=this.getFragment(a);return f.any(this.handlers,
function(a){if(a.route.test(b))return a.callback(b),!0})},navigate:function(a,b){if(!m.started)return!1;if(!b||!0===b)b={trigger:b};var c=(a||"").replace(s,"");this.fragment!=c&&(this._hasPushState?(0!=c.indexOf(this.options.root)&&(c=this.options.root+c),this.fragment=c,window.history[b.replace?"replaceState":"pushState"]({},document.title,c)):this._wantsHashChange?(this.fragment=c,this._updateHash(window.location,c,b.replace),this.iframe&&c!=this.getFragment(this.getHash(this.iframe))&&(b.replace||
this.iframe.document.open().close(),this._updateHash(this.iframe.location,c,b.replace))):window.location.assign(this.options.root+a),b.trigger&&this.loadUrl(a))},_updateHash:function(a,b,c){c?a.replace(a.toString().replace(/(javascript:|#).*$/,"")+"#"+b):a.hash=b}});var v=g.View=function(a){this.cid=f.uniqueId("view");this._configure(a||{});this._ensureElement();this.initialize.apply(this,arguments);this.delegateEvents()},F=/^(\S+)\s*(.*)$/,w="model,collection,el,id,attributes,className,tagName".split(",");
f.extend(v.prototype,k,{tagName:"div",$:function(a){return this.$el.find(a)},initialize:function(){},render:function(){return this},remove:function(){this.$el.remove();return this},make:function(a,b,c){a=document.createElement(a);b&&i(a).attr(b);c&&i(a).html(c);return a},setElement:function(a,b){this.$el&&this.undelegateEvents();this.$el=a instanceof i?a:i(a);this.el=this.$el[0];!1!==b&&this.delegateEvents();return this},delegateEvents:function(a){if(a||(a=n(this,"events"))){this.undelegateEvents();
for(var b in a){var c=a[b];f.isFunction(c)||(c=this[a[b]]);if(!c)throw Error('Method "'+a[b]+'" does not exist');var d=b.match(F),e=d[1],d=d[2],c=f.bind(c,this),e=e+(".delegateEvents"+this.cid);""===d?this.$el.bind(e,c):this.$el.delegate(d,e,c)}}},undelegateEvents:function(){this.$el.unbind(".delegateEvents"+this.cid)},_configure:function(a){this.options&&(a=f.extend({},this.options,a));for(var b=0,c=w.length;b<c;b++){var d=w[b];a[d]&&(this[d]=a[d])}this.options=a},_ensureElement:function(){if(this.el)this.setElement(this.el,
!1);else{var a=n(this,"attributes")||{};this.id&&(a.id=this.id);this.className&&(a["class"]=this.className);this.setElement(this.make(this.tagName,a),!1)}}});o.extend=r.extend=u.extend=v.extend=function(a,b){var c=G(this,a,b);c.extend=this.extend;return c};var H={create:"POST",update:"PUT","delete":"DELETE",read:"GET"};g.sync=function(a,b,c){var d=H[a];c||(c={});var e={type:d,dataType:"json"};c.url||(e.url=n(b,"url")||t());if(!c.data&&b&&("create"==a||"update"==a))e.contentType="application/json",
e.data=JSON.stringify(b.toJSON());g.emulateJSON&&(e.contentType="application/x-www-form-urlencoded",e.data=e.data?{model:e.data}:{});if(g.emulateHTTP&&("PUT"===d||"DELETE"===d))g.emulateJSON&&(e.data._method=d),e.type="POST",e.beforeSend=function(a){a.setRequestHeader("X-HTTP-Method-Override",d)};"GET"!==e.type&&!g.emulateJSON&&(e.processData=!1);return i.ajax(f.extend(e,c))};g.wrapError=function(a,b,c){return function(d,e){e=d===b?e:d;a?a(b,e,c):b.trigger("error",b,e,c)}};var x=function(){},G=function(a,
b,c){var d;d=b&&b.hasOwnProperty("constructor")?b.constructor:function(){a.apply(this,arguments)};f.extend(d,a);x.prototype=a.prototype;d.prototype=new x;b&&f.extend(d.prototype,b);c&&f.extend(d,c);d.prototype.constructor=d;d.__super__=a.prototype;return d},n=function(a,b){return!a||!a[b]?null:f.isFunction(a[b])?a[b]():a[b]},t=function(){throw Error('A "url" property or function must be specified');}}).call(this);
Can anyone tell if this file is ok? I looked for the original version of backbone.js 0.9.2 but couldn't find it.
The scan from Magento is new so it might not be perfected. The file is from a Mirasvit extension.
https://github.com/jashkenas/backbone/blob/0.9.2/backbone-min.js
It matches the original code, so the site is not compromised. It is an older version so it might be outdated code.

Create a quick Weather widget app using Reactjs [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I was wondering if there is an example of weather widget that can be created quickly and it would be better if it is lightweight.
I wanted to share some concepts of creating an application using JavaScript, Jquery and Reactjs. Which can help learning quickly than any other sources. Here is what I did using Reactjs:
HTML:
<div style="width: 310px;display: block;float: left; padding: 20px;">
<div id="weather-app"></div>
</div>
<script src='https://cdnjs.cloudflare.com/ajax/libs/react/0.14.7/react-with-addons.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/react/0.14.7/react-dom.js'></script>
<script src="script.js"></script>
JS:
var Main = React.createClass({
getInitialState: function(){
return {
isLoading: true,
toggleForm: false,
isError: false
}
},
setError: function(value){
this.setState({isError: value});
},
changeLoading: function(value){
this.setState({isLoading: value});
},
onToggleForm: function(value){
this.setState({toggleForm: value});
},
onFormSubmit: function(c, s){
this.onToggleForm(false);
this.refs.change.toggleForm();
this.refs.front.reRender(c, s);
this.setState({isError: false});
},
render: function(){
return (
<div id="weather" className="weather">
<ChangeBtn ref="change" isLoading={this.state.isLoading} toggleForm={this.onToggleForm} />
<Front ref="front" isLoading={this.state.isLoading} isError={this.state.isError} setError={this.setError} loadCallback={this.changeLoading} toggle={this.state.toggleForm} />
<Form isLoading={this.state.isLoading} toggle={this.state.toggleForm} onFormSubmit={this.onFormSubmit} isError={this.state.isError} setError={this.setError} />
<Spinner isLoading={this.state.isLoading} />
</div>
)
}
})
ReactDOM.render(<Main />, document.getElementById("weather-app"));
1) Above code is preview only. Full Example can be found at this plnkr1 link.
2) I created same example using Jquery here: plnkr2
3) I wondered, what if I build the same using native JavaScript for extremely lightweight application? Then I also created the same using pure JavaScript here: plnkr3

What Kind of compressing is that

This is the code of the compressed file!
It's clearly obfuscated and it's hard to dechiffer
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('5 G(b,a){b.N().V(G,n.o.2Z);4.I=b;4.2E=b.N().2y();4.M=a;4.C=t;4.q=t;4.16=t;4.1o=w;4.K(b.v())}G.6.2F=5(){7 d=4;7 g;7 f;4.q=3A.3u("1Y");4.q.5p=4.2E;9(4.1o){4.2a()}4.4O().4H.4B(4.q);4.2X=n.o.u.1G(4.v(),"4b",5(){f=g});n.o.u.1E(4.q,"42",5(){g=H;f=w});n.o.u.1E(4.q,"2M",5(e){g=w;9(!f){7 c;7 b;7 a=d.I.N();n.o.u.X(a,"2M",d.I);n.o.u.X(a,"3V",d.I);9(a.2B()){b=a.1y();c=d.I.1s();a.v().1V(c);1U(5(){a.v().1V(c);9(b!==t&&(a.v().17()>b)){a.v().3F(b+1)}},3z)}e.3w=H;9(e.2j){e.2j()}}});n.o.u.1E(4.q,"2U",5(){7 a=d.I.N();n.o.u.X(a,"2U",d.I)});n.o.u.1E(4.q,"2L",5(){7 a=d.I.N();n.o.u.X(a,"2L",d.I)})};G.6.2Q=5(){9(4.q&&4.q.3e){4.1F();n.o.u.3b(4.2X);n.o.u.57(4.q);4.q.3e.4Z(4.q);4.q=t}};G.6.38=5(){9(4.1o){7 a=4.28(4.C);4.q.U.1J=a.y+"z";4.q.U.1H=a.x+"z"}};G.6.1F=5(){9(4.q){4.q.U.36="2V"}4.1o=w};G.6.2a=5(){9(4.q){7 e="";7 c=4.3g.4j(" ");7 b=12(c[0].1N(),10);7 d=12(c[1].1N(),10);7 a=4.28(4.C);4.q.U.43=4.2P(a);e="<41 3Z=\'"+4.2O+"\' U=\'20: 1Z; 1J: "+d+"z; 1H: "+b+"z; ";9(!4.I.N().1l){e+="3Y: 3X("+(-1*d)+"z, "+((-1*b)+4.1r)+"z, "+((-1*d)+4.1k)+"z, "+(-1*b)+"z);"}e+="\'>";4.q.3W=e+"<1Y U=\'"+"20: 1Z;"+"1J: "+4.1X[0]+"z;"+"1H: "+4.1X[1]+"z;"+"3T: "+4.2D+";"+"1O-1f: "+4.2z+"z;"+"1O-3P: "+4.2v+";"+"1O-3N: "+4.2t+";"+"1O-U: "+4.2s+";"+"1w-3I: "+4.2o+";"+"1w-3E: 1h;"+"1x: "+4.1r+"z;"+"3B-1u:"+4.1k+"z;"+"\'>"+4.16.1w+"</1Y>";9(1Q 4.16.14==="15"||4.16.14===""){4.q.14=4.I.N().2G()}L{4.q.14=4.16.14}4.q.U.36=""}4.1o=H};G.6.3i=5(a){4.16=a;7 b=A.3p(0,a.2T-1);b=A.22(4.M.p-1,b);7 c=4.M[b];4.2O=c.3f;4.1k=c.1u;4.1r=c.1x;4.1X=c.5m||[0,0];4.2c=c.5g||[12(4.1k/2,10),12(4.1r/2,10)];4.2D=c.5b||"55";4.2z=c.51||11;4.2o=c.4V||"2V";4.2t=c.4T||"4R";4.2s=c.4N||"4K";4.2v=c.4J||"4I,4G-4F";4.3g=c.4D||"0 0"};G.6.3h=5(a){4.C=a};G.6.2P=5(b){7 a=[];a.Y("4A: 4y;");a.Y("20: 1Z; 1J: "+b.y+"z; 1H: "+b.x+"z;");a.Y("1x: "+4.1r+"z; 1u: "+4.1k+"z;");j a.4v("")};G.6.28=5(b){7 a=4.37().1P(b);a.x-=4.2c[1];a.y-=4.2c[0];a.x=12(a.x,10);a.y=12(a.y,10);j a};5 D(a){4.W=a;4.Q=a.v();4.T=a.3c();4.13=a.2S();4.18=a.3a();4.k=[];4.C=t;4.2e=t;4.Z=F G(4,a.23())}D.6.45=5(){j 4.k.p};D.6.1D=5(){j 4.k};D.6.2R=5(){j 4.C};D.6.v=5(){j 4.Q};D.6.N=5(){j 4.W};D.6.1s=5(){7 i;7 b=F n.o.1m(4.C,4.C);7 a=4.1D();B(i=0;i<a.p;i++){b.V(a[i].S())}j b};D.6.1C=5(){4.Z.K(t);4.k=[];21 4.k};D.6.1B=5(e){7 i;7 c;7 b;9(4.2N(e)){j w}9(!4.C){4.C=e.S();4.25()}L{9(4.18){7 l=4.k.p+1;7 a=(4.C.O()*(l-1)+e.S().O())/l;7 d=(4.C.19()*(l-1)+e.S().19())/l;4.C=F n.o.1q(a,d);4.25()}}e.1p=H;4.k.Y(e);c=4.k.p;b=4.W.1y();9(b!==t&&4.Q.17()>b){9(e.v()!==4.Q){e.K(4.Q)}}L 9(c<4.13){9(e.v()!==4.Q){e.K(4.Q)}}L 9(c===4.13){B(i=0;i<c;i++){4.k[i].K(t)}}L{e.K(t)}4.2K();j H};D.6.2J=5(a){j 4.2e.2I(a.S())};D.6.25=5(){7 a=F n.o.1m(4.C,4.C);4.2e=4.W.2f(a)};D.6.2K=5(){7 c=4.k.p;7 a=4.W.1y();9(a!==t&&4.Q.17()>a){4.Z.1F();j}9(c<4.13){4.Z.1F();j}7 b=4.W.23().p;7 d=4.W.2H()(4.k,b);4.Z.3h(4.C);4.Z.3i(d);4.Z.2a()};D.6.2N=5(a){7 i;9(4.k.1d){j 4.k.1d(a)!==-1}L{B(i=0;i<4.k.p;i++){9(a===4.k[i]){j H}}}j w};5 8(a,c,b){4.V(8,n.o.2Z);c=c||[];b=b||{};4.k=[];4.E=[];4.1j=[];4.1e=t;4.1i=w;4.T=b.3U||3S;4.13=b.3R||2;4.1W=b.2C||t;4.M=b.3Q||[];4.2d=b.14||"";4.1z=H;9(b.2A!==15){4.1z=b.2A}4.18=w;9(b.2k!==15){4.18=b.2k}4.1a=w;9(b.2x!==15){4.1a=b.2x}4.1l=w;9(b.2w!==15){4.1l=b.2w}4.1I=b.3O||8.2u;4.1t=b.3L||8.2g;4.1c=b.3J||8.2r;4.1T=b.3H||8.2p;4.1R=b.3G||8.2n;4.1v=b.3D||8.2m;4.1S=b.3C||"P";9(3K.3y.3M().1d("3x")!==-1){4.1R=4.1v}4.2q();4.2l(c,H);4.K(a)}8.6.2F=5(){7 a=4;4.1e=4.v();4.1i=H;4.1b();4.1j=[n.o.u.1G(4.v(),"3v",5(){a.1A(w);9(4.17()===(4.2i("3t")||0)||4.17()===4.2i("2C")){n.o.u.X(4,"2h")}}),n.o.u.1G(4.v(),"2h",5(){a.1n()})]};8.6.2Q=5(){7 i;B(i=0;i<4.k.p;i++){9(4.k[i].v()!==4.1e){4.k[i].K(4.1e)}}B(i=0;i<4.E.p;i++){4.E[i].1C()}4.E=[];B(i=0;i<4.1j.p;i++){n.o.u.3b(4.1j[i])}4.1j=[];4.1e=t;4.1i=w};8.6.38=5(){};8.6.2q=5(){7 i,1f;9(4.M.p>0){j}B(i=0;i<4.1c.p;i++){1f=4.1c[i];4.M.Y({3f:4.1I+(i+1)+"."+4.1t,1u:1f,1x:1f})}};8.6.3s=5(){7 i;7 a=4.1D();7 b=F n.o.1m();B(i=0;i<a.p;i++){b.V(a[i].S())}4.v().1V(b)};8.6.3c=5(){j 4.T};8.6.3r=5(a){4.T=a};8.6.2S=5(){j 4.13};8.6.3q=5(a){4.13=a};8.6.1y=5(){j 4.1W};8.6.40=5(a){4.1W=a};8.6.23=5(){j 4.M};8.6.3o=5(a){4.M=a};8.6.2G=5(){j 4.2d};8.6.3n=5(a){4.2d=a};8.6.2B=5(){j 4.1z};8.6.3m=5(a){4.1z=a};8.6.3a=5(){j 4.18};8.6.44=5(a){4.18=a};8.6.3l=5(){j 4.1a};8.6.3k=5(a){4.1a=a};8.6.3j=5(){j 4.1l};8.6.48=5(a){4.1l=a};8.6.5o=5(){j 4.1t};8.6.5n=5(a){4.1t=a};8.6.5l=5(){j 4.1I};8.6.5k=5(a){4.1I=a};8.6.5i=5(){j 4.1c};8.6.5h=5(a){4.1c=a};8.6.2H=5(){j 4.1T};8.6.5f=5(a){4.1T=a};8.6.5e=5(){j 4.1v};8.6.5d=5(a){4.1v=a};8.6.2y=5(){j 4.1S};8.6.5c=5(a){4.1S=a};8.6.1D=5(){j 4.k};8.6.5a=5(){j 4.k.p};8.6.59=5(){j 4.E};8.6.54=5(){j 4.E.p};8.6.1B=5(b,a){4.2b(b);9(!a){4.1n()}};8.6.2l=5(b,a){7 c;B(c 39 b){9(b.50(c)){4.2b(b[c])}}9(!a){4.1n()}};8.6.2b=5(b){9(b.4X()){7 a=4;n.o.u.1G(b,"4W",5(){9(a.1i){4.1p=w;a.1b()}})}b.1p=w;4.k.Y(b)};8.6.4U=5(c,a){7 b=4.29(c);9(!a&&b){4.1b()}j b};8.6.4S=5(a,c){7 i,r;7 b=w;B(i=0;i<a.p;i++){r=4.29(a[i]);b=b||r}9(!c&&b){4.1b()}j b};8.6.29=5(b){7 i;7 a=-1;9(4.k.1d){a=4.k.1d(b)}L{B(i=0;i<4.k.p;i++){9(b===4.k[i]){a=i;4Q}}}9(a===-1){j w}b.K(t);4.k.4P(a,1);j H};8.6.4M=5(){4.1A(H);4.k=[]};8.6.1b=5(){7 a=4.E.4L();4.E=[];4.1A(w);4.1n();1U(5(){7 i;B(i=0;i<a.p;i++){a[i].1C()}},0)};8.6.2f=5(d){7 f=4.37();7 c=F n.o.1q(d.27().O(),d.27().19());7 a=F n.o.1q(d.24().O(),d.24().19());7 e=f.1P(c);e.x+=4.T;e.y-=4.T;7 g=f.1P(a);g.x-=4.T;g.y+=4.T;7 b=f.32(e);7 h=f.32(g);d.V(b);d.V(h);j d};8.6.1n=5(){4.26(0)};8.6.1A=5(a){7 i,J;B(i=0;i<4.E.p;i++){4.E[i].1C()}4.E=[];B(i=0;i<4.k.p;i++){J=4.k[i];J.1p=w;9(a){J.K(t)}}};8.6.30=5(b,e){7 R=4E;7 g=(e.O()-b.O())*A.1K/1M;7 f=(e.19()-b.19())*A.1K/1M;7 a=A.1L(g/2)*A.1L(g/2)+A.31(b.O()*A.1K/1M)*A.31(e.O()*A.1K/1M)*A.1L(f/2)*A.1L(f/2);7 c=2*A.4C(A.2Y(a),A.2Y(1-a));7 d=R*c;j d};8.6.35=5(b,a){j a.2I(b.S())};8.6.33=5(c){7 i,d,P,1h;7 a=4z;7 b=t;B(i=0;i<4.E.p;i++){P=4.E[i];1h=P.2R();9(1h){d=4.30(1h,c.S());9(d<a){a=d;b=P}}}9(b&&b.2J(c)){b.1B(c)}L{P=F D(4);P.1B(c);4.E.Y(P)}};8.6.26=5(e){7 i,J;7 d;7 c=4;9(!4.1i){j}9(e===0){n.o.u.X(4,"4x",4);9(1Q 4.1g!=="15"){4w(4.1g);21 4.1g}}9(4.v().17()>3){d=F n.o.1m(4.v().1s().24(),4.v().1s().27())}L{d=F n.o.1m(F n.o.1q(34.4u,-2W.4t),F n.o.1q(-34.4s,2W.4r))}7 a=4.2f(d);7 b=A.22(e+4.1R,4.k.p);B(i=e;i<b;i++){J=4.k[i];9(!J.1p&&4.35(J,a)){9(!4.1a||(4.1a&&J.4q())){4.33(J)}}}9(b<4.k.p){4.1g=1U(5(){c.26(b)},0)}L{21 4.1g;n.o.u.X(4,"4Y",4)}};8.6.V=5(d,c){j(5(b){7 a;B(a 39 b.6){4.6[a]=b.6[a]}j 4}).4p(d,[c])};8.2p=5(a,c){7 f=0;7 b="";7 d=a.p.4o();7 e=d;4n(e!==0){e=12(e/10,10);f++}f=A.22(f,c);j{1w:d,2T:f,14:b}};8.2n=52;8.2m=4m;8.2u="4l://n-o-4k-58-4i.4h.4g/4f/4e/4d/4c/m";8.2g="4a";8.2r=[53,56,5j,49,47];9(1Q 3d.6.1N!==\'5\'){3d.6.1N=5(){j 4.46(/^\\s+|\\s+$/g,\'\')}}',62,336,'||||this|function|prototype|var|MarkerClusterer|if||||||||||return|markers_|||google|maps|length|div_|||null|event|getMap|false|||px|Math|for|center_|Cluster|clusters_|new|ClusterIcon|true|cluster_|marker|setMap|else|styles_|getMarkerClusterer|lat|cluster|map_||getPosition|gridSize_|style|extend|markerClusterer_|trigger|push|clusterIcon_|||parseInt|minClusterSize_|title|undefined|sums_|getZoom|averageCenter_|lng|ignoreHidden_|repaint|imageSizes_|indexOf|activeMap_|size|timerRefStatic|center|ready_|listeners_|height_|enableRetinaIcons_|LatLngBounds|redraw_|visible_|isAdded|LatLng|width_|getBounds|imageExtension_|height|batchSizeIE_|text|width|getMaxZoom|zoomOnClick_|resetViewport_|addMarker|remove|getMarkers|addDomListener|hide|addListener|left|imagePath_|top|PI|sin|180|trim|font|fromLatLngToDivPixel|typeof|batchSize_|clusterClass_|calculator_|setTimeout|fitBounds|maxZoom_|anchorText_|div|absolute|position|delete|min|getStyles|getSouthWest|calculateBounds_|createClusters_|getNorthEast|getPosFromLatLng_|removeMarker_|show|pushMarkerTo_|anchorIcon_|title_|bounds_|getExtendedBounds|IMAGE_EXTENSION|idle|get|stopPropagation|averageCenter|addMarkers|BATCH_SIZE_IE|BATCH_SIZE|textDecoration_|CALCULATOR|setupStyles_|IMAGE_SIZES|fontStyle_|fontWeight_|IMAGE_PATH|fontFamily_|enableRetinaIcons|ignoreHidden|getClusterClass|textSize_|zoomOnClick|getZoomOnClick|maxZoom|textColor_|className_|onAdd|getTitle|getCalculator|contains|isMarkerInClusterBounds|updateIcon_|mouseout|click|isMarkerAlreadyAdded_|url_|createCss|onRemove|getCenter|getMinimumClusterSize|index|mouseover|none|178|boundsChangedListener_|sqrt|OverlayView|distanceBetweenPoints_|cos|fromDivPixelToLatLng|addToClosestCluster_|85|isMarkerInBounds_|display|getProjection|draw|in|getAverageCenter|removeListener|getGridSize|String|parentNode|url|backgroundPosition_|setCenter|useStyle|getEnableRetinaIcons|setIgnoreHidden|getIgnoreHidden|setZoomOnClick|setTitle|setStyles|max|setMinimumClusterSize|setGridSize|fitMapToMarkers|minZoom|createElement|zoom_changed|cancelBubble|msie|userAgent|100|document|line|clusterClass|batchSizeIE|align|setZoom|batchSize|calculator|decoration|imageSizes|navigator|imageExtension|toLowerCase|weight|imagePath|family|styles|minimumClusterSize|60|color|gridSize|clusterclick|innerHTML|rect|clip|src|setMaxZoom|img|mousedown|cssText|setAverageCenter|getSize|replace|90|setEnableRetinaIcons|78|png|bounds_changed|images|markerclustererplus|trunk|svn|com|googlecode|v3|split|utility|https|500|while|toString|apply|getVisible|00048865625|08136444384544|48388434375|02070771743472|join|clearTimeout|clusteringbegin|pointer|40000|cursor|appendChild|atan2|backgroundPosition|6371|serif|sans|overlayMouseTarget|Arial|fontFamily|normal|slice|clearMarkers|fontStyle|getPanes|splice|break|bold|removeMarkers|fontWeight|removeMarker|textDecoration|dragend|getDraggable|clusteringend|removeChild|hasOwnProperty|textSize|2000||getTotalClusters|black||clearInstanceListeners|library|getClusters|getTotalMarkers|textColor|setClusterClass|setBatchSizeIE|getBatchSizeIE|setCalculator|anchorIcon|setImageSizes|getImageSizes|66|setImagePath|getImagePath|anchorText|setImageExtension|getImageExtension|className'.split('|'),0,{}))
you can use this http://matthewfl.com/unPacker.html to unpack
It worked to me
What you see there is called JavaScript-minification.
What minification does:
Delete line breaks and whitespaces
Replace long object names with one character names
Other minor optimizations that result in less code
This way the size of the script is reduced remarkably. One example of a library that allows minification but also deminification is UglifyJS.

missing ; after for-loop condition

Mozilla Firefox error console is telling me over and over again that:
missing ; after for-loop condition
Here is my JavaScript file (compressed) and I cannot find any error there:
$(document).ready(function(){$('#nav ul li, table tr').mouseover(function(){$(this).addClass('hover')});$('#nav ul li, table tr').mouseout(function(){$(this).removeClass('hover')})});$(document).ready(function(){$('.input-submit').button()});$(document).ready(function(){$('a[rel=external]').click(function(){$(this).attr('target','_top')});$('a[rel=external-new-window]').unbind('click').click(function(){window.open($(this).attr('href'),'','width=800, height=600, scrollbars=1');return false})});$(document).ready(function(){$('.clickable').click(function(){var href=$(this).attr('rel');if(href){window.location=href}})});function browserdetect(){var a=navigator.userAgent.toLowerCase();if(this.isIE=a.indexOf("msie")>-1)this.ieVer=/msie\s(\d\.\d)/.exec(a)[1],this.quirksMode=!document.compatMode||document.compatMode.indexOf("BackCompat")>-1,this.get_style=function(a,c){if(!(c in a.currentStyle))return"";var d=/^([\d.]+)(\w*)/.exec(a.currentStyle[c]);if(!d)return a.currentStyle[c];if(d[1]==0)return"0";if(d[2]&&d[2]!=="px"){var e=a.style.left,f=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;a.style.left=d[1]+d[2];d[0]=a.style.pixelLeft;a.style.left=e;a.runtimeStyle.left=f}return d[0]},this.supportsCorners=this.ieVer>=9;else if(this.ieVer=this.quirksMode=0,this.get_style=function(a,c){c=c.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return document.defaultView.getComputedStyle(a,"").getPropertyValue(c)},this.isSafari=a.indexOf("safari")!=-1,this.isWebKit=a.indexOf("webkit")!=-1,this.isOp="opera"in window)this.supportsCorners=(this.isOp=window.opera.version())>=10.5;else{if(!this.isWebkit&&!(this.isMoz=a.indexOf("firefox")!==-1))for(a=document.childNodes.length;--a>=0;)if("style"in document.childNodes[a]){this.isMoz="MozBorderRadius"in document.childNodes[a].style;break}this.supportsCorners=this.isWebKit||this.isMoz}}var curvyBrowser=new browserdetect;if(curvyBrowser.isIE)try{document.execCommand("BackgroundImageCache",!1,!0)}catch(e$$5){}function curvyCnrSpec(a){this.selectorText=a;this.tlR=this.trR=this.blR=this.brR=0;this.tlu=this.tru=this.blu=this.bru="";this.antiAlias=!0}curvyCnrSpec.prototype.setcorner=function(a,b,c,d){a?(a=a.charAt(0)+b.charAt(0),this[a+"R"]=parseInt(c),this[a+"u"]=d):(this.tlR=this.trR=this.blR=this.brR=parseInt(c),this.tlu=this.tru=this.blu=this.bru=d)};curvyCnrSpec.prototype.get=function(a){if(/^(t|b)(l|r)(R|u)$/.test(a))return this[a];if(/^(t|b)(l|r)Ru$/.test(a))return a=a.charAt(0)+a.charAt(1),this[a+"R"]+this[a+"u"];if(/^(t|b)Ru?$/.test(a)){var b=a.charAt(0);b+=this[b+"lR"]>this[b+"rR"]?"l":"r";b=this[b+"R"];a.length===3&&a.charAt(2)==="u"&&(b+=this.u);return b}throw Error("Don't recognize property "+a);};curvyCnrSpec.prototype.radiusdiff=function(a){if(a!=="t"&&a!=="b")throw Error("Param must be 't' or 'b'");return Math.abs(this[a+"lR"]-this[a+"rR"])};curvyCnrSpec.prototype.setfrom=function(a){this.tlu=this.tru=this.blu=this.bru="px";if("tl"in a)this.tlR=a.tl.radius;if("tr"in a)this.trR=a.tr.radius;if("bl"in a)this.blR=a.bl.radius;if("br"in a)this.brR=a.br.radius;if("antiAlias"in a)this.antiAlias=a.antiAlias};curvyCnrSpec.prototype.cloneOn=function(a){var b=["tl","tr","bl","br"],c=0,d,e;for(d in b)if(!isNaN(d)&&(e=this[b[d]+"u"],e!==""&&e!=="px")){c=new curvyCnrSpec;break}if(c){var f,g,k=curvyBrowser.get_style(a,"left");for(d in b)if(!isNaN(d)){f=b[d];e=this[f+"u"];g=this[f+"R"];if(e!=="px"){var l=a.style.left;a.style.left=g+e;g=a.style.pixelLeft;a.style.left=l}c[f+"R"]=g;c[f+"u"]="px"}a.style.left=k}else c=this;return c};curvyCnrSpec.prototype.radiusSum=function(a){if(a!=="t"&&a!=="b")throw Error("Param must be 't' or 'b'");return this[a+"lR"]+this[a+"rR"]};curvyCnrSpec.prototype.radiusCount=function(a){var b=0;this[a+"lR"]&&++b;this[a+"rR"]&&++b;return b};curvyCnrSpec.prototype.cornerNames=function(){var a=[];this.tlR&&a.push("tl");this.trR&&a.push("tr");this.blR&&a.push("bl");this.brR&&a.push("br");return a};function operasheet(a){var a=document.styleSheets.item(a).ownerNode.text,a=a.replace(/\/\*(\n|\r|.)*?\*\//g,""),b=RegExp("^\\s*([\\w.#][-\\w.#, ]+)[\\n\\s]*\\{([^}]+border-((top|bottom)-(left|right)-)?radius[^}]*)\\}","mg"),c;for(this.rules=[];(c=b.exec(a))!==null;){for(var d=RegExp("(..)border-((top|bottom)-(left|right)-)?radius:\\s*([\\d.]+)(in|em|px|ex|pt)","g"),e,f=new curvyCnrSpec(c[1]);(e=d.exec(c[2]))!==null;)e[1]!=="z-"&&f.setcorner(e[3],e[4],e[5],e[6]);this.rules.push(f)}}operasheet.contains_border_radius=function(a){return/border-((top|bottom)-(left|right)-)?radius/.test(document.styleSheets.item(a).ownerNode.text)};function curvyCorners(){var a,b,c,d,e;if(typeof arguments[0]!=="object")throw curvyCorners.newError("First parameter of curvyCorners() must be an object.");if(arguments[0]instanceof curvyCnrSpec){if(d=arguments[0],!d.selectorText&&typeof arguments[1]==="string")d.selectorText=arguments[1]}else{if(typeof arguments[1]!=="object"&&typeof arguments[1]!=="string")throw curvyCorners.newError("Second parameter of curvyCorners() must be an object or a class name.");b=arguments[1];typeof b!=="string"&&(b="");b!==""&&b.charAt(0)!=="."&&"autoPad"in arguments[0]&&(b="."+b);d=new curvyCnrSpec(b);d.setfrom(arguments[0])}if(d.selectorText){e=0;var f=d.selectorText.replace(/\s+$/,"").split(/,\s*/);c=[];for(a=0;a<f.length;++a){if((b=f[a].lastIndexOf("#"))!==-1)f[a]=f[a].substr(b);c=c.concat(curvyCorners.getElementsBySelector(f[a].split(/\s+/)))}}else e=1,c=arguments;a=e;for(b=c.length;a<b;++a)if(e=c[a],f=!1,e.className?(f=e.className.indexOf("curvyIgnore")!==-1)||(e.className+=" curvyIgnore"):e.className="curvyIgnore",!f){if(e.className.indexOf("curvyRedraw")!==-1){if(typeof curvyCorners.redrawList==="undefined")curvyCorners.redrawList=[];curvyCorners.redrawList.push({node:e,spec:d,copy:e.cloneNode(!1)})}(new curvyObject(d,e)).applyCorners()}}curvyCorners.prototype.applyCornersToAll=function(){throw curvyCorners.newError("This function is now redundant. Just call curvyCorners(). See documentation.");};curvyCorners.redraw=function(){if(!curvyBrowser.supportsCorners){if(!curvyCorners.redrawList)throw curvyCorners.newError("curvyCorners.redraw() has nothing to redraw.");var a=curvyCorners.block_redraw;curvyCorners.block_redraw=!0;for(var b in curvyCorners.redrawList)if(!isNaN(b)){var c=curvyCorners.redrawList[b];if(c.node.clientWidth){for(var d=c.copy.cloneNode(!1),e=c.node.firstChild;e!==null;e=e.nextSibling)if(e.className.indexOf("autoPadDiv")!==-1)break;if(!e){curvyCorners.alert("Couldn't find autoPad DIV");break}c.node.parentNode.replaceChild(d,c.node);for(var f=e.getElementsByTagName("script"),g=f.length-1;g>=0;--g)f[g].parentNode.removeChild(f[g]);for(;e.firstChild;)d.appendChild(e.removeChild(e.firstChild));c=new curvyObject(c.spec,c.node=d);c.applyCorners()}}curvyCorners.block_redraw=a}};curvyCorners.adjust=function(a,b,c){if(!curvyBrowser.supportsCorners){if(!curvyCorners.redrawList)throw curvyCorners.newError("curvyCorners.adjust() has nothing to adjust.");var d,e=curvyCorners.redrawList.length;for(d=0;d<e;++d)if(curvyCorners.redrawList[d].node===a)break;if(d===e)throw curvyCorners.newError("Object not redrawable");a=curvyCorners.redrawList[d].copy}b.indexOf(".")===-1?a[b]=c:eval("obj."+b+"='"+c+"'")};curvyCorners.handleWinResize=function(){curvyCorners.block_redraw||curvyCorners.redraw()};curvyCorners.setWinResize=function(a){curvyCorners.block_redraw=!a};curvyCorners.newError=function(a){return Error("curvyCorners Error:\n"+a)};curvyCorners.alert=function(a){(typeof curvyCornersVerbose==="undefined"||curvyCornersVerbose)&&alert(a)};function curvyObject(a,b){var c;this.box=b;this.settings=a;this.topContainer=this.bottomContainer=this.shell=c=null;var d=this.box.clientWidth;if("canHaveChildren"in this.box&&!this.box.canHaveChildren||this.box.tagName==="TABLE")throw Error(this.errmsg("You cannot apply corners to "+this.box.tagName+" elements.","Error"));if(!d&&curvyBrowser.isIE)this.box.style.zoom=1,d=this.box.clientWidth;if(!d&&curvyBrowser.get_style(this.box,"display")==="inline")this.box.style.display="inline-block",curvyCorners.alert(this.errmsg("Converting inline element to inline-block","warning")),d=this.box.clientWidth;if(!d){if(!this.box.parentNode)throw this.newError("box has no parent!");for(c=this.box;c=c.parentNode){if(!c||c.tagName==="BODY"){this.applyCorners=function(){};curvyCorners.alert(this.errmsg("zero-width box with no accountable parent","warning"));return}if(curvyBrowser.get_style(c,"display")==="none")break}var e=c.style.display;c.style.display="block";d=this.box.clientWidth}if(d){a instanceof curvyCnrSpec?this.spec=a.cloneOn(this.box):(this.spec=new curvyCnrSpec(""),this.spec.setfrom(this.settings));var f=curvyBrowser.get_style(this.box,"borderTopWidth"),g=curvyBrowser.get_style(this.box,"borderBottomWidth"),k=curvyBrowser.get_style(this.box,"borderLeftWidth"),l=curvyBrowser.get_style(this.box,"borderRightWidth"),s=curvyBrowser.get_style(this.box,"borderTopColor"),y=curvyBrowser.get_style(this.box,"borderBottomColor"),q=curvyBrowser.get_style(this.box,"borderLeftColor"),o=curvyBrowser.get_style(this.box,"borderRightColor"),E=curvyBrowser.get_style(this.box,"borderTopStyle"),F=curvyBrowser.get_style(this.box,"borderBottomStyle"),G=curvyBrowser.get_style(this.box,"borderLeftStyle"),H=curvyBrowser.get_style(this.box,"borderRightStyle"),C=curvyBrowser.get_style(this.box,"backgroundColor"),D=curvyBrowser.get_style(this.box,"backgroundImage"),I=curvyBrowser.get_style(this.box,"backgroundRepeat"),p,t;this.box.currentStyle&&this.box.currentStyle.backgroundPositionX?(p=curvyBrowser.get_style(this.box,"backgroundPositionX"),t=curvyBrowser.get_style(this.box,"backgroundPositionY")):(p=curvyBrowser.get_style(this.box,"backgroundPosition"),p=p.split(" "),t=p.length===2?p[1]:0,p=p[0]);var J=curvyBrowser.get_style(this.box,"position"),K=curvyBrowser.get_style(this.box,"paddingTop"),L=curvyBrowser.get_style(this.box,"paddingBottom"),M=curvyBrowser.get_style(this.box,"paddingLeft"),N=curvyBrowser.get_style(this.box,"paddingRight"),w=curvyBrowser.ieVer>7?curvyBrowser.get_style(this.box,"filter"):null,x=this.spec.get("tR"),z=this.spec.get("bR"),u=function(a){if(typeof a==="number")return a;if(typeof a!=="string")throw Error("unexpected styleToNPx type "+typeof a);var c=/^[-\d.]([a-z]+)$/.exec(a);if(c&&c[1]!="px")throw Error("Unexpected unit "+c[1]);if(isNaN(a=parseInt(a)))a=0;return a};try{this.borderWidth=u(f),this.borderWidthB=u(g),this.borderWidthL=u(k),this.borderWidthR=u(l),this.boxColour=curvyObject.format_colour(C),this.topPadding=u(K),this.bottomPadding=u(L),this.leftPadding=u(M),this.rightPadding=u(N),this.boxWidth=d,this.boxHeight=this.box.clientHeight,this.borderColour=curvyObject.format_colour(s),this.borderColourB=curvyObject.format_colour(y),this.borderColourL=curvyObject.format_colour(q),this.borderColourR=curvyObject.format_colour(o),this.borderString=this.borderWidth+"px "+E+" "+this.borderColour,this.borderStringB=this.borderWidthB+"px "+F+" "+this.borderColourB,this.borderStringL=this.borderWidthL+"px "+G+" "+this.borderColourL,this.borderStringR=this.borderWidthR+"px "+H+" "+this.borderColourR,this.backgroundImage=D!="none"?D:"",this.backgroundRepeat=I}catch(O){throw this.newError(O.message);}var A=this.boxHeight,B=d;if(curvyBrowser.isOp){var v;p=u(p);t=u(t);p&&(v=B+this.borderWidthL+this.borderWidthR,p>v&&(p=v),p=v/p*100+"%");t&&(v=A+this.borderWidth+this.borderWidthB,t>v&&(t=v),t=v/t*100+"%")}curvyBrowser.quirksMode||(this.boxWidth-=this.leftPadding+this.rightPadding,this.boxHeight-=this.topPadding+this.bottomPadding);this.contentContainer=document.createElement("div");if(w)this.contentContainer.style.filter=w;for(;this.box.firstChild;)this.contentContainer.appendChild(this.box.removeChild(this.box.firstChild));if(J!="absolute")this.box.style.position="relative";this.box.style.padding="0";this.box.style.border=this.box.style.backgroundImage="none";this.box.style.backgroundColor="transparent";this.box.style.width=B+this.borderWidthL+this.borderWidthR+"px";this.box.style.height=A+this.borderWidth+this.borderWidthB+"px";var i=document.createElement("div");i.style.position="absolute";if(w)i.style.filter=w;i.style.width=curvyBrowser.quirksMode?B+this.borderWidthL+this.borderWidthR+"px":B+"px";i.style.height=A+this.borderWidth+this.borderWidthB-x-z<=0?"0":A+this.borderWidth+this.borderWidthB-x-z+"px";i.style.padding="0";i.style.top=x+"px";i.style.left="0";if(this.borderWidthL)i.style.borderLeft=this.borderStringL;if(this.borderWidth&&!x)i.style.borderTop=this.borderString;if(this.borderWidthR)i.style.borderRight=this.borderStringR;if(this.borderWidthB&&!z)i.style.borderBottom=this.borderStringB;i.style.backgroundColor=C;i.style.backgroundImage=this.backgroundImage;i.style.backgroundRepeat=this.backgroundRepeat;i.style.direction="ltr";this.shell=this.box.appendChild(i);d=curvyBrowser.get_style(this.shell,"width");if(d===""||d==="auto"||d.indexOf("%")!==-1)throw this.newError("Shell width is "+d);this.boxWidth=d!==""&&d!="auto"&&d.indexOf("%")==-1?parseInt(d):this.shell.clientWidth;this.applyCorners=function(){this.backgroundPosX=this.backgroundPosY=0;if(this.backgroundObject){var a=function(a,c,b){if(a===0)return 0;if(a==="right"||a==="bottom")return b-c;if(a==="center")return(b-c)/2;if(a.indexOf("%")>0)return(b-c)*100/parseInt(a);return u(a)};this.backgroundPosX=a(p,this.backgroundObject.width,B);this.backgroundPosY=a(t,this.backgroundObject.height,A)}else if(this.backgroundImage)this.backgroundPosX=u(p),this.backgroundPosY=u(t);if(x)i=document.createElement("div"),i.style.width=this.boxWidth+"px",i.style.fontSize="1px",i.style.overflow="hidden",i.style.position="absolute",i.style.paddingLeft=this.borderWidth+"px",i.style.paddingRight=this.borderWidth+"px",i.style.height=x+"px",i.style.top=-x+"px",i.style.left=-this.borderWidthL+"px",this.topContainer=this.shell.appendChild(i);if(z)i=document.createElement("div"),i.style.width=this.boxWidth+"px",i.style.fontSize="1px",i.style.overflow="hidden",i.style.position="absolute",i.style.paddingLeft=this.borderWidthB+"px",i.style.paddingRight=this.borderWidthB+"px",i.style.height=z+"px",i.style.bottom=-z+"px",i.style.left=-this.borderWidthL+"px",this.bottomContainer=this.shell.appendChild(i);var a=this.spec.cornerNames(),b;for(b in a)if(!isNaN(b)){var d=a[b],f=this.spec[d+"R"],k,g,l;d=="tr"||d=="tl"?(k=this.borderColour,l=this.borderWidth):(k=this.borderColourB,l=this.borderWidthB);g=f-l;var n=document.createElement("div");n.style.height=this.spec.get(d+"Ru");n.style.width=this.spec.get(d+"Ru");n.style.position="absolute";n.style.fontSize="1px";n.style.overflow="hidden";var m,j,o,s=w?parseInt(/alpha\(opacity.(\d+)\)/.exec(w)[1]):100;for(m=0;m<f;++m){var y=m+1>=g?-1:Math.floor(Math.sqrt(Math.pow(g,2)-Math.pow(m+1,2)))-1;if(g!=f)var h=m>=g?-1:Math.ceil(Math.sqrt(Math.pow(g,2)-Math.pow(m,2))),q=m+1>=f?-1:Math.floor(Math.sqrt(Math.pow(f,2)-Math.pow(m+1,2)))-1;var C=m>=f?-1:Math.ceil(Math.sqrt(Math.pow(f,2)-Math.pow(m,2)));y>-1&&this.drawPixel(m,0,this.boxColour,s,y+1,n,!0,f);if(g!=f)if(this.spec.antiAlias){for(j=y+1;j<h;++j)this.backgroundImage!==""?(o=curvyObject.pixelFraction(m,j,g)*100,this.drawPixel(m,j,k,s,1,n,o>=30,f)):this.boxColour!=="transparent"?(o=curvyObject.BlendColour(this.boxColour,k,curvyObject.pixelFraction(m,j,g)),this.drawPixel(m,j,o,s,1,n,!1,f)):this.drawPixel(m,j,k,s>>1,1,n,!1,f);q>=h&&(h==-1&&(h=0),this.drawPixel(m,h,k,s,q-h+1,n,!1,0));o=k;j=q}else q>y&&this.drawPixel(m,y+1,k,s,q-y,n,!1,0);else o=this.boxColour,j=y;if(this.spec.antiAlias&&this.boxColour!=="transparent")for(;++j<C;)this.drawPixel(m,j,o,curvyObject.pixelFraction(m,j,f)*s,1,n,l<=0,f)}v=0;for(k=n.childNodes.length;v<k;++v){g=n.childNodes[v];l=parseInt(g.style.top);m=parseInt(g.style.left);s=parseInt(g.style.height);if(d=="tl"||d=="bl")g.style.left=f-m-1+"px";if(d=="tr"||d=="tl")g.style.top=f-s-l+"px";g.style.backgroundRepeat=this.backgroundRepeat;if(this.backgroundImage)switch(d){case"tr":g.style.backgroundPosition=this.backgroundPosX-this.borderWidthL+f-B-m+"px "+(this.backgroundPosY+s+l+this.borderWidth-f)+"px";break;case"tl":g.style.backgroundPosition=this.backgroundPosX-f+m+1+this.borderWidthL+"px "+(this.backgroundPosY-f+s+l+this.borderWidth)+"px";break;case"bl":g.style.backgroundPosition=this.backgroundPosX-f+m+1+this.borderWidthL+"px "+(this.backgroundPosY-A-this.borderWidth+(curvyBrowser.quirksMode?l:-l)+f)+"px";break;case"br":g.style.backgroundPosition=curvyBrowser.quirksMode?this.backgroundPosX-this.borderWidthL-B+f-m+"px "+(this.backgroundPosY-A-this.borderWidth+l+f)+"px":this.backgroundPosX-this.borderWidthL-B+f-m+"px "+(this.backgroundPosY-A-this.borderWidth+f-l)+"px"}}switch(d){case"tl":n.style.top=n.style.left="0";this.topContainer.appendChild(n);break;case"tr":n.style.top=n.style.right="0";this.topContainer.appendChild(n);break;case"bl":n.style.bottom=n.style.left="0";this.bottomContainer.appendChild(n);break;case"br":n.style.bottom=n.style.right="0",this.bottomContainer.appendChild(n)}}b={t:this.spec.radiusdiff("t"),b:this.spec.radiusdiff("b")};for(var r in b)if(typeof r!=="function"&&this.spec.get(r+"R")){if(b[r]){j=this.spec[r+"lR"]<this.spec[r+"rR"]?r+"l":r+"r";h=document.createElement("div");h.style.height=b[r]+"px";h.style.width=this.spec.get(j+"Ru");h.style.position="absolute";h.style.fontSize="1px";h.style.overflow="hidden";h.style.backgroundColor=this.boxColour;if(w)h.style.filter=w;h.style.backgroundImage=this.backgroundImage;h.style.backgroundRepeat=this.backgroundRepeat;switch(j){case"tl":h.style.bottom=h.style.left="0";h.style.borderLeft=this.borderStringL;h.style.backgroundPosition=this.backgroundPosX+"px "+(this.borderWidth+this.backgroundPosY-this.spec.tlR)+"px";this.topContainer.appendChild(h);break;case"tr":h.style.bottom=h.style.right="0";h.style.borderRight=this.borderStringR;h.style.backgroundPosition=this.backgroundPosX-this.boxWidth+this.spec.trR+"px "+(this.borderWidth+this.backgroundPosY-this.spec.trR)+"px";this.topContainer.appendChild(h);break;case"bl":h.style.top=h.style.left="0";h.style.borderLeft=this.borderStringL;h.style.backgroundPosition=this.backgroundPosX+"px "+(this.backgroundPosY-this.borderWidth-this.boxHeight+b[r]+this.spec.blR)+"px";this.bottomContainer.appendChild(h);break;case"br":h.style.top=h.style.right="0",h.style.borderRight=this.borderStringR,h.style.backgroundPosition=this.borderWidthL+this.backgroundPosX-this.boxWidth+this.spec.brR+"px "+(this.backgroundPosY-this.borderWidth-this.boxHeight+b[r]+this.spec.brR)+"px",this.bottomContainer.appendChild(h)}}j=document.createElement("div");if(w)j.style.filter=w;j.style.position="relative";j.style.fontSize="1px";j.style.overflow="hidden";j.style.width=this.fillerWidth(r);j.style.backgroundColor=this.boxColour;j.style.backgroundImage=this.backgroundImage;j.style.backgroundRepeat=this.backgroundRepeat;switch(r){case"t":if(this.topContainer){j.style.height=curvyBrowser.quirksMode?100+x+"px":100+x-this.borderWidth+"px";j.style.marginLeft=this.spec.tlR?this.spec.tlR-this.borderWidthL+"px":"0";j.style.borderTop=this.borderString;if(this.backgroundImage)h=this.spec.tlR?this.borderWidthL+this.backgroundPosX-this.spec.tlR+"px ":this.backgroundPosX+"px ",j.style.backgroundPosition=h+this.backgroundPosY+"px",this.shell.style.backgroundPosition=this.backgroundPosX+"px "+(this.backgroundPosY-x+this.borderWidthL)+"px";this.topContainer.appendChild(j)}break;case"b":if(this.bottomContainer){j.style.height=curvyBrowser.quirksMode?z+"px":z-this.borderWidthB+"px";j.style.marginLeft=this.spec.blR?this.spec.blR-this.borderWidthL+"px":"0";j.style.borderBottom=this.borderStringB;if(this.backgroundImage)h=this.spec.blR?this.backgroundPosX+this.borderWidthL-this.spec.blR+"px ":this.backgroundPosX+"px ",j.style.backgroundPosition=h+(this.backgroundPosY-A-this.borderWidth+z)+"px";this.bottomContainer.appendChild(j)}}}this.contentContainer.style.position="absolute";this.contentContainer.className="autoPadDiv";this.contentContainer.style.left=this.borderWidthL+"px";this.contentContainer.style.paddingTop=this.topPadding+"px";this.contentContainer.style.top=this.borderWidth+"px";this.contentContainer.style.paddingLeft=this.leftPadding+"px";this.contentContainer.style.paddingRight=this.rightPadding+"px";r=B;curvyBrowser.quirksMode||(r-=this.leftPadding+this.rightPadding);this.contentContainer.style.width=r+"px";this.contentContainer.style.textAlign=curvyBrowser.get_style(this.box,"textAlign");this.box.style.textAlign="left";this.box.appendChild(this.contentContainer);if(c)c.style.display=e};if(this.backgroundImage&&(p=this.backgroundCheck(p),t=this.backgroundCheck(t),this.backgroundObject))this.backgroundObject.holdingElement=this,this.dispatch=this.applyCorners,this.applyCorners=function(){this.backgroundObject.complete?this.dispatch():this.backgroundObject.onload=new Function("curvyObject.dispatch(this.holdingElement);")}}else curvyCorners.alert(this.errmsg("zero-width box, cannot display","error")),this.applyCorners=function(){}}curvyObject.prototype.backgroundCheck=function(a){if(a==="top"||a==="left"||parseInt(a)===0)return 0;if(!/^[-\d.]+px$/.test(a)&&!this.backgroundObject)this.backgroundObject=new Image,this.backgroundObject.src=function(a){var c=/url\("?([^'"]+)"?\)/.exec(a);return c?c[1]:a}(this.backgroundImage);return a};curvyObject.dispatch=function(a){if("dispatch"in a)a.dispatch();else throw a.newError("No dispatch function");};curvyObject.prototype.drawPixel=function(a,b,c,d,e,f,g,k){var l=document.createElement("div");l.style.height=e+"px";l.style.width="1px";l.style.position="absolute";l.style.fontSize="1px";l.style.overflow="hidden";e=this.spec.get("tR");l.style.backgroundColor=c;if(g&&this.backgroundImage!=="")l.style.backgroundImage=this.backgroundImage,l.style.backgroundPosition="-"+(this.boxWidth-(k-a)+this.borderWidth)+"px -"+(this.boxHeight+e+b-this.borderWidth)+"px";d!=100&&curvyObject.setOpacity(l,d);l.style.top=b+"px";l.style.left=a+"px";f.appendChild(l)};curvyObject.prototype.fillerWidth=function(a){var b;b=curvyBrowser.quirksMode?0:this.spec.radiusCount(a)*this.borderWidthL;if((a=this.boxWidth-this.spec.radiusSum(a)+b)<0)throw this.newError("Radius exceeds box width");return a+"px"};curvyObject.prototype.errmsg=function(a,b){var c="\ntag: "+this.box.tagName;this.box.id&&(c+="\nid: "+this.box.id);this.box.className&&(c+="\nclass: "+this.box.className);var d;(d=this.box.parentNode)===null?c+="\n(box has no parent)":(c+="\nParent tag: "+d.tagName,d.id&&(c+="\nParent ID: "+d.id),d.className&&(c+="\nParent class: "+d.className));b===void 0&&(b="warning");return"curvyObject "+b+":\n"+a+c};curvyObject.prototype.newError=function(a){return Error(this.errmsg(a,"exception"))};curvyObject.IntToHex=function(a){var b=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"];return b[a>>>4]+""+b[a&15]};curvyObject.BlendColour=function(a,b,c){if(a==="transparent"||b==="transparent")throw this.newError("Cannot blend with transparent");a.charAt(0)!=="#"&&(a=curvyObject.format_colour(a));b.charAt(0)!=="#"&&(b=curvyObject.format_colour(b));var d=parseInt(a.substr(1,2),16),e=parseInt(a.substr(3,2),16),a=parseInt(a.substr(5,2),16),f=parseInt(b.substr(1,2),16),g=parseInt(b.substr(3,2),16),b=parseInt(b.substr(5,2),16);if(c>1||c<0)c=1;d=Math.round(d*c+f*(1-c));d>255&&(d=255);d<0&&(d=0);e=Math.round(e*c+g*(1-c));e>255&&(e=255);e<0&&(e=0);c=Math.round(a*c+b*(1-c));c>255&&(c=255);c<0&&(c=0);return"#"+curvyObject.IntToHex(d)+curvyObject.IntToHex(e)+curvyObject.IntToHex(c)};curvyObject.pixelFraction=function(a,b,c){c*=c;var d=Array(2),e=Array(2),f=0,g="",k=Math.sqrt(c-Math.pow(a,2));k>=b&&k<b+1&&(g="Left",d[f]=0,e[f]=k-b,++f);k=Math.sqrt(c-Math.pow(b+1,2));k>=a&&k<a+1&&(g+="Top",d[f]=k-a,e[f]=1,++f);k=Math.sqrt(c-Math.pow(a+1,2));k>=b&&k<b+1&&(g+="Right",d[f]=1,e[f]=k-b,++f);k=Math.sqrt(c-Math.pow(b,2));k>=a&&k<a+1&&(g+="Bottom",d[f]=k-a,e[f]=0);switch(g){case"LeftRight":a=Math.min(e[0],e[1])+(Math.max(e[0],e[1])-Math.min(e[0],e[1]))/2;break;case"TopRight":a=1-(1-d[0])*(1-e[1])/2;break;case"TopBottom":a=Math.min(d[0],d[1])+(Math.max(d[0],d[1])-Math.min(d[0],d[1]))/2;break;case"LeftBottom":a=e[0]*d[1]/2;break;default:a=1}return a};curvyObject.rgb2Array=function(a){return a.substring(4,a.indexOf(")")).split(/,\s*/)};curvyObject.rgb2Hex=function(a){try{var b=curvyObject.rgb2Array(a),c=parseInt(b[0]),d=parseInt(b[1]),e=parseInt(b[2]),f="#"+curvyObject.IntToHex(c)+curvyObject.IntToHex(d)+curvyObject.IntToHex(e)}catch(g){throw a="getMessage"in g?g.getMessage():g.message,Error("Error ("+a+") converting RGB value to Hex in rgb2Hex");}return f};curvyObject.setOpacity=function(a,b){b=b==100?99.999:b;if(curvyBrowser.isSafari&&a.tagName!="IFRAME"){var c=curvyObject.rgb2Array(a.style.backgroundColor),d=parseInt(c[0]),e=parseInt(c[1]),c=parseInt(c[2]);a.style.backgroundColor="rgba("+d+", "+e+", "+c+", "+b/100+")"}else if(typeof a.style.opacity!=="undefined")a.style.opacity=b/100;else if(typeof a.style.MozOpacity!=="undefined")a.style.MozOpacity=b/100;else if(typeof a.style.filter!=="undefined")a.style.filter="alpha(opacity="+b+")";else if(typeof a.style.KHTMLOpacity!=="undefined")a.style.KHTMLOpacity=b/100};curvyCorners.addEvent=function(a,b,c,d){if(a.addEventListener)return a.addEventListener(b,c,d),!0;if(a.attachEvent)return a.attachEvent("on"+b,c);a["on"+b]=c;return!1};if(typeof addEvent==="undefined")addEvent=curvyCorners.addEvent;curvyObject.getComputedColour=function(a){var b=document.createElement("DIV");b.style.backgroundColor=a;document.body.appendChild(b);if(window.getComputedStyle)return a=document.defaultView.getComputedStyle(b,null).getPropertyValue("background-color"),b.parentNode.removeChild(b),a.substr(0,3)==="rgb"&&(a=curvyObject.rgb2Hex(a)),a;else{var c=document.body.createTextRange();c.moveToElementText(b);c.execCommand("ForeColor",!1,a);a=c.queryCommandValue("ForeColor");a="rgb("+(a&255)+", "+((a&65280)>>8)+", "+((a&16711680)>>16)+")";b.parentNode.removeChild(b);return curvyObject.rgb2Hex(a)}};curvyObject.format_colour=function(a){a!==""&&a!=="transparent"&&(a.substr(0,3)==="rgb"?a=curvyObject.rgb2Hex(a):a.charAt(0)!=="#"?a=curvyObject.getComputedColour(a):a.length===4&&(a="#"+a.charAt(1)+a.charAt(1)+a.charAt(2)+a.charAt(2)+a.charAt(3)+a.charAt(3)));return a};curvyCorners.getElementsByClass=function(a,b){var c=[];b===void 0&&(b=document);var a=a.split("."),d="*";a.length===1?(d=a[0],a=!1):(a[0]&&(d=a[0]),a=a[1]);var e,f;if(d.charAt(0)==="#")(e=document.getElementById(d.substr(1)))&&c.push(e);else if(e=b.getElementsByTagName(d),f=e.length,a)for(var g=RegExp("(^|\\s)"+a+"(\\s|$)"),d=0;d<f;++d)g.test(e[d].className)&&c.push(e[d]);else for(d=0;d<f;++d)c.push(e[d]);return c};curvyCorners.getElementsBySelector=function(a,b){var c;c=a[0];b===void 0&&(b=document);if(c.indexOf("#")===-1)c=curvyCorners.getElementsByClass(c,b);else{c=b.getElementById(c.substr(1));if(!c)return[];c=[c]}if(a.length>1){for(var d=[],e=c.length;--e>=0;)d=d.concat(curvyCorners.getElementsBySelector(a.slice(1),c[e]));c=d}return c};if(curvyBrowser.supportsCorners){var curvyCornersNoAutoScan=!0;curvyCorners.init=function(){}}else curvyCorners.scanStyles=function(){function a(a){if(!parseInt(a))return"px";return/^[\d.]+(\w+)$/.exec(a)[1]}var b,c,d;if(curvyBrowser.isIE){var e=function(c){var b=c.style,d,e,f,q;curvyBrowser.ieVer>6?(d=b["-moz-border-radius"]||0,e=b["-moz-border-radius-topright"]||0,f=b["-moz-border-radius-topleft"]||0,q=b["-moz-border-radius-bottomright"]||0,b=b["-moz-border-radius-bottomleft"]||0):(d=b["moz-border-radius"]||0,e=b["moz-border-radius-topright"]||0,f=b["moz-border-radius-topleft"]||0,q=b["moz-border-radius-bottomright"]||0,b=b["moz-border-radius-bottomleft"]||0);if(d){var o=d.split("/"),o=o[0].split(/\s+/);o[o.length-1]===""&&o.pop();switch(o.length){case 3:f=o[0];e=b=o[1];q=o[2];d=!1;break;case 2:f=q=o[0],e=b=o[1],d=!1;case 1:break;case 4:f=o[0];e=o[1];q=o[2];b=o[3];d=!1;break;default:curvyCorners.alert("Illegal corners specification: "+d)}}if(d||f||e||q||b)c=new curvyCnrSpec(c.selectorText),d?c.setcorner(null,null,parseInt(d),a(d)):(e&&c.setcorner("t","r",parseInt(e),a(e)),f&&c.setcorner("t","l",parseInt(f),a(f)),b&&c.setcorner("b","l",parseInt(b),a(b)),q&&c.setcorner("b","r",parseInt(q),a(q))),curvyCorners(c)};for(b=0;b<document.styleSheets.length;++b)try{if(document.styleSheets[b].imports)for(c=0;c<document.styleSheets[b].imports.length;++c)for(d=0;d<document.styleSheets[b].imports[c].rules.length;++d)e(document.styleSheets[b].imports[c].rules[d]);for(c=0;c<document.styleSheets[b].rules.length;++c)e(document.styleSheets[b].rules[c])}catch(f){typeof curvyCornersVerbose!=="undefined"&&curvyCornersVerbose&&alert(f.message+" - ignored")}}else if(curvyBrowser.isOp)for(b=0;b<document.styleSheets.length;++b){if(operasheet.contains_border_radius(b))for(c in d=new operasheet(b),d.rules)isNaN(c)||curvyCorners(d.rules[c])}else curvyCorners.alert("Scanstyles does nothing in Webkit/Firefox/Opera")},curvyCorners.init=function(){if(!arguments.callee.done){arguments.callee.done=!0;if(curvyBrowser.isWebKit&&curvyCorners.init.timer)clearInterval(curvyCorners.init.timer),curvyCorners.init.timer=null;curvyCorners.scanStyles()}};if(typeof curvyCornersNoAutoScan==="undefined"||curvyCornersNoAutoScan===!1)curvyBrowser.isOp?document.addEventListener("DOMContentLoaded",curvyCorners.init,!1):curvyCorners.addEvent(window,"load",curvyCorners.init,!1);
Perhaps the compression messed something up? I just opened the uncompressed code in Eclipse and there are no errors.
Instead of opening your uncompressed code in Eclipse, open it in JSHint, fix the errors and I'll bet your problem goes away. Make sure you configure your options to indicate you're using jQuery.
The code is virtually un-readable in the compressed format, but there are some for() loops without the two semicolons.
If you search for the word for( in the code, you should find them. One is about a third of the way through, and reads for(c=this.box;c=c.parentNode).
I didn't have time to keep searching, but I suspect there are more.
If the code is working prior to being compressed then I suspect you're correct about the compressor being faulty. What compressor did you use?
There are many locations in your code where you did not use the ; jslint reports about 10, this is killing for compression. those errors probably chain react to a mis-interpretation of the file by the javascript engine.
In for(var d=RegExp("(..)border-((top|bottom)-(left|right)-)?radius:\\s*([\\d.]+)(in|em|px|ex|pt)","g"),e,f=new curvyCnrSpec(c[1]);(e=d.exec(c[2]))!==null;)e[1]!=="z-"&&f.setcorner(e[3],e[4],e[5],e[6])
The semicolon after null should come after the closing parenthesis. This would be a lot easier to spot if your code was not formatted all on one line.
EDIT: Disregard this, it is totally wrong.
With same problem, found a comma instead of semi-colon.
for(i = 0, i < x.length; i++)

Categories

Resources