Major usability improvements
This commit is contained in:
@@ -14,6 +14,7 @@ class Suppliers::Ability
|
|||||||
can :mark_in_process, Order
|
can :mark_in_process, Order
|
||||||
can :mark_delivered, Order
|
can :mark_delivered, Order
|
||||||
can :cancel, Order
|
can :cancel, Order
|
||||||
|
can :switch_to, Supplier
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#= require_self
|
#= require_self
|
||||||
|
#= require md5
|
||||||
#= require handlebars
|
#= require handlebars
|
||||||
#= require ember
|
#= require ember
|
||||||
#= require ember-data
|
#= require ember-data
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
App.SuppliersSwitcherComponent = Ember.Component.extend
|
App.SuppliersSwitcherComponent = Ember.Component.extend
|
||||||
classNames: ['suppliers-switcher-container']
|
classNames: ['suppliers-switcher-container']
|
||||||
suppliers: (-> @get('targetObject.store').all 'supplier').property()
|
suppliers: (-> @get('targetObject.store').peekAll 'supplier').property()
|
||||||
other_suppliers: ( -> @get('suppliers').rejectBy 'id', @get('current_supplier.id')).property('suppliers.@each')
|
other_suppliers: ( -> @get('suppliers').rejectBy 'id', @get('globals.current_supplier.id')).property('suppliers.@each')
|
||||||
current_supplier: Ember.computed.alias 'targetObject.controllers.application.supplier'
|
|
||||||
actions:
|
actions:
|
||||||
switchTo: (locale)->
|
switchTo: (locale)->
|
||||||
setLocale locale
|
setLocale locale
|
||||||
|
|||||||
@@ -21,5 +21,5 @@ App.ApplicationController = Ember.Controller.extend
|
|||||||
window.location = Routes.destroy_employee_session_path()
|
window.location = Routes.destroy_employee_session_path()
|
||||||
showSupplierStatusInfo: ->
|
showSupplierStatusInfo: ->
|
||||||
@modal 'supplier_status_info',
|
@modal 'supplier_status_info',
|
||||||
model: @get('supplier')
|
model: @get('globals.current_supplier')
|
||||||
title_path: 'supplier_status_info.title'
|
title_path: 'supplier_status_info.title'
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
Ember.Handlebars.registerHelper 'can', (permission, resource, options)->
|
Ember.Handlebars.registerHelper 'can', (permission, resource, options)->
|
||||||
|
if options.types[1] is "ID" and options.data.view
|
||||||
|
resource = options.data.view.get(resource)
|
||||||
if employee = App.__container__.lookup('global:variables').get('current_employee')
|
if employee = App.__container__.lookup('global:variables').get('current_employee')
|
||||||
if permission is "read" or (permission is "manage" and employee.isManager())
|
if permission is "read" or (permission is "manage" and employee.isManager())
|
||||||
options.fn @
|
options.fn @
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
Ember.Handlebars.helper 'gravatar-image', (email, options={})->
|
||||||
|
size = options.hash.size || 48
|
||||||
|
gravatar_hash = md5(String(email).trim().toLowerCase())
|
||||||
|
"<img src='http://www.gravatar.com/avatar/#{gravatar_hash}?s=#{size}' />".htmlSafe()
|
||||||
|
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
Globals = Ember.Object.extend
|
Globals = Ember.Object.extend
|
||||||
current_employee: null
|
current_employee: null
|
||||||
|
current_supplier: null
|
||||||
isDragging: false
|
isDragging: false
|
||||||
App.initializer
|
App.initializer
|
||||||
name: 'injectCurrent'
|
name: 'injectCurrent'
|
||||||
|
|||||||
@@ -14,3 +14,4 @@ ControllerExtensions = Ember.Mixin.create
|
|||||||
#current_employee: (-> @get('controllers.application.employee') ).property('controllers.application.employee')
|
#current_employee: (-> @get('controllers.application.employee') ).property('controllers.application.employee')
|
||||||
|
|
||||||
Ember.Controller.reopen ControllerExtensions
|
Ember.Controller.reopen ControllerExtensions
|
||||||
|
Ember.ArrayController.reopen ControllerExtensions # Added for auto generated employeesController Ember 1,13.5
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ App.Router.map ->
|
|||||||
@route 'orders_display' # chromecast etc
|
@route 'orders_display' # chromecast etc
|
||||||
@route 'menu'
|
@route 'menu'
|
||||||
@route 'settings'
|
@route 'settings'
|
||||||
|
@route 'my_account'
|
||||||
@route 'schedule'
|
@route 'schedule'
|
||||||
@route 'empty'
|
@route 'empty'
|
||||||
#@resource 'lists', queryParams: ['state']
|
#@resource 'lists', queryParams: ['state']
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ App.ApplicationRoute = Ember.Route.extend
|
|||||||
# product_categories = controller.set 'product_categories', @store.all('product_category')
|
# product_categories = controller.set 'product_categories', @store.all('product_category')
|
||||||
#@store.find 'order', state: 'active' included in list
|
#@store.find 'order', state: 'active' included in list
|
||||||
setupController: (controller)->
|
setupController: (controller)->
|
||||||
controller.set 'supplier', @supplier
|
controller.set 'globals.current_supplier', @supplier
|
||||||
controller.set 'globals.current_employee', @employee
|
controller.set 'globals.current_employee', @employee
|
||||||
# @set 'supplier', @store.find('supplier', supplier_id)
|
# @set 'supplier', @store.find('supplier', supplier_id)
|
||||||
#controller.set 'sections', @sections
|
#controller.set 'sections', @sections
|
||||||
@@ -20,8 +20,8 @@ App.ApplicationRoute = Ember.Route.extend
|
|||||||
|
|
||||||
faye = new Faye.Client(event_host)
|
faye = new Faye.Client(event_host)
|
||||||
faye.subscribe "/supplier/#{supplier_object.id}", (e)=>
|
faye.subscribe "/supplier/#{supplier_object.id}", (e)=>
|
||||||
@set('supplier.orders_placed_count', e.data.supplier_orders_placed_count) if e.data.supplier_orders_placed_count?
|
@set('globals.current_supplier.orders_placed_count', e.data.supplier_orders_placed_count) if e.data.supplier_orders_placed_count?
|
||||||
@set('supplier.orders_in_process_count', e.data.supplier_orders_in_process_count) if e.data.supplier_orders_in_process_count?
|
@set('globals.current_supplier.orders_in_process_count', e.data.supplier_orders_in_process_count) if e.data.supplier_orders_in_process_count?
|
||||||
@events[e.event].call(@, e.data) if @events[e.event]
|
@events[e.event].call(@, e.data) if @events[e.event]
|
||||||
<% if Rails.env.test? %>
|
<% if Rails.env.test? %>
|
||||||
window.faye_log ||= []
|
window.faye_log ||= []
|
||||||
@@ -33,6 +33,11 @@ App.ApplicationRoute = Ember.Route.extend
|
|||||||
console.log e.data
|
console.log e.data
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
# Fetch suppliers for current_employee
|
||||||
|
$.getJSON(Routes.employees_suppliers_path()).then (result) =>
|
||||||
|
@store.pushPayload result
|
||||||
|
|
||||||
|
|
||||||
actions:
|
actions:
|
||||||
# openModal: (modalName, model, options={})->
|
# openModal: (modalName, model, options={})->
|
||||||
# controller_name = options.controller || modalName
|
# controller_name = options.controller || modalName
|
||||||
@@ -85,14 +90,16 @@ App.ApplicationRoute = Ember.Route.extend
|
|||||||
@controllerFor('application').set 'active_section', section
|
@controllerFor('application').set 'active_section', section
|
||||||
@transitionTo 'index'
|
@transitionTo 'index'
|
||||||
markSupplierClosed: ->
|
markSupplierClosed: ->
|
||||||
|
return unless @get('globals.current_employee.manager')
|
||||||
controller = @controllerFor('application')
|
controller = @controllerFor('application')
|
||||||
return unless supplier = controller.get('supplier')
|
return unless supplier = @get('globals.current_supplier')
|
||||||
controller.modal 'confirm',
|
controller.modal 'confirm',
|
||||||
title_path: 'supplier.close_for_orders_confirmation'
|
title_path: 'supplier.close_for_orders_confirmation'
|
||||||
model: supplier
|
model: supplier
|
||||||
ok: -> supplier.close()
|
ok: -> supplier.close()
|
||||||
markSupplierOpen: ->
|
markSupplierOpen: ->
|
||||||
return unless supplier = @controllerFor('application').get('supplier')
|
return unless @get('globals.current_employee.manager')
|
||||||
|
return unless supplier = @get('globals.current_supplier')
|
||||||
supplier.open_the_place()
|
supplier.open_the_place()
|
||||||
rotateLeft: (record)->
|
rotateLeft: (record)->
|
||||||
new_rotation = -90 + record.get('rotation')
|
new_rotation = -90 + record.get('rotation')
|
||||||
@@ -136,8 +143,8 @@ App.ApplicationRoute = Ember.Route.extend
|
|||||||
order_being_processed: (data) -> order.isActive() if order = @store.getById('order', data.id)
|
order_being_processed: (data) -> order.isActive() if order = @store.getById('order', data.id)
|
||||||
order_being_delivered: (data) -> order.isDelivered() if order = @store.getById('order', data.id)
|
order_being_delivered: (data) -> order.isDelivered() if order = @store.getById('order', data.id)
|
||||||
order_cancelled: (data) -> order.isCancelled() if order = @store.getById('order', data.id)
|
order_cancelled: (data) -> order.isCancelled() if order = @store.getById('order', data.id)
|
||||||
orders_in_process_count: (data) -> @set('supplier.orders_in_process_count', data.count)
|
orders_in_process_count: (data) -> @set('globals.current_supplier.orders_in_process_count', data.count)
|
||||||
orders_placed_count: (data) -> @set('supplier.orders_placed_count', data.count)
|
orders_placed_count: (data) -> @set('globals.current_supplier.orders_placed_count', data.count)
|
||||||
|
|
||||||
#return new Ember.Handlebars.SafeString('<span class="highlight">' + escaped + '</span>');
|
#return new Ember.Handlebars.SafeString('<span class="highlight">' + escaped + '</span>');
|
||||||
#"<span class='highlight'>#{escaped}</span>".htmlSafe()
|
#"<span class='highlight'>#{escaped}</span>".htmlSafe()
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
App.MyAccountRoute = Ember.Route.extend
|
||||||
|
model: -> @get('globals.current_employee')
|
||||||
@@ -1,8 +1,5 @@
|
|||||||
App.SettingsRoute = Ember.Route.extend
|
App.SettingsRoute = Ember.Route.extend
|
||||||
beforeModel: ->
|
model: -> @get('globals.current_supplier')
|
||||||
$.getJSON(Routes.employees_suppliers_path()).then (result) =>
|
|
||||||
@store.pushPayload result
|
|
||||||
model: -> @container.lookup('route:application').supplier
|
|
||||||
# setupController: (controller, model)->
|
# setupController: (controller, model)->
|
||||||
# #controller.set 'model', controller.get('controllers.application.supplier')
|
# #controller.set 'model', controller.get('controllers.application.supplier')
|
||||||
# controller.set 'model', model.supplier
|
# controller.set 'model', model.supplier
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
span.dropdown-trigger.button.tiny.dropdown
|
if gravatar
|
||||||
span.dropdown-trigger-text= view.title
|
span.dropdown-trigger.gravatar= gravatar-image gravatar
|
||||||
/span.dropdown-trigger-icon
|
else
|
||||||
|
span.dropdown-trigger.button.tiny.dropdown
|
||||||
|
span.dropdown-trigger-text= view.title
|
||||||
|
/span.dropdown-trigger-icon
|
||||||
.dropdown-list-container
|
.dropdown-list-container
|
||||||
= yield
|
= yield
|
||||||
|
|||||||
@@ -21,9 +21,9 @@
|
|||||||
td.boolean= boolean employee.active
|
td.boolean= boolean employee.active
|
||||||
td.colorbox= colorbox employee.color
|
td.colorbox= colorbox employee.color
|
||||||
td.actions
|
td.actions
|
||||||
can manage sections
|
can "manage" "sections"
|
||||||
a.table-edit{ action 'editEmployee' employee }: span
|
a.table-edit{ action 'editEmployee' employee }: span
|
||||||
a.table-destroy{ action 'destroyEmployee' employee }: span
|
a.table-destroy{ action 'destroyEmployee' employee }: span
|
||||||
.form-actions
|
.form-actions
|
||||||
can manage employees
|
can "manage" "employees"
|
||||||
a.form-action-new.new-employee-button{action "newEmployee"}= t 'employee.new_button'
|
a.form-action-new.new-employee-button{action "newEmployee"}= t 'employee.new_button'
|
||||||
|
|||||||
@@ -1,15 +1,6 @@
|
|||||||
.side-menu
|
.side-menu
|
||||||
ul
|
ul
|
||||||
li.title: h3= supplier.name
|
li.title: h3= globals.current_supplier.name
|
||||||
can manage supplier
|
|
||||||
if supplier.open
|
|
||||||
li: a.supplier-close-shop{action "markSupplierClosed"}= t 'supplier.close_for_orders'
|
|
||||||
else
|
|
||||||
li: a.supplier-open-shop{action "markSupplierOpen"}= t 'supplier.open_for_orders'
|
|
||||||
li
|
|
||||||
=link-to 'settings' class="supplier-settings-link"
|
|
||||||
span.settings-icon
|
|
||||||
span= t 'supplier.settings'
|
|
||||||
li
|
li
|
||||||
= link-to 'index'
|
= link-to 'index'
|
||||||
span.fa.fa-list-alt
|
span.fa.fa-list-alt
|
||||||
@@ -34,7 +25,12 @@
|
|||||||
= link-to 'schedule'
|
= link-to 'schedule'
|
||||||
span.fa.fa-calendar
|
span.fa.fa-calendar
|
||||||
= t 'top_menu.schedule'
|
= t 'top_menu.schedule'
|
||||||
li.supplier-sign-out-link
|
can "manage" globals.current_supplier
|
||||||
a{action "signOut"}
|
li
|
||||||
span.sign-out-icon
|
=link-to 'settings' class="supplier-settings-link"
|
||||||
= t 'supplier.sign_out'
|
span.settings-icon
|
||||||
|
span= t 'supplier.settings'
|
||||||
|
if globals.current_supplier.open
|
||||||
|
li: a.supplier-close-shop{action "markSupplierClosed"}= t 'supplier.close_for_orders'
|
||||||
|
else
|
||||||
|
li: a.supplier-open-shop{action "markSupplierOpen"}= t 'supplier.open_for_orders'
|
||||||
|
|||||||
@@ -17,20 +17,27 @@ header.top-menu
|
|||||||
= t 'models.plural.employee'
|
= t 'models.plural.employee'
|
||||||
= link-to "schedule" class="top-menu-schedule"
|
= link-to "schedule" class="top-menu-schedule"
|
||||||
= t 'top_menu.schedule'
|
= t 'top_menu.schedule'
|
||||||
if supplier.open
|
= dropdown-link gravatar=globals.current_employee.email classNames="current-employee-nav"
|
||||||
a.supplier-is-closed-indication.is-open{ action "markSupplierClosed" }: span.fa.fa-beer.fa-2x
|
ul
|
||||||
|
li
|
||||||
|
li= link-to 'my_account': span.current-employee-my-account-icon= t 'current_employee.my_account.link'
|
||||||
|
li: a{action "signOut"}: span.sign-out-icon= t 'supplier.sign_out'
|
||||||
|
if globals.current_supplier.open
|
||||||
|
/a.supplier-is-closed-indication.is-open{ action "markSupplierClosed" }: span.fa.fa-beer.fa-2x
|
||||||
|
a.supplier-availability.currently-open{ action "markSupplierClosed" }: span Open
|
||||||
else
|
else
|
||||||
a.supplier-is-closed-indication.is-closed{ action "markSupplierOpen" }
|
a.supplier-availability.currently-closed{ action "markSupplierOpen" }: span Closed
|
||||||
span.fa-stack.fa-lg
|
/a.supplier-is-closed-indication.is-closed{ action "markSupplierOpen" }
|
||||||
i.fa.fa-beer.fa-stack-1x
|
/span.fa-stack.fa-lg
|
||||||
i.fa.fa-ban.fa-stack-2x.text-alert
|
/i.fa.fa-beer.fa-stack-1x
|
||||||
.supplier-name= supplier.name
|
/i.fa.fa-ban.fa-stack-2x.text-alert
|
||||||
|
.supplier-name= globals.current_supplier.name
|
||||||
.extra-info{action "showSupplierStatusInfo"}
|
.extra-info{action "showSupplierStatusInfo"}
|
||||||
.supplier-info-row
|
.supplier-info-row
|
||||||
.counter.supplier-orders-placed-count
|
.counter.supplier-orders-placed-count
|
||||||
span.supplier-orders-placed-count-number= supplier.orders_placed_count
|
span.supplier-orders-placed-count-number= globals.current_supplier.orders_placed_count
|
||||||
span.orders-placed-count-icon
|
span.orders-placed-count-icon
|
||||||
.supplier-info-row
|
.supplier-info-row
|
||||||
.counter.supplier-orders-in-process-count
|
.counter.supplier-orders-in-process-count
|
||||||
span.supplier-orders-in-process-count-number= supplier.orders_in_process_count
|
span.supplier-orders-in-process-count-number= globals.current_supplier.orders_in_process_count
|
||||||
span.orders-in-process-count-icon
|
span.orders-in-process-count-icon
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
.row: .small-12.columns
|
.row: .small-12.columns
|
||||||
= sections-header sectionBinding="controller.controllers.application.active_section"
|
= sections-header sectionBinding="controller.controllers.application.active_section"
|
||||||
unless controllers.application.supplier.open
|
can "manage" globals.current_supplier
|
||||||
.alert-box.alert.radius data-alert=true
|
unless globals.current_supplier.open
|
||||||
= t 'supplier.you_are_currently_closed_alert'
|
.alert-box.alert.radius data-alert=true
|
||||||
a{ action "markSupplierOpen" }= t 'supplier.open_for_orders'
|
= t 'supplier.you_are_currently_closed_alert'
|
||||||
|
a{ action "markSupplierOpen" }= t 'supplier.open_for_orders'
|
||||||
.page-header
|
.page-header
|
||||||
div.dashboard-section-selection
|
div.dashboard-section-selection
|
||||||
/App.HomeSectionSelectorView selectionBinding="controller.controllers.application.active_section" content=controller.sections prompt=controllers.application.supplier.name
|
/App.HomeSectionSelectorView selectionBinding="controller.controllers.application.active_section" content=controller.sections prompt=globals.current_supplier.name
|
||||||
/= home-section-selector sectionBinding="controller.controllers.application.active_section"
|
/= home-section-selector sectionBinding="controller.controllers.application.active_section"
|
||||||
/= view "home-section-jumper"
|
/= view "home-section-jumper"
|
||||||
if active_lists.length
|
if active_lists.length
|
||||||
|
|||||||
@@ -6,16 +6,16 @@
|
|||||||
each product_category in sorted_product_categories
|
each product_category in sorted_product_categories
|
||||||
.row.product_category-container: .small-12.columns
|
.row.product_category-container: .small-12.columns
|
||||||
.product_category-header
|
.product_category-header
|
||||||
can manage menu
|
can "manage" "menu"
|
||||||
a.move{action "moveProductCategory" product_category} href="#"
|
a.move{action "moveProductCategory" product_category} href="#"
|
||||||
span.title= product_category.name
|
span.title= product_category.name
|
||||||
span.availability= product_category.availability_text
|
span.availability= product_category.availability_text
|
||||||
can manage menu
|
can "manage" "menu"
|
||||||
a.edit-product-category-button{action "editProductCategory" product_category} href="#": span
|
a.edit-product-category-button{action "editProductCategory" product_category} href="#": span
|
||||||
a.add-product-product_category-button{action "addProduct" product_category} href="#": span
|
a.add-product-product_category-button{action "addProduct" product_category} href="#": span
|
||||||
each product in product_category.sorted_products
|
each product in product_category.sorted_products
|
||||||
= menu-product product=product code_filter=product_code_filter
|
= menu-product product=product code_filter=product_code_filter
|
||||||
can manage menu
|
can "manage" "menu"
|
||||||
.row
|
.row
|
||||||
.small-12.columns
|
.small-12.columns
|
||||||
a.new-product_category-button{action "newProductCategory"} href="#" = t 'product_category.new_button'
|
a.new-product_category-button{action "newProductCategory"} href="#" = t 'product_category.new_button'
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
.row: .small-12.columns: h2=t 'current_employee.my_account.title'
|
||||||
|
.form-row
|
||||||
|
.form-label: label=t 'attributes.employee.email'
|
||||||
|
.form-field= input value=globals.current_employee.email type="email" classNames="supplier-email" disabled=true
|
||||||
|
.row: .small-12.columns= language-switcher
|
||||||
|
.row: .small-12.columns= suppliers-switcher
|
||||||
@@ -2,11 +2,11 @@
|
|||||||
= link-to 'sections' class="goto-sections-index-tab-header": span
|
= link-to 'sections' class="goto-sections-index-tab-header": span
|
||||||
each section in sections
|
each section in sections
|
||||||
= view "section-tab-header" context=section
|
= view "section-tab-header" context=section
|
||||||
can manage sections
|
can "manage" "sections"
|
||||||
a.add-section{action "addSection"}: span
|
a.add-section{action "addSection"}: span
|
||||||
.section-manage-tables.pull-right
|
.section-manage-tables.pull-right
|
||||||
a.go-to-orders-list{ action "showDashboardOrders" model }: span
|
a.go-to-orders-list{ action "showDashboardOrders" model }: span
|
||||||
can manage sections
|
can "manage" "sections"
|
||||||
if editmode
|
if editmode
|
||||||
= input type="text" value=model.title class="section-edit-title-field"
|
= input type="text" value=model.title class="section-edit-title-field"
|
||||||
= number-field numericValue=model.width class="dimension section-edit-width-field"
|
= number-field numericValue=model.width class="dimension section-edit-width-field"
|
||||||
|
|||||||
@@ -36,6 +36,6 @@
|
|||||||
else
|
else
|
||||||
.row: .small-12.columns
|
.row: .small-12.columns
|
||||||
.panel=t 'section.none_found'
|
.panel=t 'section.none_found'
|
||||||
can manage sections
|
can "manage" "sections"
|
||||||
.form-actions
|
.form-actions
|
||||||
a.form-action-new{action "addSection"}=t 'helpers.links.new'
|
a.form-action-new{action "addSection"}=t 'helpers.links.new'
|
||||||
|
|||||||
@@ -18,10 +18,10 @@
|
|||||||
= table.section.title
|
= table.section.title
|
||||||
/td.timestamp=time table.created_at
|
/td.timestamp=time table.created_at
|
||||||
td.actions
|
td.actions
|
||||||
can manage tables
|
can "manage" "tables"
|
||||||
a.table-edit{ action 'editTable' table }: span
|
a.table-edit{ action 'editTable' table }: span
|
||||||
a.table-destroy{ action 'destroyTable' table }: span
|
a.table-destroy{ action 'destroyTable' table }: span
|
||||||
.form-actions
|
.form-actions
|
||||||
can manage tables
|
can "manage" "tables"
|
||||||
a.form-action-new.new-table-button{action "newTable"}= t 'table.new_button'
|
a.form-action-new.new-table-button{action "newTable"}= t 'table.new_button'
|
||||||
= qr-codes-link
|
= qr-codes-link
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ App.SectionTableView = Ember.View.extend DragNDrop.Draggable,
|
|||||||
"section-table-#{@get('content.id')}"
|
"section-table-#{@get('content.id')}"
|
||||||
).property('content.id')
|
).property('content.id')
|
||||||
offsetX: (->
|
offsetX: (->
|
||||||
debugger unless @get('dpm')
|
|
||||||
(@get('dpm') || 0) * (@get('content.position_x') || 0)
|
(@get('dpm') || 0) * (@get('content.position_x') || 0)
|
||||||
).property('dpm', 'content.position_x')
|
).property('dpm', 'content.position_x')
|
||||||
offsetY: (->
|
offsetY: (->
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
//= require pickdate
|
//= require pickdate
|
||||||
//= require_directory .
|
//= require_directory .
|
||||||
//= require_self
|
//= require_self
|
||||||
|
|
||||||
if(!Modernizr.cssanimations){
|
if(!Modernizr.cssanimations){
|
||||||
window.location = "/unsupported-browser";
|
window.location = "/unsupported-browser";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,9 +13,14 @@
|
|||||||
margin-right: 6px
|
margin-right: 6px
|
||||||
|
|
||||||
.dropdown-list-container
|
.dropdown-list-container
|
||||||
|
$border-size: 1px
|
||||||
|
$arrow-size: 7px
|
||||||
|
$border-color: #333
|
||||||
|
$background-color: white
|
||||||
|
$right-offset: 16px
|
||||||
display: none
|
display: none
|
||||||
text-align: left
|
text-align: left
|
||||||
background-color: white
|
background-color: $background-color
|
||||||
position: absolute
|
position: absolute
|
||||||
right: 0
|
right: 0
|
||||||
margin: 0
|
margin: 0
|
||||||
@@ -23,18 +28,75 @@
|
|||||||
z-index: 542
|
z-index: 542
|
||||||
margin-top: 7px
|
margin-top: 7px
|
||||||
border-radius: 4px
|
border-radius: 4px
|
||||||
|
border: $border-size solid $border-color
|
||||||
|
box-shadow: 5px 5px 5px #888888
|
||||||
|
|
||||||
&:after
|
// Arrow
|
||||||
|
&:before, &:after
|
||||||
border: solid transparent
|
border: solid transparent
|
||||||
content: " "
|
content: " "
|
||||||
height: 0
|
height: 0
|
||||||
width: 0
|
width: 0
|
||||||
position: absolute
|
position: absolute
|
||||||
pointer-events: none
|
pointer-events: none
|
||||||
border-width: 6px
|
|
||||||
border-bottom-color: white
|
|
||||||
bottom: 100%
|
bottom: 100%
|
||||||
right: 30px
|
&:after
|
||||||
|
border-width: $arrow-size
|
||||||
|
margin-left: -$arrow-size
|
||||||
|
border-bottom-color: $background-color
|
||||||
|
right: $right-offset + $border-size
|
||||||
|
&:before
|
||||||
|
border-bottom-color: $border-color
|
||||||
|
border-width: $arrow-size + $border-size
|
||||||
|
margin-left: -($arrow-size + $border-size)
|
||||||
|
right: $right-offset
|
||||||
|
|
||||||
|
ul
|
||||||
|
list-style: none
|
||||||
|
margin: 0
|
||||||
|
padding: 0
|
||||||
|
li
|
||||||
|
border-bottom: 1px solid #bbb
|
||||||
|
a
|
||||||
|
font-size: 0.8em
|
||||||
|
display: block
|
||||||
|
padding: 4px 7px
|
||||||
|
&:hover
|
||||||
|
background-color: #ddd
|
||||||
|
span.section-add-tables-icon
|
||||||
|
@extend .fa
|
||||||
|
@extend .fa-plus-square
|
||||||
|
span
|
||||||
|
padding-left: 7px
|
||||||
|
span.section-arrange-tables-icon
|
||||||
|
@extend .fa
|
||||||
|
@extend .fa-th
|
||||||
|
span
|
||||||
|
padding-left: 7px
|
||||||
|
span.section-remove-icon
|
||||||
|
@extend .fa, .fa-trash-o
|
||||||
|
span
|
||||||
|
padding-left: 7px
|
||||||
|
span.section-add-section-element-icon
|
||||||
|
@extend .fa, .fa-image
|
||||||
|
span
|
||||||
|
padding-left: 7px
|
||||||
|
span.section-add-section-area-icon
|
||||||
|
@extend .fa, .fa-square
|
||||||
|
span
|
||||||
|
padding-left: 7px
|
||||||
|
span.settings-icon
|
||||||
|
@extend .fa, .fa-gear
|
||||||
|
span
|
||||||
|
padding-left: 7px
|
||||||
|
span.sign-out-icon
|
||||||
|
@extend .fa, .fa-sign-out
|
||||||
|
span
|
||||||
|
padding-left: 7px
|
||||||
|
span.current-employee-my-account-icon
|
||||||
|
@extend .fa, .fa-user
|
||||||
|
span
|
||||||
|
padding-left: 7px
|
||||||
&.active
|
&.active
|
||||||
.dropdown-list-container
|
.dropdown-list-container
|
||||||
display: block
|
display: block
|
||||||
|
|||||||
@@ -32,45 +32,8 @@
|
|||||||
.section-manage-tables
|
.section-manage-tables
|
||||||
.dropdown-container
|
.dropdown-container
|
||||||
margin-right: 10px
|
margin-right: 10px
|
||||||
$icon-right-margin: 16px
|
|
||||||
ul
|
|
||||||
list-style: none
|
|
||||||
margin: 0
|
|
||||||
padding: 0
|
|
||||||
li
|
|
||||||
border-bottom: 1px solid #bbb
|
|
||||||
a
|
|
||||||
font-size: 0.8em
|
|
||||||
display: block
|
|
||||||
padding: 4px 7px
|
|
||||||
&:hover
|
|
||||||
background-color: #ddd
|
|
||||||
span.qr-icon
|
|
||||||
margin-right: $icon-right-margin
|
|
||||||
.section-destroy
|
.section-destroy
|
||||||
color: $alert-color
|
color: $alert-color
|
||||||
span.section-add-tables-icon
|
|
||||||
@extend .fa
|
|
||||||
@extend .fa-plus-square
|
|
||||||
span
|
|
||||||
padding-left: 7px
|
|
||||||
span.section-arrange-tables-icon
|
|
||||||
@extend .fa
|
|
||||||
@extend .fa-th
|
|
||||||
span
|
|
||||||
padding-left: 7px
|
|
||||||
span.section-remove-icon
|
|
||||||
@extend .fa, .fa-trash-o
|
|
||||||
span
|
|
||||||
padding-left: 7px
|
|
||||||
span.section-add-section-element-icon
|
|
||||||
@extend .fa, .fa-image
|
|
||||||
span
|
|
||||||
padding-left: 7px
|
|
||||||
span.section-add-section-area-icon
|
|
||||||
@extend .fa, .fa-square
|
|
||||||
span
|
|
||||||
padding-left: 7px
|
|
||||||
input
|
input
|
||||||
height: auto
|
height: auto
|
||||||
padding-top: 4px
|
padding-top: 4px
|
||||||
|
|||||||
@@ -98,3 +98,28 @@ header.top-menu
|
|||||||
@extend .fa
|
@extend .fa
|
||||||
@extend .fa-bars
|
@extend .fa-bars
|
||||||
@extend .fa-lg
|
@extend .fa-lg
|
||||||
|
|
||||||
|
// CURRENT EMPOYEE NAV
|
||||||
|
.current-employee-nav
|
||||||
|
float: right
|
||||||
|
margin-right: 10px
|
||||||
|
.dropdown-trigger.gravatar
|
||||||
|
display: inline-block
|
||||||
|
overflow: hidden
|
||||||
|
border-radius: $global-rounded
|
||||||
|
|
||||||
|
// SUPPLIER AVAILABILITY
|
||||||
|
.supplier-availability
|
||||||
|
border: 2px solid #555
|
||||||
|
border-radius: 4px
|
||||||
|
padding: 5px 3px
|
||||||
|
font-weight: bold
|
||||||
|
font-size: 0.9em
|
||||||
|
float: right
|
||||||
|
margin-right: 8px
|
||||||
|
text-transform: uppercase
|
||||||
|
margin-top: 10px
|
||||||
|
&.currently-open
|
||||||
|
color: #5f5
|
||||||
|
&.currently-closed
|
||||||
|
color: #f55
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
.suppliers-switcher-container
|
||||||
|
margin-top: 12px
|
||||||
@@ -18,7 +18,7 @@ module Suppliers
|
|||||||
def switch_to
|
def switch_to
|
||||||
@switch_supplier = Supplier.find(params[:id])
|
@switch_supplier = Supplier.find(params[:id])
|
||||||
session[:supplier_id] = params[:id] if @switch_supplier.employee_ids.include? current_employee.id
|
session[:supplier_id] = params[:id] if @switch_supplier.employee_ids.include? current_employee.id
|
||||||
redirect_to supplier_root_path(anchor: '/settings')
|
redirect_to supplier_root_path(anchor: '/my_account')
|
||||||
end
|
end
|
||||||
|
|
||||||
def mark_as_open
|
def mark_as_open
|
||||||
|
|||||||
@@ -234,3 +234,8 @@ en:
|
|||||||
save_button: Save
|
save_button: Save
|
||||||
close_button: Close
|
close_button: Close
|
||||||
destroy_button: Delete
|
destroy_button: Delete
|
||||||
|
current_employee:
|
||||||
|
my_account:
|
||||||
|
link: My account
|
||||||
|
title: My account
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ nl:
|
|||||||
page:
|
page:
|
||||||
cannot_compile: There is an error in the page that prevented it from being displayed.
|
cannot_compile: There is an error in the page that prevented it from being displayed.
|
||||||
confirm:
|
confirm:
|
||||||
cancel: Sluit
|
cancel: Cancel
|
||||||
confirm: Ja
|
confirm: Ja
|
||||||
general:
|
general:
|
||||||
destroy:
|
destroy:
|
||||||
@@ -237,3 +237,7 @@ nl:
|
|||||||
save_button: Save
|
save_button: Save
|
||||||
close_button: Close
|
close_button: Close
|
||||||
destroy_button: Verwijderen
|
destroy_button: Verwijderen
|
||||||
|
current_employee:
|
||||||
|
my_account:
|
||||||
|
link: Mijn account
|
||||||
|
title: Mijn account
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ test "Triggers switch", ->
|
|||||||
controller.store.createRecord 'supplier',
|
controller.store.createRecord 'supplier',
|
||||||
id: 'other-supplier'
|
id: 'other-supplier'
|
||||||
name: 'Other supplier1'
|
name: 'Other supplier1'
|
||||||
component.set 'targetObject', controller
|
#component.set 'targetObject', controller
|
||||||
@render()
|
@render()
|
||||||
equal find('ul').text(), "Switch to Other supplier1"
|
equal find('ul').text(), "Switch to Other supplier1"
|
||||||
|
|
||||||
|
|||||||
Vendored
+274
@@ -0,0 +1,274 @@
|
|||||||
|
/*
|
||||||
|
* JavaScript MD5 1.0.1
|
||||||
|
* https://github.com/blueimp/JavaScript-MD5
|
||||||
|
*
|
||||||
|
* Copyright 2011, Sebastian Tschan
|
||||||
|
* https://blueimp.net
|
||||||
|
*
|
||||||
|
* Licensed under the MIT license:
|
||||||
|
* http://www.opensource.org/licenses/MIT
|
||||||
|
*
|
||||||
|
* Based on
|
||||||
|
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
|
||||||
|
* Digest Algorithm, as defined in RFC 1321.
|
||||||
|
* Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
|
||||||
|
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
|
||||||
|
* Distributed under the BSD License
|
||||||
|
* See http://pajhome.org.uk/crypt/md5 for more info.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*jslint bitwise: true */
|
||||||
|
/*global unescape, define */
|
||||||
|
|
||||||
|
(function ($) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
|
||||||
|
* to work around bugs in some JS interpreters.
|
||||||
|
*/
|
||||||
|
function safe_add(x, y) {
|
||||||
|
var lsw = (x & 0xFFFF) + (y & 0xFFFF),
|
||||||
|
msw = (x >> 16) + (y >> 16) + (lsw >> 16);
|
||||||
|
return (msw << 16) | (lsw & 0xFFFF);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Bitwise rotate a 32-bit number to the left.
|
||||||
|
*/
|
||||||
|
function bit_rol(num, cnt) {
|
||||||
|
return (num << cnt) | (num >>> (32 - cnt));
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* These functions implement the four basic operations the algorithm uses.
|
||||||
|
*/
|
||||||
|
function md5_cmn(q, a, b, x, s, t) {
|
||||||
|
return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);
|
||||||
|
}
|
||||||
|
function md5_ff(a, b, c, d, x, s, t) {
|
||||||
|
return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
|
||||||
|
}
|
||||||
|
function md5_gg(a, b, c, d, x, s, t) {
|
||||||
|
return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
|
||||||
|
}
|
||||||
|
function md5_hh(a, b, c, d, x, s, t) {
|
||||||
|
return md5_cmn(b ^ c ^ d, a, b, x, s, t);
|
||||||
|
}
|
||||||
|
function md5_ii(a, b, c, d, x, s, t) {
|
||||||
|
return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Calculate the MD5 of an array of little-endian words, and a bit length.
|
||||||
|
*/
|
||||||
|
function binl_md5(x, len) {
|
||||||
|
/* append padding */
|
||||||
|
x[len >> 5] |= 0x80 << (len % 32);
|
||||||
|
x[(((len + 64) >>> 9) << 4) + 14] = len;
|
||||||
|
|
||||||
|
var i, olda, oldb, oldc, oldd,
|
||||||
|
a = 1732584193,
|
||||||
|
b = -271733879,
|
||||||
|
c = -1732584194,
|
||||||
|
d = 271733878;
|
||||||
|
|
||||||
|
for (i = 0; i < x.length; i += 16) {
|
||||||
|
olda = a;
|
||||||
|
oldb = b;
|
||||||
|
oldc = c;
|
||||||
|
oldd = d;
|
||||||
|
|
||||||
|
a = md5_ff(a, b, c, d, x[i], 7, -680876936);
|
||||||
|
d = md5_ff(d, a, b, c, x[i + 1], 12, -389564586);
|
||||||
|
c = md5_ff(c, d, a, b, x[i + 2], 17, 606105819);
|
||||||
|
b = md5_ff(b, c, d, a, x[i + 3], 22, -1044525330);
|
||||||
|
a = md5_ff(a, b, c, d, x[i + 4], 7, -176418897);
|
||||||
|
d = md5_ff(d, a, b, c, x[i + 5], 12, 1200080426);
|
||||||
|
c = md5_ff(c, d, a, b, x[i + 6], 17, -1473231341);
|
||||||
|
b = md5_ff(b, c, d, a, x[i + 7], 22, -45705983);
|
||||||
|
a = md5_ff(a, b, c, d, x[i + 8], 7, 1770035416);
|
||||||
|
d = md5_ff(d, a, b, c, x[i + 9], 12, -1958414417);
|
||||||
|
c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);
|
||||||
|
b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);
|
||||||
|
a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682);
|
||||||
|
d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);
|
||||||
|
c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);
|
||||||
|
b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329);
|
||||||
|
|
||||||
|
a = md5_gg(a, b, c, d, x[i + 1], 5, -165796510);
|
||||||
|
d = md5_gg(d, a, b, c, x[i + 6], 9, -1069501632);
|
||||||
|
c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713);
|
||||||
|
b = md5_gg(b, c, d, a, x[i], 20, -373897302);
|
||||||
|
a = md5_gg(a, b, c, d, x[i + 5], 5, -701558691);
|
||||||
|
d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083);
|
||||||
|
c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);
|
||||||
|
b = md5_gg(b, c, d, a, x[i + 4], 20, -405537848);
|
||||||
|
a = md5_gg(a, b, c, d, x[i + 9], 5, 568446438);
|
||||||
|
d = md5_gg(d, a, b, c, x[i + 14], 9, -1019803690);
|
||||||
|
c = md5_gg(c, d, a, b, x[i + 3], 14, -187363961);
|
||||||
|
b = md5_gg(b, c, d, a, x[i + 8], 20, 1163531501);
|
||||||
|
a = md5_gg(a, b, c, d, x[i + 13], 5, -1444681467);
|
||||||
|
d = md5_gg(d, a, b, c, x[i + 2], 9, -51403784);
|
||||||
|
c = md5_gg(c, d, a, b, x[i + 7], 14, 1735328473);
|
||||||
|
b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);
|
||||||
|
|
||||||
|
a = md5_hh(a, b, c, d, x[i + 5], 4, -378558);
|
||||||
|
d = md5_hh(d, a, b, c, x[i + 8], 11, -2022574463);
|
||||||
|
c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562);
|
||||||
|
b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);
|
||||||
|
a = md5_hh(a, b, c, d, x[i + 1], 4, -1530992060);
|
||||||
|
d = md5_hh(d, a, b, c, x[i + 4], 11, 1272893353);
|
||||||
|
c = md5_hh(c, d, a, b, x[i + 7], 16, -155497632);
|
||||||
|
b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);
|
||||||
|
a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174);
|
||||||
|
d = md5_hh(d, a, b, c, x[i], 11, -358537222);
|
||||||
|
c = md5_hh(c, d, a, b, x[i + 3], 16, -722521979);
|
||||||
|
b = md5_hh(b, c, d, a, x[i + 6], 23, 76029189);
|
||||||
|
a = md5_hh(a, b, c, d, x[i + 9], 4, -640364487);
|
||||||
|
d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);
|
||||||
|
c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520);
|
||||||
|
b = md5_hh(b, c, d, a, x[i + 2], 23, -995338651);
|
||||||
|
|
||||||
|
a = md5_ii(a, b, c, d, x[i], 6, -198630844);
|
||||||
|
d = md5_ii(d, a, b, c, x[i + 7], 10, 1126891415);
|
||||||
|
c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);
|
||||||
|
b = md5_ii(b, c, d, a, x[i + 5], 21, -57434055);
|
||||||
|
a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571);
|
||||||
|
d = md5_ii(d, a, b, c, x[i + 3], 10, -1894986606);
|
||||||
|
c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);
|
||||||
|
b = md5_ii(b, c, d, a, x[i + 1], 21, -2054922799);
|
||||||
|
a = md5_ii(a, b, c, d, x[i + 8], 6, 1873313359);
|
||||||
|
d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);
|
||||||
|
c = md5_ii(c, d, a, b, x[i + 6], 15, -1560198380);
|
||||||
|
b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649);
|
||||||
|
a = md5_ii(a, b, c, d, x[i + 4], 6, -145523070);
|
||||||
|
d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);
|
||||||
|
c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259);
|
||||||
|
b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551);
|
||||||
|
|
||||||
|
a = safe_add(a, olda);
|
||||||
|
b = safe_add(b, oldb);
|
||||||
|
c = safe_add(c, oldc);
|
||||||
|
d = safe_add(d, oldd);
|
||||||
|
}
|
||||||
|
return [a, b, c, d];
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Convert an array of little-endian words to a string
|
||||||
|
*/
|
||||||
|
function binl2rstr(input) {
|
||||||
|
var i,
|
||||||
|
output = '';
|
||||||
|
for (i = 0; i < input.length * 32; i += 8) {
|
||||||
|
output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);
|
||||||
|
}
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Convert a raw string to an array of little-endian words
|
||||||
|
* Characters >255 have their high-byte silently ignored.
|
||||||
|
*/
|
||||||
|
function rstr2binl(input) {
|
||||||
|
var i,
|
||||||
|
output = [];
|
||||||
|
output[(input.length >> 2) - 1] = undefined;
|
||||||
|
for (i = 0; i < output.length; i += 1) {
|
||||||
|
output[i] = 0;
|
||||||
|
}
|
||||||
|
for (i = 0; i < input.length * 8; i += 8) {
|
||||||
|
output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);
|
||||||
|
}
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Calculate the MD5 of a raw string
|
||||||
|
*/
|
||||||
|
function rstr_md5(s) {
|
||||||
|
return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Calculate the HMAC-MD5, of a key and some data (raw strings)
|
||||||
|
*/
|
||||||
|
function rstr_hmac_md5(key, data) {
|
||||||
|
var i,
|
||||||
|
bkey = rstr2binl(key),
|
||||||
|
ipad = [],
|
||||||
|
opad = [],
|
||||||
|
hash;
|
||||||
|
ipad[15] = opad[15] = undefined;
|
||||||
|
if (bkey.length > 16) {
|
||||||
|
bkey = binl_md5(bkey, key.length * 8);
|
||||||
|
}
|
||||||
|
for (i = 0; i < 16; i += 1) {
|
||||||
|
ipad[i] = bkey[i] ^ 0x36363636;
|
||||||
|
opad[i] = bkey[i] ^ 0x5C5C5C5C;
|
||||||
|
}
|
||||||
|
hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);
|
||||||
|
return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Convert a raw string to a hex string
|
||||||
|
*/
|
||||||
|
function rstr2hex(input) {
|
||||||
|
var hex_tab = '0123456789abcdef',
|
||||||
|
output = '',
|
||||||
|
x,
|
||||||
|
i;
|
||||||
|
for (i = 0; i < input.length; i += 1) {
|
||||||
|
x = input.charCodeAt(i);
|
||||||
|
output += hex_tab.charAt((x >>> 4) & 0x0F) +
|
||||||
|
hex_tab.charAt(x & 0x0F);
|
||||||
|
}
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Encode a string as utf-8
|
||||||
|
*/
|
||||||
|
function str2rstr_utf8(input) {
|
||||||
|
return unescape(encodeURIComponent(input));
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Take string arguments and return either raw or hex encoded strings
|
||||||
|
*/
|
||||||
|
function raw_md5(s) {
|
||||||
|
return rstr_md5(str2rstr_utf8(s));
|
||||||
|
}
|
||||||
|
function hex_md5(s) {
|
||||||
|
return rstr2hex(raw_md5(s));
|
||||||
|
}
|
||||||
|
function raw_hmac_md5(k, d) {
|
||||||
|
return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d));
|
||||||
|
}
|
||||||
|
function hex_hmac_md5(k, d) {
|
||||||
|
return rstr2hex(raw_hmac_md5(k, d));
|
||||||
|
}
|
||||||
|
|
||||||
|
function md5(string, key, raw) {
|
||||||
|
if (!key) {
|
||||||
|
if (!raw) {
|
||||||
|
return hex_md5(string);
|
||||||
|
}
|
||||||
|
return raw_md5(string);
|
||||||
|
}
|
||||||
|
if (!raw) {
|
||||||
|
return hex_hmac_md5(key, string);
|
||||||
|
}
|
||||||
|
return raw_hmac_md5(key, string);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
define(function () {
|
||||||
|
return md5;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
$.md5 = md5;
|
||||||
|
}
|
||||||
|
}(this));
|
||||||
@@ -19,6 +19,7 @@ Supplier
|
|||||||
- Add qr-print button to tables
|
- Add qr-print button to tables
|
||||||
- Order product buttons to views
|
- Order product buttons to views
|
||||||
- Use modernizr svg to determine svg handling capabilities
|
- Use modernizr svg to determine svg handling capabilities
|
||||||
|
- Add spec for switching from non-manager supplier to other supplier
|
||||||
|
|
||||||
|
|
||||||
User
|
User
|
||||||
|
|||||||
Reference in New Issue
Block a user