My Calendar - Version 2.3.32

Version Description

  • Bug fix: end time for events auto-toggled to midnight, instead of +1 hour when end time omitted.
Download this release

Release Info

Developer joedolson
Plugin Icon 128x128 My Calendar
Version 2.3.32
Comparing to
See all releases

Code changes from version 2.3.0 to 2.3.32

Files changed (148) hide show
  1. css/mc-admin.css +15 -3
  2. css/mc-print.css +80 -13
  3. css/mc-styles.css +539 -104
  4. css/reset.css +69 -2
  5. includes/date-utilities.php +189 -141
  6. js/ajax.js +33 -0
  7. js/color-picker.js +1 -1
  8. js/gmap3.min.js +1921 -1
  9. js/jquery.addfields.js +53 -53
  10. js/jquery.checkall.js +8 -8
  11. js/mc-ajax.js +36 -0
  12. js/mc-grid.js +18 -0
  13. js/mc-list.js +18 -0
  14. js/mc-mini.js +16 -0
  15. js/mc-quicktags.js +1 -1
  16. js/pickadate/legacy.js +32 -2
  17. js/pickadate/picker.date.js +300 -1
  18. js/pickadate/picker.js +173 -1
  19. js/pickadate/picker.time.js +212 -1
  20. js/pickadate/themes/classic.css +86 -2
  21. js/pickadate/themes/classic.date.css +263 -1
  22. js/pickadate/themes/classic.time.css +104 -1
  23. js/pickadate/themes/default.css +146 -2
  24. js/pickadate/themes/default.date.css +263 -1
  25. js/pickadate/themes/default.time.css +101 -1
  26. js/pickadate/themes/rtl.css +24 -1
  27. js/pickadate/translations/ar.js +10 -1
  28. js/pickadate/translations/bg_BG.js +11 -1
  29. js/pickadate/translations/bs_BA.js +11 -1
  30. js/pickadate/translations/ca_ES.js +11 -1
  31. js/pickadate/translations/cs_CZ.js +11 -1
  32. js/pickadate/translations/da_DK.js +11 -1
  33. js/pickadate/translations/de_DE.js +11 -1
  34. js/pickadate/translations/el_GR.js +11 -1
  35. js/pickadate/translations/es_ES.js +11 -1
  36. js/pickadate/translations/et_EE.js +11 -1
  37. js/pickadate/translations/eu_ES.js +11 -1
  38. js/pickadate/translations/fi_FI.js +11 -1
  39. js/pickadate/translations/fr_FR.js +11 -1
  40. js/pickadate/translations/gl_ES.js +11 -1
  41. js/pickadate/translations/he_IL.js +10 -1
  42. js/pickadate/translations/hr_HR.js +11 -1
  43. js/pickadate/translations/hu_HU.js +11 -1
  44. js/pickadate/translations/id_ID.js +11 -1
  45. js/pickadate/translations/is_IS.js +11 -1
  46. js/pickadate/translations/it_IT.js +11 -1
  47. js/pickadate/translations/ja_JP.js +11 -1
  48. js/pickadate/translations/ko_KR.js +11 -1
  49. js/pickadate/translations/nl_NL.js +11 -1
  50. js/pickadate/translations/no_NO.js +11 -1
  51. js/pickadate/translations/pl_PL.js +11 -1
  52. js/pickadate/translations/pt_BR.js +10 -1
  53. js/pickadate/translations/pt_PT.js +10 -1
  54. js/pickadate/translations/ro_RO.js +11 -1
  55. js/pickadate/translations/ru_RU.js +11 -1
  56. js/pickadate/translations/sk_SK.js +11 -1
  57. js/pickadate/translations/sl_SI.js +11 -1
  58. js/pickadate/translations/sv_SE.js +11 -1
  59. js/pickadate/translations/th_TH.js +10 -1
  60. js/pickadate/translations/tr_TR.js +11 -1
  61. js/pickadate/translations/uk_UA.js +11 -1
  62. js/pickadate/translations/zh_CN.js +11 -1
  63. js/pickadate/translations/zh_TW.js +11 -1
  64. js/sortable.js +17 -17
  65. js/tabs.js +14 -14
  66. js/upload.js +51 -50
  67. lang/my-calendar-af.mo +0 -0
  68. lang/my-calendar-ca.mo +0 -0
  69. lang/my-calendar-cs_CZ.mo +0 -0
  70. lang/my-calendar-cs_CZ.po +0 -3087
  71. lang/my-calendar-da_DK.mo +0 -0
  72. lang/my-calendar-da_DK.po +0 -3087
  73. lang/my-calendar-de_DE.mo +0 -0
  74. lang/my-calendar-de_DE.po +0 -3611
  75. lang/my-calendar-es_ES.mo +0 -0
  76. lang/my-calendar-es_ES.po +0 -3404
  77. lang/my-calendar-eu.po +0 -3404
  78. lang/my-calendar-fi.mo +0 -0
  79. lang/my-calendar-fi.po +0 -1071
  80. lang/my-calendar-fr_FR.mo +0 -0
  81. lang/my-calendar-fr_FR.po +0 -3615
  82. lang/my-calendar-gl_ES.po +0 -4023
  83. lang/my-calendar-hi_IN.po +0 -3842
  84. lang/my-calendar-hu_HU.mo +0 -0
  85. lang/my-calendar-is_IS.mo +0 -0
  86. lang/my-calendar-it_IT.mo +0 -0
  87. lang/my-calendar-it_IT.po +0 -3611
  88. lang/my-calendar-ja.mo +0 -0
  89. lang/my-calendar-ja.po +0 -3611
  90. lang/my-calendar-nb_NO.mo +0 -0
  91. lang/my-calendar-nl.po +0 -3408
  92. lang/my-calendar-nl_NL.mo +0 -0
  93. lang/my-calendar-nl_NL.po +0 -3620
  94. lang/my-calendar-pl_PL.mo +0 -0
  95. lang/my-calendar-pl_PL.po +0 -3422
  96. lang/my-calendar-pt_BR.mo +0 -0
  97. lang/my-calendar-pt_BR.po +0 -3477
  98. lang/my-calendar-pt_PT.mo +0 -0
  99. lang/my-calendar-ro_RO.po +0 -3951
  100. lang/my-calendar-ru_RU.mo +0 -0
  101. lang/my-calendar-ru_RU.po +0 -3404
  102. lang/my-calendar-sk_SK.mo +0 -0
  103. lang/my-calendar-sl_SI.mo +0 -0
  104. lang/my-calendar-sl_SI.po +0 -3611
  105. lang/my-calendar-sv_SE.mo +0 -0
  106. lang/my-calendar-sv_SE.po +0 -3841
  107. lang/my-calendar-tr_TR.po +0 -3266
  108. lang/my-calendar-uk.mo +0 -0
  109. lang/my-calendar.pot +174 -189
  110. my-calendar-api.php +204 -37
  111. my-calendar-behaviors.php +126 -180
  112. my-calendar-categories.php +336 -244
  113. my-calendar-core.php +1282 -932
  114. my-calendar-event-manager.php +1778 -1294
  115. my-calendar-events.php +353 -191
  116. my-calendar-export.php +0 -136
  117. my-calendar-generator.php +180 -134
  118. my-calendar-group-manager.php +935 -651
  119. my-calendar-help.php +376 -309
  120. my-calendar-ical.php +40 -30
  121. my-calendar-install.php +268 -289
  122. my-calendar-limits.php +266 -198
  123. my-calendar-locations.php +367 -266
  124. my-calendar-output.php +1423 -1075
  125. my-calendar-settings.php +789 -644
  126. my-calendar-shortcodes.php +109 -88
  127. my-calendar-styles.php +237 -179
  128. my-calendar-templates.php +464 -288
  129. my-calendar-templating.php +196 -145
  130. my-calendar-upgrade-db.php +59 -46
  131. my-calendar-widgets.php +644 -448
  132. my-calendar.php +354 -278
  133. readme.txt +321 -25
  134. styles/dark.css +444 -152
  135. styles/inherit.css +220 -140
  136. styles/light.css +334 -173
  137. styles/my-calendar.css +347 -189
  138. styles/refresh.css +457 -147
  139. styles/twentyfifteen.css +477 -0
  140. styles/twentyfourteen.css +444 -84
  141. templates/dark.css +444 -152
  142. templates/inherit.css +220 -140
  143. templates/light.css +334 -173
  144. templates/my-calendar.css +344 -189
  145. templates/refresh.css +457 -147
  146. templates/twentyfifteen.css +477 -0
  147. templates/twentyfourteen.css +444 -84
  148. uninstall.php +78 -74
css/mc-admin.css CHANGED
@@ -1,3 +1,15 @@
1
- .mc_edit_links {font-size: .9em;margin: 5px -5px -5px;padding: 2px;clear: both;border-top: 1px solid #ddd;}
2
- .mc_edit_links a { display: inline!important; }
3
- .mini .mc_edit_links , .list .mc_edit_links { margin-bottom: 5px; }
1
+ .mc_edit_links {
2
+ font-size: .9em;
3
+ margin: 5px -5px -5px;
4
+ padding: 2px;
5
+ clear: both;
6
+ border-top: 1px solid #ddd;
7
+ }
8
+
9
+ .mc_edit_links a {
10
+ display: inline !important;
11
+ }
12
+
13
+ .mini .mc_edit_links, .list .mc_edit_links {
14
+ margin-bottom: 5px;
15
+ }
css/mc-print.css CHANGED
@@ -1,13 +1,80 @@
1
- .my-calendar-header, h3 img, .mc-toggle, .mc_edit_links, #mc-export,.longdesc, .shortdesc , .mc-print, form { display: none; }
2
- table { border: 1px solid #ddd; border-collapse: collapse; margin: 0 auto; width: 100%; }
3
- th { text-align:center; background: #f6f6f6; border: 1px solid #ddd; width: 130px; text-transform:uppercase; }
4
- td { border: 1px solid #ddd; font-size: 12px; vertical-align: top; width: 14.285%; }
5
- .details {border-bottom: 1px solid #ddd; color: #444; margin-bottom: 2px;}
6
- .details a, .details img { display: none; }
7
- h3 { font-size: 1.1em; margin: 2px 0 5px;}
8
- p {margin: 2px 0; padding: 1px 0; line-height: 1.2; }
9
- caption { font-size: 1.4em; padding: 3px 0; }
10
- abbr { border: none;}
11
- a { text-decoration: none; color: #f00}
12
- .mc-date { font-weight: 700; font-size: 1.2em; padding: 2px 4px; line-height: 1; margin-left: 3px; float: right; background: #f9f9f9; position: relative; top: -1px; right: -1px; border-left: 1px solid #ddd; border-bottom: 1px solid #ddd}
13
- .return { width: 910px; margin: 10px auto;}
1
+ .my-calendar-header, h3 img, .mc-toggle, .mc_edit_links, #mc-export, .longdesc, .shortdesc, .mc-print, form {
2
+ display: none;
3
+ }
4
+
5
+ table {
6
+ border: 1px solid #ddd;
7
+ border-collapse: collapse;
8
+ margin: 0 auto;
9
+ width: 100%;
10
+ }
11
+
12
+ th {
13
+ text-align: center;
14
+ background: #f6f6f6;
15
+ border: 1px solid #ddd;
16
+ width: 130px;
17
+ text-transform: uppercase;
18
+ }
19
+
20
+ td {
21
+ border: 1px solid #ddd;
22
+ font-size: 12px;
23
+ vertical-align: top;
24
+ width: 14.285%;
25
+ }
26
+
27
+ .details {
28
+ border-bottom: 1px solid #ddd;
29
+ color: #444;
30
+ margin-bottom: 2px;
31
+ }
32
+
33
+ .details a, .details img {
34
+ display: none;
35
+ }
36
+
37
+ h3 {
38
+ font-size: 1.1em;
39
+ margin: 2px 0 5px;
40
+ }
41
+
42
+ p {
43
+ margin: 2px 0;
44
+ padding: 1px 0;
45
+ line-height: 1.2;
46
+ }
47
+
48
+ caption {
49
+ font-size: 1.4em;
50
+ padding: 3px 0;
51
+ }
52
+
53
+ abbr {
54
+ border: none;
55
+ }
56
+
57
+ a {
58
+ text-decoration: none;
59
+ color: #f00
60
+ }
61
+
62
+ .mc-date {
63
+ font-weight: 700;
64
+ font-size: 1.2em;
65
+ padding: 2px 4px;
66
+ line-height: 1;
67
+ margin-left: 3px;
68
+ float: right;
69
+ background: #f9f9f9;
70
+ position: relative;
71
+ top: -1px;
72
+ right: -1px;
73
+ border-left: 1px solid #ddd;
74
+ border-bottom: 1px solid #ddd
75
+ }
76
+
77
+ .return {
78
+ width: 910px;
79
+ margin: 10px auto;
80
+ }
css/mc-styles.css CHANGED
@@ -1,110 +1,545 @@
1
- #my-calendar legend {font-weight: 700;font-size: 1em}
2
- .mcbuy, .mcsbuy {font-size: 1.1em; line-height: 1.5}
3
- .mc-button { text-align: center; font-size: 1.4em; padding: 10px 0 0}
4
- .mc-button a { padding: 3px 8px; border: 1px solid; border-radius: 5px; background: #fff}
5
- .mcd { text-align: center; margin: 0; }
6
- #cat_icon option {padding: 5px 0 5px 24px}
7
- #my-calendar-admin-table .delete {color: #c00}
8
- .import {background: #ffa;padding: 5px 10px;border: 1px solid #aaa;border-radius: 5px;margin: 15px 0}
9
- .n4 {width: 42px}
10
- .category-color {width: 1.2em;height: 1.2em;display: inline-block;border-radius: 3px;border: 1px solid #000}
11
- .jd-my-calendar .postbox h3 {cursor: text}
12
- .active-link {font-weight:700;text-decoration: underline}
13
- ul.links li {float: left;margin: 0 5px 10px;font-size: .9em}
14
- #toggle {height: 2em}
15
- #toggle li {float: left;margin-right: 5px}
16
- .jd-my-calendar .spam {background: #ffa}
17
- .jd-my-calendar .pending { background: #eee}
18
- .jd-my-calendar .pending td {color: #666}
19
- .jd-my-calendar fieldset fieldset {margin: 0 0 20px 0;padding-top: 2px}
20
- #mceditor {border: 1px solid #ddd;margin: 0 0 5px}
21
- .mc_template_tags dt {font-weight: 700}
22
- .mc_template_tags dd {margin-left: 0; padding: 2px 1px}
23
- .mc_template_tags {clear: right}
24
- .clonedInput {margin-bottom: 10px;border-bottom: 1px solid #ddd}
25
- #my-calendar .apply {padding: 1px 5px 0;margin: 0 -5px;border-radius: 3px;box-shadow: 2px 2px 3px #aaa;background: #ffd}
26
- #my-calendar .apply legend {background: #ffd;padding: 2px 0}
27
- #my-calendar .apply .warning { background: #ffe; color: #a00; padding: 3px; border: 1px solid #333 }
28
- #my-calendar .break ul {padding: 10px 10px 0;margin-right: 180px}
29
- #my-calendar .two-columns {-moz-column-count: 2;-moz-column-gap: 30px;-webkit-column-count: 2;-webkit-column-gap: 30px;column-count: 2;column-gap: 30px}
30
- .jd-my-calendar .event_image { float: right; margin-left: 10px; }
31
- .jd-my-calendar .event_image img { width: 150px; height: auto; margin: 2px 0; border-radius: 3px; }
32
- .mc_support {font-family:'Courier New';background:#fff;padding:5px}
33
- .template-editor, .style-editor { width: 98%}
34
- .jd-my-calendar .postbox { margin: 10px 10px 0 0}
35
- .jd-my-calendar .postbox .inside { overflow: visible!important} /* some plugins change this, but I need it at WP default. */
36
- .jd-my-calendar .meta-box-sortables { min-height: 0}
37
- .jd-my-calendar textarea { width: 100%}
38
- .mc-clear { clear: both }
39
- .jd-my-calendar pre { background: #fff; padding: 5px; border: 1px solid #ddd; box-shadow: 1px 1px 2px #ddd}
40
- .jd-my-calendar label span.required { font-size: .9em; color: #c33 }
41
- .jd-my-calendar .default { background: #fff }
42
- .jd-my-calendar .button-adjust { top: 10px; right: 0}
43
- .jd-my-calendar hr { width: 20%; margin: 0 auto; border: none; border-top: 1px solid #ccc}
44
- #mc-shortcodes li code, #mc-shortcodes .example code { font-size: 1.4em; line-height: 1.5; display: inline-block}
45
- .jd-my-calendar .tablenav { float: right }
46
- input[id=e_label], input[id=e_title], input[id=location_label], input[id=mc_twitter] { font-size: 1.4em; padding: 5px; width: 100%}
47
- label[for=mc_twitter] { background: url(../images/twitter.png) no-repeat; padding-left: 20px; }
48
- strong.label { font-weight: 400; }
49
- #my-calendar-text label { display: inline-block; width: 12em; }
50
- .wp-picker-container { position: relative; top: .7em; }
51
- .jd-my-calendar .counter { padding-right: 6px; border-right: 16px solid green; border-radius: 20px; }
52
- .jd-my-calendar .counter.warning { border-color: orange; }
53
- .jd-my-calendar .counter.exceeded { border-color: red; }
54
- .mc-categories th:nth-of-type(5), .mc-categories th:nth-of-type(6), .mc-categories th:nth-of-type(7) { width: 50px; }
55
-
56
- .jcd-wide { width: 75%; }
57
- .jcd-narrow { width: 20%; }
58
-
59
- .mc-tabs .tabs { margin: 0!important; padding: 0 4px; position: relative; top: 1px; }
60
- .mc-tabs .tabs li { display: inline; margin: 0 auto; line-height: 1; }
61
- .mc-tabs .tabs a { display: inline-block; padding: 4px 8px; border-radius: 4px 4px 0 0; border: 1px solid #ccc; background: #f3f3f3; }
62
- .mc-tabs .tabs a.active { border-bottom: 1px solid #fefefe; background: #fefefe; }
63
- .mc-tabs .wptab { background: #fff; padding: 12px; margin-bottom: 10px; border: 1px solid #ccc; }
64
-
65
- .jd-my-calendar .ui-accordion-header, .mc-settings-page #mc-sortable li { border: 1px solid #ccc; border-radius: 2px; background: rgba( 0,0,0,.05 ); padding: 1px 1em; margin: 1px 0; }
66
- .jd-my-calendar .ui-accordion-header.ui-state-hover, .ui-accordion-header.ui-state-focus, .mc-settings-page #mc-sortable li:hover { background: #f6f6f6; box-shadow: 0 0 2px #ddd; }
67
- #mc-sortable li { cursor: move; }
68
- .jd-my-calendar .ui-accordion-header-active { background: #fff; }
69
- #mc-sortable .mc-calendar { background: #ffc; border: 1px solid #cc8; }
70
- #mc-sortable li.mc-stop { margin: 1px -1em; border-radius: none; border-left: none; border-right: none; padding: 2px 2em; }
71
- #mc-sortable div.dashicons { vertical-align: middle; height: 1em; }
72
- #mc-sortable code { display: inline-block; width: 5em; text-align: center; }
73
-
74
- .jd-my-calendar .checkboxes { margin: 0; }
75
- .jd-my-calendar .checkboxes li { display: inline-block; padding: 5px; background: rgba( 0, 0, 0, .05 ); margin: 2px; }
76
- .jd-my-calendar .checkboxes li:hover { background: #fff; }
77
-
78
- .mc-actions { float: left; vertical-align: middle; height: 30px; margin: 6px 0 4px; clear: left; }
79
-
80
- .jd-my-calendar fieldset legend { font-weight: 700; padding: 0; font-size: 1.1em; }
81
- .generator fieldset { border: 1px solid #ccc; margin: 10px 0; padding: 10px; }
82
- .generator label { display: block; float: left; width: 30%; margin-right: 10px; }
83
- .generator td input[type=text] { width: 100%; }
84
- .generator td label { float: none; width: auto; display: inline; }
85
- .generator .help, .generator .clear { clear: left; }
86
- .generator input { line-height: normal; }
87
- .generator input[type=text], .generator select { width: 60%; }
88
- .req { color: red; }
89
-
90
- .jd-my-calendar textarea:disabled { color: #333; border: none; box-shadow: none; }
91
- .mc-locations label { display: block; }
92
- .mc-locations .checkboxes label, .checkbox label { display: inline; }
93
-
94
- .locations-container { position: relative; }
95
- .mc-locations .location-primary { width: 47%; margin-right: 20px; }
96
- .mc-locations:after { content: ' '; display: table; clear: both; }
97
- .mc-locations .location-secondary { position: absolute; left: 50%; top: 0; width: 47%; }
98
- .mc-locations .locations-container input { max-width: 90%; }
99
-
100
- .mc-search { position: absolute; right: 12px; }
101
102
@media (max-width: 1140px) {
103
- .mc-locations .locations-container input { max-width: 70%; }
104
}
105
106
@media (max-width: 782px) {
107
- .jd-my-calendar .tablenav { float: none; }
108
- .jcd-narrow { width: 100%; }
109
- .jcd-wide { width: 100%; }
110
}
1
+ #my-calendar legend {
2
+ font-weight: 700;
3
+ font-size: 1em
4
+ }
5
+
6
+ .mcbuy, .mcsbuy {
7
+ font-size: 1.1em;
8
+ line-height: 1.5
9
+ }
10
+
11
+ .mc-button {
12
+ text-align: center;
13
+ font-size: 1.4em;
14
+ padding: 10px 0 0
15
+ }
16
+
17
+ .mc-button a {
18
+ padding: 3px 8px;
19
+ border: 1px solid;
20
+ border-radius: 5px;
21
+ background: #fff
22
+ }
23
+
24
+ .mcd {
25
+ text-align: center;
26
+ margin: 0;
27
+ }
28
+
29
+ #cat_icon option {
30
+ padding: 5px 0 5px 24px
31
+ }
32
+
33
+ #my-calendar-admin-table .delete {
34
+ color: #c00
35
+ }
36
+
37
+ .import {
38
+ background: #ffa;
39
+ padding: 5px 10px;
40
+ border: 1px solid #aaa;
41
+ border-radius: 5px;
42
+ margin: 15px 0
43
+ }
44
+
45
+ .n4 {
46
+ width: 42px
47
+ }
48
+
49
+ .category-color {
50
+ width: 1.2em;
51
+ height: 1.2em;
52
+ display: inline-block;
53
+ border-radius: 3px;
54
+ border: 1px solid #000
55
+ }
56
+
57
+ .jd-my-calendar .postbox h3 {
58
+ cursor: text
59
+ }
60
+
61
+ .active-link {
62
+ font-weight: 700;
63
+ text-decoration: underline
64
+ }
65
+
66
+ ul.links li {
67
+ float: left;
68
+ margin: 0 5px 10px;
69
+ font-size: .9em
70
+ }
71
+
72
+ #toggle {
73
+ height: 2em
74
+ }
75
+
76
+ #toggle li {
77
+ float: left;
78
+ margin-right: 5px
79
+ }
80
+
81
+ .jd-my-calendar .spam {
82
+ background: #ffa
83
+ }
84
+
85
+ .jd-my-calendar .pending {
86
+ background: #eee
87
+ }
88
+
89
+ .jd-my-calendar .pending td {
90
+ color: #666
91
+ }
92
+
93
+ .jd-my-calendar fieldset fieldset {
94
+ margin: 0 0 20px 0;
95
+ padding-top: 2px
96
+ }
97
+
98
+ #mceditor {
99
+ border: 1px solid #ddd;
100
+ margin: 0 0 5px
101
+ }
102
+
103
+ .mc_template_tags dt {
104
+ font-weight: 700
105
+ }
106
+
107
+ .mc_template_tags dd {
108
+ margin-left: 0;
109
+ padding: 2px 1px
110
+ }
111
+
112
+ .mc_template_tags {
113
+ clear: right
114
+ }
115
+
116
+ .clonedInput {
117
+ margin-bottom: 10px;
118
+ border-bottom: 1px solid #ddd
119
+ }
120
+
121
+ #my-calendar .apply {
122
+ padding: 1px 5px 0;
123
+ margin: 0 -5px;
124
+ border-radius: 3px;
125
+ box-shadow: 2px 2px 3px #aaa;
126
+ background: #ffd
127
+ }
128
+
129
+ #my-calendar .apply legend {
130
+ background: #ffd;
131
+ padding: 2px 0
132
+ }
133
+
134
+ #my-calendar .apply .warning {
135
+ background: #ffe;
136
+ color: #a00;
137
+ padding: 3px;
138
+ border: 1px solid #333
139
+ }
140
+
141
+ #my-calendar .break ul {
142
+ padding: 10px 10px 0;
143
+ margin-right: 180px
144
+ }
145
+
146
+ #my-calendar .two-columns {
147
+ -moz-column-count: 2;
148
+ -moz-column-gap: 30px;
149
+ -webkit-column-count: 2;
150
+ -webkit-column-gap: 30px;
151
+ column-count: 2;
152
+ column-gap: 30px
153
+ }
154
+
155
+ .jd-my-calendar .event_image {
156
+ float: right;
157
+ margin-left: 10px;
158
+ }
159
+
160
+ .jd-my-calendar .event_image img {
161
+ width: 150px;
162
+ height: auto;
163
+ margin: 2px 0;
164
+ border-radius: 3px;
165
+ }
166
+
167
+ .mc_support {
168
+ font-family: 'Courier New';
169
+ background: #fff;
170
+ padding: 5px
171
+ }
172
+
173
+ .template-editor, .style-editor {
174
+ width: 98%
175
+ }
176
+
177
+ .jd-my-calendar .postbox {
178
+ margin: 10px 10px 0 0
179
+ }
180
+
181
+ .jd-my-calendar .postbox .inside {
182
+ overflow: visible !important
183
+ }
184
+
185
+ /* some plugins change this, but I need it at WP default. */
186
+ .jd-my-calendar .meta-box-sortables {
187
+ min-height: 0
188
+ }
189
+
190
+ .jd-my-calendar textarea {
191
+ width: 100%
192
+ }
193
+
194
+ .mc-clear {
195
+ clear: both
196
+ }
197
+
198
+ .jd-my-calendar pre {
199
+ background: #fff;
200
+ padding: 5px;
201
+ border: 1px solid #ddd;
202
+ box-shadow: 1px 1px 2px #ddd
203
+ }
204
+
205
+ .jd-my-calendar label span.required {
206
+ font-size: .9em;
207
+ color: #c33
208
+ }
209
+
210
+ .jd-my-calendar .default {
211
+ background: #fff
212
+ }
213
+
214
+ .jd-my-calendar .button-adjust {
215
+ top: 10px;
216
+ right: 0
217
+ }
218
+
219
+ .jd-my-calendar hr {
220
+ width: 20%;
221
+ margin: 0 auto;
222
+ border: none;
223
+ border-top: 1px solid #ccc
224
+ }
225
+
226
+ #mc-shortcodes li code {
227
+ font-size: 1.4em;
228
+ line-height: 1.5;
229
+ display: inline-block
230
+ }
231
+
232
+ .jd-my-calendar .tablenav {
233
+ float: right
234
+ }
235
+
236
+ input[id=e_label], input[id=e_title], input[id=location_label], input[id=mc_twitter] {
237
+ font-size: 1.4em;
238
+ padding: 5px;
239
+ width: 100%
240
+ }
241
+
242
+ label[for=mc_twitter] {
243
+ background: url(../images/twitter.png) no-repeat;
244
+ padding-left: 20px;
245
+ }
246
+
247
+ strong.label {
248
+ font-weight: 400;
249
+ }
250
+
251
+ #my-calendar-text label {
252
+ display: inline-block;
253
+ width: 12em;
254
+ }
255
+
256
+ .wp-picker-container {
257
+ position: relative;
258
+ top: .7em;
259
+ }
260
+
261
+ .jd-my-calendar .counter {
262
+ padding-right: 6px;
263
+ border-right: 16px solid green;
264
+ border-radius: 20px;
265
+ }
266
+
267
+ .jd-my-calendar .counter.warning {
268
+ border-color: orange;
269
+ }
270
+
271
+ .jd-my-calendar .counter.exceeded {
272
+ border-color: red;
273
+ }
274
+
275
+ .mc-categories th:nth-of-type(5), .mc-categories th:nth-of-type(6), .mc-categories th:nth-of-type(7) {
276
+ width: 50px;
277
+ }
278
+
279
+ .jcd-wide {
280
+ width: 75%;
281
+ }
282
+
283
+ .jcd-narrow {
284
+ width: 20%;
285
+ }
286
+
287
+ .mc-tabs .tabs {
288
+ margin: 0 !important;
289
+ padding: 0 4px;
290
+ position: relative;
291
+ top: 1px;
292
+ }
293
+
294
+ .mc-tabs .tabs li {
295
+ display: inline;
296
+ margin: 0 auto;
297
+ line-height: 1;
298
+ }
299
+
300
+ .mc-tabs .tabs a {
301
+ display: inline-block;
302
+ padding: 4px 8px;
303
+ border-radius: 4px 4px 0 0;
304
+ border: 1px solid #ccc;
305
+ background: #f3f3f3;
306
+ }
307
+
308
+ .mc-tabs .tabs a.active {
309
+ border-bottom: 1px solid #fefefe;
310
+ background: #fefefe;
311
+ }
312
+
313
+ .mc-tabs .wptab {
314
+ background: #fff;
315
+ padding: 12px;
316
+ margin-bottom: 10px;
317
+ border: 1px solid #ccc;
318
+ }
319
+
320
+ .jd-my-calendar .ui-accordion-header, .mc-settings-page #mc-sortable li {
321
+ border: 1px solid #ccc;
322
+ border-radius: 2px;
323
+ background: rgba(0, 0, 0, .05);
324
+ padding: 1px 1em;
325
+ margin: 1px 0;
326
+ }
327
+
328
+ .jd-my-calendar .ui-accordion-header.ui-state-hover, .ui-accordion-header.ui-state-focus, .mc-settings-page #mc-sortable li:hover {
329
+ background: #f6f6f6;
330
+ box-shadow: 0 0 2px #ddd;
331
+ }
332
+
333
+ #mc-sortable li {
334
+ cursor: move;
335
+ }
336
+
337
+ .jd-my-calendar .ui-accordion-header-active {
338
+ background: #fff;
339
+ }
340
+
341
+ #mc-sortable .mc-calendar {
342
+ background: #ffc;
343
+ border: 1px solid #cc8;
344
+ }
345
+
346
+ #mc-sortable li.mc-stop {
347
+ margin: 1px -1em;
348
+ border-radius: none;
349
+ border-left: none;
350
+ border-right: none;
351
+ padding: 2px 2em;
352
+ }
353
+
354
+ #mc-sortable div.dashicons {
355
+ vertical-align: middle;
356
+ height: 1em;
357
+ }
358
+
359
+ #mc-sortable code {
360
+ display: inline-block;
361
+ width: 5em;
362
+ text-align: center;
363
+ }
364
+
365
+ .jd-my-calendar .checkboxes {
366
+ margin: 0;
367
+ }
368
+ .jd-my-calendar .checkboxes:after {
369
+ content: '';
370
+ display: table;
371
+ clear: both;
372
+ margin-bottom: 1em;
373
+ }
374
+
375
+ .jd-my-calendar .checkboxes li {
376
+ display: inline-block;
377
+ padding: 5px;
378
+ background: rgba(0, 0, 0, .05);
379
+ margin: 2px;
380
+ }
381
+
382
+ .jd-my-calendar .checkboxes li:hover {
383
+ background: #fff;
384
+ }
385
+
386
+ .mc-actions {
387
+ float: left;
388
+ vertical-align: middle;
389
+ height: 30px;
390
+ margin: 6px 0 4px;
391
+ clear: left;
392
+ }
393
+
394
+ .jd-my-calendar fieldset legend {
395
+ font-weight: 700;
396
+ padding: 0;
397
+ font-size: 1.1em;
398
+ }
399
+
400
+ .generator fieldset {
401
+ border: 1px solid #ccc;
402
+ margin: 10px 0;
403
+ padding: 10px;
404
+ }
405
+
406
+ .generator label {
407
+ display: block;
408
+ float: left;
409
+ width: 30%;
410
+ margin-right: 10px;
411
+ }
412
+
413
+ .generator td input[type=text] {
414
+ width: 100%;
415
+ }
416
+
417
+ .generator td label {
418
+ float: none;
419
+ width: auto;
420
+ display: inline;
421
+ }
422
+
423
+ .generator .help, .generator .clear {
424
+ clear: left;
425
+ }
426
+
427
+ .generator input {
428
+ line-height: normal;
429
+ }
430
+
431
+ .generator input[type=text], .generator select {
432
+ width: 60%;
433
+ }
434
+
435
+ .req {
436
+ color: red;
437
+ }
438
+
439
+ .jd-my-calendar textarea[readonly="readonly"] {
440
+ color: #333;
441
+ border: none;
442
+ box-shadow: none;
443
+ font-size: 1.4em;
444
+ }
445
+
446
+ .mc-locations label {
447
+ display: block;
448
+ }
449
+
450
+ .mc-locations .checkboxes label, .checkbox label {
451
+ display: inline;
452
+ }
453
+
454
+ .locations-container {
455
+ position: relative;
456
+ }
457
+
458
+ .mc-locations .location-primary {
459
+ width: 47%;
460
+ margin-right: 20px;
461
+ }
462
+
463
+ .mc-locations:after {
464
+ content: ' ';
465
+ display: table;
466
+ clear: both;
467
+ }
468
+
469
+ .mc-locations .location-secondary {
470
+ position: absolute;
471
+ left: 50%;
472
+ top: 0;
473
+ width: 47%;
474
+ }
475
+
476
+ .mc-locations .locations-container input {
477
+ max-width: 90%;
478
+ }
479
+
480
+ .mc_recur_notice {
481
+ padding: 5px 10px;
482
+ background: #ffc;
483
+ color: #000;
484
+ }
485
+
486
+ .mc-search {
487
+ float: right;
488
+ }
489
+
490
+ .sales {
491
+ background: #e25822;
492
+ color: #fff;
493
+ text-shadow: 1px 0 0 #000;
494
+ }
495
+
496
+ .jd-my-calendar .error .button-secondary {
497
+ vertical-align: baseline;
498
+ }
499
+
500
+ .mc_response {
501
+ padding: .25em;
502
+ background: #ffa;
503
+ color: #000;
504
+ }
505
+
506
+ tr.problem {
507
+ background-color: #ffa;
508
+ }
509
+
510
+ tr.problem .error {
511
+ color: #a00;
512
+ }
513
+
514
+ .problem-icon {
515
+ font-size: 64px;
516
+ float: left;
517
+ margin-right: .25em;
518
+ height: 64px;
519
+ width: 64px;
520
+ display: block;
521
+ }
522
+
523
+ #my-calendar .inside div iframe {
524
+ float: none;
525
+ }
526
527
@media (max-width: 1140px) {
528
+ .mc-locations .locations-container input {
529
+ max-width: 70%;
530
+ }
531
}
532
533
@media (max-width: 782px) {
534
+ .jd-my-calendar .tablenav {
535
+ float: none;
536
+ }
537
+
538
+ .jcd-narrow {
539
+ width: 100%;
540
+ }
541
+
542
+ .jcd-wide {
543
+ width: 100%;
544
+ }
545
}
css/reset.css CHANGED
@@ -1,2 +1,69 @@
1
- .mc-main div,.mc-main span,.mc-main h1,.mc-main h2,.mc-main h3,.mc-main h4,.mc-main h5,.mc-main h6,.mc-main p,.mc-main blockquote,.mc-main pre,.mc-main a,.mc-main abbr,.mc-main acronym,.mc-main address,.mc-main big,.mc-main cite,.mc-main code,.mc-main del,.mc-main dfn,.mc-main font,.mc-main img,.mc-main ins,.mc-main kbd,.mc-main q,.mc-main s,.mc-main samp,.mc-main small,.mc-main strike,.mc-main sub,.mc-main sup,.mc-main tt,.mc-main var,.mc-main center,.mc-main dl,.mc-main dt,.mc-main dd,.mc-main ol,.mc-main ul,.mc-main li,.mc-main fieldset,.mc-main form,.mc-main label,.mc-main legend,.mc-main table,.mc-main caption,.mc-main tbody,.mc-main tfoot,.mc-main thead,.mc-main tr,.mc-main th,.mc-main td,.mc-main article,.mc-main aside,.mc-main audio,.mc-main canvas,.mc-main details,.mc-main figcaption,.mc-main figure,.mc-main footer,.mc-main header,.mc-main hgroup,.mc-main mark,.mc-main menu,.mc-main meter,.mc-main nav,.mc-main output,.mc-main progress,.mc-main section,.mc-main summary,.mc-main time,.mc-main video{border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent;margin:0;padding:0;}body{line-height:1;}article,.mc-main aside,.mc-main dialog,.mc-main figure,.mc-main footer,.mc-main header,.mc-main hgroup,.mc-main nav,.mc-main section,.mc-main blockquote{display:block;}nav ul{list-style:none;}ol{list-style:decimal;}ul{list-style:disc;}ul ul{list-style:circle;}blockquote,.mc-main q{quotes:none;}blockquote:before,.mc-main blockquote:after,.mc-main q:before,.mc-main q:after{content:none;}ins{text-decoration:underline;}del{text-decoration:line-through;}mark{background:none;}abbr[title],.mc-main dfn[title]{border-bottom:1px dotted #000;cursor:help;}table{border-collapse:collapse;border-spacing:0;}hr{display:block;height:1px;border:0;border-top:1px solid #ccc;margin:1em 0;padding:0;}input[type=submit],.mc-main input[type=button],.mc-main button{margin:0!important;padding:0!important;}input,.mc-main select,.mc-main a img{vertical-align:middle;}.mc-main *, .mc-main *:before, .mc-main *:after {-moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;}.mc-main .screen-reader-text { clip: rect(1px 1px 1px 1px); clip: rect(1px, 1px, 1px, 1px); overflow: hidden;
2
- position: absolute; max-height:1px; }
1
+ .mc-main div, .mc-main span, .mc-main h1, .mc-main h2, .mc-main h3, .mc-main h4, .mc-main h5, .mc-main h6, .mc-main p, .mc-main blockquote, .mc-main pre, .mc-main a, .mc-main img, .mc-main dl, .mc-main dt, .mc-main dd, .mc-main ol, .mc-main ul, .mc-main li, .mc-main fieldset, .mc-main form, .mc-main label, .mc-main legend, .mc-main table, .mc-main caption, .mc-main tbody, .mc-main tfoot, .mc-main thead, .mc-main tr, .mc-main th, .mc-main td, .mc-main article, .mc-main aside, .mc-main details, .mc-main footer, .mc-main header, .mc-main menu, .mc-main meter, .mc-main nav, .mc-main output, .mc-main progress, .mc-main section, .mc-main summary {
2
+ border: 0;
3
+ outline: 0;
4
+ font-size: 100%;
5
+ vertical-align: baseline;
6
+ background: transparent;
7
+ margin: 0;
8
+ padding: 0;
9
+ }
10
+
11
+ .mc-main {
12
+ line-height: 1;
13
+ }
14
+
15
+ .mc-main article, .mc-main aside, .mc-main dialog, .mc-main figure, .mc-main footer, .mc-main header, .mc-main nav, .mc-main section, .mc-main blockquote {
16
+ display: block;
17
+ }
18
+
19
+ .mc-main nav ul {
20
+ list-style: none;
21
+ }
22
+
23
+ .mc-main ol {
24
+ list-style: decimal;
25
+ }
26
+
27
+ .mc-main ul {
28
+ list-style: disc;
29
+ }
30
+
31
+ .mc-main ul ul {
32
+ list-style: circle;
33
+ }
34
+
35
+ .mc-main blockquote, .mc-main q {
36
+ quotes: none;
37
+ }
38
+
39
+ .mc-main blockquote:before, .mc-main blockquote:after, .mc-main q:before, .mc-main q:after {
40
+ content: none;
41
+ }
42
+
43
+ .mc-main table {
44
+ border-collapse: collapse;
45
+ border-spacing: 0;
46
+ }
47
+
48
+ .mc-main input[type=submit], .mc-main input[type=button], .mc-main button {
49
+ margin: 0 !important;
50
+ padding: 0 !important;
51
+ }
52
+
53
+ .mc-main input, .mc-main select, .mc-main a img {
54
+ vertical-align: middle;
55
+ }
56
+
57
+ .mc-main *, .mc-main *:before, .mc-main *:after {
58
+ -moz-box-sizing: border-box;
59
+ -webkit-box-sizing: border-box;
60
+ box-sizing: border-box;
61
+ }
62
+
63
+ .mc-main .screen-reader-text {
64
+ clip: rect(1px 1px 1px 1px);
65
+ clip: rect(1px, 1px, 1px, 1px);
66
+ overflow: hidden;
67
+ position: absolute;
68
+ max-height: 1px;
69
+ }
includes/date-utilities.php CHANGED
@@ -1,241 +1,289 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
4
function mc_dateclass( $now, $current ) {
5
- if ( date("Ymd",$now) == date("Ymd", $current ) ) {
6
$dateclass = 'current-day';
7
- } else if ( my_calendar_date_comp( date('Y-m-d',$now), date('Y-m-d',$current) ) ) {
8
$dateclass = 'future-day';
9
} else {
10
$dateclass = 'past-day past-date'; // stupid legacy classes.
11
}
12
return $dateclass;
13
}
14
15
// receives: time string, amount to add; returns: timestamp
16
- function my_calendar_add_date($givendate,$day=0,$mth=0,$yr=0) {
17
- $cd = strtotime($givendate);
18
- $newdate = mktime(date('H',$cd),date('i',$cd), date('s',$cd), date('m',$cd)+$mth,date('d',$cd)+$day, date('Y',$cd)+$yr);
19
return $newdate;
20
}
21
//returns true if the date is before or equal,
22
- function my_calendar_date_comp($early,$late) {
23
- $firstdate = strtotime($early);
24
- $lastdate = strtotime($late);
25
- if ($firstdate <= $lastdate) {
26
return true;
27
} else {
28
return false;
29
}
30
}
31
// true if first date before second date
32
- function my_calendar_date_xcomp($early,$late) {
33
- $firstdate = strtotime($early);
34
- $lastdate = strtotime($late);
35
- if ($firstdate < $lastdate) {
36
return true;
37
} else {
38
return false;
39
}
40
}
41
// true if dates are the same
42
- function my_calendar_date_equal($early,$late) {
43
// convert full datetime to date only
44
- $firstdate = strtotime( date( 'Y-m-d',strtotime($early) ) );
45
- $lastdate = strtotime( date( 'Y-m-d',strtotime($late) ) );
46
- if ($firstdate == $lastdate) {
47
return true;
48
} else {
49
return false;
50
- }
51
}
52
// test whether two dates are day-consecutive
53
function mc_dates_consecutive( $current, $last_date ) {
54
- if ( strtotime( $last_date.'+ 1 day' ) == strtotime( $current ) ) { return true; } else { return false; }
55
}
56
// Function to compare time in event objects
57
- function my_calendar_time_cmp($a, $b) {
58
if ( $a->occur_begin == $b->occur_begin ) {
59
return 0;
60
}
61
- return ( $a->occur_begin < $b->occur_begin ) ? -1 : 1;
62
}
63
64
// Function to compare datetime in event objects
65
- function my_calendar_datetime_cmp($a, $b) {
66
$event_dt_a = strtotime( $a->occur_begin );
67
$event_dt_b = strtotime( $b->occur_begin );
68
if ( $event_dt_a == $event_dt_b ) {
69
- // this should sub-sort by title if date is the same. But it doesn't seem to...
70
$ta = $a->event_title;
71
$tb = $b->event_title;
72
return strcmp( $ta, $tb );
73
}
74
- return ( $event_dt_a < $event_dt_b ) ? -1 : 1;
75
}
76
77
// reverse Function to compare datetime in event objects
78
- function my_calendar_reverse_datetime_cmp($b, $a) {
79
- $event_dt_a = strtotime($a->occur_begin);
80
- $event_dt_b = strtotime($b->occur_begin);
81
- if ($event_dt_a == $event_dt_b ) {
82
- return 0;
83
- }
84
- return ( $event_dt_a < $event_dt_b ) ? -1 : 1;
85
}
86
87
function my_calendar_timediff_cmp( $a, $b ) {
88
- $a = $a.date(' H:i:s',current_time( 'timestamp' ) );
89
- $b = $b.date(' H:i:s',current_time( 'timestamp' ) );
90
- $event_dt_a = strtotime($a);
91
- $event_dt_b = strtotime($b);
92
- $diff_a = jd_date_diff_precise($event_dt_a);
93
- $diff_b = jd_date_diff_precise($event_dt_b);
94
-
95
if ( $diff_a == $diff_b ) {
96
return 0;
97
}
98
- return ( $diff_a < $diff_b ) ? -1 : 1;
99
}
100
101
- function jd_date_diff_precise($start,$end="NOW") {
102
- if ($end == "NOW") {
103
- $end = strtotime("NOW");
104
- }
105
- $sdate = $start;
106
- $edate = $end;
107
108
- $time = $edate - $sdate;
109
-
110
- return abs($time);
111
}
112
113
- function jd_date_diff($start, $end="NOW") {
114
- $sdate = strtotime($start);
115
- $edate = strtotime($end);
116
117
- $time = $edate - $sdate;
118
- if ($time < 86400 && $time > -86400) {
119
- return false;
120
- } else {
121
- $pday = ($edate - $sdate) / 86400;
122
- $preday = explode('.',$pday);
123
- return $preday[0];
124
- }
125
}
126
// @param integer $date_of_event The current month's date;
127
// @return integer $week_of_event The week of the month this date falls in;
128
- function week_of_month($date_of_event) {
129
- switch ($date_of_event) {
130
- case ($date_of_event>=1 && $date_of_event <8):
131
- $week_of_event = 0;
132
- break;
133
- case ($date_of_event>=8 && $date_of_event <15):
134
- $week_of_event = 1;
135
- break;
136
- case ($date_of_event>=15 && $date_of_event <22):
137
- $week_of_event = 2;
138
- break;
139
- case ($date_of_event>=22 && $date_of_event <29):
140
- $week_of_event = 3;
141
- break;
142
- case ($date_of_event>=29):
143
- $week_of_event = 4;
144
- break;
145
- }
146
- return $week_of_event;
147
}
148
149
/**
150
* Function to find the start date of a week in a year
151
* @param integer $week The week number of the year
152
* @param integer $year The year of the week we need to calculate on
153
- * @param string $start_of_week The start day of the week you want returned
154
* @return integer The unix timestamp of the date is returned
155
*/
156
function get_week_date( $week, $year ) {
157
// Get the target week of the year with reference to the starting day of
158
// the year
159
- $start_of_week = (get_option('start_of_week')==1||get_option('start_of_week')==0)?get_option('start_of_week'):0;
160
- $week_adjustment = ($start_of_week == 0)?0:1;
161
-
162
- $target_week = strtotime("$week week", strtotime("1 January $year"));
163
- $date_info = getdate($target_week);
164
- $day_of_week = $date_info['wday'];
165
// normal start day of the week is Monday
166
$adjusted_date = $day_of_week - $start_of_week;
167
// Get the timestamp of that day
168
- $first_day = strtotime("-$adjusted_date day",$target_week);
169
return $first_day;
170
}
171
172
- function add_days_to_date( $givendate,$day=0 ) {
173
- $cd = strtotime($givendate);
174
- $newdate = date('Y-m-d h:i:s',
175
mktime(
176
- date('h',$cd),
177
- date('i',$cd),
178
- date('s',$cd),
179
- date('m',$cd),
180
- date('d',$cd)+$day,
181
- date('Y',$cd)
182
) );
183
- return $newdate;
184
}
185
186
- function mc_checkdate($date) {
187
- $time = strtotime($date);
188
- $m = date('n',$time);
189
- $d = date('j',$time);
190
- $y = date('Y',$time);
191
- return checkdate($m,$d,$y);
192
}
193
194
- function first_day_of_week( $date=false ) {
195
- $start_of_week = (get_option('start_of_week')==1||get_option('start_of_week')==0)?get_option('start_of_week'):0;
196
if ( $date ) {
197
- $today = date( 'w',$date );
198
- $now = date( 'Y-m-d',$date );
199
} else {
200
- $today = date('w',current_time('timestamp'));
201
- $now = date('Y-m-d',current_time('timestamp'));
202
- }
203
- $month = 0; // don't change month
204
- switch ($today) {
205
- case 1: $sub = ($start_of_week == 1)?0:1;break; // mon
206
- case 2: $sub = ($start_of_week == 1)?1:2;break; // tues
207
- case 3: $sub = ($start_of_week == 1)?2:3;break; // wed
208
- case 4: $sub = ($start_of_week == 1)?3:4;break; // thu
209
- case 5: $sub = ($start_of_week == 1)?4:5;break; // fri
210
- case 6: $sub = ($start_of_week == 1)?5:6;break; // sat
211
- case 0: $sub = ($start_of_week == 1)?6:0;break; // sun
212
- }
213
- $day = date('j',strtotime( $now . ' -'.$sub.' day'));
214
if ( $sub != 0 ) {
215
- if ( date('n',strtotime( $now . ' -'.$sub.' day') ) != date( 'n',strtotime($now) ) ) {
216
- $month = -1;
217
} else {
218
$month = 0;
219
}
220
}
221
return array( $day, $month );
222
}
223
224
- function mc_ordinal($number) {
225
- // when fed a number, adds the English ordinal suffix. Works for any
226
- // number, even negatives
227
- if ($number % 100 > 10 && $number %100 < 14) {
228
- $suffix = "th";
229
- } else {
230
- switch($number % 10) {
231
- case 0:$suffix = "th";break;
232
- case 1:$suffix = "st";break;
233
- case 2:$suffix = "nd";break;
234
- case 3:$suffix = "rd";break;
235
- default:$suffix = "th";break;
236
- }
237
- }
238
- return "${number}$suffix";
239
- }
240
241
- ?>
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ } // Exit if accessed directly
5
6
function mc_dateclass( $now, $current ) {
7
+ if ( date( "Ymd", $now ) == date( "Ymd", $current ) ) {
8
$dateclass = 'current-day';
9
+ } else if ( my_calendar_date_comp( date( 'Y-m-d', $now ), date( 'Y-m-d', $current ) ) ) {
10
$dateclass = 'future-day';
11
} else {
12
$dateclass = 'past-day past-date'; // stupid legacy classes.
13
}
14
+
15
return $dateclass;
16
}
17
18
// receives: time string, amount to add; returns: timestamp
19
+ function my_calendar_add_date( $givendate, $day = 0, $mth = 0, $yr = 0 ) {
20
+ $cd = strtotime( $givendate );
21
+ $newdate = mktime( date( 'H', $cd ), date( 'i', $cd ), date( 's', $cd ), date( 'm', $cd ) + $mth, date( 'd', $cd ) + $day, date( 'Y', $cd ) + $yr );
22
+
23
return $newdate;
24
}
25
+
26
//returns true if the date is before or equal,
27
+ function my_calendar_date_comp( $early, $late ) {
28
+ $firstdate = strtotime( $early );
29
+ $lastdate = strtotime( $late );
30
+ if ( $firstdate <= $lastdate ) {
31
return true;
32
} else {
33
return false;
34
}
35
}
36
+
37
// true if first date before second date
38
+ function my_calendar_date_xcomp( $early, $late ) {
39
+ $firstdate = strtotime( $early );
40
+ $lastdate = strtotime( $late );
41
+ if ( $firstdate < $lastdate ) {
42
return true;
43
} else {
44
return false;
45
}
46
}
47
+
48
// true if dates are the same
49
+ function my_calendar_date_equal( $early, $late ) {
50
// convert full datetime to date only
51
+ $firstdate = strtotime( date( 'Y-m-d', strtotime( $early ) ) );
52
+ $lastdate = strtotime( date( 'Y-m-d', strtotime( $late ) ) );
53
+ if ( $firstdate == $lastdate ) {
54
return true;
55
} else {
56
return false;
57
+ }
58
}
59
+
60
// test whether two dates are day-consecutive
61
function mc_dates_consecutive( $current, $last_date ) {
62
+ if ( strtotime( $last_date . '+ 1 day' ) == strtotime( $current ) ) {
63
+ return true;
64
+ } else {
65
+ return false;
66
+ }
67
}
68
+
69
// Function to compare time in event objects
70
+ function my_calendar_time_cmp( $a, $b ) {
71
if ( $a->occur_begin == $b->occur_begin ) {
72
return 0;
73
}
74
+
75
+ return ( $a->occur_begin < $b->occur_begin ) ? - 1 : 1;
76
}
77
78
// Function to compare datetime in event objects
79
+ function my_calendar_datetime_cmp( $a, $b ) {
80
$event_dt_a = strtotime( $a->occur_begin );
81
$event_dt_b = strtotime( $b->occur_begin );
82
if ( $event_dt_a == $event_dt_b ) {
83
+ // this should sub-sort by title if date is the same. But it doesn't seem to...
84
$ta = $a->event_title;
85
$tb = $b->event_title;
86
+
87
return strcmp( $ta, $tb );
88
}
89
+
90
+ return ( $event_dt_a < $event_dt_b ) ? - 1 : 1;
91
}
92
93
// reverse Function to compare datetime in event objects
94
+ function my_calendar_reverse_datetime_cmp( $b, $a ) {
95
+ $event_dt_a = strtotime( $a->occur_begin );
96
+ $event_dt_b = strtotime( $b->occur_begin );
97
+ if ( $event_dt_a == $event_dt_b ) {
98
+ return 0;
99
+ }
100
+
101
+ return ( $event_dt_a < $event_dt_b ) ? - 1 : 1;
102
}
103
104
function my_calendar_timediff_cmp( $a, $b ) {
105
+ $a = $a . date( ' H:i:s', current_time( 'timestamp' ) );
106
+ $b = $b . date( ' H:i:s', current_time( 'timestamp' ) );
107
+ $event_dt_a = strtotime( $a );
108
+ $event_dt_b = strtotime( $b );
109
+ $diff_a = jd_date_diff_precise( $event_dt_a );
110
+ $diff_b = jd_date_diff_precise( $event_dt_b );
111
+
112
if ( $diff_a == $diff_b ) {
113
return 0;
114
}
115
+
116
+ return ( $diff_a < $diff_b ) ? - 1 : 1;
117
}
118
119
+ function jd_date_diff_precise( $start, $end = "NOW" ) {
120
+ if ( $end == "NOW" ) {
121
+ $end = strtotime( "NOW" );
122
+ }
123
+ $sdate = $start;
124
+ $edate = $end;
125
126
+ $time = $edate - $sdate;
127
+
128
+ return abs( $time );
129
}
130
131
+ function jd_date_diff( $start, $end = "NOW" ) {
132
+ $sdate = strtotime( $start );
133
+ $edate = strtotime( $end );
134
135
+ $time = $edate - $sdate;
136
+ if ( $time < 86400 && $time > - 86400 ) {
137
+ return false;
138
+ } else {
139
+ $pday = ( $edate - $sdate ) / 86400;
140
+ $preday = explode( '.', $pday );
141
+
142
+ return $preday[0];
143
+ }
144
}
145
+
146
// @param integer $date_of_event The current month's date;
147
// @return integer $week_of_event The week of the month this date falls in;
148
+ function week_of_month( $date_of_event ) {
149
+ $week_of_event = 0;
150
+ switch ( $date_of_event ) {
151
+ case ( $date_of_event >= 1 && $date_of_event < 8 ):
152
+ $week_of_event = 0;
153
+ break;
154
+ case ( $date_of_event >= 8 && $date_of_event < 15 ):
155
+ $week_of_event = 1;
156
+ break;
157
+ case ( $date_of_event >= 15 && $date_of_event < 22 ):
158
+ $week_of_event = 2;
159
+ break;
160
+ case ( $date_of_event >= 22 && $date_of_event < 29 ):
161
+ $week_of_event = 3;
162
+ break;
163
+ case ( $date_of_event >= 29 ):
164
+ $week_of_event = 4;
165
+ break;
166
+ }
167
+
168
+ return $week_of_event;
169
}
170
171
/**
172
* Function to find the start date of a week in a year
173
+ *
174
* @param integer $week The week number of the year
175
* @param integer $year The year of the week we need to calculate on
176
+ *
177
* @return integer The unix timestamp of the date is returned
178
*/
179
function get_week_date( $week, $year ) {
180
// Get the target week of the year with reference to the starting day of
181
// the year
182
+ $start_of_week = ( get_option( 'start_of_week' ) == 1 || get_option( 'start_of_week' ) == 0 ) ? get_option( 'start_of_week' ) : 0;
183
+ $target_week = strtotime( "$week week", strtotime( "1 January $year" ) );
184
+ $date_info = getdate( $target_week );
185
+ $day_of_week = $date_info['wday'];
186
// normal start day of the week is Monday
187
$adjusted_date = $day_of_week - $start_of_week;
188
// Get the timestamp of that day
189
+ $first_day = strtotime( "-$adjusted_date day", $target_week );
190
+
191
return $first_day;
192
}
193
194
+ function add_days_to_date( $givendate, $day = 0 ) {
195
+ $cd = strtotime( $givendate );
196
+ $newdate = date( 'Y-m-d h:i:s',
197
mktime(
198
+ date( 'h', $cd ),
199
+ date( 'i', $cd ),
200
+ date( 's', $cd ),
201
+ date( 'm', $cd ),
202
+ date( 'd', $cd ) + $day,
203
+ date( 'Y', $cd )
204
) );
205
+
206
+ return $newdate;
207
}
208
209
+ function mc_checkdate( $date ) {
210
+ $time = strtotime( $date );
211
+ $m = date( 'n', $time );
212
+ $d = date( 'j', $time );
213
+ $y = date( 'Y', $time );
214
+
215
+ return checkdate( $m, $d, $y );
216
}
217
218
+ function first_day_of_week( $date = false ) {
219
+ $start_of_week = ( get_option( 'start_of_week' ) == 1 || get_option( 'start_of_week' ) == 0 ) ? get_option( 'start_of_week' ) : 0;
220
if ( $date ) {
221
+ $today = date( 'w', $date );
222
+ $now = date( 'Y-m-d', $date );
223
} else {
224
+ $today = date( 'w', current_time( 'timestamp' ) );
225
+ $now = date( 'Y-m-d', current_time( 'timestamp' ) );
226
+ }
227
+ $month = $sub = 0; // don't change month
228
+ switch ( $today ) {
229
+ case 1:
230
+ $sub = ( $start_of_week == 1 ) ? 0 : 1;
231
+ break; // mon
232
+ case 2:
233
+ $sub = ( $start_of_week == 1 ) ? 1 : 2;
234
+ break; // tues
235
+ case 3:
236
+ $sub = ( $start_of_week == 1 ) ? 2 : 3;
237
+ break; // wed
238
+ case 4:
239
+ $sub = ( $start_of_week == 1 ) ? 3 : 4;
240
+ break; // thu
241
+ case 5:
242
+ $sub = ( $start_of_week == 1 ) ? 4 : 5;
243
+ break; // fri
244
+ case 6:
245
+ $sub = ( $start_of_week == 1 ) ? 5 : 6;
246
+ break; // sat
247
+ case 0:
248
+ $sub = ( $start_of_week == 1 ) ? 6 : 0;
249
+ break; // sun
250
+ }
251
+ $day = date( 'j', strtotime( $now . ' -' . $sub . ' day' ) );
252
if ( $sub != 0 ) {
253
+ if ( date( 'n', strtotime( $now . ' -' . $sub . ' day' ) ) != date( 'n', strtotime( $now ) ) ) {
254
+ $month = - 1;
255
} else {
256
$month = 0;
257
}
258
}
259
+
260
return array( $day, $month );
261
}
262
263
+ function mc_ordinal( $number ) {
264
+ // when fed a number, adds the English ordinal suffix. Works for any
265
+ // number, even negatives
266
+ if ( $number % 100 > 10 && $number % 100 < 14 ) {
267
+ $suffix = "th";
268
+ } else {
269
+ switch ( $number % 10 ) {
270
+ case 0:
271
+ $suffix = "th";
272
+ break;
273
+ case 1:
274
+ $suffix = "st";
275
+ break;
276
+ case 2:
277
+ $suffix = "nd";
278
+ break;
279
+ case 3:
280
+ $suffix = "rd";
281
+ break;
282
+ default:
283
+ $suffix = "th";
284
+ break;
285
+ }
286
+ }
287
288
+ return "${number}$suffix";
289
+ }
js/ajax.js ADDED
@@ -0,0 +1,33 @@
1
+ (function ($) {
2
+ $(function () {
3
+ // Delete single instances of recurring events.
4
+ $( '.mc_response' ).hide();
5
+ $('button.delete_occurrence').on( 'click', function (e) {
6
+ e.preventDefault();
7
+ var value = $(this).attr( 'data-value' );
8
+ var data = {
9
+ 'action': mc_data.action,
10
+ 'occur_id': value,
11
+ 'security': mc_data.security
12
+ };
13
+ $.post( ajaxurl, data, function (response) {
14
+ if ( response.success == 1 ) {
15
+ $( "button[data-value='"+value+"']" ).parent( 'li' ).hide();
16
+ }
17
+ $('.mc_response').text( response.response ).show( 300 );
18
+ }, "json" );
19
+ });
20
+ // display notice informing users of lack of support for recur month by day
21
+ $( '.mc_recur_notice' ).hide();
22
+ $( '#e_recur' ).on( 'change', function (e) {
23
+ var recur = $(this).val();
24
+ if ( recur == 'U' ) {
25
+ $( '#e_every' ).attr( 'max', 1 ).val( 1 );
26
+ $( '.mc_recur_notice' ).show( 300 );
27
+ } else {
28
+ $( '.mc_recur_notice' ).hide();
29
+ }
30
+ });
31
+
32
+ });
33
+ }(jQuery));
js/color-picker.js CHANGED
@@ -1,3 +1,3 @@
1
- jQuery(document).ready(function($){
2
$('.mc-color-input').wpColorPicker();
3
});
1
+ jQuery(document).ready(function ($) {
2
$('.mc-color-input').wpColorPicker();
3
});
js/gmap3.min.js CHANGED
@@ -7,4 +7,1924 @@
7
* Contact : jbdemonte@gmail.com
8
* Web site : http://gmap3.net
9
*/
10
- (function(y,t){var z,i=0;function J(){if(!z){z={verbose:false,queryLimit:{attempt:5,delay:250,random:250},classes:{Map:google.maps.Map,Marker:google.maps.Marker,InfoWindow:google.maps.InfoWindow,Circle:google.maps.Circle,Rectangle:google.maps.Rectangle,OverlayView:google.maps.OverlayView,StreetViewPanorama:google.maps.StreetViewPanorama,KmlLayer:google.maps.KmlLayer,TrafficLayer:google.maps.TrafficLayer,BicyclingLayer:google.maps.BicyclingLayer,GroundOverlay:google.maps.GroundOverlay,StyledMapType:google.maps.StyledMapType,ImageMapType:google.maps.ImageMapType},map:{mapTypeId:google.maps.MapTypeId.ROADMAP,center:[46.578498,2.457275],zoom:2},overlay:{pane:"floatPane",content:"",offset:{x:0,y:0}},geoloc:{getCurrentPosition:{maximumAge:60000,timeout:5000}}}}}function k(M,L){return M!==t?M:"gmap3_"+(L?i+1:++i)}function d(L){var O=function(P){return parseInt(P,10)},N=google.maps.version.split(".").map(O),M;L=L.split(".").map(O);for(M=0;M<L.length;M++){if(N.hasOwnProperty(M)){if(N[M]<L[M]){return false}}else{return false}}return true}function n(P,L,N,Q,O){if(L.todo.events||L.todo.onces){var M={id:Q,data:L.todo.data,tag:L.todo.tag};if(L.todo.events){y.each(L.todo.events,function(R,U){var T=P,S=U;if(y.isArray(U)){T=U[0];S=U[1]}google.maps.event.addListener(N,R,function(V){S.apply(T,[O?O:N,V,M])})})}if(L.todo.onces){y.each(L.todo.onces,function(R,U){var T=P,S=U;if(y.isArray(U)){T=U[0];S=U[1]}google.maps.event.addListenerOnce(N,R,function(V){S.apply(T,[O?O:N,V,M])})})}}}function l(){var L=[];this.empty=function(){return !L.length};this.add=function(M){L.push(M)};this.get=function(){return L.length?L[0]:false};this.ack=function(){L.shift()}}function w(T,L,N){var R={},P=this,Q,S={latLng:{map:false,marker:false,infowindow:false,circle:false,overlay:false,getlatlng:false,getmaxzoom:false,getelevation:false,streetviewpanorama:false,getaddress:true},geoloc:{getgeoloc:true}};if(typeof N==="string"){N=M(N)}function M(V){var U={};U[V]={};return U}function O(){var U;for(U in N){if(U in R){continue}return U}}this.run=function(){var U,V;while(U=O()){if(typeof T[U]==="function"){Q=U;V=y.extend(true,{},z[U]||{},N[U].options||{});if(U in S.latLng){if(N[U].values){x(N[U].values,T,T[U],{todo:N[U],opts:V,session:R})}else{v(T,T[U],S.latLng[U],{todo:N[U],opts:V,session:R})}}else{if(U in S.geoloc){o(T,T[U],{todo:N[U],opts:V,session:R})}else{T[U].apply(T,[{todo:N[U],opts:V,session:R}])}}return}else{R[U]=null}}L.apply(T,[N,R])};this.ack=function(U){R[Q]=U;P.run.apply(P,[])}}function c(N){var L,M=[];for(L in N){M.push(L)}return M}function b(N,Q){var L={};if(N.todo){for(var M in N.todo){if((M!=="options")&&(M!=="values")){L[M]=N.todo[M]}}}var O,P=["data","tag","id","events","onces"];for(O=0;O<P.length;O++){A(L,P[O],Q,N.todo)}L.options=y.extend({},N.opts||{},Q.options||{});return L}function A(N,M){for(var L=2;L<arguments.length;L++){if(M in arguments[L]){N[M]=arguments[L][M];return}}}function r(){var L=[];this.get=function(S){if(L.length){var P,O,N,R,M,Q=c(S);for(P=0;P<L.length;P++){R=L[P];M=Q.length==R.keys.length;for(O=0;(O<Q.length)&&M;O++){N=Q[O];M=N in R.request;if(M){if((typeof S[N]==="object")&&("equals" in S[N])&&(typeof S[N]==="function")){M=S[N].equals(R.request[N])}else{M=S[N]===R.request[N]}}}if(M){return R.results}}}};this.store=function(N,M){L.push({request:N,keys:c(N),results:M})}}function e(Q,P,O,L){var N=this,M=[];z.classes.OverlayView.call(this);this.setMap(Q);this.onAdd=function(){var R=this.getPanes();if(P.pane in R){y(R[P.pane]).append(L)}y.each("dblclick click mouseover mousemove mouseout mouseup mousedown".split(" "),function(T,S){M.push(google.maps.event.addDomListener(L[0],S,function(U){y.Event(U).stopPropagation();google.maps.event.trigger(N,S,[U]);N.draw()}))});M.push(google.maps.event.addDomListener(L[0],"contextmenu",function(S){y.Event(S).stopPropagation();google.maps.event.trigger(N,"rightclick",[S]);N.draw()}))};this.getPosition=function(){return O};this.draw=function(){var R=this.getProjection().fromLatLngToDivPixel(O);L.css("left",(R.x+P.offset.x)+"px").css("top",(R.y+P.offset.y)+"px")};this.onRemove=function(){for(var R=0;R<M.length;R++){google.maps.event.removeListener(M[R])}L.remove()};this.hide=function(){L.hide()};this.show=function(){L.show()};this.toggle=function(){if(L){if(L.is(":visible")){this.show()}else{this.hide()}}};this.toggleDOM=function(){if(this.getMap()){this.setMap(null)}else{this.setMap(Q)}};this.getDOMElement=function(){return L[0]}}function f(O,L){function M(){this.onAdd=function(){};this.onRemove=function(){};this.draw=function(){};return z.classes.OverlayView.apply(this,[])}M.prototype=z.classes.OverlayView.prototype;var N=new M();N.setMap(O);return N}function F(ae,ao,aa){var an=false,ai=false,af=false,Z=false,W=true,V=this,N=[],T={},ad={},U={},aj=[],ah=[],O=[],ak=f(ao,aa.radius),Y,ap,am,P,Q;S();function L(aq){if(!aj[aq]){delete ah[aq].options.map;aj[aq]=new z.classes.Marker(ah[aq].options);n(ae,{todo:ah[aq]},aj[aq],ah[aq].id)}}this.getById=function(aq){if(aq in ad){L(ad[aq]);return aj[ad[aq]]}return false};this.rm=function(ar){var aq=ad[ar];if(aj[aq]){aj[aq].setMap(null)}delete aj[aq];aj[aq]=false;delete ah[aq];ah[aq]=false;delete O[aq];O[aq]=false;delete ad[ar];delete U[aq];ai=true};this.clearById=function(aq){if(aq in ad){this.rm(aq);return true}};this.clear=function(az,av,aA){var ar,ay,at,aw,au,ax=[],aq=C(aA);if(az){ar=ah.length-1;ay=-1;at=-1}else{ar=0;ay=ah.length;at=1}for(aw=ar;aw!=ay;aw+=at){if(ah[aw]){if(!aq||aq(ah[aw].tag)){ax.push(U[aw]);if(av||az){break}}}}for(au=0;au<ax.length;au++){this.rm(ax[au])}};this.add=function(aq,ar){aq.id=k(aq.id);this.clearById(aq.id);ad[aq.id]=aj.length;U[aj.length]=aq.id;aj.push(null);ah.push(aq);O.push(ar);ai=true};this.addMarker=function(ar,aq){aq=aq||{};aq.id=k(aq.id);this.clearById(aq.id);if(!aq.options){aq.options={}}aq.options.position=ar.getPosition();n(ae,{todo:aq},ar,aq.id);ad[aq.id]=aj.length;U[aj.length]=aq.id;aj.push(ar);ah.push(aq);O.push(aq.data||{});ai=true};this.todo=function(aq){return ah[aq]};this.value=function(aq){return O[aq]};this.marker=function(aq){if(aq in aj){L(aq);return aj[aq]}return false};this.markerIsSet=function(aq){return Boolean(aj[aq])};this.setMarker=function(ar,aq){aj[ar]=aq};this.store=function(aq,ar,at){T[aq.ref]={obj:ar,shadow:at}};this.free=function(){for(var aq=0;aq<N.length;aq++){google.maps.event.removeListener(N[aq])}N=[];y.each(T,function(ar){ac(ar)});T={};y.each(ah,function(ar){ah[ar]=null});ah=[];y.each(aj,function(ar){if(aj[ar]){aj[ar].setMap(null);delete aj[ar]}});aj=[];y.each(O,function(ar){delete O[ar]});O=[];ad={};U={}};this.filter=function(aq){am=aq;ag()};this.enable=function(aq){if(W!=aq){W=aq;ag()}};this.display=function(aq){P=aq};this.error=function(aq){Q=aq};this.beginUpdate=function(){an=true};this.endUpdate=function(){an=false;if(ai){ag()}};this.autofit=function(ar){for(var aq=0;aq<ah.length;aq++){if(ah[aq]){ar.extend(ah[aq].options.position)}}};function S(){ap=ak.getProjection();if(!ap){setTimeout(function(){S.apply(V,[])},25);return}Z=true;N.push(google.maps.event.addListener(ao,"zoom_changed",function(){al()}));N.push(google.maps.event.addListener(ao,"bounds_changed",function(){al()}));ag()}function ac(aq){if(typeof T[aq]==="object"){if(typeof(T[aq].obj.setMap)==="function"){T[aq].obj.setMap(null)}if(typeof(T[aq].obj.remove)==="function"){T[aq].obj.remove()}if(typeof(T[aq].shadow.remove)==="function"){T[aq].obj.remove()}if(typeof(T[aq].shadow.setMap)==="function"){T[aq].shadow.setMap(null)}delete T[aq].obj;delete T[aq].shadow}else{if(aj[aq]){aj[aq].setMap(null)}}delete T[aq]}function M(){var ay,ax,aw,au,av,at,ar,aq;if(arguments[0] instanceof google.maps.LatLng){ay=arguments[0].lat();aw=arguments[0].lng();if(arguments[1] instanceof google.maps.LatLng){ax=arguments[1].lat();au=arguments[1].lng()}else{ax=arguments[1];au=arguments[2]}}else{ay=arguments[0];aw=arguments[1];if(arguments[2] instanceof google.maps.LatLng){ax=arguments[2].lat();au=arguments[2].lng()}else{ax=arguments[2];au=arguments[3]}}av=Math.PI*ay/180;at=Math.PI*aw/180;ar=Math.PI*ax/180;aq=Math.PI*au/180;return 1000*6371*Math.acos(Math.min(Math.cos(av)*Math.cos(ar)*Math.cos(at)*Math.cos(aq)+Math.cos(av)*Math.sin(at)*Math.cos(ar)*Math.sin(aq)+Math.sin(av)*Math.sin(ar),1))}function R(){var aq=M(ao.getCenter(),ao.getBounds().getNorthEast()),ar=new google.maps.Circle({center:ao.getCenter(),radius:1.25*aq});return ar.getBounds()}function X(){var ar={},aq;for(aq in T){ar[aq]=true}return ar}function al(){clearTimeout(Y);Y=setTimeout(function(){ag()},25)}function ab(ar){var au=ap.fromLatLngToDivPixel(ar),at=ap.fromDivPixelToLatLng(new google.maps.Point(au.x+aa.radius,au.y-aa.radius)),aq=ap.fromDivPixelToLatLng(new google.maps.Point(au.x-aa.radius,au.y+aa.radius));return new google.maps.LatLngBounds(aq,at)}function ag(){if(an||af||!Z){return}var aE=[],aG={},aF=ao.getZoom(),aH=("maxZoom" in aa)&&(aF>aa.maxZoom),aw=X(),av,au,at,aA,ar=false,aq,aD,ay,az,aB,aC,ax;ai=false;if(aF>3){aq=R();ar=aq.getSouthWest().lng()<aq.getNorthEast().lng()}for(av=0;av<ah.length;av++){if(ah[av]&&(!ar||aq.contains(ah[av].options.position))&&(!am||am(O[av]))){aE.push(av)}}while(1){av=0;while(aG[av]&&(av<aE.length)){av++}if(av==aE.length){break}aA=[];if(W&&!aH){ax=10;do{az=aA;aA=[];ax--;if(az.length){ay=aq.getCenter()}else{ay=ah[aE[av]].options.position}aq=ab(ay);for(au=av;au<aE.length;au++){if(aG[au]){continue}if(aq.contains(ah[aE[au]].options.position)){aA.push(au)}}}while((az.length<aA.length)&&(aA.length>1)&&ax)}else{for(au=av;au<aE.length;au++){if(aG[au]){continue}aA.push(au);break}}aD={indexes:[],ref:[]};aB=aC=0;for(at=0;at<aA.length;at++){aG[aA[at]]=true;aD.indexes.push(aE[aA[at]]);aD.ref.push(aE[aA[at]]);aB+=ah[aE[aA[at]]].options.position.lat();aC+=ah[aE[aA[at]]].options.position.lng()}aB/=aA.length;aC/=aA.length;aD.latLng=new google.maps.LatLng(aB,aC);aD.ref=aD.ref.join("-");if(aD.ref in aw){delete aw[aD.ref]}else{if(aA.length===1){T[aD.ref]=true}P(aD)}}y.each(aw,function(aI){ac(aI)});af=false}}function a(M,L){this.id=function(){return M};this.filter=function(N){L.filter(N)};this.enable=function(){L.enable(true)};this.disable=function(){L.enable(false)};this.add=function(O,N,P){if(!P){L.beginUpdate()}L.addMarker(O,N);if(!P){L.endUpdate()}};this.getById=function(N){return L.getById(N)};this.clearById=function(P,O){var N;if(!O){L.beginUpdate()}N=L.clearById(P);if(!O){L.endUpdate()}return N};this.clear=function(P,Q,N,O){if(!O){L.beginUpdate()}L.clear(P,Q,N);if(!O){L.endUpdate()}}}function D(){var M={},N={};function L(P){return{id:P.id,name:P.name,object:P.obj,tag:P.tag,data:P.data}}this.add=function(R,Q,T,S){var P=R.todo||{},U=k(P.id);if(!M[Q]){M[Q]=[]}if(U in N){this.clearById(U)}N[U]={obj:T,sub:S,name:Q,id:U,tag:P.tag,data:P.data};M[Q].push(U);return U};this.getById=function(R,Q,P){if(R in N){if(Q){return N[R].sub}else{if(P){return L(N[R])}}return N[R].obj}return false};this.get=function(R,T,P,S){var V,U,Q=C(P);if(!M[R]||!M[R].length){return null}V=M[R].length;while(V){V--;U=M[R][T?V:M[R].length-V-1];if(U&&N[U]){if(Q&&!Q(N[U].tag)){continue}return S?L(N[U]):N[U].obj}}return null};this.all=function(S,Q,T){var P=[],R=C(Q),U=function(X){var V,W;for(V=0;V<M[X].length;V++){W=M[X][V];if(W&&N[W]){if(R&&!R(N[W].tag)){continue}P.push(T?L(N[W]):N[W].obj)}}};if(S in M){U(S)}else{if(S===t){for(S in M){U(S)}}}return P};function O(P){if(typeof(P.setMap)==="function"){P.setMap(null)}if(typeof(P.remove)==="function"){P.remove()}if(typeof(P.free)==="function"){P.free()}P=null}this.rm=function(S,Q,R){var P,T;if(!M[S]){return false}if(Q){if(R){for(P=M[S].length-1;P>=0;P--){T=M[S][P];if(Q(N[T].tag)){break}}}else{for(P=0;P<M[S].length;P++){T=M[S][P];if(Q(N[T].tag)){break}}}}else{P=R?M[S].length-1:0}if(!(P in M[S])){return false}return this.clearById(M[S][P],P)};this.clearById=function(S,P){if(S in N){var R,Q=N[S].name;for(R=0;P===t&&R<M[Q].length;R++){if(S===M[Q][R]){P=R}}O(N[S].obj);if(N[S].sub){O(N[S].sub)}delete N[S];M[Q].splice(P,1);return true}return false};this.objGetById=function(R){var Q;if(M.clusterer){for(var P in M.clusterer){if((Q=N[M.clusterer[P]].obj.getById(R))!==false){return Q}}}return false};this.objClearById=function(Q){if(M.clusterer){for(var P in M.clusterer){if(N[M.clusterer[P]].obj.clearById(Q)){return true}}}return null};this.clear=function(V,U,W,P){var R,T,S,Q=C(P);if(!V||!V.length){V=[];for(R in M){V.push(R)}}else{V=g(V)}for(T=0;T<V.length;T++){S=V[T];if(U){this.rm(S,Q,true)}else{if(W){this.rm(S,Q,false)}else{while(this.rm(S,Q,false)){}}}}};this.objClear=function(S,R,T,Q){if(M.clusterer&&(y.inArray("marker",S)>=0||!S.length)){for(var P in M.clusterer){N[M.clusterer[P]].obj.clear(R,T,Q)}}}}var m={},H=new r();function p(){if(!m.geocoder){m.geocoder=new google.maps.Geocoder()}return m.geocoder}function G(){if(!m.directionsService){m.directionsService=new google.maps.DirectionsService()}return m.directionsService}function h(){if(!m.elevationService){m.elevationService=new google.maps.ElevationService()}return m.elevationService}function q(){if(!m.maxZoomService){m.maxZoomService=new google.maps.MaxZoomService()}return m.maxZoomService}function B(){if(!m.distanceMatrixService){m.distanceMatrixService=new google.maps.DistanceMatrixService()}return m.distanceMatrixService}function u(){if(z.verbose){var L,M=[];if(window.console&&(typeof console.error==="function")){for(L=0;L<arguments.length;L++){M.push(arguments[L])}console.error.apply(console,M)}else{M="";for(L=0;L<arguments.length;L++){M+=arguments[L].toString()+" "}alert(M)}}}function E(L){return(typeof(L)==="number"||typeof(L)==="string")&&L!==""&&!isNaN(L)}function g(N){var M,L=[];if(N!==t){if(typeof(N)==="object"){if(typeof(N.length)==="number"){L=N}else{for(M in N){L.push(N[M])}}}else{L.push(N)}}return L}function C(L){if(L){if(typeof L==="function"){return L}L=g(L);return function(N){if(N===t){return false}if(typeof N==="object"){for(var M=0;M<N.length;M++){if(y.inArray(N[M],L)>=0){return true}}return false}return y.inArray(N,L)>=0}}}function I(M,O,L){var N=O?M:null;if(!M||(typeof M==="string")){return N}if(M.latLng){return I(M.latLng)}if(M instanceof google.maps.LatLng){return M}else{if(E(M.lat)){return new google.maps.LatLng(M.lat,M.lng)}else{if(!L&&y.isArray(M)){if(!E(M[0])||!E(M[1])){return N}return new google.maps.LatLng(M[0],M[1])}}}return N}function j(M){var N,L;if(!M||M instanceof google.maps.LatLngBounds){return M||null}if(y.isArray(M)){if(M.length==2){N=I(M[0]);L=I(M[1])}else{if(M.length==4){N=I([M[0],M[1]]);L=I([M[2],M[3]])}}}else{if(("ne" in M)&&("sw" in M)){N=I(M.ne);L=I(M.sw)}else{if(("n" in M)&&("e" in M)&&("s" in M)&&("w" in M)){N=I([M.n,M.e]);L=I([M.s,M.w])}}}if(N&&L){return new google.maps.LatLngBounds(L,N)}return null}function v(T,L,O,S,P){var N=O?I(S.todo,false,true):false,R=N?{latLng:N}:(S.todo.address?(typeof(S.todo.address)==="string"?{address:S.todo.address}:S.todo.address):false),M=R?H.get(R):false,Q=this;if(R){P=P||0;if(M){S.latLng=M.results[0].geometry.location;S.results=M.results;S.status=M.status;L.apply(T,[S])}else{if(R.location){R.location=I(R.location)}if(R.bounds){R.bounds=j(R.bounds)}p().geocode(R,function(V,U){if(U===google.maps.GeocoderStatus.OK){H.store(R,{results:V,status:U});S.latLng=V[0].geometry.location;S.results=V;S.status=U;L.apply(T,[S])}else{if((U===google.maps.GeocoderStatus.OVER_QUERY_LIMIT)&&(P<z.queryLimit.attempt)){setTimeout(function(){v.apply(Q,[T,L,O,S,P+1])},z.queryLimit.delay+Math.floor(Math.random()*z.queryLimit.random))}else{u("geocode failed",U,R);S.latLng=S.results=false;S.status=U;L.apply(T,[S])}}})}}else{S.latLng=I(S.todo,false,true);L.apply(T,[S])}}function x(Q,L,R,M){var O=this,N=-1;function P(){do{N++}while((N<Q.length)&&!("address" in Q[N]));if(N>=Q.length){R.apply(L,[M]);return}v(O,function(S){delete S.todo;y.extend(Q[N],S);P.apply(O,[])},true,{todo:Q[N]})}P()}function o(L,O,M){var N=false;if(navigator&&navigator.geolocation){navigator.geolocation.getCurrentPosition(function(P){if(N){return}N=true;M.latLng=new google.maps.LatLng(P.coords.latitude,P.coords.longitude);O.apply(L,[M])},function(){if(N){return}N=true;M.latLng=false;O.apply(L,[M])},M.opts.getCurrentPosition)}else{M.latLng=false;O.apply(L,[M])}}function K(T){var S=this,U=new l(),V=new D(),N=null,P;this._plan=function(Z){for(var Y=0;Y<Z.length;Y++){U.add(new w(S,R,Z[Y]))}Q()};function Q(){if(!P&&(P=U.get())){P.run()}}function R(){P=null;U.ack();Q.call(S)}function X(Y){if(Y.todo.callback){var Z=Array.prototype.slice.call(arguments,1);if(typeof Y.todo.callback==="function"){Y.todo.callback.apply(T,Z)}else{if(y.isArray(Y.todo.callback)){if(typeof Y.todo.callback[1]==="function"){Y.todo.callback[1].apply(Y.todo.callback[0],Z)}}}}}function O(Y,Z,aa){if(aa){n(T,Y,Z,aa)}X(Y,Z);P.ack(Z)}function L(aa,Y){Y=Y||{};if(N){if(Y.todo&&Y.todo.options){if(Y.todo.options.center){Y.todo.options.center=I(Y.todo.options.center)}N.setOptions(Y.todo.options)}}else{var Z=Y.opts||y.extend(true,{},z.map,Y.todo&&Y.todo.options?Y.todo.options:{});Z.center=aa||I(Z.center);N=new z.classes.Map(T.get(0),Z)}}this.map=function(Y){L(Y.latLng,Y);n(T,Y,N);O(Y,N)};this.destroy=function(Y){V.clear();T.empty();if(N){N=null}O(Y,true)};this.infowindow=function(Z){var aa=[],Y="values" in Z.todo;if(!Y){if(Z.latLng){Z.opts.position=Z.latLng}Z.todo.values=[{options:Z.opts}]}y.each(Z.todo.values,function(ac,ad){var af,ae,ab=b(Z,ad);ab.options.position=ab.options.position?I(ab.options.position):I(ad.latLng);if(!N){L(ab.options.position)}ae=new z.classes.InfoWindow(ab.options);if(ae&&((ab.open===t)||ab.open)){if(Y){ae.open(N,ab.anchor?ab.anchor:t)}else{ae.open(N,ab.anchor?ab.anchor:(Z.latLng?t:(Z.session.marker?Z.session.marker:t)))}}aa.push(ae);af=V.add({todo:ab},"infowindow",ae);n(T,{todo:ab},ae,af)});O(Z,Y?aa:aa[0])};this.circle=function(Z){var aa=[],Y="values" in Z.todo;if(!Y){Z.opts.center=Z.latLng||I(Z.opts.center);Z.todo.values=[{options:Z.opts}]}if(!Z.todo.values.length){O(Z,false);return}y.each(Z.todo.values,function(ac,ad){var af,ae,ab=b(Z,ad);ab.options.center=ab.options.center?I(ab.options.center):I(ad);if(!N){L(ab.options.center)}ab.options.map=N;ae=new z.classes.Circle(ab.options);aa.push(ae);af=V.add({todo:ab},"circle",ae);n(T,{todo:ab},ae,af)});O(Z,Y?aa:aa[0])};this.overlay=function(aa,Z){var ab=[],Y="values" in aa.todo;if(!Y){aa.todo.values=[{latLng:aa.latLng,options:aa.opts}]}if(!aa.todo.values.length){O(aa,false);return}if(!e.__initialised){e.prototype=new z.classes.OverlayView();e.__initialised=true}y.each(aa.todo.values,function(ae,af){var ah,ag,ac=b(aa,af),ad=y(document.createElement("div")).css({border:"none",borderWidth:"0px",position:"absolute"});ad.append(ac.options.content);ag=new e(N,ac.options,I(ac)||I(af),ad);ab.push(ag);ad=null;if(!Z){ah=V.add(aa,"overlay",ag);n(T,{todo:ac},ag,ah)}});if(Z){return ab[0]}O(aa,Y?ab:ab[0])};this.getaddress=function(Y){X(Y,Y.results,Y.status);P.ack()};this.getlatlng=function(Y){X(Y,Y.results,Y.status);P.ack()};this.getmaxzoom=function(Y){q().getMaxZoomAtLatLng(Y.latLng,function(Z){X(Y,Z.status===google.maps.MaxZoomStatus.OK?Z.zoom:false,status);P.ack()})};this.getelevation=function(Z){var aa,Y=[],ab=function(ad,ac){X(Z,ac===google.maps.ElevationStatus.OK?ad:false,ac);P.ack()};if(Z.latLng){Y.push(Z.latLng)}else{Y=g(Z.todo.locations||[]);for(aa=0;aa<Y.length;aa++){Y[aa]=I(Y[aa])}}if(Y.length){h().getElevationForLocations({locations:Y},ab)}else{if(Z.todo.path&&Z.todo.path.length){for(aa=0;aa<Z.todo.path.length;aa++){Y.push(I(Z.todo.path[aa]))}}if(Y.length){h().getElevationAlongPath({path:Y,samples:Z.todo.samples},ab)}else{P.ack()}}};this.defaults=function(Y){y.each(Y.todo,function(Z,aa){if(typeof z[Z]==="object"){z[Z]=y.extend({},z[Z],aa)}else{z[Z]=aa}});P.ack(true)};this.rectangle=function(Z){var aa=[],Y="values" in Z.todo;if(!Y){Z.todo.values=[{options:Z.opts}]}if(!Z.todo.values.length){O(Z,false);return}y.each(Z.todo.values,function(ac,ad){var af,ae,ab=b(Z,ad);ab.options.bounds=ab.options.bounds?j(ab.options.bounds):j(ad);if(!N){L(ab.options.bounds.getCenter())}ab.options.map=N;ae=new z.classes.Rectangle(ab.options);aa.push(ae);af=V.add({todo:ab},"rectangle",ae);n(T,{todo:ab},ae,af)});O(Z,Y?aa:aa[0])};function M(Z,aa,ab){var ac=[],Y="values" in Z.todo;if(!Y){Z.todo.values=[{options:Z.opts}]}if(!Z.todo.values.length){O(Z,false);return}L();y.each(Z.todo.values,function(af,ah){var aj,ag,ae,ai,ad=b(Z,ah);if(ad.options[ab]){if(ad.options[ab][0][0]&&y.isArray(ad.options[ab][0][0])){for(ag=0;ag<ad.options[ab].length;ag++){for(ae=0;ae<ad.options[ab][ag].length;ae++){ad.options[ab][ag][ae]=I(ad.options[ab][ag][ae])}}}else{for(ag=0;ag<ad.options[ab].length;ag++){ad.options[ab][ag]=I(ad.options[ab][ag])}}}ad.options.map=N;ai=new google.maps[aa](ad.options);ac.push(ai);aj=V.add({todo:ad},aa.toLowerCase(),ai);n(T,{todo:ad},ai,aj)});O(Z,Y?ac:ac[0])}this.polyline=function(Y){M(Y,"Polyline","path")};this.polygon=function(Y){M(Y,"Polygon","paths")};this.trafficlayer=function(Y){L();var Z=V.get("trafficlayer");if(!Z){Z=new z.classes.TrafficLayer();Z.setMap(N);V.add(Y,"trafficlayer",Z)}O(Y,Z)};this.bicyclinglayer=function(Y){L();var Z=V.get("bicyclinglayer");if(!Z){Z=new z.classes.BicyclingLayer();Z.setMap(N);V.add(Y,"bicyclinglayer",Z)}O(Y,Z)};this.groundoverlay=function(Y){Y.opts.bounds=j(Y.opts.bounds);if(Y.opts.bounds){L(Y.opts.bounds.getCenter())}var aa,Z=new z.classes.GroundOverlay(Y.opts.url,Y.opts.bounds,Y.opts.opts);Z.setMap(N);aa=V.add(Y,"groundoverlay",Z);O(Y,Z,aa)};this.streetviewpanorama=function(Y){if(!Y.opts.opts){Y.opts.opts={}}if(Y.latLng){Y.opts.opts.position=Y.latLng}else{if(Y.opts.opts.position){Y.opts.opts.position=I(Y.opts.opts.position)}}if(Y.todo.divId){Y.opts.container=document.getElementById(Y.todo.divId)}else{if(Y.opts.container){Y.opts.container=y(Y.opts.container).get(0)}}var aa,Z=new z.classes.StreetViewPanorama(Y.opts.container,Y.opts.opts);if(Z){N.setStreetView(Z)}aa=V.add(Y,"streetviewpanorama",Z);O(Y,Z,aa)};this.kmllayer=function(Z){var aa=[],Y="values" in Z.todo;if(!Y){Z.todo.values=[{options:Z.opts}]}if(!Z.todo.values.length){O(Z,false);return}y.each(Z.todo.values,function(ad,ae){var ag,af,ac,ab=b(Z,ae);if(!N){L()}ac=ab.options;if(ab.options.opts){ac=ab.options.opts;if(ab.options.url){ac.url=ab.options.url}}ac.map=N;if(d("3.10")){af=new z.classes.KmlLayer(ac)}else{af=new z.classes.KmlLayer(ac.url,ac)}aa.push(af);ag=V.add({todo:ab},"kmllayer",af);n(T,{todo:ab},af,ag)});O(Z,Y?aa:aa[0])};this.panel=function(ab){L();var ad,Y=0,ac=0,aa,Z=y(document.createElement("div"));Z.css({position:"absolute",zIndex:1000,visibility:"hidden"});if(ab.opts.content){aa=y(ab.opts.content);Z.append(aa);T.first().prepend(Z);if(ab.opts.left!==t){Y=ab.opts.left}else{if(ab.opts.right!==t){Y=T.width()-aa.width()-ab.opts.right}else{if(ab.opts.center){Y=(T.width()-aa.width())/2}}}if(ab.opts.top!==t){ac=ab.opts.top}else{if(ab.opts.bottom!==t){ac=T.height()-aa.height()-ab.opts.bottom}else{if(ab.opts.middle){ac=(T.height()-aa.height())/2}}}Z.css({top:ac,left:Y,visibility:"visible"})}ad=V.add(ab,"panel",Z);O(ab,Z,ad);Z=null};function W(aa){var af=new F(T,N,aa),Y={},ab={},ae=[],ad=/^[0-9]+#x2F;,ac,Z;for(Z in aa){if(ad.test(Z)){ae.push(1*Z);ab[Z]=aa[Z];ab[Z].width=ab[Z].width||0;ab[Z].height=ab[Z].height||0}else{Y[Z]=aa[Z]}}ae.sort(function(ah,ag){return ah>ag});if(Y.calculator){ac=function(ag){var ah=[];y.each(ag,function(aj,ai){ah.push(af.value(ai))});return Y.calculator.apply(T,[ah])}}else{ac=function(ag){return ag.length}}af.error(function(){u.apply(S,arguments)});af.display(function(ag){var ai,aj,am,ak,al,ah=ac(ag.indexes);if(aa.force||ah>1){for(ai=0;ai<ae.length;ai++){if(ae[ai]<=ah){aj=ab[ae[ai]]}}}if(aj){al=aj.offset||[-aj.width/2,-aj.height/2];am=y.extend({},Y);am.options=y.extend({pane:"overlayLayer",content:aj.content?aj.content.replace("CLUSTER_COUNT",ah):"",offset:{x:("x" in al?al.x:al[0])||0,y:("y" in al?al.y:al[1])||0}},Y.options||{});ak=S.overlay({todo:am,opts:am.options,latLng:I(ag)},true);am.options.pane="floatShadow";am.options.content=y(document.createElement("div")).width(aj.width+"px").height(aj.height+"px").css({cursor:"pointer"});shadow=S.overlay({todo:am,opts:am.options,latLng:I(ag)},true);Y.data={latLng:I(ag),markers:[]};y.each(ag.indexes,function(ao,an){Y.data.markers.push(af.value(an));if(af.markerIsSet(an)){af.marker(an).setMap(null)}});n(T,{todo:Y},shadow,t,{main:ak,shadow:shadow});af.store(ag,ak,shadow)}else{y.each(ag.indexes,function(ao,an){af.marker(an).setMap(N)})}});return af}this.marker=function(aa){var Y="values" in aa.todo,ad=!N;if(!Y){aa.opts.position=aa.latLng||I(aa.opts.position);aa.todo.values=[{options:aa.opts}]}if(!aa.todo.values.length){O(aa,false);return}if(ad){L()}if(aa.todo.cluster&&!N.getBounds()){google.maps.event.addListenerOnce(N,"bounds_changed",function(){S.marker.apply(S,[aa])});return}if(aa.todo.cluster){var Z,ab;if(aa.todo.cluster instanceof a){Z=aa.todo.cluster;ab=V.getById(Z.id(),true)}else{ab=W(aa.todo.cluster);Z=new a(k(aa.todo.id,true),ab);V.add(aa,"clusterer",Z,ab)}ab.beginUpdate();y.each(aa.todo.values,function(af,ag){var ae=b(aa,ag);ae.options.position=ae.options.position?I(ae.options.position):I(ag);ae.options.map=N;if(ad){N.setCenter(ae.options.position);ad=false}ab.add(ae,ag)});ab.endUpdate();O(aa,Z)}else{var ac=[];y.each(aa.todo.values,function(af,ag){var ai,ah,ae=b(aa,ag);ae.options.position=ae.options.position?I(ae.options.position):I(ag);ae.options.map=N;if(ad){N.setCenter(ae.options.position);ad=false}ah=new z.classes.Marker(ae.options);ac.push(ah);ai=V.add({todo:ae},"marker",ah);n(T,{todo:ae},ah,ai)});O(aa,Y?ac:ac[0])}};this.getroute=function(Y){Y.opts.origin=I(Y.opts.origin,true);Y.opts.destination=I(Y.opts.destination,true);G().route(Y.opts,function(aa,Z){X(Y,Z==google.maps.DirectionsStatus.OK?aa:false,Z);P.ack()})};this.directionsrenderer=function(Y){Y.opts.map=N;var aa,Z=new google.maps.DirectionsRenderer(Y.opts);if(Y.todo.divId){Z.setPanel(document.getElementById(Y.todo.divId))}else{if(Y.todo.container){Z.setPanel(y(Y.todo.container).get(0))}}aa=V.add(Y,"directionsrenderer",Z);O(Y,Z,aa)};this.getgeoloc=function(Y){O(Y,Y.latLng)};this.styledmaptype=function(Y){L();var Z=new z.classes.StyledMapType(Y.todo.styles,Y.opts);N.mapTypes.set(Y.todo.id,Z);O(Y,Z)};this.imagemaptype=function(Y){L();var Z=new z.classes.ImageMapType(Y.opts);N.mapTypes.set(Y.todo.id,Z);O(Y,Z)};this.autofit=function(Y){var Z=new google.maps.LatLngBounds();y.each(V.all(),function(aa,ab){if(ab.getPosition){Z.extend(ab.getPosition())}else{if(ab.getBounds){Z.extend(ab.getBounds().getNorthEast());Z.extend(ab.getBounds().getSouthWest())}else{if(ab.getPaths){ab.getPaths().forEach(function(ac){ac.forEach(function(ad){Z.extend(ad)})})}else{if(ab.getPath){ab.getPath().forEach(function(ac){Z.extend(ac);""})}else{if(ab.getCenter){Z.extend(ab.getCenter())}else{if(ab instanceof a){ab=V.getById(ab.id(),true);if(ab){ab.autofit(Z)}}}}}}}});if(!Z.isEmpty()&&(!N.getBounds()||!N.getBounds().equals(Z))){if("maxZoom" in Y.todo){google.maps.event.addListenerOnce(N,"bounds_changed",function(){if(this.getZoom()>Y.todo.maxZoom){this.setZoom(Y.todo.maxZoom)}})}N.fitBounds(Z)}O(Y,true)};this.clear=function(Y){if(typeof Y.todo==="string"){if(V.clearById(Y.todo)||V.objClearById(Y.todo)){O(Y,true);return}Y.todo={name:Y.todo}}if(Y.todo.id){y.each(g(Y.todo.id),function(Z,aa){V.clearById(aa)||V.objClearById(aa)})}else{V.clear(g(Y.todo.name),Y.todo.last,Y.todo.first,Y.todo.tag);V.objClear(g(Y.todo.name),Y.todo.last,Y.todo.first,Y.todo.tag)}O(Y,true)};this.exec=function(Y){var Z=this;y.each(g(Y.todo.func),function(aa,ab){y.each(Z.get(Y.todo,true,Y.todo.hasOwnProperty("full")?Y.todo.full:true),function(ac,ad){ab.call(T,ad)})});O(Y,true)};this.get=function(aa,ad,ac){var Z,ab,Y=ad?aa:aa.todo;if(!ad){ac=Y.full}if(typeof Y==="string"){ab=V.getById(Y,false,ac)||V.objGetById(Y);if(ab===false){Z=Y;Y={}}}else{Z=Y.name}if(Z==="map"){ab=N}if(!ab){ab=[];if(Y.id){y.each(g(Y.id),function(ae,af){ab.push(V.getById(af,false,ac)||V.objGetById(af))});if(!y.isArray(Y.id)){ab=ab[0]}}else{y.each(Z?g(Z):[t],function(af,ag){var ae;if(Y.first){ae=V.get(ag,false,Y.tag,ac);if(ae){ab.push(ae)}}else{if(Y.all){y.each(V.all(ag,Y.tag,ac),function(ai,ah){ab.push(ah)})}else{ae=V.get(ag,true,Y.tag,ac);if(ae){ab.push(ae)}}}});if(!Y.all&&!y.isArray(Z)){ab=ab[0]}}}ab=y.isArray(ab)||!Y.all?ab:[ab];if(ad){return ab}else{O(aa,ab)}};this.getdistance=function(Y){var Z;Y.opts.origins=g(Y.opts.origins);for(Z=0;Z<Y.opts.origins.length;Z++){Y.opts.origins[Z]=I(Y.opts.origins[Z],true)}Y.opts.destinations=g(Y.opts.destinations);for(Z=0;Z<Y.opts.destinations.length;Z++){Y.opts.destinations[Z]=I(Y.opts.destinations[Z],true)}B().getDistanceMatrix(Y.opts,function(ab,aa){X(Y,aa===google.maps.DistanceMatrixStatus.OK?ab:false,aa);P.ack()})};this.trigger=function(Z){if(typeof Z.todo==="string"){google.maps.event.trigger(N,Z.todo)}else{var Y=[N,Z.todo.eventName];if(Z.todo.var_args){y.each(Z.todo.var_args,function(ab,aa){Y.push(aa)})}google.maps.event.trigger.apply(google.maps.event,Y)}X(Z);P.ack()}}function s(M){var L;if(!typeof M==="object"||!M.hasOwnProperty("get")){return false}for(L in M){if(L!=="get"){return false}}return !M.get.hasOwnProperty("callback")}y.fn.gmap3=function(){var M,O=[],N=true,L=[];J();for(M=0;M<arguments.length;M++){if(arguments[M]){O.push(arguments[M])}}if(!O.length){O.push("map")}y.each(this,function(){var P=y(this),Q=P.data("gmap3");N=false;if(!Q){Q=new K(P);P.data("gmap3",Q)}if(O.length===1&&(O[0]==="get"||s(O[0]))){if(O[0]==="get"){L.push(Q.get("map",true))}else{L.push(Q.get(O[0].get,true,O[0].get.full))}}else{Q._plan(O)}});if(L.length){if(L.length===1){return L[0]}else{return L}}return this}})(jQuery);