Version Description
29/08/2014 * Fix - Safari compatibility issues
Download this release
Release Info
Developer | sormano |
Plugin | WP Dashboard Notes |
Version | 1.0.2 |
Comparing to | |
See all releases |
Version 1.0.2
- assets/css/wpdn_admin.css +318 -0
- assets/js/wpdn_admin.js +233 -0
- includes/class-note-post-type.php +69 -0
- includes/class-wpdn-ajax.php +177 -0
- includes/templates/note-list.php +58 -0
- includes/templates/note.php +56 -0
- languages/wp-dashboard-notes-nl_NL.mo +0 -0
- languages/wp-dashboard-notes-nl_NL.po +99 -0
- license.txt +621 -0
- readme.txt +69 -0
- screenshot-1.png +0 -0
- screenshot-2.png +0 -0
- screenshot-3.png +0 -0
- wp-dashboard-notes.php +233 -0
assets/css/wpdn_admin.css
ADDED
@@ -0,0 +1,318 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
input[type=text].add-list-item {
|
2 |
+
line-height: normal;
|
3 |
+
border-radius: 3px;
|
4 |
+
height: 35px;
|
5 |
+
padding: 5px 10px;
|
6 |
+
width: 75%;
|
7 |
+
border-color: #555;
|
8 |
+
background-color: rgba( 255, 255, 255, 0.6 );
|
9 |
+
}
|
10 |
+
|
11 |
+
input[type=text].add-list-item::-webkit-input-placeholder {
|
12 |
+
color: #555;
|
13 |
+
}
|
14 |
+
input[type=text].add-list-item:-moz-placeholder {
|
15 |
+
color: #555;
|
16 |
+
}
|
17 |
+
input[type=text].add-list-item::-moz-placeholder {
|
18 |
+
color: #555;
|
19 |
+
}
|
20 |
+
input[type=text].add-list-item:-ms-input-placeholder {
|
21 |
+
color: #555;
|
22 |
+
}
|
23 |
+
|
24 |
+
.wp-dashboard-note {
|
25 |
+
line-height: 1.5;
|
26 |
+
font-size: 14px;
|
27 |
+
}
|
28 |
+
.wp-dashboard-note-wrap {
|
29 |
+
padding-bottom: 40px;
|
30 |
+
}
|
31 |
+
|
32 |
+
.wp-dashboard-note-options {
|
33 |
+
text-align: left;
|
34 |
+
}
|
35 |
+
.list-note .wp-dashboard-note-options {
|
36 |
+
margin-top: 15px;
|
37 |
+
}
|
38 |
+
|
39 |
+
.wp-dashboard-note .list-item {
|
40 |
+
min-height: 30px;
|
41 |
+
line-height: 30px;
|
42 |
+
width: 100%;
|
43 |
+
display: block;
|
44 |
+
}
|
45 |
+
.wp-dashboard-note div:last-child {
|
46 |
+
border-bottom: 0;
|
47 |
+
}
|
48 |
+
|
49 |
+
/* Sortable */
|
50 |
+
.wpdn-note-sortable {
|
51 |
+
color: #6f6f6f;
|
52 |
+
margin-right: 5px;
|
53 |
+
cursor: move;
|
54 |
+
line-height: inherit;
|
55 |
+
opacity: 0;
|
56 |
+
}
|
57 |
+
.list-item:hover .wpdn-note-sortable {
|
58 |
+
opacity: 1;
|
59 |
+
}
|
60 |
+
.list-item .dashicons-no-alt {
|
61 |
+
color: #ccc;
|
62 |
+
text-align: right;
|
63 |
+
float: right;
|
64 |
+
cursor: pointer;
|
65 |
+
line-height: inherit;
|
66 |
+
}
|
67 |
+
.list-item input[type=checkbox] {
|
68 |
+
margin-right: 15px;
|
69 |
+
background: transparent;
|
70 |
+
border-color: #555;
|
71 |
+
}
|
72 |
+
.list-item input[type=checkbox]:checked:before {
|
73 |
+
color: #555;
|
74 |
+
}
|
75 |
+
.list-item input[type=checkbox]:checked ~ span {
|
76 |
+
text-decoration:line-through;
|
77 |
+
color: #6f6f6f;
|
78 |
+
}
|
79 |
+
.list-item .dashicons-no-alt:hover {
|
80 |
+
color: #999;
|
81 |
+
}
|
82 |
+
.list-item:hover .dashicons-no-alt {
|
83 |
+
display: block;
|
84 |
+
}
|
85 |
+
.list-item .dashicons-no-alt {
|
86 |
+
display: none;
|
87 |
+
}
|
88 |
+
.wp-dashboard-note-wrap .wpdn-add-item {
|
89 |
+
line-height: 2;
|
90 |
+
}
|
91 |
+
.list-item .wpdn-add-item {
|
92 |
+
color: #ccc;
|
93 |
+
margin-right: 8px;
|
94 |
+
}
|
95 |
+
.list-item-content {
|
96 |
+
line-height: 1;
|
97 |
+
}
|
98 |
+
|
99 |
+
.wp-dashboard-note-wrap:hover .wpdn-extra {
|
100 |
+
opacity: 1;
|
101 |
+
}
|
102 |
+
.wpdn-extra {
|
103 |
+
background: rgba( 76, 76, 76, 0.9 );
|
104 |
+
position: absolute;
|
105 |
+
opacity: 0;
|
106 |
+
width: 100%;
|
107 |
+
left: 0;
|
108 |
+
bottom: 0;
|
109 |
+
height: 40px;
|
110 |
+
padding-left: 12px;
|
111 |
+
box-sizing: border-box;
|
112 |
+
-webkit-transition: opacity 0.3s ease-in-out;
|
113 |
+
transition: opacity 0.2s ease-in-out;
|
114 |
+
}
|
115 |
+
.wpdn-extra * {
|
116 |
+
color: #fff;
|
117 |
+
}
|
118 |
+
.wpdn-extra .dashicons:hover {
|
119 |
+
color: #ccc;
|
120 |
+
cursor: pointer;
|
121 |
+
}
|
122 |
+
[data-note-type=list] .saved-icon .dashicons,
|
123 |
+
.wpdn-extra .dashicons {
|
124 |
+
line-height: 2;
|
125 |
+
}
|
126 |
+
.wpdn-extra .dashicons {
|
127 |
+
margin-left: 5px;
|
128 |
+
}
|
129 |
+
[data-note-type=regular] .saved-icon .dashicons {
|
130 |
+
line-height: 1;
|
131 |
+
}
|
132 |
+
.hndle span {
|
133 |
+
cursor: text;
|
134 |
+
-webkit-user-select: text;
|
135 |
+
-moz-user-select: text;
|
136 |
+
-ms-user-select: text;
|
137 |
+
-o-user-select: text;
|
138 |
+
user-select: text;
|
139 |
+
}
|
140 |
+
h3.hndle .dashicons {
|
141 |
+
display: none;
|
142 |
+
height: 19px;
|
143 |
+
color: #222;
|
144 |
+
cursor: pointer;
|
145 |
+
margin-left: 5px;
|
146 |
+
}
|
147 |
+
h3.hndle:hover .dashicons {
|
148 |
+
display: inline-block;
|
149 |
+
}
|
150 |
+
[id^=note_] .handlediv {
|
151 |
+
color: #222;
|
152 |
+
color: transparent;
|
153 |
+
}
|
154 |
+
|
155 |
+
/* Saving */
|
156 |
+
.saving-icon img {
|
157 |
+
vertical-align: middle;
|
158 |
+
}
|
159 |
+
.saved-icon,
|
160 |
+
.saving-icon {
|
161 |
+
color: #222;
|
162 |
+
}
|
163 |
+
|
164 |
+
/* Add button screen options */
|
165 |
+
[for=add_note-hide] {
|
166 |
+
float: right;
|
167 |
+
padding-left: 10px;
|
168 |
+
margin-left: 2px;
|
169 |
+
}
|
170 |
+
[for=add_note-hide] input {
|
171 |
+
display: none;
|
172 |
+
}
|
173 |
+
[for=add_note-hide]::before {
|
174 |
+
content: "\f132";
|
175 |
+
font-family: dashicons;
|
176 |
+
vertical-align: middle;
|
177 |
+
font-size: 18px;
|
178 |
+
margin-right: 5px;
|
179 |
+
}
|
180 |
+
[for=add_note-hide]:hover {
|
181 |
+
color: #fff;
|
182 |
+
background: #333;
|
183 |
+
}
|
184 |
+
/* Hide pencil at screen options titles */
|
185 |
+
.metabox-prefs .wpdn-edit-title.dashicons-edit {
|
186 |
+
display: none;
|
187 |
+
}
|
188 |
+
|
189 |
+
/****************************
|
190 |
+
* Colors
|
191 |
+
****************************/
|
192 |
+
span.wpdn-color-note:hover .wpdn-color-palette {
|
193 |
+
display: inline-block;
|
194 |
+
}
|
195 |
+
.wpdn-color-palette {
|
196 |
+
min-width: 50px;
|
197 |
+
width: auto;
|
198 |
+
padding: 4px 8px 2px 8px;
|
199 |
+
margin-left: -8px;
|
200 |
+
position: absolute;
|
201 |
+
top: -24px;
|
202 |
+
background-color: rgba(76, 76, 76, 0.9);
|
203 |
+
height: 18px;
|
204 |
+
display: none;
|
205 |
+
}
|
206 |
+
|
207 |
+
.color {
|
208 |
+
width: 10px;
|
209 |
+
height: 10px;
|
210 |
+
border: 1px solid transparent;
|
211 |
+
margin: 2.5px;
|
212 |
+
display: inline-block;
|
213 |
+
}
|
214 |
+
.color:hover {
|
215 |
+
border: 1px solid #ccc;
|
216 |
+
cursor: pointer;
|
217 |
+
}
|
218 |
+
.color-white { background-color: #ffffff; }
|
219 |
+
.color-red { background-color: #f7846a; }
|
220 |
+
.color-orange { background-color: #ffbd22; }
|
221 |
+
.color-yellow { background-color: #eeee22; }
|
222 |
+
.color-blue { background-color: #66ccdd; }
|
223 |
+
.color-green { background-color: #bbe535; }
|
224 |
+
.color-black { background-color: #777777; }
|
225 |
+
|
226 |
+
/****************************
|
227 |
+
* Black
|
228 |
+
****************************/
|
229 |
+
[data-color-text=black] {
|
230 |
+
color: white;
|
231 |
+
}
|
232 |
+
[data-color-text=black] .wpdn-note-sortable {
|
233 |
+
color: white;
|
234 |
+
}
|
235 |
+
[data-color-text=black] .wpdn-add-item {
|
236 |
+
color: white;
|
237 |
+
}
|
238 |
+
[data-color-text=black] .wp-dashboard-note .list-item {
|
239 |
+
border-color: white;
|
240 |
+
}
|
241 |
+
[data-color-text=black] input[type=checkbox] {
|
242 |
+
border: 1px solid white;
|
243 |
+
}
|
244 |
+
[data-color-text=black] .list-item input[type=checkbox]:checked ~ span {
|
245 |
+
color: white;
|
246 |
+
}
|
247 |
+
[data-color-text=black] [id^=note] .handlediv {
|
248 |
+
color: white;
|
249 |
+
}
|
250 |
+
[data-color-text=black] input[type=text].add-list-item {
|
251 |
+
border-color: #FFF;
|
252 |
+
color: #FFF;
|
253 |
+
background: rgba(255, 255, 255, 0.3);
|
254 |
+
}
|
255 |
+
[data-color-text=black] input[type=text].add-list-item::-webkit-input-placeholder {
|
256 |
+
color: white;
|
257 |
+
}
|
258 |
+
[data-color-text=black] input[type=text].add-list-item:-moz-placeholder {
|
259 |
+
color: white;
|
260 |
+
}
|
261 |
+
[data-color-text=black] input[type=text].add-list-item::-moz-placeholder {
|
262 |
+
color: white;
|
263 |
+
}
|
264 |
+
[data-color-text=black] input[type=text].add-list-item:-ms-input-placeholder {
|
265 |
+
color: white;
|
266 |
+
}
|
267 |
+
[data-color-text=black] .saved-icon,
|
268 |
+
[data-color-text=black] .saving-icon {
|
269 |
+
color: white;
|
270 |
+
}
|
271 |
+
|
272 |
+
|
273 |
+
|
274 |
+
/****************************
|
275 |
+
* Template
|
276 |
+
****************************/
|
277 |
+
[data-color-text=template] {
|
278 |
+
color: inherit;
|
279 |
+
}
|
280 |
+
[data-color-text=template] .wpdn-note-sortable {
|
281 |
+
color: inherit;
|
282 |
+
}
|
283 |
+
[data-color-text=template] .wpdn-add-item {
|
284 |
+
color: inherit;
|
285 |
+
}
|
286 |
+
[data-color-text=template] .wp-dashboard-note .list-item {
|
287 |
+
border-color: inherit;
|
288 |
+
}
|
289 |
+
[data-color-text=template] input[type=checkbox] {
|
290 |
+
border: 1px solid inherit;
|
291 |
+
}
|
292 |
+
[data-color-text=template] .list-item input[type=checkbox]:checked ~ span {
|
293 |
+
color: inherit;
|
294 |
+
}
|
295 |
+
[data-color-text=template] [id^=note] .handlediv {
|
296 |
+
color: inherit;
|
297 |
+
}
|
298 |
+
[data-color-text=template] input[type=text].add-list-item {
|
299 |
+
border-color: inherit;
|
300 |
+
color: inherit;
|
301 |
+
background: inherit;
|
302 |
+
}
|
303 |
+
[data-color-text=template] input[type=text].add-list-item::-webkit-input-placeholder {
|
304 |
+
color: inherit;
|
305 |
+
}
|
306 |
+
[data-color-text=template] input[type=text].add-list-item:-moz-placeholder {
|
307 |
+
color: inherit;
|
308 |
+
}
|
309 |
+
[data-color-text=template] input[type=text].add-list-item::-moz-placeholder {
|
310 |
+
color: inherit;
|
311 |
+
}
|
312 |
+
[data-color-text=template] input[type=text].add-list-item:-ms-input-placeholder {
|
313 |
+
color: inherit;
|
314 |
+
}
|
315 |
+
[data-color-text=template] .saved-icon,
|
316 |
+
[data-color-text=template] .saving-icon {
|
317 |
+
color: inherit;
|
318 |
+
}
|
assets/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img src="images/wpspin_light.gif"/> saving...</span>';
|
4 |
+
var saved_icon = '<span class="saved-icon"><div class="dashicons dashicons-yes"></div> saved!</span>';
|
5 |
+
|
6 |
+
|
7 |
+
// Add todo item
|
8 |
+
$( 'body, .list-item-content' ).on( 'keydown', '.add-list-item', function( e ) {
|
9 |
+
|
10 |
+
if( e.keyCode == 13 && $( this ).val() != '' ) {
|
11 |
+
|
12 |
+
var post_id = $( this ).closest( ".postbox" ).attr( 'id' );
|
13 |
+
var list_item = '<div class="list-item"><div class="dashicons dashicons-menu wpdn-note-sortable"></div><input type="checkbox"><span class="list-item-content" contenteditable="true">' + $( this ).val() + '</span><div class="delete-item dashicons dashicons-no-alt"></div></div>';
|
14 |
+
|
15 |
+
$( '#' + post_id + ' div.wp-dashboard-note' ).append( list_item );
|
16 |
+
$( this ).val( '' ); // Clear 'add item' field
|
17 |
+
$( this ).trigger( 'note-sortable' );
|
18 |
+
|
19 |
+
$( this ).trigger( 'wpdn-update', this );
|
20 |
+
|
21 |
+
}
|
22 |
+
|
23 |
+
});
|
24 |
+
|
25 |
+
|
26 |
+
// Delete todo item
|
27 |
+
$( 'body' ).on( 'click', '.delete-item', function() {
|
28 |
+
|
29 |
+
var post_id = $( this ).closest( ".postbox" ).attr( 'id' );
|
30 |
+
|
31 |
+
$( this ).parent( '.list-item' ).remove();
|
32 |
+
$( 'body' ).trigger( 'wpdn-update', ['', post_id] );
|
33 |
+
|
34 |
+
});
|
35 |
+
|
36 |
+
|
37 |
+
// Toggle visibility
|
38 |
+
$( 'body' ).on( 'click', '.wpdn-visibility', function() {
|
39 |
+
|
40 |
+
$( this ).toggleClass( 'dashicons-lock dashicons-groups' );
|
41 |
+
|
42 |
+
var visibility = $( this ).parent().attr( 'data-visibility' );
|
43 |
+
if ( 'public' == visibility ) {
|
44 |
+
$( this ).parent( '.wpdn-toggle-visibility' ).attr( 'data-visibility', 'private' );
|
45 |
+
$( this ).parent( '.wpdn-toggle-visibility' ).attr( 'title', 'Visibility: Just me' );
|
46 |
+
} else {
|
47 |
+
$( this ).parent( '.wpdn-toggle-visibility' ).attr( 'data-visibility', 'public' );
|
48 |
+
$( this ).parent( '.wpdn-toggle-visibility' ).attr( 'title', 'Visibility: Everyone' );
|
49 |
+
}
|
50 |
+
|
51 |
+
$( this ).trigger( 'wpdn-update', this );
|
52 |
+
|
53 |
+
});
|
54 |
+
|
55 |
+
|
56 |
+
// Toggle note type
|
57 |
+
$( 'body' ).on( 'click', '.wpdn-note-type', function() {
|
58 |
+
|
59 |
+
$( this ).toggleClass( 'dashicons-list-view dashicons-welcome-write-blog' );
|
60 |
+
|
61 |
+
var note_type = $( this ).closest( '[data-note-type]' ).attr( 'data-note-type' );
|
62 |
+
if ( note_type == 'regular' ) {
|
63 |
+
$( this ).closest( '[data-note-type]' ).attr( 'data-note-type', 'list' );
|
64 |
+
} else {
|
65 |
+
$( this ).closest( '[data-note-type]' ).attr( 'data-note-type', 'regular' );
|
66 |
+
}
|
67 |
+
|
68 |
+
var data = {
|
69 |
+
action: 'wpdn_toggle_note',
|
70 |
+
post_id: $( this ).closest( ".postbox" ).attr( 'id' ).replace( 'note_', '' ),
|
71 |
+
note_type: ( note_type == 'regular' ? 'list' : 'regular' )
|
72 |
+
};
|
73 |
+
|
74 |
+
$.post( ajaxurl, data, function( response ) {
|
75 |
+
$( '#note_' + data.post_id + ' .inside' ).html( response ).trigger( 'note-sortable' );;
|
76 |
+
});
|
77 |
+
|
78 |
+
$( this ).trigger( 'wpdn-update', this );
|
79 |
+
|
80 |
+
});
|
81 |
+
|
82 |
+
|
83 |
+
// Update note trigger
|
84 |
+
$( 'body' ).on( 'wpdn-update', function( event, t, post_id ) {
|
85 |
+
|
86 |
+
if ( t != '' ) {
|
87 |
+
post_id = $( t ).closest( ".postbox" ).attr( 'id' );
|
88 |
+
}
|
89 |
+
|
90 |
+
if ( ! post_id ) {
|
91 |
+
return;
|
92 |
+
}
|
93 |
+
|
94 |
+
$( '#' + post_id + ' .wp-dashboard-note-options .status' ).html( loading_icon );
|
95 |
+
var data = {
|
96 |
+
action: 'wpdn_update_note',
|
97 |
+
post_id: post_id.replace( 'note_', '' ),
|
98 |
+
post_content: $( '#' + post_id + ' div.wp-dashboard-note' ).html(),
|
99 |
+
post_title: $( '#' + post_id + ' > h3 .wpdn-title' ).html(),
|
100 |
+
note_visibility: $( '#' + post_id + ' [data-visibility]' ).attr( 'data-visibility' ),
|
101 |
+
note_color_text: $( '#' + post_id + ' [data-color-text]' ).attr( 'data-color-text' ),
|
102 |
+
note_color: $( '#' + post_id + ' [data-note-color]' ).attr( 'data-note-color' ),
|
103 |
+
note_type: $( '#' + post_id + ' [data-note-type]' ).attr( 'data-note-type' )
|
104 |
+
};
|
105 |
+
|
106 |
+
$.post( ajaxurl, data, function( response ) {
|
107 |
+
$( '#' + post_id + ' .wp-dashboard-note-options .status' ).html( saved_icon );
|
108 |
+
$( '#' + post_id + ' .wp-dashboard-note-options .status *' ).fadeOut( 1000, function() { $( this ).html( '' ) });
|
109 |
+
});
|
110 |
+
|
111 |
+
});
|
112 |
+
|
113 |
+
|
114 |
+
// Delete note
|
115 |
+
$( 'body' ).on( 'click', '.wpdn-delete-note', function() {
|
116 |
+
|
117 |
+
var post_id = $( this ).closest( ".postbox" ).attr( 'id' );
|
118 |
+
|
119 |
+
$( '#' + post_id ).fadeOut( 500, function() { $( this ).remove() } );
|
120 |
+
|
121 |
+
var data = {
|
122 |
+
action: 'wpdn_delete_note',
|
123 |
+
post_id: post_id.replace( 'note_', '' ),
|
124 |
+
};
|
125 |
+
|
126 |
+
$.post( ajaxurl, data, function( response ) {
|
127 |
+
|
128 |
+
});
|
129 |
+
|
130 |
+
});
|
131 |
+
|
132 |
+
|
133 |
+
// Add note
|
134 |
+
$( 'body' ).on( 'click', '.wpdn-add-note, #add_note-hide', function() {
|
135 |
+
|
136 |
+
var data = { action: 'wpdn_add_note' };
|
137 |
+
|
138 |
+
$.post( ajaxurl, data, function( response ) {
|
139 |
+
response = jQuery.parseJSON( response );
|
140 |
+
jQuery( '#postbox-container-1 #normal-sortables' ).append( response.note );
|
141 |
+
jQuery('body, html').animate({ scrollTop: $( "#note_" + response.post_id ).offset().top - 50 }, 750); // scroll down
|
142 |
+
jQuery( '#note_' + response.post_id + ' .add-list-item' ).focus();
|
143 |
+
});
|
144 |
+
|
145 |
+
|
146 |
+
// Stop scrollTop animation on user scroll
|
147 |
+
$( 'html, body' ).bind("scroll mousedown DOMMouseScroll mousewheel keyup", function( e ){
|
148 |
+
if ( e.which > 0 || e.type === "mousedown" || e.type === "mousewheel") {
|
149 |
+
$( 'html, body' ).stop().unbind('scroll mousedown DOMMouseScroll mousewheel keyup');
|
150 |
+
}
|
151 |
+
});
|
152 |
+
|
153 |
+
});
|
154 |
+
|
155 |
+
// Change color
|
156 |
+
$( 'body' ).on( 'click', '.color', function() {
|
157 |
+
|
158 |
+
// Set variables
|
159 |
+
var color = $( this ).attr( 'data-select-color' );
|
160 |
+
var color_text = $( this ).attr( 'data-select-color-text' );
|
161 |
+
|
162 |
+
// Preview
|
163 |
+
$( this ).closest( '.postbox' ).css( 'background-color', color );
|
164 |
+
$( this ).closest( '.wp-dashboard-note-wrap' ).attr( 'data-color-text', color_text );
|
165 |
+
|
166 |
+
// Set saving attributes
|
167 |
+
$( '[data-note-color]' ).attr( 'data-note-color', color );
|
168 |
+
$( this ).closest( '[data-color-text]' ).attr( 'data-color-text', color_text );
|
169 |
+
|
170 |
+
// Update note
|
171 |
+
$( this ).trigger( 'wpdn-update', this );
|
172 |
+
});
|
173 |
+
|
174 |
+
|
175 |
+
// Edit/update note
|
176 |
+
$( 'body' ).on( 'blur', '.list-item-content, [contenteditable=true]', function() {
|
177 |
+
$( this ).trigger( 'wpdn-update', this );
|
178 |
+
});
|
179 |
+
|
180 |
+
// Save on enter (list note)
|
181 |
+
$( 'body' ).on( 'keydown', '[data-note-type=list], .wpdn-title, .list-item-content', function( e ) {
|
182 |
+
if ( e.keyCode == 13 ) {
|
183 |
+
$( this ).trigger( 'wpdn-update', this );
|
184 |
+
$( this ).blur();
|
185 |
+
return false;
|
186 |
+
}
|
187 |
+
});
|
188 |
+
// Save on CMD|CTRL + enter (regular note)
|
189 |
+
$( 'body' ).on( 'keydown', '[data-note-type=regular] .wp-dashboard-note', function( e ) {
|
190 |
+
if ( e.keyCode == 13 && ( e.ctrlKey || e.metaKey ) ) {
|
191 |
+
$( this ).trigger( 'wpdn-update', this );
|
192 |
+
$( this ).blur();
|
193 |
+
return false;
|
194 |
+
}
|
195 |
+
});
|
196 |
+
|
197 |
+
|
198 |
+
// Edit title
|
199 |
+
$( 'body, .postbox h3' ).on( 'click', '.wpdn-edit-title', function( e ) {
|
200 |
+
$( this ).prev().focus();
|
201 |
+
document.execCommand( 'selectAll', false, null );
|
202 |
+
e.stopPropagation();
|
203 |
+
});
|
204 |
+
// Prevent collapsing on title click
|
205 |
+
$( 'body, .postbox h3' ).on( 'click', '.wpdn-title', function( e ) {
|
206 |
+
e.stopPropagation();
|
207 |
+
});
|
208 |
+
|
209 |
+
|
210 |
+
// Note checkbox toggle
|
211 |
+
$( 'input[type=checkbox]' ).change( function() {
|
212 |
+
if( this.checked ) {
|
213 |
+
$( this ).attr( 'checked', 'checked' );
|
214 |
+
} else {
|
215 |
+
$( this ).removeAttr( 'checked' );
|
216 |
+
}
|
217 |
+
$( this ).trigger( 'wpdn-update', this );
|
218 |
+
});
|
219 |
+
|
220 |
+
|
221 |
+
// Make list sortable
|
222 |
+
$( 'body' ).on( 'note-sortable', function() {
|
223 |
+
$( '.wp-dashboard-note' ).sortable({
|
224 |
+
handle: '.wpdn-note-sortable',
|
225 |
+
update: function( event, ui ) {
|
226 |
+
$( this ).trigger( 'wpdn-update', this );
|
227 |
+
}
|
228 |
+
});
|
229 |
+
})
|
230 |
+
.trigger( 'note-sortable' );
|
231 |
+
|
232 |
+
|
233 |
+
});
|
includes/class-note-post-type.php
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Class Note_Post_Type
|
6 |
+
*
|
7 |
+
* Register and handle post type registration.
|
8 |
+
*
|
9 |
+
* @class Note_Post_Type
|
10 |
+
* @version 1.0.0
|
11 |
+
* @package WP Dashboard Notes
|
12 |
+
* @author Jeroen Sormani
|
13 |
+
*/
|
14 |
+
class Note_Post_Type {
|
15 |
+
|
16 |
+
|
17 |
+
/**
|
18 |
+
* __construct function.
|
19 |
+
*
|
20 |
+
* @since 1.0.0
|
21 |
+
*/
|
22 |
+
public function __construct() {
|
23 |
+
|
24 |
+
$this->note_register_post_type();
|
25 |
+
|
26 |
+
}
|
27 |
+
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Register post type.
|
31 |
+
*
|
32 |
+
* Register and set settings for post type 'note'.
|
33 |
+
*
|
34 |
+
* @since 1.0.0
|
35 |
+
*/
|
36 |
+
public function note_register_post_type() {
|
37 |
+
|
38 |
+
$labels = array(
|
39 |
+
'name' => __( 'Notes', 'wp-dashboard-notes' ),
|
40 |
+
'singular_name' => __( 'Note', 'wp-dashboard-notes' ),
|
41 |
+
'add_new' => __( 'Add New', 'wp-dashboard-notes' ),
|
42 |
+
'add_new_item' => __( 'Add New Note' , 'wp-dashboard-notes' ),
|
43 |
+
'edit_item' => __( 'Edit Note' , 'wp-dashboard-notes' ),
|
44 |
+
'new_item' => __( 'New Note' , 'wp-dashboard-notes' ),
|
45 |
+
'view_item' => __( 'View Note', 'wp-dashboard-notes' ),
|
46 |
+
'search_items' => __( 'Search Notes', 'wp-dashboard-notes' ),
|
47 |
+
'not_found' => __( 'No Notes', 'wp-dashboard-notes' ),
|
48 |
+
'not_found_in_trash' => __( 'No Notes found in Trash', 'wp-dashboard-notes' ),
|
49 |
+
);
|
50 |
+
|
51 |
+
register_post_type( 'note', array(
|
52 |
+
'label' => 'note',
|
53 |
+
'show_ui' => false,
|
54 |
+
'show_in_menu' => false,
|
55 |
+
'capability_type' => 'post',
|
56 |
+
'map_meta_cap' => true,
|
57 |
+
'rewrite' => array( 'slug' => 'notes' ),
|
58 |
+
'_builtin' => false,
|
59 |
+
'query_var' => true,
|
60 |
+
'supports' => array( 'title', 'editor' ),
|
61 |
+
'labels' => $labels,
|
62 |
+
) );
|
63 |
+
|
64 |
+
}
|
65 |
+
|
66 |
+
}
|
67 |
+
|
68 |
+
global $wpdn_post_type;
|
69 |
+
$wpdn_post_type = new Note_Post_Type();
|
includes/class-wpdn-ajax.php
ADDED
@@ -0,0 +1,177 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Class WPDN_Ajax
|
6 |
+
*
|
7 |
+
* Class to handle all AJAX calls.
|
8 |
+
*
|
9 |
+
* @class WPDN_Ajax
|
10 |
+
* @version 1.0.0
|
11 |
+
* @package WP Dashboard Notes
|
12 |
+
* @author Jeroen Sormani
|
13 |
+
*/
|
14 |
+
class WPDN_Ajax {
|
15 |
+
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Construct function.
|
19 |
+
*
|
20 |
+
* Add ajax actions.
|
21 |
+
*
|
22 |
+
* @since 1.0.0
|
23 |
+
*/
|
24 |
+
public function __construct() {
|
25 |
+
|
26 |
+
// Update note
|
27 |
+
add_action( 'wp_ajax_wpdn_update_note', array( $this, 'wpdn_update_note' ) );
|
28 |
+
add_action( 'wp_ajax_wpdn_toggle_note', array( $this, 'wpdn_toggle_note' ) );
|
29 |
+
|
30 |
+
// Add / Delete note
|
31 |
+
add_action( 'wp_ajax_wpdn_add_note', array( $this, 'wpdn_add_note' ) );
|
32 |
+
add_action( 'wp_ajax_wpdn_delete_note', array( $this, 'wpdn_delete_note' ) );
|
33 |
+
|
34 |
+
}
|
35 |
+
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Update note.
|
39 |
+
*
|
40 |
+
* Update note + meta when the jQuery update trigger is triggered.
|
41 |
+
*
|
42 |
+
* @since 1.0.0
|
43 |
+
*/
|
44 |
+
public function wpdn_update_note() {
|
45 |
+
|
46 |
+
$post = array(
|
47 |
+
'ID' => $_POST['post_id'],
|
48 |
+
'post_title' => $_POST['post_title'],
|
49 |
+
'post_content' => $_POST['post_content'],
|
50 |
+
);
|
51 |
+
|
52 |
+
wp_update_post( $post );
|
53 |
+
|
54 |
+
$note_meta = array(
|
55 |
+
'color' => $_POST['note_color'],
|
56 |
+
'color_text' => $_POST['note_color_text'],
|
57 |
+
'visibility' => $_POST['note_visibility'],
|
58 |
+
'note_type' => $_POST['note_type'],
|
59 |
+
);
|
60 |
+
update_post_meta( $_POST['post_id'], '_note', $note_meta );
|
61 |
+
|
62 |
+
die();
|
63 |
+
|
64 |
+
}
|
65 |
+
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Toggle note.
|
69 |
+
*
|
70 |
+
* Toggle note type, from 'regular note' to 'list note' or vice versa.
|
71 |
+
*
|
72 |
+
* @since 1.0.0
|
73 |
+
*/
|
74 |
+
public function wpdn_toggle_note() {
|
75 |
+
|
76 |
+
$note = get_post( $_POST['post_id'] );
|
77 |
+
$note_meta = WP_Dashboard_Notes::wpdn_get_note_meta( $note->ID );
|
78 |
+
|
79 |
+
?>
|
80 |
+
<style>
|
81 |
+
#note_<?php echo $note->ID; ?> { background-color: <?php echo $note_meta['color']; ?>; }
|
82 |
+
#note_<?php echo $note->ID; ?> .hndle { border: none; }
|
83 |
+
</style>
|
84 |
+
<?php
|
85 |
+
if ( $_POST['note_type'] == 'regular' ) :
|
86 |
+
require plugin_dir_path( __FILE__ ) . 'templates/note.php';
|
87 |
+
else :
|
88 |
+
require plugin_dir_path( __FILE__ ) . 'templates/note-list.php';
|
89 |
+
endif;
|
90 |
+
|
91 |
+
die();
|
92 |
+
|
93 |
+
}
|
94 |
+
|
95 |
+
|
96 |
+
/**
|
97 |
+
* Add new note.
|
98 |
+
*
|
99 |
+
* Create a new note, return two variables (post ID | note content) to jQuery through json_encode.
|
100 |
+
*
|
101 |
+
* @since 1.0.0
|
102 |
+
*/
|
103 |
+
public function wpdn_add_note() {
|
104 |
+
|
105 |
+
$args = array(
|
106 |
+
'post_status' => 'publish',
|
107 |
+
'post_type' => 'note',
|
108 |
+
'post_title' => __( 'New note', 'wp-dashboard-notes' ),
|
109 |
+
);
|
110 |
+
$post_id = wp_insert_post( $args );
|
111 |
+
|
112 |
+
$note = (object) array( 'post_content' => '' );
|
113 |
+
$note_meta = array(
|
114 |
+
'color' => '#ffffff',
|
115 |
+
'color_text' => 'white',
|
116 |
+
'visibility' => 'Everyone',
|
117 |
+
'note_type' => 'list',
|
118 |
+
);
|
119 |
+
$note_meta = apply_filters( 'wpdn_new_note_meta', $note_meta );
|
120 |
+
update_post_meta( $post_id, '_note', $note_meta );
|
121 |
+
|
122 |
+
ob_start(); ?>
|
123 |
+
|
124 |
+
<div id='note_<?php echo $post_id; ?>' class='postbox'>
|
125 |
+
<div class='handlediv' title='Click to toggle'><br></div>
|
126 |
+
<h3 class="hndle">
|
127 |
+
<span>
|
128 |
+
<span contenteditable="true" class="wpdn-title"><?php _e( 'New note', 'wp-dashboard-notes' ); ?></span>
|
129 |
+
<div class="wpdn-edit-title dashicons dashicons-edit"></div>
|
130 |
+
</span>
|
131 |
+
</h3>
|
132 |
+
|
133 |
+
<div class='inside'>
|
134 |
+
|
135 |
+
<style>
|
136 |
+
#note_<?php echo $post_id; ?> .hndle { border: none; }
|
137 |
+
</style>
|
138 |
+
|
139 |
+
<?php if ( 'regular' == $note_meta['note_type'] ) :
|
140 |
+
require plugin_dir_path( __FILE__ ) . 'templates/note.php';
|
141 |
+
else :
|
142 |
+
require plugin_dir_path( __FILE__ ) . 'templates/note-list.php';
|
143 |
+
endif; ?>
|
144 |
+
|
145 |
+
</div> <!-- .inside -->
|
146 |
+
</div> <!-- .postbox -->
|
147 |
+
|
148 |
+
<?php
|
149 |
+
$return['note'] = ob_get_clean();
|
150 |
+
$return['post_id'] = $post_id;
|
151 |
+
|
152 |
+
echo json_encode( $return );
|
153 |
+
|
154 |
+
die();
|
155 |
+
|
156 |
+
}
|
157 |
+
|
158 |
+
|
159 |
+
/**
|
160 |
+
* Delete note.
|
161 |
+
*
|
162 |
+
* Post is trashed and not permanently deleted.
|
163 |
+
*
|
164 |
+
* @since 1.0.0
|
165 |
+
*/
|
166 |
+
public function wpdn_delete_note() {
|
167 |
+
|
168 |
+
$post_id = (int) $_POST['post_id'];
|
169 |
+
wp_trash_post( $post_id );
|
170 |
+
die();
|
171 |
+
|
172 |
+
}
|
173 |
+
|
174 |
+
|
175 |
+
}
|
176 |
+
new WPDN_Ajax();
|
177 |
+
?>
|
includes/templates/note-list.php
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class='wp-dashboard-note-wrap list-note' data-note-type='list' data-color-text='<?php echo $note_meta['color_text']; ?>'>
|
2 |
+
|
3 |
+
<div class='wp-dashboard-note'>
|
4 |
+
<?php echo $note->post_content; ?>
|
5 |
+
</div>
|
6 |
+
|
7 |
+
<div class='wp-dashboard-note-options'>
|
8 |
+
<div class='dashicons dashicons-plus wpdn-add-item'></div>
|
9 |
+
<input type='text' name='list_item' class='add-list-item' data-id='<?php echo $note->ID; ?>' placeholder='<?php _e( 'List item', 'wp-dashboard-notes' ); ?>' value=''>
|
10 |
+
<span class='status'></span>
|
11 |
+
<div class='wpdn-extra'>
|
12 |
+
<span class='wpdn-option-visibility'>
|
13 |
+
<?php
|
14 |
+
if ( 'private' == $note_meta['visibility'] && $note_meta ) :
|
15 |
+
$status['icon'] = 'dashicons-lock';
|
16 |
+
$status['title'] = __( 'Just me', 'wp-dashboard-notes' );
|
17 |
+
$status['visibility'] = 'private';
|
18 |
+
else :
|
19 |
+
$status['icon'] = 'dashicons-groups';
|
20 |
+
$status['title'] = __( 'Everyone', 'wp-dashboard-notes' );
|
21 |
+
$status['visibility'] = 'public';
|
22 |
+
endif; ?>
|
23 |
+
|
24 |
+
<span class='wpdn-toggle-visibility' title='<?php _e( 'Visibility:', 'wp-dashboard-notes' ); ?> <?php echo $status['title']; ?>' data-visibility='<?php echo $status['visibility']; ?>'>
|
25 |
+
<div class='wpdn-visibility visibility-publish dashicons <?php echo $status['icon']; ?>'></div>
|
26 |
+
</span>
|
27 |
+
|
28 |
+
<span class='wpdn-color-note' title='<?php _e( 'Give me a color!', 'wp-dashboard-notes' ); ?>'>
|
29 |
+
<span class='wpdn-color-palette'>
|
30 |
+
<span class='color color-white' data-select-color-text='white' data-select-color='#ffffff'></span>
|
31 |
+
<span class='color color-red' data-select-color-text='red' data-select-color='#f7846a'></span>
|
32 |
+
<span class='color color-orange' data-select-color-text='orange' data-select-color='#ffbd22'></span>
|
33 |
+
<span class='color color-yellow' data-select-color-text='yellow' data-select-color='#eeee22'></span>
|
34 |
+
<span class='color color-green' data-select-color-text='green' data-select-color='#bbe535'></span>
|
35 |
+
<span class='color color-blue' data-select-color-text='blue' data-select-color='#66ccdd'></span>
|
36 |
+
<span class='color color-black' data-select-color-text='black' data-select-color='#777777'></span>
|
37 |
+
</span>
|
38 |
+
<div class='dashicons dashicons-art wpdn-note-color' data-note-color='<?php echo $note_meta['color']; ?>'></div>
|
39 |
+
</span>
|
40 |
+
|
41 |
+
<span title='<?php _e( 'Convert to regular note', 'wp-dashboard-notes'); ?>'>
|
42 |
+
<div class='wpdn-note-type dashicons dashicons-welcome-write-blog'></div>
|
43 |
+
</span>
|
44 |
+
|
45 |
+
<span class='wpdn-add-note' title='<?php _e( 'Add a new note', 'wp-dashboard-notes' ); ?>'>
|
46 |
+
<div class='dashicons dashicons-plus'></div>
|
47 |
+
</span>
|
48 |
+
|
49 |
+
|
50 |
+
<span style='float: right; margin-right: 10px;' class='wpdn-delete-note' title='<?php _e( 'Delete note', 'wp-dashboard-notes' ); ?>'>
|
51 |
+
<div class='dashicons dashicons-trash'></div>
|
52 |
+
</span>
|
53 |
+
|
54 |
+
</span>
|
55 |
+
</div>
|
56 |
+
</div>
|
57 |
+
|
58 |
+
</div>
|
includes/templates/note.php
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class='wp-dashboard-note-wrap regular-note' data-note-type='regular' data-color-text='<?php echo $note_meta['color_text']; ?>'>
|
2 |
+
|
3 |
+
<div class='wp-dashboard-note' contenteditable='true'>
|
4 |
+
<?php echo $note->post_content; ?>
|
5 |
+
</div>
|
6 |
+
|
7 |
+
<div class='wp-dashboard-note-options'>
|
8 |
+
|
9 |
+
<span class='status'></span>
|
10 |
+
<div class='wpdn-extra'>
|
11 |
+
<span class='wpdn-option-visibility'>
|
12 |
+
<?php
|
13 |
+
if ( 'private' == $note_meta['visibility'] && $note_meta ) :
|
14 |
+
$status['icon'] = 'dashicons-lock';
|
15 |
+
$status['title'] = __( 'Just me', 'wp-dashboard-notes' );
|
16 |
+
$status['visibility'] = 'private';
|
17 |
+
else :
|
18 |
+
$status['icon'] = 'dashicons-groups';
|
19 |
+
$status['title'] = __( 'Everyone', 'wp-dashboard-notes' );
|
20 |
+
$status['visibility'] = 'public';
|
21 |
+
endif; ?>
|
22 |
+
|
23 |
+
<span class='wpdn-toggle-visibility' title='<?php _e( 'Visibility:', 'wp-dashboard-notes' ); ?> <?php echo $status['title']; ?>' data-visibility='<?php echo $status['visibility']; ?>'>
|
24 |
+
<div class='wpdn-visibility visibility-publish dashicons <?php echo $status['icon']; ?>'></div>
|
25 |
+
</span>
|
26 |
+
|
27 |
+
<span class='wpdn-color-note' title='<?php _e( 'Give me a color!', 'wp-dashboard-notes' ); ?>'>
|
28 |
+
<span class='wpdn-color-palette'>
|
29 |
+
<span class='color color-white' data-select-color-text='white' data-select-color='#ffffff'></span>
|
30 |
+
<span class='color color-red' data-select-color-text='red' data-select-color='#f7846a'></span>
|
31 |
+
<span class='color color-orange' data-select-color-text='orange' data-select-color='#ffbd22'></span>
|
32 |
+
<span class='color color-yellow' data-select-color-text='yellow' data-select-color='#eeee22'></span>
|
33 |
+
<span class='color color-green' data-select-color-text='green' data-select-color='#bbe535'></span>
|
34 |
+
<span class='color color-blue' data-select-color-text='blue' data-select-color='#66ccdd'></span>
|
35 |
+
<span class='color color-black' data-select-color-text='black' data-select-color='#777777'></span>
|
36 |
+
</span>
|
37 |
+
<div class='dashicons dashicons-art wpdn-note-color' data-note-color='<?php echo $note_meta['color']; ?>'></div>
|
38 |
+
</span>
|
39 |
+
|
40 |
+
<span title='<?php _e( 'Convert to list note', 'wp-dashboard-notes'); ?>'>
|
41 |
+
<div class='wpdn-note-type dashicons dashicons-list-view'></div>
|
42 |
+
</span>
|
43 |
+
|
44 |
+
<span class='wpdn-add-note' title='<?php _e( 'Add a new note', 'wp-dashboard-notes' ); ?>'>
|
45 |
+
<div class='dashicons dashicons-plus'></div>
|
46 |
+
</span>
|
47 |
+
|
48 |
+
<span style='float: right; margin-right: 10px;' class='wpdn-delete-note' title='<?php _e( 'Delete note', 'wp-dashboard-notes' ); ?>'>
|
49 |
+
<div class='dashicons dashicons-trash'></div>
|
50 |
+
</span>
|
51 |
+
|
52 |
+
</span>
|
53 |
+
</div>
|
54 |
+
</div>
|
55 |
+
|
56 |
+
</div>
|
languages/wp-dashboard-notes-nl_NL.mo
ADDED
Binary file
|
languages/wp-dashboard-notes-nl_NL.po
ADDED
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: wp-dashboard-notes\n"
|
4 |
+
"POT-Creation-Date: 2014-08-28 09:06+0100\n"
|
5 |
+
"PO-Revision-Date: 2014-08-28 09:08+0100\n"
|
6 |
+
"Last-Translator: \n"
|
7 |
+
"Language-Team: Jeroen Sormani <info@jeroensormani.com>\n"
|
8 |
+
"Language: nl_NL\n"
|
9 |
+
"MIME-Version: 1.0\n"
|
10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"X-Generator: Poedit 1.5.5\n"
|
13 |
+
"X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e\n"
|
14 |
+
"X-Poedit-Basepath: .\n"
|
15 |
+
"X-Poedit-SearchPath-0: ..\n"
|
16 |
+
|
17 |
+
#: ../wp-dashboard-notes.php:210
|
18 |
+
msgid "Add note"
|
19 |
+
msgstr "Nieuwe notitie"
|
20 |
+
|
21 |
+
#: ../includes/class-note-post-type.php:39
|
22 |
+
msgid "Notes"
|
23 |
+
msgstr "Notities"
|
24 |
+
|
25 |
+
#: ../includes/class-note-post-type.php:40
|
26 |
+
msgid "Note"
|
27 |
+
msgstr "Notitie"
|
28 |
+
|
29 |
+
#: ../includes/class-note-post-type.php:41
|
30 |
+
msgid "Add New"
|
31 |
+
msgstr "Nieuwe toevoegen"
|
32 |
+
|
33 |
+
#: ../includes/class-note-post-type.php:42
|
34 |
+
msgid "Add New Note"
|
35 |
+
msgstr "Nieuwe notitie toevoegen"
|
36 |
+
|
37 |
+
#: ../includes/class-note-post-type.php:43
|
38 |
+
msgid "Edit Note"
|
39 |
+
msgstr "Notitie bewerken"
|
40 |
+
|
41 |
+
#: ../includes/class-note-post-type.php:44
|
42 |
+
msgid "New Note"
|
43 |
+
msgstr "Nieuwe notitie"
|
44 |
+
|
45 |
+
#: ../includes/class-note-post-type.php:45
|
46 |
+
msgid "View Note"
|
47 |
+
msgstr "Bekijk notitie"
|
48 |
+
|
49 |
+
#: ../includes/class-note-post-type.php:46
|
50 |
+
msgid "Search Notes"
|
51 |
+
msgstr "Zoek in notities"
|
52 |
+
|
53 |
+
#: ../includes/class-note-post-type.php:47
|
54 |
+
msgid "No Notes"
|
55 |
+
msgstr "Geen notities"
|
56 |
+
|
57 |
+
#: ../includes/class-note-post-type.php:48
|
58 |
+
msgid "No Notes found in Trash"
|
59 |
+
msgstr "Geen notities gevonden in de prullenbak"
|
60 |
+
|
61 |
+
#: ../includes/class-wpdn-ajax.php:108 ../includes/class-wpdn-ajax.php:128
|
62 |
+
msgid "New note"
|
63 |
+
msgstr "Nieuwe notitie"
|
64 |
+
|
65 |
+
#: ../includes/templates/note-list.php:9
|
66 |
+
msgid "List item"
|
67 |
+
msgstr "Lijst item"
|
68 |
+
|
69 |
+
#: ../includes/templates/note-list.php:16 ../includes/templates/note.php:15
|
70 |
+
msgid "Just me"
|
71 |
+
msgstr "Alleen ik"
|
72 |
+
|
73 |
+
#: ../includes/templates/note-list.php:20 ../includes/templates/note.php:19
|
74 |
+
msgid "Everyone"
|
75 |
+
msgstr "Iedereen"
|
76 |
+
|
77 |
+
#: ../includes/templates/note-list.php:24 ../includes/templates/note.php:23
|
78 |
+
msgid "Visibility:"
|
79 |
+
msgstr "Zichtbaarheid:"
|
80 |
+
|
81 |
+
#: ../includes/templates/note-list.php:28 ../includes/templates/note.php:27
|
82 |
+
msgid "Give me a color!"
|
83 |
+
msgstr "Geef mij een kleur!"
|
84 |
+
|
85 |
+
#: ../includes/templates/note-list.php:41
|
86 |
+
msgid "Convert to regular note"
|
87 |
+
msgstr "Converteer mij naar een normale notitie"
|
88 |
+
|
89 |
+
#: ../includes/templates/note-list.php:45 ../includes/templates/note.php:44
|
90 |
+
msgid "Add a new note"
|
91 |
+
msgstr "Voeg een nieuwe notitie toe"
|
92 |
+
|
93 |
+
#: ../includes/templates/note-list.php:50 ../includes/templates/note.php:48
|
94 |
+
msgid "Delete note"
|
95 |
+
msgstr "Verwijder notitie"
|
96 |
+
|
97 |
+
#: ../includes/templates/note.php:40
|
98 |
+
msgid "Convert to list note"
|
99 |
+
msgstr "Converteer mij naar een lijst notitie"
|
license.txt
ADDED
@@ -0,0 +1,621 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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 2007
|
3 |
+
|
4 |
+
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
5 |
+
Everyone is permitted to copy and distribute verbatim copies
|
6 |
+
of this license document, but changing it is not allowed.
|
7 |
+
|
8 |
+
Preamble
|
9 |
+
|
10 |
+
The GNU General Public License is a free, copyleft license for
|
11 |
+
software and other kinds of works.
|
12 |
+
|
13 |
+
The licenses for most software and other practical works are designed
|
14 |
+
to take away your freedom to share and change the works. By contrast,
|
15 |
+
the GNU General Public License is intended to guarantee your freedom to
|
16 |
+
share and change all versions of a program--to make sure it remains free
|
17 |
+
software for all its users. We, the Free Software Foundation, use the
|
18 |
+
GNU General Public License for most of our software; it applies also to
|
19 |
+
any other work released this way by its authors. You can apply it to
|
20 |
+
your programs, too.
|
21 |
+
|
22 |
+
When we speak of free software, we are referring to freedom, not
|
23 |
+
price. Our General Public Licenses are designed to make sure that you
|
24 |
+
have the freedom to distribute copies of free software (and charge for
|
25 |
+
them if you wish), that you receive source code or can get it if you
|
26 |
+
want it, that you can change the software or use pieces of it in new
|
27 |
+
free programs, and that you know you can do these things.
|
28 |
+
|
29 |
+
To protect your rights, we need to prevent others from denying you
|
30 |
+
these rights or asking you to surrender the rights. Therefore, you have
|
31 |
+
certain responsibilities if you distribute copies of the software, or if
|
32 |
+
you modify it: responsibilities to respect the freedom of others.
|
33 |
+
|
34 |
+
For example, if you distribute copies of such a program, whether
|
35 |
+
gratis or for a fee, you must pass on to the recipients the same
|
36 |
+
freedoms that you received. You must make sure that they, too, receive
|
37 |
+
or can get the source code. And you must show them these terms so they
|
38 |
+
know their rights.
|
39 |
+
|
40 |
+
Developers that use the GNU GPL protect your rights with two steps:
|
41 |
+
(1) assert copyright on the software, and (2) offer you this License
|
42 |
+
giving you legal permission to copy, distribute and/or modify it.
|
43 |
+
|
44 |
+
For the developers' and authors' protection, the GPL clearly explains
|
45 |
+
that there is no warranty for this free software. For both users' and
|
46 |
+
authors' sake, the GPL requires that modified versions be marked as
|
47 |
+
changed, so that their problems will not be attributed erroneously to
|
48 |
+
authors of previous versions.
|
49 |
+
|
50 |
+
Some devices are designed to deny users access to install or run
|
51 |
+
modified versions of the software inside them, although the manufacturer
|
52 |
+
can do so. This is fundamentally incompatible with the aim of
|
53 |
+
protecting users' freedom to change the software. The systematic
|
54 |
+
pattern of such abuse occurs in the area of products for individuals to
|
55 |
+
use, which is precisely where it is most unacceptable. Therefore, we
|
56 |
+
|