mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Remove Darkswarm from window
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
Darkswarm.controller "ForgotCtrl", ($scope, $http, $location, AuthenticationService) ->
|
||||
angular.module('Darkswarm').controller "ForgotCtrl", ($scope, $http, $location, AuthenticationService) ->
|
||||
$scope.path = "/forgot"
|
||||
$scope.sent = false
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.controller "LoginCtrl", ($scope, $timeout, $location, $http, $window, AuthenticationService, Redirections, Loading) ->
|
||||
angular.module('Darkswarm').controller "LoginCtrl", ($scope, $timeout, $location, $http, $window, AuthenticationService, Redirections, Loading) ->
|
||||
$scope.path = "/login"
|
||||
|
||||
$scope.modalMessage = null
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.controller "SignupCtrl", ($scope, $http, $window, $location, Redirections, AuthenticationService) ->
|
||||
angular.module('Darkswarm').controller "SignupCtrl", ($scope, $http, $window, $location, Redirections, AuthenticationService) ->
|
||||
$scope.path = "/signup"
|
||||
|
||||
$scope.spree_user.password_confirmation = ''
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.controller "AuthenticationCtrl", ($scope, AuthenticationService, SpreeUser)->
|
||||
angular.module('Darkswarm').controller "AuthenticationCtrl", ($scope, AuthenticationService, SpreeUser)->
|
||||
$scope.open = AuthenticationService.open
|
||||
$scope.toggle = AuthenticationService.toggle
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.controller "CartCtrl", ($scope, Cart, CurrentHub) ->
|
||||
angular.module('Darkswarm').controller "CartCtrl", ($scope, Cart, CurrentHub) ->
|
||||
$scope.Cart = Cart
|
||||
$scope.CurrentHub = CurrentHub
|
||||
$scope.max_characters = 20
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.controller "CartDropdownCtrl", ($scope, Cart, BodyScroll) ->
|
||||
angular.module('Darkswarm').controller "CartDropdownCtrl", ($scope, Cart, BodyScroll) ->
|
||||
$scope.Cart = Cart
|
||||
$scope.showCartSidebar = false
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
Darkswarm.controller "CartFormCtrl", ($scope) ->
|
||||
angular.module('Darkswarm').controller "CartFormCtrl", ($scope) ->
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.controller "AccordionCtrl", ($scope, localStorageService, $timeout, $document, CurrentHub) ->
|
||||
angular.module('Darkswarm').controller "AccordionCtrl", ($scope, localStorageService, $timeout, $document, CurrentHub) ->
|
||||
$scope.accordionSections = ["details", "billing", "shipping", "payment"]
|
||||
$scope.accordion = { details: true, billing: true, shipping: true, payment: true }
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.controller "BillingCtrl", ($scope, $timeout) ->
|
||||
angular.module('Darkswarm').controller "BillingCtrl", ($scope, $timeout) ->
|
||||
angular.extend(this, new FieldsetMixin($scope))
|
||||
$scope.name = "billing"
|
||||
$scope.nextPanel = "shipping"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.controller "CheckoutCtrl", ($scope, localStorageService, Checkout, CurrentUser, CurrentHub, AuthenticationService, SpreeUser, $http) ->
|
||||
angular.module('Darkswarm').controller "CheckoutCtrl", ($scope, localStorageService, Checkout, CurrentUser, CurrentHub, AuthenticationService, SpreeUser, $http) ->
|
||||
$scope.Checkout = Checkout
|
||||
$scope.submitted = false
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.controller "CountryCtrl", ($scope, availableCountries) ->
|
||||
angular.module('Darkswarm').controller "CountryCtrl", ($scope, availableCountries) ->
|
||||
|
||||
$scope.countries = availableCountries
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.controller "DetailsCtrl", ($scope, $timeout, $http, CurrentUser, AuthenticationService, SpreeUser) ->
|
||||
angular.module('Darkswarm').controller "DetailsCtrl", ($scope, $timeout, $http, CurrentUser, AuthenticationService, SpreeUser) ->
|
||||
angular.extend(this, new FieldsetMixin($scope))
|
||||
$scope.name = "details"
|
||||
$scope.nextPanel = "billing"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.controller "PaymentCtrl", ($scope, $timeout, savedCreditCards, Dates) ->
|
||||
angular.module('Darkswarm').controller "PaymentCtrl", ($scope, $timeout, savedCreditCards, Dates) ->
|
||||
angular.extend(this, new FieldsetMixin($scope))
|
||||
|
||||
$scope.savedCreditCards = savedCreditCards
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.controller "ShippingCtrl", ($scope, $timeout, ShippingMethods) ->
|
||||
angular.module('Darkswarm').controller "ShippingCtrl", ($scope, $timeout, ShippingMethods) ->
|
||||
angular.extend(this, new FieldsetMixin($scope))
|
||||
$scope.ShippingMethods = ShippingMethods
|
||||
$scope.name = "shipping"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.controller "CreditCardsCtrl", ($scope, CreditCard, CreditCards) ->
|
||||
angular.module('Darkswarm').controller "CreditCardsCtrl", ($scope, CreditCard, CreditCards) ->
|
||||
angular.extend(this, new FieldsetMixin($scope))
|
||||
$scope.savedCreditCards = CreditCards.saved
|
||||
$scope.confirmSetDefault = CreditCards.confirmSetDefault
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
Darkswarm.controller "CurrentHubCtrl", ($scope, CurrentHub) ->
|
||||
angular.module('Darkswarm').controller "CurrentHubCtrl", ($scope, CurrentHub) ->
|
||||
$scope.CurrentHub = CurrentHub
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.controller "EditBoughtOrderController", ($scope, $resource, $timeout, Cart, Messages) ->
|
||||
angular.module('Darkswarm').controller "EditBoughtOrderController", ($scope, $resource, $timeout, Cart, Messages) ->
|
||||
$scope.showBought = false
|
||||
$scope.removeEnabled = true
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.controller "EnterprisesCtrl", ($scope, $rootScope, $timeout, $location, Enterprises, Search, $document, HashNavigation, FilterSelectorsService, EnterpriseModal, enterpriseMatchesNameQueryFilter, distanceWithinKmFilter) ->
|
||||
angular.module('Darkswarm').controller "EnterprisesCtrl", ($scope, $rootScope, $timeout, $location, Enterprises, Search, $document, HashNavigation, FilterSelectorsService, EnterpriseModal, enterpriseMatchesNameQueryFilter, distanceWithinKmFilter) ->
|
||||
$scope.Enterprises = Enterprises
|
||||
$scope.producers_to_filter = Enterprises.producers
|
||||
$scope.filterSelectors = FilterSelectorsService.createSelectors()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.controller "GroupEnterprisesCtrl", ($scope, Search, FilterSelectorsService, EnterpriseModal) ->
|
||||
angular.module('Darkswarm').controller "GroupEnterprisesCtrl", ($scope, Search, FilterSelectorsService, EnterpriseModal) ->
|
||||
$scope.filterSelectors = FilterSelectorsService.createSelectors()
|
||||
$scope.query = Search.search()
|
||||
$scope.openModal = EnterpriseModal.open
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
Darkswarm.controller "GroupPageCtrl", ($scope, enterprises, Enterprises) ->
|
||||
angular.module('Darkswarm').controller "GroupPageCtrl", ($scope, enterprises, Enterprises) ->
|
||||
$scope.Enterprises = Enterprises
|
||||
$scope.embedded_layout = window.location.search.indexOf("embedded_shopfront=true") != -1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.controller "GroupTabsCtrl", ($scope, $controller, Navigation) ->
|
||||
angular.module('Darkswarm').controller "GroupTabsCtrl", ($scope, $controller, Navigation) ->
|
||||
angular.extend this, $controller('TabsCtrl', {$scope: $scope})
|
||||
|
||||
$scope.tabs =
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.controller "GroupsCtrl", ($scope, Groups, Search) ->
|
||||
angular.module('Darkswarm').controller "GroupsCtrl", ($scope, Groups, Search) ->
|
||||
$scope.Groups = Groups
|
||||
$scope.order = 'position'
|
||||
$scope.query = Search.search()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.controller "HomeCtrl", ($scope) ->
|
||||
angular.module('Darkswarm').controller "HomeCtrl", ($scope) ->
|
||||
$scope.brandStoryExpanded = false
|
||||
|
||||
$scope.toggleBrandStory = ->
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.controller "HubNodeCtrl", ($scope, HashNavigation, CurrentHub, $http, $timeout) ->
|
||||
angular.module('Darkswarm').controller "HubNodeCtrl", ($scope, HashNavigation, CurrentHub, $http, $timeout) ->
|
||||
$scope.shopfront_loading = false
|
||||
$scope.enterprise_details = []
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
Darkswarm.controller "MapCtrl", ($scope, MapConfiguration, OfnMap)->
|
||||
angular.module('Darkswarm').controller "MapCtrl", ($scope, MapConfiguration, OfnMap)->
|
||||
$scope.OfnMap = OfnMap
|
||||
$scope.map = angular.copy MapConfiguration.options
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.controller "OffcanvasCtrl", ($scope) ->
|
||||
angular.module('Darkswarm').controller "OffcanvasCtrl", ($scope) ->
|
||||
$scope.menu = $(".left-off-canvas-menu")
|
||||
|
||||
$scope.setOffcanvasMenuHeight = ->
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
Darkswarm.controller "OrderCycleCtrl", ($scope, $rootScope, $timeout, OrderCycle) ->
|
||||
angular.module('Darkswarm').controller "OrderCycleCtrl", ($scope, $rootScope, $timeout, OrderCycle) ->
|
||||
$scope.order_cycle = OrderCycle.order_cycle
|
||||
$scope.OrderCycle = OrderCycle
|
||||
|
||||
Darkswarm.controller "OrderCycleChangeCtrl", ($scope, $rootScope, $timeout, OrderCycle, Products, Variants, Cart, ChangeableOrdersAlert) ->
|
||||
angular.module('Darkswarm').controller "OrderCycleChangeCtrl", ($scope, $rootScope, $timeout, OrderCycle, Products, Variants, Cart, ChangeableOrdersAlert) ->
|
||||
# Track previous order cycle id for use with revertOrderCycle()
|
||||
$scope.previous_order_cycle_id = OrderCycle.order_cycle.order_cycle_id
|
||||
$scope.$watch 'order_cycle.order_cycle_id', (newValue, oldValue)->
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
Darkswarm.controller "OrdersCtrl", ($scope, Orders) ->
|
||||
angular.module('Darkswarm').controller "OrdersCtrl", ($scope, Orders) ->
|
||||
$scope.Orders = Orders
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.controller "PageSelectionCtrl", ($scope, $rootScope, $location) ->
|
||||
angular.module('Darkswarm').controller "PageSelectionCtrl", ($scope, $rootScope, $location) ->
|
||||
$scope.selectedPage = ->
|
||||
# The path looks like `/contact` for the URL `https://ofn.org/shop#/contact`.
|
||||
# We remove the slash at the beginning.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.controller "ProducerNodeCtrl", ($scope, HashNavigation, $anchorScroll, $http, $timeout) ->
|
||||
angular.module('Darkswarm').controller "ProducerNodeCtrl", ($scope, HashNavigation, $anchorScroll, $http, $timeout) ->
|
||||
$scope.shopfront_loading = false
|
||||
$scope.enterprise_details = []
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.controller "ProductNodeCtrl", ($scope, $modal, FilterSelectorsService) ->
|
||||
angular.module('Darkswarm').controller "ProductNodeCtrl", ($scope, $modal, FilterSelectorsService) ->
|
||||
$scope.enterprise = $scope.product.supplier # For the modal, so it's consistent
|
||||
$scope.productPropertySelectors = FilterSelectorsService.createSelectors()
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.controller "ProductsCtrl", ($scope, $sce, $filter, $rootScope, Products, OrderCycle, OrderCycleResource, FilterSelectorsService, Cart, Dereferencer, Taxons, Properties, currentHub, $timeout) ->
|
||||
angular.module('Darkswarm').controller "ProductsCtrl", ($scope, $sce, $filter, $rootScope, Products, OrderCycle, OrderCycleResource, FilterSelectorsService, Cart, Dereferencer, Taxons, Properties, currentHub, $timeout) ->
|
||||
$scope.Products = Products
|
||||
$scope.Cart = Cart
|
||||
$scope.query = ""
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.controller "RegistrationCtrl", ($scope, RegistrationService, EnterpriseRegistrationService, availableCountries, GmapsGeo) ->
|
||||
angular.module('Darkswarm').controller "RegistrationCtrl", ($scope, RegistrationService, EnterpriseRegistrationService, availableCountries, GmapsGeo) ->
|
||||
$scope.currentStep = RegistrationService.currentStep
|
||||
$scope.enterprise = EnterpriseRegistrationService.enterprise
|
||||
$scope.select = RegistrationService.select
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.controller "RegistrationFormCtrl", ($scope, RegistrationService, EnterpriseRegistrationService) ->
|
||||
angular.module('Darkswarm').controller "RegistrationFormCtrl", ($scope, RegistrationService, EnterpriseRegistrationService) ->
|
||||
$scope.submitted = false
|
||||
$scope.isDisabled = false
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.controller "ShopNodeCtrl", ($scope, HashNavigation, $anchorScroll) ->
|
||||
angular.module('Darkswarm').controller "ShopNodeCtrl", ($scope, HashNavigation, $anchorScroll) ->
|
||||
$scope.toggle = ->
|
||||
HashNavigation.toggle $scope.shop.hash
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.controller "ShopVariantCtrl", ($scope, $modal, Cart) ->
|
||||
angular.module('Darkswarm').controller "ShopVariantCtrl", ($scope, $modal, Cart) ->
|
||||
$scope.updateCart = (line_item) ->
|
||||
Cart.adjust($scope.variant.line_item)
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
Darkswarm.controller "AboutUsCtrl", ($scope, Shopfront) ->
|
||||
angular.module('Darkswarm').controller "AboutUsCtrl", ($scope, Shopfront) ->
|
||||
$scope.shopfront = Shopfront.shopfront
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
Darkswarm.controller "ProducersTabCtrl", ($scope, Shopfront) ->
|
||||
angular.module('Darkswarm').controller "ProducersTabCtrl", ($scope, Shopfront) ->
|
||||
$scope.shopfront = Shopfront.shopfront
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.controller "TabsCtrl", ($scope, Navigation) ->
|
||||
angular.module('Darkswarm').controller "TabsCtrl", ($scope, Navigation) ->
|
||||
$scope.isActive = Navigation.isActive
|
||||
|
||||
# Select tab by setting the url hash path.
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
Darkswarm.controller "TmpCtrl", ($scope)->
|
||||
angular.module('Darkswarm').controller "TmpCtrl", ($scope)->
|
||||
$scope.test = {foo: "bar"}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
window.Darkswarm = angular.module("Darkswarm", [
|
||||
angular.module("Darkswarm", [
|
||||
'ngResource',
|
||||
'mm.foundation',
|
||||
'LocalStorageModule',
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "activeSelector", ->
|
||||
angular.module('Darkswarm').directive "activeSelector", ->
|
||||
# A generic selector that allows an object/scope to be toggled between active and inactive
|
||||
# Used in the filters, but hypothetically useable anywhere
|
||||
restrict: 'E'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "activeTableHubLink", (CurrentHub, CurrentOrder) ->
|
||||
angular.module('Darkswarm').directive "activeTableHubLink", (CurrentHub, CurrentOrder) ->
|
||||
# Change the text of the hub link based on CurrentHub
|
||||
# To be used with ofnEmptiesCart
|
||||
# Takes "change" and "shop" as text string attributes
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive 'auth', (AuthenticationService) ->
|
||||
angular.module('Darkswarm').directive 'auth', (AuthenticationService) ->
|
||||
restrict: 'A'
|
||||
link: (scope, elem, attrs) ->
|
||||
elem.bind "click", ->
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "bodyScroll", ($rootScope, BodyScroll) ->
|
||||
angular.module('Darkswarm').directive "bodyScroll", ($rootScope, BodyScroll) ->
|
||||
restrict: 'A'
|
||||
scope: true
|
||||
link: (scope, elem, attrs) ->
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "ofnChangeHub", (CurrentHub, Cart) ->
|
||||
angular.module('Darkswarm').directive "ofnChangeHub", (CurrentHub, Cart) ->
|
||||
# Compares scope.hub with CurrentHub. Will trigger an confirmation if they are different,
|
||||
# and Cart isn't empty
|
||||
restrict: "A"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "ofnChangeOrderCycle", (OrderCycle, Cart) ->
|
||||
angular.module('Darkswarm').directive "ofnChangeOrderCycle", (OrderCycle, Cart) ->
|
||||
# Compares chosen order cycle with pre-set OrderCycle. Will trigger
|
||||
# a confirmation if they are different, and Cart isn't empty
|
||||
restrict: "A"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "changeableOrdersAlert", (ChangeableOrdersAlert) ->
|
||||
angular.module('Darkswarm').directive "changeableOrdersAlert", (ChangeableOrdersAlert) ->
|
||||
restrict: "C"
|
||||
scope: true
|
||||
link: (scope, element, attrs) ->
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "confirmLinkClick", ($window) ->
|
||||
angular.module('Darkswarm').directive "confirmLinkClick", ($window) ->
|
||||
restrict: 'A'
|
||||
scope:
|
||||
confirmMsg: '@confirmLinkClick'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "darkerBackground", ->
|
||||
angular.module('Darkswarm').directive "darkerBackground", ->
|
||||
restrict: "A"
|
||||
link: (scope, elm, attr)->
|
||||
toggleClass = (value) ->
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "ngDebounce", ($timeout) ->
|
||||
angular.module('Darkswarm').directive "ngDebounce", ($timeout) ->
|
||||
# Slows down ng-model updates, only triggering binding ngDebounce milliseconds
|
||||
# after the last change. Used to prevent squirrely UI
|
||||
restrict: "A"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Allows disabling of link buttons via disabled attribute.
|
||||
# This is normally ignored, ie the link appears disabled but is still clickable.
|
||||
|
||||
Darkswarm.directive "disableDynamically", ->
|
||||
angular.module('Darkswarm').directive "disableDynamically", ->
|
||||
restrict: 'A'
|
||||
|
||||
link: (scope, element, attrs) ->
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "ofnDisableEnter", ()->
|
||||
angular.module('Darkswarm').directive "ofnDisableEnter", ()->
|
||||
# Stops enter from doing normal enter things
|
||||
restrict: 'A'
|
||||
link: (scope, element, attrs)->
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "disableEnterWithBlur", ()->
|
||||
angular.module('Darkswarm').directive "disableEnterWithBlur", ()->
|
||||
# Stops enter from doing normal enter things, and blurs the input
|
||||
restrict: 'A'
|
||||
link: (scope, element, attrs)->
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "ofnDisableScroll", ()->
|
||||
angular.module('Darkswarm').directive "ofnDisableScroll", ()->
|
||||
# Stops scrolling from incrementing or decrementing input value
|
||||
# Useful for number inputs
|
||||
restrict: 'A'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "enterpriseModal", (EnterpriseModal) ->
|
||||
angular.module('Darkswarm').directive "enterpriseModal", (EnterpriseModal) ->
|
||||
restrict: 'E'
|
||||
replace: true
|
||||
template: "<a ng-transclude></a>"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "fillVertical", ($window)->
|
||||
angular.module('Darkswarm').directive "fillVertical", ($window)->
|
||||
# Makes something fill the window vertically. Used on the Google Map.
|
||||
restrict: 'A'
|
||||
link: (scope, element, attrs)->
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "filterSelector", ->
|
||||
angular.module('Darkswarm').directive "filterSelector", ->
|
||||
# Automatically builds activeSelectors for taxons
|
||||
# Lots of magic here
|
||||
restrict: 'E'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "ofnFlash", (flash, $timeout, RailsFlashLoader)->
|
||||
angular.module('Darkswarm').directive "ofnFlash", (flash, $timeout, RailsFlashLoader)->
|
||||
# Our own flash class. Uses the "flash" service (third party), and a directive
|
||||
# called RailsFlashLoader to render
|
||||
typePairings =
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "ofnFocus", ->
|
||||
angular.module('Darkswarm').directive "ofnFocus", ->
|
||||
# Takes an expression attrs.ofnFocus
|
||||
# Watches value of expression, triggers element.focus() when value is truthy
|
||||
# Used to automatically focus on specific inputs in various circumstances
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "focusSearch", ->
|
||||
angular.module('Darkswarm').directive "focusSearch", ->
|
||||
restrict: 'A'
|
||||
link: (scope, element, attr)->
|
||||
element.bind 'click', (event) ->
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "helpModal", ($modal, $compile, $templateCache)->
|
||||
angular.module('Darkswarm').directive "helpModal", ($modal, $compile, $templateCache)->
|
||||
restrict: 'A'
|
||||
scope:
|
||||
helpText: "@helpModal"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "ofnInlineAlert", ->
|
||||
angular.module('Darkswarm').directive "ofnInlineAlert", ->
|
||||
restrict: 'A'
|
||||
scope: true
|
||||
link: (scope, elem, attrs) ->
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "integer", ->
|
||||
angular.module('Darkswarm').directive "integer", ->
|
||||
restrict: 'A'
|
||||
link: (scope, elem, attr) ->
|
||||
elem.bind 'input', ->
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "linkToService", ->
|
||||
angular.module('Darkswarm').directive "linkToService", ->
|
||||
restrict: 'E'
|
||||
replace: true
|
||||
scope: {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "loading", (Loading)->
|
||||
angular.module('Darkswarm').directive "loading", (Loading)->
|
||||
# Triggers a screen-wide "loading" thing when Ajaxy stuff is happening
|
||||
scope: {}
|
||||
restrict: 'E'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "logoFallback", () ->
|
||||
angular.module('Darkswarm').directive "logoFallback", () ->
|
||||
restrict: "A"
|
||||
link: (scope, elm, attr)->
|
||||
elm.bind('error', ->
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "mailto", (Navigation)->
|
||||
angular.module('Darkswarm').directive "mailto", (Navigation)->
|
||||
restrict: 'A'
|
||||
link: (scope, element, attrs)->
|
||||
element.bind 'click', (e)->
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive 'mapSearch', ($timeout, Search) ->
|
||||
angular.module('Darkswarm').directive 'mapSearch', ($timeout, Search) ->
|
||||
# Install a basic search field in a map
|
||||
restrict: 'E'
|
||||
require: ['^uiGmapGoogleMap', 'ngModel']
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "max", ->
|
||||
angular.module('Darkswarm').directive "max", ->
|
||||
restrict: 'A'
|
||||
link: (scope, elem, attr)->
|
||||
elem.bind 'input', ->
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "ofnModal", ($modal)->
|
||||
angular.module('Darkswarm').directive "ofnModal", ($modal)->
|
||||
# Generic modal! Uses transclusion so designer-types can do stuff like:
|
||||
# %ofn-modal
|
||||
# CONTENT
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "ofnOnHand", (StockQuantity) ->
|
||||
angular.module('Darkswarm').directive "ofnOnHand", (StockQuantity) ->
|
||||
restrict: 'A'
|
||||
require: "ngModel"
|
||||
scope: true
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive 'ofnOpenStreetMap', ($window, MapCentreCalculator, Enterprises, EnterpriseModal, availableCountries, openStreetMapConfig) ->
|
||||
angular.module('Darkswarm').directive 'ofnOpenStreetMap', ($window, MapCentreCalculator, Enterprises, EnterpriseModal, availableCountries, openStreetMapConfig) ->
|
||||
restrict: 'E'
|
||||
replace: true
|
||||
scope: true
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "ofnPageAlert", ($timeout) ->
|
||||
angular.module('Darkswarm').directive "ofnPageAlert", ($timeout) ->
|
||||
restrict: 'A'
|
||||
scope: true
|
||||
link: (scope, elem, attrs) ->
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "priceBreakdown", ($tooltip)->
|
||||
angular.module('Darkswarm').directive "priceBreakdown", ($tooltip)->
|
||||
# We use the $tooltip service from Angular foundation to give us boilerplate
|
||||
# Subsequently we patch the scope, template and restrictions
|
||||
tooltip = $tooltip 'priceBreakdown', 'priceBreakdown', 'click'
|
||||
@@ -10,7 +10,7 @@ Darkswarm.directive "priceBreakdown", ($tooltip)->
|
||||
tooltip
|
||||
|
||||
# This is automatically referenced via naming convention in $tooltip
|
||||
Darkswarm.directive 'priceBreakdownPopup', ->
|
||||
angular.module('Darkswarm').directive 'priceBreakdownPopup', ->
|
||||
restrict: 'EA'
|
||||
replace: true
|
||||
templateUrl: 'price_breakdown.html'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "ofnRegistrationLimitModal", (Navigation, $modal, Loading) ->
|
||||
angular.module('Darkswarm').directive "ofnRegistrationLimitModal", (Navigation, $modal, Loading) ->
|
||||
restrict: 'A'
|
||||
link: (scope, elem, attr)->
|
||||
scope.modalInstance = $modal.open
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "renderSvg", ()->
|
||||
angular.module('Darkswarm').directive "renderSvg", ()->
|
||||
# Magical directive that'll render SVGs from URLs
|
||||
# If only there were a neater way of doing this
|
||||
restrict: 'E'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive 'scrollAfterLoad', ($timeout, $location, $document)->
|
||||
angular.module('Darkswarm').directive 'scrollAfterLoad', ($timeout, $location, $document)->
|
||||
# Scroll to an element on page load
|
||||
restrict: "A"
|
||||
link: (scope, element, attr) ->
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "ofnScrollTo", ($location, $anchorScroll)->
|
||||
angular.module('Darkswarm').directive "ofnScrollTo", ($location, $anchorScroll)->
|
||||
# Onclick sets $location.hash to attrs.ofnScrollTo
|
||||
# Then triggers anchorScroll
|
||||
restrict: 'A'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "shippingTypeSelector", ->
|
||||
angular.module('Darkswarm').directive "shippingTypeSelector", ->
|
||||
# Builds selector for shipping types
|
||||
restrict: 'E'
|
||||
replace: true
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "shopVariant", ->
|
||||
angular.module('Darkswarm').directive "shopVariant", ->
|
||||
restrict: 'E'
|
||||
replace: true
|
||||
templateUrl: 'shop_variant.html'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive 'singleLineSelectors', ($timeout, $filter) ->
|
||||
angular.module('Darkswarm').directive 'singleLineSelectors', ($timeout, $filter) ->
|
||||
restrict: 'E'
|
||||
templateUrl: "single_line_selectors.html"
|
||||
scope:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "ofnSmoothScrollTo", ($location, $document)->
|
||||
angular.module('Darkswarm').directive "ofnSmoothScrollTo", ($location, $document)->
|
||||
# Onclick sets $location.hash to attrs.ofnScrollTo
|
||||
# Then triggers $document.scrollTo
|
||||
restrict: 'A'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "stripeElements", ($injector, StripeElements) ->
|
||||
angular.module('Darkswarm').directive "stripeElements", ($injector, StripeElements) ->
|
||||
restrict: 'E'
|
||||
template: "<label for='card-element'>\
|
||||
<div id='card-element'></div>\
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "tab", ->
|
||||
angular.module('Darkswarm').directive "tab", ->
|
||||
restrict: "C"
|
||||
require: "^^tabsetCtrl"
|
||||
scope:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "tabView", ->
|
||||
angular.module('Darkswarm').directive "tabView", ->
|
||||
restrict: "C"
|
||||
require: "^^tabsetCtrl"
|
||||
template: "<div ng-include='template'></div>"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "tabsetCtrl", (Tabsets, $location, $rootScope) ->
|
||||
angular.module('Darkswarm').directive "tabsetCtrl", (Tabsets, $location, $rootScope) ->
|
||||
restrict: "C"
|
||||
scope:
|
||||
id: "@"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "embeddedTargetBlank", ->
|
||||
angular.module('Darkswarm').directive "embeddedTargetBlank", ->
|
||||
restrict: 'A'
|
||||
compile: (element) ->
|
||||
elems = (element.children().find("a"))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "validateStockQuantity", (StockQuantity) ->
|
||||
angular.module('Darkswarm').directive "validateStockQuantity", (StockQuantity) ->
|
||||
restrict: 'A'
|
||||
require: "ngModel"
|
||||
scope: true
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.filter 'active', ()->
|
||||
angular.module('Darkswarm').filter 'active', ()->
|
||||
(objects, options)->
|
||||
objects ||= []
|
||||
options ?= null
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.filter "byProducer", ->
|
||||
angular.module('Darkswarm').filter "byProducer", ->
|
||||
(objects, id) ->
|
||||
objects ||= []
|
||||
id ?= 0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.filter "capitalize", ->
|
||||
angular.module('Darkswarm').filter "capitalize", ->
|
||||
# Convert to basic sentence case.
|
||||
(input, scope) ->
|
||||
input = input.toLowerCase() if input?
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.filter 'closedShops', ->
|
||||
angular.module('Darkswarm').filter 'closedShops', ->
|
||||
(enterprises, show_closed) ->
|
||||
enterprises ||= []
|
||||
show_closed ?= false
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
@API_DATETIME_FORMAT = "YYYY-MM-DD HH:mm:SS Z"
|
||||
|
||||
Darkswarm.filter "date_in_words", ->
|
||||
angular.module('Darkswarm').filter "date_in_words", ->
|
||||
(date, dateFormat) ->
|
||||
dateFormat ?= @API_DATETIME_FORMAT
|
||||
moment(date, dateFormat).fromNow()
|
||||
|
||||
Darkswarm.filter "sensible_timeframe", (date_in_wordsFilter)->
|
||||
angular.module('Darkswarm').filter "sensible_timeframe", (date_in_wordsFilter)->
|
||||
(date, dateFormat) ->
|
||||
dateFormat ?= @API_DATETIME_FORMAT
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.filter 'distanceWithinKm', ->
|
||||
angular.module('Darkswarm').filter 'distanceWithinKm', ->
|
||||
(enterprises, range) ->
|
||||
enterprises ||= []
|
||||
enterprises.filter (enterprise) ->
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.filter 'enterpriseMatchesNameQuery', ->
|
||||
angular.module('Darkswarm').filter 'enterpriseMatchesNameQuery', ->
|
||||
(enterprises, matches_name_query) ->
|
||||
enterprises.filter (enterprise) ->
|
||||
enterprise.matches_name_query == matches_name_query
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.filter "ext_url", ->
|
||||
angular.module('Darkswarm').filter "ext_url", ->
|
||||
urlPattern = /^https?:\/\//
|
||||
(url, prefix) ->
|
||||
if !url || url.match(urlPattern)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.filter "groups", (Matcher)->
|
||||
angular.module('Darkswarm').filter "groups", (Matcher)->
|
||||
(groups, text)->
|
||||
groups ||= []
|
||||
text ?= ""
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.filter 'products', (Matcher) ->
|
||||
angular.module('Darkswarm').filter 'products', (Matcher) ->
|
||||
(products, text) ->
|
||||
products ||= []
|
||||
text ?= ""
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.filter "formatBalance", (localizeCurrencyFilter, tFilter)->
|
||||
angular.module('Darkswarm').filter "formatBalance", (localizeCurrencyFilter, tFilter)->
|
||||
# Convert number to string currency using injected currency configuration.
|
||||
(balance) ->
|
||||
if balance < 0
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user