was causing conflicts with other scripts (ex. simple analytics)
This commit is contained in:
jake committed 2020-05-26 12:07:11 -04:00
1 parent 2210792577
commit 185be0abe0
1 file changed
+1 -1
+1 -1
View File
@@ -5,7 +5,7 @@
* Copyright (C) 2013 NTT corp.
* Licensed under MPL 2.0 (see https://github.com/novnc/noVNC/blob/master/LICENSE.txt)
*/
"use strict";var Util={};Array.prototype.push8=function(num){this.push(255&num)};Array.prototype.push16=function(num){this.push(num>>8&255,255&num)};Array.prototype.push32=function(num){this.push(num>>24&255,num>>16&255,num>>8&255,255&num)};Array.prototype.map||(Array.prototype.map=function(fun){var len=this.length;if("function"!=typeof fun)throw new TypeError;for(var res=new Array(len),thisp=arguments[1],i=0;i<len;i++)i in this&&(res[i]=fun.call(thisp,this[i],i,this));return res});Array.prototype.indexOf||(Array.prototype.indexOf=function(elt){var len=this.length>>>0,from=Number(arguments[1])||0;(from=from<0?Math.ceil(from):Math.floor(from))<0&&(from+=len);for(;from<len;from++)if(from in this&&this[from]===elt)return from;return-1});window.requestAnimFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(callback){window.setTimeout(callback,1e3/60)};Util._log_level="warn";Util.init_logging=function(level){void 0===level?level=Util._log_level:Util._log_level=level;void 0===window.console&&(void 0!==window.opera?window.console={log:window.opera.postError,warn:window.opera.postError,error:window.opera.postError}:window.console={log:function(){},warn:function(){},error:function(){}});Util.Debug=Util.Info=Util.Warn=Util.Error=function(){};switch(level){case"debug":Util.Debug=function(){};case"info":Util.Info=function(){};case"warn":Util.Warn=function(){};case"error":Util.Error=function(){};case"none":break;default:throw"invalid logging type '"+level+"'"}};Util.get_logging=function(){return Util._log_level};Util.init_logging();Util.conf_default=function(cfg,api,defaults,v,mode,type,defval,desc){var getter,setter;getter=function(idx){return type in{arr:1,array:1}&&void 0!==idx?cfg[v][idx]:cfg[v]};setter=function(val,idx){type in{boolean:1,bool:1}?val=!(!val||val in{0:1,no:1,false:1}):type in{integer:1,int:1}?val=parseInt(val,10):"str"===type?val=String(val):"func"===type&&(val||(val=function(){}));void 0!==idx?cfg[v][idx]=val:cfg[v]=val};api[v+"_description"]=desc;void 0===api["get_"+v]&&(api["get_"+v]=getter);void 0===api["set_"+v]&&(api["set_"+v]=function(val,idx){if(mode in{RO:1,ro:1})throw v+" is read-only";if(mode in{WO:1,wo:1}&&void 0!==cfg[v])throw v+" can only be set once";setter(val,idx)});void 0!==defaults[v]?defval=defaults[v]:!(type in{arr:1,array:1})||defval instanceof Array||(defval=[]);setter(defval)};Util.conf_defaults=function(cfg,api,defaults,arr){var i;for(i=0;i<arr.length;i++)Util.conf_default(cfg,api,defaults,arr[i][0],arr[i][1],arr[i][2],arr[i][3],arr[i][4])};Util.decodeUTF8=function(utf8string){return decodeURIComponent(escape(utf8string))};Util.get_include_uri=function(){return"undefined"!=typeof INCLUDE_URI?INCLUDE_URI:"include/"};Util._loading_scripts=[];Util._pending_scripts=[];Util.load_scripts=function(files){for(var script,head=document.getElementsByTagName("head")[0],ls=Util._loading_scripts,ps=Util._pending_scripts,f=0;f<files.length;f++){(script=document.createElement("script")).type="text/javascript";script.src=Util.get_include_uri()+files[f];script.onload=script.onreadystatechange=function(){for(;ls.length>0&&("loaded"===ls[0].readyState||"complete"===ls[0].readyState);){var s=ls.shift();head.appendChild(s)}if((!this.readyState||Util.Engine.presto&&"loaded"===this.readyState||"complete"===this.readyState)&&ps.indexOf(this)>=0){this.onload=this.onreadystatechange=null;ps.splice(ps.indexOf(this),1);0===ps.length&&window.onscriptsload&&window.onscriptsload()}};if(Util.Engine.trident)ls.push(script);else{script.async=!1;head.appendChild(script)}ps.push(script)}};Util.getPosition=function(obj){var x=0,y=0;if(obj.offsetParent)do{x+=obj.offsetLeft;y+=obj.offsetTop;obj=obj.offsetParent}while(obj);return{x:x,y:y}};Util.getEventPosition=function(e,obj,scale){var evt,docX,docY,pos;if((evt=(evt=e||window.event).changedTouches?evt.changedTouches[0]:evt.touches?evt.touches[0]:evt).pageX||evt.pageY){docX=evt.pageX;docY=evt.pageY}else if(evt.clientX||evt.clientY){docX=evt.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;docY=evt.clientY+document.body.scrollTop+document.documentElement.scrollTop}void 0===scale&&(scale=1);var realx=docX-(pos=Util.getPosition(obj)).x,realy=docY-pos.y;return{x:Math.max(Math.min(realx,obj.width-1),0)/scale,y:Math.max(Math.min(realy,obj.height-1),0)/scale,realx:realx/scale,realy:realy/scale}};Util.addEvent=function(obj,evType,fn){if(obj.attachEvent)return obj.attachEvent("on"+evType,fn);if(obj.addEventListener){obj.addEventListener(evType,fn,!1);return!0}throw"Handler could not be attached"};Util.removeEvent=function(obj,evType,fn){if(obj.detachEvent)return obj.detachEvent("on"+evType,fn);if(obj.removeEventListener){obj.removeEventListener(evType,fn,!1);return!0}throw"Handler could not be removed"};Util.stopEvent=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0;e.preventDefault?e.preventDefault():e.returnValLine truncated
"use strict";var Util={},addFunc=function(cl,name,func){cl.prototype[name]||Object.defineProperty(cl.prototype,name,{enumerable:!1,value:func})};addFunc(Array,"push8",(function(num){this.push(255&num)}));addFunc(Array,"push16",(function(num){this.push(num>>8&255,255&num)}));addFunc(Array,"push32",(function(num){this.push(num>>24&255,num>>16&255,num>>8&255,255&num)}));addFunc(Array,"map",(function(fun){var len=this.length;if("function"!=typeof fun)throw new TypeError;for(var res=new Array(len),thisp=arguments[1],i=0;i<len;i++)i in this&&(res[i]=fun.call(thisp,this[i],i,this));return res}));addFunc(Array,"indexOf",(function(elt){var len=this.length>>>0,from=Number(arguments[1])||0;(from=from<0?Math.ceil(from):Math.floor(from))<0&&(from+=len);for(;from<len;from++)if(from in this&&this[from]===elt)return from;return-1}));Object.keys||(Object.keys=function(){var hasOwnProperty=Object.prototype.hasOwnProperty,hasDontEnumBug=!{toString:null}.propertyIsEnumerable("toString"),dontEnums=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],dontEnumsLength=dontEnums.length;return function(obj){if("object"!=typeof obj&&("function"!=typeof obj||null===obj))throw new TypeError("Object.keys called on non-object");var prop,i,result=[];for(prop in obj)hasOwnProperty.call(obj,prop)&&result.push(prop);if(hasDontEnumBug)for(i=0;i<dontEnumsLength;i++)hasOwnProperty.call(obj,dontEnums[i])&&result.push(dontEnums[i]);return result}}());window.requestAnimFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(callback){window.setTimeout(callback,1e3/60)};Util._log_level="warn";Util.init_logging=function(level){void 0===level?level=Util._log_level:Util._log_level=level;void 0===window.console&&(void 0!==window.opera?window.console={log:window.opera.postError,warn:window.opera.postError,error:window.opera.postError}:window.console={log:function(){},warn:function(){},error:function(){}});Util.Debug=Util.Info=Util.Warn=Util.Error=function(){};switch(level){case"debug":Util.Debug=function(){};case"info":Util.Info=function(){};case"warn":Util.Warn=function(){};case"error":Util.Error=function(){};case"none":break;default:throw"invalid logging type '"+level+"'"}};Util.get_logging=function(){return Util._log_level};Util.init_logging();Util.conf_default=function(cfg,api,defaults,v,mode,type,defval,desc){var getter,setter;getter=function(idx){return type in{arr:1,array:1}&&void 0!==idx?cfg[v][idx]:cfg[v]};setter=function(val,idx){type in{boolean:1,bool:1}?val=!(!val||val in{0:1,no:1,false:1}):type in{integer:1,int:1}?val=parseInt(val,10):"str"===type?val=String(val):"func"===type&&(val||(val=function(){}));void 0!==idx?cfg[v][idx]=val:cfg[v]=val};api[v+"_description"]=desc;void 0===api["get_"+v]&&(api["get_"+v]=getter);void 0===api["set_"+v]&&(api["set_"+v]=function(val,idx){if(mode in{RO:1,ro:1})throw v+" is read-only";if(mode in{WO:1,wo:1}&&void 0!==cfg[v])throw v+" can only be set once";setter(val,idx)});void 0!==defaults[v]?defval=defaults[v]:!(type in{arr:1,array:1})||defval instanceof Array||(defval=[]);setter(defval)};Util.conf_defaults=function(cfg,api,defaults,arr){var i;for(i=0;i<arr.length;i++)Util.conf_default(cfg,api,defaults,arr[i][0],arr[i][1],arr[i][2],arr[i][3],arr[i][4])};Util.decodeUTF8=function(utf8string){return decodeURIComponent(escape(utf8string))};Util.getPosition=function(obj){var x=0,y=0;if(obj.offsetParent)do{x+=obj.offsetLeft;y+=obj.offsetTop;obj=obj.offsetParent}while(obj);return{x:x,y:y}};Util.getEventPosition=function(e,obj,scale){var evt,docX,docY,pos;if((evt=(evt=e||window.event).changedTouches?evt.changedTouches[0]:evt.touches?evt.touches[0]:evt).pageX||evt.pageY){docX=evt.pageX;docY=evt.pageY}else if(evt.clientX||evt.clientY){docX=evt.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;docY=evt.clientY+document.body.scrollTop+document.documentElement.scrollTop}void 0===scale&&(scale=1);var realx=docX-(pos=Util.getPosition(obj)).x,realy=docY-pos.y;return{x:Math.max(Math.min(realx,obj.width-1),0)/scale,y:Math.max(Math.min(realy,obj.height-1),0)/scale,realx:realx/scale,realy:realy/scale}};Util.addEvent=function(obj,evType,fn){if(obj.attachEvent)return obj.attachEvent("on"+evType,fn);if(obj.addEventListener){obj.addEventListener(evType,fn,!1);return!0}throw"Handler could not be attached"};Util.removeEvent=function(obj,evType,fn){if(obj.detachEvent)return obj.detachEvent("on"+evType,fn);if(obj.removeEventListener){obj.removeEventListener(evType,fn,!1);return!0}throw"Handler could not be removed"};Util.stopEvent=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0;e.preventDefault?e.preventDefault():e.returnValue=!1};Util.Features={xpath:!!document.evaluate,air:!!window.runtime,query:!!document.querySelector};Util.Engine={presto:!!window.opera,trident:!!window.ActiveXObject&&(window.XMLHttpRequest?document.Line truncated
/*!
* This DES class has been extracted from package Acme.Crypto for use in VNC.
* The unnecessary odd parity code has been removed.