fullcalendar.io-rails 2.6.0 → 2.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.rspec +3 -0
- data/.travis.yml +4 -0
- data/README.md +1 -1
- data/Rakefile +5 -0
- data/fullcalendar.io-rails.gemspec +5 -0
- data/lib/fullcalendar.io/rails/version.rb +1 -1
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/images/.keep +0 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/controllers/concerns/.keep +0 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/mailers/.keep +0 -0
- data/spec/dummy/app/models/.keep +0 -0
- data/spec/dummy/app/models/concerns/.keep +0 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +29 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +31 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +41 -0
- data/spec/dummy/config/environments/production.rb +79 -0
- data/spec/dummy/config/environments/test.rb +42 -0
- data/spec/dummy/config/initializers/assets.rb +11 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +56 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/lib/assets/.keep +0 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/features/assets_spec.rb +28 -0
- data/spec/spec_helper.rb +4 -0
- data/vendor/assets/javascripts/fullcalendar.js +79 -74
- data/vendor/assets/javascripts/fullcalendar/gcal.js +1 -1
- data/vendor/assets/stylesheets/fullcalendar.css +1 -1
- data/vendor/assets/stylesheets/fullcalendar.print.css +1 -1
- metadata +213 -3
@@ -0,0 +1,11 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Version of your assets, change this if you want to expire all your assets.
|
4
|
+
Rails.application.config.assets.version = '1.0'
|
5
|
+
|
6
|
+
# Add additional assets to the asset load path
|
7
|
+
# Rails.application.config.assets.paths << Emoji.images_path
|
8
|
+
|
9
|
+
# Precompile additional assets.
|
10
|
+
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
11
|
+
# Rails.application.config.assets.precompile += %w( search.js )
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
4
|
+
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
5
|
+
|
6
|
+
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
|
7
|
+
# Rails.backtrace_cleaner.remove_silencers!
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Add new inflection rules using the following format. Inflections
|
4
|
+
# are locale specific, and you may define rules for as many different
|
5
|
+
# locales as you wish. All of these examples are active by default:
|
6
|
+
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
7
|
+
# inflect.plural /^(ox)$/i, '\1en'
|
8
|
+
# inflect.singular /^(ox)en/i, '\1'
|
9
|
+
# inflect.irregular 'person', 'people'
|
10
|
+
# inflect.uncountable %w( fish sheep )
|
11
|
+
# end
|
12
|
+
|
13
|
+
# These inflection rules are supported but not enabled by default:
|
14
|
+
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
15
|
+
# inflect.acronym 'RESTful'
|
16
|
+
# end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# This file contains settings for ActionController::ParamsWrapper which
|
4
|
+
# is enabled by default.
|
5
|
+
|
6
|
+
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
7
|
+
ActiveSupport.on_load(:action_controller) do
|
8
|
+
wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
|
9
|
+
end
|
10
|
+
|
11
|
+
# To enable root element in JSON for ActiveRecord objects.
|
12
|
+
# ActiveSupport.on_load(:active_record) do
|
13
|
+
# self.include_root_in_json = true
|
14
|
+
# end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# Files in the config/locales directory are used for internationalization
|
2
|
+
# and are automatically loaded by Rails. If you want to use locales other
|
3
|
+
# than English, add the necessary files in this directory.
|
4
|
+
#
|
5
|
+
# To use the locales, use `I18n.t`:
|
6
|
+
#
|
7
|
+
# I18n.t 'hello'
|
8
|
+
#
|
9
|
+
# In views, this is aliased to just `t`:
|
10
|
+
#
|
11
|
+
# <%= t('hello') %>
|
12
|
+
#
|
13
|
+
# To use a different locale, set it with `I18n.locale`:
|
14
|
+
#
|
15
|
+
# I18n.locale = :es
|
16
|
+
#
|
17
|
+
# This would use the information in config/locales/es.yml.
|
18
|
+
#
|
19
|
+
# To learn more, please read the Rails Internationalization guide
|
20
|
+
# available at http://guides.rubyonrails.org/i18n.html.
|
21
|
+
|
22
|
+
en:
|
23
|
+
hello: "Hello world"
|
@@ -0,0 +1,56 @@
|
|
1
|
+
Rails.application.routes.draw do
|
2
|
+
# The priority is based upon order of creation: first created -> highest priority.
|
3
|
+
# See how all your routes lay out with "rake routes".
|
4
|
+
|
5
|
+
# You can have the root of your site routed with "root"
|
6
|
+
# root 'welcome#index'
|
7
|
+
|
8
|
+
# Example of regular route:
|
9
|
+
# get 'products/:id' => 'catalog#view'
|
10
|
+
|
11
|
+
# Example of named route that can be invoked with purchase_url(id: product.id)
|
12
|
+
# get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
|
13
|
+
|
14
|
+
# Example resource route (maps HTTP verbs to controller actions automatically):
|
15
|
+
# resources :products
|
16
|
+
|
17
|
+
# Example resource route with options:
|
18
|
+
# resources :products do
|
19
|
+
# member do
|
20
|
+
# get 'short'
|
21
|
+
# post 'toggle'
|
22
|
+
# end
|
23
|
+
#
|
24
|
+
# collection do
|
25
|
+
# get 'sold'
|
26
|
+
# end
|
27
|
+
# end
|
28
|
+
|
29
|
+
# Example resource route with sub-resources:
|
30
|
+
# resources :products do
|
31
|
+
# resources :comments, :sales
|
32
|
+
# resource :seller
|
33
|
+
# end
|
34
|
+
|
35
|
+
# Example resource route with more complex sub-resources:
|
36
|
+
# resources :products do
|
37
|
+
# resources :comments
|
38
|
+
# resources :sales do
|
39
|
+
# get 'recent', on: :collection
|
40
|
+
# end
|
41
|
+
# end
|
42
|
+
|
43
|
+
# Example resource route with concerns:
|
44
|
+
# concern :toggleable do
|
45
|
+
# post 'toggle'
|
46
|
+
# end
|
47
|
+
# resources :posts, concerns: :toggleable
|
48
|
+
# resources :photos, concerns: :toggleable
|
49
|
+
|
50
|
+
# Example resource route within a namespace:
|
51
|
+
# namespace :admin do
|
52
|
+
# # Directs /admin/products/* to Admin::ProductsController
|
53
|
+
# # (app/controllers/admin/products_controller.rb)
|
54
|
+
# resources :products
|
55
|
+
# end
|
56
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Your secret key is used for verifying the integrity of signed cookies.
|
4
|
+
# If you change this key, all old signed cookies will become invalid!
|
5
|
+
|
6
|
+
# Make sure the secret is at least 30 characters and all random,
|
7
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
8
|
+
# You can use `rake secret` to generate a secure secret key.
|
9
|
+
|
10
|
+
# Make sure the secrets in this file are kept private
|
11
|
+
# if you're sharing your code publicly.
|
12
|
+
|
13
|
+
development:
|
14
|
+
secret_key_base: 75230f5f92728ac7924e515cb33c78cbbb5cac06a012d30dae6cc94e5421c7a07ed8e57508d06ff179e7ac072392d158c73c1100835076ea67e1e8ff476c9780
|
15
|
+
|
16
|
+
test:
|
17
|
+
secret_key_base: 5698c3fa7049b25826c134a02a7f9962e06bb12ebef1873968ccef8caef3df3c366999dd0c1af692dd41bd3794639622642e4826ac364be2066c6fb2c98319f5
|
18
|
+
|
19
|
+
# Do not keep production secrets in the repository,
|
20
|
+
# instead read values from the environment.
|
21
|
+
production:
|
22
|
+
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
|
File without changes
|
File without changes
|
@@ -0,0 +1,67 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The page you were looking for doesn't exist (404)</title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<style>
|
7
|
+
body {
|
8
|
+
background-color: #EFEFEF;
|
9
|
+
color: #2E2F30;
|
10
|
+
text-align: center;
|
11
|
+
font-family: arial, sans-serif;
|
12
|
+
margin: 0;
|
13
|
+
}
|
14
|
+
|
15
|
+
div.dialog {
|
16
|
+
width: 95%;
|
17
|
+
max-width: 33em;
|
18
|
+
margin: 4em auto 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
div.dialog > div {
|
22
|
+
border: 1px solid #CCC;
|
23
|
+
border-right-color: #999;
|
24
|
+
border-left-color: #999;
|
25
|
+
border-bottom-color: #BBB;
|
26
|
+
border-top: #B00100 solid 4px;
|
27
|
+
border-top-left-radius: 9px;
|
28
|
+
border-top-right-radius: 9px;
|
29
|
+
background-color: white;
|
30
|
+
padding: 7px 12% 0;
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
+
}
|
33
|
+
|
34
|
+
h1 {
|
35
|
+
font-size: 100%;
|
36
|
+
color: #730E15;
|
37
|
+
line-height: 1.5em;
|
38
|
+
}
|
39
|
+
|
40
|
+
div.dialog > p {
|
41
|
+
margin: 0 0 1em;
|
42
|
+
padding: 1em;
|
43
|
+
background-color: #F7F7F7;
|
44
|
+
border: 1px solid #CCC;
|
45
|
+
border-right-color: #999;
|
46
|
+
border-left-color: #999;
|
47
|
+
border-bottom-color: #999;
|
48
|
+
border-bottom-left-radius: 4px;
|
49
|
+
border-bottom-right-radius: 4px;
|
50
|
+
border-top-color: #DADADA;
|
51
|
+
color: #666;
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
+
}
|
54
|
+
</style>
|
55
|
+
</head>
|
56
|
+
|
57
|
+
<body>
|
58
|
+
<!-- This file lives in public/404.html -->
|
59
|
+
<div class="dialog">
|
60
|
+
<div>
|
61
|
+
<h1>The page you were looking for doesn't exist.</h1>
|
62
|
+
<p>You may have mistyped the address or the page may have moved.</p>
|
63
|
+
</div>
|
64
|
+
<p>If you are the application owner check the logs for more information.</p>
|
65
|
+
</div>
|
66
|
+
</body>
|
67
|
+
</html>
|
@@ -0,0 +1,67 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The change you wanted was rejected (422)</title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<style>
|
7
|
+
body {
|
8
|
+
background-color: #EFEFEF;
|
9
|
+
color: #2E2F30;
|
10
|
+
text-align: center;
|
11
|
+
font-family: arial, sans-serif;
|
12
|
+
margin: 0;
|
13
|
+
}
|
14
|
+
|
15
|
+
div.dialog {
|
16
|
+
width: 95%;
|
17
|
+
max-width: 33em;
|
18
|
+
margin: 4em auto 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
div.dialog > div {
|
22
|
+
border: 1px solid #CCC;
|
23
|
+
border-right-color: #999;
|
24
|
+
border-left-color: #999;
|
25
|
+
border-bottom-color: #BBB;
|
26
|
+
border-top: #B00100 solid 4px;
|
27
|
+
border-top-left-radius: 9px;
|
28
|
+
border-top-right-radius: 9px;
|
29
|
+
background-color: white;
|
30
|
+
padding: 7px 12% 0;
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
+
}
|
33
|
+
|
34
|
+
h1 {
|
35
|
+
font-size: 100%;
|
36
|
+
color: #730E15;
|
37
|
+
line-height: 1.5em;
|
38
|
+
}
|
39
|
+
|
40
|
+
div.dialog > p {
|
41
|
+
margin: 0 0 1em;
|
42
|
+
padding: 1em;
|
43
|
+
background-color: #F7F7F7;
|
44
|
+
border: 1px solid #CCC;
|
45
|
+
border-right-color: #999;
|
46
|
+
border-left-color: #999;
|
47
|
+
border-bottom-color: #999;
|
48
|
+
border-bottom-left-radius: 4px;
|
49
|
+
border-bottom-right-radius: 4px;
|
50
|
+
border-top-color: #DADADA;
|
51
|
+
color: #666;
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
+
}
|
54
|
+
</style>
|
55
|
+
</head>
|
56
|
+
|
57
|
+
<body>
|
58
|
+
<!-- This file lives in public/422.html -->
|
59
|
+
<div class="dialog">
|
60
|
+
<div>
|
61
|
+
<h1>The change you wanted was rejected.</h1>
|
62
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
63
|
+
</div>
|
64
|
+
<p>If you are the application owner check the logs for more information.</p>
|
65
|
+
</div>
|
66
|
+
</body>
|
67
|
+
</html>
|
@@ -0,0 +1,66 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>We're sorry, but something went wrong (500)</title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<style>
|
7
|
+
body {
|
8
|
+
background-color: #EFEFEF;
|
9
|
+
color: #2E2F30;
|
10
|
+
text-align: center;
|
11
|
+
font-family: arial, sans-serif;
|
12
|
+
margin: 0;
|
13
|
+
}
|
14
|
+
|
15
|
+
div.dialog {
|
16
|
+
width: 95%;
|
17
|
+
max-width: 33em;
|
18
|
+
margin: 4em auto 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
div.dialog > div {
|
22
|
+
border: 1px solid #CCC;
|
23
|
+
border-right-color: #999;
|
24
|
+
border-left-color: #999;
|
25
|
+
border-bottom-color: #BBB;
|
26
|
+
border-top: #B00100 solid 4px;
|
27
|
+
border-top-left-radius: 9px;
|
28
|
+
border-top-right-radius: 9px;
|
29
|
+
background-color: white;
|
30
|
+
padding: 7px 12% 0;
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
+
}
|
33
|
+
|
34
|
+
h1 {
|
35
|
+
font-size: 100%;
|
36
|
+
color: #730E15;
|
37
|
+
line-height: 1.5em;
|
38
|
+
}
|
39
|
+
|
40
|
+
div.dialog > p {
|
41
|
+
margin: 0 0 1em;
|
42
|
+
padding: 1em;
|
43
|
+
background-color: #F7F7F7;
|
44
|
+
border: 1px solid #CCC;
|
45
|
+
border-right-color: #999;
|
46
|
+
border-left-color: #999;
|
47
|
+
border-bottom-color: #999;
|
48
|
+
border-bottom-left-radius: 4px;
|
49
|
+
border-bottom-right-radius: 4px;
|
50
|
+
border-top-color: #DADADA;
|
51
|
+
color: #666;
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
+
}
|
54
|
+
</style>
|
55
|
+
</head>
|
56
|
+
|
57
|
+
<body>
|
58
|
+
<!-- This file lives in public/500.html -->
|
59
|
+
<div class="dialog">
|
60
|
+
<div>
|
61
|
+
<h1>We're sorry, but something went wrong.</h1>
|
62
|
+
</div>
|
63
|
+
<p>If you are the application owner check the logs for more information.</p>
|
64
|
+
</div>
|
65
|
+
</body>
|
66
|
+
</html>
|
File without changes
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
feature 'Assets integration' do
|
4
|
+
it 'provides fullcalendar.js on the asset pipeline' do
|
5
|
+
visit '/assets/fullcalendar.js'
|
6
|
+
expect(page.status_code).to be 200
|
7
|
+
end
|
8
|
+
|
9
|
+
it 'provides fullcalendar/gcal.js on the asset pipeline' do
|
10
|
+
visit '/assets/fullcalendar/gcal.js'
|
11
|
+
expect(page.status_code).to be 200
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'provides fullcalendar/lang/pl.js on the asset pipeline' do
|
15
|
+
visit '/assets/fullcalendar/lang/pl.js'
|
16
|
+
expect(page.status_code).to be 200
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'provides fullcalendar.css on the asset pipeline' do
|
20
|
+
visit '/assets/fullcalendar.css'
|
21
|
+
expect(page.status_code).to be 200
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'provides fullcalendar.print.css on the asset pipeline' do
|
25
|
+
visit '/assets/fullcalendar.print.css'
|
26
|
+
expect(page.status_code).to be 200
|
27
|
+
end
|
28
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* FullCalendar v2.6.
|
2
|
+
* FullCalendar v2.6.1
|
3
3
|
* Docs & License: http://fullcalendar.io/
|
4
4
|
* (c) 2015 Adam Shaw
|
5
5
|
*/
|
@@ -19,8 +19,8 @@
|
|
19
19
|
;;
|
20
20
|
|
21
21
|
var FC = $.fullCalendar = {
|
22
|
-
version: "2.6.
|
23
|
-
internalApiVersion:
|
22
|
+
version: "2.6.1",
|
23
|
+
internalApiVersion: 3
|
24
24
|
};
|
25
25
|
var fcViews = FC.views = {};
|
26
26
|
|
@@ -2064,6 +2064,14 @@ var CoordCache = FC.CoordCache = Class.extend({
|
|
2064
2064
|
},
|
2065
2065
|
|
2066
2066
|
|
2067
|
+
// When called, if coord caches aren't built, builds them
|
2068
|
+
ensureBuilt: function() {
|
2069
|
+
if (!this.origin) {
|
2070
|
+
this.build();
|
2071
|
+
}
|
2072
|
+
},
|
2073
|
+
|
2074
|
+
|
2067
2075
|
// Compute and return what the elements' bounding rectangle is, from the user's perspective.
|
2068
2076
|
// Right now, only returns a rectangle if constrained by an overflow:scroll element.
|
2069
2077
|
queryBoundingRect: function() {
|
@@ -2116,6 +2124,8 @@ var CoordCache = FC.CoordCache = Class.extend({
|
|
2116
2124
|
// Given a left offset (from document left), returns the index of the el that it horizontally intersects.
|
2117
2125
|
// If no intersection is made, or outside of the boundingRect, returns undefined.
|
2118
2126
|
getHorizontalIndex: function(leftOffset) {
|
2127
|
+
this.ensureBuilt();
|
2128
|
+
|
2119
2129
|
var boundingRect = this.boundingRect;
|
2120
2130
|
var lefts = this.lefts;
|
2121
2131
|
var rights = this.rights;
|
@@ -2135,6 +2145,8 @@ var CoordCache = FC.CoordCache = Class.extend({
|
|
2135
2145
|
// Given a top offset (from document top), returns the index of the el that it vertically intersects.
|
2136
2146
|
// If no intersection is made, or outside of the boundingRect, returns undefined.
|
2137
2147
|
getVerticalIndex: function(topOffset) {
|
2148
|
+
this.ensureBuilt();
|
2149
|
+
|
2138
2150
|
var boundingRect = this.boundingRect;
|
2139
2151
|
var tops = this.tops;
|
2140
2152
|
var bottoms = this.bottoms;
|
@@ -2153,12 +2165,14 @@ var CoordCache = FC.CoordCache = Class.extend({
|
|
2153
2165
|
|
2154
2166
|
// Gets the left offset (from document left) of the element at the given index
|
2155
2167
|
getLeftOffset: function(leftIndex) {
|
2168
|
+
this.ensureBuilt();
|
2156
2169
|
return this.lefts[leftIndex];
|
2157
2170
|
},
|
2158
2171
|
|
2159
2172
|
|
2160
2173
|
// Gets the left position (from offsetParent left) of the element at the given index
|
2161
2174
|
getLeftPosition: function(leftIndex) {
|
2175
|
+
this.ensureBuilt();
|
2162
2176
|
return this.lefts[leftIndex] - this.origin.left;
|
2163
2177
|
},
|
2164
2178
|
|
@@ -2166,6 +2180,7 @@ var CoordCache = FC.CoordCache = Class.extend({
|
|
2166
2180
|
// Gets the right offset (from document left) of the element at the given index.
|
2167
2181
|
// This value is NOT relative to the document's right edge, like the CSS concept of "right" would be.
|
2168
2182
|
getRightOffset: function(leftIndex) {
|
2183
|
+
this.ensureBuilt();
|
2169
2184
|
return this.rights[leftIndex];
|
2170
2185
|
},
|
2171
2186
|
|
@@ -2173,30 +2188,35 @@ var CoordCache = FC.CoordCache = Class.extend({
|
|
2173
2188
|
// Gets the right position (from offsetParent left) of the element at the given index.
|
2174
2189
|
// This value is NOT relative to the offsetParent's right edge, like the CSS concept of "right" would be.
|
2175
2190
|
getRightPosition: function(leftIndex) {
|
2191
|
+
this.ensureBuilt();
|
2176
2192
|
return this.rights[leftIndex] - this.origin.left;
|
2177
2193
|
},
|
2178
2194
|
|
2179
2195
|
|
2180
2196
|
// Gets the width of the element at the given index
|
2181
2197
|
getWidth: function(leftIndex) {
|
2198
|
+
this.ensureBuilt();
|
2182
2199
|
return this.rights[leftIndex] - this.lefts[leftIndex];
|
2183
2200
|
},
|
2184
2201
|
|
2185
2202
|
|
2186
2203
|
// Gets the top offset (from document top) of the element at the given index
|
2187
2204
|
getTopOffset: function(topIndex) {
|
2205
|
+
this.ensureBuilt();
|
2188
2206
|
return this.tops[topIndex];
|
2189
2207
|
},
|
2190
2208
|
|
2191
2209
|
|
2192
2210
|
// Gets the top position (from offsetParent top) of the element at the given position
|
2193
2211
|
getTopPosition: function(topIndex) {
|
2212
|
+
this.ensureBuilt();
|
2194
2213
|
return this.tops[topIndex] - this.origin.top;
|
2195
2214
|
},
|
2196
2215
|
|
2197
2216
|
// Gets the bottom offset (from the document top) of the element at the given index.
|
2198
2217
|
// This value is NOT relative to the offsetParent's bottom edge, like the CSS concept of "bottom" would be.
|
2199
2218
|
getBottomOffset: function(topIndex) {
|
2219
|
+
this.ensureBuilt();
|
2200
2220
|
return this.bottoms[topIndex];
|
2201
2221
|
},
|
2202
2222
|
|
@@ -2204,12 +2224,14 @@ var CoordCache = FC.CoordCache = Class.extend({
|
|
2204
2224
|
// Gets the bottom position (from the offsetParent top) of the element at the given index.
|
2205
2225
|
// This value is NOT relative to the offsetParent's bottom edge, like the CSS concept of "bottom" would be.
|
2206
2226
|
getBottomPosition: function(topIndex) {
|
2227
|
+
this.ensureBuilt();
|
2207
2228
|
return this.bottoms[topIndex] - this.origin.top;
|
2208
2229
|
},
|
2209
2230
|
|
2210
2231
|
|
2211
2232
|
// Gets the height of the element at the given index
|
2212
2233
|
getHeight: function(topIndex) {
|
2234
|
+
this.ensureBuilt();
|
2213
2235
|
return this.bottoms[topIndex] - this.tops[topIndex];
|
2214
2236
|
}
|
2215
2237
|
|
@@ -3727,20 +3749,9 @@ Grid.mixin({
|
|
3727
3749
|
|
3728
3750
|
// Generates a semicolon-separated CSS string to be used for the default rendering of a background event.
|
3729
3751
|
// Called by the fill system.
|
3730
|
-
// TODO: consolidate with getEventSkinCss?
|
3731
3752
|
bgEventSegCss: function(seg) {
|
3732
|
-
var view = this.view;
|
3733
|
-
var event = seg.event;
|
3734
|
-
var source = event.source || {};
|
3735
|
-
|
3736
3753
|
return {
|
3737
|
-
'background-color':
|
3738
|
-
event.backgroundColor ||
|
3739
|
-
event.color ||
|
3740
|
-
source.backgroundColor ||
|
3741
|
-
source.color ||
|
3742
|
-
view.opt('eventBackgroundColor') ||
|
3743
|
-
view.opt('eventColor')
|
3754
|
+
'background-color': this.getSegSkinCss(seg)['background-color']
|
3744
3755
|
};
|
3745
3756
|
},
|
3746
3757
|
|
@@ -4323,7 +4334,8 @@ Grid.mixin({
|
|
4323
4334
|
|
4324
4335
|
|
4325
4336
|
// Utility for generating event skin-related CSS properties
|
4326
|
-
|
4337
|
+
getSegSkinCss: function(seg) {
|
4338
|
+
var event = seg.event;
|
4327
4339
|
var view = this.view;
|
4328
4340
|
var source = event.source || {};
|
4329
4341
|
var eventColor = event.color;
|
@@ -5546,7 +5558,7 @@ DayGrid.mixin({
|
|
5546
5558
|
var isResizableFromEnd = !disableResizing && event.allDay &&
|
5547
5559
|
seg.isEnd && view.isEventResizableFromEnd(event);
|
5548
5560
|
var classes = this.getSegClasses(seg, isDraggable, isResizableFromStart || isResizableFromEnd);
|
5549
|
-
var skinCss = cssToStr(this.
|
5561
|
+
var skinCss = cssToStr(this.getSegSkinCss(seg));
|
5550
5562
|
var timeHtml = '';
|
5551
5563
|
var timeText;
|
5552
5564
|
var titleHtml;
|
@@ -6902,7 +6914,7 @@ TimeGrid.mixin({
|
|
6902
6914
|
var isResizableFromStart = !disableResizing && seg.isStart && view.isEventResizableFromStart(event);
|
6903
6915
|
var isResizableFromEnd = !disableResizing && seg.isEnd && view.isEventResizableFromEnd(event);
|
6904
6916
|
var classes = this.getSegClasses(seg, isDraggable, isResizableFromStart || isResizableFromEnd);
|
6905
|
-
var skinCss = cssToStr(this.
|
6917
|
+
var skinCss = cssToStr(this.getSegSkinCss(seg));
|
6906
6918
|
var timeText;
|
6907
6919
|
var fullTimeText; // more verbose time text. for the print stylesheet
|
6908
6920
|
var startTimeText; // just the start time text
|
@@ -7313,9 +7325,12 @@ var View = FC.View = Class.extend({
|
|
7313
7325
|
// document handlers, bound to `this` object
|
7314
7326
|
documentMousedownProxy: null, // TODO: doesn't work with touch
|
7315
7327
|
|
7316
|
-
//
|
7317
|
-
|
7318
|
-
|
7328
|
+
// now indicator
|
7329
|
+
isNowIndicatorRendered: null,
|
7330
|
+
initialNowDate: null, // result first getNow call
|
7331
|
+
initialNowQueriedMs: null, // ms time the getNow was called
|
7332
|
+
nowIndicatorTimeoutID: null, // for refresh timing of now indicator
|
7333
|
+
nowIndicatorIntervalID: null, // "
|
7319
7334
|
|
7320
7335
|
|
7321
7336
|
constructor: function(calendar, type, options, intervalDuration) {
|
@@ -7585,22 +7600,6 @@ var View = FC.View = Class.extend({
|
|
7585
7600
|
},
|
7586
7601
|
|
7587
7602
|
|
7588
|
-
// If the view has already been displayed, tears it down and displays it again.
|
7589
|
-
// Will re-render the events if necessary, which display/clear DO NOT do.
|
7590
|
-
// TODO: make behavior more consistent.
|
7591
|
-
redisplay: function() {
|
7592
|
-
if (this.isSkeletonRendered) {
|
7593
|
-
var wasEventsRendered = this.isEventsRendered;
|
7594
|
-
this.clearEvents(); // won't trigger handlers if events never rendered
|
7595
|
-
this.clearView();
|
7596
|
-
this.displayView();
|
7597
|
-
if (wasEventsRendered) { // only render and trigger handlers if events previously rendered
|
7598
|
-
this.displayEvents(this.calendar.getEventCache());
|
7599
|
-
}
|
7600
|
-
}
|
7601
|
-
},
|
7602
|
-
|
7603
|
-
|
7604
7603
|
// Displays the view's non-event content, such as date-related content or anything required by events.
|
7605
7604
|
// Renders the view's non-content skeleton if necessary.
|
7606
7605
|
// Can be asynchronous and return a promise.
|
@@ -7618,10 +7617,7 @@ var View = FC.View = Class.extend({
|
|
7618
7617
|
this.renderDates();
|
7619
7618
|
this.updateSize();
|
7620
7619
|
this.renderBusinessHours(); // might need coordinates, so should go after updateSize()
|
7621
|
-
|
7622
|
-
if (this.opt('nowIndicator')) {
|
7623
|
-
this.startNowIndicator();
|
7624
|
-
}
|
7620
|
+
this.startNowIndicator();
|
7625
7621
|
},
|
7626
7622
|
|
7627
7623
|
|
@@ -7723,34 +7719,42 @@ var View = FC.View = Class.extend({
|
|
7723
7719
|
// TODO: somehow do this for the current whole day's background too
|
7724
7720
|
startNowIndicator: function() {
|
7725
7721
|
var _this = this;
|
7726
|
-
var unit
|
7727
|
-
var
|
7728
|
-
var initialNowQueried; // ms time of then getNow was called
|
7722
|
+
var unit;
|
7723
|
+
var update;
|
7729
7724
|
var delay; // ms wait value
|
7730
7725
|
|
7731
|
-
|
7732
|
-
|
7733
|
-
|
7734
|
-
|
7735
|
-
|
7736
|
-
|
7737
|
-
|
7726
|
+
if (this.opt('nowIndicator')) {
|
7727
|
+
unit = this.getNowIndicatorUnit();
|
7728
|
+
if (unit) {
|
7729
|
+
update = proxy(this, 'updateNowIndicator'); // bind to `this`
|
7730
|
+
|
7731
|
+
this.initialNowDate = this.calendar.getNow();
|
7732
|
+
this.initialNowQueriedMs = +new Date();
|
7733
|
+
this.renderNowIndicator(this.initialNowDate);
|
7734
|
+
this.isNowIndicatorRendered = true;
|
7735
|
+
|
7736
|
+
// wait until the beginning of the next interval
|
7737
|
+
delay = this.initialNowDate.clone().startOf(unit).add(1, unit) - this.initialNowDate;
|
7738
|
+
this.nowIndicatorTimeoutID = setTimeout(function() {
|
7739
|
+
_this.nowIndicatorTimeoutID = null;
|
7740
|
+
update();
|
7741
|
+
delay = +moment.duration(1, unit);
|
7742
|
+
delay = Math.max(100, delay); // prevent too frequent
|
7743
|
+
_this.nowIndicatorIntervalID = setInterval(update, delay); // update every interval
|
7744
|
+
}, delay);
|
7745
|
+
}
|
7738
7746
|
}
|
7747
|
+
},
|
7739
7748
|
|
7740
|
-
if (unit) {
|
7741
|
-
initialNow = this.calendar.getNow();
|
7742
|
-
initialNowQueried = +new Date();
|
7743
|
-
this.renderNowIndicator(initialNow);
|
7744
7749
|
|
7745
|
-
|
7746
|
-
|
7747
|
-
|
7748
|
-
|
7749
|
-
|
7750
|
-
|
7751
|
-
|
7752
|
-
|
7753
|
-
}, delay);
|
7750
|
+
// rerenders the now indicator, computing the new current time from the amount of time that has passed
|
7751
|
+
// since the initial getNow call.
|
7752
|
+
updateNowIndicator: function() {
|
7753
|
+
if (this.isNowIndicatorRendered) {
|
7754
|
+
this.unrenderNowIndicator();
|
7755
|
+
this.renderNowIndicator(
|
7756
|
+
this.initialNowDate.clone().add(new Date() - this.initialNowQueriedMs) // add ms
|
7757
|
+
);
|
7754
7758
|
}
|
7755
7759
|
},
|
7756
7760
|
|
@@ -7758,19 +7762,19 @@ var View = FC.View = Class.extend({
|
|
7758
7762
|
// Immediately unrenders the view's current time indicator and stops any re-rendering timers.
|
7759
7763
|
// Won't cause side effects if indicator isn't rendered.
|
7760
7764
|
stopNowIndicator: function() {
|
7761
|
-
|
7765
|
+
if (this.isNowIndicatorRendered) {
|
7762
7766
|
|
7763
|
-
|
7764
|
-
|
7765
|
-
|
7766
|
-
|
7767
|
-
|
7768
|
-
|
7769
|
-
|
7770
|
-
|
7767
|
+
if (this.nowIndicatorTimeoutID) {
|
7768
|
+
clearTimeout(this.nowIndicatorTimeoutID);
|
7769
|
+
this.nowIndicatorTimeoutID = null;
|
7770
|
+
}
|
7771
|
+
if (this.nowIndicatorIntervalID) {
|
7772
|
+
clearTimeout(this.nowIndicatorIntervalID);
|
7773
|
+
this.nowIndicatorIntervalID = null;
|
7774
|
+
}
|
7771
7775
|
|
7772
|
-
if (cleared) { // is the indicator currently display?
|
7773
7776
|
this.unrenderNowIndicator();
|
7777
|
+
this.isNowIndicatorRendered = false;
|
7774
7778
|
}
|
7775
7779
|
},
|
7776
7780
|
|
@@ -7808,6 +7812,7 @@ var View = FC.View = Class.extend({
|
|
7808
7812
|
|
7809
7813
|
this.updateHeight(isResize);
|
7810
7814
|
this.updateWidth(isResize);
|
7815
|
+
this.updateNowIndicator();
|
7811
7816
|
|
7812
7817
|
if (isResize) {
|
7813
7818
|
this.setScroll(scrollState);
|