Version Description
- Bug fix:
time
field doesn't work. Link - Bug fix: wrong JS call for
datetime
. Link - Improvement: file and images now not deleted from library, unless use
force_delete
option - Improvement: add
select_advanced
field, which uses select2 for better UX. Thanks @funkedgeek
Download this release
Release Info
Developer | rilwis |
Plugin | Meta Box |
Version | 4.2.2 |
Comparing to | |
See all releases |
Code changes from version 4.2.1 to 4.2.2
- css/select-advanced.css +4 -0
- css/select.css +1 -0
- css/select2/select2.css +524 -0
- css/select2/select2.png +0 -0
- css/select2/select2x2.png +0 -0
- css/select2/spinner.gif +0 -0
- demo/force-delete.php +45 -0
- inc/fields/file.php +8 -3
- inc/fields/file_single.php +198 -0
- inc/fields/image.php +5 -5
- inc/fields/plupload-image.php +32 -26
- inc/fields/select-advanced.php +87 -0
- inc/fields/taxonomy.php +36 -2
- inc/fields/time.php +1 -2
- js/datetime.js +1 -1
- js/file.js +2 -1
- js/plupload-image.js +2 -1
- js/select-advanced.js +20 -0
- js/select2/select2.min.js +82 -0
- js/time.js +1 -1
- meta-box.php +2 -2
- readme.txt +9 -1
css/select-advanced.css
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
#post-body .rwmb-select-advanced {
|
2 |
+
height: auto;
|
3 |
+
min-width: 200px;
|
4 |
+
}
|
css/select.css
CHANGED
@@ -1,3 +1,4 @@
|
|
1 |
#post-body .rwmb-select {
|
2 |
height: auto;
|
|
|
3 |
}
|
1 |
#post-body .rwmb-select {
|
2 |
height: auto;
|
3 |
+
min-width: 200px;
|
4 |
}
|
css/select2/select2.css
ADDED
@@ -0,0 +1,524 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
Version: 3.2 Timestamp: Mon Sep 10 10:38:04 PDT 2012
|
3 |
+
*/
|
4 |
+
.select2-container {
|
5 |
+
position: relative;
|
6 |
+
display: inline-block;
|
7 |
+
/* inline-block for ie7 */
|
8 |
+
zoom: 1;
|
9 |
+
*display: inline;
|
10 |
+
vertical-align: top;
|
11 |
+
}
|
12 |
+
|
13 |
+
.select2-container,
|
14 |
+
.select2-drop,
|
15 |
+
.select2-search,
|
16 |
+
.select2-search input{
|
17 |
+
/*
|
18 |
+
Force border-box so that % widths fit the parent
|
19 |
+
container without overlap because of margin/padding.
|
20 |
+
|
21 |
+
More Info : http://www.quirksmode.org/css/box.html
|
22 |
+
*/
|
23 |
+
-moz-box-sizing: border-box; /* firefox */
|
24 |
+
-ms-box-sizing: border-box; /* ie */
|
25 |
+
-webkit-box-sizing: border-box; /* webkit */
|
26 |
+
-khtml-box-sizing: border-box; /* konqueror */
|
27 |
+
box-sizing: border-box; /* css3 */
|
28 |
+
}
|
29 |
+
|
30 |
+
.select2-container .select2-choice {
|
31 |
+
background-color: #fff;
|
32 |
+
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.5, white));
|
33 |
+
background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 50%);
|
34 |
+
background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 50%);
|
35 |
+
background-image: -o-linear-gradient(bottom, #eeeeee 0%, #ffffff 50%);
|
36 |
+
background-image: -ms-linear-gradient(top, #eeeeee 0%, #ffffff 50%);
|
37 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#eeeeee', endColorstr = '#ffffff', GradientType = 0);
|
38 |
+
background-image: linear-gradient(top, #eeeeee 0%, #ffffff 50%);
|
39 |
+
-webkit-border-radius: 4px;
|
40 |
+
-moz-border-radius: 4px;
|
41 |
+
border-radius: 4px;
|
42 |
+
-moz-background-clip: padding;
|
43 |
+
-webkit-background-clip: padding-box;
|
44 |
+
background-clip: padding-box;
|
45 |
+
border: 1px solid #aaa;
|
46 |
+
display: block;
|
47 |
+
overflow: hidden;
|
48 |
+
white-space: nowrap;
|
49 |
+
position: relative;
|
50 |
+
height: 26px;
|
51 |
+
line-height: 26px;
|
52 |
+
padding: 0 0 0 8px;
|
53 |
+
color: #444;
|
54 |
+
text-decoration: none;
|
55 |
+
}
|
56 |
+
|
57 |
+
.select2-container.select2-drop-above .select2-choice
|
58 |
+
{
|
59 |
+
border-bottom-color: #aaa;
|
60 |
+
-webkit-border-radius:0px 0px 4px 4px;
|
61 |
+
-moz-border-radius:0px 0px 4px 4px;
|
62 |
+
border-radius:0px 0px 4px 4px;
|
63 |
+
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.9, white));
|
64 |
+
background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 90%);
|
65 |
+
background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 90%);
|
66 |
+
background-image: -o-linear-gradient(bottom, #eeeeee 0%, white 90%);
|
67 |
+
background-image: -ms-linear-gradient(top, #eeeeee 0%,#ffffff 90%);
|
68 |
+
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff',GradientType=0 );
|
69 |
+
background-image: linear-gradient(top, #eeeeee 0%,#ffffff 90%);
|
70 |
+
}
|
71 |
+
|
72 |
+
.select2-container .select2-choice span {
|
73 |
+
margin-right: 26px;
|
74 |
+
display: block;
|
75 |
+
overflow: hidden;
|
76 |
+
white-space: nowrap;
|
77 |
+
-o-text-overflow: ellipsis;
|
78 |
+
-ms-text-overflow: ellipsis;
|
79 |
+
text-overflow: ellipsis;
|
80 |
+
}
|
81 |
+
|
82 |
+
.select2-container .select2-choice abbr {
|
83 |
+
display: block;
|
84 |
+
position: absolute;
|
85 |
+
right: 26px;
|
86 |
+
top: 8px;
|
87 |
+
width: 12px;
|
88 |
+
height: 12px;
|
89 |
+
font-size: 1px;
|
90 |
+
background: url('select2.png') right top no-repeat;
|
91 |
+
cursor: pointer;
|
92 |
+
text-decoration: none;
|
93 |
+
border:0;
|
94 |
+
outline: 0;
|
95 |
+
}
|
96 |
+
.select2-container .select2-choice abbr:hover {
|
97 |
+
background-position: right -11px;
|
98 |
+
cursor: pointer;
|
99 |
+
}
|
100 |
+
|
101 |
+
.select2-drop {
|
102 |
+
background: #fff;
|
103 |
+
color: #000;
|
104 |
+
border: 1px solid #aaa;
|
105 |
+
border-top: 0;
|
106 |
+
position: absolute;
|
107 |
+
top: 100%;
|
108 |
+
-webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
|
109 |
+
-moz-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
|
110 |
+
-o-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
|
111 |
+
box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
|
112 |
+
z-index: 9999;
|
113 |
+
width:100%;
|
114 |
+
margin-top:-1px;
|
115 |
+
|
116 |
+
-webkit-border-radius: 0 0 4px 4px;
|
117 |
+
-moz-border-radius: 0 0 4px 4px;
|
118 |
+
border-radius: 0 0 4px 4px;
|
119 |
+
}
|
120 |
+
|
121 |
+
.select2-drop.select2-drop-above {
|
122 |
+
-webkit-border-radius: 4px 4px 0px 0px;
|
123 |
+
-moz-border-radius: 4px 4px 0px 0px;
|
124 |
+
border-radius: 4px 4px 0px 0px;
|
125 |
+
margin-top:1px;
|
126 |
+
border-top: 1px solid #aaa;
|
127 |
+
border-bottom: 0;
|
128 |
+
|
129 |
+
-webkit-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
|
130 |
+
-moz-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
|
131 |
+
-o-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
|
132 |
+
box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
|
133 |
+
}
|
134 |
+
|
135 |
+
.select2-container .select2-choice div {
|
136 |
+
-webkit-border-radius: 0 4px 4px 0;
|
137 |
+
-moz-border-radius: 0 4px 4px 0;
|
138 |
+
border-radius: 0 4px 4px 0;
|
139 |
+
-moz-background-clip: padding;
|
140 |
+
-webkit-background-clip: padding-box;
|
141 |
+
background-clip: padding-box;
|
142 |
+
background: #ccc;
|
143 |
+
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #ccc), color-stop(0.6, #eee));
|
144 |
+
background-image: -webkit-linear-gradient(center bottom, #ccc 0%, #eee 60%);
|
145 |
+
background-image: -moz-linear-gradient(center bottom, #ccc 0%, #eee 60%);
|
146 |
+
background-image: -o-linear-gradient(bottom, #ccc 0%, #eee 60%);
|
147 |
+
background-image: -ms-linear-gradient(top, #cccccc 0%, #eeeeee 60%);
|
148 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#cccccc', endColorstr = '#eeeeee', GradientType = 0);
|
149 |
+
background-image: linear-gradient(top, #cccccc 0%, #eeeeee 60%);
|
150 |
+
border-left: 1px solid #aaa;
|
151 |
+
position: absolute;
|
152 |
+
right: 0;
|
153 |
+
top: 0;
|
154 |
+
display: block;
|
155 |
+
height: 100%;
|
156 |
+
width: 18px;
|
157 |
+
}
|
158 |
+
|
159 |
+
.select2-container .select2-choice div b {
|
160 |
+
background: url('select2.png') no-repeat 0 1px;
|
161 |
+
display: block;
|
162 |
+
width: 100%;
|
163 |
+
height: 100%;
|
164 |
+
}
|
165 |
+
|
166 |
+
.select2-search {
|
167 |
+
display: inline-block;
|
168 |
+
white-space: nowrap;
|
169 |
+
z-index: 10000;
|
170 |
+
min-height: 26px;
|
171 |
+
width: 100%;
|
172 |
+
margin: 0;
|
173 |
+
padding-left: 4px;
|
174 |
+
padding-right: 4px;
|
175 |
+
}
|
176 |
+
|
177 |
+
.select2-search-hidden {
|
178 |
+
display: block;
|
179 |
+
position: absolute;
|
180 |
+
left: -10000px;
|
181 |
+
}
|
182 |
+
|
183 |
+
.select2-search input {
|
184 |
+
background: #fff url('select2.png') no-repeat 100% -22px;
|
185 |
+
background: url('select2.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
|
186 |
+
background: url('select2.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
|
187 |
+
background: url('select2.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
|
188 |
+
background: url('select2.png') no-repeat 100% -22px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
|
189 |
+
background: url('select2.png') no-repeat 100% -22px, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%);
|
190 |
+
background: url('select2.png') no-repeat 100% -22px, linear-gradient(top, #ffffff 85%, #eeeeee 99%);
|
191 |
+
padding: 4px 20px 4px 5px;
|
192 |
+
outline: 0;
|
193 |
+
border: 1px solid #aaa;
|
194 |
+
font-family: sans-serif;
|
195 |
+
font-size: 1em;
|
196 |
+
width:100%;
|
197 |
+
margin:0;
|
198 |
+
height:auto !important;
|
199 |
+
min-height: 26px;
|
200 |
+
-webkit-box-shadow: none;
|
201 |
+
-moz-box-shadow: none;
|
202 |
+
box-shadow: none;
|
203 |
+
border-radius: 0;
|
204 |
+
-moz-border-radius: 0;
|
205 |
+
-webkit-border-radius: 0;
|
206 |
+
}
|
207 |
+
|
208 |
+
.select2-drop.select2-drop-above .select2-search input
|
209 |
+
{
|
210 |
+
margin-top:4px;
|
211 |
+
}
|
212 |
+
|
213 |
+
.select2-search input.select2-active {
|
214 |
+
background: #fff url('spinner.gif') no-repeat 100%;
|
215 |
+
background: url('spinner.gif') no-repeat 100%, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
|
216 |
+
background: url('spinner.gif') no-repeat 100%, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
|
217 |
+
background: url('spinner.gif') no-repeat 100%, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
|
218 |
+
background: url('spinner.gif') no-repeat 100%, -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
|
219 |
+
background: url('spinner.gif') no-repeat 100%, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%);
|
220 |
+
background: url('spinner.gif') no-repeat 100%, linear-gradient(top, #ffffff 85%, #eeeeee 99%);
|
221 |
+
}
|
222 |
+
|
223 |
+
|
224 |
+
.select2-container-active .select2-choice,
|
225 |
+
.select2-container-active .select2-choices {
|
226 |
+
-webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
|
227 |
+
-moz-box-shadow : 0 0 5px rgba(0,0,0,.3);
|
228 |
+
-o-box-shadow : 0 0 5px rgba(0,0,0,.3);
|
229 |
+
box-shadow : 0 0 5px rgba(0,0,0,.3);
|
230 |
+
border: 1px solid #5897fb;
|
231 |
+
outline: none;
|
232 |
+
}
|
233 |
+
|
234 |
+
.select2-dropdown-open .select2-choice {
|
235 |
+
border: 1px solid #aaa;
|
236 |
+
border-bottom-color: transparent;
|
237 |
+
-webkit-box-shadow: 0 1px 0 #fff inset;
|
238 |
+
-moz-box-shadow : 0 1px 0 #fff inset;
|
239 |
+
-o-box-shadow : 0 1px 0 #fff inset;
|
240 |
+
box-shadow : 0 1px 0 #fff inset;
|
241 |
+
background-color: #eee;
|
242 |
+
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, white), color-stop(0.5, #eeeeee));
|
243 |
+
background-image: -webkit-linear-gradient(center bottom, white 0%, #eeeeee 50%);
|
244 |
+
background-image: -moz-linear-gradient(center bottom, white 0%, #eeeeee 50%);
|
245 |
+
background-image: -o-linear-gradient(bottom, white 0%, #eeeeee 50%);
|
246 |
+
background-image: -ms-linear-gradient(top, #ffffff 0%,#eeeeee 50%);
|
247 |
+
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee',GradientType=0 );
|
248 |
+
background-image: linear-gradient(top, #ffffff 0%,#eeeeee 50%);
|
249 |
+
-webkit-border-bottom-left-radius : 0;
|
250 |
+
-webkit-border-bottom-right-radius: 0;
|
251 |
+
-moz-border-radius-bottomleft : 0;
|
252 |
+
-moz-border-radius-bottomright: 0;
|
253 |
+
border-bottom-left-radius : 0;
|
254 |
+
border-bottom-right-radius: 0;
|
255 |
+
}
|
256 |
+
|
257 |
+
.select2-dropdown-open .select2-choice div {
|
258 |
+
background: transparent;
|
259 |
+
border-left: none;
|
260 |
+
}
|
261 |
+
.select2-dropdown-open .select2-choice div b {
|
262 |
+
background-position: -18px 1px;
|
263 |
+
}
|
264 |
+
|
265 |
+
/* results */
|
266 |
+
.select2-results {
|
267 |
+
margin: 4px 4px 4px 0;
|
268 |
+
padding: 0 0 0 4px;
|
269 |
+
position: relative;
|
270 |
+
overflow-x: hidden;
|
271 |
+
overflow-y: auto;
|
272 |
+
max-height: 200px;
|
273 |
+
}
|
274 |
+
|
275 |
+
.select2-results ul.select2-result-sub {
|
276 |
+
margin: 0 0 0 0;
|
277 |
+
}
|
278 |
+
|
279 |
+
.select2-results ul.select2-result-sub > li .select2-result-label { padding-left: 20px }
|
280 |
+
.select2-results ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 40px }
|
281 |
+
.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 60px }
|
282 |
+
.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 80px }
|
283 |
+
.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 100px }
|
284 |
+
.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 110px }
|
285 |
+
.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 120px }
|
286 |
+
|
287 |
+
.select2-results li {
|
288 |
+
list-style: none;
|
289 |
+
display: list-item;
|
290 |
+
}
|
291 |
+
|
292 |
+
.select2-results li.select2-result-with-children > .select2-result-label {
|
293 |
+
font-weight: bold;
|
294 |
+
}
|
295 |
+
|
296 |
+
.select2-results .select2-result-label {
|
297 |
+
padding: 3px 7px 4px;
|
298 |
+
margin: 0;
|
299 |
+
cursor: pointer;
|
300 |
+
}
|
301 |
+
|
302 |
+
.select2-results .select2-highlighted {
|
303 |
+
background: #3875d7;
|
304 |
+
color: #fff;
|
305 |
+
}
|
306 |
+
.select2-results li em {
|
307 |
+
background: #feffde;
|
308 |
+
font-style: normal;
|
309 |
+
}
|
310 |
+
.select2-results .select2-highlighted em {
|
311 |
+
background: transparent;
|
312 |
+
}
|
313 |
+
.select2-results .select2-no-results,
|
314 |
+
.select2-results .select2-searching,
|
315 |
+
.select2-results .select2-selection-limit {
|
316 |
+
background: #f4f4f4;
|
317 |
+
display: list-item;
|
318 |
+
}
|
319 |
+
|
320 |
+
/*
|
321 |
+
disabled look for already selected choices in the results dropdown
|
322 |
+
.select2-results .select2-disabled.select2-highlighted {
|
323 |
+
color: #666;
|
324 |
+
background: #f4f4f4;
|
325 |
+
display: list-item;
|
326 |
+
cursor: default;
|
327 |
+
}
|
328 |
+
.select2-results .select2-disabled {
|
329 |
+
background: #f4f4f4;
|
330 |
+
display: list-item;
|
331 |
+
cursor: default;
|
332 |
+
}
|
333 |
+
*/
|
334 |
+
.select2-results .select2-disabled {
|
335 |
+
display: none;
|
336 |
+
}
|
337 |
+
|
338 |
+
.select2-more-results.select2-active {
|
339 |
+
background: #f4f4f4 url('spinner.gif') no-repeat 100%;
|
340 |
+
}
|
341 |
+
|
342 |
+
.select2-more-results {
|
343 |
+
background: #f4f4f4;
|
344 |
+
display: list-item;
|
345 |
+
}
|
346 |
+
|
347 |
+
/* disabled styles */
|
348 |
+
|
349 |
+
.select2-container.select2-container-disabled .select2-choice {
|
350 |
+
background-color: #f4f4f4;
|
351 |
+
background-image: none;
|
352 |
+
border: 1px solid #ddd;
|
353 |
+
cursor: default;
|
354 |
+
}
|
355 |
+
|
356 |
+
.select2-container.select2-container-disabled .select2-choice div {
|
357 |
+
background-color: #f4f4f4;
|
358 |
+
background-image: none;
|
359 |
+
border-left: 0;
|
360 |
+
}
|
361 |
+
|
362 |
+
|
363 |
+
/* multiselect */
|
364 |
+
|
365 |
+
.select2-container-multi .select2-choices {
|
366 |
+
background-color: #fff;
|
367 |
+
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
|
368 |
+
background-image: -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
|
369 |
+
background-image: -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
|
370 |
+
background-image: -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
|
371 |
+
background-image: -ms-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
|
372 |
+
background-image: linear-gradient(top, #eeeeee 1%, #ffffff 15%);
|
373 |
+
border: 1px solid #aaa;
|
374 |
+
margin: 0;
|
375 |
+
padding: 0;
|
376 |
+
cursor: text;
|
377 |
+
overflow: hidden;
|
378 |
+
height: auto !important;
|
379 |
+
height: 1%;
|
380 |
+
position: relative;
|
381 |
+
}
|
382 |
+
|
383 |
+
.select2-container-multi .select2-choices {
|
384 |
+
min-height: 26px;
|
385 |
+
}
|
386 |
+
|
387 |
+
.select2-container-multi.select2-container-active .select2-choices {
|
388 |
+
-webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
|
389 |
+
-moz-box-shadow : 0 0 5px rgba(0,0,0,.3);
|
390 |
+
-o-box-shadow : 0 0 5px rgba(0,0,0,.3);
|
391 |
+
box-shadow : 0 0 5px rgba(0,0,0,.3);
|
392 |
+
border: 1px solid #5897fb;
|
393 |
+
outline: none;
|
394 |
+
}
|
395 |
+
.select2-container-multi .select2-choices li {
|
396 |
+
float: left;
|
397 |
+
list-style: none;
|
398 |
+
}
|
399 |
+
.select2-container-multi .select2-choices .select2-search-field {
|
400 |
+
white-space: nowrap;
|
401 |
+
margin: 0;
|
402 |
+
padding: 0;
|
403 |
+
}
|
404 |
+
|
405 |
+
.select2-container-multi .select2-choices .select2-search-field input {
|
406 |
+
color: #666;
|
407 |
+
background: transparent !important;
|
408 |
+
font-family: sans-serif;
|
409 |
+
font-size: 100%;
|
410 |
+
height: 15px;
|
411 |
+
padding: 5px;
|
412 |
+
margin: 1px 0;
|
413 |
+
outline: 0;
|
414 |
+
border: 0;
|
415 |
+
-webkit-box-shadow: none;
|
416 |
+
-moz-box-shadow : none;
|
417 |
+
-o-box-shadow : none;
|
418 |
+
box-shadow : none;
|
419 |
+
}
|
420 |
+
|
421 |
+
.select2-container-multi .select2-choices .select2-search-field input.select2-active {
|
422 |
+
background: #fff url('spinner.gif') no-repeat 100% !important;
|
423 |
+
}
|
424 |
+
|
425 |
+
.select2-default {
|
426 |
+
color: #999 !important;
|
427 |
+
}
|
428 |
+
|
429 |
+
.select2-container-multi .select2-choices .select2-search-choice {
|
430 |
+
-webkit-border-radius: 3px;
|
431 |
+
-moz-border-radius : 3px;
|
432 |
+
border-radius : 3px;
|
433 |
+
-moz-background-clip : padding;
|
434 |
+
-webkit-background-clip: padding-box;
|
435 |
+
background-clip : padding-box;
|
436 |
+
background-color: #e4e4e4;
|
437 |
+
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f4f4', endColorstr='#eeeeee', GradientType=0 );
|
438 |
+
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
|
439 |
+
background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
|
440 |
+
background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
|
441 |
+
background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
|
442 |
+
background-image: -ms-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
|
443 |
+
background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
|
444 |
+
-webkit-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
|
445 |
+
-moz-box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
|
446 |
+
box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
|
447 |
+
color: #333;
|
448 |
+
border: 1px solid #aaaaaa;
|
449 |
+
line-height: 13px;
|
450 |
+
padding: 3px 5px 3px 18px;
|
451 |
+
margin: 3px 0 3px 5px;
|
452 |
+
position: relative;
|
453 |
+
cursor: default;
|
454 |
+
}
|
455 |
+
.select2-container-multi .select2-choices .select2-search-choice span {
|
456 |
+
cursor: default;
|
457 |
+
}
|
458 |
+
.select2-container-multi .select2-choices .select2-search-choice-focus {
|
459 |
+
background: #d4d4d4;
|
460 |
+
}
|
461 |
+
|
462 |
+
.select2-search-choice-close {
|
463 |
+
display: block;
|
464 |
+
position: absolute;
|
465 |
+
right: 3px;
|
466 |
+
top: 4px;
|
467 |
+
width: 12px;
|
468 |
+
height: 13px;
|
469 |
+
font-size: 1px;
|
470 |
+
background: url('select2.png') right top no-repeat;
|
471 |
+
outline: none;
|
472 |
+
}
|
473 |
+
|
474 |
+
.select2-container-multi .select2-search-choice-close {
|
475 |
+
left: 3px;
|
476 |
+
}
|
477 |
+
|
478 |
+
|
479 |
+
.select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover {
|
480 |
+
background-position: right -11px;
|
481 |
+
}
|
482 |
+
.select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close {
|
483 |
+
background-position: right -11px;
|
484 |
+
}
|
485 |
+
|
486 |
+
/* disabled styles */
|
487 |
+
|
488 |
+
.select2-container-multi.select2-container-disabled .select2-choices{
|
489 |
+
background-color: #f4f4f4;
|
490 |
+
background-image: none;
|
491 |
+
border: 1px solid #ddd;
|
492 |
+
cursor: default;
|
493 |
+
}
|
494 |
+
|
495 |
+
.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice {
|
496 |
+
background-image: none;
|
497 |
+
background-color: #f4f4f4;
|
498 |
+
border: 1px solid #ddd;
|
499 |
+
padding: 3px 5px 3px 5px;
|
500 |
+
}
|
501 |
+
|
502 |
+
.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close {
|
503 |
+
display: none;
|
504 |
+
}
|
505 |
+
/* end multiselect */
|
506 |
+
|
507 |
+
.select2-result-selectable .select2-match,
|
508 |
+
.select2-result-unselectable .select2-result-selectable .select2-match { text-decoration: underline; }
|
509 |
+
.select2-result-unselectable .select2-match { text-decoration: none; }
|
510 |
+
|
511 |
+
.select2-offscreen { position: absolute; left: -10000px; }
|
512 |
+
|
513 |
+
/* Retina-ize icons */
|
514 |
+
|
515 |
+
@media only screen and (-webkit-min-device-pixel-ratio: 1.5) {
|
516 |
+
.select2-search input, .select2-search-choice-close, .select2-container .select2-choice abbr, .select2-container .select2-choice div b {
|
517 |
+
background-image: url(select2x2.png) !important;
|
518 |
+
background-repeat: no-repeat !important;
|
519 |
+
background-size: 60px 40px !important;
|
520 |
+
}
|
521 |
+
.select2-search input {
|
522 |
+
background-position: 100% -21px !important;
|
523 |
+
}
|
524 |
+
}
|
css/select2/select2.png
ADDED
Binary file
|
css/select2/select2x2.png
ADDED
Binary file
|
css/select2/spinner.gif
ADDED
Binary file
|
demo/force-delete.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
add_action( 'admin_init', 'force_delete_register_meta_boxes' );
|
3 |
+
function force_delete_register_meta_boxes()
|
4 |
+
{
|
5 |
+
if ( !class_exists( 'RW_Meta_Box' ) )
|
6 |
+
return;
|
7 |
+
|
8 |
+
$prefix = '';
|
9 |
+
|
10 |
+
$meta_box = array(
|
11 |
+
'title' => 'Test Meta Box',
|
12 |
+
'fields' => array(
|
13 |
+
// FILE UPLOAD
|
14 |
+
array(
|
15 |
+
'name' => 'File Upload',
|
16 |
+
'id' => "{$prefix}file",
|
17 |
+
'type' => 'file',
|
18 |
+
'force_delete' => true,
|
19 |
+
),
|
20 |
+
// IMAGE UPLOAD
|
21 |
+
array(
|
22 |
+
'name' => 'Image Upload',
|
23 |
+
'id' => "{$prefix}image",
|
24 |
+
'type' => 'image',
|
25 |
+
),
|
26 |
+
// THICKBOX IMAGE UPLOAD (WP 3.3+)
|
27 |
+
array(
|
28 |
+
'name' => 'Thichbox Image Upload',
|
29 |
+
'id' => "{$prefix}thickbox",
|
30 |
+
'type' => 'thickbox_image',
|
31 |
+
'force_delete' => true,
|
32 |
+
),
|
33 |
+
// PLUPLOAD IMAGE UPLOAD (WP 3.3+)
|
34 |
+
array(
|
35 |
+
'name' => 'Plupload Image Upload',
|
36 |
+
'id' => "{$prefix}plupload",
|
37 |
+
'type' => 'plupload_image',
|
38 |
+
'max_file_uploads' => 4,
|
39 |
+
'force_delete' => true,
|
40 |
+
),
|
41 |
+
),
|
42 |
+
);
|
43 |
+
|
44 |
+
new RW_Meta_Box( $meta_box );
|
45 |
+
}
|
inc/fields/file.php
CHANGED
@@ -52,11 +52,12 @@ if ( ! class_exists( 'RWMB_File_Field' ) )
|
|
52 |
$post_id = isset( $_POST['post_id'] ) ? intval( $_POST['post_id'] ) : 0;
|
53 |
$field_id = isset( $_POST['field_id'] ) ? $_POST['field_id'] : 0;
|
54 |
$attachment_id = isset( $_POST['attachment_id'] ) ? intval( $_POST['attachment_id'] ) : 0;
|
|
|
55 |
|
56 |
check_admin_referer( "rwmb-delete-file_{$field_id}" );
|
57 |
|
58 |
delete_post_meta( $post_id, $field_id, $attachment_id );
|
59 |
-
$ok = wp_delete_attachment( $attachment_id );
|
60 |
|
61 |
if ( $ok )
|
62 |
RW_Meta_Box::ajax_response( '', 'success' );
|
@@ -85,7 +86,7 @@ if ( ! class_exists( 'RWMB_File_Field' ) )
|
|
85 |
if ( ! empty( $meta ) )
|
86 |
{
|
87 |
$html .= '<ol class="rwmb-uploaded">';
|
88 |
-
$li = '<li>%s (<a title="%s" class="rwmb-delete-file" href="#" data-field_id="%s" data-attachment_id="%s">%s</a>)</li>';
|
89 |
|
90 |
foreach ( $meta as $attachment_id )
|
91 |
{
|
@@ -96,6 +97,7 @@ if ( ! class_exists( 'RWMB_File_Field' ) )
|
|
96 |
$i18n_delete,
|
97 |
$field['id'],
|
98 |
$attachment_id,
|
|
|
99 |
$i18n_delete
|
100 |
);
|
101 |
}
|
@@ -199,8 +201,11 @@ if ( ! class_exists( 'RWMB_File_Field' ) )
|
|
199 |
*/
|
200 |
static function normalize_field( $field )
|
201 |
{
|
|
|
|
|
|
|
|
|
202 |
$field['multiple'] = true;
|
203 |
-
$field['std'] = empty( $field['std'] ) ? array() : $field['std'];
|
204 |
return $field;
|
205 |
}
|
206 |
}
|
52 |
$post_id = isset( $_POST['post_id'] ) ? intval( $_POST['post_id'] ) : 0;
|
53 |
$field_id = isset( $_POST['field_id'] ) ? $_POST['field_id'] : 0;
|
54 |
$attachment_id = isset( $_POST['attachment_id'] ) ? intval( $_POST['attachment_id'] ) : 0;
|
55 |
+
$force_delete = isset( $_POST['force_delete'] ) ? intval( $_POST['force_delete'] ) : 0;
|
56 |
|
57 |
check_admin_referer( "rwmb-delete-file_{$field_id}" );
|
58 |
|
59 |
delete_post_meta( $post_id, $field_id, $attachment_id );
|
60 |
+
$ok = $force_delete ? wp_delete_attachment( $attachment_id ) : true;
|
61 |
|
62 |
if ( $ok )
|
63 |
RW_Meta_Box::ajax_response( '', 'success' );
|
86 |
if ( ! empty( $meta ) )
|
87 |
{
|
88 |
$html .= '<ol class="rwmb-uploaded">';
|
89 |
+
$li = '<li>%s (<a title="%s" class="rwmb-delete-file" href="#" data-field_id="%s" data-attachment_id="%s" data-force_delete="%s">%s</a>)</li>';
|
90 |
|
91 |
foreach ( $meta as $attachment_id )
|
92 |
{
|
97 |
$i18n_delete,
|
98 |
$field['id'],
|
99 |
$attachment_id,
|
100 |
+
$field['force_delete'] ? 1 : 0,
|
101 |
$i18n_delete
|
102 |
);
|
103 |
}
|
201 |
*/
|
202 |
static function normalize_field( $field )
|
203 |
{
|
204 |
+
$field = wp_parse_args( $field, array(
|
205 |
+
'std' => array(),
|
206 |
+
'force_delete' => false,
|
207 |
+
) );
|
208 |
$field['multiple'] = true;
|
|
|
209 |
return $field;
|
210 |
}
|
211 |
}
|
inc/fields/file_single.php
ADDED
@@ -0,0 +1,198 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Prevent loading this file directly
|
3 |
+
defined( 'ABSPATH' ) || exit;
|
4 |
+
|
5 |
+
if ( ! class_exists( 'RWMB_File_Field' ) )
|
6 |
+
{
|
7 |
+
class RWMB_File_Field
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* Enqueue scripts and styles
|
11 |
+
*
|
12 |
+
* @return void
|
13 |
+
*/
|
14 |
+
static function admin_enqueue_scripts()
|
15 |
+
{
|
16 |
+
wp_enqueue_script( 'rwmb-file', RWMB_JS_URL . 'file.js', array( 'jquery', 'wp-ajax-response' ), RWMB_VER, true );
|
17 |
+
}
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Add actions
|
21 |
+
*
|
22 |
+
* @return void
|
23 |
+
*/
|
24 |
+
static function add_actions()
|
25 |
+
{
|
26 |
+
// Add data encoding type for file uploading
|
27 |
+
add_action( 'post_edit_form_tag', array( __CLASS__, 'post_edit_form_tag' ) );
|
28 |
+
|
29 |
+
// Delete file via Ajax
|
30 |
+
add_action( 'wp_ajax_rwmb_delete_file', array( __CLASS__, 'wp_ajax_delete_file' ) );
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Add data encoding type for file uploading
|
35 |
+
*
|
36 |
+
* @return void
|
37 |
+
*/
|
38 |
+
static function post_edit_form_tag()
|
39 |
+
{
|
40 |
+
echo ' enctype="multipart/form-data"';
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Ajax callback for deleting files.
|
45 |
+
* Modified from a function used by "Verve Meta Boxes" plugin
|
46 |
+
*
|
47 |
+
* @link http://goo.gl/LzYSq
|
48 |
+
* @return void
|
49 |
+
*/
|
50 |
+
static function wp_ajax_delete_file()
|
51 |
+
{
|
52 |
+
$post_id = isset( $_POST['post_id'] ) ? intval( $_POST['post_id'] ) : 0;
|
53 |
+
$field_id = isset( $_POST['field_id'] ) ? $_POST['field_id'] : 0;
|
54 |
+
$attachment_id = isset( $_POST['attachment_id'] ) ? intval( $_POST['attachment_id'] ) : 0;
|
55 |
+
|
56 |
+
check_admin_referer( "rwmb-delete-file_{$field_id}" );
|
57 |
+
|
58 |
+
delete_post_meta( $post_id, $field_id, $attachment_id );
|
59 |
+
$ok = wp_delete_attachment( $attachment_id );
|
60 |
+
|
61 |
+
if ( $ok )
|
62 |
+
RW_Meta_Box::ajax_response( '', 'success' );
|
63 |
+
else
|
64 |
+
RW_Meta_Box::ajax_response( __( 'Error: Cannot delete file', 'rwmb' ), 'error' );
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Get field HTML
|
69 |
+
*
|
70 |
+
* @param string $html
|
71 |
+
* @param mixed $meta
|
72 |
+
* @param array $field
|
73 |
+
*
|
74 |
+
* @return string
|
75 |
+
*/
|
76 |
+
static function html( $html, $meta, $field )
|
77 |
+
{
|
78 |
+
$i18n_delete = _x( 'Delete', 'file upload', 'rwmb' );
|
79 |
+
|
80 |
+
$html = wp_nonce_field( "rwmb-delete-file_{$field['id']}", "nonce-delete-file_{$field['id']}", false, false );
|
81 |
+
|
82 |
+
if ( $meta )
|
83 |
+
{
|
84 |
+
$html .= '<ol class="rwmb-uploaded">';
|
85 |
+
$li = '<li>%s (<a title="%s" class="rwmb-delete-file" href="#" data-field_id="%s" data-attachment_id="%s">%s</a>)</li>';
|
86 |
+
|
87 |
+
$attachment = wp_get_attachment_link( $meta );
|
88 |
+
$html .= sprintf(
|
89 |
+
$li,
|
90 |
+
$attachment,
|
91 |
+
$i18n_delete,
|
92 |
+
$field['id'],
|
93 |
+
$meta,
|
94 |
+
$i18n_delete
|
95 |
+
);
|
96 |
+
|
97 |
+
$html .= '</ol>';
|
98 |
+
}
|
99 |
+
|
100 |
+
// Show form upload
|
101 |
+
$html .= sprintf(
|
102 |
+
'<input type="file" name="%s" />',
|
103 |
+
$field['field_name']
|
104 |
+
);
|
105 |
+
|
106 |
+
return $html;
|
107 |
+
}
|
108 |
+
|
109 |
+
/**
|
110 |
+
* Get meta values to save
|
111 |
+
*
|
112 |
+
* @param mixed $new
|
113 |
+
* @param mixed $old
|
114 |
+
* @param int $post_id
|
115 |
+
* @param array $field
|
116 |
+
*
|
117 |
+
* @return array|mixed
|
118 |
+
*/
|
119 |
+
static function value( $new, $old, $post_id, $field )
|
120 |
+
{
|
121 |
+
$name = $field['id'];
|
122 |
+
if ( empty( $_FILES[$name] ) )
|
123 |
+
return $new;
|
124 |
+
|
125 |
+
$new = array();
|
126 |
+
if ( $field['clone'] )
|
127 |
+
$files = self::fix_file_array( $_FILES[$name] );
|
128 |
+
else
|
129 |
+
$files = array( $_FILES[$name] );
|
130 |
+
|
131 |
+
foreach ( $files as $file_item )
|
132 |
+
{
|
133 |
+
$file = wp_handle_upload( $file_item, array( 'test_form' => false ) );
|
134 |
+
|
135 |
+
if ( ! isset( $file['file'] ) )
|
136 |
+
continue;
|
137 |
+
|
138 |
+
$file_name = $file['file'];
|
139 |
+
|
140 |
+
$attachment = array(
|
141 |
+
'post_mime_type' => $file['type'],
|
142 |
+
'guid' => $file['url'],
|
143 |
+
'post_parent' => $post_id,
|
144 |
+
'post_title' => preg_replace( '/\.[^.]+$/', '', basename( $file_name ) ),
|
145 |
+
'post_content' => '',
|
146 |
+
);
|
147 |
+
$id = wp_insert_attachment( $attachment, $file_name, $post_id );
|
148 |
+
|
149 |
+
if ( ! is_wp_error( $id ) )
|
150 |
+
{
|
151 |
+
wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file_name ) );
|
152 |
+
|
153 |
+
// Save file ID in meta field
|
154 |
+
$new[] = $id;
|
155 |
+
}
|
156 |
+
}
|
157 |
+
|
158 |
+
return $field['clone'] ? $new : array_shift( $new );
|
159 |
+
}
|
160 |
+
|
161 |
+
/**
|
162 |
+
* Fixes the odd indexing of multiple file uploads from the format:
|
163 |
+
* $_FILES['field']['key']['index']
|
164 |
+
* To the more standard and appropriate:
|
165 |
+
* $_FILES['field']['index']['key']
|
166 |
+
*
|
167 |
+
* @param array $files
|
168 |
+
*
|
169 |
+
* @return array
|
170 |
+
*/
|
171 |
+
static function fix_file_array( $files )
|
172 |
+
{
|
173 |
+
$output = array();
|
174 |
+
foreach ( $files as $key => $list )
|
175 |
+
{
|
176 |
+
foreach ( $list as $index => $value )
|
177 |
+
{
|
178 |
+
$output[$index][$key] = $value;
|
179 |
+
}
|
180 |
+
}
|
181 |
+
return $output;
|
182 |
+
}
|
183 |
+
|
184 |
+
/**
|
185 |
+
* Normalize parameters for field
|
186 |
+
*
|
187 |
+
* @param array $field
|
188 |
+
*
|
189 |
+
* @return array
|
190 |
+
*/
|
191 |
+
// static function normalize_field( $field )
|
192 |
+
// {
|
193 |
+
// $field['multiple'] = true;
|
194 |
+
// $field['std'] = empty( $field['std'] ) ? array() : $field['std'];
|
195 |
+
// return $field;
|
196 |
+
// }
|
197 |
+
}
|
198 |
+
}
|
inc/fields/image.php
CHANGED
@@ -115,7 +115,7 @@ if ( ! class_exists( 'RWMB_Image_Field' ) )
|
|
115 |
|
116 |
foreach ( $images as $image )
|
117 |
{
|
118 |
-
$html .= self::img_html( $image, $field
|
119 |
}
|
120 |
|
121 |
$html .= '</ul>';
|
@@ -127,11 +127,11 @@ if ( ! class_exists( 'RWMB_Image_Field' ) )
|
|
127 |
* Get HTML markup for ONE uploaded image
|
128 |
*
|
129 |
* @param int $image Image ID
|
130 |
-
* @param int $
|
131 |
*
|
132 |
* @return string
|
133 |
*/
|
134 |
-
static function img_html( $image, $
|
135 |
{
|
136 |
$i18n_delete = _x( 'Delete', 'image upload', 'rwmb' );
|
137 |
$i18n_edit = _x( 'Edit', 'image upload', 'rwmb' );
|
@@ -140,7 +140,7 @@ if ( ! class_exists( 'RWMB_Image_Field' ) )
|
|
140 |
<img src="%s" />
|
141 |
<div class="rwmb-image-bar">
|
142 |
<a title="%s" class="rwmb-edit-file" href="%s" target="_blank">%s</a> |
|
143 |
-
<a title="%s" class="rwmb-delete-file" href="#" data-field_id="%s" data-attachment_id="%s">%s</a>
|
144 |
</div>
|
145 |
</li>
|
146 |
';
|
@@ -154,7 +154,7 @@ if ( ! class_exists( 'RWMB_Image_Field' ) )
|
|
154 |
$image,
|
155 |
$src,
|
156 |
$i18n_edit, $link, $i18n_edit,
|
157 |
-
$i18n_delete, $
|
158 |
);
|
159 |
}
|
160 |
|
115 |
|
116 |
foreach ( $images as $image )
|
117 |
{
|
118 |
+
$html .= self::img_html( $image, $field );
|
119 |
}
|
120 |
|
121 |
$html .= '</ul>';
|
127 |
* Get HTML markup for ONE uploaded image
|
128 |
*
|
129 |
* @param int $image Image ID
|
130 |
+
* @param int $field
|
131 |
*
|
132 |
* @return string
|
133 |
*/
|
134 |
+
static function img_html( $image, $field )
|
135 |
{
|
136 |
$i18n_delete = _x( 'Delete', 'image upload', 'rwmb' );
|
137 |
$i18n_edit = _x( 'Edit', 'image upload', 'rwmb' );
|
140 |
<img src="%s" />
|
141 |
<div class="rwmb-image-bar">
|
142 |
<a title="%s" class="rwmb-edit-file" href="%s" target="_blank">%s</a> |
|
143 |
+
<a title="%s" class="rwmb-delete-file" href="#" data-field_id="%s" data-attachment_id="%s" data-force_delete="%s">%s</a>
|
144 |
</div>
|
145 |
</li>
|
146 |
';
|
154 |
$image,
|
155 |
$src,
|
156 |
$i18n_edit, $link, $i18n_edit,
|
157 |
+
$i18n_delete, $field['id'], $image, $field['force_delete'] ? 1 : 0, $i18n_delete
|
158 |
);
|
159 |
}
|
160 |
|
inc/fields/plupload-image.php
CHANGED
@@ -25,11 +25,10 @@ if ( ! class_exists( 'RWMB_Plupload_Image_Field' ) )
|
|
25 |
*/
|
26 |
static function handle_upload()
|
27 |
{
|
28 |
-
|
|
|
29 |
|
30 |
-
$
|
31 |
-
if ( is_numeric( $_REQUEST['post_id'] ) )
|
32 |
-
$post_id = (int) $_REQUEST['post_id'];
|
33 |
|
34 |
// You can use WP's wp_handle_upload() function:
|
35 |
$file = $_FILES['async-upload'];
|
@@ -49,10 +48,15 @@ if ( ! class_exists( 'RWMB_Plupload_Image_Field' ) )
|
|
49 |
wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file_attr['file'] ) );
|
50 |
|
51 |
// Save file ID in meta field
|
52 |
-
|
53 |
-
add_post_meta( $post_id, $_REQUEST['field_id'], $id, false );
|
54 |
|
55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
}
|
57 |
|
58 |
exit;
|
@@ -70,25 +74,23 @@ if ( ! class_exists( 'RWMB_Plupload_Image_Field' ) )
|
|
70 |
wp_enqueue_style( 'rwmb-plupload-image', RWMB_CSS_URL . 'plupload-image.css', array( 'wp-admin' ), RWMB_VER );
|
71 |
wp_enqueue_script( 'rwmb-plupload-image', RWMB_JS_URL . 'plupload-image.js', array( 'jquery-ui-sortable', 'wp-ajax-response', 'plupload-all' ), RWMB_VER, true );
|
72 |
wp_localize_script( 'rwmb-plupload-image', 'RWMB', array( 'url' => RWMB_URL ) );
|
73 |
-
wp_localize_script(
|
74 |
-
'
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
'extensions' => 'jpg,jpeg,gif,png',
|
86 |
-
),
|
87 |
),
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
);
|
92 |
}
|
93 |
|
94 |
/**
|
@@ -114,7 +116,11 @@ if ( ! class_exists( 'RWMB_Plupload_Image_Field' ) )
|
|
114 |
$html = wp_nonce_field( "rwmb-delete-file_{$field['id']}", "nonce-delete-file_{$field['id']}", false, false );
|
115 |
$html .= wp_nonce_field( "rwmb-reorder-images_{$field['id']}", "nonce-reorder-images_{$field['id']}", false, false );
|
116 |
$html .= wp_nonce_field( "rwmb-upload-images_{$field['id']}", "nonce-upload-images_{$field['id']}", false, false );
|
117 |
-
$html .=
|
|
|
|
|
|
|
|
|
118 |
|
119 |
// Uploaded images
|
120 |
$html .= "<div id='{$img_prefix}-container'>";
|
25 |
*/
|
26 |
static function handle_upload()
|
27 |
{
|
28 |
+
$post_id = is_numeric( $_REQUEST['post_id'] ) ? $_REQUEST['post_id'] : 0;
|
29 |
+
$field_id = isset( $_REQUEST['field_id'] ) ? $_REQUEST['field_id'] : '';
|
30 |
|
31 |
+
check_admin_referer( "rwmb-upload-images_{$field_id}" );
|
|
|
|
|
32 |
|
33 |
// You can use WP's wp_handle_upload() function:
|
34 |
$file = $_FILES['async-upload'];
|
48 |
wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file_attr['file'] ) );
|
49 |
|
50 |
// Save file ID in meta field
|
51 |
+
add_post_meta( $post_id, $field_id, $id, false );
|
|
|
52 |
|
53 |
+
// Fake field array. We need ID and force_delete only
|
54 |
+
$field = array(
|
55 |
+
'id' => $field_id,
|
56 |
+
'force_delete' => isset( $_REQUEST['force_delete'] ) ? intval( $_REQUEST['force_delete'] ) : 0,
|
57 |
+
);
|
58 |
+
|
59 |
+
RW_Meta_Box::ajax_response( self::img_html( $id, $field ), 'success' );
|
60 |
}
|
61 |
|
62 |
exit;
|
74 |
wp_enqueue_style( 'rwmb-plupload-image', RWMB_CSS_URL . 'plupload-image.css', array( 'wp-admin' ), RWMB_VER );
|
75 |
wp_enqueue_script( 'rwmb-plupload-image', RWMB_JS_URL . 'plupload-image.js', array( 'jquery-ui-sortable', 'wp-ajax-response', 'plupload-all' ), RWMB_VER, true );
|
76 |
wp_localize_script( 'rwmb-plupload-image', 'RWMB', array( 'url' => RWMB_URL ) );
|
77 |
+
wp_localize_script( 'rwmb-plupload-image', 'rwmb_plupload_defaults', array(
|
78 |
+
'runtimes' => 'html5,silverlight,flash,html4',
|
79 |
+
'file_data_name' => 'async-upload',
|
80 |
+
'multiple_queues' => true,
|
81 |
+
'max_file_size' => wp_max_upload_size() . 'b',
|
82 |
+
'url' => admin_url( 'admin-ajax.php' ),
|
83 |
+
'flash_swf_url' => includes_url( 'js/plupload/plupload.flash.swf' ),
|
84 |
+
'silverlight_xap_url' => includes_url( 'js/plupload/plupload.silverlight.xap' ),
|
85 |
+
'filters' => array(
|
86 |
+
array(
|
87 |
+
'title' => _x( 'Allowed Image Files', 'image upload', 'rwmb' ),
|
88 |
+
'extensions' => 'jpg,jpeg,gif,png',
|
|
|
|
|
89 |
),
|
90 |
+
),
|
91 |
+
'multipart' => true,
|
92 |
+
'urlstream_upload' => true,
|
93 |
+
) );
|
94 |
}
|
95 |
|
96 |
/**
|
116 |
$html = wp_nonce_field( "rwmb-delete-file_{$field['id']}", "nonce-delete-file_{$field['id']}", false, false );
|
117 |
$html .= wp_nonce_field( "rwmb-reorder-images_{$field['id']}", "nonce-reorder-images_{$field['id']}", false, false );
|
118 |
$html .= wp_nonce_field( "rwmb-upload-images_{$field['id']}", "nonce-upload-images_{$field['id']}", false, false );
|
119 |
+
$html .= sprintf(
|
120 |
+
'<input type="hidden" class="field-id rwmb-image-prefix" value="%s" data-force_delete="%s" />',
|
121 |
+
$field['id'],
|
122 |
+
$field['force_delete'] ? 1 : 0
|
123 |
+
);
|
124 |
|
125 |
// Uploaded images
|
126 |
$html .= "<div id='{$img_prefix}-container'>";
|
inc/fields/select-advanced.php
ADDED
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Prevent loading this file directly
|
3 |
+
defined( 'ABSPATH' ) || exit;
|
4 |
+
|
5 |
+
// Make sure "select" field is loaded
|
6 |
+
require_once RWMB_FIELDS_DIR . 'select.php';
|
7 |
+
|
8 |
+
if ( !class_exists( 'RWMB_Select_Advanced_Field' ) )
|
9 |
+
{
|
10 |
+
class RWMB_Select_Advanced_Field extends RWMB_Select_Field
|
11 |
+
{
|
12 |
+
/**
|
13 |
+
* Enqueue scripts and styles
|
14 |
+
*
|
15 |
+
* @return void
|
16 |
+
*/
|
17 |
+
static function admin_enqueue_scripts()
|
18 |
+
{
|
19 |
+
wp_enqueue_style( 'select2', RWMB_CSS_URL . 'select2/select2.css', array(), '3.2' );
|
20 |
+
wp_enqueue_style( 'rwmb-select-advanced', RWMB_CSS_URL . 'select-advanced.css', array(), RWMB_VER );
|
21 |
+
|
22 |
+
wp_register_script( 'select2', RWMB_JS_URL . 'select2/select2.min.js', array(), '3.2', true );
|
23 |
+
wp_enqueue_script( 'rwmb-select-advanced', RWMB_JS_URL . 'select-advanced.js', array( 'select2' ), RWMB_VER, true );
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Get field HTML
|
28 |
+
*
|
29 |
+
* @param string $html
|
30 |
+
* @param mixed $meta
|
31 |
+
* @param array $field
|
32 |
+
*
|
33 |
+
* @return string
|
34 |
+
*/
|
35 |
+
static function html( $html, $meta, $field )
|
36 |
+
{
|
37 |
+
$html = sprintf(
|
38 |
+
'<select class="rwmb-select-advanced" name="%s" id="%s"%s data-options="%s">',
|
39 |
+
$field['field_name'],
|
40 |
+
$field['id'],
|
41 |
+
$field['multiple'] ? ' multiple="multiple"' : '',
|
42 |
+
esc_attr( json_encode( $field['js_options'] ) )
|
43 |
+
);
|
44 |
+
if ( !empty( $field['js_options']['placeholder'] ) )
|
45 |
+
$html .= '<option></option>';
|
46 |
+
|
47 |
+
$option = '<option value="%s" %s>%s</option>';
|
48 |
+
|
49 |
+
foreach ( $field['options'] as $value => $label )
|
50 |
+
{
|
51 |
+
$html .= sprintf(
|
52 |
+
$option,
|
53 |
+
$value,
|
54 |
+
selected( in_array( $value, $meta ), true, false ),
|
55 |
+
$label
|
56 |
+
);
|
57 |
+
}
|
58 |
+
$html .= '</select>';
|
59 |
+
|
60 |
+
return $html;
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Normalize parameters for field
|
65 |
+
*
|
66 |
+
* @param array $field
|
67 |
+
*
|
68 |
+
* @return array
|
69 |
+
*/
|
70 |
+
static function normalize_field( $field )
|
71 |
+
{
|
72 |
+
$field = parent::normalize_field( $field );
|
73 |
+
|
74 |
+
$field = wp_parse_args( $field, array(
|
75 |
+
'js_options' => array(),
|
76 |
+
) );
|
77 |
+
|
78 |
+
$field['js_options'] = wp_parse_args( $field['js_options'], array(
|
79 |
+
'allowClear' => true,
|
80 |
+
'width' => 'resolve',
|
81 |
+
'placeholder' => __( 'Select a value', 'rwmb' )
|
82 |
+
) );
|
83 |
+
|
84 |
+
return $field;
|
85 |
+
}
|
86 |
+
}
|
87 |
+
}
|
inc/fields/taxonomy.php
CHANGED
@@ -13,8 +13,12 @@ if ( ! class_exists( 'RWMB_Taxonomy_Field' ) )
|
|
13 |
*/
|
14 |
static function admin_enqueue_scripts()
|
15 |
{
|
|
|
|
|
|
|
|
|
16 |
wp_enqueue_style( 'rwmb-taxonomy', RWMB_CSS_URL . 'taxonomy.css', array(), RWMB_VER );
|
17 |
-
wp_enqueue_script( 'rwmb-taxonomy', RWMB_JS_URL . 'taxonomy.js', array( 'jquery', 'wp-ajax-response' ), RWMB_VER, true );
|
18 |
}
|
19 |
|
20 |
/**
|
@@ -26,6 +30,15 @@ if ( ! class_exists( 'RWMB_Taxonomy_Field' ) )
|
|
26 |
*/
|
27 |
static function normalize_field( $field )
|
28 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
// Default query arguments for get_terms() function
|
30 |
$default_args = array(
|
31 |
'hide_empty' => false,
|
@@ -48,7 +61,7 @@ if ( ! class_exists( 'RWMB_Taxonomy_Field' ) )
|
|
48 |
}
|
49 |
|
50 |
// For select tree: display it as a normal select box (no multiple attribute), but allows to save multiple values
|
51 |
-
if ( 'select_tree' == $field['options']['type'] )
|
52 |
$field['field_name'] = "{$field['id']}[]";
|
53 |
|
54 |
if ( in_array( $field['options']['type'], array( 'checkbox_tree', 'select_tree' ) ) )
|
@@ -113,6 +126,27 @@ if ( ! class_exists( 'RWMB_Taxonomy_Field' ) )
|
|
113 |
$html .= self::walk_select_tree( $meta, $field, $elements, $field['options']['parent'], '', true );
|
114 |
}
|
115 |
// Select
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
else
|
117 |
{
|
118 |
$multiple = $field['multiple'] ? " multiple='multiple' style='height: auto;'" : '';
|
13 |
*/
|
14 |
static function admin_enqueue_scripts()
|
15 |
{
|
16 |
+
wp_enqueue_style( 'select2', RWMB_CSS_URL . 'select2-css/select2.css', array(), '3.2' );
|
17 |
+
wp_enqueue_style( 'rwmb-select-advanced', RWMB_CSS_URL . 'select-advanced.css', array(), RWMB_VER );
|
18 |
+
wp_register_script( 'select2', RWMB_JS_URL . 'select2-js/select2.js', array(), '3.2', true );
|
19 |
+
wp_register_script( 'select_advanced', RWMB_JS_URL . 'select-advanced.js', array('select2'), RWMB_VER, true );
|
20 |
wp_enqueue_style( 'rwmb-taxonomy', RWMB_CSS_URL . 'taxonomy.css', array(), RWMB_VER );
|
21 |
+
wp_enqueue_script( 'rwmb-taxonomy', RWMB_JS_URL . 'taxonomy.js', array( 'jquery', 'select_advanced', 'wp-ajax-response' ), RWMB_VER, true );
|
22 |
}
|
23 |
|
24 |
/**
|
30 |
*/
|
31 |
static function normalize_field( $field )
|
32 |
{
|
33 |
+
$field = wp_parse_args( $field, array(
|
34 |
+
'js_options' => array(),
|
35 |
+
) );
|
36 |
+
|
37 |
+
$field['js_options'] = wp_parse_args( $field['js_options'], array(
|
38 |
+
'allowClear' => true,
|
39 |
+
'width' => 'resolve',
|
40 |
+
'placeholder' => "Select a Value"
|
41 |
+
) );
|
42 |
// Default query arguments for get_terms() function
|
43 |
$default_args = array(
|
44 |
'hide_empty' => false,
|
61 |
}
|
62 |
|
63 |
// For select tree: display it as a normal select box (no multiple attribute), but allows to save multiple values
|
64 |
+
if ( 'select_tree' == $field['options']['type'] || ('select_advanced' == $field['options']['type'] && $field['multiple'] == true) )
|
65 |
$field['field_name'] = "{$field['id']}[]";
|
66 |
|
67 |
if ( in_array( $field['options']['type'], array( 'checkbox_tree', 'select_tree' ) ) )
|
126 |
$html .= self::walk_select_tree( $meta, $field, $elements, $field['options']['parent'], '', true );
|
127 |
}
|
128 |
// Select
|
129 |
+
elseif ( 'select_advanced' === $options['type'] ) {
|
130 |
+
$html = sprintf(
|
131 |
+
'<select class="rwmb-select-advanced" name="%s" id="%s"%s data-options ="%s">',
|
132 |
+
$field['field_name'],
|
133 |
+
$field['id'],
|
134 |
+
$field['multiple'] ? ' multiple="multiple"' : '',
|
135 |
+
esc_attr( json_encode( $field['js_options'] ))
|
136 |
+
);
|
137 |
+
$option = '<option value="%s" %s>%s</option>';
|
138 |
+
|
139 |
+
foreach ( $terms as $term )
|
140 |
+
{
|
141 |
+
$html .= sprintf(
|
142 |
+
$option,
|
143 |
+
$term->slug,
|
144 |
+
selected( in_array( $term->slug, $meta ), true, false ),
|
145 |
+
$term->name
|
146 |
+
);
|
147 |
+
}
|
148 |
+
$html .= '</select>';
|
149 |
+
}
|
150 |
else
|
151 |
{
|
152 |
$multiple = $field['multiple'] ? " multiple='multiple' style='height: auto;'" : '';
|
inc/fields/time.php
CHANGED
@@ -37,7 +37,7 @@ if ( ! class_exists( 'RWMB_Time_Field' ) )
|
|
37 |
static function html( $html, $meta, $field )
|
38 |
{
|
39 |
return sprintf(
|
40 |
-
'<input type="text" class="rwmb-
|
41 |
$field['field_name'],
|
42 |
$meta,
|
43 |
isset( $field['clone'] ) && $field['clone'] ? '' : $field['id'],
|
@@ -63,7 +63,6 @@ if ( ! class_exists( 'RWMB_Time_Field' ) )
|
|
63 |
// Deprecate 'format', but keep it for backward compatible
|
64 |
// Use 'js_options' instead
|
65 |
$field['js_options'] = wp_parse_args( $field['js_options'], array(
|
66 |
-
'timeOnly' => true,
|
67 |
'showButtonPanel' => true,
|
68 |
'timeFormat' => empty( $field['format'] ) ? 'hh:mm:ss' : $field['format'],
|
69 |
) );
|
37 |
static function html( $html, $meta, $field )
|
38 |
{
|
39 |
return sprintf(
|
40 |
+
'<input type="text" class="rwmb-time" name="%s" value="%s" id="%s" size="%s" data-options="%s" />',
|
41 |
$field['field_name'],
|
42 |
$meta,
|
43 |
isset( $field['clone'] ) && $field['clone'] ? '' : $field['id'],
|
63 |
// Deprecate 'format', but keep it for backward compatible
|
64 |
// Use 'js_options' instead
|
65 |
$field['js_options'] = wp_parse_args( $field['js_options'], array(
|
|
|
66 |
'showButtonPanel' => true,
|
67 |
'timeFormat' => empty( $field['format'] ) ? 'hh:mm:ss' : $field['format'],
|
68 |
) );
|
js/datetime.js
CHANGED
@@ -12,7 +12,7 @@ function rwmb_update_datetime_picker()
|
|
12 |
options = $this.data( 'options' );
|
13 |
|
14 |
$this.siblings( '.ui-datepicker-append' ).remove(); // Remove appended text
|
15 |
-
$this.removeClass( 'hasDatepicker' ).
|
16 |
} );
|
17 |
}
|
18 |
|
12 |
options = $this.data( 'options' );
|
13 |
|
14 |
$this.siblings( '.ui-datepicker-append' ).remove(); // Remove appended text
|
15 |
+
$this.removeClass( 'hasDatepicker' ).datetimepicker( options );
|
16 |
} );
|
17 |
}
|
18 |
|
js/file.js
CHANGED
@@ -21,7 +21,8 @@ jQuery( document ).ready( function( $ )
|
|
21 |
_wpnonce : $( '#nonce-delete-file_' + field_id ).val(),
|
22 |
post_id : $( '#post_ID' ).val(),
|
23 |
field_id : field_id,
|
24 |
-
attachment_id: $this.data( 'attachment_id' )
|
|
|
25 |
};
|
26 |
|
27 |
$.post( ajaxurl, data, function( r )
|
21 |
_wpnonce : $( '#nonce-delete-file_' + field_id ).val(),
|
22 |
post_id : $( '#post_ID' ).val(),
|
23 |
field_id : field_id,
|
24 |
+
attachment_id: $this.data( 'attachment_id' ),
|
25 |
+
force_delete : $this.data( 'force_delete' )
|
26 |
};
|
27 |
|
28 |
$.post( ajaxurl, data, function( r )
|
js/plupload-image.js
CHANGED
@@ -54,7 +54,8 @@ jQuery( document ).ready( function( $ )
|
|
54 |
action : 'rwmb_plupload_image_upload',
|
55 |
field_id: prefix,
|
56 |
_wpnonce: nonce,
|
57 |
-
post_id : $( '#post_ID' ).val()
|
|
|
58 |
};
|
59 |
|
60 |
// Create new uploader
|
54 |
action : 'rwmb_plupload_image_upload',
|
55 |
field_id: prefix,
|
56 |
_wpnonce: nonce,
|
57 |
+
post_id : $( '#post_ID' ).val(),
|
58 |
+
force_delete: $( this ).data( 'force_delete' )
|
59 |
};
|
60 |
|
61 |
// Create new uploader
|
js/select-advanced.js
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Update select2
|
3 |
+
* Used for static & dynamic added elements (when clone)
|
4 |
+
*/
|
5 |
+
function rwmb_update_select_advanced()
|
6 |
+
{
|
7 |
+
var $ = jQuery;
|
8 |
+
|
9 |
+
$( '.rwmb-select-advanced' ).each( function ()
|
10 |
+
{
|
11 |
+
var $this = $( this ),
|
12 |
+
options = $this.data( 'options' );
|
13 |
+
$this.select2( options );
|
14 |
+
} );
|
15 |
+
}
|
16 |
+
|
17 |
+
jQuery( document ).ready( function ()
|
18 |
+
{
|
19 |
+
rwmb_update_select_advanced();
|
20 |
+
} );
|
js/select2/select2.min.js
ADDED
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
Copyright 2012 Igor Vaynberg
|
3 |
+
|
4 |
+
Version: 3.2 Timestamp: Mon Sep 10 10:38:04 PDT 2012
|
5 |
+
|
6 |
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in
|
7 |
+
compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:
|
8 |
+
|
9 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
10 |
+
|
11 |
+
Unless required by applicable law or agreed to in writing, software distributed under the License is
|
12 |
+
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
+
See the License for the specific language governing permissions and limitations under the License.
|
14 |
+
*/
|
15 |
+
(function(e){"undefined"==typeof e.fn.each2&&e.fn.extend({each2:function(g){for(var i=e([0]),m=-1,s=this.length;++m<s&&(i.context=i[0]=this[m])&&!1!==g.call(i[0],m,i););return this}})})(jQuery);
|
16 |
+
(function(e,g){function i(a,b){var c=0,d=b.length,j;if("undefined"===typeof a)return-1;if(a.constructor===String)for(;c<d;c+=1){if(0===a.localeCompare(b[c]))return c}else for(;c<d;c+=1)if(j=b[c],j.constructor===String){if(0===j.localeCompare(a))return c}else if(j===a)return c;return-1}function m(a,b){return a===b?!0:a===g||b===g||null===a||null===b?!1:a.constructor===String?0===a.localeCompare(b):b.constructor===String?0===b.localeCompare(a):!1}function s(a,b){var c,d,j;if(null===a||1>a.length)return[];
|
17 |
+
c=a.split(b);d=0;for(j=c.length;d<j;d+=1)c[d]=e.trim(c[d]);return c}function A(a,b,c){var c=c||g,d;return function(){var j=arguments;window.clearTimeout(d);d=window.setTimeout(function(){b.apply(c,j)},a)}}function l(a){a.preventDefault();a.stopPropagation()}function B(a,b,c){var d=a.toUpperCase().indexOf(b.toUpperCase()),b=b.length;0>d?c.push(a):(c.push(a.substring(0,d)),c.push("<span class='select2-match'>"),c.push(a.substring(d,d+b)),c.push("</span>"),c.push(a.substring(d+b,a.length)))}function C(a){var b,
|
18 |
+
c=0,d=null,j=a.quietMillis||100;return function(h){window.clearTimeout(b);b=window.setTimeout(function(){var b=c+=1,j=a.data,n=a.transport||e.ajax,f=a.traditional||!1,g=a.type||"GET",j=j.call(this,h.term,h.page,h.context);null!==d&&d.abort();d=n.call(null,{url:a.url,dataType:a.dataType,data:j,type:g,traditional:f,success:function(d){b<c||(d=a.results(d,h.page),h.callback(d))}})},j)}}function D(a){var b=a,c,d=function(a){return""+a.text};e.isArray(b)||(d=b.text,e.isFunction(d)||(c=b.text,d=function(a){return a[c]}),
|
19 |
+
b=b.results);return function(a){var c=a.term,f={results:[]},k;if(c==="")a.callback({results:b});else{k=function(b,f){var g,t,b=b[0];if(b.children){g={};for(t in b)b.hasOwnProperty(t)&&(g[t]=b[t]);g.children=[];e(b.children).each2(function(a,b){k(b,g.children)});g.children.length&&f.push(g)}else a.matcher(c,d(b))&&f.push(b)};e(b).each2(function(a,b){k(b,f.results)});a.callback(f)}}}function E(a){return e.isFunction(a)?a:function(b){var c=b.term,d={results:[]};e(a).each(function(){var a=this.text!==
|
20 |
+
g,e=a?this.text:this;if(""===c||b.matcher(c,e))d.results.push(a?this:{id:this,text:this})});b.callback(d)}}function u(a){if(e.isFunction(a))return!0;if(!a)return!1;throw Error("formatterName must be a function or a falsy value");}function v(a){return e.isFunction(a)?a():a}function F(a){var b=0;e.each(a,function(a,d){d.children?b+=F(d.children):b++});return b}function H(a,b,c,d){var e=a,h=!1,f,k,n,o;if(!d.createSearchChoice||!d.tokenSeparators||1>d.tokenSeparators.length)return g;for(;;){h=-1;k=0;
|
21 |
+
for(n=d.tokenSeparators.length;k<n&&!(o=d.tokenSeparators[k],h=a.indexOf(o),0<=h);k++);if(0>h)break;f=a.substring(0,h);a=a.substring(h+o.length);if(0<f.length&&(f=d.createSearchChoice(f,b),f!==g&&null!==f&&d.id(f)!==g&&null!==d.id(f))){h=!1;k=0;for(n=b.length;k<n;k++)if(m(d.id(f),d.id(b[k]))){h=!0;break}h||c(f)}}if(0!=e.localeCompare(a))return a}function x(a,b){var c=function(){};c.prototype=new a;c.prototype.constructor=c;c.prototype.parent=a.prototype;c.prototype=e.extend(c.prototype,b);return c}
|
22 |
+
if(window.Select2===g){var f,w,y,z,G,q;f={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(a){a=a.which?a.which:a;switch(a){case f.LEFT:case f.RIGHT:case f.UP:case f.DOWN:return!0}return!1},isControl:function(a){switch(a.which){case f.SHIFT:case f.CTRL:case f.ALT:return!0}return a.metaKey?!0:!1},isFunctionKey:function(a){a=a.which?a.which:a;return 112<=a&&123>=a}};var I=1;G=function(){return I++};
|
23 |
+
e(document).delegate("body","mousemove",function(a){e.data(document,"select2-lastpos",{x:a.pageX,y:a.pageY})});e(document).ready(function(){e(document).delegate("body","mousedown touchend",function(a){var b=e(a.target).closest("div.select2-container").get(0),c;b?e(document).find("div.select2-container-active").each(function(){this!==b&&e(this).data("select2").blur()}):(b=e(a.target).closest("div.select2-drop").get(0),e(document).find("div.select2-drop-active").each(function(){this!==b&&e(this).data("select2").blur()}));
|
24 |
+
b=e(a.target);c=b.attr("for");"LABEL"===a.target.tagName&&(c&&0<c.length)&&(b=e("#"+c),b=b.data("select2"),b!==g&&(b.focus(),a.preventDefault()))})});w=x(Object,{bind:function(a){var b=this;return function(){a.apply(b,arguments)}},init:function(a){var b,c;this.opts=a=this.prepareOpts(a);this.id=a.id;a.element.data("select2")!==g&&null!==a.element.data("select2")&&this.destroy();this.enabled=!0;this.container=this.createContainer();this.containerId="s2id_"+(a.element.attr("id")||"autogen"+G());this.containerSelector=
|
25 |
+
"#"+this.containerId.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1");this.container.attr("id",this.containerId);var d=!1,j;this.body=function(){!1===d&&(j=a.element.closest("body"),d=!0);return j};a.element.attr("class")!==g&&this.container.addClass(a.element.attr("class").replace(/validate\[[\S ]+] ?/,""));this.container.css(v(a.containerCss));this.container.addClass(v(a.containerCssClass));this.opts.element.data("select2",this).hide().before(this.container);this.container.data("select2",
|
26 |
+
this);this.dropdown=this.container.find(".select2-drop");this.dropdown.addClass(v(a.dropdownCssClass));this.dropdown.data("select2",this);this.results=b=this.container.find(".select2-results");this.search=c=this.container.find("input.select2-input");c.attr("tabIndex",this.opts.element.attr("tabIndex"));this.resultsPage=0;this.context=null;this.initContainer();this.initContainerWidth();this.results.bind("mousemove",function(a){var b=e.data(document,"select2-lastpos");(b===g||b.x!==a.pageX||b.y!==a.pageY)&&
|
27 |
+
e(a.target).trigger("mousemove-filtered",a)});this.dropdown.delegate(".select2-results","mousemove-filtered",this.bind(this.highlightUnderEvent));var h=this.results,f=A(80,function(a){h.trigger("scroll-debounced",a)});h.bind("scroll",function(a){0<=i(a.target,h.get())&&f(a)});this.dropdown.delegate(".select2-results","scroll-debounced",this.bind(this.loadMoreIfNeeded));e.fn.mousewheel&&b.mousewheel(function(a,c,d,e){c=b.scrollTop();0<e&&0>=c-e?(b.scrollTop(0),l(a)):0>e&&b.get(0).scrollHeight-b.scrollTop()+
|
28 |
+
e<=b.height()&&(b.scrollTop(b.get(0).scrollHeight-b.height()),l(a))});c.bind("keydown",function(){e.data(c,"keyup-change-value")===g&&e.data(c,"keyup-change-value",c.val())});c.bind("keyup",function(){var a=e.data(c,"keyup-change-value");a!==g&&c.val()!==a&&(e.removeData(c,"keyup-change-value"),c.trigger("keyup-change"))});c.bind("keyup-change",this.bind(this.updateResults));c.bind("focus",function(){c.addClass("select2-focused");" "===c.val()&&c.val("")});c.bind("blur",function(){c.removeClass("select2-focused")});
|
29 |
+
this.dropdown.delegate(".select2-results","mouseup",this.bind(function(a){0<e(a.target).closest(".select2-result-selectable:not(.select2-disabled)").length?(this.highlightUnderEvent(a),this.selectHighlighted(a)):this.focusSearch();l(a)}));this.dropdown.bind("click mouseup mousedown",function(a){a.stopPropagation()});e.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource());(a.element.is(":disabled")||a.element.is("[readonly='readonly']"))&&this.disable()},destroy:function(){var a=
|
30 |
+
this.opts.element.data("select2");a!==g&&(a.container.remove(),a.dropdown.remove(),a.opts.element.removeData("select2").unbind(".select2").show())},prepareOpts:function(a){var b,c,d;b=a.element;"select"===b.get(0).tagName.toLowerCase()&&(this.select=c=a.element);c&&e.each("id multiple ajax query createSearchChoice initSelection data tags".split(" "),function(){if(this in a)throw Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.");});a=e.extend({},{populateResults:function(b,
|
31 |
+
c,d){var f,n=this.opts.id,o=this;f=function(b,c,j){var h,l,i,m,r,p,q;h=0;for(l=b.length;h<l;h=h+1){i=b[h];m=n(i)!==g;r=i.children&&i.children.length>0;p=e("<li></li>");p.addClass("select2-results-dept-"+j);p.addClass("select2-result");p.addClass(m?"select2-result-selectable":"select2-result-unselectable");r&&p.addClass("select2-result-with-children");p.addClass(o.opts.formatResultCssClass(i));m=e("<div></div>");m.addClass("select2-result-label");q=a.formatResult(i,m,d);q!==g&&m.html(o.opts.escapeMarkup(q));
|
32 |
+
p.append(m);if(r){r=e("<ul></ul>");r.addClass("select2-result-sub");f(i.children,r,j+1);p.append(r)}p.data("select2-data",i);c.append(p)}};f(c,b,0)}},e.fn.select2.defaults,a);"function"!==typeof a.id&&(d=a.id,a.id=function(a){return a[d]});if(c)a.query=this.bind(function(a){var c={results:[],more:false},d=a.term,f,n,o;o=function(b,c){var e;if(b.is("option"))a.matcher(d,b.text(),b)&&c.push({id:b.attr("value"),text:b.text(),element:b.get(),css:b.attr("class")});else if(b.is("optgroup")){e={text:b.attr("label"),
|
33 |
+
children:[],element:b.get(),css:b.attr("class")};b.children().each2(function(a,b){o(b,e.children)});e.children.length>0&&c.push(e)}};f=b.children();if(this.getPlaceholder()!==g&&f.length>0){n=f[0];e(n).text()===""&&(f=f.not(n))}f.each2(function(a,b){o(b,c.results)});a.callback(c)}),a.id=function(a){return a.id},a.formatResultCssClass=function(a){return a.css};else if(!("query"in a))if("ajax"in a){if((c=a.element.data("ajax-url"))&&0<c.length)a.ajax.url=c;a.query=C(a.ajax)}else"data"in a?a.query=D(a.data):
|
34 |
+
"tags"in a&&(a.query=E(a.tags),a.createSearchChoice=function(a){return{id:a,text:a}},a.initSelection=function(b,c){var d=[];e(s(b.val(),a.separator)).each(function(){var b=this,c=this,j=a.tags;e.isFunction(j)&&(j=j());e(j).each(function(){if(m(this.id,b)){c=this.text;return false}});d.push({id:b,text:c})});c(d)});if("function"!==typeof a.query)throw"query function not defined for Select2 "+a.element.attr("id");return a},monitorSource:function(){this.opts.element.bind("change.select2",this.bind(function(){!0!==
|
35 |
+
this.opts.element.data("select2-change-triggered")&&this.initSelection()}))},triggerChange:function(a){a=a||{};a=e.extend({},a,{type:"change",val:this.val()});this.opts.element.data("select2-change-triggered",!0);this.opts.element.trigger(a);this.opts.element.data("select2-change-triggered",!1);this.opts.element.click();this.opts.blurOnChange&&this.opts.element.blur()},enable:function(){this.enabled||(this.enabled=!0,this.container.removeClass("select2-container-disabled"))},disable:function(){this.enabled&&
|
36 |
+
(this.close(),this.enabled=!1,this.container.addClass("select2-container-disabled"))},opened:function(){return this.container.hasClass("select2-dropdown-open")},positionDropdown:function(){var a=this.container.offset(),b=this.container.outerHeight(),c=this.container.outerWidth(),d=this.dropdown.outerHeight(),j=e(window).scrollTop()+document.documentElement.clientHeight,b=a.top+b,f=a.left,j=b+d<=j,g=a.top-d>=this.body().scrollTop(),k=this.dropdown.hasClass("select2-drop-above"),n;"static"!==this.body().css("position")&&
|
37 |
+
(n=this.body().offset(),b-=n.top,f-=n.left);k?(k=!0,!g&&j&&(k=!1)):(k=!1,!j&&g&&(k=!0));k?(b=a.top-d,this.container.addClass("select2-drop-above"),this.dropdown.addClass("select2-drop-above")):(this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above"));a=e.extend({top:b,left:f,width:c},v(this.opts.dropdownCss));this.dropdown.css(a)},shouldOpen:function(){var a;if(this.opened())return!1;a=e.Event("open");this.opts.element.trigger(a);return!a.isDefaultPrevented()},
|
38 |
+
clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above");this.dropdown.removeClass("select2-drop-above")},open:function(){if(!this.shouldOpen())return!1;window.setTimeout(this.bind(this.opening),1);return!0},opening:function(){var a=this.containerId,b=this.containerSelector,c="scroll."+a,d="resize."+a;this.container.parents().each(function(){e(this).bind(c,function(){var a=e(b);0==a.length&&e(this).unbind(c);a.select2("close")})});e(window).bind(d,function(){var a=
|
39 |
+
e(b);0==a.length&&e(window).unbind(d);a.select2("close")});this.clearDropdownAlignmentPreference();" "===this.search.val()&&this.search.val("");this.container.addClass("select2-dropdown-open").addClass("select2-container-active");this.updateResults(!0);this.dropdown[0]!==this.body().children().last()[0]&&this.dropdown.detach().appendTo(this.body());this.dropdown.show();this.positionDropdown();this.dropdown.addClass("select2-drop-active");this.ensureHighlightVisible();this.focusSearch()},close:function(){if(this.opened()){var a=
|
40 |
+
this;this.container.parents().each(function(){e(this).unbind("scroll."+a.containerId)});e(window).unbind("resize."+this.containerId);this.clearDropdownAlignmentPreference();this.dropdown.hide();this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active");this.results.empty();this.clearSearch();this.opts.element.trigger(e.Event("close"))}},clearSearch:function(){},ensureHighlightVisible:function(){var a=this.results,b,c,d,f;c=this.highlight();0>c||(0==c?a.scrollTop(0):
|
41 |
+
(b=a.find(".select2-result-selectable"),d=e(b[c]),f=d.offset().top+d.outerHeight(),c===b.length-1&&(b=a.find("li.select2-more-results"),0<b.length&&(f=b.offset().top+b.outerHeight())),b=a.offset().top+a.outerHeight(),f>b&&a.scrollTop(a.scrollTop()+(f-b)),d=d.offset().top-a.offset().top,0>d&&a.scrollTop(a.scrollTop()+d)))},moveHighlight:function(a){for(var b=this.results.find(".select2-result-selectable"),c=this.highlight();-1<c&&c<b.length;){var c=c+a,d=e(b[c]);if(d.hasClass("select2-result-selectable")&&
|
42 |
+
!d.hasClass("select2-disabled")){this.highlight(c);break}}},highlight:function(a){var b=this.results.find(".select2-result-selectable").not(".select2-disabled");if(0===arguments.length)return i(b.filter(".select2-highlighted")[0],b.get());a>=b.length&&(a=b.length-1);0>a&&(a=0);b.removeClass("select2-highlighted");e(b[a]).addClass("select2-highlighted");this.ensureHighlightVisible()},countSelectableResults:function(){return this.results.find(".select2-result-selectable").not(".select2-disabled").length},
|
43 |
+
highlightUnderEvent:function(a){a=e(a.target).closest(".select2-result-selectable");if(0<a.length&&!a.is(".select2-highlighted")){var b=this.results.find(".select2-result-selectable");this.highlight(b.index(a))}else 0==a.length&&this.results.find(".select2-highlighted").removeClass("select2-highlighted")},loadMoreIfNeeded:function(){var a=this.results,b=a.find("li.select2-more-results"),c,d=this.resultsPage+1,e=this,f=this.search.val(),g=this.context;0!==b.length&&(c=b.offset().top-a.offset().top-
|
44 |
+
a.height(),0>=c&&(b.addClass("select2-active"),this.opts.query({term:f,page:d,context:g,matcher:this.opts.matcher,callback:this.bind(function(c){e.opened()&&(e.opts.populateResults.call(this,a,c.results,{term:f,page:d,context:g}),!0===c.more?(b.detach().appendTo(a).text(e.opts.formatLoadMore(d+1)),window.setTimeout(function(){e.loadMoreIfNeeded()},10)):b.remove(),e.positionDropdown(),e.resultsPage=d)})})))},tokenize:function(){},updateResults:function(a){function b(){f.scrollTop(0);d.removeClass("select2-active");
|
45 |
+
k.positionDropdown()}function c(a){f.html(k.opts.escapeMarkup(a));b()}var d=this.search,f=this.results,h=this.opts,i,k=this;if(!(!0!==a&&(!1===this.showSearchInput||!this.opened()))){d.addClass("select2-active");if(1<=h.maximumSelectionSize&&(i=this.data(),e.isArray(i)&&i.length>=h.maximumSelectionSize&&u(h.formatSelectionTooBig,"formatSelectionTooBig"))){c("<li class='select2-selection-limit'>"+h.formatSelectionTooBig(h.maximumSelectionSize)+"</li>");return}d.val().length<h.minimumInputLength&&u(h.formatInputTooShort,
|
46 |
+
"formatInputTooShort")?c("<li class='select2-no-results'>"+h.formatInputTooShort(d.val(),h.minimumInputLength)+"</li>"):(c("<li class='select2-searching'>"+h.formatSearching()+"</li>"),i=this.tokenize(),i!=g&&null!=i&&d.val(i),this.resultsPage=1,h.query({term:d.val(),page:this.resultsPage,context:null,matcher:h.matcher,callback:this.bind(function(i){var l;this.opened()&&((this.context=i.context===g?null:i.context,this.opts.createSearchChoice&&""!==d.val()&&(l=this.opts.createSearchChoice.call(null,
|
47 |
+
d.val(),i.results),l!==g&&null!==l&&k.id(l)!==g&&null!==k.id(l)&&0===e(i.results).filter(function(){return m(k.id(this),k.id(l))}).length&&i.results.unshift(l)),0===i.results.length&&u(h.formatNoMatches,"formatNoMatches"))?c("<li class='select2-no-results'>"+h.formatNoMatches(d.val())+"</li>"):(f.empty(),k.opts.populateResults.call(this,f,i.results,{term:d.val(),page:this.resultsPage,context:null}),!0===i.more&&u(h.formatLoadMore,"formatLoadMore")&&(f.append("<li class='select2-more-results'>"+k.opts.escapeMarkup(h.formatLoadMore(this.resultsPage))+
|
48 |
+
"</li>"),window.setTimeout(function(){k.loadMoreIfNeeded()},10)),this.postprocessResults(i,a),b()))})}))}},cancel:function(){this.close()},blur:function(){this.close();this.container.removeClass("select2-container-active");this.dropdown.removeClass("select2-drop-active");this.search[0]===document.activeElement&&this.search.blur();this.clearSearch();this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){this.search.show();this.search.focus();
|
49 |
+
window.setTimeout(this.bind(function(){this.search.show();this.search.focus();this.search.val(this.search.val())}),10)},selectHighlighted:function(){var a=this.highlight(),b=this.results.find(".select2-highlighted").not(".select2-disabled"),c=b.closest(".select2-result-selectable").data("select2-data");c&&(b.addClass("select2-disabled"),this.highlight(a),this.onSelect(c))},getPlaceholder:function(){return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||
|
50 |
+
this.opts.placeholder},initContainerWidth:function(){var a=function(){var a,c,d,f;if("off"===this.opts.width)return null;if("element"===this.opts.width)return 0===this.opts.element.outerWidth()?"auto":this.opts.element.outerWidth()+"px";if("copy"===this.opts.width||"resolve"===this.opts.width){a=this.opts.element.attr("style");if(a!==g){a=a.split(";");d=0;for(f=a.length;d<f;d+=1)if(c=a[d].replace(/\s/g,"").match(/width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/),null!==c&&1<=c.length)return c[1]}return"resolve"===
|
51 |
+
this.opts.width?(a=this.opts.element.css("width"),0<a.indexOf("%")?a:0===this.opts.element.outerWidth()?"auto":this.opts.element.outerWidth()+"px"):null}return e.isFunction(this.opts.width)?this.opts.width():this.opts.width}.call(this);null!==a&&this.container.attr("style","width: "+a)}});y=x(w,{createContainer:function(){return e("<div></div>",{"class":"select2-container"}).html(" <a href='#' onclick='return false;' class='select2-choice'> <span></span><abbr class='select2-search-choice-close' style='display:none;'></abbr> <div><b></b></div></a> <div class='select2-drop select2-offscreen'> <div class='select2-search'> <input type='text' autocomplete='off' class='select2-input'/> </div> <ul class='select2-results'> </ul></div>")},
|
52 |
+
opening:function(){this.search.show();this.parent.opening.apply(this,arguments);this.dropdown.removeClass("select2-offscreen")},close:function(){this.opened()&&(this.parent.close.apply(this,arguments),this.dropdown.removeAttr("style").addClass("select2-offscreen").insertAfter(this.selection).show())},focus:function(){this.close();this.selection.focus()},isFocused:function(){return this.selection[0]===document.activeElement},cancel:function(){this.parent.cancel.apply(this,arguments);this.selection.focus()},
|
53 |
+
initContainer:function(){var a,b=this.dropdown;this.selection=a=this.container.find(".select2-choice");this.search.bind("keydown",this.bind(function(a){if(this.enabled)if(a.which===f.PAGE_UP||a.which===f.PAGE_DOWN)l(a);else if(this.opened())switch(a.which){case f.UP:case f.DOWN:this.moveHighlight(a.which===f.UP?-1:1);l(a);break;case f.TAB:case f.ENTER:this.selectHighlighted();l(a);break;case f.ESC:this.cancel(a),l(a)}else a.which===f.TAB||f.isControl(a)||f.isFunctionKey(a)||a.which===f.ESC||!1===
|
54 |
+
this.opts.openOnEnter&&a.which===f.ENTER||this.open()}));this.search.bind("focus",this.bind(function(){this.selection.attr("tabIndex","-1")}));this.search.bind("blur",this.bind(function(){this.opened()||this.container.removeClass("select2-container-active");window.setTimeout(this.bind(function(){this.selection.attr("tabIndex",this.opts.element.attr("tabIndex"))}),10)}));a.bind("mousedown",this.bind(function(){this.opened()?(this.close(),this.selection.focus()):this.enabled&&this.open()}));b.bind("mousedown",
|
55 |
+
this.bind(function(){this.search.focus()}));a.bind("focus",this.bind(function(){this.container.addClass("select2-container-active");this.search.attr("tabIndex","-1")}));a.bind("blur",this.bind(function(){this.opened()||this.container.removeClass("select2-container-active");window.setTimeout(this.bind(function(){this.search.attr("tabIndex",this.opts.element.attr("tabIndex"))}),10)}));a.bind("keydown",this.bind(function(a){if(this.enabled)if(a.which===f.PAGE_UP||a.which===f.PAGE_DOWN)l(a);else if(!(a.which===
|
56 |
+
f.TAB||f.isControl(a)||f.isFunctionKey(a)||a.which===f.ESC)&&!(!1===this.opts.openOnEnter&&a.which===f.ENTER))if(a.which==f.DELETE)this.opts.allowClear&&this.clear();else{this.open();if(a.which!==f.ENTER&&!(48>a.which)){var b=String.fromCharCode(a.which).toLowerCase();a.shiftKey&&(b=b.toUpperCase());this.search.focus();this.search.val(b)}l(a)}}));a.delegate("abbr","mousedown",this.bind(function(a){this.enabled&&(this.clear(),l(a),this.close(),this.triggerChange(),this.selection.focus())}));this.setPlaceholder();
|
57 |
+
this.search.bind("focus",this.bind(function(){this.container.addClass("select2-container-active")}))},clear:function(){this.opts.element.val("");this.selection.find("span").empty();this.selection.removeData("select2-data");this.setPlaceholder()},initSelection:function(){if(""===this.opts.element.val())this.close(),this.setPlaceholder();else{var a=this;this.opts.initSelection.call(null,this.opts.element,function(b){b!==g&&null!==b&&(a.updateSelection(b),a.close(),a.setPlaceholder())})}},prepareOpts:function(){var a=
|
58 |
+
this.parent.prepareOpts.apply(this,arguments);"select"===a.element.get(0).tagName.toLowerCase()&&(a.initSelection=function(a,c){var d=a.find(":selected");e.isFunction(c)&&c({id:d.attr("value"),text:d.text()})});return a},setPlaceholder:function(){var a=this.getPlaceholder();""===this.opts.element.val()&&a!==g&&!(this.select&&""!==this.select.find("option:first").text())&&(this.selection.find("span").html(this.opts.escapeMarkup(a)),this.selection.addClass("select2-default"),this.selection.find("abbr").hide())},
|
59 |
+
postprocessResults:function(a,b){var c=0,d=this,f=!0;this.results.find(".select2-result-selectable").each2(function(a,b){if(m(d.id(b.data("select2-data")),d.opts.element.val()))return c=a,!1});this.highlight(c);!0===b&&(f=this.showSearchInput=F(a.results)>=this.opts.minimumResultsForSearch,this.dropdown.find(".select2-search")[f?"removeClass":"addClass"]("select2-search-hidden"),e(this.dropdown,this.container)[f?"addClass":"removeClass"]("select2-with-searchbox"))},onSelect:function(a){var b=this.opts.element.val();
|
60 |
+
this.opts.element.val(this.id(a));this.updateSelection(a);this.close();this.selection.focus();m(b,this.id(a))||this.triggerChange()},updateSelection:function(a){var b=this.selection.find("span");this.selection.data("select2-data",a);b.empty();a=this.opts.formatSelection(a,b);a!==g&&b.append(this.opts.escapeMarkup(a));this.selection.removeClass("select2-default");this.opts.allowClear&&this.getPlaceholder()!==g&&this.selection.find("abbr").show()},val:function(){var a,b=null,c=this;if(0===arguments.length)return this.opts.element.val();
|
61 |
+
a=arguments[0];if(this.select)this.select.val(a).find(":selected").each2(function(a,c){b={id:c.attr("value"),text:c.text()};return!1}),this.updateSelection(b),this.setPlaceholder();else{if(this.opts.initSelection===g)throw Error("cannot call val() if initSelection() is not defined");a?(this.opts.element.val(a),this.opts.initSelection(this.opts.element,function(a){c.opts.element.val(!a?"":c.id(a));c.updateSelection(a);c.setPlaceholder()})):this.clear()}},clearSearch:function(){this.search.val("")},
|
62 |
+
data:function(a){var b;if(0===arguments.length)return b=this.selection.data("select2-data"),b==g&&(b=null),b;!a||""===a?this.clear():(this.opts.element.val(!a?"":this.id(a)),this.updateSelection(a))}});z=x(w,{createContainer:function(){return e("<div></div>",{"class":"select2-container select2-container-multi"}).html(" <ul class='select2-choices'> <li class='select2-search-field'> <input type='text' autocomplete='off' class='select2-input'> </li></ul><div class='select2-drop select2-drop-multi' style='display:none;'> <ul class='select2-results'> </ul></div>")},
|
63 |
+
prepareOpts:function(){var a=this.parent.prepareOpts.apply(this,arguments);"select"===a.element.get(0).tagName.toLowerCase()&&(a.initSelection=function(a,c){var d=[];a.find(":selected").each2(function(a,b){d.push({id:b.attr("value"),text:b.text()})});e.isFunction(c)&&c(d)});return a},initContainer:function(){var a;this.searchContainer=this.container.find(".select2-search-field");this.selection=a=this.container.find(".select2-choices");this.search.bind("keydown",this.bind(function(b){if(this.enabled){if(b.which===
|
64 |
+
f.BACKSPACE&&""===this.search.val()){this.close();var c;c=a.find(".select2-search-choice-focus");if(0<c.length){this.unselect(c.first());this.search.width(10);l(b);return}c=a.find(".select2-search-choice");0<c.length&&c.last().addClass("select2-search-choice-focus")}else a.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");if(this.opened())switch(b.which){case f.UP:case f.DOWN:this.moveHighlight(b.which===f.UP?-1:1);l(b);return;case f.ENTER:case f.TAB:this.selectHighlighted();
|
65 |
+
l(b);return;case f.ESC:this.cancel(b);l(b);return}if(!(b.which===f.TAB||f.isControl(b)||f.isFunctionKey(b)||b.which===f.BACKSPACE||b.which===f.ESC)&&!(!1===this.opts.openOnEnter&&b.which===f.ENTER))this.open(),(b.which===f.PAGE_UP||b.which===f.PAGE_DOWN)&&l(b)}}));this.search.bind("keyup",this.bind(this.resizeSearch));this.search.bind("blur",this.bind(function(a){this.container.removeClass("select2-container-active");this.search.removeClass("select2-focused");this.clearSearch();a.stopImmediatePropagation()}));
|
66 |
+
this.container.delegate(".select2-choices","mousedown",this.bind(function(a){this.enabled&&!(0<e(a.target).closest(".select2-search-choice").length)&&(this.clearPlaceholder(),this.open(),this.focusSearch(),a.preventDefault())}));this.container.delegate(".select2-choices","focus",this.bind(function(){this.enabled&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder())}));this.clearSearch()},enable:function(){this.enabled||(this.parent.enable.apply(this,
|
67 |
+
arguments),this.search.removeAttr("disabled"))},disable:function(){this.enabled&&(this.parent.disable.apply(this,arguments),this.search.attr("disabled",!0))},initSelection:function(){""===this.opts.element.val()&&(this.updateSelection([]),this.close(),this.clearSearch());if(this.select||""!==this.opts.element.val()){var a=this;this.opts.initSelection.call(null,this.opts.element,function(b){if(b!==g&&b!==null){a.updateSelection(b);a.close();a.clearSearch()}})}},clearSearch:function(){var a=this.getPlaceholder();
|
68 |
+
a!==g&&0===this.getVal().length&&!1===this.search.hasClass("select2-focused")?(this.search.val(a).addClass("select2-default"),this.resizeSearch()):this.search.val(" ").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")?this.search.val("").removeClass("select2-default"):" "===this.search.val()&&this.search.val("")},opening:function(){this.parent.opening.apply(this,arguments);this.clearPlaceholder();this.resizeSearch();this.focusSearch()},close:function(){this.opened()&&
|
69 |
+
this.parent.close.apply(this,arguments)},focus:function(){this.close();this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(a){var b=[],c=[],d=this;e(a).each(function(){0>i(d.id(this),b)&&(b.push(d.id(this)),c.push(this))});a=c;this.selection.find(".select2-search-choice").remove();e(a).each(function(){d.addSelectedChoice(this)});d.postprocessResults()},tokenize:function(){var a=this.search.val(),a=this.opts.tokenizer(a,this.data(),this.bind(this.onSelect),
|
70 |
+
this.opts);null!=a&&a!=g&&(this.search.val(a),0<a.length&&this.open())},onSelect:function(a){this.addSelectedChoice(a);this.select&&this.postprocessResults();this.opts.closeOnSelect?(this.close(),this.search.width(10)):0<this.countSelectableResults()?(this.search.width(10),this.resizeSearch(),this.positionDropdown()):this.close();this.triggerChange({added:a});this.focusSearch()},cancel:function(){this.close();this.focusSearch()},addSelectedChoice:function(a){var b=e("<li class='select2-search-choice'> <div></div> <a href='#' onclick='return false;' class='select2-search-choice-close' tabindex='-1'></a></li>"),
|
71 |
+
c=this.id(a),d=this.getVal(),f;f=this.opts.formatSelection(a,b);b.find("div").replaceWith("<div>"+this.opts.escapeMarkup(f)+"</div>");b.find(".select2-search-choice-close").bind("mousedown",l).bind("click dblclick",this.bind(function(a){this.enabled&&(e(a.target).closest(".select2-search-choice").fadeOut("fast",this.bind(function(){this.unselect(e(a.target));this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");this.close();this.focusSearch()})).dequeue(),
|
72 |
+
l(a))})).bind("focus",this.bind(function(){this.enabled&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))}));b.data("select2-data",a);b.insertBefore(this.searchContainer);d.push(c);this.setVal(d)},unselect:function(a){var b=this.getVal(),c,d,a=a.closest(".select2-search-choice");if(0===a.length)throw"Invalid argument: "+a+". Must be .select2-search-choice";c=a.data("select2-data");d=i(this.id(c),b);0<=d&&(b.splice(d,1),this.setVal(b),this.select&&
|
73 |
+
this.postprocessResults());a.remove();this.triggerChange({removed:c})},postprocessResults:function(){var a=this.getVal(),b=this.results.find(".select2-result-selectable"),c=this.results.find(".select2-result-with-children"),d=this;b.each2(function(b,c){var e=d.id(c.data("select2-data"));0<=i(e,a)?c.addClass("select2-disabled").removeClass("select2-result-selectable"):c.removeClass("select2-disabled").addClass("select2-result-selectable")});c.each2(function(a,b){0==b.find(".select2-result-selectable").length?
|
74 |
+
b.addClass("select2-disabled"):b.removeClass("select2-disabled")});b.each2(function(a,b){if(!b.hasClass("select2-disabled")&&b.hasClass("select2-result-selectable"))return d.highlight(0),!1})},resizeSearch:function(){var a,b,c,d,f=this.search.outerWidth()-this.search.width();a=this.search;q||(c=a[0].currentStyle||window.getComputedStyle(a[0],null),q=e("<div></div>").css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:c.fontSize,fontFamily:c.fontFamily,fontStyle:c.fontStyle,
|
75 |
+
fontWeight:c.fontWeight,letterSpacing:c.letterSpacing,textTransform:c.textTransform,whiteSpace:"nowrap"}),e("body").append(q));q.text(a.val());a=q.width()+10;b=this.search.offset().left;c=this.selection.width();d=this.selection.offset().left;b=c-(b-d)-f;b<a&&(b=c-f);40>b&&(b=c-f);this.search.width(b)},getVal:function(){var a;if(this.select)return a=this.select.val(),null===a?[]:a;a=this.opts.element.val();return s(a,this.opts.separator)},setVal:function(a){var b;this.select?this.select.val(a):(b=
|
76 |
+
[],e(a).each(function(){0>i(this,b)&&b.push(this)}),this.opts.element.val(0===b.length?"":b.join(this.opts.separator)))},val:function(){var a,b=[],c=this;if(0===arguments.length)return this.getVal();if(a=arguments[0])if(this.setVal(a),this.select)this.select.find(":selected").each(function(){b.push({id:e(this).attr("value"),text:e(this).text()})}),this.updateSelection(b);else{if(this.opts.initSelection===g)throw Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,
|
77 |
+
function(a){var b=e(a).map(c.id);c.setVal(b);c.updateSelection(a);c.clearSearch()})}else this.opts.element.val(""),this.updateSelection([]);this.clearSearch()},onSortStart:function(){if(this.select)throw Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");this.search.width(0);this.searchContainer.hide()},onSortEnd:function(){var a=[],b=this;this.searchContainer.show();this.searchContainer.appendTo(this.searchContainer.parent());this.resizeSearch();
|
78 |
+
this.selection.find(".select2-search-choice").each(function(){a.push(b.opts.id(e(this).data("select2-data")))});this.setVal(a);this.triggerChange()},data:function(a){var b=this,c;if(0===arguments.length)return this.selection.find(".select2-search-choice").map(function(){return e(this).data("select2-data")}).get();a||(a=[]);c=e.map(a,function(a){return b.opts.id(a)});this.setVal(c);this.updateSelection(a);this.clearSearch()}});e.fn.select2=function(){var a=Array.prototype.slice.call(arguments,0),b,
|
79 |
+
c,d,f,h="val destroy opened open close focus isFocused container onSortStart onSortEnd enable disable positionDropdown data".split(" ");this.each(function(){if(0===a.length||"object"===typeof a[0])b=0===a.length?{}:e.extend({},a[0]),b.element=e(this),"select"===b.element.get(0).tagName.toLowerCase()?f=b.element.attr("multiple"):(f=b.multiple||!1,"tags"in b&&(b.multiple=f=!0)),c=f?new z:new y,c.init(b);else if("string"===typeof a[0]){if(0>i(a[0],h))throw"Unknown method: "+a[0];d=g;c=e(this).data("select2");
|
80 |
+
if(c!==g&&(d="container"===a[0]?c.container:c[a[0]].apply(c,a.slice(1)),d!==g))return!1}else throw"Invalid arguments to select2 plugin: "+a;});return d===g?this:d};e.fn.select2.defaults={width:"copy",closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(a,b,c){b=[];B(a.text,c.term,b);return b.join("")},formatSelection:function(a){return a?a.text:g},formatResultCssClass:function(){return g},formatNoMatches:function(){return"No matches found"},
|
81 |
+
formatInputTooShort:function(a,b){return"Please enter "+(b-a.length)+" more characters"},formatSelectionTooBig:function(a){return"You can only select "+a+" item"+(1==a?"":"s")},formatLoadMore:function(){return"Loading more results..."},formatSearching:function(){return"Searching..."},minimumResultsForSearch:0,minimumInputLength:0,maximumSelectionSize:0,id:function(a){return a.id},matcher:function(a,b){return 0<=b.toUpperCase().indexOf(a.toUpperCase())},separator:",",tokenSeparators:[],tokenizer:H,
|
82 |
+
escapeMarkup:function(a){return a&&"string"===typeof a?a.replace(/&/g,"&"):a},blurOnChange:!1};window.Select2={query:{ajax:C,local:D,tags:E},util:{debounce:A,markMatch:B},"class":{"abstract":w,single:y,multi:z}}}})(jQuery);
|
js/time.js
CHANGED
@@ -12,7 +12,7 @@ function rwmb_update_time_picker()
|
|
12 |
options = $this.data( 'options' );
|
13 |
|
14 |
$this.siblings( '.ui-datepicker-append' ).remove(); // Remove appended text
|
15 |
-
$this.removeClass( 'hasDatepicker' ).
|
16 |
} );
|
17 |
}
|
18 |
|
12 |
options = $this.data( 'options' );
|
13 |
|
14 |
$this.siblings( '.ui-datepicker-append' ).remove(); // Remove appended text
|
15 |
+
$this.removeClass( 'hasDatepicker' ).timepicker( options );
|
16 |
} );
|
17 |
}
|
18 |
|
meta-box.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Meta Box
|
4 |
Plugin URI: http://www.deluxeblogtips.com/meta-box
|
5 |
Description: Create meta box for editing pages in WordPress. Compatible with custom post types since WP 3.0
|
6 |
-
Version: 4.2.
|
7 |
Author: Rilwis
|
8 |
Author URI: http://www.deluxeblogtips.com
|
9 |
License: GPL2+
|
@@ -13,7 +13,7 @@ License: GPL2+
|
|
13 |
defined( 'ABSPATH' ) || exit;
|
14 |
|
15 |
// Script version, used to add version for scripts and styles
|
16 |
-
define( 'RWMB_VER', '4.2' );
|
17 |
|
18 |
// Define plugin URLs, for fast enqueuing scripts and styles
|
19 |
if ( ! defined( 'RWMB_URL' ) )
|
3 |
Plugin Name: Meta Box
|
4 |
Plugin URI: http://www.deluxeblogtips.com/meta-box
|
5 |
Description: Create meta box for editing pages in WordPress. Compatible with custom post types since WP 3.0
|
6 |
+
Version: 4.2.2
|
7 |
Author: Rilwis
|
8 |
Author URI: http://www.deluxeblogtips.com
|
9 |
License: GPL2+
|
13 |
defined( 'ABSPATH' ) || exit;
|
14 |
|
15 |
// Script version, used to add version for scripts and styles
|
16 |
+
define( 'RWMB_VER', '4.2.2' );
|
17 |
|
18 |
// Define plugin URLs, for fast enqueuing scripts and styles
|
19 |
if ( ! defined( 'RWMB_URL' ) )
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.deluxeblogtips.com/donate
|
|
4 |
Tags: meta-box, custom-fields, custom-field, meta, meta-boxes
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 3.4.2
|
7 |
-
Stable tag: 4.2.
|
8 |
|
9 |
Meta Box plugin helps you easily implement multiple meta boxes in editing pages in WordPress. Works with custom post types and various field types.
|
10 |
|
@@ -28,11 +28,13 @@ Meta Box plugin provides an API to easily implement custom meta boxes in editing
|
|
28 |
- file
|
29 |
- hidden
|
30 |
- image
|
|
|
31 |
- number
|
32 |
- password
|
33 |
- plupload_image
|
34 |
- radio
|
35 |
- select
|
|
|
36 |
- slider
|
37 |
- taxonomy
|
38 |
- text
|
@@ -59,6 +61,12 @@ To getting started with the plugin API, please read [this tutorial](http://www.d
|
|
59 |
|
60 |
== Changelog ==
|
61 |
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
= 4.2.1 =
|
63 |
* Bug fix: not save wysiwyg field in full screen mode. [Link](http://www.deluxeblogtips.com/forums/viewtopic.php?id=161)
|
64 |
* Bug fix: default value for select/checkbox_list. [Link](http://www.deluxeblogtips.com/forums/viewtopic.php?id=174)
|
4 |
Tags: meta-box, custom-fields, custom-field, meta, meta-boxes
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 3.4.2
|
7 |
+
Stable tag: 4.2.2
|
8 |
|
9 |
Meta Box plugin helps you easily implement multiple meta boxes in editing pages in WordPress. Works with custom post types and various field types.
|
10 |
|
28 |
- file
|
29 |
- hidden
|
30 |
- image
|
31 |
+
- map
|
32 |
- number
|
33 |
- password
|
34 |
- plupload_image
|
35 |
- radio
|
36 |
- select
|
37 |
+
- select_advanced (uses [select2](http://ivaynberg.github.com/select2/))
|
38 |
- slider
|
39 |
- taxonomy
|
40 |
- text
|
61 |
|
62 |
== Changelog ==
|
63 |
|
64 |
+
= 4.2.2 =
|
65 |
+
* Bug fix: `time` field doesn't work. [Link](http://wordpress.org/support/topic/time-field-js-wont-run-without-datetime)
|
66 |
+
* Bug fix: wrong JS call for `datetime`. [Link](http://wordpress.org/support/topic/421-datetime)
|
67 |
+
* Improvement: file and images now not deleted from library, *unless* use `force_delete` option
|
68 |
+
* Improvement: add `select_advanced` field, which uses [select2](http://ivaynberg.github.com/select2/) for better UX. Thanks @funkedgeek
|
69 |
+
|
70 |
= 4.2.1 =
|
71 |
* Bug fix: not save wysiwyg field in full screen mode. [Link](http://www.deluxeblogtips.com/forums/viewtopic.php?id=161)
|
72 |
* Bug fix: default value for select/checkbox_list. [Link](http://www.deluxeblogtips.com/forums/viewtopic.php?id=174)
|