From e18e186be0cba2a68b3a0acf51109c7c908f5846 Mon Sep 17 00:00:00 2001 From: Ben Ramey Date: Tue, 11 Mar 2014 22:11:39 -0500 Subject: [PATCH] Angular stuff --- .gitignore | 1 + api/models/Run.js | 4 +- assets/linker/js/.app.coffee.swp | Bin 12288 -> 0 bytes assets/linker/js/.controllers.coffee.swp | Bin 12288 -> 0 bytes assets/linker/js/controllers.coffee | 7 ++- assets/linker/js/features/socket.js | 71 ----------------------- assets/linker/js/services/socket.coffee | 8 +++ assets/templates/.home.jade.swp | Bin 12288 -> 0 bytes assets/templates/.runs.jade.swp | Bin 12288 -> 0 bytes assets/templates/home.jade | 2 +- views/.layout.jade.swp | Bin 12288 -> 0 bytes views/layout.jade | 2 +- 12 files changed, 18 insertions(+), 77 deletions(-) delete mode 100644 assets/linker/js/.app.coffee.swp delete mode 100644 assets/linker/js/.controllers.coffee.swp delete mode 100644 assets/linker/js/features/socket.js create mode 100644 assets/linker/js/services/socket.coffee delete mode 100644 assets/templates/.home.jade.swp delete mode 100644 assets/templates/.runs.jade.swp delete mode 100644 views/.layout.jade.swp diff --git a/.gitignore b/.gitignore index 7759ab5..a844be4 100644 --- a/.gitignore +++ b/.gitignore @@ -48,4 +48,5 @@ config/local.js # custom ignores ######################## assets/templates/*.html +*.swp diff --git a/api/models/Run.js b/api/models/Run.js index 651de0f..6863afc 100644 --- a/api/models/Run.js +++ b/api/models/Run.js @@ -17,7 +17,9 @@ module.exports = { type: 'email', required: true }, - groupEmails: 'String', + groupEmails: { + type: 'array' + }, menuUrl: { type: 'url' }, diff --git a/assets/linker/js/.app.coffee.swp b/assets/linker/js/.app.coffee.swp deleted file mode 100644 index a3ddca9fab40c5b175e2b901d0cce5b49073fb7f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI&Jxjwt7zgmHyD#Y0F6RqGp(a%aMNkkybWo&4m*SA7*EV{&gv-Tl`UU(3eh9^H z;pFP^)$tAyj(z z-xj%vv}NeIa(L+tE$GyIBVtD;%Ii3891BAizPb|Hxr`k*ifk`zwS*YH5=J2afsq6f z(^}n{WE<;im2}?X!aSdwJsW8W6hi<45P$##AOHafKmY>cEnuPoyQN2%=s(7Ezc2jg z`;p=?snAOHafKmY;|fB*y_009U~2RWZe`psBo|r-{G!mC(_k+5H=GjcyBIkLnd|h34WWW!TkIx2;`v<#ivB?}!`K(JI9oQuf?eCNpa39*y~)UVOc z(g8jPBNK>Ez{}ksl~f8;og)1$J=y2;y*&RmEADp=zwPqpc$=gx6P?_=-~Sz-(rr%E z*TrP^#Wq%@iH%K_nZ5LfBuw^4LHop%MVckbdmZFqRGes+9Q!1-MR3*_?R=ctqa&?n zXT)0wK;ZQPZ)p3|$IfK^#`+q+TRC|Br&tLA2tWV=5P$##AOHaf%)LMuFVMN{VzJrD z+ooTb>YGP&5P$##AOHafKmY;|fB*y_009Whp@13?t;(VQcyjQU|No!P|JO@IR}w!Z zE+sA`IugqgOA-&V@Lu9h;+KSxsB+Aq0ZN7d1Rwwb2tWV=5P$##AOL~?7w9#OxJN9l zai)#2yMD-DII6}RGVL_??U`p)40t$l#;-+GT@>#=yB7X*MVzC(vhdyDOw{J@ zQJq(L`?OtZiM diff --git a/assets/linker/js/controllers.coffee b/assets/linker/js/controllers.coffee index 7b8e293..e95bc92 100644 --- a/assets/linker/js/controllers.coffee +++ b/assets/linker/js/controllers.coffee @@ -3,10 +3,11 @@ lunchControllers = angular.module 'lunchControllers', [] lunchControllers.controller 'HomeCtrl', ['$scope', ($scope) -> ] -lunchControllers.controller 'CreateRunCtrl', ['$scope', '$http', ($scope, $http) -> - $scope.msg = 'im home, yah' - +lunchControllers.controller 'CreateRunCtrl', ['$scope', '$http', 'socket', ($scope, $http, socket) -> + $scope.stuffs = [{name: 'my name'}] $scope.create = (run) -> + socket.post '/run', run, (response) -> + ] lunchControllers.controller 'RunsCtrl', ['$scope', '$http', ($scope, $http) -> diff --git a/assets/linker/js/features/socket.js b/assets/linker/js/features/socket.js deleted file mode 100644 index 2c9b551..0000000 --- a/assets/linker/js/features/socket.js +++ /dev/null @@ -1,71 +0,0 @@ -/** - * app.js - * - * This file contains some conventional defaults for working with Socket.io + Sails. - * It is designed to get you up and running fast, but is by no means anything special. - * - * Feel free to change none, some, or ALL of this file to fit your needs! - */ - - -(function (io) { - - // as soon as this file is loaded, connect automatically, - var socket = io.connect(); - if (typeof console !== 'undefined') { - log('Connecting to Sails.js...'); - } - - socket.on('connect', function socketConnected() { - - // Listen for Comet messages from Sails - socket.on('message', function messageReceived(message) { - - /////////////////////////////////////////////////////////// - // Replace the following with your own custom logic - // to run when a new message arrives from the Sails.js - // server. - /////////////////////////////////////////////////////////// - log('New comet message received :: ', message); - ////////////////////////////////////////////////////// - - }); - - - /////////////////////////////////////////////////////////// - // Here's where you'll want to add any custom logic for - // when the browser establishes its socket connection to - // the Sails.js server. - /////////////////////////////////////////////////////////// - log( - 'Socket is now connected and globally accessible as `socket`.\n' + - 'e.g. to send a GET request to Sails, try \n' + - '`socket.get("/", function (response) ' + - '{ console.log(response); })`' - ); - /////////////////////////////////////////////////////////// - - - }); - - - // Expose connected `socket` instance globally so that it's easy - // to experiment with from the browser console while prototyping. - window.socket = socket; - - - // Simple log function to keep the example simple - function log () { - if (typeof console !== 'undefined') { - console.log.apply(console, arguments); - } - } - - -})( - - // In case you're wrapping socket.io to prevent pollution of the global namespace, - // you can replace `window.io` with your own `io` here: - window.io - -); diff --git a/assets/linker/js/services/socket.coffee b/assets/linker/js/services/socket.coffee new file mode 100644 index 0000000..cbad1bf --- /dev/null +++ b/assets/linker/js/services/socket.coffee @@ -0,0 +1,8 @@ +socketModule = angular.module 'socketModule', [] + socketModule.factory 'socket', ()-> +s = window.io.connect() + s.on 'connect', ()-> + s.on 'message', (message)-> + console.log 'New comet message received :: ', message + + return socket diff --git a/assets/templates/.home.jade.swp b/assets/templates/.home.jade.swp deleted file mode 100644 index f4d42b8443bdb7c3af8391e6f8e03e082eeaf6b3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI2O^ee&7{_P#sIH2F7cbLRNDFPc+db&Po{EUz?xCfE;ANW3w$aH`fQ5woxJ1aa z%U~Y<{~!PU|9y>+&!G39x1d8%9rWueA@4vIbRYC}hma4Tm!JY@8}#W4AsW;H6+mC0 z_D7KGv4M=xG7>-nNB{{S0VIF~kN^_62mv~G^sF&T`aR=ROLP=7eO8wJS|Fm}MY9-a z4zIzMwUw1(6{f=|Wj(>eX7Nbr*uN9W6DFdtSfMQ!N#+{Rg^4U6l8H5?m`mH$!p|zz z0ws-BqHN9*-t?>%Ue+#FAs0;#+WUF5S6Nz7upSp>sMPc(f%E_x&~E$jLPi*!jJo!< zvdO|_aF|=vJT=T}Ce1RJhM$^wn}0J_JDrZD?MbTzKNql@Sz+)El-wOXh*>1kSrnIv>>v*&jT>W{<(@AUipGm9Gr^@P) z|Npjs$lx{cB@21k63Ja;DeHT8S-Euy71nW{`738hO)nb)RONOr?C>h=z47$yG8i=S ztxXw~d`Mw0PI|(^bkB;>-W42nU&}oP+E%sDF6Tf diff --git a/assets/templates/.runs.jade.swp b/assets/templates/.runs.jade.swp deleted file mode 100644 index 8d614889945aa348e057ae2e1888e595ea3e8b2a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI%F;2rU6oBDZc0@%-76W@+nt?MgWU7GKO)MJZI8p4tP!+Dgoj3t!VB!`{5R4S5 zTcqETW%=2D^7}T+tNGncrmmAz`Zg7L`#4+Pt7rMDL{`=h(SKWGI+wUQH*Wvdmp-9h zmeB_7I-jq#3BksoqpccehH%^YkUW~g?oY%j0tg%+a4hNKYCasiyf|00)7t}ba0CGa z5I_I{1Q0*~0R+Y>5Sxj-_Lo2UDPZ!)IM({OHv$MCfB*srAb1gh5XUE!kN^TY3NDudM~d(4q#%up04^fgD2knklLz zy#If@1n>d%4)q509CaUc4fX3Hz)#e7)F;$?)JxP0)Kk$^hxQ3q?zs1_DXLZ*ct%8ESh?{_Bd-KAZXVsGW(MS=%GNIzD4( z!@N_nJ><@A8arja4AwXpA;(^F1%um_gf+QmQ<+6^-(HjT&d95cy?RiZ2-22RMsZPa zwdn}1L(UD>Tc~(rRB*j1fAs4I`p