Adding darkswarm variant of home page, getting Angular skeleton into place, taking shit off window

This commit is contained in:
Will Marshall
2014-04-18 13:01:36 +10:00
parent c0228e0cc3
commit 6753b96f29
18 changed files with 107 additions and 13 deletions

View File

@@ -10,6 +10,8 @@
#= require ../shared/bindonce.min.js
#= require ../shared/ng-infinite-scroll.min.js
#= require ../shared/angular-local-storage.js
#= require ../search/jquery.backstretch.js
#= require angular-backstretch.js
#= require angular-flash.min.js
#
#= require ../shared/jquery.timeago

View File

@@ -1,4 +1,4 @@
window.AccountSidebarCtrl = Darkswarm.controller "AccountSidebarCtrl", ($scope, $http, $location, SpreeUser, Navigation) ->
Darkswarm.controller "AccountSidebarCtrl", ($scope, $http, $location, SpreeUser, Navigation) ->
$scope.path = "/account"
Navigation.paths.push $scope.path

View File

@@ -1,4 +1,4 @@
window.AuthenticationActionsCtrl = Darkswarm.controller "AuthenticationActionsCtrl", ($scope, Navigation, storage) ->
Darkswarm.controller "AuthenticationActionsCtrl", ($scope, Navigation, storage) ->
$scope.toggleLogin = ->
Navigation.navigate "/login"

View File

@@ -1,4 +1,4 @@
window.ForgotSidebarCtrl = Darkswarm.controller "ForgotSidebarCtrl", ($scope, $http, $location, SpreeUser, Navigation) ->
Darkswarm.controller "ForgotSidebarCtrl", ($scope, $http, $location, SpreeUser, Navigation) ->
$scope.spree_user = SpreeUser.spree_user
$scope.path = "/forgot"
$scope.sent = false

View File

@@ -0,0 +1,4 @@
Darkswarm.controller "HubsCtrl", ($scope, Hubs) ->
console.log Hubs.hubs[0]
$scope.Hubs = Hubs
$scope.hubs = Hubs.hubs

View File

@@ -1,4 +1,4 @@
window.LoginSidebarCtrl = Darkswarm.controller "LoginSidebarCtrl", ($scope, $http, $location, SpreeUser, Navigation) ->
Darkswarm.controller "LoginSidebarCtrl", ($scope, $http, $location, SpreeUser, Navigation) ->
$scope.spree_user = SpreeUser.spree_user
$scope.path = "/login"
Navigation.paths.push $scope.path

View File

@@ -1,4 +1,4 @@
window.SidebarCtrl = Darkswarm.controller "SidebarCtrl", ($scope, $location) ->
Darkswarm.controller "SidebarCtrl", ($scope, $location) ->
$scope.sidebarPaths = ["/login", "/signup", "/forgot", "/account"]
$scope.active = ->

View File

@@ -1,4 +1,4 @@
window.SignupSidebarCtrl = Darkswarm.controller "SignupSidebarCtrl", ($scope, $http, $location, SpreeUser, Navigation) ->
Darkswarm.controller "SignupSidebarCtrl", ($scope, $http, $location, SpreeUser, Navigation) ->
$scope.spree_user = SpreeUser.spree_user
$scope.path = "/signup"
Navigation.paths.push $scope.path

View File

@@ -1,4 +1,4 @@
window.Darkswarm = angular.module("Darkswarm", ["ngResource", "filters", 'mm.foundation', 'angularLocalStorage', 'pasvaz.bindonce', 'infinite-scroll', 'angular-flash.service']).config ($httpProvider, $tooltipProvider) ->
window.Darkswarm = angular.module("Darkswarm", ["ngResource", "filters", 'mm.foundation', 'angularLocalStorage', 'pasvaz.bindonce', 'infinite-scroll', 'angular-flash.service', 'backstretch']).config ($httpProvider, $tooltipProvider) ->
$httpProvider.defaults.headers.post['X-CSRF-Token'] = $('meta[name="csrf-token"]').attr('content')
$httpProvider.defaults.headers.put['X-CSRF-Token'] = $('meta[name="csrf-token"]').attr('content')
$httpProvider.defaults.headers['common']['X-Requested-With'] = 'XMLHttpRequest'

View File

@@ -0,0 +1,9 @@
Darkswarm.directive "ofnDisableEnter", ()->
restrict: 'A'
link: (scope, element, attrs)->
element.bind "keydown keypress", (e)->
code = e.keyCode || e.which
if code == 13
e.preventDefault()

View File

@@ -0,0 +1,4 @@
Darkswarm.factory 'Hubs', ($location, hubs) ->
new class Hubs
constructor: ->
@hubs = hubs