Version Description
26/08/2015 =
Improvement - Optimize JavaScripts and stylesheets
Fix - Firefox users not able to use new regular note
Download this release
Release Info
Developer | sormano |
Plugin | WP Dashboard Notes |
Version | 1.0.6 |
Comparing to | |
See all releases |
Version 1.0.6
- assets/css/wp-dashboard-notes-admin.min.css +1 -0
- assets/css/wp-dashboard-notes-admin.scss +347 -0
- assets/js/wp-dashboard-notes-admin.js +245 -0
- assets/js/wp-dashboard-notes-admin.min.js +1 -0
- includes/class-note-post-type.php +70 -0
- includes/class-wpdn-ajax.php +197 -0
- includes/templates/note-list.php +56 -0
- includes/templates/note.php +54 -0
- languages/wp-dashboard-notes-nl_NL.mo +0 -0
- languages/wp-dashboard-notes-nl_NL.po +99 -0
- languages/wp-dashboard-notes-ru_RU.mo +0 -0
- languages/wp-dashboard-notes-ru_RU.po +134 -0
- license.txt +621 -0
- readme.txt +184 -0
- screenshot-1.png +0 -0
- screenshot-2.png +0 -0
- screenshot-3.png +0 -0
- wp-dashboard-notes.php +346 -0
assets/css/wp-dashboard-notes-admin.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
input[type=text].add-list-item{line-height:normal;border-radius:3px;height:35px;padding:5px 10px;width:75%;border-color:#555;background-color:rgba(255,255,255,0.6)}input[type=text].add-list-item::-webkit-input-placeholder{color:#555}input[type=text].add-list-item:-moz-placeholder{color:#555}input[type=text].add-list-item::-moz-placeholder{color:#555}input[type=text].add-list-item:-ms-input-placeholder{color:#555}.wp-dashboard-note{line-height:1.5;font-size:14px;min-height:30px}.wp-dashboard-note-wrap{padding-bottom:40px}.wp-dashboard-note-options{text-align:left}.list-note .wp-dashboard-note-options{margin-top:15px}.wp-dashboard-note .list-item{min-height:30px;line-height:30px;width:100%;display:block}.wp-dashboard-note div:last-child{border-bottom:0}.wpdn-note-sortable{color:#6f6f6f;margin-right:5px;cursor:move;line-height:inherit;opacity:0}.list-item:hover .wpdn-note-sortable{opacity:1}.list-item .dashicons-no-alt{color:rgba(0,0,0,0.3);text-align:right;float:right;cursor:pointer;line-height:inherit}.list-item input[type=checkbox]{margin-right:15px;background:transparent;border-color:#555}.list-item input[type=checkbox]:checked:before{color:#555}.list-item input[type=checkbox]:checked ~ span{text-decoration:line-through;color:#6f6f6f}.list-item .dashicons-no-alt:hover{color:#999}.list-item:hover .dashicons-no-alt{visibility:visible}.list-item .dashicons-no-alt{visibility:hidden}.wp-dashboard-note-wrap .wpdn-add-item{line-height:2}.list-item .wpdn-add-item{color:#ccc;margin-right:8px}.list-item-content{line-height:1}.wp-dashboard-note-wrap:hover .wpdn-extra{opacity:1}.wpdn-extra{background:rgba(76,76,76,0.9);position:absolute;opacity:0;width:100%;left:0;bottom:0;height:40px;padding-left:12px;box-sizing:border-box;-webkit-transition:opacity 0.3s ease-in-out;transition:opacity 0.2s ease-in-out}.wpdn-extra *{color:#fff}.wpdn-extra .dashicons:hover{color:#ccc;cursor:pointer}[data-note-type=list] .saved-icon .dashicons,.wpdn-extra .dashicons{line-height:2}.wpdn-extra .dashicons{margin-left:5px}[data-note-type=regular] .saved-icon .dashicons{line-height:1}.hndle span{cursor:text;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;-o-user-select:text;user-select:text}h3.hndle .wpdn-edit-title{display:none;height:19px;color:#222;cursor:pointer;margin-left:5px}h3.hndle:hover .dashicons{display:inline-block}[id^=note_] .handlediv{color:#222;color:transparent}.wp-dashboard-note-wrap a{position:relative}.wp-dashboard-note-wrap :focus{outline:none}.link-hover{background:rgba(76,76,76,0.9);position:absolute;left:0px;top:1.6em;padding:5px;border-radius:4px;font-size:12px;z-index:99;min-width:55px;text-align:center}.link-hover a{color:white}.hndle .status{float:right}.saving-icon img{vertical-align:middle}.saved-icon,.saving-icon{color:#222;font-weight:normal;font-size:13px}[for=add_note-hide]{float:right;padding-left:10px;margin-left:2px}[for=add_note-hide] input{display:none}[for=add_note-hide]::before{content:"\f132";font-family:dashicons;vertical-align:middle;font-size:18px;margin-right:5px}[for=add_note-hide]:hover{color:#fff;background:#333}.metabox-prefs .wpdn-edit-title.dashicons-edit{display:none}span.wpdn-color-note:hover .wpdn-color-palette{display:inline-block}.wpdn-color-palette{min-width:50px;width:auto;padding:4px 8px 2px 8px;margin-left:-8px;position:absolute;top:-24px;background-color:rgba(76,76,76,0.9);height:18px;display:none}.color{width:10px;height:10px;border:1px solid transparent;margin:2.5px;display:inline-block}.color:hover{border:1px solid #ccc;cursor:pointer}.color-white{background-color:#ffffff}.color-red{background-color:#f7846a}.color-orange{background-color:#ffbd22}.color-yellow{background-color:#eeee22}.color-blue{background-color:#66ccdd}.color-green{background-color:#bbe535}.color-black{background-color:#777777}[data-color-text=black]{color:white}[data-color-text=black] .wpdn-note-sortable{color:white}[data-color-text=black] .wpdn-add-item{color:white}[data-color-text=black] .wp-dashboard-note .list-item{border-color:white}[data-color-text=black] input[type=checkbox]{border:1px solid white}[data-color-text=black] .list-item input[type=checkbox]:checked ~ span{color:white}[data-color-text=black] [id^=note] .handlediv{color:white}[data-color-text=black] input[type=text].add-list-item{border-color:#FFF;color:#FFF;background:rgba(255,255,255,0.3)}[data-color-text=black] input[type=text].add-list-item::-webkit-input-placeholder{color:white}[data-color-text=black] input[type=text].add-list-item:-moz-placeholder{color:white}[data-color-text=black] input[type=text].add-list-item::-moz-placeholder{color:white}[data-color-text=black] input[type=text].add-list-item:-ms-input-placeholder{color:white}[data-color-text=black] .saved-icon,[data-color-text=black] .saving-icon{color:white}[data-color-text=template]{color:inherit}[data-color-text=template] .wpdn-note-sortable{color:inherit}[data-color-text=template] .wpdn-add-item{color:inherit}[data-color-text=template] .wp-dashboard-note .list-item{border-color:inherit}[data-color-text=template] input[type=checkbox]{border:1px solid inherit}[data-color-text=template] .list-item input[type=checkbox]:checked ~ span{color:inherit}[data-color-text=template] [id^=note] .handlediv{color:inherit}[data-color-text=template] input[type=text].add-list-item{border-color:inherit;color:inherit;background:inherit}[data-color-text=template] input[type=text].add-list-item::-webkit-input-placeholder{color:inherit}[data-color-text=template] input[type=text].add-list-item:-moz-placeholder{color:inherit}[data-color-text=template] input[type=text].add-list-item::-moz-placeholder{color:inherit}[data-color-text=template] input[type=text].add-list-item:-ms-input-placeholder{color:inherit}[data-color-text=template] .saved-icon,[data-color-text=template] .saving-icon{color:inherit}
|
assets/css/wp-dashboard-notes-admin.scss
ADDED
@@ -0,0 +1,347 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
min-height: 30px;
|
28 |
+
}
|
29 |
+
.wp-dashboard-note-wrap {
|
30 |
+
padding-bottom: 40px;
|
31 |
+
}
|
32 |
+
|
33 |
+
.wp-dashboard-note-options {
|
34 |
+
text-align: left;
|
35 |
+
}
|
36 |
+
.list-note .wp-dashboard-note-options {
|
37 |
+
margin-top: 15px;
|
38 |
+
}
|
39 |
+
|
40 |
+
.wp-dashboard-note .list-item {
|
41 |
+
min-height: 30px;
|
42 |
+
line-height: 30px;
|
43 |
+
width: 100%;
|
44 |
+
display: block;
|
45 |
+
}
|
46 |
+
.wp-dashboard-note div:last-child {
|
47 |
+
border-bottom: 0;
|
48 |
+
}
|
49 |
+
|
50 |
+
/* Sortable */
|
51 |
+
.wpdn-note-sortable {
|
52 |
+
color: #6f6f6f;
|
53 |
+
margin-right: 5px;
|
54 |
+
cursor: move;
|
55 |
+
line-height: inherit;
|
56 |
+
opacity: 0;
|
57 |
+
}
|
58 |
+
.list-item:hover .wpdn-note-sortable {
|
59 |
+
opacity: 1;
|
60 |
+
}
|
61 |
+
.list-item .dashicons-no-alt {
|
62 |
+
color: rgba( 0, 0, 0, 0.3 );
|
63 |
+
text-align: right;
|
64 |
+
float: right;
|
65 |
+
cursor: pointer;
|
66 |
+
line-height: inherit;
|
67 |
+
}
|
68 |
+
.list-item input[type=checkbox] {
|
69 |
+
margin-right: 15px;
|
70 |
+
background: transparent;
|
71 |
+
border-color: #555;
|
72 |
+
}
|
73 |
+
.list-item input[type=checkbox]:checked:before {
|
74 |
+
color: #555;
|
75 |
+
}
|
76 |
+
.list-item input[type=checkbox]:checked ~ span {
|
77 |
+
text-decoration:line-through;
|
78 |
+
color: #6f6f6f;
|
79 |
+
}
|
80 |
+
.list-item .dashicons-no-alt:hover {
|
81 |
+
color: #999;
|
82 |
+
}
|
83 |
+
.list-item:hover .dashicons-no-alt {
|
84 |
+
visibility: visible;
|
85 |
+
}
|
86 |
+
.list-item .dashicons-no-alt {
|
87 |
+
visibility: hidden;
|
88 |
+
}
|
89 |
+
.wp-dashboard-note-wrap .wpdn-add-item {
|
90 |
+
line-height: 2;
|
91 |
+
}
|
92 |
+
.list-item .wpdn-add-item {
|
93 |
+
color: #ccc;
|
94 |
+
margin-right: 8px;
|
95 |
+
}
|
96 |
+
.list-item-content {
|
97 |
+
line-height: 1;
|
98 |
+
}
|
99 |
+
|
100 |
+
.wp-dashboard-note-wrap:hover .wpdn-extra {
|
101 |
+
opacity: 1;
|
102 |
+
}
|
103 |
+
.wpdn-extra {
|
104 |
+
background: rgba( 76, 76, 76, 0.9 );
|
105 |
+
position: absolute;
|
106 |
+
opacity: 0;
|
107 |
+
width: 100%;
|
108 |
+
left: 0;
|
109 |
+
bottom: 0;
|
110 |
+
height: 40px;
|
111 |
+
padding-left: 12px;
|
112 |
+
box-sizing: border-box;
|
113 |
+
-webkit-transition: opacity 0.3s ease-in-out;
|
114 |
+
transition: opacity 0.2s ease-in-out;
|
115 |
+
}
|
116 |
+
.wpdn-extra * {
|
117 |
+
color: #fff;
|
118 |
+
}
|
119 |
+
.wpdn-extra .dashicons:hover {
|
120 |
+
color: #ccc;
|
121 |
+
cursor: pointer;
|
122 |
+
}
|
123 |
+
[data-note-type=list] .saved-icon .dashicons,
|
124 |
+
.wpdn-extra .dashicons {
|
125 |
+
line-height: 2;
|
126 |
+
}
|
127 |
+
.wpdn-extra .dashicons {
|
128 |
+
margin-left: 5px;
|
129 |
+
}
|
130 |
+
[data-note-type=regular] .saved-icon .dashicons {
|
131 |
+
line-height: 1;
|
132 |
+
}
|
133 |
+
.hndle span {
|
134 |
+
cursor: text;
|
135 |
+
-webkit-user-select: text;
|
136 |
+
-moz-user-select: text;
|
137 |
+
-ms-user-select: text;
|
138 |
+
-o-user-select: text;
|
139 |
+
user-select: text;
|
140 |
+
}
|
141 |
+
h3.hndle .wpdn-edit-title {
|
142 |
+
display: none;
|
143 |
+
height: 19px;
|
144 |
+
color: #222;
|
145 |
+
cursor: pointer;
|
146 |
+
margin-left: 5px;
|
147 |
+
}
|
148 |
+
h3.hndle:hover .dashicons {
|
149 |
+
display: inline-block;
|
150 |
+
}
|
151 |
+
[id^=note_] .handlediv {
|
152 |
+
color: #222;
|
153 |
+
color: transparent;
|
154 |
+
}
|
155 |
+
|
156 |
+
/* Open Link */
|
157 |
+
.wp-dashboard-note-wrap a {
|
158 |
+
position: relative;
|
159 |
+
}
|
160 |
+
.wp-dashboard-note-wrap :focus {
|
161 |
+
outline: none;
|
162 |
+
}
|
163 |
+
.link-hover {
|
164 |
+
background: rgba(76, 76, 76, 0.9);
|
165 |
+
position: absolute;
|
166 |
+
left: 0px;
|
167 |
+
top: 1.6em;
|
168 |
+
padding: 5px;
|
169 |
+
border-radius: 4px;
|
170 |
+
font-size: 12px;
|
171 |
+
z-index: 99;
|
172 |
+
min-width: 55px;
|
173 |
+
text-align: center;
|
174 |
+
}
|
175 |
+
.link-hover a {
|
176 |
+
color: white;
|
177 |
+
}
|
178 |
+
|
179 |
+
/* Saving */
|
180 |
+
.hndle .status {
|
181 |
+
float: right;
|
182 |
+
}
|
183 |
+
.saving-icon img {
|
184 |
+
vertical-align: middle;
|
185 |
+
}
|
186 |
+
.saved-icon,
|
187 |
+
.saving-icon {
|
188 |
+
color: #222;
|
189 |
+
font-weight: normal;
|
190 |
+
font-size: 13px;
|
191 |
+
}
|
192 |
+
|
193 |
+
/* Add button screen options */
|
194 |
+
[for=add_note-hide] {
|
195 |
+
float: right;
|
196 |
+
padding-left: 10px;
|
197 |
+
margin-left: 2px;
|
198 |
+
}
|
199 |
+
[for=add_note-hide] input {
|
200 |
+
display: none;
|
201 |
+
}
|
202 |
+
[for=add_note-hide]::before {
|
203 |
+
content: "\f132";
|
204 |
+
font-family: dashicons;
|
205 |
+
vertical-align: middle;
|
206 |
+
font-size: 18px;
|
207 |
+
margin-right: 5px;
|
208 |
+
}
|
209 |
+
[for=add_note-hide]:hover {
|
210 |
+
color: #fff;
|
211 |
+
background: #333;
|
212 |
+
}
|
213 |
+
/* Hide pencil at screen options titles */
|
214 |
+
.metabox-prefs .wpdn-edit-title.dashicons-edit {
|
215 |
+
display: none;
|
216 |
+
}
|
217 |
+
|
218 |
+
/****************************
|
219 |
+
* Colors
|
220 |
+
****************************/
|
221 |
+
span.wpdn-color-note:hover .wpdn-color-palette {
|
222 |
+
display: inline-block;
|
223 |
+
}
|
224 |
+
.wpdn-color-palette {
|
225 |
+
min-width: 50px;
|
226 |
+
width: auto;
|
227 |
+
padding: 4px 8px 2px 8px;
|
228 |
+
margin-left: -8px;
|
229 |
+
position: absolute;
|
230 |
+
top: -24px;
|
231 |
+
background-color: rgba(76, 76, 76, 0.9);
|
232 |
+
height: 18px;
|
233 |
+
display: none;
|
234 |
+
}
|
235 |
+
|
236 |
+
.color {
|
237 |
+
width: 10px;
|
238 |
+
height: 10px;
|
239 |
+
border: 1px solid transparent;
|
240 |
+
margin: 2.5px;
|
241 |
+
display: inline-block;
|
242 |
+
}
|
243 |
+
.color:hover {
|
244 |
+
border: 1px solid #ccc;
|
245 |
+
cursor: pointer;
|
246 |
+
}
|
247 |
+
.color-white { background-color: #ffffff; }
|
248 |
+
.color-red { background-color: #f7846a; }
|
249 |
+
.color-orange { background-color: #ffbd22; }
|
250 |
+
.color-yellow { background-color: #eeee22; }
|
251 |
+
.color-blue { background-color: #66ccdd; }
|
252 |
+
.color-green { background-color: #bbe535; }
|
253 |
+
.color-black { background-color: #777777; }
|
254 |
+
|
255 |
+
/****************************
|
256 |
+
* Black
|
257 |
+
****************************/
|
258 |
+
[data-color-text=black] {
|
259 |
+
color: white;
|
260 |
+
}
|
261 |
+
[data-color-text=black] .wpdn-note-sortable {
|
262 |
+
color: white;
|
263 |
+
}
|
264 |
+
[data-color-text=black] .wpdn-add-item {
|
265 |
+
color: white;
|
266 |
+
}
|
267 |
+
[data-color-text=black] .wp-dashboard-note .list-item {
|
268 |
+
border-color: white;
|
269 |
+
}
|
270 |
+
[data-color-text=black] input[type=checkbox] {
|
271 |
+
border: 1px solid white;
|
272 |
+
}
|
273 |
+
[data-color-text=black] .list-item input[type=checkbox]:checked ~ span {
|
274 |
+
color: white;
|
275 |
+
}
|
276 |
+
[data-color-text=black] [id^=note] .handlediv {
|
277 |
+
color: white;
|
278 |
+
}
|
279 |
+
[data-color-text=black] input[type=text].add-list-item {
|
280 |
+
border-color: #FFF;
|
281 |
+
color: #FFF;
|
282 |
+
background: rgba(255, 255, 255, 0.3);
|
283 |
+
}
|
284 |
+
[data-color-text=black] input[type=text].add-list-item::-webkit-input-placeholder {
|
285 |
+
color: white;
|
286 |
+
}
|
287 |
+
[data-color-text=black] input[type=text].add-list-item:-moz-placeholder {
|
288 |
+
color: white;
|
289 |
+
}
|
290 |
+
[data-color-text=black] input[type=text].add-list-item::-moz-placeholder {
|
291 |
+
color: white;
|
292 |
+
}
|
293 |
+
[data-color-text=black] input[type=text].add-list-item:-ms-input-placeholder {
|
294 |
+
color: white;
|
295 |
+
}
|
296 |
+
[data-color-text=black] .saved-icon,
|
297 |
+
[data-color-text=black] .saving-icon {
|
298 |
+
color: white;
|
299 |
+
}
|
300 |
+
|
301 |
+
|
302 |
+
|
303 |
+
/****************************
|
304 |
+
* Template
|
305 |
+
****************************/
|
306 |
+
[data-color-text=template] {
|
307 |
+
color: inherit;
|
308 |
+
}
|
309 |
+
[data-color-text=template] .wpdn-note-sortable {
|
310 |
+
color: inherit;
|
311 |
+
}
|
312 |
+
[data-color-text=template] .wpdn-add-item {
|
313 |
+
color: inherit;
|
314 |
+
}
|
315 |
+
[data-color-text=template] .wp-dashboard-note .list-item {
|
316 |
+
border-color: inherit;
|
317 |
+
}
|
318 |
+
[data-color-text=template] input[type=checkbox] {
|
319 |
+
border: 1px solid inherit;
|
320 |
+
}
|
321 |
+
[data-color-text=template] .list-item input[type=checkbox]:checked ~ span {
|
322 |
+
color: inherit;
|
323 |
+
}
|
324 |
+
[data-color-text=template] [id^=note] .handlediv {
|
325 |
+
color: inherit;
|
326 |
+
}
|
327 |
+
[data-color-text=template] input[type=text].add-list-item {
|
328 |
+
border-color: inherit;
|
329 |
+
color: inherit;
|
330 |
+
background: inherit;
|
331 |
+
}
|
332 |
+
[data-color-text=template] input[type=text].add-list-item::-webkit-input-placeholder {
|
333 |
+
color: inherit;
|
334 |
+
}
|
335 |
+
[data-color-text=template] input[type=text].add-list-item:-moz-placeholder {
|
336 |
+
color: inherit;
|
337 |
+
}
|
338 |
+
[data-color-text=template] input[type=text].add-list-item::-moz-placeholder {
|
339 |
+
color: inherit;
|
340 |
+
}
|
341 |
+
[data-color-text=template] input[type=text].add-list-item:-ms-input-placeholder {
|
342 |
+
color: inherit;
|
343 |
+
}
|
344 |
+
[data-color-text=template] .saved-icon,
|
345 |
+
[data-color-text=template] .saving-icon {
|
346 |
+
color: inherit;
|
347 |
+
}
|
assets/js/wp-dashboard-notes-admin.js
ADDED
@@ -0,0 +1,245 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery( document ).ready( function($) {
|
2 |
+
|
3 |
+
var loading_icon = '<span class="saving-icon"><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-admin-users 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 + ' .hndle .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 + ' .hndle .status' ).html( saved_icon );
|
108 |
+
$( '#' + post_id + ' .hndle .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 |
+
$( this ).closest( '[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 |
+
|
205 |
+
|
206 |
+
// Note checkbox toggle
|
207 |
+
$( 'input[type=checkbox]' ).change( function() {
|
208 |
+
if( this.checked ) {
|
209 |
+
$( this ).attr( 'checked', 'checked' );
|
210 |
+
} else {
|
211 |
+
$( this ).removeAttr( 'checked' );
|
212 |
+
}
|
213 |
+
$( this ).trigger( 'wpdn-update', this );
|
214 |
+
});
|
215 |
+
|
216 |
+
|
217 |
+
// Make list sortable
|
218 |
+
$( 'body' ).on( 'note-sortable', function() {
|
219 |
+
$( '.wp-dashboard-note' ).sortable({
|
220 |
+
handle: '.wpdn-note-sortable',
|
221 |
+
update: function( event, ui ) {
|
222 |
+
$( this ).trigger( 'wpdn-update', this );
|
223 |
+
},
|
224 |
+
connectWith: ['.wp-dashboard-note'],
|
225 |
+
axis: 'y'
|
226 |
+
});
|
227 |
+
})
|
228 |
+
.trigger( 'note-sortable' );
|
229 |
+
|
230 |
+
|
231 |
+
// Open link box when hovering a link
|
232 |
+
$( '.wp-dashboard-note-wrap a' ).hover( function() {
|
233 |
+
$( this ).append( '<span class="link-hover" contenteditable="false"><a href="' + $( this ).attr( 'href' ) + '" target="_blank" contenteditable="false">Open link</a></span>' );
|
234 |
+
}, function() {
|
235 |
+
$( '.link-hover' ).remove();
|
236 |
+
});
|
237 |
+
|
238 |
+
// Prevent background color and other style from copying from one note to the other
|
239 |
+
$( 'body' ).on('paste', '[contenteditable]', function (e) {
|
240 |
+
e.preventDefault();
|
241 |
+
var text = (e.originalEvent || e).clipboardData.getData('text/plain');
|
242 |
+
document.execCommand('insertText', false, text);
|
243 |
+
});
|
244 |
+
|
245 |
+
});
|
assets/js/wp-dashboard-notes-admin.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery(document).ready(function($){var t='<span class="saving-icon"><img src="images/wpspin_light.gif"/> saving...</span>',e='<span class="saved-icon"><div class="dashicons dashicons-yes"></div> saved!</span>';$("body, .list-item-content").on("keydown",".add-list-item",function(t){if(13==t.keyCode&&""!=$(this).val()){var e=$(this).closest(".postbox").attr("id"),o='<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>';$("#"+e+" div.wp-dashboard-note").append(o),$(this).val(""),$(this).trigger("note-sortable"),$(this).trigger("wpdn-update",this)}}),$("body").on("click",".delete-item",function(){var t=$(this).closest(".postbox").attr("id");$(this).parent(".list-item").remove(),$("body").trigger("wpdn-update",["",t])}),$("body").on("click",".wpdn-visibility",function(){$(this).toggleClass("dashicons-admin-users dashicons-groups");var t=$(this).parent().attr("data-visibility");"public"==t?($(this).parent(".wpdn-toggle-visibility").attr("data-visibility","private"),$(this).parent(".wpdn-toggle-visibility").attr("title","Visibility: Just me")):($(this).parent(".wpdn-toggle-visibility").attr("data-visibility","public"),$(this).parent(".wpdn-toggle-visibility").attr("title","Visibility: Everyone")),$(this).trigger("wpdn-update",this)}),$("body").on("click",".wpdn-note-type",function(){$(this).toggleClass("dashicons-list-view dashicons-welcome-write-blog");var t=$(this).closest("[data-note-type]").attr("data-note-type");"regular"==t?$(this).closest("[data-note-type]").attr("data-note-type","list"):$(this).closest("[data-note-type]").attr("data-note-type","regular");var e={action:"wpdn_toggle_note",post_id:$(this).closest(".postbox").attr("id").replace("note_",""),note_type:"regular"==t?"list":"regular"};$.post(ajaxurl,e,function(t){$("#note_"+e.post_id+" .inside").html(t).trigger("note-sortable")}),$(this).trigger("wpdn-update",this)}),$("body").on("wpdn-update",function(o,i,n){if(""!=i&&(n=$(i).closest(".postbox").attr("id")),n){$("#"+n+" .hndle .status").html(t);var a={action:"wpdn_update_note",post_id:n.replace("note_",""),post_content:$("#"+n+" div.wp-dashboard-note").html(),post_title:$("#"+n+" > h3 .wpdn-title").html(),note_visibility:$("#"+n+" [data-visibility]").attr("data-visibility"),note_color_text:$("#"+n+" [data-color-text]").attr("data-color-text"),note_color:$("#"+n+" [data-note-color]").attr("data-note-color"),note_type:$("#"+n+" [data-note-type]").attr("data-note-type")};$.post(ajaxurl,a,function(t){$("#"+n+" .hndle .status").html(e),$("#"+n+" .hndle .status *").fadeOut(1e3,function(){$(this).html("")})})}}),$("body").on("click",".wpdn-delete-note",function(){var t=$(this).closest(".postbox").attr("id");$("#"+t).fadeOut(500,function(){$(this).remove()});var e={action:"wpdn_delete_note",post_id:t.replace("note_","")};$.post(ajaxurl,e,function(t){})}),$("body").on("click",".wpdn-add-note, #add_note-hide",function(){var t={action:"wpdn_add_note"};$.post(ajaxurl,t,function(t){t=jQuery.parseJSON(t),jQuery("#postbox-container-1 #normal-sortables").append(t.note),jQuery("body, html").animate({scrollTop:$("#note_"+t.post_id).offset().top-50},750),jQuery("#note_"+t.post_id+" .add-list-item").focus()}),$("html, body").bind("scroll mousedown DOMMouseScroll mousewheel keyup",function(t){(t.which>0||"mousedown"===t.type||"mousewheel"===t.type)&&$("html, body").stop().unbind("scroll mousedown DOMMouseScroll mousewheel keyup")})}),$("body").on("click",".color",function(){var t=$(this).attr("data-select-color"),e=$(this).attr("data-select-color-text");$(this).closest(".postbox").css("background-color",t),$(this).closest(".wp-dashboard-note-wrap").attr("data-color-text",e),$(this).closest("[data-note-color]").attr("data-note-color",t),$(this).closest("[data-color-text]").attr("data-color-text",e),$(this).trigger("wpdn-update",this)}),$("body").on("blur",".list-item-content, [contenteditable=true]",function(){$(this).trigger("wpdn-update",this)}),$("body").on("keydown","[data-note-type=list], .wpdn-title, .list-item-content",function(t){return 13==t.keyCode?($(this).trigger("wpdn-update",this),$(this).blur(),!1):void 0}),$("body").on("keydown","[data-note-type=regular] .wp-dashboard-note",function(t){return 13==t.keyCode&&(t.ctrlKey||t.metaKey)?($(this).trigger("wpdn-update",this),$(this).blur(),!1):void 0}),$("body, .postbox h3").on("click",".wpdn-edit-title",function(t){$(this).prev().focus(),document.execCommand("selectAll",!1,null),t.stopPropagation()}),$("input[type=checkbox]").change(function(){this.checked?$(this).attr("checked","checked"):$(this).removeAttr("checked"),$(this).trigger("wpdn-update",this)}),$("body").on("note-sortable",function(){$(".wp-dashboard-note").sortable({handle:".wpdn-note-sortable",update:function(t,e){$(this).trigger("wpdn-update",this)},axis:"y"})}).trigger("note-sortable"),$(".wp-dashboard-note-wrap a").hover(function(){$(this).append('<span class="link-hover" contenteditable="false"><a href="'+$(this).attr("href")+'" target="_blank" contenteditable="false">Open link</a></span>')},function(){$(".link-hover").remove()}),$("body").on("paste","[contenteditable]",function(t){t.preventDefault();var e=(t.originalEvent||t).clipboardData.getData("text/plain");document.execCommand("insertText",!1,e)})});
|
includes/class-note-post-type.php
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* Constructor.
|
19 |
+
*
|
20 |
+
* @since 1.0.0
|
21 |
+
*/
|
22 |
+
public function __construct() {
|
23 |
+
|
24 |
+
// Register post type
|
25 |
+
add_action( 'init', array( $this, 'register_post_type' ) );
|
26 |
+
|
27 |
+
}
|
28 |
+
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Register post type.
|
32 |
+
*
|
33 |
+
* Register and set settings for post type 'note'.
|
34 |
+
*
|
35 |
+
* @since 1.0.0
|
36 |
+
*/
|
37 |
+
public function register_post_type() {
|
38 |
+
|
39 |
+
$labels = array(
|
40 |
+
'name' => __( 'Notes', 'wp-dashboard-notes' ),
|
41 |
+
'singular_name' => __( 'Note', 'wp-dashboard-notes' ),
|
42 |
+
'add_new' => __( 'Add New', 'wp-dashboard-notes' ),
|
43 |
+
'add_new_item' => __( 'Add New Note', 'wp-dashboard-notes' ),
|
44 |
+
'edit_item' => __( 'Edit Note', 'wp-dashboard-notes' ),
|
45 |
+
'new_item' => __( 'New Note', 'wp-dashboard-notes' ),
|
46 |
+
'view_item' => __( 'View Note', 'wp-dashboard-notes' ),
|
47 |
+
'search_items' => __( 'Search Notes', 'wp-dashboard-notes' ),
|
48 |
+
'not_found' => __( 'No Notes', 'wp-dashboard-notes' ),
|
49 |
+
'not_found_in_trash' => __( 'No Notes found in Trash', 'wp-dashboard-notes' ),
|
50 |
+
);
|
51 |
+
|
52 |
+
register_post_type( 'note', array(
|
53 |
+
'label' => 'note',
|
54 |
+
'show_ui' => false,
|
55 |
+
'show_in_menu' => false,
|
56 |
+
'capability_type' => 'post',
|
57 |
+
'map_meta_cap' => true,
|
58 |
+
'rewrite' => array( 'slug' => 'notes' ),
|
59 |
+
'_builtin' => false,
|
60 |
+
'query_var' => true,
|
61 |
+
'supports' => array( 'title', 'editor' ),
|
62 |
+
'labels' => $labels,
|
63 |
+
) );
|
64 |
+
|
65 |
+
}
|
66 |
+
|
67 |
+
}
|
68 |
+
|
69 |
+
// Backwards compatibility
|
70 |
+
$GLOBALS['wpdn_post_type'] = WP_Dashboard_Notes()->post_type;
|
includes/class-wpdn-ajax.php
ADDED
@@ -0,0 +1,197 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* Constructor.
|
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 |
+
$content = apply_filters( 'wpdn_content', $note->post_content );
|
78 |
+
$colors = apply_filters( 'wpdn_colors', array(
|
79 |
+
'white' => '#fff',
|
80 |
+
'red' => '#f7846a',
|
81 |
+
'orange' => '#ffbd22',
|
82 |
+
'yellow' => '#eeee22',
|
83 |
+
'green' => '#bbe535',
|
84 |
+
'blue' => '#66ccdd',
|
85 |
+
'black' => '#777777',
|
86 |
+
) );
|
87 |
+
$note_meta = WP_Dashboard_Notes::wpdn_get_note_meta( $note->ID );
|
88 |
+
|
89 |
+
?>
|
90 |
+
<style>
|
91 |
+
#note_<?php echo $note->ID; ?> { background-color: <?php echo $note_meta['color']; ?>; }
|
92 |
+
#note_<?php echo $note->ID; ?> .hndle { border: none; }
|
93 |
+
</style>
|
94 |
+
<?php
|
95 |
+
if ( $_POST['note_type'] == 'regular' ) :
|
96 |
+
require plugin_dir_path( __FILE__ ) . 'templates/note.php';
|
97 |
+
else :
|
98 |
+
require plugin_dir_path( __FILE__ ) . 'templates/note-list.php';
|
99 |
+
endif;
|
100 |
+
|
101 |
+
die();
|
102 |
+
|
103 |
+
}
|
104 |
+
|
105 |
+
|
106 |
+
/**
|
107 |
+
* Add new note.
|
108 |
+
*
|
109 |
+
* Create a new note, return two variables (post ID | note content) to jQuery through json_encode.
|
110 |
+
*
|
111 |
+
* @since 1.0.0
|
112 |
+
*/
|
113 |
+
public function wpdn_add_note() {
|
114 |
+
|
115 |
+
$args = array(
|
116 |
+
'post_status' => 'publish',
|
117 |
+
'post_type' => 'note',
|
118 |
+
'post_title' => __( 'New note', 'wp-dashboard-notes' ),
|
119 |
+
);
|
120 |
+
$post_id = wp_insert_post( $args );
|
121 |
+
|
122 |
+
$note = (object) array( 'ID' => $post_id, 'post_content' => '' );
|
123 |
+
$note_meta = apply_filters( 'wpdn_new_note_meta', array(
|
124 |
+
'color' => '#ffffff',
|
125 |
+
'color_text' => 'white',
|
126 |
+
'visibility' => 'Everyone',
|
127 |
+
'note_type' => 'list',
|
128 |
+
) );
|
129 |
+
$content = apply_filters( 'wpdn_content', $note->post_content );
|
130 |
+
$colors = apply_filters( 'wpdn_colors', array(
|
131 |
+
'white' => '#fff',
|
132 |
+
'red' => '#f7846a',
|
133 |
+
'orange' => '#ffbd22',
|
134 |
+
'yellow' => '#eeee22',
|
135 |
+
'green' => '#bbe535',
|
136 |
+
'blue' => '#66ccdd',
|
137 |
+
'black' => '#777777',
|
138 |
+
) );
|
139 |
+
$note_meta = apply_filters( 'wpdn_new_note_meta', $note_meta );
|
140 |
+
update_post_meta( $post_id, '_note', $note_meta );
|
141 |
+
|
142 |
+
ob_start(); ?>
|
143 |
+
|
144 |
+
<div id='note_<?php echo $post_id; ?>' class='postbox'>
|
145 |
+
<div class='handlediv' title='Click to toggle'><br></div>
|
146 |
+
<h3 class="hndle">
|
147 |
+
<span>
|
148 |
+
<span contenteditable="true" class="wpdn-title"><?php _e( 'New note', 'wp-dashboard-notes' ); ?></span>
|
149 |
+
<div class="wpdn-edit-title dashicons dashicons-edit"></div>
|
150 |
+
<span class="status"></span>
|
151 |
+
</span>
|
152 |
+
</h3>
|
153 |
+
|
154 |
+
<div class='inside'>
|
155 |
+
|
156 |
+
<style>
|
157 |
+
#note_<?php echo $post_id; ?> { background-color: <?php echo $note_meta['color']; ?>; }
|
158 |
+
#note_<?php echo $post_id; ?> .hndle { border: none; }
|
159 |
+
</style>
|
160 |
+
|
161 |
+
<?php if ( 'regular' == $note_meta['note_type'] ) :
|
162 |
+
require plugin_dir_path( __FILE__ ) . 'templates/note.php';
|
163 |
+
else :
|
164 |
+
require plugin_dir_path( __FILE__ ) . 'templates/note-list.php';
|
165 |
+
endif; ?>
|
166 |
+
|
167 |
+
</div> <!-- .inside -->
|
168 |
+
</div> <!-- .postbox -->
|
169 |
+
|
170 |
+
<?php
|
171 |
+
$return['note'] = ob_get_clean();
|
172 |
+
$return['post_id'] = $post_id;
|
173 |
+
|
174 |
+
echo json_encode( $return );
|
175 |
+
|
176 |
+
die();
|
177 |
+
|
178 |
+
}
|
179 |
+
|
180 |
+
|
181 |
+
/**
|
182 |
+
* Delete note.
|
183 |
+
*
|
184 |
+
* Post is trashed and not permanently deleted.
|
185 |
+
*
|
186 |
+
* @since 1.0.0
|
187 |
+
*/
|
188 |
+
public function wpdn_delete_note() {
|
189 |
+
|
190 |
+
$post_id = (int) $_POST['post_id'];
|
191 |
+
wp_trash_post( $post_id );
|
192 |
+
die();
|
193 |
+
|
194 |
+
}
|
195 |
+
|
196 |
+
|
197 |
+
}
|
includes/templates/note-list.php
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class='wp-dashboard-note-wrap list-note' data-note-type='list' data-color-text='<?php echo $note_meta['color_text']; ?>' data-note-color='<?php echo $note_meta['color']; ?>'>
|
2 |
+
|
3 |
+
<div class='wp-dashboard-note'>
|
4 |
+
<?php echo $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' ); ?>'>
|
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-admin-users';
|
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 |
+
|
31 |
+
<?php foreach ( $colors as $name => $color ) : ?>
|
32 |
+
<span class='color color-<?php echo $name;?>' data-select-color-text='<?php echo $name; ?>' data-select-color='<?php echo $color; ?>' style='background-color: <?php echo $color; ?>'></span>
|
33 |
+
<?php endforeach; ?>
|
34 |
+
|
35 |
+
</span>
|
36 |
+
<div class='dashicons dashicons-art wpdn-note-color'></div>
|
37 |
+
</span>
|
38 |
+
|
39 |
+
<span title='<?php _e( 'Convert to regular note', 'wp-dashboard-notes'); ?>'>
|
40 |
+
<div class='wpdn-note-type dashicons dashicons-welcome-write-blog'></div>
|
41 |
+
</span>
|
42 |
+
|
43 |
+
<span class='wpdn-add-note' title='<?php _e( 'Add a new note', 'wp-dashboard-notes' ); ?>'>
|
44 |
+
<div class='dashicons dashicons-plus'></div>
|
45 |
+
</span>
|
46 |
+
|
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>
|
includes/templates/note.php
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class='wp-dashboard-note-wrap regular-note' data-note-type='regular' data-color-text='<?php echo $note_meta['color_text']; ?>' data-note-color='<?php echo $note_meta['color']; ?>'>
|
2 |
+
|
3 |
+
<div class='wp-dashboard-note' contenteditable='true'>
|
4 |
+
<?php echo $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-admin-users';
|
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 |
+
|
30 |
+
<?php foreach ( $colors as $name => $color ) : ?>
|
31 |
+
<span class='color color-<?php echo $name;?>' data-select-color-text='<?php echo $name; ?>' data-select-color='<?php echo $color; ?>' style='background-color: <?php echo $color; ?>'></span>
|
32 |
+
<?php endforeach; ?>
|
33 |
+
|
34 |
+
</span>
|
35 |
+
<div class='dashicons dashicons-art wpdn-note-color'></div>
|
36 |
+
</span>
|
37 |
+
|
38 |
+
<span title='<?php _e( 'Convert to list note', 'wp-dashboard-notes'); ?>'>
|
39 |
+
<div class='wpdn-note-type dashicons dashicons-list-view'></div>
|
40 |
+
</span>
|
41 |
+
|
42 |
+
<span class='wpdn-add-note' title='<?php _e( 'Add a new note', 'wp-dashboard-notes' ); ?>'>
|
43 |
+
<div class='dashicons dashicons-plus'></div>
|
44 |
+
</span>
|
45 |
+
|
46 |
+
<span style='float: right; margin-right: 10px;' class='wpdn-delete-note' title='<?php _e( 'Delete note', 'wp-dashboard-notes' ); ?>'>
|
47 |
+
<div class='dashicons dashicons-trash'></div>
|
48 |
+
</span>
|
49 |
+
|
50 |
+
</span>
|
51 |
+
</div>
|
52 |
+
</div>
|
53 |
+
|
54 |
+
</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"
|
languages/wp-dashboard-notes-ru_RU.mo
ADDED
Binary file
|
languages/wp-dashboard-notes-ru_RU.po
ADDED
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: WP Dashboard Notes v1.0.4\n"
|
4 |
+
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: \n"
|
6 |
+
"PO-Revision-Date: 2015-01-19 18:05:27+0000\n"
|
7 |
+
"Last-Translator: administrator <admin@vsevyazemy.ru>\n"
|
8 |
+
"Language-Team: \n"
|
9 |
+
"MIME-Version: 1.0\n"
|
10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"Plural-Forms: nplurals=3; plural=n%100/10==1 ? 2 : n%10==1 ? 0 : (n+9)%10>3 ? 2 : 1;\n"
|
13 |
+
"X-Generator: CSL v1.x\n"
|
14 |
+
"X-Poedit-Language: Russian\n"
|
15 |
+
"X-Poedit-Country: RUSSIA\n"
|
16 |
+
"X-Poedit-SourceCharset: utf-8\n"
|
17 |
+
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;\n"
|
18 |
+
"X-Poedit-Basepath: ../\n"
|
19 |
+
"X-Poedit-Bookmarks: \n"
|
20 |
+
"X-Poedit-SearchPath-0: .\n"
|
21 |
+
"X-Textdomain-Support: yes"
|
22 |
+
|
23 |
+
#: includes/class-note-post-type.php:39
|
24 |
+
#@ wp-dashboard-notes
|
25 |
+
msgid "Notes"
|
26 |
+
msgstr "Заметки"
|
27 |
+
|
28 |
+
#: includes/class-note-post-type.php:40
|
29 |
+
#@ wp-dashboard-notes
|
30 |
+
msgid "Note"
|
31 |
+
msgstr "Заметка"
|
32 |
+
|
33 |
+
#: includes/class-note-post-type.php:41
|
34 |
+
#@ wp-dashboard-notes
|
35 |
+
msgid "Add New"
|
36 |
+
msgstr "Добавить"
|
37 |
+
|
38 |
+
#: includes/class-note-post-type.php:42
|
39 |
+
#@ wp-dashboard-notes
|
40 |
+
msgid "Add New Note"
|
41 |
+
msgstr "Добавить"
|
42 |
+
|
43 |
+
#: includes/class-note-post-type.php:43
|
44 |
+
#@ wp-dashboard-notes
|
45 |
+
msgid "Edit Note"
|
46 |
+
msgstr "Изменить"
|
47 |
+
|
48 |
+
#: includes/class-note-post-type.php:44
|
49 |
+
#@ wp-dashboard-notes
|
50 |
+
msgid "New Note"
|
51 |
+
msgstr "Создать"
|
52 |
+
|
53 |
+
#: includes/class-note-post-type.php:45
|
54 |
+
#@ wp-dashboard-notes
|
55 |
+
msgid "View Note"
|
56 |
+
msgstr "Смотреть"
|
57 |
+
|
58 |
+
#: includes/class-note-post-type.php:46
|
59 |
+
#@ wp-dashboard-notes
|
60 |
+
msgid "Search Notes"
|
61 |
+
msgstr "Искать"
|
62 |
+
|
63 |
+
#: includes/class-note-post-type.php:47
|
64 |
+
#@ wp-dashboard-notes
|
65 |
+
msgid "No Notes"
|
66 |
+
msgstr "Нет заметок"
|
67 |
+
|
68 |
+
#: includes/class-note-post-type.php:48
|
69 |
+
#@ wp-dashboard-notes
|
70 |
+
msgid "No Notes found in Trash"
|
71 |
+
msgstr "В мусоре нет заметок"
|
72 |
+
|
73 |
+
#: includes/class-wpdn-ajax.php:118
|
74 |
+
#: includes/class-wpdn-ajax.php:148
|
75 |
+
#@ wp-dashboard-notes
|
76 |
+
msgid "New note"
|
77 |
+
msgstr "Создать"
|
78 |
+
|
79 |
+
#: includes/templates/note-list.php:9
|
80 |
+
#@ wp-dashboard-notes
|
81 |
+
msgid "List item"
|
82 |
+
msgstr "Список"
|
83 |
+
|
84 |
+
#: includes/templates/note-list.php:16
|
85 |
+
#: includes/templates/note.php:15
|
86 |
+
#@ wp-dashboard-notes
|
87 |
+
msgid "Just me"
|
88 |
+
msgstr "Приватно"
|
89 |
+
|
90 |
+
#: includes/templates/note-list.php:20
|
91 |
+
#: includes/templates/note.php:19
|
92 |
+
#@ wp-dashboard-notes
|
93 |
+
msgid "Everyone"
|
94 |
+
msgstr "Общедоступно"
|
95 |
+
|
96 |
+
#: includes/templates/note-list.php:24
|
97 |
+
#: includes/templates/note.php:23
|
98 |
+
#@ wp-dashboard-notes
|
99 |
+
msgid "Visibility:"
|
100 |
+
msgstr "Видимость:"
|
101 |
+
|
102 |
+
#: includes/templates/note-list.php:28
|
103 |
+
#: includes/templates/note.php:27
|
104 |
+
#@ wp-dashboard-notes
|
105 |
+
msgid "Give me a color!"
|
106 |
+
msgstr "Выбрать цвет"
|
107 |
+
|
108 |
+
#: includes/templates/note-list.php:39
|
109 |
+
#@ wp-dashboard-notes
|
110 |
+
msgid "Convert to regular note"
|
111 |
+
msgstr "Список > в текст"
|
112 |
+
|
113 |
+
#: includes/templates/note-list.php:43
|
114 |
+
#: includes/templates/note.php:42
|
115 |
+
#@ wp-dashboard-notes
|
116 |
+
msgid "Add a new note"
|
117 |
+
msgstr "Добавить"
|
118 |
+
|
119 |
+
#: includes/templates/note-list.php:48
|
120 |
+
#: includes/templates/note.php:46
|
121 |
+
#@ wp-dashboard-notes
|
122 |
+
msgid "Delete note"
|
123 |
+
msgstr "Удалить"
|
124 |
+
|
125 |
+
#: includes/templates/note.php:38
|
126 |
+
#@ wp-dashboard-notes
|
127 |
+
msgid "Convert to list note"
|
128 |
+
msgstr "Текст > в список"
|
129 |
+
|
130 |
+
#: wp-dashboard-notes.php:249
|
131 |
+
#@ wp-dashboard-notes
|
132 |
+
msgid "Add note"
|
133 |
+
msgstr "Добавить"
|
134 |
+
|
license.txt
ADDED
@@ -0,0 +1,621 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
GNU GENERAL PUBLIC LICENSE
|
2 |
+
Version 3, 29 June 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 |
+
have designed this version of the GPL to prohibit the practice for those
|
57 |
+
products. If such problems arise substantially in other domains, we
|
58 |
+
stand ready to extend this provision to those domains in future versions
|
59 |
+
of the GPL, as needed to protect the freedom of users.
|
60 |
+
|
61 |
+
Finally, every program is threatened constantly by software patents.
|
62 |
+
States should not allow patents to restrict development and use of
|
63 |
+
software on general-purpose computers, but in those that do, we wish to
|
64 |
+
avoid the special danger that patents applied to a free program could
|
65 |
+
make it effectively proprietary. To prevent this, the GPL assures that
|
66 |
+
patents cannot be used to render the program non-free.
|
67 |
+
|
68 |
+
The precise terms and conditions for copying, distribution and
|
69 |
+
modification follow.
|
70 |
+
|
71 |
+
TERMS AND CONDITIONS
|
72 |
+
|
73 |
+
0. Definitions.
|
74 |
+
|
75 |
+
"This License" refers to version 3 of the GNU General Public License.
|
76 |
+
|
77 |
+
"Copyright" also means copyright-like laws that apply to other kinds of
|
78 |
+
works, such as semiconductor masks.
|
79 |
+
|
80 |
+
"The Program" refers to any copyrightable work licensed under this
|
81 |
+
License. Each licensee is addressed as "you". "Licensees" and
|
82 |
+
"recipients" may be individuals or organizations.
|
83 |
+
|
84 |
+
To "modify" a work means to copy from or adapt all or part of the work
|
85 |
+
in a fashion requiring copyright permission, other than the making of an
|
86 |
+
exact copy. The resulting work is called a "modified version" of the
|
87 |
+
earlier work or a work "based on" the earlier work.
|
88 |
+
|
89 |
+
A "covered work" means either the unmodified Program or a work based
|
90 |
+
on the Program.
|
91 |
+
|
92 |
+
To "propagate" a work means to do anything with it that, without
|
93 |
+
permission, would make you directly or secondarily liable for
|
94 |
+
infringement under applicable copyright law, except executing it on a
|
95 |
+
computer or modifying a private copy. Propagation includes copying,
|
96 |
+
distribution (with or without modification), making available to the
|
97 |
+
public, and in some countries other activities as well.
|
98 |
+
|
99 |
+
To "convey" a work means any kind of propagation that enables other
|
100 |
+
parties to make or receive copies. Mere interaction with a user through
|
101 |
+
a computer network, with no transfer of a copy, is not conveying.
|
102 |
+
|
103 |
+
An interactive user interface displays "Appropriate Legal Notices"
|
104 |
+
to the extent that it includes a convenient and prominently visible
|
105 |
+
feature that (1) displays an appropriate copyright notice, and (2)
|
106 |
+
tells the user that there is no warranty for the work (except to the
|
107 |
+
extent that warranties are provided), that licensees may convey the
|
108 |
+
work under this License, and how to view a copy of this License. If
|
109 |
+
the interface presents a list of user commands or options, such as a
|
110 |
+
menu, a prominent item in the list meets this criterion.
|
111 |
+
|
112 |
+
1. Source Code.
|
113 |
+
|
114 |
+
The "source code" for a work means the preferred form of the work
|
115 |
+
for making modifications to it. "Object code" means any non-source
|
116 |
+
form of a work.
|
117 |
+
|
118 |
+
A "Standard Interface" means an interface that either is an official
|
119 |
+
standard defined by a recognized standards body, or, in the case of
|
120 |
+
interfaces specified for a particular programming language, one that
|
121 |
+
is widely used among developers working in that language.
|
122 |
+
|
123 |
+
The "System Libraries" of an executable work include anything, other
|
124 |
+
than the work as a whole, that (a) is included in the normal form of
|
125 |
+
packaging a Major Component, but which is not part of that Major
|
126 |
+
Component, and (b) serves only to enable use of the work with that
|
127 |
+
Major Component, or to implement a Standard Interface for which an
|
128 |
+
implementation is available to the public in source code form. A
|
129 |
+
"Major Component", in this context, means a major essential component
|
130 |
+
(kernel, window system, and so on) of the specific operating system
|
131 |
+
(if any) on which the executable work runs, or a compiler used to
|
132 |
+
produce the work, or an object code interpreter used to run it.
|
133 |
+
|
134 |
+
The "Corresponding Source" for a work in object code form means all
|
135 |
+
the source code needed to generate, install, and (for an executable
|
136 |
+
work) run the object code and to modify the work, including scripts to
|
137 |
+
control those activities. However, it does not include the work's
|
138 |
+
System Libraries, or general-purpose tools or generally available free
|
139 |
+
programs which are used unmodified in performing those activities but
|
140 |
+
which are not part of the work. For example, Corresponding Source
|
141 |
+
includes interface definition files associated with source files for
|
142 |
+
the work, and the source code for shared libraries and dynamically
|
143 |
+
linked subprograms that the work is specifically designed to require,
|
144 |
+
such as by intimate data communication or control flow between those
|
145 |
+
subprograms and other parts of the work.
|
146 |
+
|
147 |
+
The Corresponding Source need not include anything that users
|
148 |
+
can regenerate automatically from other parts of the Corresponding
|
149 |
+
Source.
|
150 |
+
|
151 |
+
The Corresponding Source for a work in source code form is that
|
152 |
+
same work.
|
153 |
+
|
154 |
+
2. Basic Permissions.
|
155 |
+
|
156 |
+
All rights granted under this License are granted for the term of
|
157 |
+
copyright on the Program, and are irrevocable provided the stated
|
158 |
+
conditions are met. This License explicitly affirms your unlimited
|
159 |
+
permission to run the unmodified Program. The output from running a
|
160 |
+
covered work is covered by this License only if the output, given its
|
161 |
+
content, constitutes a covered work. This License acknowledges your
|
162 |
+
rights of fair use or other equivalent, as provided by copyright law.
|
163 |
+
|
164 |
+
You may make, run and propagate covered works that you do not
|
165 |
+
convey, without conditions so long as your license otherwise remains
|
166 |
+
in force. You may convey covered works to others for the sole purpose
|
167 |
+
of having them make modifications exclusively for you, or provide you
|
168 |
+
with facilities for running those works, provided that you comply with
|
169 |
+
the terms of this License in conveying all material for which you do
|
170 |
+
not control copyright. Those thus making or running the covered works
|
171 |
+
for you must do so exclusively on your behalf, under your direction
|
172 |
+
and control, on terms that prohibit them from making any copies of
|
173 |
+
your copyrighted material outside their relationship with you.
|
174 |
+
|
175 |
+
Conveying under any other circumstances is permitted solely under
|
176 |
+
the conditions stated below. Sublicensing is not allowed; section 10
|
177 |
+
makes it unnecessary.
|
178 |
+
|
179 |
+
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
180 |
+
|
181 |
+
No covered work shall be deemed part of an effective technological
|
182 |
+
measure under any applicable law fulfilling obligations under article
|
183 |
+
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
184 |
+
similar laws prohibiting or restricting circumvention of such
|
185 |
+
measures.
|
186 |
+
|
187 |
+
When you convey a covered work, you waive any legal power to forbid
|
188 |
+
circumvention of technological measures to the extent such circumvention
|
189 |
+
is effected by exercising rights under this License with respect to
|
190 |
+
the covered work, and you disclaim any intention to limit operation or
|
191 |
+
modification of the work as a means of enforcing, against the work's
|
192 |
+
users, your or third parties' legal rights to forbid circumvention of
|
193 |
+
technological measures.
|
194 |
+
|
195 |
+
4. Conveying Verbatim Copies.
|
196 |
+
|
197 |
+
You may convey verbatim copies of the Program's source code as you
|
198 |
+
receive it, in any medium, provided that you conspicuously and
|
199 |
+
appropriately publish on each copy an appropriate copyright notice;
|
200 |
+
keep intact all notices stating that this License and any
|
201 |
+
non-permissive terms added in accord with section 7 apply to the code;
|
202 |
+
keep intact all notices of the absence of any warranty; and give all
|
203 |
+
recipients a copy of this License along with the Program.
|
204 |
+
|
205 |
+
You may charge any price or no price for each copy that you convey,
|
206 |
+
and you may offer support or warranty protection for a fee.
|
207 |
+
|
208 |
+
5. Conveying Modified Source Versions.
|
209 |
+
|
210 |
+
You may convey a work based on the Program, or the modifications to
|
211 |
+
produce it from the Program, in the form of source code under the
|
212 |
+
terms of section 4, provided that you also meet all of these conditions:
|
213 |
+
|
214 |
+
a) The work must carry prominent notices stating that you modified
|
215 |
+
it, and giving a relevant date.
|
216 |
+
|
217 |
+
b) The work must carry prominent notices stating that it is
|
218 |
+
released under this License and any conditions added under section
|
219 |
+
7. This requirement modifies the requirement in section 4 to
|
220 |
+
"keep intact all notices".
|
221 |
+
|
222 |
+
c) You must license the entire work, as a whole, under this
|
223 |
+
License to anyone who comes into possession of a copy. This
|
224 |
+
License will therefore apply, along with any applicable section 7
|
225 |
+
additional terms, to the whole of the work, and all its parts,
|
226 |
+
regardless of how they are packaged. This License gives no
|
227 |
+
permission to license the work in any other way, but it does not
|
228 |
+
invalidate such permission if you have separately received it.
|
229 |
+
|
230 |
+
d) If the work has interactive user interfaces, each must display
|
231 |
+
Appropriate Legal Notices; however, if the Program has interactive
|
232 |
+
interfaces that do not display Appropriate Legal Notices, your
|
233 |
+
work need not make them do so.
|
234 |
+
|
235 |
+
A compilation of a covered work with other separate and independent
|
236 |
+
works, which are not by their nature extensions of the covered work,
|
237 |
+
and which are not combined with it such as to form a larger program,
|
238 |
+
in or on a volume of a storage or distribution medium, is called an
|
239 |
+
"aggregate" if the compilation and its resulting copyright are not
|
240 |
+
used to limit the access or legal rights of the compilation's users
|
241 |
+
beyond what the individual works permit. Inclusion of a covered work
|
242 |
+
in an aggregate does not cause this License to apply to the other
|
243 |
+
parts of the aggregate.
|
244 |
+
|
245 |
+
6. Conveying Non-Source Forms.
|
246 |
+
|
247 |
+
You may convey a covered work in object code form under the terms
|
248 |
+
of sections 4 and 5, provided that you also convey the
|
249 |
+
machine-readable Corresponding Source under the terms of this License,
|
250 |
+
in one of these ways:
|
251 |
+
|
252 |
+
a) Convey the object code in, or embodied in, a physical product
|
253 |
+
(including a physical distribution medium), accompanied by the
|
254 |
+
Corresponding Source fixed on a durable physical medium
|
255 |
+
customarily used for software interchange.
|
256 |
+
|
257 |
+
b) Convey the object code in, or embodied in, a physical product
|
258 |
+
(including a physical distribution medium), accompanied by a
|
259 |
+
written offer, valid for at least three years and valid for as
|
260 |
+
long as you offer spare parts or customer support for that product
|
261 |
+
model, to give anyone who possesses the object code either (1) a
|
262 |
+
copy of the Corresponding Source for all the software in the
|
263 |
+
product that is covered by this License, on a durable physical
|
264 |
+
medium customarily used for software interchange, for a price no
|
265 |
+
more than your reasonable cost of physically performing this
|
266 |
+
conveying of source, or (2) access to copy the
|
267 |
+
Corresponding Source from a network server at no charge.
|
268 |
+
|
269 |
+
c) Convey individual copies of the object code with a copy of the
|
270 |
+
written offer to provide the Corresponding Source. This
|
271 |
+
alternative is allowed only occasionally and noncommercially, and
|
272 |
+
only if you received the object code with such an offer, in accord
|
273 |
+
with subsection 6b.
|
274 |
+
|
275 |
+
d) Convey the object code by offering access from a designated
|
276 |
+
place (gratis or for a charge), and offer equivalent access to the
|
277 |
+
Corresponding Source in the same way through the same place at no
|
278 |
+
further charge. You need not require recipients to copy the
|
279 |
+
Corresponding Source along with the object code. If the place to
|
280 |
+
copy the object code is a network server, the Corresponding Source
|
281 |
+
may be on a different server (operated by you or a third party)
|
282 |
+
that supports equivalent copying facilities, provided you maintain
|
283 |
+
clear directions next to the object code saying where to find the
|
284 |
+
Corresponding Source. Regardless of what server hosts the
|
285 |
+
Corresponding Source, you remain obligated to ensure that it is
|
286 |
+
available for as long as needed to satisfy these requirements.
|
287 |
+
|
288 |
+
e) Convey the object code using peer-to-peer transmission, provided
|
289 |
+
you inform other peers where the object code and Corresponding
|
290 |
+
Source of the work are being offered to the general public at no
|
291 |
+
charge under subsection 6d.
|
292 |
+
|
293 |
+
A separable portion of the object code, whose source code is excluded
|
294 |
+
from the Corresponding Source as a System Library, need not be
|
295 |
+
included in conveying the object code work.
|
296 |
+
|
297 |
+
A "User Product" is either (1) a "consumer product", which means any
|
298 |
+
tangible personal property which is normally used for personal, family,
|
299 |
+
or household purposes, or (2) anything designed or sold for incorporation
|
300 |
+
into a dwelling. In determining whether a product is a consumer product,
|
301 |
+
doubtful cases shall be resolved in favor of coverage. For a particular
|
302 |
+
product received by a particular user, "normally used" refers to a
|
303 |
+
typical or common use of that class of product, regardless of the status
|
304 |
+
of the particular user or of the way in which the particular user
|
305 |
+
actually uses, or expects or is expected to use, the product. A product
|
306 |
+
is a consumer product regardless of whether the product has substantial
|
307 |
+
commercial, industrial or non-consumer uses, unless such uses represent
|
308 |
+
the only significant mode of use of the product.
|
309 |
+
|
310 |
+
"Installation Information" for a User Product means any methods,
|
311 |
+
procedures, authorization keys, or other information required to install
|
312 |
+
and execute modified versions of a covered work in that User Product from
|
313 |
+
a modified version of its Corresponding Source. The information must
|
314 |
+
suffice to ensure that the continued functioning of the modified object
|
315 |
+
code is in no case prevented or interfered with solely because
|
316 |
+
modification has been made.
|
317 |
+
|
318 |
+
If you convey an object code work under this section in, or with, or
|
319 |
+
specifically for use in, a User Product, and the conveying occurs as
|
320 |
+
part of a transaction in which the right of possession and use of the
|
321 |
+
User Product is transferred to the recipient in perpetuity or for a
|
322 |
+
fixed term (regardless of how the transaction is characterized), the
|
323 |
+
Corresponding Source conveyed under this section must be accompanied
|
324 |
+
by the Installation Information. But this requirement does not apply
|
325 |
+
if neither you nor any third party retains the ability to install
|
326 |
+
modified object code on the User Product (for example, the work has
|
327 |
+
been installed in ROM).
|
328 |
+
|
329 |
+
The requirement to provide Installation Information does not include a
|
330 |
+
requirement to continue to provide support service, warranty, or updates
|
331 |
+
for a work that has been modified or installed by the recipient, or for
|
332 |
+
the User Product in which it has been modified or installed. Access to a
|
333 |
+
network may be denied when the modification itself materially and
|
334 |
+
adversely affects the operation of the network or violates the rules and
|
335 |
+
protocols for communication across the network.
|
336 |
+
|
337 |
+
Corresponding Source conveyed, and Installation Information provided,
|
338 |
+
in accord with this section must be in a format that is publicly
|
339 |
+
documented (and with an implementation available to the public in
|
340 |
+
source code form), and must require no special password or key for
|
341 |
+
unpacking, reading or copying.
|
342 |
+
|
343 |
+
7. Additional Terms.
|
344 |
+
|
345 |
+
"Additional permissions" are terms that supplement the terms of this
|
346 |
+
License by making exceptions from one or more of its conditions.
|
347 |
+
Additional permissions that are applicable to the entire Program shall
|
348 |
+
be treated as though they were included in this License, to the extent
|
349 |
+
that they are valid under applicable law. If additional permissions
|
350 |
+
apply only to part of the Program, that part may be used separately
|
351 |
+
under those permissions, but the entire Program remains governed by
|
352 |
+
this License without regard to the additional permissions.
|
353 |
+
|
354 |
+
When you convey a copy of a covered work, you may at your option
|
355 |
+
remove any additional permissions from that copy, or from any part of
|
356 |
+
it. (Additional permissions may be written to require their own
|
357 |
+
removal in certain cases when you modify the work.) You may place
|
358 |
+
additional permissions on material, added by you to a covered work,
|
359 |
+
for which you have or can give appropriate copyright permission.
|
360 |
+
|
361 |
+
Notwithstanding any other provision of this License, for material you
|
362 |
+
add to a covered work, you may (if authorized by the copyright holders of
|
363 |
+
that material) supplement the terms of this License with terms:
|
364 |
+
|
365 |
+
a) Disclaiming warranty or limiting liability differently from the
|
366 |
+
terms of sections 15 and 16 of this License; or
|
367 |
+
|
368 |
+
b) Requiring preservation of specified reasonable legal notices or
|
369 |
+
author attributions in that material or in the Appropriate Legal
|
370 |
+
Notices displayed by works containing it; or
|
371 |
+
|
372 |
+
c) Prohibiting misrepresentation of the origin of that material, or
|
373 |
+
requiring that modified versions of such material be marked in
|
374 |
+
reasonable ways as different from the original version; or
|
375 |
+
|
376 |
+
d) Limiting the use for publicity purposes of names of licensors or
|
377 |
+
authors of the material; or
|
378 |
+
|
379 |
+
e) Declining to grant rights under trademark law for use of some
|
380 |
+
trade names, trademarks, or service marks; or
|
381 |
+
|
382 |
+
f) Requiring indemnification of licensors and authors of that
|
383 |
+
material by anyone who conveys the material (or modified versions of
|
384 |
+
it) with contractual assumptions of liability to the recipient, for
|
385 |
+
any liability that these contractual assumptions directly impose on
|
386 |
+
those licensors and authors.
|
387 |
+
|
388 |
+
All other non-permissive additional terms are considered "further
|
389 |
+
restrictions" within the meaning of section 10. If the Program as you
|
390 |
+
received it, or any part of it, contains a notice stating that it is
|
391 |
+
governed by this License along with a term that is a further
|
392 |
+
restriction, you may remove that term. If a license document contains
|
393 |
+
a further restriction but permits relicensing or conveying under this
|
394 |
+
License, you may add to a covered work material governed by the terms
|
395 |
+
of that license document, provided that the further restriction does
|
396 |
+
not survive such relicensing or conveying.
|
397 |
+
|
398 |
+
If you add terms to a covered work in accord with this section, you
|
399 |
+
must place, in the relevant source files, a statement of the
|
400 |
+
additional terms that apply to those files, or a notice indicating
|
401 |
+
where to find the applicable terms.
|
402 |
+
|
403 |
+
Additional terms, permissive or non-permissive, may be stated in the
|
404 |
+
form of a separately written license, or stated as exceptions;
|
405 |
+
the above requirements apply either way.
|
406 |
+
|
407 |
+
8. Termination.
|
408 |
+
|
409 |
+
You may not propagate or modify a covered work except as expressly
|
410 |
+
provided under this License. Any attempt otherwise to propagate or
|
411 |
+
modify it is void, and will automatically terminate your rights under
|
412 |
+
this License (including any patent licenses granted under the third
|
413 |
+
paragraph of section 11).
|
414 |
+
|
415 |
+
However, if you cease all violation of this License, then your
|
416 |
+
license from a particular copyright holder is reinstated (a)
|
417 |
+
provisionally, unless and until the copyright holder explicitly and
|
418 |
+
finally terminates your license, and (b) permanently, if the copyright
|
419 |
+
holder fails to notify you of the violation by some reasonable means
|
420 |
+
prior to 60 days after the cessation.
|
421 |
+
|
422 |
+
Moreover, your license from a particular copyright holder is
|
423 |
+
reinstated permanently if the copyright holder notifies you of the
|
424 |
+
violation by some reasonable means, this is the first time you have
|
425 |
+
received notice of violation of this License (for any work) from that
|
426 |
+
copyright holder, and you cure the violation prior to 30 days after
|
427 |
+
your receipt of the notice.
|
428 |
+
|
429 |
+
Termination of your rights under this section does not terminate the
|
430 |
+
licenses of parties who have received copies or rights from you under
|
431 |
+
this License. If your rights have been terminated and not permanently
|
432 |
+
reinstated, you do not qualify to receive new licenses for the same
|
433 |
+
material under section 10.
|
434 |
+
|
435 |
+
9. Acceptance Not Required for Having Copies.
|
436 |
+
|
437 |
+
You are not required to accept this License in order to receive or
|
438 |
+
run a copy of the Program. Ancillary propagation of a covered work
|
439 |
+
occurring solely as a consequence of using peer-to-peer transmission
|
440 |
+
to receive a copy likewise does not require acceptance. However,
|
441 |
+
nothing other than this License grants you permission to propagate or
|
442 |
+
modify any covered work. These actions infringe copyright if you do
|
443 |
+
not accept this License. Therefore, by modifying or propagating a
|
444 |
+
covered work, you indicate your acceptance of this License to do so.
|
445 |
+
|
446 |
+
10. Automatic Licensing of Downstream Recipients.
|
447 |
+
|
448 |
+
Each time you convey a covered work, the recipient automatically
|
449 |
+
receives a license from the original licensors, to run, modify and
|
450 |
+
propagate that work, subject to this License. You are not responsible
|
451 |
+
for enforcing compliance by third parties with this License.
|
452 |
+
|
453 |
+
An "entity transaction" is a transaction transferring control of an
|
454 |
+
organization, or substantially all assets of one, or subdividing an
|
455 |
+
organization, or merging organizations. If propagation of a covered
|
456 |
+
work results from an entity transaction, each party to that
|
457 |
+
transaction who receives a copy of the work also receives whatever
|
458 |
+
licenses to the work the party's predecessor in interest had or could
|
459 |
+
give under the previous paragraph, plus a right to possession of the
|
460 |
+
Corresponding Source of the work from the predecessor in interest, if
|
461 |
+
the predecessor has it or can get it with reasonable efforts.
|
462 |
+
|
463 |
+
You may not impose any further restrictions on the exercise of the
|
464 |
+
rights granted or affirmed under this License. For example, you may
|
465 |
+
not impose a license fee, royalty, or other charge for exercise of
|
466 |
+
rights granted under this License, and you may not initiate litigation
|
467 |
+
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
468 |
+
any patent claim is infringed by making, using, selling, offering for
|
469 |
+
sale, or importing the Program or any portion of it.
|
470 |
+
|
471 |
+
11. Patents.
|
472 |
+
|
473 |
+
A "contributor" is a copyright holder who authorizes use under this
|
474 |
+
License of the Program or a work on which the Program is based. The
|
475 |
+
work thus licensed is called the contributor's "contributor version".
|
476 |
+
|
477 |
+
A contributor's "essential patent claims" are all patent claims
|
478 |
+
owned or controlled by the contributor, whether already acquired or
|
479 |
+
hereafter acquired, that would be infringed by some manner, permitted
|
480 |
+
by this License, of making, using, or selling its contributor version,
|
481 |
+
but do not include claims that would be infringed only as a
|
482 |
+
consequence of further modification of the contributor version. For
|
483 |
+
purposes of this definition, "control" includes the right to grant
|
484 |
+
patent sublicenses in a manner consistent with the requirements of
|
485 |
+
this License.
|
486 |
+
|
487 |
+
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
488 |
+
patent license under the contributor's essential patent claims, to
|
489 |
+
make, use, sell, offer for sale, import and otherwise run, modify and
|
490 |
+
propagate the contents of its contributor version.
|
491 |
+
|
492 |
+
In the following three paragraphs, a "patent license" is any express
|
493 |
+
agreement or commitment, however denominated, not to enforce a patent
|
494 |
+
(such as an express permission to practice a patent or covenant not to
|
495 |
+
sue for patent infringement). To "grant" such a patent license to a
|
496 |
+
party means to make such an agreement or commitment not to enforce a
|
497 |
+
patent against the party.
|
498 |
+
|
499 |
+
If you convey a covered work, knowingly relying on a patent license,
|
500 |
+
and the Corresponding Source of the work is not available for anyone
|
501 |
+
to copy, free of charge and under the terms of this License, through a
|
502 |
+
publicly available network server or other readily accessible means,
|
503 |
+
then you must either (1) cause the Corresponding Source to be so
|
504 |
+
available, or (2) arrange to deprive yourself of the benefit of the
|
505 |
+
patent license for this particular work, or (3) arrange, in a manner
|
506 |
+
consistent with the requirements of this License, to extend the patent
|
507 |
+
license to downstream recipients. "Knowingly relying" means you have
|
508 |
+
actual knowledge that, but for the patent license, your conveying the
|
509 |
+
covered work in a country, or your recipient's use of the covered work
|
510 |
+
in a country, would infringe one or more identifiable patents in that
|
511 |
+
country that you have reason to believe are valid.
|
512 |
+
|
513 |
+
If, pursuant to or in connection with a single transaction or
|
514 |
+
arrangement, you convey, or propagate by procuring conveyance of, a
|
515 |
+
covered work, and grant a patent license to some of the parties
|
516 |
+
receiving the covered work authorizing them to use, propagate, modify
|
517 |
+
or convey a specific copy of the covered work, then the patent license
|
518 |
+
you grant is automatically extended to all recipients of the covered
|
519 |
+
work and works based on it.
|
520 |
+
|
521 |
+
A patent license is "discriminatory" if it does not include within
|
522 |
+
the scope of its coverage, prohibits the exercise of, or is
|
523 |
+
conditioned on the non-exercise of one or more of the rights that are
|
524 |
+
specifically granted under this License. You may not convey a covered
|
525 |
+
work if you are a party to an arrangement with a third party that is
|
526 |
+
in the business of distributing software, under which you make payment
|
527 |
+
to the third party based on the extent of your activity of conveying
|
528 |
+
the work, and under which the third party grants, to any of the
|
529 |
+
parties who would receive the covered work from you, a discriminatory
|
530 |
+
patent license (a) in connection with copies of the covered work
|
531 |
+
conveyed by you (or copies made from those copies), or (b) primarily
|
532 |
+
for and in connection with specific products or compilations that
|
533 |
+
contain the covered work, unless you entered into that arrangement,
|
534 |
+
or that patent license was granted, prior to 28 March 2007.
|
535 |
+
|
536 |
+
Nothing in this License shall be construed as excluding or limiting
|
537 |
+
any implied license or other defenses to infringement that may
|
538 |
+
otherwise be available to you under applicable patent law.
|
539 |
+
|
540 |
+
12. No Surrender of Others' Freedom.
|
541 |
+
|
542 |
+
If conditions are imposed on you (whether by court order, agreement or
|
543 |
+
otherwise) that contradict the conditions of this License, they do not
|
544 |
+
excuse you from the conditions of this License. If you cannot convey a
|
545 |
+
covered work so as to satisfy simultaneously your obligations under this
|
546 |
+
License and any other pertinent obligations, then as a consequence you may
|
547 |
+
not convey it at all. For example, if you agree to terms that obligate you
|
548 |
+
to collect a royalty for further conveying from those to whom you convey
|
549 |
+
the Program, the only way you could satisfy both those terms and this
|
550 |
+
License would be to refrain entirely from conveying the Program.
|
551 |
+
|
552 |
+
13. Use with the GNU Affero General Public License.
|
553 |
+
|
554 |
+
Notwithstanding any other provision of this License, you have
|
555 |
+
permission to link or combine any covered work with a work licensed
|
556 |
+
under version 3 of the GNU Affero General Public License into a single
|
557 |
+
combined work, and to convey the resulting work. The terms of this
|
558 |
+
License will continue to apply to the part which is the covered work,
|
559 |
+
but the special requirements of the GNU Affero General Public License,
|
560 |
+
section 13, concerning interaction through a network will apply to the
|
561 |
+
combination as such.
|
562 |
+
|
563 |
+
14. Revised Versions of this License.
|
564 |
+
|
565 |
+
The Free Software Foundation may publish revised and/or new versions of
|
566 |
+
the GNU General Public License from time to time. Such new versions will
|
567 |
+
be similar in spirit to the present version, but may differ in detail to
|
568 |
+
address new problems or concerns.
|
569 |
+
|
570 |
+
Each version is given a distinguishing version number. If the
|
571 |
+
Program specifies that a certain numbered version of the GNU General
|
572 |
+
Public License "or any later version" applies to it, you have the
|
573 |
+
option of following the terms and conditions either of that numbered
|
574 |
+
version or of any later version published by the Free Software
|
575 |
+
Foundation. If the Program does not specify a version number of the
|
576 |
+
GNU General Public License, you may choose any version ever published
|
577 |
+
by the Free Software Foundation.
|
578 |
+
|
579 |
+
If the Program specifies that a proxy can decide which future
|
580 |
+
versions of the GNU General Public License can be used, that proxy's
|
581 |
+
public statement of acceptance of a version permanently authorizes you
|
582 |
+
to choose that version for the Program.
|
583 |
+
|
584 |
+
Later license versions may give you additional or different
|
585 |
+
permissions. However, no additional obligations are imposed on any
|
586 |
+
author or copyright holder as a result of your choosing to follow a
|
587 |
+
later version.
|
588 |
+
|
589 |
+
15. Disclaimer of Warranty.
|
590 |
+
|
591 |
+
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
592 |
+
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
593 |
+
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
594 |
+
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
595 |
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
596 |
+
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
597 |
+
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
598 |
+
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
599 |
+
|
600 |
+
16. Limitation of Liability.
|
601 |
+
|
602 |
+
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
603 |
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
604 |
+
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
605 |
+
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
606 |
+
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
607 |
+
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
608 |
+
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
609 |
+
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
610 |
+
SUCH DAMAGES.
|
611 |
+
|
612 |
+
17. Interpretation of Sections 15 and 16.
|
613 |
+
|
614 |
+
If the disclaimer of warranty and limitation of liability provided
|
615 |
+
above cannot be given local legal effect according to their terms,
|
616 |
+
reviewing courts shall apply local law that most closely approximates
|
617 |
+
an absolute waiver of all civil liability in connection with the
|
618 |
+
Program, unless a warranty or assumption of liability accompanies a
|
619 |
+
copy of the Program in return for a fee.
|
620 |
+
|
621 |
+
END OF TERMS AND CONDITIONS
|
readme.txt
ADDED
@@ -0,0 +1,184 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== WP Dashboard Notes ===
|
2 |
+
Contributors: sormano
|
3 |
+
Donate link: http://jeroensormani.com/donate/
|
4 |
+
Tags: note, notes, dashboard notes, wordpress notes, admin note, private note, notification, collaboration, workflow, to do list, note list, note widget
|
5 |
+
Requires at least: 3.8
|
6 |
+
Tested up to: 4.4
|
7 |
+
Stable tag: 1.0.6
|
8 |
+
License: GPLv3 or later
|
9 |
+
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
+
|
11 |
+
Working with multiple persons on a website? Want to make notes? You can do just that with WP Dashboard Notes. Create beautiful notes with a nice user experience.
|
12 |
+
|
13 |
+
== Description ==
|
14 |
+
Working with multiple persons on a website? Want to make notes? You can do just that with WP Dashboard Notes. Create beautiful notes with a nice user experience.
|
15 |
+
|
16 |
+
**Features:**
|
17 |
+
|
18 |
+
* Colored notes
|
19 |
+
* List notes or regular notes
|
20 |
+
* Public or private notes
|
21 |
+
* Edit on dashboard
|
22 |
+
* Add as many notes as you like
|
23 |
+
* Drag & drop list items
|
24 |
+
* No save button needed!
|
25 |
+
|
26 |
+
**Feature requests, ratings and donations are welcome and appreciated!**
|
27 |
+
|
28 |
+
== Frequently Asked Questions ==
|
29 |
+
|
30 |
+
= How can I add a new note? =
|
31 |
+
|
32 |
+
A new note can be added in two ways.
|
33 |
+
|
34 |
+
- Open 'Screen Options' on your dashboard, in the right corner you'll find a button called 'Add note'.
|
35 |
+
- Or you can add a new note from within an existing note. When hovering over a note there will show an black bar at the bottom of that note. There is an '+' within that bar where you can add a new note.
|
36 |
+
|
37 |
+
= Can I change the colors =
|
38 |
+
|
39 |
+
You could change the colors by overriding the style from another stylesheet. If you need help with this, ask in the support forums.
|
40 |
+
|
41 |
+
= How can I add my own colors? =
|
42 |
+
|
43 |
+
Add the following code to your functions.php, you can change the values of course to your own colors.
|
44 |
+
|
45 |
+
Required:
|
46 |
+
`
|
47 |
+
add_filter( 'wpdn_colors', 'wpdn_add_purple' );
|
48 |
+
function wpdn_add_purple( $colors ) {
|
49 |
+
|
50 |
+
$colors['purple'] = '#5236A0';
|
51 |
+
|
52 |
+
return $colors;
|
53 |
+
|
54 |
+
}
|
55 |
+
`
|
56 |
+
|
57 |
+
*Optional:*
|
58 |
+
You can add the following code for extra styling (e.g. light text instead of dark)
|
59 |
+
`
|
60 |
+
add_action( 'admin_head', 'wpdn_add_style' );
|
61 |
+
function wpdn_add_style() {
|
62 |
+
|
63 |
+
?><style>
|
64 |
+
|
65 |
+
/****************************
|
66 |
+
* purple
|
67 |
+
****************************/
|
68 |
+
[data-color-text=purple] {
|
69 |
+
color: white;
|
70 |
+
}
|
71 |
+
[data-color-text=purple] .wpdn-note-sortable {
|
72 |
+
color: inherit;
|
73 |
+
}
|
74 |
+
[data-color-text=purple] .wpdn-add-item {
|
75 |
+
color: inherit;
|
76 |
+
}
|
77 |
+
[data-color-text=purple] .wp-dashboard-note .list-item {
|
78 |
+
border-color: inherit;
|
79 |
+
}
|
80 |
+
|
81 |
+
[data-color-text=purple] .list-item input[type=checkbox] {
|
82 |
+
border: 1px solid white !important;
|
83 |
+
}
|
84 |
+
|
85 |
+
[data-color-text=purple] .list-item input[type=checkbox]:checked ~ span {
|
86 |
+
color: white;
|
87 |
+
}
|
88 |
+
/* Unused for now */
|
89 |
+
[data-color-text=purple] [id^=note] .handlediv {
|
90 |
+
color: inherit;
|
91 |
+
}
|
92 |
+
/* Add list item input colors */
|
93 |
+
[data-color-text=purple] input[type=text].add-list-item {
|
94 |
+
border-color: white;
|
95 |
+
color: inherit;
|
96 |
+
background: inherit;
|
97 |
+
}
|
98 |
+
/* Placeholder text color */
|
99 |
+
[data-color-text=purple] input[type=text].add-list-item::-webkit-input-placeholder {
|
100 |
+
color: white;
|
101 |
+
}
|
102 |
+
[data-color-text=purple] input[type=text].add-list-item:-moz-placeholder {
|
103 |
+
color: white;
|
104 |
+
}
|
105 |
+
[data-color-text=purple] input[type=text].add-list-item::-moz-placeholder {
|
106 |
+
color: white;
|
107 |
+
}
|
108 |
+
[data-color-text=purple] input[type=text].add-list-item:-ms-input-placeholder {
|
109 |
+
color: white;
|
110 |
+
}
|
111 |
+
/* Saved/saving text color */
|
112 |
+
[data-color-text=purple] .saved-icon,
|
113 |
+
[data-color-text=purple] .saving-icon {
|
114 |
+
color: inherit;
|
115 |
+
}
|
116 |
+
/* Delete icon */
|
117 |
+
[data-color-text=purple] .list-item .dashicons-no-alt {
|
118 |
+
color: white;
|
119 |
+
}
|
120 |
+
/* Sort icon */
|
121 |
+
[data-color-text=purple] .wpdn-note-sortable {
|
122 |
+
color: white;
|
123 |
+
}
|
124 |
+
</style><?php
|
125 |
+
|
126 |
+
}
|
127 |
+
`
|
128 |
+
|
129 |
+
== Installation ==
|
130 |
+
|
131 |
+
1. Upload the folder `wp-dashboard-notes` to the `/wp-content/plugins/` directory.
|
132 |
+
2. Activate the plugin through the 'Plugins' menu in WordPress.
|
133 |
+
3. Add your first note via the 'Add note' button in the 'Screen Options'.
|
134 |
+
|
135 |
+
== Screenshots ==
|
136 |
+
|
137 |
+
1. WordPress dashboard example
|
138 |
+
2. Add note button
|
139 |
+
3. Normal white note
|
140 |
+
|
141 |
+
== Changelog ==
|
142 |
+
|
143 |
+
= 1.0.6 - 26/08/2015 =
|
144 |
+
|
145 |
+
* Improvement - Optimize JavaScripts and stylesheets
|
146 |
+
* Fix - Firefox users not able to use new regular note
|
147 |
+
|
148 |
+
= 1.0.5 - 24/01/2015 =
|
149 |
+
|
150 |
+
* Improvement - Use singleton instead of global
|
151 |
+
* Fix - Notice in the background when getting data
|
152 |
+
* Fix - Delete not working when having double lined items
|
153 |
+
* Fix - Bug in changing background colors
|
154 |
+
* Fix - Prevent copying the text background color (or any other styles)
|
155 |
+
* Add - Russian translation
|
156 |
+
|
157 |
+
= 1.0.4 - 19/10/2014 =
|
158 |
+
|
159 |
+
* Fix - Notice on WP_DEBUG mode when creating new note
|
160 |
+
* Fix - Wrong visibility icon when switching
|
161 |
+
* Fix - Displaying colors on new notes/after switching
|
162 |
+
* Improvement - Drag list items only vertically
|
163 |
+
* Improvement - Move savig/saved icon to title bar
|
164 |
+
|
165 |
+
= 1.0.3 - 12/10/2014 =
|
166 |
+
|
167 |
+
* Add - *beta* URLs are automatically clickable (after page refresh)
|
168 |
+
* Improvement - Add filters to add your own colors
|
169 |
+
* Improvement - Small improvements for coloring
|
170 |
+
* Improvement - New icon for Personal visibility
|
171 |
+
|
172 |
+
= 1.0.2 - 29/08/2014 =
|
173 |
+
|
174 |
+
* Fix - Safari compatibility issues
|
175 |
+
|
176 |
+
= 1.0.1 - 28/08/2014 =
|
177 |
+
|
178 |
+
* Added ‚jquery-ui-sortable’ dependency
|
179 |
+
* Fixed sub-menu not showing up
|
180 |
+
* Add check at js update note function
|
181 |
+
|
182 |
+
= 1.0.0 - 18/08/2014 =
|
183 |
+
|
184 |
+
* Initial release
|
screenshot-1.png
ADDED
Binary file
|
screenshot-2.png
ADDED
Binary file
|
screenshot-3.png
ADDED
Binary file
|
wp-dashboard-notes.php
ADDED
@@ -0,0 +1,346 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* Plugin Name: WP Dashboard Notes
|
4 |
+
* Plugin URI: https://wordpress.org/plugins/wp-dashboard-notes/
|
5 |
+
* Donate link: http://jeroensormani.com/donate/
|
6 |
+
* Description: Working in a team? Want to make notes? You can do just that with WP Dashboard Notes. Create beautiful notes with a nice user experience.
|
7 |
+
* Version: 1.0.6
|
8 |
+
* Author: Jeroen Sormani
|
9 |
+
* Author URI: http://jeroensormani.com/
|
10 |
+
* Text Domain: wp-dashboard-notes
|
11 |
+
*/
|
12 |
+
|
13 |
+
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
14 |
+
if ( ! is_admin() ) return; // Only load plugin when user is in admin
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Class WP_Dashboard_Notes.
|
18 |
+
*
|
19 |
+
* Main WPDN class initializes the plugin.
|
20 |
+
*
|
21 |
+
* @class WP_Dashboard_Notes
|
22 |
+
* @version 1.0.0
|
23 |
+
* @author Jeroen Sormani
|
24 |
+
*/
|
25 |
+
class WP_Dashboard_Notes {
|
26 |
+
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Plugin version number
|
30 |
+
*
|
31 |
+
* @since 1.0.3
|
32 |
+
* @var string $version Plugin version number.
|
33 |
+
*/
|
34 |
+
public $version = '1.0.6';
|
35 |
+
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Plugin file.
|
39 |
+
*
|
40 |
+
* @since 1.0.0
|
41 |
+
* @var string $file Plugin file path.
|
42 |
+
*/
|
43 |
+
public $file = __FILE__;
|
44 |
+
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Instace of WP_Dashboard_Notes.
|
48 |
+
*
|
49 |
+
* @since 1.0.0
|
50 |
+
* @access private
|
51 |
+
* @var object $instance The instance of WP_Dashboard_Notes.
|
52 |
+
*/
|
53 |
+
private static $instance;
|
54 |
+
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Constructor.
|
58 |
+
*
|
59 |
+
* @since 1.0.0
|
60 |
+
*/
|
61 |
+
public function __construct() {
|
62 |
+
|
63 |
+
// Init plugin parts
|
64 |
+
$this->init();
|
65 |
+
|
66 |
+
$this->hooks();
|
67 |
+
|
68 |
+
}
|
69 |
+
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Instance.
|
73 |
+
*
|
74 |
+
* An global instance of the class. Used to retrieve the instance
|
75 |
+
* to use on other files/plugins/themes.
|
76 |
+
*
|
77 |
+
* @since 1.0.0
|
78 |
+
*
|
79 |
+
* @return object Instance of the class.
|
80 |
+
*/
|
81 |
+
public static function instance() {
|
82 |
+
|
83 |
+
if ( is_null( self::$instance ) ) :
|
84 |
+
self::$instance = new self();
|
85 |
+
endif;
|
86 |
+
|
87 |
+
return self::$instance;
|
88 |
+
|
89 |
+
}
|
90 |
+
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Init.
|
94 |
+
*
|
95 |
+
* Initiate plugin parts.
|
96 |
+
*
|
97 |
+
* @since 1.0.5
|
98 |
+
*/
|
99 |
+
public function init() {
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Post type class.
|
103 |
+
*/
|
104 |
+
require_once plugin_dir_path( __FILE__ ) . 'includes/class-note-post-type.php';
|
105 |
+
$this->post_type = new Note_Post_Type();
|
106 |
+
|
107 |
+
/**
|
108 |
+
* AJAX class.
|
109 |
+
*/
|
110 |
+
require_once plugin_dir_path( __FILE__ ) . 'includes/class-wpdn-ajax.php';
|
111 |
+
$this->ajax = new WPDN_Ajax();
|
112 |
+
|
113 |
+
}
|
114 |
+
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Hooks.
|
118 |
+
*
|
119 |
+
* Init actions and filters.
|
120 |
+
*
|
121 |
+
* @since 1.0.5
|
122 |
+
*/
|
123 |
+
public function hooks() {
|
124 |
+
|
125 |
+
// Add dashboard widget
|
126 |
+
add_action( 'wp_dashboard_setup', array( $this, 'wpdn_init_dashboard_widget' ) );
|
127 |
+
|
128 |
+
// Enqueue scripts
|
129 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
|
130 |
+
|
131 |
+
// Make URLs clickable
|
132 |
+
add_action( 'wpdn_content', array( $this, 'wpdn_clickable_url' ) );
|
133 |
+
|
134 |
+
// Add note button
|
135 |
+
add_filter( 'manage_dashboard_columns', array( $this, 'wpdn_dashboard_columns' ) );
|
136 |
+
|
137 |
+
// Load textdomain
|
138 |
+
load_plugin_textdomain( 'wp-dashboard-notes', false, basename( dirname( __FILE__ ) ) . '/languages' );
|
139 |
+
|
140 |
+
}
|
141 |
+
|
142 |
+
|
143 |
+
/**
|
144 |
+
* Enqueue scripts.
|
145 |
+
*
|
146 |
+
* Enqueue Stylesheet and multiple javascripts.
|
147 |
+
*
|
148 |
+
* @since 1.0.0
|
149 |
+
*/
|
150 |
+
public function admin_enqueue_scripts() {
|
151 |
+
|
152 |
+
// Javascript
|
153 |
+
wp_enqueue_script( 'wpdn_admin_js', plugin_dir_url( __FILE__ ) . 'assets/js/wp-dashboard-notes-admin.min.js', array( 'jquery', 'jquery-ui-sortable' ), $this->version );
|
154 |
+
|
155 |
+
// Stylesheet
|
156 |
+
wp_enqueue_style( 'wpdn_admin_css', plugin_dir_url( __FILE__ ) . 'assets/css/wp-dashboard-notes-admin.min.css', array( 'dashicons' ), $this->version );
|
157 |
+
|
158 |
+
}
|
159 |
+
|
160 |
+
|
161 |
+
/**
|
162 |
+
* Get notes.
|
163 |
+
*
|
164 |
+
* Returns all posts from DB with post type 'note'.
|
165 |
+
*
|
166 |
+
* @since 1.0.0
|
167 |
+
*
|
168 |
+
* @return Array List of all published notes.
|
169 |
+
*/
|
170 |
+
public function wpdn_get_notes() {
|
171 |
+
|
172 |
+
$notes = get_posts( array( 'posts_per_page' => '-1', 'post_type' => 'note' ) );
|
173 |
+
|
174 |
+
return apply_filters( 'wpdn_notes', $notes );
|
175 |
+
|
176 |
+
}
|
177 |
+
|
178 |
+
|
179 |
+
/**
|
180 |
+
* Note meta.
|
181 |
+
*
|
182 |
+
* Return note meta selected by note id.
|
183 |
+
*
|
184 |
+
* @since 1.0.0
|
185 |
+
*
|
186 |
+
* @param int $note_id ID of the note.
|
187 |
+
* @return array Note meta.
|
188 |
+
*/
|
189 |
+
public static function wpdn_get_note_meta( $note_id ) {
|
190 |
+
|
191 |
+
$note_meta = get_post_meta( $note_id, '_note', true );
|
192 |
+
|
193 |
+
if ( ! isset( $note_meta['note_type'] ) ) { $note_meta['note_type'] = 'regular'; }
|
194 |
+
if ( ! isset( $note_meta['color'] ) ) { $note_meta['color'] = '#ffffff'; }
|
195 |
+
if ( ! isset( $note_meta['visibility'] ) ) { $note_meta['visibility'] = 'public'; }
|
196 |
+
if ( ! isset( $note_meta['color_text'] ) ) { $note_meta['color_text'] = 'white'; }
|
197 |
+
|
198 |
+
return apply_filters( 'wpdn_note_meta', $note_meta );
|
199 |
+
|
200 |
+
}
|
201 |
+
|
202 |
+
|
203 |
+
/**
|
204 |
+
* Initialize dashboard notes.
|
205 |
+
*
|
206 |
+
* Get all notes and initialize dashboard widgets.
|
207 |
+
*
|
208 |
+
* @since 1.0.0
|
209 |
+
*/
|
210 |
+
public function wpdn_init_dashboard_widget() {
|
211 |
+
|
212 |
+
$notes = $this->wpdn_get_notes();
|
213 |
+
|
214 |
+
foreach ( $notes as $note ) :
|
215 |
+
|
216 |
+
$note_meta = $this->wpdn_get_note_meta( $note->ID );
|
217 |
+
$user = wp_get_current_user();
|
218 |
+
|
219 |
+
// Skip if private
|
220 |
+
if ( 'private' == $note_meta['visibility'] && $user->ID != $note->post_author ) :
|
221 |
+
continue;
|
222 |
+
endif;
|
223 |
+
|
224 |
+
// Add widget
|
225 |
+
wp_add_dashboard_widget(
|
226 |
+
'note_' . $note->ID,
|
227 |
+
'<span contenteditable="true" class="wpdn-title">' . $note->post_title . '</span><div class="wpdn-edit-title dashicons dashicons-edit"></div><span class="status"></span>',
|
228 |
+
array( $this, 'wpdn_render_dashboard_widget' ),
|
229 |
+
'',
|
230 |
+
$note
|
231 |
+
);
|
232 |
+
|
233 |
+
endforeach;
|
234 |
+
|
235 |
+
}
|
236 |
+
|
237 |
+
|
238 |
+
/**
|
239 |
+
* Render dashboard widget.
|
240 |
+
*
|
241 |
+
* Load data and render the widget with the right colors.
|
242 |
+
*
|
243 |
+
* @since 1.0.0
|
244 |
+
*
|
245 |
+
* @param object $post Post object.
|
246 |
+
* @param array $args Extra arguments.
|
247 |
+
*/
|
248 |
+
public function wpdn_render_dashboard_widget( $post, $args ) {
|
249 |
+
|
250 |
+
$note = $args['args'];
|
251 |
+
$note_meta = $this->wpdn_get_note_meta( $note->ID );
|
252 |
+
$content = apply_filters( 'wpdn_content', $note->post_content );
|
253 |
+
$colors = apply_filters( 'wpdn_colors', array(
|
254 |
+
'white' => '#fff',
|
255 |
+
'red' => '#f7846a',
|
256 |
+
'orange' => '#ffbd22',
|
257 |
+
'yellow' => '#eeee22',
|
258 |
+
'green' => '#bbe535',
|
259 |
+
'blue' => '#66ccdd',
|
260 |
+
'black' => '#777777',
|
261 |
+
) );
|
262 |
+
|
263 |
+
// Inline styling required for note depending colors.
|
264 |
+
?><style>
|
265 |
+
#note_<?php echo $note->ID; ?> { background-color: <?php echo $note_meta['color']; ?>; }
|
266 |
+
#note_<?php echo $note->ID; ?> .hndle { border: none; }
|
267 |
+
</style><?php
|
268 |
+
|
269 |
+
if ( $note_meta['note_type'] == 'regular' ) :
|
270 |
+
require plugin_dir_path( __FILE__ ) . 'includes/templates/note.php';
|
271 |
+
else :
|
272 |
+
require plugin_dir_path( __FILE__ ) . 'includes/templates/note-list.php';
|
273 |
+
endif;
|
274 |
+
|
275 |
+
}
|
276 |
+
|
277 |
+
|
278 |
+
/**
|
279 |
+
* Clickable URL.
|
280 |
+
*
|
281 |
+
* Filter note content to make links clickable.
|
282 |
+
*
|
283 |
+
* @since 1.0.0
|
284 |
+
*
|
285 |
+
* @param string $content Original content.
|
286 |
+
* @return string Edited content.
|
287 |
+
*/
|
288 |
+
public function wpdn_clickable_url( $content ) {
|
289 |
+
|
290 |
+
return make_clickable( $content );
|
291 |
+
|
292 |
+
}
|
293 |
+
|
294 |
+
|
295 |
+
/**
|
296 |
+
* Add button.
|
297 |
+
*
|
298 |
+
* Adds a 'Add note' button to the 'Screen Options' tab.
|
299 |
+
* Triggered via jQuery.
|
300 |
+
*
|
301 |
+
* @since 1.0.0
|
302 |
+
*
|
303 |
+
* @global object $current_screen Information about current screen.
|
304 |
+
*
|
305 |
+
* @param array $columns Array of columns within the screen options tab.
|
306 |
+
* @return array Array of columns within the screen options tab.
|
307 |
+
*/
|
308 |
+
public function wpdn_dashboard_columns( $columns ) {
|
309 |
+
|
310 |
+
global $current_screen;
|
311 |
+
|
312 |
+
if ( $current_screen->id ) :
|
313 |
+
$columns['add_note'] = __( 'Add note', 'wp-dashboard-notes' );
|
314 |
+
endif;
|
315 |
+
return $columns;
|
316 |
+
|
317 |
+
}
|
318 |
+
|
319 |
+
|
320 |
+
}
|
321 |
+
|
322 |
+
|
323 |
+
/**
|
324 |
+
* The main function responsible for returning the WP_Dashboard_Notes object.
|
325 |
+
*
|
326 |
+
* Use this function like you would a global variable, except without needing to declare the global.
|
327 |
+
*
|
328 |
+
* Example: <?php WP_Dashboard_Notes()->method_name(); ?>
|
329 |
+
*
|
330 |
+
* @since 1.0.0
|
331 |
+
*
|
332 |
+
* @return object WP_Dashboard_Notes class object.
|
333 |
+
*/
|
334 |
+
if ( ! function_exists( 'WP_Dashboard_Notes' ) ) :
|
335 |
+
|
336 |
+
function WP_Dashboard_Notes() {
|
337 |
+
return WP_Dashboard_Notes::instance();
|
338 |
+
}
|
339 |
+
|
340 |
+
endif;
|
341 |
+
|
342 |
+
WP_Dashboard_Notes();
|
343 |
+
|
344 |
+
|
345 |
+
// Backwards compatibility
|
346 |
+
$GLOBALS['wp_dashboard_notes'] = WP_Dashboard_Notes();
|