aboutsummaryrefslogtreecommitdiffstats
path: root/portal-common/src/main/webapp/common/js
diff options
context:
space:
mode:
Diffstat (limited to 'portal-common/src/main/webapp/common/js')
-rw-r--r--portal-common/src/main/webapp/common/js/Main2moreMenu.js17
-rw-r--r--portal-common/src/main/webapp/common/js/core/const.js46
-rw-r--r--portal-common/src/main/webapp/common/js/core/hk.min.js819
-rw-r--r--portal-common/src/main/webapp/common/js/core/load_menuList.js70
-rw-r--r--portal-common/src/main/webapp/common/js/core/openoFrameWork.js3701
-rw-r--r--portal-common/src/main/webapp/common/js/core/pym.min.js16
-rw-r--r--portal-common/src/main/webapp/common/js/fm_light.js169
-rw-r--r--portal-common/src/main/webapp/common/js/international/loadi18n.js52
-rw-r--r--portal-common/src/main/webapp/common/js/json2.js341
-rw-r--r--portal-common/src/main/webapp/common/js/login.js158
-rw-r--r--portal-common/src/main/webapp/common/js/mainpage/about.js142
-rw-r--r--portal-common/src/main/webapp/common/js/mainpage/load_mainPage.js95
-rw-r--r--portal-common/src/main/webapp/common/js/moreOperation.js166
-rw-r--r--portal-common/src/main/webapp/common/js/openotopo/openotopo.js314
-rw-r--r--portal-common/src/main/webapp/common/js/openotopo/openotopo.min.js32
-rw-r--r--portal-common/src/main/webapp/common/js/security/aes.js44
-rw-r--r--portal-common/src/main/webapp/common/js/security/framework-util.js38
-rw-r--r--portal-common/src/main/webapp/common/js/security/security.js127
-rw-r--r--portal-common/src/main/webapp/common/js/tools.js1021
19 files changed, 0 insertions, 7368 deletions
diff --git a/portal-common/src/main/webapp/common/js/Main2moreMenu.js b/portal-common/src/main/webapp/common/js/Main2moreMenu.js
deleted file mode 100644
index 576595fb..00000000
--- a/portal-common/src/main/webapp/common/js/Main2moreMenu.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright 2016-2017, CMCC Technologies Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var sideBarMenu_to_moreMenu_frame = new Array();
-var horBarMenu_to_moreMenu_frame = new Array();
diff --git a/portal-common/src/main/webapp/common/js/core/const.js b/portal-common/src/main/webapp/common/js/core/const.js
deleted file mode 100644
index fd96a5e9..00000000
--- a/portal-common/src/main/webapp/common/js/core/const.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2016-2017, CMCC Technologies Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var fMenuSiderDivId = 'page-f-sidebar-menu';
-var ICTFRAME_CONST_SPINNER_GIF_PATH="image/loading-spinner-grey.gif";
-var ICTFRAME_CONST_IFRAME_HEIGHT_AJUST = 10;
-var ICTFRAME_CONST_IFRAME_HEIGHT_AJUST_IE = 5;
-var ICTFRAME_CONST_THEME_COLOR_CSS_PREFFIX = "css/themes/";
-var ICTFRAME_CONST_DEFAULTPAGE_PATH = "default.html?";
-var ICTFRAME_CONST_DATABACKUP_PATH = 'menus/dataBackup-mysql.html';
-var IS_V5_TESTVERSION = true;
-
-var FrameConst={};
-//Ĭϵ¼ɹתҳ
-FrameConst.DEFAULT_LOGINSKIP_PAGE = "common/main-page.html";
-FrameConst.DEFAULT_PAGE = "default.html";
-
-FrameConst.do_heartbeat = false;
-FrameConst.change_pass = false;
-//Ƿ
-FrameConst.isEncypt = "false";
-FrameConst.REST_FRAMECOMMIFO = "../../api/uiframe/v1/frameCommInfo";
-FrameConst.REST_HEARTBEAT = "../../api/uiframe/v1/heartbeat";
-FrameConst.REST_GETLICENSEINFO = "../../api/uiframe/v1/licensevalueinfo";
-FrameConst.REST_CHECKRIGHT = "../../api/uiframe/v1/checkRight";
-FrameConst.REST_LOGIN = "../../api/uiframe/v1/login";
-FrameConst.REST_GET_FRAME_MENUDIRECTION = "../../api/uiframe/v1/confByKey?key=usf.mainframe.web.navigation.direction";
-FrameConst.REST_GET_USERNAME = "../../api/uiframe/v1/userName";
-
-
-FrameConst.REST_GET_VERSIONINFO = "../../api/uiframe/v1/versionInfo";
-var zte_http_headers=new Array();
-zte_http_headers.push({"key":"ICTAuthentication","value":"icttka","store":true});
-zte_http_headers.push({"key":"isFromWeb","value":"1","store":false}); \ No newline at end of file
diff --git a/portal-common/src/main/webapp/common/js/core/hk.min.js b/portal-common/src/main/webapp/common/js/core/hk.min.js
deleted file mode 100644
index a6baa7ab..00000000
--- a/portal-common/src/main/webapp/common/js/core/hk.min.js
+++ /dev/null
@@ -1,819 +0,0 @@
-/*
- * Copyright 2016-2017, CMCC Technologies Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-;(function(window, define) {
- var _ = {
- version: "2.3.0",
- areas: {},
- apis: {},
-
- // utilities
- inherit: function(api, o) {
- for (var p in api) {
- if (!o.hasOwnProperty(p)) {
- o[p] = api[p];
- }
- }
- return o;
- },
- stringify: function(d) {
- return d === undefined || typeof d === "function" ? d+'' : JSON.stringify(d);
- },
- parse: function(s) {
- // if it doesn't parse, return as is
- try{ return JSON.parse(s); }catch(e){ return s; }
- },
-
- // extension hooks
- fn: function(name, fn) {
- _.storeAPI[name] = fn;
- for (var api in _.apis) {
- _.apis[api][name] = fn;
- }
- },
- get: function(area, key){ return area.getItem(key); },
- set: function(area, key, string){ area.setItem(key, string); },
- remove: function(area, key){ area.removeItem(key); },
- key: function(area, i){ return area.key(i); },
- length: function(area){ return area.length; },
- clear: function(area){ area.clear(); },
-
- // core functions
- Store: function(id, area, namespace) {
- var store = _.inherit(_.storeAPI, function(key, data, overwrite) {
- if (arguments.length === 0){ return store.getAll(); }
- if (data !== undefined){ return store.set(key, data, overwrite); }
- if (typeof key === "string"){ return store.get(key); }
- if (!key){ return store.clear(); }
- return store.setAll(key, data);// overwrite=data, data=key
- });
- store._id = id;
- try {
- var testKey = '_safariPrivate_';
- area.setItem(testKey, 'sucks');
- store._area = area;
- area.removeItem(testKey);
- } catch (e) {}
- if (!store._area) {
- store._area = _.inherit(_.storageAPI, { items: {}, name: 'fake' });
- }
- store._ns = namespace || '';
- if (!_.areas[id]) {
- _.areas[id] = store._area;
- }
- if (!_.apis[store._ns+store._id]) {
- _.apis[store._ns+store._id] = store;
- }
- return store;
- },
- storeAPI: {
- // admin functions
- area: function(id, area) {
- var store = this[id];
- if (!store || !store.area) {
- store = _.Store(id, area, this._ns);//new area-specific api in this namespace
- if (!this[id]){ this[id] = store; }
- }
- return store;
- },
- namespace: function(namespace, noSession) {
- if (!namespace){
- return this._ns ? this._ns.substring(0,this._ns.length-1) : '';
- }
- var ns = namespace, store = this[ns];
- if (!store || !store.namespace) {
- store = _.Store(this._id, this._area, this._ns+ns+'.');//new namespaced api
- if (!this[ns]){ this[ns] = store; }
- if (!noSession){ store.area('session', _.areas.session); }
- }
- return store;
- },
- isFake: function(){ return this._area.name === 'fake'; },
- toString: function() {
- return 'store'+(this._ns?'.'+this.namespace():'')+'['+this._id+']';
- },
-
- // storage functions
- has: function(key) {
- if (this._area.has) {
- return this._area.has(this._in(key));//extension hook
- }
- return !!(this._in(key) in this._area);
- },
- size: function(){ return this.keys().length; },
- each: function(fn, and) {
- for (var i=0, m=_.length(this._area); i<m; i++) {
- var key = this._out(_.key(this._area, i));
- if (key !== undefined) {
- if (fn.call(this, key, and || this.get(key)) === false) {
- break;
- }
- }
- if (m > _.length(this._area)) { m--; i--; }// in case of removeItem
- }
- return and || this;
- },
- keys: function() {
- return this.each(function(k, list){ list.push(k); }, []);
- },
- get: function(key, alt) {
- var s = _.get(this._area, this._in(key));
- return s !== null ? _.parse(s) : alt || s;// support alt for easy default mgmt
- },
- getAll: function() {
- return this.each(function(k, all){ all[k] = this.get(k); }, {});
- },
- set: function(key, data, overwrite) {
- var d = this.get(key);
- if (d != null && overwrite === false) {
- return data;
- }
- return _.set(this._area, this._in(key), _.stringify(data), overwrite) || d;
- },
- setAll: function(data, overwrite) {
- var changed, val;
- for (var key in data) {
- val = data[key];
- if (this.set(key, val, overwrite) !== val) {
- changed = true;
- }
- }
- return changed;
- },
- remove: function(key) {
- var d = this.get(key);
- _.remove(this._area, this._in(key));
- return d;
- },
- clear: function() {
- if (!this._ns) {
- _.clear(this._area);
- } else {
- this.each(function(k){ _.remove(this._area, this._in(k)); }, 1);
- }
- return this;
- },
- clearAll: function() {
- var area = this._area;
- for (var id in _.areas) {
- if (_.areas.hasOwnProperty(id)) {
- this._area = _.areas[id];
- this.clear();
- }
- }
- this._area = area;
- return this;
- },
-
- // internal use functions
- _in: function(k) {
- if (typeof k !== "string"){ k = _.stringify(k); }
- return this._ns ? this._ns + k : k;
- },
- _out: function(k) {
- return this._ns ?
- k && k.indexOf(this._ns) === 0 ?
- k.substring(this._ns.length) :
- undefined : // so each() knows to skip it
- k;
- }
- },// end _.storeAPI
- storageAPI: {
- length: 0,
- has: function(k){ return this.items.hasOwnProperty(k); },
- key: function(i) {
- var c = 0;
- for (var k in this.items){
- if (this.has(k) && i === c++) {
- return k;
- }
- }
- },
- setItem: function(k, v) {
- if (!this.has(k)) {
- this.length++;
- }
- this.items[k] = v;
- },
- removeItem: function(k) {
- if (this.has(k)) {
- delete this.items[k];
- this.length--;
- }
- },
- getItem: function(k){ return this.has(k) ? this.items[k] : null; },
- clear: function(){ for (var k in this.list){ this.removeItem(k); } },
- toString: function(){ return this.length+' items in '+this.name+'Storage'; }
- }// end _.storageAPI
- };
-
- // setup the primary store fn
- if (window.store){ _.conflict = window.store; }
- var store =
- // safely set this up (throws error in IE10/32bit mode for local files)
- _.Store("local", (function(){try{ return localStorage; }catch(e){}})());
- store.local = store;// for completeness
- store._ = _;// for extenders and debuggers...
- // safely setup store.session (throws exception in FF for file:/// urls)
- store.area("session", (function(){try{ return sessionStorage; }catch(e){}})());
-
- //Expose store to the global object
- window.store = store;
-
- if (typeof define === 'function' && define.amd !== undefined) {
- define(function () {
- return store;
- });
- } else if (typeof module !== 'undefined' && module.exports) {
- module.exports = store;
- }
-
-})(this, null);
-
-// XHook - v1.3.3 - https://github.com/jpillora/xhook
-// Jaime Pillora <dev@jpillora.com> - MIT Copyright 2015
-(function(window,undefined) {
-var AFTER, BEFORE, COMMON_EVENTS, EventEmitter, FIRE, FormData, NativeFormData, NativeXMLHttp, OFF, ON, READY_STATE, UPLOAD_EVENTS, XHookFormData, XHookHttpRequest, XMLHTTP, convertHeaders, depricatedProp, document, fakeEvent, mergeObjects, msie, proxyEvents, slice, xhook, _base,
- __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
-
-document = window.document;
-
-BEFORE = 'before';
-
-AFTER = 'after';
-
-READY_STATE = 'readyState';
-
-ON = 'addEventListener';
-
-OFF = 'removeEventListener';
-
-FIRE = 'dispatchEvent';
-
-XMLHTTP = 'XMLHttpRequest';
-
-FormData = 'FormData';
-
-UPLOAD_EVENTS = ['load', 'loadend', 'loadstart'];
-
-COMMON_EVENTS = ['progress', 'abort', 'error', 'timeout'];
-
-msie = parseInt((/msie (\d+)/.exec(navigator.userAgent.toLowerCase()) || [])[1]);
-
-if (isNaN(msie)) {
- msie = parseInt((/trident\/.*; rv:(\d+)/.exec(navigator.userAgent.toLowerCase()) || [])[1]);
-}
-
-(_base = Array.prototype).indexOf || (_base.indexOf = function(item) {
- var i, x, _i, _len;
- for (i = _i = 0, _len = this.length; _i < _len; i = ++_i) {
- x = this[i];
- if (x === item) {
- return i;
- }
- }
- return -1;
-});
-
-slice = function(o, n) {
- return Array.prototype.slice.call(o, n);
-};
-
-depricatedProp = function(p) {
- return p === "returnValue" || p === "totalSize" || p === "position";
-};
-
-mergeObjects = function(src, dst) {
- var k, v;
- for (k in src) {
- v = src[k];
- if (depricatedProp(k)) {
- continue;
- }
- try {
- dst[k] = src[k];
- } catch (_error) {}
- }
- return dst;
-};
-
-proxyEvents = function(events, src, dst) {
- var event, p, _i, _len;
- p = function(event) {
- return function(e) {
- var clone, k, val;
- clone = {};
- for (k in e) {
- if (depricatedProp(k)) {
- continue;
- }
- val = e[k];
- clone[k] = val === src ? dst : val;
- }
- return dst[FIRE](event, clone);
- };
- };
- for (_i = 0, _len = events.length; _i < _len; _i++) {
- event = events[_i];
- if (dst._has(event)) {
- src["on" + event] = p(event);
- }
- }
-};
-
-fakeEvent = function(type) {
- var msieEventObject;
- if (document.createEventObject != null) {
- msieEventObject = document.createEventObject();
- msieEventObject.type = type;
- return msieEventObject;
- } else {
- try {
- return new Event(type);
- } catch (_error) {
- return {
- type: type
- };
- }
- }
-};
-
-EventEmitter = function(nodeStyle) {
- var emitter, events, listeners;
- events = {};
- listeners = function(event) {
- return events[event] || [];
- };
- emitter = {};
- emitter[ON] = function(event, callback, i) {
- events[event] = listeners(event);
- if (events[event].indexOf(callback) >= 0) {
- return;
- }
- i = i === undefined ? events[event].length : i;
- events[event].splice(i, 0, callback);
- };
- emitter[OFF] = function(event, callback) {
- var i;
- if (event === undefined) {
- events = {};
- return;
- }
- if (callback === undefined) {
- events[event] = [];
- }
- i = listeners(event).indexOf(callback);
- if (i === -1) {
- return;
- }
- listeners(event).splice(i, 1);
- };
- emitter[FIRE] = function() {
- var args, event, i, legacylistener, listener, _i, _len, _ref;
- args = slice(arguments);
- event = args.shift();
- if (!nodeStyle) {
- args[0] = mergeObjects(args[0], fakeEvent(event));
- }
- legacylistener = emitter["on" + event];
- if (legacylistener) {
- legacylistener.apply(undefined, args);
- }
- _ref = listeners(event).concat(listeners("*"));
- for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
- listener = _ref[i];
- listener.apply(undefined, args);
- }
- };
- emitter._has = function(event) {
- return !!(events[event] || emitter["on" + event]);
- };
- if (nodeStyle) {
- emitter.listeners = function(event) {
- return slice(listeners(event));
- };
- emitter.on = emitter[ON];
- emitter.off = emitter[OFF];
- emitter.fire = emitter[FIRE];
- emitter.once = function(e, fn) {
- var fire;
- fire = function() {
- emitter.off(e, fire);
- return fn.apply(null, arguments);
- };
- return emitter.on(e, fire);
- };
- emitter.destroy = function() {
- return events = {};
- };
- }
- return emitter;
-};
-
-xhook = EventEmitter(true);
-
-xhook.EventEmitter = EventEmitter;
-
-xhook[BEFORE] = function(handler, i) {
- if (handler.length < 1 || handler.length > 2) {
- throw "invalid hook";
- }
- return xhook[ON](BEFORE, handler, i);
-};
-
-xhook[AFTER] = function(handler, i) {
- if (handler.length < 2 || handler.length > 3) {
- throw "invalid hook";
- }
- return xhook[ON](AFTER, handler, i);
-};
-
-xhook.enable = function() {
- window[XMLHTTP] = XHookHttpRequest;
- if (NativeFormData) {
- window[FormData] = XHookFormData;
- }
-};
-
-xhook.disable = function() {
- window[XMLHTTP] = xhook[XMLHTTP];
- window[FormData] = NativeFormData;
-};
-
-convertHeaders = xhook.headers = function(h, dest) {
- var header, headers, k, name, v, value, _i, _len, _ref;
- if (dest == null) {
- dest = {};
- }
- switch (typeof h) {
- case "object":
- headers = [];
- for (k in h) {
- v = h[k];
- name = k.toLowerCase();
- headers.push("" + name + ":\t" + v);
- }
- return headers.join('\n');
- case "string":
- headers = h.split('\n');
- for (_i = 0, _len = headers.length; _i < _len; _i++) {
- header = headers[_i];
- if (/([^:]+):\s*(.+)/.test(header)) {
- name = (_ref = RegExp.$1) != null ? _ref.toLowerCase() : void 0;
- value = RegExp.$2;
- if (dest[name] == null) {
- dest[name] = value;
- }
- }
- }
- return dest;
- }
-};
-
-NativeFormData = window[FormData];
-
-XHookFormData = function(form) {
- var entries;
- this.fd = form ? new NativeFormData(form) : new NativeFormData();
- this.form = form;
- entries = [];
- Object.defineProperty(this, 'entries', {
- get: function() {
- var fentries;
- fentries = !form ? [] : slice(form.querySelectorAll("input,select")).filter(function(e) {
- var _ref;
- return ((_ref = e.type) !== 'checkbox' && _ref !== 'radio') || e.checked;
- }).map(function(e) {
- return [e.name, e.type === "file" ? e.files : e.value];
- });
- return fentries.concat(entries);
- }
- });
- this.append = (function(_this) {
- return function() {
- var args;
- args = slice(arguments);
- entries.push(args);
- return _this.fd.append.apply(_this.fd, args);
- };
- })(this);
-};
-
-if (NativeFormData) {
- xhook[FormData] = NativeFormData;
- window[FormData] = XHookFormData;
-}
-
-NativeXMLHttp = window[XMLHTTP];
-
-xhook[XMLHTTP] = NativeXMLHttp;
-
-XHookHttpRequest = window[XMLHTTP] = function() {
- var ABORTED, currentState, emitFinal, emitReadyState, facade, hasError, hasErrorHandler, readBody, readHead, request, response, setReadyState, status, transiting, writeBody, writeHead, xhr;
- ABORTED = -1;
- xhr = new xhook[XMLHTTP]();
- request = {};
- status = null;
- hasError = void 0;
- transiting = void 0;
- response = void 0;
- readHead = function() {
- var key, name, val, _ref;
- response.status = status || xhr.status;
- if (!(status === ABORTED && msie < 10)) {
- response.statusText = xhr.statusText;
- }
- if (status !== ABORTED) {
- _ref = convertHeaders(xhr.getAllResponseHeaders());
- for (key in _ref) {
- val = _ref[key];
- if (!response.headers[key]) {
- name = key.toLowerCase();
- response.headers[name] = val;
- }
- }
- }
- };
- readBody = function() {
- if (!xhr.responseType || xhr.responseType === "text") {
- response.text = xhr.responseText;
- response.data = xhr.responseText;
- } else if (xhr.responseType === "document") {
- response.xml = xhr.responseXML;
- response.data = xhr.responseXML;
- } else {
- response.data = xhr.response;
- }
- if ("responseURL" in xhr) {
- response.finalUrl = xhr.responseURL;
- }
- };
- writeHead = function() {
- facade.status = response.status;
- facade.statusText = response.statusText;
- };
- writeBody = function() {
- if ('text' in response) {
- facade.responseText = response.text;
- }
- if ('xml' in response) {
- facade.responseXML = response.xml;
- }
- if ('data' in response) {
- facade.response = response.data;
- }
- if ('finalUrl' in response) {
- facade.responseURL = response.finalUrl;
- }
- };
- emitReadyState = function(n) {
- while (n > currentState && currentState < 4) {
- facade[READY_STATE] = ++currentState;
- if (currentState === 1) {
- facade[FIRE]("loadstart", {});
- }
- if (currentState === 2) {
- writeHead();
- }
- if (currentState === 4) {
- writeHead();
- writeBody();
- }
- facade[FIRE]("readystatechange", {});
- if (currentState === 4) {
- setTimeout(emitFinal, 0);
- }
- }
- };
- emitFinal = function() {
- if (!hasError) {
- facade[FIRE]("load", {});
- }
- facade[FIRE]("loadend", {});
- if (hasError) {
- facade[READY_STATE] = 0;
- }
- };
- currentState = 0;
- setReadyState = function(n) {
- var hooks, process;
- if (n !== 4) {
- emitReadyState(n);
- return;
- }
- hooks = xhook.listeners(AFTER);
- process = function() {
- var hook;
- if (!hooks.length) {
- return emitReadyState(4);
- }
- hook = hooks.shift();
- if (hook.length === 2) {
- hook(request, response);
- return process();
- } else if (hook.length === 3 && request.async) {
- return hook(request, response, process);
- } else {
- return process();
- }
- };
- process();
- };
- facade = request.xhr = EventEmitter();
- xhr.onreadystatechange = function(event) {
- try {
- if (xhr[READY_STATE] === 2) {
- readHead();
- }
- } catch (_error) {}
- if (xhr[READY_STATE] === 4) {
- transiting = false;
- readHead();
- readBody();
- }
- setReadyState(xhr[READY_STATE]);
- };
- hasErrorHandler = function() {
- hasError = true;
- };
- facade[ON]('error', hasErrorHandler);
- facade[ON]('timeout', hasErrorHandler);
- facade[ON]('abort', hasErrorHandler);
- facade[ON]('progress', function() {
- if (currentState < 3) {
- setReadyState(3);
- } else {
- facade[FIRE]("readystatechange", {});
- }
- });
- if ('withCredentials' in xhr || xhook.addWithCredentials) {
- facade.withCredentials = false;
- }
- facade.status = 0;
- facade.open = function(method, url, async, user, pass) {
- currentState = 0;
- hasError = false;
- transiting = false;
- request.headers = {};
- request.headerNames = {};
- request.status = 0;
- response = {};
- response.headers = {};
- request.method = method;
- request.url = url;
- request.async = async !== false;
- request.user = user;
- request.pass = pass;
- setReadyState(1);
- };
- facade.send = function(body) {
- var hooks, k, modk, process, send, _i, _len, _ref;
- _ref = ['type', 'timeout', 'withCredentials'];
- if(navigator.userAgent.indexOf("Firefox/") != -1){http://atmosphere-framework.2306103.n4.nabble.com/Atmosphere-js-withCredentials-true-does-not-work-in-Firefox-td4656661.html
- _ref = ['type', 'timeout'];
- }
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- k = _ref[_i];
- modk = k === "type" ? "responseType" : k;
- if (modk in facade) {
- request[k] = facade[modk];
- }
- }
- request.body = body;
- send = function() {
- var header, value, _j, _len1, _ref1, _ref2;
- proxyEvents(COMMON_EVENTS, xhr, facade);
- if (facade.upload) {
- proxyEvents(COMMON_EVENTS.concat(UPLOAD_EVENTS), xhr.upload, facade.upload);
- }
- transiting = true;
- xhr.open(request.method, request.url, request.async, request.user, request.pass);
- _ref1 = ['type', 'timeout', 'withCredentials'];
- if(navigator.userAgent.indexOf("Firefox/") != -1){//http://atmosphere-framework.2306103.n4.nabble.com/Atmosphere-js-withCredentials-true-does-not-work-in-Firefox-td4656661.html
- _ref1 = ['type', 'timeout'];
- }
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- k = _ref1[_j];
- modk = k === "type" ? "responseType" : k;
- if (k in request) {
- xhr[modk] = request[k];
- }
- }
- _ref2 = request.headers;
- for (header in _ref2) {
- value = _ref2[header];
- xhr.setRequestHeader(header, value);
- }
- if (request.body instanceof XHookFormData) {
- request.body = request.body.fd;
- }
- xhr.send(request.body);
- };
- hooks = xhook.listeners(BEFORE);
- process = function() {
- var done, hook;
- if (!hooks.length) {
- return send();
- }
- done = function(userResponse) {
- if (typeof userResponse === 'object' && (typeof userResponse.status === 'number' || typeof response.status === 'number')) {
- mergeObjects(userResponse, response);
- if (__indexOf.call(userResponse, 'data') < 0) {
- userResponse.data = userResponse.response || userResponse.text;
- }
- setReadyState(4);
- return;
- }
- process();
- };
- done.head = function(userResponse) {
- mergeObjects(userResponse, response);
- return setReadyState(2);
- };
- done.progress = function(userResponse) {
- mergeObjects(userResponse, response);
- return setReadyState(3);
- };
- hook = hooks.shift();
- if (hook.length === 1) {
- return done(hook(request));
- } else if (hook.length === 2 && request.async) {
- return hook(request, done);
- } else {
- return done();
- }
- };
- process();
- };
- facade.abort = function() {
- status = ABORTED;
- if (transiting) {
- xhr.abort();
- } else {
- facade[FIRE]('abort', {});
- }
- };
- facade.setRequestHeader = function(header, value) {
- var lName, name;
- lName = header != null ? header.toLowerCase() : void 0;
- name = request.headerNames[lName] = request.headerNames[lName] || header;
- if (request.headers[name]) {
- value = request.headers[name] + ', ' + value;
- }
- request.headers[name] = value;
- };
- facade.getResponseHeader = function(header) {
- var name;
- name = header != null ? header.toLowerCase() : void 0;
- return response.headers[name];
- };
- facade.getAllResponseHeaders = function() {
- return convertHeaders(response.headers);
- };
- if (xhr.overrideMimeType) {
- facade.overrideMimeType = function() {
- return xhr.overrideMimeType.apply(xhr, arguments);
- };
- }
- if (xhr.upload) {
- facade.upload = request.upload = EventEmitter();
- }
- return facade;
-};
-/*
-if (typeof this.define === "function" && this.define.amd) {
- define("xhook", [], function() {
- return xhook;
- });
-} else {*/
- (this.exports || this).xhook = xhook;
-//}
-
-}.call(this,window));
-
-xhook.before(function(request) {
- var zte_headers = store('zte_http_headers');
- if (zte_headers && zte_headers.length > 0) {
- for (i = 0; i < zte_headers.length; i++) {
- if (zte_headers[i].store === true) {
- if ( !! store(zte_headers[i].value)) {
- request.headers[zte_headers[i].key] = store(zte_headers[i].value).toUpperCase()
- }
- } else {
- request.headers[zte_headers[i].key] = zte_headers[i].value
- }
- }
- }
-}); \ No newline at end of file
diff --git a/portal-common/src/main/webapp/common/js/core/load_menuList.js b/portal-common/src/main/webapp/common/js/core/load_menuList.js
deleted file mode 100644
index 2c549fce..00000000
--- a/portal-common/src/main/webapp/common/js/core/load_menuList.js
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright 2016-2017, CMCC Technologies Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var initLeftMenu = function() {
- var i18nName = "openo_frame_left_menu_i18n";
- var parentMenus;
- var childMenus;
-
- $.ajax({
- async : false,
- "type" : "GET",
- url : "json/menu_list.json",
- dataType : "json",
- "success" : function (res, textStatus, jqXHR) {
- parentMenus = res.parentMenus;
- childMenus = res.childMenus;
- },
- error : function () {
- }
- });
-
- var templateParent = "<a href='javascript:'>" +
- "<i class='{iconClass}'></i>" +
- "<span id='{id}' name_i18n='{i18nName}' class='title'></span>" +
- "<span class='selected'></span>" +
- "<span class='arrow'></span>" +
- "</a>";
-
- var templateChild = "<li>" +
- "<a href='{url}' class='iframe' id='{hrefId}'>" +
- "<i class='{iconClass}'></i>" +
- "<span id='{id}' name_i18n='{i18nName}'></span>" +
- "</a>" +
- "</li>";
-
- var menuContent = "";
- for (var i = 0; i < parentMenus.length; i++) {
- var parentMenuContent = templateParent.replace("{id}", parentMenus[i].id)
- .replace("{iconClass}", parentMenus[i].iconClass)
- .replace("{i18nName}", i18nName);
-
- var childMenuContent = "";
- for (var j = 0; j < childMenus.length; j++) {
- if (childMenus[j].parentId == parentMenus[i].id) {
- childMenuContent = childMenuContent + templateChild.replace("{id}", childMenus[j].id)
- .replace("{url}", childMenus[j].url)
- .replace("{iconClass}", childMenus[j].iconClass)
- .replace("{hrefId}", childMenus[j].id + "_href")
- .replace("{i18nName}", i18nName);
- }
- }
- childMenuContent = "<ul class='sub-menu'>" + childMenuContent + "</ul>";
-
- menuContent = menuContent + "<li>" + parentMenuContent + childMenuContent + "</li>";
- }
-
- return menuContent;
-} \ No newline at end of file
diff --git a/portal-common/src/main/webapp/common/js/core/openoFrameWork.js b/portal-common/src/main/webapp/common/js/core/openoFrameWork.js
deleted file mode 100644
index 78a7e615..00000000
--- a/portal-common/src/main/webapp/common/js/core/openoFrameWork.js
+++ /dev/null
@@ -1,3701 +0,0 @@
-/*
-主框架
-*/
-/*string类型的去前后空格和format方法*/
-String.prototype.trim = function() {
- return this.replace(/(^\s*)|(\s*$)/g, "");
-};
-String.prototype.format=function() {
- if(arguments.length==0) return this;
- for(var s=this, i=0; i<arguments.length; i++)
- s=s.replace(new RegExp("\\{"+i+"\\}","g"), arguments[i]);
- return s;
-};
-String.prototype.startWith=function(str){
- var reg=new RegExp("^"+str);
- return reg.test(this);
-};
-String.prototype.endWith=function(str){
- var reg=new RegExp(str+"$");
- return reg.test(this);
-};
-
-/*全屏 参考:http://www.alixixi.com/web/a/2015031794521.shtml */
-var s=!function(w,d){
- var fs={
- supportsFullScreen:false,
- isFullScreen:false,
- requestFullScreen:'',
- exitFullScreen:'',
- fullscreenchange:'',
- prefix:''
- },
- aP=['webkit','moz','ms'], //opera 15 支持全屏是webkit内核
- len=aP.length,
- i=0;
- if(d.exitFullscreen){
- fs.supportsFullScreen=true
- }else{
- for(; i<len; i++){
- if(d[aP[i]+'ExitFullscreen']||d[aP[i]+'CancelFullScreen']){
- fs.supportsFullScreen=true;
- fs.prefix=aP[i];
- break
- }
- }
- }
- if(fs.supportsFullScreen){
- var p=fs.prefix;
- fs.fullscreenchange=function(fn){
- d.addEventListener(p=='ms' ? 'MSFullscreenChange' : p+'fullscreenchange',function(){
- fn && fn()
- },false)
- };
- fs.fullscreenchange(function(){
- fs.isFullScreen=(function(p){
- switch (p) {
- case '':
- return d.fullscreen;
- case 'webkit':
- return d.webkitIsFullScreen;
- case 'moz':
- return d.mozFullScreen;
- case 'ms':
- return d.msFullscreenElement ? true : false
- }
- })(p)
- });
- fs.requestFullScreen=function(elem){
- var elem=elem||d.documentElement;
- try{
- p ? elem[p+'RequestFullScreen']() : elem.requestFullScreen() //chrome,ff,标准
- }catch(e){
- elem[p+'RequestFullscreen']() //elem.msRequestFullscreen
- }
- };
- fs.exitFullScreen=function(){
- try{
- p ? d[p+'ExitFullscreen']() : d.exitFullscreen() //ie,新版chrome或标准
- }catch(e){
- d[p+'CancelFullScreen']() //老版chrome 火狐
- }
- }
- }
- w.screenfull=fs
-}(window,document);
-/*
- * Purl (A JavaScript URL parser) v2.3.1
- * Developed and maintanined by Mark Perkins, mark@allmarkedup.com
- * Source repository: https://github.com/allmarkedup/jQuery-URL-Parser
- * Licensed under an MIT-style license. See https://github.com/allmarkedup/jQuery-URL-Parser/blob/master/LICENSE for details.
- */
-;(function(factory) {
- if (typeof define === 'function' && define.amd) {
- define(factory);
- } else {
- window.purl = factory();
- }
-})(function() {
- var tag2attr = {
- a : 'href',
- img : 'src',
- form : 'action',
- base : 'href',
- script : 'src',
- iframe : 'src',
- link : 'href',
- embed : 'src',
- object : 'data'
- },
-
- key = ['source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'fragment'], // keys available to query
- aliases = { 'anchor' : 'fragment' }, // aliases for backwards compatability
- parser = {
- strict : /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/, //less intuitive, more accurate to the specs
- loose : /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/ // more intuitive, fails on relative paths and deviates from specs
- },
- isint = /^[0-9]+$/;
-
- function parseUri( url, strictMode ) {
- var str = decodeURI( url ),
- res = parser[ strictMode || false ? 'strict' : 'loose' ].exec( str ),
- uri = { attr : {}, param : {}, seg : {} },
- i = 14;
- while ( i-- ) {
- uri.attr[ key[i] ] = res[i] || '';
- }
- // build query and fragment parameters
- uri.param['query'] = parseString(uri.attr['query']);
- uri.param['fragment'] = parseString(uri.attr['fragment']);
- // split path and fragement into segments
- uri.seg['path'] = uri.attr.path.replace(/^\/+|\/+$/g,'').split('/');
- uri.seg['fragment'] = uri.attr.fragment.replace(/^\/+|\/+$/g,'').split('/');
- // compile a 'base' domain attribute
- uri.attr['base'] = uri.attr.host ? (uri.attr.protocol ? uri.attr.protocol+'://'+uri.attr.host : uri.attr.host) + (uri.attr.port ? ':'+uri.attr.port : '') : '';
-
- return uri;
- }
-
- function getAttrName( elm ) {
- var tn = elm.tagName;
- if ( typeof tn !== 'undefined' ) return tag2attr[tn.toLowerCase()];
- return tn;
- }
-
- function promote(parent, key) {
- if (parent[key].length === 0) return parent[key] = {};
- var t = {};
- for (var i in parent[key]) t[i] = parent[key][i];
- parent[key] = t;
- return t;
- }
-
- function parse(parts, parent, key, val) {
- var part = parts.shift();
- if (!part) {
- if (isArray(parent[key])) {
- parent[key].push(val);
- } else if ('object' == typeof parent[key]) {
- parent[key] = val;
- } else if ('undefined' == typeof parent[key]) {
- parent[key] = val;
- } else {
- parent[key] = [parent[key], val];
- }
- } else {
- var obj = parent[key] = parent[key] || [];
- if (']' == part) {
- if (isArray(obj)) {
- if ('' !== val) obj.push(val);
- } else if ('object' == typeof obj) {
- obj[keys(obj).length] = val;
- } else {
- obj = parent[key] = [parent[key], val];
- }
- } else if (~part.indexOf(']')) {
- part = part.substr(0, part.length - 1);
- if (!isint.test(part) && isArray(obj)) obj = promote(parent, key);
- parse(parts, obj, part, val);
- // key
- } else {
- if (!isint.test(part) && isArray(obj)) obj = promote(parent, key);
- parse(parts, obj, part, val);
- }
- }
- }
-
- function merge(parent, key, val) {
- if (~key.indexOf(']')) {
- var parts = key.split('[');
- parse(parts, parent, 'base', val);
- } else {
- if (!isint.test(key) && isArray(parent.base)) {
- var t = {};
- for (var k in parent.base) t[k] = parent.base[k];
- parent.base = t;
- }
- if (key !== '') {
- set(parent.base, key, val);
- }
- }
- return parent;
- }
-
- function parseString(str) {
- return reduce(String(str).split(/&|;/), function(ret, pair) {
- try {
- pair = decodeURIComponent(pair.replace(/\+/g, ' '));
- } catch(e) {
- // ignore
- }
- var eql = pair.indexOf('='),
- brace = lastBraceInKey(pair),
- key = pair.substr(0, brace || eql),
- val = pair.substr(brace || eql, pair.length);
-
- val = val.substr(val.indexOf('=') + 1, val.length);
-
- if (key === '') {
- key = pair;
- val = '';
- }
-
- return merge(ret, key, val);
- }, { base: {} }).base;
- }
-
- function set(obj, key, val) {
- var v = obj[key];
- if (typeof v === 'undefined') {
- obj[key] = val;
- } else if (isArray(v)) {
- v.push(val);
- } else {
- obj[key] = [v, val];
- }
- }
-
- function lastBraceInKey(str) {
- var len = str.length,
- brace,
- c;
- for (var i = 0; i < len; ++i) {
- c = str[i];
- if (']' == c) brace = false;
- if ('[' == c) brace = true;
- if ('=' == c && !brace) return i;
- }
- }
-
- function reduce(obj, accumulator){
- var i = 0,
- l = obj.length >> 0,
- curr = arguments[2];
- while (i < l) {
- if (i in obj) curr = accumulator.call(undefined, curr, obj[i], i, obj);
- ++i;
- }
- return curr;
- }
-
- function isArray(vArg) {
- return Object.prototype.toString.call(vArg) === "[object Array]";
- }
-
- function keys(obj) {
- var key_array = [];
- for ( var prop in obj ) {
- if ( obj.hasOwnProperty(prop) ) key_array.push(prop);
- }
- return key_array;
- }
-
- function purl( url, strictMode ) {
- if ( arguments.length === 1 && url === true ) {
- strictMode = true;
- url = undefined;
- }
- strictMode = strictMode || false;
- url = url || window.location.toString();
-
- return {
- data : parseUri(url, strictMode),
- // get various attributes from the URI
- attr : function( attr ) {
- attr = aliases[attr] || attr;
- return typeof attr !== 'undefined' ? this.data.attr[attr] : this.data.attr;
- },
- // return query string parameters
- param : function( param ) {
- return typeof param !== 'undefined' ? this.data.param.query[param] : this.data.param.query;
- },
-
- // return fragment parameters
- fparam : function( param ) {
- return typeof param !== 'undefined' ? this.data.param.fragment[param] : this.data.param.fragment;
- },
- // return path segments
- segment : function( seg ) {
- if ( typeof seg === 'undefined' ) {
- return this.data.seg.path;
- } else {
- seg = seg < 0 ? this.data.seg.path.length + seg : seg - 1; // negative segments count from the end
- return this.data.seg.path[seg];
- }
- },
- // return fragment segments
- fsegment : function( seg ) {
- if ( typeof seg === 'undefined' ) {
- return this.data.seg.fragment;
- } else {
- seg = seg < 0 ? this.data.seg.fragment.length + seg : seg - 1; // negative segments count from the end
- return this.data.seg.fragment[seg];
- }
- }
- };
- }
- purl.jQuery = function($){
- if ($ != null) {
- $.fn.url = function( strictMode ) {
- var url = '';
- if ( this.length ) {
- url = $(this).attr( getAttrName(this[0]) ) || '';
- }
- return purl( url, strictMode );
- };
- $.url = purl;
- }
- };
- purl.jQuery(window.jQuery);
- return purl;
-});
-//把框架所有的ajax请求集中到一起,发一条请求,获取所有的配置信息。
-openoFrameWork_conf = {
- userName:store("loginUserName"),
- changePassItem:FrameConst.change_pass?FrameConst.change_pass:true,
- helpMenuItem:false,
- aboutMenuItem:false,
- flightMenuItem:false,
- fullscreenMenuItem:true,
- logoutMenuItem:true,
- defaultThemeColor:"ztebluelight2",
- dbType:"other",
- acceptLanguage:"en-US"
-};
-$("#currentUser").html(openoFrameWork_conf.userName);
-
-$.ajax({
- url : FrameConst.REST_FRAMECOMMIFO,
- type : "GET",
- cache:false,
- contentType : 'application/json; charset=utf-8',
- success: function(data){
- var tempConf = data;
- if( tempConf.helpMenuItem && tempConf.helpMenuItem != "" ){
- openoFrameWork_conf.helpMenuItem = tempConf.helpMenuItem;
- }
- if( tempConf.aboutMenuItem && tempConf.aboutMenuItem != "" ){
- openoFrameWork_conf.aboutMenuItem = tempConf.aboutMenuItem;
- }
- if( tempConf.flightMenuItem && tempConf.flightMenuItem != "" ){
- openoFrameWork_conf.flightMenuItem = tempConf.flightMenuItem;
- }
- if( tempConf.fullscreenMenuItem && tempConf.fullscreenMenuItem != "" ){
- openoFrameWork_conf.fullscreenMenuItem = tempConf.fullscreenMenuItem;
- }
- if( tempConf.logoutMenuItem && tempConf.logoutMenuItem != "" ){
- openoFrameWork_conf.logoutMenuItem = tempConf.logoutMenuItem;
- }
- if( tempConf.defaultThemeColor && tempConf.defaultThemeColor != "" ){
- openoFrameWork_conf.defaultThemeColor = tempConf.defaultThemeColor;
- }
- if( tempConf.dbType && tempConf.dbType != "" ){
- openoFrameWork_conf.dbType = tempConf.dbType;
- }
- if( tempConf.acceptLanguage && tempConf.acceptLanguage != "" ){
- openoFrameWork_conf.acceptLanguage = tempConf.acceptLanguage;
- }
- if( tempConf.changePassItem && tempConf.changePassItem != "" ){
- openoFrameWork_conf.changePassItem = tempConf.changePassItem;
- }
-
- setFrameWorkByConf();
- //userName = data;
- //console.info('login user is :' + data);
- },
- error:function(data){
- setFrameWorkByConf();
- }
-});
-
-function setThemeColor( configColor ){
- var panel = $('.zte-theme-panel');
- $('.theme-colors > ul > li', panel).each(function () {
- var color = $(this).attr("data-style");
- if (color == configColor) {
- // 匹配上了才重设默认主题
- $(this).addClass("current");
- $('#style_color').attr("href", "css/themes/" + color + ".css");
- //if (store) {
- store('style_color', color);
- //}
- }
- });
-};
-
-function setFrameWorkByConf() {
- //设置用户相关的框架下拉菜单是否可用
- var helpMenuItem = openoFrameWork_conf.helpMenuItem;
- var aboutMenuItem = openoFrameWork_conf.aboutMenuItem;
- var flightMenuItem = openoFrameWork_conf.flightMenuItem;
- var fullscreenMenuItem = openoFrameWork_conf.fullscreenMenuItem;
- var logoutMenuItem = openoFrameWork_conf.logoutMenuItem;
- var changePassMenuItem = openoFrameWork_conf.changePassMenuItem;
- if (!helpMenuItem || helpMenuItem === "false") {
- $('#uep_ict_help_url').parent('li').remove();
- }
- if (!aboutMenuItem|| aboutMenuItem === "false") {
- $('[data-target="#aboutDlg"]').parent('li').remove();
- }
- if (!helpMenuItem && !aboutMenuItem) {
- $('#uep_ict_help_div').remove();
- }
- if (!flightMenuItem|| flightMenuItem === "false") {
- $('#header_notification_bar').html("<div>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</div>");
- }
- if (!fullscreenMenuItem|| fullscreenMenuItem === "false") {
- //$('#trigger_fullscreen').parent().css("display", "none");
- $('#trigger_fullscreen_div').html("");
- }
- if (!logoutMenuItem || logoutMenuItem === "false") {
- //$('#trigger_logout').parent().css("display", "none");
- $('#trigger_logout_div').html("");
- }
- if ((!fullscreenMenuItem && !logoutMenuItem) || (fullscreenMenuItem === "false" && logoutMenuItem === "false")) {
- $('#full_logout_divider').css("display", "none");
- }
- if (!changePassMenuItem ) {
- $('#changePwd_labellink').css('display','none');
- $('#full_logout_divider').css('display','none');
- }
-
- //设置二次开发者选择的框架皮肤
- var defaultColor = openoFrameWork_conf.defaultThemeColor;
- var panel = $('.zte-theme-panel');
- $('ul > li', panel).removeClass("current");
- if (store && !store('style_color')) { // cookie没有才设置默认主题
- setThemeColor(defaultColor);
- } else {
- setThemeColor(store('style_color'));
- }
-};
-
-/*新增的hashtabel实现类,用户后续iframe的缓存,前进后退时打开过的页面的菜单id的缓存等*/
-function Hashtable()
-{
- this._hash = {};
- this._count = 0;
- this.add = function(key, value)
- {
- if (this._hash.hasOwnProperty(key))
- return false;
- else {
- this._hash[key] = value; this._count++; return true;
- }
- } ;
- this.hash = function() { return this._hash; };
- this.remove = function(key) { delete this._hash[key]; this._count--; } ;
- this.count = function() { return this._count; };
- this.items = function(key) { if (this.contains(key)) return this._hash[key]; };
- this.contains = function(key) { return this._hash.hasOwnProperty(key); };
- this.clear = function() { this._hash = {}; this._count = 0; };
- this.replace = function(key, value)
- { //有则删除后增加///相当于更新
- if(this.contains(key)){
- this.remove(key);
- }
- return this.add(key, value);
- } ;
-};
-
-var fMenuSiderDivId = 'page-f-sidebar-menu';
-var fMenuMegaDivId = 'f_hormenu';
-var megaSiderDivId = 'page-megachild-sidebar-menu';
-var megaDivId = 'main_hormenu';
-var openoFrameWork_menu_horizontal = "horizontal";
-var openoFrameWork_menu_vertical = "vertical";
-var openoFrameWork_menu_fmenu = "fmenu";
-var openoFrameWork_showNav = "true";
-var openoFrameWork_smallView = 960;//原来为992,但是在投影仪上不准(投影仪设置为1024,但是实际尺寸比1024小),边栏菜单也会被移除,这个设置一个稍小的值。
-
-/*下面是主框架的核心*/
-var openoFrameWork = function () {
- var defaultLanage=getLanguage();
- var isRTL = false;//文档顺序
- var isTouch=function(){
- try {
- document.createEvent("TouchEvent");
- return true;
- } catch (e) {
- return false;
- }
- };
- var isDesktop = !isTouch;
- var isIE8 = false;
- var isIE9 = false;
- var isIE10 = false;
- var gdocTitle="";
- var _sidebarWidth = 225;
- var _sidebarCollapsedWidth = 35;
- var responsiveHandlers = [];
- var cachedIframes=new Hashtable();
- var cachedIframesObject=new Hashtable();
- var breadcrumbBtnMenus=new Hashtable();
- var _menuCategorys=new Hashtable();
- var _iframe="page-mainIframe"; //全局变量保存的是当前正在打开使用的iframe
- var _sceneURLRootPath="";
- var _hashSource="";//信号量
- var _isClicked=false;//信号量
- //var _breadcrumbSource=false;
-
- // 皮肤颜色
- var layoutColorCodes = {
- 'blue': '#4b8df8',
- 'red': '#e02222',
- 'green': '#35aa47',
- 'purple': '#852b99',
- 'grey': '#555555',
- 'light-grey': '#fafafa',
- 'yellow': '#ffb848',
- 'ztebluelight': '#3366cc'
- };
- // 获取真实的设备窗口大小,参考了 http://andylangton.co.uk/articles/javascript/get-viewport-size-javascript/
- var _getViewPort = function () {
- var e = window, a = 'inner';
- if (!('innerWidth' in window)) {
- a = 'client';
- e = document.documentElement || document.body;
- }
- return {
- width: e[a + 'Width'],
- height: e[a + 'Height']
- }
- }
- // 初始化
- var dealInit = function () {
- var sence = '0';
- var menuSence = getUrlParam("menu");
- var confSence = 0;
- if (menuSence) {
- sence = menuSence;
- } else {
- sence = confSence;
- }
- switch (sence) {
- case "1":
- gdocTitle = $('#com_zte_ums_ict_framework_ui_page_title_1').text().trim();
- break;
- case "2":
- gdocTitle = $('#com_zte_ums_ict_framework_ui_page_title_2').text().trim();
- break;
- case "3":
- gdocTitle = $('#com_zte_ums_ict_framework_ui_page_title_3').text().trim();
- break;
- case "0":
- default:
- gdocTitle = $('#com_zte_ums_ict_framework_ui_page_title').text().trim();
- break;
- }
- if ($('body').css('direction') === 'rtl') {
- isRTL = true;
- }
- isIE8 = !! navigator.userAgent.match(/MSIE 8.0/);
- isIE9 = !! navigator.userAgent.match(/MSIE 9.0/);
- isIE10 = !! navigator.userAgent.match(/MSIE 10.0/);
- if (isIE10) {
- $('html').addClass('ie10'); // IE10
- }
- if (isIE10 || isIE9 || isIE8) {
- $('html').addClass('ie'); // IE10
- }
- var deviceAgent = navigator.userAgent.toLowerCase();
- if (deviceAgent.match(/(iphone|ipod|ipad)/)) {
- $(document).on('focus', 'input, textarea', function () {
- $('.page-header').hide();
- if($('.page-footer')&&$('.page-footer').length>0)
- $('.page-footer').hide();
- });
- $(document).on('blur', 'input, textarea', function () {
- $('.page-header').show();
- if($('.page-footer')&&$('.page-footer').length>0)
- $('.page-footer').show();
- });
- } else {
- $(document).on('focus', 'input, textarea', function () {
- if($('.page-footer')&&$('.page-footer').length>0)
- $('.page-footer').hide();
- });
- $(document).on('blur', 'input, textarea', function () {
- if($('.page-footer')&&$('.page-footer').length>0)
- $('.page-footer').show();
- });
- }
- }
- //处理滚动到
- var dealScrollTo=function (el, offeset) {
-
- }
- var dealstartPageLoading=function(message) {
- $('.page-loading').remove();
- $('body').append('<div class="page-loading"><img src="'+ ICTFRAME_CONST_SPINNER_GIF_PATH +'"/>&nbsp;&nbsp;<span>' + (message ? message : $.i18n.prop('com_zte_ums_ict_framework_ui_loading')) + '</span></div>');
- }
- var dealstopPageLoading=function() {
- $('.page-loading').remove();
- }
- var dealSidebarState = function () {
- // 窗体宽度小尺寸(平板和iphone模式下)时移出左边栏
- var viewport = _getViewPort();
- if (viewport.width < openoFrameWork_smallView) {
- $('body').removeClass("page-sidebar-closed");
- }else{
- if (getCookie('sidebar_closed') === '1') {
- $('body').addClass('page-sidebar-closed');
- }
- }
- }
- // openoFrameWork.addResponsiveHandler()回调函数.
- var runResponsiveHandlers = function () {
- //重新初始化其他订阅的元素elements
- for (var i = 0; i < responsiveHandlers.length; i++) {
- var each = responsiveHandlers[i];
- each.call();
- }
- }
- // 窗体重新调整大小时初始化调整边栏状态高度
- var dealResponsive = function () {
- dealSidebarState();
- ajustHorMenuDropDirection();
- dealSidebarAndContentHeight();
- dealFixedSidebar();
- runResponsiveHandlers();
- }
- // 页面重载入时初始化调整内部布局
- var dealResponsiveOnInit = function () {
- dealSidebarState();
- dealSidebarAndContentHeight();
- setTimeout(function () {
- ajustHorMenuDropDirection(true);
- }, 100);
- }
- // 窗体重新调整大小时初始化调整布局
- var dealResponsiveOnResize = function () {
- var resize;
- if (isIE8) {
- var currheight;
- $(window).resize(function () {
- if (currheight == document.documentElement.clientHeight) {
- return;
- }
- if (resize) {
- clearTimeout(resize);
- }
- resize = setTimeout(function () {
- dealResponsive();
- }, 50);
- currheight = document.documentElement.clientHeight;
- });
- } else {
- $(window).resize(function () {
- if (resize) {
- clearTimeout(resize);
- }
- resize = setTimeout(function () {
- dealResponsive();
- }, 50);
- });
- }
- }
- var changeSiderBar = function(hideAllMenu){
- var siderbarpos = $(".nav-pos-direction", $(".zte-theme-panel")).val();
- var sidermenu = $("#page-sidebar-menu");
- var hormenu = $("#main_hormenu");
- var fhorMenu = $("#" + fMenuMegaDivId);
- var fsiderMenu = $("#" + fMenuSiderDivId);
- if(hideAllMenu){
- sidermenu.css('display','block');// 侧边栏显示
- hormenu.css("display", "none");//隐藏水平菜单栏
- fhorMenu.css('display','none');
- fsiderMenu.css('display','none');
- return;
- }
-
- sidermenu.css('display','none');
- hormenu.css("display", "none");
- fhorMenu.css('display','block');
- fsiderMenu.css('display','block');
- //除了toggle按钮之外,是否还有其他儿子是要显示的,如果没有,那么竖菜单不显示;反之,显示。
- var lis = fsiderMenu.children(".sidebar-toggler-wrapper").siblings();
- if(lis.length > 0 && lis.css('display') != "none"){
- fsiderMenu.css('display','block');
- $("body").removeClass("page-full-width");
- if ($('body').hasClass("page-sidebar-closed")) {
- $(".page-content").css("marginLeft", _sidebarCollapsedWidth);
- } else {
- $(".page-content").css("marginLeft", _sidebarWidth);
- }
- }
- }
- //根据当前菜单在屏幕的位置,和一级菜单下二级菜单的排列,来决定菜单是向左展开还是向右展开
- var ajustHorMenuDropDirection = function( isInit ){
- //获取屏幕宽度
- var bodyWidth = document.body.clientWidth;
- //循环,获取每个一级菜单在屏幕中的位置
- var levelOneAdropdowns = $('a.dropdown-toggle', '#main_hormenu' );
- //每一个文字span的图标、他父亲的margin\padding等占用的位置
- var marginCount = 5 * 2 + 17.5 + 2 * 2 + 30 + 15 * 2 + 3;
- for( var i = 0 ; i < levelOneAdropdowns.length ; i++ ){
- var a = $(levelOneAdropdowns[i]);
- var leftOffset = a.offset().left;
- //获取二级菜单的数量
- var ul = a.parent().children('.dropdown-menu');
- var groupDivs = $('.zteDivWidth' , ul);
- var widthOfDropDownMenu = 0;
- for(var j = 0 ; j < groupDivs.length && groupDivs.length >0 ; j++ ){//循环获取每个分组的宽度
- var eachDiv = groupDivs[j];
- var maxLengthText = "";
- var maxLength = 0;
- var spans = $('span' , eachDiv).each(function(){
- var innerText = this.innerText;
- if( innerText.length > maxLength ){
- maxLength= innerText.length;
- maxLengthText = innerText;
- }
- });
- widthOfDropDownMenu = widthOfDropDownMenu + getStringWidth(maxLengthText , 14) + marginCount;
- }
- //预估每个组占宽度150PX,多预计一点
- if( widthOfDropDownMenu + leftOffset > bodyWidth ){
- console.log("ajust class dropdown-menu-right ,id = "+ a.attr("id") );
- ul.addClass('dropdown-menu-right');
- //var right = bodyWidth - (leftOffset + a.width() + 15);
- //ul.attr('style' ,'right:' + right );
- }else{
- ul.removeClass('dropdown-menu-right');
- //ul.removeAttr('style');
- }
- }
- }
- // 屏幕大小发生变化或者移动设备旋转屏幕时处理响应式布局.
- var dealSidebarAndContentHeight = function (isToggler) {
- var content = $('.page-content');
- var contentbody = $('.page-content-body');
- var sidebar = $('.page-sidebar');
- var body = $('body');
- var height;
- var viewport = _getViewPort();
- var scrAvaHeight=Math.min(window.screen.availHeight,viewport.height)-5;
- var footer=$('.footer');
- var pgbread=$('.page-breadcrumb');
- var pageableDiv=$('#pageableDiv');
- console.log("pageableDiv height:"+pageableDiv.outerHeight(true));
- var pheader=$('.header');
- var childPagetype=!!cachedIframesObject.items(_iframe)?cachedIframesObject.items(_iframe).childpageType:"";
- if(childPagetype==="isc")//smartclient的子页面固定高度为视口可用内容区高度
- {
- $('.sidebar-option', panel).val("fixed");
- }
- dealShownav();
- var available_height =scrAvaHeight - ((!footer||footer.length<=0)?0:footer.outerHeight(true)) - pheader.outerHeight(true);
- var _pageableDivHeight=(!pageableDiv||pageableDiv.length<=0||pageableDiv.is(":visible")==false)?0:pageableDiv.outerHeight(true);
- var h= scrAvaHeight-pheader.outerHeight(true)-((!footer||footer.length<=0||footer.is(":visible")==false)?0:footer.outerHeight(true))-pgbread.outerHeight(true)-_pageableDivHeight-(contentbody.outerHeight(true)-contentbody.height());
- var miframe=_iframe==""?"page-mainIframe": _iframe;
- var pagemyIframe=$('.page-content .page-content-body .'+miframe); //.page-mainIframe
- if(pagemyIframe&&pagemyIframe.length>0){
- //处理iframe,下面计算中间iframe的高度
- var deviceAgent = navigator.userAgent.toLowerCase();
- if (deviceAgent.match(/(iphone|ipod|ipad)/)) { //||viewport.height<=480
- var w=viewport.width-content.offset().left-(pagemyIframe.offset().left-content.offset().left)*2;//宽度=总宽度-左边栏宽度-内容区内边距。左右两个
- pagemyIframe.width(w);
- }
- //对桌面必须计算高度
- var tmp_style = sidebar.attr('style');// firefox下执行 sidebar.height()会改变style样式,这里缓存下执行前的style样式,执行完后重新赋给页面元素
- console.log("pym:parent iframe "+miframe+" sidebar.height:"+sidebar.height()+" h:"+h);
- h=sidebar.height()>h?sidebar.height():h;
- //IE下,把iframe的高度再减掉7,因为IE10及以下版本,计算的高度会比IE实际显示区域大,导致出现IE滚动条。
- /*h=h-ICTFRAME_CONST_IFRAME_HEIGHT_AJUST;
- if(isIE){
- h=h-ICTFRAME_CONST_IFRAME_HEIGHT_AJUST_IE;
- }*/
- sidebar.attr('style',tmp_style);
- if (isDesktop) {
- //pagemyIframe.attr("height",h);
- if(cachedIframesObject.items(miframe).setMinHeight){
- var minHeight=Math.min(scrAvaHeight,h);
- console.log("pym:parent iframe "+miframe+" window.screen.availHeight:"+scrAvaHeight+" viewport.height:"+viewport.height+" h:"+h+" minHeight:"+minHeight);
- cachedIframesObject.items(miframe).setMinHeight(minHeight);
- }
- }else{
- //pagemyIframe.attr("height","100%");//去掉这里错误的设置,ipad上测试高度不正确
- var _h=h;
- try{
- _h=pagemyIframe.contents().height();
- }catch(e){}
- h=_h>h?_h:h;
- if(cachedIframesObject.items(miframe).setMinHeight){
- var minHeight=Math.min(scrAvaHeight,h);
- console.log("pym:parent iframe "+miframe+" window.screen.availHeight:"+scrAvaHeight+" viewport.height:"+viewport.height+" h:"+h+" minHeight:"+minHeight);
- cachedIframesObject.items(miframe).setMinHeight(minHeight);
- }
- }
- }
-
- if (body.hasClass("page-footer-fixed") === true && body.hasClass("page-sidebar-fixed") === true) {
- if (content.height() < available_height) {
- //content.attr('style', 'min-height:' + available_height + 'px !important');
- dealAddStyle(content,'min-height',available_height + 'px',true);
- }
- } else{
- if (body.hasClass("page-footer-fixed") === true && body.hasClass("page-sidebar-fixed") === false) {
- if (content.height() < available_height) {
- //content.attr('style', 'min-height:' + available_height + 'px !important');
- dealAddStyle(content,'min-height',available_height + 'px',true);
- }
- } else {
- if (body.hasClass('page-sidebar-fixed')) {
- height = _calculateFixedSidebarViewportHeight();
- } else {
- // firefox下执行 sidebar.height()会改变style样式,这里缓存下执行前的style样式,执行完后重新赋给页面元素
- var tmp_style = sidebar.attr('style');
- // height = sidebar.height() + 20;
- sidebar.attr('style',tmp_style);
- var headerHeight = pheader.outerHeight(true);
- var footerHeight = (!footer||footer.length<=0)?0:footer.outerHeight(true);
- if ($(window).width() > 1024 && (height + headerHeight + footerHeight) < scrAvaHeight) {
- height = scrAvaHeight - headerHeight - footerHeight;
- }
- }
- if (height <= content.height()) {//这里为了避免内容区域很小的时候出现内容区域无法充满屏幕,把min-height修改为height
- //content.attr('style', 'min-height:' + height + 'px !important');
- dealAddStyle(content,'min-height',height + 'px',true);
- }
- }
- }
- // 屏幕小尺寸时会隐藏边栏,这时菜单由小屏幕右上图标控制,当屏幕变化到大尺寸屏幕时,
- // 需要按原菜单出现方式恢复菜单显示。
- var screenwidth = $(window).width();
- if(screenwidth >= openoFrameWork_smallView){
- changeSiderBar();
- if($(".page-sidebar-menu li").css('display') != "none"){
- if ($('body').hasClass("page-sidebar-closed") && $(".sidebar-toggler").hasClass("close-by-viewportChange")) {
- if( !isToggler ){
- $(".sidebar-toggler")[1].click();
- }
- $(".sidebar-toggler").removeClass("close-by-viewportChange");
- }
- }
- }
- else {
- changeSiderBar(true);
- }
- }
- var showIframe=function(iframe){
- var resize,pagemainIframe;
- if (cachedIframes.count()>0) {
- for (var i in cachedIframes.hash()) {
- cachedIframes.replace(i,0);
- var pagemyIframe=$('.page-content .page-content-body .'+i);
- if(pagemyIframe&&pagemyIframe.length>0){
- if(iframe==i){
- pagemyIframe.show();
- cachedIframes.replace(i,1);
- } else{
- if("page-mainIframe"===i){//2015年12月10日 wimax要求页面切换后删除没有配置cacheNum的缓存页面
- pagemainIframe=i;
- pagemyIframe.attr("src","");
- pagemyIframe.remove();
- }else{
- pagemyIframe.hide();
- }
- cachedIframes.replace(i,0);
- }
- }
- }
- }
- if(pagemainIframe){
- delete cachedIframes._hash[pagemainIframe];
- delete cachedIframesObject._hash[pagemainIframe];
- }
- if (!cachedIframes.contains(iframe)) {
- cachedIframes.add(iframe,1);
- //增加的iframe加载完毕后 停止加载中提示信息
- myIframe=$('.'+iframe);
- myIframe.show();
- myIframe.load(function(){
- /*if (!isDesktop) {
- if (resize) {
- clearInterval(resize);
- }
- resize = setInterval(dealIframeHeight, 400,$(this));
- }*/
- openoFrameWork.stopPageLoading();
- });
- }
- }
- var hidemenu=function(){
- $('.hor-menu').hide();
- dealAddStyle($('.page-content'),'margin-left','0px',true);
- dealAddStyle($('.page-sidebar'),'display','none',true);
- var fsiderMenu = $("#" + fMenuSiderDivId);
- fsiderMenu.children().css('display' , 'none');
- }
- var hideAlarmLight=function(){
- //$('#header_notification_bar').hide();
- //$('#header_notification_bar').empty();
- $('#header_notification_bar').html("<div>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</div>");
- }
- var dealShownav=function(){
- var showNav=openoFrameWork.getLocationURLParameter('showNav');
- if( showNav=="false"){
- openoFrameWork_showNav = showNav;
- hidemenu();
- hideAlarmLight();
- }
- }
- /* 点击菜单时,处理对应该菜单项的横,左菜单项 */
- var dealRelateMenu = function(source) {
- // 点击子菜单时,对应的横竖菜单项也联动为选择样式,(高亮,箭头变化)
- var panel = $('.zte-theme-panel');
- var navPosOption = $('.nav-pos-direction', panel).val();
- var targetsource = null;
- var targetContainer = null;
- if (navPosOption === "vertical") {
- // 当前是左菜单,则处理对应的横菜单
- targetsource = $("#"+source.attr("id"), $("#main_hormenu"));
- targetContainer = $(".header ul");
- } else if (navPosOption === "horizontal") {
- var rtn = dealMgaBarRelated(source);
- dealFMenuRelated(source , megaSiderDivId);
- targetContainer = rtn[0];
- targetsource = rtn[1];
- }else if(navPosOption === openoFrameWork_menu_fmenu){
- dealFMenuRelated(source , fMenuSiderDivId);
- }
- if (targetContainer) {
- // 移除原有菜单项的活动及箭头样式
- targetContainer.children('li.active').removeClass('active');
- targetContainer.find('.arrow.open').removeClass('open');
- }
- if (targetsource) {
- // 增加活动及箭头样式
- targetsource.parents('li').each(function () {
- $(this).addClass('iframe active');
- $(this).find('a > span.arrow').addClass('open');
- });
- targetsource.parents('li').addClass('active');
- if (navPosOption === "horizontal") {
- if (targetsource.parent().parent().parent().is("li")) {
- $('.arrow', targetsource.parent().parent().parent()).addClass("open");
- }
- }
- }
- }
- var dealMgaBarRelated = function(source){
- // 当前是横菜单,则处理对应的左菜单
- targetsource = $("#"+source.attr("id"), $("[class='page-sidebar-menu']"));
- targetContainer = $("#page-sidebar-menu ul");
- // 将先前左菜单展开的子菜单收缩
- $("li.open",targetContainer).each(function() {
- var style = $("ul.sub-menu", this).attr("style");
- if (style) {
- $("ul.sub-menu", this).removeAttr("style");
- $(this).removeClass('open');
- }
- });
- // 当前是横菜单,但在屏幕缩小的情况下显示的是tip垂直菜单,而横菜单是隐藏的,所以需额外处理横菜单
- if (source.parent().parent().parent().parent().attr("class").indexOf("page-sidebar-menu") >= 0) {
- var tiptargetsource = $("#"+source.attr("id"), $("#main_hormenu"));
- var tiptargetContainer = $(".header ul");
- tiptargetContainer.children('li.active').removeClass('active');
- tiptargetContainer.find('.arrow.open').removeClass('open');
- tiptargetsource.parents('li').each(function () {
- $(this).addClass('iframe active');
- $(this).find('a > span.arrow').addClass('open');
- });
- tiptargetsource.parents('li').addClass('active');
- }
- return [targetContainer ,targetsource ];
- }
- var dealFMenuRelated = function(source , siderDivId ){
- var fsiderMenu = $("#" + siderDivId);
- if(isMoreMenuItemClick){//更多菜单点击 , 临时方案,增加信号量,使用之后就置为false
- isMoreMenuItemClick = false
- }else if($(source).parents('li').hasClass('mega-menu-dropdown')){//F的横向菜单的点击
- var id = source.attr('id');
- //非被点击的一级菜单的二级菜单都不显示
- $('#' + siderDivId + '>li').hide();
- var level2Lis = $("a[hparentid= " + id + "]" , fsiderMenu).parent();
- level2Lis.show();
- if(level2Lis.length > 0){//把竖向菜单的收起放大按钮显示出来
- $('#' + siderDivId + '>li.sidebar-toggler-wrapper').show();
- }
- if($("a[hparentid= " + id + "]" , fsiderMenu).length > 0){ //有子孙菜单时,把F菜单的竖菜单显示出来
- dealFSidermenu(source ,siderDivId );
- }else{//否则隐藏竖菜单
- fsiderMenu.css('display','none');
- $("body").addClass("page-full-width");
- $(".page-content").css("marginLeft", _sidebarWidth);
- }
-
- }else{//F菜单的竖向菜单点击
- //处理一种特殊情况,告警灯打开新页面,所有的菜单都不出现,因此,虽然这个source在竖菜单,但竖菜单这个时候实际上是没有显示的
- if( openoFrameWork_showNav == "true") {
- $('#' + siderDivId + '>li').hide();
- var lis = $(source).parents('li');
- var id = lis.eq(lis.length-1).children( 'a' ).attr('hparentid');
- //var id = $(source).parents('li').children('a').attr('hparentId');
- var level2Lis = $("a[hparentid=" + id + "]" , fsiderMenu).parent();
- level2Lis.show();
- if(level2Lis.length > 0) {//把竖向菜单的收起放大按钮显示出来
- $('#'+ siderDivId + '>li.sidebar-toggler-wrapper').show();
- }
- //$('#' + siderDivId + '>li')[0].show();
- dealFSidermenu(source , siderDivId);
- }
- }
- }
- var dealFSidermenu = function(source , siderDivId){
- var fsiderMenu = $("#" + siderDivId);
- fsiderMenu.css('display','block');
- $('ul.sub-menu',fsiderMenu).css('display','block');
- $('.arrow',fsiderMenu).addClass('open');
- $("body").removeClass("page-full-width");
- if ($('body').hasClass("page-sidebar-closed")) {
- $(".page-content").css("marginLeft", _sidebarCollapsedWidth);
- } else {
- $(".page-content").css("marginLeft", _sidebarWidth);
- }
- var href = source.attr("href");
- $('li.iframe' ,fsiderMenu ).removeClass('active');
- var selectedIframeLi = $("a[href ='" + href + "']" ,fsiderMenu ).parent();
- selectedIframeLi.addClass('active');
- selectedIframeLi.parent().parent().addClass("open").addClass("active");
- selectedIframeLi.parent().css('display','block');
- selectedIframeLi.parent().parent().children('a').children('.arrow').addClass('open');
- }
- var dealMenuItemClick=function(source,e,menuContainerStr){
- var url = source.attr("href");
- if(!url||url.length<2)
- return;
- e.preventDefault();
- if(!_isClicked){//导航情况下,首先要模拟点开菜单分组
- _isClicked=true;//如果菜单有子菜单点击一次来展开子菜单,注意这个信号量的变化,避免死循环
- var mainMenu=source.parents('li').last();
- if(!mainMenu.hasClass('open')){
- dealLiAClick(mainMenu.children('a:eq(0)'));
- }
- }
- if(menuContainerStr&&menuContainerStr.length>0){
- var menuContainer = $('.'+menuContainerStr+' ul');
-
- menuContainer.children('li.active').removeClass('active');
- // menuContainer.children('arrow.open').removeClass('open');
- //menuContainer.find('.arrow.open').addClass('open');
- }
- source.parents('li').each(function () {
- $(this).addClass('iframe active');
- $(this).children('a > span.arrow').addClass('open');
- });
- source.parents('li').addClass('active');
- // 处理点击菜单对应的横或左菜单项的选择样式
- dealRelateMenu(source);
- if(menuContainerStr&&menuContainerStr.length>0){
- if ($(window).width() <= 991 && $('.'+menuContainerStr).hasClass("in")) {
- $('.navbar-toggle').click();
- }
- }
- if(dealMultTabPage(source))
- return true;
- dealScrollTo();
- var breadmenuID=e.data&&e.data.breadcrumbBtnMenuItem&&e.data.breadcrumbBtnMenuItem.length>0?e.data.breadcrumbBtnMenuItem:"";
- if(breadmenuID.length>0){//面包削导航来的,只需要重新生成面包削即可
- //找到更多菜单按钮
- var moreMenuItem = $('#' + breadmenuID , $('#pageableDiv'));
- if( moreMenuItem.length == 0 ){
- moreMenuItem = $('#' + breadmenuID , $('.more-botton-zone'));
- }
- dealBreadcrumbBtnMenuItemClick(moreMenuItem,e);
- //dealBreadcrumb(source,false,e);
- }else{//非面包削导航来的,
- dealstartPageLoading();
- if(dealIframe(source,e))//当返回true时说明是正常加载iframe了,否则面包削不能切换
- dealBreadcrumb(source,false,e);
- }
- //dealShownav();
- };
- var dealMenuItemGetFocus=function(source,e,menuContainerStr){
- var url = source.attr("href");
- if(!url||url.length<2)
- return;
- e.preventDefault();
- if(!_isClicked){//导航情况下,首先要模拟点开菜单分组
- _isClicked=true;//如果菜单有子菜单点击一次来展开子菜单,注意这个信号量的变化,避免死循环
- var mainMenu=source.parents('li').last();
- dealLiAClick(mainMenu.children('a:eq(0)'));
- }
- if(menuContainerStr&&menuContainerStr.length>0){
- var menuContainer = $('.'+menuContainerStr+' ul');
-
- menuContainer.children('li.active').removeClass('active');
- menuContainer.children('arrow.open').removeClass('open');
- }
- source.parents('li').each(function () {
- $(this).addClass('iframe active');
- $(this).children('a > span.arrow').addClass('open');
- });
- source.parents('li').addClass('active');
-
- if(menuContainerStr&&menuContainerStr.length>0){
- if ($(window).width() <= 991 && $('.'+menuContainerStr).hasClass("in")) {
- $('.navbar-toggle').click();
- }
- }
- };
- //处理iframe的核心处理类,逻辑较为复杂,注意各种参数的处理
- var dealIframe=function(aObject,e){
- _hashSource="";
- var url = aObject.attr("href");
- if(!url||url.length<2)
- return;
- url=openoFrameWork.handlBaseURL(url);
- //-----------2015年9月21日新增V5中大O需要的按照实例(根据选择的系统实例变化url的ip和端口地址)进行动态切换菜单的功能
- var category= aObject.attr("category");//处理菜单中定义的Category属性
- if(category&&category.length>0){//处理Category属性
- var newIpPort=_menuCategorys.items(category);
- if(newIpPort&&newIpPort.ipPort&&newIpPort.ipPort.trim()!=""){//如果找到了
- var newIpPortstr=openoFrameWork.getDomainURL(newIpPort.ipPort);//去掉ip和port后多余的部分
- var urlipport=openoFrameWork.getDomainURL(url);
- console.log("old url:"+url);
- url=newIpPortstr+url.replace(urlipport,"");
- console.log("newIpPort:"+newIpPortstr+" newURL:"+url);
- }
- }
- //------------
- dealstartPageLoading();
- var cacheNum= aObject.attr("cacheNum");//当第三方应用需要框架缓存曾经打开过的页面时使用。
- var shiftJS= aObject.attr("shiftJS");//当第三方应用不需要后面的href页面进行重新加载仅仅执行某个脚本打开某个功能时使用
- var _iframeName= aObject.attr("iframeName");//对有些第三方应用设置了顶层frame名字的,这个必须设置
- var _iframeAutoScroll= aObject.attr("iframeAutoScroll");//设置iframe的滚动条是否出现,可以设置为auto,yes或者no,默认为no 不出现.
- _iframeAutoScroll=!!_iframeAutoScroll?(_iframeAutoScroll==='yes'?'yes':_iframeAutoScroll==='auto'?'auto':'no'):'no';
- _xdomain= aObject.attr("xdomain");//对有些第三方应用如果跨域了,需要设置这个信任域属性,以便于来跨域通讯.这里取值是一个正则表达式
- _xdomain=_xdomain&&_xdomain.length>0?_xdomain:"*";
- var _cssfile= aObject.attr("cssSrc");//设置iframe中页面需要动态加载的css文件.
- _cssfile=(_cssfile&&_cssfile.length>0)?_cssfile:"";
- var _runShiftJS="";
- var pageContentBody=$('.page-content .page-content-body');
- var tabHtml="";
- var tabContentHtml="";
- var tabID="";
- var tabContentID="";
- var iframename='';
- function createIframe(pdiv,url,id,name,clsname,xdom,autoScroll){
- var pymParent = new pym.Parent(pdiv, url, {xdomain:xdom});
- pymParent.iframe.id=id;
- pymParent.iframe.name=name;
- //pymParent.iframe.setAttribute('display', "none");
- //pymParent.iframe.style.height="100%";
- //pymParent.iframe.setAttribute('height', "100%");
- pymParent.iframe.setAttribute('class', clsname);
- pymParent.iframe.setAttribute('allowfullscreen','');
- pymParent.iframe.setAttribute('mozallowfullscreen','');
- pymParent.iframe.setAttribute('oallowfullscreen','');
- pymParent.iframe.setAttribute('msallowfullscreen','');
- pymParent.iframe.setAttribute('webkitallowfullscreen','');
- //pymParent.iframe.setAttribute('scrolling',autoScroll);
- pymParent.iframe.setAttribute('onload', 'openoFrameWork.SyncCSS(this,0,"'+_cssfile+'");openoFrameWork.stopPageLoading();');
- cachedIframesObject.replace(id,pymParent);//缓存iframe对象实体
- pymParent.onMessage('height', function(he){
- console.log("The frame "+id+" receive message height is "+he);
- var pagemyIframe=$('.page-content .page-content-body .'+id);
- var h=Math.max(this.minHeight,he);
- pagemyIframe.height(h);
- });
- return pymParent;
- };
-
- if(cacheNum){//处理缓存iframe和iframename标签
- cacheNum="page-mainIframe"+cacheNum;
- iframename="fraMain"+cacheNum;
- }else{
- cacheNum="page-mainIframe";
- iframename="fraMain";
- }
- iframename=!!_iframeName?_iframeName:iframename;
- _iframe= cacheNum;//注意这里_iframe是一个全局变量
-
- var miframe=_iframe==""?"page-mainIframe": _iframe;
- var pagemyIframe=$('.page-content .page-content-body .'+miframe);
- var nagivJS=e&&e.data&&e.data.action?e.data.action:"";
- nagivJS=(!!nagivJS&&nagivJS.length>0)?(nagivJS.trim().toLowerCase()=="null"?nagivJS:"javascript:$('.page-content .page-content-body ."+miframe+"')[0].contentWindow."+nagivJS.trim()+";"):"";
- nagivJS=nagivJS.trim();
-
- _runShiftJS=(!!shiftJS&&shiftJS.length>0)?(shiftJS.trim().toLowerCase()=="null"?shiftJS:"javascript:$('.page-content .page-content-body ."+miframe+"')[0].contentWindow."+shiftJS+";"):"";
- if(pagemyIframe&&pagemyIframe.length>0){//如果iframe已经添加了,则直接更改url或者执行切换或导航函数
- var src=pagemyIframe.attr("src");
- if((!!shiftJS||nagivJS.length>0)&&(src==url||src.split('?')[0]==url.split('?')[0])&& cacheNum!="page-mainIframe") { //url相同时,处理缓存shiftJS标签
- //这里shiftJS必须定义iframe中的页面定义到window上的函数;
- //pagemyIframe.attr("scrolling",_iframeAutoScroll);
- cachedIframesObject.items(miframe).settings.xdomain=_xdomain;
- if(nagivJS.length>0&&nagivJS.toLowerCase()!="null")
- _runShiftJS=nagivJS;//如果是nagivJS导航过来的,nagivJS优先级高于shiftJS,如果有nagivJS就用nagivJS替换_runShiftJS; 直接执行一次导航切换
- try{
- if(_runShiftJS.trim().toLowerCase()!="null")
- eval(_runShiftJS);
- }catch(e){
- if (e instanceof EvalError) {
- console.log(e.name + " EvalError: " + e.message);
- } else if (e instanceof SyntaxError) {
- console.log(e.name + " SyntaxError: " + e.message);
- }else if (e instanceof Error) {
- if(e.name.toLowerCase().trim()=="typeerror")
- {
- //console.log($.i18n.prop('com_zte_ums_ict_framework_ui_clickTooFast'));
- var parm={runShiftJS:_runShiftJS};
- pagemyIframe.one('load',parm,function(e){
- var runShiftJS=e&&e.data&&e.data.runShiftJS?e.data.runShiftJS:"";
- if(runShiftJS.length>0&&runShiftJS.toLowerCase()!="null")
- eval(runShiftJS);//点击太快了,页面没有加载完毕,那就加载完毕了再次执行
- })
- }
- }
- return false;//返回false 后续不再做其他动作了
- }
- finally{
- openoFrameWork.stopPageLoading();
- }
- }else{//否则url不同,或者url相同但没有shiftjs
- if(nagivJS.length>0&&nagivJS.toLowerCase()!="null"){//如果是代码导航过来的去掉url参数中的默认action动作
- url=url.split('?')[0];//去掉?参数,防止默认执行动作,只响应nagivJS指定的动作;
- }
- if(src.split('#')[0]!=url.split('#')[0])//如果相等说明是通过锚点导航的,真实url没有变化,对SPA应用比较普遍
- {
- pagemyIframe.attr("src","");//url和src不同说明更换了页面,需要清空重新加载
- }else //if (src.trim()==url.trim()) //没有shiftjs并且url相同,说明不需要再次加载了,已经加载过了
- {
- openoFrameWork.stopPageLoading();
- }
- pagemyIframe.attr("src",url);
-
- if(nagivJS.length>0&&nagivJS.toLowerCase()!="null"){//如果是nagivJS导航过来的,iframe加载完毕后执行一次导航切换脚本
- var parm={nagivJS:nagivJS};
- pagemyIframe.one('load',parm,function(e){
- var nagivJS=e&&e.data&&e.data.nagivJS?e.data.nagivJS:"";
- if(nagivJS.length>0&&nagivJS.toLowerCase()!="null")
- eval(nagivJS);//如果没有加载过,加载后也要执行跳转的函数
- });
- }
- if(_cssfile.length>0&&_cssfile.toLowerCase()!="null"){//如果配置了cssSrc,每次切换都重新执行一边这个css文件,防止有遗漏
- parm={syncCSSJS:'openoFrameWork.SyncCSS(this,10,"'+_cssfile+'");openoFrameWork.stopPageLoading();'};
- pagemyIframe.one('load',parm,function(e){
- var syncCSSJS=e&&e.data&&e.data.syncCSSJS?e.data.syncCSSJS:"";
- if(syncCSSJS.length>0&&syncCSSJS.toLowerCase()!="null")
- eval(syncCSSJS);
- });
- }
- }
-
- }else{//否则添加新的iframe元素 overflow:visible;
- if(nagivJS.length>0&&nagivJS.toLowerCase()!="null"){//如果是代码导航过来的去掉url参数中的默认action动作
- url=url.split('?')[0];//去掉?参数,防止默认执行动作,只响应nagivJS指定的动作;
- }
- var pdiv="pdiv_"+miframe;
- if($("#"+pdiv).length<=0){//检查下,如果该div没有添加过就添加
- pageContentBody.append("<div id='"+pdiv+"' style='height:800px;overflow:auto'></div>");
- }
- dealstartPageLoading();
- pymParent=createIframe(pdiv, url,miframe,miframe,miframe,_xdomain,_iframeAutoScroll);
- pagemyIframe=$(pymParent.iframe);
-
- if(nagivJS.length>0&&nagivJS.toLowerCase()!="null"){//如果是nagivJS导航过来的,iframe加载完毕后执行一次导航切换
- var parm={nagivJS:nagivJS};
- pagemyIframe=$('.page-content .page-content-body .'+miframe);
- if(pagemyIframe&&pagemyIframe.length>0){
- pagemyIframe.one('load',parm,function(e){
- var nagivJS=e&&e.data&&e.data.nagivJS?e.data.nagivJS:"";
- if(nagivJS.length>0&&nagivJS.toLowerCase()!="null")
- eval(nagivJS);//如果没有加载过,加载后也要执行跳转的函数
- })
- }
- }
-
- }
- showIframe(miframe);
- openoFrameWork.fixContentHeight(); // 调整高度
- return true;
- }
- // 处理边栏菜单
- var dealLiAClick=function(source){
- if (source.next().hasClass('sub-menu') == false) {
- if ($('.btn-navbar').hasClass('collapsed') == false) {
- $('.btn-navbar').click();
- }
- return;
- }
-
- if (source.next().hasClass('sub-menu always-open')) {
- return;
- }
- var parent = source.parent().parent();
- var the = source;
- var menu = $('.page-sidebar-menu');
- var sub = source.next();
- var autoScroll = menu.data("auto-scroll") ? menu.data("auto-scroll") : true;
- var slideSpeed = menu.data("slide-speed") ? parseInt(menu.data("slide-speed")) : 200;
- parent.children('li.open').children('a').children('.arrow').removeClass('open');
- parent.children('li.open').children('.sub-menu:not(.always-open)').slideUp(200);
- parent.children('li.open').removeClass('open');
- var slideOffeset = -200;
- if (sub.is(":visible")) {
- $('.arrow', source).removeClass("open");
- source.parent().removeClass("open");
- sub.slideUp(slideSpeed, function () {
- if (autoScroll == true && $('body').hasClass('page-sidebar-closed') == false) {
- if ($('body').hasClass('page-sidebar-fixed')) {
-
- } else {
- dealScrollTo(the, slideOffeset);
- }
- }
- dealSidebarAndContentHeight();
- });
- } else {
- $('.arrow', source).addClass("open");
- source.parent().addClass("open");
- sub.slideDown(slideSpeed, function () {
- if (autoScroll == true && $('body').hasClass('page-sidebar-closed') == false) {
- if ($('body').hasClass('page-sidebar-fixed')) {
- dealScrollTo(the, slideOffeset);
- }
- }
- dealSidebarAndContentHeight();
- });
- }
- }
- var dealSidebarMenu = function () {//这里注册和处理边栏菜单的各类点击事件
- $('.page-sidebar').on('click', 'li > a', function (e) {
- if ($(this).next().hasClass('sub-menu') == false) {
- if ($('.btn-navbar').hasClass('collapsed') == false) {
- $('.btn-navbar').click();
- }
- return;
- }
- if ($(this).next().hasClass('sub-menu always-open')) {
- return;
- }
- dealLiAClick($(this));
- e.preventDefault();
- });
-
- // 处理左边导航中的菜单连接,显示在iframe中
- $('.page-sidebar').on('click', ' li > a.iframe', function (e) {
- //dealMenuItemClick($(this),e,"page-sidebar")
- e.preventDefault();
- var menuItemID=$(this).attr("id");
- if(!!menuItemID&&menuItemID.length>0){
- _setLocationHash(menuItemID);
- _hashSource="dhByInterface";
- }//else{
- _isClicked=true;
- dealMenuItemClick($(this),e,"page-sidebar");
- //}
- });
- // 处理更多菜单的菜单连接,显示在iframe中dropdown-menu
- $('.page-breadcrumb').on('click', ' li > a.iframe', function (e) {
- var url = $(this).attr("href");
- if(url.length<2)
- return;
- e.preventDefault();
- dealBreadcrumbBtnMenuItemClick($(this),e);
- });
- // 处理可翻页更多菜单中的菜单连接,显示在iframe中dropdown-menu
- $('#pageableDiv').on('click', ' div > a.iframe', function (e) {
- var url = $(this).attr("href");
- if(url.length<2)
- return;
- e.preventDefault();
- dealBreadcrumbBtnMenuItemClick($(this),e);
- });
- // 处理可翻页更多菜单中的菜单连接,显示在iframe中dropdown-menu
- $('#pageableDiv').on('click', ' li > a.iframe', function (e) {
- var url = $(this).attr("href");
- if(url.length<2)
- return;
- e.preventDefault();
- if(e.target){
- var tg=$("span",e.target);
- tg=tg.length>0?tg[0]:e.target;
- $(".open a>div>span",e.target.parentNode.parentNode.parentNode.parentNode.parentNode).replaceWith(tg.outerHTML);
- }
- dealBreadcrumbBtnMenuItemClick($(this),e);
- });
-
- // 处理header下拉菜单中的菜单连接,显示在iframe中
- $('.dropdown').on('click', ' li > a.iframe', function (e) {
- var url = $(this).attr("href");
- if(url.length<2)
- return;
- e.preventDefault();
- dealScrollTo();
- dealstartPageLoading();
-
- dealIframe($(this),e)
- dealBreadcrumb($(this),false,e);
- });
- }
- var getSceneURL=function(url){
- if(url&&url.trim().length>0){
- url=url.trim();
- //url=
- _sceneURLRootPath=_sceneURLRootPath+url;
- }
- }
- var gurl="";//临时全局变量,存储当前加载的more菜单,如果加载过了,就不再加载了。下面的方法中会用到
- var moreMenusisLoaded=true;
- var waittime=null;
- var getBreadcrumbRightButtons=function(url,e){
- if (url.length<2){
- return;
- }
- url=openoFrameWork.handlBaseURL(url);
- if (gurl==url){
- if(e===true){
- $('#pageableDiv').show();
- }else if(e&&e.target&&e.currentTarget){
- var defaultDisplay=$(e.target).attr("defaultDisplay");
- defaultDisplay=(!defaultDisplay)?$(e.currentTarget).attr("defaultDisplay"):defaultDisplay;
- if(defaultDisplay&&defaultDisplay.trim()=="false"){
- $('#pageableDiv').hide();
- }else{
- $('#pageableDiv').show();
- }
- }
- return;
-
- }else{
- gurl=url;
- clearMoreOperations();
- }
- //处理e参数,注意e可能为null
- var breadmenuID=e&&e.data&&e.data.breadcrumbBtnMenuItem&&e.data.breadcrumbBtnMenuItem.length>0?e.data.breadcrumbBtnMenuItem:"";
- breadmenuID=breadmenuID.length<=0?(e&&e.breadcrumbBtnMenuItem&&e.breadcrumbBtnMenuItem.length>0?e.breadcrumbBtnMenuItem:""):breadmenuID;
- moreMenusisLoaded=false;
- $.ajax({
- type: "GET",
- cache: false,
- url: url,
- dataType: "html",
- success: function (res) {
- try{
- //$('.page-breadcrumb').append(res);
- var resScriptsSriped = stripHtmlScripts(res);
- //$('.page-breadcrumb').append(resScriptsSriped);
- $('.more-botton-zone').children().remove();
- //V5新增逻辑,如果displayType = pageableDiv,那么就用滑动的DIV来显示更多菜单里面的内容,如果没有配置,或为其他值,就按原有方式显示
- var tempDiv = $('<div style="display:none"></div>');
- tempDiv.children().remove();
- tempDiv.append(resScriptsSriped);
-
- //获取UL属性
- var displayType = $('.dropdown-menu',tempDiv).attr('displayType');
- if( displayType && displayType != 'pageableDiv'){
- $('.more-botton-zone').append(resScriptsSriped);
- $('#pageableDiv').hide();
- }else{
- var tempUl = $('.dropdown-menu',tempDiv);
- if(tempUl.length>0){
- moreOperations(tempUl[0]);
- if(e&&e.target&&e.currentTarget){
- var defaultDisplay=$(e.target).attr("defaultDisplay");
- defaultDisplay=(!defaultDisplay)?$(e.currentTarget).attr("defaultDisplay"):defaultDisplay;
- if(defaultDisplay&&defaultDisplay.trim()=="false"){
- $('#pageableDiv').hide();
- }else{
- $('#pageableDiv').show();
- }
- }
- }
- }
- runHtmlScripts(res);
- }catch(ex){
- }finally{
- moreMenusisLoaded=true;
- }
- groupButtonAuthentication();
- if(breadmenuID.length>0){//面包削导航来的,只需要重新生成面包削即可
- var menuitem=undefined;
- var panel = $('.zte-theme-panel');
- var navPosOption = $('.nav-pos-direction', panel).val();
- //var items=$("a[id='"+breadmenuID+"']");
- var items = undefined;
- if (navPosOption === "vertical"){ //从垂直菜单里面找
- items=$("#page-sidebar-menu a[id='"+breadmenuID+"']");
-
- }else{//从水平菜单里面找
- items=$(".hor-menu a[id='"+breadmenuID+"']");
- }
- if (!items || items.length < 1) {
- items=$(".page-content a[id='"+breadmenuID+"']");
- }
- if(items.length>0){
- for(var i=0;i<items.length;i++){
- if($(items[i]).parentsUntil('.more-botton-zone .btn-group').hasClass('dropdown-menu')){
- menuitem=$(items[i]);
- break;
- }
- if($(items[i]).parentsUntil('#pageableDiv').hasClass('row1')){
- menuitem=$(items[i]);
- break;
- }
- }
- }
- if(!!menuitem&&menuitem.length>0)
- dealBreadcrumbBtnMenuItemClick(menuitem,e);
- }
- },
- error: function (xhr, ajaxOptions, thrownError) {//加载操作菜单失败!com_zte_ums_ict_framework_ui_loadmenuerror
- $('.page-breadcrumb').append('<h4>'+$.i18n.prop('com_zte_ums_ict_framework_ui_loadmenuerror')+'</h4>');
- moreMenusisLoaded=true;
- }
- });
- }
-
- //处理多tab也场景 ----redirect 该标签暂时保留,不建议使用了
- dealMultTabPage=function(clickedObject){
- var url = clickedObject.attr("href");
- if(!url||url.length<2)
- return;
- var redirect=clickedObject.attr("redirect"); //处理多tab页面的需求
- if (!!redirect&&redirect.length>0){
- var miframe=_iframe==""?"page-mainIframe": _iframe;
- var pagemyIframe=$('.page-content .page-content-body .'+miframe); //.page-mainIframe
- //var pagemyIframe=$('.page-content .page-content-body .page-mainIframe');
- var oldhref="";
- if(pagemyIframe&&pagemyIframe.length>0){
- oldhref=pagemyIframe.attr("src");
- if(url.split("?")[0]==oldhref.split("?")[0])
- {
- eval(redirect);
- dealBreadcrumb(clickedObject,false,e);
- return true;
- }
- }
- };
- return false;
- };
- //处理主菜单面包削导航
- var globleCurrentBreadcrumb="";
- var globleCurrentMainMenuItemID="";
- var dhByBreadcrumb = false;
- var dealBreadcrumb=function(clickedObject,notGenUID,e){//notGenUID为true就不重新生成id
- var mbreadcrumb=$('.breadcrumbUl');
- openoFrameWork.setPageTitle(clickedObject.find('span').text().trim());
- var clieckedObj= clickedObject.parent('li');
- if(clieckedObj.length == 0){ //分页式更多菜单,a链接的父亲是div
- clieckedObj= clickedObject.parent('div');
- }
- //如果点击的是F菜单的竖菜单,还需要找到横菜单上的对应父亲加入到clieckedObj
- var navPosOption = $('.nav-pos-direction', panel).val();
- var parentid = clickedObject.attr('hparentid');
- var breadcrumGroupButtonSrc=clickedObject.attr("breadcrumGroupButtonSrc");
- globleCurrentMainMenuItemID=clickedObject.attr("id");
- var mhmtl="";
- var url="";
- var tempObj=null;
- //var breadChangeType = e? (e.data ? e.data.breadChangeType:null):null;
- if( dhByBreadcrumb ){
- mhmtl = dealClickBreadcrumb(clieckedObj);
- dhByBreadcrumb = "";
- }else{
- while (clieckedObj&&clieckedObj.length>0){
- if(clieckedObj.children('a')){
- if(!notGenUID){
- url=openoFrameWork.getUniqueID("aid");//+Math.floor(Math.random() * (new Date()).getTime());
- clieckedObj.children('a').attr("name",url);
- }else{
- url=clieckedObj.children('a').attr("name");
- }
- tempObj=clieckedObj.clone();
- tempObj.children('a').removeClass('iframe');
- tempObj.children('a').removeClass('active');
- tempObj.children('a').attr("href","javascript:openoFrameWork.goToURL('"+url+"');");
- var arrowdown = $(".fa-angle-down", tempObj.children('a'));
- if (arrowdown) {
- arrowdown.remove();
- }
- if(tempObj.children('a').length>0){
- mhmtl=tempObj.children('a')[0].outerHTML+"<i class='fa fa-angle-right'></i>"+mhmtl;
- }
- //如果是F菜单和横菜单的子竖菜单点击,需要做特殊处理
- if( clieckedObj.parent('ul').attr('id') == fMenuSiderDivId || clieckedObj.parent('ul').attr('id') == megaSiderDivId){
- var id = clieckedObj.children( 'a' ).attr('hparentid');
- //判断是F菜单还是横菜单
- var megaMenu = null;
- if(navPosOption == openoFrameWork_menu_horizontal){
- magaMenu = $('#'+megaDivId);
- }else if(navPosOption == openoFrameWork_menu_fmenu){
- magaMenu = $('#'+fMenuMegaDivId);
- }
- clieckedObj = $("a[id=" + id + "]" , magaMenu).parent('li');
- }else{
- clieckedObj=clieckedObj.parents('li');
- }
- }
- }
- if(clieckedObj[0]&&clieckedObj[0].length>0) {
- mhmtl=clieckedObj.children('a')[0].outerHTML+"<i class='fa fa-angle-right'></i>"+mhmtl;
- }
- }
- mbreadcrumb.empty();
- $('.more-botton-zone').empty();
- globleCurrentBreadcrumb=mhmtl;
- store("globleCurrentBreadcrumb",globleCurrentBreadcrumb);
- mbreadcrumb.append(mhmtl);
- if(breadcrumGroupButtonSrc&&breadcrumGroupButtonSrc.length>0){
- getBreadcrumbRightButtons(breadcrumGroupButtonSrc,e);
- }else{
- $('#pageableDiv').hide();
- }
-
- };
- //面包屑发起的点击,就不重新生成面包屑,只是把该面包屑的后续节点移出。
- var dealClickBreadcrumb = function(clieckedObj){
- var index = globleCurrentBreadcrumb.indexOf(clieckedObj.children('a').attr("name"));
- if( index > -1 ){//截取
- var indexofSign = globleCurrentBreadcrumb.indexOf("<i class='fa fa-angle-right'>",index);
- var newBreadcrumb = globleCurrentBreadcrumb.substring(0,indexofSign) + "<i class='fa fa-angle-right'></i>";
- return newBreadcrumb;
- }
- }
- //处理面包削中菜单点击后的导航(更多菜单的面包屑)
- var dealBreadcrumbBtnGroupMenus=function(clickedObject,notGenUID , e ){
- var mbreadcrumb=$('.breadcrumbUl');
- var clieckedObj= clickedObject.parent();
- var breadcrumGroupButtonSrc=clickedObject.attr("breadcrumGroupButtonSrc");
- var mhmtl="";
- var url="";
- var tempObj=null;
- var menuid=clickedObject.attr("id");
- if (!breadcrumbBtnMenus.contains(menuid)) {//把当前面包削中的菜单id和该子菜单对应的父菜单关联缓存起来
- breadcrumbBtnMenus.add(menuid,globleCurrentMainMenuItemID);
- }
- while (clieckedObj&&clieckedObj.length>0){
- tempObj=clieckedObj.clone();
- if(tempObj.children('a')){
- tempObj.children('a').removeClass('iframe');
- url=tempObj.children('a').attr("href");
- tempObj.children('a').attr("onclick","openoFrameWork.openbreadcrumbLink($(this),event);");
- var tempdiv = tempObj.children('a').children('div');
- if( tempdiv.length > 0 ){
- var innerofDiv = tempdiv[0].innerHTML;
- tempdiv.remove();
- tempObj.children('a')[0].innerHTML = innerofDiv;
- }
- if(tempObj.children('a').length>0){
- mhmtl=tempObj.children('a')[0].outerHTML+"<i class='fa fa-angle-right'></i>"+mhmtl;
- }
- clieckedObj=clieckedObj.parents('li');
- }
-
- }
- if(clieckedObj[0]&&clieckedObj[0].length>0) {
- mhmtl=clieckedObj.children('a')[0].outerHTML+"<i class='fa fa-angle-right'></i>"+mhmtl;
- }
-
- if(breadcrumGroupButtonSrc&&breadcrumGroupButtonSrc.length>0){
- getBreadcrumbRightButtons(breadcrumGroupButtonSrc,true);
- }else{
- $('#pageableDiv').hide();
- }
- mbreadcrumb.empty();
- var category= clickedObject.attr("category");//处理菜单中定义的Category属性
- if(category&&category.length>0){//处理Category属性
- var newIpPort=_menuCategorys.items(category);
- if(newIpPort&&newIpPort.ipTitle&&newIpPort.ipTitle.trim()!=""){//如果找到了
- mhmtl=newIpPort.ipTitle+'<i class="fa fa-angle-right"></i>'+mhmtl;
- }
- }
- mhmtl=globleCurrentBreadcrumb+mhmtl;
- mbreadcrumb.append(mhmtl);
- };
- var isMoreMenuItemClick = false;
- var dealBreadcrumbBtnMenuItemClick=function(clickObj,e){
- dealScrollTo();
- var menuItemID=clickObj.attr("id");
- if(!!menuItemID&&menuItemID.length>0){
- _setLocationHash(menuItemID);
- var breadmenuID=e&&e.data&&e.data.breadcrumbBtnMenuItem&&e.data.breadcrumbBtnMenuItem.length>0?e.data.breadcrumbBtnMenuItem:"";
- _hashSource=breadmenuID&&breadmenuID.length>0?"":"dhByInterface";//hash进来的,不是导航进来的。
- }
- if(!(e&&e.breadcrumbBtnMenuItem&&e.breadcrumbBtnMenuItem.length>0)){//如果仅仅是tab跳转设置bread进来的,就框架不处理菜单点击,直接重新建立bread即可
- dealstartPageLoading();
- dealIframe(clickObj,e);
- }
- dealBreadcrumbBtnGroupMenus(clickObj,false,e);
- }
- // 固定边栏布局时计算边栏高度.
- var _calculateFixedSidebarViewportHeight = function () {
- var viewport = _getViewPort();
- var sidebarHeight =viewport.height - $('.header').height() + 1;
- if ($('body').hasClass("page-footer-fixed")) {
- sidebarHeight = sidebarHeight - (!$('.footer')||$('.footer').length<=0)?0:$('.footer').outerHeight();
- }
- return sidebarHeight;
- }
- // 处理固定边栏
- var dealFixedSidebar = function () {
- var menu = $('.page-sidebar-menu');
- if (menu.parent('.slimScrollDiv').size() === 1) {
- menu.removeAttr('style');
- $('.page-sidebar').removeAttr('style');
- }
-
- if ($('.page-sidebar-fixed').size() === 0) {
- dealSidebarAndContentHeight();
- return;
- }
-
- var viewport = _getViewPort();
- if (viewport.width >= openoFrameWork_smallView) {
- var sidebarHeight = _calculateFixedSidebarViewportHeight();
- dealSidebarAndContentHeight();
- }
- }
- // 固定边栏时处理菜单 hover 效果.
- var dealFixedSidebarHoverable = function () {
- if ($('body').hasClass('page-sidebar-fixed') === false) {
- return;
- }
- $('.page-sidebar').off('mouseenter').on('mouseenter', function () {
- dealSiderBarMouseenter();
- });
- $('.page-sidebar').off('mouseleave').on('mouseleave', function () {
- dealSiderBarMouseLeave();
- });
- }
- var dealSiderBarMouseenter=function(){
- var body = $('body');
- var siderbar=$('.page-sidebar');
- if ((body.hasClass('page-sidebar-closed') === false || body.hasClass('page-sidebar-fixed') === false) || $(this).hasClass('page-sidebar-hovering')) {
- return;
- }
- body.removeClass('page-sidebar-closed').addClass('page-sidebar-hover-on');
- var siderbartoggle=$('.sidebar-toggler');
-
- if (body.hasClass("page-sidebar-reversed")) {
- siderbar.width(_sidebarWidth);
- dealSiderBarWidthChange();
- } else {
- siderbar.addClass('page-sidebar-hovering');
- siderbar.animate({
- width: _sidebarWidth
- }, 350, '', function () {
- siderbar.removeClass('page-sidebar-hovering');
- dealSiderBarWidthChange();
- });
- }
- }
- var dealSiderBarMouseLeave=function(){
- var body = $('body');
- if ((body.hasClass('page-sidebar-hover-on') === false || body.hasClass('page-sidebar-fixed') === false) || $(this).hasClass('page-sidebar-hovering')) {
- return;
- }
- var siderbar=$('.page-sidebar');
- var siderbartoggle=$('.sidebar-toggler');
- if (body.hasClass("page-sidebar-reversed")) {
- body.addClass('page-sidebar-closed').removeClass('page-sidebar-hover-on');
- siderbar.width(_sidebarCollapsedWidth);
- if(siderbartoggle){
- siderbartoggle.removeAttr('style');
- }
- dealSiderBarWidthChange();
- } else {
- siderbar.addClass('page-sidebar-hovering');
- siderbar.animate({
- width: _sidebarCollapsedWidth
- }, 350, '', function () {
- body.addClass('page-sidebar-closed').removeClass('page-sidebar-hover-on');
- dealSiderBarWidthChange();
- siderbar.removeClass('page-sidebar-hovering');
- if(siderbartoggle){
- siderbartoggle.removeAttr('style');
- }
- });
- }
-
- }
- //处理style css
- var dealAddStyle=function(element, property, value, important) {
- var styleText=element.attr('style')?element.attr('style'):"";
- styles=styleText.split(";");
- var find="";
- for(i=0;i<styles.length;i++){
- if(styles[i].indexOf(property)>=0){
- find=styles[i];//看是否已经添加过,如果添加过就需要替换掉
- break;
- }
- }
- styleText=find.length>0?styleText.replace(find,""):styleText;
- styleText=(styleText + ';'+property + ':' + value + ((important) ? ' !important' : '') + ';').replace(/;;/g,";");
- element.attr('style',styleText );
- }
- var dealSiderBarWidthChange=function(){
-
- }
- // 处理边栏菜单切换时的关闭和隐藏.
- var dealSidebarToggler = function () {
- var viewport = _getViewPort();
- if (getCookie('sidebar_closed') === '1' && viewport.width >= openoFrameWork_smallView) {
- $('body').addClass('page-sidebar-closed');
- }
- $('.page-sidebar, .sidebar-toggler').on('click', '.sidebar-toggler', function (e) {
- e.preventDefault();
- var body = $('body');
- var sidebar = $('.page-sidebar');
- if(body.hasClass('page-sidebar-closed')){
- $(this).removeAttr('style');
- }
- } );
- $('.page-sidebar, .header').on('click', '.sidebar-toggler', function (e) {
- var body = $('body');
- var sidebar = $('.page-sidebar');
- if ((body.hasClass("page-sidebar-hover-on") && body.hasClass('page-sidebar-fixed')) || sidebar.hasClass('page-sidebar-hovering')) {
- body.removeClass('page-sidebar-hover-on');
- sidebar.css('width', '').hide().show();
- dealSidebarAndContentHeight(); //fix content & sidebar height
- setCookie('sidebar_closed', '0');
- dealSiderBarWidthChange();
- e.stopPropagation();
- runResponsiveHandlers();
- return;
- }
- $(".sidebar-search", sidebar).removeClass("open");
- var panel = $('.zte-theme-panel');
- var sidebarPosOption = $('.sidebar-pos-option', panel).val();
- var pcontent = $("[class='page-content']");
- if (body.hasClass("page-sidebar-closed")) {
- body.removeClass("page-sidebar-closed");
- if (body.hasClass('page-sidebar-fixed')) {
- sidebar.css('width', '');
- }
- setCookie('sidebar_closed', '0');
- pcontent.css("marginLeft",_sidebarWidth);
- dealSiderBarWidthChange();
- } else {
- body.addClass("page-sidebar-closed");
- $(this).removeAttr('style');
- setCookie('sidebar_closed', '1');
- pcontent.css("marginLeft", _sidebarCollapsedWidth);
- dealSiderBarWidthChange();
- }
- //针对侧边栏伸缩的情况需加入对.page-content的判断。
- dealSidebarAndContentHeight(true);
- runResponsiveHandlers();
- });
- }
- // 处理水平菜单
- var dealHorizontalMenu = function () {
- $('.header').on('click', '.hor-menu .hor-menu-search-form-toggler', function (e) {
- if ($(this).hasClass('off')) {
- $(this).removeClass('off');
- $('.header .hor-menu .search-form').hide();
- } else {
- $(this).addClass('off');
- $('.header .hor-menu .search-form').show();
- }
- e.preventDefault();
- });
- // 处理水平菜单 处理header下拉菜单中的菜单连接,显示在iframe中
- $('.header').on('click', ' li > a.iframe', function (e) {
- //dealMenuItemClick($(this),e,"header");
- e.preventDefault();
- var menuItemID=$(this).attr("id");
- if(!!menuItemID&&menuItemID.length>0){
- _setLocationHash(menuItemID);
- _hashSource="dhByInterface";
- }//else{
- _isClicked=true;
- dealMenuItemClick($(this),e,"header");
- //}
- });
- //处理TAB点击
- $('.header').on('click', '.hor-menu a[data-toggle="tab"]', function (e) {
- e.preventDefault();
- var nav = $(".hor-menu .nav");
- var active_link = nav.find('li.current');
- $('li.active', active_link).removeClass("active");
- $('.selected', active_link).remove();
- var new_link = $(this).parents('li').last();
- new_link.addClass("current");
- new_link.find("a:first").append('<span class="selected"></span>');
- });
- }
- // 增加一个对服务端的心跳
- var doHeartbeat = function() {
- //心跳超时次数
- var heartBeatTimes = 0;
- return setInterval(function() {
- var userName;
- if( userName == null ){
- var userName = openoFrameWork_conf.userName;
- }
- var heartUrl = FrameConst.REST_HEARTBEAT + "?username=" + encodeURIComponent(userName);
- $.ajax(heartUrl, {
- dataType : "text",
- cache : false
- }).done(function(data) {
- // if (data != "true") { //收到不属于取值范围内的回复,说明出现不可预知情况,取消心跳。是原framework.js中的逻辑,比较奇怪,先保留注释。
- // disableHeartbeat();
- // }
- //收到心跳回应消息,心跳超时次数置0
- if( data == "true" ){
- heartBeatTimes = 0;
- }
- });
- heartBeatTimes++;
- //心跳超时6次即1分钟,转到登录界面,认为链路断。
- if(heartBeatTimes >= 6){
- disableHeartbeat();
- //console.log(com_zte_ums_aos_framework_ui_heartbeat_timeout);
- bootbox.alert($.i18n.prop('com_zte_ums_aos_framework_ui_heartbeat_fail'), function () {
- window.location.replace("login.html");
- });
- }
- }, 10000);
- };
- if( FrameConst.do_heartbeat ){
- var heartbeatTimer = doHeartbeat();
- }
- window.enableHeartbeat = function() {
- if (!heartbeatTimer) {
- //重新启动心跳功能,心跳超时次数置0
- heartBeatTimes = 0;
- heartbeatTimer = doHeartbeat();
- return "Enabled";
- }
- return "Already enabled!";
- };
- window.disableHeartbeat = function() {
- if (heartbeatTimer) {
- clearInterval(heartbeatTimer);
- heartbeatTimer = null;
- return "Disabled";
- }
- return "Already disabled!";
- };
- window.doLogout = function(){
- logoutSubmit();
- };
- //处理ict注销确认
- $('#trigger_logout').click(function(){
- bootbox.confirm($.i18n.prop('com_zte_ums_ict_framework_ui_confirmlogout'), function(result) { //你确认要注销吗?
- if(result){
- doLogout();
- }
- });
- });
- // Handle full screen mode toggle
- var isscreenFull=false;
- var dealFullScreenMode = function() {
- // 处理全屏事件
- function toggleFullScreen() {
- if(!screenfull.supportsFullScreen){//不支持全屏
- if (isIE&&typeof window.ActiveXObject !== "undefined") { // Older IE.
- var wscript = new ActiveXObject("WScript.Shell");
- if (wscript !== null) {
- wscript.SendKeys("{F11}");
- isscreenFull=!isscreenFull;
- }
- }else{
- isscreenFull=screenfull.supportsFullScreen;
- };
- }else{
- screenfull.isFullScreen?screenfull.exitFullScreen():screenfull.requestFullScreen();
- isscreenFull= screenfull.isFullscreen;
- }
- setTimeout(function(){
- if(isscreenFull){
- $("#fullscreen_label").text($.i18n.prop('com_zte_ums_ict_framework_ui_group_exitfullscreen'));
- }else{
- $("#fullscreen_label").text($.i18n.prop('com_zte_ums_ict_framework_ui_group_fullscreen'));
- }
- },500);
- }
-
- $('#trigger_fullscreen').click(function() {
- toggleFullScreen();
- });
- }
- //清理当前正在显示的iframe之外缓存的iframe,
- var dealClearCachedIframes=function(isall){
- if (cachedIframes.count()>0) {
- for (var i in cachedIframes.hash()) {
- var pagemyIframe=$('.page-content .page-content-body .'+i);
- if(pagemyIframe&&pagemyIframe.length>0){
- if(isall==true){
- pagemyIframe.attr("src","");
- pagemyIframe.remove();
- }else if(i!=_iframe)
- pagemyIframe.attr("src","");
- pagemyIframe.remove();
- }
- }
- }
- cachedIframes.clear();
- if (cachedIframesObject.count()>0) {//清理缓存的iframe实体对象。
- for (var i in cachedIframesObject.hash()) {
- if(i!=_iframe)
- cachedIframesObject.remove(i);
- }
- }
- }
- var lastSelectedLayout = '';
- var dealTheme = function () {
- var panel = $('.zte-theme-panel');
- if ($('body').hasClass('page-boxed') == false) {
- $('.layout-option', panel).val("fluid");
- }
- $('.sidebar-option', panel).val("default");
- $('.language-option', panel).val(defaultLanage);
- $('.header-option', panel).val("fixed");
- $('.footer-option', panel).val("default");
- if ( $('.sidebar-pos-option').attr("disabled") === false) {
- $('.sidebar-pos-option', panel).val(openoFrameWork.isRTL() ? 'right' : 'left');
- }
- var _resetLayout = function () {
- dealResetLayout();
- }
- var _setLayout = function () {
- dealSetLayout();
- }
- var setColor = function (color) {
- var color_ = (openoFrameWork.isRTL() ? color + '-rtl' : color);
- $('#style_color').attr("href", ICTFRAME_CONST_THEME_COLOR_CSS_PREFFIX + color_ + ".css");
- setCookie('style_color', color);
- syncColorCSS();
- }
- $('.toggler', panel).click(function () {
- $('.toggler').hide();
- $('.toggler-close').show();
- $('.zte-theme-panel > .theme-options').show();
- });
-
- $('.toggler-close', panel).click(function () {
- $('.toggler').show();
- $('.toggler-close').hide();
- $('.zte-theme-panel > .theme-options').hide();
- });
- $('.theme-colors > ul > li', panel).click(function () {
- var color = $(this).attr("data-style");
- setColor(color);
- $('ul > li', panel).removeClass("current");
- $(this).addClass("current");
- });
- $('.layout-option,.header-option, .sidebar-option, .footer-option, .sidebar-pos-option, .nav-pos-direction', panel).change(_setLayout);
- if (getCookie('style_color') != undefined) {
- setColor(getCookie('style_color'));
- }
- $('.language-option', panel).change(function(){
- var languageOption = $('.language-option', panel).val();
- setCookie('language-option', languageOption);
- window.location.reload();
- });
- }
- var dealResetLayout = function () {
- $("body").
- removeClass("page-boxed").
- removeClass("page-footer-fixed").
- removeClass("page-sidebar-fixed").
- removeClass("page-header-fixed").
- removeClass("page-sidebar-reversed");
- $('.header > .header-inner').removeClass("container");
- if ($('.page-container').parent(".container").size() === 1) {
- $('.page-container').insertAfter('body > .clearfix');
- }
- if ($('.footer > .container').size() === 1) {
- $('.footer').html($('.footer > .container').html());
- } else if ($('.footer').parent(".container").size() === 1) {
- $('.footer').insertAfter('.page-container');
- }
- $('body > .container').remove();
- }
- /*
- * 此方法在客户端初始化和设置面板上选择菜单方向的时候用。
- * param navPosOption
- */
- var dealNavPos = function(navPosOption) {
- // 横竖边栏切换功能禁用,则返回
- var panel = $('.zte-theme-panel');
- if ($('.nav-pos-direction', panel).attr("disabled") == "disabled") {
- return;
- }
- var sidermenu = $("#page-sidebar-menu");
- var hormenu = $("#main_hormenu");
- var sidermenu = $("#page-sidebar-menu");
- var hormenu = $("#main_hormenu");
- var horSiderMenu = $('#' + megaSiderDivId );
- var fhorMenu = $("#" + fMenuMegaDivId);
- var fsiderMenu = $("#" + fMenuSiderDivId);
- var pcontent = $("[class='page-content']");
- if (sidermenu && sidermenu.length > 0 && hormenu && hormenu.length > 0 && fhorMenu && fhorMenu.length > 0) {
- if (navPosOption === openoFrameWork_menu_horizontal) {
- sidermenu.css('display','none');// 侧边栏隐藏
- fhorMenu.css('display','none');
- fsiderMenu.css('display','none');
- pcontent.css("marginLeft",0);
- $("body").addClass("page-full-width");//调整内容显示
- hormenu.css("display", "block");//显示水平菜单栏
- // 导航位置为水平菜单时,边栏和边栏位置为默认和靠左,且将其切换功能禁用掉
- $('.sidebar-option', panel).val("default");
- $('.sidebar-option', panel).attr("disabled", true);
- $('.sidebar-pos-option', panel).val("left");
- $('.sidebar-pos-option', panel).attr("disabled", true);
- } else if (navPosOption === openoFrameWork_menu_vertical ) {
- $("body").removeClass("page-full-width");
- sidermenu.css('display','block');//侧边栏显示
- var body = $('body');
- if (body.hasClass("page-sidebar-closed")) {
- pcontent.css("marginLeft", _sidebarCollapsedWidth);
- } else {
- pcontent.css("marginLeft", _sidebarWidth);
- }
- hormenu.css("display", "none");//隐藏水平菜单栏
- fhorMenu.css('display','none');
- fsiderMenu.css('display','none');
- horSiderMenu.css('display','none');
- $('.sidebar-option', panel).attr("disabled", false);
- $('.sidebar-pos-option', panel).attr("disabled", false);
- } else if(navPosOption === openoFrameWork_menu_fmenu ){
- sidermenu.css('display','none');// 侧边栏隐藏
- hormenu.css("display", "none");//隐藏水平菜单栏
- fsiderMenu.css('display','none');
- fhorMenu.css('display','block');
- pcontent.css("marginLeft",0);
- $("body").addClass("page-full-width");//调整内容显示
- // 导航位置为水平菜单时,边栏和边栏位置为默认和靠左,且将其切换功能禁用掉
- $('.sidebar-option', panel).val("default");
- $('.sidebar-option', panel).attr("disabled", true);
- $('.sidebar-pos-option', panel).val("left");
- $('.sidebar-pos-option', panel).attr("disabled", true);
- }
- }
- }
- var dealSetLayout = function(){
- var panel = $('.zte-theme-panel');
- var layoutOption = $('.layout-option', panel).val();
- var languageOption = $('.language-option', panel).val();
- var headerOption = $('.header-option', panel).val();
- var footerOption = $('.footer-option', panel).val();
- var navPosOption = $('.nav-pos-direction', panel).val();
- dealNavPos(navPosOption);
- var sidebarOption = $('.sidebar-option', panel).val();
- var sidebarPosOption = $('.sidebar-pos-option', panel).val();
- if (sidebarOption == "fixed" && headerOption == "default") {
- alert($.i18n.prop('com_zte_ums_ict_framework_ui_fixedsidedefaultheaderError')); //页头不支持固定边栏,先固定页头才能固定边栏.
- $('.header-option', panel).val("fixed");
- $('.sidebar-option', panel).val("fixed");
- sidebarOption = 'fixed';
- headerOption = 'fixed';
- }
- if (sidebarOption == "fixed" && sidebarPosOption == "right") {
- alert($.i18n.prop('com_zte_ums_ict_framework_ui_fixedsiderightpositionError')); //固定边栏情况下,边栏不能靠右。.
- $('.sidebar-pos-option', panel).val("left");
- sidebarPosOption = 'left';
- }
- dealResetLayout(); // reset layout to default state
- if (layoutOption === "boxed") {
- $("body").addClass("page-boxed");
- // set header
- $('.header > .header-inner').addClass("container");
- var cont = $('body > .clearfix').after('<div class="container"></div>');
- // set content
- $('.page-container').appendTo('body > .container');
- // set footer
- if (footerOption === 'fixed') {
- $('.footer').html('<div class="container">' + $('.footer').html() + '</div>');
- } else {
- $('.footer').appendTo('body > .container');
- }
- }
- if (lastSelectedLayout != layoutOption) {
- runResponsiveHandlers();
- }
- lastSelectedLayout = layoutOption;
- //header
- if (headerOption === 'fixed') {
- $("body").addClass("page-header-fixed");
- $(".header").removeClass("navbar-static-top").addClass("navbar-fixed-top");
- } else {
- $("body").removeClass("page-header-fixed");
- $(".header").removeClass("navbar-fixed-top").addClass("navbar-static-top");
- }
- //sidebar
- if ($('body').hasClass('page-full-width') === false) {
- if (sidebarOption === 'fixed') {
- $("body").addClass("page-sidebar-fixed");
- } else {
- $("body").removeClass("page-sidebar-fixed");
- }
- }
- //footer
- if (footerOption === 'fixed') {
- $("body").addClass("page-footer-fixed");
- } else {
- $("body").removeClass("page-footer-fixed");
- }
- //sidebar position
- if (openoFrameWork.isRTL()) {
- if (sidebarPosOption === 'left') {
- $("body").addClass("page-sidebar-reversed");
- $('#frontend-link').tooltip('destroy').tooltip({placement: 'right'});
- } else {
- var pcontent = $("[class='page-content']");
- pcontent.css("marginLeft",0);//侧边栏靠右,则左边内容填充为0
- $("body").removeClass("page-sidebar-reversed");
- $('#frontend-link').tooltip('destroy').tooltip({placement: 'left'});
- }
- } else {
- if (sidebarPosOption === 'right') {
- var pcontent = $("[class='page-content']");
- pcontent.css("marginLeft",0);//侧边栏靠右,则左边内容填充为0
- $("body").addClass("page-sidebar-reversed");
- $('#frontend-link').tooltip('destroy').tooltip({placement: 'left'});
- } else {
- $("body").removeClass("page-sidebar-reversed");
- $('#frontend-link').tooltip('destroy').tooltip({placement: 'right'});
- }
- }
- dealSidebarAndContentHeight();
- dealFixedSidebar();
- dealFixedSidebarHoverable();
- dealSiderBarWidthChange();
- setCookie('layout-option', layoutOption);
- setCookie('language-option', languageOption);
- setCookie('header-option', headerOption);
- setCookie('sidebar-option', sidebarOption);
- setCookie('sidebar-pos-option', sidebarPosOption);
- setCookie('nav-pos-direction', navPosOption);
- }
- var setCookie = function (key, value) {
- if (store) {
- store(key, value);
- }
- }
- var getCookie = function (key) {
- if (store) {
- return store(key);
- } else {
- return undefined;
- }
- }
- /*下面处理前进后退和锚点访问*/
- var _getLocationHash = function() {
- return location.hash.replace("#_", "");
- }
- /*统一入口设置锚点*/
- var _setLocationHash = function(menuItemID) {
- location.hash = getLocationHashByMenuId(menuItemID);
- }
- var getLocationHashByMenuId = function(menuItemID){
- return "#_" + menuItemID;
- }
- // hash control
- var loadCurrentHash = function(e,data){
- var locationhash = _getLocationHash(); //important
- if(!!locationhash&&locationhash.length>0){
- if(_hashSource.trim()=="dhByInterface"){
- _hashSource="";
- }else{
- processChangedHash(locationhash,data);
- }
- }
- }
- // hash control 这种写法安全点
- var processChangedHash = function(path) {
- var id = path;
- var action = undefined;
- var spIndex = path.indexOf("/");
- if(spIndex != -1) {
- id = path.substring(0,spIndex);
- action = path.substring(spIndex+1);
- }
- openoFrameWork.goToURLByIDAndNewAction(id,action);
- }
- var syncColorCSS=function(){//注册皮肤切换事件处理函数,处理iframe中的皮肤切换
- var pagemyIframe=null;
- if (cachedIframes.count()>0) {
- for (var i in cachedIframes.hash()) {
- pagemyIframe=$('.page-content .page-content-body .'+i);
- if(pagemyIframe&&pagemyIframe.length>0){
- openoFrameWork.SyncCSS(pagemyIframe[0],1,"");
- }
- }
- }
- }
- var getCurrentVisibleIframe=function(){
- var pagemyIframe=null;
- if (cachedIframes.count()>0) {
- for (var i in cachedIframes.hash()) {
- if(cachedIframes.items(i)===1){
- pagemyIframe=$('.page-content .page-content-body .'+i);
- }
- }
- }
- return pagemyIframe;
- }
- //处理跨域请求代理,通过该代理进行iframe间传递参数,注意这里的代理页面proxy.html必须部署到要跨域的对端域的服务器web根目录下
- var dealCrossProxy=function(ifrm,crossproxysrc,ifmHeadlins,flag){//crossproxysrc这个是proxy.html对应的url根路径
- var url=$.url(openoFrameWork.getCurrentScript(document));
- var proxyHtmlPath=url.attr("directory")+"proxy/proxy.html"//这中情况适用于使用了该界面集成框架的应用系统
- var _ifmProxy=$('<iframe id="ifm_Proxy" name="ifm_Proxy" oldproxyorigin="'+crossproxysrc+'" src="'+crossproxysrc+proxyHtmlPath+'" style="border: 0px; margin: 0px; padding: 0px; width: 100%; display:none;" ></iframe>');
- var _ifm=$('#ifm_Proxy');
- _ifm.hide();
- var pageContentBody=$('.page-content .page-content-body');
- var linksrcs=new Array();
- var linksids=new Array();
- var linktyps=new Array();
- var _src="";
- for (i=0;i<ifmHeadlins.length;i++){
- if(typeof ifmHeadlins[i].link.href!== "undefined"){
- _src=ifmHeadlins[i].link.href;
- linktyps.push("css");
- }
- else if(typeof ifmHeadlins[i].link.src!== "undefined"){
- if(!!ifmHeadlins[i].link.src&&ifmHeadlins[i].link.src.length>0){
- _src=ifmHeadlins[i].link.src;
- linktyps.push("javascriptfile");
- }else{
- _src=ifmHeadlins[i].link.text;
- linktyps.push("javascripttext");
- }
- }else{
- linktyps.push("undefined");
- }
- linksrcs.push(_src);
- linksids.push({"pos":ifmHeadlins[i].pos,"scope":ifmHeadlins[i].scope,"id":ifmHeadlins[i].link.id});
- }
- var parm={iFrame:ifrm,cssLinktyps:linktyps,cssLinksrcs:linksrcs,cssLinkids:linksids,origin:crossproxysrc,flag:flag};
- if(_ifm&&_ifm.length<=0){//没有添加过
- _ifmProxy.appendTo(pageContentBody);
- _ifmProxy.one('load',parm,function(e){
- var data={iFrame:e.data.iFrame,cssLinktyps:e.data.cssLinktyps,cssLinksrcs:e.data.cssLinksrcs,cssLinkids:e.data.cssLinkids,flag:flag};
- $('#ifm_Proxy')[0].contentWindow.postMessage(data,e.data.origin);//window.location.origin
- });
- }else if(_ifm.attr("oldproxyorigin")!=crossproxysrc){//代理已经添加过了,看是否是同一个网站的代理,如果不是需要重新加载
- _ifm.attr("src","");
- _ifm.attr("oldproxyorigin",crossproxysrc);
- _ifm.one('load',parm,function(e){
- var data={iFrame:e.data.iFrame,cssLinktyps:e.data.cssLinktyps,cssLinksrcs:e.data.cssLinksrcs,cssLinkids:e.data.cssLinkids,flag:flag};
- $('#ifm_Proxy')[0].contentWindow.postMessage(data,e.data.origin);//window.location.origin
- });
- _ifm.attr("src",_ifmProxy.attr("src"));
- }else{//已经添加过,直接触发消息发送即可
- var data={iFrame:parm.iFrame,cssLinktyps:parm.cssLinktyps,cssLinksrcs:parm.cssLinksrcs,cssLinkids:parm.cssLinkids,flag:flag};
- _ifm[0].contentWindow.postMessage(data,parm.origin);//window.location.origin
- }
- }
- return {
- init: function () {
- if(zte_http_headers){
- store("zte_http_headers",zte_http_headers);
- }
- dealInit();
- dealResponsiveOnResize();
- dealResponsiveOnInit();
- dealClearCachedIframes(true); ////清理当前正在显示的iframe之外缓存的iframe,
- breadcrumbBtnMenus.clear();
- dealFixedSidebar(); // deals fixed sidebar menu
- dealFixedSidebarHoverable(); // deals fixed sidebar on hover effect
- dealSidebarMenu(); // deals main menu
- dealHorizontalMenu(); // deals horizontal menu
- dealSidebarToggler(); // deals sidebar hide/show
- dealTheme(); // deals style customer tool
- dealSetLayout();
- $(function() {
- $(window).on('hashchange',function(){
- loadCurrentHash();
- });
- });
- dealFullScreenMode(); // deals full screen
- $("#header_dropdown_user").css('display','block');
- $("#com_zte_ums_ict_framework_img_netnumenLogo").css('display','inline');
- $("#com_zte_ums_ict_framework_ui_main_title").css('display','inline');
- handeCtxMenuitem();
- },
- //公开清理缓存的所有Iframe的方法:isALL==true则清理所有,否则清理当前正在显示的iframe之外缓存的iframe,。
- clearCachedIframes:function(isAll){
- dealClearCachedIframes(isAll);
- },
-
- setBaseURLRoot:function(ipportStr){//菜单url的跟ip和端口例如:http://10.74.151.122:21180
- if (store) {
- store('baseURLRoot', ipportStr);
- }
- var url = $.url(ipportStr);
- location.hash=url.attr('fragment');
- var auth=url.attr('query');
- if (store) {
- store('baseURLRootAuth', auth);
- }
- },
- getBaseURLRoot:function(ipportStr){//菜单url的跟ip和端口例如:http://10.74.151.122:21180
- var rooturl="";
- if (store) {
- rooturl=store('baseURLRoot');
- }
- return !rooturl?"":rooturl;
- },
- clearBaseURLRoot:function(){//菜单url的跟ip和端口例如:http://10.74.151.122:21180
- if (store) {
- store('baseURLRoot', "",-1);
- }
- },
- setPageTitle:function(title){//设置页面标题
- $('title').html(title+" - "+gdocTitle);
- },
- getLanguage:function(){//获取语言
- return openoFrameWork_conf.acceptLanguage;
- },
-
- getLocationHash:function(){
- return _getLocationHash();
- },
- setSceneURLRootPath:function(sceneURLRootPath){
- if(sceneURLRootPath&&sceneURLRootPath.trim().length>0){//如果定义了场景的全局参数
- _sceneURLRootPath=sceneURLRootPath.trim();
- if(_sceneURLRootPath.charAt(_sceneURLRootPath.length-1)!='/')
- {
- _sceneURLRootPath=_sceneURLRootPath+'/';
- }
- }
- },
- //public function to add callback a function which will be called on window resize
- addResponsiveHandler: function (func) {
- responsiveHandlers.push(func);
- },
-
- hiddenAlarmLight:function(){
- hideAlarmLight();
- },
-
- hiddenMenu:function(){
- hidemenu();
- },
- setBreadcrumbByMenuID:function(id){
- //var breaditem=$('#'+id);
- var menuitem=undefined;
- // var items=$("a[id='"+id+"']");
- var items = undefined;
- var panel = $('.zte-theme-panel');
- var navPosOption = $('.nav-pos-direction', panel).val();
- if (navPosOption === "vertical"){ //从垂直菜单里面找
- items=$("#page-sidebar-menu a[id='"+id+"']");
- if (!items || items.length < 1) {
- items=$(".page-content a[id='"+id+"']");
- }
- }else if(navPosOption === openoFrameWork_menu_horizontal){//从水平菜单里面找
- items=$("#main_hormenu a[id='"+id+"']");
- if(items.length == 0){
- //横菜单没有找到,再在横菜单的子菜单找一次
- items=$("#page-megachild-sidebar-menu a[id='"+id+"']");
- }
- }else if(navPosOption === openoFrameWork_menu_fmenu){
- items=$("#f_hormenu a[id='"+id+"']");
- if(items.length == 0){
- //横菜单没有找到,再在竖菜单找一次。
- items=$("#page-f-sidebar-menu a[id='"+id+"']");
- }
- }
- var isbreadcrumbMenuItem=false;
- if(items.length>0){
- for(var i=0;i<items.length;i++){
- if($(items[i]).parentsUntil('.header-inner').hasClass('hor-menu')){
- menuitem=$(items[i]);
- break;
- }else if($(items[i]).parentsUntil('.page-container').hasClass('page-sidebar')){
- menuitem=$(items[i]);
- break;
- }else if($(items[i]).parentsUntil('.more-botton-zone .btn-group').hasClass('dropdown-menu')){
- menuitem=$(items[i]);
- isbreadcrumbMenuItem=true;
- break;
- }else if($(items[i]).parentsUntil('#pageableDiv').hasClass('row1')){
- menuitem=$(items[i]);
- isbreadcrumbMenuItem=true;
- break;
- }
- }
- }
-
- if(menuitem&&menuitem.length>0){
- if(isbreadcrumbMenuItem){
- dealBreadcrumbBtnGroupMenus(menuitem,false);
- }else{
- dealBreadcrumb(menuitem,true,null);
- }
- }else{
- var breadcrumbBtnMenuItemParent="";
- if(!menuitem||menuitem.length<=0){//没有找到该菜单,可能是面包削中的,需要额外处理
- var menuItemID=id;
- if (breadcrumbBtnMenus.contains(menuItemID)) {//有缓存
- breadcrumbBtnMenuItemParent="#"+breadcrumbBtnMenus.items(menuItemID);
- menuitem=$(breadcrumbBtnMenuItemParent);
- //_breadcrumbSource=true;
- }
- }
- var parm=undefined;
- if(breadcrumbBtnMenuItemParent&&breadcrumbBtnMenuItemParent.length>0){
- parm={breadcrumbBtnMenuItem:menuItemID};
- }
- if(parm&&menuitem&&menuitem.length>0) {
- dealBreadcrumb(menuitem,true,parm);
- }
- }
- },
- setSiderbarCollapseWidth:function(width){
- _sidebarCollapsedWidth = width;
- },
- getSiderbarCollapseWidth:function(){
- return _sidebarCollapsedWidth;
- },
- setSidebarWidth:function(width){
- _sidebarWidth = width;
- },
- getSidebarWidth:function(){
- return _sidebarWidth;
- },
- //2015年10月26日新增动态切换菜单的功能,这里的菜单还需要再次更换菜单项访问的ip端口信息
- handlBaseURL:function(url){
- var baseURLRoot=openoFrameWork.getBaseURLRoot();
- if (baseURLRoot.length>0) {//2015年10月26日新增动态切换菜单的功能,这里的菜单还需要再次更换菜单项访问的ip端口信息
- baseURLRoot=openoFrameWork.getDomainURL(baseURLRoot);//去掉ip和port后多余的部分
- console.log("old a link href url:"+url);
- url=baseURLRoot+url.replace(openoFrameWork.getDomainURL(url),"");
- console.log("baseURLRoot:"+baseURLRoot+" newURL:"+url);
- };
- return url;
- },
-
- startPageLoading: function(message) {
- dealstartPageLoading(message);
- },
- stopPageLoading: function() {
- dealstopPageLoading();
- },
- //public function to get a paremeter by name from URL
- getLocationURLParameter: function (paramName,separator) {
- var searchString = decodeURIComponent(window.location.search.substring(1)).toLowerCase(),
- i, val, params = searchString.split(separator?separator:"&");
- paramName=paramName.toLowerCase();
- for (i = 0; i < params.length; i++) {
- val = params[i].split("=");
- if (val[0] == paramName) {
- return unescape(val[1]);
- }
- }
- return null;
- },
- //public function to get a paremeter by name from URL
- getURLParameter: function (paramName,url) {
- var searchString = decodeURIComponent(url).toLowerCase(),
- i, val, params = searchString.split("&");
- paramName=paramName.toLowerCase();
- for (i = 0; i < params.length; i++) {
- val = params[i].split("=");
- if (val[0] == paramName) {
- return unescape(val[1]);
- }
- }
- return null;
- },
- // check for device touch support
- isTouchDevice: function () {
- return isTouch;
- },
- getUniqueID: function(prefix) {
- return prefix+'_' + Math.floor(Math.random() * (new Date()).getTime());
- },
- // check IE8 mode
- isIE8: function () {
- return isIE8;
- },
- // check IE9 mode
- isIE9: function () {
- return isIE9;
- },
- //check RTL mode
- isRTL: function () {
- return isRTL;
- },
- getViewPort:function(){
- return _getViewPort();
- },
- // get layout color code by color name
- getLayoutColorCode: function (name) {
- if (layoutColorCodes[name]) {
- return layoutColorCodes[name];
- } else {
- return '';
- }
- } ,
- fixContentHeight: function () {
- dealSidebarAndContentHeight();
- },
- dealAtoIframe:function(aObj,event){
- var containerStr=aObj.parentsUntil('.page-container').hasClass('page-sidebar')?'page-sidebar':"";//
- containerStr=aObj.parentsUntil('.header-inner').hasClass('hor-menu')?'header':containerStr;
- dealMenuItemClick(aObj,event,containerStr);
- _isClicked=false;
- },
- getDomainURL:function(urlAddress){
- var url = $.url(urlAddress);
- var protocol=url.attr('protocol');
- var host=url.attr('host');
- var port=url.attr('port');
- var crossOrign=protocol+"://"+host+(port.length>0?":"+port:"");
- return crossOrign;
- },
- getCurrentScript:function(doc) {//doc为 document对象
- /* 注意该功能在其他脚本中调用时出safari获取到的脚本路径为本方法所在脚本的路径,
- 其他浏览器获取到的为调用该方法的脚本所在路径
- 取得正在解析的script节点
- */
- if(doc&&doc.currentScript) { //firefox 4+
- console.log("0、 "+doc.currentScript.src);
- return doc.currentScript.src;
- }
- // 参考 https://github.com/samyk/jiagra/blob/master/jiagra.js
- var stack;
- try {
- a.b.c(); //强制报错,以便捕获e.stack
- } catch(e) {//safari的错误对象只有line,sourceId 或者高版本还有sourceURL
- stack = e.stack;
- if(e.sourceURL){//safari 浏览器没有e.stack但有e.sourceURL
- stack=e.sourceURL;
- }else if(!stack && window.opera){
- //opera 9没有e.stack,但有e.Backtrace,但不能直接取得,需要对e对象转字符串进行抽取
- stack = (String(e).match(/of linked script \S+/g) || []).join(" ");
- }
- console.log("1、 "+stack);
- }
- if(stack) {
- /*e.stack最后一行在所有支持的浏览器大致如下:
- *chrome23:
- * at http://113.93.50.63/data.js:4:1
- *firefox17:
- *@http://113.93.50.63/query.js:4
- *opera12:
- *@http://113.93.50.63/data.js:4
- *IE10:
- * at Global code (http://113.93.50.63/data.js:4:1)
- */
- console.log("2、 "+stack);
- stack = stack.split( /[@ ]/g).pop();//取得最后一行,最后一个空格或@之后的部分
- stack = stack[0] == "(" ? stack.slice(1,-1) : stack;
- console.log("3、 "+stack);
- return stack.replace(/(:\d+)?:\d+$/i, "");//去掉行号与或许存在的出错字符起始位置
- }
- if(doc){
- var nodes = doc.getElementsByTagName("script"); //只在head标签中寻找
- for(var i = 0, node; node = nodes[i++];) {
- if(node.readyState === "interactive") {
- console.log("4、 "+(node.className = node.src));
- return node.className = node.src;
- }
- }
- }
- },
- /*下面的flag为0表示默认不触发孙子iframe中的onload事件,为1表示要触发,flag为10则对cssSrc重复执行,其他不做重复执行*/
- SyncCSS:function(ifrm,flag,cssSrc){//将主框架中的皮肤css应用到打开的iframe页面中
- if(!ifrm)return;
- var ifmHeadlins = new Array();
- if(cssSrc&&cssSrc.length>0&&cssSrc.endWith(".css")){
- var _div = $('<a href="'+cssSrc+'"></a>');
- var csslink=document.createElement("link");
- csslink.href=_div[0].href;//这里同步菜单定义中cssSrc属性指定的css文件到iframe
- _div = null;
- csslink.rel="stylesheet";
- csslink.type="text/css";
- csslink.id="ifram_csssrc";
- ifmHeadlins.push({"pos":"head","scope":"all","link":csslink});//pos是添加到子iframe中的位置,scope是子窗体作用返回,one表示直接子窗体,all表示嵌套所有子窗体
- }
- if(flag!=10){//当flag为10时下面的css和js都不执行
- if($('#style_color').length>0){
- var csslink=document.createElement("link");
- csslink.href=$('#style_color')[0].href.replace(".css","_ifrm.css");//这里同步的皮肤页面修改为原皮肤页面文件名后缀添加ifrm的css皮肤文件
- csslink.rel="stylesheet";
- csslink.type="text/css";
- csslink.id="style_color";
- ifmHeadlins.push({"pos":"head","scope":"all","link":csslink});//pos是添加到子iframe中的位置,scope是子窗体作用返回,one表示直接子窗体,all表示嵌套所有子窗体
- }
- // 将 font-awesome字体图标应用到模块iframe
- if($('#font_awesome').length>0){
- var awesomelink=document.createElement("link");
- awesomelink.href=$('#font_awesome')[0].href;
- awesomelink.rel="stylesheet";
- awesomelink.type="text/css";
- awesomelink.id="font_awesome";
- ifmHeadlins.push({"pos":"head","scope":"all","link":awesomelink});
- }
- // 将pym.js or pym.min.js应用到模块iframe
- var pymjsObj=$("script[src*='/pym.']");//模糊查找
- pymjsObj=pymjsObj.length>0?pymjsObj:$("script[src*='/pym1.']");
- if(pymjsObj.length>0){
- var pymjs=document.createElement("script");
- pymjs.src=pymjsObj[0].src;
- pymjs.type="text/javascript";
- pymjs.id=!!pymjsObj[0].id?pymjsObj[0].id:"pymjs";
- ifmHeadlins.push({"pos":"head","scope":"one","link":pymjs});
- pymjs=document.createElement("script"); //pym脚本文件加载后要执行new pym.Child()进行iframe子窗体实例化,便于子窗体和父窗体通讯new pym.Child({ id: '"+_iframe+"' ,polling: 1000})
- var frameid=(_iframe.split('-').length>0?_iframe.split('-')[1]:"1");
- pymjs.text="var t1;function pmchd(){console.log('In the frame "+_iframe+",pym code call is begining; '+(typeof pym!= 'undefined'));if(typeof pym != 'undefined'){pymChild"+frameid+" = new pym.Child({ id: 'pdiv_"+_iframe+"' ,polling: 500});window.clearInterval(t1); }};t1 = window.setInterval(pmchd,5);";
- pymjs.type="text/javascript";
- pymjs.id="pymChild";
- ifmHeadlins.push({"pos":"htmlend","scope":"one","link":pymjs});
- }
- // 将hk.js or hk.min.js应用到模块iframe
- var hkjsObj=$("script[src*='/hk.']");//模糊查找
- hkjsObj=hkjsObj.length>0?hkjsObj:$("script[src*='/hk1.']");
- if(hkjsObj.length>0){
- var hkjs=document.createElement("script");
- hkjs.src=hkjsObj[0].src;
- hkjs.type="text/javascript";
- hkjs.id=!!hkjsObj[0].id?hkjsObj[0].id:"hkjs";
- ifmHeadlins.push({"pos":"head","scope":"one","link":hkjs});
- hkjs=document.createElement("script"); ////hk.js 加载后拦截ajax请求进行转发
- }
- }
- var crossOrign=openoFrameWork.getDomainURL(ifrm.src);
- if( window.location.origin==crossOrign){ //第一层同域处理
- for (i=0;i<ifmHeadlins.length;i++){
- var link=ifrm.contentDocument.getElementById(ifmHeadlins[i].link.id);
- if(link){
- if(link.parentNode.tagName.toUpperCase==="HEAD"){
- ifrm.contentDocument.head.removeChild(link);
- }else if(link.parentNode.tagName.toUpperCase==="HTML"){
- ifrm.contentDocument.removeChild(link);
- }
- }
- if(ifmHeadlins[i].pos=="head")
- ifrm.contentDocument.head.appendChild(ifmHeadlins[i].link);
- else if (ifmHeadlins[i].pos=="bodyend")
- ifrm.contentDocument.body.appendChild(ifmHeadlins[i].link);
- else if (ifmHeadlins[i].pos=="htmlend")
- ifrm.contentDocument.body.parentNode.appendChild(ifmHeadlins[i].link);
- }
- //对iframe中又有嵌套一级iframe的地方进行同步,只同步scope为all的
- var childifrms=ifrm.contentDocument.getElementsByTagName("iframe");
- if(childifrms&&childifrms.length>0){
- var ifmHeadlins2 = new Array();
- for (i=0;i<ifmHeadlins.length;i++){//筛选出scope为all的
- if(ifmHeadlins[i].scope=="one") break;
- ifmHeadlins2.push(ifmHeadlins[i]);
- }
- for(j=0;j<childifrms.length;j++){
- var parm={ifmHeadlins:ifmHeadlins2};
- var childOrign=openoFrameWork.getDomainURL(childifrms[j].src);
- if(window.location.origin==childOrign){//同域
- var ifrmload=function(e){
- for (i=0;i<e.data.ifmHeadlins.length;i++){
- var ifmheadlink=$(e.data.ifmHeadlins[i].link).clone()[0];////注意这里必须克隆,否则会出现元素移动,前面ifrm添加的都会被移出
- var link=this.contentDocument.getElementById(ifmheadlink.id);
- if(link){
- if(link.parentNode.tagName.toUpperCase==="HEAD"){
- this.contentDocument.head.removeChild(link);
- }else if(link.parentNode.tagName.toUpperCase==="HTML"){
- this.contentDocument.removeChild(link);
- }
- }
- if(e.data.ifmHeadlins[i].pos=="head"){
- this.contentDocument.head.appendChild(ifmheadlink);
- }else if(e.data.ifmHeadlins[i].pos=="bodyend"){
- this.contentDocument.body.appendChild(ifmheadlink);
- }else if (ifmHeadlins2[i].pos=="htmlend"){
- this.contentDocument.body.parentNode.appendChild(ifmheadlink);
- }
- }
- }
- $(childifrms[j]).off('onload',parm,ifrmload);
- $(childifrms[j]).on('onload',parm,ifrmload);
- $(childifrms[j]).trigger("onload");
-
- }else{
- if(ifmHeadlins2.length>0){
- console.log('跨域访问: 系统将进入跨域访问代理处理流程 ');
- dealCrossProxy(childifrms[j].name,childOrign,ifmHeadlins2,flag);
- }
- }
- }
- }
- }else{
- if(ifmHeadlins.length>0){
- console.log('跨域访问: 系统将进入跨域访问代理处理流程 ');
- dealCrossProxy(ifrm.name,crossOrign,ifmHeadlins,flag);
- }
- }
- },
- goToURL:function(url){
- dhByBreadcrumb = true;//全局变量,声明此次事件是由点击面包屑发起的
- var showNav=openoFrameWork.getLocationURLParameter('showNav');
- if(showNav=="false"){//如果不显示菜单,就强制刷新本页
- location.reload();
- }else{
- url="a[name='"+url+"']";
- $(url).click();
- }
- },
- goToURLByName:function(name){
- var showNav=openoFrameWork.getLocationURLParameter('showNav');
- if(showNav=="false"){//如果不显示菜单,就强制刷新本页
- location.reload();
- }else{
- url="a[name='"+name+"']";
- $(url).click();
- }
- },
- goToURLByID:function(id){
- if(!id){
- return;
- }
- var showNav=openoFrameWork.getLocationURLParameter('showNav');
- if(showNav=="false"){//如果不显示菜单,就强制刷新本页
- location.reload();
- }else{
- if(id.indexOf("#")<0){
- id="#"+id;
- }
- $(id).click();
- }
- },
- goToPortal:function(id){
- var _url=top.location.href;
- console.log(_url);
- //_url="/ngict/iui/framework/";
- var url=$.url(_url);
- top.location=url.attr("directory")+"uifportal.html#"+id+"/";
- },
- //Category
- goToURLByIDAndNewIPPort:function(id,newIPPort,newActionStr){
- //先把NewIPPort对象:newIPPort={menuCategoryID:'vim',ipPortStr:'htpp://10.74.151.123:31180',newTitle:''}缓存到Category数组中,
- //menuCategoryID属性是更多菜单上配置的菜单的分类id,;
- //ipPortStr属性是该id的菜单要替换的新的ip和端口地址字符串,包括协议部分,比如http://10.74.151.64:21169
- //newTitle属性用于放置新开ip的页面对应到面包屑上的名字,可以为“”,空标识不关注
- _menuCategorys.replace(newIPPort.menuCategoryID,{ipPort:newIPPort.ipPortStr,ipTitle:newIPPort.newTitle});//把当前面包削中的菜单id和该子菜单对应的父菜单关联缓存起来
- if (store) {
- store('menuCategoryID', newIPPort.menuCategoryID+"[menuCategoryID]"+newIPPort.ipPortStr+"[menuCategoryID]"+(!!newIPPort.newTitle?newIPPort.newTitle:""));
- }
- //这里增加按照newIPPort.menuCategoryID分类加载more菜单的处理逻辑
- //首先根据id找到对应的主菜单菜单项
- var menuitem = this.findMenuItemByMenuId(id);
- if(!menuitem||menuitem.length<=0){//主菜单中没有找到,就找more菜单,找到id对应的more菜单项所属的主菜单项
- var mainMenuId = this.getMenuItemId_From_MoreMenuRelation(id);
- if( !!mainMenuId&&mainMenuId.length>0 ){//more菜单中找到了id对应的主菜单项id,根据id返回主菜单项
- menuitem = this.findMenuItemByMenuId(mainMenuId);
- if(!!menuitem&&menuitem.length>0){
- var more=$("#"+id,$('#pageableDiv')).parent();
- $(".box.boxOperation", $(".carousel-inner")).removeClass("moreButtonSelected");
- more=$('a>div.box',more);
- if (more.hasClass('moreButtonSelected') == false){
- more.addClass('moreButtonSelected');
- }
- var pagesTags=$('.item.moreButtonsTag');
- if(pagesTags.length>0){
- for(var i=0;i<pagesTags.length;i++){
- var tags=$(pagesTags[i]);
- tags.removeClass('active');
- if($('.moreButtonSelected',tags).length>0){
- tags.addClass('active');
- }
- }
- }
- }
- }
- }
- //其次找到的菜单项中newIPPort.menuCategoryID对应的src覆盖breadcrumgroupbuttonsrc属性值,
- if(!!menuitem&&menuitem.length>0){
- var mulsrc=menuitem.attr(newIPPort.menuCategoryID+"-multiInsrc");
- if(!!mulsrc){
- menuitem.attr("breadcrumgroupbuttonsrc" ,mulsrc);
- getBreadcrumbRightButtons(mulsrc,true);
- }
- }
- if (waittime) {
- clearInterval(waittime);
- }
- waittime = setInterval(function () {
- if(moreMenusisLoaded==true){
- clearInterval(waittime);
- openoFrameWork.goToURLByIDAndNewAction(id,newActionStr,null);
- }
- }, 10);
- },
- goToURLByIDAndNewAction:function(id,newActionStr,newBrowserPageOption){
- if(!id){
- return;
- }
-
- /*if(id.indexOf("#")<0){
- id="#"+id;
- }*/
- var menuitem = this.findMenuItemByMenuId(id);
- //处理新开页面情况
- if(newBrowserPageOption){
- var href = ICTFRAME_CONST_DEFAULTPAGE_PATH;
- var hash = getLocationHashByMenuId(id);
- var newin=window.open(href + newBrowserPageOption.paramStr + hash,newBrowserPageOption.windowTitle);
- newin.name=newActionStr;//注意这种传递参数的方法,被打开的页面中需要通过top.name中获取该传递的参数。
- return;
- }
- //$(window).off('hashchange', loadCurrentHash);
- var menuItemID=menuitem?menuitem.attr("id"):"";
- if(!!menuItemID&&menuItemID.length>0){
- //menuItemID="#" + menuItemID;
- //menuItemID=!!newActionStr?menuItemID:menuItemID+"/no";
- _setLocationHash(menuItemID);
- }
- var breadcrumbBtnMenuItemParent="";
- if(!menuitem||menuitem.length<=0){//没有找到该菜单,可能是面包削中的,需要额外处理
- menuItemID=id;
- if (breadcrumbBtnMenus.contains(menuItemID)) {//有缓存
- breadcrumbBtnMenuItemParent=breadcrumbBtnMenus.items(menuItemID);
- menuitem=this.findMenuItemByMenuId(breadcrumbBtnMenuItemParent);
- //_breadcrumbSource=true;
- }
- // else{//在新增的可翻页的更多菜单里面找
- // var pageDiv = $('#pageableDiv');
- // menuitem=$('#' + menuItemID , pageDiv);
- // }
- if( menuitem && menuitem.length > 0){
- isMoreMenuItemClick = true;
- }
- }
- if(!menuitem||menuitem.length<=0){
- //面包屑和主菜单都没有找到,情况可能是:更多菜单点击打开后,刷新,hash已经更改,但是对应的更多菜单的html没有加载,需要找到更多菜单和主菜单的对应关系
- var mainMenuId = this.getMenuItemId_From_MoreMenuRelation( id );
- if( mainMenuId ){
- menuitem = this.findMenuItemByMenuId(mainMenuId);
- }
-
- }
- if (store&&store("globleCurrentBreadcrumb")){
- globleCurrentBreadcrumb=store("globleCurrentBreadcrumb");
- //下面处理下刷新整个页面后从cookie中获取来的最后一次操作的面包屑对应的对应菜单的name属性回写,便于面包屑事件响应能够找到对应的菜单
- var al=$("a",$("<div>"+globleCurrentBreadcrumb+"</div>"));
- var alink,gal;
- for(i=0;i<al.length;i++){
- alink=$(al[i]);
- gal=$("a[id='"+alink.attr("id")+"']");//从整个页面查找
- for(j=0;j<gal.length;j++){
- $(gal[j]).attr("name",alink.attr("name"));
- }
- }
- }
- if(menuitem&&menuitem.length>0){
- var panel = $('.zte-theme-panel');
- var navPosOption = $('.nav-pos-direction', panel).val();
- if(navPosOption === openoFrameWork_menu_fmenu){
- var hparentid=menuitem.attr("hparentid");
- var id=menuitem.attr("id");
- var i=0,menuItemH=menuitem;
- while (id!=hparentid&&i<20){
- menuItemH=openoFrameWork.findMenuItemByMenuId(hparentid);
- hparentid=menuItemH.attr("hparentid");
- id=menuItemH.attr("id");
- i++;
- };
- if(!menuItemH.hasClass('active'))
- menuItemH.parent().addClass("active");
- }
- }else{
- console.log("goToURLByIDAndNewAction():Can't find the menuitem.The menu ID is:"+id+".Please check if the ID or ID cache is correct.");
- }
- //try{
- var parm=undefined;
- if(!!newActionStr&&breadcrumbBtnMenuItemParent&&breadcrumbBtnMenuItemParent.length>0){
- parm={action:newActionStr,breadcrumbBtnMenuItem:menuItemID};
- }else if(!!newActionStr){
- parm={action:newActionStr};
- }else if(breadcrumbBtnMenuItemParent&&breadcrumbBtnMenuItemParent.length>0){
- parm={breadcrumbBtnMenuItem:menuItemID};
- }else if(mainMenuId){
- isMoreMenuItemClick = true;
- parm={breadcrumbBtnMenuItem:menuItemID};
- }
- //if(breadChangeType){
- // if(!parm){
- // parm = {};
- // }
- // parm.breadChangeType = breadChangeType;
- //}
- if(parm&&parm.action || parm&&parm.breadChangeType) {
- _hashSource="dhByInterface";
- }
-
- if(menuitem&&menuitem.length>0){
- menuitem.one('click',parm,function(e){ //临时一次性的注册一次click事件处理函数,执行完毕会自动删除
- openoFrameWork.dealAtoIframe($(this),e);
- //$(window).one('hashchange', loadCurrentHash);
- return false;
- });
- menuitem.click();//后执行
- }
- /*}catch(e){}
- finally{
- //$(window).on('hashchange', loadCurrentHash);
- }*/
- },
-
- getBreadcrumbEle:function(){
- return $('.breadcrumbUl')[0];
- },
-
-
- findMenuItemByMenuId:function( id ){
- var menuitem=undefined;
- var panel = $('.zte-theme-panel');
- var navPosOption = $('.nav-pos-direction', panel).val();
-
- var items = undefined;
- if (navPosOption === "vertical"){ //从垂直菜单里面找
- items=$("#page-sidebar-menu a[id='"+id+"']");
- }else if(navPosOption === openoFrameWork_menu_horizontal){//从水平菜单里面找
- items=$("#main_hormenu a[id='"+id+"']");
- if(items.length == 0){
- //横菜单没有找到,再在横菜单的子菜单找一次
- items=$("#page-megachild-sidebar-menu a[id='"+id+"']");
- }
- }else if(navPosOption === openoFrameWork_menu_fmenu){
- items=$("#f_hormenu a[id='"+id+"']");
- if(items.length == 0){
- //横菜单没有找到,再在竖菜单找一次。
- items=$("#page-f-sidebar-menu a[id='"+id+"']");
-
- }
-
- }
- if( items&&items.length == 0 ){
- console.log( 'fmenu alink length is :' + $("#page-f-sidebar-menu a").length );
- console.log( 'cant find menu in sidemenu、megamenu and fmenu , the menu id is ' + id );
- }
- if(items&&items.length>0){
- for(var i=0;i<items.length;i++){
- if($(items[i]).parentsUntil('.header-inner').hasClass('hor-menu')){
- menuitem=$(items[i]);
- break;
- }else if($(items[i]).parentsUntil('.page-container').hasClass('page-sidebar')){
- menuitem=$(items[i]);
- break;
- }
- }
- }
- return menuitem;
- },
-
- getMenuItemId_From_MoreMenuRelation:function( id ){
- var panel = $('.zte-theme-panel');
- var navPosOption = $('.nav-pos-direction', panel).val();
- var mainMenuId = null;
- if (navPosOption === openoFrameWork_menu_vertical){
- relationAry=sideBarMenu_to_moreMenu_frame;
- }else if(navPosOption === openoFrameWork_menu_horizontal){
- relationAry=horBarMenu_to_moreMenu_frame;
- }else if(navPosOption === openoFrameWork_menu_fmenu){
- relationAry=horBarMenu_to_moreMenu_frame;
- }
- if ( !relationAry || !id ){
- return;
- }
- for ( var i = 0 ; i < relationAry.length ; i++ ){
- var eachMain = relationAry[i];
- var moreMenuIds = eachMain.moreMenuIds;
- for ( var j = 0 ; j < moreMenuIds.length ; j++ ){
- if( moreMenuIds[j] && moreMenuIds[j] == id ){
- return eachMain.mainMenuId;
- }
- }
- }
- return null;
- },
-
- getMenuItemFoucsByID : function (id) {
- if(!id){
- return;
- }
- var menuitem=undefined;
- // var items=$("a[id='"+id+"']");
- var items = undefined;
- var panel = $('.zte-theme-panel');
- var navPosOption = $('.nav-pos-direction', panel).val();
- if (navPosOption === "vertical"){ //从垂直菜单里面找
- items=$("#page-sidebar-menu a[id='"+id+"']");
- }else if(navPosOption === openoFrameWork_menu_horizontal){//从水平菜单里面找
- items=$("#main_hormenu a[id='"+id+"']");
- if(items.length == 0){
- //横菜单没有找到,再在横菜单的子菜单找一次
- items=$("#page-megachild-sidebar-menu a[id='"+id+"']");
- }
- }else if(navPosOption === openoFrameWork_menu_fmenu){
- items=$("#f_hormenu a[id='"+id+"']");
- if(items.length == 0){
- //横菜单没有找到,再在竖菜单找一次。
- items=$("#page-f-sidebar-menu a[id='"+id+"']");
-
- }
- }
- if(items.length>0){
- for(var i=0;i<items.length;i++){
- if($(items[i]).parentsUntil('.header-inner').hasClass('hor-menu')){
- menuitem=$(items[i]);
- break;
- }else if($(items[i]).parentsUntil('.page-container').hasClass('page-sidebar')){
- menuitem=$(items[i]);
- break;
- }
- }
- }
- var breadcrumbBtnMenuItemParent="";
- if(!menuitem||menuitem.length<=0){//没有找到该菜单,可能是面包削中的,需要额外处理
- menuItemID=id;
- if (breadcrumbBtnMenus.contains(menuItemID)) {//有缓存
- breadcrumbBtnMenuItemParent="#"+breadcrumbBtnMenus.items(menuItemID);
- menuitem=$(breadcrumbBtnMenuItemParent);
- }
- }
- var parm = undefined;
- if (breadcrumbBtnMenuItemParent && breadcrumbBtnMenuItemParent.length > 0) {
- parm = {
- breadcrumbBtnMenuItem : menuItemID
- };
- }
- if (menuitem && menuitem.length > 0) {
- menuitem.one('click', parm, function (e) { //临时一次性的注册一次click事件处理函数,执行完毕会自动删除
- var containerStr = $(this).parentsUntil('.page-container').hasClass('page-sidebar') ? 'page-sidebar' : ""; //
- containerStr = $(this).parentsUntil('.header-inner').hasClass('hor-menu') ? 'header' : containerStr;
- _isClicked = false;
- dealMenuItemGetFocus($(this),e,containerStr);
- return false;
- });
- menuitem.click(); //后执行
- }
- },
- // 处理面包削中的按钮菜单增加的导航连接,显示在iframe中
- openbreadcrumbLink:function(aObject,e) {
- var url = aObject.attr("href");
- if(!url||url.length<2)
- return;
- e.preventDefault();
- dealScrollTo();
- var menuItemID=aObject.attr("id");
- if(!!menuItemID&&menuItemID.length>0){
- _setLocationHash(menuItemID);
- _hashSource="dhByInterface";
- }
- dealstartPageLoading();
- dealIframe(aObject,e);
- },
- getURLParam:function(name){
- var reg = new RegExp("(^|&)" + name.toLowerCase() + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
- var search =decodeURIComponent(location.search.substring(1)).toLowerCase();
- var r =search.match(reg); //匹配目标参数
- if (r != null) return unescape(r[2]);
- return null; //返回参数值
- }
- };
-}();
-
-//抽取html片段中任意位置的script标签(包括代码是内嵌的情况)逐个运行(不会在单个script加载不到的时候停下来)
-function runHtmlScripts(s) {
- var div = document.createElement('div');
- div.innerHTML = s;
- var scripts = div.getElementsByTagName('script');
-
- var currentRunningScriptSrcPath = {};
- $(scripts).each(function() {
- var src = this.src;
- src = openoFrameWork.handlBaseURL(src);
- if (src) {
- currentRunningScriptSrcPath[src.substring(src.lastIndexOf("/") + 1)] = src.substring(0, src.lastIndexOf("/") + 1);
- $.getScript(src);
- } else {
- $.globalEval(this.text || this.textContent || this.innerHTML || '');
- }
- });
-};
-
-function stripHtmlScripts(htmlContent) {
- var divContent = document.createElement('div');
- divContent.innerHTML = htmlContent;
- var scripts = divContent.getElementsByTagName('script');
-
- $(scripts).each(function() {
- this.src = openoFrameWork.handlBaseURL(this.src);
- this.parentNode.removeChild(this);
- });
- return divContent.innerHTML;
-};
-
-function getsiderBarMenu(url){
- if (url.length<2){
- return;
- }
- url=openoFrameWork.handlBaseURL(url);
- openoFrameWork.startPageLoading();//菜单加载中请稍候....
- var pagesidebar=$('#page-sidebar-menu');
- pagesidebar.empty();
- pagesidebar.append("<li class='sidebar-toggler-wrapper'><div class='sidebar-toggler hidden-xs hidden-sm'></div></li>");
- $.ajax({
- type: "GET",
- cache: false,
- url: url,
- dataType: "html",
- success: function (res) {
- //去除script标签以后添加到主框架以防止append方法因为加载script标签失败导致后面的代码无法运行
- //res = stripHtmlScripts(res);
- var resScriptsSriped = stripHtmlScripts(res);
- pagesidebar.append(resScriptsSriped);
- runHtmlScripts(res);
-
- siderBarMenuAuthentication();
- dealMysqlBackupMenu();
- //loadi18n_WebFramework_sideMenu();
- setTimeout(function () {
- openoFrameWork.stopPageLoading();
- goToHomePage();
- }, 1000);
- },
- error: function (xhr, ajaxOptions, thrownError) {
- //$('#page-sidebar-menu').append('<h4 class="nav-load-error">'+$.i18n.prop('com_zte_ums_ict_framework_ui_loadmenuerror')+'</h4>');//加载系统菜单失败!;//加载系统菜单失败!
- }
- });
-};
-var setLayoutValueByCookie = function () {
- var panel = $('.zte-theme-panel');
- if (store('layout-option') != undefined) {
- $('.layout-option', panel).val(store('layout-option'));
- }
- if (store('language-option') != undefined) {
- $('.language-option', panel).val(store('language-option'));
- }
- if (store('sidebar-option') != undefined) {
- $('.sidebar-option', panel).val(store('sidebar-option'));
- }
- if (store('header-option') != undefined) {
- $('.header-option', panel).val(store('header-option'));
- }
- if (store('sidebar-pos-option') != undefined) {
- $('.sidebar-pos-option', panel).val(store('sidebar-pos-option'));
- }
- var horMenuLoadTip = $("[class='nav-load-error']", $(".hormenu"));
- var sideMenuLoadTip = $("[class='nav-load-error']", $("[class='page-sidebar-menu']"));
- // 横竖菜单都无错误提示,都正确加载
- // if ((!horMenuLoadTip || horMenuLoadTip.length <= 0) && (!sideMenuLoadTip || sideMenuLoadTip.length <= 0)) {
- // if (store('nav-pos-direction') != undefined) {
- // var navPosOption = store('nav-pos-direction');
- // $('.nav-pos-direction', panel).val(navPosOption);
- // } else {
- $('.nav-pos-direction', panel).val('fmenu');
- // $.ajax({
- // "dataType" : 'json',
- // "type" : "GET",
- // "async" : false,
- // url : FrameConst.REST_GET_FRAME_MENUDIRECTION + "&tmpstamp=" + new Date().getTime(),
- // "success" : function (obj) {
- // if (obj.value && (obj.value != "")) {
- // $('.nav-pos-direction', panel).val(obj.value);
- // }
- // }
- // });
- //}
- // } else {
- // $('.nav-pos-direction', panel).attr("disabled", true);
- // }
-};
-
-
-function iniFMenu() {
- var fsidemenu = $('#' + fMenuSiderDivId);
-
- if (fsidemenu) {
- openoFrameWork.startPageLoading();
-
- var menuContent = initLeftMenu();
- fsidemenu.empty();
- fsidemenu.append("<li class='sidebar-toggler-wrapper'><div class='sidebar-toggler hidden-xs hidden-sm'></div></li>");
- fsidemenu.append(menuContent);
- loadi18n_WebFramework('web-framework-menu-i18n', 'i18n/', 'openo_frame_left_menu_i18n');
-
- openoFrameWork.stopPageLoading();
- }
-};
-
-function goToHomePage(){
- locationhash = openoFrameWork.getLocationHash();
- if(!!locationhash&&locationhash.length>0){//有锚点,直接触发
- var newIPPort=null;
- if (store&&store('menuCategoryID')) {
- var s=store('menuCategoryID').split('[menuCategoryID]');
- if(s.length>2){
- newIPPort={menuCategoryID:s[0],ipPortStr:s[1],newTitle:s[2]};
- }
- }
- if(!!newIPPort){
- openoFrameWork.goToURLByIDAndNewIPPort(locationhash,newIPPort,null);
- }else{
- openoFrameWork.goToURLByIDAndNewAction(locationhash,null,null);
- }
- }else{//否则还是模拟点击配置了start类的菜单
- var containerStr = "";
- //var sidermenu = $("[class='page-sidebar-menu']", $("[class='page-sidebar navbar-collapse collapse']"));
- var sidermenu = $("#page-sidebar-menu");
- var hormenu = $("#main_hormenu");
- var fhormenu = $('#' + fMenuMegaDivId);
- var fhormenusider = $('#page-f-sidebar-menu');
- var startmenu = null;
- var navPosOption = $('.nav-pos-direction', panel).val();
- // 侧边栏显示,根据侧边栏CSS选择
- if (navPosOption === "vertical") {
- //containerStr=$('.page-sidebar').length>0?'.page-sidebar':"";
- startmenu = $('.iframe.start' , sidermenu);
- dealStartMenu( startmenu, sidermenu );
- }
- // 水平菜单显示,根据水平菜单CSS选择
- else if (navPosOption === "horizontal") {
- //containerStr=$('.hor-menu').length>0?'.header':containerStr;
- startmenu = $('.iframe.start' , hormenu);
- dealStartMenu( startmenu, hormenu );
-
- }
- //F菜单的恒菜单显示
- else if (navPosOption === openoFrameWork_menu_fmenu) {
- //containerStr=$('.hor-menu').length>0?'.header':containerStr;
- startmenu = $('.iframe.start' ,fhormenu);
- if (startmenu && startmenu.length < 1) {
- startmenu = $('.iframe.start' ,fhormenusider);
- }
- dealStartMenu( startmenu, fhormenu,fhormenusider );
- }
- }
-};
-var dealStartMenu = function(startmenu , menuContainer,menuContainer2 ){
- var timer =setInterval(function () {
- if(startmenu&&startmenu.length>0){
- startmenu.click();
- clearInterval(timer);
- }else{
- console.log('the start menu click event is not be triggerd ,so do it repeat!!');
- $('a[operation]', menuContainer).each(function () {
- startmenu = $(this);
- return false;
- });
- if (menuContainer2&&startmenu && startmenu.length < 1) {
- $('a[operation]', menuContainer2).each(function () {
- startmenu = $(this);
- return false;
- });
- }
- }
- }, 100);
- handeCtxMenuitem();
- }
-// 屏蔽横竖菜单项的右键功能
-function handeCtxMenuitem() {
- $(".page-sidebar ul li a").each(function() {
- if ($(this).attr("href") && $(this).attr("href") != "javascript:;" && $(this).attr("href") != "#") {
- $(this).attr("oncontextmenu", "return false");
- }
- });
- $(".hormenu li a").each(function() {
- if ($(this).attr("href") && $(this).attr("href") != "javascript:;" && $(this).attr("href") != "#") {
- $(this).attr("oncontextmenu", "return false");
- }
- });
-}
-function initBaseInfo(){
- $("#logout_label").text($.i18n.prop('com_zte_ums_ict_framework_ui_group_logout'));
- $("#fullscreen_label").text($.i18n.prop('com_zte_ums_ict_framework_ui_group_fullscreen'));
- $("#changePwd_label").text($.i18n.prop('com_zte_ums_ict_framework_ui_changePwd'));
- $("#com_zte_ums_ict_framework_moudle_about").text($.i18n.prop('com_zte_ums_ict_framework_moudle_about'));
- $("#com_zte_ums_ict_framework_moudle_help").text($.i18n.prop('com_zte_ums_ict_framework_moudle_help'));
- $("#zte_menu-toggler").attr("title",$.i18n.prop('com_zte_ums_ict_framework_moudle_menutoggler'));
-};
-window.closeModal = function(modalid) {
- if(!modalid){
- return;
- }
- if(modalid.indexOf("#")<0){
- modalid="#"+modalid;
- }
- $(modalid).modal('hide');
-};
-function getLcsRight(lcsoperations) {
- var lcsrights = new Array();
- if (lcsoperations && (lcsoperations.length > 0)) {
- // 请求后台license value
- //----test data----
- // var testjson = '{"data":[{"id":"mylcs","name":"xxx","value":"false"}]}';
- // var testopt = eval('(' + testjson + ')');
- // var testarray = testopt.data;
- //-----end test data---
- var keys = {
- "keys" : lcsoperations
- };
- var jsonvalues = JSON.stringify(keys);
- var data = {
- "data" : jsonvalues
- };
- var url=FrameConst.REST_GETLICENSEINFO + "?tmpstamp=" + new Date().getTime();
- url=openoFrameWork.handlBaseURL(url);
- $.ajax({
- "dataType" : 'json',
- "type" : "GET",
- "async" : false,
- "url" : url,
- "data" : data,
- //"contentType" : 'application/json; charset=utf-8',
- "success" : function (response) {
- if (response) {
- lcsrights = response.data;
- }
- },
- "error" : function (XMLHttpRequest, textStatus, errorThrown) {
- lcsrights = null;
- }
- });
- return lcsrights;
- }
- return lcsrights;
-}
-// 侧边栏菜单鉴权
-function siderBarMenuAuthentication() {
- // license 鉴权
- var menuids = new Array();
- var lcsoperations = new Array();
- //从页面DOM取得菜单license项。
- $('a[licenseid]', $('.page-sidebar-menu')).each(function () {
- var licenseid = $(this).attr("licenseid");
- if (licenseid) {
- lcsoperations.push(licenseid);
- var id = $(this).attr("id");
- menuids.push(id);
- }
- });
- var lcsrights = getLcsRight(lcsoperations);// 取得license数据。
- if (lcsrights && (lcsrights.length == menuids.length)) {
- // 根据后台license值判断所在菜单项是否显示
- for (var i = 0; i < menuids.length; i++) {
- var id = menuids[i];
- var lcskey = lcsoperations[i];
- var lcsitem = lcsrights[i];
- // 菜单项如果配了licenseid, 并且不是true字符串, 则移除菜单项
- if (lcsitem.value != "True") {
- $('#'+id, $('.page-sidebar-menu')).parent().remove();
- }
- }
- }
- var operations = new Array();
- $('a[operation]', $('.page-sidebar-menu')).each(function () {
- var operation = $(this).attr("operation");
- if (operation) {
- operations.push(operation);
- }
- }); // 遍历菜单项,提取所有的操作码
- var rightObj = getAllOperCodeRights(operations); // 对操作码进行鉴权判断
- $('a[operation]', $('.page-sidebar-menu')).each(function () {
- var operation = $(this).attr("operation");
- if (operation) {
- if (!hasRight(operation, rightObj)) {
- $(this).parent("li").remove(); // 删除没有权限的菜单项
- }
- }
- });
- rebuildSiderBarMenu();
-};
-// 横向菜单栏鉴权
-function horMenuAuthentication( horMenuId ) {
- // license 鉴权
- var menuids = new Array();
- var lcsoperations = new Array();
- //从页面DOM取得菜单license项。
- $('a[licenseid]', $('#'+ horMenuId)).each(function () {
- var licenseid = $(this).attr("licenseid");
- if (licenseid) {
- lcsoperations.push(licenseid);
- var id = $(this).attr("id");
- menuids.push(id);
- }
- });
- var lcsrights = getLcsRight(lcsoperations);// 取得license数据。
- if (lcsrights && (lcsrights.length == menuids.length)) {
- // 根据后台license值判断所在菜单项是否显示
- for (var i = 0; i < menuids.length; i++) {
- var id = menuids[i];
- var lcskey = lcsoperations[i];
- var lcsitem = lcsrights[i];
- // 菜单项如果配了licenseid, 并且不是true字符串, 则移除菜单项
- if (lcsitem.value != "True") {
- $('#'+id, $('#'+ horMenuId)).parent().remove();
- }
- }
- }
- var operations = new Array();
- $('a[operation]', $('#'+ horMenuId)).each(function () {
- var operation = $(this).attr("operation");
- if (operation) {
- operations.push(operation);
- }
- }); // 遍历菜单项,提取所有的操作码
- var rightObj = getAllOperCodeRights(operations); // 对操作码进行鉴权判断
- $('a[operation]', $('#'+ horMenuId)).each(function () {
- var operation = $(this).attr("operation");
- if (operation) {
- if (!hasRight(operation, rightObj)) {
- $(this).parent("li").remove(); // 删除没有权限的菜单项
- }
- }
- });
- rebuildHorMenu();
-};
-
-// “更多操作”分组按钮鉴权
-function groupButtonAuthentication() {
- // license 鉴权
- var menuids = new Array();
- var lcsoperations = new Array();
- //从页面DOM取得菜单license项。
- $('a[licenseid]', $('.more-botton-zone > li.btn-group')).each(function () {
- var licenseid = $(this).attr("licenseid");
- if (licenseid) {
- lcsoperations.push(licenseid);
- var id = $(this).attr("id");
- menuids.push(id);
- }
- });
- var lcsrights = getLcsRight(lcsoperations);// 取得license数据。
- if (lcsrights && (lcsrights.length == menuids.length)) {
- // 根据后台license值判断所在菜单项是否显示
- for (var i = 0; i < menuids.length; i++) {
- var id = menuids[i];
- var lcskey = lcsoperations[i];
- var lcsitem = lcsrights[i];
- // 菜单项如果配了licenseid, 并且不是true字符串, 则移除菜单项
- if (lcsitem.value != "True") {
- $('#'+id, $('.more-botton-zone > li.btn-group')).parent().remove();
- }
- }
- }
- // 增加mysql判断,如果数据库为mysql,去掉基础数据备份功能菜单项
- var dbType = openoFrameWork_conf.dbType;
- if (dbType == "mysql") {
- $("#uep-ict-backup-baseDataBack",$('.more-botton-zone > li.btn-group')).parent().remove();
- }
- var operations = new Array();
- $('a[operation]', $('.more-botton-zone > li.btn-group')).each(function () {
- var operation = $(this).attr("operation");
- if (operation) {
- operations.push(operation);
- }
- }); // 遍历菜单项,提取所有的操作码
- var rightObj = getAllOperCodeRights(operations); // 对操作码进行鉴权判断
- $('a[operation]', $('.more-botton-zone > li.btn-group')).each(function () {
- var operation = $(this).attr("operation");
- if (operation) {
- if (!hasRight(operation, rightObj)) {
- $(this).parent("li").remove(); // 删除没有权限的菜单项
- }
- }
- });
- // 如果“更多菜单”下没有子菜单了,则删除整个“更多菜单”下拉框。
- if ($('li > a', $('.more-botton-zone > li.btn-group')).length == 0) {
- $('.more-botton-zone > li.btn-group').remove();
- }
-};
-// 删除没有子菜单的一级菜单,查看新菜单是否配了登录默认页面,如没有则指定第一个有权限的菜单作为登录后默认页面
-function rebuildSiderBarMenu() {
- if ($('a.start').length == 0) {
- $('li > a[href!="javascript:;"]', $('.page-sidebar-menu')).eq(0).addClass("start");
- }
- $('ul.sub-menu', $('.page-sidebar-menu')).each(function () {
- if ($(this).has('li').length == 0) {
- $(this).parent("li").remove();
- }
- });
-};
-// 删除没有子菜单的一级菜单,查看新菜单是否配了登录默认页面,如没有则指定第一个有权限的菜单作为登录后默认页面
-function rebuildHorMenu() {
- if ($('a.start').length == 0) {
- $('li > a[href!="#"]', $('#main_hormenu')).eq(0).addClass("start");
- }
- $('ul.mega-menu-submenu', $('#main_hormenu')).each(function () {
- if ($(this).has('li > a').length == 0) {
- $(this).remove(); // 删空的分组列
- }
- });
- //删除增加的分组div
- $('div.zteDivWidth', $('#main_hormenu')).each(function () {
- if ($(this).has('ul').length == 0) {
- $(this).remove(); // 删空的分组列
- }
- });
- $('ul.dropdown-menu', $('#main_hormenu')).each(function () {
- if ($(this).has('ul').length == 0) {
- $(this).parent("li").remove(); // 删空的一级菜单栏
- }
- });
- $('li.divider', $('#main_hormenu')).each(function () {
- if ($(this).next().hasClass('divider')) {
- $(this).remove(); // 连续出现分隔线则删除一个
- }
- });
- $('li.divider', $('#main_hormenu')).each(function () {
- if ($(this).next().length == 0) {
- $(this).remove(); // 如果分隔线在最后一行,则删除之
- }
- });
-}
-//获取页面菜单栏所有的操作码权限
-function getAllOperCodeRights(operations) {
- var rights = new Array();
- if( operations && operations.length > 0 ){
- var data = {
- "operations" : operations
- };
- var sendData = JSON.stringify(data);
- var url=FrameConst.REST_CHECKRIGHT + "?data=" + sendData + "&tmpstamp=" + new Date().getTime();
- url=openoFrameWork.handlBaseURL(url);
- $.ajax({
- "dataType" : 'json',
- "type" : "GET",
- "async" : false,
- "url" : url,
- "data" : null,
- //"contentType" : 'application/json; charset=utf-8',
- "success" : function (response) {
- rights = response.value;
- },
- "error" : function (XMLHttpRequest, textStatus, errorThrown) {
- if (XMLHttpRequest.status == 401) {
- window.location.replace("login.html");
- } else {
- console.log('Communication Error!');
- }
- }
- });
- }
- return {
- opCodes : operations,
- rights : rights
- };
-};
-// 判断操作码是否有权限
-function hasRight(opCode, rightObj) {
- for (var i = 0; i < rightObj.opCodes.length; i++) {
- if (rightObj.opCodes[i] == opCode) {
- return (rightObj.rights[i] == true);
- }
- }
- return false;
-};
-// 处理mysql环境下备份菜单的合并问题
-function dealMysqlBackupMenu() {
- var dbType = openoFrameWork_conf.dbType;
- if (dbType !== undefined && dbType !== "mysql") {
- return;
- }
- var sidermenu = $("[class='page-sidebar-menu']");
- var hormenu = $(".hormenu");
- //这段代码先这么写,html的位置不一定正确,如果后面位置不一致,再修改。
- if (sidermenu.length > 0 && $('#uep-ict-backup-dataBackup').length > 0) {
- $('#uep-ict-backup-dataBackup', sidermenu).attr("breadcrumGroupButtonSrc", ICTFRAME_CONST_DATABACKUP_PATH);
- }
- if (hormenu.length > 0 && $('#uep-ict-backup-dataBackup').length > 0) {
- $('#uep-ict-backup-dataBackup', hormenu).attr("breadcrumGroupButtonSrc", ICTFRAME_CONST_DATABACKUP_PATH);
- $('#uep-ict-backup-dataBackup').parent('li').attr('style', 'display:block');
- $('#uep-ict-backup-allDbStructBackup').parent('li').attr('style', 'display:none');
- $('#uep-ict-backup-baseDataBack').parent('li').attr('style', 'display:none');
- }
-};
-// 浏览器缩小后导航栏隐藏的情况下点击navbar-toggle显示菜单的前置工作,
-// 浏览器缩小后导航栏隐藏的情况下点击navbar-toggle显示菜单的前置工作,
-function dealMavToggle(navtoggle) {
- var sidermenu = $("#page-sidebar-menu");
- var hormenu = $("#main_hormenu");
- var panel = $(".zte-theme-panel");
- var siderbarpos = $(".nav-pos-direction", panel).val()
- if ("hidden" == $(navtoggle).attr("navtoggledispattr")) {
- $(navtoggle).attr("navtoggledispattr", "display");
- sidermenu.css('display','block');//侧边栏显示
- hormenu.css("display", "none");//隐藏水平菜单栏
- } else {
- $(navtoggle).attr("navtoggledispattr", "hidden");
- sidermenu.css('display','none');//侧边栏隐藏
- hormenu.css("display", "none");
- }
-};
diff --git a/portal-common/src/main/webapp/common/js/core/pym.min.js b/portal-common/src/main/webapp/common/js/core/pym.min.js
deleted file mode 100644
index db0984ea..00000000
--- a/portal-common/src/main/webapp/common/js/core/pym.min.js
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * Copyright 2016-2017, CMCC Technologies Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-(function(a){if(typeof define==="function"&&define.amd){define("pym",[],a)}else{if(typeof module!=="undefined"&&module.exports){module.exports=a()}else{window.pym=a.call(this)}}window.pym=a.call(this)})(function(){var a="xPYMx";function e(){var k,i;if(window.innerHeight&&window.scrollMaxY){k=window.innerWidth+window.scrollMaxX;i=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){k=document.body.scrollWidth;i=document.body.scrollHeight}else{k=document.body.offsetWidth;i=document.body.offsetHeight}}var j,l;if(self.innerHeight){if(document.documentElement.clientWidth){j=document.documentElement.clientWidth}else{j=self.innerWidth}l=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){j=document.documentElement.clientWidth;l=document.documentElement.clientHeight}else{if(document.body){j=document.body.clientWidth;l=document.body.clientHeight}}}if(i<l){pageHeight=l}else{pageHeight=i}if(k<j){pageWidth=k}else{pageWidth=j}arrayPageSize=new Array(pageWidth,pageHeight,j,l);return arrayPageSize}var g={};var c=function(i){var k=new RegExp("[\\?&]"+i.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]")+"=([^&#]*)");var j=k.exec(location.search);if(j===null){return""}return decodeURIComponent(j[1].replace(/\+/g," "))};var b=function(j,i){if(i.xdomain!=="*"){if(!j.origin.match(new RegExp(i.xdomain+"$"))){return}}return true};var h=function(l,i,j){var k=["pym",l,i,j];return k.join(a)};var f=function(j){var i=["pym",j,"(\\S+)","(.+)"];return new RegExp("^"+i.join(a)+"$")};var d=function(){var n=document.querySelectorAll("[data-pym-src]:not([data-pym-auto-initialized])");var m=n.length;for(var i=0;i<m;++i){var l=n[i];l.setAttribute("data-pym-auto-initialized","");if(l.id===""){l.id="pym-"+i}var o=l.getAttribute("data-pym-src");var k=l.getAttribute("data-pym-xdomain");var j={};if(k){j.xdomain=k}new g.Parent(l.id,o,j)}};g.Parent=function(m,j,i){this.id=m;this.url=j;this.el=document.getElementById(m);this.iframe=null;this.minHeight="0";this._olddisplay="";this.oldHeight=0;this.childpageType="";this.setMinHeight=function(n){this.minHeight=n;this._onHeightMessage(n)};this.settings={xdomain:"*"};this.messageRegex=f(this.id);this.messageHandlers={};i=(i||{});this._constructIframe=function(){var o=this.el.offsetWidth.toString();this.iframe=document.createElement("iframe");var q="";var n=this.url.indexOf("#");if(n>-1){q=this.url.substring(n,this.url.length);this.url=this.url.substring(0,n)}if(this.url.indexOf("?")<0){this.url+="?"}else{this.url+="&"}this.iframe.src=this.url.trim().indexOf("javascript:")>=0?"":this.url+"initialWidth="+o+"&childId="+this.id;"&parentUrl="+encodeURIComponent(window.location.href)+q;this.iframe.setAttribute("width","100%");this.iframe.setAttribute("scrolling","no");this.iframe.setAttribute("marginheight","0");this.iframe.setAttribute("frameborder","0");this.el.appendChild(this.iframe);var p=this;window.addEventListener("resize",this._onResize)};this._onResize=function(){this.sendWidth()}.bind(this);this._fire=function(o,p){if(o in this.messageHandlers){for(var n=0;n<this.messageHandlers[o].length;n++){this.messageHandlers[o][n].call(this,p)}}};this.remove=function(){window.removeEventListener("message",this._processMessage);window.removeEventListener("resize",this._onResize);this.el.removeChild(this.iframe)};this._processMessage=function(q){if(!b(q,this.settings)){return}if(typeof q.data!=="string"){return}var n=q.data.match(this.messageRegex);if(!n||n.length!==3){return false}var o=n[1];var p=n[2];this._fire(o,p)}.bind(this);this._onHeightMessage=function(o){var n=parseInt(o);n=Math.max(this.minHeight,n);if(this.oldHeight!=n){if(this.childpageType&&this.childpageType.length>0&&this.childpageType==="isc"){console.log("parent window detect that the child iframe page loaded smartclient,the iframe height will ignore the child's Height change message;");if(this.minHeight<n){n=this.minHeight}}this.oldHeight=n;this.iframe.setAttribute("height",n+"px")}};this._onNavigateToMessage=function(n){document.location.href=n};this._onChildpageTypeMessage=function(n){this.childpageType=n};this.onMessage=function(n,o){if(!(n in this.messageHandlers)){this.messageHandlers[n]=[]}this.messageHandlers[n].push(o)};this.sendMessage=function(n,o){this.el.getElementsByTagName("iframe")[0].contentWindow.postMessage(h(this.id,n,o),"*")};this.sendWidth=function(){var n=this.el.offsetWidth.toString();this.sendMessage("width",n)};for(var k in i){this.settings[k]=i[k]}this.onMessage("height",this._onHeightMessage);this.onMessage("navigateTo",this._onNavigateToMessage);this.onMessage("childpageType",this._onChildpageTypeMessage);var l=this;window.addEventListener("message",this._processMessage,false);this._constructIframe();return this};g.Child=function(i){this.parentWidth=null;this.id=null;this.oldHeight=0;this.parentUrl=null;this.settings={renderCallback:null,xdomain:"*",polling:0};this.messageRegex=null;this.messageHandlers={};i=(i||{});this.onMessage=function(m,n){if(!(m in this.messageHandlers)){this.messageHandlers[m]=[]}this.messageHandlers[m].push(n)};this._fire=function(n,o){if(n in this.messageHandlers){for(var m=0;m<this.messageHandlers[n].length;m++){this.messageHandlers[n][m].call(this,o)}}};this._processMessage=function(p){if(!b(p,this.settings)){return}if(typeof p.data!=="string"){return}var m=p.data.match(this.messageRegex);if(!m||m.length!==3){return}var n=m[1];var o=m[2];this._fire(n,o)}.bind(this);this._onWidthMessage=function(n){var m=parseInt(n);if(m!==this.parentWidth){this.parentWidth=m;if(this.settings.renderCallback){this.settings.renderCallback(m)}this.sendHeight()}};this.sendMessage=function(m,n){window.parent.postMessage(h(this.id,m,n),"*")};this.sendHeight=function(){var n=document.getElementsByTagName("body")[0];height=n.offsetHeight;if(typeof isc!="undefined"&&l.oldPageType!="isc"){height=5;console.log("child iframe id="+l.id+" loaded smartclient");l.oldPageType="isc";l.sendMessage("childpageType","isc")}var m=0;if(l.oldHeight>height){m=l.oldHeight-height}else{m=height-l.oldHeight}if(m<=70){return}if(l.oldHeight!=height){l.oldHeight=height;console.log("child iframe id="+l.id+" sedHeight:"+height);l.sendMessage("height",height)}}.bind(this);this.scrollParentTo=function(m){this.sendMessage("navigateTo","#"+m)};this.navigateParentTo=function(m){this.sendMessage("navigateTo",m)};this.id=c("childId")||i.id;this.messageRegex=new RegExp("^pym"+a+this.id+a+"(\\S+)"+a+"(.+)$");var k=parseInt(c("initialWidth"));this.parentUrl=c("parentUrl");this.onMessage("width",this._onWidthMessage);for(var j in i){this.settings[j]=i[j]}var l=this;window.addEventListener("message",this._processMessage,false);if(this.settings.renderCallback){this.settings.renderCallback(k)}this.sendHeight();if(this.settings.polling){window.setInterval(this.sendHeight,this.settings.polling)}return this};d();return g});
diff --git a/portal-common/src/main/webapp/common/js/fm_light.js b/portal-common/src/main/webapp/common/js/fm_light.js
deleted file mode 100644
index ea4aeb29..00000000
--- a/portal-common/src/main/webapp/common/js/fm_light.js
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Copyright 2016-2017, CMCC Technologies Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-(function($) {
- String.prototype.trim = function() {
- return this.replace(/(^\s*)|(\s*$)/g, "");
- };
- String.prototype.format=function() {
- if(arguments.length==0) return this;
- for(var s=this, i=0; i<arguments.length; i++)
- s=s.replace(new RegExp("\\{"+i+"\\}","g"), arguments[i]);
- return s;
- };
- //告警计数点击事件
- $(function(){
- $("#hd_alarmcount_critical_value").parentsUntil('a').parent().click(function() {
- openNewPage(1);
- });
-
- $("#hd_alarmcount_major_value").parentsUntil('a').parent().click(function() {
- openNewPage(2);
- });
-
- $("#hd_alarmcount_minor_value").parentsUntil('a').parent().click(function() {
- openNewPage(3);
- });
-
- $("#hd_alarmcount_warning_value").parentsUntil('a').parent().click(function() {
- openNewPage(4);
- });
- function openNewPage(severity)
- {
- window.open("default.html?showNav=false&severity=" + severity + "#_uep-ict-fm-currentAlarm",
- "fm_portlet_page_title");
- }
- });
- try{
- //base版本不加载告警统计,并在界面隐藏
- $().ready(function(){
- if(typeof(base) == "undefined" || !base){
- if($("#header_notification_bar")&&$("#header_notification_bar").length>0&&$("#header_notification_bar").children().length>0){
- // 对告警灯进行鉴权,如果有当前告警权限,显示告警灯,否则返回?
- var operations = new Array();
- operations.push("common.fm.currentview");
- var rightObj = getAllOperCodeRights(operations);
- var operation = $("#uep-ict-fm-currentAlarm").attr("operation");;
- if (!hasRight(operation, rightObj)) {
- $('#header_notification_bar').html("<div>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</div>");
- return;
- }
- // get total alarm count
- $("#hd_heighestAlarmcount_label").attr("title",$.i18n.prop('com_zte_ums_ict_alarmcount_none_label'));
- $("#hd_alarmcount_total_value").attr("title",$.i18n.prop('com_zte_ums_ict_alarmcount_total_label'));
- $("#hd_alarmcount_critical_value").attr("title",$.i18n.prop('com_zte_ums_ict_alarmcount_critical_label'));
- $("#hd_alarmcount_major_value").attr("title",$.i18n.prop('com_zte_ums_ict_alarmcount_major_label'));
- $("#hd_alarmcount_minor_value").attr("title",$.i18n.prop('com_zte_ums_ict_alarmcount_minor_label'));
- $("#hd_alarmcount_warning_value").attr("title",$.i18n.prop('com_zte_ums_ict_alarmcount_warning_label'));
-
- function alarmLight(alarmcount){
- if (!alarmcount || !alarmcount.unAckedCount || (alarmcount.unAckedCount.length < 4) || !alarmcount.ackedCount || (alarmcount.ackedCount.length < 4)) {
- return;
- }
- var criticalNum = alarmcount.unAckedCount[0] + alarmcount.ackedCount[0];
- var majorNum = alarmcount.unAckedCount[1] + alarmcount.ackedCount[1];
- var minorNum = alarmcount.unAckedCount[2] + alarmcount.ackedCount[2];
- var warningNum = alarmcount.unAckedCount[3] + alarmcount.ackedCount[3];
- var totalNum= criticalNum+ majorNum+ minorNum+ warningNum;
- var heighestAlarmcount=0;
- var hd_heighestAlarmcount_label="";
- if(criticalNum>0){
- heighestAlarmcount =criticalNum;
- hd_heighestAlarmcount_label=$.i18n.prop('com_zte_ums_ict_alarmcount_critical_label');
- // $("#hd_heighestAlarmcount_li").attr("class",$("#hd_alarmcount_critical_li").attr("class"));
- }else if(majorNum>0){
- heighestAlarmcount =majorNum;
- hd_heighestAlarmcount_label=$.i18n.prop('com_zte_ums_ict_alarmcount_major_label');
- }else if(minorNum>0){
- heighestAlarmcount =minorNum;
- hd_heighestAlarmcount_label=$.i18n.prop('com_zte_ums_ict_alarmcount_minor_label');
- }else if(warningNum>0){
- heighestAlarmcount =warningNum;
- hd_heighestAlarmcount_label=$.i18n.prop('com_zte_ums_ict_alarmcount_warning_label');
- }else{
- heighestAlarmcount =0;
- hd_heighestAlarmcount_label=$.i18n.prop('com_zte_ums_ict_alarmcount_none_label');
- }
-
- $("#hd_heighestAlarmcount_value").text(heighestAlarmcount);
- $("#hd_alarmcount_total_value").text(totalNum);
- $("#hd_alarmcount_critical_value").text(criticalNum);
- $("#hd_alarmcount_major_value").text(majorNum);
- $("#hd_alarmcount_minor_value").text(minorNum);
- $("#hd_alarmcount_warning_value").text(warningNum);
-
- $("#hd_heighestAlarmcount_value").attr("title",hd_heighestAlarmcount_label.format(heighestAlarmcount ));
- $("#hd_alarmcount_total_value").attr("title",$.i18n.prop('com_zte_ums_ict_alarmcount_total_label').format(totalNum ));
- $("#hd_alarmcount_critical_value").attr("title",$.i18n.prop('com_zte_ums_ict_alarmcount_critical_label').format( criticalNum ));
- $("#hd_alarmcount_major_value").attr("title",$.i18n.prop('com_zte_ums_ict_alarmcount_major_label').format(majorNum));
- $("#hd_alarmcount_minor_value").attr("title",$.i18n.prop('com_zte_ums_ict_alarmcount_minor_label').format(minorNum));
- $("#hd_alarmcount_warning_value").attr("title",$.i18n.prop('com_zte_ums_ict_alarmcount_warning_label').format(warningNum));
-
- $("#hd_alarmcount_critical_text").text($.i18n.prop('com_zte_ums_ict_alarmcount_critical_text'));
- $("#hd_alarmcount_major_text").text($.i18n.prop('com_zte_ums_ict_alarmcount_major_text'));
- $("#hd_alarmcount_minor_text").text($.i18n.prop('com_zte_ums_ict_alarmcount_minor_text'));
- $("#hd_alarmcount_warning_text").text($.i18n.prop('com_zte_ums_ict_alarmcount_warning_text'));
-
- $("#hd_alarmcount_total_before_text").text($.i18n.prop('com_zte_ums_ict_alarmcount_total_before_text'));
- $("#hd_alarmcount_total_after_text").text($.i18n.prop('com_zte_ums_ict_alarmcount_total_after_text'));
- $("#header_notification_bar").css('display','block');
- }
- function queryAlarmTotalCount() {
- $.getJSON("/web/rest/web/fm/count/total", function(data) {
- //var alarmcount = $.parseJSON(data);
- alarmLight(data);
- if($("#header_notification_bar")&&$("#header_notification_bar").length>0&&$("#header_notification_bar").children().length>0){
- registerAlarmTotalCountToCometd();
- }
- })
- }
- if($("#header_notification_bar")&&$("#header_notification_bar").length>0&&$("#header_notification_bar").children().length>0){
- queryAlarmTotalCount();
- }
- var registerAlarmTotalCountToCometd = function () {
- var self = this;
- var cometd = $.cometd;
- var cometURL = location.protocol + "//" + location.host + "/web/cometd";
- cometd.configure({
- url: cometURL,
- logLevel: 'debug'
- });
- cometd.addListener('/meta/handshake', function (handshake){
- if (handshake.successful === true) {
- cometd.batch(function () {
- cometd.subscribe('/alarm/usercount', function (message) {
- var alarmcount =message.data;
- alarmLight(alarmcount);
- })
- })
- }
- });
- cometd.handshake();
- };
-
- // if($("#header_notification_bar")&&$("#header_notification_bar").length>0&&$("#header_notification_bar").children().length>0){
- // registerAlarmTotalCountToCometd();
- // }
- //setInterval(queryAlarmTotalCount, 30 * 1000);
- }
- }
- else if(base){
- //$("#header_notification_bar").hide();
- //$('#header_notification_bar').empty();
- $('#header_notification_bar').html("<div>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</div>");
- }
- });
- }catch(e){}
-})(jQuery);
diff --git a/portal-common/src/main/webapp/common/js/international/loadi18n.js b/portal-common/src/main/webapp/common/js/international/loadi18n.js
deleted file mode 100644
index b3989158..00000000
--- a/portal-common/src/main/webapp/common/js/international/loadi18n.js
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 2016-2017, CMCC Technologies Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var lang = 'en-US';
-
-function loadProperties(propertiesFileName, propertiesFilePath , name_i18n) {
- jQuery.i18n.properties({
- language:lang,
- name:propertiesFileName,
- path:propertiesFilePath,
- mode:'map',
- callback: function() {
- var i18nItems = $('[name_i18n='+ name_i18n + ']');
- for (var i = 0; i < i18nItems.length; i++) {
- var $item = $(i18nItems.eq(i));
- var itemId = $item.attr('id');
- var itemValue = $.i18n.prop(itemId);
- if (itemValue.indexOf(';') > 0) {
- itemValue = itemValue.replace(';', '');
- }
- if (/[\'\"]/.test(itemValue)) {
- itemValue = itemValue.replace(/\"/g,'');
- itemValue = itemValue.replace(/\'/g,'');
- }
- if (typeof($item.attr("title")) != "undefined") {
- $item.attr("title", itemValue);
- } else if (typeof($item.attr("placeholder")) != "undefined") {
- $item.attr("placeholder", itemValue);
- } else {
- $item.text(itemValue);
- }
- }
- }
- });
-}
-
-function loadi18n_WebFramework(propertiesFileName, propertiesFilePath, name_i18n) {
- loadProperties(propertiesFileName, propertiesFilePath, name_i18n);
-}
-
diff --git a/portal-common/src/main/webapp/common/js/json2.js b/portal-common/src/main/webapp/common/js/json2.js
deleted file mode 100644
index e6c115c0..00000000
--- a/portal-common/src/main/webapp/common/js/json2.js
+++ /dev/null
@@ -1,341 +0,0 @@
-/*
- * Copyright 2016-2017, CMCC Technologies Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-if (typeof JSON !== 'object') {
- JSON = {};
-}
-
-(function () {
- 'use strict';
-
- function f(n) {
- // Format integers to have at least two digits.
- return n < 10 ? '0' + n : n;
- }
-
- if (typeof Date.prototype.toJSON !== 'function') {
-
- Date.prototype.toJSON = function (key) {
-
- return isFinite(this.valueOf())
- ? this.getUTCFullYear() + '-' +
- f(this.getUTCMonth() + 1) + '-' +
- f(this.getUTCDate()) + 'T' +
- f(this.getUTCHours()) + ':' +
- f(this.getUTCMinutes()) + ':' +
- f(this.getUTCSeconds()) + 'Z'
- : null;
- };
-
- String.prototype.toJSON =
- Number.prototype.toJSON =
- Boolean.prototype.toJSON = function (key) {
- return this.valueOf();
- };
- }
-
- var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
- escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
- gap,
- indent,
- meta = { // table of character substitutions
- '\b': '\\b',
- '\t': '\\t',
- '\n': '\\n',
- '\f': '\\f',
- '\r': '\\r',
- '"' : '\\"',
- '\\': '\\\\'
- },
- rep;
-
-
- function quote(string) {
-
-// If the string contains no control characters, no quote characters, and no
-// backslash characters, then we can safely slap some quotes around it.
-// Otherwise we must also replace the offending characters with safe escape
-// sequences.
-
- escapable.lastIndex = 0;
- return escapable.test(string) ? '"' + string.replace(escapable, function (a) {
- var c = meta[a];
- return typeof c === 'string'
- ? c
- : '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
- }) + '"' : '"' + string + '"';
- }
-
-
- function str(key, holder) {
-
-// Produce a string from holder[key].
-
- var i, // The loop counter.
- k, // The member key.
- v, // The member value.
- length,
- mind = gap,
- partial,
- value = holder[key];
-
-// If the value has a toJSON method, call it to obtain a replacement value.
-
- if (value && typeof value === 'object' &&
- typeof value.toJSON === 'function') {
- value = value.toJSON(key);
- }
-
-// If we were called with a replacer function, then call the replacer to
-// obtain a replacement value.
-
- if (typeof rep === 'function') {
- value = rep.call(holder, key, value);
- }
-
-// What happens next depends on the value's type.
-
- switch (typeof value) {
- case 'string':
- return quote(value);
-
- case 'number':
-
-// JSON numbers must be finite. Encode non-finite numbers as null.
-
- return isFinite(value) ? String(value) : 'null';
-
- case 'boolean':
- case 'null':
-
-// If the value is a boolean or null, convert it to a string. Note:
-// typeof null does not produce 'null'. The case is included here in
-// the remote chance that this gets fixed someday.
-
- return String(value);
-
-// If the type is 'object', we might be dealing with an object or an array or
-// null.
-
- case 'object':
-
-// Due to a specification blunder in ECMAScript, typeof null is 'object',
-// so watch out for that case.
-
- if (!value) {
- return 'null';
- }
-
-// Make an array to hold the partial results of stringifying this object value.
-
- gap += indent;
- partial = [];
-
-// Is the value an array?
-
- if (Object.prototype.toString.apply(value) === '[object Array]') {
-
-// The value is an array. Stringify every element. Use null as a placeholder
-// for non-JSON values.
-
- length = value.length;
- for (i = 0; i < length; i += 1) {
- partial[i] = str(i, value) || 'null';
- }
-
-// Join all of the elements together, separated with commas, and wrap them in
-// brackets.
-
- v = partial.length === 0
- ? '[]'
- : gap
- ? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']'
- : '[' + partial.join(',') + ']';
- gap = mind;
- return v;
- }
-
-// If the replacer is an array, use it to select the members to be stringified.
-
- if (rep && typeof rep === 'object') {
- length = rep.length;
- for (i = 0; i < length; i += 1) {
- if (typeof rep[i] === 'string') {
- k = rep[i];
- v = str(k, value);
- if (v) {
- partial.push(quote(k) + (gap ? ': ' : ':') + v);
- }
- }
- }
- } else {
-
-// Otherwise, iterate through all of the keys in the object.
-
- for (k in value) {
- if (Object.prototype.hasOwnProperty.call(value, k)) {
- v = str(k, value);
- if (v) {
- partial.push(quote(k) + (gap ? ': ' : ':') + v);
- }
- }
- }
- }
-
-// Join all of the member texts together, separated with commas,
-// and wrap them in braces.
-
- v = partial.length === 0
- ? '{}'
- : gap
- ? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}'
- : '{' + partial.join(',') + '}';
- gap = mind;
- return v;
- }
- }
-
-// If the JSON object does not yet have a stringify method, give it one.
-
- if (typeof JSON.stringify !== 'function') {
- JSON.stringify = function (value, replacer, space) {
-
-// The stringify method takes a value and an optional replacer, and an optional
-// space parameter, and returns a JSON text. The replacer can be a function
-// that can replace values, or an array of strings that will select the keys.
-// A default replacer method can be provided. Use of the space parameter can
-// produce text that is more easily readable.
-
- var i;
- gap = '';
- indent = '';
-
-// If the space parameter is a number, make an indent string containing that
-// many spaces.
-
- if (typeof space === 'number') {
- for (i = 0; i < space; i += 1) {
- indent += ' ';
- }
-
-// If the space parameter is a string, it will be used as the indent string.
-
- } else if (typeof space === 'string') {
- indent = space;
- }
-
-// If there is a replacer, it must be a function or an array.
-// Otherwise, throw an error.
-
- rep = replacer;
- if (replacer && typeof replacer !== 'function' &&
- (typeof replacer !== 'object' ||
- typeof replacer.length !== 'number')) {
- throw new Error('JSON.stringify');
- }
-
-// Make a fake root object containing our value under the key of ''.
-// Return the result of stringifying the value.
-
- return str('', {'': value});
- };
- }
-
-
-// If the JSON object does not yet have a parse method, give it one.
-
- if (typeof JSON.parse !== 'function') {
- JSON.parse = function (text, reviver) {
-
-// The parse method takes a text and an optional reviver function, and returns
-// a JavaScript value if the text is a valid JSON text.
-
- var j;
-
- function walk(holder, key) {
-
-// The walk method is used to recursively walk the resulting structure so
-// that modifications can be made.
-
- var k, v, value = holder[key];
- if (value && typeof value === 'object') {
- for (k in value) {
- if (Object.prototype.hasOwnProperty.call(value, k)) {
- v = walk(value, k);
- if (v !== undefined) {
- value[k] = v;
- } else {
- delete value[k];
- }
- }
- }
- }
- return reviver.call(holder, key, value);
- }
-
-
-// Parsing happens in four stages. In the first stage, we replace certain
-// Unicode characters with escape sequences. JavaScript handles many characters
-// incorrectly, either silently deleting them, or treating them as line endings.
-
- text = String(text);
- cx.lastIndex = 0;
- if (cx.test(text)) {
- text = text.replace(cx, function (a) {
- return '\\u' +
- ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
- });
- }
-
-// In the second stage, we run the text against regular expressions that look
-// for non-JSON patterns. We are especially concerned with '()' and 'new'
-// because they can cause invocation, and '=' because it can cause mutation.
-// But just to be safe, we want to reject all unexpected forms.
-
-// We split the second stage into 4 regexp operations in order to work around
-// crippling inefficiencies in IE's and Safari's regexp engines. First we
-// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
-// replace all simple value tokens with ']' characters. Third, we delete all
-// open brackets that follow a colon or comma or that begin the text. Finally,
-// we look to see that the remaining characters are only whitespace or ']' or
-// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
-
- if (/^[\],:{}\s]*$/
- .test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
- .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
- .replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
-
-// In the third stage we use the eval function to compile the text into a
-// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
-// in JavaScript: it can begin a block or an object literal. We wrap the text
-// in parens to eliminate the ambiguity.
-
- j = eval('(' + text + ')');
-
-// In the optional fourth stage, we recursively walk the new structure, passing
-// each name/value pair to a reviver function for possible transformation.
-
- return typeof reviver === 'function'
- ? walk({'': j}, '')
- : j;
- }
-
-// If the text is not JSON parseable, then a SyntaxError is thrown.
-
- throw new SyntaxError('JSON.parse');
- };
- }
-}());
diff --git a/portal-common/src/main/webapp/common/js/login.js b/portal-common/src/main/webapp/common/js/login.js
deleted file mode 100644
index def0c456..00000000
--- a/portal-common/src/main/webapp/common/js/login.js
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright 2016-2017, CMCC Technologies Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-String.prototype.trim = function() {
- return this.replace(/(^\s*)|(\s*$)/g, "");
-};
-
-function loginSubmitHandler() {
- var loginData = {
- "userName": $("#openo_input_userName").val(),
- "password": $("#openo_input_password").val()
- }
-
- $.ajax({
- url : "/openoapi/auth/v1/tokens",
- type : "POST",
- contentType : 'application/json; charset=utf-8',
- data : JSON.stringify(loginData)
- }).done(function(data) {
- var topURL = top.window.document.location.href;
- if (topURL.indexOf("?service") != -1) {
- top.window.document.location.href = decodeURIComponent(topURL.substring(topURL.indexOf("?service") + 9));
- } else {
- top.window.document.location.href = "/openoui/common/default.html";
- }
- store("loginUserName", $("#openo_input_userName").val());
- }).fail(function(data) {
- var tipDivId = $("#loginConnError");
- if (data.status == 401) {
- tipDivId = $("#nameOrpwdError");
- }
-
- tipDivId.addClass('alert-danger');
- if (tipDivId.attr("tipstatus") == "normal") {
- tipDivId.show();
- } else if (tipDivId.attr("tipstatus") == "close") {
- tipDivId.attr("tipstatus", "normal");
- }
- });
-
- saveUserInfo();
-};
-
-var Login = function () {
- var handleLogin = function() {
- $('.login-form').validate({
- errorElement: 'span', //default input error message container
- errorClass: 'help-block', // default input error message class
- focusInvalid: false, // do not focus the last invalid input
- rules: {
- username: {
- required: true
- },
- password: {
- required: false
- },
- remember: {
- required: false
- }
- },
- messages: {
- username: {
- required: $.i18n.prop('openo_input_userName').replace(/\"/g,'')
- },
- password: {
- required: $.i18n.prop('openo_input_password').replace(/\"/g,'')
- }
- },
- invalidHandler: function (event, validator) {
- $('.alert-danger', $('.login-form')).show();
- },
- highlight: function (element) {
- $(element).closest('.form-group').addClass('has-error'); // set error class to the control group
- },
- success: function (label) {
- label.closest('.form-group').removeClass('has-error');
- label.remove();
- },
- errorPlacement: function (error, element) {
- error.insertAfter(element.closest('.input-icon'));
- },
- submitHandler: loginSubmitHandler
- });
-
- $('.login-form input').keypress(function (e) {
- $("#nameOrpwdError").hide();
- $("#loginConnError").hide();
- if (e.which == 13) {
- if ($('.login-form').validate().form()) {
- $('.login-form').submit();
- }
- return false;
- }
- });
- }
-
- return {
- //main function to initiate the module
- init: function () {
- handleLogin();
- $.backstretch([
- "image/integration/openo_bg_1.jpg",
- "image/integration//openo_bg_2.jpg",
- "image/integration//openo_bg_3.jpg"
- ], {
- fade: 500,
- duration: 15000
- });
- }
- };
-}();
-
-$(document).ready(function() {
- if (store("remember") == "true") {
- $("input[name='remember']").attr("checked", "checked");
- $("#openo_input_userName").val(store("openo_input_userName"));
- $("#openo_input_password").val(store("openo_input_password"));
- }
-});
-
-function saveUserInfo() {
- var rmbcheck = $("input[name='remember']");
- if (rmbcheck.attr("checked") == true || rmbcheck.is(':checked')) {
- store("remember", "true");
- store("openo_input_userName", $("#openo_input_userName").val());
- store("openo_input_password", $("#openo_input_password").val());
- } else {
- store.remove("remember");
- store.remove("openo_input_userName");
- store.remove("openo_input_password");
- }
-}
-
-function logoutSubmit() {
- $.ajax({
- url: "/openoapi/auth/v1/tokens" + "?=" + new Date().getTime(),
- type: "DELETE",
- contentType: "application/json",
- dataType: "text",
- success: function() {
- top.window.location = "/openoui/common/login.html";
- },
- error: function() {
- }
- })
-}
diff --git a/portal-common/src/main/webapp/common/js/mainpage/about.js b/portal-common/src/main/webapp/common/js/mainpage/about.js
deleted file mode 100644
index 2202f6af..00000000
--- a/portal-common/src/main/webapp/common/js/mainpage/about.js
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Copyright 2016-2017, CMCC Technologies Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var iniAboutInfo = function() {
-
- //转换colomn
-
- var divId = "ict_about_table_div";
- var tableId = "abouttable";
- var column = [
- {"mData": "name", name: $.i18n.prop('com_zte_ums_ict_about_ppu_field_name'), "sWidth": '20%'},
- {"mData": "version", name: $.i18n.prop('com_zte_ums_ict_about_ppu_field_version'), "sWidth": '25%'},
- {"mData": "describe", name: $.i18n.prop('com_zte_ums_ict_about_ppu_field_desc'), "sWidth": '25%'},
- {"mData": "time", name: $.i18n.prop('com_zte_ums_ict_about_ppu_field_time'), "sWidth": '30%'}
- ];
- //先把原来的表格清空
- $('#' + divId).children().remove();
- var tableEleStr = '<table class="table table-striped table-bordered table-hover" id= ' + tableId + '>'
- + '<thead>'
- + '<tr role="row" class="heading" >'
- + '</tr>'
- + '</thead>'
- + '<tbody>'
- + '</tbody>'
- + '</table>';
- $('#' + divId).append(tableEleStr);
- var trEle = $('#' + tableId + ' > thead >tr');
-
- for (var one in column) {
- var th = '<th>' + column[one].name + '</th>';
- trEle.append(th);
- }
- var table = $("#" + tableId).dataTable({
- "bFilter": false,// 搜索栏
- "bPaginate":false,
- "bInfo":false,
- "bSort":false,
- 'bAutoWidth':true
- });
- $.ajax({
- type: "GET",
- cache: false,
- url: FrameConst.REST_GET_VERSIONINFO,
- dataType: "json",
- success: function (data) {
- console.log(data);
- //主版本号
- $(".ict_main_version").append('<span>' + data.mainversion + '</span>');
- //表格数据填充
- for( var i = 0 ; i < data.ppuinfo.length ; i++ ) {
- var eachPPU = data.ppuinfo[i];
- $('#'+ tableId).dataTable().fnAddData([eachPPU.name ,eachPPU.version ,eachPPU.describe , eachPPU.time ]);
- }
- },
- error: function (xhr, ajaxOptions, thrownError) {
-
- }
- });
-};
-
-function internationalization(){
- var lang = getLanguage();
- //加载国际化
- jQuery.i18n.properties({
- language:lang,
- name:'web-framework-mainPage-i18n',
- path:'i18n/', // 资源文件路径
- mode:'map', // 用 Map 的方式使用资源文件中的值
- callback: function() {// 加载成功后设置显示内容
- var i18nItems = $('[name_i18n=com_zte_ums_ict_framework_ui_i18n]' , '.aboutDlg');
- for(var i=0;i<i18nItems.length;i++){
- var $item = $(i18nItems.eq(i));
- var itemId = $item.attr('id');
- if(typeof($item.attr("title"))!="undefined"){
- $item.attr("title", $.i18n.prop(itemId));
- }else{
- $item.text($.i18n.prop(itemId));
- }
- }
- }
- });
-
-}
-
-function getAboutDlg(url){
- if (url.length<2){
- return;
- }
- openoFrameWork.startPageLoading();//加载中....
- var aboutDiv =jQuery('.modal-dialog .aboutDlg');
- aboutDiv.empty();
- $.ajax({
- type: "GET",
- cache: false,
- url: url,
- dataType: "html",
- success: function (res) {
- jQuery('.modal-dialog .aboutDlg').append(res);
- iniAboutInfo();
- internationalization();
- openoFrameWork.stopPageLoading();
- },
- error: function (xhr, ajaxOptions, thrownError) {
-
- }
- });
-};
-
-function iniAboutDlg(){
- var url=jQuery('.modal-dialog .aboutDlg').attr("dlgsrc");
- if(url&&url.length>0){
- getAboutDlg(url);
- }
-};
-
-var ict_about_dlg_close = function(){
- link_click('about');
- console.log("about click close");
- $('#aboutDlg').modal('hide');
-};
-var link_click = function( pageName ){
- console.log("about click change");
- if(pageName === 'info'){
- $('.aboutmain').attr("style" , "display:none");
- $('.aboutinfo').attr("style" , "display:block");
- }else{
- $('.aboutmain').attr("style" , "display:block");
- $('.aboutinfo').attr("style" , "display:none");
- }
-};
diff --git a/portal-common/src/main/webapp/common/js/mainpage/load_mainPage.js b/portal-common/src/main/webapp/common/js/mainpage/load_mainPage.js
deleted file mode 100644
index 61dad58e..00000000
--- a/portal-common/src/main/webapp/common/js/mainpage/load_mainPage.js
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright 2016-2017, CMCC Technologies Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var initMainPage = function() {
- var modules;
- var propertiesFilePath = "i18n/";
- var propertiesFileName = "web-framework-mainPage-i18n";
- var i18nName = "openo_main_page_i18n";
-
- $.ajax({
- async : false,
- "type" : "GET",
- url : "json/main_page.json",
- dataType : "json",
- "success" : function (res, textStatus, jqXHR) {
- modules = res.modules;
- },
- error : function () {
- }
- });
-
- var template = "<div class='brick {image}'>" +
- "<a id='{linkId}' href='{url}' class='entranceLink'>" +
- "<div class='row'>" +
- "<div class='cover contentToggle'>{cover}</div>" +
- "<div class='{toolsImage}'></div>" +
- "<div class='contentTip contentToggle'>{contentTip}</div>" +
- "</div>" +
- "</a>" +
- "</div>";
-
- var templatePic = "<div class='brick {image}'>" +
- "<div class='row'>" +
- "<div class='cover contentToggle'>{cover}</div>" +
- "<div class='{toolsImage}'></div>" +
- "<div class='contentTip contentToggle'>{contentTip}</div>" +
- "</div>" +
- "</div>";
-
- for (var i = 0; i < modules.length; ++i) {
- var temp = "";
- if (modules[i].linkId) {
- temp = template.replace("{linkId}", modules[i].linkId)
- .replace("{image}", modules[i].background)
- .replace("{toolsImage}", modules[i].toolsImage)
- .replace("{url}", modules[i].url)
- .replace("{contentTip}", modules[i].contentTip);
- } else {
- temp = templatePic.replace("{image}", modules[i].background)
- .replace("{url}", modules[i].url)
- .replace("{contentTip}", "");
- }
-
- if (modules[i].cover) {
- temp = temp.replace("{cover}", "<span id='" + modules[i].cover + "' name_i18n='openo_main_page_i18n'></span>");
- } else {
- temp = temp.replace("{cover}","");
- }
-
- $($(".column")[i % 4]).append(temp);
- }
-
- $(function() {
- $(".brick").mouseover(function() {
- $(".contentTip", this).fadeTo(1000, 1);
- $(".cover", this).fadeOut(1000);
- });
-
- $(".brick").mouseout(function() {
- $(".contentTip", this).fadeTo(1000, 0);
- $(".cover", this).fadeIn(1000);
- });
-
- $("a.entranceLink").click(function(e) {
- e.preventDefault();
- if ($(this).attr("id") && $(this).attr("id") != "undefined") {
- location.href = "default.html" + "#_" + $(this).attr("id");
- }
- });
-
- loadi18n_WebFramework(propertiesFileName, propertiesFilePath, i18nName);
- });
-} \ No newline at end of file
diff --git a/portal-common/src/main/webapp/common/js/moreOperation.js b/portal-common/src/main/webapp/common/js/moreOperation.js
deleted file mode 100644
index 1f9121e1..00000000
--- a/portal-common/src/main/webapp/common/js/moreOperation.js
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Copyright 2016-2017, CMCC Technologies Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var resetSelectedItem=function(menuAlink){
- if(menuAlink.children('div.boxOperation').length>0){
- $(".box.boxOperation", $(".carousel-inner")).removeClass("moreButtonSelected");
- menuAlink.children('div.boxOperation').addClass('moreButtonSelected');
- }else if(menuAlink.parents('div.boxOperation').length>0){
- $(".box.boxOperation", $(".carousel-inner")).removeClass("moreButtonSelected");
- menuAlink.parents('div.boxOperation').addClass('moreButtonSelected');
- }
-}
-var reSelected=function(){
- if(openoFrameWork){
- var menuID = openoFrameWork.getLocationHash();
- var menuAlink = $('#'+ menuID,$('#pageableDiv'));
- if(menuAlink.length>0){
- resetSelectedItem(menuAlink);
- }else{
- menuAlink = $('#'+ menuID,$('.hor-menu'));
- if(!!menuAlink.attr("defaultchildmenuid")&&menuAlink.attr("defaultchildmenuid").length>0){
- menuAlink = $('#'+ menuAlink.attr("defaultchildmenuid"),$('#pageableDiv'));
- if(menuAlink.length>0){
- resetSelectedItem(menuAlink);
- }
- }
- }
- }
-}
-var inter=null;
-
-var clearMoreOperations=function(){
- $('#pageableDiv').removeClass("moreOpen");
- $('#pageableDiv').addClass("moreClose");
- $('.col-xs-12',$('#pageableDiv')).removeClass("moreOpen");
- $('.col-xs-12',$('#pageableDiv')).addClass("moreClose");
- $(".carousel-inner").children().remove();
- if (inter) {
- clearInterval(inter);
- };
-}
-
-var moreOperations = function(html){
- $('#pageableDiv').removeClass("moreClose");
- $('#pageableDiv').addClass("moreOpen");
- $('.col-xs-12',$('#pageableDiv')).removeClass("moreClose");
- $('.col-xs-12',$('#pageableDiv')).addClass("moreOpen");
- showArrow();
- $(".carousel-inner").children().remove();
- inter=setInterval(reSelected, 200);
- var moreViewData=[];
- var div = document.createElement('div');
- //div.innerHTML = html;
- $(div).append(html);
- var liTages =$("ul:first",div).children(); //div.getElementsByTagName('li')
- for(var i=0;i<liTages.length;i++){
- if(!$(liTages[i]).hasClass("divider")){
- var aLink = {};
- if($(liTages[i]).hasClass("dropdown")){//???????????
- var _litages=$(liTages[i]);
- aLink.html='<div class="box boxOperation">'+_litages.prop("outerHTML")+"</div>";
- }else{
- var aLinkTag = $("a", liTages[i]);
- aLink.id = aLinkTag.attr("id");
- var aLinkContent = aLinkTag.html();
- aLinkTag.empty().html('<div class="box boxOperation"></div>');
- $(".box", aLinkTag).html(aLinkContent);
- aLink.html = aLinkTag.prop("outerHTML");
- }
- moreViewData.push(aLink);
- }
- }
-
- var transformQueryViewData = function(queryViewData, pageSize){
- var newData = [];
- var pageNo = Math.floor(queryViewData.length / pageSize) + 1;
- if(queryViewData.length % pageSize == 0){
- pageNo--;
- }
- for(var i=0;i<pageNo;i++){
- newData.push({array:[]});
- }
- for(var j=0;j<queryViewData.length;j++){
- newData[Math.floor(j/pageSize)].array.push(queryViewData[j]);
- }
- return newData;
- }
-
- var moreOperationItems = [];
-
- var generateOperationItems = function(){
- for(var i=0;i<moreOperationItems.length;i++){
- var itemHtml = '<div id="page_' + i + '" class="item moreButtonsTag">' +
- '<div class="col-xs-12" style="padding-right: 20px;">' +
- "</div>" +
- "</div>";
- $(".carousel-inner").append(itemHtml);
- }
- for(var i=0;i<moreOperationItems.length;i++){
- for(var j=0;j<moreOperationItems[i].array.length;j++){
- var buttonHtml = '<div class="moreButton boxPadding">' + moreOperationItems[i].array[j].html + '</div>';
- $(".col-xs-12", $("#page_" + i + ".item")).append(buttonHtml);
- }
- }
- }
-
- //moreOperationItems = transformQueryViewData(moreViewData, 14);
-
- var moreOperationPageSize = 14;
- var windowWidth = $(window).width();
- if(windowWidth >= 1367 && windowWidth < 1441){
- moreOperationPageSize = 12;
- }else if(windowWidth >= 1281 && windowWidth < 1367){
- moreOperationPageSize = 11;
- }else if(windowWidth >= 1025 && windowWidth < 1281){
- moreOperationPageSize = 10;
- }else if(windowWidth >= 920 && windowWidth < 1281){
- moreOperationPageSize = 9;
- }else if(windowWidth >= 820 && windowWidth < 920){
- moreOperationPageSize = 8;
- }else if(windowWidth >= 680 && windowWidth < 820){
- moreOperationPageSize = 7;
- }else if(windowWidth >= 540 && windowWidth < 680){
- moreOperationPageSize = 4;
- }else if(windowWidth >= 390 && windowWidth < 540){
- moreOperationPageSize = 3;
- }else if(windowWidth < 390){
- moreOperationPageSize = 2;
- }
-
- moreOperationItems = transformQueryViewData(moreViewData, moreOperationPageSize);
- generateOperationItems();
-
- $(".box.boxOperation").click(function(){
- $(".box.boxOperation", $(".carousel-inner")).removeClass("moreButtonSelected");
- $(this).addClass("moreButtonSelected");
- });
-
- $($(".item", $(".carousel-inner"))[0]).addClass("active");
-
- if($(".item.moreButtonsTag").length < 2){
- hideArrow();
- }
-}
-
-var showArrow = function(){
- $(".carousel-control").show();
- $(".boxOperation").removeClass("boxOperationOnePage");
-}
-
-var hideArrow = function(){
- $(".carousel-control").hide();
- $(".boxOperation").addClass("boxOperationOnePage");
-}
diff --git a/portal-common/src/main/webapp/common/js/openotopo/openotopo.js b/portal-common/src/main/webapp/common/js/openotopo/openotopo.js
deleted file mode 100644
index a6735e72..00000000
--- a/portal-common/src/main/webapp/common/js/openotopo/openotopo.js
+++ /dev/null
@@ -1,314 +0,0 @@
-/*
- * Copyright 2016-2017, CMCC Technologies Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-function oTopo() {
-
- var topo;
-
- /**
- * <Creat topological graph object>
- * @param id: The id of DIV which display topological graph.
- * @param settings: Init parameters .
- * @see []
- */
- this.canvas = function (id, settings)
- {
- var g =
- {
- nodes : [],// nodes
- edges : [] // links
- };
-
- topo = new sigma(
- {
- graph : g,
- renderer :
- {
- // IMPORTANT:
- // This works only with the canvas renderer, so the
- // renderer type set as "canvas" is necessary here.
- container : document.getElementById(id),
- type : 'canvas'
- },
- settings : settings
- });
-
- CustomShapes.init(topo);
- };
-
-
- /**
- * <Refresh topological graph object>
- * @see []
- */
- this.refresh = function()
- {
- topo.refresh();
- };
-
-
- /**
- * <Creat node object>
- * @param id: The id of node.
- * @see []
- */
- this.Node = function(id)
- {
- var pr = this;
- this.id = id,
- this.label = "",
- this.type = "square",/**equilateral,star,square,diamond,circle,cross**/
- this.x = 1,
- this.y = 1,
- this.size = 10,
- this.image = {};
- this.color = "transparent",
- this.borderColor = "#1E90FF",
-
- this.setName = function(v)
- {
- pr.label = v;
- };
-
- this.setType = function(v)
- {
- pr.type = v;
- };
-
- this.setSize = function(v)
- {
- pr.size = v;
- };
-
- this.setImg = function(url)
- {
- pr.image =
- {
- url : url,
- // scale/clip are ratio values applied on top of 'size'
- scale : 1,
- clip : 0,
- };
- pr.borderColor = "transparent";
- pr.color = "transparent";
- };
-
- this.setImgScale = function(s)
- {
- pr.image.scale = s;
- };
-
- this.setImgClip = function(c)
- {
- pr.image.clip = c;
- };
-
- this.setColor = function(v)
- {
- pr.color = v;
- };
-
- this.setBorderColor = function(v)
- {
- pr.borderColor = v;
- };
-
- this.setLocation = function(x,y)
- {
- pr.x = x;
- pr.y = y;
- };
-
- this.setProperty = function(k,v)
- {
- pr[k] = v;
- };
- };
-
- /**
- * <Creat link object>
- * @param id: The id of link.
- * @see []
- */
- this.Link = function(id)
- {
- var pr = this;
- this.id = id,
- this.type = "arrow",/*'line','curve','arrow','curvedArrow','dashed','dotted','parallel','tapered'*/
- this.source = 1,
- this.target = 1,
- this.size = Math.random(),
- this.color = "#1E90FF",
-
- this.setType = function(v)
- {
- pr.type = v;
- };
-
- this.setSize = function(v)
- {
- pr.size = v;
- };
-
- this.setConnect = function(s,t)
- {
- pr.source = s;
- pr.target = t;
- };
-
- this.setColor = function(v)
- {
- pr.color = v;
- };
-
- this.setProperty = function(k,v)
- {
- pr[k] = v;
- };
- };
-
- /**
- * <Add node to the topological graph>
- * @param v: Node object.
- * @see []
- */
- this.addNode = function(v)
- {
- topo.graph.addNode(v);
- };
-
- /**
- * <Delete node from the topological graph>
- * @param id: The id of node.
- * @see []
- */
- this.dropNode = function(id)
- {
- topo.graph.dropNode(id);
- };
-
-
- /**
- * <Add link to the topological graph>
- * @param v: Link object.
- * @see []
- */
- this.addLink = function(v)
- {
- topo.graph.addEdge(v);
- };
-
- /**
- * <Delete link from the topological graph>
- * @param id: The id of link.
- * @see []
- */
- this.dropLink = function(id)
- {
- topo.graph.dropEdge(id);
- };
-
- /**
- * <Returns all of the nodes>
- * @see []
- */
- this.allNodes = function()
- {
- return topo.graph.nodes();
- };
-
- /**
- * Define drag and drop object.
- */
- var dragListener = null;
-
- /**
- * <Set the node drag and drop>
- * @param b: The node can be dragged and dropped when the parameter is TRUE.Set after canvas init.
- * @see []
- */
- this.setDrag = function(b)
- {
- if (b)
- {
- dragListener = sigma.plugins.dragNodes(topo, topo.renderers[0]);
- }
- };
-
- /**
- * <Binding the event of drag and drop>
- * @param method: The binding method include:startdrag,drag,drop,dragend.
- * @param e: Callback method.
- * @see []
- */
- var dragBind = function(method,e)
- {
- if (null != dragListener)
- {
- dragListener.bind(method, function(event){
- e(event);
- });
- }
- };
-
-
- /**
- * <Binding the event of mouse>
- * @param method: The binding method include:rightClick,clickStage,doubleClickStage,rightClickStage,clickNode,clickNodes,clickEdge,
- * clickEdges,doubleClickNode,doubleClickNodes,doubleClickEdge,doubleClickEdges,rightClickNode,
- * rightClickNodes,rightClickEdge,rightClickEdges,overNode,overNodes,overEdge,overEdges,outNode,
- * outNodes,outEdge,outEdges,downNode,downNodes,downEdge,downEdges,upNode,upNodes,upEdge,upEdges
- * @param e Callback method.
- * @see []
- */
- this.mouseBind = function(method,e)
- {
- if (null != topo)
- {
- topo.bind(method, function(event){
- e(event);
- });
- }
- };
-
-
- /**
- * <Disable the right mouse button for browser>
- * @param obj: The object to be disabled.
- * @see []
- */
- this.noright = function(obj) {
- if (obj) {
- obj.oncontextmenu = function() {
- return false;
- }
- obj.ondragstart = function() {
- return false;
- }
- obj.onselectstart = function() {
- return false;
- }
- obj.onselect = function() {
- obj.selection.empty();
- }
- obj.oncopy = function() {
- obj.selection.empty();
- }
- obj.onbeforecopy = function() {
- return false;
- }
- }
- }
-}
diff --git a/portal-common/src/main/webapp/common/js/openotopo/openotopo.min.js b/portal-common/src/main/webapp/common/js/openotopo/openotopo.min.js
deleted file mode 100644
index 3ad313a1..00000000
--- a/portal-common/src/main/webapp/common/js/openotopo/openotopo.min.js
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2016-2017, CMCC Technologies Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-(function(a){"use strict";var b={},c=function(a){var d,e,f,g,h;c.classes.dispatcher.extend(this);var i=this,j=a||{};if("string"==typeof j||j instanceof HTMLElement?j={renderers:[j]}:"[object Array]"===Object.prototype.toString.call(j)&&(j={renderers:j}),g=j.renderers||j.renderer||j.container,j.renderers&&0!==j.renderers.length||("string"==typeof g||g instanceof HTMLElement||"object"==typeof g&&"container"in g)&&(j.renderers=[g]),j.id){if(b[j.id])throw'sigma: Instance "'+j.id+'" already exists.';Object.defineProperty(this,"id",{value:j.id})}else{for(h=0;b[h];)h++;Object.defineProperty(this,"id",{value:""+h})}for(b[this.id]=this,this.settings=new c.classes.configurable(c.settings,j.settings||{}),Object.defineProperty(this,"graph",{value:new c.classes.graph(this.settings),configurable:!0}),Object.defineProperty(this,"middlewares",{value:[],configurable:!0}),Object.defineProperty(this,"cameras",{value:{},configurable:!0}),Object.defineProperty(this,"renderers",{value:{},configurable:!0}),Object.defineProperty(this,"renderersPerCamera",{value:{},configurable:!0}),Object.defineProperty(this,"cameraFrames",{value:{},configurable:!0}),Object.defineProperty(this,"camera",{get:function(){return this.cameras[0]}}),Object.defineProperty(this,"events",{value:["click","rightClick","clickStage","doubleClickStage","rightClickStage","clickNode","clickNodes","doubleClickNode","doubleClickNodes","rightClickNode","rightClickNodes","overNode","overNodes","outNode","outNodes","downNode","downNodes","upNode","upNodes"],configurable:!0}),this._handler=function(a){var b,c={};for(b in a.data)c[b]=a.data[b];c.renderer=a.target,this.dispatchEvent(a.type,c)}.bind(this),f=j.renderers||[],d=0,e=f.length;e>d;d++)this.addRenderer(f[d]);for(f=j.middlewares||[],d=0,e=f.length;e>d;d++)this.middlewares.push("string"==typeof f[d]?c.middlewares[f[d]]:f[d]);"object"==typeof j.graph&&j.graph&&(this.graph.read(j.graph),this.refresh()),window.addEventListener("resize",function(){i.settings&&i.refresh()})};if(c.prototype.addCamera=function(b){var d,e=this;if(!arguments.length){for(b=0;this.cameras[""+b];)b++;b=""+b}if(this.cameras[b])throw'sigma.addCamera: The camera "'+b+'" already exists.';return d=new c.classes.camera(b,this.graph,this.settings),this.cameras[b]=d,d.quadtree=new c.classes.quad,c.classes.edgequad!==a&&(d.edgequadtree=new c.classes.edgequad),d.bind("coordinatesUpdated",function(a){e.renderCamera(d,d.isAnimated)}),this.renderersPerCamera[b]=[],d},c.prototype.killCamera=function(a){if(a="string"==typeof a?this.cameras[a]:a,!a)throw"sigma.killCamera: The camera is undefined.";var b,c,d=this.renderersPerCamera[a.id];for(c=d.length,b=c-1;b>=0;b--)this.killRenderer(d[b]);return delete this.renderersPerCamera[a.id],delete this.cameraFrames[a.id],delete this.cameras[a.id],a.kill&&a.kill(),this},c.prototype.addRenderer=function(a){var b,d,e,f,g=a||{};if("string"==typeof g?g={container:document.getElementById(g)}:g instanceof HTMLElement&&(g={container:g}),"string"==typeof g.container&&(g.container=document.getElementById(g.container)),"id"in g)b=g.id;else{for(b=0;this.renderers[""+b];)b++;b=""+b}if(this.renderers[b])throw'sigma.addRenderer: The renderer "'+b+'" already exists.';if(d="function"==typeof g.type?g.type:c.renderers[g.type],d=d||c.renderers.def,e="camera"in g?g.camera instanceof c.classes.camera?g.camera:this.cameras[g.camera]||this.addCamera(g.camera):this.addCamera(),this.cameras[e.id]!==e)throw"sigma.addRenderer: The camera is not properly referenced.";return f=new d(this.graph,e,this.settings,g),this.renderers[b]=f,Object.defineProperty(f,"id",{value:b}),f.bind&&f.bind(["click","rightClick","clickStage","doubleClickStage","rightClickStage","clickNode","clickNodes","clickEdge","clickEdges","doubleClickNode","doubleClickNodes","doubleClickEdge","doubleClickEdges","rightClickNode","rightClickNodes","rightClickEdge","rightClickEdges","overNode","overNodes","overEdge","overEdges","outNode","outNodes","outEdge","outEdges","downNode","downNodes","downEdge","downEdges","upNode","upNodes","upEdge","upEdges"],this._handler),this.renderersPerCamera[e.id].push(f),f},c.prototype.killRenderer=function(a){if(a="string"==typeof a?this.renderers[a]:a,!a)throw"sigma.killRenderer: The renderer is undefined.";var b=this.renderersPerCamera[a.camera.id],c=b.indexOf(a);return c>=0&&b.splice(c,1),a.kill&&a.kill(),delete this.renderers[a.id],this},c.prototype.refresh=function(b){var d,e,f,g,h,i,j=0;for(b=b||{},g=this.middlewares||[],d=0,e=g.length;e>d;d++)g[d].call(this,0===d?"":"tmp"+j+":",d===e-1?"ready:":"tmp"+ ++j+":");for(f in this.cameras)h=this.cameras[f],h.settings("autoRescale")&&this.renderersPerCamera[h.id]&&this.renderersPerCamera[h.id].length?c.middlewares.rescale.call(this,g.length?"ready:":"",h.readPrefix,{width:this.renderersPerCamera[h.id][0].width,height:this.renderersPerCamera[h.id][0].height}):c.middlewares.copy.call(this,g.length?"ready:":"",h.readPrefix),b.skipIndexation||(i=c.utils.getBoundaries(this.graph,h.readPrefix),h.quadtree.index(this.graph.nodes(),{prefix:h.readPrefix,bounds:{x:i.minX,y:i.minY,width:i.maxX-i.minX,height:i.maxY-i.minY}}),h.edgequadtree!==a&&h.settings("drawEdges")&&h.settings("enableEdgeHovering")&&h.edgequadtree.index(this.graph,{prefix:h.readPrefix,bounds:{x:i.minX,y:i.minY,width:i.maxX-i.minX,height:i.maxY-i.minY}}));for(g=Object.keys(this.renderers),d=0,e=g.length;e>d;d++)if(this.renderers[g[d]].process)if(this.settings("skipErrors"))try{this.renderers[g[d]].process()}catch(k){console.log('Warning: The renderer "'+g[d]+'" crashed on ".process()"')}else this.renderers[g[d]].process();return this.render(),this},c.prototype.render=function(){var a,b,c;for(c=Object.keys(this.renderers),a=0,b=c.length;b>a;a++)if(this.settings("skipErrors"))try{this.renderers[c[a]].render()}catch(d){this.settings("verbose")&&console.log('Warning: The renderer "'+c[a]+'" crashed on ".render()"')}else this.renderers[c[a]].render();return this},c.prototype.renderCamera=function(a,b){var c,d,e,f=this;if(b)for(e=this.renderersPerCamera[a.id],c=0,d=e.length;d>c;c++)if(this.settings("skipErrors"))try{e[c].render()}catch(g){this.settings("verbose")&&console.log('Warning: The renderer "'+e[c].id+'" crashed on ".render()"')}else e[c].render();else if(!this.cameraFrames[a.id]){for(e=this.renderersPerCamera[a.id],c=0,d=e.length;d>c;c++)if(this.settings("skipErrors"))try{e[c].render()}catch(g){this.settings("verbose")&&console.log('Warning: The renderer "'+e[c].id+'" crashed on ".render()"')}else e[c].render();this.cameraFrames[a.id]=requestAnimationFrame(function(){delete f.cameraFrames[a.id]})}return this},c.prototype.kill=function(){var a;this.dispatchEvent("kill"),this.graph.kill(),delete this.middlewares;for(a in this.renderers)this.killRenderer(this.renderers[a]);for(a in this.cameras)this.killCamera(this.cameras[a]);delete this.renderers,delete this.cameras;for(a in this)this.hasOwnProperty(a)&&delete this[a];delete b[this.id]},c.instances=function(a){return arguments.length?b[a]:c.utils.extend({},b)},c.version="1.0.3","undefined"!=typeof this.sigma)throw"An object called sigma is already in the global scope.";this.sigma=c}).call(this),function(a){"use strict";function b(a,c){var d,e,f,g;if(arguments.length)if(1===arguments.length&&Object(arguments[0])===arguments[0])for(a in arguments[0])b(a,arguments[0][a]);else if(arguments.length>1)for(g=Array.isArray(a)?a:a.split(/ /),d=0,e=g.length;d!==e;d+=1)f=g[d],C[f]||(C[f]=[]),C[f].push({handler:c})}function c(a,b){var c,d,e,f,g,h,i=Array.isArray(a)?a:a.split(/ /);if(arguments.length)if(b)for(c=0,d=i.length;c!==d;c+=1){if(h=i[c],C[h]){for(g=[],e=0,f=C[h].length;e!==f;e+=1)C[h][e].handler!==b&&g.push(C[h][e]);C[h]=g}C[h]&&0===C[h].length&&delete C[h]}else for(c=0,d=i.length;c!==d;c+=1)delete C[i[c]];else C=Object.create(null)}function d(a,b){var c,d,e,f,g,h,i=Array.isArray(a)?a:a.split(/ /);for(b=void 0===b?{}:b,c=0,e=i.length;c!==e;c+=1)if(h=i[c],C[h])for(g={type:h,data:b||{}},d=0,f=C[h].length;d!==f;d+=1)try{C[h][d].handler(g)}catch(j){}}function e(){var a,b,c,d,e=!1,f=s(),g=x.shift();if(c=g.job(),f=s()-f,g.done++,g.time+=f,g.currentTime+=f,g.weightTime=g.currentTime/(g.weight||1),g.averageTime=g.time/g.done,d=g.count?g.count<=g.done:!c,!d){for(a=0,b=x.length;b>a;a++)if(x[a].weightTime>g.weightTime){x.splice(a,0,g),e=!0;break}e||x.push(g)}return d?g:null}function f(a){var b=x.length;w[a.id]=a,a.status="running",b&&(a.weightTime=x[b-1].weightTime,a.currentTime=a.weightTime*(a.weight||1)),a.startTime=s(),d("jobStarted",q(a)),x.push(a)}function g(){var a,b,c;for(a in v)b=v[a],b.after?y[a]=b:f(b),delete v[a];for(u=!!x.length;x.length&&s()-t<B.frameDuration;)if(c=e()){i(c.id);for(a in y)y[a].after===c.id&&(f(y[a]),delete y[a])}u?(t=s(),d("enterFrame"),setTimeout(g,0)):d("stop")}function h(a,b){var c,e,f;if(Array.isArray(a)){for(A=!0,c=0,e=a.length;e>c;c++)h(a[c].id,p(a[c],b));A=!1,u||(t=s(),d("start"),g())}else if("object"==typeof a)if("string"==typeof a.id)h(a.id,a);else{A=!0;for(c in a)"function"==typeof a[c]?h(c,p({job:a[c]},b)):h(c,p(a[c],b));A=!1,u||(t=s(),d("start"),g())}else{if("string"!=typeof a)throw new Error("[conrad.addJob] Wrong arguments.");if(k(a))throw new Error('[conrad.addJob] Job with id "'+a+'" already exists.');if("function"==typeof b)f={id:a,done:0,time:0,status:"waiting",currentTime:0,averageTime:0,weightTime:0,job:b};else{if("object"!=typeof b)throw new Error("[conrad.addJob] Wrong arguments.");f=p({id:a,done:0,time:0,status:"waiting",currentTime:0,averageTime:0,weightTime:0},b)}v[a]=f,d("jobAdded",q(f)),u||A||(t=s(),d("start"),g())}return this}function i(a){var b,c,e,f,g=!1;if(Array.isArray(a))for(b=0,c=a.length;c>b;b++)i(a[b]);else{if("string"!=typeof a)throw new Error("[conrad.killJob] Wrong arguments.");for(e=[w,y,v],b=0,c=e.length;c>b;b++)a in e[b]&&(f=e[b][a],B.history&&(f.status="done",z.push(f)),d("jobEnded",q(f)),delete e[b][a],"function"==typeof f.end&&f.end(),g=!0);for(e=x,b=0,c=e.length;c>b;b++)if(e[b].id===a){e.splice(b,1);break}if(!g)throw new Error('[conrad.killJob] Job "'+a+'" not found.')}return this}function j(){var a,b=p(v,w,y);if(B.history)for(a in b)b[a].status="done",z.push(b[a]),"function"==typeof b[a].end&&b[a].end();return v={},y={},w={},x=[],u=!1,this}function k(a){var b=v[a]||w[a]||y[a];return b?p(b):null}function l(a,b){var c;if("string"==typeof a1&&1===arguments.length)return B[a1];c="object"==typeof a1&&1===arguments.length?a1||{}:{},"string"==typeof a1&&(c[a1]=a2);for(var d in c)void 0!==c[d]?B[d]=c[d]:delete B[d];return this}function m(){return u}function n(){return z=[],this}function o(a,b){var c,d,e,f,g,h,i;if(!arguments.length){g=[];for(d in v)g.push(v[d]);for(d in y)g.push(y[d]);for(d in w)g.push(w[d]);g=g.concat(z)}if("string"==typeof a)switch(a){case"waiting":g=r(y);break;case"running":g=r(w);break;case"done":g=z;break;default:h=a}if(a instanceof RegExp&&(h=a),!h&&("string"==typeof b||b instanceof RegExp)&&(h=b),h){if(i="string"==typeof h,g instanceof Array)c=g;else if("object"==typeof g){c=[];for(d in g)c=c.concat(g[d])}else{c=[];for(d in v)c.push(v[d]);for(d in y)c.push(y[d]);for(d in w)c.push(w[d]);c=c.concat(z)}for(g=[],e=0,f=c.length;f>e;e++)(i?c[e].id===h:c[e].id.match(h))&&g.push(c[e])}return q(g)}function p(){var a,b,c={},d=arguments.length;for(a=d-1;a>=0;a--)for(b in arguments[a])c[b]=arguments[a][b];return c}function q(a){var b,c,d;if(!a)return a;if(Array.isArray(a))for(b=[],c=0,d=a.length;d>c;c++)b.push(q(a[c]));else if("object"==typeof a){b={};for(c in a)b[c]=q(a[c])}else b=a;return b}function r(a){var b,c=[];for(b in a)c.push(a[b]);return c}function s(){return Date.now?Date.now():(new Date).getTime()}if(a.conrad)throw new Error("conrad already exists");var t,u=!1,v={},w={},x=[],y={},z=[],A=!1,B={frameDuration:20,history:!0},C=Object.create(null);Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});var D={hasJob:k,addJob:h,killJob:i,killAll:j,settings:l,getStats:o,isRunning:m,clearHistory:n,bind:b,unbind:c,version:"0.1.0"};"undefined"!=typeof exports&&("undefined"!=typeof module&&module.exports&&(exports=module.exports=D),exports.conrad=D),a.conrad=D}(this),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";var b=this;sigma.utils=sigma.utils||{},sigma.utils.extend=function(){var a,b,c={},d=arguments.length;for(a=d-1;a>=0;a--)for(b in arguments[a])c[b]=arguments[a][b];return c},sigma.utils.dateNow=function(){return Date.now?Date.now():(new Date).getTime()},sigma.utils.pkg=function(a){return(a||"").split(".").reduce(function(a,b){return b in a?a[b]:a[b]={}},b)},sigma.utils.id=function(){var a=0;return function(){return++a}}(),sigma.utils.floatColor=function(a){var b=[0,0,0];return a.match(/^#/)?(a=(a||"").replace(/^#/,""),b=3===a.length?[parseInt(a.charAt(0)+a.charAt(0),16),parseInt(a.charAt(1)+a.charAt(1),16),parseInt(a.charAt(2)+a.charAt(2),16)]:[parseInt(a.charAt(0)+a.charAt(1),16),parseInt(a.charAt(2)+a.charAt(3),16),parseInt(a.charAt(4)+a.charAt(5),16)]):a.match(/^ *rgba? *\(/)&&(a=a.match(/^ *rgba? *\( *([0-9]*) *, *([0-9]*) *, *([0-9]*) *(,.*)?\) *$/),b=[+a[1],+a[2],+a[3]]),256*b[0]*256+256*b[1]+b[2]},sigma.utils.zoomTo=function(a,b,c,d,e){var f,g,h,i=a.settings;g=Math.max(i("zoomMin"),Math.min(i("zoomMax"),a.ratio*d)),g!==a.ratio&&(d=g/a.ratio,h={x:b*(1-d)+a.x,y:c*(1-d)+a.y,ratio:g},e&&e.duration?(f=sigma.misc.animation.killAll(a),e=sigma.utils.extend(e,{easing:f?"quadraticOut":"quadraticInOut"}),sigma.misc.animation.camera(a,h,e)):(a.goTo(h),e&&e.onComplete&&e.onComplete()))},sigma.utils.getQuadraticControlPoint=function(a,b,c,d){return{x:(a+c)/2+(d-b)/4,y:(b+d)/2+(a-c)/4}},sigma.utils.getPointOnQuadraticCurve=function(a,b,c,d,e,f,g){return{x:Math.pow(1-a,2)*b+2*(1-a)*a*f+Math.pow(a,2)*d,y:Math.pow(1-a,2)*c+2*(1-a)*a*g+Math.pow(a,2)*e}},sigma.utils.getPointOnBezierCurve=function(a,b,c,d,e,f,g,h,i){var j=Math.pow(1-a,3),k=3*a*Math.pow(1-a,2),l=3*Math.pow(a,2)*(1-a),m=Math.pow(a,3);return{x:j*b+k*f+l*h+m*d,y:j*c+k*g+l*i+m*e}},sigma.utils.getSelfLoopControlPoints=function(a,b,c){return{x1:a-7*c,y1:b,x2:a,y2:b+7*c}},sigma.utils.getDistance=function(a,b,c,d){return Math.sqrt(Math.pow(c-a,2)+Math.pow(d-b,2))},sigma.utils.getCircleIntersection=function(a,b,c,d,e,f){var g,h,i,j,k,l,m,n,o;if(h=d-a,i=e-b,j=Math.sqrt(i*i+h*h),j>c+f)return!1;if(j<Math.abs(c-f))return!1;g=(c*c-f*f+j*j)/(2*j),n=a+h*g/j,o=b+i*g/j,k=Math.sqrt(c*c-g*g),l=-i*(k/j),m=h*(k/j);var p=n+l,q=n-l,r=o+m,s=o-m;return{xi:p,xi_prime:q,yi:r,yi_prime:s}},sigma.utils.isPointOnSegment=function(a,b,c,d,e,f,g){var h=Math.abs((b-d)*(e-c)-(a-c)*(f-d)),i=sigma.utils.getDistance(c,d,e,f),j=h/i;return g>j&&Math.min(c,e)<=a&&a<=Math.max(c,e)&&Math.min(d,f)<=b&&b<=Math.max(d,f)},sigma.utils.isPointOnQuadraticCurve=function(a,b,c,d,e,f,g,h,i){var j=sigma.utils.getDistance(c,d,e,f);if(Math.abs(a-c)>j||Math.abs(b-d)>j)return!1;for(var k,l=sigma.utils.getDistance(a,b,c,d),m=sigma.utils.getDistance(a,b,e,f),n=.5,o=m>l?-.01:.01,p=.001,q=100,r=sigma.utils.getPointOnQuadraticCurve(n,c,d,e,f,g,h),s=sigma.utils.getDistance(a,b,r.x,r.y);q-- >0&&n>=0&&1>=n&&s>i&&(o>p||-p>o);)k=s,r=sigma.utils.getPointOnQuadraticCurve(n,c,d,e,f,g,h),s=sigma.utils.getDistance(a,b,r.x,r.y),s>k?(o=-o/2,n+=o):0>n+o||n+o>1?(o/=2,s=k):n+=o;return i>s},sigma.utils.isPointOnBezierCurve=function(a,b,c,d,e,f,g,h,i,j,k){var l=sigma.utils.getDistance(c,d,g,h);if(Math.abs(a-c)>l||Math.abs(b-d)>l)return!1;for(var m,n=sigma.utils.getDistance(a,b,c,d),o=sigma.utils.getDistance(a,b,e,f),p=.5,q=o>n?-.01:.01,r=.001,s=100,t=sigma.utils.getPointOnBezierCurve(p,c,d,e,f,g,h,i,j),u=sigma.utils.getDistance(a,b,t.x,t.y);s-- >0&&p>=0&&1>=p&&u>k&&(q>r||-r>q);)m=u,t=sigma.utils.getPointOnBezierCurve(p,c,d,e,f,g,h,i,j),u=sigma.utils.getDistance(a,b,t.x,t.y),u>m?(q=-q/2,p+=q):0>p+q||p+q>1?(q/=2,u=m):p+=q;return k>u},sigma.utils.getX=function(b){return b.offsetX!==a&&b.offsetX||b.layerX!==a&&b.layerX||b.clientX!==a&&b.clientX},sigma.utils.getY=function(b){return b.offsetY!==a&&b.offsetY||b.layerY!==a&&b.layerY||b.clientY!==a&&b.clientY},sigma.utils.getWidth=function(b){var c=b.target.ownerSVGElement?b.target.ownerSVGElement.width:b.target.width;return"number"==typeof c&&c||c!==a&&c.baseVal!==a&&c.baseVal.value},sigma.utils.getHeight=function(b){var c=b.target.ownerSVGElement?b.target.ownerSVGElement.height:b.target.height;return"number"==typeof c&&c||c!==a&&c.baseVal!==a&&c.baseVal.value},sigma.utils.getDelta=function(b){return b.wheelDelta!==a&&b.wheelDelta||b.detail!==a&&-b.detail},sigma.utils.getOffset=function(a){for(var b=0,c=0;a;)c+=parseInt(a.offsetTop),b+=parseInt(a.offsetLeft),a=a.offsetParent;return{top:c,left:b}},sigma.utils.doubleClick=function(a,b,c){var d,e=0;a._doubleClickHandler=a._doubleClickHandler||{},a._doubleClickHandler[b]=a._doubleClickHandler[b]||[],d=a._doubleClickHandler[b],d.push(function(a){return e++,2===e?(e=0,c(a)):void(1===e&&setTimeout(function(){e=0},sigma.settings.doubleClickTimeout))}),a.addEventListener(b,d[d.length-1],!1)},sigma.utils.unbindDoubleClick=function(a,b){for(var c,d=(a._doubleClickHandler||{})[b]||[];c=d.pop();)a.removeEventListener(b,c);delete(a._doubleClickHandler||{})[b]},sigma.utils.easings=sigma.utils.easings||{},sigma.utils.easings.linearNone=function(a){return a},sigma.utils.easings.quadraticIn=function(a){return a*a},sigma.utils.easings.quadraticOut=function(a){return a*(2-a)},sigma.utils.easings.quadraticInOut=function(a){return(a*=2)<1?.5*a*a:-.5*(--a*(a-2)-1)},sigma.utils.easings.cubicIn=function(a){return a*a*a},sigma.utils.easings.cubicOut=function(a){return--a*a*a+1},sigma.utils.easings.cubicInOut=function(a){return(a*=2)<1?.5*a*a*a:.5*((a-=2)*a*a+2)},sigma.utils.loadShader=function(a,b,c,d){var e,f=a.createShader(c);return a.shaderSource(f,b),a.compileShader(f),e=a.getShaderParameter(f,a.COMPILE_STATUS),e?f:(d&&d('Error compiling shader "'+f+'":'+a.getShaderInfoLog(f)),a.deleteShader(f),null)},sigma.utils.loadProgram=function(a,b,c,d,e){var f,g,h=a.createProgram();for(f=0;f<b.length;++f)a.attachShader(h,b[f]);if(c)for(f=0;f<c.length;++f)a.bindAttribLocation(h,locations?locations[f]:f,opt_attribs[f]);return a.linkProgram(h),g=a.getProgramParameter(h,a.LINK_STATUS),g?h:(e&&e("Error in program linking: "+a.getProgramInfoLog(h)),a.deleteProgram(h),null)},sigma.utils.pkg("sigma.utils.matrices"),sigma.utils.matrices.translation=function(a,b){return[1,0,0,0,1,0,a,b,1]},sigma.utils.matrices.rotation=function(a,b){var c=Math.cos(a),d=Math.sin(a);return b?[c,-d,d,c]:[c,-d,0,d,c,0,0,0,1]},sigma.utils.matrices.scale=function(a,b){return b?[a,0,0,a]:[a,0,0,0,a,0,0,0,1]},sigma.utils.matrices.multiply=function(a,b,c){var d=c?2:3,e=a[0*d+0],f=a[0*d+1],g=a[0*d+2],h=a[1*d+0],i=a[1*d+1],j=a[1*d+2],k=a[2*d+0],l=a[2*d+1],m=a[2*d+2],n=b[0*d+0],o=b[0*d+1],p=b[0*d+2],q=b[1*d+0],r=b[1*d+1],s=b[1*d+2],t=b[2*d+0],u=b[2*d+1],v=b[2*d+2];return c?[e*n+f*q,e*o+f*r,h*n+i*q,h*o+i*r]:[e*n+f*q+g*t,e*o+f*r+g*u,e*p+f*s+g*v,h*n+i*q+j*t,h*o+i*r+j*u,h*p+i*s+j*v,k*n+l*q+m*t,k*o+l*r+m*u,k*p+l*s+m*v]}}.call(this),function(a){"use strict";var b,c=0,d=["ms","moz","webkit","o"];for(b=0;b<d.length&&!a.requestAnimationFrame;b++)a.requestAnimationFrame=a[d[b]+"RequestAnimationFrame"],a.cancelAnimationFrame=a[d[b]+"CancelAnimationFrame"]||a[d[b]+"CancelRequestAnimationFrame"];a.requestAnimationFrame||(a.requestAnimationFrame=function(b,d){var e=(new Date).getTime(),f=Math.max(0,16-(e-c)),g=a.setTimeout(function(){b(e+f)},f);return c=e+f,g}),a.cancelAnimationFrame||(a.cancelAnimationFrame=function(a){clearTimeout(a)}),Function.prototype.bind||(Function.prototype.bind=function(a){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var b,c,d=Array.prototype.slice.call(arguments,1),e=this;return b=function(){},c=function(){return e.apply(this instanceof b&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))},b.prototype=this.prototype,c.prototype=new b,c})}(this),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.settings");var b={clone:!0,immutable:!0,verbose:!1,classPrefix:"sigma",defaultNodeType:"def",defaultEdgeType:"def",defaultLabelColor:"#000",defaultEdgeColor:"#000",defaultNodeColor:"#000",defaultLabelSize:14,edgeColor:"source",minArrowSize:0,font:"arial",fontStyle:"",labelColor:"default",labelSize:"fixed",labelSizeRatio:1,labelThreshold:8,webglOversamplingRatio:2,borderSize:0,defaultNodeBorderColor:"#000",hoverFont:"",singleHover:!0,hoverFontStyle:"",labelHoverShadow:"default",labelHoverShadowColor:"#000",nodeHoverColor:"node",defaultNodeHoverColor:"#000",labelHoverBGColor:"default",defaultHoverLabelBGColor:"#fff",labelHoverColor:"default",defaultLabelHoverColor:"#000",edgeHoverColor:"edge",edgeHoverSizeRatio:1,defaultEdgeHoverColor:"#000",edgeHoverExtremities:!1,drawEdges:!0,drawNodes:!0,drawLabels:!0,drawEdgeLabels:!1,batchEdgesDrawing:!1,hideEdgesOnMove:!1,canvasEdgesBatchSize:500,webglEdgesBatchSize:1e3,scalingMode:"inside",sideMargin:0,minEdgeSize:.5,maxEdgeSize:1,minNodeSize:1,maxNodeSize:8,touchEnabled:!0,mouseEnabled:!0,mouseWheelEnabled:!0,doubleClickEnabled:!0,eventsEnabled:!0,zoomingRatio:1.7,doubleClickZoomingRatio:2.2,zoomMin:.0625,zoomMax:2,mouseZoomDuration:200,doubleClickZoomDuration:200,mouseInertiaDuration:200,mouseInertiaRatio:3,touchInertiaDuration:200,touchInertiaRatio:3,doubleClickTimeout:300,doubleTapTimeout:300,dragTimeout:200,autoResize:!0,autoRescale:!0,enableCamera:!0,enableHovering:!0,enableEdgeHovering:!1,edgeHoverPrecision:5,rescaleIgnoreSize:!1,skipErrors:!1,nodesPowRatio:.5,edgesPowRatio:.5,animationsTime:200};sigma.settings=sigma.utils.extend(sigma.settings||{},b)}.call(this),function(){"use strict";var a=function(){Object.defineProperty(this,"_handlers",{value:{}})};a.prototype.bind=function(a,b){var c,d,e,f;if(1===arguments.length&&"object"==typeof arguments[0])for(a in arguments[0])this.bind(a,arguments[0][a]);else{if(2!==arguments.length||"function"!=typeof arguments[1])throw"bind: Wrong arguments.";for(f="string"==typeof a?a.split(" "):a,c=0,d=f.length;c!==d;c+=1)e=f[c],e&&(this._handlers[e]||(this._handlers[e]=[]),this._handlers[e].push({handler:b}))}return this},a.prototype.unbind=function(a,b){var c,d,e,f,g,h,i,j="string"==typeof a?a.split(" "):a;if(!arguments.length){for(g in this._handlers)delete this._handlers[g];return this}if(b)for(c=0,d=j.length;c!==d;c+=1){if(i=j[c],this._handlers[i]){for(h=[],e=0,f=this._handlers[i].length;e!==f;e+=1)this._handlers[i][e].handler!==b&&h.push(this._handlers[i][e]);this._handlers[i]=h}this._handlers[i]&&0===this._handlers[i].length&&delete this._handlers[i]}else for(c=0,d=j.length;c!==d;c+=1)delete this._handlers[j[c]];return this},a.prototype.dispatchEvent=function(a,b){var c,d,e,f,g,h,i,j=this,k="string"==typeof a?a.split(" "):a;for(b=void 0===b?{}:b,c=0,d=k.length;c!==d;c+=1)if(i=k[c],this._handlers[i]){for(h=j.getEvent(i,b),g=[],e=0,f=this._handlers[i].length;e!==f;e+=1)this._handlers[i][e].handler(h),this._handlers[i][e].one||g.push(this._handlers[i][e]);this._handlers[i]=g}return this},a.prototype.getEvent=function(a,b){return{type:a,data:b||{},target:this}},a.extend=function(b,c){var d;for(d in a.prototype)a.prototype.hasOwnProperty(d)&&(b[d]=a.prototype[d]);a.apply(b,c)},"undefined"!=typeof this.sigma?(this.sigma.classes=this.sigma.classes||{},this.sigma.classes.dispatcher=a):"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=a),exports.dispatcher=a):this.dispatcher=a}.call(this),function(){"use strict";var a=function(){var b,c,d={},e=Array.prototype.slice.call(arguments,0),f=function(a,b){var c,g,h,i;{if(1!==arguments.length||"string"!=typeof a){if("object"==typeof a&&"string"==typeof b)return void 0!==(a||{})[b]?a[b]:f(b);for(c="object"==typeof a&&void 0===b?a:{},"string"==typeof a&&(c[a]=b),g=0,i=Object.keys(c),h=i.length;h>g;g++)d[i[g]]=c[i[g]];return this}if(void 0!==d[a])return d[a];for(g=0,h=e.length;h>g;g++)if(void 0!==e[g][a])return e[g][a]}};for(f.embedObjects=function(){var b=e.concat(d).concat(Array.prototype.splice.call(arguments,0));return a.apply({},b)},b=0,c=arguments.length;c>b;b++)f(arguments[b]);return f};"undefined"!=typeof this.sigma?(this.sigma.classes=this.sigma.classes||{},this.sigma.classes.configurable=a):"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=a),exports.configurable=a):this.configurable=a}.call(this),function(a){"use strict";function b(a,b,c){var d=function(){var d,e;for(d in h[a])h[a][d].apply(b,arguments);e=c.apply(b,arguments);for(d in g[a])g[a][d].apply(b,arguments);return e};return d}function c(a){var b;for(b in a)"hasOwnProperty"in a&&!a.hasOwnProperty(b)||delete a[b];return a}var d=Object.create(null),e=Object.create(null),f=Object.create(null),g=Object.create(null),h=Object.create(null),i={immutable:!0,clone:!0},j=function(a){return i[a]},k=function(a){var c,e,g;g={settings:a||j,nodesArray:[],edgesArray:[],nodesIndex:Object.create(null),edgesIndex:Object.create(null),inNeighborsIndex:Object.create(null),outNeighborsIndex:Object.create(null),allNeighborsIndex:Object.create(null),inNeighborsCount:Object.create(null),outNeighborsCount:Object.create(null),allNeighborsCount:Object.create(null)};for(c in f)f[c].call(g);for(c in d)e=b(c,g,d[c]),this[c]=e,g[c]=e};k.addMethod=function(a,b){if("string"!=typeof a||"function"!=typeof b||2!==arguments.length)throw"addMethod: Wrong arguments.";if(d[a]||k[a])throw'The method "'+a+'" already exists.';return d[a]=b,g[a]=Object.create(null),h[a]=Object.create(null),this},k.hasMethod=function(a){return!(!d[a]&&!k[a])},k.attach=function(a,b,c,d){if("string"!=typeof a||"string"!=typeof b||"function"!=typeof c||arguments.length<3||arguments.length>4)throw"attach: Wrong arguments.";var e;if("constructor"===a)e=f;else if(d){if(!h[a])throw'The method "'+a+'" does not exist.';e=h[a]}else{if(!g[a])throw'The method "'+a+'" does not exist.';e=g[a]}if(e[b])throw'A function "'+b+'" is already attached to the method "'+a+'".';return e[b]=c,this},k.attachBefore=function(a,b,c){return this.attach(a,b,c,!0)},k.addIndex=function(a,b){if("string"!=typeof a||Object(b)!==b||2!==arguments.length)throw"addIndex: Wrong arguments.";if(e[a])throw'The index "'+a+'" already exists.';var c;e[a]=b;for(c in b){if("function"!=typeof b[c])throw"The bindings must be functions.";k.attach(c,a,b[c])}return this},k.addMethod("addNode",function(a){if(Object(a)!==a||1!==arguments.length)throw"addNode: Wrong arguments.";if("string"!=typeof a.id&&"number"!=typeof a.id)throw"The node must have a string or number id.";if(this.nodesIndex[a.id])throw'The node "'+a.id+'" already exists.';var b,c=a.id,d=Object.create(null);if(this.settings("clone"))for(b in a)"id"!==b&&(d[b]=a[b]);else d=a;return this.settings("immutable")?Object.defineProperty(d,"id",{value:c,enumerable:!0}):d.id=c,this.inNeighborsIndex[c]=Object.create(null),this.outNeighborsIndex[c]=Object.create(null),this.allNeighborsIndex[c]=Object.create(null),this.inNeighborsCount[c]=0,this.outNeighborsCount[c]=0,this.allNeighborsCount[c]=0,this.nodesArray.push(d),this.nodesIndex[d.id]=d,this}),k.addMethod("addEdge",function(a){if(Object(a)!==a||1!==arguments.length)throw"addEdge: Wrong arguments.";if("string"!=typeof a.id&&"number"!=typeof a.id)throw"The edge must have a string or number id.";if("string"!=typeof a.source&&"number"!=typeof a.source||!this.nodesIndex[a.source])throw"The edge source must have an existing node id.";if("string"!=typeof a.target&&"number"!=typeof a.target||!this.nodesIndex[a.target])throw"The edge target must have an existing node id.";if(this.edgesIndex[a.id])throw'The edge "'+a.id+'" already exists.';var b,c=Object.create(null);if(this.settings("clone"))for(b in a)"id"!==b&&"source"!==b&&"target"!==b&&(c[b]=a[b]);else c=a;return this.settings("immutable")?(Object.defineProperty(c,"id",{value:a.id,enumerable:!0}),Object.defineProperty(c,"source",{value:a.source,enumerable:!0}),Object.defineProperty(c,"target",{value:a.target,enumerable:!0})):(c.id=a.id,c.source=a.source,c.target=a.target),this.edgesArray.push(c),this.edgesIndex[c.id]=c,this.inNeighborsIndex[c.target][c.source]||(this.inNeighborsIndex[c.target][c.source]=Object.create(null)),this.inNeighborsIndex[c.target][c.source][c.id]=c,this.outNeighborsIndex[c.source][c.target]||(this.outNeighborsIndex[c.source][c.target]=Object.create(null)),this.outNeighborsIndex[c.source][c.target][c.id]=c,this.allNeighborsIndex[c.source][c.target]||(this.allNeighborsIndex[c.source][c.target]=Object.create(null)),this.allNeighborsIndex[c.source][c.target][c.id]=c,c.target!==c.source&&(this.allNeighborsIndex[c.target][c.source]||(this.allNeighborsIndex[c.target][c.source]=Object.create(null)),this.allNeighborsIndex[c.target][c.source][c.id]=c),this.inNeighborsCount[c.target]++,this.outNeighborsCount[c.source]++,this.allNeighborsCount[c.target]++,this.allNeighborsCount[c.source]++,this}),k.addMethod("dropNode",function(a){if("string"!=typeof a&&"number"!=typeof a||1!==arguments.length)throw"dropNode: Wrong arguments.";if(!this.nodesIndex[a])throw'The node "'+a+'" does not exist.';var b,c,d;for(delete this.nodesIndex[a],b=0,d=this.nodesArray.length;d>b;b++)if(this.nodesArray[b].id===a){this.nodesArray.splice(b,1);break}for(b=this.edgesArray.length-1;b>=0;b--)(this.edgesArray[b].source===a||this.edgesArray[b].target===a)&&this.dropEdge(this.edgesArray[b].id);delete this.inNeighborsIndex[a],delete this.outNeighborsIndex[a],delete this.allNeighborsIndex[a],delete this.inNeighborsCount[a],delete this.outNeighborsCount[a],delete this.allNeighborsCount[a];for(c in this.nodesIndex)delete this.inNeighborsIndex[c][a],delete this.outNeighborsIndex[c][a],delete this.allNeighborsIndex[c][a];return this}),k.addMethod("dropEdge",function(a){if("string"!=typeof a&&"number"!=typeof a||1!==arguments.length)throw"dropEdge: Wrong arguments.";if(!this.edgesIndex[a])throw'The edge "'+a+'" does not exist.';var b,c,d;for(d=this.edgesIndex[a],delete this.edgesIndex[a],b=0,c=this.edgesArray.length;c>b;b++)if(this.edgesArray[b].id===a){this.edgesArray.splice(b,1);break}return delete this.inNeighborsIndex[d.target][d.source][d.id],Object.keys(this.inNeighborsIndex[d.target][d.source]).length||delete this.inNeighborsIndex[d.target][d.source],delete this.outNeighborsIndex[d.source][d.target][d.id],Object.keys(this.outNeighborsIndex[d.source][d.target]).length||delete this.outNeighborsIndex[d.source][d.target],delete this.allNeighborsIndex[d.source][d.target][d.id],Object.keys(this.allNeighborsIndex[d.source][d.target]).length||delete this.allNeighborsIndex[d.source][d.target],d.target!==d.source&&(delete this.allNeighborsIndex[d.target][d.source][d.id],Object.keys(this.allNeighborsIndex[d.target][d.source]).length||delete this.allNeighborsIndex[d.target][d.source]),this.inNeighborsCount[d.target]--,this.outNeighborsCount[d.source]--,this.allNeighborsCount[d.source]--,this.allNeighborsCount[d.target]--,this}),k.addMethod("kill",function(){this.nodesArray.length=0,this.edgesArray.length=0,delete this.nodesArray,delete this.edgesArray,delete this.nodesIndex,delete this.edgesIndex,delete this.inNeighborsIndex,delete this.outNeighborsIndex,delete this.allNeighborsIndex,delete this.inNeighborsCount,delete this.outNeighborsCount,delete this.allNeighborsCount}),k.addMethod("clear",function(){return this.nodesArray.length=0,this.edgesArray.length=0,c(this.nodesIndex),c(this.edgesIndex),c(this.nodesIndex),c(this.inNeighborsIndex),c(this.outNeighborsIndex),c(this.allNeighborsIndex),c(this.inNeighborsCount),c(this.outNeighborsCount),c(this.allNeighborsCount),this}),k.addMethod("read",function(a){var b,c,d;for(c=a.nodes||[],b=0,d=c.length;d>b;b++)this.addNode(c[b]);for(c=a.edges||[],b=0,d=c.length;d>b;b++)this.addEdge(c[b]);return this}),k.addMethod("nodes",function(a){if(!arguments.length)return this.nodesArray.slice(0);if(1===arguments.length&&("string"==typeof a||"number"==typeof a))return this.nodesIndex[a];if(1===arguments.length&&"[object Array]"===Object.prototype.toString.call(a)){
-var b,c,d=[];for(b=0,c=a.length;c>b;b++){if("string"!=typeof a[b]&&"number"!=typeof a[b])throw"nodes: Wrong arguments.";d.push(this.nodesIndex[a[b]])}return d}throw"nodes: Wrong arguments."}),k.addMethod("degree",function(a,b){if(b={"in":this.inNeighborsCount,out:this.outNeighborsCount}[b||""]||this.allNeighborsCount,"string"==typeof a||"number"==typeof a)return b[a];if("[object Array]"===Object.prototype.toString.call(a)){var c,d,e=[];for(c=0,d=a.length;d>c;c++){if("string"!=typeof a[c]&&"number"!=typeof a[c])throw"degree: Wrong arguments.";e.push(b[a[c]])}return e}throw"degree: Wrong arguments."}),k.addMethod("edges",function(a){if(!arguments.length)return this.edgesArray.slice(0);if(1===arguments.length&&("string"==typeof a||"number"==typeof a))return this.edgesIndex[a];if(1===arguments.length&&"[object Array]"===Object.prototype.toString.call(a)){var b,c,d=[];for(b=0,c=a.length;c>b;b++){if("string"!=typeof a[b]&&"number"!=typeof a[b])throw"edges: Wrong arguments.";d.push(this.edgesIndex[a[b]])}return d}throw"edges: Wrong arguments."}),"undefined"!=typeof sigma?(sigma.classes=sigma.classes||Object.create(null),sigma.classes.graph=k):"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=k),exports.graph=k):this.graph=k}.call(this),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.classes"),sigma.classes.camera=function(a,b,c,d){sigma.classes.dispatcher.extend(this),Object.defineProperty(this,"graph",{value:b}),Object.defineProperty(this,"id",{value:a}),Object.defineProperty(this,"readPrefix",{value:"read_cam"+a+":"}),Object.defineProperty(this,"prefix",{value:"cam"+a+":"}),this.x=0,this.y=0,this.ratio=1,this.angle=0,this.isAnimated=!1,this.settings="object"==typeof d&&d?c.embedObject(d):c},sigma.classes.camera.prototype.goTo=function(b){if(!this.settings("enableCamera"))return this;var c,d,e=b||{},f=["x","y","ratio","angle"];for(c=0,d=f.length;d>c;c++)if(e[f[c]]!==a){if("number"!=typeof e[f[c]]||isNaN(e[f[c]]))throw'Value for "'+f[c]+'" is not a number.';this[f[c]]=e[f[c]]}return this.dispatchEvent("coordinatesUpdated"),this},sigma.classes.camera.prototype.applyView=function(b,c,d){d=d||{},c=c!==a?c:this.prefix,b=b!==a?b:this.readPrefix;var e,f,g,h=d.nodes||this.graph.nodes(),i=d.edges||this.graph.edges(),j=Math.cos(this.angle),k=Math.sin(this.angle),l=Math.pow(this.ratio,this.settings("nodesPowRatio")),m=Math.pow(this.ratio,this.settings("edgesPowRatio"));for(e=0,f=h.length;f>e;e++)g=h[e],g[c+"x"]=(((g[b+"x"]||0)-this.x)*j+((g[b+"y"]||0)-this.y)*k)/this.ratio+(d.width||0)/2,g[c+"y"]=(((g[b+"y"]||0)-this.y)*j-((g[b+"x"]||0)-this.x)*k)/this.ratio+(d.height||0)/2,g[c+"size"]=(g[b+"size"]||0)/l;for(e=0,f=i.length;f>e;e++)i[e][c+"size"]=(i[e][b+"size"]||0)/m;return this},sigma.classes.camera.prototype.graphPosition=function(a,b,c){var d=0,e=0,f=Math.cos(this.angle),g=Math.sin(this.angle);return c||(d=-(this.x*f+this.y*g)/this.ratio,e=-(this.y*f-this.x*g)/this.ratio),{x:(a*f+b*g)/this.ratio+d,y:(b*f-a*g)/this.ratio+e}},sigma.classes.camera.prototype.cameraPosition=function(a,b,c){var d=0,e=0,f=Math.cos(this.angle),g=Math.sin(this.angle);return c||(d=-(this.x*f+this.y*g)/this.ratio,e=-(this.y*f-this.x*g)/this.ratio),{x:((a-d)*f-(b-e)*g)*this.ratio,y:((b-e)*f+(a-d)*g)*this.ratio}},sigma.classes.camera.prototype.getMatrix=function(){var a=sigma.utils.matrices.scale(1/this.ratio),b=sigma.utils.matrices.rotation(this.angle),c=sigma.utils.matrices.translation(-this.x,-this.y),d=sigma.utils.matrices.multiply(c,sigma.utils.matrices.multiply(b,a));return d},sigma.classes.camera.prototype.getRectangle=function(a,b){var c=this.cameraPosition(a,0,!0),d=this.cameraPosition(0,b,!0),e=this.cameraPosition(a/2,b/2,!0),f=this.cameraPosition(a/4,0,!0).x,g=this.cameraPosition(0,b/4,!0).y;return{x1:this.x-e.x-f,y1:this.y-e.y-g,x2:this.x-e.x+f+c.x,y2:this.y-e.y-g+c.y,height:Math.sqrt(Math.pow(d.x,2)+Math.pow(d.y+2*g,2))}}}.call(this),function(a){"use strict";function b(a,b){var c=b.x+b.width/2,d=b.y+b.height/2,e=a.y<d,f=a.x<c;return e?f?0:1:f?2:3}function c(a,b){for(var c=[],d=0;4>d;d++)a.x2>=b[d][0].x&&a.x1<=b[d][1].x&&a.y1+a.height>=b[d][0].y&&a.y1<=b[d][2].y&&c.push(d);return c}function d(a,b){for(var c=[],d=0;4>d;d++)j.collision(a,b[d])&&c.push(d);return c}function e(a,b){var c,d,e=b.level+1,f=Math.round(b.bounds.width/2),g=Math.round(b.bounds.height/2),h=Math.round(b.bounds.x),j=Math.round(b.bounds.y);switch(a){case 0:c=h,d=j;break;case 1:c=h+f,d=j;break;case 2:c=h,d=j+g;break;case 3:c=h+f,d=j+g}return i({x:c,y:d,width:f,height:g},e,b.maxElements,b.maxLevel)}function f(b,d,g){if(g.level<g.maxLevel)for(var h=c(d,g.corners),i=0,j=h.length;j>i;i++)g.nodes[h[i]]===a&&(g.nodes[h[i]]=e(h[i],g)),f(b,d,g.nodes[h[i]]);else g.elements.push(b)}function g(c,d){if(d.level<d.maxLevel){var e=b(c,d.bounds);return d.nodes[e]!==a?g(c,d.nodes[e]):[]}return d.elements}function h(b,c,d,e){if(e=e||{},c.level<c.maxLevel)for(var f=d(b,c.corners),g=0,i=f.length;i>g;g++)c.nodes[f[g]]!==a&&h(b,c.nodes[f[g]],d,e);else for(var j=0,k=c.elements.length;k>j;j++)e[c.elements[j].id]===a&&(e[c.elements[j].id]=c.elements[j]);return e}function i(a,b,c,d){return{level:b||0,bounds:a,corners:j.splitSquare(a),maxElements:c||20,maxLevel:d||4,elements:[],nodes:[]}}var j={pointToSquare:function(a){return{x1:a.x-a.size,y1:a.y-a.size,x2:a.x+a.size,y2:a.y-a.size,height:2*a.size}},isAxisAligned:function(a){return a.x1===a.x2||a.y1===a.y2},axisAlignedTopPoints:function(a){return a.y1===a.y2&&a.x1<a.x2?a:a.x1===a.x2&&a.y2>a.y1?{x1:a.x1-a.height,y1:a.y1,x2:a.x1,y2:a.y1,height:a.height}:a.x1===a.x2&&a.y2<a.y1?{x1:a.x1,y1:a.y2,x2:a.x2+a.height,y2:a.y2,height:a.height}:{x1:a.x2,y1:a.y1-a.height,x2:a.x1,y2:a.y1-a.height,height:a.height}},lowerLeftCoor:function(a){var b=Math.sqrt(Math.pow(a.x2-a.x1,2)+Math.pow(a.y2-a.y1,2));return{x:a.x1-(a.y2-a.y1)*a.height/b,y:a.y1+(a.x2-a.x1)*a.height/b}},lowerRightCoor:function(a,b){return{x:b.x-a.x1+a.x2,y:b.y-a.y1+a.y2}},rectangleCorners:function(a){var b=this.lowerLeftCoor(a),c=this.lowerRightCoor(a,b);return[{x:a.x1,y:a.y1},{x:a.x2,y:a.y2},{x:b.x,y:b.y},{x:c.x,y:c.y}]},splitSquare:function(a){return[[{x:a.x,y:a.y},{x:a.x+a.width/2,y:a.y},{x:a.x,y:a.y+a.height/2},{x:a.x+a.width/2,y:a.y+a.height/2}],[{x:a.x+a.width/2,y:a.y},{x:a.x+a.width,y:a.y},{x:a.x+a.width/2,y:a.y+a.height/2},{x:a.x+a.width,y:a.y+a.height/2}],[{x:a.x,y:a.y+a.height/2},{x:a.x+a.width/2,y:a.y+a.height/2},{x:a.x,y:a.y+a.height},{x:a.x+a.width/2,y:a.y+a.height}],[{x:a.x+a.width/2,y:a.y+a.height/2},{x:a.x+a.width,y:a.y+a.height/2},{x:a.x+a.width/2,y:a.y+a.height},{x:a.x+a.width,y:a.y+a.height}]]},axis:function(a,b){return[{x:a[1].x-a[0].x,y:a[1].y-a[0].y},{x:a[1].x-a[3].x,y:a[1].y-a[3].y},{x:b[0].x-b[2].x,y:b[0].y-b[2].y},{x:b[0].x-b[1].x,y:b[0].y-b[1].y}]},projection:function(a,b){var c=(a.x*b.x+a.y*b.y)/(Math.pow(b.x,2)+Math.pow(b.y,2));return{x:c*b.x,y:c*b.y}},axisCollision:function(a,b,c){for(var d=[],e=[],f=0;4>f;f++){var g=this.projection(b[f],a),h=this.projection(c[f],a);d.push(g.x*a.x+g.y*a.y),e.push(h.x*a.x+h.y*a.y)}var i=Math.max.apply(Math,d),j=Math.max.apply(Math,e),k=Math.min.apply(Math,d),l=Math.min.apply(Math,e);return i>=l&&j>=k},collision:function(a,b){for(var c=this.axis(a,b),d=!0,e=0;4>e;e++)d=d&&this.axisCollision(c[e],a,b);return d}},k=function(){this._geom=j,this._tree=null,this._cache={query:!1,result:!1}};k.prototype.index=function(a,b){if(!b.bounds)throw"sigma.classes.quad.index: bounds information not given.";var c=b.prefix||"";this._tree=i(b.bounds,0,b.maxElements,b.maxLevel);for(var d=0,e=a.length;e>d;d++)f(a[d],j.pointToSquare({x:a[d][c+"x"],y:a[d][c+"y"],size:a[d][c+"size"]}),this._tree);return this._cache={query:!1,result:!1},this._tree},k.prototype.point=function(a,b){return this._tree?g({x:a,y:b},this._tree)||[]:[]},k.prototype.area=function(a){var b,e,f=JSON.stringify(a);if(this._cache.query===f)return this._cache.result;j.isAxisAligned(a)?(b=c,e=j.axisAlignedTopPoints(a)):(b=d,e=j.rectangleCorners(a));var g=this._tree?h(e,this._tree,b):[],i=[];for(var k in g)i.push(g[k]);return this._cache.query=f,this._cache.result=i,i},"undefined"!=typeof this.sigma?(this.sigma.classes=this.sigma.classes||{},this.sigma.classes.quad=k):"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=k),exports.quad=k):this.quad=k}.call(this),function(a){"use strict";function b(a,b){var c=b.x+b.width/2,d=b.y+b.height/2,e=a.y<d,f=a.x<c;return e?f?0:1:f?2:3}function c(a,b){for(var c=[],d=0;4>d;d++)a.x2>=b[d][0].x&&a.x1<=b[d][1].x&&a.y1+a.height>=b[d][0].y&&a.y1<=b[d][2].y&&c.push(d);return c}function d(a,b){for(var c=[],d=0;4>d;d++)j.collision(a,b[d])&&c.push(d);return c}function e(a,b){var c,d,e=b.level+1,f=Math.round(b.bounds.width/2),g=Math.round(b.bounds.height/2),h=Math.round(b.bounds.x),j=Math.round(b.bounds.y);switch(a){case 0:c=h,d=j;break;case 1:c=h+f,d=j;break;case 2:c=h,d=j+g;break;case 3:c=h+f,d=j+g}return i({x:c,y:d,width:f,height:g},e,b.maxElements,b.maxLevel)}function f(b,d,g){if(g.level<g.maxLevel)for(var h=c(d,g.corners),i=0,j=h.length;j>i;i++)g.nodes[h[i]]===a&&(g.nodes[h[i]]=e(h[i],g)),f(b,d,g.nodes[h[i]]);else g.elements.push(b)}function g(c,d){if(d.level<d.maxLevel){var e=b(c,d.bounds);return d.nodes[e]!==a?g(c,d.nodes[e]):[]}return d.elements}function h(b,c,d,e){if(e=e||{},c.level<c.maxLevel)for(var f=d(b,c.corners),g=0,i=f.length;i>g;g++)c.nodes[f[g]]!==a&&h(b,c.nodes[f[g]],d,e);else for(var j=0,k=c.elements.length;k>j;j++)e[c.elements[j].id]===a&&(e[c.elements[j].id]=c.elements[j]);return e}function i(a,b,c,d){return{level:b||0,bounds:a,corners:j.splitSquare(a),maxElements:c||40,maxLevel:d||8,elements:[],nodes:[]}}var j={pointToSquare:function(a){return{x1:a.x-a.size,y1:a.y-a.size,x2:a.x+a.size,y2:a.y-a.size,height:2*a.size}},lineToSquare:function(a){return a.y1<a.y2?a.x1<a.x2?{x1:a.x1-a.size,y1:a.y1-a.size,x2:a.x2+a.size,y2:a.y1-a.size,height:a.y2-a.y1+2*a.size}:{x1:a.x2-a.size,y1:a.y1-a.size,x2:a.x1+a.size,y2:a.y1-a.size,height:a.y2-a.y1+2*a.size}:a.x1<a.x2?{x1:a.x1-a.size,y1:a.y2-a.size,x2:a.x2+a.size,y2:a.y2-a.size,height:a.y1-a.y2+2*a.size}:{x1:a.x2-a.size,y1:a.y2-a.size,x2:a.x1+a.size,y2:a.y2-a.size,height:a.y1-a.y2+2*a.size}},quadraticCurveToSquare:function(a,b){var c=sigma.utils.getPointOnQuadraticCurve(.5,a.x1,a.y1,a.x2,a.y2,b.x,b.y),d=Math.min(a.x1,a.x2,c.x),e=Math.max(a.x1,a.x2,c.x),f=Math.min(a.y1,a.y2,c.y),g=Math.max(a.y1,a.y2,c.y);return{x1:d-a.size,y1:f-a.size,x2:e+a.size,y2:f-a.size,height:g-f+2*a.size}},selfLoopToSquare:function(a){var b=sigma.utils.getSelfLoopControlPoints(a.x,a.y,a.size),c=Math.min(a.x,b.x1,b.x2),d=Math.max(a.x,b.x1,b.x2),e=Math.min(a.y,b.y1,b.y2),f=Math.max(a.y,b.y1,b.y2);return{x1:c-a.size,y1:e-a.size,x2:d+a.size,y2:e-a.size,height:f-e+2*a.size}},isAxisAligned:function(a){return a.x1===a.x2||a.y1===a.y2},axisAlignedTopPoints:function(a){return a.y1===a.y2&&a.x1<a.x2?a:a.x1===a.x2&&a.y2>a.y1?{x1:a.x1-a.height,y1:a.y1,x2:a.x1,y2:a.y1,height:a.height}:a.x1===a.x2&&a.y2<a.y1?{x1:a.x1,y1:a.y2,x2:a.x2+a.height,y2:a.y2,height:a.height}:{x1:a.x2,y1:a.y1-a.height,x2:a.x1,y2:a.y1-a.height,height:a.height}},lowerLeftCoor:function(a){var b=Math.sqrt(Math.pow(a.x2-a.x1,2)+Math.pow(a.y2-a.y1,2));return{x:a.x1-(a.y2-a.y1)*a.height/b,y:a.y1+(a.x2-a.x1)*a.height/b}},lowerRightCoor:function(a,b){return{x:b.x-a.x1+a.x2,y:b.y-a.y1+a.y2}},rectangleCorners:function(a){var b=this.lowerLeftCoor(a),c=this.lowerRightCoor(a,b);return[{x:a.x1,y:a.y1},{x:a.x2,y:a.y2},{x:b.x,y:b.y},{x:c.x,y:c.y}]},splitSquare:function(a){return[[{x:a.x,y:a.y},{x:a.x+a.width/2,y:a.y},{x:a.x,y:a.y+a.height/2},{x:a.x+a.width/2,y:a.y+a.height/2}],[{x:a.x+a.width/2,y:a.y},{x:a.x+a.width,y:a.y},{x:a.x+a.width/2,y:a.y+a.height/2},{x:a.x+a.width,y:a.y+a.height/2}],[{x:a.x,y:a.y+a.height/2},{x:a.x+a.width/2,y:a.y+a.height/2},{x:a.x,y:a.y+a.height},{x:a.x+a.width/2,y:a.y+a.height}],[{x:a.x+a.width/2,y:a.y+a.height/2},{x:a.x+a.width,y:a.y+a.height/2},{x:a.x+a.width/2,y:a.y+a.height},{x:a.x+a.width,y:a.y+a.height}]]},axis:function(a,b){return[{x:a[1].x-a[0].x,y:a[1].y-a[0].y},{x:a[1].x-a[3].x,y:a[1].y-a[3].y},{x:b[0].x-b[2].x,y:b[0].y-b[2].y},{x:b[0].x-b[1].x,y:b[0].y-b[1].y}]},projection:function(a,b){var c=(a.x*b.x+a.y*b.y)/(Math.pow(b.x,2)+Math.pow(b.y,2));return{x:c*b.x,y:c*b.y}},axisCollision:function(a,b,c){for(var d=[],e=[],f=0;4>f;f++){var g=this.projection(b[f],a),h=this.projection(c[f],a);d.push(g.x*a.x+g.y*a.y),e.push(h.x*a.x+h.y*a.y)}var i=Math.max.apply(Math,d),j=Math.max.apply(Math,e),k=Math.min.apply(Math,d),l=Math.min.apply(Math,e);return i>=l&&j>=k},collision:function(a,b){for(var c=this.axis(a,b),d=!0,e=0;4>e;e++)d=d&&this.axisCollision(c[e],a,b);return d}},k=function(){this._geom=j,this._tree=null,this._cache={query:!1,result:!1},this._enabled=!0};k.prototype.index=function(a,b){if(!this._enabled)return this._tree;if(!b.bounds)throw"sigma.classes.edgequad.index: bounds information not given.";var c,d,e,g,h,k=b.prefix||"";this._tree=i(b.bounds,0,b.maxElements,b.maxLevel);for(var l=a.edges(),m=0,n=l.length;n>m;m++)d=a.nodes(l[m].source),e=a.nodes(l[m].target),h={x1:d[k+"x"],y1:d[k+"y"],x2:e[k+"x"],y2:e[k+"y"],size:l[m][k+"size"]||0},"curve"===l[m].type||"curvedArrow"===l[m].type?d.id===e.id?(g={x:d[k+"x"],y:d[k+"y"],size:d[k+"size"]||0},f(l[m],j.selfLoopToSquare(g),this._tree)):(c=sigma.utils.getQuadraticControlPoint(h.x1,h.y1,h.x2,h.y2),f(l[m],j.quadraticCurveToSquare(h,c),this._tree)):f(l[m],j.lineToSquare(h),this._tree);return this._cache={query:!1,result:!1},this._tree},k.prototype.point=function(a,b){return this._enabled&&this._tree?g({x:a,y:b},this._tree)||[]:[]},k.prototype.area=function(a){if(!this._enabled)return[];var b,e,f=JSON.stringify(a);if(this._cache.query===f)return this._cache.result;j.isAxisAligned(a)?(b=c,e=j.axisAlignedTopPoints(a)):(b=d,e=j.rectangleCorners(a));var g=this._tree?h(e,this._tree,b):[],i=[];for(var k in g)i.push(g[k]);return this._cache.query=f,this._cache.result=i,i},"undefined"!=typeof this.sigma?(this.sigma.classes=this.sigma.classes||{},this.sigma.classes.edgequad=k):"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=k),exports.edgequad=k):this.edgequad=k}.call(this),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.captors"),sigma.captors.mouse=function(a,b,c){function d(a){var b,c,d;return y("mouseEnabled")&&v.dispatchEvent("mousemove",{x:sigma.utils.getX(a)-sigma.utils.getWidth(a)/2,y:sigma.utils.getY(a)-sigma.utils.getHeight(a)/2,clientX:a.clientX,clientY:a.clientY,ctrlKey:a.ctrlKey,metaKey:a.metaKey,altKey:a.altKey,shiftKey:a.shiftKey}),y("mouseEnabled")&&q?(r=!0,s=!0,u&&clearTimeout(u),u=setTimeout(function(){r=!1},y("dragTimeout")),sigma.misc.animation.killAll(x),x.isMoving=!0,d=x.cameraPosition(sigma.utils.getX(a)-o,sigma.utils.getY(a)-p,!0),b=k-d.x,c=l-d.y,(b!==x.x||c!==x.y)&&(m=x.x,n=x.y,x.goTo({x:b,y:c})),a.preventDefault?a.preventDefault():a.returnValue=!1,a.stopPropagation(),!1):void 0}function e(a){if(y("mouseEnabled")&&q){q=!1,u&&clearTimeout(u),x.isMoving=!1;var b=sigma.utils.getX(a),c=sigma.utils.getY(a);r?(sigma.misc.animation.killAll(x),sigma.misc.animation.camera(x,{x:x.x+y("mouseInertiaRatio")*(x.x-m),y:x.y+y("mouseInertiaRatio")*(x.y-n)},{easing:"quadraticOut",duration:y("mouseInertiaDuration")})):(o!==b||p!==c)&&x.goTo({x:x.x,y:x.y}),v.dispatchEvent("mouseup",{x:b-sigma.utils.getWidth(a)/2,y:c-sigma.utils.getHeight(a)/2,clientX:a.clientX,clientY:a.clientY,ctrlKey:a.ctrlKey,metaKey:a.metaKey,altKey:a.altKey,shiftKey:a.shiftKey}),r=!1}}function f(a){if(y("mouseEnabled"))switch(k=x.x,l=x.y,m=x.x,n=x.y,o=sigma.utils.getX(a),p=sigma.utils.getY(a),s=!1,t=(new Date).getTime(),a.which){case 2:break;case 3:v.dispatchEvent("rightclick",{x:o-sigma.utils.getWidth(a)/2,y:p-sigma.utils.getHeight(a)/2,clientX:a.clientX,clientY:a.clientY,ctrlKey:a.ctrlKey,metaKey:a.metaKey,altKey:a.altKey,shiftKey:a.shiftKey});break;default:q=!0,v.dispatchEvent("mousedown",{x:o-sigma.utils.getWidth(a)/2,y:p-sigma.utils.getHeight(a)/2,clientX:a.clientX,clientY:a.clientY,ctrlKey:a.ctrlKey,metaKey:a.metaKey,altKey:a.altKey,shiftKey:a.shiftKey})}}function g(a){y("mouseEnabled")&&v.dispatchEvent("mouseout")}function h(a){return y("mouseEnabled")&&v.dispatchEvent("click",{x:sigma.utils.getX(a)-sigma.utils.getWidth(a)/2,y:sigma.utils.getY(a)-sigma.utils.getHeight(a)/2,clientX:a.clientX,clientY:a.clientY,ctrlKey:a.ctrlKey,metaKey:a.metaKey,altKey:a.altKey,shiftKey:a.shiftKey,isDragging:(new Date).getTime()-t>100&&s}),a.preventDefault?a.preventDefault():a.returnValue=!1,a.stopPropagation(),!1}function i(a){var b,c,d;return y("mouseEnabled")?(c=1/y("doubleClickZoomingRatio"),v.dispatchEvent("doubleclick",{x:o-sigma.utils.getWidth(a)/2,y:p-sigma.utils.getHeight(a)/2,clientX:a.clientX,clientY:a.clientY,ctrlKey:a.ctrlKey,metaKey:a.metaKey,altKey:a.altKey,shiftKey:a.shiftKey}),y("doubleClickEnabled")&&(b=x.cameraPosition(sigma.utils.getX(a)-sigma.utils.getWidth(a)/2,sigma.utils.getY(a)-sigma.utils.getHeight(a)/2,!0),d={duration:y("doubleClickZoomDuration")},sigma.utils.zoomTo(x,b.x,b.y,c,d)),a.preventDefault?a.preventDefault():a.returnValue=!1,a.stopPropagation(),!1):void 0}function j(a){var b,c,d;return y("mouseEnabled")&&y("mouseWheelEnabled")?(c=sigma.utils.getDelta(a)>0?1/y("zoomingRatio"):y("zoomingRatio"),b=x.cameraPosition(sigma.utils.getX(a)-sigma.utils.getWidth(a)/2,sigma.utils.getY(a)-sigma.utils.getHeight(a)/2,!0),d={duration:y("mouseZoomDuration")},sigma.utils.zoomTo(x,b.x,b.y,c,d),a.preventDefault?a.preventDefault():a.returnValue=!1,a.stopPropagation(),!1):void 0}var k,l,m,n,o,p,q,r,s,t,u,v=this,w=a,x=b,y=c;sigma.classes.dispatcher.extend(this),sigma.utils.doubleClick(w,"click",i),w.addEventListener("DOMMouseScroll",j,!1),w.addEventListener("mousewheel",j,!1),w.addEventListener("mousemove",d,!1),w.addEventListener("mousedown",f,!1),w.addEventListener("click",h,!1),w.addEventListener("mouseout",g,!1),document.addEventListener("mouseup",e,!1),this.kill=function(){sigma.utils.unbindDoubleClick(w,"click"),w.removeEventListener("DOMMouseScroll",j),w.removeEventListener("mousewheel",j),w.removeEventListener("mousemove",d),w.removeEventListener("mousedown",f),w.removeEventListener("click",h),w.removeEventListener("mouseout",g),document.removeEventListener("mouseup",e)}}}.call(this),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.captors"),sigma.captors.touch=function(a,b,c){function d(a){var b=sigma.utils.getOffset(B);return{x:a.pageX-b.left,y:a.pageY-b.top}}function e(a){if(D("touchEnabled")){var b,c,e,f,g,h;switch(E=a.touches,E.length){case 1:C.isMoving=!0,w=1,i=C.x,j=C.y,m=C.x,n=C.y,g=d(E[0]),q=g.x,r=g.y;break;case 2:return C.isMoving=!0,w=2,g=d(E[0]),h=d(E[1]),b=g.x,e=g.y,c=h.x,f=h.y,m=C.x,n=C.y,k=C.angle,l=C.ratio,i=C.x,j=C.y,q=b,r=e,s=c,t=f,u=Math.atan2(t-r,s-q),v=Math.sqrt(Math.pow(t-r,2)+Math.pow(s-q,2)),a.preventDefault(),!1}}}function f(a){if(D("touchEnabled")){E=a.touches;var b=D("touchInertiaRatio");switch(z&&(x=!1,clearTimeout(z)),w){case 2:if(1===a.touches.length){e(a),a.preventDefault();break}case 1:C.isMoving=!1,A.dispatchEvent("stopDrag"),x&&(y=!1,sigma.misc.animation.camera(C,{x:C.x+b*(C.x-m),y:C.y+b*(C.y-n)},{easing:"quadraticOut",duration:D("touchInertiaDuration")})),x=!1,w=0}}}function g(a){if(!y&&D("touchEnabled")){var b,c,e,f,g,h,B,F,G,H,I,J,K,L,M,N,O;switch(E=a.touches,x=!0,z&&clearTimeout(z),z=setTimeout(function(){x=!1},D("dragTimeout")),w){case 1:F=d(E[0]),b=F.x,e=F.y,H=C.cameraPosition(b-q,e-r,!0),L=i-H.x,M=j-H.y,(L!==C.x||M!==C.y)&&(m=C.x,n=C.y,C.goTo({x:L,y:M}),A.dispatchEvent("mousemove",{x:F.x-sigma.utils.getWidth(a)/2,y:F.y-sigma.utils.getHeight(a)/2,clientX:a.clientX,clientY:a.clientY,ctrlKey:a.ctrlKey,metaKey:a.metaKey,altKey:a.altKey,shiftKey:a.shiftKey}),A.dispatchEvent("drag"));break;case 2:F=d(E[0]),G=d(E[1]),b=F.x,e=F.y,c=G.x,f=G.y,I=C.cameraPosition((q+s)/2-sigma.utils.getWidth(a)/2,(r+t)/2-sigma.utils.getHeight(a)/2,!0),B=C.cameraPosition((b+c)/2-sigma.utils.getWidth(a)/2,(e+f)/2-sigma.utils.getHeight(a)/2,!0),J=Math.atan2(f-e,c-b)-u,K=Math.sqrt(Math.pow(f-e,2)+Math.pow(c-b,2))/v,b=I.x,e=I.y,N=l/K,b*=K,e*=K,O=k-J,g=Math.cos(-J),h=Math.sin(-J),c=b*g+e*h,f=e*g-b*h,b=c,e=f,L=b-B.x+i,M=e-B.y+j,(N!==C.ratio||O!==C.angle||L!==C.x||M!==C.y)&&(m=C.x,n=C.y,o=C.angle,p=C.ratio,C.goTo({x:L,y:M,angle:O,ratio:N}),A.dispatchEvent("drag"))}return a.preventDefault(),!1}}function h(a){var b,c,e;return a.touches&&1===a.touches.length&&D("touchEnabled")?(y=!0,c=1/D("doubleClickZoomingRatio"),b=d(a.touches[0]),A.dispatchEvent("doubleclick",{x:b.x-sigma.utils.getWidth(a)/2,y:b.y-sigma.utils.getHeight(a)/2,clientX:a.clientX,clientY:a.clientY,ctrlKey:a.ctrlKey,metaKey:a.metaKey,altKey:a.altKey,shiftKey:a.shiftKey}),D("doubleClickEnabled")&&(b=C.cameraPosition(b.x-sigma.utils.getWidth(a)/2,b.y-sigma.utils.getHeight(a)/2,!0),e={duration:D("doubleClickZoomDuration"),onComplete:function(){y=!1}},sigma.utils.zoomTo(C,b.x,b.y,c,e)),a.preventDefault?a.preventDefault():a.returnValue=!1,a.stopPropagation(),!1):void 0}var i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A=this,B=a,C=b,D=c,E=[];sigma.classes.dispatcher.extend(this),sigma.utils.doubleClick(B,"touchstart",h),B.addEventListener("touchstart",e,!1),B.addEventListener("touchend",f,!1),B.addEventListener("touchcancel",f,!1),B.addEventListener("touchleave",f,!1),B.addEventListener("touchmove",g,!1),this.kill=function(){sigma.utils.unbindDoubleClick(B,"touchstart"),B.addEventListener("touchstart",e),B.addEventListener("touchend",f),B.addEventListener("touchcancel",f),B.addEventListener("touchleave",f),B.addEventListener("touchmove",g)}}}.call(this),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";if("undefined"==typeof conrad)throw"conrad is not declared";sigma.utils.pkg("sigma.renderers"),sigma.renderers.canvas=function(a,b,c,d){if("object"!=typeof d)throw"sigma.renderers.canvas: Wrong arguments.";if(!(d.container instanceof HTMLElement))throw"Container not found.";var e,f,g,h;for(sigma.classes.dispatcher.extend(this),Object.defineProperty(this,"conradId",{value:sigma.utils.id()}),this.graph=a,this.camera=b,this.contexts={},this.domElements={},this.options=d,this.container=this.options.container,this.settings="object"==typeof d.settings&&d.settings?c.embedObjects(d.settings):c,this.nodesOnScreen=[],this.edgesOnScreen=[],this.jobs={},this.options.prefix="renderer"+this.conradId+":",this.settings("batchEdgesDrawing")?(this.initDOM("canvas","edges"),this.initDOM("canvas","scene"),this.contexts.nodes=this.contexts.scene,this.contexts.labels=this.contexts.scene):(this.initDOM("canvas","scene"),this.contexts.edges=this.contexts.scene,this.contexts.nodes=this.contexts.scene,this.contexts.labels=this.contexts.scene),this.initDOM("canvas","mouse"),this.contexts.hover=this.contexts.mouse,this.captors=[],g=this.options.captors||[sigma.captors.mouse,sigma.captors.touch],e=0,f=g.length;f>e;e++)h="function"==typeof g[e]?g[e]:sigma.captors[g[e]],this.captors.push(new h(this.domElements.mouse,this.camera,this.settings));sigma.misc.bindEvents.call(this,this.options.prefix),sigma.misc.drawHovers.call(this,this.options.prefix),this.resize(!1)},sigma.renderers.canvas.prototype.render=function(b){b=b||{};var c,d,e,f,g,h,i,j,k,l,m,n,o,p={},q=this.graph,r=this.graph.nodes,s=(this.options.prefix||"",this.settings(b,"drawEdges")),t=this.settings(b,"drawNodes"),u=this.settings(b,"drawLabels"),v=this.settings(b,"drawEdgeLabels"),w=this.settings.embedObjects(b,{prefix:this.options.prefix});this.resize(!1),this.settings(b,"hideEdgesOnMove")&&(this.camera.isAnimated||this.camera.isMoving)&&(s=!1),this.camera.applyView(a,this.options.prefix,{width:this.width,height:this.height}),this.clear();for(e in this.jobs)conrad.hasJob(e)&&conrad.killJob(e);for(this.edgesOnScreen=[],this.nodesOnScreen=this.camera.quadtree.area(this.camera.getRectangle(this.width,this.height)),c=this.nodesOnScreen,d=0,f=c.length;f>d;d++)p[c[d].id]=c[d];if(s){for(c=q.edges(),d=0,f=c.length;f>d;d++)g=c[d],!p[g.source]&&!p[g.target]||g.hidden||r(g.source).hidden||r(g.target).hidden||this.edgesOnScreen.push(g);if(this.settings(b,"batchEdgesDrawing"))h="edges_"+this.conradId,n=w("canvasEdgesBatchSize"),l=this.edgesOnScreen,f=l.length,k=0,i=Math.min(l.length,k+n),j=function(){for(o=this.contexts.edges.globalCompositeOperation,this.contexts.edges.globalCompositeOperation="destination-over",m=sigma.canvas.edges,d=k;i>d;d++)g=l[d],(m[g.type||this.settings(b,"defaultEdgeType")]||m.def)(g,q.nodes(g.source),q.nodes(g.target),this.contexts.edges,w);if(v)for(m=sigma.canvas.edges.labels,d=k;i>d;d++)g=l[d],g.hidden||(m[g.type||this.settings(b,"defaultEdgeType")]||m.def)(g,q.nodes(g.source),q.nodes(g.target),this.contexts.labels,w);return this.contexts.edges.globalCompositeOperation=o,i===l.length?(delete this.jobs[h],!1):(k=i+1,i=Math.min(l.length,k+n),!0)},this.jobs[h]=j,conrad.addJob(h,j.bind(this));else{for(m=sigma.canvas.edges,c=this.edgesOnScreen,d=0,f=c.length;f>d;d++)g=c[d],(m[g.type||this.settings(b,"defaultEdgeType")]||m.def)(g,q.nodes(g.source),q.nodes(g.target),this.contexts.edges,w);if(v)for(m=sigma.canvas.edges.labels,c=this.edgesOnScreen,d=0,f=c.length;f>d;d++)c[d].hidden||(m[c[d].type||this.settings(b,"defaultEdgeType")]||m.def)(c[d],q.nodes(c[d].source),q.nodes(c[d].target),this.contexts.labels,w)}}if(t)for(m=sigma.canvas.nodes,c=this.nodesOnScreen,d=0,f=c.length;f>d;d++)c[d].hidden||(m[c[d].type||this.settings(b,"defaultNodeType")]||m.def)(c[d],this.contexts.nodes,w);if(u)for(m=sigma.canvas.labels,c=this.nodesOnScreen,d=0,f=c.length;f>d;d++)c[d].hidden||(m[c[d].type||this.settings(b,"defaultNodeType")]||m.def)(c[d],this.contexts.labels,w);return this.dispatchEvent("render"),this},sigma.renderers.canvas.prototype.initDOM=function(a,b){var c=document.createElement(a);c.style.position="absolute",c.setAttribute("class","sigma-"+b),this.domElements[b]=c,this.container.appendChild(c),"canvas"===a.toLowerCase()&&(this.contexts[b]=c.getContext("2d"))},sigma.renderers.canvas.prototype.resize=function(b,c){var d,e=this.width,f=this.height,g=1;if(b!==a&&c!==a?(this.width=b,this.height=c):(this.width=this.container.offsetWidth,this.height=this.container.offsetHeight,b=this.width,c=this.height),e!==this.width||f!==this.height)for(d in this.domElements)this.domElements[d].style.width=b+"px",this.domElements[d].style.height=c+"px","canvas"===this.domElements[d].tagName.toLowerCase()&&(this.domElements[d].setAttribute("width",b*g+"px"),this.domElements[d].setAttribute("height",c*g+"px"),1!==g&&this.contexts[d].scale(g,g));return this},sigma.renderers.canvas.prototype.clear=function(){var a;for(a in this.domElements)"CANVAS"===this.domElements[a].tagName&&(this.domElements[a].width=this.domElements[a].width);return this},sigma.renderers.canvas.prototype.kill=function(){for(var a,b;b=this.captors.pop();)b.kill();delete this.captors;for(a in this.domElements)this.domElements[a].parentNode.removeChild(this.domElements[a]),delete this.domElements[a],delete this.contexts[a];delete this.domElements,delete this.contexts},sigma.utils.pkg("sigma.canvas.nodes"),sigma.utils.pkg("sigma.canvas.edges"),sigma.utils.pkg("sigma.canvas.labels")}.call(this),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.renderers"),sigma.renderers.webgl=function(a,b,c,d){if("object"!=typeof d)throw"sigma.renderers.webgl: Wrong arguments.";if(!(d.container instanceof HTMLElement))throw"Container not found.";var e,f,g,h;for(sigma.classes.dispatcher.extend(this),this.jobs={},Object.defineProperty(this,"conradId",{value:sigma.utils.id()}),this.graph=a,this.camera=b,this.contexts={},this.domElements={},this.options=d,this.container=this.options.container,this.settings="object"==typeof d.settings&&d.settings?c.embedObjects(d.settings):c,this.options.prefix=this.camera.readPrefix,Object.defineProperty(this,"nodePrograms",{value:{}}),Object.defineProperty(this,"edgePrograms",{value:{}}),Object.defineProperty(this,"nodeFloatArrays",{value:{}}),Object.defineProperty(this,"edgeFloatArrays",{value:{}}),this.settings(d,"batchEdgesDrawing")?(this.initDOM("canvas","edges",!0),this.initDOM("canvas","nodes",!0)):(this.initDOM("canvas","scene",!0),this.contexts.nodes=this.contexts.scene,this.contexts.edges=this.contexts.scene),this.initDOM("canvas","labels"),this.initDOM("canvas","mouse"),this.contexts.hover=this.contexts.mouse,this.captors=[],g=this.options.captors||[sigma.captors.mouse,sigma.captors.touch],e=0,f=g.length;f>e;e++)h="function"==typeof g[e]?g[e]:sigma.captors[g[e]],this.captors.push(new h(this.domElements.mouse,this.camera,this.settings));sigma.misc.bindEvents.call(this,this.camera.prefix),sigma.misc.drawHovers.call(this,this.camera.prefix),this.resize()},sigma.renderers.webgl.prototype.process=function(){var a,b,c,d,e,f,g=this.graph,h=sigma.utils.extend(h,this.options);for(d in this.nodeFloatArrays)delete this.nodeFloatArrays[d];for(d in this.edgeFloatArrays)delete this.edgeFloatArrays[d];for(a=g.edges(),b=0,c=a.length;c>b;b++)e=a[b].type||this.settings(h,"defaultEdgeType"),d=e&&sigma.webgl.edges[e]?e:"def",this.edgeFloatArrays[d]||(this.edgeFloatArrays[d]={edges:[]}),this.edgeFloatArrays[d].edges.push(a[b]);for(a=g.nodes(),b=0,c=a.length;c>b;b++)e=a[b].type||this.settings(h,"defaultNodeType"),d=e&&sigma.webgl.nodes[e]?e:"def",this.nodeFloatArrays[d]||(this.nodeFloatArrays[d]={nodes:[]}),this.nodeFloatArrays[d].nodes.push(a[b]);for(d in this.edgeFloatArrays)for(f=sigma.webgl.edges[d],a=this.edgeFloatArrays[d].edges,b=0,c=a.length;c>b;b++)this.edgeFloatArrays[d].array||(this.edgeFloatArrays[d].array=new Float32Array(a.length*f.POINTS*f.ATTRIBUTES)),a[b].hidden||g.nodes(a[b].source).hidden||g.nodes(a[b].target).hidden||f.addEdge(a[b],g.nodes(a[b].source),g.nodes(a[b].target),this.edgeFloatArrays[d].array,b*f.POINTS*f.ATTRIBUTES,h.prefix,this.settings);for(d in this.nodeFloatArrays)for(f=sigma.webgl.nodes[d],a=this.nodeFloatArrays[d].nodes,b=0,c=a.length;c>b;b++)this.nodeFloatArrays[d].array||(this.nodeFloatArrays[d].array=new Float32Array(a.length*f.POINTS*f.ATTRIBUTES)),a[b].hidden||f.addNode(a[b],this.nodeFloatArrays[d].array,b*f.POINTS*f.ATTRIBUTES,h.prefix,this.settings);return this},sigma.renderers.webgl.prototype.render=function(b){var c,d,e,f,g,h,i=this,j=(this.graph,this.contexts.nodes),k=this.contexts.edges,l=this.camera.getMatrix(),m=sigma.utils.extend(b,this.options),n=this.settings(m,"drawLabels"),o=this.settings(m,"drawEdges"),p=this.settings(m,"drawNodes");this.resize(!1),this.settings(m,"hideEdgesOnMove")&&(this.camera.isAnimated||this.camera.isMoving)&&(o=!1),this.clear(),l=sigma.utils.matrices.multiply(l,sigma.utils.matrices.translation(this.width/2,this.height/2));for(f in this.jobs)conrad.hasJob(f)&&conrad.killJob(f);if(o)if(this.settings(m,"batchEdgesDrawing"))(function(){var a,b,c,d,e,f,g,h,i;c="edges_"+this.conradId,i=this.settings(m,"webglEdgesBatchSize"),a=Object.keys(this.edgeFloatArrays),a.length&&(b=0,h=sigma.webgl.edges[a[b]],e=this.edgeFloatArrays[a[b]].array,g=0,f=Math.min(g+i*h.POINTS,e.length/h.ATTRIBUTES),d=function(){return this.edgePrograms[a[b]]||(this.edgePrograms[a[b]]=h.initProgram(k)),f>g&&(k.useProgram(this.edgePrograms[a[b]]),h.render(k,this.edgePrograms[a[b]],e,{settings:this.settings,matrix:l,width:this.width,height:this.height,ratio:this.camera.ratio,scalingRatio:this.settings(m,"webglOversamplingRatio"),start:g,count:f-g})),f>=e.length/h.ATTRIBUTES&&b===a.length-1?(delete this.jobs[c],!1):(f>=e.length/h.ATTRIBUTES?(b++,e=this.edgeFloatArrays[a[b]].array,h=sigma.webgl.edges[a[b]],g=0,f=Math.min(g+i*h.POINTS,e.length/h.ATTRIBUTES)):(g=f,f=Math.min(g+i*h.POINTS,e.length/h.ATTRIBUTES)),!0)},this.jobs[c]=d,conrad.addJob(c,d.bind(this)))}).call(this);else for(f in this.edgeFloatArrays)h=sigma.webgl.edges[f],this.edgePrograms[f]||(this.edgePrograms[f]=h.initProgram(k)),this.edgeFloatArrays[f]&&(k.useProgram(this.edgePrograms[f]),h.render(k,this.edgePrograms[f],this.edgeFloatArrays[f].array,{
-settings:this.settings,matrix:l,width:this.width,height:this.height,ratio:this.camera.ratio,scalingRatio:this.settings(m,"webglOversamplingRatio")}));if(p){j.blendFunc(j.SRC_ALPHA,j.ONE_MINUS_SRC_ALPHA),j.enable(j.BLEND);for(f in this.nodeFloatArrays)h=sigma.webgl.nodes[f],this.nodePrograms[f]||(this.nodePrograms[f]=h.initProgram(j)),this.nodeFloatArrays[f]&&(j.useProgram(this.nodePrograms[f]),h.render(j,this.nodePrograms[f],this.nodeFloatArrays[f].array,{settings:this.settings,matrix:l,width:this.width,height:this.height,ratio:this.camera.ratio,scalingRatio:this.settings(m,"webglOversamplingRatio")}))}if(n)for(c=this.camera.quadtree.area(this.camera.getRectangle(this.width,this.height)),this.camera.applyView(a,a,{nodes:c,edges:[],width:this.width,height:this.height}),g=function(a){return i.settings({prefix:i.camera.prefix},a)},d=0,e=c.length;e>d;d++)c[d].hidden||(sigma.canvas.labels[c[d].type||this.settings(m,"defaultNodeType")]||sigma.canvas.labels.def)(c[d],this.contexts.labels,g);return this.dispatchEvent("render"),this},sigma.renderers.webgl.prototype.initDOM=function(a,b,c){var d=document.createElement(a),e=this;d.style.position="absolute",d.setAttribute("class","sigma-"+b),this.domElements[b]=d,this.container.appendChild(d),"canvas"===a.toLowerCase()&&(this.contexts[b]=d.getContext(c?"experimental-webgl":"2d",{preserveDrawingBuffer:!0}),c&&(d.addEventListener("webglcontextlost",function(a){a.preventDefault()},!1),d.addEventListener("webglcontextrestored",function(a){e.render()},!1)))},sigma.renderers.webgl.prototype.resize=function(b,c){var d,e=this.width,f=this.height;if(b!==a&&c!==a?(this.width=b,this.height=c):(this.width=this.container.offsetWidth,this.height=this.container.offsetHeight,b=this.width,c=this.height),e!==this.width||f!==this.height)for(d in this.domElements)this.domElements[d].style.width=b+"px",this.domElements[d].style.height=c+"px","canvas"===this.domElements[d].tagName.toLowerCase()&&(this.contexts[d]&&this.contexts[d].scale?(this.domElements[d].setAttribute("width",b+"px"),this.domElements[d].setAttribute("height",c+"px")):(this.domElements[d].setAttribute("width",b*this.settings("webglOversamplingRatio")+"px"),this.domElements[d].setAttribute("height",c*this.settings("webglOversamplingRatio")+"px")));for(d in this.contexts)this.contexts[d]&&this.contexts[d].viewport&&this.contexts[d].viewport(0,0,this.width*this.settings("webglOversamplingRatio"),this.height*this.settings("webglOversamplingRatio"));return this},sigma.renderers.webgl.prototype.clear=function(){var a;for(a in this.domElements)"CANVAS"===this.domElements[a].tagName&&(this.domElements[a].width=this.domElements[a].width);return this.contexts.nodes.clear(this.contexts.nodes.COLOR_BUFFER_BIT),this.contexts.edges.clear(this.contexts.edges.COLOR_BUFFER_BIT),this},sigma.renderers.webgl.prototype.kill=function(){for(var a,b;b=this.captors.pop();)b.kill();delete this.captors;for(a in this.domElements)this.domElements[a].parentNode.removeChild(this.domElements[a]),delete this.domElements[a],delete this.contexts[a];delete this.domElements,delete this.contexts},sigma.utils.pkg("sigma.webgl.nodes"),sigma.utils.pkg("sigma.webgl.edges"),sigma.utils.pkg("sigma.canvas.labels")}.call(this),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";if("undefined"==typeof conrad)throw"conrad is not declared";sigma.utils.pkg("sigma.renderers"),sigma.renderers.svg=function(a,b,c,d){if("object"!=typeof d)throw"sigma.renderers.svg: Wrong arguments.";if(!(d.container instanceof HTMLElement))throw"Container not found.";var e,f,g,h,i=this;for(sigma.classes.dispatcher.extend(this),this.graph=a,this.camera=b,this.domElements={graph:null,groups:{},nodes:{},edges:{},labels:{},hovers:{}},this.measurementCanvas=null,this.options=d,this.container=this.options.container,this.settings="object"==typeof d.settings&&d.settings?c.embedObjects(d.settings):c,this.settings("freeStyle",!!this.options.freeStyle),this.settings("xmlns","http://www.w3.org/2000/svg"),this.nodesOnScreen=[],this.edgesOnScreen=[],this.options.prefix="renderer"+sigma.utils.id()+":",this.initDOM("svg"),this.captors=[],g=this.options.captors||[sigma.captors.mouse,sigma.captors.touch],e=0,f=g.length;f>e;e++)h="function"==typeof g[e]?g[e]:sigma.captors[g[e]],this.captors.push(new h(this.domElements.graph,this.camera,this.settings));window.addEventListener("resize",function(){i.resize()}),sigma.misc.bindDOMEvents.call(this,this.domElements.graph),this.bindHovers(this.options.prefix),this.resize(!1)},sigma.renderers.svg.prototype.render=function(b){b=b||{};var c,d,e,f,g,h,i,j,k,l={},m=this.graph,n=this.graph.nodes,o=(this.options.prefix||"",this.settings(b,"drawEdges")),p=this.settings(b,"drawNodes"),q=(this.settings(b,"drawLabels"),this.settings.embedObjects(b,{prefix:this.options.prefix,forceLabels:this.options.forceLabels}));for(this.settings(b,"hideEdgesOnMove")&&(this.camera.isAnimated||this.camera.isMoving)&&(o=!1),this.camera.applyView(a,this.options.prefix,{width:this.width,height:this.height}),this.hideDOMElements(this.domElements.nodes),this.hideDOMElements(this.domElements.edges),this.hideDOMElements(this.domElements.labels),this.edgesOnScreen=[],this.nodesOnScreen=this.camera.quadtree.area(this.camera.getRectangle(this.width,this.height)),c=this.nodesOnScreen,d=0,f=c.length;f>d;d++)l[c[d].id]=c[d];for(c=m.edges(),d=0,f=c.length;f>d;d++)g=c[d],!l[g.source]&&!l[g.target]||g.hidden||n(g.source).hidden||n(g.target).hidden||this.edgesOnScreen.push(g);if(j=sigma.svg.nodes,k=sigma.svg.labels,p)for(c=this.nodesOnScreen,d=0,f=c.length;f>d;d++)c[d].hidden||this.domElements.nodes[c[d].id]||(e=(j[c[d].type]||j.def).create(c[d],q),this.domElements.nodes[c[d].id]=e,this.domElements.groups.nodes.appendChild(e),e=(k[c[d].type]||k.def).create(c[d],q),this.domElements.labels[c[d].id]=e,this.domElements.groups.labels.appendChild(e));if(p)for(c=this.nodesOnScreen,d=0,f=c.length;f>d;d++)c[d].hidden||((j[c[d].type]||j.def).update(c[d],this.domElements.nodes[c[d].id],q),(k[c[d].type]||k.def).update(c[d],this.domElements.labels[c[d].id],q));if(j=sigma.svg.edges,o)for(c=this.edgesOnScreen,d=0,f=c.length;f>d;d++)this.domElements.edges[c[d].id]||(h=n(c[d].source),i=n(c[d].target),e=(j[c[d].type]||j.def).create(c[d],h,i,q),this.domElements.edges[c[d].id]=e,this.domElements.groups.edges.appendChild(e));if(o)for(c=this.edgesOnScreen,d=0,f=c.length;f>d;d++)h=n(c[d].source),i=n(c[d].target),(j[c[d].type]||j.def).update(c[d],this.domElements.edges[c[d].id],h,i,q);return this.dispatchEvent("render"),this},sigma.renderers.svg.prototype.initDOM=function(a){var b,c,d,e=document.createElementNS(this.settings("xmlns"),a),f=this.settings("classPrefix");e.style.position="absolute",e.setAttribute("class",f+"-svg"),e.setAttribute("xmlns",this.settings("xmlns")),e.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),e.setAttribute("version","1.1");var g=document.createElement("canvas");g.setAttribute("class",f+"-measurement-canvas"),this.domElements.graph=this.container.appendChild(e);var h=["edges","nodes","labels","hovers"];for(d=0,c=h.length;c>d;d++)b=document.createElementNS(this.settings("xmlns"),"g"),b.setAttributeNS(null,"id",f+"-group-"+h[d]),b.setAttributeNS(null,"class",f+"-group"),this.domElements.groups[h[d]]=this.domElements.graph.appendChild(b);this.container.appendChild(g),this.measurementCanvas=g.getContext("2d")},sigma.renderers.svg.prototype.hideDOMElements=function(a){var b,c;for(c in a)b=a[c],sigma.svg.utils.hide(b);return this},sigma.renderers.svg.prototype.bindHovers=function(a){function b(b){var c=b.data.node,d=g.settings.embedObjects({prefix:a});if(d("enableHovering")){var h=(f[c.type]||f.def).create(c,g.domElements.nodes[c.id],g.measurementCanvas,d);g.domElements.hovers[c.id]=h,g.domElements.groups.hovers.appendChild(h),e=c}}function c(b){var c=b.data.node,d=g.settings.embedObjects({prefix:a});d("enableHovering")&&(g.domElements.groups.hovers.removeChild(g.domElements.hovers[c.id]),e=null,delete g.domElements.hovers[c.id],g.domElements.groups.nodes.appendChild(g.domElements.nodes[c.id]))}function d(){if(e){var b=g.settings.embedObjects({prefix:a});g.domElements.groups.hovers.removeChild(g.domElements.hovers[e.id]),delete g.domElements.hovers[e.id];var c=(f[e.type]||f.def).create(e,g.domElements.nodes[e.id],g.measurementCanvas,b);g.domElements.hovers[e.id]=c,g.domElements.groups.hovers.appendChild(c)}}var e,f=sigma.svg.hovers,g=this;this.bind("overNode",b),this.bind("outNode",c),this.bind("render",d)},sigma.renderers.svg.prototype.resize=function(b,c){var d=this.width,e=this.height,f=1;return b!==a&&c!==a?(this.width=b,this.height=c):(this.width=this.container.offsetWidth,this.height=this.container.offsetHeight,b=this.width,c=this.height),(d!==this.width||e!==this.height)&&(this.domElements.graph.style.width=b+"px",this.domElements.graph.style.height=c+"px","svg"===this.domElements.graph.tagName.toLowerCase()&&(this.domElements.graph.setAttribute("width",b*f),this.domElements.graph.setAttribute("height",c*f))),this},sigma.utils.pkg("sigma.svg.nodes"),sigma.utils.pkg("sigma.svg.edges"),sigma.utils.pkg("sigma.svg.labels")}.call(this),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.renderers");var b,c=!!a.WebGLRenderingContext;if(c){b=document.createElement("canvas");try{c=!(!b.getContext("webgl")&&!b.getContext("experimental-webgl"))}catch(d){c=!1}}sigma.renderers.def=c?sigma.renderers.webgl:sigma.renderers.canvas}(this),function(){"use strict";sigma.utils.pkg("sigma.webgl.nodes"),sigma.webgl.nodes.def={POINTS:3,ATTRIBUTES:5,addNode:function(a,b,c,d,e){var f=sigma.utils.floatColor(a.color||e("defaultNodeColor"));b[c++]=a[d+"x"],b[c++]=a[d+"y"],b[c++]=a[d+"size"],b[c++]=f,b[c++]=0,b[c++]=a[d+"x"],b[c++]=a[d+"y"],b[c++]=a[d+"size"],b[c++]=f,b[c++]=2*Math.PI/3,b[c++]=a[d+"x"],b[c++]=a[d+"y"],b[c++]=a[d+"size"],b[c++]=f,b[c++]=4*Math.PI/3},render:function(a,b,c,d){var e,f=a.getAttribLocation(b,"a_position"),g=a.getAttribLocation(b,"a_size"),h=a.getAttribLocation(b,"a_color"),i=a.getAttribLocation(b,"a_angle"),j=a.getUniformLocation(b,"u_resolution"),k=a.getUniformLocation(b,"u_matrix"),l=a.getUniformLocation(b,"u_ratio"),m=a.getUniformLocation(b,"u_scale");e=a.createBuffer(),a.bindBuffer(a.ARRAY_BUFFER,e),a.bufferData(a.ARRAY_BUFFER,c,a.DYNAMIC_DRAW),a.uniform2f(j,d.width,d.height),a.uniform1f(l,1/Math.pow(d.ratio,d.settings("nodesPowRatio"))),a.uniform1f(m,d.scalingRatio),a.uniformMatrix3fv(k,!1,d.matrix),a.enableVertexAttribArray(f),a.enableVertexAttribArray(g),a.enableVertexAttribArray(h),a.enableVertexAttribArray(i),a.vertexAttribPointer(f,2,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,0),a.vertexAttribPointer(g,1,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,8),a.vertexAttribPointer(h,1,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,12),a.vertexAttribPointer(i,1,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,16),a.drawArrays(a.TRIANGLES,d.start||0,d.count||c.length/this.ATTRIBUTES)},initProgram:function(a){var b,c,d;return b=sigma.utils.loadShader(a,["attribute vec2 a_position;","attribute float a_size;","attribute float a_color;","attribute float a_angle;","uniform vec2 u_resolution;","uniform float u_ratio;","uniform float u_scale;","uniform mat3 u_matrix;","varying vec4 color;","varying vec2 center;","varying float radius;","void main() {","radius = a_size * u_ratio;","vec2 position = (u_matrix * vec3(a_position, 1)).xy;","center = position * u_scale;","center = vec2(center.x, u_scale * u_resolution.y - center.y);","position = position +","2.0 * radius * vec2(cos(a_angle), sin(a_angle));","position = (position / u_resolution * 2.0 - 1.0) * vec2(1, -1);","radius = radius * u_scale;","gl_Position = vec4(position, 0, 1);","float c = a_color;","color.b = mod(c, 256.0); c = floor(c / 256.0);","color.g = mod(c, 256.0); c = floor(c / 256.0);","color.r = mod(c, 256.0); c = floor(c / 256.0); color /= 255.0;","color.a = 1.0;","}"].join("\n"),a.VERTEX_SHADER),c=sigma.utils.loadShader(a,["precision mediump float;","varying vec4 color;","varying vec2 center;","varying float radius;","void main(void) {","vec4 color0 = vec4(0.0, 0.0, 0.0, 0.0);","vec2 m = gl_FragCoord.xy - center;","float diff = radius - sqrt(m.x * m.x + m.y * m.y);","if (diff > 0.0)","gl_FragColor = color;","else","gl_FragColor = color0;","}"].join("\n"),a.FRAGMENT_SHADER),d=sigma.utils.loadProgram(a,[b,c])}}}(),function(){"use strict";sigma.utils.pkg("sigma.webgl.nodes"),sigma.webgl.nodes.fast={POINTS:1,ATTRIBUTES:4,addNode:function(a,b,c,d,e){b[c++]=a[d+"x"],b[c++]=a[d+"y"],b[c++]=a[d+"size"],b[c++]=sigma.utils.floatColor(a.color||e("defaultNodeColor"))},render:function(a,b,c,d){var e,f=a.getAttribLocation(b,"a_position"),g=a.getAttribLocation(b,"a_size"),h=a.getAttribLocation(b,"a_color"),i=a.getUniformLocation(b,"u_resolution"),j=a.getUniformLocation(b,"u_matrix"),k=a.getUniformLocation(b,"u_ratio"),l=a.getUniformLocation(b,"u_scale");e=a.createBuffer(),a.bindBuffer(a.ARRAY_BUFFER,e),a.bufferData(a.ARRAY_BUFFER,c,a.DYNAMIC_DRAW),a.uniform2f(i,d.width,d.height),a.uniform1f(k,1/Math.pow(d.ratio,d.settings("nodesPowRatio"))),a.uniform1f(l,d.scalingRatio),a.uniformMatrix3fv(j,!1,d.matrix),a.enableVertexAttribArray(f),a.enableVertexAttribArray(g),a.enableVertexAttribArray(h),a.vertexAttribPointer(f,2,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,0),a.vertexAttribPointer(g,1,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,8),a.vertexAttribPointer(h,1,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,12),a.drawArrays(a.POINTS,d.start||0,d.count||c.length/this.ATTRIBUTES)},initProgram:function(a){var b,c,d;return b=sigma.utils.loadShader(a,["attribute vec2 a_position;","attribute float a_size;","attribute float a_color;","uniform vec2 u_resolution;","uniform float u_ratio;","uniform float u_scale;","uniform mat3 u_matrix;","varying vec4 color;","void main() {","gl_Position = vec4(","((u_matrix * vec3(a_position, 1)).xy /","u_resolution * 2.0 - 1.0) * vec2(1, -1),","0,","1",");","gl_PointSize = a_size * u_ratio * u_scale * 2.0;","float c = a_color;","color.b = mod(c, 256.0); c = floor(c / 256.0);","color.g = mod(c, 256.0); c = floor(c / 256.0);","color.r = mod(c, 256.0); c = floor(c / 256.0); color /= 255.0;","color.a = 1.0;","}"].join("\n"),a.VERTEX_SHADER),c=sigma.utils.loadShader(a,["precision mediump float;","varying vec4 color;","void main(void) {","gl_FragColor = color;","}"].join("\n"),a.FRAGMENT_SHADER),d=sigma.utils.loadProgram(a,[b,c])}}}(),function(){"use strict";sigma.utils.pkg("sigma.webgl.edges"),sigma.webgl.edges.def={POINTS:6,ATTRIBUTES:7,addEdge:function(a,b,c,d,e,f,g){var h=(a[f+"size"]||1)/2,i=b[f+"x"],j=b[f+"y"],k=c[f+"x"],l=c[f+"y"],m=a.color;if(!m)switch(g("edgeColor")){case"source":m=b.color||g("defaultNodeColor");break;case"target":m=c.color||g("defaultNodeColor");break;default:m=g("defaultEdgeColor")}m=sigma.utils.floatColor(m),d[e++]=i,d[e++]=j,d[e++]=k,d[e++]=l,d[e++]=h,d[e++]=0,d[e++]=m,d[e++]=k,d[e++]=l,d[e++]=i,d[e++]=j,d[e++]=h,d[e++]=1,d[e++]=m,d[e++]=k,d[e++]=l,d[e++]=i,d[e++]=j,d[e++]=h,d[e++]=0,d[e++]=m,d[e++]=k,d[e++]=l,d[e++]=i,d[e++]=j,d[e++]=h,d[e++]=0,d[e++]=m,d[e++]=i,d[e++]=j,d[e++]=k,d[e++]=l,d[e++]=h,d[e++]=1,d[e++]=m,d[e++]=i,d[e++]=j,d[e++]=k,d[e++]=l,d[e++]=h,d[e++]=0,d[e++]=m},render:function(a,b,c,d){var e,f=a.getAttribLocation(b,"a_color"),g=a.getAttribLocation(b,"a_position1"),h=a.getAttribLocation(b,"a_position2"),i=a.getAttribLocation(b,"a_thickness"),j=a.getAttribLocation(b,"a_minus"),k=a.getUniformLocation(b,"u_resolution"),l=a.getUniformLocation(b,"u_matrix"),m=a.getUniformLocation(b,"u_matrixHalfPi"),n=a.getUniformLocation(b,"u_matrixHalfPiMinus"),o=a.getUniformLocation(b,"u_ratio"),p=a.getUniformLocation(b,"u_scale");e=a.createBuffer(),a.bindBuffer(a.ARRAY_BUFFER,e),a.bufferData(a.ARRAY_BUFFER,c,a.STATIC_DRAW),a.uniform2f(k,d.width,d.height),a.uniform1f(o,d.ratio/Math.pow(d.ratio,d.settings("edgesPowRatio"))),a.uniform1f(p,d.scalingRatio),a.uniformMatrix3fv(l,!1,d.matrix),a.uniformMatrix2fv(m,!1,sigma.utils.matrices.rotation(Math.PI/2,!0)),a.uniformMatrix2fv(n,!1,sigma.utils.matrices.rotation(-Math.PI/2,!0)),a.enableVertexAttribArray(f),a.enableVertexAttribArray(g),a.enableVertexAttribArray(h),a.enableVertexAttribArray(i),a.enableVertexAttribArray(j),a.vertexAttribPointer(g,2,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,0),a.vertexAttribPointer(h,2,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,8),a.vertexAttribPointer(i,1,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,16),a.vertexAttribPointer(j,1,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,20),a.vertexAttribPointer(f,1,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,24),a.drawArrays(a.TRIANGLES,d.start||0,d.count||c.length/this.ATTRIBUTES)},initProgram:function(a){var b,c,d;return b=sigma.utils.loadShader(a,["attribute vec2 a_position1;","attribute vec2 a_position2;","attribute float a_thickness;","attribute float a_minus;","attribute float a_color;","uniform vec2 u_resolution;","uniform float u_ratio;","uniform float u_scale;","uniform mat3 u_matrix;","uniform mat2 u_matrixHalfPi;","uniform mat2 u_matrixHalfPiMinus;","varying vec4 color;","void main() {","vec2 position = a_thickness * u_ratio *","normalize(a_position2 - a_position1);","mat2 matrix = a_minus * u_matrixHalfPiMinus +","(1.0 - a_minus) * u_matrixHalfPi;","position = matrix * position + a_position1;","gl_Position = vec4(","((u_matrix * vec3(position, 1)).xy /","u_resolution * 2.0 - 1.0) * vec2(1, -1),","0,","1",");","float c = a_color;","color.b = mod(c, 256.0); c = floor(c / 256.0);","color.g = mod(c, 256.0); c = floor(c / 256.0);","color.r = mod(c, 256.0); c = floor(c / 256.0); color /= 255.0;","color.a = 1.0;","}"].join("\n"),a.VERTEX_SHADER),c=sigma.utils.loadShader(a,["precision mediump float;","varying vec4 color;","void main(void) {","gl_FragColor = color;","}"].join("\n"),a.FRAGMENT_SHADER),d=sigma.utils.loadProgram(a,[b,c])}}}(),function(){"use strict";sigma.utils.pkg("sigma.webgl.edges"),sigma.webgl.edges.fast={POINTS:2,ATTRIBUTES:3,addEdge:function(a,b,c,d,e,f,g){var h=((a[f+"size"]||1)/2,b[f+"x"]),i=b[f+"y"],j=c[f+"x"],k=c[f+"y"],l=a.color;if(!l)switch(g("edgeColor")){case"source":l=b.color||g("defaultNodeColor");break;case"target":l=c.color||g("defaultNodeColor");break;default:l=g("defaultEdgeColor")}l=sigma.utils.floatColor(l),d[e++]=h,d[e++]=i,d[e++]=l,d[e++]=j,d[e++]=k,d[e++]=l},render:function(a,b,c,d){var e,f=a.getAttribLocation(b,"a_color"),g=a.getAttribLocation(b,"a_position"),h=a.getUniformLocation(b,"u_resolution"),i=a.getUniformLocation(b,"u_matrix");e=a.createBuffer(),a.bindBuffer(a.ARRAY_BUFFER,e),a.bufferData(a.ARRAY_BUFFER,c,a.DYNAMIC_DRAW),a.uniform2f(h,d.width,d.height),a.uniformMatrix3fv(i,!1,d.matrix),a.enableVertexAttribArray(g),a.enableVertexAttribArray(f),a.vertexAttribPointer(g,2,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,0),a.vertexAttribPointer(f,1,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,8),a.lineWidth(3),a.drawArrays(a.LINES,d.start||0,d.count||c.length/this.ATTRIBUTES)},initProgram:function(a){var b,c,d;return b=sigma.utils.loadShader(a,["attribute vec2 a_position;","attribute float a_color;","uniform vec2 u_resolution;","uniform mat3 u_matrix;","varying vec4 color;","void main() {","gl_Position = vec4(","((u_matrix * vec3(a_position, 1)).xy /","u_resolution * 2.0 - 1.0) * vec2(1, -1),","0,","1",");","float c = a_color;","color.b = mod(c, 256.0); c = floor(c / 256.0);","color.g = mod(c, 256.0); c = floor(c / 256.0);","color.r = mod(c, 256.0); c = floor(c / 256.0); color /= 255.0;","color.a = 1.0;","}"].join("\n"),a.VERTEX_SHADER),c=sigma.utils.loadShader(a,["precision mediump float;","varying vec4 color;","void main(void) {","gl_FragColor = color;","}"].join("\n"),a.FRAGMENT_SHADER),d=sigma.utils.loadProgram(a,[b,c])}}}(),function(){"use strict";sigma.utils.pkg("sigma.webgl.edges"),sigma.webgl.edges.arrow={POINTS:9,ATTRIBUTES:11,addEdge:function(a,b,c,d,e,f,g){var h=(a[f+"size"]||1)/2,i=b[f+"x"],j=b[f+"y"],k=c[f+"x"],l=c[f+"y"],m=c[f+"size"],n=a.color;if(!n)switch(g("edgeColor")){case"source":n=b.color||g("defaultNodeColor");break;case"target":n=c.color||g("defaultNodeColor");break;default:n=g("defaultEdgeColor")}n=sigma.utils.floatColor(n),d[e++]=i,d[e++]=j,d[e++]=k,d[e++]=l,d[e++]=h,d[e++]=m,d[e++]=0,d[e++]=0,d[e++]=0,d[e++]=0,d[e++]=n,d[e++]=k,d[e++]=l,d[e++]=i,d[e++]=j,d[e++]=h,d[e++]=m,d[e++]=1,d[e++]=1,d[e++]=0,d[e++]=0,d[e++]=n,d[e++]=k,d[e++]=l,d[e++]=i,d[e++]=j,d[e++]=h,d[e++]=m,d[e++]=1,d[e++]=0,d[e++]=0,d[e++]=0,d[e++]=n,d[e++]=k,d[e++]=l,d[e++]=i,d[e++]=j,d[e++]=h,d[e++]=m,d[e++]=1,d[e++]=0,d[e++]=0,d[e++]=0,d[e++]=n,d[e++]=i,d[e++]=j,d[e++]=k,d[e++]=l,d[e++]=h,d[e++]=m,d[e++]=0,d[e++]=1,d[e++]=0,d[e++]=0,d[e++]=n,d[e++]=i,d[e++]=j,d[e++]=k,d[e++]=l,d[e++]=h,d[e++]=m,d[e++]=0,d[e++]=0,d[e++]=0,d[e++]=0,d[e++]=n,d[e++]=k,d[e++]=l,d[e++]=i,d[e++]=j,d[e++]=h,d[e++]=m,d[e++]=1,d[e++]=0,d[e++]=1,d[e++]=-1,d[e++]=n,d[e++]=k,d[e++]=l,d[e++]=i,d[e++]=j,d[e++]=h,d[e++]=m,d[e++]=1,d[e++]=0,d[e++]=1,d[e++]=0,d[e++]=n,d[e++]=k,d[e++]=l,d[e++]=i,d[e++]=j,d[e++]=h,d[e++]=m,d[e++]=1,d[e++]=0,d[e++]=1,d[e++]=1,d[e++]=n},render:function(a,b,c,d){var e,f=a.getAttribLocation(b,"a_pos1"),g=a.getAttribLocation(b,"a_pos2"),h=a.getAttribLocation(b,"a_thickness"),i=a.getAttribLocation(b,"a_tSize"),j=a.getAttribLocation(b,"a_delay"),k=a.getAttribLocation(b,"a_minus"),l=a.getAttribLocation(b,"a_head"),m=a.getAttribLocation(b,"a_headPosition"),n=a.getAttribLocation(b,"a_color"),o=a.getUniformLocation(b,"u_resolution"),p=a.getUniformLocation(b,"u_matrix"),q=a.getUniformLocation(b,"u_matrixHalfPi"),r=a.getUniformLocation(b,"u_matrixHalfPiMinus"),s=a.getUniformLocation(b,"u_ratio"),t=a.getUniformLocation(b,"u_nodeRatio"),u=a.getUniformLocation(b,"u_arrowHead"),v=a.getUniformLocation(b,"u_scale");e=a.createBuffer(),a.bindBuffer(a.ARRAY_BUFFER,e),a.bufferData(a.ARRAY_BUFFER,c,a.STATIC_DRAW),a.uniform2f(o,d.width,d.height),a.uniform1f(s,d.ratio/Math.pow(d.ratio,d.settings("edgesPowRatio"))),a.uniform1f(t,Math.pow(d.ratio,d.settings("nodesPowRatio"))/d.ratio),a.uniform1f(u,5),a.uniform1f(v,d.scalingRatio),a.uniformMatrix3fv(p,!1,d.matrix),a.uniformMatrix2fv(q,!1,sigma.utils.matrices.rotation(Math.PI/2,!0)),a.uniformMatrix2fv(r,!1,sigma.utils.matrices.rotation(-Math.PI/2,!0)),a.enableVertexAttribArray(f),a.enableVertexAttribArray(g),a.enableVertexAttribArray(h),a.enableVertexAttribArray(i),a.enableVertexAttribArray(j),a.enableVertexAttribArray(k),a.enableVertexAttribArray(l),a.enableVertexAttribArray(m),a.enableVertexAttribArray(n),a.vertexAttribPointer(f,2,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,0),a.vertexAttribPointer(g,2,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,8),a.vertexAttribPointer(h,1,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,16),a.vertexAttribPointer(i,1,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,20),a.vertexAttribPointer(j,1,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,24),a.vertexAttribPointer(k,1,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,28),a.vertexAttribPointer(l,1,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,32),a.vertexAttribPointer(m,1,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,36),a.vertexAttribPointer(n,1,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,40),a.drawArrays(a.TRIANGLES,d.start||0,d.count||c.length/this.ATTRIBUTES)},initProgram:function(a){var b,c,d;return b=sigma.utils.loadShader(a,["attribute vec2 a_pos1;","attribute vec2 a_pos2;","attribute float a_thickness;","attribute float a_tSize;","attribute float a_delay;","attribute float a_minus;","attribute float a_head;","attribute float a_headPosition;","attribute float a_color;","uniform vec2 u_resolution;","uniform float u_ratio;","uniform float u_nodeRatio;","uniform float u_arrowHead;","uniform float u_scale;","uniform mat3 u_matrix;","uniform mat2 u_matrixHalfPi;","uniform mat2 u_matrixHalfPiMinus;","varying vec4 color;","void main() {","vec2 pos = normalize(a_pos2 - a_pos1);","mat2 matrix = (1.0 - a_head) *","(","a_minus * u_matrixHalfPiMinus +","(1.0 - a_minus) * u_matrixHalfPi",") + a_head * (","a_headPosition * u_matrixHalfPiMinus * 0.6 +","(a_headPosition * a_headPosition - 1.0) * mat2(1.0)",");","pos = a_pos1 + (","(1.0 - a_head) * a_thickness * u_ratio * matrix * pos +","a_head * u_arrowHead * a_thickness * u_ratio * matrix * pos +","a_delay * pos * (","a_tSize / u_nodeRatio +","u_arrowHead * a_thickness * u_ratio",")",");","gl_Position = vec4(","((u_matrix * vec3(pos, 1)).xy /","u_resolution * 2.0 - 1.0) * vec2(1, -1),","0,","1",");","float c = a_color;","color.b = mod(c, 256.0); c = floor(c / 256.0);","color.g = mod(c, 256.0); c = floor(c / 256.0);","color.r = mod(c, 256.0); c = floor(c / 256.0); color /= 255.0;","color.a = 1.0;","}"].join("\n"),a.VERTEX_SHADER),c=sigma.utils.loadShader(a,["precision mediump float;","varying vec4 color;","void main(void) {","gl_FragColor = color;","}"].join("\n"),a.FRAGMENT_SHADER),d=sigma.utils.loadProgram(a,[b,c])}}}(),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.canvas.labels"),sigma.canvas.labels.def=function(a,b,c){var d,e=c("prefix")||"",f=a[e+"size"];f<c("labelThreshold")||a.label&&"string"==typeof a.label&&(d="fixed"===c("labelSize")?c("defaultLabelSize"):c("labelSizeRatio")*f,b.font=(c("fontStyle")?c("fontStyle")+" ":"")+d+"px "+c("font"),b.fillStyle="node"===c("labelColor")?a.color||c("defaultNodeColor"):c("defaultLabelColor"),b.fillText(a.label,Math.round(a[e+"x"]+f+3),Math.round(a[e+"y"]+d/3)))}}.call(this),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.canvas.hovers"),sigma.canvas.hovers.def=function(a,b,c){var d,e,f,g,h,i=c("hoverFontStyle")||c("fontStyle"),j=c("prefix")||"",k=a[j+"size"],l="fixed"===c("labelSize")?c("defaultLabelSize"):c("labelSizeRatio")*k;b.font=(i?i+" ":"")+l+"px "+(c("hoverFont")||c("font")),b.beginPath(),b.fillStyle="node"===c("labelHoverBGColor")?a.color||c("defaultNodeColor"):c("defaultHoverLabelBGColor"),a.label&&c("labelHoverShadow")&&(b.shadowOffsetX=0,b.shadowOffsetY=0,b.shadowBlur=8,b.shadowColor=c("labelHoverShadowColor")),a.label&&"string"==typeof a.label&&(d=Math.round(a[j+"x"]-l/2-2),e=Math.round(a[j+"y"]-l/2-2),f=Math.round(b.measureText(a.label).width+l/2+k+7),g=Math.round(l+4),h=Math.round(l/2+2),b.moveTo(d,e+h),b.arcTo(d,e,d+h,e,h),b.lineTo(d+f,e),b.lineTo(d+f,e+g),b.lineTo(d+h,e+g),b.arcTo(d,e+g,d,e+g-h,h),b.lineTo(d,e+h),b.closePath(),b.fill(),b.shadowOffsetX=0,b.shadowOffsetY=0,b.shadowBlur=0),c("borderSize")>0&&(b.beginPath(),b.fillStyle="node"===c("nodeBorderColor")?a.color||c("defaultNodeColor"):c("defaultNodeBorderColor"),b.arc(a[j+"x"],a[j+"y"],k+c("borderSize"),0,2*Math.PI,!0),b.closePath(),b.fill());var m=sigma.canvas.nodes[a.type]||sigma.canvas.nodes.def;m(a,b,c),a.label&&"string"==typeof a.label&&(b.fillStyle="node"===c("labelHoverColor")?a.color||c("defaultNodeColor"):c("defaultLabelHoverColor"),b.fillText(a.label,Math.round(a[j+"x"]+k+3),Math.round(a[j+"y"]+l/3)))}}.call(this),function(){"use strict";sigma.utils.pkg("sigma.canvas.nodes"),sigma.canvas.nodes.def=function(a,b,c){var d=c("prefix")||"";b.fillStyle=a.color||c("defaultNodeColor"),b.beginPath(),b.arc(a[d+"x"],a[d+"y"],a[d+"size"],0,2*Math.PI,!0),b.closePath(),b.fill()}}(),function(){"use strict";sigma.utils.pkg("sigma.canvas.edges"),sigma.canvas.edges.def=function(a,b,c,d,e){var f=a.color,g=e("prefix")||"",h=a[g+"size"]||1,i=e("edgeColor"),j=e("defaultNodeColor"),k=e("defaultEdgeColor");if(!f)switch(i){case"source":f=b.color||j;break;case"target":f=c.color||j;break;default:f=k}d.strokeStyle=f,d.lineWidth=h,d.beginPath(),d.moveTo(b[g+"x"],b[g+"y"]),d.lineTo(c[g+"x"],c[g+"y"]),d.stroke()}}(),function(){"use strict";sigma.utils.pkg("sigma.canvas.edges"),sigma.canvas.edges.curve=function(a,b,c,d,e){var f=a.color,g=e("prefix")||"",h=a[g+"size"]||1,i=e("edgeColor"),j=e("defaultNodeColor"),k=e("defaultEdgeColor"),l={},m=b[g+"size"],n=b[g+"x"],o=b[g+"y"],p=c[g+"x"],q=c[g+"y"];if(l=b.id===c.id?sigma.utils.getSelfLoopControlPoints(n,o,m):sigma.utils.getQuadraticControlPoint(n,o,p,q),!f)switch(i){case"source":f=b.color||j;break;case"target":f=c.color||j;break;default:f=k}d.strokeStyle=f,d.lineWidth=h,d.beginPath(),d.moveTo(n,o),b.id===c.id?d.bezierCurveTo(l.x1,l.y1,l.x2,l.y2,p,q):d.quadraticCurveTo(l.x,l.y,p,q),d.stroke()}}(),function(){"use strict";sigma.utils.pkg("sigma.canvas.edges"),sigma.canvas.edges.arrow=function(a,b,c,d,e){var f=a.color,g=e("prefix")||"",h=e("edgeColor"),i=e("defaultNodeColor"),j=e("defaultEdgeColor"),k=a[g+"size"]||1,l=c[g+"size"],m=b[g+"x"],n=b[g+"y"],o=c[g+"x"],p=c[g+"y"],q=Math.max(2.5*k,e("minArrowSize")),r=Math.sqrt(Math.pow(o-m,2)+Math.pow(p-n,2)),s=m+(o-m)*(r-q-l)/r,t=n+(p-n)*(r-q-l)/r,u=(o-m)*q/r,v=(p-n)*q/r;if(!f)switch(h){case"source":f=b.color||i;break;case"target":f=c.color||i;break;default:f=j}d.strokeStyle=f,d.lineWidth=k,d.beginPath(),d.moveTo(m,n),d.lineTo(s,t),d.stroke(),d.fillStyle=f,d.beginPath(),d.moveTo(s+u,t+v),d.lineTo(s+.6*v,t-.6*u),d.lineTo(s-.6*v,t+.6*u),d.lineTo(s+u,t+v),d.closePath(),d.fill()}}(),function(){"use strict";sigma.utils.pkg("sigma.canvas.edges"),sigma.canvas.edges.curvedArrow=function(a,b,c,d,e){var f,g,h,i,j,k=a.color,l=e("prefix")||"",m=e("edgeColor"),n=e("defaultNodeColor"),o=e("defaultEdgeColor"),p={},q=a[l+"size"]||1,r=c[l+"size"],s=b[l+"x"],t=b[l+"y"],u=c[l+"x"],v=c[l+"y"],w=Math.max(2.5*q,e("minArrowSize"));if(p=b.id===c.id?sigma.utils.getSelfLoopControlPoints(s,t,r):sigma.utils.getQuadraticControlPoint(s,t,u,v),b.id===c.id?(f=Math.sqrt(Math.pow(u-p.x1,2)+Math.pow(v-p.y1,2)),g=p.x1+(u-p.x1)*(f-w-r)/f,h=p.y1+(v-p.y1)*(f-w-r)/f,i=(u-p.x1)*w/f,j=(v-p.y1)*w/f):(f=Math.sqrt(Math.pow(u-p.x,2)+Math.pow(v-p.y,2)),g=p.x+(u-p.x)*(f-w-r)/f,h=p.y+(v-p.y)*(f-w-r)/f,i=(u-p.x)*w/f,j=(v-p.y)*w/f),!k)switch(m){case"source":k=b.color||n;break;case"target":k=c.color||n;break;default:k=o}d.strokeStyle=k,d.lineWidth=q,d.beginPath(),d.moveTo(s,t),b.id===c.id?d.bezierCurveTo(p.x2,p.y2,p.x1,p.y1,g,h):d.quadraticCurveTo(p.x,p.y,g,h),d.stroke(),d.fillStyle=k,d.beginPath(),d.moveTo(g+i,h+j),d.lineTo(g+.6*j,h-.6*i),d.lineTo(g-.6*j,h+.6*i),d.lineTo(g+i,h+j),d.closePath(),d.fill()}}(),function(){"use strict";sigma.utils.pkg("sigma.canvas.edgehovers"),sigma.canvas.edgehovers.def=function(a,b,c,d,e){var f=a.color,g=e("prefix")||"",h=a[g+"size"]||1,i=e("edgeColor"),j=e("defaultNodeColor"),k=e("defaultEdgeColor");if(!f)switch(i){case"source":f=b.color||j;break;case"target":f=c.color||j;break;default:f=k}f="edge"===e("edgeHoverColor")?a.hover_color||f:a.hover_color||e("defaultEdgeHoverColor")||f,h*=e("edgeHoverSizeRatio"),d.strokeStyle=f,d.lineWidth=h,d.beginPath(),d.moveTo(b[g+"x"],b[g+"y"]),d.lineTo(c[g+"x"],c[g+"y"]),d.stroke()}}(),function(){"use strict";sigma.utils.pkg("sigma.canvas.edgehovers"),sigma.canvas.edgehovers.curve=function(a,b,c,d,e){var f=a.color,g=e("prefix")||"",h=e("edgeHoverSizeRatio")*(a[g+"size"]||1),i=e("edgeColor"),j=e("defaultNodeColor"),k=e("defaultEdgeColor"),l={},m=b[g+"size"],n=b[g+"x"],o=b[g+"y"],p=c[g+"x"],q=c[g+"y"];if(l=b.id===c.id?sigma.utils.getSelfLoopControlPoints(n,o,m):sigma.utils.getQuadraticControlPoint(n,o,p,q),!f)switch(i){case"source":f=b.color||j;break;case"target":f=c.color||j;break;default:f=k}f="edge"===e("edgeHoverColor")?a.hover_color||f:a.hover_color||e("defaultEdgeHoverColor")||f,d.strokeStyle=f,d.lineWidth=h,d.beginPath(),d.moveTo(n,o),b.id===c.id?d.bezierCurveTo(l.x1,l.y1,l.x2,l.y2,p,q):d.quadraticCurveTo(l.x,l.y,p,q),d.stroke()}}(),function(){"use strict";sigma.utils.pkg("sigma.canvas.edgehovers"),sigma.canvas.edgehovers.arrow=function(a,b,c,d,e){var f=a.color,g=e("prefix")||"",h=e("edgeColor"),i=e("defaultNodeColor"),j=e("defaultEdgeColor"),k=a[g+"size"]||1,l=c[g+"size"],m=b[g+"x"],n=b[g+"y"],o=c[g+"x"],p=c[g+"y"];
-k=a.hover?e("edgeHoverSizeRatio")*k:k;var q=2.5*k,r=Math.sqrt(Math.pow(o-m,2)+Math.pow(p-n,2)),s=m+(o-m)*(r-q-l)/r,t=n+(p-n)*(r-q-l)/r,u=(o-m)*q/r,v=(p-n)*q/r;if(!f)switch(h){case"source":f=b.color||i;break;case"target":f=c.color||i;break;default:f=j}f="edge"===e("edgeHoverColor")?a.hover_color||f:a.hover_color||e("defaultEdgeHoverColor")||f,d.strokeStyle=f,d.lineWidth=k,d.beginPath(),d.moveTo(m,n),d.lineTo(s,t),d.stroke(),d.fillStyle=f,d.beginPath(),d.moveTo(s+u,t+v),d.lineTo(s+.6*v,t-.6*u),d.lineTo(s-.6*v,t+.6*u),d.lineTo(s+u,t+v),d.closePath(),d.fill()}}(),function(){"use strict";sigma.utils.pkg("sigma.canvas.edgehovers"),sigma.canvas.edgehovers.curvedArrow=function(a,b,c,d,e){var f,g,h,i,j,k,l=a.color,m=e("prefix")||"",n=e("edgeColor"),o=e("defaultNodeColor"),p=e("defaultEdgeColor"),q={},r=e("edgeHoverSizeRatio")*(a[m+"size"]||1),s=c[m+"size"],t=b[m+"x"],u=b[m+"y"],v=c[m+"x"],w=c[m+"y"];if(q=b.id===c.id?sigma.utils.getSelfLoopControlPoints(t,u,s):sigma.utils.getQuadraticControlPoint(t,u,v,w),b.id===c.id?(f=Math.sqrt(Math.pow(v-q.x1,2)+Math.pow(w-q.y1,2)),g=2.5*r,h=q.x1+(v-q.x1)*(f-g-s)/f,i=q.y1+(w-q.y1)*(f-g-s)/f,j=(v-q.x1)*g/f,k=(w-q.y1)*g/f):(f=Math.sqrt(Math.pow(v-q.x,2)+Math.pow(w-q.y,2)),g=2.5*r,h=q.x+(v-q.x)*(f-g-s)/f,i=q.y+(w-q.y)*(f-g-s)/f,j=(v-q.x)*g/f,k=(w-q.y)*g/f),!l)switch(n){case"source":l=b.color||o;break;case"target":l=c.color||o;break;default:l=p}l="edge"===e("edgeHoverColor")?a.hover_color||l:a.hover_color||e("defaultEdgeHoverColor")||l,d.strokeStyle=l,d.lineWidth=r,d.beginPath(),d.moveTo(t,u),b.id===c.id?d.bezierCurveTo(q.x2,q.y2,q.x1,q.y1,h,i):d.quadraticCurveTo(q.x,q.y,h,i),d.stroke(),d.fillStyle=l,d.beginPath(),d.moveTo(h+j,i+k),d.lineTo(h+.6*k,i-.6*j),d.lineTo(h-.6*k,i+.6*j),d.lineTo(h+j,i+k),d.closePath(),d.fill()}}(),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.canvas.extremities"),sigma.canvas.extremities.def=function(a,b,c,d,e){(sigma.canvas.hovers[b.type]||sigma.canvas.hovers.def)(b,d,e),(sigma.canvas.hovers[c.type]||sigma.canvas.hovers.def)(c,d,e)}}.call(this),function(){"use strict";sigma.utils.pkg("sigma.svg.utils"),sigma.svg.utils={show:function(a){return a.style.display="",this},hide:function(a){return a.style.display="none",this}}}(),function(){"use strict";sigma.utils.pkg("sigma.svg.nodes"),sigma.svg.nodes.def={create:function(a,b){var c=(b("prefix")||"",document.createElementNS(b("xmlns"),"circle"));return c.setAttributeNS(null,"data-node-id",a.id),c.setAttributeNS(null,"class",b("classPrefix")+"-node"),c.setAttributeNS(null,"fill",a.color||b("defaultNodeColor")),c},update:function(a,b,c){var d=c("prefix")||"";return b.setAttributeNS(null,"cx",a[d+"x"]),b.setAttributeNS(null,"cy",a[d+"y"]),b.setAttributeNS(null,"r",a[d+"size"]),c("freeStyle")||b.setAttributeNS(null,"fill",a.color||c("defaultNodeColor")),b.style.display="",this}}}(),function(){"use strict";sigma.utils.pkg("sigma.svg.edges"),sigma.svg.edges.def={create:function(a,b,c,d){var e=a.color,f=(d("prefix")||"",d("edgeColor")),g=d("defaultNodeColor"),h=d("defaultEdgeColor");if(!e)switch(f){case"source":e=b.color||g;break;case"target":e=c.color||g;break;default:e=h}var i=document.createElementNS(d("xmlns"),"line");return i.setAttributeNS(null,"data-edge-id",a.id),i.setAttributeNS(null,"class",d("classPrefix")+"-edge"),i.setAttributeNS(null,"stroke",e),i},update:function(a,b,c,d,e){var f=e("prefix")||"";return b.setAttributeNS(null,"stroke-width",a[f+"size"]||1),b.setAttributeNS(null,"x1",c[f+"x"]),b.setAttributeNS(null,"y1",c[f+"y"]),b.setAttributeNS(null,"x2",d[f+"x"]),b.setAttributeNS(null,"y2",d[f+"y"]),b.style.display="",this}}}(),function(){"use strict";sigma.utils.pkg("sigma.svg.edges"),sigma.svg.edges.curve={create:function(a,b,c,d){var e=a.color,f=(d("prefix")||"",d("edgeColor")),g=d("defaultNodeColor"),h=d("defaultEdgeColor");if(!e)switch(f){case"source":e=b.color||g;break;case"target":e=c.color||g;break;default:e=h}var i=document.createElementNS(d("xmlns"),"path");return i.setAttributeNS(null,"data-edge-id",a.id),i.setAttributeNS(null,"class",d("classPrefix")+"-edge"),i.setAttributeNS(null,"stroke",e),i},update:function(a,b,c,d,e){var f=e("prefix")||"";b.setAttributeNS(null,"stroke-width",a[f+"size"]||1);var g=(c[f+"x"]+d[f+"x"])/2+(d[f+"y"]-c[f+"y"])/4,h=(c[f+"y"]+d[f+"y"])/2+(c[f+"x"]-d[f+"x"])/4,i="M"+c[f+"x"]+","+c[f+"y"]+" Q"+g+","+h+" "+d[f+"x"]+","+d[f+"y"];return b.setAttributeNS(null,"d",i),b.setAttributeNS(null,"fill","none"),b.style.display="",this}}}(),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.svg.labels"),sigma.svg.labels.def={create:function(a,b){var c=b("prefix")||"",d=a[c+"size"],e=document.createElementNS(b("xmlns"),"text"),f="fixed"===b("labelSize")?b("defaultLabelSize"):b("labelSizeRatio")*d,g="node"===b("labelColor")?a.color||b("defaultNodeColor"):b("defaultLabelColor");return e.setAttributeNS(null,"data-label-target",a.id),e.setAttributeNS(null,"class",b("classPrefix")+"-label"),e.setAttributeNS(null,"font-size",f),e.setAttributeNS(null,"font-family",b("font")),e.setAttributeNS(null,"fill",g),e.innerHTML=a.label,e.textContent=a.label,e},update:function(a,b,c){var d=c("prefix")||"",e=a[d+"size"],f="fixed"===c("labelSize")?c("defaultLabelSize"):c("labelSizeRatio")*e;return!c("forceLabels")&&e<c("labelThreshold")||"string"!=typeof a.label?void 0:(b.setAttributeNS(null,"x",Math.round(a[d+"x"]+e+3)),b.setAttributeNS(null,"y",Math.round(a[d+"y"]+f/3)),b.style.display="",this)}}}.call(this),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.svg.hovers"),sigma.svg.hovers.def={create:function(a,b,c,d){var e,f,g,h,i,j=(d("hoverFontStyle")||d("fontStyle"),d("prefix")||""),k=a[j+"size"],l="fixed"===d("labelSize")?d("defaultLabelSize"):d("labelSizeRatio")*k,m="node"===d("labelHoverColor")?a.color||d("defaultNodeColor"):d("defaultLabelHoverColor"),n=document.createElementNS(d("xmlns"),"g"),o=document.createElementNS(d("xmlns"),"rect"),p=document.createElementNS(d("xmlns"),"circle"),q=document.createElementNS(d("xmlns"),"text");return n.setAttributeNS(null,"class",d("classPrefix")+"-hover"),n.setAttributeNS(null,"data-node-id",a.id),"string"==typeof a.label&&(q.innerHTML=a.label,q.textContent=a.label,q.setAttributeNS(null,"class",d("classPrefix")+"-hover-label"),q.setAttributeNS(null,"font-size",l),q.setAttributeNS(null,"font-family",d("font")),q.setAttributeNS(null,"fill",m),q.setAttributeNS(null,"x",Math.round(a[j+"x"]+k+3)),q.setAttributeNS(null,"y",Math.round(a[j+"y"]+l/3)),e=Math.round(a[j+"x"]-l/2-2),f=Math.round(a[j+"y"]-l/2-2),g=Math.round(c.measureText(a.label).width+l/2+k+9),h=Math.round(l+4),i=Math.round(l/2+2),p.setAttributeNS(null,"class",d("classPrefix")+"-hover-area"),p.setAttributeNS(null,"fill","#fff"),p.setAttributeNS(null,"cx",a[j+"x"]),p.setAttributeNS(null,"cy",a[j+"y"]),p.setAttributeNS(null,"r",i),o.setAttributeNS(null,"class",d("classPrefix")+"-hover-area"),o.setAttributeNS(null,"fill","#fff"),o.setAttributeNS(null,"x",a[j+"x"]+i/4),o.setAttributeNS(null,"y",a[j+"y"]-i),o.setAttributeNS(null,"width",g),o.setAttributeNS(null,"height",h)),n.appendChild(p),n.appendChild(o),n.appendChild(q),n.appendChild(b),n}}}.call(this),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.middlewares"),sigma.utils.pkg("sigma.utils"),sigma.middlewares.rescale=function(a,b,c){var d,e,f,g,h,i,j,k,l=this.graph.nodes(),m=this.graph.edges(),n=this.settings.embedObjects(c||{}),o=n("bounds")||sigma.utils.getBoundaries(this.graph,a,!0),p=o.minX,q=o.minY,r=o.maxX,s=o.maxY,t=o.sizeMax,u=o.weightMax,v=n("width")||1,w=n("height")||1,x=n("autoRescale"),y={nodePosition:1,nodeSize:1,edgeSize:1};for(x instanceof Array||(x=["nodePosition","nodeSize","edgeSize"]),d=0,e=x.length;e>d;d++)if(!y[x[d]])throw new Error('The rescale setting "'+x[d]+'" is not recognized.');var z=~x.indexOf("nodePosition"),A=~x.indexOf("nodeSize"),B=~x.indexOf("edgeSize");for(j="outside"===n("scalingMode")?Math.max(v/Math.max(r-p,1),w/Math.max(s-q,1)):Math.min(v/Math.max(r-p,1),w/Math.max(s-q,1)),k=(n("rescaleIgnoreSize")?0:(n("maxNodeSize")||t)/j)+(n("sideMargin")||0),r+=k,p-=k,s+=k,q-=k,j="outside"===n("scalingMode")?Math.max(v/Math.max(r-p,1),w/Math.max(s-q,1)):Math.min(v/Math.max(r-p,1),w/Math.max(s-q,1)),n("maxNodeSize")||n("minNodeSize")?n("maxNodeSize")===n("minNodeSize")?(f=0,g=+n("maxNodeSize")):(f=(n("maxNodeSize")-n("minNodeSize"))/t,g=+n("minNodeSize")):(f=1,g=0),n("maxEdgeSize")||n("minEdgeSize")?n("maxEdgeSize")===n("minEdgeSize")?(h=0,i=+n("minEdgeSize")):(h=(n("maxEdgeSize")-n("minEdgeSize"))/u,i=+n("minEdgeSize")):(h=1,i=0),d=0,e=m.length;e>d;d++)m[d][b+"size"]=m[d][a+"size"]*(B?h:1)+(B?i:0);for(d=0,e=l.length;e>d;d++)l[d][b+"size"]=l[d][a+"size"]*(A?f:1)+(A?g:0),l[d][b+"x"]=(l[d][a+"x"]-(r+p)/2)*(z?j:1),l[d][b+"y"]=(l[d][a+"y"]-(s+q)/2)*(z?j:1)},sigma.utils.getBoundaries=function(a,b,c){var d,e,f=a.edges(),g=a.nodes(),h=-(1/0),i=-(1/0),j=1/0,k=1/0,l=-(1/0),m=-(1/0);if(c)for(d=0,e=f.length;e>d;d++)h=Math.max(f[d][b+"size"],h);for(d=0,e=g.length;e>d;d++)i=Math.max(g[d][b+"size"],i),l=Math.max(g[d][b+"x"],l),j=Math.min(g[d][b+"x"],j),m=Math.max(g[d][b+"y"],m),k=Math.min(g[d][b+"y"],k);return h=h||1,i=i||1,{weightMax:h,sizeMax:i,minX:j,minY:k,maxX:l,maxY:m}}}.call(this),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.middlewares"),sigma.middlewares.copy=function(a,b){var c,d,e;if(b+""!=a+""){for(e=this.graph.nodes(),c=0,d=e.length;d>c;c++)e[c][b+"x"]=e[c][a+"x"],e[c][b+"y"]=e[c][a+"y"],e[c][b+"size"]=e[c][a+"size"];for(e=this.graph.edges(),c=0,d=e.length;d>c;c++)e[c][b+"size"]=e[c][a+"size"]}}}.call(this),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.misc.animation.running");var b=function(){var a=0;return function(){return""+ ++a}}();sigma.misc.animation.camera=function(c,d,e){if(!(c instanceof sigma.classes.camera&&"object"==typeof d&&d))throw"animation.camera: Wrong arguments.";if("number"!=typeof d.x&&"number"!=typeof d.y&&"number"!=typeof d.ratio&&"number"!=typeof d.angle)throw"There must be at least one valid coordinate in the given val.";var f,g,h,i,j,k,l=e||{},m=sigma.utils.dateNow();return k={x:c.x,y:c.y,ratio:c.ratio,angle:c.angle},j=l.duration,i="function"!=typeof l.easing?sigma.utils.easings[l.easing||"quadraticInOut"]:l.easing,f=function(){var b,e=l.duration?(sigma.utils.dateNow()-m)/l.duration:1;e>=1?(c.isAnimated=!1,c.goTo({x:d.x!==a?d.x:k.x,y:d.y!==a?d.y:k.y,ratio:d.ratio!==a?d.ratio:k.ratio,angle:d.angle!==a?d.angle:k.angle}),cancelAnimationFrame(g),delete sigma.misc.animation.running[g],"function"==typeof l.onComplete&&l.onComplete()):(b=i(e),c.isAnimated=!0,c.goTo({x:d.x!==a?k.x+(d.x-k.x)*b:k.x,y:d.y!==a?k.y+(d.y-k.y)*b:k.y,ratio:d.ratio!==a?k.ratio+(d.ratio-k.ratio)*b:k.ratio,angle:d.angle!==a?k.angle+(d.angle-k.angle)*b:k.angle}),"function"==typeof l.onNewFrame&&l.onNewFrame(),h.frameId=requestAnimationFrame(f))},g=b(),h={frameId:requestAnimationFrame(f),target:c,type:"camera",options:l,fn:f},sigma.misc.animation.running[g]=h,g},sigma.misc.animation.kill=function(a){if(1!==arguments.length||"number"!=typeof a)throw"animation.kill: Wrong arguments.";var b=sigma.misc.animation.running[a];return b&&(cancelAnimationFrame(a),delete sigma.misc.animation.running[b.frameId],"camera"===b.type&&(b.target.isAnimated=!1),"function"==typeof(b.options||{}).onComplete&&b.options.onComplete()),this},sigma.misc.animation.killAll=function(a){var b,c,d=0,e="string"==typeof a?a:null,f="object"==typeof a?a:null,g=sigma.misc.animation.running;for(c in g)e&&g[c].type!==e||f&&g[c].target!==f||(b=sigma.misc.animation.running[c],cancelAnimationFrame(b.frameId),delete sigma.misc.animation.running[c],"camera"===b.type&&(b.target.isAnimated=!1),d++,"function"==typeof(b.options||{}).onComplete&&b.options.onComplete());return d},sigma.misc.animation.has=function(a){var b,c="string"==typeof a?a:null,d="object"==typeof a?a:null,e=sigma.misc.animation.running;for(b in e)if(!(c&&e[b].type!==c||d&&e[b].target!==d))return!0;return!1}}.call(this),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.misc"),sigma.misc.bindEvents=function(b){function c(a){a&&(h="x"in a.data?a.data.x:h,i="y"in a.data?a.data.y:i);var c,d,e,f,g,k,l,m,n=[],o=h+j.width/2,p=i+j.height/2,q=j.camera.cameraPosition(h,i),r=j.camera.quadtree.point(q.x,q.y);if(r.length)for(c=0,e=r.length;e>c;c++)if(f=r[c],g=f[b+"x"],k=f[b+"y"],l=f[b+"size"],!f.hidden&&o>g-l&&g+l>o&&p>k-l&&k+l>p&&Math.sqrt(Math.pow(o-g,2)+Math.pow(p-k,2))<l){for(m=!1,d=0;d<n.length;d++)if(f.size>n[d].size){n.splice(d,0,f),m=!0;break}m||n.push(f)}return n}function d(c){function d(a,b){for(r=!1,g=0;g<a.length;g++)if(b.size>a[g].size){a.splice(g,0,b),r=!0;break}r||a.push(b)}if(!j.settings("enableEdgeHovering"))return[];var e=sigma.renderers.canvas&&j instanceof sigma.renderers.canvas;if(!e)throw new Error("The edge events feature is not compatible with the WebGL renderer");c&&(h="x"in c.data?c.data.x:h,i="y"in c.data?c.data.y:i);var f,g,k,l,m,n,o,p,q,r,s=j.settings("edgeHoverPrecision"),t={},u=[],v=h+j.width/2,w=i+j.height/2,x=j.camera.cameraPosition(h,i),y=[];if(e){var z=j.camera.quadtree.area(j.camera.getRectangle(j.width,j.height));for(l=z,f=0,k=l.length;k>f;f++)t[l[f].id]=l[f]}if(j.camera.edgequadtree!==a&&(y=j.camera.edgequadtree.point(x.x,x.y)),y.length)for(f=0,k=y.length;k>f;f++)m=y[f],o=j.graph.nodes(m.source),p=j.graph.nodes(m.target),n=m[b+"size"]||m["read_"+b+"size"],!m.hidden&&!o.hidden&&!p.hidden&&(!e||t[m.source]||t[m.target])&&sigma.utils.getDistance(o[b+"x"],o[b+"y"],v,w)>o[b+"size"]&&sigma.utils.getDistance(p[b+"x"],p[b+"y"],v,w)>p[b+"size"]&&("curve"==m.type||"curvedArrow"==m.type?o.id===p.id?(q=sigma.utils.getSelfLoopControlPoints(o[b+"x"],o[b+"y"],o[b+"size"]),sigma.utils.isPointOnBezierCurve(v,w,o[b+"x"],o[b+"y"],p[b+"x"],p[b+"y"],q.x1,q.y1,q.x2,q.y2,Math.max(n,s))&&d(u,m)):(q=sigma.utils.getQuadraticControlPoint(o[b+"x"],o[b+"y"],p[b+"x"],p[b+"y"]),sigma.utils.isPointOnQuadraticCurve(v,w,o[b+"x"],o[b+"y"],p[b+"x"],p[b+"y"],q.x,q.y,Math.max(n,s))&&d(u,m)):sigma.utils.isPointOnSegment(v,w,o[b+"x"],o[b+"y"],p[b+"x"],p[b+"y"],Math.max(n,s))&&d(u,m));return u}function e(a){function b(a){j.settings("eventsEnabled")&&(j.dispatchEvent("click",a.data),i=c(a),k=d(a),i.length?(j.dispatchEvent("clickNode",{node:i[0],captor:a.data}),j.dispatchEvent("clickNodes",{node:i,captor:a.data})):k.length?(j.dispatchEvent("clickEdge",{edge:k[0],captor:a.data}),j.dispatchEvent("clickEdges",{edge:k,captor:a.data})):j.dispatchEvent("clickStage",{captor:a.data}))}function e(a){j.settings("eventsEnabled")&&(j.dispatchEvent("doubleClick",a.data),i=c(a),k=d(a),i.length?(j.dispatchEvent("doubleClickNode",{node:i[0],captor:a.data}),j.dispatchEvent("doubleClickNodes",{node:i,captor:a.data})):k.length?(j.dispatchEvent("doubleClickEdge",{edge:k[0],captor:a.data}),j.dispatchEvent("doubleClickEdges",{edge:k,captor:a.data})):j.dispatchEvent("doubleClickStage",{captor:a.data}))}function f(a){j.settings("eventsEnabled")&&(j.dispatchEvent("rightClick",a.data),i=c(a),k=d(a),i.length?(j.dispatchEvent("rightClickNode",{node:i[0],captor:a.data}),j.dispatchEvent("rightClickNodes",{node:i,captor:a.data})):k.length?(j.dispatchEvent("rightClickEdge",{edge:k[0],captor:a.data}),j.dispatchEvent("rightClickEdges",{edge:k,captor:a.data})):j.dispatchEvent("rightClickStage",{captor:a.data}))}function g(a){if(j.settings("eventsEnabled")){var b,c,d,e,f=[],g=[];for(b in l)f.push(l[b]);for(l={},c=0,d=f.length;d>c;c++)j.dispatchEvent("outNode",{node:f[c],captor:a.data});for(f.length&&j.dispatchEvent("outNodes",{nodes:f,captor:a.data}),m={},c=0,e=g.length;e>c;c++)j.dispatchEvent("outEdge",{edge:g[c],captor:a.data});g.length&&j.dispatchEvent("outEdges",{edges:g,captor:a.data})}}function h(a){if(j.settings("eventsEnabled")){i=c(a),k=d(a);var b,e,f,g,h=[],n=[],o={},p=i.length,q=[],r=[],s={},t=k.length;for(b=0;p>b;b++)f=i[b],o[f.id]=f,l[f.id]||(n.push(f),l[f.id]=f);for(e in l)o[e]||(h.push(l[e]),delete l[e]);for(b=0,p=n.length;p>b;b++)j.dispatchEvent("overNode",{node:n[b],captor:a.data});for(b=0,p=h.length;p>b;b++)j.dispatchEvent("outNode",{node:h[b],captor:a.data});for(n.length&&j.dispatchEvent("overNodes",{nodes:n,captor:a.data}),h.length&&j.dispatchEvent("outNodes",{nodes:h,captor:a.data}),b=0;t>b;b++)g=k[b],s[g.id]=g,m[g.id]||(r.push(g),m[g.id]=g);for(e in m)s[e]||(q.push(m[e]),delete m[e]);for(b=0,t=r.length;t>b;b++)j.dispatchEvent("overEdge",{edge:r[b],captor:a.data});for(b=0,t=q.length;t>b;b++)j.dispatchEvent("outEdge",{edge:q[b],captor:a.data});r.length&&j.dispatchEvent("overEdges",{edges:r,captor:a.data}),q.length&&j.dispatchEvent("outEdges",{edges:q,captor:a.data})}}var i,k,l={},m={};a.bind("click",b),a.bind("mousedown",h),a.bind("mouseup",h),a.bind("mousemove",h),a.bind("mouseout",g),a.bind("doubleclick",e),a.bind("rightclick",f),j.bind("render",h)}var f,g,h,i,j=this;for(f=0,g=this.captors.length;g>f;f++)e(this.captors[f])}}.call(this),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.misc"),sigma.misc.bindDOMEvents=function(a){function b(a){this.attr=function(b){return a.getAttributeNS(null,b)},this.tag=a.tagName,this["class"]=this.attr("class"),this.id=this.attr("id"),this.isNode=function(){return!!~this["class"].indexOf(g.settings("classPrefix")+"-node")},this.isEdge=function(){return!!~this["class"].indexOf(g.settings("classPrefix")+"-edge")},this.isHover=function(){return!!~this["class"].indexOf(g.settings("classPrefix")+"-hover")}}function c(a){if(g.settings("eventsEnabled")){g.dispatchEvent("click",a);var c=new b(a.target);c.isNode()?g.dispatchEvent("clickNode",{node:h.nodes(c.attr("data-node-id"))}):g.dispatchEvent("clickStage"),a.preventDefault(),a.stopPropagation()}}function d(a){if(g.settings("eventsEnabled")){g.dispatchEvent("doubleClick",a);var c=new b(a.target);c.isNode()?g.dispatchEvent("doubleClickNode",{node:h.nodes(c.attr("data-node-id"))}):g.dispatchEvent("doubleClickStage"),a.preventDefault(),a.stopPropagation()}}function e(a){var c=a.toElement||a.target;if(g.settings("eventsEnabled")&&c){var d=new b(c);if(d.isNode())g.dispatchEvent("overNode",{node:h.nodes(d.attr("data-node-id"))});else if(d.isEdge()){var e=h.edges(d.attr("data-edge-id"));g.dispatchEvent("overEdge",{edge:e,source:h.nodes(e.source),target:h.nodes(e.target)})}}}function f(a){var c=a.fromElement||a.originalTarget;if(g.settings("eventsEnabled")){var d=new b(c);if(d.isNode())g.dispatchEvent("outNode",{node:h.nodes(d.attr("data-node-id"))});else if(d.isEdge()){var e=h.edges(d.attr("data-edge-id"));g.dispatchEvent("outEdge",{edge:e,source:h.nodes(e.source),target:h.nodes(e.target)})}}}var g=this,h=this.graph;a.addEventListener("click",c,!1),sigma.utils.doubleClick(a,"click",d),a.addEventListener("touchstart",c,!1),sigma.utils.doubleClick(a,"touchstart",d),a.addEventListener("mouseover",e,!0),a.addEventListener("mouseout",f,!0)}}.call(this),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.misc"),sigma.misc.drawHovers=function(a){function b(){c.contexts.hover.canvas.width=c.contexts.hover.canvas.width;var b,f,g,h,i,j=c.settings("defaultNodeType"),k=c.settings("defaultEdgeType"),l=sigma.canvas.hovers,m=sigma.canvas.edgehovers,n=sigma.canvas.extremities,o=c.settings.embedObjects({prefix:a});if(o("enableHovering")&&o("singleHover")&&Object.keys(d).length&&(h=d[Object.keys(d)[0]],(l[h.type]||l[j]||l.def)(h,c.contexts.hover,o)),o("enableHovering")&&!o("singleHover"))for(b in d)(l[d[b].type]||l[j]||l.def)(d[b],c.contexts.hover,o);if(o("enableEdgeHovering")&&o("singleHover")&&Object.keys(e).length&&(i=e[Object.keys(e)[0]],f=c.graph.nodes(i.source),g=c.graph.nodes(i.target),i.hidden||((m[i.type]||m[k]||m.def)(i,f,g,c.contexts.hover,o),o("edgeHoverExtremities")?(n[i.type]||n.def)(i,f,g,c.contexts.hover,o):((sigma.canvas.nodes[f.type]||sigma.canvas.nodes.def)(f,c.contexts.hover,o),(sigma.canvas.nodes[g.type]||sigma.canvas.nodes.def)(g,c.contexts.hover,o)))),o("enableEdgeHovering")&&!o("singleHover"))for(b in e)i=e[b],f=c.graph.nodes(i.source),g=c.graph.nodes(i.target),i.hidden||((m[i.type]||m[k]||m.def)(i,f,g,c.contexts.hover,o),o("edgeHoverExtremities")?(n[i.type]||n.def)(i,f,g,c.contexts.hover,o):((sigma.canvas.nodes[f.type]||sigma.canvas.nodes.def)(f,c.contexts.hover,o),(sigma.canvas.nodes[g.type]||sigma.canvas.nodes.def)(g,c.contexts.hover,o)))}var c=this,d={},e={};this.bind("overNode",function(a){var c=a.data.node;c.hidden||(d[c.id]=c,b())}),this.bind("outNode",function(a){delete d[a.data.node.id],b()}),this.bind("overEdge",function(a){var c=a.data.edge;c.hidden||(e[c.id]=c,b())}),this.bind("outEdge",function(a){delete e[a.data.edge.id],b()}),this.bind("render",function(a){b()})}}.call(this);
-
-/**sigma.plugins.dragNodes**/
-(function(){"use strict";function a(a,b){function c(a){var b=window.getComputedStyle(a),c=function(a){return parseInt(b.getPropertyValue(a).replace("px",""))||0};return{left:a.getBoundingClientRect().left+c("padding-left"),top:a.getBoundingClientRect().top+c("padding-top")}}function d(a){t=!1,l.removeEventListener("mousemove",i),l.removeEventListener("mouseup",h),r.length||(p=null)}function e(a){s[a.data.node.id]||(r.push(a.data.node),s[a.data.node.id]=!0,r.length&&!t&&(p=r[r.length-1],n.addEventListener("mousedown",g)))}function f(a){var b=r.map(function(a){return a}).indexOf(a.data.node);r.splice(b,1),delete s[a.data.node.id],r.length&&!t?p=r[r.length-1]:n.removeEventListener("mousedown",g)}function g(a){t=!0;var b=k.graph.nodes().length;if(p&&b>1){n.removeEventListener("mousedown",g),l.addEventListener("mousemove",i),l.addEventListener("mouseup",h);var c,d;for(c in k.cameras)d=k.cameras[c],void 0!==d.edgequadtree&&(d.edgequadtree._enabled=!1);m.settings({mouseEnabled:!1,enableHovering:!1}),k.refresh(),j.dispatchEvent("startdrag",{node:p,captor:a,renderer:m})}}function h(a){t=!1,n.addEventListener("mousedown",g),l.removeEventListener("mousemove",i),l.removeEventListener("mouseup",h);var b,c;for(b in k.cameras)c=k.cameras[b],void 0!==c.edgequadtree&&(c.edgequadtree._enabled=!0);m.settings({mouseEnabled:!0,enableHovering:!0}),k.refresh(),u&&j.dispatchEvent("drop",{node:p,captor:a,renderer:m}),j.dispatchEvent("dragend",{node:p,captor:a,renderer:m}),u=!1,p=null}function i(a){function b(){for(var b=c(m.container),d=a.clientX-b.left,e=a.clientY-b.top,f=Math.cos(o.angle),g=Math.sin(o.angle),h=k.graph.nodes(),i=[],l=0;2>l;l++){var n=h[l],r={x:n.x*f+n.y*g,y:n.y*f-n.x*g,renX:n[q+"x"],renY:n[q+"y"]};i.push(r)}if(i[0].x===i[1].x&&i[0].y===i[1].y){var s=0===i[0].renX?1:i[0].renX,t=0===i[0].renY?1:i[0].renY;d=i[0].x/s*(d-i[0].renX)+i[0].x,e=i[0].y/t*(e-i[0].renY)+i[0].y}else{var s=(i[1].renX-i[0].renX)/(i[1].x-i[0].x),t=(i[1].renY-i[0].renY)/(i[1].y-i[0].y);i[1].x===i[0].x&&(s=t),i[1].y===i[0].y&&(t=s),d=(d-i[0].renX)/s+i[0].x,e=(e-i[0].renY)/t+i[0].y}p.x=d*f-e*g,p.y=e*f+d*g,k.refresh(),u=!0,j.dispatchEvent("drag",{node:p,captor:a,renderer:m})}if(navigator.userAgent.toLowerCase().indexOf("firefox")>-1){clearTimeout(d);var d=setTimeout(b,0)}else b()}if(sigma.classes.dispatcher.extend(this),sigma.renderers.webgl&&b instanceof sigma.renderers.webgl)throw new Error("The sigma.plugins.dragNodes is not compatible with the WebGL renderer");var j=this,k=a,l=document.body,m=b,n=b.container.lastChild,o=b.camera,p=null,q="",r=[],s={},t=!1,u=!1;b instanceof sigma.renderers.svg&&(n=b.container.firstChild),q=b instanceof sigma.renderers.webgl?b.options.prefix.substr(5):b.options.prefix,b.bind("overNode",e),b.bind("outNode",f),b.bind("click",d),k.bind("kill",function(){j.unbindAll()}),this.unbindAll=function(){n.removeEventListener("mousedown",g),l.removeEventListener("mousemove",i),l.removeEventListener("mouseup",h),m.unbind("overNode",e),m.unbind("outNode",f)}}if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.plugins");var b={};sigma.plugins.dragNodes=function(c,d){return b[c.id]||(b[c.id]=new a(c,d)),c.bind("kill",function(){sigma.plugins.killDragNodes(c)}),b[c.id]},sigma.plugins.killDragNodes=function(c){b[c.id]instanceof a&&(b[c.id].unbindAll(),delete b[c.id])}}).call(window);
-
-/**shape-library**/
-(function(c){var b=[];var m=function(o,n,p){b.push({"name":o,"drawShape":n,"drawBorder":p})};var d=function(){return b};var h=function(n){return function(s,o,t,r,p,q){q.fillStyle=p;q.beginPath();n(s,o,t,r,q);q.closePath();q.fill()}};var j=function(n){return function(s,o,t,r,p,q){q.strokeStyle=p;q.lineWidth=r/5;q.beginPath();n(s,o,t,r,q);q.closePath();q.stroke()}};var f=function(s,n,t,r,q){var o=Math.PI*45/180;q.moveTo(n+r*Math.sin(o),t-r*Math.cos(o));for(var p=1;p<4;p++){q.lineTo(n+Math.sin(o+2*Math.PI*p/4)*r,t-Math.cos(o+2*Math.PI*p/4)*r)}};m("square",h(f),j(f));var i=function(q,n,r,p,o){o.arc(n,r,p,0,Math.PI*2,true)};m("circle",h(i),j(i));var a=function(q,n,r,p,o){o.moveTo(n-p,r);o.lineTo(n,r-p);o.lineTo(n+p,r);o.lineTo(n,r+p)};m("diamond",h(a),j(a));var g=function(r,n,s,q,p){var o=(r.cross&&r.cross.lineWeight)||5;p.moveTo(n-q,s-o);p.lineTo(n-q,s+o);p.lineTo(n-o,s+o);p.lineTo(n-o,s+q);p.lineTo(n+o,s+q);p.lineTo(n+o,s+o);p.lineTo(n+q,s+o);p.lineTo(n+q,s-o);p.lineTo(n+o,s-o);p.lineTo(n+o,s-q);p.lineTo(n-o,s-q);p.lineTo(n-o,s-o)};m("cross",h(g),j(g));var e=function(o,t,s,v,n){var u=(o.equilateral&&o.equilateral.numPoints)||5;var p=((o.equilateral&&o.equilateral.rotate)||0)*Math.PI/180;var r=v;n.moveTo(t+r*Math.sin(p),s-r*Math.cos(p));for(var q=1;q<u;q++){n.lineTo(t+Math.sin(p+2*Math.PI*q/u)*r,s-Math.cos(p+2*Math.PI*q/u)*r)}};m("equilateral",h(e),j(e));var k=function(p,u,t,z,o){var v=(p.star&&p.star.numPoints)||5,n=(p.star&&p.star.innerRatio)||0.5,s=z,w=z*n,q=Math.PI/v;o.moveTo(u,t-z);for(var r=0;r<v;r++){o.lineTo(u+Math.sin(q+2*Math.PI*r/v)*w,t-Math.cos(q+2*Math.PI*r/v)*w);o.lineTo(u+Math.sin(2*Math.PI*(r+1)/v)*s,t-Math.cos(2*Math.PI*(r+1)/v)*s)}};m("star",h(k),j(k));var l=function(r,n,s,q,o,p){p.fillStyle="yellow";p.beginPath();p.arc(n,s,q,1.25*Math.PI,0,false);p.arc(n,s,q,0,0.75*Math.PI,false);p.lineTo(n,s);p.closePath();p.fill();p.fillStyle="white";p.strokeStyle="black";p.beginPath();p.arc(n+q/3,s-q/3,q/4,0,2*Math.PI,false);p.closePath();p.fill();p.stroke();p.fillStyle="black";p.beginPath();p.arc(n+4*q/9,s-q/3,q/8,0,2*Math.PI,false);p.closePath();p.fill()};m("pacman",l,null);this.ShapeLibrary={enumerate:d,version:"0.1"}}).call(this);
-
-/**sigma.renderers.customShapes**/
-(function(a){"use strict";var b=[],c=function(a,c,d){b.push({name:a,drawShape:c,drawBorder:d})},d=function(){return b},e=function(a){return function(b,c,d,e,f,g){g.fillStyle=f,g.beginPath(),a(b,c,d,e,g),g.closePath(),g.fill()}},f=function(a){return function(b,c,d,e,f,g){g.strokeStyle=f,g.lineWidth=e/5,g.beginPath(),a(b,c,d,e,g),g.closePath(),g.stroke()}},g=function(a,b,c,d,e){var f=45*Math.PI/180;e.moveTo(b+d*Math.sin(f),c-d*Math.cos(f));for(var g=1;4>g;g++)e.lineTo(b+Math.sin(f+2*Math.PI*g/4)*d,c-Math.cos(f+2*Math.PI*g/4)*d)};c("square",e(g),f(g));var h=function(a,b,c,d,e){e.arc(b,c,d,0,2*Math.PI,!0)};c("circle",e(h),f(h));var i=function(a,b,c,d,e){e.moveTo(b-d,c),e.lineTo(b,c-d),e.lineTo(b+d,c),e.lineTo(b,c+d)};c("diamond",e(i),f(i));var j=function(a,b,c,d,e){var f=a.cross&&a.cross.lineWeight||5;e.moveTo(b-d,c-f),e.lineTo(b-d,c+f),e.lineTo(b-f,c+f),e.lineTo(b-f,c+d),e.lineTo(b+f,c+d),e.lineTo(b+f,c+f),e.lineTo(b+d,c+f),e.lineTo(b+d,c-f),e.lineTo(b+f,c-f),e.lineTo(b+f,c-d),e.lineTo(b-f,c-d),e.lineTo(b-f,c-f)};c("cross",e(j),f(j));var k=function(a,b,c,d,e){var f=a.equilateral&&a.equilateral.numPoints||5,g=(a.equilateral&&a.equilateral.rotate||0)*Math.PI/180,h=d;e.moveTo(b+h*Math.sin(g),c-h*Math.cos(g));for(var i=1;f>i;i++)e.lineTo(b+Math.sin(g+2*Math.PI*i/f)*h,c-Math.cos(g+2*Math.PI*i/f)*h)};c("equilateral",e(k),f(k));var l=function(a,b,c,d,e){var f=a.star&&a.star.numPoints||5,g=a.star&&a.star.innerRatio||.5,h=d,i=d*g,j=Math.PI/f;e.moveTo(b,c-d);for(var k=0;f>k;k++)e.lineTo(b+Math.sin(j+2*Math.PI*k/f)*i,c-Math.cos(j+2*Math.PI*k/f)*i),e.lineTo(b+Math.sin(2*Math.PI*(k+1)/f)*h,c-Math.cos(2*Math.PI*(k+1)/f)*h)};c("star",e(l),f(l));var m=function(a,b,c,d,e,f){f.fillStyle="yellow",f.beginPath(),f.arc(b,c,d,1.25*Math.PI,0,!1),f.arc(b,c,d,0,.75*Math.PI,!1),f.lineTo(b,c),f.closePath(),f.fill(),f.fillStyle="white",f.strokeStyle="black",f.beginPath(),f.arc(b+d/3,c-d/3,d/4,0,2*Math.PI,!1),f.closePath(),f.fill(),f.stroke(),f.fillStyle="black",f.beginPath(),f.arc(b+4*d/9,c-d/3,d/8,0,2*Math.PI,!1),f.closePath(),f.fill()};c("pacman",m,null),this.ShapeLibrary={enumerate:d,version:"0.1"}}).call(this),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";if("undefined"==typeof ShapeLibrary)throw"ShapeLibrary is not declared";sigma.utils.pkg("sigma.canvas.nodes"),sigma.utils.pkg("sigma.svg.nodes");var b=a,c={},d=function(a){b=a},e=function(a,d,e,f,g){if(b&&a.image&&a.image.url){var h=a.image.url,i=a.image.h||1,j=a.image.w||1,k=a.image.scale||1,l=a.image.clip||1,m=c[h];m||(m=document.createElement("IMG"),m.src=h,m.status="loading",m.onerror=function(){/*console.log("error loading",h),*/m.status="error"},m.onload=function(){/*console.log("redraw on image load",h),*/m.status="ok",b.refresh()},c[h]=m);var n=i>j?j/i:1,o=j>i?i/j:1,p=f*k;g.save(),g.beginPath(),g.arc(d,e,f*l,0,2*Math.PI,!0),g.closePath(),g.clip(),"ok"===m.status&&g.drawImage(m,d+Math.sin(-0.7855)*p*n,e-Math.cos(-0.7855)*p*o,p*n*2*Math.sin(-0.7855)*-1,p*o*2*Math.cos(-0.7855)),g.restore()}},f=function(a,c,d){if(b&&a.image&&a.image.url){var e=document.createElementNS(d("xmlns"),"circle"),f=document.createElementNS(d("xmlns"),"clipPath"),g=d("classPrefix")+"-clip-path-"+a.id,h=document.createElementNS(d("xmlns"),"defs"),i=document.createElementNS(d("xmlns"),"image");a.image.url;f.setAttributeNS(null,"id",g),f.appendChild(e),h.appendChild(f);var j=/MSIE [5-9]/.test(navigator.userAgent)?"":document.location.href;j=j.split("#")[0],i.setAttributeNS(null,"class",d("classPrefix")+"-node-image"),i.setAttributeNS(null,"clip-path","url("+j+"#"+g+")"),i.setAttributeNS(null,"pointer-events","none"),i.setAttributeNS("http://www.w3.org/1999/xlink","href",a.image.url),c.appendChild(h),c.appendChild(i)}},g=function(a,b,c){sigma.canvas.nodes[a]=function(a,d,f){var g=(arguments,f("prefix")||""),h=a[g+"size"],i=a.color||f("defaultNodeColor"),j=a.borderColor||i,k=a[g+"x"],l=a[g+"y"];d.save(),b&&b(a,k,l,h,i,d),c&&c(a,k,l,h,j,d),e(a,k,l,h,d),d.restore()},sigma.svg.nodes[a]={create:function(a,b){var c=document.createElementNS(b("xmlns"),"g"),d=document.createElementNS(b("xmlns"),"circle");return c.setAttributeNS(null,"class",b("classPrefix")+"-node-group"),c.setAttributeNS(null,"data-node-id",a.id),d.setAttributeNS(null,"data-node-id",a.id),d.setAttributeNS(null,"class",b("classPrefix")+"-node"),d.setAttributeNS(null,"fill",a.color||b("defaultNodeColor")),c.appendChild(d),f(a,c,b),c},update:function(a,b,c){for(var d=c("classPrefix"),e=a.image.clip||1,f=a.image.h||1,g=a.image.w||1,h=c("prefix")||"",i=a.image.scale||1,j=a[h+"size"],k=a[h+"x"],l=a[h+"y"],m=i*j,n=f>g?g/f:1,o=g>f?f/g:1,p=0,q=b.childNodes;p<q.length;p++){var r=q[p].getAttribute("class");switch(r){case d+"-node":q[p].setAttributeNS(null,"cx",k),q[p].setAttributeNS(null,"cy",l),q[p].setAttributeNS(null,"r",j),c("freeStyle")||q[p].setAttributeNS(null,"fill",a.color||c("defaultNodeColor"));break;case d+"-node-image":q[p].setAttributeNS(null,"x",k+Math.sin(-0.7855)*m*n),q[p].setAttributeNS(null,"y",l-Math.cos(-0.7855)*m*o),q[p].setAttributeNS(null,"width",m*n*2*Math.sin(-0.7855)*-1),q[p].setAttributeNS(null,"height",m*o*2*Math.cos(-0.7855));break;default:var s=q[p].firstChild;if(null!=s){var t=d+"-clip-path-"+a.id;s.getAttribute("id")===t&&(s.firstChild.setAttributeNS(null,"cx",k),s.firstChild.setAttributeNS(null,"cy",l),s.firstChild.setAttributeNS(null,"r",e*j))}}}b.style.display=""}}};ShapeLibrary.enumerate().forEach(function(a){g(a.name,a.drawShape,a.drawBorder)}),this.CustomShapes={init:d,version:"0.1"}}.call(this);
-
-/**openo tools**/
-// generate a random graph
-function oTopo(){var b;this.canvas=function(f,d){var e={nodes:[],edges:[]};b=new sigma({graph:e,renderer:{container:document.getElementById(f),type:"canvas"},settings:d});CustomShapes.init(b)};this.refresh=function(){b.refresh()};this.Node=function(e){var d=this;this.id=e,this.label="",this.type="square",this.x=1,this.y=1,this.size=10,this.image={};this.color="transparent",this.borderColor="#1E90FF",this.setName=function(f){d.label=f};this.setType=function(f){d.type=f};this.setSize=function(f){d.size=f};this.setImg=function(f){d.image={url:f,scale:1,clip:0,};d.borderColor="transparent";d.color="transparent"};this.setImgScale=function(f){d.image.scale=f};this.setImgClip=function(f){d.image.clip=f};this.setColor=function(f){d.color=f};this.setBorderColor=function(f){d.borderColor=f};this.setLocation=function(f,g){d.x=f;d.y=g};this.setProperty=function(g,f){d[g]=f}};this.Link=function(e){var d=this;this.id=e,this.type="arrow",this.source=1,this.target=1,this.size=Math.random(),this.color="#1E90FF",this.setType=function(f){d.type=f};this.setSize=function(f){d.size=f};this.setConnect=function(g,f){d.source=g;d.target=f};this.setColor=function(f){d.color=f};this.setProperty=function(g,f){d[g]=f}};this.addNode=function(d){b.graph.addNode(d)};this.dropNode=function(d){b.graph.dropNode(d)};this.addLink=function(d){b.graph.addEdge(d)};this.dropLink=function(d){b.graph.dropEdge(d)};this.allNodes=function(){return b.graph.nodes()};var c=null;this.setDrag=function(d){if(d){c=sigma.plugins.dragNodes(b,b.renderers[0])}};var a=function(f,d){if(null!=c){c.bind(f,function(e){d(e)})}};this.mouseBind=function(f,d){if(null!=b){b.bind(f,function(e){d(e)})}};this.noright=function(d){if(d){d.oncontextmenu=function(){return false};d.ondragstart=function(){return false};d.onselectstart=function(){return false};d.onselect=function(){d.selection.empty()};d.oncopy=function(){d.selection.empty()};d.onbeforecopy=function(){return false}}}}; \ No newline at end of file
diff --git a/portal-common/src/main/webapp/common/js/security/aes.js b/portal-common/src/main/webapp/common/js/security/aes.js
deleted file mode 100644
index b3f0691b..00000000
--- a/portal-common/src/main/webapp/common/js/security/aes.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright 2016-2017, CMCC Technologies Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var CryptoJS=CryptoJS||function(u,p){var d={},l=d.lib={},s=function(){},t=l.Base={extend:function(a){s.prototype=this;var c=new s;a&&c.mixIn(a);c.hasOwnProperty("init")||(c.init=function(){c.$super.init.apply(this,arguments)});c.init.prototype=c;c.$super=this;return c},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var c in a)a.hasOwnProperty(c)&&(this[c]=a[c]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.init.prototype.extend(this)}},
-r=l.WordArray=t.extend({init:function(a,c){a=this.words=a||[];this.sigBytes=c!=p?c:4*a.length},toString:function(a){return(a||v).stringify(this)},concat:function(a){var c=this.words,e=a.words,j=this.sigBytes;a=a.sigBytes;this.clamp();if(j%4)for(var k=0;k<a;k++)c[j+k>>>2]|=(e[k>>>2]>>>24-8*(k%4)&255)<<24-8*((j+k)%4);else if(65535<e.length)for(k=0;k<a;k+=4)c[j+k>>>2]=e[k>>>2];else c.push.apply(c,e);this.sigBytes+=a;return this},clamp:function(){var a=this.words,c=this.sigBytes;a[c>>>2]&=4294967295<<
-32-8*(c%4);a.length=u.ceil(c/4)},clone:function(){var a=t.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var c=[],e=0;e<a;e+=4)c.push(4294967296*u.random()|0);return new r.init(c,a)}}),w=d.enc={},v=w.Hex={stringify:function(a){var c=a.words;a=a.sigBytes;for(var e=[],j=0;j<a;j++){var k=c[j>>>2]>>>24-8*(j%4)&255;e.push((k>>>4).toString(16));e.push((k&15).toString(16))}return e.join("")},parse:function(a){for(var c=a.length,e=[],j=0;j<c;j+=2)e[j>>>3]|=parseInt(a.substr(j,
-2),16)<<24-4*(j%8);return new r.init(e,c/2)}},b=w.Latin1={stringify:function(a){var c=a.words;a=a.sigBytes;for(var e=[],j=0;j<a;j++)e.push(String.fromCharCode(c[j>>>2]>>>24-8*(j%4)&255));return e.join("")},parse:function(a){for(var c=a.length,e=[],j=0;j<c;j++)e[j>>>2]|=(a.charCodeAt(j)&255)<<24-8*(j%4);return new r.init(e,c)}},x=w.Utf8={stringify:function(a){try{return decodeURIComponent(escape(b.stringify(a)))}catch(c){throw Error("Malformed UTF-8 data");}},parse:function(a){return b.parse(unescape(encodeURIComponent(a)))}},
-q=l.BufferedBlockAlgorithm=t.extend({reset:function(){this._data=new r.init;this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=x.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var c=this._data,e=c.words,j=c.sigBytes,k=this.blockSize,b=j/(4*k),b=a?u.ceil(b):u.max((b|0)-this._minBufferSize,0);a=b*k;j=u.min(4*a,j);if(a){for(var q=0;q<a;q+=k)this._doProcessBlock(e,q);q=e.splice(0,a);c.sigBytes-=j}return new r.init(q,j)},clone:function(){var a=t.clone.call(this);
-a._data=this._data.clone();return a},_minBufferSize:0});l.Hasher=q.extend({cfg:t.extend(),init:function(a){this.cfg=this.cfg.extend(a);this.reset()},reset:function(){q.reset.call(this);this._doReset()},update:function(a){this._append(a);this._process();return this},finalize:function(a){a&&this._append(a);return this._doFinalize()},blockSize:16,_createHelper:function(a){return function(b,e){return(new a.init(e)).finalize(b)}},_createHmacHelper:function(a){return function(b,e){return(new n.HMAC.init(a,
-e)).finalize(b)}}});var n=d.algo={};return d}(Math);
-(function(){var u=CryptoJS,p=u.lib.WordArray;u.enc.Base64={stringify:function(d){var l=d.words,p=d.sigBytes,t=this._map;d.clamp();d=[];for(var r=0;r<p;r+=3)for(var w=(l[r>>>2]>>>24-8*(r%4)&255)<<16|(l[r+1>>>2]>>>24-8*((r+1)%4)&255)<<8|l[r+2>>>2]>>>24-8*((r+2)%4)&255,v=0;4>v&&r+0.75*v<p;v++)d.push(t.charAt(w>>>6*(3-v)&63));if(l=t.charAt(64))for(;d.length%4;)d.push(l);return d.join("")},parse:function(d){var l=d.length,s=this._map,t=s.charAt(64);t&&(t=d.indexOf(t),-1!=t&&(l=t));for(var t=[],r=0,w=0;w<
-l;w++)if(w%4){var v=s.indexOf(d.charAt(w-1))<<2*(w%4),b=s.indexOf(d.charAt(w))>>>6-2*(w%4);t[r>>>2]|=(v|b)<<24-8*(r%4);r++}return p.create(t,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})();
-(function(u){function p(b,n,a,c,e,j,k){b=b+(n&a|~n&c)+e+k;return(b<<j|b>>>32-j)+n}function d(b,n,a,c,e,j,k){b=b+(n&c|a&~c)+e+k;return(b<<j|b>>>32-j)+n}function l(b,n,a,c,e,j,k){b=b+(n^a^c)+e+k;return(b<<j|b>>>32-j)+n}function s(b,n,a,c,e,j,k){b=b+(a^(n|~c))+e+k;return(b<<j|b>>>32-j)+n}for(var t=CryptoJS,r=t.lib,w=r.WordArray,v=r.Hasher,r=t.algo,b=[],x=0;64>x;x++)b[x]=4294967296*u.abs(u.sin(x+1))|0;r=r.MD5=v.extend({_doReset:function(){this._hash=new w.init([1732584193,4023233417,2562383102,271733878])},
-_doProcessBlock:function(q,n){for(var a=0;16>a;a++){var c=n+a,e=q[c];q[c]=(e<<8|e>>>24)&16711935|(e<<24|e>>>8)&4278255360}var a=this._hash.words,c=q[n+0],e=q[n+1],j=q[n+2],k=q[n+3],z=q[n+4],r=q[n+5],t=q[n+6],w=q[n+7],v=q[n+8],A=q[n+9],B=q[n+10],C=q[n+11],u=q[n+12],D=q[n+13],E=q[n+14],x=q[n+15],f=a[0],m=a[1],g=a[2],h=a[3],f=p(f,m,g,h,c,7,b[0]),h=p(h,f,m,g,e,12,b[1]),g=p(g,h,f,m,j,17,b[2]),m=p(m,g,h,f,k,22,b[3]),f=p(f,m,g,h,z,7,b[4]),h=p(h,f,m,g,r,12,b[5]),g=p(g,h,f,m,t,17,b[6]),m=p(m,g,h,f,w,22,b[7]),
-f=p(f,m,g,h,v,7,b[8]),h=p(h,f,m,g,A,12,b[9]),g=p(g,h,f,m,B,17,b[10]),m=p(m,g,h,f,C,22,b[11]),f=p(f,m,g,h,u,7,b[12]),h=p(h,f,m,g,D,12,b[13]),g=p(g,h,f,m,E,17,b[14]),m=p(m,g,h,f,x,22,b[15]),f=d(f,m,g,h,e,5,b[16]),h=d(h,f,m,g,t,9,b[17]),g=d(g,h,f,m,C,14,b[18]),m=d(m,g,h,f,c,20,b[19]),f=d(f,m,g,h,r,5,b[20]),h=d(h,f,m,g,B,9,b[21]),g=d(g,h,f,m,x,14,b[22]),m=d(m,g,h,f,z,20,b[23]),f=d(f,m,g,h,A,5,b[24]),h=d(h,f,m,g,E,9,b[25]),g=d(g,h,f,m,k,14,b[26]),m=d(m,g,h,f,v,20,b[27]),f=d(f,m,g,h,D,5,b[28]),h=d(h,f,
-m,g,j,9,b[29]),g=d(g,h,f,m,w,14,b[30]),m=d(m,g,h,f,u,20,b[31]),f=l(f,m,g,h,r,4,b[32]),h=l(h,f,m,g,v,11,b[33]),g=l(g,h,f,m,C,16,b[34]),m=l(m,g,h,f,E,23,b[35]),f=l(f,m,g,h,e,4,b[36]),h=l(h,f,m,g,z,11,b[37]),g=l(g,h,f,m,w,16,b[38]),m=l(m,g,h,f,B,23,b[39]),f=l(f,m,g,h,D,4,b[40]),h=l(h,f,m,g,c,11,b[41]),g=l(g,h,f,m,k,16,b[42]),m=l(m,g,h,f,t,23,b[43]),f=l(f,m,g,h,A,4,b[44]),h=l(h,f,m,g,u,11,b[45]),g=l(g,h,f,m,x,16,b[46]),m=l(m,g,h,f,j,23,b[47]),f=s(f,m,g,h,c,6,b[48]),h=s(h,f,m,g,w,10,b[49]),g=s(g,h,f,m,
-E,15,b[50]),m=s(m,g,h,f,r,21,b[51]),f=s(f,m,g,h,u,6,b[52]),h=s(h,f,m,g,k,10,b[53]),g=s(g,h,f,m,B,15,b[54]),m=s(m,g,h,f,e,21,b[55]),f=s(f,m,g,h,v,6,b[56]),h=s(h,f,m,g,x,10,b[57]),g=s(g,h,f,m,t,15,b[58]),m=s(m,g,h,f,D,21,b[59]),f=s(f,m,g,h,z,6,b[60]),h=s(h,f,m,g,C,10,b[61]),g=s(g,h,f,m,j,15,b[62]),m=s(m,g,h,f,A,21,b[63]);a[0]=a[0]+f|0;a[1]=a[1]+m|0;a[2]=a[2]+g|0;a[3]=a[3]+h|0},_doFinalize:function(){var b=this._data,n=b.words,a=8*this._nDataBytes,c=8*b.sigBytes;n[c>>>5]|=128<<24-c%32;var e=u.floor(a/
-4294967296);n[(c+64>>>9<<4)+15]=(e<<8|e>>>24)&16711935|(e<<24|e>>>8)&4278255360;n[(c+64>>>9<<4)+14]=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360;b.sigBytes=4*(n.length+1);this._process();b=this._hash;n=b.words;for(a=0;4>a;a++)c=n[a],n[a]=(c<<8|c>>>24)&16711935|(c<<24|c>>>8)&4278255360;return b},clone:function(){var b=v.clone.call(this);b._hash=this._hash.clone();return b}});t.MD5=v._createHelper(r);t.HmacMD5=v._createHmacHelper(r)})(Math);
-(function(){var u=CryptoJS,p=u.lib,d=p.Base,l=p.WordArray,p=u.algo,s=p.EvpKDF=d.extend({cfg:d.extend({keySize:4,hasher:p.MD5,iterations:1}),init:function(d){this.cfg=this.cfg.extend(d)},compute:function(d,r){for(var p=this.cfg,s=p.hasher.create(),b=l.create(),u=b.words,q=p.keySize,p=p.iterations;u.length<q;){n&&s.update(n);var n=s.update(d).finalize(r);s.reset();for(var a=1;a<p;a++)n=s.finalize(n),s.reset();b.concat(n)}b.sigBytes=4*q;return b}});u.EvpKDF=function(d,l,p){return s.create(p).compute(d,
-l)}})();
-CryptoJS.lib.Cipher||function(u){var p=CryptoJS,d=p.lib,l=d.Base,s=d.WordArray,t=d.BufferedBlockAlgorithm,r=p.enc.Base64,w=p.algo.EvpKDF,v=d.Cipher=t.extend({cfg:l.extend(),createEncryptor:function(e,a){return this.create(this._ENC_XFORM_MODE,e,a)},createDecryptor:function(e,a){return this.create(this._DEC_XFORM_MODE,e,a)},init:function(e,a,b){this.cfg=this.cfg.extend(b);this._xformMode=e;this._key=a;this.reset()},reset:function(){t.reset.call(this);this._doReset()},process:function(e){this._append(e);return this._process()},
-finalize:function(e){e&&this._append(e);return this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(e){return{encrypt:function(b,k,d){return("string"==typeof k?c:a).encrypt(e,b,k,d)},decrypt:function(b,k,d){return("string"==typeof k?c:a).decrypt(e,b,k,d)}}}});d.StreamCipher=v.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var b=p.mode={},x=function(e,a,b){var c=this._iv;c?this._iv=u:c=this._prevBlock;for(var d=0;d<b;d++)e[a+d]^=
-c[d]},q=(d.BlockCipherMode=l.extend({createEncryptor:function(e,a){return this.Encryptor.create(e,a)},createDecryptor:function(e,a){return this.Decryptor.create(e,a)},init:function(e,a){this._cipher=e;this._iv=a}})).extend();q.Encryptor=q.extend({processBlock:function(e,a){var b=this._cipher,c=b.blockSize;x.call(this,e,a,c);b.encryptBlock(e,a);this._prevBlock=e.slice(a,a+c)}});q.Decryptor=q.extend({processBlock:function(e,a){var b=this._cipher,c=b.blockSize,d=e.slice(a,a+c);b.decryptBlock(e,a);x.call(this,
-e,a,c);this._prevBlock=d}});b=b.CBC=q;q=(p.pad={}).Pkcs7={pad:function(a,b){for(var c=4*b,c=c-a.sigBytes%c,d=c<<24|c<<16|c<<8|c,l=[],n=0;n<c;n+=4)l.push(d);c=s.create(l,c);a.concat(c)},unpad:function(a){a.sigBytes-=a.words[a.sigBytes-1>>>2]&255}};d.BlockCipher=v.extend({cfg:v.cfg.extend({mode:b,padding:q}),reset:function(){v.reset.call(this);var a=this.cfg,b=a.iv,a=a.mode;if(this._xformMode==this._ENC_XFORM_MODE)var c=a.createEncryptor;else c=a.createDecryptor,this._minBufferSize=1;this._mode=c.call(a,
-this,b&&b.words)},_doProcessBlock:function(a,b){this._mode.processBlock(a,b)},_doFinalize:function(){var a=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){a.pad(this._data,this.blockSize);var b=this._process(!0)}else b=this._process(!0),a.unpad(b);return b},blockSize:4});var n=d.CipherParams=l.extend({init:function(a){this.mixIn(a)},toString:function(a){return(a||this.formatter).stringify(this)}}),b=(p.format={}).OpenSSL={stringify:function(a){var b=a.ciphertext;a=a.salt;return(a?s.create([1398893684,
-1701076831]).concat(a).concat(b):b).toString(r)},parse:function(a){a=r.parse(a);var b=a.words;if(1398893684==b[0]&&1701076831==b[1]){var c=s.create(b.slice(2,4));b.splice(0,4);a.sigBytes-=16}return n.create({ciphertext:a,salt:c})}},a=d.SerializableCipher=l.extend({cfg:l.extend({format:b}),encrypt:function(a,b,c,d){d=this.cfg.extend(d);var l=a.createEncryptor(c,d);b=l.finalize(b);l=l.cfg;return n.create({ciphertext:b,key:c,iv:l.iv,algorithm:a,mode:l.mode,padding:l.padding,blockSize:a.blockSize,formatter:d.format})},
-decrypt:function(a,b,c,d){d=this.cfg.extend(d);b=this._parse(b,d.format);return a.createDecryptor(c,d).finalize(b.ciphertext)},_parse:function(a,b){return"string"==typeof a?b.parse(a,this):a}}),p=(p.kdf={}).OpenSSL={execute:function(a,b,c,d){d||(d=s.random(8));a=w.create({keySize:b+c}).compute(a,d);c=s.create(a.words.slice(b),4*c);a.sigBytes=4*b;return n.create({key:a,iv:c,salt:d})}},c=d.PasswordBasedCipher=a.extend({cfg:a.cfg.extend({kdf:p}),encrypt:function(b,c,d,l){l=this.cfg.extend(l);d=l.kdf.execute(d,
-b.keySize,b.ivSize);l.iv=d.iv;b=a.encrypt.call(this,b,c,d.key,l);b.mixIn(d);return b},decrypt:function(b,c,d,l){l=this.cfg.extend(l);c=this._parse(c,l.format);d=l.kdf.execute(d,b.keySize,b.ivSize,c.salt);l.iv=d.iv;return a.decrypt.call(this,b,c,d.key,l)}})}();
-(function(){for(var u=CryptoJS,p=u.lib.BlockCipher,d=u.algo,l=[],s=[],t=[],r=[],w=[],v=[],b=[],x=[],q=[],n=[],a=[],c=0;256>c;c++)a[c]=128>c?c<<1:c<<1^283;for(var e=0,j=0,c=0;256>c;c++){var k=j^j<<1^j<<2^j<<3^j<<4,k=k>>>8^k&255^99;l[e]=k;s[k]=e;var z=a[e],F=a[z],G=a[F],y=257*a[k]^16843008*k;t[e]=y<<24|y>>>8;r[e]=y<<16|y>>>16;w[e]=y<<8|y>>>24;v[e]=y;y=16843009*G^65537*F^257*z^16843008*e;b[k]=y<<24|y>>>8;x[k]=y<<16|y>>>16;q[k]=y<<8|y>>>24;n[k]=y;e?(e=z^a[a[a[G^z]]],j^=a[a[j]]):e=j=1}var H=[0,1,2,4,8,
-16,32,64,128,27,54],d=d.AES=p.extend({_doReset:function(){for(var a=this._key,c=a.words,d=a.sigBytes/4,a=4*((this._nRounds=d+6)+1),e=this._keySchedule=[],j=0;j<a;j++)if(j<d)e[j]=c[j];else{var k=e[j-1];j%d?6<d&&4==j%d&&(k=l[k>>>24]<<24|l[k>>>16&255]<<16|l[k>>>8&255]<<8|l[k&255]):(k=k<<8|k>>>24,k=l[k>>>24]<<24|l[k>>>16&255]<<16|l[k>>>8&255]<<8|l[k&255],k^=H[j/d|0]<<24);e[j]=e[j-d]^k}c=this._invKeySchedule=[];for(d=0;d<a;d++)j=a-d,k=d%4?e[j]:e[j-4],c[d]=4>d||4>=j?k:b[l[k>>>24]]^x[l[k>>>16&255]]^q[l[k>>>
-8&255]]^n[l[k&255]]},encryptBlock:function(a,b){this._doCryptBlock(a,b,this._keySchedule,t,r,w,v,l)},decryptBlock:function(a,c){var d=a[c+1];a[c+1]=a[c+3];a[c+3]=d;this._doCryptBlock(a,c,this._invKeySchedule,b,x,q,n,s);d=a[c+1];a[c+1]=a[c+3];a[c+3]=d},_doCryptBlock:function(a,b,c,d,e,j,l,f){for(var m=this._nRounds,g=a[b]^c[0],h=a[b+1]^c[1],k=a[b+2]^c[2],n=a[b+3]^c[3],p=4,r=1;r<m;r++)var q=d[g>>>24]^e[h>>>16&255]^j[k>>>8&255]^l[n&255]^c[p++],s=d[h>>>24]^e[k>>>16&255]^j[n>>>8&255]^l[g&255]^c[p++],t=
-d[k>>>24]^e[n>>>16&255]^j[g>>>8&255]^l[h&255]^c[p++],n=d[n>>>24]^e[g>>>16&255]^j[h>>>8&255]^l[k&255]^c[p++],g=q,h=s,k=t;q=(f[g>>>24]<<24|f[h>>>16&255]<<16|f[k>>>8&255]<<8|f[n&255])^c[p++];s=(f[h>>>24]<<24|f[k>>>16&255]<<16|f[n>>>8&255]<<8|f[g&255])^c[p++];t=(f[k>>>24]<<24|f[n>>>16&255]<<16|f[g>>>8&255]<<8|f[h&255])^c[p++];n=(f[n>>>24]<<24|f[g>>>16&255]<<16|f[h>>>8&255]<<8|f[k&255])^c[p++];a[b]=q;a[b+1]=s;a[b+2]=t;a[b+3]=n},keySize:8});u.AES=p._createHelper(d)})();
diff --git a/portal-common/src/main/webapp/common/js/security/framework-util.js b/portal-common/src/main/webapp/common/js/security/framework-util.js
deleted file mode 100644
index 8299fdca..00000000
--- a/portal-common/src/main/webapp/common/js/security/framework-util.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2016-2017, CMCC Technologies Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-function ict_framework_func1(word){
- var a1 = CryptoJS.enc.Utf8.parse(ict_framework_aes_a1);
- var a2 = CryptoJS.enc.Utf8.parse(ict_framework_aes_a2);
- var srcs = CryptoJS.enc.Utf8.parse(word);
- var encrypted = CryptoJS.AES.encrypt(srcs, a1, { iv: a2,mode:CryptoJS.mode.CBC});
- return encrypted.toString();
-}
-
-function ict_framework_func2(word){
- var a1 = CryptoJS.enc.Utf8.parse(ict_framework_aes_a1);
- var a2 = CryptoJS.enc.Utf8.parse(ict_framework_aes_a2);
- var decrypt = CryptoJS.AES.decrypt(word, a1, { iv: a2,mode:CryptoJS.mode.CBC});
- return CryptoJS.enc.Utf8.stringify(decrypt).toString();
-}
-
-
-
-
-
-
-
-var ict_framework_aes_a1 = "9763853428462486";
-var ict_framework_aes_a2 = "9763853428462486"; \ No newline at end of file
diff --git a/portal-common/src/main/webapp/common/js/security/security.js b/portal-common/src/main/webapp/common/js/security/security.js
deleted file mode 100644
index f4a759ee..00000000
--- a/portal-common/src/main/webapp/common/js/security/security.js
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright 2016-2017, CMCC Technologies Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var ErrResult_LOGIN_SUCCESS = 0;
-var ErrResult_LOGIN_FAILURE = 4;
-var ErrResult_LOGIN_SUCCESS_WARN = 1;
-var ErrResult_LOGIN_SUCCESS_PASSWORD_WARN = 2;
-var ErrResult_LOGIN_SUCCESS_PASSWORD_MUSTCHANGE = 3;
-var ErrResult_LOGIN_SERV_ERROR = -1;
-
-function processLoginResult(data,params){
- if(data.home="web/res/web-framework/index.html"||data.home.indexOf("index.html")>0){
- data.home=FrameConst.DEFAULT_PAGE;
- //下面这部分是为了演示需要临时增加的自动切换
- /*if(params.username=="admin1"){
- data.home="/web/res/web-framework/default.html?menu=1";
- }else if(params.username=="admin2"){
- data.home="/web/res/web-framework/default.html?menu=2";
- }else if(params.username=="admin3"){
- data.home="/web/res/web-framework/default.html?menu=3";
- }else if(params.username=="admin4"){
- data.home="/web/res/web-framework/default.html?menu=4";
- }else if(params.username=="admin5"){
- data.home="/web/res/web-framework/default.html?menu=5";
- }else if(params.username=="admin6"){
- data.home="/web/res/web-framework/default.html?menu=6";
- }else if(params.username=="admin7"){
- data.home="/web/res/web-framework/default.html?menu=7";
- }*/
- }
- var toHomePage = function(){
- location.href = data.home;
- }
-
- var loginHander = function(inParams){
- if(inParams != undefined){
- login(inParams);
- }
- else{
- login(params);
- }
- }
-
- var errors = data.detail;
- if(data.result == 0){
- store('username',params.username);
- if(errors){
- if(errors.code==ErrResult_LOGIN_SUCCESS_PASSWORD_WARN){
-
- com_zte_ums_aos_portal_PasswordDialog.create({
- ID : "LOGIN_MODIFY_PASSWORD",
- username : params.username,
- oldPassword : ict_framework_func2(params.password),
- descLabel : errors[ErrResult_LOGIN_SUCCESS_PASSWORD_WARN],
- cancelHander : toHomePage,
- confirmHander : toHomePage
- });
- LOGIN_MODIFY_PASSWORD.show();
- }
- else if(errors.code==ErrResult_LOGIN_SUCCESS_WARN){
- window.alert(errors[ErrResult_LOGIN_SUCCESS_WARN],toHomePage);
- }
- else {
- location.href = data.home;
- }
- }
- else {
- location.href = data.home;
- }
- }
- else {
- if(errors.code==ErrResult_LOGIN_SUCCESS_PASSWORD_MUSTCHANGE){
- com_zte_ums_aos_portal_PasswordDialog.create({
- ID : "LOGIN_MODIFY_PASSWORD",
- username : params.username,
- oldPassword : ict_framework_func2(params.password),
- descLabel : errors[ErrResult_LOGIN_SUCCESS_PASSWORD_MUSTCHANGE],
- confirmHander : loginHander
-
- });
- LOGIN_MODIFY_PASSWORD.show();
- }
- else if(errors.code==ErrResult_LOGIN_FAILURE){
- $("#nameOrpwdError").addClass('alert-danger');
- $("#com_zte_ums_ict_portal_login_userPassword").html(errors[ErrResult_LOGIN_FAILURE]);
- var tip = $("#nameOrpwdError");
- if (tip.attr("tipstatus") == "normal") {
- tip.show();
- } else if (tip.attr("tipstatus") == "close") {
- tip.attr("tipstatus", "normal");
- }
- // if(0 < $("#inputPassword").length){
- // $("#inputPassword")[0].value = "";
- // }
- }
- else if(errors.code==ErrResult_LOGIN_SERV_ERROR){
- $("#loginConnError").addClass('alert-danger');
- var tip = $("#loginConnError");
- if (tip.attr("tipstatus") == "normal") {
- tip.show();
- } else if (tip.attr("tipstatus") == "close") {
- tip.attr("tipstatus", "normal");
- }
- }
- }
-}
-function login(params){
- $.post("login",{
- username : params.username,
- password : params.password,
- isEncypted:true
- },function(data){
- processLoginResult(data,params);
- },"json");
-}
diff --git a/portal-common/src/main/webapp/common/js/tools.js b/portal-common/src/main/webapp/common/js/tools.js
deleted file mode 100644
index 6ecc9603..00000000
--- a/portal-common/src/main/webapp/common/js/tools.js
+++ /dev/null
@@ -1,1021 +0,0 @@
-/*
- * Copyright 2016-2017, CMCC Technologies Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-;(function(window, define) {
- var _ = {
- version: "2.3.0",
- areas: {},
- apis: {},
-
- // utilities
- inherit: function(api, o) {
- for (var p in api) {
- if (!o.hasOwnProperty(p)) {
- o[p] = api[p];
- }
- }
- return o;
- },
- stringify: function(d) {
- return d === undefined || typeof d === "function" ? d+'' : JSON.stringify(d);
- },
- parse: function(s) {
- // if it doesn't parse, return as is
- try{ return JSON.parse(s); }catch(e){ return s; }
- },
-
- // extension hooks
- fn: function(name, fn) {
- _.storeAPI[name] = fn;
- for (var api in _.apis) {
- _.apis[api][name] = fn;
- }
- },
- get: function(area, key){ return area.getItem(key); },
- set: function(area, key, string){ area.setItem(key, string); },
- remove: function(area, key){ area.removeItem(key); },
- key: function(area, i){ return area.key(i); },
- length: function(area){ return area.length; },
- clear: function(area){ area.clear(); },
-
- // core functions
- Store: function(id, area, namespace) {
- var store = _.inherit(_.storeAPI, function(key, data, overwrite) {
- if (arguments.length === 0){ return store.getAll(); }
- if (data !== undefined){ return store.set(key, data, overwrite); }
- if (typeof key === "string"){ return store.get(key); }
- if (!key){ return store.clear(); }
- return store.setAll(key, data);// overwrite=data, data=key
- });
- store._id = id;
- try {
- var testKey = '_safariPrivate_';
- area.setItem(testKey, 'sucks');
- store._area = area;
- area.removeItem(testKey);
- } catch (e) {}
- if (!store._area) {
- store._area = _.inherit(_.storageAPI, { items: {}, name: 'fake' });
- }
- store._ns = namespace || '';
- if (!_.areas[id]) {
- _.areas[id] = store._area;
- }
- if (!_.apis[store._ns+store._id]) {
- _.apis[store._ns+store._id] = store;
- }
- return store;
- },
- storeAPI: {
- // admin functions
- area: function(id, area) {
- var store = this[id];
- if (!store || !store.area) {
- store = _.Store(id, area, this._ns);//new area-specific api in this namespace
- if (!this[id]){ this[id] = store; }
- }
- return store;
- },
- namespace: function(namespace, noSession) {
- if (!namespace){
- return this._ns ? this._ns.substring(0,this._ns.length-1) : '';
- }
- var ns = namespace, store = this[ns];
- if (!store || !store.namespace) {
- store = _.Store(this._id, this._area, this._ns+ns+'.');//new namespaced api
- if (!this[ns]){ this[ns] = store; }
- if (!noSession){ store.area('session', _.areas.session); }
- }
- return store;
- },
- isFake: function(){ return this._area.name === 'fake'; },
- toString: function() {
- return 'store'+(this._ns?'.'+this.namespace():'')+'['+this._id+']';
- },
-
- // storage functions
- has: function(key) {
- if (this._area.has) {
- return this._area.has(this._in(key));//extension hook
- }
- return !!(this._in(key) in this._area);
- },
- size: function(){ return this.keys().length; },
- each: function(fn, and) {
- for (var i=0, m=_.length(this._area); i<m; i++) {
- var key = this._out(_.key(this._area, i));
- if (key !== undefined) {
- if (fn.call(this, key, and || this.get(key)) === false) {
- break;
- }
- }
- if (m > _.length(this._area)) { m--; i--; }// in case of removeItem
- }
- return and || this;
- },
- keys: function() {
- return this.each(function(k, list){ list.push(k); }, []);
- },
- get: function(key, alt) {
- var s = _.get(this._area, this._in(key));
- return s !== null ? _.parse(s) : alt || s;// support alt for easy default mgmt
- },
- getAll: function() {
- return this.each(function(k, all){ all[k] = this.get(k); }, {});
- },
- set: function(key, data, overwrite) {
- var d = this.get(key);
- if (d != null && overwrite === false) {
- return data;
- }
- return _.set(this._area, this._in(key), _.stringify(data), overwrite) || d;
- },
- setAll: function(data, overwrite) {
- var changed, val;
- for (var key in data) {
- val = data[key];
- if (this.set(key, val, overwrite) !== val) {
- changed = true;
- }
- }
- return changed;
- },
- remove: function(key) {
- var d = this.get(key);
- _.remove(this._area, this._in(key));
- return d;
- },
- clear: function() {
- if (!this._ns) {
- _.clear(this._area);
- } else {
- this.each(function(k){ _.remove(this._area, this._in(k)); }, 1);
- }
- return this;
- },
- clearAll: function() {
- var area = this._area;
- for (var id in _.areas) {
- if (_.areas.hasOwnProperty(id)) {
- this._area = _.areas[id];
- this.clear();
- }
- }
- this._area = area;
- return this;
- },
-
- // internal use functions
- _in: function(k) {
- if (typeof k !== "string"){ k = _.stringify(k); }
- return this._ns ? this._ns + k : k;
- },
- _out: function(k) {
- return this._ns ?
- k && k.indexOf(this._ns) === 0 ?
- k.substring(this._ns.length) :
- undefined : // so each() knows to skip it
- k;
- }
- },// end _.storeAPI
- storageAPI: {
- length: 0,
- has: function(k){ return this.items.hasOwnProperty(k); },
- key: function(i) {
- var c = 0;
- for (var k in this.items){
- if (this.has(k) && i === c++) {
- return k;
- }
- }
- },
- setItem: function(k, v) {
- if (!this.has(k)) {
- this.length++;
- }
- this.items[k] = v;
- },
- removeItem: function(k) {
- if (this.has(k)) {
- delete this.items[k];
- this.length--;
- }
- },
- getItem: function(k){ return this.has(k) ? this.items[k] : null; },
- clear: function(){ for (var k in this.list){ this.removeItem(k); } },
- toString: function(){ return this.length+' items in '+this.name+'Storage'; }
- }// end _.storageAPI
- };
-
- // setup the primary store fn
- if (window.store){ _.conflict = window.store; }
- var store =
- // safely set this up (throws error in IE10/32bit mode for local files)
- _.Store("local", (function(){try{ return localStorage; }catch(e){}})());
- store.local = store;// for completeness
- store._ = _;// for extenders and debuggers...
- // safely setup store.session (throws exception in FF for file:/// urls)
- store.area("session", (function(){try{ return sessionStorage; }catch(e){}})());
-
- //Expose store to the global object
- window.store = store;
-
- if (typeof define === 'function' && define.amd !== undefined) {
- define(function () {
- return store;
- });
- } else if (typeof module !== 'undefined' && module.exports) {
- module.exports = store;
- }
-
-})(this, null);
-
-// XHook - v1.3.3 - https://github.com/jpillora/xhook
-// Jaime Pillora <dev@jpillora.com> - MIT Copyright 2015
-(function(window,undefined) {
-var AFTER, BEFORE, COMMON_EVENTS, EventEmitter, FIRE, FormData, NativeFormData, NativeXMLHttp, OFF, ON, READY_STATE, UPLOAD_EVENTS, XHookFormData, XHookHttpRequest, XMLHTTP, convertHeaders, depricatedProp, document, fakeEvent, mergeObjects, msie, proxyEvents, slice, xhook, _base,
- __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
-
-document = window.document;
-
-BEFORE = 'before';
-
-AFTER = 'after';
-
-READY_STATE = 'readyState';
-
-ON = 'addEventListener';
-
-OFF = 'removeEventListener';
-
-FIRE = 'dispatchEvent';
-
-XMLHTTP = 'XMLHttpRequest';
-
-FormData = 'FormData';
-
-UPLOAD_EVENTS = ['load', 'loadend', 'loadstart'];
-
-COMMON_EVENTS = ['progress', 'abort', 'error', 'timeout'];
-
-msie = parseInt((/msie (\d+)/.exec(navigator.userAgent.toLowerCase()) || [])[1]);
-
-if (isNaN(msie)) {
- msie = parseInt((/trident\/.*; rv:(\d+)/.exec(navigator.userAgent.toLowerCase()) || [])[1]);
-}
-
-(_base = Array.prototype).indexOf || (_base.indexOf = function(item) {
- var i, x, _i, _len;
- for (i = _i = 0, _len = this.length; _i < _len; i = ++_i) {
- x = this[i];
- if (x === item) {
- return i;
- }
- }
- return -1;
-});
-
-slice = function(o, n) {
- return Array.prototype.slice.call(o, n);
-};
-
-depricatedProp = function(p) {
- return p === "returnValue" || p === "totalSize" || p === "position";
-};
-
-mergeObjects = function(src, dst) {
- var k, v;
- for (k in src) {
- v = src[k];
- if (depricatedProp(k)) {
- continue;
- }
- try {
- dst[k] = src[k];
- } catch (_error) {}
- }
- return dst;
-};
-
-proxyEvents = function(events, src, dst) {
- var event, p, _i, _len;
- p = function(event) {
- return function(e) {
- var clone, k, val;
- clone = {};
- for (k in e) {
- if (depricatedProp(k)) {
- continue;
- }
- val = e[k];
- clone[k] = val === src ? dst : val;
- }
- return dst[FIRE](event, clone);
- };
- };
- for (_i = 0, _len = events.length; _i < _len; _i++) {
- event = events[_i];
- if (dst._has(event)) {
- src["on" + event] = p(event);
- }
- }
-};
-
-fakeEvent = function(type) {
- var msieEventObject;
- if (document.createEventObject != null) {
- msieEventObject = document.createEventObject();
- msieEventObject.type = type;
- return msieEventObject;
- } else {
- try {
- return new Event(type);
- } catch (_error) {
- return {
- type: type
- };
- }
- }
-};
-
-EventEmitter = function(nodeStyle) {
- var emitter, events, listeners;
- events = {};
- listeners = function(event) {
- return events[event] || [];
- };
- emitter = {};
- emitter[ON] = function(event, callback, i) {
- events[event] = listeners(event);
- if (events[event].indexOf(callback) >= 0) {
- return;
- }
- i = i === undefined ? events[event].length : i;
- events[event].splice(i, 0, callback);
- };
- emitter[OFF] = function(event, callback) {
- var i;
- if (event === undefined) {
- events = {};
- return;
- }
- if (callback === undefined) {
- events[event] = [];
- }
- i = listeners(event).indexOf(callback);
- if (i === -1) {
- return;
- }
- listeners(event).splice(i, 1);
- };
- emitter[FIRE] = function() {
- var args, event, i, legacylistener, listener, _i, _len, _ref;
- args = slice(arguments);
- event = args.shift();
- if (!nodeStyle) {
- args[0] = mergeObjects(args[0], fakeEvent(event));
- }
- legacylistener = emitter["on" + event];
- if (legacylistener) {
- legacylistener.apply(undefined, args);
- }
- _ref = listeners(event).concat(listeners("*"));
- for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
- listener = _ref[i];
- listener.apply(undefined, args);
- }
- };
- emitter._has = function(event) {
- return !!(events[event] || emitter["on" + event]);
- };
- if (nodeStyle) {
- emitter.listeners = function(event) {
- return slice(listeners(event));
- };
- emitter.on = emitter[ON];
- emitter.off = emitter[OFF];
- emitter.fire = emitter[FIRE];
- emitter.once = function(e, fn) {
- var fire;
- fire = function() {
- emitter.off(e, fire);
- return fn.apply(null, arguments);
- };
- return emitter.on(e, fire);
- };
- emitter.destroy = function() {
- return events = {};
- };
- }
- return emitter;
-};
-
-xhook = EventEmitter(true);
-
-xhook.EventEmitter = EventEmitter;
-
-xhook[BEFORE] = function(handler, i) {
- if (handler.length < 1 || handler.length > 2) {
- throw "invalid hook";
- }
- return xhook[ON](BEFORE, handler, i);
-};
-
-xhook[AFTER] = function(handler, i) {
- if (handler.length < 2 || handler.length > 3) {
- throw "invalid hook";
- }
- return xhook[ON](AFTER, handler, i);
-};
-
-xhook.enable = function() {
- window[XMLHTTP] = XHookHttpRequest;
- if (NativeFormData) {
- window[FormData] = XHookFormData;
- }
-};
-
-xhook.disable = function() {
- window[XMLHTTP] = xhook[XMLHTTP];
- window[FormData] = NativeFormData;
-};
-
-convertHeaders = xhook.headers = function(h, dest) {
- var header, headers, k, name, v, value, _i, _len, _ref;
- if (dest == null) {
- dest = {};
- }
- switch (typeof h) {
- case "object":
- headers = [];
- for (k in h) {
- v = h[k];
- name = k.toLowerCase();
- headers.push("" + name + ":\t" + v);
- }
- return headers.join('\n');
- case "string":
- headers = h.split('\n');
- for (_i = 0, _len = headers.length; _i < _len; _i++) {
- header = headers[_i];
- if (/([^:]+):\s*(.+)/.test(header)) {
- name = (_ref = RegExp.$1) != null ? _ref.toLowerCase() : void 0;
- value = RegExp.$2;
- if (dest[name] == null) {
- dest[name] = value;
- }
- }
- }
- return dest;
- }
-};
-
-NativeFormData = window[FormData];
-
-XHookFormData = function(form) {
- var entries;
- this.fd = form ? new NativeFormData(form) : new NativeFormData();
- this.form = form;
- entries = [];
- Object.defineProperty(this, 'entries', {
- get: function() {
- var fentries;
- fentries = !form ? [] : slice(form.querySelectorAll("input,select")).filter(function(e) {
- var _ref;
- return ((_ref = e.type) !== 'checkbox' && _ref !== 'radio') || e.checked;
- }).map(function(e) {
- return [e.name, e.type === "file" ? e.files : e.value];
- });
- return fentries.concat(entries);
- }
- });
- this.append = (function(_this) {
- return function() {
- var args;
- args = slice(arguments);
- entries.push(args);
- return _this.fd.append.apply(_this.fd, args);
- };
- })(this);
-};
-
-if (NativeFormData) {
- xhook[FormData] = NativeFormData;
- window[FormData] = XHookFormData;
-}
-
-NativeXMLHttp = window[XMLHTTP];
-
-xhook[XMLHTTP] = NativeXMLHttp;
-
-XHookHttpRequest = window[XMLHTTP] = function() {
- var ABORTED, currentState, emitFinal, emitReadyState, facade, hasError, hasErrorHandler, readBody, readHead, request, response, setReadyState, status, transiting, writeBody, writeHead, xhr;
- ABORTED = -1;
- xhr = new xhook[XMLHTTP]();
- request = {};
- status = null;
- hasError = void 0;
- transiting = void 0;
- response = void 0;
- readHead = function() {
- var key, name, val, _ref;
- response.status = status || xhr.status;
- if (!(status === ABORTED && msie < 10)) {
- response.statusText = xhr.statusText;
- }
- if (status !== ABORTED) {
- _ref = convertHeaders(xhr.getAllResponseHeaders());
- for (key in _ref) {
- val = _ref[key];
- if (!response.headers[key]) {
- name = key.toLowerCase();
- response.headers[name] = val;
- }
- }
- }
- };
- readBody = function() {
- if (!xhr.responseType || xhr.responseType === "text") {
- response.text = xhr.responseText;
- response.data = xhr.responseText;
- } else if (xhr.responseType === "document") {
- response.xml = xhr.responseXML;
- response.data = xhr.responseXML;
- } else {
- response.data = xhr.response;
- }
- if ("responseURL" in xhr) {
- response.finalUrl = xhr.responseURL;
- }
- };
- writeHead = function() {
- facade.status = response.status;
- facade.statusText = response.statusText;
- };
- writeBody = function() {
- if ('text' in response) {
- facade.responseText = response.text;
- }
- if ('xml' in response) {
- facade.responseXML = response.xml;
- }
- if ('data' in response) {
- facade.response = response.data;
- }
- if ('finalUrl' in response) {
- facade.responseURL = response.finalUrl;
- }
- };
- emitReadyState = function(n) {
- while (n > currentState && currentState < 4) {
- facade[READY_STATE] = ++currentState;
- if (currentState === 1) {
- facade[FIRE]("loadstart", {});
- }
- if (currentState === 2) {
- writeHead();
- }
- if (currentState === 4) {
- writeHead();
- writeBody();
- }
- facade[FIRE]("readystatechange", {});
- if (currentState === 4) {
- setTimeout(emitFinal, 0);
- }
- }
- };
- emitFinal = function() {
- if (!hasError) {
- facade[FIRE]("load", {});
- }
- facade[FIRE]("loadend", {});
- if (hasError) {
- facade[READY_STATE] = 0;
- }
- };
- currentState = 0;
- setReadyState = function(n) {
- var hooks, process;
- if (n !== 4) {
- emitReadyState(n);
- return;
- }
- hooks = xhook.listeners(AFTER);
- process = function() {
- var hook;
- if (!hooks.length) {
- return emitReadyState(4);
- }
- hook = hooks.shift();
- if (hook.length === 2) {
- hook(request, response);
- return process();
- } else if (hook.length === 3 && request.async) {
- return hook(request, response, process);
- } else {
- return process();
- }
- };
- process();
- };
- facade = request.xhr = EventEmitter();
- xhr.onreadystatechange = function(event) {
- try {
- if (xhr[READY_STATE] === 2) {
- readHead();
- }
- } catch (_error) {}
- if (xhr[READY_STATE] === 4) {
- transiting = false;
- readHead();
- readBody();
- }
- setReadyState(xhr[READY_STATE]);
- };
- hasErrorHandler = function() {
- hasError = true;
- };
- facade[ON]('error', hasErrorHandler);
- facade[ON]('timeout', hasErrorHandler);
- facade[ON]('abort', hasErrorHandler);
- facade[ON]('progress', function() {
- if (currentState < 3) {
- setReadyState(3);
- } else {
- facade[FIRE]("readystatechange", {});
- }
- });
- if ('withCredentials' in xhr || xhook.addWithCredentials) {
- facade.withCredentials = false;
- }
- facade.status = 0;
- facade.open = function(method, url, async, user, pass) {
- currentState = 0;
- hasError = false;
- transiting = false;
- request.headers = {};
- request.headerNames = {};
- request.status = 0;
- response = {};
- response.headers = {};
- request.method = method;
- request.url = url;
- request.async = async !== false;
- request.user = user;
- request.pass = pass;
- setReadyState(1);
- };
- facade.send = function(body) {
- var hooks, k, modk, process, send, _i, _len, _ref;
- _ref = ['type', 'timeout', 'withCredentials'];
- if(navigator.userAgent.indexOf("Firefox/") != -1){http://atmosphere-framework.2306103.n4.nabble.com/Atmosphere-js-withCredentials-true-does-not-work-in-Firefox-td4656661.html
- _ref = ['type', 'timeout'];
- }
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- k = _ref[_i];
- modk = k === "type" ? "responseType" : k;
- if (modk in facade) {
- request[k] = facade[modk];
- }
- }
- request.body = body;
- send = function() {
- var header, value, _j, _len1, _ref1, _ref2;
- proxyEvents(COMMON_EVENTS, xhr, facade);
- if (facade.upload) {
- proxyEvents(COMMON_EVENTS.concat(UPLOAD_EVENTS), xhr.upload, facade.upload);
- }
- transiting = true;
- xhr.open(request.method, request.url, request.async, request.user, request.pass);
- _ref1 = ['type', 'timeout', 'withCredentials'];
- if(navigator.userAgent.indexOf("Firefox/") != -1){//http://atmosphere-framework.2306103.n4.nabble.com/Atmosphere-js-withCredentials-true-does-not-work-in-Firefox-td4656661.html
- _ref1 = ['type', 'timeout'];
- }
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- k = _ref1[_j];
- modk = k === "type" ? "responseType" : k;
- if (k in request) {
- xhr[modk] = request[k];
- }
- }
- _ref2 = request.headers;
- for (header in _ref2) {
- value = _ref2[header];
- xhr.setRequestHeader(header, value);
- }
- if (request.body instanceof XHookFormData) {
- request.body = request.body.fd;
- }
- xhr.send(request.body);
- };
- hooks = xhook.listeners(BEFORE);
- process = function() {
- var done, hook;
- if (!hooks.length) {
- return send();
- }
- done = function(userResponse) {
- if (typeof userResponse === 'object' && (typeof userResponse.status === 'number' || typeof response.status === 'number')) {
- mergeObjects(userResponse, response);
- if (__indexOf.call(userResponse, 'data') < 0) {
- userResponse.data = userResponse.response || userResponse.text;
- }
- setReadyState(4);
- return;
- }
- process();
- };
- done.head = function(userResponse) {
- mergeObjects(userResponse, response);
- return setReadyState(2);
- };
- done.progress = function(userResponse) {
- mergeObjects(userResponse, response);
- return setReadyState(3);
- };
- hook = hooks.shift();
- if (hook.length === 1) {
- return done(hook(request));
- } else if (hook.length === 2 && request.async) {
- return hook(request, done);
- } else {
- return done();
- }
- };
- process();
- };
- facade.abort = function() {
- status = ABORTED;
- if (transiting) {
- xhr.abort();
- } else {
- facade[FIRE]('abort', {});
- }
- };
- facade.setRequestHeader = function(header, value) {
- var lName, name;
- lName = header != null ? header.toLowerCase() : void 0;
- name = request.headerNames[lName] = request.headerNames[lName] || header;
- if (request.headers[name]) {
- value = request.headers[name] + ', ' + value;
- }
- request.headers[name] = value;
- };
- facade.getResponseHeader = function(header) {
- var name;
- name = header != null ? header.toLowerCase() : void 0;
- return response.headers[name];
- };
- facade.getAllResponseHeaders = function() {
- return convertHeaders(response.headers);
- };
- if (xhr.overrideMimeType) {
- facade.overrideMimeType = function() {
- return xhr.overrideMimeType.apply(xhr, arguments);
- };
- }
- if (xhr.upload) {
- facade.upload = request.upload = EventEmitter();
- }
- return facade;
-};
-/*
-if (typeof this.define === "function" && this.define.amd) {
- define("xhook", [], function() {
- return xhook;
- });
-} else {*/
- (this.exports || this).xhook = xhook;
-//}
-
-}.call(this,window));
-
-xhook.before(function(request) {
- var zte_headers = store('zte_http_headers');
- if (zte_headers && zte_headers.length > 0) {
- for (i = 0; i < zte_headers.length; i++) {
- if (zte_headers[i].store === true) {
- if ( !! store(zte_headers[i].value)) {
- request.headers[zte_headers[i].key] = store(zte_headers[i].value).toUpperCase()
- }
- } else {
- request.headers[zte_headers[i].key] = zte_headers[i].value
- }
- }
- }
-});
-/**
- * 初始化脚本文件装载工具
- * zongying 2010.12
- * modify:
- */
-$Boot = {};
-
-/**
- * 创建命名空间
- * @param {Object} name
- * @param {Object} object
- */
-$Boot.createNamespace = function(name, object) {
- var splits = name.split(".");
- var parent = window;
- //document.window浏览器内置对象
- var part = splits[0];
- for (var i = 0, len = splits.length - 1; i < len; i++, part = splits[i]) {
- if (!parent[part]) {
- parent = parent[part] = {};
- } else {
- parent = parent[part];
- }
- }
- // 存放对象
- parent[part] = object;
- // 返回 last part name (例如:classname)
- return part;
-}
-
-$Boot.isDefined = function(o) {
- return typeof (o) != "undefined"
-}
-/**
- * 启动配置类
- */
-$Boot.Config = function() {
-
- function isDefined(o) {
- return typeof (o) != "undefined"
- }
-
- //用户应用当前目录
- if (!isDefined(window.$userAppDir)) {
- window.$userAppDir = './'
- }
- //组件库目录
- if (!isDefined(window.$userFrameDir)) {
- window.$userFrameDir = '/common/'
- }
- //用户i18文件目录
- if (!isDefined(window.$userI18nDir)) {
- window.$userI18nDir = './'
- }
-
- //当前语言 默认为英语
- var language = "en-US";
- //var languageList = ['ar', 'ba', 'cr', 'cs', 'de', 'el', 'es', 'fi', 'fr', 'fr-FR', 'hu-HU', 'id', 'it', 'ja', 'nb-NO', 'nl', 'pl', 'pl-PL', 'pt', 'pt-BR', 'ro-RO', 'ru-RU', 'sk', 'sr', 'sr-Latn', 'sv-SE', 'en-US','uk-UA', 'zh-CN', 'zh-TW'];
- var languageList = ['en-US', 'zh-CN'];
-
- //从服务端取客户端接受语言类型
- var getAcceptLangFromServer = true;
-
-
- /**
- * 创建XMLHttpRequest对象
- */
- function createXMLHttpRequest() {
- if (window.ActiveXObject) {
- return new ActiveXObject("Microsoft.XMLHTTP");
- } else if (window.XMLHttpRequest) {
- return new XMLHttpRequest();
- } else {
- throw new Error("This Brower do not support XMLHTTP!!");
- }
- }
-
-
- /**
- * 同步发送xml http 请求
- * @param {Object} url
- * @param {Object} data
- * @param {Object} method
- */
- function httpRequest(method, url, data) {
- var xmlhttp;
- xmlhttp = createXMLHttpRequest();
- var sendData = null;
- if (method == "get") {
- url = url + "?" + data;
-
- } else if (method == "post") {
- sendData = data;
- }
- xmlhttp.open(method, url, false);
- xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
- xmlhttp.setRequestHeader("If-Modified-Since", "0");
- xmlhttp.send(sendData);
- if (xmlhttp.status == 200)
- return xmlhttp.responseText;
- }
-
- /**
- * 同步发送xml http 请求(给外部调用)
- * @param {Object} url
- * @param {Object} data
- * @param {Object} method
- */
- this.httpRequestStatic = function(method, url, data) {
- var xmlhttp;
- xmlhttp = createXMLHttpRequest();
- var sendData = null;
- if (method == "get") {
- url = url + "?" + data;
-
- } else if (method == "post") {
- sendData = data;
- }
- xmlhttp.open(method, url, false);
- xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
- xmlhttp.setRequestHeader("If-Modified-Since", "0");
- xmlhttp.send(sendData);
- if (xmlhttp.status == 200)
- return xmlhttp.responseText;
- }
-
- function inArray(array, obj) {
- for (var i = 0; i < array.length; i++) {
- if (array[i] == obj) {
- return true;
- }
- }
- return false;
-
- }
-
-
- this.getUrlParam=function(name){
- var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
- var search =decodeURIComponent(location.search.substring(1)); //decodeURIComponent() 函数可对 encodeURIComponent() 函数编码的 URI 进行解码。
- var r =search.match(reg); //匹配目标参数
- if (r != null) return unescape(r[2]); //unescape() 函数可对通过 escape() 编码的字符串进行解码。
- return null; //返回参数值
- }
-
-
-}
-
-//创建命名空间
-$Boot.createNamespace("com.zte.ums.aos.framework.BootConfig", $Boot.Config);
-//创建基础配置对象实例
-$Boot.bootConfig = new com.zte.ums.aos.framework.BootConfig();
-
-function getLanguage(){
- return "en-US";
-}
-
-function getStringWidth(text,fontSize)
-{
- var span = document.getElementById("_ictframework_getwidth");
- if (span == null) {
- span = document.createElement("span");
- span.id = "_ictframework_getwidth";
- document.body.appendChild(span);
- }
- span.innerText = text;
- span.style.whiteSpace = "nowrap";
- $("#_ictframework_getwidth").attr('style','font-size:'+fontSize+'px;');
- var width = span.offsetWidth;
- $("#_ictframework_getwidth").attr('style','display:none');
- return width;
-}
-
-function getUrlParam(name){
- return $Boot.bootConfig.getUrlParam(name);
-}
-
-function httpRequest(method, url, data) {
- return $Boot.bootConfig.httpRequestStatic(method, url, data)
-}
-
-// 定义JQUERY AJAX 完成函数,判断返回状态,如果状态正常,但HEADER头里有session超时信息,则刷新重登录
-// 如果状态为 401, 也刷新重登录
-// 注意如果在$.ajax() 函数中定义了 complete,则覆盖了这里预定义complete内容,以$.ajax()函数中定义的为准,这里预定义的函数则失效,如果
-// 要继续判断session超时,则需要在 $.ajax()函数中定义的complete函数中加入这里预定义内容。
-if (jQuery) {
- $.ajaxSetup({
- complete:function(XMLHttpRequest,textStatus){
- if (XMLHttpRequest.status == 401) {
- window.location.replace("login.html");
- }
- // if (XMLHttpRequest.status == 200) {
- // var sessionstatus=XMLHttpRequest.getResponseHeader("sessionstatus"); ////通过XMLHttpRequest取得响应头,sessionstatus,
- // if(sessionstatus=="timeout"){
- // window.location.replace("/");
- // }
- // } else if (XMLHttpRequest.status == 401) {
- // window.location.replace("/");
- // }
- }
- });
-}