diff --git a/Gemfile b/Gemfile
index 97af3604..9f7b59d6 100644
--- a/Gemfile
+++ b/Gemfile
@@ -23,18 +23,20 @@ group :assets do
#gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
- gem 'mustache' #, :require => 'mustache/railtie'
+ #gem 'mustache' #, :require => 'mustache/railtie'
end
gem 'jquery-rails'
-gem 'haml-rails'
+gem 'jquery-ui-rails'
+gem 'ember-rails'
gem 'slim-rails'
#gem 'less-rails'
-gem 'couch_potato' , :git => 'git://github.com/bterkuile/couch_potato.git'
-gem 'simply_stored' , :git => 'git://github.com/bterkuile/simply_stored.git'
-gem 'devise', '2.0.4'
-gem 'devise_simply_stored'
+gem 'couch_potato' , github: 'bterkuile/couch_potato'
+gem 'simply_stored' , github: 'bterkuile/simply_stored'
+gem 'orm_adapter', github: 'bterkuile/orm_adapter'
+gem 'devise', '3.1.0' #, '2.0.4'
+gem 'devise_simply_stored', github: 'bterkuile/devise_simply_stored'
gem 'simple_form'
gem 'active_decorator' #, path: '/Users/bterkuile/companytools/development/rails/components/active_decorator'
gem 'cmtool', github: 'bterkuile/cmtool'
@@ -50,17 +52,17 @@ gem 'mini_magick'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
group :development do
- gem 'pry'
#gem 'pry-remote'
gem 'rspec-rails'
gem 'guard-rspec'
gem 'quiet_assets'
gem 'letter_opener'
gem 'thin'
+ gem 'faye'
+ gem 'pry-rails'
end
group :test do
- gem 'pry'
#gem 'steak'
gem 'rspec-rails'
gem 'cucumber-rails'
@@ -71,6 +73,7 @@ group :test do
gem 'ruby_gntp'
gem 'guard-rspec'
gem 'factory_girl_rails'
+ gem 'pry-rails'
end
# Use unicorn as the app server
diff --git a/Gemfile.lock b/Gemfile.lock
index 3a3881bc..7d26a05b 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,17 +1,17 @@
GIT
remote: git://github.com/bterkuile/cmtool.git
- revision: 370aa0369e1885dacaac57c911ebd6aded808eee
+ revision: fd158660ada56158796c91df162672ddc74799d8
specs:
cmtool (0.5.0)
bourbon
coffee-script
- devise (= 2.0.4)
+ devise
devise_simply_stored
email_validator
haml-rails
jquery-rails
paperclip
- rails (~> 3.2.2)
+ rails (>= 3.2.2)
sass-rails
slim-rails
tinymce-rails
@@ -25,9 +25,22 @@ GIT
couchrest (>= 1.0.1)
json (~> 1.6)
+GIT
+ remote: git://github.com/bterkuile/devise_simply_stored.git
+ revision: 8fdaed396a7e9566fe6cb59b64d950953c8506a6
+ specs:
+ devise_simply_stored (0.1.0)
+ devise
+
+GIT
+ remote: git://github.com/bterkuile/orm_adapter.git
+ revision: e0b5f652c8d1eda8c0f6636f3b3d17d598603450
+ specs:
+ orm_adapter (0.4.0)
+
GIT
remote: git://github.com/bterkuile/simply_stored.git
- revision: fe749c792e303817f825fa4964936cc68a62b14b
+ revision: b62ce6c7a0e453230fe807075926c637ceefedc8
specs:
simply_stored (1.0.0)
activesupport
@@ -51,6 +64,8 @@ GEM
rack-test (~> 0.6.1)
sprockets (~> 2.2.1)
active_decorator (0.3.4)
+ active_model_serializers (0.8.1)
+ activemodel (>= 3.0)
activemodel (3.2.13)
activesupport (= 3.2.13)
builder (~> 3.0.0)
@@ -65,12 +80,17 @@ GEM
activesupport (3.2.13)
i18n (= 0.6.1)
multi_json (~> 1.0)
- addressable (2.3.3)
+ addressable (2.3.5)
arel (3.0.2)
- bcrypt-ruby (3.0.1)
- bootstrap-sass (2.3.1.0)
+ atomic (1.1.14)
+ barber (0.4.2)
+ ember-source
+ execjs
+ handlebars-source
+ bcrypt-ruby (3.1.2)
+ bootstrap-sass (2.3.2.2)
sass (~> 3.2)
- bourbon (3.1.2)
+ bourbon (3.1.8)
sass (>= 3.2.0)
thor
builder (3.0.4)
@@ -85,6 +105,7 @@ GEM
chunky_png (1.2.8)
climate_control (0.0.3)
activesupport (>= 3.0)
+ cliver (0.2.1)
cocaine (0.5.1)
climate_control (>= 0.0.3, < 1.0)
coderay (1.0.9)
@@ -94,121 +115,158 @@ GEM
coffee-script (2.2.0)
coffee-script-source
execjs
- coffee-script-source (1.6.2)
+ coffee-script-source (1.6.3)
compass (0.12.2)
chunky_png (~> 1.2)
fssm (>= 0.2.7)
sass (~> 3.1)
compass-rails (1.0.3)
compass (>= 0.12.2, < 0.14)
- couchrest (1.1.3)
+ cookiejar (0.3.0)
+ couchrest (1.2.0)
mime-types (~> 1.15)
multi_json (~> 1.0)
rest-client (~> 1.6.1)
- cucumber (1.2.5)
+ cucumber (1.3.8)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
- gherkin (~> 2.11.7)
- multi_json (~> 1.3)
- cucumber-rails (1.3.1)
+ gherkin (~> 2.12.1)
+ multi_json (>= 1.7.5, < 2.0)
+ multi_test (>= 0.0.2)
+ cucumber-rails (1.4.0)
capybara (>= 1.1.2)
cucumber (>= 1.2.0)
nokogiri (>= 1.5.0)
- rails (~> 3.0)
+ rails (>= 3.0.0)
daemons (1.1.9)
- database_cleaner (0.9.1)
- devise (2.0.4)
+ database_cleaner (1.1.1)
+ devise (3.1.0)
bcrypt-ruby (~> 3.0)
- orm_adapter (~> 0.0.3)
- railties (~> 3.1)
- warden (~> 1.1.1)
- devise_simply_stored (0.0.3)
- devise
- diff-lcs (1.2.2)
+ orm_adapter (~> 0.1)
+ railties (>= 3.2.6, < 5)
+ thread_safe (~> 0.1)
+ warden (~> 1.2.3)
+ diff-lcs (1.2.4)
+ em-http-request (1.1.0)
+ addressable (>= 2.3.4)
+ cookiejar
+ em-socksify (>= 0.3)
+ eventmachine (>= 1.0.3)
+ http_parser.rb (>= 0.6.0.beta.2)
+ em-socksify (0.3.0)
+ eventmachine (>= 1.0.0.beta.4)
email_validator (1.4.0)
activemodel
+ ember-data-source (0.14)
+ ember-source
+ ember-rails (0.13.0)
+ active_model_serializers
+ barber (>= 0.4.1)
+ ember-data-source
+ ember-source
+ execjs (>= 1.2)
+ handlebars-source
+ railties (>= 3.1)
+ ember-source (1.0.0)
+ handlebars-source (= 1.0.12)
erubis (2.7.0)
eventmachine (1.0.3)
- execjs (1.4.0)
- multi_json (~> 1.0)
+ execjs (2.0.1)
factory_girl (4.2.0)
activesupport (>= 3.0.0)
factory_girl_rails (4.2.1)
factory_girl (~> 4.2.0)
railties (>= 3.0.0)
- faye-websocket (0.4.7)
+ faye (0.8.9)
+ cookiejar (>= 0.3.0)
+ em-http-request (>= 0.3.0)
eventmachine (>= 0.12.0)
- ffi (1.6.0)
+ faye-websocket (>= 0.4.0)
+ rack (>= 1.0.0)
+ yajl-ruby (>= 1.0.0)
+ faye-websocket (0.7.0)
+ eventmachine (>= 0.12.0)
+ websocket-driver (>= 0.3.0)
+ ffi (1.9.0)
formatador (0.2.4)
fssm (0.2.10)
- gherkin (2.11.8)
+ gherkin (2.12.1)
multi_json (~> 1.3)
- guard (1.7.0)
+ guard (1.8.2)
formatador (>= 0.2.4)
- listen (>= 0.6.0)
+ listen (>= 1.0.0)
lumberjack (>= 1.0.2)
pry (>= 0.9.10)
thor (>= 0.14.6)
- guard-rspec (2.5.2)
- guard (>= 1.1)
- rspec (~> 2.11)
- haml (4.0.2)
+ guard-rspec (3.0.3)
+ guard (>= 1.8)
+ rspec (~> 2.13)
+ haml (4.0.3)
tilt
haml-rails (0.4)
actionpack (>= 3.1, < 4.1)
activesupport (>= 3.1, < 4.1)
haml (>= 3.1, < 4.1)
railties (>= 3.1, < 4.1)
- hike (1.2.2)
- http_parser.rb (0.5.3)
+ handlebars-source (1.0.12)
+ hike (1.2.3)
+ http_parser.rb (0.6.0.beta.2)
i18n (0.6.1)
journey (1.0.4)
- jquery-rails (2.2.1)
+ jquery-rails (3.0.4)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
- json (1.7.7)
+ jquery-ui-rails (4.0.4)
+ jquery-rails
+ railties (>= 3.1.0)
+ json (1.8.0)
kaminari (0.14.1)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
- launchy (2.2.0)
+ launchy (2.3.0)
addressable (~> 2.3)
- letter_opener (1.1.0)
- launchy (~> 2.2.0)
- listen (0.7.3)
- lumberjack (1.0.3)
- mail (2.5.3)
- i18n (>= 0.4.0)
+ letter_opener (1.1.2)
+ launchy (~> 2.2)
+ listen (1.3.1)
+ rb-fsevent (>= 0.9.3)
+ rb-inotify (>= 0.9)
+ rb-kqueue (>= 0.2)
+ lumberjack (1.0.4)
+ mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
- method_source (0.8.1)
- mime-types (1.22)
- mini_magick (3.5.0)
+ method_source (0.8.2)
+ mime-types (1.25)
+ mini_magick (3.6.0)
subexec (~> 0.2.1)
- multi_json (1.7.2)
- mustache (0.99.4)
- nokogiri (1.5.9)
- orm_adapter (0.0.7)
- paperclip (3.4.1)
+ mini_portile (0.5.1)
+ multi_json (1.8.0)
+ multi_test (0.0.2)
+ nokogiri (1.6.0)
+ mini_portile (~> 0.5.0)
+ paperclip (3.5.1)
activemodel (>= 3.0.0)
- activerecord (>= 3.0.0)
activesupport (>= 3.0.0)
cocaine (~> 0.5.0)
mime-types
- poltergeist (1.1.0)
- capybara (~> 2.0, >= 2.0.1)
- faye-websocket (~> 0.4, >= 0.4.4)
- http_parser.rb (~> 0.5.3)
+ poltergeist (1.4.1)
+ capybara (~> 2.1.0)
+ cliver (~> 0.2.1)
+ multi_json (~> 1.0)
+ websocket-driver (>= 0.2.0)
polyglot (0.3.3)
- pry (0.9.12)
+ pry (0.9.12.2)
coderay (~> 1.0.5)
method_source (~> 0.8)
slop (~> 3.4)
+ pry-rails (0.3.2)
+ pry (>= 0.9.10)
quiet_assets (1.0.2)
railties (>= 3.1, < 5.0)
rack (1.4.5)
rack-cache (1.2)
rack (>= 0.4)
- rack-cors (0.2.7)
+ rack-cors (0.2.8)
rack
rack-ssl (1.3.3)
rack
@@ -229,79 +287,87 @@ GEM
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0)
- rake (10.0.4)
+ rake (10.1.0)
rb-fsevent (0.9.3)
+ rb-inotify (0.9.2)
+ ffi (>= 0.5.0)
+ rb-kqueue (0.2.0)
+ ffi (>= 0.5.0)
rdoc (3.12.2)
json (~> 1.4)
rest-client (1.6.7)
mime-types (>= 1.16)
rqrcode (0.4.2)
- rspec (2.13.0)
- rspec-core (~> 2.13.0)
- rspec-expectations (~> 2.13.0)
- rspec-mocks (~> 2.13.0)
- rspec-core (2.13.1)
- rspec-expectations (2.13.0)
+ rspec (2.14.1)
+ rspec-core (~> 2.14.0)
+ rspec-expectations (~> 2.14.0)
+ rspec-mocks (~> 2.14.0)
+ rspec-core (2.14.5)
+ rspec-expectations (2.14.2)
diff-lcs (>= 1.1.3, < 2.0)
- rspec-mocks (2.13.1)
- rspec-rails (2.13.0)
+ rspec-mocks (2.14.3)
+ rspec-rails (2.14.0)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
- rspec-core (~> 2.13.0)
- rspec-expectations (~> 2.13.0)
- rspec-mocks (~> 2.13.0)
+ rspec-core (~> 2.14.0)
+ rspec-expectations (~> 2.14.0)
+ rspec-mocks (~> 2.14.0)
ruby_gntp (0.3.4)
rubyzip (0.9.9)
- sass (3.2.7)
+ sass (3.2.10)
sass-rails (3.2.6)
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
- selenium-webdriver (2.32.0)
+ selenium-webdriver (2.35.1)
childprocess (>= 0.2.5)
multi_json (~> 1.0)
- rubyzip
+ rubyzip (< 1.0.0)
websocket (~> 1.0.4)
simple_form (2.1.0)
actionpack (~> 3.0)
activemodel (~> 3.0)
- slim (1.3.7)
- temple (~> 0.6.3)
- tilt (~> 1.3.3)
- slim-rails (1.1.1)
+ slim (2.0.1)
+ temple (~> 0.6.6)
+ tilt (>= 1.3.3, < 2.1)
+ slim-rails (2.0.1)
actionpack (>= 3.0, < 4.1)
activesupport (>= 3.0, < 4.1)
railties (>= 3.0, < 4.1)
- slim (~> 1.3)
- slop (3.4.4)
+ slim (~> 2.0)
+ slop (3.4.6)
sprockets (2.2.2)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
subexec (0.2.3)
- temple (0.6.3)
+ temple (0.6.6)
thin (1.5.1)
daemons (>= 1.0.9)
eventmachine (>= 0.12.6)
rack (>= 1.0.0)
thor (0.18.1)
- tilt (1.3.7)
- tinymce-rails (3.5.8.1)
+ thread_safe (0.1.3)
+ atomic
+ tilt (1.4.1)
+ tinymce-rails (4.0.6)
railties (>= 3.1.1)
- treetop (1.4.12)
+ treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.37)
- uglifier (2.0.1)
+ uglifier (2.2.1)
execjs (>= 0.3.0)
multi_json (~> 1.0, >= 1.0.2)
- warden (1.1.1)
+ warden (1.2.3)
rack (>= 1.0)
websocket (1.0.7)
+ websocket-driver (0.3.0)
xpath (2.0.0)
nokogiri (~> 1.3)
+ yajl-ruby (1.1.0)
PLATFORMS
ruby
@@ -316,18 +382,20 @@ DEPENDENCIES
couch_potato!
cucumber-rails
database_cleaner
- devise (= 2.0.4)
- devise_simply_stored
+ devise (= 3.1.0)
+ devise_simply_stored!
+ ember-rails
factory_girl_rails
+ faye
guard-rspec
- haml-rails
jquery-rails
+ jquery-ui-rails
kaminari
letter_opener
mini_magick
- mustache
+ orm_adapter!
poltergeist
- pry
+ pry-rails
quiet_assets
rack-cors
rails (= 3.2.13)
diff --git a/app/assets/javascripts/supplier/application.js b/app/assets/javascripts/supplier/application.js
index 085a322a..2a7ae0d3 100644
--- a/app/assets/javascripts/supplier/application.js
+++ b/app/assets/javascripts/supplier/application.js
@@ -1,6 +1,6 @@
//= require jquery
//= require jquery_ujs
-//= require jquery-ui
+//= require jquery.ui.all
//= require jquery.ui.datepicker-en
//= require jquery.ui.datepicker-nl
// require bootstrap-transition
diff --git a/app/assets/javascripts/theme1/application.js b/app/assets/javascripts/theme1/application.js
index f9afcdd3..e0ef15b0 100644
--- a/app/assets/javascripts/theme1/application.js
+++ b/app/assets/javascripts/theme1/application.js
@@ -12,7 +12,7 @@
//
//= require jquery
//= require jquery_ujs
-//= require jquery-ui
+//= require jquery.ui.all
//= require bootstrap
// require twitter/bootstrap
//= require_directory .
diff --git a/app/models/administrator.rb b/app/models/administrator.rb
index 9209aaec..f064f0fe 100644
--- a/app/models/administrator.rb
+++ b/app/models/administrator.rb
@@ -1,6 +1,5 @@
class Administrator
include SimplyStored::Couch
- include Devise::Orm::SimplyStored
devise :database_authenticatable, :rememberable #, :recoverable, :rememberable, :trackable, :registerable
view :by_email, key: :email
diff --git a/app/models/section.rb b/app/models/section.rb
index 437c8447..f1dce6ee 100644
--- a/app/models/section.rb
+++ b/app/models/section.rb
@@ -3,7 +3,7 @@ class Section
include Qwaiter::Distribution
property :title
- property :path, type: Array, default: []
+ property :path, type: Array, default: [[0.0, 0.0], [20.0, 30.0]] # default width 20m height 30m
belongs_to :supplier
has_many :tables
@@ -46,10 +46,11 @@ class Section
self.path[0] ||= [0.0, 0.0]
self.path[1] ||= [0.0, 0.0]
unless path[1][0] == val
- self.path[1][0] = val
+ self.path[1][0] = val
path_will_change!
end
end
+
def height=(val)
val = val.to_f
self.path[0] ||= [0.0, 0.0]
diff --git a/app/models/supplier.rb b/app/models/supplier.rb
index 94f43f0f..642ee210 100644
--- a/app/models/supplier.rb
+++ b/app/models/supplier.rb
@@ -1,6 +1,5 @@
class Supplier
include SimplyStored::Couch
- include Devise::Orm::SimplyStored
devise :database_authenticatable, :recoverable, :rememberable, :trackable, :registerable, :confirmable
property :unconfirmed_email
diff --git a/app/models/user.rb b/app/models/user.rb
index bedc3829..393c83e4 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -1,6 +1,5 @@
class User
include SimplyStored::Couch
- include Devise::Orm::SimplyStored
property :name
property :active_list_id
diff --git a/app/views/application/_error_messages.html.haml b/app/views/application/_error_messages.html.slim
similarity index 52%
rename from app/views/application/_error_messages.html.haml
rename to app/views/application/_error_messages.html.slim
index 6437f6a7..daff8681 100644
--- a/app/views/application/_error_messages.html.haml
+++ b/app/views/application/_error_messages.html.slim
@@ -1,7 +1,7 @@
-if target.errors.any?
#error_explanation
.errors-content
- %h2= t('helpers.forms.errors.title', :count => target.errors.count)
- %ul
+ h2= t('helpers.forms.errors.title', :count => target.errors.count)
+ ul
- for message in target.errors.full_messages
- %li= message
+ li= message
diff --git a/app/views/layouts/phone.html.slim b/app/views/layouts/phone.html.slim
index d0b82db5..e716b946 100644
--- a/app/views/layouts/phone.html.slim
+++ b/app/views/layouts/phone.html.slim
@@ -32,7 +32,7 @@ html lang="en"
var $locale = 'en';
var $asset_path = '/assets/';
var Qstorage = localStorage;
- #{Rails.env.production? ? '' : "data_host = 'http://qwaiter.dev';"}
+ #{Rails.env.production? ? '' : "data_host = 'http://localhost:3000';".html_safe }
var data_host = 'http://localhost:3000';
QMobile || (QMobile = {
scanQr: function(){window.location = '/select_qrcode'},
diff --git a/app/views/layouts/tablet.html.slim b/app/views/layouts/tablet.html.slim
index ceb5fd91..55f6af1b 100644
--- a/app/views/layouts/tablet.html.slim
+++ b/app/views/layouts/tablet.html.slim
@@ -16,14 +16,7 @@ html lang="en"
link href="/images/apple-touch-icon-72x72.png" rel="apple-touch-icon-precomposed" sizes="72x72"
link href="/images/apple-touch-icon.png" rel="apple-touch-icon-precomposed"
link href="/favicon.ico" rel="shortcut icon"
-
- javascript:
- var $locale = '#{I18n.locale}';
- var supplier_id = '#{current_supplier.id}';
- var data_host = '';
- var event_host = '#{event_host}';
- var datepicker_options = {dateFormat: 'yy-mm-dd', firstDay: #{current_supplier.week_starts_on_monday? ? 1 : 0}};
-
+ = render 'suppliers/application/head'
= yield :head
body
diff --git a/app/views/supplier/edit.html.slim b/app/views/supplier/edit.html.slim
index f733af03..12838d10 100644
--- a/app/views/supplier/edit.html.slim
+++ b/app/views/supplier/edit.html.slim
@@ -21,7 +21,7 @@
= f.label :location, class: 'control-label'
.controls
= f.text_field :location, class: 'location_picker'
- = image_tag 'supplier/settings/location-balloon.png'
+ = image_tag 'supplier/settings/location-balloon.png'
.control-group
= f.label :time_zone, class: 'control-label'
.controls
diff --git a/app/views/suppliers/application/_head.html.erb b/app/views/suppliers/application/_head.html.erb
new file mode 100644
index 00000000..f3a30546
--- /dev/null
+++ b/app/views/suppliers/application/_head.html.erb
@@ -0,0 +1,7 @@
+
diff --git a/app/views/suppliers/tables/index.html.slim b/app/views/suppliers/tables/index.html.slim
index 16485d4e..ec0a4519 100644
--- a/app/views/suppliers/tables/index.html.slim
+++ b/app/views/suppliers/tables/index.html.slim
@@ -21,7 +21,7 @@ div.page-header= title :index, model_class
- @tables.each do |table|
tr
td.link= link_to table.number, [:suppliers, table]
- td.link= link_to_if table.section.present?, table.section.try(:title), [:suppliers, table.section]
+ td.link= link_to_if table.section.present?, table.section.try(:title), tables_view_suppliers_section_path(table.section)
td.timestamp data-time=table.created_at.utc.iso8601
td.actions
= link_to t('helpers.links.edit'), [:edit, :suppliers, table], class: 'btn btn-mini', data: {t: 'helpers.links.edit'}
diff --git a/config/couchdb.yml b/config/couchdb.yml
index 69368497..b7c58c71 100644
--- a/config/couchdb.yml
+++ b/config/couchdb.yml
@@ -1,9 +1,9 @@
development:
validation_framework: :active_model #optional
- database: qrammer_development
+ database: qwaiter_development
test:
validation_framework: :active_model #optional
- database: qrammer_test
+ database: qwaiter_test
production:
validation_framework: :active_model #optional
database: qwaiter
diff --git a/config/environments/development.rb b/config/environments/development.rb
index 9f43a7e2..ab3c33b4 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -5,13 +5,6 @@ Qwaiter::Application.configure do
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
- silence_warnings do
- begin
- require 'pry'
- IRB = Pry
- rescue LoadError
- end
- end
# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true
diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb
index 04eeb97a..cdca776d 100644
--- a/config/initializers/devise.rb
+++ b/config/initializers/devise.rb
@@ -1,16 +1,19 @@
# Use this hook to configure devise mailer, warden hooks and so forth.
# Many of these configuration options can be set straight in your model.
Devise.setup do |config|
+ # The secret key used by Devise. Devise uses this key to generate
+ # random tokens. Changing this key will render invalid all existing
+ # confirmation, reset password and unlock tokens in the database.
+ config.secret_key = '43bd9182902186846fbc9bfb99952f7e1a7e4a04e3f0e34042e976649985e101e53799ff6a69738279ac31144d3197be6ba62c92f276c3af5cad7e27d722f91c'
+
# ==> Mailer Configuration
# Configure the e-mail address which will be shown in Devise::Mailer,
- # note that it will be overwritten if you use your own mailer class with default "from" parameter.
- config.mailer_sender = 'Qwaiter '
+ # note that it will be overwritten if you use your own mailer class
+ # with default "from" parameter.
+ config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
# Configure the class responsible to send e-mails.
- # config.mailer = "Devise::Mailer"
-
- # Automatically apply schema changes in tableless databases
- config.apply_schema = false
+ # config.mailer = 'Devise::Mailer'
# ==> ORM configuration
# Load and configure the ORM. Supports :active_record (default) and
@@ -51,17 +54,21 @@ Devise.setup do |config|
# enable it only for database (email + password) authentication.
# config.params_authenticatable = true
- # Tell if authentication through HTTP Basic Auth is enabled. False by default.
+ # Tell if authentication through HTTP Auth is enabled. False by default.
# It can be set to an array that will enable http authentication only for the
# given strategies, for example, `config.http_authenticatable = [:token]` will
- # enable it only for token authentication.
- # config.http_authenticatable = [:token]
+ # enable it only for token authentication. The supported strategies are:
+ # :database = Support basic authentication with authentication key + password
+ # :token = Support basic authentication with token authentication key
+ # :token_options = Support token authentication with options as defined in
+ # http://api.rubyonrails.org/classes/ActionController/HttpAuthentication/Token.html
+ # config.http_authenticatable = false
# If http headers should be returned for AJAX requests. True by default.
# config.http_authenticatable_on_xhr = true
- # The realm used in Http Basic Authentication. "Application" by default.
- # config.http_authentication_realm = "Application"
+ # The realm used in Http Basic Authentication. 'Application' by default.
+ # config.http_authentication_realm = 'Application'
# It will change confirmation, password recovery and other workflows
# to behave the same regardless if the e-mail provided was right or wrong.
@@ -75,6 +82,12 @@ Devise.setup do |config|
# passing :skip => :sessions to `devise_for` in your config/routes.rb
config.skip_session_storage = [:http_auth]
+ # By default, Devise cleans up the CSRF token on authentication to
+ # avoid CSRF token fixation attacks. This means that, when using AJAX
+ # requests for sign in and sign up, you need to get a new CSRF token
+ # from the server. You can disable this option at your own risk.
+ # config.clean_up_csrf_token_on_authentication = true
+
# ==> Configuration for :database_authenticatable
# For bcrypt, this is the cost for hashing the password and defaults to 10. If
# using other encryptors, it sets how many times you want the password re-encrypted.
@@ -85,7 +98,7 @@ Devise.setup do |config|
config.stretches = Rails.env.test? ? 1 : 10
# Setup a pepper to generate the encrypted password.
- # config.pepper = "0645e56df1cf3f1fabb289964a240de9069b044768999ea2bec0ff49794c0613273f9a29c013f47574c9c225b0d5dbe9a8d961ba49dd9a3e878a0da539905b56"
+ # config.pepper = '2d7486d586fab8cd5b61566b8435f3de36e40ca6b15235fd39be9412bd4d478a67e157f855bdd14dde2057d443c7db30574e8cb02f948b99662f02b54a888770'
# ==> Configuration for :confirmable
# A period that the user is allowed to access the website even without
@@ -95,7 +108,15 @@ Devise.setup do |config|
# the user cannot access the website without confirming his account.
# config.allow_unconfirmed_access_for = 2.days
- # If true, requires any email changes to be confirmed (exctly the same way as
+ # A period that the user is allowed to confirm their account before their
+ # token becomes invalid. For example, if set to 3.days, the user can confirm
+ # their account within 3 days after the mail was sent, but on the fourth day
+ # their account can't be confirmed with the token any more.
+ # Default is nil, meaning there is no restriction on how long a user can take
+ # before confirming their account.
+ # config.confirm_within = 3.days
+
+ # If true, requires any email changes to be confirmed (exactly the same way as
# initial account confirmation) to be applied. Requires additional unconfirmed_email
# db field (see migrations). Until confirmed new email is stored in
# unconfirmed email column, and copied to email column on successful confirmation.
@@ -111,20 +132,16 @@ Devise.setup do |config|
# If true, extends the user's remember period when remembered via cookie.
# config.extend_remember_period = false
- # If true, uses the password salt as remember token. This should be turned
- # to false if you are not using database authenticatable.
- config.use_salt_as_remember_token = true
-
# Options to be passed to the created cookie. For instance, you can set
# :secure => true in order to force SSL only cookies.
- # config.cookie_options = {}
+ # config.rememberable_options = {}
# ==> Configuration for :validatable
- # Range for password length. Default is 6..128.
- # config.password_length = 6..128
+ # Range for password length. Default is 8..128.
+ config.password_length = 8..128
# Email regex used to validate email formats. It simply asserts that
- # an one (and only one) @ exists in the given string. This is mainly
+ # one (and only one) @ exists in the given string. This is mainly
# to give user feedback and not to assert the e-mail validity.
# config.email_regexp = /\A[^@]+@[^@]+\z/
@@ -133,6 +150,9 @@ Devise.setup do |config|
# time the user will be asked for credentials again. Default is 30 minutes.
# config.timeout_in = 30.minutes
+ # If true, expires auth token on session timeout.
+ # config.expire_auth_token_on_timeout = false
+
# ==> Configuration for :lockable
# Defines which strategy will be used to lock an account.
# :failed_attempts = Locks an account after a number of failed attempts to sign in.
@@ -171,27 +191,28 @@ Devise.setup do |config|
# :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
# :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
# and :restful_authentication_sha1 (then you should set stretches to 10, and copy
- # REST_AUTH_SITE_KEY to pepper)
+ # REST_AUTH_SITE_KEY to pepper).
+ #
+ # Require the `devise-encryptable` gem when using anything other than bcrypt
# config.encryptor = :sha512
# ==> Configuration for :token_authenticatable
# Defines name of the authentication token params key
- config.token_authentication_key = :auth_token
+ # config.token_authentication_key = :auth_token
# ==> Scopes configuration
# Turn scoped views on. Before rendering "sessions/new", it will first check for
# "users/sessions/new". It's turned off by default because it's slower if you
# are using only default views.
- config.scoped_views = true
+ # config.scoped_views = false
# Configure the default scope given to Warden. By default it's the first
# devise role declared in your routes (usually :user).
- config.default_scope = :supplier
+ # config.default_scope = :user
- # Configure sign_out behavior.
- # Sign_out action can be scoped (i.e. /users/sign_out affects only :user scope).
- # The default is true, which means any logout action will sign out all active scopes.
- config.sign_out_all_scopes = false
+ # Set this configuration to false if you want /users/sign_out to sign out
+ # only the current scope. By default, Devise signs out all scopes.
+ # config.sign_out_all_scopes = true
# ==> Navigation configuration
# Lists the formats that should be treated as navigational. Formats like
@@ -202,10 +223,10 @@ Devise.setup do |config|
# should add them to the navigational formats lists.
#
# The "*/*" below is required to match Internet Explorer requests.
- # config.navigational_formats = ["*/*", :html]
+ # config.navigational_formats = ['*/*', :html]
# The default HTTP method used to sign out a resource. Default is :delete.
- config.sign_out_via = [:delete, :get]
+ config.sign_out_via = :delete
# ==> OmniAuth
# Add a new OmniAuth provider. Check the wiki for more information on setting
@@ -220,4 +241,18 @@ Devise.setup do |config|
# manager.intercept_401 = false
# manager.default_strategies(:scope => :user).unshift :some_external_strategy
# end
+
+ # ==> Mountable engine configurations
+ # When using Devise inside an engine, let's call it `MyEngine`, and this engine
+ # is mountable, there are some extra configurations to be taken into account.
+ # The following options are available, assuming the engine is mounted as:
+ #
+ # mount MyEngine, at: '/my_engine'
+ #
+ # The router that invoked `devise_for`, in the example above, would be:
+ # config.router_name = :my_engine
+ #
+ # When using omniauth, Devise cannot automatically set Omniauth path,
+ # so you need to do it manually. For the users scope, it would be:
+ # config.omniauth_path_prefix = '/my_engine/users/auth'
end
diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml
index 2ede53ba..e7445b31 100644
--- a/config/locales/devise.en.yml
+++ b/config/locales/devise.en.yml
@@ -1,71 +1,60 @@
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
en:
+ devise:
+ confirmations:
+ confirmed: "Your account was successfully confirmed. Please sign in."
+ confirmed_and_signed_in: "Your account was successfully confirmed. You are now signed in."
+ send_instructions: "You will receive an email with instructions about how to confirm your account in a few minutes."
+ send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes."
+ failure:
+ already_authenticated: "You are already signed in."
+ inactive: "Your account is not activated yet."
+ invalid: "Invalid email or password."
+ invalid_token: "Invalid authentication token."
+ locked: "Your account is locked."
+ not_found_in_database: "Invalid email or password."
+ timeout: "Your session expired. Please sign in again to continue."
+ unauthenticated: "You need to sign in or sign up before continuing."
+ unconfirmed: "You have to confirm your account before continuing."
+ mailer:
+ confirmation_instructions:
+ subject: "Confirmation instructions"
+ reset_password_instructions:
+ subject: "Reset password instructions"
+ unlock_instructions:
+ subject: "Unlock Instructions"
+ omniauth_callbacks:
+ failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
+ success: "Successfully authenticated from %{kind} account."
+ passwords:
+ no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
+ send_instructions: "You will receive an email with instructions about how to reset your password in a few minutes."
+ send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
+ updated: "Your password was changed successfully. You are now signed in."
+ updated_not_active: "Your password was changed successfully."
+ registrations:
+ destroyed: "Bye! Your account was successfully cancelled. We hope to see you again soon."
+ signed_up: "Welcome! You have signed up successfully."
+ signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
+ signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
+ signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please open the link to activate your account."
+ update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and click on the confirm link to finalize confirming your new email address."
+ updated: "You updated your account successfully."
+ sessions:
+ signed_in: "Signed in successfully."
+ signed_out: "Signed out successfully."
+ unlocks:
+ send_instructions: "You will receive an email with instructions about how to unlock your account in a few minutes."
+ send_paranoid_instructions: "If your account exists, you will receive an email with instructions about how to unlock it in a few minutes."
+ unlocked: "Your account has been unlocked successfully. Please sign in to continue."
errors:
messages:
+ already_confirmed: "was already confirmed, please try signing in"
+ confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
expired: "has expired, please request a new one"
not_found: "not found"
- already_confirmed: "was already confirmed, please try signing in"
not_locked: "was not locked"
not_saved:
one: "1 error prohibited this %{resource} from being saved:"
other: "%{count} errors prohibited this %{resource} from being saved:"
-
- devise:
- failure:
- already_authenticated: 'You are already signed in.'
- unauthenticated: 'You need to sign in or sign up before continuing.'
- unconfirmed: 'You have to confirm your account before continuing.'
- locked: 'Your account is locked.'
- invalid: 'Invalid email or password.'
- invalid_token: 'Invalid authentication token.'
- timeout: 'Your session expired, please sign in again to continue.'
- inactive: 'Your account was not activated yet.'
- sessions:
- title: Sign in
- button: Sign in
- remember_me: Remember me
- forgot_your_password: 'Forgot your password?'
- signed_in: 'Signed in successfully.'
- signed_out: 'Signed out successfully.'
- passwords:
- title: Forgot your password?
- button: 'Send me reset password instructions'
- send_instructions: 'You will receive an email with instructions about how to reset your password in a few minutes.'
- updated: 'Your password was changed successfully. You are now signed in.'
- updated_not_active: 'Your password was changed successfully.'
- send_paranoid_instructions: "If your e-mail exists on our database, you will receive a password recovery link on your e-mail"
- edit:
- title: 'Change your password'
- button: 'Change my password'
- confirmations:
- did_not_receive_instructions_link: "Didn't receive confirmation instructions?"
- send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.'
- send_paranoid_instructions: 'If your e-mail exists on our database, you will receive an email with instructions about how to confirm your account in a few minutes.'
- confirmed: 'Your account was successfully confirmed. You are now signed in.'
- registrations:
- title: Sign up
- button: Sign up
- signed_up: 'Welcome! You have signed up successfully.'
- signed_up_but_unconfirmed: 'A message with a confirmation link has been sent to your email address. Please open the link to activate your account.'
- signed_up_but_inactive: 'You have signed up successfully. However, we could not sign you in because your account is not yet activated.'
- signed_up_but_locked: 'You have signed up successfully. However, we could not sign you in because your account is locked.'
- updated: 'You updated your account successfully.'
- update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and click on the confirm link to finalize confirming your new email address."
- destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.'
- unlocks:
- did_not_receive_instructions_link: "Didn't receive unlock instructions?"
- send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes.'
- unlocked: 'Your account has been unlocked successfully. Please sign in to continue.'
- send_paranoid_instructions: 'If your account exists, you will receive an email with instructions about how to unlock it in a few minutes.'
- omniauth_callbacks:
- sign_in_with: "Sign in with %{provider}"
- success: 'Successfully authorized from %{kind} account.'
- failure: 'Could not authorize you from %{kind} because "%{reason}".'
- mailer:
- confirmation_instructions:
- subject: 'Confirmation instructions'
- reset_password_instructions:
- subject: 'Reset password instructions'
- unlock_instructions:
- subject: 'Unlock Instructions'
diff --git a/vendor/assets/javascripts/faye.js b/vendor/assets/javascripts/faye.js
index de9030c5..8ff931d7 100644
--- a/vendor/assets/javascripts/faye.js
+++ b/vendor/assets/javascripts/faye.js
@@ -1,2 +1,2 @@
var Faye=(typeof Faye==='object')?Faye:{};if(typeof window!=='undefined')window.Faye=Faye;Faye.extend=function(a,b,d){if(!b)return a;for(var f in b){if(!b.hasOwnProperty(f))continue;if(a.hasOwnProperty(f)&&d===false)continue;if(a[f]!==b[f])a[f]=b[f]}return a};Faye.extend(Faye,{VERSION:'0.8.6',BAYEUX_VERSION:'1.0',ID_LENGTH:160,JSONP_CALLBACK:'jsonpcallback',CONNECTION_TYPES:['long-polling','cross-origin-long-polling','callback-polling','websocket','eventsource','in-process'],MANDATORY_CONNECTION_TYPES:['long-polling','callback-polling','in-process'],ENV:(function(){return this})(),random:function(a){a=a||this.ID_LENGTH;if(a>32){var b=Math.ceil(a/32),d='';while(b--)d+=this.random(32);var f=d.split(''),g='';while(f.length>0)g+=f.pop();return g}var h=Math.pow(2,a)-1,i=h.toString(36).length,d=Math.floor(Math.random()*h).toString(36);while(d.length0)j();k=false};var n=function(){i+=1;l()};n()},toJSON:function(a){if(this.stringify)return this.stringify(a,function(key,value){return(this[key]instanceof Array)?this[key]:value});return JSON.stringify(a)},logger:function(a){if(typeof console!=='undefined')console.log(a)},timestamp:function(){var b=new Date(),d=b.getFullYear(),f=b.getMonth()+1,g=b.getDate(),h=b.getHours(),i=b.getMinutes(),k=b.getSeconds();var j=function(a){return a<10?'0'+a:String(a)};return j(d)+'-'+j(f)+'-'+j(g)+' '+j(h)+':'+j(i)+':'+j(k)}});Faye.Class=function(a,b){if(typeof a!=='function'){b=a;a=Object}var d=function(){if(!this.initialize)return this;return this.initialize.apply(this,arguments)||this};var f=function(){};f.prototype=a.prototype;d.prototype=new f();Faye.extend(d.prototype,b);return d};Faye.Namespace=Faye.Class({initialize:function(){this._e={}},exists:function(a){return this._e.hasOwnProperty(a)},generate:function(){var a=Faye.random();while(this._e.hasOwnProperty(a))a=Faye.random();return this._e[a]=a},release:function(a){delete this._e[a]}});Faye.Error=Faye.Class({initialize:function(a,b,d){this.code=a;this.params=Array.prototype.slice.call(b);this.message=d},toString:function(){return this.code+':'+this.params.join(',')+':'+this.message}});Faye.Error.parse=function(a){a=a||'';if(!Faye.Grammar.ERROR.test(a))return new this(null,[],a);var b=a.split(':'),d=parseInt(b[0]),f=b[1].split(','),a=b[2];return new this(d,f,a)};Faye.Error.versionMismatch=function(){return new this(300,arguments,"Version mismatch").toString()};Faye.Error.conntypeMismatch=function(){return new this(301,arguments,"Connection types not supported").toString()};Faye.Error.extMismatch=function(){return new this(302,arguments,"Extension mismatch").toString()};Faye.Error.badRequest=function(){return new this(400,arguments,"Bad request").toString()};Faye.Error.clientUnknown=function(){return new this(401,arguments,"Unknown client").toString()};Faye.Error.parameterMissing=function(){return new this(402,arguments,"Missing required parameter").toString()};Faye.Error.channelForbidden=function(){return new this(403,arguments,"Forbidden channel").toString()};Faye.Error.channelUnknown=function(){return new this(404,arguments,"Unknown channel").toString()};Faye.Error.channelInvalid=function(){return new this(405,arguments,"Invalid channel").toString()};Faye.Error.extUnknown=function(){return new this(406,arguments,"Unknown extension").toString()};Faye.Error.publishFailed=function(){return new this(407,arguments,"Failed to publish").toString()};Faye.Error.serverError=function(){return new this(500,arguments,"Internal server error").toString()};Faye.Deferrable={callback:function(a,b){if(!a)return;if(this._w==='succeeded')return a.apply(b,this._j);this._k=this._k||[];this._k.push([a,b])},timeout:function(a,b){var d=this;var f=Faye.ENV.setTimeout(function(){d.setDeferredStatus('failed',b)},a*1000);this._x=f},errback:function(a,b){if(!a)return;if(this._w==='failed')return a.apply(b,this._j);this._l=this._l||[];this._l.push([a,b])},setDeferredStatus:function(){if(this._x)Faye.ENV.clearTimeout(this._x);var a=Array.prototype.slice.call(arguments),b=a.shift(),d;this._w=b;this._j=a;if(b==='succeeded')d=this._k;else if(b==='failed')d=this._l;if(!d)return;var f;while(f=d.shift())f[0].apply(f[1],this._j)}};Faye.Publisher={countListeners:function(a){if(!this._3||!this._3[a])return 0;return this._3[a].length},bind:function(a,b,d){this._3=this._3||{};var f=this._3[a]=this._3[a]||[];f.push([b,d])},unbind:function(a,b,d){if(!this._3||!this._3[a])return;if(!b){delete this._3[a];return}var f=this._3[a],g=f.length;while(g--){if(b!==f[g][0])continue;if(d&&f[g][1]!==d)continue;f.splice(g,1)}},trigger:function(){var a=Array.prototype.slice.call(arguments),b=a.shift();if(!this._3||!this._3[b])return;var d=this._3[b].slice(),f;for(var g=0,h=d.length;gd[b])return;var a=Array.prototype.slice.apply(a),f=' ['+b.toUpperCase()+'] [Faye',g=this.className,h=a.shift().replace(/\?/g,function(){try{return Faye.toJSON(a.shift())}catch(e){return'[Object]'}});for(var i in Faye){if(g)continue;if(typeof Faye[i]!=='function')continue;if(this instanceof Faye[i])g=i}if(g)f+='.'+g;f+='] ';Faye.logger(Faye.timestamp()+f+h)}};(function(){for(var d in Faye.Logging.LOG_LEVELS)(function(a,b){Faye.Logging[a]=function(){this.log(arguments,a)}})(d,Faye.Logging.LOG_LEVELS[d])})();Faye.Grammar={LOWALPHA:/^[a-z]$/,UPALPHA:/^[A-Z]$/,ALPHA:/^([a-z]|[A-Z])$/,DIGIT:/^[0-9]$/,ALPHANUM:/^(([a-z]|[A-Z])|[0-9])$/,MARK:/^(\-|\_|\!|\~|\(|\)|\$|\@)$/,STRING:/^(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)| |\/|\*|\.))*$/,TOKEN:/^(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)))+$/,INTEGER:/^([0-9])+$/,CHANNEL_SEGMENT:/^(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)))+$/,CHANNEL_SEGMENTS:/^(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)))+(\/(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)))+)*$/,CHANNEL_NAME:/^\/(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)))+(\/(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)))+)*$/,WILD_CARD:/^\*{1,2}$/,CHANNEL_PATTERN:/^(\/(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)))+)*\/\*{1,2}$/,VERSION_ELEMENT:/^(([a-z]|[A-Z])|[0-9])(((([a-z]|[A-Z])|[0-9])|\-|\_))*$/,VERSION:/^([0-9])+(\.(([a-z]|[A-Z])|[0-9])(((([a-z]|[A-Z])|[0-9])|\-|\_))*)*$/,CLIENT_ID:/^((([a-z]|[A-Z])|[0-9]))+$/,ID:/^((([a-z]|[A-Z])|[0-9]))+$/,ERROR_MESSAGE:/^(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)| |\/|\*|\.))*$/,ERROR_ARGS:/^(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)| |\/|\*|\.))*(,(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)| |\/|\*|\.))*)*$/,ERROR_CODE:/^[0-9][0-9][0-9]$/,ERROR:/^([0-9][0-9][0-9]:(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)| |\/|\*|\.))*(,(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)| |\/|\*|\.))*)*:(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)| |\/|\*|\.))*|[0-9][0-9][0-9]::(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)| |\/|\*|\.))*)$/};Faye.Extensible={addExtension:function(a){this._6=this._6||[];this._6.push(a);if(a.added)a.added(this)},removeExtension:function(a){if(!this._6)return;var b=this._6.length;while(b--){if(this._6[b]!==a)continue;this._6.splice(b,1);if(a.removed)a.removed(this)}},pipeThroughExtensions:function(d,f,g,h){this.debug('Passing through ? extensions: ?',d,f);if(!this._6)return g.call(h,f);var i=this._6.slice();var k=function(a){if(!a)return g.call(h,a);var b=i.shift();if(!b)return g.call(h,a);if(b[d])b[d](a,k);else k(a)};k(f)}};Faye.extend(Faye.Extensible,Faye.Logging);Faye.Channel=Faye.Class({initialize:function(a){this.id=this.name=a},push:function(a){this.trigger('message',a)},isUnused:function(){return this.countListeners('message')===0}});Faye.extend(Faye.Channel.prototype,Faye.Publisher);Faye.extend(Faye.Channel,{HANDSHAKE:'/meta/handshake',CONNECT:'/meta/connect',SUBSCRIBE:'/meta/subscribe',UNSUBSCRIBE:'/meta/unsubscribe',DISCONNECT:'/meta/disconnect',META:'meta',SERVICE:'service',expand:function(a){var b=this.parse(a),d=['/**',a];var f=b.slice();f[f.length-1]='*';d.push(this.unparse(f));for(var g=1,h=b.length;g=Math.pow(2,32))this._g=0;return this._g.toString(36)},_F:function(a){Faye.extend(this._8,a);if(this._8.reconnect===this.HANDSHAKE&&this._1!==this.DISCONNECTED){this._1=this.UNCONNECTED;this._0=null;this._B()}},_G:function(a){if(!a.channel||a.data===undefined)return;this.info('Client ? calling listeners for ? with ?',this._0,a.channel,a.data);this._2.distributeMessage(a)},_I:function(){if(!this._q)return;this._q=null;this.info('Closed connection for ?',this._0)},_B:function(){this._I();var a=this;Faye.ENV.setTimeout(function(){a.connect()},this._8.interval)}});Faye.extend(Faye.Client.prototype,Faye.Deferrable);Faye.extend(Faye.Client.prototype,Faye.Publisher);Faye.extend(Faye.Client.prototype,Faye.Logging);Faye.extend(Faye.Client.prototype,Faye.Extensible);Faye.Transport=Faye.extend(Faye.Class({MAX_DELAY:0.0,batching:true,initialize:function(a,b){this._7=a;this.endpoint=b;this._c=[]},close:function(){},send:function(a,b){this.debug('Client ? sending message to ?: ?',this._7._0,this.endpoint,a);if(!this.batching)return this.request([a],b);this._c.push(a);this._J=b;if(a.channel===Faye.Channel.HANDSHAKE)return this.addTimeout('publish',0.01,this.flush,this);if(a.channel===Faye.Channel.CONNECT)this._r=a;if(this.shouldFlush&&this.shouldFlush(this._c))return this.flush();this.addTimeout('publish',this.MAX_DELAY,this.flush,this)},flush:function(){this.removeTimeout('publish');if(this._c.length>1&&this._r)this._r.advice={timeout:0};this.request(this._c,this._J);this._r=null;this._c=[]},receive:function(a){this.debug('Client ? received from ?: ?',this._7._0,this.endpoint,a);for(var b=0,d=a.length;b=200&&b<300)||b===304||b===1223);if(!d){m();h();return k.trigger('down')}try{a=JSON.parse(j.responseText)}catch(e){}m();if(a){k.receive(a);k.trigger('up')}else{h();k.trigger('down')}};j.send(Faye.toJSON(f))}}),{isUsable:function(a,b,d,f){d.call(f,Faye.URI.parse(b).isSameOrigin())}});Faye.Transport.register('long-polling',Faye.Transport.XHR);Faye.Transport.CORS=Faye.extend(Faye.Class(Faye.Transport,{request:function(b,d){var f=Faye.ENV.XDomainRequest?XDomainRequest:XMLHttpRequest,g=new f(),h=this.retry(b,d),i=this;g.open('POST',this.endpoint,true);if(g.setRequestHeader)g.setRequestHeader('Pragma','no-cache');var k=function(){if(!g)return false;g.onload=g.onerror=g.ontimeout=g.onprogress=null;g=null;Faye.ENV.clearTimeout(l);return true};g.onload=function(){var a=null;try{a=JSON.parse(g.responseText)}catch(e){}k();if(a){i.receive(a);i.trigger('up')}else{h();i.trigger('down')}};var j=function(){k();h();i.trigger('down')};var l=Faye.ENV.setTimeout(j,1.5*1000*d);g.onerror=j;g.ontimeout=j;g.onprogress=function(){};g.send('message='+encodeURIComponent(Faye.toJSON(b)))}}),{isUsable:function(a,b,d,f){if(Faye.URI.parse(b).isSameOrigin())return d.call(f,false);if(Faye.ENV.XDomainRequest)return d.call(f,Faye.URI.parse(b).protocol===Faye.URI.parse(Faye.ENV.location).protocol);if(Faye.ENV.XMLHttpRequest){var g=new Faye.ENV.XMLHttpRequest();return d.call(f,g.withCredentials!==undefined)}return d.call(f,false)}});Faye.Transport.register('cross-origin-long-polling',Faye.Transport.CORS);Faye.Transport.JSONP=Faye.extend(Faye.Class(Faye.Transport,{shouldFlush:function(a){var b={message:Faye.toJSON(a),jsonp:'__jsonp'+Faye.Transport.JSONP._v+'__'};var d=Faye.URI.parse(this.endpoint,b).toURL();return d.length>=Faye.Transport.MAX_URL_LENGTH},request:function(b,d){var f={message:Faye.toJSON(b)},g=document.getElementsByTagName('head')[0],h=document.createElement('script'),i=Faye.Transport.JSONP.getCallbackName(),k=Faye.URI.parse(this.endpoint,f),j=this.retry(b,d),l=this;Faye.ENV[i]=function(a){o();l.receive(a);l.trigger('up')};var n=Faye.ENV.setTimeout(function(){o();j();l.trigger('down')},1.5*1000*d);var o=function(){if(!Faye.ENV[i])return false;Faye.ENV[i]=undefined;try{delete Faye.ENV[i]}catch(e){}Faye.ENV.clearTimeout(n);h.parentNode.removeChild(h);return true};k.params.jsonp=i;h.type='text/javascript';h.src=k.toURL();g.appendChild(h)}}),{_v:0,getCallbackName:function(){this._v+=1;return'__jsonp'+this._v+'__'},isUsable:function(a,b,d,f){d.call(f,true)}});Faye.Transport.register('callback-polling',Faye.Transport.JSONP);
-//@ sourceMappingURL=faye-browser-min.js.map
\ No newline at end of file
+// sourceMappingURL=faye-browser-min.js.map