Remove Darkswarm from window

This commit is contained in:
Matt-Yorkley
2021-08-02 10:21:47 +01:00
parent af7355a780
commit e1155277fc
167 changed files with 172 additions and 172 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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 = ''

View File

@@ -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

View File

@@ -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

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "CartDropdownCtrl", ($scope, Cart, BodyScroll) ->
angular.module('Darkswarm').controller "CartDropdownCtrl", ($scope, Cart, BodyScroll) ->
$scope.Cart = Cart
$scope.showCartSidebar = false

View File

@@ -1,2 +1,2 @@
Darkswarm.controller "CartFormCtrl", ($scope) ->
angular.module('Darkswarm').controller "CartFormCtrl", ($scope) ->

View File

@@ -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 }

View File

@@ -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"

View File

@@ -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

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "CountryCtrl", ($scope, availableCountries) ->
angular.module('Darkswarm').controller "CountryCtrl", ($scope, availableCountries) ->
$scope.countries = availableCountries

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -1,2 +1,2 @@
Darkswarm.controller "CurrentHubCtrl", ($scope, CurrentHub) ->
angular.module('Darkswarm').controller "CurrentHubCtrl", ($scope, CurrentHub) ->
$scope.CurrentHub = CurrentHub

View File

@@ -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

View File

@@ -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()

View File

@@ -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

View File

@@ -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

View File

@@ -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 =

View File

@@ -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()

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "HomeCtrl", ($scope) ->
angular.module('Darkswarm').controller "HomeCtrl", ($scope) ->
$scope.brandStoryExpanded = false
$scope.toggleBrandStory = ->

View File

@@ -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 = []

View File

@@ -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

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "OffcanvasCtrl", ($scope) ->
angular.module('Darkswarm').controller "OffcanvasCtrl", ($scope) ->
$scope.menu = $(".left-off-canvas-menu")
$scope.setOffcanvasMenuHeight = ->

View File

@@ -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)->

View File

@@ -1,2 +1,2 @@
Darkswarm.controller "OrdersCtrl", ($scope, Orders) ->
angular.module('Darkswarm').controller "OrdersCtrl", ($scope, Orders) ->
$scope.Orders = Orders

View File

@@ -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.

View File

@@ -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 = []

View File

@@ -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()

View File

@@ -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 = ""

View File

@@ -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

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "RegistrationFormCtrl", ($scope, RegistrationService, EnterpriseRegistrationService) ->
angular.module('Darkswarm').controller "RegistrationFormCtrl", ($scope, RegistrationService, EnterpriseRegistrationService) ->
$scope.submitted = false
$scope.isDisabled = false

View File

@@ -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

View File

@@ -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)

View File

@@ -1,2 +1,2 @@
Darkswarm.controller "AboutUsCtrl", ($scope, Shopfront) ->
angular.module('Darkswarm').controller "AboutUsCtrl", ($scope, Shopfront) ->
$scope.shopfront = Shopfront.shopfront

View File

@@ -1,2 +1,2 @@
Darkswarm.controller "ProducersTabCtrl", ($scope, Shopfront) ->
angular.module('Darkswarm').controller "ProducersTabCtrl", ($scope, Shopfront) ->
$scope.shopfront = Shopfront.shopfront

View File

@@ -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.

View File

@@ -1,2 +1,2 @@
Darkswarm.controller "TmpCtrl", ($scope)->
angular.module('Darkswarm').controller "TmpCtrl", ($scope)->
$scope.test = {foo: "bar"}

View File

@@ -1,4 +1,4 @@
window.Darkswarm = angular.module("Darkswarm", [
angular.module("Darkswarm", [
'ngResource',
'mm.foundation',
'LocalStorageModule',

View File

@@ -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'

View File

@@ -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

View File

@@ -1,4 +1,4 @@
Darkswarm.directive 'auth', (AuthenticationService) ->
angular.module('Darkswarm').directive 'auth', (AuthenticationService) ->
restrict: 'A'
link: (scope, elem, attrs) ->
elem.bind "click", ->

View File

@@ -1,4 +1,4 @@
Darkswarm.directive "bodyScroll", ($rootScope, BodyScroll) ->
angular.module('Darkswarm').directive "bodyScroll", ($rootScope, BodyScroll) ->
restrict: 'A'
scope: true
link: (scope, elem, attrs) ->

View File

@@ -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"

View File

@@ -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"

View File

@@ -1,4 +1,4 @@
Darkswarm.directive "changeableOrdersAlert", (ChangeableOrdersAlert) ->
angular.module('Darkswarm').directive "changeableOrdersAlert", (ChangeableOrdersAlert) ->
restrict: "C"
scope: true
link: (scope, element, attrs) ->

View File

@@ -1,4 +1,4 @@
Darkswarm.directive "confirmLinkClick", ($window) ->
angular.module('Darkswarm').directive "confirmLinkClick", ($window) ->
restrict: 'A'
scope:
confirmMsg: '@confirmLinkClick'

View File

@@ -1,4 +1,4 @@
Darkswarm.directive "darkerBackground", ->
angular.module('Darkswarm').directive "darkerBackground", ->
restrict: "A"
link: (scope, elm, attr)->
toggleClass = (value) ->

View File

@@ -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"

View File

@@ -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) ->

View File

@@ -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)->

View File

@@ -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)->

View File

@@ -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'

View File

@@ -1,4 +1,4 @@
Darkswarm.directive "enterpriseModal", (EnterpriseModal) ->
angular.module('Darkswarm').directive "enterpriseModal", (EnterpriseModal) ->
restrict: 'E'
replace: true
template: "<a ng-transclude></a>"

View File

@@ -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)->

View File

@@ -1,4 +1,4 @@
Darkswarm.directive "filterSelector", ->
angular.module('Darkswarm').directive "filterSelector", ->
# Automatically builds activeSelectors for taxons
# Lots of magic here
restrict: 'E'

View File

@@ -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 =

View File

@@ -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

View File

@@ -1,4 +1,4 @@
Darkswarm.directive "focusSearch", ->
angular.module('Darkswarm').directive "focusSearch", ->
restrict: 'A'
link: (scope, element, attr)->
element.bind 'click', (event) ->

View File

@@ -1,4 +1,4 @@
Darkswarm.directive "helpModal", ($modal, $compile, $templateCache)->
angular.module('Darkswarm').directive "helpModal", ($modal, $compile, $templateCache)->
restrict: 'A'
scope:
helpText: "@helpModal"

View File

@@ -1,4 +1,4 @@
Darkswarm.directive "ofnInlineAlert", ->
angular.module('Darkswarm').directive "ofnInlineAlert", ->
restrict: 'A'
scope: true
link: (scope, elem, attrs) ->

View File

@@ -1,4 +1,4 @@
Darkswarm.directive "integer", ->
angular.module('Darkswarm').directive "integer", ->
restrict: 'A'
link: (scope, elem, attr) ->
elem.bind 'input', ->

View File

@@ -1,4 +1,4 @@
Darkswarm.directive "linkToService", ->
angular.module('Darkswarm').directive "linkToService", ->
restrict: 'E'
replace: true
scope: {

View File

@@ -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'

View File

@@ -1,4 +1,4 @@
Darkswarm.directive "logoFallback", () ->
angular.module('Darkswarm').directive "logoFallback", () ->
restrict: "A"
link: (scope, elm, attr)->
elm.bind('error', ->

View File

@@ -1,4 +1,4 @@
Darkswarm.directive "mailto", (Navigation)->
angular.module('Darkswarm').directive "mailto", (Navigation)->
restrict: 'A'
link: (scope, element, attrs)->
element.bind 'click', (e)->

View File

@@ -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']

View File

@@ -1,4 +1,4 @@
Darkswarm.directive "max", ->
angular.module('Darkswarm').directive "max", ->
restrict: 'A'
link: (scope, elem, attr)->
elem.bind 'input', ->

View File

@@ -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

View File

@@ -1,4 +1,4 @@
Darkswarm.directive "ofnOnHand", (StockQuantity) ->
angular.module('Darkswarm').directive "ofnOnHand", (StockQuantity) ->
restrict: 'A'
require: "ngModel"
scope: true

View File

@@ -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

View File

@@ -1,4 +1,4 @@
Darkswarm.directive "ofnPageAlert", ($timeout) ->
angular.module('Darkswarm').directive "ofnPageAlert", ($timeout) ->
restrict: 'A'
scope: true
link: (scope, elem, attrs) ->

View File

@@ -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'

View File

@@ -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

View File

@@ -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'

View File

@@ -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) ->

View File

@@ -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'

View File

@@ -1,4 +1,4 @@
Darkswarm.directive "shippingTypeSelector", ->
angular.module('Darkswarm').directive "shippingTypeSelector", ->
# Builds selector for shipping types
restrict: 'E'
replace: true

View File

@@ -1,4 +1,4 @@
Darkswarm.directive "shopVariant", ->
angular.module('Darkswarm').directive "shopVariant", ->
restrict: 'E'
replace: true
templateUrl: 'shop_variant.html'

View File

@@ -1,4 +1,4 @@
Darkswarm.directive 'singleLineSelectors', ($timeout, $filter) ->
angular.module('Darkswarm').directive 'singleLineSelectors', ($timeout, $filter) ->
restrict: 'E'
templateUrl: "single_line_selectors.html"
scope:

View File

@@ -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'

View File

@@ -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>\

View File

@@ -1,4 +1,4 @@
Darkswarm.directive "tab", ->
angular.module('Darkswarm').directive "tab", ->
restrict: "C"
require: "^^tabsetCtrl"
scope:

View File

@@ -1,4 +1,4 @@
Darkswarm.directive "tabView", ->
angular.module('Darkswarm').directive "tabView", ->
restrict: "C"
require: "^^tabsetCtrl"
template: "<div ng-include='template'></div>"

View File

@@ -1,4 +1,4 @@
Darkswarm.directive "tabsetCtrl", (Tabsets, $location, $rootScope) ->
angular.module('Darkswarm').directive "tabsetCtrl", (Tabsets, $location, $rootScope) ->
restrict: "C"
scope:
id: "@"

View File

@@ -1,4 +1,4 @@
Darkswarm.directive "embeddedTargetBlank", ->
angular.module('Darkswarm').directive "embeddedTargetBlank", ->
restrict: 'A'
compile: (element) ->
elems = (element.children().find("a"))

View File

@@ -1,4 +1,4 @@
Darkswarm.directive "validateStockQuantity", (StockQuantity) ->
angular.module('Darkswarm').directive "validateStockQuantity", (StockQuantity) ->
restrict: 'A'
require: "ngModel"
scope: true

View File

@@ -1,4 +1,4 @@
Darkswarm.filter 'active', ()->
angular.module('Darkswarm').filter 'active', ()->
(objects, options)->
objects ||= []
options ?= null

View File

@@ -1,4 +1,4 @@
Darkswarm.filter "byProducer", ->
angular.module('Darkswarm').filter "byProducer", ->
(objects, id) ->
objects ||= []
id ?= 0

View File

@@ -1,4 +1,4 @@
Darkswarm.filter "capitalize", ->
angular.module('Darkswarm').filter "capitalize", ->
# Convert to basic sentence case.
(input, scope) ->
input = input.toLowerCase() if input?

View File

@@ -1,4 +1,4 @@
Darkswarm.filter 'closedShops', ->
angular.module('Darkswarm').filter 'closedShops', ->
(enterprises, show_closed) ->
enterprises ||= []
show_closed ?= false

View File

@@ -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

View File

@@ -1,4 +1,4 @@
Darkswarm.filter 'distanceWithinKm', ->
angular.module('Darkswarm').filter 'distanceWithinKm', ->
(enterprises, range) ->
enterprises ||= []
enterprises.filter (enterprise) ->

View File

@@ -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

View File

@@ -1,4 +1,4 @@
Darkswarm.filter "ext_url", ->
angular.module('Darkswarm').filter "ext_url", ->
urlPattern = /^https?:\/\//
(url, prefix) ->
if !url || url.match(urlPattern)

View File

@@ -1,4 +1,4 @@
Darkswarm.filter "groups", (Matcher)->
angular.module('Darkswarm').filter "groups", (Matcher)->
(groups, text)->
groups ||= []
text ?= ""

View File

@@ -1,4 +1,4 @@
Darkswarm.filter 'products', (Matcher) ->
angular.module('Darkswarm').filter 'products', (Matcher) ->
(products, text) ->
products ||= []
text ?= ""

View File

@@ -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