{"action":"created","issue":{"url":"https://api.github.com/repos/brave/browser-laptop/issues/5830","repository_url":"https://api.github.com/repos/brave/browser-laptop","labels_url":"https://api.github.com/repos/brave/browser-laptop/issues/5830/labels{/name}","comments_url":"https://api.github.com/repos/brave/browser-laptop/issues/5830/comments","events_url":"https://api.github.com/repos/brave/browser-laptop/issues/5830/events","html_url":"https://github.com/brave/browser-laptop/issues/5830","id":191528863,"number":5830,"title":"Cannot see page","user":{"login":"austenlennon","id":23722967,"avatar_url":"https://avatars.githubusercontent.com/u/23722967?v=3","gravatar_id":"","url":"https://api.github.com/users/austenlennon","html_url":"https://github.com/austenlennon","followers_url":"https://api.github.com/users/austenlennon/followers","following_url":"https://api.github.com/users/austenlennon/following{/other_user}","gists_url":"https://api.github.com/users/austenlennon/gists{/gist_id}","starred_url":"https://api.github.com/users/austenlennon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/austenlennon/subscriptions","organizations_url":"https://api.github.com/users/austenlennon/orgs","repos_url":"https://api.github.com/users/austenlennon/repos","events_url":"https://api.github.com/users/austenlennon/events{/privacy}","received_events_url":"https://api.github.com/users/austenlennon/received_events","type":"User","site_admin":false},"labels":[{"id":324836095,"url":"https://api.github.com/repos/brave/browser-laptop/labels/info-needed","name":"info-needed","color":"c2e0c6","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-24T14:09:20Z","updated_at":"2016-12-02T16:06:59Z","closed_at":null,"body":"**Did you search for similar issues before submitting this one?** yes\r\n\r\n**Describe the issue you encountered:** page wont show data\r\n\r\n**Expected behavior:** seeing charts \r\n\r\n- Platform (Win7, 8, 10? macOS? Linux distro?): MAC latest\r\n\r\n- Brave Version:  latest and same with previous\r\n\r\n- Steps to reproduce:\r\n    1. go to page\r\n    2.\r\n    3.\r\n\r\n- Screenshot if needed:\r\n\r\n- Any related issues: I have pasted source code\r\n\r\n<!DOCTYPE html>\r\n<html lang=\"en\">\r\n  <head>\r\n<!--[if IE]>\r\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=Edge,chrome=IE8\"/>\r\n<![endif]-->\r\n    <title>enteliWEB</title>    <meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" />\r\n<meta name=\"distribution\" content=\"IU\" />\r\n<meta name=\"content-language\" content=\"en\" />\r\n<meta name=\"robots\" content=\"noindex, nofollow\" />\r\n<meta name=\"copyright\" content=\"Copyright &amp;#169; 2016 Delta Controls Inc.\" />    <link href=\"/enteliweb/images/favicon.ico\" rel=\"SHORTCUT ICON\" />\r\n<link href=\"/enteliweb/resources/css/ext-all.css?4.1.738\" media=\"all\" rel=\"stylesheet\" type=\"text/css\" />\r\n<link href=\"/enteliweb/style/delta/index.css?4.1.738\" media=\"all\" rel=\"stylesheet\" type=\"text/css\" />\r\n<link href=\"/enteliweb/style/delta/Delta.Notification.css?4.1.738\" media=\"all\" rel=\"stylesheet\" type=\"text/css\" />\r\n<link href=\"/enteliweb/style/delta/Delta.Energy.css?4.1.738\" media=\"all\" rel=\"stylesheet\" type=\"text/css\" />\r\n        <script type=\"text/javascript\">\r\n      var APPLICATION_URL = \"/enteliweb\";\r\n      var gLocale = \"en\";\r\n      var BUILD_VERSION = \"4.1.738\";\r\n    </script>\r\n    <script type=\"text/javascript\" src=\"/enteliweb/javascript/ext4/ext-all.js?4.1.738\"></script>\r\n<script type=\"text/javascript\" src=\"/enteliweb/javascript/jquery/jquery.js?4.1.738\"></script>\r\n<script type=\"text/javascript\">\r\n    //<![CDATA[\r\n    var _tokenName = \"_csrfToken\";\r\nvar _token     = \"jRH7XnK7eYzhtSERIzLrf4SO6jL4u15UxdBnP2jPFk\";\r\nvar _isPageRdy = false;\r\n    //]]>\r\n</script>\r\n<script type=\"text/javascript\" src=\"/enteliweb/javascript/delta/delta_override.js?4.1.738\"></script>\r\n<script type=\"text/javascript\" src=\"/enteliweb/javascript/jquery/jquery.ui.js?4.1.738\"></script>\r\n<script type=\"text/javascript\" src=\"/enteliweb/javascript/delta/Delta.js?4.1.738\"></script>\r\n<script type=\"text/javascript\" src=\"/enteliweb/javascript/delta/resources/Delta.ML.en.js?4.1.738\"></script>\r\n<script type=\"text/javascript\" src=\"/enteliweb/javascript/delta/Ext-lang.js?4.1.738\"></script>\r\n<script type=\"text/javascript\" src=\"/enteliweb/javascript/delta/Delta.DateTime.js?4.1.738\"></script>\r\n<script type=\"text/javascript\" src=\"/enteliweb/javascript/delta/Delta.UI.js?4.1.738\"></script>\r\n<script type=\"text/javascript\" src=\"/enteliweb/javascript/delta/Delta.UI.DSTree.js?4.1.738\"></script>\r\n<script type=\"text/javascript\" src=\"/enteliweb/javascript/delta/Delta.NotificationPopup.js?4.1.738\"></script>\r\n<script type=\"text/javascript\" src=\"/enteliweb/javascript/delta/Delta.NotificationBar.js?4.1.738\"></script>  </head>\r\n  <body>\r\n    <script type=\"text/javascript\">\r\n//<!--/*--><![CDATA[/*><!--*/\r\n// Initialization\r\nvar PERSONAL_DASHBOARD_ID = \"00000000-0000-0000-0000-000000000001\";\r\nvar customViews = [{\"id\":\"5852fe4f-84c5-11e4-8e4a-005056a56544\",\"title\":\"Ballygally Castle Hotel\"},{\"id\":\"73982183-fee6-11e4-9482-005056a56544\",\"title\":\"Culloden Hotel\"},{\"id\":\"ebb321f0-84c5-11e4-8e4a-005056a56544\",\"title\":\"Europa Hotel\"},{\"id\":\"ed6eae3f-048f-11e5-9482-005056a56544\",\"title\":\"Everglades Hotel\"}];  // custom views\r\nvar systemList = [{\"ID\":\"2263f449-84b9-11e4-8e4a-005056a56544\",\"Name\":\"Europa Boilerhouse\",\"Description\":\"\",\"Template\":\"boiler_system.xml\"},{\"ID\":\"26c53cab-7b8a-11e5-a87c-005056a56544\",\"Name\":\"Culloden - ACU Systems\",\"Description\":\"\",\"Template\":\"ACU.xml\"},{\"ID\":\"4a8d512d-6aea-11e5-a87c-005056a56544\",\"Name\":\"Ballygally Bedrooms\",\"Description\":\"\",\"Template\":\"hotelbedrooms.xml\"},{\"ID\":\"63232b07-84c4-11e4-8e4a-005056a56544\",\"Name\":\"Ballgally Boilerhouse\",\"Description\":\"\",\"Template\":\"boiler_system.xml\"},{\"ID\":\"a54d7bd9-0490-11e5-9482-005056a56544\",\"Name\":\"Everglades Boilerhouse\",\"Description\":\"\",\"Template\":\"boiler_system.xml\"}];  // system list\r\nvar dashboardTree = [{\"id\":\"00000000-0000-0000-0000-000000000001\",\"text\":\"Personal\",\"qtip\":\"Personal\",\"children\":[{\"id\":\"a0b1c89e-b6c1-11e4-8e4a-005056a56544\",\"text\":\"Austen's Dashboard\",\"qtip\":\"Austen's Dashboard\",\"href\":\"\\/enteliweb\\/dashboard\\/display\\/dashboard\\/a0b1c89e-b6c1-11e4-8e4a-005056a56544\",\"hrefTarget\":\"mainFrame\",\"leaf\":true,\"iconCls\":\"dashboard_icon\"}]},{\"id\":\"00000000-0000-0000-0000-000000000000\",\"text\":\"Enterprise\",\"qtip\":\"Enterprise\",\"children\":[{\"id\":\"b30ab4a7-c053-11e5-a5c8-005056a56544\",\"text\":\"Ballygally AHU\",\"qtip\":\"Ballygally AHU\",\"href\":\"\\/enteliweb\\/dashboard\\/display\\/dashboard\\/b30ab4a7-c053-11e5-a5c8-005056a56544\",\"hrefTarget\":\"mainFrame\",\"leaf\":true,\"iconCls\":\"dashboard_icon\"},{\"id\":\"24481b8d-8ebe-11e5-a5c8-005056a56544\",\"text\":\"Ballygally Bedrooms\",\"qtip\":\"Ballygally Bedrooms\",\"href\":\"\\/enteliweb\\/dashboard\\/display\\/dashboard\\/24481b8d-8ebe-11e5-a5c8-005056a56544\",\"hrefTarget\":\"mainFrame\",\"leaf\":true,\"iconCls\":\"dashboard_icon\"},{\"id\":\"3c1de927-8ebe-11e5-a5c8-005056a56544\",\"text\":\"Ballygally Boilerhouse\",\"qtip\":\"Ballygally Boilerhouse\",\"href\":\"\\/enteliweb\\/dashboard\\/display\\/dashboard\\/3c1de927-8ebe-11e5-a5c8-005056a56544\",\"hrefTarget\":\"mainFrame\",\"leaf\":true,\"iconCls\":\"dashboard_icon\"},{\"id\":\"6f67f6cb-8eb2-11e5-a5c8-005056a56544\",\"text\":\"Ballygally Energy\",\"qtip\":\"Ballygally Energy\",\"href\":\"\\/enteliweb\\/dashboard\\/display\\/dashboard\\/6f67f6cb-8eb2-11e5-a5c8-005056a56544\",\"hrefTarget\":\"mainFrame\",\"leaf\":true,\"iconCls\":\"dashboard_icon\"},{\"id\":\"ed57b505-c0f3-11e5-a5c8-005056a56544\",\"text\":\"Culloden AC Units\",\"qtip\":\"Culloden AC Units\",\"href\":\"\\/enteliweb\\/dashboard\\/display\\/dashboard\\/ed57b505-c0f3-11e5-a5c8-005056a56544\",\"hrefTarget\":\"mainFrame\",\"leaf\":true,\"iconCls\":\"dashboard_icon\"},{\"id\":\"c4a91e90-b607-11e5-a5c8-005056a56544\",\"text\":\"Culloden Hotel\",\"qtip\":\"Culloden Hotel\",\"href\":\"\\/enteliweb\\/dashboard\\/display\\/dashboard\\/c4a91e90-b607-11e5-a5c8-005056a56544\",\"hrefTarget\":\"mainFrame\",\"leaf\":true,\"iconCls\":\"dashboard_icon\"},{\"id\":\"a09d52e4-b61a-11e5-a5c8-005056a56544\",\"text\":\"Culloden Spa\",\"qtip\":\"Culloden Spa\",\"href\":\"\\/enteliweb\\/dashboard\\/display\\/dashboard\\/a09d52e4-b61a-11e5-a5c8-005056a56544\",\"hrefTarget\":\"mainFrame\",\"leaf\":true,\"iconCls\":\"dashboard_icon\"},{\"id\":\"b1def2c9-b47b-11e5-a5c8-005056a56544\",\"text\":\"Europa AHU\",\"qtip\":\"Europa AHU\",\"href\":\"\\/enteliweb\\/dashboard\\/display\\/dashboard\\/b1def2c9-b47b-11e5-a5c8-005056a56544\",\"hrefTarget\":\"mainFrame\",\"leaf\":true,\"iconCls\":\"dashboard_icon\"},{\"id\":\"9e2369b3-b47b-11e5-a5c8-005056a56544\",\"text\":\"Europa Boilerhouse\",\"qtip\":\"Europa Boilerhouse\",\"href\":\"\\/enteliweb\\/dashboard\\/display\\/dashboard\\/9e2369b3-b47b-11e5-a5c8-005056a56544\",\"hrefTarget\":\"mainFrame\",\"leaf\":true,\"iconCls\":\"dashboard_icon\"},{\"id\":\"bc1ce8b2-b47b-11e5-a5c8-005056a56544\",\"text\":\"Europa Emerald Suite\",\"qtip\":\"Europa Emerald Suite\",\"href\":\"\\/enteliweb\\/dashboard\\/display\\/dashboard\\/bc1ce8b2-b47b-11e5-a5c8-005056a56544\",\"hrefTarget\":\"mainFrame\",\"leaf\":true,\"iconCls\":\"dashboard_icon\"},{\"id\":\"0dbef3ce-8f97-11e5-a5c8-005056a56544\",\"text\":\"Everglades\",\"qtip\":\"Everglades\",\"href\":\"\\/enteliweb\\/dashboard\\/display\\/dashboard\\/0dbef3ce-8f97-11e5-a5c8-005056a56544\",\"hrefTarget\":\"mainFrame\",\"leaf\":true,\"iconCls\":\"dashboard_icon\"},{\"id\":\"d1ca9689-b529-11e5-a5c8-005056a56544\",\"text\":\"Everglades AHU\",\"qtip\":\"Everglades AHU\",\"href\":\"\\/enteliweb\\/dashboard\\/display\\/dashboard\\/d1ca9689-b529-11e5-a5c8-005056a56544\",\"hrefTarget\":\"mainFrame\",\"leaf\":true,\"iconCls\":\"dashboard_icon\"},{\"id\":\"e75c2990-0de8-11e6-af91-005056a56544\",\"text\":\"Everglades Bedrooms\",\"qtip\":\"Everglades Bedrooms\",\"href\":\"\\/enteliweb\\/dashboard\\/display\\/dashboard\\/e75c2990-0de8-11e6-af91-005056a56544\",\"hrefTarget\":\"mainFrame\",\"leaf\":true,\"iconCls\":\"dashboard_icon\"},{\"id\":\"797bd3c4-07c2-11e6-af91-005056a56544\",\"text\":\"Slieve Donard Bedrooms\",\"qtip\":\"Slieve Donard Bedrooms\",\"href\":\"\\/enteliweb\\/dashboard\\/display\\/dashboard\\/797bd3c4-07c2-11e6-af91-005056a56544\",\"hrefTarget\":\"mainFrame\",\"leaf\":true,\"iconCls\":\"dashboard_icon\"},{\"id\":\"c1e2b1c0-9866-11e5-a5c8-005056a56544\",\"text\":\"Slieve Donard Energy\",\"qtip\":\"Slieve Donard Energy\",\"href\":\"\\/enteliweb\\/dashboard\\/display\\/dashboard\\/c1e2b1c0-9866-11e5-a5c8-005056a56544\",\"hrefTarget\":\"mainFrame\",\"leaf\":true,\"iconCls\":\"dashboard_icon\"},{\"id\":\"c2dde273-9861-11e5-a5c8-005056a56544\",\"text\":\"Slieve Donard Hotel Boilerhouse\",\"qtip\":\"Slieve Donard Hotel Boilerhouse\",\"href\":\"\\/enteliweb\\/dashboard\\/display\\/dashboard\\/c2dde273-9861-11e5-a5c8-005056a56544\",\"hrefTarget\":\"mainFrame\",\"leaf\":true,\"iconCls\":\"dashboard_icon\"},{\"id\":\"b6376805-a3ee-11e5-a5c8-005056a56544\",\"text\":\"Slieve Donard Spa Boilerhouse\",\"qtip\":\"Slieve Donard Spa Boilerhouse\",\"href\":\"\\/enteliweb\\/dashboard\\/display\\/dashboard\\/b6376805-a3ee-11e5-a5c8-005056a56544\",\"hrefTarget\":\"mainFrame\",\"leaf\":true,\"iconCls\":\"dashboard_icon\"},{\"id\":\"aa4f76ee-b553-11e5-a5c8-005056a56544\",\"text\":\"Stormont AHU\",\"qtip\":\"Stormont AHU\",\"href\":\"\\/enteliweb\\/dashboard\\/display\\/dashboard\\/aa4f76ee-b553-11e5-a5c8-005056a56544\",\"hrefTarget\":\"mainFrame\",\"leaf\":true,\"iconCls\":\"dashboard_icon\"},{\"id\":\"cca95e7f-b553-11e5-a5c8-005056a56544\",\"text\":\"Stormont Boilerhouse\",\"qtip\":\"Stormont Boilerhouse\",\"href\":\"\\/enteliweb\\/dashboard\\/display\\/dashboard\\/cca95e7f-b553-11e5-a5c8-005056a56544\",\"hrefTarget\":\"mainFrame\",\"leaf\":true,\"iconCls\":\"dashboard_icon\"},{\"id\":\"7b5086d7-b5e9-11e5-a5c8-005056a56544\",\"text\":\"Stormont HQ Boilerhouse\",\"qtip\":\"Stormont HQ Boilerhouse\",\"href\":\"\\/enteliweb\\/dashboard\\/display\\/dashboard\\/7b5086d7-b5e9-11e5-a5c8-005056a56544\",\"hrefTarget\":\"mainFrame\",\"leaf\":true,\"iconCls\":\"dashboard_icon\"}]}];\r\nvar permission = {\"dashboard\":true,\"navigation\":true,\"graphic\":false,\"alarm\":true,\"report\":true,\"energy\":true,\"log\":true};\r\nvar networkViewAccess = true;\r\nvar manageSiteRight = true;\r\nvar manageGraphic = false;\r\nvar enteliVIZSupport = false;\r\nvar alarmNotification = {\"Enabled\":true,\"Popups\":true,\"Sound\":true};\r\nvar algorithm = {\"Historian\":\"System\",\"Service\":\"System\",\"CopperCube\":\"System\",\"Device\":\"System\",\"Energy_Anomaly\":\"Energy\",\"Energy_PeakDuration\":\"Energy\",\"Energy_RollingTarget\":\"Energy\",\"Energy_Target\":\"Energy\"};\r\nvar encodedUN = \"QXVzdGVu\";\r\nvar personalDashboard = true;\r\nvar isFullScreen = false;\r\nvar isRightClick = false;\r\n\r\nExt.onReady(function()\r\n  {\r\n    Ext.state.Manager.setProvider(new Ext.state.LocalStorageProvider({prefix: encodedUN}));\r\n    Ext.define(\"enteliWeb\", // global\r\n      {\r\n        singleton: true,\r\n        dashboardTree: {},\r\n        networkTree: {},\r\n        graphicsTree: {},\r\n        alarmTree: {},\r\n        reportTree: {},\r\n        energyTree: {},\r\n        logTree: {}\r\n      });\r\n\r\n    Ext.create(\"Ext.data.Store\",\r\n      {\r\n        storeId: \"systemlist\",\r\n        fields: [\"ID\", \"Name\", \"Description\", \"Template\"],\r\n        proxy:\r\n          {\r\n            type: 'memory',\r\n            reader:\r\n              {\r\n                type: 'json'\r\n              }\r\n          },\r\n        data: systemList\r\n      });\r\n\r\n    var navigatorTabs,\r\n        accordion_Dashboard,\r\n        accordion_Navigation,\r\n        accordion_Graphics,\r\n        accordion_Alarms,\r\n        accordion_Reports,\r\n        accordion_EnergyView,\r\n        accordion_Log;\r\n\r\n    if (permission.dashboard)\r\n      {\r\n        enteliWeb.dashboardTree =\r\n          {\r\n            id: \"dashboardTree\",\r\n            stateId: \"cookiedashboardTree\",\r\n            xtype: \"deltatreepanel\",\r\n            cls: \"treepanel\",\r\n            border: false,\r\n            store:\r\n              {\r\n                root:\r\n                  {\r\n                    id: \"dashboardTree_root\",\r\n                    expanded: true,\r\n                    leaf: false,\r\n                    text: \"Home\",\r\n                    children: dashboardTree\r\n                  },\r\n                listeners:\r\n                  {\r\n                    append: function(node, newNode, index, eOpts)\r\n                      {\r\n                        newNode.set(\"text\", Delta.Util.encodeHTML(newNode.get(\"text\")));\r\n                        newNode.set(\"qtip\", Delta.Util.encodeHTML(newNode.get(\"qtip\")));\r\n                      }\r\n                  }\r\n              },\r\n            listeners:\r\n              {\r\n                \"itemkeydown\": function()\r\n                  {\r\n                    // reset right click flag in case the flag was set to true from previous right click action\r\n                    isRightClick = false;\r\n                  },\r\n                \"itemcontextmenu\": function(panel, record, item, index, e)\r\n                  {\r\n                    // mark the right click flag to true so that the select listener will not open the object\r\n                    // list page when the node is right click\r\n                    isRightClick = true;\r\n                  },\r\n                \"select\": function(selection, record, index, eOpts)\r\n                  {\r\n                    if (record.get(\"parentId\") == PERSONAL_DASHBOARD_ID)\r\n                      {\r\n                        Ext.getCmp(\"menu_DeleteSelectedDashboard\").enable();\r\n                      }\r\n                    else\r\n                      {\r\n                        Ext.getCmp(\"menu_DeleteSelectedDashboard\").disable();\r\n                      }\r\n\r\n                    var myUrl = record.get(\"href\");\r\n                    if (myUrl && !(isRightClick))\r\n                      {\r\n                        Ext.get(\"mainFrame\").dom.src = (myUrl);\r\n                      }\r\n                    isRightClick = true;\r\n                  },\r\n                \"itemclick\": function(view, record, item, index, e, eOpts)\r\n                  {\r\n                    e.preventDefault(); // disable anchor tag\r\n                    var myUrl = record.get(\"href\");\r\n                    if (myUrl && (isRightClick))\r\n                      {\r\n                        Ext.get(\"mainFrame\").dom.src = (myUrl);\r\n                      }\r\n                  }\r\n            }\r\n          };\r\n\r\n        accordion_Dashboard =\r\n          {\r\n            id: \"accordion_Dashboard\",\r\n            title: TXID.WEB_DASHBOARDS,\r\n            iconCls: \"home_icon\",\r\n            listeners:\r\n              {\r\n                afterrender: function()\r\n                  {\r\n                    if (personalDashboard)\r\n                      {\r\n                        Ext.getCmp(\"menu_AddNewDashboard\").enable();\r\n                      }\r\n\r\n                    if (!this.collapsed)  // check it is active tab.\r\n                      {\r\n                        enteliWeb.dashboardTree = this.add(enteliWeb.dashboardTree);\r\n                      }\r\n                  },\r\n                expand: function()\r\n                  {\r\n                    if (!(enteliWeb.dashboardTree instanceof Delta.UI.Tree))\r\n                      {\r\n                        enteliWeb.dashboardTree = this.add(enteliWeb.dashboardTree);\r\n                      }\r\n                  }\r\n              },\r\n            bbar: Ext.create(\"Ext.toolbar.Toolbar\",\r\n              {\r\n                id: \"menu_Home\",\r\n                items: [\r\n                  \"-\",\r\n                  {\r\n                    id: \"menu_HomeAction\",\r\n                    width: 70,\r\n                    text: TXID.WEB_ACTION,\r\n                    menu:\r\n                    {\r\n                      items: [\r\n                        {\r\n                          id: \"menu_AddNewDashboard\",\r\n                          text: TXID.WEB_CREATE_PERSONAL_DASHBOARD,\r\n                          disabled: true,\r\n                          handler: openCreateDashboardWindow\r\n                        },\r\n                        {\r\n                          id: \"menu_DeleteSelectedDashboard\",\r\n                          text: TXID.WEB_DELETE_PERSONAL_DASHBOARD,\r\n                          disabled: true,\r\n                          handler: function()\r\n                            {\r\n                              var confirmMsg = TXID.WEB_DELETE_SELECTED_PERSONAL_DASHBORAD;\r\n                              Ext.MessageBox.confirm(TXID.WEB_DELETE, confirmMsg, function(btn)\r\n                                {\r\n                                  if (btn == \"yes\")\r\n                                    {\r\n                                      deletePersonalDashboard();\r\n                                    }\r\n                                });\r\n                            }\r\n                        }]\r\n                    }\r\n                  },\r\n                  \"-\"]\r\n              })\r\n          };\r\n      }\r\n\r\n    if (permission.navigation)\r\n      {\r\n        navigatorTabs = [];\r\n\r\n        if (networkViewAccess)\r\n          {\r\n            navigatorTabs[navigatorTabs.length] =\r\n              {\r\n                id: \"network_tab\",\r\n                title: TXID.WEB_NETWORK,\r\n                tabTip: TXID.WEB_NETWORK,\r\n                border: false,\r\n                layout: \"fit\",\r\n                autoScroll: false,\r\n                collapsed: false,\r\n                defaults: {autoscroll: false},\r\n                tbar: [\r\n                  {\r\n                    xtype: 'textfield',\r\n                    flex: 0.8,\r\n                    emptyText: TXID.WEB_SEARCH,\r\n                    enableKeyEvents: true,\r\n                    listeners:\r\n                      {\r\n                        keypress: function(box, e)\r\n                          {\r\n                            if (e.getCharCode() == e.ENTER)\r\n                              {\r\n\r\n                                Ext.getCmp(\"networkTree\").filterTree(box.getValue());\r\n                              }\r\n                          }\r\n                      }\r\n                  }],\r\n                items:\r\n                  {\r\n                    id: \"networkTree\",\r\n                    stateId: \"cookieNetworkTree\",\r\n                    xtype: \"deltadstree\",\r\n                    cls: \"treepanel\",\r\n                    rootVisible: false,\r\n                    multiSelect: true,\r\n                    store:\r\n                    {\r\n                      model: \"NetworkNode\",\r\n                      root:\r\n                        {\r\n                          id: \"root_network\",\r\n                          text: \"root_network\"\r\n                        },\r\n                      proxy:\r\n                        {\r\n                          type: \"memory\"\r\n                        }\r\n                    }\r\n                  }\r\n              };\r\n          }\r\n\r\n        accordion_Navigation =\r\n          {\r\n            id: \"accordion_Navigation\",\r\n            title: TXID.WEB_NAVIGATION,\r\n            items:\r\n              {\r\n                id: \"NavigatorTab\",\r\n                xtype: \"tabpanel\",\r\n                layout: \"fit\",\r\n                border: false,\r\n                autoScroll: false,\r\n                defaults: {autoScroll: false, border: false},\r\n                items: navigatorTabs,\r\n                listeners:\r\n                  {\r\n                    \"tabchange\": function(tabPanel, activePanel)\r\n                      {\r\n                        var activeTab = Ext.getCmp(\"NavigatorTab\").getActiveTab();\r\n                        var navigationMenu = Ext.getCmp(\"menu_Navigation\");\r\n                        if (activeTab.id != \"network_tab\")\r\n                          {\r\n                            navigationMenu.enable();\r\n                          }\r\n                        else\r\n                          {\r\n                            navigationMenu.disable();\r\n                          }\r\n                      }\r\n                  }\r\n              },\r\n            iconCls: \"network_icon\" ,\r\n            bbar: Ext.create(\"Ext.toolbar.Toolbar\",\r\n              {\r\n                id: \"menu_Navigation\",\r\n                stateful: false,\r\n                border: false,\r\n                display: manageSiteRight ? \"show\" : \"hide\",\r\n                defaults: {stateful: false},\r\n                disabled: true,\r\n                items: [\r\n                  \"-\",\r\n                  {\r\n                    text: TXID.WEB_EDIT_VIEW,\r\n                    id: \"menu_NavigationAction\",\r\n                    handler: function()\r\n                      {\r\n                        var activeTab = Ext.getCmp(\"NavigatorTab\").getActiveTab();\r\n                        if (activeTab.id != \"network_tab\")\r\n                          {\r\n                            var viewId = activeTab.id.substr(5);\r\n                            Ext.get(\"mainFrame\").dom.src = (APPLICATION_URL + \"/admin/viewdetail/id/\" + viewId);\r\n                          }\r\n                      }\r\n                  },\r\n                  \"-\"\r\n                ]\r\n              }),\r\n\r\n            listeners:\r\n              {\r\n                afterrender: function()\r\n                  {\r\n                    var networkTree = Ext.getCmp(\"networkTree\");\r\n                    if (networkTree)\r\n                      {\r\n                        networkTree.init();\r\n                        if (!this.collapsed)  // check it is active tab.\r\n                          {\r\n                            networkTree.startLoad();\r\n                          }\r\n                      }\r\n                    for (var i = 0; i < customViews.length; i++)\r\n                      {\r\n                        addSystemTree(customViews[i][\"id\"], customViews[i][\"title\"]);\r\n                      }\r\n                    this.systemLoaded = true;\r\n                  },\r\n                expand: function()\r\n                  {\r\n                    var networkTree = Ext.getCmp(\"networkTree\");\r\n                    if (networkTree)\r\n                      {\r\n                        networkTree.startLoad();\r\n                      }\r\n                    if (!this.systemLoaded)\r\n                      {\r\n                        for (var i = 0; i < customViews.length; i++)\r\n                          {\r\n                            addSystemTree(customViews[i][\"id\"], customViews[i][\"title\"]);\r\n                          }\r\n                        this.systemLoaded = true;\r\n                      }\r\n                  },\r\n                collapse: function()\r\n                  {\r\n                    Ext.getCmp(\"networkTree\").stopReloadingDescriptor();\r\n                    Ext.getCmp(\"networkTree\").stopLoad();\r\n                  }\r\n              }\r\n          };\r\n      }\r\n    var newSearchStr = 0;\r\n    var oldSearchStr = 0;\r\n    if (permission.graphic || manageGraphic)\r\n      {\r\n        enteliWeb.graphicsTree =\r\n          {\r\n            id: \"graphicsTree\",\r\n            stateId: \"cookieGraphicsTree\",\r\n            xtype: \"deltatreepanel\",\r\n            cls: \"treepanel\",\r\n            layout: \"fit\",\r\n            tbar: [\r\n              {\r\n                xtype: 'textfield',\r\n                flex: 0.8,\r\n                emptyText: TXID.WEB_SEARCH,\r\n                enableKeyEvents: true,\r\n                listeners:\r\n                  {\r\n                    keypress: function(box, e)\r\n                      {\r\n                        if (e.getCharCode() == e.ENTER && box.getValue() != '')\r\n                          {\r\n                            // get param\r\n                            var searchStr = box.getValue();\r\n                            var store = Ext.getCmp(\"graphicsTree\").getStore();\r\n                            // load the tree\r\n                            store.load(\r\n                              {\r\n                                params:\r\n                                  {\r\n                                    searchStr: searchStr\r\n                                  }\r\n                              });\r\n                          }\r\n                      },\r\n                    keyup: function(field, e)\r\n                      {\r\n                        // compare old and new search string\r\n                        newSearchStr = (field.getValue()).length;\r\n                        if (newSearchStr < oldSearchStr)\r\n                          {\r\n                            // not considering the Enter key press as it was previously taking care of\r\n                            if (e.getCharCode(field.getValue()) != e.ENTER)\r\n                              {\r\n                                if (field.getValue() == \"\")\r\n                                  {\r\n                                    var searchStr = field.getValue();\r\n                                    var store = Ext.getCmp(\"graphicsTree\").getStore();\r\n                                    // load the tree\r\n                                    store.load(\r\n                                      {\r\n                                        params:\r\n                                          {\r\n                                            searchStr: searchStr\r\n                                          }\r\n                                      });\r\n                                  }\r\n                              }\r\n                          }\r\n                        oldSearchStr = newSearchStr;\r\n                      }\r\n                  }\r\n              }],\r\n            store:\r\n              {\r\n                root:\r\n                  {\r\n                    id: \"graphicstree_root\",\r\n                    text: \"\"\r\n                  },\r\n                proxy:\r\n                  {\r\n                    type: \"ajax\",\r\n                    extraParams: {\"showGpc\": 0},\r\n                    url: APPLICATION_URL + \"/wsgraphics/gettree/\"\r\n                  },\r\n                listeners:\r\n                  {\r\n                    append: function(node, newNode, index, eOpts)\r\n                      {\r\n                        newNode.set(\"text\", Delta.Util.encodeHTML(newNode.get(\"text\")));\r\n                        newNode.set(\"qtip\", Delta.Util.encodeHTML(newNode.get(\"qtip\")));\r\n                      },\r\n                    load: function(store, node, records, success)\r\n                      {\r\n                        enteliWeb.graphicsTree.applyState(enteliWeb.graphicsTree.stateHash);\r\n                        enteliWeb.graphicsTree.hasBeenLoaded = true;\r\n                      }\r\n                  }\r\n              },\r\n            listeners:\r\n              {\r\n                \"itemkeydown\": function()\r\n                  {\r\n                    // reset right click flag in case the flag was set to true from previous right click action\r\n                    isRightClick = false;\r\n                  },\r\n                \"itemcontextmenu\": function(panel, record, item, index, e)\r\n                  {\r\n                    // mark the right click flag to true so that the select listener will not open the\r\n                    // object list page when the node is right click\r\n                    isRightClick = true;\r\n                  },\r\n                \"select\": function(selection, record, index, eOpts)\r\n                  {\r\n                    var myUrl = record.get(\"href\");\r\n                    if (myUrl && !(isRightClick))\r\n                      {\r\n                        enteliWeb.graphicsTree.setGraphicsURL(myUrl);\r\n                      }\r\n                    isRightClick = true;\r\n                  },\r\n                \"itemclick\": function(view, record, item, index, e, eOpts)\r\n                  {\r\n                    e.preventDefault(); // disable anchor tag; needed! don't remove\r\n                    // need the following when click on already selected node (in case content in mainFrame has changed)\r\n                    var myUrl = record.get(\"href\");\r\n                    if (myUrl && (isRightClick))\r\n                      {\r\n                        enteliWeb.graphicsTree.setGraphicsURL(myUrl);\r\n                      }\r\n                  }\r\n              },\r\n            // Set the graphics url of the mainFrame\r\n            // Special handling for enteliVIZ2 and enteliVIZ5. Not refresh with new URL but reload the graphics content.\r\n            setGraphicsURL: function(url)\r\n              {\r\n                var dg, dg5;\r\n                try\r\n                  {\r\n                    dg = Ext.get(\"mainFrame\").dom.contentDocument.getElementById(\"dglux\");\r\n                  }\r\n                catch(err)\r\n                  {\r\n                    // EWEB-10754: access denied due to same-origin policy\r\n                  }\r\n                try\r\n                  {\r\n                    dg5 = Ext.get(\"mainFrame\").dom.contentDocument.getElementById(\"defaultproj\");\r\n                  }\r\n                catch(err)\r\n                  {\r\n                  }\r\n\r\n                if (dg != null && url.indexOf(\"entelivizview\") > 0)\r\n                  dg.updateDGML(decodeURIComponent(url.substr(url.indexOf(\"=\") + 1)));\r\n                else if (dg5 !=null && url.indexOf(\"enteliviz5\")>0) \r\n                  {\r\n                    var mainWindow = dg5.ownerDocument.defaultView;\r\n                    var graphicsName = decodeURIComponent(url.substr(url.indexOf(\"=\") + 1));\r\n\r\n                    // EWEB-17736: Workaround to compare previous project with current project if they are\r\n                    // different then refresh the page.\r\n                    // IMPORTANT: Need to remove check once we get proper fix from DGLogik\r\n\r\n                    var urlSplit = graphicsName.split('&');\r\n                    graphicsName = \"lib/\" + graphicsName.replace(\"&path=\", \"/\");\r\n                    var currentProj = urlSplit[0];\r\n                    var previousProj = dg5.value;\r\n\r\n                    if (previousProj == currentProj)\r\n                      {\r\n                        mainWindow.updateDG5(graphicsName);\r\n                      }\r\n                    else\r\n                      {\r\n                        Ext.get(\"mainFrame\").dom.src = url;\r\n                      }\r\n                  }\r\n                else\r\n                  Ext.get(\"mainFrame\").dom.src = url;\r\n              },\r\n            // Delta custom properties; adds support to allow child pages from within the mainframe to refresh the tree.\r\n            hasBeenLoaded: false,\r\n            manuallyReloadTree: function(newChildren)\r\n              {\r\n                if (enteliWeb.graphicsTree.hasBeenLoaded)\r\n                  {\r\n                    enteliWeb.graphicsTree.getStore().load();\r\n                  }\r\n              }\r\n          };\r\n\r\n        accordion_Graphics =\r\n          {\r\n            id: \"accordion_Graphics\",\r\n            title: TXID.WEB_GRAPHICS,\r\n            iconCls: \"graphic_icon\" ,\r\n            listeners:\r\n              {\r\n                afterrender: function()\r\n                  {\r\n                    if (!this.collapsed)  // check it is active tab.\r\n                      {\r\n                        enteliWeb.graphicsTree = this.add(enteliWeb.graphicsTree);\r\n                      }\r\n                  },\r\n                expand: function()\r\n                  {\r\n                    if (!(enteliWeb.graphicsTree instanceof Delta.UI.Tree))\r\n                      {\r\n                        enteliWeb.graphicsTree = this.add(enteliWeb.graphicsTree);\r\n                      }\r\n                  }\r\n              }\r\n                    };\r\n      }\r\n\r\n    if (permission.alarm)\r\n      {\r\n        enteliWeb.alarmTree =\r\n          {\r\n            id: \"alarmTree\",\r\n            stateId: \"cookieAlarmTree\",\r\n            xtype: \"deltatreepanel\",\r\n            cls: \"treepanel\",\r\n            layout: \"fit\",\r\n            store:\r\n              {\r\n                storeId: \"alarmTreeStore\",\r\n                root:\r\n                  {\r\n                    id: \"alarmtree_root\",\r\n                    text: \"\"\r\n                  },\r\n                proxy:\r\n                  {\r\n                    type: \"ajax\",\r\n                    url: APPLICATION_URL + \"/wsalarm/gettree/\"\r\n                  },\r\n                listeners:\r\n                  {\r\n                    append: function(obj, node, option)\r\n                      {\r\n                        var text = Delta.Util.encodeHTML(node.get(\"text\"));\r\n                        var dbQuery;\r\n\r\n                        var siteName = node.raw.site;\r\n                        var system = node.raw.parameter ? node.raw.parameter.system : null;\r\n                        var alert = node.raw.alert;\r\n                        var module = node.raw.module;\r\n                        var title = node.raw.text;\r\n\r\n                        if (siteName)\r\n                          {\r\n                            dbQuery = {\"site\": siteName};\r\n                          }\r\n                        else if (system)\r\n                          {\r\n                            dbQuery = {\"system\": system};\r\n                          }\r\n                        else if (alert)\r\n                          {\r\n                            dbQuery = {\"alert\": alert};\r\n                          }\r\n                        else if (module)\r\n                          {\r\n                            dbQuery = {\"alert\": module};\r\n                          }\r\n                        node.set(\"text\", text);\r\n                        node.set(\"qtip\", text);\r\n                        node.set(\"dbQuery\", dbQuery);\r\n                        node.set(\"filterQuery\", null);\r\n\r\n                        if (!Ext.isEmpty(dbQuery))\r\n                          {\r\n                             node.set(\"href\", enteliWeb.alarmTree.getUrl(title, dbQuery, null));\r\n                             node.set(\"hrefTarget\", \"mainFrame\");\r\n                          }\r\n\r\n                        if ((node.raw) && (!Ext.isEmpty(node.raw.system)))\r\n                          {\r\n                            node.set(\"icon\", APPLICATION_URL + \"/images/alarmlist_16.png\");\r\n                          }\r\n                      }\r\n                  }\r\n              },\r\n            getUrl: function(title, dbQuery, filterQuery)\r\n              {\r\n                return  APPLICATION_URL + \"/alarm/display/title/\" + Delta.Util.encodeURI(title) + \"/dbQuery/\" +\r\n                        Delta.Util.encodeURI(Ext.encode(dbQuery)) +  \"/filterQuery/\" +\r\n                        Delta.Util.encodeURI(Ext.encode(filterQuery));\r\n              },\r\n            openAlarmPage: function(title, dbQuery, filterQuery)\r\n              {\r\n                var mainFrame = document.getElementById(\"mainFrame\");\r\n                var iWin = mainFrame.contentWindow; // iframe window object\r\n                var iWinUrl, isSameOrigin = true;\r\n\r\n                try\r\n                  {\r\n                    iWinUrl = iWin.location.href;\r\n                  }\r\n                catch(err)\r\n                  {\r\n                    // EWEB-10754: access denied due to same-origin policy\r\n                    iWinUrl = $(\"#mainFrame\").attr(\"src\");\r\n                    isSameOrigin = false;\r\n                  }\r\n\r\n                if (isSameOrigin && (iWinUrl != \"undefined\") &&\r\n                    (iWin.MyApp) && (iWinUrl.indexOf(\"/alarm/display/\") > 0))\r\n                  {\r\n                    iWin.MyApp.refreshPage(dbQuery, filterQuery, title);\r\n                  }\r\n                else\r\n                  {\r\n                    // EWEB-9557: open the page in the main tab because it doesn't render properly inside iframe\r\n                                          mainFrame.src = enteliWeb.alarmTree.getUrl(title, dbQuery, filterQuery);\r\n                                      }\r\n              },\r\n            listeners:\r\n              {\r\n                \"itemkeydown\": function()\r\n                  {\r\n                    // reset right click flag in case the flag was set to true from previous right click action\r\n                    isRightClick = false;\r\n                  },\r\n                \"itemcontextmenu\": function(panel, record, item, index, e)\r\n                  {\r\n                    // mark the right click flag to true so that the select listener will not open the object list\r\n                    // page when the node is right click\r\n                    isRightClick = true;\r\n                  },\r\n                \"select\": function(selection, record, index, eOpts)\r\n                  {\r\n                    var dbQuery = record.get(\"dbQuery\");\r\n                    var title = Ext.String.htmlDecode(record.get(\"text\"));\r\n\r\n                    if (dbQuery  && !(isRightClick))\r\n                      {\r\n                        this.openAlarmPage(title, dbQuery, null);\r\n                      }\r\n                    isRightClick = true;\r\n                  },\r\n                \"itemclick\": function(view, record, item, index, e, eOpts)\r\n                  {\r\n                    e.preventDefault();\r\n\r\n                    var dbQuery = record.get(\"dbQuery\");\r\n                    var title = Ext.String.htmlDecode(record.get(\"text\"));\r\n\r\n                    if (dbQuery && (isRightClick))\r\n                      {\r\n                        this.openAlarmPage(title, dbQuery, null);\r\n                      }\r\n                  }\r\n              }\r\n          };\r\n\r\n        accordion_Alarms =\r\n          {\r\n            id: \"accordion_Alarms\",\r\n            title: TXID.WEB_ALARMS,\r\n            iconCls: \"alarm_icon\",\r\n            listeners:\r\n              {\r\n                afterrender: function()\r\n                  {\r\n                    if (!this.collapsed)  // check it is active tab.\r\n                      {\r\n                        enteliWeb.alarmTree = this.add(enteliWeb.alarmTree);\r\n                      }\r\n                  },\r\n                expand: function()\r\n                  {\r\n                    if (!(enteliWeb.alarmTree instanceof Delta.UI.Tree))\r\n                      {\r\n                        enteliWeb.alarmTree = this.add(enteliWeb.alarmTree);\r\n                      }\r\n                  }\r\n              }\r\n          };\r\n      }\r\n\r\n    if (permission.report)\r\n      {\r\n                  enteliWeb.reportTree =\r\n            {\r\n              id: \"reportTree\",\r\n              stateId: \"cookieReportTree\",\r\n              xtype: \"deltatreepanel\",\r\n              cls: \"treepanel\",\r\n              stateful: true,\r\n              autoScroll: false,\r\n              store:\r\n                {\r\n                  root:\r\n                    {\r\n                      id: \"reporttree_root\",\r\n                      text: \"\"\r\n                    },\r\n                  proxy:\r\n                    {\r\n                      type: \"ajax\",\r\n                      url: APPLICATION_URL + \"/wsreport/gettree/\"\r\n                    },\r\n                  sorters: [\r\n                    {\r\n                      property: 'text' ,\r\n                      transform: function(val)\r\n                        {\r\n                          return val.toLowerCase();\r\n                        }\r\n                    }],\r\n                  listeners:\r\n                    {\r\n                      append: function(node, newNode, index, eOpts)\r\n                        {\r\n                          var encodedText = Delta.Util.encodeHTML(newNode.get(\"text\"));\r\n                          newNode.set(\"text\", encodedText);\r\n                          newNode.set(\"qtip\", encodedText);\r\n                        }\r\n                    }\r\n                },\r\n              listeners:\r\n                {\r\n                  \"itemkeydown\": function()\r\n                    {\r\n                      // reset right click flag in case the flag was set to true from previous right click action\r\n                      isRightClick = false;\r\n                    },\r\n                  \"itemcontextmenu\": function(panel, record, item, index, e)\r\n                    {\r\n                      // mark the right click flag to true so that the select listener will not open the object\r\n                      // list page when the node is right click\r\n                      isRightClick = true;\r\n                    },\r\n                  \"select\": function(selection, record, index, eOpts)\r\n                    {\r\n                      var myUrl = record.get(\"href\");\r\n                      if (myUrl && !(isRightClick))\r\n                        {\r\n                          // EWEB-9557: open the page in the main tab because it doesn't render properly inside iframe\r\n                                                      Ext.get(\"mainFrame\").dom.src = (myUrl);\r\n                                                  }\r\n                      isRightClick = true;\r\n                    },\r\n                  \"itemclick\": function(view, record, item, index, e, eOpts)\r\n                    {\r\n                      var myUrl = record.get(\"href\");\r\n                      e.preventDefault(); // disable anchor tag\r\n                      if (myUrl && (isRightClick))\r\n                        {\r\n                          // EWEB-9557: open the page in the main tab because it doesn't render properly inside iframe\r\n                                                      Ext.get(\"mainFrame\").dom.src = (myUrl);\r\n                                                  }\r\n                    }\r\n                }\r\n            };\r\n\r\n          accordion_Reports =\r\n            {\r\n              id: \"accordion_Reports\",\r\n              title: TXID.WEB_REPORTS,\r\n              iconCls: \"report_icon\" ,\r\n              sorters: new Ext.util.Sorter({property: 'text', direction: 'ASC'}),\r\n              sortOnLoad: true,\r\n              listeners:\r\n                {\r\n                  afterrender: function()\r\n                    {\r\n                      if (!this.collapsed)  // check it is active tab.\r\n                        {\r\n                          enteliWeb.reportTree = this.add(enteliWeb.reportTree);\r\n                        }\r\n                    },\r\n                  expand: function()\r\n                    {\r\n                      if (!(enteliWeb.reportTree instanceof Delta.UI.Tree))\r\n                        {\r\n                          enteliWeb.reportTree = this.add(enteliWeb.reportTree);\r\n                        }\r\n                    }\r\n                }\r\n            };\r\n              }\r\n\r\n    if (permission.energy)\r\n      {\r\n                  enteliWeb.energyTree =\r\n            {\r\n              id: \"energyTree\",\r\n              stateId: \"cookieEnergyTree\",\r\n              xtype: \"deltatreepanel\",\r\n              cls: \"treepanel\",\r\n\r\n              rootVisible: \"false\",\r\n              store:\r\n                {\r\n                  root:\r\n                    {\r\n                      id: \"00000000-0000-0000-0000-000000000000\"\r\n                    },\r\n                  nodeParam: \"id\",\r\n                  folderSort: false,\r\n                  proxy:\r\n                    {\r\n                      type: \"ajax\",\r\n                      url: APPLICATION_URL + \"/wsmeterdata/gettree\",\r\n                      reader: {type: \"json\"} ,\r\n                      extraParams:\r\n                        {\r\n                          includedatapoints: '0',\r\n                          includefulllist: '0'\r\n                        }\r\n                    },\r\n                  listeners:\r\n                    {\r\n                      append: function(node, newNode, index, eOpts)\r\n                        {\r\n                          if (newNode.isRoot())\r\n                            {\r\n                               newNode.set(\"text\", TXID.WEB_PORTFOLIO);\r\n                               newNode.set(\"iconCls\", \"report-tree portfolio\");\r\n                            }\r\n                          var encodedText = Delta.Util.encodeHTML(newNode.get(\"text\"));\r\n                          newNode.set(\"text\", encodedText);\r\n                          newNode.set(\"qtip\", encodedText);\r\n                          newNode.set(\"href\", APPLICATION_URL + '/energy/index/instance/' + newNode.get(\"id\"));\r\n                          newNode.set(\"hrefTarget\", \"mainFrame\");\r\n                        }\r\n                    }\r\n                },\r\n              listeners:\r\n                {\r\n                  \"itemkeydown\": function()\r\n                    {\r\n                      // reset right click flag in case the flag was set to true from previous right click action\r\n                      isRightClick = false;\r\n                    },\r\n                  \"itemcontextmenu\": function(panel, record, item, index, e)\r\n                    {\r\n                      // mark the right click flag to true so that the select listener will not open the object list\r\n                      // page when the node is right click\r\n                      isRightClick = true;\r\n                    },\r\n                  \"select\": function(selection, record, index, eOpts)\r\n                    {\r\n                      if (record.get(\"id\") && !(isRightClick))\r\n                        {\r\n                          var frame = window.frames['mainFrame'];\r\n                          try\r\n                            {\r\n                              frame.setEnergyViewParams({instance: record.get(\"id\")});\r\n                            }\r\n                          catch(err)\r\n                            {\r\n                              Ext.get('mainFrame').dom.src =\r\n                                  APPLICATION_URL + '/energy/index/instance/' + record.get(\"id\");\r\n                            }\r\n                        }\r\n                      isRightClick = true;\r\n                    },\r\n                  \"itemclick\": function(view, record, item, index, e, eOpts)\r\n                    {\r\n                      e.preventDefault();  // disable anchor tag\r\n                      if (record.get(\"id\") && (isRightClick))\r\n                        {\r\n                          var frame = window.frames['mainFrame'];\r\n                          try\r\n                            {\r\n                              frame.setEnergyViewParams({instance: record.get(\"id\")});\r\n                            }\r\n                          catch(err)\r\n                            {\r\n                              Ext.get('mainFrame').dom.src =\r\n                                  APPLICATION_URL + '/energy/index/instance/' + record.get(\"id\");\r\n                            }\r\n                         }\r\n                    }\r\n                }\r\n            };\r\n\r\n          accordion_EnergyView =\r\n            {\r\n              id: \"accordion_EnergyView\",\r\n              title: TXID.WEB_ENERGY,\r\n              initialized: false,\r\n              iconCls: \"energy_icon\",\r\n              listeners:\r\n                {\r\n                  afterrender: function()\r\n                    {\r\n                      if (!this.collapsed)  // check it is active tab.\r\n                        {\r\n                          enteliWeb.energyTree = this.add(enteliWeb.energyTree);\r\n                        }\r\n                    },\r\n                  expand: function()\r\n                    {\r\n                      if (!(enteliWeb.energyTree instanceof Delta.UI.Tree))\r\n                        {\r\n                          enteliWeb.energyTree = this.add(enteliWeb.energyTree);\r\n                        }\r\n                    }\r\n                }\r\n            };\r\n              }\r\n\r\n    if (permission.log)\r\n      {\r\n        enteliWeb.logTree =\r\n          {\r\n            id: \"logTree\",\r\n            stateId: \"cookieLogTree\",\r\n            xtype: \"deltatreepanel\",\r\n            cls: \"treepanel\",\r\n            autoScroll: false,\r\n            rootVisible: false,\r\n            viewConfig: {loadMask: false},\r\n            store:\r\n              {\r\n                autoLoad: true,\r\n                root:\r\n                  {\r\n                    children: [\r\n                      {\r\n                        \"id\": \"logtree_root\",\r\n                        \"text\": \"Log\",\r\n                        \"qtip\": \"Log\"                      },\r\n                      {\r\n                        \"id\": \"logtree_archive\",\r\n                        \"text\": \"Archive\",\r\n                        \"qtip\": \"Archive\",\r\n                        \"leaf\": true\r\n                      }]\r\n                  },\r\n                proxy:\r\n                  {\r\n                    type: \"ajax\",\r\n                    url: APPLICATION_URL + \"/wslog/gettree\"\r\n                  },\r\n                listeners:\r\n                  {\r\n                    beforeappend: function(node, newNode, index, eOpts)\r\n                      {\r\n                        if (newNode.raw)\r\n                          {\r\n                            if (newNode.get(\"text\") == \"Archive\")\r\n                              {\r\n                                newNode.set(\"href\", APPLICATION_URL + '/log/display/?' +\r\n                                              Ext.Object.toQueryString(\r\n                                                  {\r\n                                                    \"title\": newNode.get(\"text\"),\r\n                                                    'dbQuery': newNode.raw.dbQuery,\r\n                                                    'isArchive': 1\r\n                                                  }\r\n                                              ));\r\n                                newNode.set(\"icon\", APPLICATION_URL + '/images/archive_file_16.png');\r\n                              }\r\n                            else\r\n                              {\r\n                                newNode.set(\"href\", APPLICATION_URL + '/log/display/?' +\r\n                                              Ext.Object.toQueryString(\r\n                                                  {\"title\": newNode.get(\"text\"), 'dbQuery': newNode.raw.dbQuery}\r\n                                              ));\r\n                                newNode.set(\"icon\", APPLICATION_URL + '/images/log_file_16.png');\r\n                              }\r\n                          }\r\n                        var encodedText = Delta.Util.encodeHTML(newNode.get(\"text\"));\r\n                        newNode.set(\"hrefTarget\", \"mainFrame\");\r\n                        newNode.set(\"text\", encodedText);\r\n                     }\r\n                  }\r\n              },\r\n            listeners:\r\n              {\r\n                \"itemkeydown\": function()\r\n                  {\r\n                    // reset right click flag in case the flag was set to true from previous right click action\r\n                    isRightClick = false;\r\n                  },\r\n                \"itemcontextmenu\": function(panel, record, item, index, e)\r\n                  {\r\n                    // mark the right click flag to true so that the select listener will not open the object\r\n                    // list page when the node is right click\r\n                    isRightClick = true;\r\n                  },\r\n                \"select\": function(selection, record, index, eOpts)\r\n                  {\r\n                    var myUrl = record.get(\"href\");\r\n                    if (myUrl && !(isRightClick))\r\n                      {\r\n                        Ext.get(\"mainFrame\").dom.src = (myUrl);\r\n                      }\r\n                    if (index != 0 && record.data.id != \"logtree_archive\")\r\n                      {\r\n                        Ext.getCmp(\"menu_DeleteSelectedLog\").enable();\r\n                      }\r\n                    else\r\n                      {\r\n                        Ext.getCmp(\"menu_DeleteSelectedLog\").disable();\r\n                      }\r\n                    isRightClick = true;\r\n                  },\r\n                \"itemclick\": function(view, record, item, index, e, eOpts)\r\n                  {\r\n                    var myUrl = record.get(\"href\");\r\n                    e.preventDefault(); // disable anchor tag\r\n                    if (myUrl && (isRightClick))\r\n                      {\r\n                        Ext.get(\"mainFrame\").dom.src = (myUrl);\r\n                      }\r\n                  }\r\n              }\r\n          };\r\n\r\n        accordion_Log =\r\n          {\r\n            id: \"accordion_Log\",\r\n            title: TXID.WEB_LOGS,\r\n            iconCls: \"log_icon\",\r\n            listeners:\r\n              {\r\n                afterrender: function()\r\n                  {\r\n                    if (!this.collapsed)  // check it is active tab.\r\n                      {\r\n                        enteliWeb.logTree = this.add(enteliWeb.logTree);\r\n                        if (1 == 1)\r\n                          {\r\n                            enteliWeb.logTree.getView().node.childNodes[1].remove();\r\n                          }\r\n                      }\r\n                  },\r\n                expand: function()\r\n                  {\r\n                    if (!(enteliWeb.logTree instanceof Delta.UI.Tree))\r\n                      {\r\n                        enteliWeb.logTree = this.add(enteliWeb.logTree);\r\n                        if (1 == 1)\r\n                          {\r\n                            enteliWeb.logTree.getView().node.childNodes[1].remove();\r\n                          }\r\n                      }\r\n                  }\r\n              },\r\n            bbar: Ext.create(\"Ext.toolbar.Toolbar\",\r\n              {\r\n                id: \"menu_Log\",\r\n                stateful: false,\r\n                items: [\r\n                  \"-\",\r\n                  {\r\n                    stateful: false,\r\n                    id: \"menu_DeleteSelectedLog\",\r\n                    text: TXID.WEB_DELETE,\r\n                    disabled: true,\r\n                    handler: function()\r\n                      {\r\n                        // get selected node\r\n                        try\r\n                          {\r\n                            var tree = Ext.getCmp(\"logTree\");\r\n                            if (tree)\r\n                              {\r\n                                var selectedNode = tree.getSelectionModel().selected.first();\r\n\r\n                                if (!(selectedNode)) {return;}\r\n\r\n                                if (selectedNode.getId() != \"logAll\" && selectedNode.getId() != \"logtree_archive\")\r\n                                  {\r\n                                    var url = APPLICATION_URL + \"/wslog/removefilter\";\r\n                                    $.post(url, \"&id=\" + selectedNode.getId(), function(data)\r\n                                      {\r\n                                        selectedNode.remove();\r\n                                      });\r\n                                  }\r\n                              }\r\n                             this.disable();\r\n                          }\r\n                        catch(err)\r\n                          {}\r\n                      }\r\n                  },\r\n                  \"-\"\r\n                ]\r\n              })\r\n          };\r\n      }\r\n\r\n    Ext.create(\"Ext.container.Viewport\",\r\n      {\r\n        layout: \"border\",\r\n        margin: \"0 0 0 0\",\r\n        defaults: {border: false, header: false},\r\n        items: [\r\n          {\r\n            id: \"northPanel\",\r\n            region: \"north\",\r\n            contentEl: \"index_header\",\r\n            height: 48,\r\n            margins: \"0 0 0 0\" ,\r\n            hidden: isFullScreen\r\n          },\r\n          {\r\n            id: \"westPanel\",\r\n            region: \"west\",\r\n            hidden: isFullScreen,\r\n            collapsible: true,\r\n            collapseMode: 'mini',\r\n            split: true,\r\n            border: true,\r\n            stateful: true,\r\n            layout: \"accordion\",\r\n            width: 250,\r\n            defaults:\r\n              {\r\n                border: false,\r\n                stateful: true,\r\n                margins: \"0 0 1 0\",\r\n                xtype: \"panel\",\r\n                cls: \"accordion-content\",\r\n                hideCollapseTool: true,\r\n                autoScroll: false,\r\n                layout: \"fit\"\r\n              },\r\n            items: [\r\n              accordion_Dashboard,\r\n              accordion_Navigation,\r\n              accordion_Graphics,\r\n              accordion_Alarms,\r\n              accordion_Reports,\r\n              accordion_EnergyView,\r\n              accordion_Log\r\n                                                , \r\n                                          ],\r\n            listeners:\r\n              {\r\n                \"resize\": function()\r\n                  {\r\n                                          Delta.NotificationBar.resize(); // pass it along!\r\n                                      }\r\n              }\r\n          },\r\n          {\r\n            id: \"centerPanel\",\r\n            region: \"center\",     // center region is required, no width/height specified\r\n            margins: \"0 0 0 0\",\r\n            layout: \"border\",\r\n            autoScroll: false,\r\n            items: [\r\n              {\r\n                region: \"center\",\r\n                id: \"center_mainFrame\",\r\n                autoScroll: false,\r\n                layout: \"fit\",\r\n                border: true,\r\n                items:\r\n                  {\r\n                    id: \"mainFramePanel\",\r\n                    html: '<iframe id=\"mainFrame\" name=\"mainFrame\" scrolling=\"auto\" style=\"border:0\" src=\"\"></iframe>',\r\n                    frameborder: \"0\",\r\n                    autoMask: false,\r\n                    border: false\r\n                  }\r\n              },\r\n                          ,\r\n              {\r\n                split: true,\r\n                id: \"center_alarmNotification\",\r\n                region: \"south\",\r\n                height: 200,\r\n                minHeight: 50,         // Defaults to 50\r\n                hidden: true,\r\n                hideMode: \"offsets\",\r\n                contentEl: \"pinnedNotification_div\",\r\n                border: true\r\n              }\r\n                        ]\r\n          },\r\n          {\r\n            id: \"eastPanel\",\r\n            region: \"east\",\r\n            hidden: isFullScreen\r\n          },\r\n          {\r\n            id: \"southPanel\",\r\n            region: \"south\",     // position for region\r\n            height: 21,\r\n            split: false,\r\n            html: '<div id=\"index_footer\"><span id=\"copyright_statement\">&#169; 2016 Delta Controls Inc. ' +\r\n                  '</span><span id=\"label_version\">' + TXID.WEB_VERSION + ' 4.1.738</span></div>',\r\n            margins: \"2 0 0 5\",\r\n            hidden: isFullScreen\r\n          }],\r\n        listeners:\r\n          {\r\n            \"afterrender\": function()\r\n              {\r\n                document.getElementById(\"mainFrame\").src = \"\\/enteliweb\\/dashboard\\/display\\/dashboard\\/a0b1c89e-b6c1-11e4-8e4a-005056a56544\";\r\n              }\r\n          }\r\n      });\r\n\r\n\r\n          // Wait 10 seconds to get notifications (avoid massive request blast).\r\n      setTimeout(function()\r\n        {\r\n          Delta.NotificationBar.init(alarmNotification, encodedUN);\r\n        }, 10000);\r\n    \r\n\r\n    var adminLinkObj = $(\".admin_link\");\r\n    adminLinkObj.hover(\r\n      function()\r\n        {\r\n          $(this).addClass(\"link_mouseover\");\r\n          $(\".admin_link_image\").attr(\"src\", APPLICATION_URL + '/images/settings_inverted_16.png');\r\n        },\r\n      function()\r\n        {\r\n          $(this).removeClass(\"link_mouseover\");\r\n          $(\".admin_link_image\").attr(\"src\", APPLICATION_URL + '/images/gear_16.png');\r\n        }\r\n    );\r\n\r\n    adminLinkObj.click(function()\r\n      {\r\n        top.frames[\"mainFrame\"].location = APPLICATION_URL + '/admin/main';\r\n      });\r\n\r\n    var moduleLinkObj = $(\".module_link\");\r\n    moduleLinkObj.hover(\r\n      function()\r\n        {\r\n          $(this).addClass(\"link_mouseover\");\r\n          $(\".module_link_image\").attr(\"src\", APPLICATION_URL + '/images/module_inverted_16.png');\r\n        },\r\n      function()\r\n        {\r\n          $(this).removeClass(\"link_mouseover\");\r\n          $(\".module_link_image\").attr(\"src\", APPLICATION_URL + '/images/module_in_header_16.png');\r\n        }\r\n    );\r\n\r\n    moduleLinkObj.click(function(){\r\n      top.frames[\"mainFrame\"].location = APPLICATION_URL + '/admin/moduleindex';\r\n    });\r\n\r\n    var energyLinkObj = $(\".energy_link\");\r\n    energyLinkObj.hover(\r\n      function()\r\n        {\r\n          $(this).addClass(\"link_mouseover\");\r\n          $(\".energy_link_image\").attr(\"src\", APPLICATION_URL + '/images/energy_inverted_16.png');\r\n        },\r\n      function()\r\n        {\r\n          $(this).removeClass(\"link_mouseover\");\r\n          $(\".energy_link_image\").attr(\"src\", APPLICATION_URL + '/images/energy_16.png');\r\n        }\r\n    );\r\n\r\n    energyLinkObj.click(function()\r\n      {\r\n        top.frames[\"mainFrame\"].location = APPLICATION_URL + '/tablet/energy';\r\n      });\r\n\r\n    var phoneLinkObj = $(\".phone_link\");\r\n    phoneLinkObj.hover(\r\n      function()\r\n        {\r\n          $(this).addClass(\"link_mouseover\");\r\n          $(\".phone_link_image\").attr(\"src\", APPLICATION_URL + '/images/mobile_inverted_16.png');\r\n        },\r\n      function()\r\n        {\r\n          $(this).removeClass(\"link_mouseover\");\r\n          $(\".phone_link_image\").attr(\"src\", APPLICATION_URL + '/images/mobile_16.png');\r\n        }\r\n    );\r\n\r\n    phoneLinkObj.click(function()\r\n      {\r\n        top.frames[\"mainFrame\"].location = APPLICATION_URL + '/phone/index?isPhone=true';\r\n      });\r\n\r\n    var helpLinkObj = $(\".help_link\");\r\n    helpLinkObj.hover(\r\n      function()\r\n        {\r\n          $(this).addClass(\"help_link_mouseover\");\r\n          $(\".help_link_image\").attr(\"src\", APPLICATION_URL + '/images/help_inverted_16.png');\r\n        },\r\n      function()\r\n        {\r\n          $(this).removeClass(\"help_link_mouseover\");\r\n          $(\".help_link_image\").attr(\"src\", APPLICATION_URL + '/images/help_24.png');\r\n        }\r\n    );\r\n\r\n    helpLinkObj.click(function()\r\n      {\r\n        openHelpWindow();\r\n      });\r\n\r\n  });\r\n\r\nfunction addSystemTree(viewId, viewTitle)\r\n  {\r\n    var tabObj = buildSystemTab(viewId, viewTitle);\r\n    var NavigatorTab = Ext.getCmp(\"NavigatorTab\");\r\n    NavigatorTab.add(tabObj);\r\n\r\n    function buildSystemTab(viewId, viewTitle)\r\n    {\r\n      var encodedViewTitle = Ext.util.Format.htmlEncode(viewTitle);\r\n      return  {\r\n          id: \"view_\" + viewId,\r\n          title: encodedViewTitle,\r\n          tabTip: encodedViewTitle,\r\n          layout: \"fit\",\r\n          items: [\r\n            {\r\n              xtype: \"deltatreepanel\",\r\n              id: \"tree_\" + viewId,\r\n              stateId: \"systemtree_\" + viewId + \"SystemCookie\",\r\n              cls: \"treepanel\",\r\n              layout: \"fit\",\r\n              store: Ext.create(\"Ext.data.TreeStore\",\r\n                {\r\n                  proxy:\r\n                    {\r\n                      type: \"ajax\",\r\n/*******need a new call which returns the system_group::getTree based on viewID ****************/\r\n                      url: APPLICATION_URL + \"/wssystem/getview/viewid/\" + viewId +\r\n                           \"/showsystemdetail/0/showdashboarddetail/0\"\r\n                    },\r\n                  listeners:\r\n                    {\r\n                      append: function(node, newNode, index, eOpts)\r\n                        {\r\n                          if (!newNode.isRoot())\r\n                            {\r\n                              var record;\r\n                              var Template = \"\";\r\n                              var system = newNode.raw.system;  // there gotta be better way to retrieve this.\r\n                              var dashboard = newNode.raw.dashboard;\r\n                              newNode.set(\"text\", Ext.util.Format.htmlEncode(newNode.get(\"text\")));\r\n                              if (system)\r\n                                {\r\n                                  record = Ext.getStore(\"systemlist\").findRecord(\"ID\", system);\r\n\r\n                                  if (record)\r\n                                    {\r\n                                      Template = record.get(\"Template\");\r\n                                    }\r\n                                }\r\n\r\n                              if (!((Ext.isEmpty(system)) && (Ext.isEmpty(dashboard))))\r\n                                {\r\n                                  newNode.set(\"icon\", Delta.UI.getSystemIconPath(Template, \"16\"));\r\n                                }\r\n\r\n                               // Use the model\"s profile url as the icon for each tree item\r\n\r\n                              if (dashboard)\r\n                                {\r\n                                  newNode.set(\"href\", APPLICATION_URL + \"/view/display/nodeid/\" + newNode.get(\"id\"));\r\n                                  newNode.set(\"hrefTarget\", \"mainFrame\");\r\n                                }\r\n                            }\r\n                        }\r\n                    }\r\n                }),\r\n              listeners:\r\n                {\r\n                  \"itemkeydown\": function()\r\n                    {\r\n                      // reset right click flag in case the flag was set to true from previous right click action\r\n                      isRightClick = false;\r\n                    },\r\n                  \"itemcontextmenu\": function(panel, record, item, index, e)\r\n                    {\r\n                      // mark the right click flag to true so that the select listener\r\n                      // will not open the object list page when the node is right click\r\n                      isRightClick = true;\r\n                    },\r\n                  \"select\": function(selection, record, index, eOpts)\r\n                    {\r\n                      var myUrl = record.get(\"href\");\r\n                      if (myUrl && !(isRightClick))\r\n                        {\r\n                          Ext.get(\"mainFrame\").dom.src = (myUrl);\r\n                        }\r\n                      isRightClick = true;\r\n                    },\r\n                  \"itemclick\": function(view, record, item, index, e, eOpts)\r\n                    {\r\n                      var myUrl = record.get(\"href\");\r\n                      e.preventDefault(); // disable anchor tag\r\n                      if (myUrl && (isRightClick))\r\n                        {\r\n                          Ext.get(\"mainFrame\").dom.src = (myUrl);\r\n                        }\r\n                    }\r\n                }\r\n            }]\r\n        }\r\n    }\r\n  }\r\n\r\nfunction refreshReport(type, name)\r\n  {\r\n    var reportTree = Ext.getCmp(\"reportTree\");\r\n    $.ajax(\r\n      {\r\n        type: \"GET\",\r\n        url: APPLICATION_URL + \"/wsreport/gettree/type/\" + type,\r\n        dataType: \"json\",\r\n        complete: function(data)\r\n          {\r\n            var result = Ext.decode(data.responseText);\r\n            var reportTreeStore = reportTree.getStore();\r\n\r\n            for (var j = 0; j < result.length; j++)\r\n              {\r\n                // if report design node doesn't exist\r\n                if (reportTreeStore.getNodeById(result[j].id) == undefined)\r\n                  {\r\n                    // add new report node under report design node\r\n                    var designNode = reportTreeStore.getNodeById(type);\r\n                    designNode.set(\"leaf\", false);\r\n                    designNode.set(\"expanded\", true);\r\n                    designNode.appendChild(result[j]);\r\n                  }\r\n                else\r\n                  {\r\n                    // check saved report name change\r\n                    var childNode = reportTreeStore.getNodeById(result[j].id);\r\n                    var safeText = Delta.Util.encodeHTML(result[j].text);\r\n                    if (childNode.get(\"text\") != safeText)\r\n                      {\r\n                        childNode.set(\"text\", safeText);\r\n                      }\r\n                  }\r\n              }\r\n\r\n            var removeList = [];\r\n            // check report design nodes for deletion\r\n            reportTree.getRootNode().eachChild(function(rd)\r\n              {\r\n                if (rd.get('id') == type)\r\n                  {\r\n                    // check saved report nodes for deletion\r\n                    if (rd.hasChildNodes())\r\n                      {\r\n                         rd.eachChild(function(r)\r\n                           {\r\n                             var removeNode = true;\r\n                             for (var j = 0; j < result.length; j++)\r\n                               {\r\n                                  if (r.getId() == result[j].id)\r\n                                    {\r\n                                       removeNode = false;\r\n                                       break;\r\n                                    }\r\n                               }\r\n                             if (removeNode)\r\n                               {\r\n                                 // if saved report node is not in the new result, add to remove list\r\n                                 removeList.push(r);\r\n                               }\r\n                           });\r\n                      }\r\n                  }\r\n              });\r\n\r\n            // remove tree nodes in remove list\r\n            for (var k = 0; k < removeList.length; k++)\r\n              {\r\n                removeList[k].remove();\r\n              }\r\n\r\n            // sort tree\r\n            reportTreeStore.sort('text', 'ASC');\r\n          }\r\n      });\r\n  }\r\n\r\nfunction refreshEnergyTree(instance)\r\n  {\r\n    var tree = Ext.getCmp(\"energyTree\");\r\n    if (!tree)\r\n      return;\r\n\r\n    var record = tree.getRootNode().findChild('id', instance, true);\r\n\r\n    if (record === null)\r\n      {\r\n        var lastnode = tree.getSelectionModel().getLastSelected();\r\n        if (!lastnode.isExpanded())\r\n          {\r\n            lastnode.expand(false, function()\r\n              {\r\n                record = tree.getRootNode().findChild('id', instance, true);\r\n\r\n                if (record !== null)\r\n                  {\r\n                    tree.suspendEvents(false); // Stop all events.\r\n                    tree.getSelectionModel().select(record);\r\n                    tree.resumeEvents(); // resume events\r\n                    tree.getView().focusRow(record);\r\n\r\n                  }\r\n              });\r\n          }\r\n      }\r\n    else\r\n      {\r\n        tree.suspendEvents(false); // Stop all events.\r\n        tree.getSelectionModel().select(record);\r\n        tree.resumeEvents(); // resume events\r\n        tree.getView().focusRow(record);\r\n        recusriveExpandParents(record);\r\n      }\r\n  }\r\n\r\n/**\r\n * Function to expand parent nodes if any of the child nodes is not visible.\r\n *\r\n * @param node\r\n *          the selected node.\r\n * @return\r\n */\r\n\r\nfunction recusriveExpandParents(node)\r\n  {\r\n    if (!node.isVisible())\r\n      {\r\n\r\n        var parent = node.parentNode;\r\n\r\n        if (parent && !node.isVisible() && !parent.isExpanded())\r\n          {\r\n            parent.expand();\r\n            recusriveExpandParents(parent);\r\n          }\r\n      }\r\n  }\r\n\r\nfunction openHelpWindow()\r\n  {\r\n    // get the mainframe src\r\n    var url, anchor = '';\r\n    try\r\n      {\r\n        url = Ext.get(\"mainFrame\").dom.contentDocument.URL;\r\n      }\r\n    catch(err)\r\n      {\r\n        // EWEB-10754: access denied due to same-origin policy\r\n      }\r\n\r\n    if (Ext.isEmpty(url)) return;\r\n\r\n    // get controller\r\n    var temp = url.split(\"://\");\r\n    if (temp.length > 1)\r\n      {\r\n        url = temp[1];\r\n      }\r\n\r\n    var arr = url.split(\"/\");\r\n    var folder = \"\", file = \"\";\r\n    if (arr.length > 3)\r\n      {\r\n        folder = arr[2];\r\n        file = arr[3];\r\n        if (file.indexOf(\"#\") > -1)\r\n          {\r\n            file = file.substr(0, file.indexOf(\"#\"));\r\n          }\r\n        if (file.indexOf(\"?\") > -1)\r\n          {\r\n            file = file.substr(0, file.indexOf(\"?\"));\r\n          }\r\n        if (folder == \"object\")\r\n          {\r\n            if (arr.length > 5)\r\n              {\r\n                var fullRef = decodeURIComponent(arr[5]);\r\n                file = Delta.FullRef.getAbbr(fullRef);\r\n\r\n                // get the vendor id.\r\n                var mainFrame = document.getElementById(\"mainFrame\");\r\n                var iWin = mainFrame.contentWindow; // iframe window object\r\n                var vendorId;\r\n\r\n                try\r\n                  {\r\n                    vendorId = iWin.gVendorID;\r\n                  }\r\n                catch(err)\r\n                  {\r\n                    // EWEB-10754: access denied due to same-origin policy\r\n                  }\r\n\r\n                if (Delta.Util.isDeltaVendorId(vendorId))\r\n                  {\r\n                    folder += \"/vendor\" + vendorId;\r\n                  }\r\n                else\r\n                  {\r\n                    folder += \"/generic\";\r\n                  }\r\n             }\r\n          }\r\n        // Specific widget support pages; URL must include \"/type/<widgettype>\"\r\n        else if ((file == \"createwidget\") || (file == \"editwidget\"))\r\n          {\r\n            // Determine which widget.\r\n            if ((arr[7] !== undefined))\r\n              {\r\n                folder = 'widget';\r\n                file = arr[7].toLowerCase();\r\n              }\r\n          }\r\n        // EWEB-12484: Refer to specific report help\r\n        // for eg., http://localhost/enteliweb/report/form/SelectedReport/Consumption/ReportID/4ecbc32f....\r\n        // the above link refers to specific report ie., Consumption\r\n        else if (folder == \"report\")\r\n          {\r\n            file = arr[5].toLowerCase();\r\n            file = file.replace(/%20/g, \"_\");\r\n          }\r\n\r\n        // EWEB 14641: Device page can have other tabs besides \"Objects\" tab.\r\n        // Need to show corresponding help since iframe URL doesn't change; (parse localStorage instead)\r\n        // sub-folder name will have no spaces and is in lowercase\r\n        // tab (actual help filename) name is in lowercase and will convert spaces to underscore (no symbols)\r\n        var helpPath = Ext.decode(localStorage.getItem(\"overwriteHelpFilePath\"));\r\n        if (!$.isEmptyObject(helpPath) && helpPath['folder'] && helpPath['file'])\r\n          {\r\n            var tempFolder = helpPath['folder'].toLowerCase().replace(/\\s/g, '');\r\n            // If we are reading from localStorage, we need to clear it whenever URL changes which is not easy to do\r\n            // Extra comparing on (helpPath['folder'].indexOf(folder) > -1) to make sure we are looking at the same page\r\n            if (tempFolder.indexOf(folder) === 0)  // compare 'device/configuration/input' against 'device'\r\n              {\r\n                folder = tempFolder;\r\n                file = helpPath['file'].toLowerCase().replace(/[^\\w\\s]/g, '').replace(/\\s/g, \"_\");\r\n                anchor = (typeof helpPath['anchor'] == \"undefined\") ? '' : helpPath['anchor'].replace(/\\s/g, \"\");\r\n              }\r\n            else\r\n              {\r\n                // if compare failed, means localStroage has old values from previous page. Clear it\r\n                localStorage.getItem(\"overwriteHelpFilePath\");\r\n              }\r\n          }\r\n      }\r\n    Delta.UI.popupHelp(folder, file, anchor);\r\n  }\r\n\r\nfunction reloadDasboards(newChildren)\r\n  {\r\n    // Create new store\r\n    var newRootNode =\r\n      {\r\n        id: \"dashboardTree_root\",\r\n        expanded: true,\r\n        leaf: false,\r\n        text: \"Home\",\r\n        children: newChildren\r\n      };\r\n\r\n    // Use root of new store\r\n    var dashboardTree = Ext.getCmp('dashboardTree');\r\n    if (dashboardTree)\r\n      {\r\n        dashboardTree.getStore().setRootNode(newRootNode);\r\n        dashboardTree.expandAll();\r\n      }\r\n  }\r\n\r\nfunction openCreateDashboardWindow()\r\n  {\r\n    var dashWin = Ext.getCmp(\"dashwin\");\r\n    if (!dashWin)\r\n      {\r\n        dashWin = Ext.create(\"Ext.window.Window\",\r\n          {\r\n            id: \"dashwin\",\r\n            title: TXID.WEB_CREATE_PERSONAL_DASHBOARD,\r\n            width: 400,\r\n            height: 100,\r\n            layout: \"fit\",\r\n            closeAction: \"hide\",\r\n            items: [\r\n              {\r\n                id: \"addDashboardForm\",\r\n                xtype: \"form\",\r\n                labelAlign: \"top\",\r\n                bodyPadding: 5,\r\n                layout: \"anchor\",\r\n                border: false,\r\n                items: [\r\n                  {\r\n                    id: \"ext_input_AddDashboardTitle\",\r\n                    xtype: \"textfield\",\r\n                    margins: \"10 0 0 0\",\r\n                    fieldLabel: TXID.WEB_NAME,\r\n                    name: \"title\",\r\n                    allowBlank: false,\r\n                    anchor: \"95%\"\r\n                  }],\r\n                buttons: [\r\n                  {\r\n                    id: \"ext_btn_AddDashboard\",\r\n                    text: TXID.WEB_ADD,\r\n                    handler: function()\r\n                      {\r\n                        // create new personal dashboard\r\n                        var tree = Ext.getCmp(\"dashboardTree\");\r\n                        if (tree)\r\n                          {\r\n                            var title = Ext.getCmp(\"ext_input_AddDashboardTitle\").value;\r\n\r\n                            Ext.Ajax.request(\r\n                              {\r\n                                url: APPLICATION_URL + \"/wsdashboard/adddashboard\",\r\n                                method: 'POST',\r\n                                success: function(response)\r\n                                  {\r\n                                    var data = Ext.decode(response.responseText);\r\n                                    if (data.Error)\r\n                                      {\r\n                                        Ext.Msg.alert(\"Warning\", _T(data.Error.Message));\r\n                                      }\r\n                                    else\r\n                                      {\r\n                                        var json = {};\r\n                                        json[\"id\"] = data.dashboardid;\r\n                                        //Delta.Util.encodeHTML(title);  was using encodeHTML() but don't have a\r\n                                        // chance to decode\r\n                                        json[\"text\"] = title;\r\n                                        json[\"qtip\"] = title;\r\n                                        json[\"href\"] = APPLICATION_URL + \"/dashboard/display/dashboard/\" +\r\n                                                       data.dashboardid;\r\n                                        json[\"hrefTarget\"] = \"mainFrame\";\r\n                                        json[\"leaf\"] = true;\r\n                                        json[\"iconCls\"] = \"dashboard_icon\";\r\n\r\n                                        var personalFolder = tree.getStore().getRootNode().firstChild;\r\n                                        personalFolder.appendChild(json, null);\r\n\r\n                                        dashWin.hide();\r\n                                      }\r\n                                  },\r\n                                failure: function(){},\r\n                                params: {\"type\": \"Personal\", \"title\": title}\r\n                              });\r\n                         }\r\n                      }\r\n                  }]\r\n              }]\r\n          });\r\n      }\r\n\r\n    Ext.getCmp(\"addDashboardForm\").getForm().reset();\r\n    dashWin.show();\r\n  }\r\n\r\nfunction deletePersonalDashboard()\r\n  {\r\n    // get selected node\r\n    try\r\n      {\r\n        var tree = Ext.getCmp(\"dashboardTree\");\r\n        if (tree)\r\n          {\r\n            var selectedNode = tree.getSelectionModel().selected.first();\r\n\r\n            if ((selectedNode) && (selectedNode.parentNode.getId() == PERSONAL_DASHBOARD_ID) && (selectedNode.isLeaf()))\r\n              {\r\n                Ext.Ajax.request(\r\n                  {\r\n                    url: APPLICATION_URL + \"/wsdashboard/removedashboard\",\r\n                    method: 'POST',\r\n                    params: {\"id\": selectedNode.getId()},\r\n                    success: function(response)\r\n                      {\r\n                        selectedNode.remove();\r\n                      }\r\n                  });\r\n              }\r\n          }\r\n      }\r\n    catch(err)\r\n      {}\r\n  }\r\n\r\n//]]>-->\r\n</script>\r\n<div id=\"index_header\"  style=\"height:48px;\">\r\n  <table style=\"padding:0;margin:0;width:100%;height:100%;border-collapse:collapse;border-spacing:0;\">\r\n    <tr style=\"text-align: center;\">\r\n      <td style=\"text-align:left;padding:0\">\r\n         <div style=\"margin:4px 0 0 15px;\" class=\"cns\">\r\n         <img src=\"/enteliweb/images/enteliweb.png?4.1.738\" alt=\"enteliweb\" style=\"vertical-align:middle;\" />\r\n        </div>\r\n      </td>\r\n\r\n      <td style=\"text-align:right;vertical-align:bottom;padding:0\">\r\n        <div style=\"margin:0 15px 15px 0;\">\r\n          <span id=\"label_Welcome\" class=\"welcomeText\">Welcome</span>\r\n                    <a href=\"/enteliweb/admin/userdetail/user/Austen\" id=\"loggedin_user\" class=\"toplink\"\r\n             title=\"Settings\" target=\"mainFrame\">\r\n           <!-- this line indented this way to satisfy phpcs -->\r\n          Austen</a>\r\n          <span class=\"divider\">|</span>\r\n          <a href=\"/enteliweb/index/login\" id=\"link_logout\" class=\"toplink\" title=\"Log out\">\r\n          Log out\r\n          </a>\r\n        </div>\r\n      </td>\r\n\r\n            <td style=\"width:50px;padding:0\" class=\"admin_link\" title=\"Administration\" >\r\n        <a href=\"/enteliweb/admin/main\" title=\"Administration\" id=\"link_admin\"\r\n           class=\"toplink\" target=\"mainFrame\">\r\n          <img src=\"/enteliweb/images/gear_16.png?4.1.738\" alt=\"Administration\" class=\"admin_link_image\"\r\n             title=\"Administration\" style=\"cursor: pointer;\" />\r\n        </a>\r\n      </td>\r\n      \r\n      \r\n      \r\n      <td style=\"width:45px;padding:0\" class=\"help_link\" title=\"Help\">\r\n         <img src=\"/enteliweb/images/help_24.png?4.1.738\" id=\"link_help\" alt=\"Help\" title=\"Help\"\r\n              style=\"cursor: pointer;\" class=\"help_link_image\"/>\r\n      </td>\r\n    </tr>\r\n    <tr>\r\n      <td colspan=\"4\" style=\"background:#da2238;height:4px;padding:0\"></td>\r\n    </tr>\r\n  </table>\r\n</div>\r\n<!-- Panel to contain notifications when pinned -->\r\n<div id=\"pinnedNotification_div\" style=\"height:100%;min-height:65px;\"></div>\r\n\r\n<!-- Notification on BOTTOM (status bar and floating popup)-->\r\n<div id=\"notification_overlay\" style=\"z-index:4999\">\r\n  <div id=\"notification_bar\" style=\"position:fixed;bottom:0;right:7px;\"></div>\r\n  <div id=\"notification_popup\" style=\"position:fixed;bottom:45px;right:15px;width:300px;\"></div>\r\n</div>\r\n\r\n<!-- NOTIFICATION STATUS (bottom of page) Use absolute pos so that animations do not affect other elements.-->\r\n<div id=\"notification_status_container\" style=\"position:fixed; bottom:0; right:25px; z-index:5000\">\r\n  <div id=\"notification_status\">\r\n    <div id=\"notification_unseen_alarms\"></div>\r\n  </div>\r\n</div>\r\n  </body>\r\n</html>\r\n"},"comment":{"url":"https://api.github.com/repos/brave/browser-laptop/issues/comments/264490565","html_url":"https://github.com/brave/browser-laptop/issues/5830#issuecomment-264490565","issue_url":"https://api.github.com/repos/brave/browser-laptop/issues/5830","id":264490565,"user":{"login":"bsclifton","id":4733304,"avatar_url":"https://avatars.githubusercontent.com/u/4733304?v=3","gravatar_id":"","url":"https://api.github.com/users/bsclifton","html_url":"https://github.com/bsclifton","followers_url":"https://api.github.com/users/bsclifton/followers","following_url":"https://api.github.com/users/bsclifton/following{/other_user}","gists_url":"https://api.github.com/users/bsclifton/gists{/gist_id}","starred_url":"https://api.github.com/users/bsclifton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bsclifton/subscriptions","organizations_url":"https://api.github.com/users/bsclifton/orgs","repos_url":"https://api.github.com/users/bsclifton/repos","events_url":"https://api.github.com/users/bsclifton/events{/privacy}","received_events_url":"https://api.github.com/users/bsclifton/received_events","type":"User","site_admin":false},"created_at":"2016-12-02T16:06:59Z","updated_at":"2016-12-02T16:06:59Z","body":"I checked out the names in the above, and it seems @austenlennon is having a problem loading pages either locally or on an intranet which are using this framework:\r\nhttps://www.deltacontrols.com/enteliweb/\r\n\r\n@austenlennon can you confirm?"}}
{"actor":{"display_login":"bsclifton"}}