aboutsummaryrefslogtreecommitdiffstats
path: root/openo-portal/portal-common/src/main/webapp/common/js
diff options
context:
space:
mode:
authorseshukm <seshu.kumar.m@huawei.com>2017-01-20 17:43:08 +0530
committerseshukm <seshu.kumar.m@huawei.com>2017-01-20 17:43:08 +0530
commitf0b211f269df2b0bb10d5552d14aeb8991a750ed (patch)
tree1bd6ccf7503f8dad0785e03ce52937a55ae9555b /openo-portal/portal-common/src/main/webapp/common/js
parent68036a69f0dd0dad6b6a715d9850997d21f82940 (diff)
GUI Code refactor
GUI Code refactor for the sun release code. Issue-Id : CLIENT-11 Change-Id: I771cc25ff3c8ff7a4e939ce7baef7dd94a67974b Signed-off-by: seshukm <seshu.kumar.m@huawei.com>
Diffstat (limited to 'openo-portal/portal-common/src/main/webapp/common/js')
-rw-r--r--openo-portal/portal-common/src/main/webapp/common/js/Main2moreMenu.js34
-rw-r--r--openo-portal/portal-common/src/main/webapp/common/js/core/const.js90
-rw-r--r--openo-portal/portal-common/src/main/webapp/common/js/core/hk.min.js1636
-rw-r--r--openo-portal/portal-common/src/main/webapp/common/js/core/load_menuList.js138
-rw-r--r--openo-portal/portal-common/src/main/webapp/common/js/core/openoFrameWork.js7402
-rw-r--r--openo-portal/portal-common/src/main/webapp/common/js/core/pym.min.js32
-rw-r--r--openo-portal/portal-common/src/main/webapp/common/js/fm_light.js338
-rw-r--r--openo-portal/portal-common/src/main/webapp/common/js/international/loadi18n.js104
-rw-r--r--openo-portal/portal-common/src/main/webapp/common/js/json2.js682
-rw-r--r--openo-portal/portal-common/src/main/webapp/common/js/login.js316
-rw-r--r--openo-portal/portal-common/src/main/webapp/common/js/mainpage/about.js284
-rw-r--r--openo-portal/portal-common/src/main/webapp/common/js/mainpage/load_mainPage.js188
-rw-r--r--openo-portal/portal-common/src/main/webapp/common/js/moreOperation.js332
-rw-r--r--openo-portal/portal-common/src/main/webapp/common/js/openotopo/openotopo.js628
-rw-r--r--openo-portal/portal-common/src/main/webapp/common/js/openotopo/openotopo.min.js62
-rw-r--r--openo-portal/portal-common/src/main/webapp/common/js/security/aes.js88
-rw-r--r--openo-portal/portal-common/src/main/webapp/common/js/security/framework-util.js74
-rw-r--r--openo-portal/portal-common/src/main/webapp/common/js/security/security.js254
-rw-r--r--openo-portal/portal-common/src/main/webapp/common/js/tools.js2042
19 files changed, 7362 insertions, 7362 deletions
diff --git a/openo-portal/portal-common/src/main/webapp/common/js/Main2moreMenu.js b/openo-portal/portal-common/src/main/webapp/common/js/Main2moreMenu.js
index 3fadb215..1e84fbf0 100644
--- a/openo-portal/portal-common/src/main/webapp/common/js/Main2moreMenu.js
+++ b/openo-portal/portal-common/src/main/webapp/common/js/Main2moreMenu.js
@@ -1,17 +1,17 @@
-/*
- * Copyright 2016, 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();
+/*
+ * Copyright 2016, 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/openo-portal/portal-common/src/main/webapp/common/js/core/const.js b/openo-portal/portal-common/src/main/webapp/common/js/core/const.js
index 66bee91a..60307c97 100644
--- a/openo-portal/portal-common/src/main/webapp/common/js/core/const.js
+++ b/openo-portal/portal-common/src/main/webapp/common/js/core/const.js
@@ -1,46 +1,46 @@
-/*
- * Copyright 2016, 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});
+/*
+ * Copyright 2016, 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/openo-portal/portal-common/src/main/webapp/common/js/core/hk.min.js b/openo-portal/portal-common/src/main/webapp/common/js/core/hk.min.js
index 73ab7f2c..1f817a2c 100644
--- a/openo-portal/portal-common/src/main/webapp/common/js/core/hk.min.js
+++ b/openo-portal/portal-common/src/main/webapp/common/js/core/hk.min.js
@@ -1,819 +1,819 @@
-/*
- * Copyright 2016, 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
- }
- }
- }
+/*
+ * Copyright 2016, 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/openo-portal/portal-common/src/main/webapp/common/js/core/load_menuList.js b/openo-portal/portal-common/src/main/webapp/common/js/core/load_menuList.js
index 972e782b..0ec860d7 100644
--- a/openo-portal/portal-common/src/main/webapp/common/js/core/load_menuList.js
+++ b/openo-portal/portal-common/src/main/webapp/common/js/core/load_menuList.js
@@ -1,70 +1,70 @@
-/*
- * Copyright 2016, 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;
+/*
+ * Copyright 2016, 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/openo-portal/portal-common/src/main/webapp/common/js/core/openoFrameWork.js b/openo-portal/portal-common/src/main/webapp/common/js/core/openoFrameWork.js
index 3b7e4b38..78a7e615 100644
--- a/openo-portal/portal-common/src/main/webapp/common/js/core/openoFrameWork.js
+++ b/openo-portal/portal-common/src/main/webapp/common/js/core/openoFrameWork.js
@@ -1,3701 +1,3701 @@
-锘/*
-涓绘鏋
-*/
-/*string绫诲瀷鐨勫幓鍓嶅悗绌烘牸鍜宖ormat鏂规硶*/
-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 鏀寔鍏ㄥ睆鏄痺ebkit鍐呮牳
- 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锛宖f锛屾爣鍑
- }catch(e){
- elem[p+'RequestFullscreen']() //elem.msRequestFullscreen
- }
- };
- fs.exitFullScreen=function(){
- try{
- p ? d[p+'ExitFullscreen']() : d.exitFullscreen() //ie锛屾柊鐗坈hrome鎴栨爣鍑
- }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'));
- }
-};
-
-/*鏂板鐨刪ashtabel瀹炵幇绫伙紝鐢ㄦ埛鍚庣画iframe鐨勭紦瀛橈紝鍓嶈繘鍚庨鏃舵墦寮杩囩殑椤甸潰鐨勮彍鍗昳d鐨勭紦瀛樼瓑*/
-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"; //鍏ㄥ眬鍙橀噺淇濆瓨鐨勬槸褰撳墠姝e湪鎵撳紑浣跨敤鐨刬frame
- 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'
- };
- // 鑾峰彇鐪熷疄鐨勮澶囩獥鍙eぇ灏忥紝鍙傝冧簡 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 () {
- // 绐椾綋瀹藉害灏忓昂瀵革紙骞虫澘鍜宨phone妯″紡涓嬶級鏃剁Щ鍑哄乏杈规爮
- 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鎸夐挳涔嬪锛屾槸鍚﹁繕鏈夊叾浠栧効瀛愭槸瑕佹樉绀虹殑锛屽鏋滄病鏈夛紝閭d箞绔栬彍鍗曚笉鏄剧ず锛涘弽涔嬶紝鏄剧ず銆
- 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' );
- //姣忎竴涓枃瀛梥pan鐨勫浘鏍囥佷粬鐖朵翰鐨刴argin\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鐨勫瓙椤甸潰鍥哄畾楂樺害涓鸿鍙e彲鐢ㄥ唴瀹瑰尯楂樺害
- {
- $('.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()浼氭敼鍙榮tyle鏍峰紡锛岃繖閲岀紦瀛樹笅鎵ц鍓嶇殑style鏍峰紡锛屾墽琛屽畬鍚庨噸鏂拌祴缁欓〉闈㈠厓绱
- console.log("pym:parent iframe "+miframe+" sidebar.height:"+sidebar.height()+" h:"+h);
- h=sidebar.height()>h?sidebar.height():h;
- //IE涓嬶紝鎶奿frame鐨勯珮搴﹀啀鍑忔帀7锛屽洜涓篒E10鍙婁互涓嬬増鏈紝璁$畻鐨勯珮搴︿細姣擨E瀹為檯鏄剧ず鍖哄煙澶э紝瀵艰嚧鍑虹幇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涓婃祴璇曢珮搴︿笉姝g‘
- 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()浼氭敼鍙榮tyle鏍峰紡锛岃繖閲岀紦瀛樹笅鎵ц鍓嶇殑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()) {//杩欓噷涓轰簡閬垮厤鍐呭鍖哄煙寰堝皬鐨勬椂鍊欏嚭鐜板唴瀹瑰尯鍩熸棤娉曞厖婊″睆骞,鎶妋in-height淇敼涓篽eight
- //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瑕佹眰椤甸潰鍒囨崲鍚庡垹闄ゆ病鏈夐厤缃甤acheNum鐨勭紦瀛橀〉闈
- 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);
- //澧炲姞鐨刬frame鍔犺浇瀹屾瘯鍚 鍋滄鍔犺浇涓彁绀轰俊鎭
- 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');
- }
- });
- // 褰撳墠鏄í鑿滃崟锛屼絾鍦ㄥ睆骞曠缉灏忕殑鎯呭喌涓嬫樉绀虹殑鏄痶ip鍨傜洿鑿滃崟锛岃屾í鑿滃崟鏄殣钘忕殑锛屾墍浠ラ渶棰濆澶勭悊妯彍鍗
- 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))//褰撹繑鍥瀟rue鏃惰鏄庢槸姝e父鍔犺浇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鏃ユ柊澧濾5涓ぇO闇瑕佺殑鎸夌収瀹炰緥锛堟牴鎹夋嫨鐨勭郴缁熷疄渚嬪彉鍖杣rl鐨刬p鍜岀鍙e湴鍧锛夎繘琛屽姩鎬佸垏鎹㈣彍鍗曠殑鍔熻兘
- 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鍜宲ort鍚庡浣欑殑閮ㄥ垎
- 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");//瀵规湁浜涚涓夋柟搴旂敤璁剧疆浜嗛《灞俧rame鍚嶅瓧鐨勶紝杩欎釜蹇呴』璁剧疆
- var _iframeAutoScroll= aObject.attr("iframeAutoScroll");//璁剧疆iframe鐨勬粴鍔ㄦ潯鏄惁鍑虹幇,鍙互璁剧疆涓篴uto,yes鎴栬卬o,榛樿涓簄o 涓嶅嚭鐜.
- _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鍜宨framename鏍囩
- 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宸茬粡娣诲姞浜嗭紝鍒欑洿鎺ユ洿鏀箄rl鎴栬呮墽琛屽垏鎹㈡垨瀵艰埅鍑芥暟
- 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涓殑椤甸潰瀹氫箟鍒皐indow涓婄殑鍑芥暟锛
- //pagemyIframe.attr("scrolling",_iframeAutoScroll);
- cachedIframesObject.items(miframe).settings.xdomain=_xdomain;
- if(nagivJS.length>0&&nagivJS.toLowerCase()!="null")
- _runShiftJS=nagivJS;//濡傛灉鏄痭agivJS瀵艰埅杩囨潵鐨勶紝nagivJS浼樺厛绾ч珮浜巗hiftJS锛屽鏋滄湁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涓嶅悓,鎴栬卽rl鐩稿悓浣嗘病鏈塻hiftjs
- 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鍜宻rc涓嶅悓璇存槑鏇存崲浜嗛〉闈紝闇瑕佹竻绌洪噸鏂板姞杞
- }else //if (src.trim()==url.trim()) //娌℃湁shiftjs骞朵笖url鐩稿悓锛岃鏄庝笉闇瑕佸啀娆″姞杞戒簡,宸茬粡鍔犺浇杩囦簡
- {
- openoFrameWork.stopPageLoading();
- }
- pagemyIframe.attr("src",url);
-
- if(nagivJS.length>0&&nagivJS.toLowerCase()!="null"){//濡傛灉鏄痭agivJS瀵艰埅杩囨潵鐨勶紝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"){//濡傛灉閰嶇疆浜哻ssSrc锛屾瘡娆″垏鎹㈤兘閲嶆柊鎵ц涓杈硅繖涓猚ss鏂囦欢锛岄槻姝㈡湁閬楁紡
- 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"){//濡傛灉鏄痭agivJS瀵艰埅杩囨潵鐨勶紝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");
- //}
- });
- // 澶勭悊鏇村鑿滃崟鐨勮彍鍗曡繛鎺ワ紝鏄剧ず鍦╥frame涓璬ropdown-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);
- });
- // 澶勭悊鍙炕椤垫洿澶氳彍鍗曚腑鐨勮彍鍗曡繛鎺ワ紝鏄剧ず鍦╥frame涓璬ropdown-menu
- $('#pageableDiv').on('click', ' div > a.iframe', function (e) {
- var url = $(this).attr("href");
- if(url.length<2)
- return;
- e.preventDefault();
- dealBreadcrumbBtnMenuItemClick($(this),e);
- });
- // 澶勭悊鍙炕椤垫洿澶氳彍鍗曚腑鐨勮彍鍗曡繛鎺ワ紝鏄剧ず鍦╥frame涓璬ropdown-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鍙傛暟锛屾敞鎰廵鍙兘涓簄ull
- 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鏂板閫昏緫锛屽鏋渄isplayType = pageableDiv,閭d箞灏辩敤婊戝姩鐨凞IV鏉ユ樉绀烘洿澶氳彍鍗曢噷闈㈢殑鍐呭锛屽鏋滄病鏈夐厤缃紝鎴栦负鍏朵粬鍊硷紝灏辨寜鍘熸湁鏂瑰紡鏄剧ず
- 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;
- }
- });
- }
-
- //澶勭悊澶歵ab涔熷満鏅 ----redirect 璇ユ爣绛炬殏鏃朵繚鐣,涓嶅缓璁娇鐢ㄤ簡
- dealMultTabPage=function(clickedObject){
- var url = clickedObject.attr("href");
- if(!url||url.length<2)
- return;
- var redirect=clickedObject.attr("redirect"); //澶勭悊澶歵ab椤甸潰鐨勯渶姹
- 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涓簍rue灏变笉閲嶆柊鐢熸垚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鑿滃崟鐨勭珫鑿滃崟锛岃繕闇瑕佹壘鍒版í鑿滃崟涓婄殑瀵瑰簲鐖朵翰鍔犲叆鍒癱lieckedObj
- 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;
- }
- //濡傛灉鏄疐鑿滃崟鍜屾í鑿滃崟鐨勫瓙绔栬彍鍗曠偣鍑伙紝闇瑕佸仛鐗规畩澶勭悊
- if( clieckedObj.parent('ul').attr('id') == fMenuSiderDivId || clieckedObj.parent('ul').attr('id') == megaSiderDivId){
- var id = clieckedObj.children( 'a' ).attr('hparentid');
- //鍒ゆ柇鏄疐鑿滃崟杩樻槸妯彍鍗
- 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)){//濡傛灉浠呬粎鏄痶ab璺宠浆璁剧疆bread杩涙潵鐨勶紝灏辨鏋朵笉澶勭悊鑿滃崟鐐瑰嚮锛岀洿鎺ラ噸鏂板缓绔媌read鍗冲彲
- 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") { //鏀跺埌涓嶅睘浜庡彇鍊艰寖鍥村唴鐨勫洖澶嶏紝璇存槑鍑虹幇涓嶅彲棰勭煡鎯呭喌锛屽彇娑堝績璺炽傛槸鍘焒ramework.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();
- });
- }
- //娓呯悊褰撳墠姝e湪鏄剧ず鐨刬frame涔嬪缂撳瓨鐨刬frame锛
- 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) {//娓呯悊缂撳瓨鐨刬frame瀹炰綋瀵硅薄銆
- 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(){//娉ㄥ唽鐨偆鍒囨崲浜嬩欢澶勭悊鍑芥暟锛屽鐞唅frame涓殑鐨偆鍒囨崲
- 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;
- }
- //澶勭悊璺ㄥ煙璇锋眰浠g悊锛岄氳繃璇ヤ唬鐞嗚繘琛宨frame闂翠紶閫掑弬鏁帮紝娉ㄦ剰杩欓噷鐨勪唬鐞嗛〉闈roxy.html蹇呴』閮ㄧ讲鍒拌璺ㄥ煙鐨勫绔煙鐨勬湇鍔″櫒web鏍圭洰褰曚笅
- var dealCrossProxy=function(ifrm,crossproxysrc,ifmHeadlins,flag){//crossproxysrc杩欎釜鏄痯roxy.html瀵瑰簲鐨剈rl鏍硅矾寰
- 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){//浠g悊宸茬粡娣诲姞杩囦簡锛岀湅鏄惁鏄悓涓涓綉绔欑殑浠g悊锛屽鏋滀笉鏄渶瑕侀噸鏂板姞杞
- _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); ////娓呯悊褰撳墠姝e湪鏄剧ず鐨刬frame涔嬪缂撳瓨鐨刬frame锛
- 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();
- },
- //鍏紑娓呯悊缂撳瓨鐨勬墍鏈塈frame鐨勬柟娉曪細isALL==true鍒欐竻鐞嗘墍鏈夛紝鍚﹀垯娓呯悊褰撳墠姝e湪鏄剧ず鐨刬frame涔嬪缂撳瓨鐨刬frame锛屻
- clearCachedIframes:function(isAll){
- dealClearCachedIframes(isAll);
- },
-
- setBaseURLRoot:function(ipportStr){//鑿滃崟url鐨勮窡ip鍜岀鍙d緥濡: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鍜岀鍙d緥濡:http://10.74.151.122:21180
- var rooturl="";
- if (store) {
- rooturl=store('baseURLRoot');
- }
- return !rooturl?"":rooturl;
- },
- clearBaseURLRoot:function(){//鑿滃崟url鐨勮窡ip鍜岀鍙d緥濡: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鏃ユ柊澧炲姩鎬佸垏鎹㈣彍鍗曠殑鍔熻兘锛岃繖閲岀殑鑿滃崟杩橀渶瑕佸啀娆℃洿鎹㈣彍鍗曢」璁块棶鐨刬p绔彛淇℃伅
- handlBaseURL:function(url){
- var baseURLRoot=openoFrameWork.getBaseURLRoot();
- if (baseURLRoot.length>0) {//2015骞10鏈26鏃ユ柊澧炲姩鎬佸垏鎹㈣彍鍗曠殑鍔熻兘锛岃繖閲岀殑鑿滃崟杩橀渶瑕佸啀娆℃洿鎹㈣彍鍗曢」璁块棶鐨刬p绔彛淇℃伅
- baseURLRoot=openoFrameWork.getDomainURL(baseURLRoot);//鍘绘帀ip鍜宲ort鍚庡浣欑殑閮ㄥ垎
- 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瀵硅薄
- /* 娉ㄦ剰璇ュ姛鑳藉湪鍏朵粬鑴氭湰涓皟鐢ㄦ椂鍑簊afari鑾峰彇鍒扮殑鑴氭湰璺緞涓烘湰鏂规硶鎵鍦ㄨ剼鏈殑璺緞锛
- 鍏朵粬娴忚鍣ㄨ幏鍙栧埌鐨勪负璋冪敤璇ユ柟娉曠殑鑴氭湰鎵鍦ㄨ矾寰
- 鍙栧緱姝e湪瑙f瀽鐨剆cript鑺傜偣
- */
- 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鐨勯敊璇璞″彧鏈塴ine,sourceId 鎴栬呴珮鐗堟湰杩樻湁sourceURL
- stack = e.stack;
- if(e.sourceURL){//safari 娴忚鍣ㄦ病鏈塭.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;
- }
- }
- }
- },
- /*涓嬮潰鐨刦lag涓0琛ㄧず榛樿涓嶈Е鍙戝瓩瀛恑frame涓殑onload浜嬩欢,涓1琛ㄧず瑕佽Е鍙,flag涓10鍒欏cssSrc閲嶅鎵ц锛屽叾浠栦笉鍋氶噸澶嶆墽琛*/
- SyncCSS:function(ifrm,flag,cssSrc){//灏嗕富妗嗘灦涓殑鐨偆css搴旂敤鍒版墦寮鐨刬frame椤甸潰涓
- 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;//杩欓噷鍚屾鑿滃崟瀹氫箟涓璫ssSrc灞炴ф寚瀹氱殑css鏂囦欢鍒癷frame
- _div = null;
- csslink.rel="stylesheet";
- csslink.type="text/css";
- csslink.id="ifram_csssrc";
- ifmHeadlins.push({"pos":"head","scope":"all","link":csslink});//pos鏄坊鍔犲埌瀛恑frame涓殑浣嶇疆锛宻cope鏄瓙绐椾綋浣滅敤杩斿洖锛宱ne琛ㄧず鐩存帴瀛愮獥浣擄紝all琛ㄧず宓屽鎵鏈夊瓙绐椾綋
- }
- if(flag!=10){//褰揻lag涓10鏃朵笅闈㈢殑css鍜宩s閮戒笉鎵ц
- if($('#style_color').length>0){
- var csslink=document.createElement("link");
- csslink.href=$('#style_color')[0].href.replace(".css","_ifrm.css");//杩欓噷鍚屾鐨勭毊鑲ら〉闈慨鏀逛负鍘熺毊鑲ら〉闈㈡枃浠跺悕鍚庣紑娣诲姞ifrm鐨刢ss鐨偆鏂囦欢
- csslink.rel="stylesheet";
- csslink.type="text/css";
- csslink.id="style_color";
- ifmHeadlins.push({"pos":"head","scope":"all","link":csslink});//pos鏄坊鍔犲埌瀛恑frame涓殑浣嶇疆锛宻cope鏄瓙绐椾綋浣滅敤杩斿洖锛宱ne琛ㄧず鐩存帴瀛愮獥浣擄紝all琛ㄧず宓屽鎵鏈夊瓙绐椾綋
- }
- // 灏 font-awesome瀛椾綋鍥炬爣搴旂敤鍒版ā鍧梚frame
- 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});
- }
- // 灏唒ym.js or pym.min.js搴旂敤鍒版ā鍧梚frame
- 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});
- }
- // 灏唄k.js or hk.min.js搴旂敤鍒版ā鍧梚frame
- 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 鍔犺浇鍚庢嫤鎴猘jax璇锋眰杩涜杞彂
- }
- }
- 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);
- }
- //瀵筰frame涓張鏈夊祵濂椾竴绾frame鐨勫湴鏂硅繘琛屽悓姝ワ紝鍙悓姝cope涓篴ll鐨
- var childifrms=ifrm.contentDocument.getElementsByTagName("iframe");
- if(childifrms&&childifrms.length>0){
- var ifmHeadlins2 = new Array();
- for (i=0;i<ifmHeadlins.length;i++){//绛涢夊嚭scope涓篴ll鐨
- 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];////娉ㄦ剰杩欓噷蹇呴』鍏嬮殕锛屽惁鍒欎細鍑虹幇鍏冪礌绉诲姩锛屽墠闈frm娣诲姞鐨勯兘浼氳绉诲嚭
- 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;//鍏ㄥ眬鍙橀噺锛屽0鏄庢娆′簨浠舵槸鐢辩偣鍑婚潰鍖呭睉鍙戣捣鐨
- 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:''}缂撳瓨鍒癈ategory鏁扮粍涓紝
- //menuCategoryID灞炴ф槸鏇村鑿滃崟涓婇厤缃殑鑿滃崟鐨勫垎绫籭d锛;
- //ipPortStr灞炴ф槸璇d鐨勮彍鍗曡鏇挎崲鐨勬柊鐨刬p鍜岀鍙e湴鍧瀛楃涓诧紝鍖呮嫭鍗忚閮ㄥ垎锛屾瘮濡俬ttp://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){//涓昏彍鍗曚腑娌℃湁鎵惧埌锛屽氨鎵緈ore鑿滃崟锛屾壘鍒癷d瀵瑰簲鐨刴ore鑿滃崟椤规墍灞炵殑涓昏彍鍗曢」
- var mainMenuId = this.getMenuItemId_From_MoreMenuRelation(id);
- if( !!mainMenuId&&mainMenuId.length>0 ){//more鑿滃崟涓壘鍒颁簡id瀵瑰簲鐨勪富鑿滃崟椤筰d锛屾牴鎹甶d杩斿洖涓昏彍鍗曢」
- 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');
- }
- }
- }
- }
- }
- }
- //鍏舵鎵惧埌鐨勮彍鍗曢」涓璶ewIPPort.menuCategoryID瀵瑰簲鐨剆rc瑕嗙洊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){
- //闈㈠寘灞戝拰涓昏彍鍗曢兘娌℃湁鎵惧埌锛屾儏鍐靛彲鑳芥槸锛氭洿澶氳彍鍗曠偣鍑绘墦寮鍚庯紝鍒锋柊锛宧ash宸茬粡鏇存敼锛屼絾鏄搴旂殑鏇村鑿滃崟鐨刪tml娌℃湁鍔犺浇锛岄渶瑕佹壘鍒版洿澶氳彍鍗曞拰涓昏彍鍗曠殑瀵瑰簲鍏崇郴
- var mainMenuId = this.getMenuItemId_From_MoreMenuRelation( id );
- if( mainMenuId ){
- menuitem = this.findMenuItemByMenuId(mainMenuId);
- }
-
- }
- if (store&&store("globleCurrentBreadcrumb")){
- globleCurrentBreadcrumb=store("globleCurrentBreadcrumb");
- //涓嬮潰澶勭悊涓嬪埛鏂版暣涓〉闈㈠悗浠巆ookie涓幏鍙栨潵鐨勬渶鍚庝竴娆℃搷浣滅殑闈㈠寘灞戝搴旂殑瀵瑰簲鑿滃崟鐨刵ame灞炴у洖鍐欙紝渚夸簬闈㈠寘灞戜簨浠跺搷搴旇兘澶熸壘鍒板搴旂殑鑿滃崟
- 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){ //涓存椂涓娆℃х殑娉ㄥ唽涓娆lick浜嬩欢澶勭悊鍑芥暟锛屾墽琛屽畬姣曚細鑷姩鍒犻櫎
- 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銆乵egamenu 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) { //涓存椂涓娆℃х殑娉ㄥ唽涓娆lick浜嬩欢澶勭悊鍑芥暟锛屾墽琛屽畬姣曚細鑷姩鍒犻櫎
- 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() + "=([^&]*)(&|$)"); //鏋勯犱竴涓惈鏈夌洰鏍囧弬鏁扮殑姝e垯琛ㄨ揪寮忓璞
- 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鏍囩浠ュ悗娣诲姞鍒颁富妗嗘灦浠ラ槻姝ppend鏂规硶鍥犱负鍔犺浇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{//鍚﹀垯杩樻槸妯℃嫙鐐瑰嚮閰嶇疆浜唖tart绫荤殑鑿滃崟
- 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();
- // 渚ц竟鏍忔樉绀猴紝鏍规嵁渚ц竟鏍廋SS閫夋嫨
- if (navPosOption === "vertical") {
- //containerStr=$('.page-sidebar').length>0?'.page-sidebar':"";
- startmenu = $('.iframe.start' , sidermenu);
- dealStartMenu( startmenu, sidermenu );
- }
- // 姘村钩鑿滃崟鏄剧ず锛屾牴鎹按骞宠彍鍗旵SS閫夋嫨
- 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();
- //浠庨〉闈OM鍙栧緱鑿滃崟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];
- // 鑿滃崟椤瑰鏋滈厤浜唋icenseid, 骞朵笖涓嶆槸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();
- //浠庨〉闈OM鍙栧緱鑿滃崟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];
- // 鑿滃崟椤瑰鏋滈厤浜唋icenseid, 骞朵笖涓嶆槸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();
- //浠庨〉闈OM鍙栧緱鑿滃崟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];
- // 鑿滃崟椤瑰鏋滈厤浜唋icenseid, 骞朵笖涓嶆槸true瀛楃涓, 鍒欑Щ闄よ彍鍗曢」
- if (lcsitem.value != "True") {
- $('#'+id, $('.more-botton-zone > li.btn-group')).parent().remove();
- }
- }
- }
- // 澧炲姞mysql鍒ゆ柇锛屽鏋滄暟鎹簱涓簃ysql锛屽幓鎺夊熀纭鏁版嵁澶囦唤鍔熻兘鑿滃崟椤
- 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(); // 鍒犵┖鐨勫垎缁勫垪
- }
- });
- //鍒犻櫎澧炲姞鐨勫垎缁刣iv
- $('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");
- //杩欐浠g爜鍏堣繖涔堝啓,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');
- }
-};
-// 娴忚鍣ㄧ缉灏忓悗瀵艰埅鏍忛殣钘忕殑鎯呭喌涓嬬偣鍑籲avbar-toggle鏄剧ず鑿滃崟鐨勫墠缃伐浣滐紝
-// 娴忚鍣ㄧ缉灏忓悗瀵艰埅鏍忛殣钘忕殑鎯呭喌涓嬬偣鍑籲avbar-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");
- }
-};
+锘/*
+涓绘鏋
+*/
+/*string绫诲瀷鐨勫幓鍓嶅悗绌烘牸鍜宖ormat鏂规硶*/
+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 鏀寔鍏ㄥ睆鏄痺ebkit鍐呮牳
+ 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锛宖f锛屾爣鍑
+ }catch(e){
+ elem[p+'RequestFullscreen']() //elem.msRequestFullscreen
+ }
+ };
+ fs.exitFullScreen=function(){
+ try{
+ p ? d[p+'ExitFullscreen']() : d.exitFullscreen() //ie锛屾柊鐗坈hrome鎴栨爣鍑
+ }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'));
+ }
+};
+
+/*鏂板鐨刪ashtabel瀹炵幇绫伙紝鐢ㄦ埛鍚庣画iframe鐨勭紦瀛橈紝鍓嶈繘鍚庨鏃舵墦寮杩囩殑椤甸潰鐨勮彍鍗昳d鐨勭紦瀛樼瓑*/
+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"; //鍏ㄥ眬鍙橀噺淇濆瓨鐨勬槸褰撳墠姝e湪鎵撳紑浣跨敤鐨刬frame
+ 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'
+ };
+ // 鑾峰彇鐪熷疄鐨勮澶囩獥鍙eぇ灏忥紝鍙傝冧簡 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 () {
+ // 绐椾綋瀹藉害灏忓昂瀵革紙骞虫澘鍜宨phone妯″紡涓嬶級鏃剁Щ鍑哄乏杈规爮
+ 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鎸夐挳涔嬪锛屾槸鍚﹁繕鏈夊叾浠栧効瀛愭槸瑕佹樉绀虹殑锛屽鏋滄病鏈夛紝閭d箞绔栬彍鍗曚笉鏄剧ず锛涘弽涔嬶紝鏄剧ず銆
+ 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' );
+ //姣忎竴涓枃瀛梥pan鐨勫浘鏍囥佷粬鐖朵翰鐨刴argin\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鐨勫瓙椤甸潰鍥哄畾楂樺害涓鸿鍙e彲鐢ㄥ唴瀹瑰尯楂樺害
+ {
+ $('.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()浼氭敼鍙榮tyle鏍峰紡锛岃繖閲岀紦瀛樹笅鎵ц鍓嶇殑style鏍峰紡锛屾墽琛屽畬鍚庨噸鏂拌祴缁欓〉闈㈠厓绱
+ console.log("pym:parent iframe "+miframe+" sidebar.height:"+sidebar.height()+" h:"+h);
+ h=sidebar.height()>h?sidebar.height():h;
+ //IE涓嬶紝鎶奿frame鐨勯珮搴﹀啀鍑忔帀7锛屽洜涓篒E10鍙婁互涓嬬増鏈紝璁$畻鐨勯珮搴︿細姣擨E瀹為檯鏄剧ず鍖哄煙澶э紝瀵艰嚧鍑虹幇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涓婃祴璇曢珮搴︿笉姝g‘
+ 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()浼氭敼鍙榮tyle鏍峰紡锛岃繖閲岀紦瀛樹笅鎵ц鍓嶇殑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()) {//杩欓噷涓轰簡閬垮厤鍐呭鍖哄煙寰堝皬鐨勬椂鍊欏嚭鐜板唴瀹瑰尯鍩熸棤娉曞厖婊″睆骞,鎶妋in-height淇敼涓篽eight
+ //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瑕佹眰椤甸潰鍒囨崲鍚庡垹闄ゆ病鏈夐厤缃甤acheNum鐨勭紦瀛橀〉闈
+ 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);
+ //澧炲姞鐨刬frame鍔犺浇瀹屾瘯鍚 鍋滄鍔犺浇涓彁绀轰俊鎭
+ 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');
+ }
+ });
+ // 褰撳墠鏄í鑿滃崟锛屼絾鍦ㄥ睆骞曠缉灏忕殑鎯呭喌涓嬫樉绀虹殑鏄痶ip鍨傜洿鑿滃崟锛岃屾í鑿滃崟鏄殣钘忕殑锛屾墍浠ラ渶棰濆澶勭悊妯彍鍗
+ 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))//褰撹繑鍥瀟rue鏃惰鏄庢槸姝e父鍔犺浇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鏃ユ柊澧濾5涓ぇO闇瑕佺殑鎸夌収瀹炰緥锛堟牴鎹夋嫨鐨勭郴缁熷疄渚嬪彉鍖杣rl鐨刬p鍜岀鍙e湴鍧锛夎繘琛屽姩鎬佸垏鎹㈣彍鍗曠殑鍔熻兘
+ 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鍜宲ort鍚庡浣欑殑閮ㄥ垎
+ 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");//瀵规湁浜涚涓夋柟搴旂敤璁剧疆浜嗛《灞俧rame鍚嶅瓧鐨勶紝杩欎釜蹇呴』璁剧疆
+ var _iframeAutoScroll= aObject.attr("iframeAutoScroll");//璁剧疆iframe鐨勬粴鍔ㄦ潯鏄惁鍑虹幇,鍙互璁剧疆涓篴uto,yes鎴栬卬o,榛樿涓簄o 涓嶅嚭鐜.
+ _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鍜宨framename鏍囩
+ 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宸茬粡娣诲姞浜嗭紝鍒欑洿鎺ユ洿鏀箄rl鎴栬呮墽琛屽垏鎹㈡垨瀵艰埅鍑芥暟
+ 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涓殑椤甸潰瀹氫箟鍒皐indow涓婄殑鍑芥暟锛
+ //pagemyIframe.attr("scrolling",_iframeAutoScroll);
+ cachedIframesObject.items(miframe).settings.xdomain=_xdomain;
+ if(nagivJS.length>0&&nagivJS.toLowerCase()!="null")
+ _runShiftJS=nagivJS;//濡傛灉鏄痭agivJS瀵艰埅杩囨潵鐨勶紝nagivJS浼樺厛绾ч珮浜巗hiftJS锛屽鏋滄湁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涓嶅悓,鎴栬卽rl鐩稿悓浣嗘病鏈塻hiftjs
+ 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鍜宻rc涓嶅悓璇存槑鏇存崲浜嗛〉闈紝闇瑕佹竻绌洪噸鏂板姞杞
+ }else //if (src.trim()==url.trim()) //娌℃湁shiftjs骞朵笖url鐩稿悓锛岃鏄庝笉闇瑕佸啀娆″姞杞戒簡,宸茬粡鍔犺浇杩囦簡
+ {
+ openoFrameWork.stopPageLoading();
+ }
+ pagemyIframe.attr("src",url);
+
+ if(nagivJS.length>0&&nagivJS.toLowerCase()!="null"){//濡傛灉鏄痭agivJS瀵艰埅杩囨潵鐨勶紝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"){//濡傛灉閰嶇疆浜哻ssSrc锛屾瘡娆″垏鎹㈤兘閲嶆柊鎵ц涓杈硅繖涓猚ss鏂囦欢锛岄槻姝㈡湁閬楁紡
+ 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"){//濡傛灉鏄痭agivJS瀵艰埅杩囨潵鐨勶紝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");
+ //}
+ });
+ // 澶勭悊鏇村鑿滃崟鐨勮彍鍗曡繛鎺ワ紝鏄剧ず鍦╥frame涓璬ropdown-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);
+ });
+ // 澶勭悊鍙炕椤垫洿澶氳彍鍗曚腑鐨勮彍鍗曡繛鎺ワ紝鏄剧ず鍦╥frame涓璬ropdown-menu
+ $('#pageableDiv').on('click', ' div > a.iframe', function (e) {
+ var url = $(this).attr("href");
+ if(url.length<2)
+ return;
+ e.preventDefault();
+ dealBreadcrumbBtnMenuItemClick($(this),e);
+ });
+ // 澶勭悊鍙炕椤垫洿澶氳彍鍗曚腑鐨勮彍鍗曡繛鎺ワ紝鏄剧ず鍦╥frame涓璬ropdown-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鍙傛暟锛屾敞鎰廵鍙兘涓簄ull
+ 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鏂板閫昏緫锛屽鏋渄isplayType = pageableDiv,閭d箞灏辩敤婊戝姩鐨凞IV鏉ユ樉绀烘洿澶氳彍鍗曢噷闈㈢殑鍐呭锛屽鏋滄病鏈夐厤缃紝鎴栦负鍏朵粬鍊硷紝灏辨寜鍘熸湁鏂瑰紡鏄剧ず
+ 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;
+ }
+ });
+ }
+
+ //澶勭悊澶歵ab涔熷満鏅 ----redirect 璇ユ爣绛炬殏鏃朵繚鐣,涓嶅缓璁娇鐢ㄤ簡
+ dealMultTabPage=function(clickedObject){
+ var url = clickedObject.attr("href");
+ if(!url||url.length<2)
+ return;
+ var redirect=clickedObject.attr("redirect"); //澶勭悊澶歵ab椤甸潰鐨勯渶姹
+ 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涓簍rue灏变笉閲嶆柊鐢熸垚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鑿滃崟鐨勭珫鑿滃崟锛岃繕闇瑕佹壘鍒版í鑿滃崟涓婄殑瀵瑰簲鐖朵翰鍔犲叆鍒癱lieckedObj
+ 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;
+ }
+ //濡傛灉鏄疐鑿滃崟鍜屾í鑿滃崟鐨勫瓙绔栬彍鍗曠偣鍑伙紝闇瑕佸仛鐗规畩澶勭悊
+ if( clieckedObj.parent('ul').attr('id') == fMenuSiderDivId || clieckedObj.parent('ul').attr('id') == megaSiderDivId){
+ var id = clieckedObj.children( 'a' ).attr('hparentid');
+ //鍒ゆ柇鏄疐鑿滃崟杩樻槸妯彍鍗
+ 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)){//濡傛灉浠呬粎鏄痶ab璺宠浆璁剧疆bread杩涙潵鐨勶紝灏辨鏋朵笉澶勭悊鑿滃崟鐐瑰嚮锛岀洿鎺ラ噸鏂板缓绔媌read鍗冲彲
+ 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") { //鏀跺埌涓嶅睘浜庡彇鍊艰寖鍥村唴鐨勫洖澶嶏紝璇存槑鍑虹幇涓嶅彲棰勭煡鎯呭喌锛屽彇娑堝績璺炽傛槸鍘焒ramework.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();
+ });
+ }
+ //娓呯悊褰撳墠姝e湪鏄剧ず鐨刬frame涔嬪缂撳瓨鐨刬frame锛
+ 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) {//娓呯悊缂撳瓨鐨刬frame瀹炰綋瀵硅薄銆
+ 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(){//娉ㄥ唽鐨偆鍒囨崲浜嬩欢澶勭悊鍑芥暟锛屽鐞唅frame涓殑鐨偆鍒囨崲
+ 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;
+ }
+ //澶勭悊璺ㄥ煙璇锋眰浠g悊锛岄氳繃璇ヤ唬鐞嗚繘琛宨frame闂翠紶閫掑弬鏁帮紝娉ㄦ剰杩欓噷鐨勪唬鐞嗛〉闈roxy.html蹇呴』閮ㄧ讲鍒拌璺ㄥ煙鐨勫绔煙鐨勬湇鍔″櫒web鏍圭洰褰曚笅
+ var dealCrossProxy=function(ifrm,crossproxysrc,ifmHeadlins,flag){//crossproxysrc杩欎釜鏄痯roxy.html瀵瑰簲鐨剈rl鏍硅矾寰
+ 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){//浠g悊宸茬粡娣诲姞杩囦簡锛岀湅鏄惁鏄悓涓涓綉绔欑殑浠g悊锛屽鏋滀笉鏄渶瑕侀噸鏂板姞杞
+ _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); ////娓呯悊褰撳墠姝e湪鏄剧ず鐨刬frame涔嬪缂撳瓨鐨刬frame锛
+ 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();
+ },
+ //鍏紑娓呯悊缂撳瓨鐨勬墍鏈塈frame鐨勬柟娉曪細isALL==true鍒欐竻鐞嗘墍鏈夛紝鍚﹀垯娓呯悊褰撳墠姝e湪鏄剧ず鐨刬frame涔嬪缂撳瓨鐨刬frame锛屻
+ clearCachedIframes:function(isAll){
+ dealClearCachedIframes(isAll);
+ },
+
+ setBaseURLRoot:function(ipportStr){//鑿滃崟url鐨勮窡ip鍜岀鍙d緥濡: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鍜岀鍙d緥濡:http://10.74.151.122:21180
+ var rooturl="";
+ if (store) {
+ rooturl=store('baseURLRoot');
+ }
+ return !rooturl?"":rooturl;
+ },
+ clearBaseURLRoot:function(){//鑿滃崟url鐨勮窡ip鍜岀鍙d緥濡: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鏃ユ柊澧炲姩鎬佸垏鎹㈣彍鍗曠殑鍔熻兘锛岃繖閲岀殑鑿滃崟杩橀渶瑕佸啀娆℃洿鎹㈣彍鍗曢」璁块棶鐨刬p绔彛淇℃伅
+ handlBaseURL:function(url){
+ var baseURLRoot=openoFrameWork.getBaseURLRoot();
+ if (baseURLRoot.length>0) {//2015骞10鏈26鏃ユ柊澧炲姩鎬佸垏鎹㈣彍鍗曠殑鍔熻兘锛岃繖閲岀殑鑿滃崟杩橀渶瑕佸啀娆℃洿鎹㈣彍鍗曢」璁块棶鐨刬p绔彛淇℃伅
+ baseURLRoot=openoFrameWork.getDomainURL(baseURLRoot);//鍘绘帀ip鍜宲ort鍚庡浣欑殑閮ㄥ垎
+ 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瀵硅薄
+ /* 娉ㄦ剰璇ュ姛鑳藉湪鍏朵粬鑴氭湰涓皟鐢ㄦ椂鍑簊afari鑾峰彇鍒扮殑鑴氭湰璺緞涓烘湰鏂规硶鎵鍦ㄨ剼鏈殑璺緞锛
+ 鍏朵粬娴忚鍣ㄨ幏鍙栧埌鐨勪负璋冪敤璇ユ柟娉曠殑鑴氭湰鎵鍦ㄨ矾寰
+ 鍙栧緱姝e湪瑙f瀽鐨剆cript鑺傜偣
+ */
+ 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鐨勯敊璇璞″彧鏈塴ine,sourceId 鎴栬呴珮鐗堟湰杩樻湁sourceURL
+ stack = e.stack;
+ if(e.sourceURL){//safari 娴忚鍣ㄦ病鏈塭.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;
+ }
+ }
+ }
+ },
+ /*涓嬮潰鐨刦lag涓0琛ㄧず榛樿涓嶈Е鍙戝瓩瀛恑frame涓殑onload浜嬩欢,涓1琛ㄧず瑕佽Е鍙,flag涓10鍒欏cssSrc閲嶅鎵ц锛屽叾浠栦笉鍋氶噸澶嶆墽琛*/
+ SyncCSS:function(ifrm,flag,cssSrc){//灏嗕富妗嗘灦涓殑鐨偆css搴旂敤鍒版墦寮鐨刬frame椤甸潰涓
+ 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;//杩欓噷鍚屾鑿滃崟瀹氫箟涓璫ssSrc灞炴ф寚瀹氱殑css鏂囦欢鍒癷frame
+ _div = null;
+ csslink.rel="stylesheet";
+ csslink.type="text/css";
+ csslink.id="ifram_csssrc";
+ ifmHeadlins.push({"pos":"head","scope":"all","link":csslink});//pos鏄坊鍔犲埌瀛恑frame涓殑浣嶇疆锛宻cope鏄瓙绐椾綋浣滅敤杩斿洖锛宱ne琛ㄧず鐩存帴瀛愮獥浣擄紝all琛ㄧず宓屽鎵鏈夊瓙绐椾綋
+ }
+ if(flag!=10){//褰揻lag涓10鏃朵笅闈㈢殑css鍜宩s閮戒笉鎵ц
+ if($('#style_color').length>0){
+ var csslink=document.createElement("link");
+ csslink.href=$('#style_color')[0].href.replace(".css","_ifrm.css");//杩欓噷鍚屾鐨勭毊鑲ら〉闈慨鏀逛负鍘熺毊鑲ら〉闈㈡枃浠跺悕鍚庣紑娣诲姞ifrm鐨刢ss鐨偆鏂囦欢
+ csslink.rel="stylesheet";
+ csslink.type="text/css";
+ csslink.id="style_color";
+ ifmHeadlins.push({"pos":"head","scope":"all","link":csslink});//pos鏄坊鍔犲埌瀛恑frame涓殑浣嶇疆锛宻cope鏄瓙绐椾綋浣滅敤杩斿洖锛宱ne琛ㄧず鐩存帴瀛愮獥浣擄紝all琛ㄧず宓屽鎵鏈夊瓙绐椾綋
+ }
+ // 灏 font-awesome瀛椾綋鍥炬爣搴旂敤鍒版ā鍧梚frame
+ 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});
+ }
+ // 灏唒ym.js or pym.min.js搴旂敤鍒版ā鍧梚frame
+ 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});
+ }
+ // 灏唄k.js or hk.min.js搴旂敤鍒版ā鍧梚frame
+ 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 鍔犺浇鍚庢嫤鎴猘jax璇锋眰杩涜杞彂
+ }
+ }
+ 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);
+ }
+ //瀵筰frame涓張鏈夊祵濂椾竴绾frame鐨勫湴鏂硅繘琛屽悓姝ワ紝鍙悓姝cope涓篴ll鐨
+ var childifrms=ifrm.contentDocument.getElementsByTagName("iframe");
+ if(childifrms&&childifrms.length>0){
+ var ifmHeadlins2 = new Array();
+ for (i=0;i<ifmHeadlins.length;i++){//绛涢夊嚭scope涓篴ll鐨
+ 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];////娉ㄦ剰杩欓噷蹇呴』鍏嬮殕锛屽惁鍒欎細鍑虹幇鍏冪礌绉诲姩锛屽墠闈frm娣诲姞鐨勯兘浼氳绉诲嚭
+ 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;//鍏ㄥ眬鍙橀噺锛屽0鏄庢娆′簨浠舵槸鐢辩偣鍑婚潰鍖呭睉鍙戣捣鐨
+ 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:''}缂撳瓨鍒癈ategory鏁扮粍涓紝
+ //menuCategoryID灞炴ф槸鏇村鑿滃崟涓婇厤缃殑鑿滃崟鐨勫垎绫籭d锛;
+ //ipPortStr灞炴ф槸璇d鐨勮彍鍗曡鏇挎崲鐨勬柊鐨刬p鍜岀鍙e湴鍧瀛楃涓诧紝鍖呮嫭鍗忚閮ㄥ垎锛屾瘮濡俬ttp://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){//涓昏彍鍗曚腑娌℃湁鎵惧埌锛屽氨鎵緈ore鑿滃崟锛屾壘鍒癷d瀵瑰簲鐨刴ore鑿滃崟椤规墍灞炵殑涓昏彍鍗曢」
+ var mainMenuId = this.getMenuItemId_From_MoreMenuRelation(id);
+ if( !!mainMenuId&&mainMenuId.length>0 ){//more鑿滃崟涓壘鍒颁簡id瀵瑰簲鐨勪富鑿滃崟椤筰d锛屾牴鎹甶d杩斿洖涓昏彍鍗曢」
+ 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');
+ }
+ }
+ }
+ }
+ }
+ }
+ //鍏舵鎵惧埌鐨勮彍鍗曢」涓璶ewIPPort.menuCategoryID瀵瑰簲鐨剆rc瑕嗙洊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){
+ //闈㈠寘灞戝拰涓昏彍鍗曢兘娌℃湁鎵惧埌锛屾儏鍐靛彲鑳芥槸锛氭洿澶氳彍鍗曠偣鍑绘墦寮鍚庯紝鍒锋柊锛宧ash宸茬粡鏇存敼锛屼絾鏄搴旂殑鏇村鑿滃崟鐨刪tml娌℃湁鍔犺浇锛岄渶瑕佹壘鍒版洿澶氳彍鍗曞拰涓昏彍鍗曠殑瀵瑰簲鍏崇郴
+ var mainMenuId = this.getMenuItemId_From_MoreMenuRelation( id );
+ if( mainMenuId ){
+ menuitem = this.findMenuItemByMenuId(mainMenuId);
+ }
+
+ }
+ if (store&&store("globleCurrentBreadcrumb")){
+ globleCurrentBreadcrumb=store("globleCurrentBreadcrumb");
+ //涓嬮潰澶勭悊涓嬪埛鏂版暣涓〉闈㈠悗浠巆ookie涓幏鍙栨潵鐨勬渶鍚庝竴娆℃搷浣滅殑闈㈠寘灞戝搴旂殑瀵瑰簲鑿滃崟鐨刵ame灞炴у洖鍐欙紝渚夸簬闈㈠寘灞戜簨浠跺搷搴旇兘澶熸壘鍒板搴旂殑鑿滃崟
+ 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){ //涓存椂涓娆℃х殑娉ㄥ唽涓娆lick浜嬩欢澶勭悊鍑芥暟锛屾墽琛屽畬姣曚細鑷姩鍒犻櫎
+ 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銆乵egamenu 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) { //涓存椂涓娆℃х殑娉ㄥ唽涓娆lick浜嬩欢澶勭悊鍑芥暟锛屾墽琛屽畬姣曚細鑷姩鍒犻櫎
+ 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() + "=([^&]*)(&|$)"); //鏋勯犱竴涓惈鏈夌洰鏍囧弬鏁扮殑姝e垯琛ㄨ揪寮忓璞
+ 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鏍囩浠ュ悗娣诲姞鍒颁富妗嗘灦浠ラ槻姝ppend鏂规硶鍥犱负鍔犺浇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{//鍚﹀垯杩樻槸妯℃嫙鐐瑰嚮閰嶇疆浜唖tart绫荤殑鑿滃崟
+ 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();
+ // 渚ц竟鏍忔樉绀猴紝鏍规嵁渚ц竟鏍廋SS閫夋嫨
+ if (navPosOption === "vertical") {
+ //containerStr=$('.page-sidebar').length>0?'.page-sidebar':"";
+ startmenu = $('.iframe.start' , sidermenu);
+ dealStartMenu( startmenu, sidermenu );
+ }
+ // 姘村钩鑿滃崟鏄剧ず锛屾牴鎹按骞宠彍鍗旵SS閫夋嫨
+ 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();
+ //浠庨〉闈OM鍙栧緱鑿滃崟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];
+ // 鑿滃崟椤瑰鏋滈厤浜唋icenseid, 骞朵笖涓嶆槸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();
+ //浠庨〉闈OM鍙栧緱鑿滃崟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];
+ // 鑿滃崟椤瑰鏋滈厤浜唋icenseid, 骞朵笖涓嶆槸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();
+ //浠庨〉闈OM鍙栧緱鑿滃崟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];
+ // 鑿滃崟椤瑰鏋滈厤浜唋icenseid, 骞朵笖涓嶆槸true瀛楃涓, 鍒欑Щ闄よ彍鍗曢」
+ if (lcsitem.value != "True") {
+ $('#'+id, $('.more-botton-zone > li.btn-group')).parent().remove();
+ }
+ }
+ }
+ // 澧炲姞mysql鍒ゆ柇锛屽鏋滄暟鎹簱涓簃ysql锛屽幓鎺夊熀纭鏁版嵁澶囦唤鍔熻兘鑿滃崟椤
+ 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(); // 鍒犵┖鐨勫垎缁勫垪
+ }
+ });
+ //鍒犻櫎澧炲姞鐨勫垎缁刣iv
+ $('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");
+ //杩欐浠g爜鍏堣繖涔堝啓,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');
+ }
+};
+// 娴忚鍣ㄧ缉灏忓悗瀵艰埅鏍忛殣钘忕殑鎯呭喌涓嬬偣鍑籲avbar-toggle鏄剧ず鑿滃崟鐨勫墠缃伐浣滐紝
+// 娴忚鍣ㄧ缉灏忓悗瀵艰埅鏍忛殣钘忕殑鎯呭喌涓嬬偣鍑籲avbar-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/openo-portal/portal-common/src/main/webapp/common/js/core/pym.min.js b/openo-portal/portal-common/src/main/webapp/common/js/core/pym.min.js
index 78b2f513..937c6eac 100644
--- a/openo-portal/portal-common/src/main/webapp/common/js/core/pym.min.js
+++ b/openo-portal/portal-common/src/main/webapp/common/js/core/pym.min.js
@@ -1,16 +1,16 @@
-/*
- * Copyright 2016, 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});
+/*
+ * Copyright 2016, 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/openo-portal/portal-common/src/main/webapp/common/js/fm_light.js b/openo-portal/portal-common/src/main/webapp/common/js/fm_light.js
index e31224c5..222deedc 100644
--- a/openo-portal/portal-common/src/main/webapp/common/js/fm_light.js
+++ b/openo-portal/portal-common/src/main/webapp/common/js/fm_light.js
@@ -1,169 +1,169 @@
-/*
- * Copyright 2016, 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);
+/*
+ * Copyright 2016, 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/openo-portal/portal-common/src/main/webapp/common/js/international/loadi18n.js b/openo-portal/portal-common/src/main/webapp/common/js/international/loadi18n.js
index e34794e3..4792b374 100644
--- a/openo-portal/portal-common/src/main/webapp/common/js/international/loadi18n.js
+++ b/openo-portal/portal-common/src/main/webapp/common/js/international/loadi18n.js
@@ -1,52 +1,52 @@
-/*
- * Copyright 2016, 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);
-}
-
+/*
+ * Copyright 2016, 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/openo-portal/portal-common/src/main/webapp/common/js/json2.js b/openo-portal/portal-common/src/main/webapp/common/js/json2.js
index a281d22c..a51a0bcd 100644
--- a/openo-portal/portal-common/src/main/webapp/common/js/json2.js
+++ b/openo-portal/portal-common/src/main/webapp/common/js/json2.js
@@ -1,341 +1,341 @@
-/*
- * Copyright 2016, 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');
- };
- }
-}());
+/*
+ * Copyright 2016, 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/openo-portal/portal-common/src/main/webapp/common/js/login.js b/openo-portal/portal-common/src/main/webapp/common/js/login.js
index a5f65a8f..c4df17d7 100644
--- a/openo-portal/portal-common/src/main/webapp/common/js/login.js
+++ b/openo-portal/portal-common/src/main/webapp/common/js/login.js
@@ -1,158 +1,158 @@
-/*
- * Copyright 2016, 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() {
- }
- })
-}
+/*
+ * Copyright 2016, 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/openo-portal/portal-common/src/main/webapp/common/js/mainpage/about.js b/openo-portal/portal-common/src/main/webapp/common/js/mainpage/about.js
index afbdcf62..bab46c4f 100644
--- a/openo-portal/portal-common/src/main/webapp/common/js/mainpage/about.js
+++ b/openo-portal/portal-common/src/main/webapp/common/js/mainpage/about.js
@@ -1,142 +1,142 @@
-/*
- * Copyright 2016, 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");
- }
-};
+/*
+ * Copyright 2016, 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/openo-portal/portal-common/src/main/webapp/common/js/mainpage/load_mainPage.js b/openo-portal/portal-common/src/main/webapp/common/js/mainpage/load_mainPage.js
index 3ba0f7ba..d164771f 100644
--- a/openo-portal/portal-common/src/main/webapp/common/js/mainpage/load_mainPage.js
+++ b/openo-portal/portal-common/src/main/webapp/common/js/mainpage/load_mainPage.js
@@ -1,95 +1,95 @@
-/*
- * Copyright 2016, 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);
- });
+/*
+ * Copyright 2016, 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/openo-portal/portal-common/src/main/webapp/common/js/moreOperation.js b/openo-portal/portal-common/src/main/webapp/common/js/moreOperation.js
index 8078f54b..59e781a0 100644
--- a/openo-portal/portal-common/src/main/webapp/common/js/moreOperation.js
+++ b/openo-portal/portal-common/src/main/webapp/common/js/moreOperation.js
@@ -1,166 +1,166 @@
-/*
- * Copyright 2016, 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");
-}
+/*
+ * Copyright 2016, 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/openo-portal/portal-common/src/main/webapp/common/js/openotopo/openotopo.js b/openo-portal/portal-common/src/main/webapp/common/js/openotopo/openotopo.js
index 06ef623b..0de3548a 100644
--- a/openo-portal/portal-common/src/main/webapp/common/js/openotopo/openotopo.js
+++ b/openo-portal/portal-common/src/main/webapp/common/js/openotopo/openotopo.js
@@ -1,314 +1,314 @@
-/*
- * Copyright 2016, 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;
- }
- }
- }
-}
+/*
+ * Copyright 2016, 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/openo-portal/portal-common/src/main/webapp/common/js/openotopo/openotopo.min.js b/openo-portal/portal-common/src/main/webapp/common/js/openotopo/openotopo.min.js
index 223ecdf0..7ef85183 100644
--- a/openo-portal/portal-common/src/main/webapp/common/js/openotopo/openotopo.min.js
+++ b/openo-portal/portal-common/src/main/webapp/common/js/openotopo/openotopo.min.js
@@ -1,32 +1,32 @@
-/*
- * Copyright 2016, 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
+/*
+ * Copyright 2016, 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/openo-portal/portal-common/src/main/webapp/common/js/security/aes.js b/openo-portal/portal-common/src/main/webapp/common/js/security/aes.js
index a5dc52b2..1a0c18a6 100644
--- a/openo-portal/portal-common/src/main/webapp/common/js/security/aes.js
+++ b/openo-portal/portal-common/src/main/webapp/common/js/security/aes.js
@@ -1,44 +1,44 @@
-/*
- * Copyright 2016, 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)})();
+/*
+ * Copyright 2016, 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/openo-portal/portal-common/src/main/webapp/common/js/security/framework-util.js b/openo-portal/portal-common/src/main/webapp/common/js/security/framework-util.js
index 8939a281..cd638243 100644
--- a/openo-portal/portal-common/src/main/webapp/common/js/security/framework-util.js
+++ b/openo-portal/portal-common/src/main/webapp/common/js/security/framework-util.js
@@ -1,38 +1,38 @@
-/*
- * Copyright 2016, 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";
+/*
+ * Copyright 2016, 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/openo-portal/portal-common/src/main/webapp/common/js/security/security.js b/openo-portal/portal-common/src/main/webapp/common/js/security/security.js
index f6ae4d05..3f513b02 100644
--- a/openo-portal/portal-common/src/main/webapp/common/js/security/security.js
+++ b/openo-portal/portal-common/src/main/webapp/common/js/security/security.js
@@ -1,127 +1,127 @@
-/*
- * Copyright 2016, 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");
-}
+/*
+ * Copyright 2016, 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/openo-portal/portal-common/src/main/webapp/common/js/tools.js b/openo-portal/portal-common/src/main/webapp/common/js/tools.js
index b4a6e68f..386a49db 100644
--- a/openo-portal/portal-common/src/main/webapp/common/js/tools.js
+++ b/openo-portal/portal-common/src/main/webapp/common/js/tools.js
@@ -1,1021 +1,1021 @@
-/*
- * Copyright 2016, 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 (渚嬪锛歝lassname)
- 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!!");
- }
- }
-
-
- /**
- * 鍚屾鍙戦亁ml 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;
- }
-
- /**
- * 鍚屾鍙戦亁ml 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 + "=([^&]*)(&|$)"); //鏋勯犱竴涓惈鏈夌洰鏍囧弬鏁扮殑姝e垯琛ㄨ揪寮忓璞
- var search =decodeURIComponent(location.search.substring(1)); //decodeURIComponent() 鍑芥暟鍙 encodeURIComponent() 鍑芥暟缂栫爜鐨 URI 杩涜瑙g爜銆
- var r =search.match(reg); //鍖归厤鐩爣鍙傛暟
- if (r != null) return unescape(r[2]); //unescape() 鍑芥暟鍙閫氳繃 escape() 缂栫爜鐨勫瓧绗︿覆杩涜瑙g爜銆
- 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 瀹屾垚鍑芥暟锛屽垽鏂繑鍥炵姸鎬侊紝濡傛灉鐘舵佹甯革紝浣咹EADER澶撮噷鏈塻ession瓒呮椂淇℃伅锛屽垯鍒锋柊閲嶇櫥褰
-// 濡傛灉鐘舵佷负 401, 涔熷埛鏂伴噸鐧诲綍
-// 娉ㄦ剰濡傛灉鍦$.ajax() 鍑芥暟涓畾涔変簡 complete锛屽垯瑕嗙洊浜嗚繖閲岄瀹氫箟complete鍐呭锛屼互$.ajax()鍑芥暟涓畾涔夌殑涓哄噯锛岃繖閲岄瀹氫箟鐨勫嚱鏁板垯澶辨晥锛屽鏋
-// 瑕佺户缁垽鏂璼ession瓒呮椂锛屽垯闇瑕佸湪 $.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("/");
- // }
- }
- });
-}
+/*
+ * Copyright 2016, 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 (渚嬪锛歝lassname)
+ 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!!");
+ }
+ }
+
+
+ /**
+ * 鍚屾鍙戦亁ml 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;
+ }
+
+ /**
+ * 鍚屾鍙戦亁ml 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 + "=([^&]*)(&|$)"); //鏋勯犱竴涓惈鏈夌洰鏍囧弬鏁扮殑姝e垯琛ㄨ揪寮忓璞
+ var search =decodeURIComponent(location.search.substring(1)); //decodeURIComponent() 鍑芥暟鍙 encodeURIComponent() 鍑芥暟缂栫爜鐨 URI 杩涜瑙g爜銆
+ var r =search.match(reg); //鍖归厤鐩爣鍙傛暟
+ if (r != null) return unescape(r[2]); //unescape() 鍑芥暟鍙閫氳繃 escape() 缂栫爜鐨勫瓧绗︿覆杩涜瑙g爜銆
+ 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 瀹屾垚鍑芥暟锛屽垽鏂繑鍥炵姸鎬侊紝濡傛灉鐘舵佹甯革紝浣咹EADER澶撮噷鏈塻ession瓒呮椂淇℃伅锛屽垯鍒锋柊閲嶇櫥褰
+// 濡傛灉鐘舵佷负 401, 涔熷埛鏂伴噸鐧诲綍
+// 娉ㄦ剰濡傛灉鍦$.ajax() 鍑芥暟涓畾涔変簡 complete锛屽垯瑕嗙洊浜嗚繖閲岄瀹氫箟complete鍐呭锛屼互$.ajax()鍑芥暟涓畾涔夌殑涓哄噯锛岃繖閲岄瀹氫箟鐨勫嚱鏁板垯澶辨晥锛屽鏋
+// 瑕佺户缁垽鏂璼ession瓒呮椂锛屽垯闇瑕佸湪 $.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("/");
+ // }
+ }
+ });
+}