• R/O
  • HTTP
  • SSH
  • HTTPS

zephyr: Commit

This repository is for zephyr, which is implemented for a GUI of Eos.


Commit MetaInfo

Revisionb1c5a8ba69e0f24ab6b2fe9fb66a538e948feddd (tree)
Time2016-02-10 10:12:46
Authorhimetani_cafe <fumifumi@yasu...>
Commiterhimetani_cafe

Log Message

[TMP] preview Modal

Change Summary

Incremental Difference

--- a/front-end/app/scripts/App.ts
+++ b/front-end/app/scripts/App.ts
@@ -39,6 +39,7 @@ namespace app {
3939
4040 zephyr.filter('Tag', filters.Tag);
4141 zephyr.controller('selectCommandController', controllers.SelectCommand);
42+ zephyr.controller('previewController', controllers.Preview);
4243
4344 zephyr.service('MyModal', services.MyModal);
4445
--- a/front-end/app/scripts/controllers/Execution.ts
+++ b/front-end/app/scripts/controllers/Execution.ts
@@ -14,10 +14,15 @@ namespace app.controllers {
1414 public add() {
1515 // close all <uib-accordion> tag
1616 this.$scope.$broadcast('close');
17+ var commandInfoList = this.commandInfoList;
1718
1819 // add <command> directive
19- this.MyModal.selectCommand();
20- //this.commandInfoList.push(new declares.CommandInfo('mrcImageNoiseAdd'));
20+ var commandInstance = this.MyModal.selectCommand();
21+ commandInstance
22+ .result
23+ .then(function(command) {
24+ commandInfoList.push(new declares.CommandInfo(command));
25+ });
2126 }
2227
2328 public open() {
--- /dev/null
+++ b/front-end/app/scripts/controllers/Preview.ts
@@ -0,0 +1,25 @@
1+namespace app.controllers {
2+ export class Preview{
3+
4+ public static $inject = ['$scope', 'APIEndPoint','$uibModalInstance'];
5+ private tags: string[];
6+ private commands: string[];
7+ private searchText: string;
8+ private currentTag: string;
9+
10+ constructor($scope: ng.IScope, private APIEndPoint: services.APIEndPoint, private $modalInstance: ng.ui.bootstrap.IModalServiceInstance) {
11+ var controller = this;
12+ console.log('preview');
13+ /*
14+ this.APIEndPoint
15+ .getCommands()
16+ .$promise.then((result) => {
17+ controller.commands = result.info;
18+ });
19+ this.currentTag = 'all';
20+ */
21+
22+ }
23+
24+ }
25+}
--- a/front-end/app/scripts/controllers/SelectCommand.ts
+++ b/front-end/app/scripts/controllers/SelectCommand.ts
@@ -1,13 +1,13 @@
11 namespace app.controllers {
22 export class SelectCommand{
33
4- public static $inject = ['$scope', 'APIEndPoint'];
4+ public static $inject = ['$scope', 'APIEndPoint','$uibModalInstance'];
55 private tags: string[];
66 private commands: string[];
77 private searchText: string;
88 private currentTag: string;
99
10- constructor($scope: ng.IScope, private APIEndPoint: services.APIEndPoint) {
10+ constructor($scope: ng.IScope, private APIEndPoint: services.APIEndPoint, private $modalInstance: ng.ui.bootstrap.IModalServiceInstance) {
1111 var controller = this;
1212 this.APIEndPoint
1313 .getTags()
@@ -27,5 +27,10 @@ namespace app.controllers {
2727 private changeTag(tag: string) {
2828 this.currentTag = tag;
2929 }
30+
31+ private selectCommand(command:string) {
32+ this.$modalInstance.close(command);
33+ }
34+
3035 }
3136 }
--- a/front-end/app/scripts/directives/Command.ts
+++ b/front-end/app/scripts/directives/Command.ts
@@ -45,7 +45,7 @@ namespace app.directives {
4545
4646 export class CommandController {
4747
48- public static $inject = ['APIEndPoint', '$scope'];
48+ public static $inject = ['APIEndPoint', '$scope', 'MyModal'];
4949
5050 // From parent directive bindToController property
5151 private index: string;
@@ -63,7 +63,7 @@ namespace app.directives {
6363 private options: declares.IOption[];
6464 private dirs: any;
6565
66- constructor(private APIEndPoint: services.APIEndPoint, private $scope: ng.IScope) {
66+ constructor(private APIEndPoint: services.APIEndPoint, private $scope: ng.IScope, private MyModal: services.MyModal) {
6767 var controller = this;
6868
6969 // Get OptionControlFile and bind it to $scope.options
@@ -148,9 +148,7 @@ namespace app.directives {
148148 }
149149
150150 public debug() {
151- console.log(this.files);
152- console.log(this.files);
153- console.log(this.workspace);
151+ this.MyModal.preview();
154152 }
155153 }
156154 }
--- a/front-end/app/scripts/entry.ts
+++ b/front-end/app/scripts/entry.ts
@@ -22,5 +22,6 @@ import './controllers/Execution.ts';
2222 import './controllers/Workspace.ts';
2323 import './controllers/History.ts';
2424 import './controllers/SelectCommand.ts';
25+import './controllers/Preview.ts';
2526
2627 import './App.ts';
--- a/front-end/app/scripts/reference.ts
+++ b/front-end/app/scripts/reference.ts
@@ -14,5 +14,6 @@
1414 /// <reference path="./controllers/Workspace.ts" />
1515 /// <reference path="./controllers/History.ts" />
1616 /// <reference path="./controllers/SelectCommand.ts" />
17+/// <reference path="./controllers/Preview.ts" />
1718
1819 /// <reference path="./filters/Tag.ts" />
--- a/front-end/app/scripts/services/MyModal.ts
+++ b/front-end/app/scripts/services/MyModal.ts
@@ -3,6 +3,7 @@ namespace app.services {
33
44 private $uibModal: ng.ui.bootstrap.IModalService;
55 private modalOption: ng.ui.bootstrap.IModalSettings;
6+ public static $inject = ['$uibModal'];
67
78 constructor($uibModal: ng.ui.bootstrap.IModalService) {
89 this.$uibModal = $uibModal;
@@ -34,5 +35,13 @@ namespace app.services {
3435 return this.$uibModal.open(this.modalOption);
3536 }
3637
38+ public preview(): ng.ui.bootstrap.IModalServiceInstance {
39+ this.modalOption.templateUrl = 'templates/preview.html';
40+ this.modalOption.controller = 'previewController';
41+ this.modalOption.controllerAs = 'c';
42+ this.modalOption.size = 'lg';
43+ return this.$uibModal.open(this.modalOption);
44+ }
45+
3746 }
3847 }
Show on old repository browser