2 ================================================================================
4 ================================================================================
5 Copyright (C) 2017 AT&T Intellectual Property
6 ================================================================================
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
11 http://www.apache.org/licenses/LICENSE-2.0
13 Unless required by applicable law or agreed to in writing, software
14 distributed under the License is distributed on an "AS IS" BASIS,
15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 See the License for the specific language governing permissions and
17 limitations under the License.
18 ================================================================================
20 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
21 <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
22 <%@ page isELIgnored="false"%>
23 <%@ page import="org.onap.portalsdk.core.util.SystemProperties"%>
24 <%@ page import="org.onap.portalsdk.core.onboarding.util.PortalApiProperties"%>
25 <%@ page import="org.onap.portalsdk.core.onboarding.util.PortalApiConstants"%>
26 <%@ page import="org.onap.portalsdk.core.domain.MenuData"%>
27 <link rel="stylesheet" type="text/css" href="app/fusion/external/ebz/ebz_header/header.css">
28 <link rel="stylesheet" type="text/css" href="app/fusion/external/ebz/ebz_header/portal_ebz_header.css">
29 <link rel="stylesheet" type="text/css" href="app/fusion/external/ebz/sandbox/styles/style.css" >
32 <%--<script src= "app/fusion/external/ebz/angular_js/angular.js"></script> --%>
33 <script src="app/fusion/external/angular-1.4.8/angular.min.js"></script>
34 <script src="app/fusion/external/angular-1.4.8/angular-route.min.js"></script>
35 <script src="app/fusion/external/angular-1.4.8/angular-sanitize.min.js"></script>
36 <script src="app/fusion/external/angular-1.4.8/angular-cookies.min.js"></script>
37 <script src="app/fusion/external/ebz/angular_js/app.js"></script>
38 <script src="app/fusion/external/ebz/angular_js/gestures.js"></script>
39 <script src="static/js/jquery-1.10.2.js"></script>
40 <script src="app/fusion/scripts/modalService.js"></script>
41 <script src="static/js/jquery.mask.min.js" type="text/javascript"></script>
42 <script src="static/js/jquery-ui.js" type="text/javascript"></script>
43 <script src="app/fusion/external/ebz/sandbox/att-abs-tpls.js" type="text/javascript"></script>
44 <script src="static/fusion/js/att_angular_gridster/ui-gridster-tpls.js"></script>
45 <script src="static/fusion/js/att_angular_gridster/angular-gridster.js"></script>
46 <script src= "app/fusion/external/ebz/angular_js/checklist-model.js"></script>
47 <script type="text/javascript" src="app/fusion/external/lodash/lodash.min.0.10.js"></script>
48 <%--<script src="app/fusion/external/angular-ui/ui-bootstrap-tpls-1.1.2.min.js"></script>--%>
49 <script src="app/fusion/external/angular-1.4.8/angular-touch.min.js"></script>
50 <script src="app/fusion/external/angular-1.4.8/angular-animate.min.js"></script>
51 <script src="app/fusion/external/angular-bootstrap/ui-bootstrap-tpls.min.js"></script>
52 <script src="app/fusion/scripts/services/userInfoService.js"></script>
53 <script src="app/fusion/scripts/services/leftMenuService.js"></script>
56 <jsp:include page="/WEB-INF/fusion/jsp/ebz/loginSnippet.html" ></jsp:include>
58 <c:set var="UserName" value="<%= session.getAttribute(\"fullName\")%>" />
59 <c:set var="UserFirstName" value="<%= session.getAttribute(\"first_name\")%>" />
62 String contactUsLink = SystemProperties.getProperty(SystemProperties.CONTACT_US_LINK);
63 String redirectUrl = PortalApiProperties.getProperty(PortalApiConstants.ECOMP_REDIRECT_URL);
64 String portalUrl = redirectUrl.substring(0, redirectUrl.lastIndexOf('/')) + "/process_csp";
65 String getAccessLink = redirectUrl.substring(0, redirectUrl.lastIndexOf('/')) + "/get_access";
67 <c:set var="returnPortalUrl" value="<%=portalUrl%>" />
68 <c:set var="contactUsLink" value="<%=contactUsLink%>" />
69 <c:set var="getAccessLink" value="<%=getAccessLink%>" />
72 z-index:997 !important;
75 .secondaryMenuContainer{
78 .megamenu-tabs .megamenu__item {
81 .megamenu-tabs .megamenu__item span {
88 .submenu-tabs .sub__menu{
92 .top-megamenu .megamenu-tabs ul{
98 <%@include file="/WEB-INF/fusion/jsp/ebz/loginSnippet.html" %>
100 <div style="position: relative; z-index: 999;">
101 <div ng-controller="headerController">
103 <div class="headerContainer" id="headerContainer" ng-cloak ng-show="{{showHeader && false}}">
104 <div id="megaMenuContainer" class="megaMenuContainer" style="margin-top: 0; overflow: visible;">
107 <!-- Mega Menu parent-tab directive with three models menu-items, active-sub-menu, active-menu -->
108 <div id="topMenu" class="top-megamenu" ng-mouseleave="activeClickSubMenu.x.active=false; activeClickMenu.x.active=false">
109 <div style="float:left;width:100%;"parent-tab menu-items="megaMenuDataObject" active-sub-menu='activeClickSubMenu.x' active-menu='activeClickMenu.x'>
110 <div parentmenu-tabs mega-menu="true" menu-items="megaMenuDataObject" style="height:55px;">
111 <div style="float:left">
112 <li class="megamenu__item" style="line-height:55px;" onclick="returnToPortal()">
113 <img src="app/fusion/external/ebz/images/att_logo.png" class="ATTLogo" ></span>
114 <!-- <a id='returnPortal' class="primaryMenuOptionLink" style="font-weight: 400 !important; font-family: clearview_att_bold !important; font-size: 18px;">ECOMP</a>
115 --> <strong style="font-weight: 400 !important; font-family: clearview_att_bold !important; font-size: 18px;" id='returnPortal' >ECOMP Portal</strong>
117 <div menu-tabs mega-menu="true" tab-name="item.text" menu-item="item" active-menu="activeClickMenu.x"
118 ng-repeat="item in megaMenuDataObject" style="font-size: 18px;" ng-mousedown="loadFavorites()" >
119 <div parentmenu-tabs sub-menu="true" ng-show="activeClickMenu.x.active && item.active" menu-items="activeClickMenu.x.children">
120 <!-- Second level menu -->
122 <div menu-tabs sub-menu="true" tab-name="subItem.text"
123 tab-url="subItem.url" menu-item="subItem"
124 ng-repeat="subItem in activeClickMenu.x.children | orderBy : 'column'" active-menu="activeClickSubMenu.x"
125 sub-item-active="{{subItem.active}}" style="float:left;" aria-label="{{subItem.text}}"
126 ng-mouseenter="submenuLevelAction(subItem.text,subItem.column)"
127 ng-mouseleave="submenuLevelAction(subItem.text,subItem.column)"
128 ng-click="submenuLevelAction(subItem.text,subItem.column)" >
129 <i ng-if="subItem.text=='Favorites'" id="favorite-star"
130 class="icon-star favorites-icon-active">
134 <div class="sub__menu" ng-mouseleave="activeClickSubMenu.x.active=false" >
135 <ul ng-show="activeClickSubMenu.x.active" role="menubar" class="columns">
136 <!-- Third level menu -->
137 <div menu-tabs menu-item="subItem"
139 ng-repeat="subItem in activeClickSubMenu.x.children | orderBy : 'column'"
140 ng-show="activeClickSubMenu.x.active">
142 <i id="favorite-selector-third-level"
143 ng-show="isUrlFavorite(subItem.menuId)==false"
144 class="icon-star favorites-icon-inactive"
145 ng-if="subItem.url.length > 1">
147 <i id="favorite-selector-third-level"
148 ng-show="isUrlFavorite(subItem.menuId)"
149 class="icon-star favorites-icon-active"
150 ng-if="subItem.url.length > 1">
152 <span class="title" aria-label="{{subItem.text}}"
153 ng-click="goToUrl(subItem)">{{subItem.text}}</span>
154 <!-- Fourth level menus -->
155 <div att-links-list="">
156 <i id="favorite-selector-fourth-level"
157 class="icon-star favorites-icon-inactive"
158 ng-show="isUrlFavorite(tabValue.menuId)==false"
159 ng-if="tabValue.url.length > 1">
162 <i id="favorite-selector-fourth-level"
163 class="icon-star favorites-icon-active"
164 ng-show="isUrlFavorite(tabValue.menuId)"
165 ng-if="tabValue.url.length > 1">
168 <span role="menuitem" att-links-list-item=""
169 ng-repeat="tabValue in subItem.children"
170 ng-click="goToUrl(tabValue)"
171 att-accessibility-click="13,32"
172 ng-class="{'disabled': tabValue.disabled}">{{tabValue.text}}</span>
174 <hr ng-show="!$last"/>
178 <!-- Favorites level menu -->
179 <div class="favorites-window" ng-show='favoritesWindow' ng-mouseleave="hideFavoritesWindow()">
180 <div id="favorites-menu-items" ng-show="showFavorites">
181 <div ng-repeat="subItem in favoritesMenuItems" att-links-list="" style='display: inline'>
182 <i id="favorite-selector-favorites-list" class="icon-star favorites-icon-active">
184 <a id="favorites-list" aria-label="{{subItem.text}}"
185 ng-click="goToUrl(subItem)"
186 style="margin-left: 3px; margin-right: 20px; text-decoration: none; color: #666666;">
192 <p style='font-weight: 400; font-family: clearview_att_bold !important;
193 font-size: 18px; text-align: center; background-color: lightgray;
194 width: 400px; margin-left: 25%; margin-right: 25%;'>
195 Manage favorites on ECOMP Portal.
199 <!-- Favorites when empty -->
200 <div id="favorites-empty" ng-show='favoritesWindow' ng-show="emptyFavorites">
201 <div id="favorites-empty" ng-show="emptyFavorites" class="favorites-window-empty">
203 <img src="app/fusion/external/ebz/images/no_favorites_star.png">
204 <p class='favoritesLargeText'>No Favorites</p>
205 <p class='favoritesNormalText'>Manage favorites on ECOMP Portal.</p>
215 <li class="megamenu__item" style="line-height:55px;" ng-if="loadMenufail">
216 <strong style="font-weight: 400 !important; font-family: clearview_att_bold !important; font-size: 18px;" >Unable to load menus</strong>
218 <!-- <li class="megamenu__item" style="width: 20%;"> </li>
220 <!-- Login Snippet-->
221 <div style="float:right">
222 <li id="bcLoginSnippet" class="megamenu__item" style="width: 140px;" >
223 <div popover="loginSnippet.html" aria-label="Login Snippet" referby="loginSnippet" att-accessibility-click="13,32" popover-style="\" popover-placement="below" style="width: 200px;">
224 <div class="icon-user-small login-snippet-icon"></div>
225 <div class="login-snippet-text" style="display: inline-block; font-size:12px; margin-left:5px;overflow: hidden; max-height: 31px; max-width:120px; padding-top: 0px; margin-top: 0px; white-space: nowrap;" ng-bind="userProfile.firstName"></div>
228 <li class="megamenu__item" style="width:120px;"> </li>
233 <div style="clear: both"></div>
238 <div class="license-notification" id="license-notification">
239 <a href="javascript:void(0)" style="background-color:#bbb;" class="button button--small" tooltip="Please contact ECOMP Portal team to get the license" tooltip-placement="below" tooltip-style="light" tooltip-popup-delay="500" >
240 <span style="">{{app_name_full}}</span>
243 <div style="position: relative; color: black; top: 70px;">
245 <span ng-style="adjustHLeftMenu('burgerIcon')" style="z-index:998; position:fixed; left:0%; font-size:35px; margin-left:10px;text-decoration:none;">
246 <a ng-click="toggleDrawer();isOpen = !isOpen" href="javascript:void(0);" class="arrow-icon-left" >
247 <span class="icon-hamburger"></span></a>
248 <span ng-init="isOpen = true" ng-show="isOpen" style="font-size:16px; position:relative; top:-8px; left:-15px;">    {{app_name}}</span>
249 <span data-tests-id='app-version' ng-show="isOpen" style="font-size:13px; position:relative; top:15px; left:-45px; color:#666666;">{{app_version}}</span>
251 <div att-drawer drawer-slide="left" drawer-custom-top="{{drawer_custom_top}}px" drawer-size="200px" drawer-open="drawerOpen" drawer-custom-height="100%" >
252 <div ng-style="adjustHLeftMenu('leftMenu')">
253 <div class="attDrawer" style="margin-top:{{drawer_margin_top}}px;">
254 <div style="margin-left:10px; margin-right:10px;">
255 <accordion close-others="true" css="att-accordion--no-box">
256 <accordion-group ng-repeat="parent in menuItems" heading="{{parent.parentLabel}}" child="{{parent.parentAction}}" parent-link="{{parent.parentAction}}" image-source="{{parent.parentImageSrc}}" child-length="{{parent.childItemList.length}}" is-open="parent.open">
257 <div ng-repeat="subMenu in parent.childItemList" style="font-size:12px; margin-left:10px;">
258 <a href="{{subMenu.action}}" style="font-size:12px; color:#666666;" >{{subMenu.label}}</a>
271 function returnToPortal(){
272 window.location.href = "<c:out value='${returnPortalUrl}'/>";
274 detectScrollEvent = function() {
275 var footerOff = $('#footerContainer').offset().top;
276 var headOff = $('#headerContainer').offset().top;
277 var winHeight = $(window).height();
278 if ((footerOff - headOff) <= winHeight) {
279 $('.att-drawer').css({
280 "height" : footerOff - headOff - 55
283 $('.att-drawer').css({
288 $(window).scroll(function() {
289 if ($('.att-drawer').is(':visible')) {
293 app.controller("headerController", function($scope, $timeout, $log, $http, UserInfoService, $window, $cookies,LeftMenuService) {
294 // $log.debug('HeaderController started');
295 $scope.jsonMenuData = [];
296 $scope.loadMenufail=false;
297 $scope.app_name = "";
298 $scope.app_name_full = "";
299 $scope.megaMenuDataObject =[];
300 $scope.activeClickSubMenu = {
303 $scope.activeClickMenu = {
306 $scope.favoritesMenuItems = [];
307 $scope.favoriteItemsCount = 0;
308 $scope.showFavorites = false;
309 $scope.emptyFavorites = false;
310 $scope.favoritesWindow = false;
317 $scope.app_version="";
318 /*Put user info into fields*/
319 $scope.inputUserInfo = function(userInfo){
320 if (typeof(userInfo) != "undefined" && userInfo!=null && userInfo!=''){
321 if (typeof(userInfo.USER_FIRST_NAME) != "undefined" && userInfo.USER_FIRST_NAME!=null && userInfo.USER_FIRST_NAME!='')
322 $scope.userProfile.firstName = userInfo.USER_FIRST_NAME;
323 if (typeof(userInfo.USER_LAST_NAME) != "undefined" && userInfo.USER_LAST_NAME!=null && userInfo.USER_LAST_NAME!='')
324 $scope.userProfile.lastName = userInfo.USER_LAST_NAME;
325 if (typeof(userInfo.USER_EMAIL) != "undefined" && userInfo.USER_EMAIL!=null && userInfo.USER_EMAIL!='')
326 $scope.userProfile.email = userInfo.USER_EMAIL;
329 /*getting user info from session*/
330 $scope.getUserNameFromSession = function(){
331 UserInfoService.getFunctionalMenuStaticDetailSession()
332 .then(function (res) {
333 $scope.userProfile.firstName = res.firstName;
334 $scope.redirectUrl = res.portalUrl;
337 $scope.getTopMenuStaticInfo=function() {
338 var promise = UserInfoService.getFunctionalMenuStaticDetailShareContext();
341 if(res==null || res==''){
342 $log.info('failed getting static User information');
343 $scope.getUserNameFromSession();
345 $log.info('Received static User information');
347 $scope.inputUserInfo(resData);
348 $scope.userProfile.fullName = $scope.userProfile.firstName+ ' '+ $scope.userProfile.lastName;
352 $log.info('failed getting static User information');
357 var unflatten = function( array, parent, tree ){
358 tree = typeof tree !== 'undefined' ? tree : [];
359 parent = typeof parent !== 'undefined' ? parent : { menuId: null };
360 var children = _.filter( array, function(child){ return child.parentMenuId == parent.menuId; });
362 if( !_.isEmpty( children ) ){
363 if( parent.menuId === null ){
366 parent['children'] = children
368 _.each( children, function( child ){ unflatten( array, child ) } );
374 var menuStructureConvert = function(menuItems) {
375 var megaMenuDataObjectTemp = [
384 url:"<c:out value='${contactUsLink}'/>"
388 url:"<c:out value='${getAccessLink}'/>"
392 return megaMenuDataObjectTemp;
397 LeftMenuService.getAppName().then(function(response){
400 if(j && j !== "null" && j!== "undefined"){
401 // console.log("app name is " + $scope.app_name);
402 $scope.app_name_full = j.data;
403 var processed_app_name = j.data;
404 var indexOfLic = processed_app_name.indexOf('[');
406 if (jQuery('.license-notification')!=null)
407 jQuery('.license-notification').css("display", "none");
409 var n = processed_app_name.length;
413 if(n > indexOfLic && indexOfLic > 0) {
416 $scope.app_name_full = $scope.app_name_full.substr(0, n);
417 $scope.app_name = processed_app_name.substr(0, n);
420 throw "Get app_name response is not an object/is empty";
423 console.log("error happened while trying to get app name "+e);
427 console.log('getAppName failed', error);
430 LeftMenuService.getAppVersion().then(function(response){
434 $scope.app_version = j.displayVersion;
437 throw "Version response is not in expected format.";
440 console.log("Error happened while trying to get app version: "+e);
444 console.log('getAppVersion failed', error);
447 $scope.getTopMenuStaticInfo();
448 $scope.getMenu=function() {
452 url: 'get_functional_menu',
453 // TIMEOUT USED FOR LOCAL TESTING ONLY
455 }).success(function (response) {
456 if(response == '101: Timeout') {
457 $log.error('Timeout attempting to get_functional_menu');
458 // TIMEOUT USED FOR LOCAL TESTING ONLY
459 // $scope.createErrorMenu();
460 $scope.megaMenuDataObject = menuStructureConvert('');
462 $log.debug('get_functional_menu success: ' + response);
463 if(typeof response != 'undefined' && response.length!=0 && typeof response[0] != 'undefined' && typeof response[0].error!="undefined"){
464 // createErrorMenu() USED FOR LOCAL TESTING ONLY
465 // $scope.createErrorMenu();
466 $scope.megaMenuDataObject = menuStructureConvert('');
467 // $scope.loadMenufail=true;
469 $scope.jsonMenuData = unflatten( response );
470 $scope.megaMenuDataObject = menuStructureConvert($scope.jsonMenuData);
473 }).error(function (response){
474 // createErrorMenu() USED FOR LOCAL TESTING ONLY
475 // $scope.createErrorMenu();
477 //$scope.loadMenufail=true;
478 $scope.megaMenuDataObject = menuStructureConvert('');
479 $log.debug('REST API failed get_functional_menu...'+ response);
482 $scope.adjustHLeftMenu = function (type){
483 $scope.showHeader = ($cookies.show_app_header == undefined ? true : $cookies.show_app_header);
485 if($scope.showHeader == true) {
486 $scope.drawer_margin_top = 60;
487 $scope.drawer_custom_top = 5;
488 $scope.toggle_drawer_top = 5;
492 $scope.drawer_margin_top = 50;
493 $scope.drawer_custom_top = 5;
494 $scope.toggle_drawer_top = 5;
496 if(type=='burgerIcon'){
497 return { "top": $scope.toggle_drawer_top+"px"};
498 }else if(type=='leftMenu'){
499 return { "margin-top": $scope.drawer_margin_top+"px"};
503 $scope.adjustHeader=function() {
504 $scope.showHeader = ($cookies.show_app_header == undefined ? true : $cookies.show_app_header);
506 if($scope.showHeader == true) {
507 $scope.drawer_margin_top = 50;
508 $scope.drawer_custom_top = 5;
509 $scope.toggle_drawer_top = 5;
513 $scope.drawer_margin_top = 40;
514 $scope.drawer_custom_top = 5;
515 $scope.toggle_drawer_top = 5;
523 $scope.adjustHeader();
526 /* **************************************************************************/
527 /* Logic for the favorite menus is here */
529 $scope.loadFavorites = function () {
530 $log.debug('loadFavorites has happened.');
531 if ($scope.favoritesMenuItems == '') {
532 $scope.generateFavoriteItems();
533 $log.debug('loadFavorites is calling generateFavoriteItems()');
535 $log.debug('loadFavorites is NOT calling generateFavoriteItems()');
539 $scope.goToUrl = function (item) {
540 $log.info("goToUrl called")
544 var restrictedApp = item.restrictedApp;
545 $log.debug('Restricted app status is: ' + restrictedApp);
547 $log.info('No url found for this application, doing nothing..');
551 $window.open(url, '_blank');
553 $window.open(url, '_self');
558 $scope.submenuLevelAction = function(index, column) {
559 if ($scope.favoritesMenuItems == '') {
560 $scope.generateFavoriteItems();
561 $log.debug('submenuLevelAction is calling generateFavoriteItems()');
563 $log.debug('item hovered/clicked: ' + index + '; column = ' + column);
564 if (column == 2) { // 2 is Design
565 $scope.favoritesWindow = false;
566 $scope.showFavorites = false;
567 $scope.emptyFavorites = false;
569 if (index=='Favorites' && $scope.favoriteItemsCount != 0) {
570 $log.debug('Showing Favorites window');
571 $scope.favoritesWindow = true;
572 $scope.showFavorites = true;
573 $scope.emptyFavorites = false;
575 if (index=='Favorites' && $scope.favoriteItemsCount == 0) {
576 $log.debug('Hiding Favorites window in favor of No Favorites Window');
577 $scope.favoritesWindow = true;
578 $scope.showFavorites = false;
579 $scope.emptyFavorites = true;
582 $scope.favoritesWindow = false;
583 $scope.showFavorites = false;
584 $scope.emptyFavorites = false;
588 $scope.hideFavoritesWindow = function() {
589 $log.debug('$scope.hideFavoritesWindow has been called');
590 $scope.showFavorites = false;
591 $scope.emptyFavorites = false;
594 $scope.isUrlFavorite = function (menuId) {
595 // $log.debug('array objects in menu favorites = ' + $scope.favoriteItemsCount + '; menuId=' + menuId);
596 var jsonMenu = JSON.stringify($scope.favoritesMenuItems);
597 var isMenuFavorite = jsonMenu.indexOf('menuId\":' + menuId);
598 if (isMenuFavorite==-1) {
606 $scope.generateFavoriteItems = function() {
609 url: 'get_favorites',
610 // TIMEOUT USED FOR LOCAL TESTING ONLY
612 }).success(function (response) {
613 if (response == '101: Timeout') {
614 $log.error('Timeout attempting to get_favorites_menu');
616 if(typeof response != 'undefined' && response.length!=0 && typeof response[0] != 'undefined' && typeof response[0].error!="undefined"){
617 $log.error('REST API failed get_favorites' + response);
619 $log.debug('get_favorites = ' + JSON.stringify(response));
620 $scope.favoritesMenuItems = response;
621 $scope.favoriteItemsCount = Object.keys($scope.favoritesMenuItems).length;
622 $log.info('number of favorite menus: ' + $scope.favoriteItemsCount);
625 }).error(function (response){
626 $log.error('REST API failed get_favorites' + response);
627 //createFavoriteErrorMenu() USED FOR LOCAL TESTING ONLY
628 // $scope.createFavoriteErrorMenu();
632 $scope.createFavoriteErrorMenu=function() {
633 $scope.favoritesMenuItems = [
636 // "text": "JSONLint",
637 // "url": "http://http://jsonlint.com"
641 // "text": "ECOMP Wasteland",
642 // "url": "https://ecomp.homer.att.com/ecompportal/applicationsHome"
646 // "text": "HROneStop",
647 // "url": "http://ebiz.sbc.com/hronestop"
651 // "text": "Andy and his Astrophotgraphy",
652 // "url": "https://ecomp.homer.att.com/ecompportal/applicationsHome"
655 $scope.favoriteItemsCount = Object.keys($scope.favoritesMenuItems).length;
656 $log.info('number of favorite menus: ' + $scope.favoriteItemsCount);
659 /* end of Favorite Menu code */
660 /* **************************************************************************/
663 /* **************************************************************************/
664 // THIS IS USED FOR LOCAL TESTING ONLY
665 /* **************************************************************************/
667 $scope.createErrorMenu=function() {
668 $scope.jsonMenuData = [
673 "parentMenuId": null,
679 "text": "Infrastructure Ordering",
680 "parentMenuId": null,
686 "text": "Service Creation",
687 "parentMenuId": null,
693 "text": "Service Mgmt",
694 "parentMenuId": null,
702 "url": "http://google.com"
707 "text": "Mike Little's Coffee Cup",
709 "url": "http://coffee.com"
714 "text": "Andy and his Astrophotgraphy",
716 "url": "http://nightskypix.com"
723 "url": "http://http://jsonlint.com"
730 "url": "http://ebiz.sbc.com/hronestop"
735 "text": "4th Level App4a R16",
737 "url": "http://www.e-access.att.com/ecomp_portal_ist/ecompportal/widgets"
742 "text": "3rd Level App1c R200",
744 "url": "http://app1c.com"
749 "text": "3rd Level App4b R16",
751 "url": "http://app4b.com"
756 "text": "3rd Level App2b R16",
758 "url": "http://app2b.com"
764 "parentMenuId": null,
768 $scope.jsonMenuData = unflatten( $scope.jsonMenuData );
769 $scope.megaMenuDataObject = menuStructureConvert($scope.jsonMenuData);
770 // $log.debug(JSON.stringify($scope.jsonMenuData));
772 var childItemList="";
775 childItemList = ${menu.childItemList};
776 parentList = ${menu.parentList};
778 console.log("ebz_header: failed to get child/parent lists", err);
781 var pageUrl = window.location.href.split('/')[window.location.href.split('/').length-1];
783 $scope.menuItems = [];
784 for (var i = 0; i < parentList.length; i++) {
785 $scope.openCurrentMenu = false;
786 if(pageUrl==parentList[i].action)
787 $scope.openCurrentMenu = true;
788 $scope.childItemList = childItemList[i];
789 for(chIndex in $scope.childItemList){
790 if($scope.childItemList.length>0)
791 if($scope.childItemList[chIndex].action!=null){
792 if($scope.childItemList[chIndex].action==pageUrl)
793 $scope.openCurrentMenu = true;
797 parentLabel : parentList[i].label,
798 parentAction : parentList[i].action,
799 parentImageSrc : parentList[i].imageSrc,
800 open:$scope.openCurrentMenu,
801 childItemList : $scope.childItemList
803 $scope.menuItems.push($scope.item);
805 $scope.arrowShow = true;
806 $scope.drawerOpen = false;
807 $scope.subMenuContent = false;
808 $scope.toggleSubMenu = function() {
809 $scope.subMenuContent = !$scope.subMenuContent;
812 var drawerOpen = 'open';
813 if (drawerOpen == 'open') {
814 $scope.drawerOpen = true;
815 $scope.arrowShow = true;
817 $scope.arrowShow = false;
819 $scope.arrowShow = true;
820 $scope.drawerOpen = false;
821 $scope.toggleDrawer = function() {
822 $scope.drawerOpen = !($scope.drawerOpen);
823 if ($scope.drawerOpen) {
824 $scope.arrowShow = true;
825 if (document.getElementById('mContent')!=null)
826 document.getElementById('mContent').style.marginLeft = "0px";
828 $scope.arrowShow = false;
829 if (document.getElementById('mContent')!=null)
830 document.getElementById('mContent').style.marginLeft = "-150px";
833 //var drawerOpen = getCookie('drawerOpen');
834 if (drawerOpen == 'open') {
835 $scope.drawerOpen = true;
836 $scope.arrowShow = true;
838 $scope.arrowShow = false;
840 $timeout(function() {
846 app.filter("ellipsis", function(){
847 return function(text, length){
849 var ellipsis = text.length > length ? "..." : "";
850 return text.slice(0, length) + ellipsis;