Version Description
- The new look and feel of the calendar makes it easier to scan over your posts while showing you more information.
- You can customize the number of weeks you work with in the calendar using the screen options pull down in the upper right.
- The calendar now starts with the current day as the first week.
- When dragging posts the calendar will now automatically scroll when you move a post past the top or bottom of the calendar.
- You can now access the edit, view, and delete post links directly in the calendar without bringing up a second dialog.
- The calendar now prevents you from changing posts that have already been published.
- The calendar now supports using HTTPS for admin with the define('FORCE_SSL_ADMIN', true); option in wp-config.php.
- The calendar is now properly handling posts with apostrophe's in the title in Internet Explorer.
- The calendar now supports French. Thanks to the guys at StressLimitDesign.
Download this release
Release Info
Developer | MaryVogt |
Plugin | Editorial Calendar |
Version | 0.6 |
Comparing to | |
See all releases |
Code changes from version 0.5.4 to 0.6
- edcal.css +130 -59
- edcal.js +558 -210
- edcal.php +185 -50
- images/month-present_bk.gif +0 -0
- images/today_bk.gif +0 -0
- languages/editorial-calendar-fr_FR.mo +0 -0
- languages/editorial-calendar-fr_FR.po +191 -0
- lib/languages/date-fr_FR.js +104 -0
- readme.txt +42 -15
- screenshot-1.gif +0 -0
- screenshot-1.png +0 -0
- screenshot-2.gif +0 -0
- screenshot-2.png +0 -0
- screenshot-3.gif +0 -0
- screenshot-3.png +0 -0
- screenshot-4.png +0 -0
edcal.css
CHANGED
@@ -15,13 +15,27 @@
|
|
15 |
******************************************************************************/
|
16 |
|
17 |
#edcal_scrollable {
|
18 |
-
width: 98%;
|
19 |
/* required settings */
|
20 |
position:relative;
|
21 |
overflow:hidden;
|
22 |
|
23 |
/* This height will be reset with JavaScript */
|
24 |
height: 100%;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
}
|
26 |
|
27 |
#cal {
|
@@ -33,28 +47,32 @@
|
|
33 |
}
|
34 |
|
35 |
.day {
|
36 |
-
|
37 |
-
|
|
|
|
|
|
|
|
|
38 |
}
|
39 |
|
40 |
-
.
|
41 |
-
background:
|
42 |
}
|
43 |
|
44 |
-
.
|
45 |
-
|
46 |
}
|
47 |
|
48 |
-
.
|
49 |
-
background-color:
|
50 |
}
|
51 |
|
52 |
-
.
|
53 |
-
background
|
54 |
}
|
55 |
|
56 |
-
.
|
57 |
-
|
58 |
}
|
59 |
|
60 |
.dayobj {
|
@@ -66,42 +84,111 @@
|
|
66 |
.daylabel {
|
67 |
position: absolute;
|
68 |
top: 0px;
|
69 |
-
right:
|
70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
}
|
72 |
|
73 |
.post {
|
74 |
display: block;
|
75 |
list-style-type: none;
|
76 |
-
background: #FFFFE0;
|
77 |
z-index: 10;
|
78 |
-
cursor: move;
|
79 |
-
-moz-border-radius:6px;
|
80 |
-
-webkit-border-radius:6px;
|
81 |
margin-left: 2px;
|
82 |
margin-right: 2px;
|
83 |
-
|
|
|
|
|
84 |
}
|
85 |
|
86 |
-
.post
|
87 |
-
|
88 |
-
background: black;
|
89 |
}
|
90 |
|
91 |
-
.
|
92 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
}
|
94 |
|
95 |
.dayhead {
|
96 |
font-weight: bold;
|
97 |
-
text-align:
|
98 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
}
|
100 |
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
}
|
106 |
|
107 |
#topbar {
|
@@ -132,17 +219,9 @@
|
|
132 |
text-decoration: none;
|
133 |
}
|
134 |
|
135 |
-
.future {
|
136 |
-
background-color: #FFFFE0;
|
137 |
-
}
|
138 |
-
|
139 |
-
.draft, .pending {
|
140 |
-
background-color: #cccccc;
|
141 |
-
|
142 |
-
}
|
143 |
-
|
144 |
.publish {
|
145 |
-
|
|
|
146 |
}
|
147 |
|
148 |
#loadingcont {
|
@@ -160,7 +239,7 @@
|
|
160 |
top: -1.5em;
|
161 |
}
|
162 |
|
163 |
-
.loadingclass, .tiploading, .loadingclass:hover {
|
164 |
background-image: url('images/loading_post.gif');
|
165 |
background-position: top right;
|
166 |
background-repeat: no-repeat;
|
@@ -170,15 +249,17 @@
|
|
170 |
.postlist {
|
171 |
position: relative;
|
172 |
top: 1.5em;
|
173 |
-
height:
|
174 |
overflow: auto;
|
175 |
}
|
176 |
|
177 |
-
|
178 |
text-decoration: none;
|
179 |
-
border: none;
|
180 |
border-bottom-style: none;
|
181 |
-
|
|
|
|
|
|
|
182 |
|
183 |
#tooltip p {
|
184 |
margin-left: 1.5em;
|
@@ -225,10 +306,6 @@
|
|
225 |
padding-bottom: 0.5em;
|
226 |
}
|
227 |
|
228 |
-
.ui-draggable-dragging {
|
229 |
-
width: 8em;
|
230 |
-
}
|
231 |
-
|
232 |
#tipclose {
|
233 |
width: 24px;
|
234 |
height: 23px;
|
@@ -250,14 +327,8 @@
|
|
250 |
font-size: 11px;
|
251 |
}
|
252 |
|
253 |
-
.daynewlink {
|
254 |
-
display: none;
|
255 |
-
padding-left: 0.5em;
|
256 |
-
padding-right: 0.5em;
|
257 |
-
text-decoration: none;
|
258 |
-
font-weight: bold;
|
259 |
-
}
|
260 |
-
|
261 |
#nextmonth, #prevmonth {
|
262 |
-
padding: 0.5em
|
|
|
263 |
}
|
|
15 |
******************************************************************************/
|
16 |
|
17 |
#edcal_scrollable {
|
|
|
18 |
/* required settings */
|
19 |
position:relative;
|
20 |
overflow:hidden;
|
21 |
|
22 |
/* This height will be reset with JavaScript */
|
23 |
height: 100%;
|
24 |
+
margin-top: 5px;
|
25 |
+
margin-left: 2.5px;
|
26 |
+
margin-right: 2.5px;
|
27 |
+
}
|
28 |
+
|
29 |
+
#cal_cont, #edcal_scrollable {
|
30 |
+
-x-system-font:none;
|
31 |
+
font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;
|
32 |
+
font-size:11px;
|
33 |
+
font-size-adjust:none;
|
34 |
+
font-stretch:normal;
|
35 |
+
font-style:normal;
|
36 |
+
font-variant:normal;
|
37 |
+
font-weight:normal;
|
38 |
+
line-height:18px;
|
39 |
}
|
40 |
|
41 |
#cal {
|
47 |
}
|
48 |
|
49 |
.day {
|
50 |
+
border: thin solid rgb(164, 164, 164);
|
51 |
+
-moz-border-radius-topright:3px;
|
52 |
+
-moz-border-radius-topleft:3px;
|
53 |
+
-webkit-border-top-left-radius:3px;
|
54 |
+
-webkit-border-top-right-radius:3px;
|
55 |
+
background: white;
|
56 |
}
|
57 |
|
58 |
+
.day.beforeToday {
|
59 |
+
background: #f1f1f1;
|
60 |
}
|
61 |
|
62 |
+
.day.todayAndAfter {
|
63 |
+
background: #fff;
|
64 |
}
|
65 |
|
66 |
+
.day-active {
|
67 |
+
background-color: lightyellow;
|
68 |
}
|
69 |
|
70 |
+
.scrollHover {
|
71 |
+
background: lightblue;
|
72 |
}
|
73 |
|
74 |
+
.row {
|
75 |
+
height: 100%;
|
76 |
}
|
77 |
|
78 |
.dayobj {
|
84 |
.daylabel {
|
85 |
position: absolute;
|
86 |
top: 0px;
|
87 |
+
right: 0px;
|
88 |
+
left: 0px;
|
89 |
+
font-weight:bold;
|
90 |
+
text-align: right;
|
91 |
+
padding-right: 10px;
|
92 |
+
}
|
93 |
+
|
94 |
+
.daynewlink {
|
95 |
+
position: absolute;
|
96 |
+
top: 0px;
|
97 |
+
left: 0px;
|
98 |
+
display: none;
|
99 |
+
padding-left: 0.5em;
|
100 |
+
padding-right: 0.5em;
|
101 |
+
text-decoration: none;
|
102 |
+
font-size:10px;
|
103 |
+
z-index: 10;
|
104 |
+
overflow: hidden;
|
105 |
+
height: 1.5em;
|
106 |
+
}
|
107 |
+
|
108 |
+
.today .daylabel {
|
109 |
+
color: white;
|
110 |
+
}
|
111 |
+
|
112 |
+
.today .daynewlink {
|
113 |
+
color: white;
|
114 |
}
|
115 |
|
116 |
.post {
|
117 |
display: block;
|
118 |
list-style-type: none;
|
|
|
119 |
z-index: 10;
|
|
|
|
|
|
|
120 |
margin-left: 2px;
|
121 |
margin-right: 2px;
|
122 |
+
font-size: 10px;
|
123 |
+
padding: 0.7em 0.5em 2em 0.2em;
|
124 |
+
color: #21759b;
|
125 |
}
|
126 |
|
127 |
+
.post.draggable .postlink {
|
128 |
+
cursor: move;
|
|
|
129 |
}
|
130 |
|
131 |
+
.post .postactions {
|
132 |
+
display: none;
|
133 |
+
}
|
134 |
+
|
135 |
+
.postactions a {
|
136 |
+
text-decoration:none;
|
137 |
+
}
|
138 |
+
|
139 |
+
.post .postlink:hover {
|
140 |
+
color: #d54e21;
|
141 |
+
background: #f5f5f5;
|
142 |
}
|
143 |
|
144 |
.dayhead {
|
145 |
font-weight: bold;
|
146 |
+
text-align: left;
|
147 |
+
text-indent: 5px;
|
148 |
+
color: #FFFFFF;
|
149 |
+
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.4);
|
150 |
+
border-style-top:solid solid none;
|
151 |
+
border-width:1px 1px 0;
|
152 |
+
line-height: 23px;
|
153 |
+
min-width: 10em;
|
154 |
+
-x-system-font:none;
|
155 |
+
font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;
|
156 |
+
font-size:13px;
|
157 |
+
font-size-adjust:none;
|
158 |
+
font-stretch:normal;
|
159 |
+
font-style:normal;
|
160 |
+
font-variant:normal;
|
161 |
+
font-weight:normal;
|
162 |
+
}
|
163 |
+
|
164 |
+
.dayheadcont {
|
165 |
+
position: relative;
|
166 |
+
height: 28px;
|
167 |
+
top: 0px;
|
168 |
+
|
169 |
+
-webkit-border-top-left-radius: 6px;
|
170 |
+
-webkit-border-top-right-radius: 6px;
|
171 |
+
-moz-border-radius-topleft: 6px;
|
172 |
+
-moz-border-radius-topright: 6px;
|
173 |
}
|
174 |
|
175 |
+
.dayhead.firstday {
|
176 |
+
margin-left: 5px;
|
177 |
+
|
178 |
+
}
|
179 |
+
|
180 |
+
.dayhead.lastday {
|
181 |
+
|
182 |
+
}
|
183 |
+
|
184 |
+
#cal_cont {
|
185 |
+
border-left: thin solid lightgray;
|
186 |
+
border-right: thin solid lightgray;
|
187 |
+
border-bottom: thin solid lightgray;
|
188 |
+
padding-bottom: 5px;
|
189 |
+
|
190 |
+
-moz-border-radius: 12px;
|
191 |
+
-webkit-border-radius: 12px;
|
192 |
}
|
193 |
|
194 |
#topbar {
|
219 |
text-decoration: none;
|
220 |
}
|
221 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
222 |
.publish {
|
223 |
+
color: #a4a4a4;
|
224 |
+
font-weight:normal;
|
225 |
}
|
226 |
|
227 |
#loadingcont {
|
239 |
top: -1.5em;
|
240 |
}
|
241 |
|
242 |
+
.loadingclass > .postlink, .tiploading, .loadingclass:hover > .postlink {
|
243 |
background-image: url('images/loading_post.gif');
|
244 |
background-position: top right;
|
245 |
background-repeat: no-repeat;
|
249 |
.postlist {
|
250 |
position: relative;
|
251 |
top: 1.5em;
|
252 |
+
height: 90%;
|
253 |
overflow: auto;
|
254 |
}
|
255 |
|
256 |
+
/*.page-numbers {
|
257 |
text-decoration: none;
|
|
|
258 |
border-bottom-style: none;
|
259 |
+
border: none;
|
260 |
+
background: white;
|
261 |
+
color: #21759B;
|
262 |
+
}*/
|
263 |
|
264 |
#tooltip p {
|
265 |
margin-left: 1.5em;
|
306 |
padding-bottom: 0.5em;
|
307 |
}
|
308 |
|
|
|
|
|
|
|
|
|
309 |
#tipclose {
|
310 |
width: 24px;
|
311 |
height: 23px;
|
327 |
font-size: 11px;
|
328 |
}
|
329 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
330 |
#nextmonth, #prevmonth {
|
331 |
+
/*padding: 0.5em;*/
|
332 |
+
font-size:12px;
|
333 |
}
|
334 |
+
|
edcal.js
CHANGED
@@ -62,20 +62,45 @@
|
|
62 |
</div>
|
63 |
*/
|
64 |
var edcal = {
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
/*
|
66 |
* True if the calendar is in the process of moving
|
67 |
*/
|
68 |
isMoving: false,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
|
70 |
-
wp_dateFormat: "yyyy-MM-dd",
|
71 |
-
|
72 |
/*
|
73 |
-
This is the
|
74 |
-
|
75 |
-
|
76 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
*/
|
78 |
-
|
|
|
|
|
79 |
|
80 |
/*
|
81 |
* The cache of dates we have already loaded posts for.
|
@@ -181,7 +206,7 @@ var edcal = {
|
|
181 |
have to change the cell sizes in multiple places.
|
182 |
*/
|
183 |
alignCal: function() {
|
184 |
-
edcal.alignGrid("#cal", 1, 100,
|
185 |
},
|
186 |
|
187 |
|
@@ -190,17 +215,89 @@ var edcal = {
|
|
190 |
calendar.
|
191 |
*/
|
192 |
createDaysHeader: function() {
|
193 |
-
var html = '<div class="dayhead">' + edcal.str_day1 + '</div>';
|
194 |
html += '<div class="dayhead">' + edcal.str_day2 + '</div>';
|
195 |
html += '<div class="dayhead">' + edcal.str_day3 + '</div>';
|
196 |
html += '<div class="dayhead">' + edcal.str_day4 + '</div>';
|
197 |
html += '<div class="dayhead">' + edcal.str_day5 + '</div>';
|
198 |
html += '<div class="dayhead">' + edcal.str_day6 + '</div>';
|
199 |
-
html += '<div class="dayhead">' + edcal.str_day7 + '</div>';
|
200 |
|
201 |
-
jQuery("#
|
202 |
|
203 |
-
edcal.alignGrid("
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
204 |
},
|
205 |
|
206 |
/*
|
@@ -213,15 +310,24 @@ var edcal = {
|
|
213 |
var newrow = '<div class="rowcont" id="' + 'row' + edcal._wDate.toString("ddMMyyyy") + '">' +
|
214 |
'<div id="' + 'row' + edcal._wDate.toString("ddMMyyyy") + 'row" class="row">';
|
215 |
for (var i = 0; i < 7; i++) {
|
216 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
_date.toString("dddd").toLowerCase() + ' month-' +
|
218 |
_date.toString("MM").toLowerCase() + '">';
|
219 |
|
220 |
newrow += '<div class="dayobj">';
|
221 |
|
222 |
-
newrow += '<div class="daylabel">';
|
223 |
newrow += '<a href="#" adddate="' + _date.toString("MMMM d") + '" class="daynewlink" title="' + edcal.str_newpost + _date.toString("MMMM d") + '" ' +
|
224 |
-
'onclick="return false;"
|
|
|
|
|
225 |
if (_date.toString("dd") == "01") {
|
226 |
newrow += _date.toString("MMM d");
|
227 |
} else {
|
@@ -249,17 +355,33 @@ var edcal = {
|
|
249 |
parent.prepend(newrow);
|
250 |
}
|
251 |
|
252 |
-
|
|
|
|
|
|
|
253 |
|
254 |
-
|
255 |
-
edcal.addTooltip(jQuery(this).attr("id"));
|
256 |
-
});
|
257 |
|
258 |
-
|
259 |
-
|
260 |
-
jQuery('#row' + edcal._wDate.toString("ddMMyyyy") + ' .day').droppable({
|
261 |
hoverClass: 'day-active',
|
262 |
-
accept:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
263 |
greedy: true,
|
264 |
tolerance: 'pointer',
|
265 |
drop: function(event, ui) {
|
@@ -284,9 +406,6 @@ var edcal = {
|
|
284 |
jQuery('#' + jQuery(this).attr("id") + ' .postlist').append(edcal.createPostItem(post,
|
285 |
jQuery(this).attr("id")));
|
286 |
|
287 |
-
// Step 4. And add the tooltip
|
288 |
-
edcal.addTooltip(jQuery(this).attr("id"));
|
289 |
-
|
290 |
if (dayId == jQuery(this).attr("id")) {
|
291 |
/*
|
292 |
If they dropped back on to the day they started with we
|
@@ -307,33 +426,69 @@ var edcal = {
|
|
307 |
* This is a helper method to make an individual post item draggable.
|
308 |
*/
|
309 |
draggablePost: function(/*post selector*/ post) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
310 |
/*
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
* Chrome.
|
317 |
*/
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
if (is_chrome || is_safari) {
|
322 |
-
jQuery(post).draggable({
|
323 |
-
revert: 'invalid',
|
324 |
-
appendTo: 'body',
|
325 |
-
helper: "clone",
|
326 |
-
addClasses: false
|
327 |
-
});
|
328 |
-
} else {
|
329 |
-
jQuery(post).draggable({
|
330 |
-
revert: 'invalid',
|
331 |
-
appendTo: 'body',
|
332 |
-
distance: 10,
|
333 |
-
helper: "clone",
|
334 |
-
addClasses: false
|
335 |
-
});
|
336 |
-
}
|
337 |
},
|
338 |
|
339 |
/*
|
@@ -358,7 +513,12 @@ var edcal = {
|
|
358 |
* Adds a post to an already existing calendar day.
|
359 |
*/
|
360 |
addPostItem: function(/*post*/ post, /*string*/ dayobjId) {
|
361 |
-
|
|
|
|
|
|
|
|
|
|
|
362 |
},
|
363 |
|
364 |
/*
|
@@ -366,20 +526,69 @@ var edcal = {
|
|
366 |
and adds the tooltip.
|
367 |
*/
|
368 |
addPostItemDragAndToolltip: function(/*string*/ dayobjId) {
|
369 |
-
edcal.draggablePost('#' + dayobjId + '
|
370 |
-
edcal.addTooltip(dayobjId);
|
371 |
},
|
372 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
373 |
/*
|
374 |
* Confirms if you want to delete the specified post
|
375 |
*/
|
376 |
confirmDelete: function(/*string*/ posttitle) {
|
377 |
if (confirm(edcal.str_del_msg1 + posttitle + edcal.str_del_msg2)) {
|
378 |
return true;
|
|
|
379 |
} else {
|
380 |
return false;
|
381 |
}
|
382 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
383 |
|
384 |
/*
|
385 |
This is an AJAX function to save the past title when
|
@@ -387,7 +596,7 @@ var edcal = {
|
|
387 |
*/
|
388 |
saveTitle: function(/*string*/ postId) {
|
389 |
edcal.output("Saving the new title " + jQuery("#edcal-title-edit-field").val() + " for post " + postId);
|
390 |
-
var url = edcal.ajax_url + "&action=edcal_changetitle&postid=" + postId +
|
391 |
"&title=" + encodeURIComponent(jQuery("#edcal-title-edit-field").val());
|
392 |
|
393 |
jQuery("#post-" + postId).addClass("loadingclass");
|
@@ -413,7 +622,6 @@ var edcal = {
|
|
413 |
}
|
414 |
edcal.addPostItem(res.post, res.post.date);
|
415 |
edcal.addPostItemDragAndToolltip(res.post.date);
|
416 |
-
edcal.output("Finished saving the new title " + jQuery("#edcal-title-edit-field").val() + " for post " + postId);
|
417 |
},
|
418 |
error: function(xhr) {
|
419 |
edcal.showError(edcal.general_error);
|
@@ -455,61 +663,6 @@ var edcal = {
|
|
455 |
jQuery("#tooltip").hide();
|
456 |
},
|
457 |
|
458 |
-
/*
|
459 |
-
* Adds a tooltip to every post in the specified day.
|
460 |
-
*/
|
461 |
-
addTooltip: function(/*string*/ dayobjId) {
|
462 |
-
jQuery('#' + dayobjId + ' .post').tooltip({
|
463 |
-
delay: 1500,
|
464 |
-
bodyHandler: function() {
|
465 |
-
var post = edcal.findPostForId(dayobjId, jQuery(this).attr("id"));
|
466 |
-
|
467 |
-
var posttitle = post.title;
|
468 |
-
|
469 |
-
var tooltip = '<div class="tooltip">' +
|
470 |
-
'<a href="#" id="tipclose" onclick="edcal.closeTooltip(); return false;" title="close"> </a>' +
|
471 |
-
'<h3 id="edcal-title">' + posttitle +
|
472 |
-
' <a href="#" onclick="edcal.editTitle(); return false;" class="edit-post-status" id="edcal-title-edit">' + edcal.str_edit + '</a>' +
|
473 |
-
'</h3>' +
|
474 |
-
'<div id="edcal-title-box">' +
|
475 |
-
'<input type="text" postid="' + post.id + '" value="' + post.title + '" id="edcal-title-edit-field"/> ' +
|
476 |
-
'<span id="edit-slug-buttons">' +
|
477 |
-
'<a class="save button" href="#" onclick="edcal.saveTitle(\'' + post.id + '\'); return false;">Save</a> ' +
|
478 |
-
'<a href="#" onclick="edcal.cancelEditTitle(\'' + post.title + '\'); return false;" class="cancel">' + edcal.str_cancel + '</a></span>' +
|
479 |
-
'</div>' +
|
480 |
-
'<p>' +
|
481 |
-
'<i>' + edcal.str_by + '</i> ' + post.author + ' <i>' + edcal.str_on + '</i> ' +
|
482 |
-
edcal.getDayFromDayId(post.date).toString("MMMM d, yyyy") + ' ' + edcal.str_at + ' ' +
|
483 |
-
post.time +
|
484 |
-
'</p>' +
|
485 |
-
'<p>' +
|
486 |
-
edcal.str_status + '<b>' + post.status + '</b>' +
|
487 |
-
' ';
|
488 |
-
if (post.editlink) {
|
489 |
-
/*
|
490 |
-
* If the user doesn't have permission to edit a post then
|
491 |
-
* then server won't send the edit link URL and we shouldn't
|
492 |
-
* show the edit link
|
493 |
-
*/
|
494 |
-
tooltip += '<a href="' + post.editlink + '" title="' + edcal.str_edit + ' ' + post.title +
|
495 |
-
'">' + edcal.str_edit + '</a> | ';
|
496 |
-
}
|
497 |
-
|
498 |
-
if (post.dellink) {
|
499 |
-
tooltip += '<a class="submitdelete" href="' + post.dellink + '" ' +
|
500 |
-
'onclick="return edcal.confirmDelete(\'' + post.title + '\');"' +
|
501 |
-
'title="' + edcal.str_del + ' ' + post.title + '">' + edcal.str_del + '</a> | ';
|
502 |
-
}
|
503 |
-
|
504 |
-
tooltip += '<a href="' + post.permalink + '" title="' + edcal.str_view + ' ' + post.title + '">' + edcal.str_view + '</a>' +
|
505 |
-
'</p>' +
|
506 |
-
'</div>';
|
507 |
-
|
508 |
-
return tooltip;
|
509 |
-
}
|
510 |
-
});
|
511 |
-
},
|
512 |
-
|
513 |
/*
|
514 |
* Adds a tooltip to every add post link
|
515 |
*/
|
@@ -518,7 +671,7 @@ var edcal = {
|
|
518 |
return;
|
519 |
}
|
520 |
|
521 |
-
var date = createLink.parent().parent().
|
522 |
|
523 |
|
524 |
createLink.tooltip({
|
@@ -615,6 +768,57 @@ var edcal = {
|
|
615 |
return postsString;
|
616 |
},
|
617 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
618 |
/*
|
619 |
* Gets the HTML string for a post.
|
620 |
*/
|
@@ -624,7 +828,38 @@ var edcal = {
|
|
624 |
if (posttitle === "") {
|
625 |
posttitle = "[No Title]";
|
626 |
}
|
627 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
628 |
},
|
629 |
|
630 |
/*
|
@@ -633,7 +868,7 @@ var edcal = {
|
|
633 |
*/
|
634 |
setClassforToday: function() {
|
635 |
/*
|
636 |
-
We want to set a class for the cell that represents the current day so we
|
637 |
give it a background color.
|
638 |
*/
|
639 |
jQuery('#' + Date.today().toString("ddMMyyyy")).addClass("today");
|
@@ -645,18 +880,13 @@ var edcal = {
|
|
645 |
calendar based on the window height.
|
646 |
*/
|
647 |
getCalHeight: function() {
|
648 |
-
var myHeight =
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
} else if ( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
|
656 |
-
//IE 4 compatible
|
657 |
-
myHeight = document.body.clientHeight;
|
658 |
-
}
|
659 |
-
return myHeight - 150;
|
660 |
},
|
661 |
|
662 |
/*
|
@@ -665,7 +895,7 @@ var edcal = {
|
|
665 |
up into the past.
|
666 |
*/
|
667 |
move: function(steps, direction) {
|
668 |
-
|
669 |
The working date is a marker for the last calendar row we created.
|
670 |
If we are moving forward that will be the last row, if we are moving
|
671 |
backward it will be the first row. If we switch direction we need
|
@@ -673,15 +903,15 @@ var edcal = {
|
|
673 |
*/
|
674 |
if (edcal.currentDirection != direction) {
|
675 |
if (direction) { // into the future
|
676 |
-
edcal._wDate = edcal._wDate.add(
|
677 |
} else { // into the past
|
678 |
-
edcal._wDate = edcal._wDate.add(-
|
679 |
}
|
680 |
|
681 |
edcal.steps = 0;
|
682 |
edcal.moveDate = edcal._wDate;
|
683 |
}
|
684 |
-
|
685 |
edcal.currentDirection = direction;
|
686 |
|
687 |
var i;
|
@@ -746,7 +976,7 @@ var edcal = {
|
|
746 |
issue by adding the spaces back before we parse.
|
747 |
*/
|
748 |
getDayFromDayId: function(/*dayId*/ day) {
|
749 |
-
|
750 |
},
|
751 |
|
752 |
/*
|
@@ -754,7 +984,7 @@ var edcal = {
|
|
754 |
the calendar. It looks like November 2009-December2009
|
755 |
*/
|
756 |
setDateLabel: function(year) {
|
757 |
-
var api = jQuery("
|
758 |
var items = api.getVisibleItems();
|
759 |
|
760 |
/*
|
@@ -763,7 +993,7 @@ var edcal = {
|
|
763 |
work around a small JQuery issue.
|
764 |
*/
|
765 |
var firstDate = edcal.getDayFromDayId(items.eq(0).children(".row").children(".day:first").attr("id"));
|
766 |
-
var lastDate = edcal.getDayFromDayId(items.eq(
|
767 |
|
768 |
jQuery("#currentRange").text(firstDate.toString("MMMM yyyy") + " - " + lastDate.toString("MMMM yyyy"));
|
769 |
},
|
@@ -874,23 +1104,23 @@ var edcal = {
|
|
874 |
/*
|
875 |
When we first start up our working date is 4 weeks before
|
876 |
the next Sunday.
|
877 |
-
|
878 |
-
edcal._wDate = edcal.nextStartOfWeek(date).add(-
|
879 |
|
880 |
/*
|
881 |
-
After we remove and
|
882 |
moving in a going down direction.
|
883 |
*/
|
884 |
edcal.currentDirection = true;
|
885 |
|
886 |
-
for (var i = 0; i <
|
887 |
edcal.createRow(jQuery("#cal"), true);
|
888 |
edcal._wDate.add(7).days();
|
889 |
}
|
890 |
|
891 |
edcal.alignCal();
|
892 |
|
893 |
-
var api = jQuery("
|
894 |
api.move(2);
|
895 |
|
896 |
edcal.setDateLabel();
|
@@ -898,6 +1128,43 @@ var edcal = {
|
|
898 |
edcal.isMoving = false;
|
899 |
|
900 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
901 |
|
902 |
/*
|
903 |
* Initializes the calendar
|
@@ -922,15 +1189,15 @@ var edcal = {
|
|
922 |
edcal.createDaysHeader();
|
923 |
|
924 |
// initialize scrollable
|
925 |
-
jQuery("
|
926 |
vertical:true,
|
927 |
-
size:
|
928 |
keyboardSteps: 1,
|
929 |
speed: 100
|
930 |
// use mousewheel plugin
|
931 |
}).mousewheel();
|
932 |
|
933 |
-
var api = jQuery("
|
934 |
|
935 |
edcal.moveTo(Date.today());
|
936 |
|
@@ -969,11 +1236,11 @@ var edcal = {
|
|
969 |
|
970 |
if ((evt.keyCode === 34 && !(evt.altKey || evt.ctrlKey)) || //page down
|
971 |
evt.keyCode === 40 && evt.ctrlKey){ // Ctrl+down down arrow
|
972 |
-
edcal.move(
|
973 |
return false;
|
974 |
} else if ((evt.keyCode === 33 && !(evt.altKey || evt.ctrlKey)) || //page up
|
975 |
evt.keyCode === 38 && evt.ctrlKey){ // Ctrl+up up arrow
|
976 |
-
edcal.move(
|
977 |
return false;
|
978 |
} else if (evt.keyCode === 27) { //escape key
|
979 |
edcal.closeTooltip();
|
@@ -981,8 +1248,8 @@ var edcal = {
|
|
981 |
}
|
982 |
});
|
983 |
|
984 |
-
edcal.getPosts(edcal.nextStartOfWeek(Date.today()).add(-
|
985 |
-
edcal.nextStartOfWeek(Date.today()).add(
|
986 |
|
987 |
/*
|
988 |
Now we bind the listeners for all of our links and the window
|
@@ -994,12 +1261,12 @@ var edcal = {
|
|
994 |
});
|
995 |
|
996 |
jQuery("#prevmonth").click(function() {
|
997 |
-
edcal.move(
|
998 |
return false;
|
999 |
});
|
1000 |
|
1001 |
jQuery("#nextmonth").click(function() {
|
1002 |
-
edcal.move(
|
1003 |
return false;
|
1004 |
});
|
1005 |
|
@@ -1007,20 +1274,11 @@ var edcal = {
|
|
1007 |
if (edcal.windowHeight != jQuery(window).height()) {
|
1008 |
jQuery("#edcal_scrollable").css("height", edcal.getCalHeight() + "px");
|
1009 |
edcal.windowHeight = jQuery(window).height();
|
|
|
1010 |
}
|
1011 |
}
|
1012 |
jQuery(window).bind("resize", resizeWindow);
|
1013 |
|
1014 |
-
jQuery(".day").live("mouseover", function(evt) {
|
1015 |
-
var createLink = jQuery("#" + jQuery(this).attr("id") + " .daynewlink");
|
1016 |
-
createLink.show();
|
1017 |
-
edcal.addCreateTooltip(createLink);
|
1018 |
-
});
|
1019 |
-
|
1020 |
-
jQuery(".day").live("mouseout", function(evt) {
|
1021 |
-
jQuery("#" + jQuery(this).attr("id") + " .daynewlink").hide();
|
1022 |
-
});
|
1023 |
-
|
1024 |
jQuery("#newPostButton").live("click", function(evt) {
|
1025 |
edcal.createNewDraft(jQuery(this).attr("adddate"), jQuery("#edcal-title-new-field").val(), false);
|
1026 |
});
|
@@ -1055,12 +1313,29 @@ var edcal = {
|
|
1055 |
}
|
1056 |
|
1057 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1058 |
},
|
1059 |
|
1060 |
/*
|
1061 |
* When the user presses the new post link on each calendar cell they get
|
1062 |
* a tooltip which prompts them to edit the title of the new post. Once
|
1063 |
-
* they provide a
|
1064 |
*
|
1065 |
* date - the date for the new post
|
1066 |
* title - the title for the new post
|
@@ -1071,8 +1346,7 @@ var edcal = {
|
|
1071 |
if (!title || title === "") {
|
1072 |
return;
|
1073 |
}
|
1074 |
-
|
1075 |
-
edcal.output('Adding new draft "' + title + '" on ' + date);
|
1076 |
|
1077 |
jQuery("#edit-slug-buttons").addClass("tiploading");
|
1078 |
/*
|
@@ -1080,8 +1354,7 @@ var edcal = {
|
|
1080 |
* put a default post time of 10:00 AM.
|
1081 |
*/
|
1082 |
var formattedDate = encodeURIComponent(edcal.getDayFromDayId(date).toString(edcal.wp_dateFormat) + " 10:00:00");
|
1083 |
-
edcal.
|
1084 |
-
var url = edcal.ajax_url + "&action=edcal_newdraft&date=" + formattedDate + "&title=" +
|
1085 |
encodeURIComponent(title);
|
1086 |
|
1087 |
jQuery.ajax( {
|
@@ -1107,7 +1380,6 @@ var edcal = {
|
|
1107 |
if (!res.post) {
|
1108 |
edcal.showError("There was an error creating a new post for your blog.");
|
1109 |
} else {
|
1110 |
-
edcal.output('Finished adding new draft "' + title + '" on ' + date);
|
1111 |
if (doEdit) {
|
1112 |
/*
|
1113 |
* If the user wanted to edit the post then we redirect
|
@@ -1139,45 +1411,12 @@ var edcal = {
|
|
1139 |
edcal.output('Changing the date of "' + post.title + '" to ' + newdate);
|
1140 |
var newdateFormatted = edcal.getDayFromDayId(newdate).toString(edcal.wp_dateFormat);
|
1141 |
|
1142 |
-
var
|
1143 |
-
|
1144 |
-
if (post.status === "draft") {
|
1145 |
-
/*
|
1146 |
-
* If the status of the post was a draft we leave it as a draft
|
1147 |
-
*/
|
1148 |
-
postStatus = "draft";
|
1149 |
-
} else if (post.status === "pending") {
|
1150 |
-
/*
|
1151 |
-
* If the status of the post was a pending we leave it as a draft
|
1152 |
-
*/
|
1153 |
-
postStatus = "pending";
|
1154 |
-
} else {
|
1155 |
-
/*
|
1156 |
-
If the post status was published or future we need to adjust
|
1157 |
-
it. If you take a post that is published a move it after
|
1158 |
-
the current day we change the status to future. If the post
|
1159 |
-
was scheduled to get published in the future and they drag
|
1160 |
-
it into the past we change the status to publish.
|
1161 |
-
*/
|
1162 |
-
var compare = Date.parseExact(newdateFormatted, edcal.wp_dateFormat).compareTo(Date.today());
|
1163 |
-
if (compare === -1) {
|
1164 |
-
if (post.status === "publish") {
|
1165 |
-
postStatus = "publish";
|
1166 |
-
} else {
|
1167 |
-
postStatus = "draft";
|
1168 |
-
}
|
1169 |
-
|
1170 |
-
} else {
|
1171 |
-
postStatus = "future";
|
1172 |
-
}
|
1173 |
-
}
|
1174 |
-
|
1175 |
-
var url = edcal.ajax_url + "&action=edcal_changedate&postid=" + post.id +
|
1176 |
-
"&postStatus=" + postStatus +
|
1177 |
"&newdate=" + newdateFormatted + "&olddate=" + edcal.getDayFromDayId(post.date).toString(edcal.wp_dateFormat);
|
1178 |
|
1179 |
jQuery("#post-" + post.id).addClass("loadingclass");
|
1180 |
-
|
1181 |
jQuery.ajax( {
|
1182 |
url: url,
|
1183 |
type: "POST",
|
@@ -1189,8 +1428,6 @@ var edcal = {
|
|
1189 |
edcal.addPostItem(res.post, res.post.date);
|
1190 |
edcal.addPostItemDragAndToolltip(res.post.date);
|
1191 |
|
1192 |
-
edcal.output('Finished changing the date of "' + post.title + '" to ' + newdate);
|
1193 |
-
|
1194 |
if (res.error) {
|
1195 |
/*
|
1196 |
* If there was an error we need to remove the dropped
|
@@ -1228,7 +1465,7 @@ var edcal = {
|
|
1228 |
if (shouldGet) {
|
1229 |
/*
|
1230 |
* TODO: We don't want to make extra AJAX calls for dates
|
1231 |
-
* that we have already
|
1232 |
* it somewhat, but we could get much better about this.
|
1233 |
*/
|
1234 |
edcal.output("Using cached results for posts from " + from.toString("dd-MMM-yyyy") + " to " + to.toString("dd-MMM-yyyy"));
|
@@ -1237,10 +1474,10 @@ var edcal = {
|
|
1237 |
|
1238 |
edcal.cacheDates[from] = true;
|
1239 |
|
1240 |
-
|
1241 |
-
|
1242 |
-
edcal.
|
1243 |
-
|
1244 |
jQuery("#loading").show();
|
1245 |
|
1246 |
jQuery.ajax( {
|
@@ -1269,10 +1506,17 @@ var edcal = {
|
|
1269 |
return;
|
1270 |
}
|
1271 |
var postDates = [];
|
1272 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1273 |
if (post) {
|
1274 |
if (post.status === 'trash') {
|
1275 |
-
|
1276 |
}
|
1277 |
|
1278 |
/*
|
@@ -1287,7 +1531,7 @@ var edcal = {
|
|
1287 |
edcal.addPostItem(post, post.date);
|
1288 |
postDates[postDates.length] = post.date;
|
1289 |
}
|
1290 |
-
}
|
1291 |
|
1292 |
/*
|
1293 |
* If the blog has a very larger number of posts then adding
|
@@ -1300,10 +1544,11 @@ var edcal = {
|
|
1300 |
* stop complaining.
|
1301 |
*/
|
1302 |
setTimeout(function() {
|
1303 |
-
edcal.output("Finished adding
|
1304 |
jQuery.each(postDates, function(i, postDate) {
|
1305 |
edcal.addPostItemDragAndToolltip(postDate);
|
1306 |
});
|
|
|
1307 |
}, 300);
|
1308 |
},
|
1309 |
error: function(xhr) {
|
@@ -1315,6 +1560,109 @@ var edcal = {
|
|
1315 |
});
|
1316 |
},
|
1317 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1318 |
/**
|
1319 |
* Outputs info messages to the Firebug console if it is available.
|
1320 |
*
|
62 |
</div>
|
63 |
*/
|
64 |
var edcal = {
|
65 |
+
|
66 |
+
/*
|
67 |
+
This value is the number of weeks the user wants to see at one time
|
68 |
+
in the calendar.
|
69 |
+
*/
|
70 |
+
weeksPref: 3,
|
71 |
/*
|
72 |
* True if the calendar is in the process of moving
|
73 |
*/
|
74 |
isMoving: false,
|
75 |
+
|
76 |
+
/*
|
77 |
+
* True if we are in the middle of dragging a post
|
78 |
+
*/
|
79 |
+
inDrag: false,
|
80 |
+
|
81 |
+
/*
|
82 |
+
True if the calendar is in the process of queueing scrolling
|
83 |
+
during a drag.
|
84 |
+
*/
|
85 |
+
isDragScrolling: false,
|
86 |
|
|
|
|
|
87 |
/*
|
88 |
+
This is the position of the calendar. It is an array with
|
89 |
+
two fields: top and bottom.
|
90 |
+
*/
|
91 |
+
position: null,
|
92 |
+
|
93 |
+
/*
|
94 |
+
* This is the first date of the current month
|
95 |
+
*/
|
96 |
+
firstDayOfMonth: null,
|
97 |
+
|
98 |
+
/*
|
99 |
+
* This is the first day of the next month
|
100 |
*/
|
101 |
+
firstDayOfNextMonth: null,
|
102 |
+
|
103 |
+
wp_dateFormat: "yyyy-MM-dd",
|
104 |
|
105 |
/*
|
106 |
* The cache of dates we have already loaded posts for.
|
206 |
have to change the cell sizes in multiple places.
|
207 |
*/
|
208 |
alignCal: function() {
|
209 |
+
edcal.alignGrid("#cal", 1, 100, (100 / edcal.weeksPref) - 1, 1);
|
210 |
},
|
211 |
|
212 |
|
215 |
calendar.
|
216 |
*/
|
217 |
createDaysHeader: function() {
|
218 |
+
var html = '<div class="dayheadcont"><div class="dayhead firstday">' + edcal.str_day1 + '</div>';
|
219 |
html += '<div class="dayhead">' + edcal.str_day2 + '</div>';
|
220 |
html += '<div class="dayhead">' + edcal.str_day3 + '</div>';
|
221 |
html += '<div class="dayhead">' + edcal.str_day4 + '</div>';
|
222 |
html += '<div class="dayhead">' + edcal.str_day5 + '</div>';
|
223 |
html += '<div class="dayhead">' + edcal.str_day6 + '</div>';
|
224 |
+
html += '<div class="dayhead lastday">' + edcal.str_day7 + '</div></div>';
|
225 |
|
226 |
+
jQuery("#cal_cont").prepend(html);
|
227 |
|
228 |
+
edcal.alignGrid(".dayheadcont", 7, 13.8, 100, 0.5);
|
229 |
+
},
|
230 |
+
|
231 |
+
/*
|
232 |
+
We have different styles for days in previous months,
|
233 |
+
the current month, and future months. This function
|
234 |
+
figures out the right class based on the date.
|
235 |
+
*/
|
236 |
+
getDateClass: function(/*Date*/ date) {
|
237 |
+
|
238 |
+
var monthstyle;
|
239 |
+
var daystyle;
|
240 |
+
|
241 |
+
if (date.compareTo(Date.today()) == -1) {
|
242 |
+
/*
|
243 |
+
* Date is before today
|
244 |
+
*/
|
245 |
+
daystyle = "beforeToday";
|
246 |
+
} else {
|
247 |
+
/*
|
248 |
+
* Date is after today
|
249 |
+
*/
|
250 |
+
daystyle = "todayAndAfter";
|
251 |
+
}
|
252 |
+
if (!edcal.firstDayOfMonth) {
|
253 |
+
/*
|
254 |
+
* We only need to figure out the first and last day
|
255 |
+
* of the month once
|
256 |
+
*/
|
257 |
+
edcal.firstDayOfMonth = Date.today().moveToFirstDayOfMonth().clearTime();
|
258 |
+
edcal.firstDayOfNextMonth = Date.today().moveToLastDayOfMonth().clearTime();
|
259 |
+
}
|
260 |
+
if (date.between(edcal.firstDayOfMonth, edcal.firstDayOfNextMonth)) {
|
261 |
+
/*
|
262 |
+
* If the date isn't before the first of the
|
263 |
+
* month and it isn't after the last of the
|
264 |
+
* month then it is in the current month.
|
265 |
+
*/
|
266 |
+
monthstyle = "month-present";
|
267 |
+
} else if (date.compareTo(edcal.firstDayOfMonth) == 1) {
|
268 |
+
/*
|
269 |
+
* Then the date is after the current month
|
270 |
+
*/
|
271 |
+
monthstyle = "month-future";
|
272 |
+
} else if (date.compareTo(edcal.firstDayOfNextMonth) == -1) {
|
273 |
+
/*
|
274 |
+
* Then the date is before the current month
|
275 |
+
*/
|
276 |
+
monthstyle = "month-past";
|
277 |
+
}
|
278 |
+
return monthstyle+' '+daystyle;
|
279 |
+
},
|
280 |
+
|
281 |
+
/*
|
282 |
+
Show the add post link. This gets called when the mouse
|
283 |
+
is over a specific day.
|
284 |
+
*/
|
285 |
+
showAddPostLink: function(/*string*/ dayid) {
|
286 |
+
if (edcal.inDrag) {
|
287 |
+
return;
|
288 |
+
}
|
289 |
+
|
290 |
+
var createLink = jQuery("#" + dayid + " a.daynewlink");
|
291 |
+
createLink.css("display", "block");
|
292 |
+
edcal.addCreateTooltip(createLink);
|
293 |
+
},
|
294 |
+
|
295 |
+
/*
|
296 |
+
Hides the add new post link it is called when the mouse moves
|
297 |
+
outside of the calendar day.
|
298 |
+
*/
|
299 |
+
hideAddPostLink: function(/*string*/ dayid) {
|
300 |
+
jQuery("#" + dayid + " a.daynewlink").hide();
|
301 |
},
|
302 |
|
303 |
/*
|
310 |
var newrow = '<div class="rowcont" id="' + 'row' + edcal._wDate.toString("ddMMyyyy") + '">' +
|
311 |
'<div id="' + 'row' + edcal._wDate.toString("ddMMyyyy") + 'row" class="row">';
|
312 |
for (var i = 0; i < 7; i++) {
|
313 |
+
/*
|
314 |
+
* Adding all of these calls in the string is kind of messy. We
|
315 |
+
* could do this with the JQuery live function, but there are a lot
|
316 |
+
* of days in the calendar and the live function gets a little slow.
|
317 |
+
*/
|
318 |
+
newrow += '<div onmouseover="edcal.showAddPostLink(\'' + _date.toString("ddMMyyyy") + '\');" ' +
|
319 |
+
'onmouseout="edcal.hideAddPostLink(\'' + _date.toString("ddMMyyyy") + '\');" ' +
|
320 |
+
'id="' + _date.toString("ddMMyyyy") + '" class="day ' +
|
321 |
+
edcal.getDateClass(_date) + ' ' +
|
322 |
_date.toString("dddd").toLowerCase() + ' month-' +
|
323 |
_date.toString("MM").toLowerCase() + '">';
|
324 |
|
325 |
newrow += '<div class="dayobj">';
|
326 |
|
|
|
327 |
newrow += '<a href="#" adddate="' + _date.toString("MMMM d") + '" class="daynewlink" title="' + edcal.str_newpost + _date.toString("MMMM d") + '" ' +
|
328 |
+
'onclick="return false;">' + edcal.str_addPostLink + '</a>';
|
329 |
+
|
330 |
+
newrow += '<div class="daylabel">';
|
331 |
if (_date.toString("dd") == "01") {
|
332 |
newrow += _date.toString("MMM d");
|
333 |
} else {
|
355 |
parent.prepend(newrow);
|
356 |
}
|
357 |
|
358 |
+
/*
|
359 |
+
* This is the horizontal alignment of an individual week
|
360 |
+
*/
|
361 |
+
edcal.alignGrid("#row" + edcal._wDate.toString("ddMMyyyy") + "row", 7, 13.9, 100, 0.5);
|
362 |
|
363 |
+
edcal.draggablePost('#row' + edcal._wDate.toString("ddMMyyyy") + ' li.post');
|
|
|
|
|
364 |
|
365 |
+
jQuery('#row' + edcal._wDate.toString("ddMMyyyy") + ' > div > div.day').droppable({
|
|
|
|
|
366 |
hoverClass: 'day-active',
|
367 |
+
accept: function(ui) {
|
368 |
+
/*
|
369 |
+
We only let them drag draft posts into the past. If
|
370 |
+
they try to drag and scheduled post into the past we
|
371 |
+
reject the drag. Using the class here is a little
|
372 |
+
fragile, but it is much faster than doing date
|
373 |
+
arithmetic every time the mouse twitches.
|
374 |
+
*/
|
375 |
+
if (jQuery(this).hasClass("beforeToday")) {
|
376 |
+
if (ui.hasClass("draft")) {
|
377 |
+
return true;
|
378 |
+
} else {
|
379 |
+
return false;
|
380 |
+
}
|
381 |
+
} else {
|
382 |
+
return true;
|
383 |
+
}
|
384 |
+
},
|
385 |
greedy: true,
|
386 |
tolerance: 'pointer',
|
387 |
drop: function(event, ui) {
|
406 |
jQuery('#' + jQuery(this).attr("id") + ' .postlist').append(edcal.createPostItem(post,
|
407 |
jQuery(this).attr("id")));
|
408 |
|
|
|
|
|
|
|
409 |
if (dayId == jQuery(this).attr("id")) {
|
410 |
/*
|
411 |
If they dropped back on to the day they started with we
|
426 |
* This is a helper method to make an individual post item draggable.
|
427 |
*/
|
428 |
draggablePost: function(/*post selector*/ post) {
|
429 |
+
jQuery(post).each(function() {
|
430 |
+
var postObj = edcal.findPostForId(jQuery(this).parent().parent().parent().attr("id"),
|
431 |
+
jQuery(this).attr("id"));
|
432 |
+
if (edcal.isPostEditable(postObj)) {
|
433 |
+
jQuery(this).draggable({
|
434 |
+
revert: 'invalid',
|
435 |
+
appendTo: 'body',
|
436 |
+
helper: "clone",
|
437 |
+
distance: 1,
|
438 |
+
addClasses: false,
|
439 |
+
start: function() {
|
440 |
+
edcal.inDrag = true;
|
441 |
+
},
|
442 |
+
stop: function() {
|
443 |
+
edcal.inDrag = false;
|
444 |
+
},
|
445 |
+
drag: function(event, ui) {
|
446 |
+
edcal.handleDrag(event, ui);
|
447 |
+
},
|
448 |
+
scroll: false,
|
449 |
+
refreshPositions: true
|
450 |
+
});
|
451 |
+
jQuery(this).addClass("draggable");
|
452 |
+
}
|
453 |
+
});
|
454 |
+
},
|
455 |
+
|
456 |
+
/*
|
457 |
+
When the user is dragging we scroll the calendar when they get
|
458 |
+
close to the top or bottom of the calendar. This function handles
|
459 |
+
scrolling the calendar when that happens.
|
460 |
+
*/
|
461 |
+
handleDrag: function(event, ui) {
|
462 |
+
if (edcal.isMoving || edcal.isDragScrolling) {
|
463 |
+
return;
|
464 |
+
}
|
465 |
+
|
466 |
+
edcal.isDragScrolling = true;
|
467 |
+
|
468 |
+
if (event.pageY < (edcal.position.top + 10)) {
|
469 |
+
/*
|
470 |
+
This means we're close enough to the top of the calendar to
|
471 |
+
start scrolling up.
|
472 |
+
*/
|
473 |
+
edcal.move(1, false);
|
474 |
+
} else if (event.pageY > (edcal.position.bottom - 10)) {
|
475 |
+
/*
|
476 |
+
This means we're close enough to the bottom of the calendar
|
477 |
+
to start scrolling down.
|
478 |
+
*/
|
479 |
+
edcal.move(1, true);
|
480 |
+
}
|
481 |
+
|
482 |
/*
|
483 |
+
We want to start scrolling as soon as the user gets their mouse
|
484 |
+
close to the top, but if we just scrolle with every event then
|
485 |
+
the screen flies by way too fast. We wait here so we scroll one
|
486 |
+
row and wait three quarters of a second. That way it gives a
|
487 |
+
smooth scroll that doesn't go too fast to track.
|
|
|
488 |
*/
|
489 |
+
setTimeout(function() {
|
490 |
+
edcal.isDragScrolling = false;
|
491 |
+
}, 500);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
492 |
},
|
493 |
|
494 |
/*
|
513 |
* Adds a post to an already existing calendar day.
|
514 |
*/
|
515 |
addPostItem: function(/*post*/ post, /*string*/ dayobjId) {
|
516 |
+
/*
|
517 |
+
* We are trying to select the .postlist item under this div. It would
|
518 |
+
* be much more adaptable to reference the class by name, but this is
|
519 |
+
* significantly faster. Especially on IE.
|
520 |
+
*/
|
521 |
+
jQuery('#' + dayobjId + " > div > ul").append(edcal.createPostItem(post, dayobjId));
|
522 |
},
|
523 |
|
524 |
/*
|
526 |
and adds the tooltip.
|
527 |
*/
|
528 |
addPostItemDragAndToolltip: function(/*string*/ dayobjId) {
|
529 |
+
edcal.draggablePost('#' + dayobjId + ' > div > ul > li');
|
|
|
530 |
},
|
531 |
|
532 |
+
|
533 |
+
/*
|
534 |
+
Deletes the post specified. Will only be executed once the user clicks the confirm link to proceed.
|
535 |
+
*/
|
536 |
+
deletePost: function(/*Post ID*/ postId) {
|
537 |
+
|
538 |
+
var url = edcal.ajax_url() + "&action=edcal_deletepost&postid=" + postId;
|
539 |
+
edcal.output("Calling AJAX URL: " + url);
|
540 |
+
|
541 |
+
jQuery.ajax( {
|
542 |
+
url: url,
|
543 |
+
type: "POST",
|
544 |
+
processData: false,
|
545 |
+
timeout: 100000,
|
546 |
+
dataType: "json",
|
547 |
+
success: function(res) {
|
548 |
+
edcal.removePostItem(res.post.date, "post-" + res.post.id);
|
549 |
+
if (res.error) {
|
550 |
+
/*
|
551 |
+
* If there was an error we need to remove the dropped
|
552 |
+
* post item.
|
553 |
+
*/
|
554 |
+
if (res.error === edcal.NONCE_ERROR) {
|
555 |
+
edcal.showError(edcal.checksum_error);
|
556 |
+
}
|
557 |
+
} else {
|
558 |
+
edcal.output('Finished deleting the post: "' + res.post.title + '"');
|
559 |
+
}
|
560 |
+
},
|
561 |
+
error: function(xhr) {
|
562 |
+
edcal.showError(edcal.general_error);
|
563 |
+
if (xhr.responseText) {
|
564 |
+
edcal.output("xhr.responseText: " + xhr.responseText);
|
565 |
+
}
|
566 |
+
}
|
567 |
+
});
|
568 |
+
},
|
569 |
+
|
570 |
+
|
571 |
+
|
572 |
+
|
573 |
/*
|
574 |
* Confirms if you want to delete the specified post
|
575 |
*/
|
576 |
confirmDelete: function(/*string*/ posttitle) {
|
577 |
if (confirm(edcal.str_del_msg1 + posttitle + edcal.str_del_msg2)) {
|
578 |
return true;
|
579 |
+
// [wes] might be better to call deletePost from here directly, rather than return control back to the agent... which will then follow the link and call deletePost
|
580 |
} else {
|
581 |
return false;
|
582 |
}
|
583 |
},
|
584 |
+
|
585 |
+
/*
|
586 |
+
This is a simple function that creates the AJAX URL with the
|
587 |
+
nonce value generated in edcal.php.
|
588 |
+
*/
|
589 |
+
ajax_url: function() {
|
590 |
+
return ajaxurl + "?_wpnonce=" + edcal.wp_nonce;
|
591 |
+
},
|
592 |
|
593 |
/*
|
594 |
This is an AJAX function to save the past title when
|
596 |
*/
|
597 |
saveTitle: function(/*string*/ postId) {
|
598 |
edcal.output("Saving the new title " + jQuery("#edcal-title-edit-field").val() + " for post " + postId);
|
599 |
+
var url = edcal.ajax_url() + "&action=edcal_changetitle&postid=" + postId +
|
600 |
"&title=" + encodeURIComponent(jQuery("#edcal-title-edit-field").val());
|
601 |
|
602 |
jQuery("#post-" + postId).addClass("loadingclass");
|
622 |
}
|
623 |
edcal.addPostItem(res.post, res.post.date);
|
624 |
edcal.addPostItemDragAndToolltip(res.post.date);
|
|
|
625 |
},
|
626 |
error: function(xhr) {
|
627 |
edcal.showError(edcal.general_error);
|
663 |
jQuery("#tooltip").hide();
|
664 |
},
|
665 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
666 |
/*
|
667 |
* Adds a tooltip to every add post link
|
668 |
*/
|
671 |
return;
|
672 |
}
|
673 |
|
674 |
+
var date = createLink.parent().parent().attr("id");
|
675 |
|
676 |
|
677 |
createLink.tooltip({
|
768 |
return postsString;
|
769 |
},
|
770 |
|
771 |
+
/*
|
772 |
+
When you hover your mouse over a post we show the edit, delete,
|
773 |
+
and view links below it. If there was another post below we don't
|
774 |
+
want it to jump around. To make that work we set a padding on the
|
775 |
+
bottom of the post equal to the height of the div containing
|
776 |
+
the links. When the div is shown we remove the padding on the
|
777 |
+
bottom.
|
778 |
+
|
779 |
+
This function determines the right size for that padding. We
|
780 |
+
call it once when we first get posts and again if we resize the
|
781 |
+
window. The boolean indicates which case this is.
|
782 |
+
*/
|
783 |
+
updatePostPadding: function(/*boolean*/ resized) {
|
784 |
+
if (resized || !edcal.actionButtonHeight) {
|
785 |
+
edcal.actionButtonHeight = jQuery("div.postactions").height();
|
786 |
+
jQuery(".post").css("padding-bottom", edcal.actionButtonHeight + "px");
|
787 |
+
}
|
788 |
+
},
|
789 |
+
|
790 |
+
/*
|
791 |
+
This function shows the action links for the post with the
|
792 |
+
specified ID.
|
793 |
+
*/
|
794 |
+
showActionLinks: function(/*string*/ postid) {
|
795 |
+
if (edcal.inDrag) {
|
796 |
+
return;
|
797 |
+
}
|
798 |
+
jQuery('#' + postid).css({
|
799 |
+
'padding-bottom': '0px'
|
800 |
+
});
|
801 |
+
jQuery('#' + postid + ' > div.postactions').show();
|
802 |
+
},
|
803 |
+
|
804 |
+
/*
|
805 |
+
Hides the action links for the post with the specified
|
806 |
+
post ID.
|
807 |
+
*/
|
808 |
+
hideActionLinks: function(/*string*/ postid) {
|
809 |
+
jQuery('#' + postid).css({
|
810 |
+
'padding-bottom': edcal.actionButtonHeight + "px"
|
811 |
+
});
|
812 |
+
jQuery('#' + postid + ' > div.postactions').hide();
|
813 |
+
},
|
814 |
+
|
815 |
+
/*
|
816 |
+
* Returns true if the post is editable and false otherwise
|
817 |
+
*/
|
818 |
+
isPostEditable: function(/*post*/ post) {
|
819 |
+
return post.status !== 'publish';
|
820 |
+
},
|
821 |
+
|
822 |
/*
|
823 |
* Gets the HTML string for a post.
|
824 |
*/
|
828 |
if (posttitle === "") {
|
829 |
posttitle = "[No Title]";
|
830 |
}
|
831 |
+
|
832 |
+
if (post.status === "draft" ||
|
833 |
+
post.status === "pending") {
|
834 |
+
posttitle += edcal.str_draft;
|
835 |
+
} else if (post.status !== "publish" &&
|
836 |
+
post.status !== "future" &&
|
837 |
+
post.status !== "pending") {
|
838 |
+
/*
|
839 |
+
There are some WordPress plugins that let you specify
|
840 |
+
custom post status. In that case we just want to show
|
841 |
+
you the status.
|
842 |
+
*/
|
843 |
+
posttitle += ' [' + post.status + ']';
|
844 |
+
}
|
845 |
+
|
846 |
+
posttitle = '<span class="posttime">' + post.formattedtime + '</span> ' + posttitle;
|
847 |
+
|
848 |
+
if (edcal.isPostEditable(post)) {
|
849 |
+
return '<li onmouseover="edcal.showActionLinks(\'post-' + post.id + '\');" ' +
|
850 |
+
'onmouseout="edcal.hideActionLinks(\'post-' + post.id + '\');" ' +
|
851 |
+
'id="post-' + post.id + '" class="post ' + post.status + '"><div class="postlink">' + posttitle + '</div>' +
|
852 |
+
'<div class="postactions"><a href="' + post.editlink + '">' + edcal.str_edit + '</a> | ' +
|
853 |
+
'<a href="' + post.dellink + '" onclick="return edcal.confirmDelete(\'' + post.title + '\');">' + edcal.str_del + '</a> | ' +
|
854 |
+
'<a href="' + post.permalink + '">' + edcal.str_view + '</a>' +
|
855 |
+
'</div></li>';
|
856 |
+
} else {
|
857 |
+
return '<li onmouseover="edcal.showActionLinks(\'post-' + post.id + '\');" ' +
|
858 |
+
'onmouseout="edcal.hideActionLinks(\'post-' + post.id + '\');" ' +
|
859 |
+
'id="post-' + post.id + '" class="post ' + post.status + '"><div class="postlink">' + posttitle + '</div>' +
|
860 |
+
'<div class="postactions"><a href="' + post.editlink + '">' + edcal.str_republish + '</a>' +
|
861 |
+
'</div></li>';
|
862 |
+
}
|
863 |
},
|
864 |
|
865 |
/*
|
868 |
*/
|
869 |
setClassforToday: function() {
|
870 |
/*
|
871 |
+
We want to set a class for the cell that represents the current day so we can
|
872 |
give it a background color.
|
873 |
*/
|
874 |
jQuery('#' + Date.today().toString("ddMMyyyy")).addClass("today");
|
880 |
calendar based on the window height.
|
881 |
*/
|
882 |
getCalHeight: function() {
|
883 |
+
var myHeight = jQuery(window).height() - 225;
|
884 |
+
|
885 |
+
/*
|
886 |
+
We don't want to make the calendar too short even if the
|
887 |
+
user's screen is super short.
|
888 |
+
*/
|
889 |
+
return Math.max(myHeight, 600);
|
|
|
|
|
|
|
|
|
|
|
890 |
},
|
891 |
|
892 |
/*
|
895 |
up into the past.
|
896 |
*/
|
897 |
move: function(steps, direction) {
|
898 |
+
/*
|
899 |
The working date is a marker for the last calendar row we created.
|
900 |
If we are moving forward that will be the last row, if we are moving
|
901 |
backward it will be the first row. If we switch direction we need
|
903 |
*/
|
904 |
if (edcal.currentDirection != direction) {
|
905 |
if (direction) { // into the future
|
906 |
+
edcal._wDate = edcal._wDate.add((edcal.weeksPref + 7) * 7).days();
|
907 |
} else { // into the past
|
908 |
+
edcal._wDate = edcal._wDate.add(-((edcal.weeksPref + 7) * 7)).days();
|
909 |
}
|
910 |
|
911 |
edcal.steps = 0;
|
912 |
edcal.moveDate = edcal._wDate;
|
913 |
}
|
914 |
+
|
915 |
edcal.currentDirection = direction;
|
916 |
|
917 |
var i;
|
976 |
issue by adding the spaces back before we parse.
|
977 |
*/
|
978 |
getDayFromDayId: function(/*dayId*/ day) {
|
979 |
+
return Date.parseExact(day.substring(2, 4) + '/' + day.substring(0, 2) + '/' + day.substring(4), "MM/dd/yyyy");
|
980 |
},
|
981 |
|
982 |
/*
|
984 |
the calendar. It looks like November 2009-December2009
|
985 |
*/
|
986 |
setDateLabel: function(year) {
|
987 |
+
var api = jQuery("#edcal_scrollable").scrollable();
|
988 |
var items = api.getVisibleItems();
|
989 |
|
990 |
/*
|
993 |
work around a small JQuery issue.
|
994 |
*/
|
995 |
var firstDate = edcal.getDayFromDayId(items.eq(0).children(".row").children(".day:first").attr("id"));
|
996 |
+
var lastDate = edcal.getDayFromDayId(items.eq(edcal.weeksPref - 1).children(".row").children(".day:last").attr("id"));
|
997 |
|
998 |
jQuery("#currentRange").text(firstDate.toString("MMMM yyyy") + " - " + lastDate.toString("MMMM yyyy"));
|
999 |
},
|
1104 |
/*
|
1105 |
When we first start up our working date is 4 weeks before
|
1106 |
the next Sunday.
|
1107 |
+
*/
|
1108 |
+
edcal._wDate = edcal.nextStartOfWeek(date).add(-21).days();
|
1109 |
|
1110 |
/*
|
1111 |
+
After we remove and redo all the rows we are back to
|
1112 |
moving in a going down direction.
|
1113 |
*/
|
1114 |
edcal.currentDirection = true;
|
1115 |
|
1116 |
+
for (var i = 0; i < edcal.weeksPref + 6; i++) {
|
1117 |
edcal.createRow(jQuery("#cal"), true);
|
1118 |
edcal._wDate.add(7).days();
|
1119 |
}
|
1120 |
|
1121 |
edcal.alignCal();
|
1122 |
|
1123 |
+
var api = jQuery("#edcal_scrollable").scrollable();
|
1124 |
api.move(2);
|
1125 |
|
1126 |
edcal.setDateLabel();
|
1128 |
edcal.isMoving = false;
|
1129 |
|
1130 |
},
|
1131 |
+
|
1132 |
+
/*
|
1133 |
+
When we handle dragging posts we need to know the size
|
1134 |
+
of the calendar so we figure it out ahead of time and
|
1135 |
+
save it.
|
1136 |
+
*/
|
1137 |
+
savePosition: function() {
|
1138 |
+
var cal = jQuery("#edcal_scrollable");
|
1139 |
+
edcal.position = {
|
1140 |
+
top: cal.offset().top,
|
1141 |
+
bottom: cal.offset().top + cal.height()
|
1142 |
+
};
|
1143 |
+
|
1144 |
+
edcal.updatePostPadding(true);
|
1145 |
+
|
1146 |
+
/*
|
1147 |
+
When the user drags a post they get a "helper" element that clones
|
1148 |
+
the post and displays it during the drag. This means they get all
|
1149 |
+
the same classes and styles. However, the width of a post is based
|
1150 |
+
on the width of a day in the calendar and not anything in a style.
|
1151 |
+
That works well for the posts in the calendar, but it means we need
|
1152 |
+
to dynamically determine the width of the post when dragging.
|
1153 |
+
|
1154 |
+
This value will remain the same until the calendar resizes. That is
|
1155 |
+
why we do it here. We need to get the width of the first visible day
|
1156 |
+
in the calendar which is why we use the complicated selector. We also
|
1157 |
+
need to generate a style for it since the drag element doesn't exist
|
1158 |
+
yet and using the live function would really slow down the drag operation.
|
1159 |
+
|
1160 |
+
We base this on the width of a way since they might not have any posts
|
1161 |
+
yet.
|
1162 |
+
*/
|
1163 |
+
jQuery('#edcal_poststyle').remove();
|
1164 |
+
jQuery('head').append('<style id="edcal_poststyle" type="text/css">.ui-draggable-dragging {' +
|
1165 |
+
'width: ' + (jQuery(".rowcont:eq(2) .day:first").width() - 5) + 'px;' +
|
1166 |
+
'</style>}');
|
1167 |
+
},
|
1168 |
|
1169 |
/*
|
1170 |
* Initializes the calendar
|
1189 |
edcal.createDaysHeader();
|
1190 |
|
1191 |
// initialize scrollable
|
1192 |
+
jQuery("#edcal_scrollable").scrollable({
|
1193 |
vertical:true,
|
1194 |
+
size: edcal.weeksPref,
|
1195 |
keyboardSteps: 1,
|
1196 |
speed: 100
|
1197 |
// use mousewheel plugin
|
1198 |
}).mousewheel();
|
1199 |
|
1200 |
+
var api = jQuery("#edcal_scrollable").scrollable();
|
1201 |
|
1202 |
edcal.moveTo(Date.today());
|
1203 |
|
1236 |
|
1237 |
if ((evt.keyCode === 34 && !(evt.altKey || evt.ctrlKey)) || //page down
|
1238 |
evt.keyCode === 40 && evt.ctrlKey){ // Ctrl+down down arrow
|
1239 |
+
edcal.move(edcal.weeksPref, true);
|
1240 |
return false;
|
1241 |
} else if ((evt.keyCode === 33 && !(evt.altKey || evt.ctrlKey)) || //page up
|
1242 |
evt.keyCode === 38 && evt.ctrlKey){ // Ctrl+up up arrow
|
1243 |
+
edcal.move(edcal.weeksPref, false);
|
1244 |
return false;
|
1245 |
} else if (evt.keyCode === 27) { //escape key
|
1246 |
edcal.closeTooltip();
|
1248 |
}
|
1249 |
});
|
1250 |
|
1251 |
+
edcal.getPosts(edcal.nextStartOfWeek(Date.today()).add(-21).days(),
|
1252 |
+
edcal.nextStartOfWeek(Date.today()).add((edcal.weeksPref * 7) + 21).days());
|
1253 |
|
1254 |
/*
|
1255 |
Now we bind the listeners for all of our links and the window
|
1261 |
});
|
1262 |
|
1263 |
jQuery("#prevmonth").click(function() {
|
1264 |
+
edcal.move(edcal.weeksPref, false);
|
1265 |
return false;
|
1266 |
});
|
1267 |
|
1268 |
jQuery("#nextmonth").click(function() {
|
1269 |
+
edcal.move(edcal.weeksPref, true);
|
1270 |
return false;
|
1271 |
});
|
1272 |
|
1274 |
if (edcal.windowHeight != jQuery(window).height()) {
|
1275 |
jQuery("#edcal_scrollable").css("height", edcal.getCalHeight() + "px");
|
1276 |
edcal.windowHeight = jQuery(window).height();
|
1277 |
+
edcal.savePosition();
|
1278 |
}
|
1279 |
}
|
1280 |
jQuery(window).bind("resize", resizeWindow);
|
1281 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1282 |
jQuery("#newPostButton").live("click", function(evt) {
|
1283 |
edcal.createNewDraft(jQuery(this).attr("adddate"), jQuery("#edcal-title-new-field").val(), false);
|
1284 |
});
|
1313 |
}
|
1314 |
|
1315 |
});
|
1316 |
+
|
1317 |
+
jQuery("#edcal_weeks_pref").live("keyup", function(evt) {
|
1318 |
+
if (jQuery("#edcal_weeks_pref").val().length > 0) {
|
1319 |
+
jQuery("#edcal_applyoptions").removeClass("disabled");
|
1320 |
+
} else {
|
1321 |
+
jQuery("#edcal_applyoptions").addClass("disabled");
|
1322 |
+
}
|
1323 |
+
|
1324 |
+
if (evt.keyCode == 13) { // enter key
|
1325 |
+
edcal.saveOptions();
|
1326 |
+
}
|
1327 |
+
|
1328 |
+
});
|
1329 |
+
|
1330 |
+
edcal.savePosition();
|
1331 |
+
|
1332 |
+
edcal.addOptionsSection();
|
1333 |
},
|
1334 |
|
1335 |
/*
|
1336 |
* When the user presses the new post link on each calendar cell they get
|
1337 |
* a tooltip which prompts them to edit the title of the new post. Once
|
1338 |
+
* they provide a title we call this function.
|
1339 |
*
|
1340 |
* date - the date for the new post
|
1341 |
* title - the title for the new post
|
1346 |
if (!title || title === "") {
|
1347 |
return;
|
1348 |
}
|
1349 |
+
edcal.output("createNewDraft(" + date + ", " + title + ")");
|
|
|
1350 |
|
1351 |
jQuery("#edit-slug-buttons").addClass("tiploading");
|
1352 |
/*
|
1354 |
* put a default post time of 10:00 AM.
|
1355 |
*/
|
1356 |
var formattedDate = encodeURIComponent(edcal.getDayFromDayId(date).toString(edcal.wp_dateFormat) + " 10:00:00");
|
1357 |
+
var url = edcal.ajax_url() + "&action=edcal_newdraft&date=" + formattedDate + "&title=" +
|
|
|
1358 |
encodeURIComponent(title);
|
1359 |
|
1360 |
jQuery.ajax( {
|
1380 |
if (!res.post) {
|
1381 |
edcal.showError("There was an error creating a new post for your blog.");
|
1382 |
} else {
|
|
|
1383 |
if (doEdit) {
|
1384 |
/*
|
1385 |
* If the user wanted to edit the post then we redirect
|
1411 |
edcal.output('Changing the date of "' + post.title + '" to ' + newdate);
|
1412 |
var newdateFormatted = edcal.getDayFromDayId(newdate).toString(edcal.wp_dateFormat);
|
1413 |
|
1414 |
+
var url = edcal.ajax_url() + "&action=edcal_changedate&postid=" + post.id +
|
1415 |
+
"&postStatus=" + post.status +
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1416 |
"&newdate=" + newdateFormatted + "&olddate=" + edcal.getDayFromDayId(post.date).toString(edcal.wp_dateFormat);
|
1417 |
|
1418 |
jQuery("#post-" + post.id).addClass("loadingclass");
|
1419 |
+
|
1420 |
jQuery.ajax( {
|
1421 |
url: url,
|
1422 |
type: "POST",
|
1428 |
edcal.addPostItem(res.post, res.post.date);
|
1429 |
edcal.addPostItemDragAndToolltip(res.post.date);
|
1430 |
|
|
|
|
|
1431 |
if (res.error) {
|
1432 |
/*
|
1433 |
* If there was an error we need to remove the dropped
|
1465 |
if (shouldGet) {
|
1466 |
/*
|
1467 |
* TODO: We don't want to make extra AJAX calls for dates
|
1468 |
+
* that we have already covered. This is cutting down on
|
1469 |
* it somewhat, but we could get much better about this.
|
1470 |
*/
|
1471 |
edcal.output("Using cached results for posts from " + from.toString("dd-MMM-yyyy") + " to " + to.toString("dd-MMM-yyyy"));
|
1474 |
|
1475 |
edcal.cacheDates[from] = true;
|
1476 |
|
1477 |
+
edcal.output("edcal.ajax_url(): " + edcal.ajax_url());
|
1478 |
+
|
1479 |
+
var url = edcal.ajax_url() + "&action=edcal_posts&from=" + from.toString("yyyy-MM-dd") + "&to=" + to.toString("yyyy-MM-dd");
|
1480 |
+
|
1481 |
jQuery("#loading").show();
|
1482 |
|
1483 |
jQuery.ajax( {
|
1506 |
return;
|
1507 |
}
|
1508 |
var postDates = [];
|
1509 |
+
|
1510 |
+
/*
|
1511 |
+
We get the posts back with the most recent post first. That
|
1512 |
+
is what most blogs want. However, we want them in the other
|
1513 |
+
order so we can show the earliest post in a given day first.
|
1514 |
+
*/
|
1515 |
+
for (var i = parsedRes.length; i >= 0; i--) {
|
1516 |
+
var post = parsedRes[i];
|
1517 |
if (post) {
|
1518 |
if (post.status === 'trash') {
|
1519 |
+
continue;
|
1520 |
}
|
1521 |
|
1522 |
/*
|
1531 |
edcal.addPostItem(post, post.date);
|
1532 |
postDates[postDates.length] = post.date;
|
1533 |
}
|
1534 |
+
}
|
1535 |
|
1536 |
/*
|
1537 |
* If the blog has a very larger number of posts then adding
|
1544 |
* stop complaining.
|
1545 |
*/
|
1546 |
setTimeout(function() {
|
1547 |
+
edcal.output("Finished adding draggable support to " + postDates.length + " posts.");
|
1548 |
jQuery.each(postDates, function(i, postDate) {
|
1549 |
edcal.addPostItemDragAndToolltip(postDate);
|
1550 |
});
|
1551 |
+
edcal.updatePostPadding(false);
|
1552 |
}, 300);
|
1553 |
},
|
1554 |
error: function(xhr) {
|
1560 |
});
|
1561 |
},
|
1562 |
|
1563 |
+
/*
|
1564 |
+
This function adds the scren options tab to the top of the screen. I wish
|
1565 |
+
WordPress had a hook so I could provide this in PHP, but as of version 2.9.1
|
1566 |
+
they just have an internal loop for their own screen options tabs so we're
|
1567 |
+
doing this in JavaScript.
|
1568 |
+
*/
|
1569 |
+
addOptionsSection: function() {
|
1570 |
+
var html =
|
1571 |
+
'<div class="hide-if-no-js screen-meta-toggle" id="screen-options-link-wrap">' +
|
1572 |
+
'<a class="show-settings" ' +
|
1573 |
+
'id="show-edcal-settings-link" ' +
|
1574 |
+
'onclick="edcal.toggleOptions(); return false;" ' +
|
1575 |
+
'href="#screen-options" ' +
|
1576 |
+
'style="background-image: url(images/screen-options-right.gif);">' + edcal.str_screenoptions + '</a>' +
|
1577 |
+
'</div>';
|
1578 |
+
|
1579 |
+
jQuery("#screen-meta-links").append(html);
|
1580 |
+
},
|
1581 |
+
|
1582 |
+
/*
|
1583 |
+
Respond to clicks on the Screen Options tab by sliding it down when it
|
1584 |
+
is up and sliding it up when it is down.
|
1585 |
+
*/
|
1586 |
+
toggleOptions: function() {
|
1587 |
+
if (!edcal.helpMeta) {
|
1588 |
+
/*
|
1589 |
+
Show the screen options section. We start by saving off the old HTML
|
1590 |
+
*/
|
1591 |
+
edcal.helpMeta = jQuery("#contextual-help-wrap").html();
|
1592 |
+
|
1593 |
+
jQuery("#contextual-help-wrap").html(
|
1594 |
+
'<h5>' + edcal.str_optionsheader + '</h5>' +
|
1595 |
+
'<div class="metabox-prefs">' +
|
1596 |
+
edcal.str_show + '<input type="text" value="' + edcal.weeksPref + '" ' +
|
1597 |
+
'maxlength="1" width="2" id="edcal_weeks_pref" ' +
|
1598 |
+
'class="screen-per-page" title="' + edcal.str_weekstt + '" /> ' +
|
1599 |
+
edcal.str_show2 + '<br /><br />' +
|
1600 |
+
'<button id="edcal_applyoptions" onclick="edcal.saveOptions(); return false;" class="save button">' + edcal.str_apply + '</button>' +
|
1601 |
+
'</div>');
|
1602 |
+
|
1603 |
+
jQuery("#contextual-help-link-wrap").hide();
|
1604 |
+
|
1605 |
+
jQuery('#contextual-help-wrap').slideDown('normal');
|
1606 |
+
|
1607 |
+
jQuery("#show-edcal-settings-link").css("background-image", "url(images/screen-options-right-up.gif)");
|
1608 |
+
} else {
|
1609 |
+
jQuery('#contextual-help-wrap').slideUp('fast');
|
1610 |
+
|
1611 |
+
/*
|
1612 |
+
* restore the old HTML
|
1613 |
+
*/
|
1614 |
+
jQuery("#contextual-help-wrap").html(edcal.helpMeta);
|
1615 |
+
|
1616 |
+
edcal.helpMeta = null;
|
1617 |
+
|
1618 |
+
jQuery("#show-edcal-settings-link").css("background-image", "url(images/screen-options-right.gif)");
|
1619 |
+
jQuery("#contextual-help-link-wrap").show();
|
1620 |
+
}
|
1621 |
+
},
|
1622 |
+
|
1623 |
+
/*
|
1624 |
+
Save the number of weeks options with an AJAX call. This happens
|
1625 |
+
when you press the apply button.
|
1626 |
+
*/
|
1627 |
+
saveOptions: function() {
|
1628 |
+
/*
|
1629 |
+
We start by validating the number of weeks. We only allow
|
1630 |
+
1, 2, 3, 4, or 5 weeks at a time.
|
1631 |
+
*/
|
1632 |
+
if (jQuery("#edcal_weeks_pref").val() !== '1' &&
|
1633 |
+
jQuery("#edcal_weeks_pref").val() !== '2' &&
|
1634 |
+
jQuery("#edcal_weeks_pref").val() !== '3' &&
|
1635 |
+
jQuery("#edcal_weeks_pref").val() !== '4' &&
|
1636 |
+
jQuery("#edcal_weeks_pref").val() !== '5') {
|
1637 |
+
humanMsg.displayMsg(edcal.str_weekserror);
|
1638 |
+
return;
|
1639 |
+
}
|
1640 |
+
|
1641 |
+
var url = edcal.ajax_url() + "&action=edcal_saveoptions&weeks=" +
|
1642 |
+
encodeURIComponent(jQuery("#edcal_weeks_pref").val());
|
1643 |
+
|
1644 |
+
jQuery.ajax( {
|
1645 |
+
url: url,
|
1646 |
+
type: "POST",
|
1647 |
+
processData: false,
|
1648 |
+
timeout: 100000,
|
1649 |
+
dataType: "text",
|
1650 |
+
success: function(res) {
|
1651 |
+
/*
|
1652 |
+
Now we refresh the page because I'm too lazy to
|
1653 |
+
make changing the weeks work inline.
|
1654 |
+
*/
|
1655 |
+
window.location.href = window.location.href;
|
1656 |
+
},
|
1657 |
+
error: function(xhr) {
|
1658 |
+
edcal.showError(edcal.general_error);
|
1659 |
+
if (xhr.responseText) {
|
1660 |
+
edcal.output("xhr.responseText: " + xhr.responseText);
|
1661 |
+
}
|
1662 |
+
}
|
1663 |
+
});
|
1664 |
+
},
|
1665 |
+
|
1666 |
/**
|
1667 |
* Outputs info messages to the Firebug console if it is available.
|
1668 |
*
|
edcal.php
CHANGED
@@ -18,16 +18,18 @@
|
|
18 |
/*
|
19 |
Plugin Name: WordPress Editorial Calendar
|
20 |
Description: An editorial calendar for managing the dates of your WordPress posts
|
21 |
-
Version: 0.
|
22 |
Author: Mary Vogt and Zack Grossbart
|
23 |
Author URI: http://www.zackgrossbart.com
|
24 |
*/
|
25 |
|
|
|
26 |
add_action('wp_ajax_edcal_changedate', 'edcal_changedate' );
|
27 |
add_action('wp_ajax_edcal_newdraft', 'edcal_newdraft' );
|
28 |
add_action('wp_ajax_edcal_changetitle', 'edcal_changetitle' );
|
29 |
add_action('admin_menu', 'edcal_list_add_management_page');
|
30 |
add_action('wp_ajax_edcal_posts', 'edcal_posts' );
|
|
|
31 |
add_action("admin_print_scripts", 'edcal_scripts');
|
32 |
add_action("init", 'edcal_load_language');
|
33 |
|
@@ -108,7 +110,14 @@ function edcal_list_admin() {
|
|
108 |
<!-- This is just a little script so we can pass the AJAX URL and some localized strings -->
|
109 |
<script type="text/javascript">
|
110 |
jQuery(document).ready(function(){
|
111 |
-
edcal.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
|
113 |
/*
|
114 |
* We want to show the day of the first day of the week to match the user's
|
@@ -127,47 +136,55 @@ function edcal_list_admin() {
|
|
127 |
* pass the values to JavaScript.
|
128 |
*/
|
129 |
|
130 |
-
edcal.str_on =
|
131 |
-
edcal.str_by =
|
132 |
-
edcal.str_at =
|
|
|
|
|
133 |
|
134 |
-
edcal.str_day1 =
|
135 |
-
edcal.str_day2 =
|
136 |
-
edcal.str_day3 =
|
137 |
-
edcal.str_day4 =
|
138 |
-
edcal.str_day5 =
|
139 |
-
edcal.str_day6 =
|
140 |
-
edcal.str_day7 =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
141 |
|
142 |
-
edcal.
|
143 |
-
edcal.
|
144 |
-
edcal.str_view = '<?php echo(__('View', 'editorial-calendar')) ?>';
|
145 |
-
edcal.str_status = '<?php echo(__('Status:', 'editorial-calendar')) ?>';
|
146 |
-
edcal.str_cancel = '<?php echo(__('Cancel', 'editorial-calendar')) ?>';
|
147 |
-
edcal.str_posttitle = '<?php echo(__('Post Title:', 'editorial-calendar')) ?>';
|
148 |
-
edcal.str_savedraft = '<?php echo(__('Save Draft', 'editorial-calendar')) ?>';
|
149 |
-
edcal.str_saveandedit = '<?php echo(__('Save and Edit Draft', 'editorial-calendar')) ?>';
|
150 |
-
edcal.str_newpost = '<?php echo(__('Add a new post on ', 'editorial-calendar')) ?>';
|
151 |
|
152 |
-
edcal.
|
153 |
-
edcal.
|
|
|
|
|
154 |
|
155 |
-
edcal.
|
156 |
-
edcal.
|
157 |
-
edcal.
|
158 |
-
edcal.
|
|
|
|
|
|
|
159 |
});
|
160 |
</script>
|
161 |
|
162 |
<style type="text/css">
|
163 |
-
.loadingclass, .tiploading {
|
164 |
background-image: url('<?php echo(path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/images/loading_post.gif")); ?>');
|
165 |
}
|
166 |
|
167 |
-
.loadingclass:hover {
|
168 |
-
background-image: url('<?php echo(path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/images/loading_post_hover.gif")); ?>');
|
169 |
-
}
|
170 |
-
|
171 |
#loading {
|
172 |
background-image: url('<?php echo(path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/images/loading.gif")); ?>');
|
173 |
}
|
@@ -175,6 +192,32 @@ function edcal_list_admin() {
|
|
175 |
#tipclose {
|
176 |
background-image: url('<?php echo(path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/images/tip_close.gif")); ?>');
|
177 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
178 |
</style>
|
179 |
|
180 |
<?php
|
@@ -193,23 +236,24 @@ function edcal_list_admin() {
|
|
193 |
<div id="loading"> </div>
|
194 |
</div>
|
195 |
|
196 |
-
<div id="topbar">
|
197 |
-
<div id="topleft">
|
198 |
-
<
|
199 |
-
<a href="#" title="<?php echo(__('
|
200 |
<span id="currentRange"></span>
|
201 |
-
<a href="#" title="<?php echo(__('Skip ahead
|
202 |
-
</
|
203 |
</div>
|
204 |
|
205 |
<div id="topright">
|
206 |
-
<a href="#" id="moveToToday"><?php echo(__('Today', 'editorial-calendar')) ?></a>
|
207 |
</div>
|
208 |
</div>
|
209 |
|
210 |
-
<div id="
|
211 |
-
|
212 |
-
|
|
|
213 |
</div>
|
214 |
</div>
|
215 |
|
@@ -301,8 +345,9 @@ function edcal_posts() {
|
|
301 |
|
302 |
?>[
|
303 |
<?php
|
|
|
304 |
|
305 |
-
|
306 |
/*
|
307 |
* Sticky posts are ones that stick to the front page.
|
308 |
* They do technically have a date, but it doesn't
|
@@ -311,8 +356,10 @@ function edcal_posts() {
|
|
311 |
* to stay on the front page.
|
312 |
*/
|
313 |
|
|
|
|
|
314 |
if (!is_sticky($post->ID)) {
|
315 |
-
edcal_postJSON($post);
|
316 |
}
|
317 |
}
|
318 |
|
@@ -322,35 +369,97 @@ function edcal_posts() {
|
|
322 |
die();
|
323 |
}
|
324 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
325 |
/*
|
326 |
* This function sets up the post data and prints out the values we
|
327 |
* care about in a JSON data structure. This prints out just the
|
328 |
* value part.
|
329 |
*/
|
330 |
-
function edcal_postJSON($post) {
|
331 |
setup_postdata($post);
|
332 |
?>
|
333 |
{
|
334 |
"date" : "<?php the_time('d') ?><?php the_time('m') ?><?php the_time('Y') ?>",
|
335 |
"time" : "<?php the_time() ?>",
|
336 |
-
"
|
|
|
337 |
"status" : "<?php echo(get_post_status()); ?>",
|
338 |
-
"title" :
|
339 |
"author" : "<?php the_author(); ?>",
|
340 |
<?php if ( current_user_can('edit_post', $post->ID) ) {?>
|
341 |
"editlink" : "<?php echo(get_edit_post_link($id)); ?>",
|
342 |
<?php } ?>
|
343 |
|
344 |
-
<?php if ( current_user_can('delete_post', $post->ID) ) {?>
|
345 |
-
"dellink" : "<?php echo
|
346 |
<?php } ?>
|
347 |
|
348 |
"permalink" : "<?php echo(get_permalink($id)); ?>",
|
349 |
"id" : "<?php the_ID(); ?>"
|
350 |
-
}
|
351 |
<?php
|
|
|
|
|
|
|
352 |
}
|
353 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
354 |
/*
|
355 |
* This is a helper AJAX function to change the title of a post. It
|
356 |
* gets called from the save button in the tooltip when you change a
|
@@ -621,3 +730,29 @@ function edcal_changedate() {
|
|
621 |
|
622 |
die();
|
623 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
/*
|
19 |
Plugin Name: WordPress Editorial Calendar
|
20 |
Description: An editorial calendar for managing the dates of your WordPress posts
|
21 |
+
Version: 0.6
|
22 |
Author: Mary Vogt and Zack Grossbart
|
23 |
Author URI: http://www.zackgrossbart.com
|
24 |
*/
|
25 |
|
26 |
+
add_action('wp_ajax_edcal_saveoptions', 'edcal_saveoptions' );
|
27 |
add_action('wp_ajax_edcal_changedate', 'edcal_changedate' );
|
28 |
add_action('wp_ajax_edcal_newdraft', 'edcal_newdraft' );
|
29 |
add_action('wp_ajax_edcal_changetitle', 'edcal_changetitle' );
|
30 |
add_action('admin_menu', 'edcal_list_add_management_page');
|
31 |
add_action('wp_ajax_edcal_posts', 'edcal_posts' );
|
32 |
+
add_action('wp_ajax_edcal_deletepost', 'edcal_deletepost' );
|
33 |
add_action("admin_print_scripts", 'edcal_scripts');
|
34 |
add_action("init", 'edcal_load_language');
|
35 |
|
110 |
<!-- This is just a little script so we can pass the AJAX URL and some localized strings -->
|
111 |
<script type="text/javascript">
|
112 |
jQuery(document).ready(function(){
|
113 |
+
edcal.wp_nonce = '<?php echo wp_create_nonce("edit-calendar"); ?>';
|
114 |
+
<?php
|
115 |
+
if (get_option("edcal_weeks_pref") != "") {
|
116 |
+
?>
|
117 |
+
edcal.weeksPref = '<?php echo(get_option("edcal_weeks_pref")); ?>';
|
118 |
+
<?php
|
119 |
+
}
|
120 |
+
?>
|
121 |
|
122 |
/*
|
123 |
* We want to show the day of the first day of the week to match the user's
|
136 |
* pass the values to JavaScript.
|
137 |
*/
|
138 |
|
139 |
+
edcal.str_on = <?php echo(edcal_json_encode(__('on', 'editorial-calendar'))) ?>;
|
140 |
+
edcal.str_by = <?php echo(edcal_json_encode(__('by', 'editorial-calendar'))) ?>;
|
141 |
+
edcal.str_at = <?php echo(edcal_json_encode(__('at', 'editorial-calendar'))) ?>;
|
142 |
+
|
143 |
+
edcal.str_addPostLink = <?php echo(edcal_json_encode(__('Add a Post', 'editorial-calendar'))) ?>;
|
144 |
|
145 |
+
edcal.str_day1 = <?php echo(edcal_json_encode(__('Sunday', 'editorial-calendar'))) ?>;
|
146 |
+
edcal.str_day2 = <?php echo(edcal_json_encode(__('Monday', 'editorial-calendar'))) ?>;
|
147 |
+
edcal.str_day3 = <?php echo(edcal_json_encode(__('Tuesday', 'editorial-calendar'))) ?>;
|
148 |
+
edcal.str_day4 = <?php echo(edcal_json_encode(__('Wednesday', 'editorial-calendar'))) ?>;
|
149 |
+
edcal.str_day5 = <?php echo(edcal_json_encode(__('Thursday', 'editorial-calendar'))) ?>;
|
150 |
+
edcal.str_day6 = <?php echo(edcal_json_encode(__('Friday', 'editorial-calendar'))) ?>;
|
151 |
+
edcal.str_day7 = <?php echo(edcal_json_encode(__('Saturday', 'editorial-calendar'))) ?>;
|
152 |
+
|
153 |
+
edcal.str_draft = <?php echo(edcal_json_encode(__(' [DRAFT]', 'editorial-calendar'))) ?>;
|
154 |
+
edcal.str_edit = <?php echo(edcal_json_encode(__('Edit', 'editorial-calendar'))) ?>;
|
155 |
+
edcal.str_del = <?php echo(edcal_json_encode(__('Delete', 'editorial-calendar'))) ?>;
|
156 |
+
edcal.str_view = <?php echo(edcal_json_encode(__('View', 'editorial-calendar'))) ?>;
|
157 |
+
edcal.str_republish = <?php echo(edcal_json_encode(__('Republish', 'editorial-calendar'))) ?>;
|
158 |
+
edcal.str_status = <?php echo(edcal_json_encode(__('Status:', 'editorial-calendar'))) ?>;
|
159 |
+
edcal.str_cancel = <?php echo(edcal_json_encode(__('Cancel', 'editorial-calendar'))) ?>;
|
160 |
+
edcal.str_posttitle = <?php echo(edcal_json_encode(__('Post Title:', 'editorial-calendar'))) ?>;
|
161 |
+
edcal.str_savedraft = <?php echo(edcal_json_encode(__('Save Draft', 'editorial-calendar'))) ?>;
|
162 |
+
edcal.str_saveandedit = <?php echo(edcal_json_encode(__('Save and Edit Draft', 'editorial-calendar'))) ?>;
|
163 |
+
edcal.str_newpost = <?php echo(edcal_json_encode(__('Add a new post on ', 'editorial-calendar'))) ?>;
|
164 |
|
165 |
+
edcal.str_del_msg1 = <?php echo(edcal_json_encode(__('You are about to delete the post "', 'editorial-calendar'))) ?>;
|
166 |
+
edcal.str_del_msg2 = <?php echo(edcal_json_encode(__('". Press Cancel to stop, OK to delete.', 'editorial-calendar'))) ?>;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
|
168 |
+
edcal.concurrency_error = <?php echo(edcal_json_encode(__('Looks like someone else already moved this post.', 'editorial-calendar'))) ?>;
|
169 |
+
edcal.permission_error = <?php echo(edcal_json_encode(__('You do not have permission to edit posts.', 'editorial-calendar'))) ?>;
|
170 |
+
edcal.checksum_error = <?php echo(edcal_json_encode(__('Invalid checksum for post. This is commonly a cross-site scripting error.', 'editorial-calendar'))) ?>;
|
171 |
+
edcal.general_error = <?php echo(edcal_json_encode(__('There was an error contacting your blog.', 'editorial-calendar'))) ?>;
|
172 |
|
173 |
+
edcal.str_screenoptions = <?php echo(edcal_json_encode(__('Screen Options', 'editorial-calendar'))) ?>;
|
174 |
+
edcal.str_optionsheader = <?php echo(edcal_json_encode(__('Calendar Options', 'editorial-calendar'))) ?>;
|
175 |
+
edcal.str_apply = <?php echo(edcal_json_encode(__('Apply', 'editorial-calendar'))) ?>;
|
176 |
+
edcal.str_show = <?php echo(edcal_json_encode(__('Show ', 'editorial-calendar'))) ?>;
|
177 |
+
edcal.str_show2 = <?php echo(edcal_json_encode(__('weeks at a time', 'editorial-calendar'))) ?>;
|
178 |
+
edcal.str_weekserror = <?php echo(edcal_json_encode(__('The calendar can only show between 1 and 5 weeks at a time.', 'editorial-calendar'))) ?>;
|
179 |
+
edcal.str_weekstt = <?php echo(edcal_json_encode(__('Enter the number of weeks, between 1 and 5, for the calendar to show.', 'editorial-calendar'))) ?>;
|
180 |
});
|
181 |
</script>
|
182 |
|
183 |
<style type="text/css">
|
184 |
+
.loadingclass > .postlink, .loadingclass:hover > .postlink, .tiploading {
|
185 |
background-image: url('<?php echo(path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/images/loading_post.gif")); ?>');
|
186 |
}
|
187 |
|
|
|
|
|
|
|
|
|
188 |
#loading {
|
189 |
background-image: url('<?php echo(path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/images/loading.gif")); ?>');
|
190 |
}
|
192 |
#tipclose {
|
193 |
background-image: url('<?php echo(path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/images/tip_close.gif")); ?>');
|
194 |
}
|
195 |
+
|
196 |
+
.month-present .daylabel {
|
197 |
+
background: #F5F5F5 url('<?php echo(path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/images/month-present_bk.gif")); ?>') repeat-x left top;
|
198 |
+
}
|
199 |
+
|
200 |
+
.today .daylabel {
|
201 |
+
background: url('<?php echo(path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/images/today_bk.gif")); ?>') repeat-x left top;
|
202 |
+
}
|
203 |
+
|
204 |
+
.dayheadcont {
|
205 |
+
background: #6D6D6D url('<?php echo(path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/../../../wp-admin/images/menu-bits.gif")); ?>') repeat-x scroll left top;
|
206 |
+
}
|
207 |
+
|
208 |
+
<?php
|
209 |
+
$userAgent = strToLower( $_SERVER['HTTP_USER_AGENT']);
|
210 |
+
if (strpos($userAgent, 'macintosh') || strpos($userAgent, 'mac platform x')) {
|
211 |
+
/*
|
212 |
+
* Bold titles look much better on Mac, but not on Window
|
213 |
+
*/
|
214 |
+
?>
|
215 |
+
.post.draggable .postlink {
|
216 |
+
font-weight: bold;
|
217 |
+
}
|
218 |
+
<?php
|
219 |
+
}
|
220 |
+
?>
|
221 |
</style>
|
222 |
|
223 |
<?php
|
236 |
<div id="loading"> </div>
|
237 |
</div>
|
238 |
|
239 |
+
<div id="topbar" class="tablenav">
|
240 |
+
<div id="topleft" class="tablenav-pages">
|
241 |
+
<h3>
|
242 |
+
<a href="#" title="<?php echo(__('Jump back', 'editorial-calendar')) ?>" class="prev page-numbers" id="prevmonth">«</a>
|
243 |
<span id="currentRange"></span>
|
244 |
+
<a href="#" title="<?php echo(__('Skip ahead', 'editorial-calendar')) ?>" class="next page-numbers" id="nextmonth">»</a>
|
245 |
+
</h3>
|
246 |
</div>
|
247 |
|
248 |
<div id="topright">
|
249 |
+
<a href="#" title="<?php echo(__('Jump to today', 'editorial-calendar')) ?>" id="moveToToday"><?php echo(__('Today', 'editorial-calendar')) ?></a>
|
250 |
</div>
|
251 |
</div>
|
252 |
|
253 |
+
<div id="cal_cont">
|
254 |
+
<div id="edcal_scrollable" class="edcal_scrollable vertical">
|
255 |
+
<div id="cal"></div>
|
256 |
+
</div>
|
257 |
</div>
|
258 |
</div>
|
259 |
|
345 |
|
346 |
?>[
|
347 |
<?php
|
348 |
+
$size = sizeof($myposts);
|
349 |
|
350 |
+
for($i = 0; $i < $size; $i++) {
|
351 |
/*
|
352 |
* Sticky posts are ones that stick to the front page.
|
353 |
* They do technically have a date, but it doesn't
|
356 |
* to stay on the front page.
|
357 |
*/
|
358 |
|
359 |
+
$post = $myposts[$i];
|
360 |
+
|
361 |
if (!is_sticky($post->ID)) {
|
362 |
+
edcal_postJSON($post, $i < $size - 1);
|
363 |
}
|
364 |
}
|
365 |
|
369 |
die();
|
370 |
}
|
371 |
|
372 |
+
function edcal_json_encode($string) {
|
373 |
+
/*
|
374 |
+
* WordPress escapes apostrophe's when they show up in post titles as '
|
375 |
+
* This is the HTML ASCII code for a straight apostrophe. This works well
|
376 |
+
* with Firefox, but IE complains with a very unhelpful error message. We
|
377 |
+
* can replace them with a right curly apostrophe since that works in IE
|
378 |
+
* and Firefox. It is also a little nicer typographically.
|
379 |
+
*/
|
380 |
+
return json_encode(str_replace("'", "’", $string));
|
381 |
+
}
|
382 |
+
|
383 |
/*
|
384 |
* This function sets up the post data and prints out the values we
|
385 |
* care about in a JSON data structure. This prints out just the
|
386 |
* value part.
|
387 |
*/
|
388 |
+
function edcal_postJSON($post, $addComma = true) {
|
389 |
setup_postdata($post);
|
390 |
?>
|
391 |
{
|
392 |
"date" : "<?php the_time('d') ?><?php the_time('m') ?><?php the_time('Y') ?>",
|
393 |
"time" : "<?php the_time() ?>",
|
394 |
+
"formattedtime" : "<?php edcal_json_encode(the_time(__('ga', 'editorial-calendar'))); ?>",
|
395 |
+
"url" : "<?php edcal_json_encode(the_permalink()); ?>",
|
396 |
"status" : "<?php echo(get_post_status()); ?>",
|
397 |
+
"title" : <?php echo(edcal_json_encode(get_the_title())); ?>,
|
398 |
"author" : "<?php the_author(); ?>",
|
399 |
<?php if ( current_user_can('edit_post', $post->ID) ) {?>
|
400 |
"editlink" : "<?php echo(get_edit_post_link($id)); ?>",
|
401 |
<?php } ?>
|
402 |
|
403 |
+
<?php if ( current_user_can('delete_post', $post->ID) ) { // [wes] changed delete link to edcal ajax link ?>
|
404 |
+
"dellink" : "javascript:edcal.deletePost(<?php echo $post->ID ?>)",
|
405 |
<?php } ?>
|
406 |
|
407 |
"permalink" : "<?php echo(get_permalink($id)); ?>",
|
408 |
"id" : "<?php the_ID(); ?>"
|
409 |
+
}
|
410 |
<?php
|
411 |
+
if ($addComma) {
|
412 |
+
?>,<?php
|
413 |
+
}
|
414 |
}
|
415 |
|
416 |
+
|
417 |
+
/* [wes]
|
418 |
+
* This is a helper AJAX function to delete a post. It gets called
|
419 |
+
* when a user clicks the delete button, and allows the user to
|
420 |
+
* retain their position within the calendar without a page refresh.
|
421 |
+
* It is not called unless the user has permission to delete the post
|
422 |
+
*/
|
423 |
+
function edcal_deletepost() {
|
424 |
+
if (!edcal_checknonce()) {
|
425 |
+
die();
|
426 |
+
}
|
427 |
+
|
428 |
+
header("Content-Type: application/json");
|
429 |
+
$edcal_postid = isset($_GET['postid'])?$_GET['postid']:null;
|
430 |
+
$post = get_post($edcal_postid, ARRAY_A);
|
431 |
+
$title = $post['post_title'];
|
432 |
+
$date = date('dmY', strtotime($post['post_date'])); // [TODO] : is there a better way to generate the date string ... ??
|
433 |
+
|
434 |
+
|
435 |
+
$force = !EMPTY_TRASH_DAYS; // wordpress 2.9 thing. deleted post hangs around (ie in a recycle bin) after deleted for this # of days
|
436 |
+
if ( $post->post_type == 'attachment' ) {
|
437 |
+
$force = ( $force || !MEDIA_TRASH );
|
438 |
+
if ( ! wp_delete_attachment($edcal_postid, $force) )
|
439 |
+
wp_die( __('Error in deleting...') );
|
440 |
+
} else {
|
441 |
+
if ( !wp_delete_post($edcal_postid, $force) )
|
442 |
+
wp_die( __('Error in deleting...') );
|
443 |
+
}
|
444 |
+
|
445 |
+
// return the following info so that jQuery can then remove post from edcal display :
|
446 |
+
?>
|
447 |
+
{
|
448 |
+
"post" :
|
449 |
+
{
|
450 |
+
"date" : "<?php echo $date ?>",
|
451 |
+
"title" : "<?php echo $title ?>",
|
452 |
+
"id" : "<?php echo $edcal_postid ?>"
|
453 |
+
}
|
454 |
+
}
|
455 |
+
<?php
|
456 |
+
|
457 |
+
die();
|
458 |
+
}
|
459 |
+
|
460 |
+
|
461 |
+
|
462 |
+
|
463 |
/*
|
464 |
* This is a helper AJAX function to change the title of a post. It
|
465 |
* gets called from the save button in the tooltip when you change a
|
730 |
|
731 |
die();
|
732 |
}
|
733 |
+
|
734 |
+
/*
|
735 |
+
* This function saves the preferences
|
736 |
+
*/
|
737 |
+
function edcal_saveoptions() {
|
738 |
+
if (!edcal_checknonce()) {
|
739 |
+
die();
|
740 |
+
}
|
741 |
+
|
742 |
+
header("Content-Type: application/json");
|
743 |
+
$edcal_weeks = isset($_GET['weeks'])?$_GET['weeks']:null;
|
744 |
+
|
745 |
+
add_option("edcal_weeks_pref", $edcal_weeks, "", "yes");
|
746 |
+
update_option("edcal_weeks_pref", $edcal_weeks);
|
747 |
+
|
748 |
+
|
749 |
+
/*
|
750 |
+
* We finish by returning the latest data for the post in the JSON
|
751 |
+
*/
|
752 |
+
?>{
|
753 |
+
"update" : "success"
|
754 |
+
}
|
755 |
+
<?php
|
756 |
+
|
757 |
+
die();
|
758 |
+
}
|
images/month-present_bk.gif
ADDED
Binary file
|
images/today_bk.gif
ADDED
Binary file
|
languages/editorial-calendar-fr_FR.mo
ADDED
Binary file
|
languages/editorial-calendar-fr_FR.po
ADDED
@@ -0,0 +1,191 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Translation of the WordPress plugin Editorial Calendar by stresslimitdesign.
|
2 |
+
# Copyright (C) 2010
|
3 |
+
# This file is distributed under the same license as the package.
|
4 |
+
# COLIN VERNON <COLIN@STRESSLIMITDESIGN.COM>, 2010.
|
5 |
+
#
|
6 |
+
msgid ""
|
7 |
+
msgstr ""
|
8 |
+
"Project-Id-Version: \n"
|
9 |
+
"Report-Msgid-Bugs-To: http://wordpress.org/tag/editorial-calendar\n"
|
10 |
+
"POT-Creation-Date: 2010-01-14 20:13+0000\n"
|
11 |
+
"PO-Revision-Date: 2010-01-18 10:08-0500\n"
|
12 |
+
"Last-Translator: Zack Grossbart <zack@grossbart.com>\n"
|
13 |
+
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
+
"MIME-Version: 1.0\n"
|
15 |
+
"Content-Type: text/plain; charset=utf-8\n"
|
16 |
+
"Content-Transfer-Encoding: 8bit\n"
|
17 |
+
|
18 |
+
#: edcal.php:60
|
19 |
+
msgid "Calendar"
|
20 |
+
msgstr "Calendrier"
|
21 |
+
|
22 |
+
#: edcal.php:130
|
23 |
+
#: edcal.php:277
|
24 |
+
msgid "en-US"
|
25 |
+
msgstr "fr_FR"
|
26 |
+
|
27 |
+
#: edcal.php:138
|
28 |
+
msgid "on"
|
29 |
+
msgstr "le"
|
30 |
+
|
31 |
+
#: edcal.php:139
|
32 |
+
msgid "by"
|
33 |
+
msgstr "par"
|
34 |
+
|
35 |
+
#: edcal.php:140
|
36 |
+
msgid "at"
|
37 |
+
msgstr "à"
|
38 |
+
|
39 |
+
#: edcal.php:142
|
40 |
+
msgid "Add a post"
|
41 |
+
msgstr "Ajouter un post"
|
42 |
+
|
43 |
+
#: edcal.php:144
|
44 |
+
msgid "Sunday"
|
45 |
+
msgstr "Dimanche"
|
46 |
+
|
47 |
+
#: edcal.php:145
|
48 |
+
msgid "Monday"
|
49 |
+
msgstr "Lundi"
|
50 |
+
|
51 |
+
#: edcal.php:146
|
52 |
+
msgid "Tuesday"
|
53 |
+
msgstr "Mardi"
|
54 |
+
|
55 |
+
#: edcal.php:147
|
56 |
+
msgid "Wednesday"
|
57 |
+
msgstr "Mercredi"
|
58 |
+
|
59 |
+
#: edcal.php:148
|
60 |
+
msgid "Thursday"
|
61 |
+
msgstr "Jeudi"
|
62 |
+
|
63 |
+
#: edcal.php:149
|
64 |
+
msgid "Friday"
|
65 |
+
msgstr "Vendredi"
|
66 |
+
|
67 |
+
#: edcal.php:150
|
68 |
+
msgid "Saturday"
|
69 |
+
msgstr "Samedi"
|
70 |
+
|
71 |
+
#: edcal.php:152
|
72 |
+
msgid " [DRAFT]"
|
73 |
+
msgstr " [BROUILLON]"
|
74 |
+
|
75 |
+
#: edcal.php:153
|
76 |
+
msgid "Edit"
|
77 |
+
msgstr "Éditer"
|
78 |
+
|
79 |
+
#: edcal.php:154
|
80 |
+
msgid "Delete"
|
81 |
+
msgstr "Supprimer"
|
82 |
+
|
83 |
+
#: edcal.php:155
|
84 |
+
msgid "View"
|
85 |
+
msgstr "Voir"
|
86 |
+
|
87 |
+
#: edcal.php:156
|
88 |
+
msgid "Republish"
|
89 |
+
msgstr "Republier"
|
90 |
+
|
91 |
+
#: edcal.php:157
|
92 |
+
msgid "Status:"
|
93 |
+
msgstr "Status :"
|
94 |
+
|
95 |
+
#: edcal.php:158
|
96 |
+
msgid "Cancel"
|
97 |
+
msgstr "Annuler"
|
98 |
+
|
99 |
+
#: edcal.php:159
|
100 |
+
msgid "Post Title:"
|
101 |
+
msgstr "Titre du post :"
|
102 |
+
|
103 |
+
#: edcal.php:160
|
104 |
+
msgid "Save Draft"
|
105 |
+
msgstr "Enregistrer brouillon"
|
106 |
+
|
107 |
+
#: edcal.php:161
|
108 |
+
msgid "Save and Edit Draft"
|
109 |
+
msgstr "Enregistrer et éditer brouillon"
|
110 |
+
|
111 |
+
#: edcal.php:162
|
112 |
+
msgid "Add a new post on "
|
113 |
+
msgstr "Ajouter un nouveau post le "
|
114 |
+
|
115 |
+
#: edcal.php:164
|
116 |
+
msgid "You are about to delete this post "
|
117 |
+
msgstr "Vous allez supprimer le post '"
|
118 |
+
|
119 |
+
#: edcal.php:165
|
120 |
+
msgid "Press cancel to stop, OK to delete."
|
121 |
+
msgstr "'. Cliquer sur annuler pour arrêter, OK pour supprimer"
|
122 |
+
|
123 |
+
#: edcal.php:167
|
124 |
+
msgid "Looks like someone else already moved this post."
|
125 |
+
msgstr "Quelqu'un d'autre a déjà déplacé ce post."
|
126 |
+
|
127 |
+
#: edcal.php:168
|
128 |
+
msgid "You do not have permission to edit posts."
|
129 |
+
msgstr "Vous n'avez pas les permissions d'éditer les posts."
|
130 |
+
|
131 |
+
#: edcal.php:169
|
132 |
+
msgid "Invalid checksum for post. This is commonly a cross-site scripting error."
|
133 |
+
msgstr "Désolé, le post est corrompu, il se peut que ce soit une erreur de 'cross-site scripting' (XSS)."
|
134 |
+
|
135 |
+
#: edcal.php:170
|
136 |
+
msgid "There was an error contacting your blog."
|
137 |
+
msgstr "Une erreur est survenue en contactant votre blog."
|
138 |
+
|
139 |
+
#: edcal.php:172
|
140 |
+
msgid "Screen Options"
|
141 |
+
msgstr "Options d'affichage"
|
142 |
+
|
143 |
+
#: edcal.php:173
|
144 |
+
msgid "Calendar Options"
|
145 |
+
msgstr "Options du calendrier"
|
146 |
+
|
147 |
+
#: edcal.php:174
|
148 |
+
msgid "Apply"
|
149 |
+
msgstr "Appliquer"
|
150 |
+
|
151 |
+
#: edcal.php:175
|
152 |
+
msgid "Show "
|
153 |
+
msgstr "Afficher "
|
154 |
+
|
155 |
+
#: edcal.php:176
|
156 |
+
msgid "weeks at a time"
|
157 |
+
msgstr "semaines à la fois"
|
158 |
+
|
159 |
+
#: edcal.php:177
|
160 |
+
msgid "The calendar can only show between 1 and 5 weeks at a time."
|
161 |
+
msgstr "Le calendrier ne peut afficher qu'une à cinq semaines à la fois."
|
162 |
+
|
163 |
+
#: edcal.php:178
|
164 |
+
msgid "Enter the number of weeks, between 1 and 5, for the calendar to show."
|
165 |
+
msgstr "Entrer le nombre de semaines que le calendrier va afficher (entre 1 et 5)"
|
166 |
+
|
167 |
+
#: edcal.php:214
|
168 |
+
msgid "Posts Calendar"
|
169 |
+
msgstr "Calendrier de posts"
|
170 |
+
|
171 |
+
#: edcal.php:223
|
172 |
+
msgid "Jump back"
|
173 |
+
msgstr "Mois précédent"
|
174 |
+
|
175 |
+
#: edcal.php:225
|
176 |
+
msgid "Skip ahead"
|
177 |
+
msgstr "Mois suivant"
|
178 |
+
|
179 |
+
#: edcal.php:230
|
180 |
+
msgid "Jump to today"
|
181 |
+
msgstr "Retourner à aujourd'hui"
|
182 |
+
|
183 |
+
#: edcal.php:230
|
184 |
+
msgid "Today"
|
185 |
+
msgstr "Aujourd'hui"
|
186 |
+
|
187 |
+
#: edcal.php:361
|
188 |
+
#: - this is the time format (12 hour or 24 hour)
|
189 |
+
msgid "ga"
|
190 |
+
msgstr "H"
|
191 |
+
|
lib/languages/date-fr_FR.js
ADDED
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Version: 1.0 Alpha-1
|
3 |
+
* Build Date: 13-Nov-2007
|
4 |
+
* Copyright (c) 2006-2007, Coolite Inc. (http://www.coolite.com/). All rights reserved.
|
5 |
+
* License: Licensed under The MIT License. See license.txt and http://www.datejs.com/license/.
|
6 |
+
* Website: http://www.datejs.com/ or http://www.coolite.com/datejs/
|
7 |
+
*/
|
8 |
+
Date.CultureInfo={name:"fr-FR",englishName:"French (France)",nativeName:"français (France)",dayNames:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],abbreviatedDayNames:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],shortestDayNames:["di","lu","ma","me","je","ve","sa"],firstLetterDayNames:["d","l","m","m","j","v","s"],monthNames:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],abbreviatedMonthNames:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],amDesignator:"",pmDesignator:"",firstDayOfWeek:1,twoDigitYearMax:2029,dateElementOrder:"dmy",formatPatterns:{shortDate:"dd/MM/yyyy",longDate:"dddd d MMMM yyyy",shortTime:"HH:mm",longTime:"HH:mm:ss",fullDateTime:"dddd d MMMM yyyy HH:mm:ss",sortableDateTime:"yyyy-MM-ddTHH:mm:ss",universalSortableDateTime:"yyyy-MM-dd HH:mm:ssZ",rfc1123:"ddd, dd MMM yyyy HH:mm:ss GMT",monthDay:"d MMMM",yearMonth:"MMMM yyyy"},regexPatterns:{jan:/^janv(.(ier)?)?/i,feb:/^févr(.(ier)?)?/i,mar:/^mars/i,apr:/^avr(.(il)?)?/i,may:/^mai/i,jun:/^juin/i,jul:/^juil(.(let)?)?/i,aug:/^août/i,sep:/^sept(.(embre)?)?/i,oct:/^oct(.(obre)?)?/i,nov:/^nov(.(embre)?)?/i,dec:/^déc(.(embre)?)?/i,sun:/^di(m(.(anche)?)?)?/i,mon:/^lu(n(.(di)?)?)?/i,tue:/^ma(r(.(di)?)?)?/i,wed:/^me(r(.(credi)?)?)?/i,thu:/^je(u(.(di)?)?)?/i,fri:/^ve(n(.(dredi)?)?)?/i,sat:/^sa(m(.(edi)?)?)?/i,future:/^next/i,past:/^last|past|prev(ious)?/i,add:/^(\+|after|from)/i,subtract:/^(\-|before|ago)/i,yesterday:/^yesterday/i,today:/^t(oday)?/i,tomorrow:/^tomorrow/i,now:/^n(ow)?/i,millisecond:/^ms|milli(second)?s?/i,second:/^sec(ond)?s?/i,minute:/^min(ute)?s?/i,hour:/^h(ou)?rs?/i,week:/^w(ee)?k/i,month:/^m(o(nth)?s?)?/i,day:/^d(ays?)?/i,year:/^y((ea)?rs?)?/i,shortMeridian:/^(a|p)/i,longMeridian:/^(a\.?m?\.?|p\.?m?\.?)/i,timezone:/^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt)/i,ordinalSuffix:/^\s*(st|nd|rd|th)/i,timeContext:/^\s*(\:|a|p)/i},abbreviatedTimeZoneStandard:{GMT:"-000",EST:"-0400",CST:"-0500",MST:"-0600",PST:"-0700"},abbreviatedTimeZoneDST:{GMT:"-000",EDT:"-0500",CDT:"-0600",MDT:"-0700",PDT:"-0800"}};
|
9 |
+
Date.getMonthNumberFromName=function(name){var n=Date.CultureInfo.monthNames,m=Date.CultureInfo.abbreviatedMonthNames,s=name.toLowerCase();for(var i=0;i<n.length;i++){if(n[i].toLowerCase()==s||m[i].toLowerCase()==s){return i;}}
|
10 |
+
return-1;};Date.getDayNumberFromName=function(name){var n=Date.CultureInfo.dayNames,m=Date.CultureInfo.abbreviatedDayNames,o=Date.CultureInfo.shortestDayNames,s=name.toLowerCase();for(var i=0;i<n.length;i++){if(n[i].toLowerCase()==s||m[i].toLowerCase()==s){return i;}}
|
11 |
+
return-1;};Date.isLeapYear=function(year){return(((year%4===0)&&(year%100!==0))||(year%400===0));};Date.getDaysInMonth=function(year,month){return[31,(Date.isLeapYear(year)?29:28),31,30,31,30,31,31,30,31,30,31][month];};Date.getTimezoneOffset=function(s,dst){return(dst||false)?Date.CultureInfo.abbreviatedTimeZoneDST[s.toUpperCase()]:Date.CultureInfo.abbreviatedTimeZoneStandard[s.toUpperCase()];};Date.getTimezoneAbbreviation=function(offset,dst){var n=(dst||false)?Date.CultureInfo.abbreviatedTimeZoneDST:Date.CultureInfo.abbreviatedTimeZoneStandard,p;for(p in n){if(n[p]===offset){return p;}}
|
12 |
+
return null;};Date.prototype.clone=function(){return new Date(this.getTime());};Date.prototype.compareTo=function(date){if(isNaN(this)){throw new Error(this);}
|
13 |
+
if(date instanceof Date&&!isNaN(date)){return(this>date)?1:(this<date)?-1:0;}else{throw new TypeError(date);}};Date.prototype.equals=function(date){return(this.compareTo(date)===0);};Date.prototype.between=function(start,end){var t=this.getTime();return t>=start.getTime()&&t<=end.getTime();};Date.prototype.addMilliseconds=function(value){this.setMilliseconds(this.getMilliseconds()+value);return this;};Date.prototype.addSeconds=function(value){return this.addMilliseconds(value*1000);};Date.prototype.addMinutes=function(value){return this.addMilliseconds(value*60000);};Date.prototype.addHours=function(value){return this.addMilliseconds(value*3600000);};Date.prototype.addDays=function(value){return this.addMilliseconds(value*86400000);};Date.prototype.addWeeks=function(value){return this.addMilliseconds(value*604800000);};Date.prototype.addMonths=function(value){var n=this.getDate();this.setDate(1);this.setMonth(this.getMonth()+value);this.setDate(Math.min(n,this.getDaysInMonth()));return this;};Date.prototype.addYears=function(value){return this.addMonths(value*12);};Date.prototype.add=function(config){if(typeof config=="number"){this._orient=config;return this;}
|
14 |
+
var x=config;if(x.millisecond||x.milliseconds){this.addMilliseconds(x.millisecond||x.milliseconds);}
|
15 |
+
if(x.second||x.seconds){this.addSeconds(x.second||x.seconds);}
|
16 |
+
if(x.minute||x.minutes){this.addMinutes(x.minute||x.minutes);}
|
17 |
+
if(x.hour||x.hours){this.addHours(x.hour||x.hours);}
|
18 |
+
if(x.month||x.months){this.addMonths(x.month||x.months);}
|
19 |
+
if(x.year||x.years){this.addYears(x.year||x.years);}
|
20 |
+
if(x.day||x.days){this.addDays(x.day||x.days);}
|
21 |
+
return this;};Date._validate=function(value,min,max,name){if(typeof value!="number"){throw new TypeError(value+" is not a Number.");}else if(value<min||value>max){throw new RangeError(value+" is not a valid value for "+name+".");}
|
22 |
+
return true;};Date.validateMillisecond=function(n){return Date._validate(n,0,999,"milliseconds");};Date.validateSecond=function(n){return Date._validate(n,0,59,"seconds");};Date.validateMinute=function(n){return Date._validate(n,0,59,"minutes");};Date.validateHour=function(n){return Date._validate(n,0,23,"hours");};Date.validateDay=function(n,year,month){return Date._validate(n,1,Date.getDaysInMonth(year,month),"days");};Date.validateMonth=function(n){return Date._validate(n,0,11,"months");};Date.validateYear=function(n){return Date._validate(n,1,9999,"seconds");};Date.prototype.set=function(config){var x=config;if(!x.millisecond&&x.millisecond!==0){x.millisecond=-1;}
|
23 |
+
if(!x.second&&x.second!==0){x.second=-1;}
|
24 |
+
if(!x.minute&&x.minute!==0){x.minute=-1;}
|
25 |
+
if(!x.hour&&x.hour!==0){x.hour=-1;}
|
26 |
+
if(!x.day&&x.day!==0){x.day=-1;}
|
27 |
+
if(!x.month&&x.month!==0){x.month=-1;}
|
28 |
+
if(!x.year&&x.year!==0){x.year=-1;}
|
29 |
+
if(x.millisecond!=-1&&Date.validateMillisecond(x.millisecond)){this.addMilliseconds(x.millisecond-this.getMilliseconds());}
|
30 |
+
if(x.second!=-1&&Date.validateSecond(x.second)){this.addSeconds(x.second-this.getSeconds());}
|
31 |
+
if(x.minute!=-1&&Date.validateMinute(x.minute)){this.addMinutes(x.minute-this.getMinutes());}
|
32 |
+
if(x.hour!=-1&&Date.validateHour(x.hour)){this.addHours(x.hour-this.getHours());}
|
33 |
+
if(x.month!==-1&&Date.validateMonth(x.month)){this.addMonths(x.month-this.getMonth());}
|
34 |
+
if(x.year!=-1&&Date.validateYear(x.year)){this.addYears(x.year-this.getFullYear());}
|
35 |
+
if(x.day!=-1&&Date.validateDay(x.day,this.getFullYear(),this.getMonth())){this.addDays(x.day-this.getDate());}
|
36 |
+
if(x.timezone){this.setTimezone(x.timezone);}
|
37 |
+
if(x.timezoneOffset){this.setTimezoneOffset(x.timezoneOffset);}
|
38 |
+
return this;};Date.prototype.clearTime=function(){this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this;};Date.prototype.isLeapYear=function(){var y=this.getFullYear();return(((y%4===0)&&(y%100!==0))||(y%400===0));};Date.prototype.isWeekday=function(){return!(this.is().sat()||this.is().sun());};Date.prototype.getDaysInMonth=function(){return Date.getDaysInMonth(this.getFullYear(),this.getMonth());};Date.prototype.moveToFirstDayOfMonth=function(){return this.set({day:1});};Date.prototype.moveToLastDayOfMonth=function(){return this.set({day:this.getDaysInMonth()});};Date.prototype.moveToDayOfWeek=function(day,orient){var diff=(day-this.getDay()+7*(orient||+1))%7;return this.addDays((diff===0)?diff+=7*(orient||+1):diff);};Date.prototype.moveToMonth=function(month,orient){var diff=(month-this.getMonth()+12*(orient||+1))%12;return this.addMonths((diff===0)?diff+=12*(orient||+1):diff);};Date.prototype.getDayOfYear=function(){return Math.floor((this-new Date(this.getFullYear(),0,1))/86400000);};Date.prototype.getWeekOfYear=function(firstDayOfWeek){var y=this.getFullYear(),m=this.getMonth(),d=this.getDate();var dow=firstDayOfWeek||Date.CultureInfo.firstDayOfWeek;var offset=7+1-new Date(y,0,1).getDay();if(offset==8){offset=1;}
|
39 |
+
var daynum=((Date.UTC(y,m,d,0,0,0)-Date.UTC(y,0,1,0,0,0))/86400000)+1;var w=Math.floor((daynum-offset+7)/7);if(w===dow){y--;var prevOffset=7+1-new Date(y,0,1).getDay();if(prevOffset==2||prevOffset==8){w=53;}else{w=52;}}
|
40 |
+
return w;};Date.prototype.isDST=function(){console.log('isDST');return this.toString().match(/(E|C|M|P)(S|D)T/)[2]=="D";};Date.prototype.getTimezone=function(){return Date.getTimezoneAbbreviation(this.getUTCOffset,this.isDST());};Date.prototype.setTimezoneOffset=function(s){var here=this.getTimezoneOffset(),there=Number(s)*-6/10;this.addMinutes(there-here);return this;};Date.prototype.setTimezone=function(s){return this.setTimezoneOffset(Date.getTimezoneOffset(s));};Date.prototype.getUTCOffset=function(){var n=this.getTimezoneOffset()*-10/6,r;if(n<0){r=(n-10000).toString();return r[0]+r.substr(2);}else{r=(n+10000).toString();return"+"+r.substr(1);}};Date.prototype.getDayName=function(abbrev){return abbrev?Date.CultureInfo.abbreviatedDayNames[this.getDay()]:Date.CultureInfo.dayNames[this.getDay()];};Date.prototype.getMonthName=function(abbrev){return abbrev?Date.CultureInfo.abbreviatedMonthNames[this.getMonth()]:Date.CultureInfo.monthNames[this.getMonth()];};Date.prototype._toString=Date.prototype.toString;Date.prototype.toString=function(format){var self=this;var p=function p(s){return(s.toString().length==1)?"0"+s:s;};return format?format.replace(/dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?/g,function(format){switch(format){case"hh":return p(self.getHours()<13?self.getHours():(self.getHours()-12));case"h":return self.getHours()<13?self.getHours():(self.getHours()-12);case"HH":return p(self.getHours());case"H":return self.getHours();case"mm":return p(self.getMinutes());case"m":return self.getMinutes();case"ss":return p(self.getSeconds());case"s":return self.getSeconds();case"yyyy":return self.getFullYear();case"yy":return self.getFullYear().toString().substring(2,4);case"dddd":return self.getDayName();case"ddd":return self.getDayName(true);case"dd":return p(self.getDate());case"d":return self.getDate().toString();case"MMMM":return self.getMonthName();case"MMM":return self.getMonthName(true);case"MM":return p((self.getMonth()+1));case"M":return self.getMonth()+1;case"t":return self.getHours()<12?Date.CultureInfo.amDesignator.substring(0,1):Date.CultureInfo.pmDesignator.substring(0,1);case"tt":return self.getHours()<12?Date.CultureInfo.amDesignator:Date.CultureInfo.pmDesignator;case"zzz":case"zz":case"z":return"";}}):this._toString();};
|
41 |
+
Date.now=function(){return new Date();};Date.today=function(){return Date.now().clearTime();};Date.prototype._orient=+1;Date.prototype.next=function(){this._orient=+1;return this;};Date.prototype.last=Date.prototype.prev=Date.prototype.previous=function(){this._orient=-1;return this;};Date.prototype._is=false;Date.prototype.is=function(){this._is=true;return this;};Number.prototype._dateElement="day";Number.prototype.fromNow=function(){var c={};c[this._dateElement]=this;return Date.now().add(c);};Number.prototype.ago=function(){var c={};c[this._dateElement]=this*-1;return Date.now().add(c);};(function(){var $D=Date.prototype,$N=Number.prototype;var dx=("sunday monday tuesday wednesday thursday friday saturday").split(/\s/),mx=("january february march april may june july august september october november december").split(/\s/),px=("Millisecond Second Minute Hour Day Week Month Year").split(/\s/),de;var df=function(n){return function(){if(this._is){this._is=false;return this.getDay()==n;}
|
42 |
+
return this.moveToDayOfWeek(n,this._orient);};};for(var i=0;i<dx.length;i++){$D[dx[i]]=$D[dx[i].substring(0,3)]=df(i);}
|
43 |
+
var mf=function(n){return function(){if(this._is){this._is=false;return this.getMonth()===n;}
|
44 |
+
return this.moveToMonth(n,this._orient);};};for(var j=0;j<mx.length;j++){$D[mx[j]]=$D[mx[j].substring(0,3)]=mf(j);}
|
45 |
+
var ef=function(j){return function(){if(j.substring(j.length-1)!="s"){j+="s";}
|
46 |
+
return this["add"+j](this._orient);};};var nf=function(n){return function(){this._dateElement=n;return this;};};for(var k=0;k<px.length;k++){de=px[k].toLowerCase();$D[de]=$D[de+"s"]=ef(px[k]);$N[de]=$N[de+"s"]=nf(de);}}());Date.prototype.toJSONString=function(){return this.toString("yyyy-MM-ddThh:mm:ssZ");};Date.prototype.toShortDateString=function(){return this.toString(Date.CultureInfo.formatPatterns.shortDatePattern);};Date.prototype.toLongDateString=function(){return this.toString(Date.CultureInfo.formatPatterns.longDatePattern);};Date.prototype.toShortTimeString=function(){return this.toString(Date.CultureInfo.formatPatterns.shortTimePattern);};Date.prototype.toLongTimeString=function(){return this.toString(Date.CultureInfo.formatPatterns.longTimePattern);};Date.prototype.getOrdinal=function(){switch(this.getDate()){case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th";}};
|
47 |
+
(function(){Date.Parsing={Exception:function(s){this.message="Parse error at '"+s.substring(0,10)+" ...'";}};var $P=Date.Parsing;var _=$P.Operators={rtoken:function(r){return function(s){var mx=s.match(r);if(mx){return([mx[0],s.substring(mx[0].length)]);}else{throw new $P.Exception(s);}};},token:function(s){return function(s){return _.rtoken(new RegExp("^\s*"+s+"\s*"))(s);};},stoken:function(s){return _.rtoken(new RegExp("^"+s));},until:function(p){return function(s){var qx=[],rx=null;while(s.length){try{rx=p.call(this,s);}catch(e){qx.push(rx[0]);s=rx[1];continue;}
|
48 |
+
break;}
|
49 |
+
return[qx,s];};},many:function(p){return function(s){var rx=[],r=null;while(s.length){try{r=p.call(this,s);}catch(e){return[rx,s];}
|
50 |
+
rx.push(r[0]);s=r[1];}
|
51 |
+
return[rx,s];};},optional:function(p){return function(s){var r=null;try{r=p.call(this,s);}catch(e){return[null,s];}
|
52 |
+
return[r[0],r[1]];};},not:function(p){return function(s){try{p.call(this,s);}catch(e){return[null,s];}
|
53 |
+
throw new $P.Exception(s);};},ignore:function(p){return p?function(s){var r=null;r=p.call(this,s);return[null,r[1]];}:null;},product:function(){var px=arguments[0],qx=Array.prototype.slice.call(arguments,1),rx=[];for(var i=0;i<px.length;i++){rx.push(_.each(px[i],qx));}
|
54 |
+
return rx;},cache:function(rule){var cache={},r=null;return function(s){try{r=cache[s]=(cache[s]||rule.call(this,s));}catch(e){r=cache[s]=e;}
|
55 |
+
if(r instanceof $P.Exception){throw r;}else{return r;}};},any:function(){var px=arguments;return function(s){var r=null;for(var i=0;i<px.length;i++){if(px[i]==null){continue;}
|
56 |
+
try{r=(px[i].call(this,s));}catch(e){r=null;}
|
57 |
+
if(r){return r;}}
|
58 |
+
throw new $P.Exception(s);};},each:function(){var px=arguments;return function(s){var rx=[],r=null;for(var i=0;i<px.length;i++){if(px[i]==null){continue;}
|
59 |
+
try{r=(px[i].call(this,s));}catch(e){throw new $P.Exception(s);}
|
60 |
+
rx.push(r[0]);s=r[1];}
|
61 |
+
return[rx,s];};},all:function(){var px=arguments,_=_;return _.each(_.optional(px));},sequence:function(px,d,c){d=d||_.rtoken(/^\s*/);c=c||null;if(px.length==1){return px[0];}
|
62 |
+
return function(s){var r=null,q=null;var rx=[];for(var i=0;i<px.length;i++){try{r=px[i].call(this,s);}catch(e){break;}
|
63 |
+
rx.push(r[0]);try{q=d.call(this,r[1]);}catch(ex){q=null;break;}
|
64 |
+
s=q[1];}
|
65 |
+
if(!r){throw new $P.Exception(s);}
|
66 |
+
if(q){throw new $P.Exception(q[1]);}
|
67 |
+
if(c){try{r=c.call(this,r[1]);}catch(ey){throw new $P.Exception(r[1]);}}
|
68 |
+
return[rx,(r?r[1]:s)];};},between:function(d1,p,d2){d2=d2||d1;var _fn=_.each(_.ignore(d1),p,_.ignore(d2));return function(s){var rx=_fn.call(this,s);return[[rx[0][0],r[0][2]],rx[1]];};},list:function(p,d,c){d=d||_.rtoken(/^\s*/);c=c||null;return(p instanceof Array?_.each(_.product(p.slice(0,-1),_.ignore(d)),p.slice(-1),_.ignore(c)):_.each(_.many(_.each(p,_.ignore(d))),px,_.ignore(c)));},set:function(px,d,c){d=d||_.rtoken(/^\s*/);c=c||null;return function(s){var r=null,p=null,q=null,rx=null,best=[[],s],last=false;for(var i=0;i<px.length;i++){q=null;p=null;r=null;last=(px.length==1);try{r=px[i].call(this,s);}catch(e){continue;}
|
69 |
+
rx=[[r[0]],r[1]];if(r[1].length>0&&!last){try{q=d.call(this,r[1]);}catch(ex){last=true;}}else{last=true;}
|
70 |
+
if(!last&&q[1].length===0){last=true;}
|
71 |
+
if(!last){var qx=[];for(var j=0;j<px.length;j++){if(i!=j){qx.push(px[j]);}}
|
72 |
+
p=_.set(qx,d).call(this,q[1]);if(p[0].length>0){rx[0]=rx[0].concat(p[0]);rx[1]=p[1];}}
|
73 |
+
if(rx[1].length<best[1].length){best=rx;}
|
74 |
+
if(best[1].length===0){break;}}
|
75 |
+
if(best[0].length===0){return best;}
|
76 |
+
if(c){try{q=c.call(this,best[1]);}catch(ey){throw new $P.Exception(best[1]);}
|
77 |
+
best[1]=q[1];}
|
78 |
+
return best;};},forward:function(gr,fname){return function(s){return gr[fname].call(this,s);};},replace:function(rule,repl){return function(s){var r=rule.call(this,s);return[repl,r[1]];};},process:function(rule,fn){return function(s){var r=rule.call(this,s);return[fn.call(this,r[0]),r[1]];};},min:function(min,rule){return function(s){var rx=rule.call(this,s);if(rx[0].length<min){throw new $P.Exception(s);}
|
79 |
+
return rx;};}};var _generator=function(op){return function(){var args=null,rx=[];if(arguments.length>1){args=Array.prototype.slice.call(arguments);}else if(arguments[0]instanceof Array){args=arguments[0];}
|
80 |
+
if(args){for(var i=0,px=args.shift();i<px.length;i++){args.unshift(px[i]);rx.push(op.apply(null,args));args.shift();return rx;}}else{return op.apply(null,arguments);}};};var gx="optional not ignore cache".split(/\s/);for(var i=0;i<gx.length;i++){_[gx[i]]=_generator(_[gx[i]]);}
|
81 |
+
var _vector=function(op){return function(){if(arguments[0]instanceof Array){return op.apply(null,arguments[0]);}else{return op.apply(null,arguments);}};};var vx="each any all".split(/\s/);for(var j=0;j<vx.length;j++){_[vx[j]]=_vector(_[vx[j]]);}}());(function(){var flattenAndCompact=function(ax){var rx=[];for(var i=0;i<ax.length;i++){if(ax[i]instanceof Array){rx=rx.concat(flattenAndCompact(ax[i]));}else{if(ax[i]){rx.push(ax[i]);}}}
|
82 |
+
return rx;};Date.Grammar={};Date.Translator={hour:function(s){return function(){this.hour=Number(s);};},minute:function(s){return function(){this.minute=Number(s);};},second:function(s){return function(){this.second=Number(s);};},meridian:function(s){return function(){this.meridian=s.slice(0,1).toLowerCase();};},timezone:function(s){return function(){var n=s.replace(/[^\d\+\-]/g,"");if(n.length){this.timezoneOffset=Number(n);}else{this.timezone=s.toLowerCase();}};},day:function(x){var s=x[0];return function(){this.day=Number(s.match(/\d+/)[0]);};},month:function(s){return function(){this.month=((s.length==3)?Date.getMonthNumberFromName(s):(Number(s)-1));};},year:function(s){return function(){var n=Number(s);this.year=((s.length>2)?n:(n+(((n+2000)<Date.CultureInfo.twoDigitYearMax)?2000:1900)));};},rday:function(s){return function(){switch(s){case"yesterday":this.days=-1;break;case"tomorrow":this.days=1;break;case"today":this.days=0;break;case"now":this.days=0;this.now=true;break;}};},finishExact:function(x){x=(x instanceof Array)?x:[x];var now=new Date();this.year=now.getFullYear();this.month=now.getMonth();this.day=1;this.hour=0;this.minute=0;this.second=0;for(var i=0;i<x.length;i++){if(x[i]){x[i].call(this);}}
|
83 |
+
this.hour=(this.meridian=="p"&&this.hour<13)?this.hour+12:this.hour;if(this.day>Date.getDaysInMonth(this.year,this.month)){throw new RangeError(this.day+" is not a valid value for days.");}
|
84 |
+
var r=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second);if(this.timezone){r.set({timezone:this.timezone});}else if(this.timezoneOffset){r.set({timezoneOffset:this.timezoneOffset});}
|
85 |
+
return r;},finish:function(x){x=(x instanceof Array)?flattenAndCompact(x):[x];if(x.length===0){return null;}
|
86 |
+
for(var i=0;i<x.length;i++){if(typeof x[i]=="function"){x[i].call(this);}}
|
87 |
+
if(this.now){return new Date();}
|
88 |
+
var today=Date.today();var method=null;var expression=!!(this.days!=null||this.orient||this.operator);if(expression){var gap,mod,orient;orient=((this.orient=="past"||this.operator=="subtract")?-1:1);if(this.weekday){this.unit="day";gap=(Date.getDayNumberFromName(this.weekday)-today.getDay());mod=7;this.days=gap?((gap+(orient*mod))%mod):(orient*mod);}
|
89 |
+
if(this.month){this.unit="month";gap=(this.month-today.getMonth());mod=12;this.months=gap?((gap+(orient*mod))%mod):(orient*mod);this.month=null;}
|
90 |
+
if(!this.unit){this.unit="day";}
|
91 |
+
if(this[this.unit+"s"]==null||this.operator!=null){if(!this.value){this.value=1;}
|
92 |
+
if(this.unit=="week"){this.unit="day";this.value=this.value*7;}
|
93 |
+
this[this.unit+"s"]=this.value*orient;}
|
94 |
+
return today.add(this);}else{if(this.meridian&&this.hour){this.hour=(this.hour<13&&this.meridian=="p")?this.hour+12:this.hour;}
|
95 |
+
if(this.weekday&&!this.day){this.day=(today.addDays((Date.getDayNumberFromName(this.weekday)-today.getDay()))).getDate();}
|
96 |
+
if(this.month&&!this.day){this.day=1;}
|
97 |
+
return today.set(this);}}};var _=Date.Parsing.Operators,g=Date.Grammar,t=Date.Translator,_fn;g.datePartDelimiter=_.rtoken(/^([\s\-\.\,\/\x27]+)/);g.timePartDelimiter=_.stoken(":");g.whiteSpace=_.rtoken(/^\s*/);g.generalDelimiter=_.rtoken(/^(([\s\,]|at|on)+)/);var _C={};g.ctoken=function(keys){var fn=_C[keys];if(!fn){var c=Date.CultureInfo.regexPatterns;var kx=keys.split(/\s+/),px=[];for(var i=0;i<kx.length;i++){px.push(_.replace(_.rtoken(c[kx[i]]),kx[i]));}
|
98 |
+
fn=_C[keys]=_.any.apply(null,px);}
|
99 |
+
return fn;};g.ctoken2=function(key){return _.rtoken(Date.CultureInfo.regexPatterns[key]);};g.h=_.cache(_.process(_.rtoken(/^(0[0-9]|1[0-2]|[1-9])/),t.hour));g.hh=_.cache(_.process(_.rtoken(/^(0[0-9]|1[0-2])/),t.hour));g.H=_.cache(_.process(_.rtoken(/^([0-1][0-9]|2[0-3]|[0-9])/),t.hour));g.HH=_.cache(_.process(_.rtoken(/^([0-1][0-9]|2[0-3])/),t.hour));g.m=_.cache(_.process(_.rtoken(/^([0-5][0-9]|[0-9])/),t.minute));g.mm=_.cache(_.process(_.rtoken(/^[0-5][0-9]/),t.minute));g.s=_.cache(_.process(_.rtoken(/^([0-5][0-9]|[0-9])/),t.second));g.ss=_.cache(_.process(_.rtoken(/^[0-5][0-9]/),t.second));g.hms=_.cache(_.sequence([g.H,g.mm,g.ss],g.timePartDelimiter));g.t=_.cache(_.process(g.ctoken2("shortMeridian"),t.meridian));g.tt=_.cache(_.process(g.ctoken2("longMeridian"),t.meridian));g.z=_.cache(_.process(_.rtoken(/^(\+|\-)?\s*\d\d\d\d?/),t.timezone));g.zz=_.cache(_.process(_.rtoken(/^(\+|\-)\s*\d\d\d\d/),t.timezone));g.zzz=_.cache(_.process(g.ctoken2("timezone"),t.timezone));g.timeSuffix=_.each(_.ignore(g.whiteSpace),_.set([g.tt,g.zzz]));g.time=_.each(_.optional(_.ignore(_.stoken("T"))),g.hms,g.timeSuffix);g.d=_.cache(_.process(_.each(_.rtoken(/^([0-2]\d|3[0-1]|\d)/),_.optional(g.ctoken2("ordinalSuffix"))),t.day));g.dd=_.cache(_.process(_.each(_.rtoken(/^([0-2]\d|3[0-1])/),_.optional(g.ctoken2("ordinalSuffix"))),t.day));g.ddd=g.dddd=_.cache(_.process(g.ctoken("sun mon tue wed thu fri sat"),function(s){return function(){this.weekday=s;};}));g.M=_.cache(_.process(_.rtoken(/^(1[0-2]|0\d|\d)/),t.month));g.MM=_.cache(_.process(_.rtoken(/^(1[0-2]|0\d)/),t.month));g.MMM=g.MMMM=_.cache(_.process(g.ctoken("jan feb mar apr may jun jul aug sep oct nov dec"),t.month));g.y=_.cache(_.process(_.rtoken(/^(\d\d?)/),t.year));g.yy=_.cache(_.process(_.rtoken(/^(\d\d)/),t.year));g.yyy=_.cache(_.process(_.rtoken(/^(\d\d?\d?\d?)/),t.year));g.yyyy=_.cache(_.process(_.rtoken(/^(\d\d\d\d)/),t.year));_fn=function(){return _.each(_.any.apply(null,arguments),_.not(g.ctoken2("timeContext")));};g.day=_fn(g.d,g.dd);g.month=_fn(g.M,g.MMM);g.year=_fn(g.yyyy,g.yy);g.orientation=_.process(g.ctoken("past future"),function(s){return function(){this.orient=s;};});g.operator=_.process(g.ctoken("add subtract"),function(s){return function(){this.operator=s;};});g.rday=_.process(g.ctoken("yesterday tomorrow today now"),t.rday);g.unit=_.process(g.ctoken("minute hour day week month year"),function(s){return function(){this.unit=s;};});g.value=_.process(_.rtoken(/^\d\d?(st|nd|rd|th)?/),function(s){return function(){this.value=s.replace(/\D/g,"");};});g.expression=_.set([g.rday,g.operator,g.value,g.unit,g.orientation,g.ddd,g.MMM]);_fn=function(){return _.set(arguments,g.datePartDelimiter);};g.mdy=_fn(g.ddd,g.month,g.day,g.year);g.ymd=_fn(g.ddd,g.year,g.month,g.day);g.dmy=_fn(g.ddd,g.day,g.month,g.year);g.date=function(s){return((g[Date.CultureInfo.dateElementOrder]||g.mdy).call(this,s));};g.format=_.process(_.many(_.any(_.process(_.rtoken(/^(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?)/),function(fmt){if(g[fmt]){return g[fmt];}else{throw Date.Parsing.Exception(fmt);}}),_.process(_.rtoken(/^[^dMyhHmstz]+/),function(s){return _.ignore(_.stoken(s));}))),function(rules){return _.process(_.each.apply(null,rules),t.finishExact);});var _F={};var _get=function(f){return _F[f]=(_F[f]||g.format(f)[0]);};g.formats=function(fx){if(fx instanceof Array){var rx=[];for(var i=0;i<fx.length;i++){rx.push(_get(fx[i]));}
|
100 |
+
return _.any.apply(null,rx);}else{return _get(fx);}};g._formats=g.formats(["yyyy-MM-ddTHH:mm:ss","ddd, MMM dd, yyyy H:mm:ss tt","ddd MMM d yyyy HH:mm:ss zzz","d"]);g._start=_.process(_.set([g.date,g.time,g.expression],g.generalDelimiter,g.whiteSpace),t.finish);g.start=function(s){try{var r=g._formats.call({},s);if(r[1].length===0){return r;}}catch(e){}
|
101 |
+
return g._start.call({},s);};}());Date._parse=Date.parse;Date.parse=function(s){var r=null;if(!s){return null;}
|
102 |
+
try{r=Date.Grammar.start.call({},s);}catch(e){return null;}
|
103 |
+
return((r[1].length===0)?r[0]:null);};Date.getParseFunction=function(fx){var fn=Date.Grammar.formats(fx);return function(s){var r=null;try{r=fn.call({},s);}catch(e){return null;}
|
104 |
+
return((r[1].length===0)?r[0]:null);};};Date.parseExact=function(s,fx){return Date.getParseFunction(fx)(s);};
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: MaryVogt, zgrossbart
|
|
3 |
Tags: posts, post, calendar, AJAX, admin, administration
|
4 |
Requires at least: 2.8.5
|
5 |
Tested up to: 2.9.1
|
6 |
-
Stable tag: 0.
|
7 |
|
8 |
Editorial calendar makes it possible to see all your posts and drag and drop them to manage your blog.
|
9 |
|
@@ -11,8 +11,6 @@ Editorial calendar makes it possible to see all your posts and drag and drop the
|
|
11 |
|
12 |
The editorial calendar lets WordPress administrators and editors manage the dates for multiple posts at once. You see all of your posts in a calendar view and can arrange them via an easy drag and drop interface. The editorial calendar greatly improves any blog that plans posts in advance or takes contributions from multiple users.
|
13 |
|
14 |
-
This is the beta version and the first one ready for public use. Please help us make this plugin better by giving us <a href="mailto:zack@grossbart.com">feedback</a>.
|
15 |
-
|
16 |
<a href="http://chrisg.org/drag-and-drop-post-scheduling-with-the-editorial-calendar-wordpress-plugin/">Chris Garret</a> liked the calendar so much he made a <a href="http://www.youtube.com/watch?v=F4BnQZsgtZc&feature=player_embedded" style="font-size: 1.25em">video</a> showing you how to use it. Thanks Chris!
|
17 |
|
18 |
Features:
|
@@ -22,6 +20,8 @@ Features:
|
|
22 |
1. Edit and arrange post titles.
|
23 |
1. Easily see the status of your posts.
|
24 |
|
|
|
|
|
25 |
== Installation ==
|
26 |
|
27 |
1. <b>Backup your WordPress database</b>.
|
@@ -33,23 +33,38 @@ Features:
|
|
33 |
|
34 |
= Can I see a demo of the calendar? =
|
35 |
|
36 |
-
Check out our demo installation at <a href="http://www.zackgrossbart.com/extras/sandbox/wp-admin/">
|
37 |
|
38 |
-
=
|
39 |
|
40 |
-
|
41 |
|
42 |
-
|
|
|
|
|
|
|
|
|
|
|
43 |
|
44 |
-
|
|
|
|
|
|
|
|
|
45 |
|
46 |
-
|
47 |
|
48 |
-
|
|
|
|
|
|
|
|
|
49 |
|
50 |
-
|
|
|
|
|
51 |
|
52 |
-
|
53 |
|
54 |
= Why doesn't the calendar work with Live Countdown Timer =
|
55 |
|
@@ -57,12 +72,24 @@ If you use the plugin <a href="http://wordpress.org/extend/plugins/live-countdow
|
|
57 |
|
58 |
== Screenshots ==
|
59 |
|
60 |
-
1.
|
61 |
-
2.
|
62 |
-
3. Drag and drop posts to easily change dates and
|
|
|
63 |
|
64 |
== Changelog ==
|
65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
= 0.5.4 =
|
67 |
* I think this should finally fix the date format bugs we've been having. Thanks for sticking with it guys.
|
68 |
|
3 |
Tags: posts, post, calendar, AJAX, admin, administration
|
4 |
Requires at least: 2.8.5
|
5 |
Tested up to: 2.9.1
|
6 |
+
Stable tag: 0.6
|
7 |
|
8 |
Editorial calendar makes it possible to see all your posts and drag and drop them to manage your blog.
|
9 |
|
11 |
|
12 |
The editorial calendar lets WordPress administrators and editors manage the dates for multiple posts at once. You see all of your posts in a calendar view and can arrange them via an easy drag and drop interface. The editorial calendar greatly improves any blog that plans posts in advance or takes contributions from multiple users.
|
13 |
|
|
|
|
|
14 |
<a href="http://chrisg.org/drag-and-drop-post-scheduling-with-the-editorial-calendar-wordpress-plugin/">Chris Garret</a> liked the calendar so much he made a <a href="http://www.youtube.com/watch?v=F4BnQZsgtZc&feature=player_embedded" style="font-size: 1.25em">video</a> showing you how to use it. Thanks Chris!
|
15 |
|
16 |
Features:
|
20 |
1. Edit and arrange post titles.
|
21 |
1. Easily see the status of your posts.
|
22 |
|
23 |
+
The editorial calendar is getting closer and closer to version 1.0. We have a few more features to go. Thank you to everyone who has helped us improve this plugin with their feedback. If you have questions, problems, or idea for new features please let us know at <a href="mailto:wp-edcal@googlegroups.com">wp-edcal@googlegroups.com</a>.
|
24 |
+
|
25 |
== Installation ==
|
26 |
|
27 |
1. <b>Backup your WordPress database</b>.
|
33 |
|
34 |
= Can I see a demo of the calendar? =
|
35 |
|
36 |
+
Check out our demo installation at <a href="http://www.zackgrossbart.com/extras/sandbox/wp-admin/edit.php?page=posts_list">Zack's WordPress Sandbox</a>.
|
37 |
|
38 |
+
= How do I navigate the calendar? =
|
39 |
|
40 |
+
You can move around in the calendar using the arrows next to the months at the top or your mouse wheel, You can also move using your keyboard:
|
41 |
|
42 |
+
<ul>
|
43 |
+
<li>Move 1 week into the past - Up Arrow</li>
|
44 |
+
<li>Move 1 week into the future - Down Arrow</li>
|
45 |
+
<li>Jump multiple weeks into the past - Page Up or Ctrl+Up Arrow</li>
|
46 |
+
<li>Jump multiple weeks into the future - Page Down or Ctrl+Down Arrow</li>
|
47 |
+
</ul>
|
48 |
|
49 |
+
= What languages does the calendar support? =
|
50 |
+
|
51 |
+
The calendar is available in English, French, and Croatian.
|
52 |
+
|
53 |
+
= Can I add new languages? =
|
54 |
|
55 |
+
Yes please! We are looking for translators. It only takes about 20 minutes. If you're interested please <a href="mailto:wp-edcal@googlegroups.com">contact us</a>.
|
56 |
|
57 |
+
= Can I use the editorial calendar with pages? =
|
58 |
+
|
59 |
+
Right now the calendar only supports posts. We're considering adding pages. If you would like to see support for pages let us know.
|
60 |
+
|
61 |
+
= Will my readers be able to tell I'm using the editorial calendar? =
|
62 |
|
63 |
+
No. The calendar is only an administration tool. None of your readers will know you are running the calendar unless you tell them.
|
64 |
+
|
65 |
+
= Why can't I move published posts? =
|
66 |
|
67 |
+
Moving published posts can cause problems with some RSS feeds and is generally not a very popular thing to do. The calendar only allows you to move scheduled and draft posts.
|
68 |
|
69 |
= Why doesn't the calendar work with Live Countdown Timer =
|
70 |
|
72 |
|
73 |
== Screenshots ==
|
74 |
|
75 |
+
1. The calendar integrates seamlessly into the WordPress administration console
|
76 |
+
2. See the big picture with a view of all your posts and when they'll be published.
|
77 |
+
3. Drag and drop posts to easily change dates and take control of your blog.
|
78 |
+
4. Create and schedule new posts in one simple step.
|
79 |
|
80 |
== Changelog ==
|
81 |
|
82 |
+
= 0.6 =
|
83 |
+
* The new look and feel of the calendar makes it easier to scan over your posts while showing you more information.
|
84 |
+
* You can customize the number of weeks you work with in the calendar using the screen options pull down in the upper right.
|
85 |
+
* The calendar now starts with the current day as the first week.
|
86 |
+
* When dragging posts the calendar will now automatically scroll when you move a post past the top or bottom of the calendar.
|
87 |
+
* You can now access the edit, view, and delete post links directly in the calendar without bringing up a second dialog.
|
88 |
+
* The calendar now prevents you from changing posts that have already been published.
|
89 |
+
* The calendar now supports using HTTPS for admin with the define('FORCE_SSL_ADMIN', true); option in wp-config.php.
|
90 |
+
* The calendar is now properly handling posts with apostrophe's in the title in Internet Explorer.
|
91 |
+
* The calendar now supports French. Thanks to the guys at <a href="http://stresslimitdesign.com/">StressLimitDesign</a>.
|
92 |
+
|
93 |
= 0.5.4 =
|
94 |
* I think this should finally fix the date format bugs we've been having. Thanks for sticking with it guys.
|
95 |
|
screenshot-1.gif
DELETED
Binary file
|
screenshot-1.png
ADDED
Binary file
|
screenshot-2.gif
DELETED
Binary file
|
screenshot-2.png
ADDED
Binary file
|
screenshot-3.gif
DELETED
Binary file
|
screenshot-3.png
ADDED
Binary file
|
screenshot-4.png
ADDED
Binary file
|