/* * noVNC: HTML5 VNC client * Copyright (C) 2012 Joel Martin * Copyright (C) 2013 NTT corp. * Licensed under MPL 2.0 (see LICENSE.txt) * * See README.md for usage and integration instructions. */ var WebUtil={},$D;window.$D||(window.$D=function(e){return document.getElementById?document.getElementById(e):document.all?document.all[e]:document.layers?document.layers[e]:void 0}),WebUtil.init_logging=function(e){"use strict";if(void 0!==e)Util._log_level=e;else{var t=document.location.href.match(/logging=([A-Za-z0-9\._\-]*)/);Util._log_level=(t||["",Util._log_level])[1]}Util.init_logging()},WebUtil.dirObj=function(e,t,i){"use strict";t||(t=2),i||(i="");var n="";for(var o in e)if(t>1&&"object"==typeof e[o])n+=WebUtil.dirObj(e[o],t-1,i+"."+o);else{var r="";r=void 0===e[o]?"undefined":e[o].toString().replace("\n"," "),r.length>30&&(r=r.substr(0,30)+"..."),n+=i+"."+o+": "+r+"\n"}return n},WebUtil.getQueryVar=function(e,t){"use strict";var i=new RegExp(".*[?&]"+e+"=([^&#]*)"),n=document.location.href.match(i);return void 0===t&&(t=null),n?decodeURIComponent(n[1]):t},WebUtil.getHashVar=function(e,t){"use strict";var i=new RegExp(".*[&#]"+e+"=([^&]*)"),n=document.location.hash.match(i);return void 0===t&&(t=null),n?decodeURIComponent(n[1]):t},WebUtil.getConfigVar=function(e,t){"use strict";var i=WebUtil.getHashVar(e);return null===i&&(i=WebUtil.getQueryVar(e,t)),i},WebUtil.createCookie=function(e,t,i){"use strict";var n,o;i?(n=new Date,n.setTime(n.getTime()+24*i*60*60*1e3),o="; expires="+n.toGMTString()):o="";var r;r="https:"===document.location.protocol?"; secure":"",document.cookie=e+"="+t+o+"; path=/"+r},WebUtil.readCookie=function(e,t){"use strict";for(var i=e+"=",n=document.cookie.split(";"),o=0;o-1&&t.push(e[i]);return t},WebUtil.selectStylesheet=function(e){"use strict";void 0===e&&(e="default");for(var t=WebUtil.getStylesheets(),i=0;i