Add touch events
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
Ember.Handlebars.registerHelper 't', (path, params..., options)->
|
Ember.Handlebars.helper 't', (path, params..., options)->
|
||||||
text = t(path)
|
text = t(path)
|
||||||
tag = if options.hash.bare then text else "<span data-t='#{path}' data-t-attributes='{}'>#{text}</span>"
|
tag = if options.hash.bare then text else "<span data-t='#{path}' data-t-attributes='{}'>#{text}</span>"
|
||||||
new Handlebars.SafeString tag
|
tag.htmlSafe()
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#= require_self
|
#= require_self
|
||||||
|
#= require jquery.touchSwipe
|
||||||
#= require handlebars
|
#= require handlebars
|
||||||
#= require ember
|
#= require ember
|
||||||
#= require ember-data
|
#= require ember-data
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
header.top-menu
|
.top-menu
|
||||||
.toggle-side-menu: span
|
|
||||||
.top-menu-bar
|
.top-menu-bar
|
||||||
.menu-content
|
.menu-content
|
||||||
section.main-buttons
|
section.main-buttons
|
||||||
@@ -30,7 +29,8 @@ header.top-menu
|
|||||||
.counter.supplier-orders-in-process-count
|
.counter.supplier-orders-in-process-count
|
||||||
= list.supplier.orders_in_process_count
|
= list.supplier.orders_in_process_count
|
||||||
span.orders-in-process-count-icon
|
span.orders-in-process-count-icon
|
||||||
aside.side-menu
|
.side-menu
|
||||||
|
.toggle-side-menu: span
|
||||||
ul
|
ul
|
||||||
li.title: h3 Menu
|
li.title: h3 Menu
|
||||||
li
|
li
|
||||||
@@ -69,7 +69,7 @@ aside.side-menu
|
|||||||
a{action "openDebugger"}
|
a{action "openDebugger"}
|
||||||
span.fa.fa-wrench.fa-lg
|
span.fa.fa-wrench.fa-lg
|
||||||
span Debugger
|
span Debugger
|
||||||
main.main-section
|
.main-section
|
||||||
.main-section-content
|
.main-section-content
|
||||||
if notice
|
if notice
|
||||||
#notice.alert-box{action "clearNotice"} data-alert=true
|
#notice.alert-box{action "clearNotice"} data-alert=true
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
App.ApplicationView = Ember.View.extend
|
App.ApplicationView = Ember.View.extend
|
||||||
didInsertElement: ->
|
didInsertElement: ->
|
||||||
$('.main-section').css 'min-height', $(window).height() - $('.top-menu').outerHeight()
|
# Side menu collapsing
|
||||||
|
targets = @$('.side-menu')
|
||||||
$('.toggle-side-menu,.side-menu').click ->
|
targets.addClass('closed').click -> targets.toggleClass('active').addClass('clicked').toggleClass('closed')
|
||||||
menu = $('aside.side-menu')
|
controller = @get('controller')
|
||||||
toggle = $('.toggle-side-menu')
|
@$('.main-section').swipe
|
||||||
if menu.is(':visible')
|
swipe: (event, direction, distance, duration, fingerCount) ->
|
||||||
menu.animate left: -255, -> $(@).hide()
|
if fingerCount is 2
|
||||||
toggle.animate left: 0, -> $(@).removeClass('open')
|
if direction is "right"
|
||||||
else
|
targets.addClass('active clicked').removeClass('closed')
|
||||||
menu.show().animate left: 0
|
if direction is "left"
|
||||||
toggle.animate left: 222 - 30, -> $(@).addClass('open')
|
targets.removeClass('active').addClass('closed')
|
||||||
|
if fingerCount is 3 and direction is "up"
|
||||||
|
controller.transitionToRoute "settings"
|
||||||
|
fingers: 'all'
|
||||||
|
|||||||
@@ -3,13 +3,7 @@
|
|||||||
#= require faye
|
#= require faye
|
||||||
#= require moment
|
#= require moment
|
||||||
#= require translations
|
#= require translations
|
||||||
#= require_directory .
|
|
||||||
#= require_self
|
#= require_self
|
||||||
#
|
|
||||||
# (($) ->
|
|
||||||
# origAppend = $.fn.append
|
|
||||||
# $.fn.append = -> origAppend.apply(@, arguments).trigger("append")
|
|
||||||
# )(jQuery)
|
|
||||||
|
|
||||||
@Qstorage = localStorage
|
@Qstorage = localStorage
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
html, body
|
html, body
|
||||||
margin: 0
|
margin: 0
|
||||||
padding: 0
|
padding: 0
|
||||||
|
//width: 100%
|
||||||
|
//height: 100%
|
||||||
body
|
body
|
||||||
overflow-x: hidden
|
overflow-x: hidden
|
||||||
@media #{$small-only}
|
@media #{$small-only}
|
||||||
@@ -9,14 +11,23 @@ body
|
|||||||
background-image: image-url('theme1/wall-bg.jpg')
|
background-image: image-url('theme1/wall-bg.jpg')
|
||||||
background-repeat: repeat
|
background-repeat: repeat
|
||||||
padding-top: $top-menu-height
|
padding-top: $top-menu-height
|
||||||
|
|
||||||
main.main-section
|
|
||||||
+panel($bg:rgba(200,200,200,0.8))
|
|
||||||
//height: 100%
|
//height: 100%
|
||||||
|
> .ember-view
|
||||||
|
// application-view
|
||||||
|
//height: 100%
|
||||||
|
|
||||||
|
.main-section
|
||||||
|
+panel($bg:rgba(200,200,200,0.8))
|
||||||
|
position: absolute
|
||||||
padding: 0
|
padding: 0
|
||||||
margin: 0
|
margin: 0
|
||||||
|
width: 100%
|
||||||
|
top: $top-menu-height
|
||||||
|
bottom: 0
|
||||||
|
overflow-y: scroll
|
||||||
|
-webkit-overflow-scrolling: touch
|
||||||
.main-section-content
|
.main-section-content
|
||||||
min-height: calc(100% - #{$top-menu-height})
|
//nothing
|
||||||
span.icon
|
span.icon
|
||||||
@extend .fa
|
@extend .fa
|
||||||
@extend .fa-lg
|
@extend .fa-lg
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
header.top-menu
|
.top-menu
|
||||||
// Fixed styling rules copied from foundation top-menu fixed
|
// Fixed styling rules copied from foundation top-menu fixed
|
||||||
width: 100%
|
width: 100%
|
||||||
#{$default-float}: 0
|
#{$default-float}: 0
|
||||||
position: fixed
|
position: absolute
|
||||||
top: 0
|
top: 0
|
||||||
z-index: 99
|
z-index: 99
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,23 @@
|
|||||||
aside.side-menu
|
$side-menu-width: 222px
|
||||||
|
.side-menu
|
||||||
background-color: #444
|
background-color: #444
|
||||||
position: fixed
|
position: fixed
|
||||||
display: none
|
//display: none
|
||||||
left: -222px
|
left: -$side-menu-width
|
||||||
top: 0
|
top: 0
|
||||||
width: 222px
|
width: $side-menu-width
|
||||||
height: 100%
|
height: 100%
|
||||||
z-index: 157
|
z-index: 157
|
||||||
opacity: 0.9
|
opacity: 0.9
|
||||||
border-right: 2px solid black
|
border-right: 2px solid black
|
||||||
|
&.active
|
||||||
|
left: 0
|
||||||
|
+animation(sideMenuActive 0.5s)
|
||||||
|
.toggle-side-menu
|
||||||
|
right: 5px
|
||||||
|
&.closed
|
||||||
|
&.clicked
|
||||||
|
+animation(sideMenuClosed 0.3s)
|
||||||
> ul
|
> ul
|
||||||
list-style: none
|
list-style: none
|
||||||
a
|
a
|
||||||
@@ -47,13 +56,22 @@ aside.side-menu
|
|||||||
width: 28px
|
width: 28px
|
||||||
height: 28px
|
height: 28px
|
||||||
color: white
|
color: white
|
||||||
left: 0
|
right: -30px
|
||||||
cursor: pointer
|
cursor: pointer
|
||||||
z-index: 100
|
//z-index: 158
|
||||||
font-size: 1.6em
|
font-size: 1.6em
|
||||||
&.open
|
|
||||||
color: white
|
|
||||||
span
|
span
|
||||||
@extend .fa
|
@extend .fa
|
||||||
@extend .fa-lg
|
@extend .fa-lg
|
||||||
@extend .fa-bars
|
@extend .fa-bars
|
||||||
|
|
||||||
|
+keyframes(sideMenuActive)
|
||||||
|
from
|
||||||
|
left: -$side-menu-width
|
||||||
|
to
|
||||||
|
left: 0
|
||||||
|
+keyframes(sideMenuClosed)
|
||||||
|
from
|
||||||
|
left: 0
|
||||||
|
to
|
||||||
|
left: -$side-menu-width
|
||||||
|
|||||||
+5
-1
@@ -1,7 +1,11 @@
|
|||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
extensions = %w[jpg jpeg png js css gif svg json woff eot ttf otf ]
|
extensions = %w[jpg jpeg png js css gif svg json woff eot ttf otf ]
|
||||||
|
start_time = Time.now
|
||||||
Dir.glob(File.join('public/assets/**', "*.{#{extensions.join(',')}}")).each do |asset_path|
|
Dir.glob(File.join('public/assets/**', "*.{#{extensions.join(',')}}")).each do |asset_path|
|
||||||
next unless asset_path =~ /-[a-f0-9]{32}\.(#{extensions.join('|')})\Z/
|
next unless asset_path =~ /-[a-f0-9]{32}\.(#{extensions.join('|')})\Z/
|
||||||
dedigest_path = asset_path.sub(/-[a-f0-9]{32}/, '')
|
dedigest_path = asset_path.sub(/-[a-f0-9]{32}/, '')
|
||||||
`mv '#{asset_path}' '#{dedigest_path}' 2>/dev/null`
|
#`mv '#{asset_path}' '#{dedigest_path}' 2>/dev/null`
|
||||||
|
`mv '#{asset_path}' '#{dedigest_path}'`
|
||||||
end
|
end
|
||||||
|
end_time = Time.now
|
||||||
|
puts "Dedigested assets in #{(end_time - start_time).round} seconds}"
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
|
start_time = Time.now
|
||||||
require 'active_support/all'
|
require 'active_support/all'
|
||||||
require 'uglifier'
|
require 'uglifier'
|
||||||
require 'fileutils'
|
require 'fileutils'
|
||||||
@@ -42,4 +43,7 @@ remove 'user/app/application.js' # embedded in flat/application
|
|||||||
gsub_file 'user/foundation/application.css', /url\(("?)\/assets/, 'url(\1../..'
|
gsub_file 'user/foundation/application.css', /url\(("?)\/assets/, 'url(\1../..'
|
||||||
gsub_all_scripts 'src="/assets', 'src="./assets'
|
gsub_all_scripts 'src="/assets', 'src="./assets'
|
||||||
|
|
||||||
compress_js 'user/flat/application.js'
|
#compress_js 'user/flat/application.js'
|
||||||
|
|
||||||
|
end_time = Time.now
|
||||||
|
puts "Converted assets for mobile in #{(end_time - start_time).round} seconds"
|
||||||
|
|||||||
@@ -21,11 +21,13 @@ Qwaiter::Application.configure do
|
|||||||
|
|
||||||
# Compress JavaScripts and CSS
|
# Compress JavaScripts and CSS
|
||||||
# config.assets.js_compressor = :uglifier # compress manual, since the rails 4 asset pipeline is non configurable
|
# config.assets.js_compressor = :uglifier # compress manual, since the rails 4 asset pipeline is non configurable
|
||||||
|
config.assets.css_compressor = nil
|
||||||
|
|
||||||
config.ember.variant = :production if defined?(Ember::Rails)
|
config.ember.variant = :production if defined?(Ember::Rails)
|
||||||
|
|
||||||
# Generate digests for assets URLs
|
# Generate digests for assets URLs
|
||||||
config.assets.compile = true
|
config.assets.compile = true
|
||||||
|
config.assets.compress = false
|
||||||
config.assets.digest = false
|
config.assets.digest = false
|
||||||
|
|
||||||
# Defaults to nil and saved in location specified by config.assets.prefix
|
# Defaults to nil and saved in location specified by config.assets.prefix
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
0.9.6
|
0.9.20
|
||||||
|
|||||||
+18
-4
@@ -5,7 +5,7 @@ require 'pry'
|
|||||||
class String; def to_version; Versionomy.parse(self) end end
|
class String; def to_version; Versionomy.parse(self) end end
|
||||||
|
|
||||||
HOME=ENV['HOME']
|
HOME=ENV['HOME']
|
||||||
APP_ROOT="#{HOME}/Documents/workspace/mozo"
|
APP_ROOT="#{HOME}/Documents/workspace/mozo-mobile-app"
|
||||||
APP_ASSET_ROOT="#{APP_ROOT}/www/assets"
|
APP_ASSET_ROOT="#{APP_ROOT}/www/assets"
|
||||||
app_config_path = File.join(APP_ROOT, 'config.xml')
|
app_config_path = File.join(APP_ROOT, 'config.xml')
|
||||||
app_config = File.read(app_config_path)
|
app_config = File.read(app_config_path)
|
||||||
@@ -29,10 +29,24 @@ end
|
|||||||
`rm -rf public/assets`
|
`rm -rf public/assets`
|
||||||
`QWAITER_MOBILE_EXPORT=yes RAILS_ENV=user_app bundle exec rake assets:precompile`
|
`QWAITER_MOBILE_EXPORT=yes RAILS_ENV=user_app bundle exec rake assets:precompile`
|
||||||
`find public/assets -name "*.gz" -exec rm -f {} \\;`
|
`find public/assets -name "*.gz" -exec rm -f {} \\;`
|
||||||
`./bin/dedigest_assets`
|
%w[
|
||||||
|
supplier
|
||||||
|
cmtool
|
||||||
|
waiter
|
||||||
|
admin
|
||||||
|
qr_sheet
|
||||||
|
site
|
||||||
|
cartoon
|
||||||
|
frames
|
||||||
|
tinymce
|
||||||
|
textures
|
||||||
|
jquery-ui
|
||||||
|
icons
|
||||||
|
].each{|folder| `rm -rf public/assets/#{folder}`}
|
||||||
|
`time ./bin/dedigest_assets`
|
||||||
|
|
||||||
# correct stuff
|
# correct stuff
|
||||||
`./bin/user_asset_corrections`
|
`time ./bin/user_asset_corrections`
|
||||||
|
|
||||||
# now move stuff to a cleaned up cordova location
|
# now move stuff to a cleaned up cordova location
|
||||||
`cp -r public/assets/user #{APP_ASSET_ROOT}/user`
|
`cp -r public/assets/user #{APP_ASSET_ROOT}/user`
|
||||||
@@ -61,4 +75,4 @@ end
|
|||||||
|
|
||||||
# Set app versions
|
# Set app versions
|
||||||
File.open(app_config_path, 'w+'){|f| f.puts app_config.sub(%[version="#{current_version}"], %[version="#{new_version}"])}
|
File.open(app_config_path, 'w+'){|f| f.puts app_config.sub(%[version="#{current_version}"], %[version="#{new_version}"])}
|
||||||
File.open(app_index_html_path, 'w+'){ |f| f.puts app_index_html.sub(/$app_version\s*=\s*'([\.\d]+)'/, "$app_version = '#{new_version.to_s}'") }
|
File.open(app_index_html_path, 'w+'){ |f| f.puts app_index_html.sub(/app_version\s*=\s*'([\.\d]+)'/, "app_version = '#{new_version.to_s}'") }
|
||||||
|
|||||||
+2036
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user