/* eyeOS Spice Web Client Copyright (c) 2015 eyeOS S.L. Contact Jose Carlos Norte (jose@eyeos.com) for more information about this software. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License version 3 along with this program in the file "LICENSE". If not, see . See www.eyeos.org for more details. All requests should be sent to licensing@eyeos.org The interactive user interfaces in modified source and object code versions of this program must display Appropriate Legal Notices, as required under Section 5 of the GNU Affero General Public License version 3. In accordance with Section 7(b) of the GNU Affero General Public License version 3, these Appropriate Legal Notices must retain the display of the "Powered by eyeos" logo and retain the original copyright notice. If the display of the logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices must display the words "Powered by eyeos" and retain the original copyright notice. */ //If we are in NODE if (typeof module !== "undefined" && module.exports) { jQuery = $ = { isArray: function (obj) { return Object.prototype.toString.apply(obj) === "[object Array]" }, isPlainObject: function( obj ) { var key; // Must be an Object. // Because of IE, we also have to check the presence of the constructor property. // Make sure that DOM nodes and window objects don't pass through, as well if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { return false; } // Not own constructor property must be Object if ( obj.constructor && !core_hasOwn.call(obj, "constructor") && !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { return false; } // Own properties are enumerated firstly, so to speed up, // if last one is own, then all properties are own. for ( key in obj ) {} return key === undefined || core_hasOwn.call( obj, key ); }, extend: function() { var options, name, src, copy, copyIsArray, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false; // Handle a deep copy situation if ( typeof target === "boolean" ) { deep = target; target = arguments[1] || {}; // skip the boolean and the target i = 2; } // extend jQuery itself if only one argument is passed if ( length === i ) { target = this; --i; } for ( ; i < length; i++ ) { // Only deal with non-null/undefined values if ( (options = arguments[ i ]) != null ) { // Extend the base object for ( name in options ) { src = target[ name ]; copy = options[ name ]; // Prevent never-ending loop if ( target === copy ) { continue; } // Recurse if we're merging plain objects or arrays if ( deep && copy && ( this.isPlainObject(copy) || (copyIsArray = this.isArray(copy)) ) ) { if ( copyIsArray ) { copyIsArray = false; clone = src && this.isArray(src) ? src : []; } else { clone = src && this.isPlainObject(src) ? src : {}; } // Never move original objects, clone them target[ name ] = this.extend( deep, clone, copy ); // Don't bring in undefined values } else if ( copy !== undefined ) { target[ name ] = copy; } } } } // Return the modified object return target; } }; } $.extend({ spcExtend: function(obj) { var f = function(c) { if(typeof this['init'] !== 'undefined') { this.init(c || {}); } }; f.prototype.superInit = obj.init; var args = []; args.push(f.prototype); var length = arguments.length; for(var i =0; i= 10); wdi.Exception = $.spcExtend(wdi.DomainObject, { errorCode: null, message: null, init: function(c) { this.message = c.message || ''; this.errorCode = c.errorCode || 0; } }); try { new ImageData(1,1); } catch(e) { if (typeof window !== 'undefined') {//Just in case it is nodejs window.ImageData = function(arr, width, height) { var canvas = document.createElement('canvas'); var context = canvas.getContext('2d'); var imgData = context.createImageData(width, height); imgData.data.set(arr); return imgData; } } } wdi.bppMask = []; wdi.bppMask[1] = [128, 64, 32, 16, 8, 4, 2, 1]; wdi.bppMask[4] = [240, 15]; wdi.bppMask[8] = [255]; wdi.SeamlessIntegration = true; wdi.Debug.debug = false; wdi.exceptionHandling = true; wdi.IntegrationBenchmarkEnabled = false; // MS Excel loading time benchmark wdi.useWorkers = true; wdi.logOperations = false;