surveyor 0.22.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/.rspec +1 -0
- data/CHANGELOG.md +83 -0
- data/Gemfile.rails_version +7 -1
- data/README.md +114 -16
- data/Rakefile +15 -9
- data/app/inputs/quiet_input.rb +5 -0
- data/app/inputs/surveyor_check_boxes_input.rb +35 -0
- data/app/inputs/surveyor_radio_input.rb +18 -0
- data/app/views/partials/_answer.html.haml +4 -4
- data/app/views/partials/_question.html.haml +7 -7
- data/app/views/partials/_question_group.html.haml +9 -8
- data/app/views/surveyor/export.json.rabl +28 -25
- data/app/views/surveyor/new.html.haml +8 -5
- data/app/views/surveyor/show.json.rabl +3 -2
- data/ci-exec.sh +13 -7
- data/cucumber.yml +3 -3
- data/doc/REPRESENTATIONS.md +34 -0
- data/doc/api_id_schema.json +7 -0
- data/doc/response_set_schema.json +54 -0
- data/doc/surveyor question combinations.png +0 -0
- data/doc/surveyor_timestamp_schema.json +9 -0
- data/features/ajax_submissions.feature +140 -0
- data/features/export_to_json.feature +182 -34
- data/features/no_duplicates.feature +110 -0
- data/features/show_survey.feature +1 -1
- data/features/step_definitions/parser_steps.rb +25 -2
- data/features/step_definitions/surveyor_steps.rb +145 -20
- data/features/step_definitions/ui_steps.rb +3 -0
- data/features/support/database_cleaner.rb +16 -0
- data/features/support/env.rb +21 -17
- data/features/support/simultaneous_ajax.rb +101 -0
- data/features/support/single_quit_selenium_driver.rb +23 -0
- data/features/support/slow_updates.rb +18 -0
- data/features/surveyor.feature +174 -44
- data/features/surveyor_dependencies.feature +80 -39
- data/features/surveyor_parser.feature +114 -20
- data/features/z_redcap_parser.feature +0 -1
- data/lib/{generators/surveyor/templates/public → assets}/images/surveyor/next.gif +0 -0
- data/lib/{generators/surveyor/templates/public → assets}/images/surveyor/prev.gif +0 -0
- data/lib/{generators/surveyor/templates/public/stylesheets/surveyor → assets/images}/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/lib/{generators/surveyor/templates/public/stylesheets/surveyor → assets/images}/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/lib/{generators/surveyor/templates/public/stylesheets/surveyor → assets/images}/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/lib/{generators/surveyor/templates/public/stylesheets/surveyor → assets/images}/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/lib/assets/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/lib/{generators/surveyor/templates/public/stylesheets/surveyor → assets/images}/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/lib/{generators/surveyor/templates/public/stylesheets/surveyor → assets/images}/ui-icons_ef8c08_256x240.png +0 -0
- data/lib/{generators/surveyor/templates/public/stylesheets/surveyor → assets/images}/ui-icons_ffffff_256x240.png +0 -0
- data/lib/{generators/surveyor/templates/public → assets}/javascripts/surveyor/jquery-ui-timepicker-addon.js +23 -23
- data/lib/{generators/surveyor/templates/public → assets}/javascripts/surveyor/jquery-ui.js +125 -125
- data/lib/assets/javascripts/surveyor/jquery.selectToUISlider.js +240 -0
- data/lib/{generators/surveyor/templates/public → assets}/javascripts/surveyor/jquery.surveyor.js +52 -57
- data/lib/{generators/surveyor/templates/public → assets}/javascripts/surveyor/jquery.tools.min.js +7 -7
- data/lib/{generators/surveyor/templates/public → assets}/stylesheets/surveyor/dateinput.css +13 -13
- data/lib/{generators/surveyor/templates/public → assets}/stylesheets/surveyor/jquery-ui-timepicker-addon.css +0 -0
- data/lib/{generators/surveyor/templates/public → assets}/stylesheets/surveyor/jquery-ui.custom.css +17 -17
- data/lib/{generators/surveyor/templates/public → assets}/stylesheets/surveyor/reset.css +1 -1
- data/lib/{generators/surveyor/templates/public → assets}/stylesheets/surveyor/results.css +0 -0
- data/lib/assets/stylesheets/surveyor/ui.slider.extras.css +110 -0
- data/lib/{generators/surveyor/templates/public/stylesheets/sass → assets/stylesheets}/surveyor.sass +15 -7
- data/lib/generators/surveyor/custom_generator.rb +3 -2
- data/lib/generators/surveyor/install_generator.rb +59 -17
- data/lib/generators/surveyor/templates/app/assets/javascripts/surveyor_all.js +5 -0
- data/lib/generators/surveyor/templates/app/assets/stylesheets/surveyor_all.css +9 -0
- data/lib/generators/surveyor/templates/app/controllers/surveyor_controller.rb +2 -1
- data/lib/generators/surveyor/templates/app/views/layouts/surveyor_custom.html.erb +1 -0
- data/lib/generators/surveyor/templates/config/locales/surveyor_es.yml +1 -0
- data/lib/generators/surveyor/templates/config/locales/surveyor_he.yml +1 -0
- data/lib/generators/surveyor/templates/db/migrate/add_api_id_to_question_groups.rb +1 -0
- data/lib/generators/surveyor/templates/db/migrate/add_api_ids.rb +1 -0
- data/lib/generators/surveyor/templates/db/migrate/add_api_ids_to_response_sets_and_responses.rb +1 -0
- data/lib/generators/surveyor/templates/db/migrate/add_correct_answer_id_to_questions.rb +1 -0
- data/lib/generators/surveyor/templates/db/migrate/add_default_value_to_answers.rb +1 -0
- data/lib/generators/surveyor/templates/db/migrate/add_display_order_to_surveys.rb +1 -0
- data/lib/generators/surveyor/templates/db/migrate/add_display_type_to_answers.rb +1 -0
- data/lib/generators/surveyor/templates/db/migrate/add_index_to_response_sets.rb +1 -0
- data/lib/generators/surveyor/templates/db/migrate/add_index_to_surveys.rb +1 -0
- data/lib/generators/surveyor/templates/db/migrate/add_section_id_to_responses.rb +1 -0
- data/lib/generators/surveyor/templates/db/migrate/add_unique_index_on_access_code_and_version_in_surveys.rb +10 -0
- data/lib/generators/surveyor/templates/db/migrate/add_unique_indicies.rb +3 -2
- data/lib/generators/surveyor/templates/db/migrate/add_version_to_surveys.rb +10 -0
- data/lib/generators/surveyor/templates/db/migrate/api_ids_must_be_unique.rb +23 -0
- data/lib/generators/surveyor/templates/db/migrate/create_answers.rb +6 -5
- data/lib/generators/surveyor/templates/db/migrate/create_dependencies.rb +2 -1
- data/lib/generators/surveyor/templates/db/migrate/create_dependency_conditions.rb +2 -1
- data/lib/generators/surveyor/templates/db/migrate/create_question_groups.rb +5 -4
- data/lib/generators/surveyor/templates/db/migrate/create_questions.rb +4 -3
- data/lib/generators/surveyor/templates/db/migrate/create_response_sets.rb +1 -0
- data/lib/generators/surveyor/templates/db/migrate/create_responses.rb +10 -9
- data/lib/generators/surveyor/templates/db/migrate/create_survey_sections.rb +5 -4
- data/lib/generators/surveyor/templates/db/migrate/create_surveys.rb +4 -3
- data/lib/generators/surveyor/templates/db/migrate/create_validation_conditions.rb +5 -4
- data/lib/generators/surveyor/templates/db/migrate/create_validations.rb +3 -2
- data/lib/generators/surveyor/templates/db/migrate/drop_unique_index_on_access_code_in_surveys.rb +10 -0
- data/lib/generators/surveyor/templates/db/migrate/update_blank_api_ids_on_question_group.rb +22 -0
- data/lib/generators/surveyor/templates/db/migrate/update_blank_versions_on_surveys.rb +13 -0
- data/lib/generators/surveyor/templates/surveys/date_survey.rb +1 -0
- data/lib/generators/surveyor/templates/surveys/kitchen_sink_survey.rb +54 -24
- data/lib/generators/surveyor/templates/surveys/quiz.rb +1 -0
- data/lib/generators/surveyor/templates/{public/stylesheets/sass → vendor/assets/stylesheets}/custom.sass +1 -1
- data/lib/surveyor/common.rb +16 -31
- data/lib/surveyor/engine.rb +2 -4
- data/lib/surveyor/helpers/asset_pipeline.rb +13 -0
- data/lib/surveyor/helpers/formtastic_custom_input.rb +17 -0
- data/lib/surveyor/helpers/surveyor_helper_methods.rb +10 -8
- data/lib/surveyor/models/answer_methods.rb +3 -0
- data/lib/surveyor/models/dependency_condition_methods.rb +27 -28
- data/lib/surveyor/models/dependency_methods.rb +3 -0
- data/lib/surveyor/models/question_group_methods.rb +3 -0
- data/lib/surveyor/models/question_methods.rb +10 -7
- data/lib/surveyor/models/response_methods.rb +16 -0
- data/lib/surveyor/models/response_set_methods.rb +71 -64
- data/lib/surveyor/models/survey_methods.rb +19 -28
- data/lib/surveyor/models/survey_section_methods.rb +3 -0
- data/lib/surveyor/models/validation_condition_methods.rb +4 -2
- data/lib/surveyor/models/validation_methods.rb +3 -0
- data/lib/surveyor/parser.rb +198 -148
- data/lib/surveyor/redcap_parser.rb +120 -80
- data/lib/surveyor/surveyor_controller_methods.rb +86 -37
- data/lib/surveyor/version.rb +2 -2
- data/lib/surveyor.rb +5 -6
- data/lib/tasks/surveyor_tasks.rake +19 -7
- data/spec/controllers/surveyor_controller_spec.rb +166 -92
- data/spec/factories.rb +33 -32
- data/spec/helpers/formtastic_custom_input_spec.rb +16 -0
- data/spec/lib/common_spec.rb +0 -39
- data/spec/lib/redcap_parser_spec.rb +24 -24
- data/spec/models/answer_spec.rb +12 -0
- data/spec/models/dependency_condition_spec.rb +279 -323
- data/spec/models/dependency_spec.rb +10 -0
- data/spec/models/question_group_spec.rb +12 -0
- data/spec/models/question_spec.rb +12 -0
- data/spec/models/response_set_spec.rb +189 -139
- data/spec/models/response_spec.rb +60 -0
- data/spec/models/survey_section_spec.rb +9 -0
- data/spec/models/survey_spec.rb +72 -9
- data/spec/models/validation_condition_spec.rb +9 -1
- data/spec/models/validation_spec.rb +10 -0
- data/spec/spec_helper.rb +25 -6
- data/surveyor.gemspec +5 -4
- metadata +332 -291
- data/features/step_definitions/common_steps.rb +0 -3
- data/lib/formtastic/surveyor_builder.rb +0 -82
- data/lib/generators/surveyor/templates/public/javascripts/surveyor/jquery.blockUI.js +0 -499
@@ -2,7 +2,8 @@ Feature: Survey parser
|
|
2
2
|
As a developer
|
3
3
|
I want to write out the survey in the DSL
|
4
4
|
So that I can give it to survey participants
|
5
|
-
|
5
|
+
|
6
|
+
@focus
|
6
7
|
Scenario: Parsing basic questions
|
7
8
|
Given I parse
|
8
9
|
"""
|
@@ -89,7 +90,7 @@ Feature: Survey parser
|
|
89
90
|
a :string
|
90
91
|
end
|
91
92
|
end
|
92
|
-
end
|
93
|
+
end
|
93
94
|
"""
|
94
95
|
Then there should be 1 survey with:
|
95
96
|
| title |
|
@@ -113,17 +114,17 @@ Feature: Survey parser
|
|
113
114
|
section "Conditionals" do
|
114
115
|
q_montypython3 "What... is your name? (e.g. It is 'Arthur', King of the Britons)"
|
115
116
|
a_1 :string
|
116
|
-
|
117
|
+
|
117
118
|
q_montypython4 "What... is your quest? (e.g. To seek the Holy Grail)"
|
118
119
|
a_1 :string
|
119
120
|
dependency :rule => "A"
|
120
121
|
condition_A :q_montypython3, "==", {:string_value => "It is 'Arthur', King of the Britons", :answer_reference => "1"}
|
121
|
-
|
122
|
+
|
122
123
|
q "How many pets do you own?"
|
123
124
|
a :integer
|
124
125
|
validation :rule => "A"
|
125
126
|
condition_A ">=", :integer_value => 0
|
126
|
-
|
127
|
+
|
127
128
|
q "What is your address?", :custom_class => 'address'
|
128
129
|
a :text, :custom_class => 'mapper'
|
129
130
|
validation :rule => "AC"
|
@@ -170,38 +171,38 @@ Feature: Survey parser
|
|
170
171
|
"""
|
171
172
|
survey "dependency test" do
|
172
173
|
section "section 1" do
|
173
|
-
|
174
|
+
|
174
175
|
q_copd_sh_1 "Have you ever smoked cigarettes?",:pick=>:one,:help_text=>"NO means less than 20 packs of cigarettes or 12 oz. of tobacco in a lifetime or less than 1 cigarette a day for 1 year."
|
175
176
|
a_1 "Yes"
|
176
177
|
a_2 "No"
|
177
|
-
|
178
|
+
|
178
179
|
q_copd_sh_1a "How old were you when you first started smoking cigarettes?", :help_text=>"age in years"
|
179
180
|
a :integer
|
180
181
|
dependency :rule => "A"
|
181
182
|
condition_A :q_copd_sh_1, "==", :a_1
|
182
|
-
|
183
|
+
|
183
184
|
q_copd_sh_1b "Do you currently smoke cigarettes?",:pick=>:one, :help_text=>"as of 1 month ago"
|
184
185
|
a_1 "Yes"
|
185
186
|
a_2 "No"
|
186
187
|
dependency :rule => "B"
|
187
188
|
condition_B :q_copd_sh_1, "==", :a_1
|
188
|
-
|
189
|
+
|
189
190
|
q_copd_sh_1c "On the average of the entire time you smoked, how many cigarettes did you smoke per day?"
|
190
191
|
a :integer
|
191
192
|
dependency :rule => "C"
|
192
193
|
condition_C :q_copd_sh_1, "==", :a_1
|
193
|
-
|
194
|
+
|
194
195
|
q_copd_sh_1bb "How many cigarettes do you smoke per day now?"
|
195
196
|
a_2 "integer"
|
196
197
|
dependency :rule => "D"
|
197
198
|
condition_D :q_copd_sh_1b, "==", :a_1
|
198
|
-
|
199
|
-
|
199
|
+
|
200
|
+
|
200
201
|
q_copd_sh_1ba "How old were you when you stopped?"
|
201
202
|
a "Years", :integer
|
202
203
|
dependency :rule => "E"
|
203
204
|
condition_E :q_copd_sh_1b, "==", :a_2
|
204
|
-
|
205
|
+
|
205
206
|
end
|
206
207
|
end
|
207
208
|
"""
|
@@ -210,7 +211,7 @@ Feature: Survey parser
|
|
210
211
|
And question "copd_sh_1ba" should have a dependency with rule "E"
|
211
212
|
|
212
213
|
Scenario: Parsing dependencies on questions inside of a group
|
213
|
-
Given
|
214
|
+
Given I parse
|
214
215
|
"""
|
215
216
|
survey "Phone Screen Questions" do
|
216
217
|
section "Phone Screen" do
|
@@ -222,7 +223,7 @@ Feature: Survey parser
|
|
222
223
|
a_yes "Yes"
|
223
224
|
a_no "No"
|
224
225
|
|
225
|
-
group do
|
226
|
+
group do
|
226
227
|
dependency :rule => "A"
|
227
228
|
condition_A :q_diabetes, "==", :a_yes
|
228
229
|
label "It looks like you are not eligible for this specific study at the time"
|
@@ -248,9 +249,9 @@ Feature: Survey parser
|
|
248
249
|
Then there should be 4 dependencies
|
249
250
|
And 2 dependencies should depend on questions
|
250
251
|
And 2 dependencies should depend on question groups
|
251
|
-
|
252
|
+
|
252
253
|
Scenario: Parsing dependencies with "a"
|
253
|
-
Given
|
254
|
+
Given I parse
|
254
255
|
"""
|
255
256
|
survey "Dependencies with 'a'" do
|
256
257
|
section "First" do
|
@@ -272,9 +273,9 @@ Feature: Survey parser
|
|
272
273
|
And there should be 1 resolved dependency_condition with:
|
273
274
|
| rule_key |
|
274
275
|
| A |
|
275
|
-
|
276
|
+
|
276
277
|
Scenario: Parsing dependencies with "q"
|
277
|
-
Given
|
278
|
+
Given I parse
|
278
279
|
"""
|
279
280
|
survey "Dependencies with 'q'" do
|
280
281
|
section "First" do
|
@@ -295,4 +296,97 @@ Feature: Survey parser
|
|
295
296
|
| A |
|
296
297
|
And there should be 1 resolved dependency_condition with:
|
297
298
|
| rule_key |
|
298
|
-
| A |
|
299
|
+
| A |
|
300
|
+
|
301
|
+
@quiz
|
302
|
+
Scenario: Parsing a quiz
|
303
|
+
Given I parse
|
304
|
+
"""
|
305
|
+
survey "Quiz time" do
|
306
|
+
section "First" do
|
307
|
+
q_the_answer "What is the 'Answer to the Ultimate Question of Life, The Universe, and Everything'", :correct => "adams"
|
308
|
+
a_pi "3.14"
|
309
|
+
a_zero "0"
|
310
|
+
a_adams "42"
|
311
|
+
end
|
312
|
+
end
|
313
|
+
"""
|
314
|
+
Then the question "the_answer" should have correct answer "adams"
|
315
|
+
|
316
|
+
@quiz
|
317
|
+
Scenario: Parsing a quiz for #365
|
318
|
+
Given I parse
|
319
|
+
"""
|
320
|
+
survey "Arithmetic" do
|
321
|
+
section "Addtion" do
|
322
|
+
q_1 "What is one plus one?", :pick => :one, :correct => "2"
|
323
|
+
a_1 "1"
|
324
|
+
a_2 "2"
|
325
|
+
a_3 "3"
|
326
|
+
a_4 "4"
|
327
|
+
|
328
|
+
q_2 "What is five plus one?", :pick => :one, :correct => "6"
|
329
|
+
a_5 "five"
|
330
|
+
a_6 "six"
|
331
|
+
a_7 "seven"
|
332
|
+
a_8 "eight"
|
333
|
+
end
|
334
|
+
end
|
335
|
+
"""
|
336
|
+
Then the question "1" should have correct answer "2"
|
337
|
+
Then the question "2" should have correct answer "6"
|
338
|
+
|
339
|
+
Scenario: Parsing typos in blocks
|
340
|
+
Given the survey
|
341
|
+
"""
|
342
|
+
survey "Basics" do
|
343
|
+
sectionals "Typo" do
|
344
|
+
end
|
345
|
+
end
|
346
|
+
|
347
|
+
"""
|
348
|
+
Then the parser should fail with "Dropping the Sectionals block like it's hot!"
|
349
|
+
|
350
|
+
Scenario: Parsing bad references
|
351
|
+
Given the survey
|
352
|
+
"""
|
353
|
+
survey "Refs" do
|
354
|
+
section "Bad" do
|
355
|
+
q_watch "Do you watch football?", :pick => :one
|
356
|
+
a_1 "Yes"
|
357
|
+
a_2 "No"
|
358
|
+
|
359
|
+
q "Do you like the replacement refs?", :pick => :one
|
360
|
+
dependency :rule => "A or B"
|
361
|
+
condition_A :q_1, "==", :a_1
|
362
|
+
condition_B :q_watch, "==", :b_1
|
363
|
+
a "Yes"
|
364
|
+
a "No"
|
365
|
+
end
|
366
|
+
end
|
367
|
+
|
368
|
+
"""
|
369
|
+
Then the parser should fail with "Bad references: q_1; q_1, a_1; q_watch, a_b_1"
|
370
|
+
|
371
|
+
Scenario: Parsing repeated references
|
372
|
+
Given the survey
|
373
|
+
"""
|
374
|
+
survey "Refs" do
|
375
|
+
section "Bad" do
|
376
|
+
q_watch "Do you watch football?", :pick => :one
|
377
|
+
a_1 "Yes"
|
378
|
+
a_1 "No"
|
379
|
+
|
380
|
+
q_watch "Do you watch baseball?", :pick => :one
|
381
|
+
a_yes "Yes"
|
382
|
+
a_no "No"
|
383
|
+
|
384
|
+
q "Do you like the replacement refs?", :pick => :one
|
385
|
+
dependency :rule => "A or B"
|
386
|
+
condition_A :q_watch, "==", :a_1
|
387
|
+
a "Yes"
|
388
|
+
a "No"
|
389
|
+
end
|
390
|
+
end
|
391
|
+
"""
|
392
|
+
Then the parser should fail with "Duplicate references: q_watch, a_1; q_watch"
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# The redcap parser feature should run last. If it runs in between other features that use the surveyor parser,
|
2
2
|
# it causes the DependencyCondition before_save :resolve_references hook to stop running, causing hard to trace failures.
|
3
|
-
|
4
3
|
Feature: Survey import from REDCap
|
5
4
|
As a developer
|
6
5
|
I want to write out the survey in the DSL
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
Binary file
|
File without changes
|
File without changes
|
File without changes
|
@@ -3,12 +3,12 @@
|
|
3
3
|
* By: Trent Richardson [http://trentrichardson.com]
|
4
4
|
* Version 0.9.7
|
5
5
|
* Last Modified: 10/02/2011
|
6
|
-
*
|
6
|
+
*
|
7
7
|
* Copyright 2011 Trent Richardson
|
8
8
|
* Dual licensed under the MIT and GPL licenses.
|
9
9
|
* http://trentrichardson.com/Impromptu/GPL-LICENSE.txt
|
10
10
|
* http://trentrichardson.com/Impromptu/MIT-LICENSE.txt
|
11
|
-
*
|
11
|
+
*
|
12
12
|
* HERES THE CSS:
|
13
13
|
* .ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }
|
14
14
|
* .ui-timepicker-div dl { text-align: left; }
|
@@ -131,7 +131,7 @@ $.extend(Timepicker.prototype, {
|
|
131
131
|
_newInst: function($input, o) {
|
132
132
|
var tp_inst = new Timepicker(),
|
133
133
|
inlineSettings = {};
|
134
|
-
|
134
|
+
|
135
135
|
for (var attrName in this._defaults) {
|
136
136
|
var attrValue = $input.attr('time:' + attrName);
|
137
137
|
if (attrValue) {
|
@@ -186,7 +186,7 @@ $.extend(Timepicker.prototype, {
|
|
186
186
|
tp_inst.$altInput = $(o.altField)
|
187
187
|
.css({ cursor: 'pointer' })
|
188
188
|
.focus(function(){ $input.trigger("focus"); });
|
189
|
-
|
189
|
+
|
190
190
|
if(tp_inst._defaults.minDate==0 || tp_inst._defaults.minDateTime==0)
|
191
191
|
{
|
192
192
|
tp_inst._defaults.minDate=new Date();
|
@@ -195,7 +195,7 @@ $.extend(Timepicker.prototype, {
|
|
195
195
|
{
|
196
196
|
tp_inst._defaults.maxDate=new Date();
|
197
197
|
}
|
198
|
-
|
198
|
+
|
199
199
|
// datepicker needs minDate/maxDate, timepicker needs minDateTime/maxDateTime..
|
200
200
|
if(tp_inst._defaults.minDate !== undefined && tp_inst._defaults.minDate instanceof Date)
|
201
201
|
tp_inst._defaults.minDateTime = new Date(tp_inst._defaults.minDate.getTime());
|
@@ -213,7 +213,7 @@ $.extend(Timepicker.prototype, {
|
|
213
213
|
//########################################################################
|
214
214
|
_addTimePicker: function(dp_inst) {
|
215
215
|
var currDT = (this.$altInput && this._defaults.altFieldTimeOnly) ?
|
216
|
-
this.$input.val() + ' ' + this.$altInput.val() :
|
216
|
+
this.$input.val() + ' ' + this.$altInput.val() :
|
217
217
|
this.$input.val();
|
218
218
|
|
219
219
|
this.timeDefined = this._parseTime(currDT);
|
@@ -247,7 +247,7 @@ $.extend(Timepicker.prototype, {
|
|
247
247
|
var specials = new RegExp("[.*+?|()\\[\\]{}\\\\]", "g");
|
248
248
|
regstr = '.{' + dp_dateFormat.length + ',}' + this._defaults.separator.replace(specials, "\\$&") + regstr;
|
249
249
|
}
|
250
|
-
|
250
|
+
|
251
251
|
treg = timeString.match(new RegExp(regstr, 'i'));
|
252
252
|
|
253
253
|
if (treg) {
|
@@ -295,7 +295,7 @@ $.extend(Timepicker.prototype, {
|
|
295
295
|
}
|
296
296
|
this.timezone = tz;
|
297
297
|
}
|
298
|
-
|
298
|
+
|
299
299
|
return true;
|
300
300
|
|
301
301
|
}
|
@@ -749,7 +749,7 @@ $.extend(Timepicker.prototype, {
|
|
749
749
|
|
750
750
|
},
|
751
751
|
|
752
|
-
|
752
|
+
|
753
753
|
//########################################################################
|
754
754
|
// when a slider moves, set the internal time...
|
755
755
|
// on time change is also called when the time is updated in the text field
|
@@ -782,7 +782,7 @@ $.extend(Timepicker.prototype, {
|
|
782
782
|
|| (this.ampm.length > 0
|
783
783
|
&& (hour < 12) != ($.inArray(this.ampm.toUpperCase(), this.amNames) !== -1))
|
784
784
|
|| timezone != this.timezone);
|
785
|
-
|
785
|
+
|
786
786
|
if (hasChanged) {
|
787
787
|
|
788
788
|
if (hour !== false)this.hour = hour;
|
@@ -790,21 +790,21 @@ $.extend(Timepicker.prototype, {
|
|
790
790
|
if (second !== false) this.second = second;
|
791
791
|
if (millisec !== false) this.millisec = millisec;
|
792
792
|
if (timezone !== false) this.timezone = timezone;
|
793
|
-
|
793
|
+
|
794
794
|
if (!this.inst) this.inst = $.datepicker._getInst(this.$input[0]);
|
795
|
-
|
795
|
+
|
796
796
|
this._limitMinMaxDateTime(this.inst, true);
|
797
797
|
}
|
798
798
|
if (o.ampm) this.ampm = ampm;
|
799
|
-
|
799
|
+
|
800
800
|
this._formatTime();
|
801
801
|
if (this.$timeObj) this.$timeObj.text(this.formattedTime + o.timeSuffix);
|
802
802
|
this.timeDefined = true;
|
803
803
|
if (hasChanged) this._updateDateTime();
|
804
804
|
},
|
805
|
-
|
805
|
+
|
806
806
|
//########################################################################
|
807
|
-
// call custom onSelect.
|
807
|
+
// call custom onSelect.
|
808
808
|
// bind to sliders slidestop, and grid click.
|
809
809
|
//########################################################################
|
810
810
|
_onSelectHandler: function() {
|
@@ -888,7 +888,7 @@ $.extend(Timepicker.prototype, {
|
|
888
888
|
} else {
|
889
889
|
this.$input.val(formattedDateTime);
|
890
890
|
}
|
891
|
-
|
891
|
+
|
892
892
|
this.$input.trigger("change");
|
893
893
|
}
|
894
894
|
|
@@ -918,9 +918,9 @@ $.fn.extend({
|
|
918
918
|
tmp_args = arguments;
|
919
919
|
|
920
920
|
if (typeof(o) == 'string'){
|
921
|
-
if(o == 'getDate')
|
921
|
+
if(o == 'getDate')
|
922
922
|
return $.fn.datepicker.apply($(this[0]), tmp_args);
|
923
|
-
else
|
923
|
+
else
|
924
924
|
return this.each(function() {
|
925
925
|
var $t = $(this);
|
926
926
|
$t.datepicker.apply($t, tmp_args);
|
@@ -972,9 +972,9 @@ $.datepicker._updateDatepicker = function(inst) {
|
|
972
972
|
}
|
973
973
|
|
974
974
|
if (typeof(inst.stay_open) !== 'boolean' || inst.stay_open === false) {
|
975
|
-
|
975
|
+
|
976
976
|
this._base_updateDatepicker(inst);
|
977
|
-
|
977
|
+
|
978
978
|
// Reload the time control when changing something in the input text field.
|
979
979
|
var tp_inst = this._get(inst, 'timepicker');
|
980
980
|
if(tp_inst) tp_inst._addTimePicker(inst);
|
@@ -1012,7 +1012,7 @@ $.datepicker._doKeyPress = function(event) {
|
|
1012
1012
|
return event.ctrlKey || (chr < ' ' || !dateChars || datetimeChars.indexOf(chr) > -1);
|
1013
1013
|
}
|
1014
1014
|
}
|
1015
|
-
|
1015
|
+
|
1016
1016
|
return $.datepicker._base_doKeyPress(event);
|
1017
1017
|
};
|
1018
1018
|
|
@@ -1205,7 +1205,7 @@ $.datepicker._formatDate = function(inst, day, month, year){
|
|
1205
1205
|
{
|
1206
1206
|
if(day)
|
1207
1207
|
var b = this._base_formatDate(inst, day, month, year);
|
1208
|
-
tp_inst._updateDateTime();
|
1208
|
+
tp_inst._updateDateTime();
|
1209
1209
|
return tp_inst.$input.val();
|
1210
1210
|
}
|
1211
1211
|
return this._base_formatDate(inst);
|
@@ -1242,7 +1242,7 @@ $.datepicker._optionDatepicker = function(target, name, value) {
|
|
1242
1242
|
min=new Date();
|
1243
1243
|
else
|
1244
1244
|
min= new Date(min);
|
1245
|
-
|
1245
|
+
|
1246
1246
|
tp_inst._defaults.minDate = min;
|
1247
1247
|
tp_inst._defaults.minDateTime = min;
|
1248
1248
|
} else if (max){ //if max was set
|