From ed64b5edff15e702493df21aa3230b81593e6133 Mon Sep 17 00:00:00 2001 From: Michael Lando Date: Fri, 9 Jun 2017 03:19:04 +0300 Subject: [SDC-29] catalog 1707 rebase commit. Change-Id: I43c3dc5cf44abf5da817649bc738938a3e8388c1 Signed-off-by: Michael Lando --- .../directives/tutorial/tutorial-directive.ts | 147 --------------------- 1 file changed, 147 deletions(-) delete mode 100644 catalog-ui/app/scripts/directives/tutorial/tutorial-directive.ts (limited to 'catalog-ui/app/scripts/directives/tutorial/tutorial-directive.ts') diff --git a/catalog-ui/app/scripts/directives/tutorial/tutorial-directive.ts b/catalog-ui/app/scripts/directives/tutorial/tutorial-directive.ts deleted file mode 100644 index 7df35cade9..0000000000 --- a/catalog-ui/app/scripts/directives/tutorial/tutorial-directive.ts +++ /dev/null @@ -1,147 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * SDC - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -/// -module Sdc.Directives { - 'use strict'; - export interface ITutorialScope extends ng.IScope { - showTutorial:boolean; - isFirstTime:boolean; - templateUrl:string; - totalPages: number; - currentPageIndex: number; - page:number; - tabs:Array; - tutorialData:any; - pageObject:any; - - initPage:Function; - next:Function; - previous:Function; - hasNext():boolean; - hasPrevious():boolean; - closeTutorial:Function; - closeAndShowLastPage:Function; - } - - export class TutorialDirective implements ng.IDirective { - - constructor( - private $templateCache:ng.ITemplateCacheService, - private sdcConfig:Models.IAppConfigurtaion, - private $state:ng.ui.IStateService - ) { - } - - scope = { - page: '=', - showTutorial: '=', - isFirstTime: '=' - }; - - replace = false; - restrict = 'EA'; - template = ():string => { - return this.$templateCache.get('/app/scripts/directives/tutorial/tutorial-directive.html'); - }; - - link = (scope:ITutorialScope, $elem:any) => { - - let findPageIndex:Function = (pageId:number):number=> { - for (let i:number=0;i { - scope.pageObject = scope.tutorialData.pages[scope.currentPageIndex]; - scope.templateUrl = '/app/scripts/directives/tutorial/' + scope.pageObject.template + '.html'; - } - - scope.tutorialData = this.sdcConfig.tutorial; - - scope.closeTutorial = ()=> { - scope.showTutorial = false; - if(scope.isFirstTime){ - scope.isFirstTime=false; - } - } - - scope.closeAndShowLastPage = ()=> { - if(scope.isFirstTime){ - this.$state.go('dashboard.tutorial-end'); - } - scope.closeTutorial(); - } - - let init:Function = ():void => { - scope.tabs = scope.tutorialData.tabs; - scope.totalPages = scope.tutorialData.pages.length; - scope.initPage(scope.page); - - } - - scope.initPage = (pageId) => { - scope.currentPageIndex = findPageIndex(pageId); - showCurrentPage(); - } - - scope.next = ():void => { - if (scope.hasNext()){ - scope.currentPageIndex++; - showCurrentPage(); - } - } - - scope.previous = ():void => { - if (scope.hasPrevious()){ - scope.currentPageIndex--; - showCurrentPage(); - } - } - - scope.hasNext = ():boolean => { - return (scope.currentPageIndex+1) < scope.totalPages; - } - - scope.hasPrevious = ():boolean => { - return scope.currentPageIndex>0; - } - - angular.element(document).ready(function () { - init(); - }); - - scope.$watch('showTutorial', (showTutorial:any):void => { - scope.initPage(scope.page); - }); - - }; - - public static factory = ($templateCache:ng.ITemplateCacheService, sdcConfig:Models.IAppConfigurtaion, $state:ng.ui.IStateService)=> { - return new TutorialDirective($templateCache, sdcConfig, $state); - }; - - } - - TutorialDirective.factory.$inject = ['$templateCache', 'sdcConfig', '$state']; -} -- cgit 1.2.3-korg