From 07c9ec7bfb49488ad096e31b1716392fed4e35ef Mon Sep 17 00:00:00 2001 From: Omar Duarte Date: Sat, 21 Feb 2015 13:04:53 -0800 Subject: [PATCH] Beautification of the moment view Add cards and ionic button styles Add concatCss and allowed Sass transpiling Remove dynamic text are plugin as it was breaking tests Removed dynamic textarea plugin Adds new styles to moment-view Fixes typo and several formatting issues Removes angular-elastic from bower.json This removes a third party angular plugin that allowed easy resize of a text area given the amount of text in it. It was removed because it was breaking the tests. We might be able to add it later when we're in the polishing stages. Restores $httpProvider.defaults.withCredentials = true; --- bower.json | 2 ++ client/www/app/app.module.js | 9 +++++-- .../app/moment/items/moment.items.module.js | 5 ++-- .../app/moment/items/newItem.directive.html | 18 ++++++------- .../www/app/moment/items/newItem.directive.js | 22 +-------------- .../app/moment/items/newText.directive.html | 22 ++++++++++----- .../app/moment/items/showText.directive.html | 8 +++--- .../app/moment/items/showText.directive.js | 22 +++++++-------- .../app/moment/moment.create.controller.js | 2 +- client/www/app/moment/moment.create.html | 13 +++++---- .../app/moment/moment.render.controller.js | 2 +- client/www/content/css/app.css | 11 ++++++++ client/www/content/sass/items.scss | 10 +++++++ client/www/content/sass/moment.scss | 5 ++++ client/www/index.html | 1 + gulpfile.js | 27 ++++++++++--------- package.json | 1 + 17 files changed, 107 insertions(+), 73 deletions(-) create mode 100644 client/www/content/css/app.css create mode 100644 client/www/content/sass/items.scss create mode 100644 client/www/content/sass/moment.scss diff --git a/bower.json b/bower.json index 56e7e2e..7f015d3 100644 --- a/bower.json +++ b/bower.json @@ -4,5 +4,7 @@ "devDependencies": { "ionic": "driftyco/ionic-bower#1.0.0-beta.14", "angular-mocks": "~1.3.13" + }, + "dependencies": { } } diff --git a/client/www/app/app.module.js b/client/www/app/app.module.js index 63729f8..b0aad27 100644 --- a/client/www/app/app.module.js +++ b/client/www/app/app.module.js @@ -8,7 +8,7 @@ 'app.moment', 'app.mementos', 'app.memento', - 'app.memento.create' + 'app.memento.create', 'app.user.auth' ]) @@ -27,6 +27,11 @@ }) .config(function($httpProvider) { + + // IMPORTANT + // This will not work when testing in the browser. You will need + // to comment this out if you'd like to test the app in Chrome. + // Otherwise, it works great in the iOS simulator/built app. $httpProvider.defaults.withCredentials = true; delete $httpProvider.defaults.headers.common["X-Requested-With"]; }) @@ -55,7 +60,7 @@ url: '/create', templateUrl: 'app/memento-create/memento.create.html', controller: 'MementoCreate as vm' - }); + }) .state('signup', { url: '/signup', diff --git a/client/www/app/moment/items/moment.items.module.js b/client/www/app/moment/items/moment.items.module.js index b3de9ef..65de0e5 100644 --- a/client/www/app/moment/items/moment.items.module.js +++ b/client/www/app/moment/items/moment.items.module.js @@ -1,5 +1,6 @@ (function() { + 'use strict'; - angular.module('app.moment.items', []); -})(); \ No newline at end of file + +})(); diff --git a/client/www/app/moment/items/newItem.directive.html b/client/www/app/moment/items/newItem.directive.html index cfc93cb..c1b22b4 100644 --- a/client/www/app/moment/items/newItem.directive.html +++ b/client/www/app/moment/items/newItem.directive.html @@ -1,13 +1,13 @@ -
+
- +
- - - - +
+ + + + +
- - -
\ No newline at end of file +
diff --git a/client/www/app/moment/items/newItem.directive.js b/client/www/app/moment/items/newItem.directive.js index b1cb2c9..15c2896 100644 --- a/client/www/app/moment/items/newItem.directive.js +++ b/client/www/app/moment/items/newItem.directive.js @@ -20,33 +20,13 @@ return directive; function link(scope, element, attrs) { - scope.typeSelected = null; - scope.newItemButtonWasTapped = false; + scope.typeSelected = null; ; scope.insertIntoMoment = insertIntoMoment; scope.selectType = selectType; scope.done = done; - activate(); - /////////////////////////////////////// - function activate() { - $ionicGesture.on('tap', function (ev) { - showThenHideButtons(); - }, element); - } - - function showThenHideButtons() { - scope.newItemButtonWasTapped = true; - - $timeout(function() { - scope.newItemButtonWasTapped = false; - scope.$apply(); - }, 3500); - - scope.$apply(); - } - function insertIntoMoment(type, url) { scope.moment.content.push({ type: type, diff --git a/client/www/app/moment/items/newText.directive.html b/client/www/app/moment/items/newText.directive.html index 61614cc..2d95313 100644 --- a/client/www/app/moment/items/newText.directive.html +++ b/client/www/app/moment/items/newText.directive.html @@ -1,6 +1,16 @@ -
-

Write something memorable:

- - - -
\ No newline at end of file +
+ +
+

Write something memorable

+
+ +
+ +
+ +
+ + +
+ +
diff --git a/client/www/app/moment/items/showText.directive.html b/client/www/app/moment/items/showText.directive.html index 4ba5820..fbce82c 100644 --- a/client/www/app/moment/items/showText.directive.html +++ b/client/www/app/moment/items/showText.directive.html @@ -1,3 +1,5 @@ -
- {{ item.url }} -
\ No newline at end of file +
+
+ {{ item.url }} +
+
diff --git a/client/www/app/moment/items/showText.directive.js b/client/www/app/moment/items/showText.directive.js index 851f8e3..8551758 100644 --- a/client/www/app/moment/items/showText.directive.js +++ b/client/www/app/moment/items/showText.directive.js @@ -1,19 +1,19 @@ (function() { angular - .module('app.moment.items') - .directive('showText', showText); + .module('app.moment.items') + .directive('showText', showText); - /* @ngInject */ - function showText() { + /* @ngInject */ + function showText() { - var directive = { - restrict: 'EA', - templateUrl: 'app/moment/items/showText.directive.html', - replace: true - }; + var directive = { + restrict: 'EA', + templateUrl: 'app/moment/items/showText.directive.html', + replace: true + }; - return directive; - } + return directive; + } })(); diff --git a/client/www/app/moment/moment.create.controller.js b/client/www/app/moment/moment.create.controller.js index 56eb7a9..570432a 100644 --- a/client/www/app/moment/moment.create.controller.js +++ b/client/www/app/moment/moment.create.controller.js @@ -52,4 +52,4 @@ } -})(); \ No newline at end of file +})(); diff --git a/client/www/app/moment/moment.create.html b/client/www/app/moment/moment.create.html index e555a9b..e52c974 100644 --- a/client/www/app/moment/moment.create.html +++ b/client/www/app/moment/moment.create.html @@ -2,9 +2,12 @@ - - - + +
+ +
@@ -19,8 +22,8 @@ - - + + diff --git a/client/www/app/moment/moment.render.controller.js b/client/www/app/moment/moment.render.controller.js index 953e710..677615b 100644 --- a/client/www/app/moment/moment.render.controller.js +++ b/client/www/app/moment/moment.render.controller.js @@ -26,4 +26,4 @@ } -})(); \ No newline at end of file +})(); diff --git a/client/www/content/css/app.css b/client/www/content/css/app.css new file mode 100644 index 0000000..c595bfa --- /dev/null +++ b/client/www/content/css/app.css @@ -0,0 +1,11 @@ +.new-items .buttons { + display: block; + margin: 0 auto; +} + +.new-items .buttons button { + display: inline-block; +} +.moment-title input[type='text'] { + text-align: center; +} \ No newline at end of file diff --git a/client/www/content/sass/items.scss b/client/www/content/sass/items.scss new file mode 100644 index 0000000..43c0019 --- /dev/null +++ b/client/www/content/sass/items.scss @@ -0,0 +1,10 @@ +.new-items { + .buttons { + display: block; + margin: 0 auto; + + button { + display: inline-block; + } + } +} \ No newline at end of file diff --git a/client/www/content/sass/moment.scss b/client/www/content/sass/moment.scss new file mode 100644 index 0000000..d9d57b5 --- /dev/null +++ b/client/www/content/sass/moment.scss @@ -0,0 +1,5 @@ +.moment-title { + input[type='text'] { + text-align: center; + } +} \ No newline at end of file diff --git a/client/www/index.html b/client/www/index.html index 48f4325..ba595fd 100644 --- a/client/www/index.html +++ b/client/www/index.html @@ -6,6 +6,7 @@ +