From bbba33088188129d4d637d565c3c738752f6383a Mon Sep 17 00:00:00 2001 From: Andrew Buss Date: Wed, 13 May 2015 17:31:19 -0700 Subject: [PATCH] Added addclass stuff with autocomplete prototype --- config.js | 20 +++++++++++++------- flashy.css | 29 ++++++++++++++++++++++++++++- gjslint.conf | 1 - home.html | 10 +++++----- scripts/ClassAddController.js | 9 +++++++++ scripts/FeedController.js | 27 ++++++++++++--------------- templates/addclass.html | 20 ++++++++++++++++++++ 7 files changed, 87 insertions(+), 29 deletions(-) create mode 100644 scripts/ClassAddController.js create mode 100644 templates/addclass.html diff --git a/config.js b/config.js index 555f8f7..9df10dc 100644 --- a/config.js +++ b/config.js @@ -4,11 +4,12 @@ angular.module('flashy', [ 'flashy.HomeController', 'flashy.FeedController', 'flashy.DeckController', - 'flashy.RequestResetController', + 'flashy.ClassAddController', + 'flashy.RequestResetController', 'ngCookies']). config(['$stateProvider', '$urlRouterProvider', '$httpProvider', '$locationProvider', - function($stateProvider, $urlRouterProvider, $httpProvider, $locationProvider) { + function ($stateProvider, $urlRouterProvider, $httpProvider, $locationProvider) { 'use strict'; $httpProvider.defaults.withCredentials = true; $httpProvider.defaults.xsrfCookieName = 'csrftoken'; @@ -41,15 +42,20 @@ angular.module('flashy', [ templateUrl: 'templates/feed.html', controller: 'FeedController' }). + state('addclass', { + url: '/classes/add', + templateUrl: 'templates/addclass.html', + controller: 'ClassAddController' + }). state('deck', { url: '/deck', templateUrl: 'templates/deck.html', controller: 'DeckController' }). - state('requestpasswordreset', { - url: '/requestpasswordreset', - templateUrl: 'templates/requestpasswordreset.html', - controller: 'RequestResetController' - }); + state('requestpasswordreset', { + url: '/requestpasswordreset', + templateUrl: 'templates/requestpasswordreset.html', + controller: 'RequestResetController' + }); }]); diff --git a/flashy.css b/flashy.css index 3348554..8c9acbf 100644 --- a/flashy.css +++ b/flashy.css @@ -40,7 +40,34 @@ .container { position: relative; - width: 400px; + width: 600px; height: 80px; } +.angucomplete-dropdown { + border-color: #ececec; + border-width: 1px; + border-style: solid; + border-radius: 2px; + /*width: 250px;*/ + padding: 6px; + cursor: pointer; + z-index: 9999; + position: absolute; + /*top: 32px; + left: 0px; + */ + margin-top: -6px; + background-color: #ffffff; +} + +.angucomplete-description { + font-size: 14px; +} + +.angucomplete-row { + padding: 5px; + color: #000000; + margin-bottom: 4px; + clear: both; +} \ No newline at end of file diff --git a/gjslint.conf b/gjslint.conf index 4046fce..b106210 100644 --- a/gjslint.conf +++ b/gjslint.conf @@ -1,2 +1 @@ ---strict --summary \ No newline at end of file diff --git a/home.html b/home.html index add4d69..414db9a 100644 --- a/home.html +++ b/home.html @@ -18,7 +18,9 @@
- + + + @@ -28,10 +30,8 @@ - - - - + + diff --git a/scripts/ClassAddController.js b/scripts/ClassAddController.js new file mode 100644 index 0000000..2a69386 --- /dev/null +++ b/scripts/ClassAddController.js @@ -0,0 +1,9 @@ +angular.module('flashy.ClassAddController', ['ui.router', 'angucomplete-alt']). + + controller('ClassAddController', ['$scope', '$state', function ($scope, $state) { + + $scope.remoteUrlRequestFn = function (str) { + return {q: str}; + }; + + }]); diff --git a/scripts/FeedController.js b/scripts/FeedController.js index 84b3ed0..79e5bca 100644 --- a/scripts/FeedController.js +++ b/scripts/FeedController.js @@ -1,21 +1,18 @@ angular.module('flashy.FeedController', ['ui.router']). -controller('FeedController', ['$scope', '$state', function($scope, $state) { - console.log('Hello from feed'); + controller('FeedController', ['$scope', '$state', function ($scope, $state) { + console.log('Hello from feed'); + $scope.createCard = function () { - $scope.createCard = function () { + $(document).ready(function () { + $("#createCardModal").modal('show'); + }); + } - $(document).ready(function () { - $("#createCardModal").modal('show'); - }); - } + $scope.viewDeck = function () { + $state.go('deck'); + console.log("go to deck"); + } - - - $scope.viewDeck = function () { - $state.go('deck'); - console.log("go to deck"); - } - -}]); + }]); diff --git a/templates/addclass.html b/templates/addclass.html new file mode 100644 index 0000000..137cf2c --- /dev/null +++ b/templates/addclass.html @@ -0,0 +1,20 @@ +
+
+
+ You selected {{selectedClass.course_num}} + which + has a country code of {{selectedClass.instructor}} +
+
\ No newline at end of file -- 1.9.1