appointments 1.0.4 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/generators/templates/appointment.js +110 -0
- metadata +3 -4
- data/README.txt +0 -57
@@ -0,0 +1,110 @@
|
|
1
|
+
$(function () {
|
2
|
+
$('#appointment_form').hide();
|
3
|
+
$('#hour_picker').hide();
|
4
|
+
$('#hidden_hour_div').hide();
|
5
|
+
$('#cal_previous2').hide();
|
6
|
+
});
|
7
|
+
|
8
|
+
function findHours(current_date){
|
9
|
+
$.ajax({
|
10
|
+
type: "POST",
|
11
|
+
url: "match_dates",
|
12
|
+
cache: false,
|
13
|
+
data: {matched_date:current_date},
|
14
|
+
success: function(html){
|
15
|
+
var hours_array = [];
|
16
|
+
$("#hidden_hour_div").append(html);
|
17
|
+
var hours_string = $("#hidden_hour_div").html()
|
18
|
+
var one = hours_string.substring(2, 6);
|
19
|
+
var two = hours_string.substring(10, 14);
|
20
|
+
var three = hours_string.substring(18, 22);
|
21
|
+
var four = hours_string.substring(26, 30);
|
22
|
+
var five = hours_string.substring(34, 38);
|
23
|
+
var six = hours_string.substring(42, 46);
|
24
|
+
var seven = hours_string.substring(50, 54);
|
25
|
+
var eight = hours_string.substring(58, 62);
|
26
|
+
var nine = hours_string.substring(66, 70);
|
27
|
+
var ten = hours_string.substring(74, 78);
|
28
|
+
var eleven = hours_string.substring(82, 86);
|
29
|
+
var twelve = hours_string.substring(90, 94);
|
30
|
+
hours_array.push(one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve);
|
31
|
+
for (var j in hours_array) {
|
32
|
+
(final_array = '\.'+ hours_array[j]);
|
33
|
+
$(final_array).hide();
|
34
|
+
}
|
35
|
+
}
|
36
|
+
});
|
37
|
+
}
|
38
|
+
|
39
|
+
var disabledDays = [];
|
40
|
+
|
41
|
+
$(function () {
|
42
|
+
|
43
|
+
$('.schedules_dates').map(function () {
|
44
|
+
disabledDays.push(this.id);
|
45
|
+
}).get().join(',');
|
46
|
+
|
47
|
+
});
|
48
|
+
|
49
|
+
function unavailableDays(date) {
|
50
|
+
var y = date.getFullYear(),
|
51
|
+
m = date.getMonth(),
|
52
|
+
d = date.getDate();
|
53
|
+
if ($.inArray(y + '-' + (m + 1) + '-' + d, disabledDays) != -1 || new Date() > date) {
|
54
|
+
return [false];
|
55
|
+
}
|
56
|
+
return [true];
|
57
|
+
}
|
58
|
+
|
59
|
+
$(function () {
|
60
|
+
var currentTime = new Date()
|
61
|
+
var month = currentTime.getMonth()
|
62
|
+
var day = currentTime.getDate()
|
63
|
+
var year = currentTime.getFullYear()
|
64
|
+
|
65
|
+
$("#datepicker").datepicker({
|
66
|
+
minDate: new Date(year, month, day),
|
67
|
+
dateFormat: 'yy-mm-dd',
|
68
|
+
onSelect: function(dateText, inst) {
|
69
|
+
setFinalDate = dateText;
|
70
|
+
$('#hour_picker').show();
|
71
|
+
$('#datepicker').hide();
|
72
|
+
findHours(setFinalDate);
|
73
|
+
$("th.selected_date").append("Date Chosen:" + " " + (setFinalDate));
|
74
|
+
pageNo = '2';
|
75
|
+
}
|
76
|
+
|
77
|
+
});
|
78
|
+
});
|
79
|
+
|
80
|
+
|
81
|
+
function nextPage(hour, id){
|
82
|
+
setFinalHour = hour;
|
83
|
+
if (setFinalHour == null || setFinalHour == "") return false;
|
84
|
+
else {
|
85
|
+
$('#hour_picker').hide();
|
86
|
+
$("#appointment_form").show();
|
87
|
+
document.getElementById('schedules_date').value = setFinalDate;
|
88
|
+
document.getElementById('schedules_hour').value = setFinalHour;
|
89
|
+
$('#cal_previous2').show();
|
90
|
+
document.getElementById('subData').style.display = 'block'
|
91
|
+
$('#final_date h2').append(setFinalDate);
|
92
|
+
$('#final_hour h2').append(id);
|
93
|
+
pageNo = '3';
|
94
|
+
return true;
|
95
|
+
}
|
96
|
+
|
97
|
+
}
|
98
|
+
|
99
|
+
function prevPage() {
|
100
|
+
|
101
|
+
if (pageNo === '3') {
|
102
|
+
setFinalHour = "";
|
103
|
+
$('#appointment_form').hide();
|
104
|
+
$("#hour_picker").show();
|
105
|
+
$('#cal_previous2').hide();
|
106
|
+
$('#final_date h2').empty();
|
107
|
+
$('#final_hour h2').empty();
|
108
|
+
pageNo = '2'
|
109
|
+
}
|
110
|
+
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appointments
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,13 +11,12 @@ bindir: bin
|
|
11
11
|
cert_chain: []
|
12
12
|
date: 2012-02-18 00:00:00.000000000Z
|
13
13
|
dependencies: []
|
14
|
-
description:
|
14
|
+
description: Schedule appointments with Rails 3 and the jQuery-UI
|
15
15
|
email: mleveton@prepcloud.com
|
16
16
|
executables: []
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
|
-
- README.txt
|
21
20
|
- bin/appointments
|
22
21
|
- lib/appointments.rb
|
23
22
|
- lib/generators/install_generators.rb
|
@@ -65,6 +64,6 @@ rubyforge_project:
|
|
65
64
|
rubygems_version: 1.8.8
|
66
65
|
signing_key:
|
67
66
|
specification_version: 3
|
68
|
-
summary:
|
67
|
+
summary: Schedule appointments with Rails 3 and the jQuery-UI
|
69
68
|
test_files:
|
70
69
|
- test/test_appointments.rb
|
data/README.txt
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
= appointments
|
2
|
-
|
3
|
-
* FIX (url)
|
4
|
-
|
5
|
-
== DESCRIPTION:
|
6
|
-
|
7
|
-
FIX (describe your package)
|
8
|
-
|
9
|
-
== FEATURES/PROBLEMS:
|
10
|
-
|
11
|
-
* FIX (list of features or problems)
|
12
|
-
|
13
|
-
== SYNOPSIS:
|
14
|
-
|
15
|
-
FIX (code sample of usage)
|
16
|
-
|
17
|
-
== REQUIREMENTS:
|
18
|
-
|
19
|
-
* FIX (list of requirements)
|
20
|
-
|
21
|
-
== INSTALL:
|
22
|
-
|
23
|
-
* FIX (sudo gem install, anything else)
|
24
|
-
|
25
|
-
== DEVELOPERS:
|
26
|
-
|
27
|
-
After checking out the source, run:
|
28
|
-
|
29
|
-
$ rake newb
|
30
|
-
|
31
|
-
This task will install any missing dependencies, run the tests/specs,
|
32
|
-
and generate the RDoc.
|
33
|
-
|
34
|
-
== LICENSE:
|
35
|
-
|
36
|
-
(The MIT License)
|
37
|
-
|
38
|
-
Copyright (c) 2012 FIX
|
39
|
-
|
40
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
41
|
-
a copy of this software and associated documentation files (the
|
42
|
-
'Software'), to deal in the Software without restriction, including
|
43
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
44
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
45
|
-
permit persons to whom the Software is furnished to do so, subject to
|
46
|
-
the following conditions:
|
47
|
-
|
48
|
-
The above copyright notice and this permission notice shall be
|
49
|
-
included in all copies or substantial portions of the Software.
|
50
|
-
|
51
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
52
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
53
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
54
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
55
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
56
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
57
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|