From ab43d5cec98a102664262523e311e2a94449e885 Mon Sep 17 00:00:00 2001 From: Mohsen Azimi Date: Mon, 15 Dec 2014 15:10:29 -0800 Subject: [PATCH] Add 'About Swagger Editor' menu option and modal and some UI modification Fixed #271 --- app/index.html | 1 + app/scripts/controllers/header.js | 8 ++++++++ app/scripts/controllers/modal.js | 9 +++++++++ app/styles/components/header.less | 2 +- app/styles/components/modal.less | 8 ++++++++ app/templates/about.html | 25 +++++++++++++++++++++++++ app/views/header/header.html | 7 +++++-- 7 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 app/scripts/controllers/modal.js create mode 100644 app/templates/about.html diff --git a/app/index.html b/app/index.html index 5affed6052a..563105847b3 100644 --- a/app/index.html +++ b/app/index.html @@ -68,6 +68,7 @@ + diff --git a/app/scripts/controllers/header.js b/app/scripts/controllers/header.js index 9a0b0c3055f..39b7ab29c5c 100644 --- a/app/scripts/controllers/header.js +++ b/app/scripts/controllers/header.js @@ -101,6 +101,14 @@ PhonicsApp.controller('HeaderCtrl', function HeaderCtrl($scope, $modal, }); }; + $scope.openAbout = function () { + $modal.open({ + templateUrl: 'templates/about.html', + size: 'large', + controller: 'ModalCtrl' + }); + }; + $scope.toggleAboutEditor = function (value) { $scope.showAbout = value; }; diff --git a/app/scripts/controllers/modal.js b/app/scripts/controllers/modal.js new file mode 100644 index 00000000000..e67cb71d902 --- /dev/null +++ b/app/scripts/controllers/modal.js @@ -0,0 +1,9 @@ +'use strict'; + +/* + * General modal controller +*/ +PhonicsApp.controller('ModalCtrl', function ModalCtrl($scope, $modalInstance) { + $scope.cancel = $modalInstance.close; + $scope.close = $modalInstance.close; +}); diff --git a/app/styles/components/header.less b/app/styles/components/header.less index 09d4b0e25a4..96a8bbc6813 100644 --- a/app/styles/components/header.less +++ b/app/styles/components/header.less @@ -8,7 +8,7 @@ z-index: 5; } -span.logo { +a.logo { background-image: url("../images/swagger-sprite.png"); background-repeat: no-repeat; background-position: 0 -25px; diff --git a/app/styles/components/modal.less b/app/styles/components/modal.less index d0c460fb281..ae1511ae684 100644 --- a/app/styles/components/modal.less +++ b/app/styles/components/modal.less @@ -40,6 +40,10 @@ select { color: #000000; // 1 } + + a { + color: rgb(15, 214, 250); + } } .modal-footer { @@ -56,4 +60,8 @@ } } } + + .monospace { + font-family: monospace; + } } diff --git a/app/templates/about.html b/app/templates/about.html new file mode 100644 index 00000000000..e80a002a586 --- /dev/null +++ b/app/templates/about.html @@ -0,0 +1,25 @@ + + + diff --git a/app/views/header/header.html b/app/views/header/header.html index 3ab226071b8..d56ff1f8d41 100644 --- a/app/views/header/header.html +++ b/app/views/header/header.html @@ -1,6 +1,6 @@
- +