Version Description
Upgrade Notice
Download this release
Release Info
Developer | raptor235 |
Plugin | Sidekick |
Version | 1.0 |
Comparing to | |
See all releases |
Version 1.0
- css/sidekick_wordpress.css +385 -0
- images/arrows.png +0 -0
- images/arrows_01.png +0 -0
- images/arrows_02.png +0 -0
- images/arrows_04.png +0 -0
- images/arrows_05.png +0 -0
- images/sidekick_wp_sprites.png +0 -0
- js/sk.source.js +2551 -0
- license.txt +281 -0
- readme.txt +132 -0
- sidekick.php +444 -0
- sk_init.php +19 -0
- wpu_init.php +14 -0
css/sidekick_wordpress.css
ADDED
@@ -0,0 +1,385 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
div#sidekick {
|
2 |
+
position: fixed;
|
3 |
+
bottom: 10px;
|
4 |
+
right: -3px;
|
5 |
+
width: 300px;
|
6 |
+
display: none;
|
7 |
+
border: solid 1px transparent;
|
8 |
+
font-family: Helvetica;
|
9 |
+
text-shadow: 1px 1px 3px #000;
|
10 |
+
overflow: hidden;
|
11 |
+
z-index: 1000000;
|
12 |
+
-webkit-border-radius: 3px;
|
13 |
+
-moz-border-radius: 3px;
|
14 |
+
-ms-border-radius: 3px;
|
15 |
+
-o-border-radius: 3px;
|
16 |
+
border-radius: 3px;
|
17 |
+
}
|
18 |
+
div#sidekick .hide {
|
19 |
+
display: none;
|
20 |
+
}
|
21 |
+
div#sidekick > * {
|
22 |
+
display: none;
|
23 |
+
}
|
24 |
+
div#sidekick button {
|
25 |
+
cursor: pointer;
|
26 |
+
cursor: hand;
|
27 |
+
}
|
28 |
+
div#sidekick button #goto_library {
|
29 |
+
padding: 10px 20px;
|
30 |
+
background-color: #E04F19;
|
31 |
+
text-transform: uppercase;
|
32 |
+
margin: 10px auto;
|
33 |
+
border: solid 1px white;
|
34 |
+
color: white;
|
35 |
+
font-size: 14px;
|
36 |
+
display: block;
|
37 |
+
-moz-box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.3);
|
38 |
+
-webkit-box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.3);
|
39 |
+
box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.3);
|
40 |
+
-webkit-border-radius: 3px;
|
41 |
+
-moz-border-radius: 3px;
|
42 |
+
-ms-border-radius: 3px;
|
43 |
+
-o-border-radius: 3px;
|
44 |
+
border-radius: 3px;
|
45 |
+
}
|
46 |
+
div#sidekick button #goto_library:hover {
|
47 |
+
background-color: #f75619;
|
48 |
+
color: #fff;
|
49 |
+
}
|
50 |
+
div#sidekick ul.bucketContainer {
|
51 |
+
height: 217px;
|
52 |
+
overflow-y: hidden;
|
53 |
+
overflow-x: hidden;
|
54 |
+
}
|
55 |
+
div#sidekick ul.bucketContainer div > li {
|
56 |
+
width: 300px;
|
57 |
+
height: 217px;
|
58 |
+
overflow-y: auto;
|
59 |
+
}
|
60 |
+
div#sidekick ul {
|
61 |
+
margin: 0;
|
62 |
+
width: 100%;
|
63 |
+
position: relative;
|
64 |
+
}
|
65 |
+
div#sidekick ul .list {
|
66 |
+
height: 217px;
|
67 |
+
overflow-x: hidden;
|
68 |
+
overflow-y: auto;
|
69 |
+
}
|
70 |
+
div#sidekick ul .list a {
|
71 |
+
color: white;
|
72 |
+
text-decoration: none;
|
73 |
+
}
|
74 |
+
div#sidekick ul .list a:hover div {
|
75 |
+
color: yellow;
|
76 |
+
}
|
77 |
+
div#sidekick ul .list a:first-child li {
|
78 |
+
-moz-box-shadow: inset 0px 2px 6px rgba(0, 0, 0, 0.8);
|
79 |
+
-webkit-box-shadow: inset 0px 2px 6px rgba(0, 0, 0, 0.8);
|
80 |
+
box-shadow: inset 0px 2px 6px rgba(0, 0, 0, 0.8);
|
81 |
+
}
|
82 |
+
div#sidekick ul .list a:nth-child(even) li {
|
83 |
+
background-color: #2c517a;
|
84 |
+
}
|
85 |
+
div#sidekick ul .list a:nth-child(even) li:hover {
|
86 |
+
background-color: #294c73;
|
87 |
+
}
|
88 |
+
div#sidekick ul .list a li {
|
89 |
+
background-color: #4986cc;
|
90 |
+
min-height: 24px;
|
91 |
+
line-height: 24px;
|
92 |
+
overflow: hidden;
|
93 |
+
width: 100%;
|
94 |
+
}
|
95 |
+
div#sidekick ul .list a li:hover {
|
96 |
+
-webkit-transition: all 0.1s ease-out;
|
97 |
+
-moz-transition: all 0.1s ease-out;
|
98 |
+
-o-transition: all 0.1s ease-out;
|
99 |
+
transition: all 0.1s ease-out;
|
100 |
+
background-color: #437bbc;
|
101 |
+
}
|
102 |
+
div#sidekick ul .list a li div {
|
103 |
+
padding: 0 0 0 16px;
|
104 |
+
}
|
105 |
+
div#sidekick ul .new_window {
|
106 |
+
left: 300px;
|
107 |
+
}
|
108 |
+
div#sidekick ul .new_window,
|
109 |
+
div#sidekick ul .current_window {
|
110 |
+
position: absolute;
|
111 |
+
top: 0px;
|
112 |
+
width: 100%;
|
113 |
+
height: 217px;
|
114 |
+
overflow-y: auto;
|
115 |
+
}
|
116 |
+
div#sidekick ul .main {
|
117 |
+
overflow: auto;
|
118 |
+
height: 217px;
|
119 |
+
}
|
120 |
+
div#sidekick ul .message div {
|
121 |
+
background-color: #454545;
|
122 |
+
padding: 10px;
|
123 |
+
font-size: 14px;
|
124 |
+
line-height: 18px;
|
125 |
+
height: 217px;
|
126 |
+
}
|
127 |
+
div#sidekick ul .review {
|
128 |
+
background-color: #3A3A3A;
|
129 |
+
}
|
130 |
+
div#sidekick ul .review li {
|
131 |
+
padding: 0;
|
132 |
+
}
|
133 |
+
div#sidekick ul .review li div {
|
134 |
+
padding: 10px;
|
135 |
+
}
|
136 |
+
div#sidekick ul .review li input[type="button"],
|
137 |
+
div#sidekick ul .review li input[type="submit"] {
|
138 |
+
padding: 10px 20px;
|
139 |
+
background-color: #6fe04a;
|
140 |
+
text-transform: uppercase;
|
141 |
+
/*margin: 10px auto;*/
|
142 |
+
|
143 |
+
border: solid 1px white;
|
144 |
+
color: white;
|
145 |
+
font-size: 14px;
|
146 |
+
display: block;
|
147 |
+
-moz-box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.3);
|
148 |
+
-webkit-box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.3);
|
149 |
+
box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.3);
|
150 |
+
-webkit-border-radius: 3px;
|
151 |
+
-moz-border-radius: 3px;
|
152 |
+
border-radius: 3px;
|
153 |
+
margin-bottom: 20px;
|
154 |
+
color: black;
|
155 |
+
font-weight: bold;
|
156 |
+
cursor: pointer;
|
157 |
+
float: right;
|
158 |
+
}
|
159 |
+
div#sidekick ul .review li input[type="button"]:hover,
|
160 |
+
div#sidekick ul .review li input[type="submit"]:hover {
|
161 |
+
background-color: #76f24f;
|
162 |
+
}
|
163 |
+
div#sidekick ul .review li input[type="button"] {
|
164 |
+
background-color: #bec2c4;
|
165 |
+
float: left;
|
166 |
+
}
|
167 |
+
div#sidekick ul .review li input[type="button"]:hover {
|
168 |
+
background-color: #cacfd1;
|
169 |
+
}
|
170 |
+
div#sidekick ul .review li textarea {
|
171 |
+
width: 100%;
|
172 |
+
color: gray;
|
173 |
+
line-height: 20px;
|
174 |
+
min-height: 80px;
|
175 |
+
margin-bottom: 10px;
|
176 |
+
}
|
177 |
+
div#sidekick ul .review li .rate {
|
178 |
+
height: 24px;
|
179 |
+
width: 120px;
|
180 |
+
margin: 0 auto;
|
181 |
+
}
|
182 |
+
div#sidekick ul .review li .rate span {
|
183 |
+
width: 20px;
|
184 |
+
height: 20px;
|
185 |
+
background: url('../images/sidekick_wp_sprites.png') -676px -43px;
|
186 |
+
display: block;
|
187 |
+
float: left;
|
188 |
+
margin: 0 2px;
|
189 |
+
cursor: pointer;
|
190 |
+
}
|
191 |
+
div#sidekick ul .review li .rate span.hover {
|
192 |
+
background: url('../images/sidekick_wp_sprites.png') -676px -69px;
|
193 |
+
}
|
194 |
+
div#sidekick ul .review li .rate span.saved {
|
195 |
+
background: url('../images/sidekick_wp_sprites.png') -676px -102px;
|
196 |
+
}
|
197 |
+
div#sidekick ul li.heading,
|
198 |
+
div#sidekick ul li.heading:hover {
|
199 |
+
-moz-box-shadow: inset 0px 2px 6px rgba(0, 0, 0, 0.8);
|
200 |
+
-webkit-box-shadow: inset 0px 2px 6px rgba(0, 0, 0, 0.8);
|
201 |
+
box-shadow: inset 0px 2px 6px rgba(0, 0, 0, 0.8);
|
202 |
+
background-color: #454545;
|
203 |
+
cursor: default;
|
204 |
+
}
|
205 |
+
div#sidekick ul li.heading div,
|
206 |
+
div#sidekick ul li.heading:hover div {
|
207 |
+
padding: 6px 0 6px 10px;
|
208 |
+
}
|
209 |
+
div#sidekick ul li {
|
210 |
+
color: white;
|
211 |
+
margin: 0;
|
212 |
+
/*position: absolute;*/
|
213 |
+
|
214 |
+
width: 100%;
|
215 |
+
}
|
216 |
+
div#sidekick ul li ul {
|
217 |
+
padding: 0;
|
218 |
+
}
|
219 |
+
div#sidekick ul li ul li {
|
220 |
+
position: relative;
|
221 |
+
}
|
222 |
+
div#sidekick ul li.group_section {
|
223 |
+
min-height: 54px;
|
224 |
+
background-color: #454545;
|
225 |
+
font-size: 14px;
|
226 |
+
/*line-height: 54px;*/
|
227 |
+
|
228 |
+
color: white;
|
229 |
+
margin: 0;
|
230 |
+
position: relative;
|
231 |
+
cursor: pointer;
|
232 |
+
cursor: hand;
|
233 |
+
-moz-box-shadow: inset 3px 3px 6px rgba(0, 0, 0, 0.3);
|
234 |
+
-webkit-box-shadow: inset 3px 3px 6px rgba(0, 0, 0, 0.3);
|
235 |
+
box-shadow: inset 3px 3px 6px rgba(0, 0, 0, 0.3);
|
236 |
+
}
|
237 |
+
div#sidekick ul li.group_section > div {
|
238 |
+
padding: 19px 10px;
|
239 |
+
}
|
240 |
+
div#sidekick ul li.group_section span {
|
241 |
+
background-color: #2f2f2f;
|
242 |
+
width: 53px;
|
243 |
+
height: 30px;
|
244 |
+
display: block;
|
245 |
+
position: absolute;
|
246 |
+
top: 13px;
|
247 |
+
right: 10px;
|
248 |
+
text-align: center;
|
249 |
+
line-height: 30px;
|
250 |
+
}
|
251 |
+
div#sidekick ul li.group_section:hover {
|
252 |
+
-webkit-transition: all 0.1s ease-out;
|
253 |
+
-moz-transition: all 0.1s ease-out;
|
254 |
+
-o-transition: all 0.1s ease-out;
|
255 |
+
transition: all 0.1s ease-out;
|
256 |
+
background-color: #3a3a3a;
|
257 |
+
color: yellow;
|
258 |
+
}
|
259 |
+
div#sidekick ul li.group_section:nth-child(odd) {
|
260 |
+
background-color: #2c517a;
|
261 |
+
}
|
262 |
+
div#sidekick ul li.group_section:nth-child(odd) span {
|
263 |
+
background-color: #234163;
|
264 |
+
}
|
265 |
+
div#sidekick ul li.group_section:nth-child(odd):hover {
|
266 |
+
-webkit-transition: all 0.1s ease-out;
|
267 |
+
-moz-transition: all 0.1s ease-out;
|
268 |
+
-o-transition: all 0.1s ease-out;
|
269 |
+
transition: all 0.1s ease-out;
|
270 |
+
background-color: #325b8b;
|
271 |
+
}
|
272 |
+
div#sidekick ul li.group_section:nth-child(odd):hover span {
|
273 |
+
background-color: #234163;
|
274 |
+
}
|
275 |
+
div#sidekick h2 {
|
276 |
+
cursor: default;
|
277 |
+
text-align: center;
|
278 |
+
color: white;
|
279 |
+
font-weight: normal;
|
280 |
+
font-size: 14px;
|
281 |
+
min-height: 35px;
|
282 |
+
line-height: 35px;
|
283 |
+
position: relative;
|
284 |
+
margin: 0;
|
285 |
+
-webkit-border-radius: 3px;
|
286 |
+
-moz-border-radius: 3px;
|
287 |
+
border-radius: 3px;
|
288 |
+
background: #2c517a;
|
289 |
+
/* Old browsers */
|
290 |
+
|
291 |
+
background: -moz-linear-gradient(top, #2c517a 0%, #395777 46%, #2c517a 100%);
|
292 |
+
/* FF3.6+ */
|
293 |
+
|
294 |
+
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #2c517a), color-stop(46%, #395777), color-stop(100%, #2c517a));
|
295 |
+
/* Chrome,Safari4+ */
|
296 |
+
|
297 |
+
background: -webkit-linear-gradient(top, #2c517a 0%, #395777 46%, #2c517a 100%);
|
298 |
+
/* Chrome10+,Safari5.1+ */
|
299 |
+
|
300 |
+
background: -o-linear-gradient(top, #2c517a 0%, #395777 46%, #2c517a 100%);
|
301 |
+
/* Opera 11.10+ */
|
302 |
+
|
303 |
+
background: -ms-linear-gradient(top, #2c517a 0%, #395777 46%, #2c517a 100%);
|
304 |
+
/* IE10+ */
|
305 |
+
|
306 |
+
background: linear-gradient(to bottom, #2c517a 0%, #395777 46%, #2c517a 100%);
|
307 |
+
/* W3C */
|
308 |
+
|
309 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#2c517a', endColorstr='#2c517a', GradientType=0);
|
310 |
+
/* IE6-9 */
|
311 |
+
|
312 |
+
-moz-box-shadow: inset 3px 3px 15px rgba(0, 0, 0, 0.5);
|
313 |
+
-webkit-box-shadow: inset 3px 3px 15px rgba(0, 0, 0, 0.5);
|
314 |
+
box-shadow: inset 3px 3px 15px rgba(0, 0, 0, 0.5);
|
315 |
+
}
|
316 |
+
div#sidekick h2 button {
|
317 |
+
float: left;
|
318 |
+
background-color: #3487b8;
|
319 |
+
border: none;
|
320 |
+
position: absolute;
|
321 |
+
top: 5px;
|
322 |
+
left: 5px;
|
323 |
+
width: 30px;
|
324 |
+
height: 24px;
|
325 |
+
line-height: 24px;
|
326 |
+
color: white;
|
327 |
+
-moz-box-shadow: inset 0px 0px 15px rgba(0, 0, 0, 0.3);
|
328 |
+
-webkit-box-shadow: inset 0px 0px 15px rgba(0, 0, 0, 0.3);
|
329 |
+
box-shadow: inset 0px 0px 15px rgba(0, 0, 0, 0.3);
|
330 |
+
-webkit-border-radius: 3px;
|
331 |
+
-moz-border-radius: 3px;
|
332 |
+
border-radius: 3px;
|
333 |
+
border: solid 1px #3c6fa9;
|
334 |
+
background: url('../images/sidekick_wp_sprites.png') -640px -38px;
|
335 |
+
}
|
336 |
+
div#sidekick h2 button:hover {
|
337 |
+
background-color: #3a9bd5;
|
338 |
+
}
|
339 |
+
div#sidekick h2 button.goback {
|
340 |
+
background: url('../images/sidekick_wp_sprites.png') -641px -21px;
|
341 |
+
}
|
342 |
+
div#sidekick h2 button.close {
|
343 |
+
background: url('../images/sidekick_wp_sprites.png') -640px -75px;
|
344 |
+
left: auto;
|
345 |
+
right: 10px;
|
346 |
+
}
|
347 |
+
div#sidekick > ul {
|
348 |
+
height: 260px;
|
349 |
+
}
|
350 |
+
div#sidekick > #logo {
|
351 |
+
width: 70px;
|
352 |
+
height: 70px;
|
353 |
+
right: -30px;
|
354 |
+
background: url('../images/sidekick_wp_sprites.png') -476px -347px;
|
355 |
+
display: block;
|
356 |
+
position: relative;
|
357 |
+
cursor: pointer;
|
358 |
+
cursor: hand;
|
359 |
+
margin-top: 235px;
|
360 |
+
}
|
361 |
+
div#sidekick > #logo:hover {
|
362 |
+
background: url('../images/sidekick_wp_sprites.png') -562px -347px;
|
363 |
+
}
|
364 |
+
div#sidekick #logo_full {
|
365 |
+
width: 100px;
|
366 |
+
height: 38px;
|
367 |
+
margin: 6px auto 0;
|
368 |
+
background: url('../images/sidekick_wp_sprites.png') -299px -371px;
|
369 |
+
position: relative;
|
370 |
+
}
|
371 |
+
div#sidekick div.search {
|
372 |
+
background-color: transparent;
|
373 |
+
padding: 1px 5px;
|
374 |
+
}
|
375 |
+
div#sidekick div.search input {
|
376 |
+
width: 100%;
|
377 |
+
padding: 6px 20px;
|
378 |
+
color: #cfcfcf;
|
379 |
+
border: none;
|
380 |
+
}
|
381 |
+
div#sidekick.shadow {
|
382 |
+
-moz-box-shadow: 3px 3px 15px rgba(0, 0, 0, 0.5);
|
383 |
+
-webkit-box-shadow: 3px 3px 15px rgba(0, 0, 0, 0.5);
|
384 |
+
box-shadow: 3px 3px 15px rgba(0, 0, 0, 0.5);
|
385 |
+
}
|
images/arrows.png
ADDED
Binary file
|
images/arrows_01.png
ADDED
Binary file
|
images/arrows_02.png
ADDED
Binary file
|
images/arrows_04.png
ADDED
Binary file
|
images/arrows_05.png
ADDED
Binary file
|
images/sidekick_wp_sprites.png
ADDED
Binary file
|
js/sk.source.js
ADDED
@@ -0,0 +1,2551 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
/* appModel.js */
|
3 |
+
|
4 |
+
/* 1 */ (function($) {
|
5 |
+
/* 2 */
|
6 |
+
/* 3 */ window.SidekickWP = {
|
7 |
+
/* 4 */ Models: {},
|
8 |
+
/* 5 */ Collections: {},
|
9 |
+
/* 6 */ Views: {},
|
10 |
+
/* 7 */ Events: {},
|
11 |
+
/* 8 */ Templates: {},
|
12 |
+
/* 9 */ Helpers: {}
|
13 |
+
/* 10 */ };
|
14 |
+
/* 11 */
|
15 |
+
/* 12 */ if (!window.console) window.console = {log: function() {}};
|
16 |
+
/* 13 */ if (!window.console.clear) window.console.clear = function(){};
|
17 |
+
/* 14 */ if (!window.console.group) window.console.group = function(){};
|
18 |
+
/* 15 */ if (!window.console.groupEnd) window.console.groupEnd = function(){};
|
19 |
+
/* 16 */ if (!window.console.table) window.console.table = function(){};
|
20 |
+
/* 17 */ if (!window.console.error) window.console.error = function(){};
|
21 |
+
/* 18 */
|
22 |
+
/* 19 */ if (window.console){
|
23 |
+
/* 20 */ window.console.info = function(msg,o1,o2,o3){if (!o1) o1 = '';if (!o2) o2 = '';if (!o3) o3 = '';console.log('%c' + msg,'color: blue;font-weight: bold',o1,o2,o3);};
|
24 |
+
/* 21 */ window.console.event = function(msg,o1,o2,o3){if (!o1) o1 = '';if (!o2) o2 = '';if (!o3) o3 = '';console.log('%c' + msg,'color: green;font-weight: bold',o1,o2,o3);};
|
25 |
+
/* 22 */ }
|
26 |
+
/* 23 */
|
27 |
+
/* 24 */ SidekickWP.Models.App = Backbone.Model.extend({
|
28 |
+
/* 25 */ defaults: {
|
29 |
+
/* 26 */ full_library: null,
|
30 |
+
/* 27 */ my_library: null,
|
31 |
+
/* 28 */ wp_version: null,
|
32 |
+
/* 29 */ installed_plugins: null,
|
33 |
+
/* 30 */ current_url: null,
|
34 |
+
/* 31 */ current_plugin: null,
|
35 |
+
/* 32 */ license_status: null,
|
36 |
+
/* 33 */ bucket_counts: []
|
37 |
+
/* 34 */ },
|
38 |
+
/* 35 */
|
39 |
+
/* 36 */ initialize: function(){
|
40 |
+
/* 37 */ console.group('%cinitialize: App Model %o', 'color:#3b4580', this);
|
41 |
+
/* 38 */
|
42 |
+
/* 39 */ _.extend(this, Backbone.Events);
|
43 |
+
/* 40 */ SidekickWP.Events = _.extend({}, Backbone.Events);
|
44 |
+
/* 41 */
|
45 |
+
/* 42 */ Sidekick.Events.on('loaded_walkthrough',this.loaded_walkthrough,this);
|
46 |
+
/* 43 */ Sidekick.Events.on('stop',this.show_review,this);
|
47 |
+
/* 44 */ SidekickWP.Events.on('show_msg',this.show_msg,this);
|
48 |
+
/* 45 */
|
49 |
+
/* 46 */ this.trackingModel = new SidekickWP.Models.Tracking();
|
50 |
+
/* 47 */
|
51 |
+
/* 48 */ if (typeof sk_library == 'undefined') {
|
52 |
+
/* 49 */ var msg = 'No Library Found!';
|
53 |
+
/* 50 */ SidekickWP.Events.trigger('track_error',{msg: msg});
|
54 |
+
|
55 |
+
/* appModel.js */
|
56 |
+
|
57 |
+
/* 51 */
|
58 |
+
/* 52 */ console.error('Sidekick Library Not Found!');
|
59 |
+
/* 53 */ return;
|
60 |
+
/* 54 */ }
|
61 |
+
/* 55 */ console.info('Library -> ' + sk_library_file);
|
62 |
+
/* 56 */ console.info('my wpu_library %o', sk_library);
|
63 |
+
/* 57 */
|
64 |
+
/* 58 */ if (typeof sk_just_activated != 'undefined')
|
65 |
+
/* 59 */ SidekickWP.Events.trigger('window_activate');
|
66 |
+
/* 60 */
|
67 |
+
/* 61 */ if (typeof sk_main_soft_version === 'undefined') {
|
68 |
+
/* 62 */ console.error('No WP Version?!?');
|
69 |
+
/* 63 */ return false;
|
70 |
+
/* 64 */ }
|
71 |
+
/* 65 */
|
72 |
+
/* 66 */ if (typeof sk_main_soft_version != 'undefined') this.set('sk_main_soft_version',sk_main_soft_version);
|
73 |
+
/* 67 */ if (typeof sk_library != 'undefined') this.set('full_library',sk_library);
|
74 |
+
/* 68 */ if (typeof sk_installed_plugins != 'undefined') this.set('installed_plugins',sk_installed_plugins);
|
75 |
+
/* 69 */
|
76 |
+
/* 70 */ console.table(this.attributes);
|
77 |
+
/* 71 */
|
78 |
+
/* 72 */
|
79 |
+
/* 73 */ // console.info('Full Library %o', this.get('full_library'));
|
80 |
+
/* 74 */ this.set('current_url',window.location.toString());
|
81 |
+
/* 75 */
|
82 |
+
/* 76 */ this.Config = {
|
83 |
+
/* 77 */ domain: 'http://www.wpuniversity.com'
|
84 |
+
/* 78 */ };
|
85 |
+
/* 79 */
|
86 |
+
/* 80 */ this.check_library();
|
87 |
+
/* 81 */ this.views = {};
|
88 |
+
/* 82 */ this.views.app = new SidekickWP.Views.App({model: this, el: $("body")});
|
89 |
+
/* 83 */
|
90 |
+
/* 84 */ // var my_library = this.get('my_library');
|
91 |
+
/* 85 */ // console.log('my_library %o', my_library);
|
92 |
+
/* 86 */
|
93 |
+
/* 87 */ console.groupEnd();
|
94 |
+
/* 88 */ },
|
95 |
+
/* 89 */
|
96 |
+
/* 90 */ check_library: function(){
|
97 |
+
/* 91 */ if (!this.get('full_library')) {
|
98 |
+
/* 92 */ console.error("WPU Library Not Found!");
|
99 |
+
/* 93 */ return false;
|
100 |
+
/* 94 */ }
|
101 |
+
/* 95 */ if (!this.get('sk_main_soft_version')){
|
102 |
+
/* 96 */ console.error("No WP Version Found!");
|
103 |
+
/* 97 */ return false;
|
104 |
+
/* 98 */ }
|
105 |
+
/* 99 */ this.parse_my_library();
|
106 |
+
/* 100 */ },
|
107 |
+
|
108 |
+
/* appModel.js */
|
109 |
+
|
110 |
+
/* 101 */
|
111 |
+
/* 102 */ check_walkthrough_compatibility: function(bucket_data,walkthrough,bucket_key,type_key){
|
112 |
+
/* 103 */ // console.group('check_walkthrough_compatibility %o, %o', bucket_data, walkthrough);
|
113 |
+
/* 104 */
|
114 |
+
/* 105 */ var sk_main_soft_version = this.get('sk_main_soft_version');
|
115 |
+
/* 106 */ var pass_main_soft_version = false, pass_theme_version = false, pass_theme = false, pass_plugin = false, pass_plugin_version = false, pass_user_level = false;
|
116 |
+
/* 107 */ var bucket_counts = this.get('bucket_counts');
|
117 |
+
/* 108 */ var installed_plugins = this.get('installed_plugins') ;
|
118 |
+
/* 109 */
|
119 |
+
/* 110 */ pass_main_soft_version = _.find(walkthrough.main_soft_version,function(val){
|
120 |
+
/* 111 */ if (val == sk_main_soft_version)
|
121 |
+
/* 112 */ return true;
|
122 |
+
/* 113 */ });
|
123 |
+
/* 114 */
|
124 |
+
/* 115 */ if (walkthrough.theme) {
|
125 |
+
/* 116 */ if (walkthrough.theme === sk_installed_theme) {
|
126 |
+
/* 117 */ pass_theme = true;
|
127 |
+
/* 118 */ if (walkthrough.theme_version) {
|
128 |
+
/* 119 */ pass_theme_version = _.find(walkthrough.theme_version,function(val){
|
129 |
+
/* 120 */ if (val == sk_theme_version) {
|
130 |
+
/* 121 */ return true;
|
131 |
+
/* 122 */ }
|
132 |
+
/* 123 */ });
|
133 |
+
/* 124 */ } else {
|
134 |
+
/* 125 */ pass_theme_version = true;
|
135 |
+
/* 126 */ }
|
136 |
+
/* 127 */
|
137 |
+
/* 128 */ }
|
138 |
+
/* 129 */ } else {
|
139 |
+
/* 130 */ pass_theme = true;
|
140 |
+
/* 131 */ pass_theme_version = true;
|
141 |
+
/* 132 */ }
|
142 |
+
/* 133 */
|
143 |
+
/* 134 */ if (walkthrough.plugin && sk_installed_plugins) {
|
144 |
+
/* 135 */ console.log('sk_installed_plugins %o', sk_installed_plugins);
|
145 |
+
/* 136 */
|
146 |
+
/* 137 */ pass_plugin = _.find(sk_installed_plugins,function(plugin_data){
|
147 |
+
/* 138 */ for (var plugin in plugin_data) {
|
148 |
+
/* 139 */ var version = plugin_data[plugin];
|
149 |
+
/* 140 */
|
150 |
+
/* 141 */ if (plugin == walkthrough.plugin) {
|
151 |
+
/* 142 */ pass_plugin = true;
|
152 |
+
/* 143 */
|
153 |
+
/* 144 */ pass_plugin_version = _.find(walkthrough.plugin_version,function(version2){
|
154 |
+
/* 145 */ console.log('version %o == %o ?', version,version2);
|
155 |
+
/* 146 */
|
156 |
+
/* 147 */ if (version == version2) {
|
157 |
+
/* 148 */ pass_plugin_version = true;
|
158 |
+
/* 149 */ return true;
|
159 |
+
/* 150 */ }
|
160 |
+
|
161 |
+
/* appModel.js */
|
162 |
+
|
163 |
+
/* 151 */ });
|
164 |
+
/* 152 */ console.log('pass_plugin_version %o', pass_plugin_version);
|
165 |
+
/* 153 */
|
166 |
+
/* 154 */ return true;
|
167 |
+
/* 155 */ }
|
168 |
+
/* 156 */ break;
|
169 |
+
/* 157 */ }
|
170 |
+
/* 158 */ });
|
171 |
+
/* 159 */ } else {
|
172 |
+
/* 160 */ pass_plugin = true;
|
173 |
+
/* 161 */ pass_plugin_version = true;
|
174 |
+
/* 162 */ }
|
175 |
+
/* 163 */
|
176 |
+
/* 164 */ if (walkthrough.role) {
|
177 |
+
/* 165 */ pass_user_level = _.find(walkthrough.role,function(val){
|
178 |
+
/* 166 */ if (val == sk_user_level) {
|
179 |
+
/* 167 */ return true;
|
180 |
+
/* 168 */ }
|
181 |
+
/* 169 */ });
|
182 |
+
/* 170 */ } else {
|
183 |
+
/* 171 */ pass_user_level = true;
|
184 |
+
/* 172 */ }
|
185 |
+
/* 173 */
|
186 |
+
/* 174 */
|
187 |
+
/* 175 */ if (!pass_main_soft_version || !pass_theme || !pass_theme_version || !pass_plugin || !pass_plugin_version || !pass_user_level){
|
188 |
+
/* 176 */ if (!pass_main_soft_version)
|
189 |
+
/* 177 */ console.error('FAILED %o - Main %o != %o',walkthrough.title, pass_main_soft_version,walkthrough.main_soft_version);
|
190 |
+
/* 178 */
|
191 |
+
/* 179 */ if (!pass_theme)
|
192 |
+
/* 180 */ console.error('FAILED %o - Theme %o != %o',walkthrough.title, walkthrough.theme, pass_theme);
|
193 |
+
/* 181 */
|
194 |
+
/* 182 */ if (!pass_theme_version)
|
195 |
+
/* 183 */ console.error('FAILED %o - Theme Ver %o != %o',walkthrough.title, sk_theme_version, walkthrough.theme_version);
|
196 |
+
/* 184 */
|
197 |
+
/* 185 */ if (!pass_plugin)
|
198 |
+
/* 186 */ console.error('FAILED %o - Plugin %o != %o',walkthrough.title, sk_installed_plugins, walkthrough.plugin);
|
199 |
+
/* 187 */
|
200 |
+
/* 188 */ if (!pass_plugin_version)
|
201 |
+
/* 189 */ console.error('FAILED %o - Plugin Ver %o != %o',walkthrough.title, sk_installed_plugins, walkthrough.plugin_version);
|
202 |
+
/* 190 */
|
203 |
+
/* 191 */ if (!pass_user_level)
|
204 |
+
/* 192 */ console.error('FAILED %o - User Level %o != %o',walkthrough.title, sk_user_level, walkthrough.role);
|
205 |
+
/* 193 */
|
206 |
+
/* 194 */ if (typeof bucket_data.walkthroughs !== 'undefined') {
|
207 |
+
/* 195 */ bucket_data.walkthroughs[type_key] = _.without(bucket_data.walkthroughs[type_key], _.findWhere(bucket_data.walkthroughs[type_key], {id: walkthrough.id}));
|
208 |
+
/* 196 */ } else {
|
209 |
+
/* 197 */ bucket_data.sub_buckets[bucket_key].walkthroughs[type_key] = _.without(bucket_data.sub_buckets[bucket_key].walkthroughs[type_key], _.findWhere(bucket_data.sub_buckets[bucket_key].walkthroughs[type_key], {id: walkthrough.id}));
|
210 |
+
/* 198 */ }
|
211 |
+
/* 199 */ } else {
|
212 |
+
/* 200 */ // console.log('PASSED! %o', walkthrough.title);
|
213 |
+
|
214 |
+
/* appModel.js */
|
215 |
+
|
216 |
+
/* 201 */
|
217 |
+
/* 202 */ if (typeof bucket_counts[bucket_data.title] == 'undefined' || typeof bucket_counts[bucket_data.title].count == 'undefined') {
|
218 |
+
/* 203 */ bucket_counts[bucket_data.title] = {count: 1};
|
219 |
+
/* 204 */ } else {
|
220 |
+
/* 205 */ bucket_counts[bucket_data.title].count++;
|
221 |
+
/* 206 */ }
|
222 |
+
/* 207 */ }
|
223 |
+
/* 208 */
|
224 |
+
/* 209 */ if (typeof bucket_data.walkthroughs !== 'undefined') {
|
225 |
+
/* 210 */ if (!_.size(bucket_data.walkthroughs[type_key])) {
|
226 |
+
/* 211 */ // console.log('%cDeleteing Bucket Type %o','color: #d17919', type_key);
|
227 |
+
/* 212 */ delete(bucket_data.walkthroughs[type_key]);
|
228 |
+
/* 213 */ }
|
229 |
+
/* 214 */ } else {
|
230 |
+
/* 215 */ if (!_.size(bucket_data.sub_buckets[bucket_key].walkthroughs[type_key])) {
|
231 |
+
/* 216 */ // console.log('%cDeleteing Bucket Type %o - %o', 'color: #d17919',bucket_key, type_key);
|
232 |
+
/* 217 */ delete(bucket_data.sub_buckets[bucket_key].walkthroughs[type_key]);
|
233 |
+
/* 218 */ }
|
234 |
+
/* 219 */ }
|
235 |
+
/* 220 */ this.set('bucket_counts',bucket_counts);
|
236 |
+
/* 221 */ // console.groupEnd();
|
237 |
+
/* 222 */ },
|
238 |
+
/* 223 */
|
239 |
+
/* 224 */ filter_bucket_walkthroughs: function(bucket_data,bucket_key){
|
240 |
+
/* 225 */ // console.group('%cFilter Bucket %o(%o) - %o', 'color:#3b4580',bucket_data.title, bucket_key,bucket_data);
|
241 |
+
/* 226 */
|
242 |
+
/* 227 */ if (bucket_data.sub_buckets) {
|
243 |
+
/* 228 */ // console.group('%cFilter Sub Bucket %o', 'color:#3b4580');
|
244 |
+
/* 229 */ _.each(bucket_data.sub_buckets, function(sub_bucket,sub_bucket_key){
|
245 |
+
/* 230 */ _.each(sub_bucket.walkthroughs, function(type,type_key){
|
246 |
+
/* 231 */ _.each(type, function(walkthrough,walkthrough_key){
|
247 |
+
/* 232 */ this.check_walkthrough_compatibility(bucket_data,walkthrough,sub_bucket_key,type_key);
|
248 |
+
/* 233 */ },this);
|
249 |
+
/* 234 */
|
250 |
+
/* 235 */ if (!_.size(bucket_data.sub_buckets[sub_bucket_key].walkthroughs)) {
|
251 |
+
/* 236 */ delete(bucket_data.sub_buckets[sub_bucket_key]);
|
252 |
+
/* 237 */ }
|
253 |
+
/* 238 */ },this);
|
254 |
+
/* 239 */
|
255 |
+
/* 240 */ if (!_.size(bucket_data.sub_buckets)) {
|
256 |
+
/* 241 */ delete(bucket_data.sub_buckets);
|
257 |
+
/* 242 */ }
|
258 |
+
/* 243 */ },this);
|
259 |
+
/* 244 */ // console.groupEnd();
|
260 |
+
/* 245 */ } else if (bucket_data.walkthroughs){
|
261 |
+
/* 246 */ // console.group('%cFilter Walkthroughs %o - %o', 'color:#3b4580',bucket_data.title,bucket_data);
|
262 |
+
/* 247 */ _.each(bucket_data.walkthroughs, function(type,type_key){
|
263 |
+
/* 248 */ _.each(type, function(walkthrough,walkthrough_key){
|
264 |
+
/* 249 */ this.check_walkthrough_compatibility(bucket_data,walkthrough,bucket_key,type_key);
|
265 |
+
/* 250 */ },this);
|
266 |
+
|
267 |
+
/* appModel.js */
|
268 |
+
|
269 |
+
/* 251 */
|
270 |
+
/* 252 */ if (!_.size(bucket_data.walkthroughs)) {
|
271 |
+
/* 253 */ bucket_data = null;
|
272 |
+
/* 254 */ }
|
273 |
+
/* 255 */ },this);
|
274 |
+
/* 256 */ // console.groupEnd();
|
275 |
+
/* 257 */ }
|
276 |
+
/* 258 */
|
277 |
+
/* 259 */ // console.groupEnd();
|
278 |
+
/* 260 */ if (typeof bucket_data !== 'undefined' && bucket_data) {
|
279 |
+
/* 261 */ if (typeof bucket_data.walkthroughs !== 'undefined' || typeof bucket_data.sub_buckets !== 'undefined')
|
280 |
+
/* 262 */ return bucket_data;
|
281 |
+
/* 263 */ }
|
282 |
+
/* 264 */
|
283 |
+
/* 265 */ return false;
|
284 |
+
/* 266 */ },
|
285 |
+
/* 267 */
|
286 |
+
/* 268 */ parse_my_library: function(){
|
287 |
+
/* 269 */ // console.log('parse_my_library');
|
288 |
+
/* 270 */ console.group('%cParse Library %o', 'color:#3b4580');
|
289 |
+
/* 271 */ var full_library = this.get('full_library');
|
290 |
+
/* 272 */ console.log('Wpu: parse_full_library %o', full_library);
|
291 |
+
/* 273 */
|
292 |
+
/* 274 */ var all_buckets = [];
|
293 |
+
/* 275 */
|
294 |
+
/* 276 */ for (var bucket in full_library){
|
295 |
+
/* 277 */ if (typeof full_library[bucket] == 'object' && bucket !== 'all_walkthrough_ids') {
|
296 |
+
/* 278 */ bucket_data = full_library[bucket];
|
297 |
+
/* 279 */ var filtered_bucket_data = this.filter_bucket_walkthroughs(bucket_data,bucket);
|
298 |
+
/* 280 */
|
299 |
+
/* 281 */ if (filtered_bucket_data) {
|
300 |
+
/* 282 */ // console.log('Adding to all_buckiets %o - %o', bucket, filtered_bucket_data);
|
301 |
+
/* 283 */ all_buckets[bucket] = filtered_bucket_data;
|
302 |
+
/* 284 */ if (bucket_data.sub_buckets){
|
303 |
+
/* 285 */ for (var sub_bucket in bucket_data.sub_buckets){
|
304 |
+
/* 286 */ if (this.filter_bucket_walkthroughs(bucket_data.sub_buckets[sub_bucket],sub_bucket)) {
|
305 |
+
/* 287 */ // console.log('Adding to all_buckiets %o %o', sub_bucket, bucket_data.sub_buckets[sub_bucket]);
|
306 |
+
/* 288 */
|
307 |
+
/* 289 */ all_buckets[sub_bucket] = bucket_data.sub_buckets[sub_bucket];
|
308 |
+
/* 290 */ }
|
309 |
+
/* 291 */ }
|
310 |
+
/* 292 */ }
|
311 |
+
/* 293 */ } else {
|
312 |
+
/* 294 */ delete(full_library[bucket]);
|
313 |
+
/* 295 */ }
|
314 |
+
/* 296 */ }
|
315 |
+
/* 297 */ }
|
316 |
+
/* 298 */ // console.info('all_buckets %o', all_buckets);
|
317 |
+
/* 299 */
|
318 |
+
/* 300 */ this.set('all_buckets',all_buckets);
|
319 |
+
|
320 |
+
/* appModel.js */
|
321 |
+
|
322 |
+
/* 301 */ console.groupEnd();
|
323 |
+
/* 302 */ },
|
324 |
+
/* 303 */
|
325 |
+
/* 304 */ loaded_walkthrough: function(walkthrough_model){
|
326 |
+
/* 305 */ // console.log('WPU:loaded_walkthrough');
|
327 |
+
/* 306 */ this.set('last_loaded_walkthrough',walkthrough_model);
|
328 |
+
/* 307 */ },
|
329 |
+
/* 308 */
|
330 |
+
/* 309 */ show_review: function(a,b){
|
331 |
+
/* 310 */ console.log('show_review');
|
332 |
+
/* 311 */ var last_loaded_walkthrough = this.get('last_loaded_walkthrough');
|
333 |
+
/* 312 */ console.log('last_loaded_walkthrough %o', last_loaded_walkthrough);
|
334 |
+
/* 313 */
|
335 |
+
/* 314 */ var walkthrough_title = last_loaded_walkthrough.get('title');
|
336 |
+
/* 315 */ console.log('walkthrough_title %o', walkthrough_title);
|
337 |
+
/* 316 */
|
338 |
+
/* 317 */ new SidekickWP.Models.Review({walkthrough_title: walkthrough_title});
|
339 |
+
/* 318 */ },
|
340 |
+
/* 319 */
|
341 |
+
/* 320 */ show_msg: function(data,context){
|
342 |
+
/* 321 */ console.log('show_msg %o',arguments);
|
343 |
+
/* 322 */ console.log('this.models %o', this.models);
|
344 |
+
/* 323 */ console.log('context %o', context);
|
345 |
+
/* 324 */ new SidekickWP.Models.Message({title: data.title, message: data.msg});
|
346 |
+
/* 325 */ }
|
347 |
+
/* 326 */ });
|
348 |
+
/* 327 */ }(jQuery));
|
349 |
+
|
350 |
+
;
|
351 |
+
/* bucketContainerModel.js */
|
352 |
+
|
353 |
+
/* 1 */ (function($) {
|
354 |
+
/* 2 */
|
355 |
+
/* 3 */ SidekickWP.Models.BucketContainer = Backbone.Model.extend({
|
356 |
+
/* 4 */ defaults: {
|
357 |
+
/* 5 */ full_library: null,
|
358 |
+
/* 6 */ all_buckets: null,
|
359 |
+
/* 7 */ bucket_counts: null
|
360 |
+
/* 8 */ },
|
361 |
+
/* 9 */
|
362 |
+
/* 10 */ initialize: function(){
|
363 |
+
/* 11 */ this.view = new SidekickWP.Views.BucketContainer({model: this});
|
364 |
+
/* 12 */ return this;
|
365 |
+
/* 13 */ }
|
366 |
+
/* 14 */ });
|
367 |
+
/* 15 */
|
368 |
+
/* 16 */ }(jQuery));
|
369 |
+
|
370 |
+
;
|
371 |
+
/* bucketModel.js */
|
372 |
+
|
373 |
+
/* 1 */ (function($) {
|
374 |
+
/* 2 */
|
375 |
+
/* 3 */ SidekickWP.Models.Bucket = Backbone.Model.extend({
|
376 |
+
/* 4 */ defaults: {
|
377 |
+
/* 5 */ bucket: null,
|
378 |
+
/* 6 */ title: 'What do you need help with?',
|
379 |
+
/* 7 */ bucket_counts: null
|
380 |
+
/* 8 */ },
|
381 |
+
/* 9 */
|
382 |
+
/* 10 */ initialize: function(){
|
383 |
+
/* 11 */ console.log('initialize bucketModel %o', this.attributes);
|
384 |
+
/* 12 */ this.view = new SidekickWP.Views.Bucket({model: this});
|
385 |
+
/* 13 */ return this;
|
386 |
+
/* 14 */ }
|
387 |
+
/* 15 */ });
|
388 |
+
/* 16 */
|
389 |
+
/* 17 */ }(jQuery));
|
390 |
+
|
391 |
+
;
|
392 |
+
/* helpers.js */
|
393 |
+
|
394 |
+
/* 1 */ (function($) {
|
395 |
+
/* 2 */
|
396 |
+
/* 3 */ SidekickWP.Helpers = ({
|
397 |
+
/* 4 */ preventScrolling: function(){
|
398 |
+
/* 5 */ $('#sidekick .bucketContainer>div>ul').on('DOMMouseScroll mousewheel', function(ev) {
|
399 |
+
/* 6 */ console.log('asd');
|
400 |
+
/* 7 */ var $this = $(this),
|
401 |
+
/* 8 */ scrollTop = this.scrollTop,
|
402 |
+
/* 9 */ scrollHeight = this.scrollHeight,
|
403 |
+
/* 10 */ height = $this.height(),
|
404 |
+
/* 11 */ delta = (ev.type == 'DOMMouseScroll' ?
|
405 |
+
/* 12 */ ev.originalEvent.detail * -40 :
|
406 |
+
/* 13 */ ev.originalEvent.wheelDelta),
|
407 |
+
/* 14 */ up = delta > 0;
|
408 |
+
/* 15 */
|
409 |
+
/* 16 */ var prevent = function() {
|
410 |
+
/* 17 */ ev.stopPropagation();
|
411 |
+
/* 18 */ ev.preventDefault();
|
412 |
+
/* 19 */ ev.returnValue = false;
|
413 |
+
/* 20 */ return false;
|
414 |
+
/* 21 */ };
|
415 |
+
/* 22 */
|
416 |
+
/* 23 */ if (!up && -delta > scrollHeight - height - scrollTop) {
|
417 |
+
/* 24 */ // Scrolling down, but this will take us past the bottom.
|
418 |
+
/* 25 */ $this.scrollTop(scrollHeight);
|
419 |
+
/* 26 */ return prevent();
|
420 |
+
/* 27 */ } else if (up && delta > scrollTop) {
|
421 |
+
/* 28 */ // Scrolling up, but this will take us past the top.
|
422 |
+
/* 29 */ $this.scrollTop(0);
|
423 |
+
/* 30 */ return prevent();
|
424 |
+
/* 31 */ }
|
425 |
+
/* 32 */ });
|
426 |
+
/* 33 */ }
|
427 |
+
/* 34 */ });
|
428 |
+
/* 35 */ }(jQuery));
|
429 |
+
/* 36 */
|
430 |
+
/* 37 */
|
431 |
+
|
432 |
+
;
|
433 |
+
/* listModel.js */
|
434 |
+
|
435 |
+
/* 1 */ (function($) {
|
436 |
+
/* 2 */
|
437 |
+
/* 3 */ SidekickWP.Models.List = Backbone.Model.extend({
|
438 |
+
/* 4 */ defaults: {
|
439 |
+
/* 5 */ bucket: null,
|
440 |
+
/* 6 */ title: 'List'
|
441 |
+
/* 7 */ },
|
442 |
+
/* 8 */
|
443 |
+
/* 9 */ initialize: function(){
|
444 |
+
/* 10 */ console.log('initialize bucketModel %o', this.attributes);
|
445 |
+
/* 11 */ this.view = new SidekickWP.Views.List({model: this});
|
446 |
+
/* 12 */ return this;
|
447 |
+
/* 13 */ }
|
448 |
+
/* 14 */ });
|
449 |
+
/* 15 */
|
450 |
+
/* 16 */ }(jQuery));
|
451 |
+
|
452 |
+
;
|
453 |
+
/* messageModel.js */
|
454 |
+
|
455 |
+
/* 1 */ (function($) {
|
456 |
+
/* 2 */
|
457 |
+
/* 3 */ SidekickWP.Models.Message = Backbone.Model.extend({
|
458 |
+
/* 4 */ defaults: {
|
459 |
+
/* 5 */ title: null,
|
460 |
+
/* 6 */ message: null
|
461 |
+
/* 7 */ },
|
462 |
+
/* 8 */
|
463 |
+
/* 9 */ initialize: function(){
|
464 |
+
/* 10 */ this.view = new SidekickWP.Views.Message({model: this, el: $("#sidekick ul.bucketContainer div")});
|
465 |
+
/* 11 */ }
|
466 |
+
/* 12 */ });
|
467 |
+
/* 13 */
|
468 |
+
/* 14 */ }(jQuery));
|
469 |
+
|
470 |
+
;
|
471 |
+
/* reviewModel.js */
|
472 |
+
|
473 |
+
/* 1 */ (function($) {
|
474 |
+
/* 2 */
|
475 |
+
/* 3 */ SidekickWP.Models.Review = Backbone.Model.extend({
|
476 |
+
/* 4 */ defaults: {
|
477 |
+
/* 5 */ walkthrough_title: null
|
478 |
+
/* 6 */ },
|
479 |
+
/* 7 */
|
480 |
+
/* 8 */ initialize: function(){
|
481 |
+
/* 9 */ this.view = new SidekickWP.Views.Review({model: this, el: $("#sidekick .bucketContainer div")});
|
482 |
+
/* 10 */ }
|
483 |
+
/* 11 */ });
|
484 |
+
/* 12 */
|
485 |
+
/* 13 */ }(jQuery));
|
486 |
+
|
487 |
+
;
|
488 |
+
/* trackingModel.js */
|
489 |
+
|
490 |
+
/* 1 */ (function($) {
|
491 |
+
/* 2 */
|
492 |
+
/* 3 */ SidekickWP.Models.Tracking = Backbone.Model.extend({
|
493 |
+
/* 4 */ defaults : {
|
494 |
+
/* 5 */ gaAccountID : 'UA-39283622-1'
|
495 |
+
/* 6 */ },
|
496 |
+
/* 7 */
|
497 |
+
/* 8 */ initialize: function(){
|
498 |
+
/* 9 */ SidekickWP.Events.on('track_open_sidekick_window', this.track_open_sidekick_window, this);
|
499 |
+
/* 10 */ SidekickWP.Events.on('track_explore', this.track_explore, this);
|
500 |
+
/* 11 */ SidekickWP.Events.on('window_activate', this.window_activate, this);
|
501 |
+
/* 12 */ SidekickWP.Events.on('window_deactivate', this.window_deactivate, this);
|
502 |
+
/* 13 */ SidekickWP.Events.on('track_error', this.track_error, this);
|
503 |
+
/* 14 */
|
504 |
+
/* 15 */ window._gaq = window._gaq || [];
|
505 |
+
/* 16 */ window._gaq.push(['sidekickWP._setAccount', this.get('gaAccountID')]);
|
506 |
+
/* 17 */
|
507 |
+
/* 18 */ (function() {
|
508 |
+
/* 19 */ var ga_sk = document.createElement('script'); ga_sk.type = 'text/javascript'; ga_sk.async = true;
|
509 |
+
/* 20 */ ga_sk.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
510 |
+
/* 21 */ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga_sk, s);
|
511 |
+
/* 22 */ })();
|
512 |
+
/* 23 */ },
|
513 |
+
/* 24 */
|
514 |
+
/* 25 */ send: function(data){
|
515 |
+
/* 26 */ model = window.sidekickWP || {};
|
516 |
+
/* 27 */
|
517 |
+
/* 28 */ data = data || {};
|
518 |
+
/* 29 */ data.source = 'plugin';
|
519 |
+
/* 30 */ data.action = 'track';
|
520 |
+
/* 31 */ data.data = JSON.stringify(model);
|
521 |
+
/* 32 */ data.user = sk_license_key;
|
522 |
+
/* 33 */ console.log('send tracking to WPU',data);
|
523 |
+
/* 34 */ $.post("http://www.wpuniversity.com/wp-admin/admin-ajax.php", data);
|
524 |
+
/* 35 */ },
|
525 |
+
/* 36 */
|
526 |
+
/* 37 */ track_explore: function(data){
|
527 |
+
/* 38 */ window._gaq.push(['sidekickWP._trackEvent', 'Plugin - Explore', data.what, null, 0,true]);
|
528 |
+
/* 39 */ this.send({type: 'explore', label: data.what});
|
529 |
+
/* 40 */ },
|
530 |
+
/* 41 */
|
531 |
+
/* 42 */ track_open_sidekick_window: function(data){
|
532 |
+
/* 43 */ window._gaq.push(['sidekickWP._trackEvent', 'Plugin - Window', 'Open', data.position, 0,true]);
|
533 |
+
/* 44 */ this.send({type: 'open'});
|
534 |
+
/* 45 */ },
|
535 |
+
/* 46 */
|
536 |
+
/* 47 */ window_activate: function(data){
|
537 |
+
/* 48 */ window._gaq.push(['sidekickWP._trackEvent', 'Plugin - Activate', '', wpu_plugin_version, 0,true]);
|
538 |
+
/* 49 */ this.send({type: 'activate'});
|
539 |
+
/* 50 */ },
|
540 |
+
|
541 |
+
/* trackingModel.js */
|
542 |
+
|
543 |
+
/* 51 */
|
544 |
+
/* 52 */ window_deactivate: function(data){
|
545 |
+
/* 53 */ window._gaq.push(['sidekickWP._trackEvent', 'Plugin - Deactivate', '', wpu_plugin_version, 0,true]);
|
546 |
+
/* 54 */ this.send({type: 'deactivate'});
|
547 |
+
/* 55 */ },
|
548 |
+
/* 56 */
|
549 |
+
/* 57 */ track_error: function(data){
|
550 |
+
/* 58 */ window._gaq.push(['sidekickWP._trackEvent', 'Plugin', 'Error', data.msg,null,true]);
|
551 |
+
/* 59 */ this.send({type: 'error', label: data.msg});
|
552 |
+
/* 60 */ }
|
553 |
+
/* 61 */
|
554 |
+
/* 62 */ });
|
555 |
+
/* 63 */
|
556 |
+
/* 64 */ }(jQuery));
|
557 |
+
/* 65 */
|
558 |
+
/* 66 */
|
559 |
+
/* 67 */
|
560 |
+
|
561 |
+
;
|
562 |
+
/* appView.js */
|
563 |
+
|
564 |
+
/* 1 */ (function($) {
|
565 |
+
/* 2 */ SidekickWP.Views.App = Backbone.View.extend({
|
566 |
+
/* 3 */ initialize: function(){
|
567 |
+
/* 4 */ SidekickWP.Events.on('close_sidekick_window', this.close_sidekick_window, this);
|
568 |
+
/* 5 */ SidekickWP.Events.on('show_main_pane', this.show_main_pane, this);
|
569 |
+
/* 6 */ SidekickWP.Events.on('show_next_pane', this.show_next_pane, this);
|
570 |
+
/* 7 */ SidekickWP.Events.on('show_prev_pane', this.show_prev_pane, this);
|
571 |
+
/* 8 */
|
572 |
+
/* 9 */ SidekickWP.Events.on('do_update_header', this.update_header, this);
|
573 |
+
/* 10 */ SidekickWP.Events.on('show_next_pane', this.update_header, this);
|
574 |
+
/* 11 */ SidekickWP.Events.on('show_prev_pane', this.update_header, this);
|
575 |
+
/* 12 */
|
576 |
+
/* 13 */ if (typeof Sidekick !== 'undefined')
|
577 |
+
/* 14 */ Sidekick.Events.on('stop', this.open_sidekick_window, this);
|
578 |
+
/* 15 */ return this.render();
|
579 |
+
/* 16 */ },
|
580 |
+
/* 17 */
|
581 |
+
/* 18 */ render: function(){
|
582 |
+
/* 19 */ console.group('%crender: SidekickWP: appView %o', 'color:#8fa2ff', this);
|
583 |
+
/* 20 */
|
584 |
+
/* 21 */ var all_buckets = this.model.get('all_buckets');
|
585 |
+
/* 22 */
|
586 |
+
/* 23 */ this.BucketContainer = new SidekickWP.Models.BucketContainer({
|
587 |
+
/* 24 */ full_library: this.model.get('full_library'),
|
588 |
+
/* 25 */ all_buckets: all_buckets,
|
589 |
+
/* 26 */ bucket_counts: this.model.get('bucket_counts')
|
590 |
+
/* 27 */ });
|
591 |
+
/* 28 */
|
592 |
+
/* 29 */ var variables = {
|
593 |
+
/* 30 */ BucketContainer: this.BucketContainer.view.render().$el.html()
|
594 |
+
/* 31 */ };
|
595 |
+
/* 32 */
|
596 |
+
/* 33 */ var template = _.template( SidekickWP.Templates.App, variables );
|
597 |
+
/* 34 */ this.$el.append( template );
|
598 |
+
/* 35 */
|
599 |
+
/* 36 */ if (!all_buckets) {
|
600 |
+
/* 37 */ SidekickWP.Events.trigger('show_msg',{title: "No Walkthroughs", msg: "We're sorry but it looks like there are no walkthroughs compatible with your version of software."},this.model);
|
601 |
+
/* 38 */ }
|
602 |
+
/* 39 */
|
603 |
+
/* 40 */ SidekickWP.Events.trigger('rendered');
|
604 |
+
/* 41 */
|
605 |
+
/* 42 */ if (typeof window.sidekick !== 'undefined' && window.sidekick.get('playing')) {
|
606 |
+
/* 43 */ this.close_sidekick_window();
|
607 |
+
/* 44 */ } else {
|
608 |
+
/* 45 */ this.open_sidekick_mini_window();
|
609 |
+
/* 46 */ }
|
610 |
+
/* 47 */ console.groupEnd();
|
611 |
+
/* 48 */ return this;
|
612 |
+
/* 49 */ },
|
613 |
+
/* 50 */
|
614 |
+
|
615 |
+
/* appView.js */
|
616 |
+
|
617 |
+
/* 51 */ events: {
|
618 |
+
/* 52 */ "click #logo": "open_sidekick_window",
|
619 |
+
/* 53 */ "click h2 button.close": "open_sidekick_mini_window",
|
620 |
+
/* 54 */ "click h2 button.config": "goto_config",
|
621 |
+
/* 55 */ "click h2 button.goback": "go_back"
|
622 |
+
/* 56 */ },
|
623 |
+
/* 57 */
|
624 |
+
/* 58 */ close_sidekick_window: function(){
|
625 |
+
/* 59 */ // console.log('close_sidekick_window');
|
626 |
+
/* 60 */ $('.sidekick_container').hide();
|
627 |
+
/* 61 */ },
|
628 |
+
/* 62 */
|
629 |
+
/* 63 */ open_sidekick_mini_window: function(){
|
630 |
+
/* 64 */ // console.log('open_sidekick_mini_window');
|
631 |
+
/* 65 */ var width = '100px';
|
632 |
+
/* 66 */ var height = '70px';
|
633 |
+
/* 67 */
|
634 |
+
/* 68 */ if ($('.sidekick_container').is(':visible')) {
|
635 |
+
/* 69 */ $('.sidekick_container>*').fadeOut('fast',function(){
|
636 |
+
/* 70 */ $('.sidekick_container').animate({
|
637 |
+
/* 71 */ backgroundColor: 'transparent',
|
638 |
+
/* 72 */ borderColor: 'transparent'
|
639 |
+
/* 73 */ },200,function(){
|
640 |
+
/* 74 */ $('.sidekick_container').removeClass('shadow');
|
641 |
+
/* 75 */ $('.sidekick_container').animate({
|
642 |
+
/* 76 */ width: width,
|
643 |
+
/* 77 */ minHeight: height
|
644 |
+
/* 78 */ },200,function(){
|
645 |
+
/* 79 */ $('.sidekick_container #logo').fadeIn('slow');
|
646 |
+
/* 80 */ });
|
647 |
+
/* 81 */ });
|
648 |
+
/* 82 */ });
|
649 |
+
/* 83 */ } else {
|
650 |
+
/* 84 */ $('.sidekick_container').css({
|
651 |
+
/* 85 */ width: width,
|
652 |
+
/* 86 */ minHeight: height
|
653 |
+
/* 87 */ }).show();
|
654 |
+
/* 88 */ }
|
655 |
+
/* 89 */ },
|
656 |
+
/* 90 */
|
657 |
+
/* 91 */ goto_config: function(){
|
658 |
+
/* 92 */ // console.log('goto_config');
|
659 |
+
/* 93 */ window.open('/wp-admin/admin.php?page=sidekick','_self');
|
660 |
+
/* 94 */ },
|
661 |
+
/* 95 */
|
662 |
+
/* 96 */ go_back: function(){
|
663 |
+
/* 97 */ SidekickWP.Events.trigger('show_prev_pane');
|
664 |
+
/* 98 */ },
|
665 |
+
/* 99 */
|
666 |
+
/* 100 */ open_sidekick_window: function(e){
|
667 |
+
|
668 |
+
/* appView.js */
|
669 |
+
|
670 |
+
/* 101 */ // console.log('open_sidekick_window %o', e);
|
671 |
+
/* 102 */ var width = '300px';
|
672 |
+
/* 103 */ var height = '300px';
|
673 |
+
/* 104 */
|
674 |
+
/* 105 */ if (typeof e != 'undefined' && typeof e.currentTarget != 'undefined')
|
675 |
+
/* 106 */ SidekickWP.Events.trigger('track_open_sidekick_window',{position: $(e.currentTarget).attr('id')});
|
676 |
+
/* 107 */
|
677 |
+
/* 108 */ $('.sidekick_container #logo').fadeOut('fast',function(){
|
678 |
+
/* 109 */ $('.sidekick_container').show().animate({
|
679 |
+
/* 110 */ backgroundColor: '#e8e8e8',
|
680 |
+
/* 111 */ borderColor: '#d4d4d4',
|
681 |
+
/* 112 */ width: width,
|
682 |
+
/* 113 */ height: height
|
683 |
+
/* 114 */ },200,function(){
|
684 |
+
/* 115 */ $('.sidekick_container').addClass('shadow');
|
685 |
+
/* 116 */ $('.sidekick_container>*').not('.sidekick_container #logo').fadeIn('fast');
|
686 |
+
/* 117 */ });
|
687 |
+
/* 118 */ });
|
688 |
+
/* 119 */ },
|
689 |
+
/* 120 */
|
690 |
+
/* 121 */ update_header: function(){
|
691 |
+
/* 122 */ console.log('update_header %o', $('#sidekick .bucketContainer ul').length);
|
692 |
+
/* 123 */
|
693 |
+
/* 124 */ if ($('#sidekick ul.message').length){
|
694 |
+
/* 125 */ $('#sidekick h2 button').addClass('goback hide');
|
695 |
+
/* 126 */ } else if ($('#sidekick .bucketContainer ul').length > 1) {
|
696 |
+
/* 127 */ $('#sidekick h2 button').addClass('goback').removeClass('config hide');
|
697 |
+
/* 128 */ } else {
|
698 |
+
/* 129 */ $('#sidekick h2 button').addClass('config').removeClass('goback hide');
|
699 |
+
/* 130 */ }
|
700 |
+
/* 131 */
|
701 |
+
/* 132 */ var new_title = $('#sidekick .bucketContainer div>ul:last-child').data('title');
|
702 |
+
/* 133 */
|
703 |
+
/* 134 */ if (new_title)
|
704 |
+
/* 135 */ $('#sidekick h2 span').html(new_title);
|
705 |
+
/* 136 */
|
706 |
+
/* 137 */ SidekickWP.Events.trigger('rendered');
|
707 |
+
/* 138 */ },
|
708 |
+
/* 139 */
|
709 |
+
/* 140 */ show_next_pane: function(){
|
710 |
+
/* 141 */ console.log('show_next_pane');
|
711 |
+
/* 142 */ // $('#sidekick .bucketContainer').css({overflowY:'hidden',overflowX:'hidden'});
|
712 |
+
/* 143 */ $('#sidekick .bucketContainer div>ul:last-child, #sidekick .bucketContainer div>ul:nth-last-child(2)').animate({
|
713 |
+
/* 144 */ left: '-=300'
|
714 |
+
/* 145 */ },200,function(){
|
715 |
+
/* 146 */ // $('#sidekick .bucketContainer').css({overflowY:'auto'});
|
716 |
+
/* 147 */ }).wait(100,function(e){
|
717 |
+
/* 148 */ SidekickWP.Events.trigger('do_update_header');
|
718 |
+
/* 149 */ });
|
719 |
+
/* 150 */ SidekickWP.Helpers.preventScrolling();
|
720 |
+
|
721 |
+
/* appView.js */
|
722 |
+
|
723 |
+
/* 151 */ },
|
724 |
+
/* 152 */
|
725 |
+
/* 153 */ show_prev_pane: function(){
|
726 |
+
/* 154 */ console.log('show_prev_pane');
|
727 |
+
/* 155 */ if ($('#sidekick .review').length > 0) {
|
728 |
+
/* 156 */ $('#sidekick .bucketContainer div>ul').not(':last-child,:first-child').remove();
|
729 |
+
/* 157 */ }
|
730 |
+
/* 158 */ $('#sidekick .bucketContainer div>ul:last-child, #sidekick .bucketContainer div>ul:nth-last-child(2)').animate({
|
731 |
+
/* 159 */ left: '+=300'
|
732 |
+
/* 160 */ },200).wait(200).filter(':last-child').remove().wait(0,function(e){
|
733 |
+
/* 161 */ SidekickWP.Events.trigger('do_update_header');
|
734 |
+
/* 162 */ });
|
735 |
+
/* 163 */ SidekickWP.Helpers.preventScrolling();
|
736 |
+
/* 164 */ },
|
737 |
+
/* 165 */
|
738 |
+
/* 166 */ show_main_pane: function(){
|
739 |
+
/* 167 */ console.log('show_main_pane');
|
740 |
+
/* 168 */
|
741 |
+
/* 169 */ $('#sidekick .bucketContainer div>ul').not(':last-child,:first-child').remove();
|
742 |
+
/* 170 */ $('#sidekick .bucketContainer div>ul:last-child, #sidekick .bucketContainer div>ul:first-child').animate({
|
743 |
+
/* 171 */ left: '+=300'
|
744 |
+
/* 172 */ },200).wait(200).filter(':last-child').remove().wait(0,function(e){
|
745 |
+
/* 173 */ SidekickWP.Events.trigger('do_update_header');
|
746 |
+
/* 174 */ });
|
747 |
+
/* 175 */ SidekickWP.Helpers.preventScrolling();
|
748 |
+
/* 176 */ }
|
749 |
+
/* 177 */ });
|
750 |
+
/* 178 */
|
751 |
+
/* 179 */ }(jQuery));
|
752 |
+
/* 180 */
|
753 |
+
/* 181 */
|
754 |
+
/* 182 */
|
755 |
+
/* 183 */
|
756 |
+
|
757 |
+
;
|
758 |
+
/* bucketContainerView.js */
|
759 |
+
|
760 |
+
/* 1 */ (function($) {
|
761 |
+
/* 2 */ SidekickWP.Views.BucketContainer = Backbone.View.extend({
|
762 |
+
/* 3 */ // el: $('.BucketContainer'),
|
763 |
+
/* 4 */ // tagName: 'ul',
|
764 |
+
/* 5 */
|
765 |
+
/* 6 */ initialize: function(models,options){
|
766 |
+
/* 7 */ console.group('%cinitialize: bucketContiainerView %o', 'color:#3b4580', arguments);
|
767 |
+
/* 8 */ SidekickWP.Events.on('rendered', this.setup_events, this);
|
768 |
+
/* 9 */ return this;
|
769 |
+
/* 10 */ },
|
770 |
+
/* 11 */
|
771 |
+
/* 12 */ render: function(){
|
772 |
+
/* 13 */ // console.log('render bucketContiainerView %o',this);
|
773 |
+
/* 14 */ console.group('%crender: render: bucketContainerView %o', 'color:#8fa2ff', this);
|
774 |
+
/* 15 */
|
775 |
+
/* 16 */ SidekickWP.Events.trigger('track_explore',{what:'Bucket' });
|
776 |
+
/* 17 */ this.bucket = new SidekickWP.Models.Bucket({
|
777 |
+
/* 18 */ title: this.model.get('title'),
|
778 |
+
/* 19 */ bucket: this.model.get('full_library'),
|
779 |
+
/* 20 */ bucket_counts: this.model.get('bucket_counts')
|
780 |
+
/* 21 */ });
|
781 |
+
/* 22 */ this.$el.append(this.bucket.view.render().el);
|
782 |
+
/* 23 */ this.$el.find('.buckets').show().removeClass('new_window').addClass('current_window');
|
783 |
+
/* 24 */ return this;
|
784 |
+
/* 25 */ },
|
785 |
+
/* 26 */
|
786 |
+
/* 27 */ events: {
|
787 |
+
/* 28 */ "click .bucket": "clicked_bucket"
|
788 |
+
/* 29 */ },
|
789 |
+
/* 30 */
|
790 |
+
/* 31 */ clicked_bucket: function(e){
|
791 |
+
/* 32 */ // console.log('clicked_bucket');
|
792 |
+
/* 33 */ var bucket_to_open = $(e).data('bucket');
|
793 |
+
/* 34 */ // console.log('bucket_to_open %o', bucket_to_open);
|
794 |
+
/* 35 */
|
795 |
+
/* 36 */ var all_buckets = this.model.get('all_buckets');
|
796 |
+
/* 37 */ // console.log('all_buckets %o', all_buckets);
|
797 |
+
/* 38 */
|
798 |
+
/* 39 */ bucket_to_open = all_buckets[bucket_to_open];
|
799 |
+
/* 40 */ // console.log('bucket_to_open %o', bucket_to_open);
|
800 |
+
/* 41 */
|
801 |
+
/* 42 */ if (bucket_to_open.walkthroughs) {
|
802 |
+
/* 43 */ this.list = new SidekickWP.Models.List({
|
803 |
+
/* 44 */ bucket: bucket_to_open.walkthroughs,
|
804 |
+
/* 45 */ title: bucket_to_open.title
|
805 |
+
/* 46 */ });
|
806 |
+
/* 47 */ $('.bucketContainer>div').append( this.list.view.render().$el.html() );
|
807 |
+
/* 48 */ SidekickWP.Events.trigger('show_next_pane');
|
808 |
+
/* 49 */ } else {
|
809 |
+
/* 50 */ this.bucket = new SidekickWP.Models.Bucket({
|
810 |
+
|
811 |
+
/* bucketContainerView.js */
|
812 |
+
|
813 |
+
/* 51 */ bucket: bucket_to_open.sub_buckets,
|
814 |
+
/* 52 */ bucket_counts: this.model.get('bucket_counts'),
|
815 |
+
/* 53 */ title: bucket_to_open.title
|
816 |
+
/* 54 */ });
|
817 |
+
/* 55 */ $('.bucketContainer>div').append( this.bucket.view.render().$el.html() );
|
818 |
+
/* 56 */ SidekickWP.Events.trigger('show_next_pane');
|
819 |
+
/* 57 */ }
|
820 |
+
/* 58 */ },
|
821 |
+
/* 59 */
|
822 |
+
/* 60 */ setup_events: function(){
|
823 |
+
/* 61 */ console.log('setup_events');
|
824 |
+
/* 62 */ var group_id = this.model.get('id');
|
825 |
+
/* 63 */
|
826 |
+
/* 64 */ $('.bucket').unbind('click').click({context:this},function(e){
|
827 |
+
/* 65 */ // console.log('click',e);
|
828 |
+
/* 66 */ e.data.context.clicked_bucket(this);
|
829 |
+
/* 67 */ });
|
830 |
+
/* 68 */
|
831 |
+
/* 69 */ $('a.sidekick_play_walkthrough').unbind('click').click({context:this},function(e){
|
832 |
+
/* 70 */ // console.log('click aa',e);
|
833 |
+
/* 71 */ SidekickWP.Events.trigger('close_sidekick_window');
|
834 |
+
/* 72 */ });
|
835 |
+
/* 73 */
|
836 |
+
/* 74 */ // SidekickWP.Helpers.preventScrolling();
|
837 |
+
/* 75 */ }
|
838 |
+
/* 76 */ });
|
839 |
+
/* 77 */
|
840 |
+
/* 78 */ }(jQuery));
|
841 |
+
/* 79 */
|
842 |
+
/* 80 */
|
843 |
+
|
844 |
+
;
|
845 |
+
/* bucketView.js */
|
846 |
+
|
847 |
+
/* 1 */ (function($) {
|
848 |
+
/* 2 */ SidekickWP.Views.Bucket = Backbone.View.extend({
|
849 |
+
/* 3 */
|
850 |
+
/* 4 */ initialize: function(models,options){
|
851 |
+
/* 5 */ return this;
|
852 |
+
/* 6 */ },
|
853 |
+
/* 7 */
|
854 |
+
/* 8 */ render: function(){
|
855 |
+
/* 9 */ console.group('%crender: render: bucketView %o', 'color:#8fa2ff', this);
|
856 |
+
/* 10 */
|
857 |
+
/* 11 */ SidekickWP.Events.trigger('track_explore',{what:'Bucket' });
|
858 |
+
/* 12 */
|
859 |
+
/* 13 */ var variables = {
|
860 |
+
/* 14 */ title: this.model.get('title'),
|
861 |
+
/* 15 */ bucket: this.model.get('bucket'),
|
862 |
+
/* 16 */ bucket_counts: this.model.get('bucket_counts')
|
863 |
+
/* 17 */ };
|
864 |
+
/* 18 */ console.log('variables %o', variables);
|
865 |
+
/* 19 */
|
866 |
+
/* 20 */ var template = _.template( SidekickWP.Templates.Bucket, variables );
|
867 |
+
/* 21 */ this.$el.append(template);
|
868 |
+
/* 22 */ console.groupEnd();
|
869 |
+
/* 23 */ return this;
|
870 |
+
/* 24 */ }
|
871 |
+
/* 25 */ });
|
872 |
+
/* 26 */
|
873 |
+
/* 27 */ }(jQuery));
|
874 |
+
|
875 |
+
;
|
876 |
+
/* listView.js */
|
877 |
+
|
878 |
+
/* 1 */ (function($) {
|
879 |
+
/* 2 */ SidekickWP.Views.List = Backbone.View.extend({
|
880 |
+
/* 3 */
|
881 |
+
/* 4 */ initialize: function(models,options){
|
882 |
+
/* 5 */ return this;
|
883 |
+
/* 6 */ },
|
884 |
+
/* 7 */
|
885 |
+
/* 8 */ render: function(){
|
886 |
+
/* 9 */ console.group('%crender: render: listView %o', 'color:#8fa2ff', this);
|
887 |
+
/* 10 */
|
888 |
+
/* 11 */ SidekickWP.Events.trigger('track_explore',{what:'List' });
|
889 |
+
/* 12 */
|
890 |
+
/* 13 */ var variables = {
|
891 |
+
/* 14 */ bucket: this.model.get('bucket'),
|
892 |
+
/* 15 */ title: this.model.get('title')
|
893 |
+
/* 16 */ };
|
894 |
+
/* 17 */ console.log('variables %o', variables);
|
895 |
+
/* 18 */
|
896 |
+
/* 19 */ var template = _.template( SidekickWP.Templates.List, variables );
|
897 |
+
/* 20 */ console.log('template %o', template);
|
898 |
+
/* 21 */
|
899 |
+
/* 22 */ // SidekickWP.Helpers.preventScrolling();
|
900 |
+
/* 23 */ this.$el.append(template);
|
901 |
+
/* 24 */ console.groupEnd();
|
902 |
+
/* 25 */ return this;
|
903 |
+
/* 26 */ }
|
904 |
+
/* 27 */ });
|
905 |
+
/* 28 */ }(jQuery));
|
906 |
+
|
907 |
+
;
|
908 |
+
/* messageView.js */
|
909 |
+
|
910 |
+
/* 1 */ (function($) {
|
911 |
+
/* 2 */ SidekickWP.Views.Message = Backbone.View.extend({
|
912 |
+
/* 3 */
|
913 |
+
/* 4 */ initialize: function(models,options){
|
914 |
+
/* 5 */ console.group('%crender: render: messageView %o', 'color:#8fa2ff', this);
|
915 |
+
/* 6 */ this.render();
|
916 |
+
/* 7 */ console.groupEnd();
|
917 |
+
/* 8 */ return this;
|
918 |
+
/* 9 */ },
|
919 |
+
/* 10 */
|
920 |
+
/* 11 */ render: function(){
|
921 |
+
/* 12 */
|
922 |
+
/* 13 */ var variables = {
|
923 |
+
/* 14 */ title: this.model.get('title'),
|
924 |
+
/* 15 */ message: this.model.get('message')
|
925 |
+
/* 16 */ };
|
926 |
+
/* 17 */
|
927 |
+
/* 18 */ var template = _.template( SidekickWP.Templates.Message, variables );
|
928 |
+
/* 19 */
|
929 |
+
/* 20 */ this.$el.append( template );
|
930 |
+
/* 21 */ SidekickWP.Helpers.preventScrolling();
|
931 |
+
/* 22 */ SidekickWP.Events.trigger('show_next_pane');
|
932 |
+
/* 23 */
|
933 |
+
/* 24 */ // $('#sidekick .prev_window').removeClass('prev_window');
|
934 |
+
/* 25 */ // $('#sidekick #main_menu').addClass('prev_window');
|
935 |
+
/* 26 */ // $('#sidekick ul.main>li').not('#main_menu,#review').remove();
|
936 |
+
/* 27 */
|
937 |
+
/* 28 */ return this;
|
938 |
+
/* 29 */ }
|
939 |
+
/* 30 */
|
940 |
+
/* 31 */ });
|
941 |
+
/* 32 */
|
942 |
+
/* 33 */ }(jQuery));
|
943 |
+
|
944 |
+
;
|
945 |
+
/* reviewView.js */
|
946 |
+
|
947 |
+
/* 1 */ (function($) {
|
948 |
+
/* 2 */ SidekickWP.Views.Review = Backbone.View.extend({
|
949 |
+
/* 3 */
|
950 |
+
/* 4 */ initialize: function(models,options){
|
951 |
+
/* 5 */ console.group('%cinitialize: Core View %o', 'color:#3b4580', arguments);
|
952 |
+
/* 6 */ this.render();
|
953 |
+
/* 7 */ this.setup_events();
|
954 |
+
/* 8 */ console.groupEnd();
|
955 |
+
/* 9 */ return this;
|
956 |
+
/* 10 */ },
|
957 |
+
/* 11 */
|
958 |
+
/* 12 */ render: function(){
|
959 |
+
/* 13 */ console.group('%crender: render: renderView %o', 'color:#8fa2ff', this);
|
960 |
+
/* 14 */ console.log('SidekickWP.Templates.Review %o', SidekickWP.Templates.Review);
|
961 |
+
/* 15 */
|
962 |
+
/* 16 */ var variables = {
|
963 |
+
/* 17 */ title: 'How did we do?'
|
964 |
+
/* 18 */ };
|
965 |
+
/* 19 */
|
966 |
+
/* 20 */ var template = _.template( SidekickWP.Templates.Review, variables );
|
967 |
+
/* 21 */ console.log('template %o', template);
|
968 |
+
/* 22 */
|
969 |
+
/* 23 */ this.$el.append( template );
|
970 |
+
/* 24 */ SidekickWP.Helpers.preventScrolling();
|
971 |
+
/* 25 */ SidekickWP.Events.trigger('show_next_pane');
|
972 |
+
/* 26 */
|
973 |
+
/* 27 */ // $('#sidekick .prev_window').removeClass('prev_window');
|
974 |
+
/* 28 */ // $('#sidekick #main_menu').addClass('prev_window');
|
975 |
+
/* 29 */ // $('#sidekick ul.main>li').not('#main_menu,#review').remove();
|
976 |
+
/* 30 */
|
977 |
+
/* 31 */ return this;
|
978 |
+
/* 32 */ },
|
979 |
+
/* 33 */
|
980 |
+
/* 34 */ events: {
|
981 |
+
/* 35 */ "click input[type='submit']": "submit",
|
982 |
+
/* 36 */ "click div.rate span": "rate"
|
983 |
+
/* 37 */ },
|
984 |
+
/* 38 */
|
985 |
+
/* 39 */ setup_events: function(){
|
986 |
+
/* 40 */ var group_id = this.model.get('id');
|
987 |
+
/* 41 */
|
988 |
+
/* 42 */ $('#sidekick .review h2 button.goback, #sidekick .review input[type="button"]').unbind('click').click({context:this},function(e){
|
989 |
+
/* 43 */ console.log('click goback/button');
|
990 |
+
/* 44 */ SidekickWP.Events.trigger('show_main_pane');
|
991 |
+
/* 45 */ });
|
992 |
+
/* 46 */
|
993 |
+
/* 47 */ $('#sidekick .review .rate span').unbind('hover').hover(function(){
|
994 |
+
/* 48 */ $(this).addClass('hover')
|
995 |
+
/* 49 */ .prevAll().addClass('hover');
|
996 |
+
/* 50 */ },function(){
|
997 |
+
|
998 |
+
/* reviewView.js */
|
999 |
+
|
1000 |
+
/* 51 */ $('#sidekick .review .rate span').removeClass('hover');
|
1001 |
+
/* 52 */ });
|
1002 |
+
/* 53 */
|
1003 |
+
/* 54 */ $('#sidekick .review .rate span').unbind('click').click = this.rate;
|
1004 |
+
/* 55 */
|
1005 |
+
/* 56 */ $('#sidekick .review textarea').unbind('click').click(function(){
|
1006 |
+
/* 57 */ if(!$(this).hasClass('clicked')){
|
1007 |
+
/* 58 */ $(this).addClass('clicked')
|
1008 |
+
/* 59 */ .val('');
|
1009 |
+
/* 60 */ }
|
1010 |
+
/* 61 */ });
|
1011 |
+
/* 62 */ },
|
1012 |
+
/* 63 */
|
1013 |
+
/* 64 */ submit: function(){
|
1014 |
+
/* 65 */ var data = {
|
1015 |
+
/* 66 */ walkthrough_title: this.model.get('walkthrough_title'),
|
1016 |
+
/* 67 */ value: $('#sidekick textarea[name="comment"]').val(),
|
1017 |
+
/* 68 */ license: sk_license_key
|
1018 |
+
/* 69 */ };
|
1019 |
+
/* 70 */
|
1020 |
+
/* 71 */ $.ajax({
|
1021 |
+
/* 72 */ url: 'http://www.wpuniversity.com/wp-admin/admin-ajax.php?action=wpu_add_comment',
|
1022 |
+
/* 73 */ context: this,
|
1023 |
+
/* 74 */ data: data,
|
1024 |
+
/* 75 */ dataType: 'json'
|
1025 |
+
/* 76 */ }).done(function(data,e){
|
1026 |
+
/* 77 */ console.log('Saved Comment');
|
1027 |
+
/* 78 */ $('#sidekick textarea').html('Thank You!');
|
1028 |
+
/* 79 */ $('#sidekick .review input[type="submit"]').val('Sent!');
|
1029 |
+
/* 80 */ setTimeout(SidekickWP.Events.trigger('show_main_pane'),3000);
|
1030 |
+
/* 81 */ }).error(function(e){
|
1031 |
+
/* 82 */ console.error('Comment Save error (%o)',e);
|
1032 |
+
/* 83 */ });
|
1033 |
+
/* 84 */ },
|
1034 |
+
/* 85 */
|
1035 |
+
/* 86 */ rate: function(e){
|
1036 |
+
/* 87 */ var data = {
|
1037 |
+
/* 88 */ walkthrough_title: this.model.get('walkthrough_title'),
|
1038 |
+
/* 89 */ rating: $(e.currentTarget).data('val'),
|
1039 |
+
/* 90 */ license: sk_license_key
|
1040 |
+
/* 91 */ };
|
1041 |
+
/* 92 */
|
1042 |
+
/* 93 */ $(e.currentTarget).addClass('saved')
|
1043 |
+
/* 94 */ .prevAll().addClass('saved');
|
1044 |
+
/* 95 */
|
1045 |
+
/* 96 */ $('#sidekick .rate span').unbind('mouseenter mouseleave click').css({cursor: 'default'});
|
1046 |
+
/* 97 */
|
1047 |
+
/* 98 */ $.ajax({
|
1048 |
+
/* 99 */ url: 'http://www.wpuniversity.com/wp-admin/admin-ajax.php?action=wpu_add_rating',
|
1049 |
+
/* 100 */ context: this,
|
1050 |
+
|
1051 |
+
/* reviewView.js */
|
1052 |
+
|
1053 |
+
/* 101 */ data: data,
|
1054 |
+
/* 102 */ dataType: 'json'
|
1055 |
+
/* 103 */ }).done(function(data,e){
|
1056 |
+
/* 104 */ console.log('Saved Rating');
|
1057 |
+
/* 105 */ $('#sidekick .hover').addClass('saved');
|
1058 |
+
/* 106 */
|
1059 |
+
/* 107 */ }).error(function(e){
|
1060 |
+
/* 108 */ console.error('Rating Save error (%o)',e);
|
1061 |
+
/* 109 */ });
|
1062 |
+
/* 110 */
|
1063 |
+
/* 111 */ }
|
1064 |
+
/* 112 */
|
1065 |
+
/* 113 */ });
|
1066 |
+
/* 114 */
|
1067 |
+
/* 115 */ }(jQuery));
|
1068 |
+
|
1069 |
+
;
|
1070 |
+
/* templates.js */
|
1071 |
+
|
1072 |
+
/* 1 */ _.templateSettings.interpolate = /\{\{(.*?)\}\}/;
|
1073 |
+
/* 2 */
|
1074 |
+
/* 3 */ SidekickWP.Templates.App = [
|
1075 |
+
/* 4 */ "<div id='sidekick' class='sidekick_container'>",
|
1076 |
+
/* 5 */ "<h2><button class='config'></button><span>What do you need help with?</span><button class='close'></button></h2>",
|
1077 |
+
/* 6 */ "<div class='search'><!--<input type='text' value='Search'></input>--></div>",
|
1078 |
+
/* 7 */ "<ul class='bucketContainer'><% print(BucketContainer) %></ul>",
|
1079 |
+
/* 8 */ "<div id='logo'></div><a href='http://www.wpuniversity.com'><div id='logo_full'></div></a> ",
|
1080 |
+
/* 9 */ "</div>"
|
1081 |
+
/* 10 */ ].join("");
|
1082 |
+
/* 11 */
|
1083 |
+
/* 12 */
|
1084 |
+
/* 13 */ SidekickWP.Templates.Bucket = [
|
1085 |
+
/* 14 */ "<ul class='big buckets new_window' data-title='<% print(title) %>'>",
|
1086 |
+
/* 15 */ "<% _.each(bucket, function(bucket_data, key){ %>",
|
1087 |
+
/* 16 */ "<% if (bucket_data.walkthroughs || bucket_data.sub_buckets) { %>",
|
1088 |
+
/* 17 */ "<li data-bucket='<% print(key) %>' class='group_section bucket <% if (bucket_data.sub_buckets) { %>sub_buckets_exist<% } %>'><div><% print(bucket_data.title) %> <span><% print(bucket_counts[bucket_data.title].count) %></span></div></li>",
|
1089 |
+
/* 18 */ "<% } %>",
|
1090 |
+
/* 19 */ "<% }); %>",
|
1091 |
+
/* 20 */ "</ul>"
|
1092 |
+
/* 21 */ ].join("");
|
1093 |
+
/* 22 */
|
1094 |
+
/* 23 */ SidekickWP.Templates.List = [
|
1095 |
+
/* 24 */ "<ul class='list small buckets new_window' data-title='<% print(title) %>'>",
|
1096 |
+
/* 25 */ "<% if (bucket.overview) { %>",
|
1097 |
+
/* 26 */ "<li class='heading'><div>Overviews</div></li>",
|
1098 |
+
/* 27 */ "<li>",
|
1099 |
+
/* 28 */ "<ul class='walkthroughs'>",
|
1100 |
+
/* 29 */ "<% _.each(bucket.overview, function(walkthrough){ %> ",
|
1101 |
+
/* 30 */ "<% console.log(walkthrough) %><a class='sidekick_play_walkthrough' href='javascript: sidekick.play_walkthrough(\"<% print(walkthrough.id) %>\")'>",
|
1102 |
+
/* 31 */ "<li><div><% print(walkthrough.title) %></div></li>",
|
1103 |
+
/* 32 */ "</a>",
|
1104 |
+
/* 33 */ "<% }); %>",
|
1105 |
+
/* 34 */ "</ul>",
|
1106 |
+
/* 35 */ "</li>",
|
1107 |
+
/* 36 */ "<% } %>",
|
1108 |
+
/* 37 */ "<% if (bucket.how) { %>",
|
1109 |
+
/* 38 */ "<li class='heading'><div>How Tos</div></li>",
|
1110 |
+
/* 39 */ "<li>",
|
1111 |
+
/* 40 */ "<ul class='walkthroughs'>",
|
1112 |
+
/* 41 */ "<% _.each(bucket.how, function(walkthrough){ %>",
|
1113 |
+
/* 42 */ "<a class='sidekick_play_walkthrough' href='javascript: sidekick.play_walkthrough(\"<% print(walkthrough.id) %>\")'>",
|
1114 |
+
/* 43 */ "<li><div><% print(walkthrough.title) %></div></li>",
|
1115 |
+
/* 44 */ "</a>",
|
1116 |
+
/* 45 */ "<% }); %>",
|
1117 |
+
/* 46 */ "</ul>",
|
1118 |
+
/* 47 */ "</li>",
|
1119 |
+
/* 48 */ "<% } %>",
|
1120 |
+
/* 49 */ "</ul>"
|
1121 |
+
/* 50 */ ].join("");
|
1122 |
+
|
1123 |
+
/* templates.js */
|
1124 |
+
|
1125 |
+
/* 51 */
|
1126 |
+
/* 52 */ SidekickWP.Templates.Review = [
|
1127 |
+
/* 53 */ "<ul class='new_window review' data-title='<% print(title) %>'>",
|
1128 |
+
/* 54 */ "<li>",
|
1129 |
+
/* 55 */ "<div><div class='rate'><span data-val='1' class='rate1'></span><span data-val='2' class='rate2'></span><span data-val='3' class='rate3'></span><span data-val='4' class='rate4'></span><span data-val='5' class='rate5'></span></div>",
|
1130 |
+
/* 56 */ "<textarea name='comment'>Let us know if you found the Walkthrough helpful or if we can improve something.</textarea>",
|
1131 |
+
/* 57 */ "<br/><input type='button' value='Skip'></input><input type='submit' value='Submit'></input>",
|
1132 |
+
/* 58 */ "</li>",
|
1133 |
+
/* 59 */ "</ul>"
|
1134 |
+
/* 60 */ ].join("");
|
1135 |
+
/* 61 */
|
1136 |
+
/* 62 */
|
1137 |
+
/* 63 */ SidekickWP.Templates.Message = [
|
1138 |
+
/* 64 */ "<ul class='new_window message' data-title='<% print(title) %>'>",
|
1139 |
+
/* 65 */ "<li>",
|
1140 |
+
/* 66 */ "<div><% print(message) %></div>",
|
1141 |
+
/* 67 */ "</li>",
|
1142 |
+
/* 68 */ "</ul>"
|
1143 |
+
/* 69 */ ].join("");
|
1144 |
+
/* 70 */
|
1145 |
+
/* 71 */
|
1146 |
+
|
1147 |
+
;
|
1148 |
+
/* jquery.lightbox_me.js */
|
1149 |
+
|
1150 |
+
/* 1 */ /*
|
1151 |
+
/* 2 *| * $ lightbox_me
|
1152 |
+
/* 3 *| * By: Buck Wilson
|
1153 |
+
/* 4 *| * Version : 2.3
|
1154 |
+
/* 5 *| *
|
1155 |
+
/* 6 *| * Licensed under the Apache License, Version 2.0 (the "License");
|
1156 |
+
/* 7 *| * you may not use this file except in compliance with the License.
|
1157 |
+
/* 8 *| * You may obtain a copy of the License at
|
1158 |
+
/* 9 *| *
|
1159 |
+
/* 10 *| * http://www.apache.org/licenses/LICENSE-2.0
|
1160 |
+
/* 11 *| *
|
1161 |
+
/* 12 *| * Unless required by applicable law or agreed to in writing, software
|
1162 |
+
/* 13 *| * distributed under the License is distributed on an "AS IS" BASIS,
|
1163 |
+
/* 14 *| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
1164 |
+
/* 15 *| * See the License for the specific language governing permissions and
|
1165 |
+
/* 16 *| * limitations under the License.
|
1166 |
+
/* 17 *| */
|
1167 |
+
/* 18 */
|
1168 |
+
/* 19 */
|
1169 |
+
/* 20 */ (function($) {
|
1170 |
+
/* 21 */
|
1171 |
+
/* 22 */ $.fn.lightbox_me = function(options) {
|
1172 |
+
/* 23 */
|
1173 |
+
/* 24 */ return this.each(function() {
|
1174 |
+
/* 25 */
|
1175 |
+
/* 26 */ var
|
1176 |
+
/* 27 */ opts = $.extend({}, $.fn.lightbox_me.defaults, options),
|
1177 |
+
/* 28 */ $overlay = $(),
|
1178 |
+
/* 29 */ $self = $(this),
|
1179 |
+
/* 30 */ $iframe = $('<iframe id="foo" style="z-index: ' + (opts.zIndex + 1) + ';border: none; margin: 0; padding: 0; position: absolute; width: 100%; height: 100%; top: 0; left: 0; filter: mask();"/>'),
|
1180 |
+
/* 31 */ ie6 = ($.browser.msie && $.browser.version < 7);
|
1181 |
+
/* 32 */
|
1182 |
+
/* 33 */ if (opts.showOverlay) {
|
1183 |
+
/* 34 */ //check if there's an existing overlay, if so, make subequent ones clear
|
1184 |
+
/* 35 */ var $currentOverlays = $(".js_lb_overlay:visible");
|
1185 |
+
/* 36 */ if ($currentOverlays.length > 0){
|
1186 |
+
/* 37 */ $overlay = $('<div class="lb_overlay_clear js_lb_overlay"/>');
|
1187 |
+
/* 38 */ } else {
|
1188 |
+
/* 39 */ $overlay = $('<div class="' + opts.classPrefix + '_overlay js_lb_overlay"/>');
|
1189 |
+
/* 40 */ }
|
1190 |
+
/* 41 */ }
|
1191 |
+
/* 42 */
|
1192 |
+
/* 43 */ /*----------------------------------------------------
|
1193 |
+
/* 44 *| DOM Building
|
1194 |
+
/* 45 *| ---------------------------------------------------- */
|
1195 |
+
/* 46 */ if (ie6) {
|
1196 |
+
/* 47 */ var src = /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank';
|
1197 |
+
/* 48 */ $iframe.attr('src', src);
|
1198 |
+
/* 49 */ $('body').append($iframe);
|
1199 |
+
/* 50 */ } // iframe shim for ie6, to hide select elements
|
1200 |
+
|
1201 |
+
/* jquery.lightbox_me.js */
|
1202 |
+
|
1203 |
+
/* 51 */ $('body').append($self.hide()).append($overlay);
|
1204 |
+
/* 52 */
|
1205 |
+
/* 53 */
|
1206 |
+
/* 54 */ /*----------------------------------------------------
|
1207 |
+
/* 55 *| Overlay CSS stuffs
|
1208 |
+
/* 56 *| ---------------------------------------------------- */
|
1209 |
+
/* 57 */
|
1210 |
+
/* 58 */ // set css of the overlay
|
1211 |
+
/* 59 */ if (opts.showOverlay) {
|
1212 |
+
/* 60 */ setOverlayHeight(); // pulled this into a function because it is called on window resize.
|
1213 |
+
/* 61 */ $overlay.css({ position: 'absolute', width: '100%', top: 0, left: 0, right: 0, bottom: 0, zIndex: (opts.zIndex + 2), display: 'none' });
|
1214 |
+
/* 62 */ if (!$overlay.hasClass('lb_overlay_clear')){
|
1215 |
+
/* 63 */ $overlay.css(opts.overlayCSS);
|
1216 |
+
/* 64 */ }
|
1217 |
+
/* 65 */ }
|
1218 |
+
/* 66 */
|
1219 |
+
/* 67 */ /*----------------------------------------------------
|
1220 |
+
/* 68 *| Animate it in.
|
1221 |
+
/* 69 *| ---------------------------------------------------- */
|
1222 |
+
/* 70 */ //
|
1223 |
+
/* 71 */ if (opts.showOverlay) {
|
1224 |
+
/* 72 */ $overlay.fadeIn(opts.overlaySpeed, function() {
|
1225 |
+
/* 73 */ setSelfPosition();
|
1226 |
+
/* 74 */ $self[opts.appearEffect](opts.lightboxSpeed, function() { setOverlayHeight(); setSelfPosition(); opts.onLoad()});
|
1227 |
+
/* 75 */ });
|
1228 |
+
/* 76 */ } else {
|
1229 |
+
/* 77 */ setSelfPosition();
|
1230 |
+
/* 78 */ $self[opts.appearEffect](opts.lightboxSpeed, function() { opts.onLoad()});
|
1231 |
+
/* 79 */ }
|
1232 |
+
/* 80 */
|
1233 |
+
/* 81 */ /*----------------------------------------------------
|
1234 |
+
/* 82 *| Hide parent if parent specified (parentLightbox should be jquery reference to any parent lightbox)
|
1235 |
+
/* 83 *| ---------------------------------------------------- */
|
1236 |
+
/* 84 */ if (opts.parentLightbox) {
|
1237 |
+
/* 85 */ opts.parentLightbox.fadeOut(200);
|
1238 |
+
/* 86 */ }
|
1239 |
+
/* 87 */
|
1240 |
+
/* 88 */
|
1241 |
+
/* 89 */ /*----------------------------------------------------
|
1242 |
+
/* 90 *| Bind Events
|
1243 |
+
/* 91 *| ---------------------------------------------------- */
|
1244 |
+
/* 92 */
|
1245 |
+
/* 93 */ $(window).resize(setOverlayHeight)
|
1246 |
+
/* 94 */ .resize(setSelfPosition)
|
1247 |
+
/* 95 */ .scroll(setSelfPosition);
|
1248 |
+
/* 96 */
|
1249 |
+
/* 97 */ $(window).bind('keyup.lightbox_me', observeKeyPress);
|
1250 |
+
/* 98 */
|
1251 |
+
/* 99 */ if (opts.closeClick) {
|
1252 |
+
/* 100 */ $overlay.click(function(e) { closeLightbox(); e.preventDefault; });
|
1253 |
+
|
1254 |
+
/* jquery.lightbox_me.js */
|
1255 |
+
|
1256 |
+
/* 101 */ }
|
1257 |
+
/* 102 */ $self.delegate(opts.closeSelector, "click", function(e) {
|
1258 |
+
/* 103 */ closeLightbox(); e.preventDefault();
|
1259 |
+
/* 104 */ });
|
1260 |
+
/* 105 */ $self.bind('close', closeLightbox);
|
1261 |
+
/* 106 */ $self.bind('reposition', setSelfPosition);
|
1262 |
+
/* 107 */
|
1263 |
+
/* 108 */
|
1264 |
+
/* 109 */
|
1265 |
+
/* 110 */ /*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
1266 |
+
/* 111 *| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
|
1267 |
+
/* 112 */
|
1268 |
+
/* 113 */
|
1269 |
+
/* 114 */ /*----------------------------------------------------
|
1270 |
+
/* 115 *| Private Functions
|
1271 |
+
/* 116 *| ---------------------------------------------------- */
|
1272 |
+
/* 117 */
|
1273 |
+
/* 118 */ /* Remove or hide all elements */
|
1274 |
+
/* 119 */ function closeLightbox() {
|
1275 |
+
/* 120 */ var s = $self[0].style;
|
1276 |
+
/* 121 */ if (opts.destroyOnClose) {
|
1277 |
+
/* 122 */ $self.add($overlay).remove();
|
1278 |
+
/* 123 */ } else {
|
1279 |
+
/* 124 */ $self.add($overlay).hide();
|
1280 |
+
/* 125 */ }
|
1281 |
+
/* 126 */
|
1282 |
+
/* 127 */ //show the hidden parent lightbox
|
1283 |
+
/* 128 */ if (opts.parentLightbox) {
|
1284 |
+
/* 129 */ opts.parentLightbox.fadeIn(200);
|
1285 |
+
/* 130 */ }
|
1286 |
+
/* 131 */
|
1287 |
+
/* 132 */ $iframe.remove();
|
1288 |
+
/* 133 */
|
1289 |
+
/* 134 */ // clean up events.
|
1290 |
+
/* 135 */ $self.undelegate(opts.closeSelector, "click");
|
1291 |
+
/* 136 */
|
1292 |
+
/* 137 */ $(window).unbind('reposition', setOverlayHeight);
|
1293 |
+
/* 138 */ $(window).unbind('reposition', setSelfPosition);
|
1294 |
+
/* 139 */ $(window).unbind('scroll', setSelfPosition);
|
1295 |
+
/* 140 */ $(window).unbind('keyup.lightbox_me');
|
1296 |
+
/* 141 */ if (ie6)
|
1297 |
+
/* 142 */ s.removeExpression('top');
|
1298 |
+
/* 143 */ opts.onClose();
|
1299 |
+
/* 144 */ }
|
1300 |
+
/* 145 */
|
1301 |
+
/* 146 */
|
1302 |
+
/* 147 */ /* Function to bind to the window to observe the escape/enter key press */
|
1303 |
+
/* 148 */ function observeKeyPress(e) {
|
1304 |
+
/* 149 */ if((e.keyCode == 27 || (e.DOM_VK_ESCAPE == 27 && e.which==0)) && opts.closeEsc) closeLightbox();
|
1305 |
+
/* 150 */ }
|
1306 |
+
|
1307 |
+
/* jquery.lightbox_me.js */
|
1308 |
+
|
1309 |
+
/* 151 */
|
1310 |
+
/* 152 */
|
1311 |
+
/* 153 */ /* Set the height of the overlay
|
1312 |
+
/* 154 *| : if the document height is taller than the window, then set the overlay height to the document height.
|
1313 |
+
/* 155 *| : otherwise, just set overlay height: 100%
|
1314 |
+
/* 156 *| */
|
1315 |
+
/* 157 */ function setOverlayHeight() {
|
1316 |
+
/* 158 */ if ($(window).height() < $(document).height()) {
|
1317 |
+
/* 159 */ $overlay.css({height: $(document).height() + 'px'});
|
1318 |
+
/* 160 */ $iframe.css({height: $(document).height() + 'px'});
|
1319 |
+
/* 161 */ } else {
|
1320 |
+
/* 162 */ $overlay.css({height: '100%'});
|
1321 |
+
/* 163 */ if (ie6) {
|
1322 |
+
/* 164 */ $('html,body').css('height','100%');
|
1323 |
+
/* 165 */ $iframe.css('height', '100%');
|
1324 |
+
/* 166 */ } // ie6 hack for height: 100%; TODO: handle this in IE7
|
1325 |
+
/* 167 */ }
|
1326 |
+
/* 168 */ }
|
1327 |
+
/* 169 */
|
1328 |
+
/* 170 */
|
1329 |
+
/* 171 */ /* Set the position of the modal'd window ($self)
|
1330 |
+
/* 172 *| : if $self is taller than the window, then make it absolutely positioned
|
1331 |
+
/* 173 *| : otherwise fixed
|
1332 |
+
/* 174 *| */
|
1333 |
+
/* 175 */ function setSelfPosition() {
|
1334 |
+
/* 176 */ var s = $self[0].style;
|
1335 |
+
/* 177 */
|
1336 |
+
/* 178 */ // reset CSS so width is re-calculated for margin-left CSS
|
1337 |
+
/* 179 */ $self.css({left: '50%', marginLeft: ($self.outerWidth() / 2) * -1, zIndex: (opts.zIndex + 3) });
|
1338 |
+
/* 180 */
|
1339 |
+
/* 181 */
|
1340 |
+
/* 182 */ /* we have to get a little fancy when dealing with height, because lightbox_me
|
1341 |
+
/* 183 *| is just so fancy.
|
1342 |
+
/* 184 *| */
|
1343 |
+
/* 185 */
|
1344 |
+
/* 186 */ // if the height of $self is bigger than the window and self isn't already position absolute
|
1345 |
+
/* 187 */ if (($self.height() + 80 >= $(window).height()) && ($self.css('position') != 'absolute' || ie6)) {
|
1346 |
+
/* 188 */
|
1347 |
+
/* 189 */ // we are going to make it positioned where the user can see it, but they can still scroll
|
1348 |
+
/* 190 */ // so the top offset is based on the user's scroll position.
|
1349 |
+
/* 191 */ var topOffset = $(document).scrollTop() + 40;
|
1350 |
+
/* 192 */ $self.css({position: 'absolute', top: topOffset + 'px', marginTop: 0})
|
1351 |
+
/* 193 */ if (ie6) {
|
1352 |
+
/* 194 */ s.removeExpression('top');
|
1353 |
+
/* 195 */ }
|
1354 |
+
/* 196 */ } else if ($self.height()+ 80 < $(window).height()) {
|
1355 |
+
/* 197 */ //if the height is less than the window height, then we're gonna make this thing position: fixed.
|
1356 |
+
/* 198 */ // in ie6 we're gonna fake it.
|
1357 |
+
/* 199 */ if (ie6) {
|
1358 |
+
/* 200 */ s.position = 'absolute';
|
1359 |
+
|
1360 |
+
/* jquery.lightbox_me.js */
|
1361 |
+
|
1362 |
+
/* 201 */ if (opts.centered) {
|
1363 |
+
/* 202 */ s.setExpression('top', '(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"')
|
1364 |
+
/* 203 */ s.marginTop = 0;
|
1365 |
+
/* 204 */ } else {
|
1366 |
+
/* 205 */ var top = (opts.modalCSS && opts.modalCSS.top) ? parseInt(opts.modalCSS.top) : 0;
|
1367 |
+
/* 206 */ s.setExpression('top', '((blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"')
|
1368 |
+
/* 207 */ }
|
1369 |
+
/* 208 */ } else {
|
1370 |
+
/* 209 */ if (opts.centered) {
|
1371 |
+
/* 210 */ $self.css({ position: 'fixed', top: '50%', marginTop: ($self.outerHeight() / 2) * -1})
|
1372 |
+
/* 211 */ } else {
|
1373 |
+
/* 212 */ $self.css({ position: 'fixed'}).css(opts.modalCSS);
|
1374 |
+
/* 213 */ }
|
1375 |
+
/* 214 */
|
1376 |
+
/* 215 */ }
|
1377 |
+
/* 216 */ }
|
1378 |
+
/* 217 */ }
|
1379 |
+
/* 218 */
|
1380 |
+
/* 219 */ });
|
1381 |
+
/* 220 */
|
1382 |
+
/* 221 */
|
1383 |
+
/* 222 */
|
1384 |
+
/* 223 */ };
|
1385 |
+
/* 224 */
|
1386 |
+
/* 225 */ $.fn.lightbox_me.defaults = {
|
1387 |
+
/* 226 */
|
1388 |
+
/* 227 */ // animation
|
1389 |
+
/* 228 */ appearEffect: "fadeIn",
|
1390 |
+
/* 229 */ appearEase: "",
|
1391 |
+
/* 230 */ overlaySpeed: 250,
|
1392 |
+
/* 231 */ lightboxSpeed: 300,
|
1393 |
+
/* 232 */
|
1394 |
+
/* 233 */ // close
|
1395 |
+
/* 234 */ closeSelector: ".close",
|
1396 |
+
/* 235 */ closeClick: true,
|
1397 |
+
/* 236 */ closeEsc: true,
|
1398 |
+
/* 237 */
|
1399 |
+
/* 238 */ // behavior
|
1400 |
+
/* 239 */ destroyOnClose: false,
|
1401 |
+
/* 240 */ showOverlay: true,
|
1402 |
+
/* 241 */ parentLightbox: false,
|
1403 |
+
/* 242 */
|
1404 |
+
/* 243 */ // callbacks
|
1405 |
+
/* 244 */ onLoad: function() {},
|
1406 |
+
/* 245 */ onClose: function() {},
|
1407 |
+
/* 246 */
|
1408 |
+
/* 247 */ // style
|
1409 |
+
/* 248 */ classPrefix: 'lb',
|
1410 |
+
/* 249 */ zIndex: 999,
|
1411 |
+
/* 250 */ centered: false,
|
1412 |
+
|
1413 |
+
/* jquery.lightbox_me.js */
|
1414 |
+
|
1415 |
+
/* 251 */ modalCSS: {top: '40px'},
|
1416 |
+
/* 252 */ overlayCSS: {background: 'black', opacity: .3}
|
1417 |
+
/* 253 */ }
|
1418 |
+
/* 254 */ })(jQuery);
|
1419 |
+
|
1420 |
+
;
|
1421 |
+
/* jquery.easing.1.3.js */
|
1422 |
+
|
1423 |
+
/* 1 */ /*
|
1424 |
+
/* 2 *| * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
|
1425 |
+
/* 3 *| *
|
1426 |
+
/* 4 *| * Uses the built in easing capabilities added In jQuery 1.1
|
1427 |
+
/* 5 *| * to offer multiple easing options
|
1428 |
+
/* 6 *| *
|
1429 |
+
/* 7 *| * TERMS OF USE - jQuery Easing
|
1430 |
+
/* 8 *| *
|
1431 |
+
/* 9 *| * Open source under the BSD License.
|
1432 |
+
/* 10 *| *
|
1433 |
+
/* 11 *| * Copyright © 2008 George McGinley Smith
|
1434 |
+
/* 12 *| * All rights reserved.
|
1435 |
+
/* 13 *| *
|
1436 |
+
/* 14 *| * Redistribution and use in source and binary forms, with or without modification,
|
1437 |
+
/* 15 *| * are permitted provided that the following conditions are met:
|
1438 |
+
/* 16 *| *
|
1439 |
+
/* 17 *| * Redistributions of source code must retain the above copyright notice, this list of
|
1440 |
+
/* 18 *| * conditions and the following disclaimer.
|
1441 |
+
/* 19 *| * Redistributions in binary form must reproduce the above copyright notice, this list
|
1442 |
+
/* 20 *| * of conditions and the following disclaimer in the documentation and/or other materials
|
1443 |
+
/* 21 *| * provided with the distribution.
|
1444 |
+
/* 22 *| *
|
1445 |
+
/* 23 *| * Neither the name of the author nor the names of contributors may be used to endorse
|
1446 |
+
/* 24 *| * or promote products derived from this software without specific prior written permission.
|
1447 |
+
/* 25 *| *
|
1448 |
+
/* 26 *| * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
1449 |
+
/* 27 *| * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
1450 |
+
/* 28 *| * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
1451 |
+
/* 29 *| * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
1452 |
+
/* 30 *| * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
1453 |
+
/* 31 *| * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
1454 |
+
/* 32 *| * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
1455 |
+
/* 33 *| * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
1456 |
+
/* 34 *| * OF THE POSSIBILITY OF SUCH DAMAGE.
|
1457 |
+
/* 35 *| *
|
1458 |
+
/* 36 *| */
|
1459 |
+
/* 37 */
|
1460 |
+
/* 38 */ // t: current time, b: begInnIng value, c: change In value, d: duration
|
1461 |
+
/* 39 */ jQuery.easing['jswing'] = jQuery.easing['swing'];
|
1462 |
+
/* 40 */
|
1463 |
+
/* 41 */ jQuery.extend( jQuery.easing,
|
1464 |
+
/* 42 */ {
|
1465 |
+
/* 43 */ def: 'easeOutQuad',
|
1466 |
+
/* 44 */ swing: function (x, t, b, c, d) {
|
1467 |
+
/* 45 */ //alert(jQuery.easing.default);
|
1468 |
+
/* 46 */ return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
|
1469 |
+
/* 47 */ },
|
1470 |
+
/* 48 */ easeInQuad: function (x, t, b, c, d) {
|
1471 |
+
/* 49 */ return c*(t/=d)*t + b;
|
1472 |
+
/* 50 */ },
|
1473 |
+
|
1474 |
+
/* jquery.easing.1.3.js */
|
1475 |
+
|
1476 |
+
/* 51 */ easeOutQuad: function (x, t, b, c, d) {
|
1477 |
+
/* 52 */ return -c *(t/=d)*(t-2) + b;
|
1478 |
+
/* 53 */ },
|
1479 |
+
/* 54 */ easeInOutQuad: function (x, t, b, c, d) {
|
1480 |
+
/* 55 */ if ((t/=d/2) < 1) return c/2*t*t + b;
|
1481 |
+
/* 56 */ return -c/2 * ((--t)*(t-2) - 1) + b;
|
1482 |
+
/* 57 */ },
|
1483 |
+
/* 58 */ easeInCubic: function (x, t, b, c, d) {
|
1484 |
+
/* 59 */ return c*(t/=d)*t*t + b;
|
1485 |
+
/* 60 */ },
|
1486 |
+
/* 61 */ easeOutCubic: function (x, t, b, c, d) {
|
1487 |
+
/* 62 */ return c*((t=t/d-1)*t*t + 1) + b;
|
1488 |
+
/* 63 */ },
|
1489 |
+
/* 64 */ easeInOutCubic: function (x, t, b, c, d) {
|
1490 |
+
/* 65 */ if ((t/=d/2) < 1) return c/2*t*t*t + b;
|
1491 |
+
/* 66 */ return c/2*((t-=2)*t*t + 2) + b;
|
1492 |
+
/* 67 */ },
|
1493 |
+
/* 68 */ easeInQuart: function (x, t, b, c, d) {
|
1494 |
+
/* 69 */ return c*(t/=d)*t*t*t + b;
|
1495 |
+
/* 70 */ },
|
1496 |
+
/* 71 */ easeOutQuart: function (x, t, b, c, d) {
|
1497 |
+
/* 72 */ return -c * ((t=t/d-1)*t*t*t - 1) + b;
|
1498 |
+
/* 73 */ },
|
1499 |
+
/* 74 */ easeInOutQuart: function (x, t, b, c, d) {
|
1500 |
+
/* 75 */ if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
|
1501 |
+
/* 76 */ return -c/2 * ((t-=2)*t*t*t - 2) + b;
|
1502 |
+
/* 77 */ },
|
1503 |
+
/* 78 */ easeInQuint: function (x, t, b, c, d) {
|
1504 |
+
/* 79 */ return c*(t/=d)*t*t*t*t + b;
|
1505 |
+
/* 80 */ },
|
1506 |
+
/* 81 */ easeOutQuint: function (x, t, b, c, d) {
|
1507 |
+
/* 82 */ return c*((t=t/d-1)*t*t*t*t + 1) + b;
|
1508 |
+
/* 83 */ },
|
1509 |
+
/* 84 */ easeInOutQuint: function (x, t, b, c, d) {
|
1510 |
+
/* 85 */ if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
|
1511 |
+
/* 86 */ return c/2*((t-=2)*t*t*t*t + 2) + b;
|
1512 |
+
/* 87 */ },
|
1513 |
+
/* 88 */ easeInSine: function (x, t, b, c, d) {
|
1514 |
+
/* 89 */ return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
|
1515 |
+
/* 90 */ },
|
1516 |
+
/* 91 */ easeOutSine: function (x, t, b, c, d) {
|
1517 |
+
/* 92 */ return c * Math.sin(t/d * (Math.PI/2)) + b;
|
1518 |
+
/* 93 */ },
|
1519 |
+
/* 94 */ easeInOutSine: function (x, t, b, c, d) {
|
1520 |
+
/* 95 */ return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
|
1521 |
+
/* 96 */ },
|
1522 |
+
/* 97 */ easeInExpo: function (x, t, b, c, d) {
|
1523 |
+
/* 98 */ return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
|
1524 |
+
/* 99 */ },
|
1525 |
+
/* 100 */ easeOutExpo: function (x, t, b, c, d) {
|
1526 |
+
|
1527 |
+
/* jquery.easing.1.3.js */
|
1528 |
+
|
1529 |
+
/* 101 */ return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
|
1530 |
+
/* 102 */ },
|
1531 |
+
/* 103 */ easeInOutExpo: function (x, t, b, c, d) {
|
1532 |
+
/* 104 */ if (t==0) return b;
|
1533 |
+
/* 105 */ if (t==d) return b+c;
|
1534 |
+
/* 106 */ if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
|
1535 |
+
/* 107 */ return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
|
1536 |
+
/* 108 */ },
|
1537 |
+
/* 109 */ easeInCirc: function (x, t, b, c, d) {
|
1538 |
+
/* 110 */ return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
|
1539 |
+
/* 111 */ },
|
1540 |
+
/* 112 */ easeOutCirc: function (x, t, b, c, d) {
|
1541 |
+
/* 113 */ return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
|
1542 |
+
/* 114 */ },
|
1543 |
+
/* 115 */ easeInOutCirc: function (x, t, b, c, d) {
|
1544 |
+
/* 116 */ if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
|
1545 |
+
/* 117 */ return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
|
1546 |
+
/* 118 */ },
|
1547 |
+
/* 119 */ easeInElastic: function (x, t, b, c, d) {
|
1548 |
+
/* 120 */ var s=1.70158;var p=0;var a=c;
|
1549 |
+
/* 121 */ if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
1550 |
+
/* 122 */ if (a < Math.abs(c)) { a=c; var s=p/4; }
|
1551 |
+
/* 123 */ else var s = p/(2*Math.PI) * Math.asin (c/a);
|
1552 |
+
/* 124 */ return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
1553 |
+
/* 125 */ },
|
1554 |
+
/* 126 */ easeOutElastic: function (x, t, b, c, d) {
|
1555 |
+
/* 127 */ var s=1.70158;var p=0;var a=c;
|
1556 |
+
/* 128 */ if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
1557 |
+
/* 129 */ if (a < Math.abs(c)) { a=c; var s=p/4; }
|
1558 |
+
/* 130 */ else var s = p/(2*Math.PI) * Math.asin (c/a);
|
1559 |
+
/* 131 */ return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
|
1560 |
+
/* 132 */ },
|
1561 |
+
/* 133 */ easeInOutElastic: function (x, t, b, c, d) {
|
1562 |
+
/* 134 */ var s=1.70158;var p=0;var a=c;
|
1563 |
+
/* 135 */ if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
|
1564 |
+
/* 136 */ if (a < Math.abs(c)) { a=c; var s=p/4; }
|
1565 |
+
/* 137 */ else var s = p/(2*Math.PI) * Math.asin (c/a);
|
1566 |
+
/* 138 */ if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
1567 |
+
/* 139 */ return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
|
1568 |
+
/* 140 */ },
|
1569 |
+
/* 141 */ easeInBack: function (x, t, b, c, d, s) {
|
1570 |
+
/* 142 */ if (s == undefined) s = 1.70158;
|
1571 |
+
/* 143 */ return c*(t/=d)*t*((s+1)*t - s) + b;
|
1572 |
+
/* 144 */ },
|
1573 |
+
/* 145 */ easeOutBack: function (x, t, b, c, d, s) {
|
1574 |
+
/* 146 */ if (s == undefined) s = 1.70158;
|
1575 |
+
/* 147 */ return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
|
1576 |
+
/* 148 */ },
|
1577 |
+
/* 149 */ easeInOutBack: function (x, t, b, c, d, s) {
|
1578 |
+
/* 150 */ if (s == undefined) s = 1.70158;
|
1579 |
+
|
1580 |
+
/* jquery.easing.1.3.js */
|
1581 |
+
|
1582 |
+
/* 151 */ if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
|
1583 |
+
/* 152 */ return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
|
1584 |
+
/* 153 */ },
|
1585 |
+
/* 154 */ easeInBounce: function (x, t, b, c, d) {
|
1586 |
+
/* 155 */ return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
|
1587 |
+
/* 156 */ },
|
1588 |
+
/* 157 */ easeOutBounce: function (x, t, b, c, d) {
|
1589 |
+
/* 158 */ if ((t/=d) < (1/2.75)) {
|
1590 |
+
/* 159 */ return c*(7.5625*t*t) + b;
|
1591 |
+
/* 160 */ } else if (t < (2/2.75)) {
|
1592 |
+
/* 161 */ return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
|
1593 |
+
/* 162 */ } else if (t < (2.5/2.75)) {
|
1594 |
+
/* 163 */ return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
|
1595 |
+
/* 164 */ } else {
|
1596 |
+
/* 165 */ return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
|
1597 |
+
/* 166 */ }
|
1598 |
+
/* 167 */ },
|
1599 |
+
/* 168 */ easeInOutBounce: function (x, t, b, c, d) {
|
1600 |
+
/* 169 */ if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
|
1601 |
+
/* 170 */ return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
|
1602 |
+
/* 171 */ }
|
1603 |
+
/* 172 */ });
|
1604 |
+
/* 173 */
|
1605 |
+
/* 174 */ /*
|
1606 |
+
/* 175 *| *
|
1607 |
+
/* 176 *| * TERMS OF USE - EASING EQUATIONS
|
1608 |
+
/* 177 *| *
|
1609 |
+
/* 178 *| * Open source under the BSD License.
|
1610 |
+
/* 179 *| *
|
1611 |
+
/* 180 *| * Copyright © 2001 Robert Penner
|
1612 |
+
/* 181 *| * All rights reserved.
|
1613 |
+
/* 182 *| *
|
1614 |
+
/* 183 *| * Redistribution and use in source and binary forms, with or without modification,
|
1615 |
+
/* 184 *| * are permitted provided that the following conditions are met:
|
1616 |
+
/* 185 *| *
|
1617 |
+
/* 186 *| * Redistributions of source code must retain the above copyright notice, this list of
|
1618 |
+
/* 187 *| * conditions and the following disclaimer.
|
1619 |
+
/* 188 *| * Redistributions in binary form must reproduce the above copyright notice, this list
|
1620 |
+
/* 189 *| * of conditions and the following disclaimer in the documentation and/or other materials
|
1621 |
+
/* 190 *| * provided with the distribution.
|
1622 |
+
/* 191 *| *
|
1623 |
+
/* 192 *| * Neither the name of the author nor the names of contributors may be used to endorse
|
1624 |
+
/* 193 *| * or promote products derived from this software without specific prior written permission.
|
1625 |
+
/* 194 *| *
|
1626 |
+
/* 195 *| * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
1627 |
+
/* 196 *| * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
1628 |
+
/* 197 *| * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
1629 |
+
/* 198 *| * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
1630 |
+
/* 199 *| * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
1631 |
+
/* 200 *| * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
1632 |
+
|
1633 |
+
/* jquery.easing.1.3.js */
|
1634 |
+
|
1635 |
+
/* 201 *| * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
1636 |
+
/* 202 *| * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
1637 |
+
/* 203 *| * OF THE POSSIBILITY OF SUCH DAMAGE.
|
1638 |
+
/* 204 *| *
|
1639 |
+
/* 205 *| */
|
1640 |
+
|
1641 |
+
;
|
1642 |
+
/* jquery-timing.min.js */
|
1643 |
+
|
1644 |
+
/* 1 */ /**
|
1645 |
+
/* 2 *|
|
1646 |
+
/* 3 *| * timing.jquery.js
|
1647 |
+
/* 4 *| *
|
1648 |
+
/* 5 *| * JavaScript functions for waiting / repeating / stopping jQuery actions.
|
1649 |
+
/* 6 *| *
|
1650 |
+
/* 7 *| * This code is published under the MIT License (MIT).
|
1651 |
+
/* 8 *| * http://www.opensource.org/licenses/mit-license.php
|
1652 |
+
/* 9 *| *
|
1653 |
+
/* 10 *| * For examples, reference, and other information see
|
1654 |
+
/* 11 *| * http://creativecouple.github.com/jquery-timing/
|
1655 |
+
/* 12 *| *
|
1656 |
+
/* 13 *| * @author CreativeCouple
|
1657 |
+
/* 14 *| * @author Peter Liske
|
1658 |
+
/* 15 *| * @copyright (c) 2011 by CreativeCouple
|
1659 |
+
/* 16 *| * @see http://creativecouple.github.com/jquery-timing/
|
1660 |
+
/* 17 *| */
|
1661 |
+
/* 18 */
|
1662 |
+
/* 19 */ (function(jQuery, window){
|
1663 |
+
/* 20 */ /**
|
1664 |
+
/* 21 *| * object to store statically invoked threads
|
1665 |
+
/* 22 *| */
|
1666 |
+
/* 23 */ var THREAD_GROUPS = {},
|
1667 |
+
/* 24 */
|
1668 |
+
/* 25 */ /**
|
1669 |
+
/* 26 *| * unique timing identifier for different purposes
|
1670 |
+
/* 27 *| */
|
1671 |
+
/* 28 */ tuid = 1,
|
1672 |
+
/* 29 */
|
1673 |
+
/* 30 */ /**
|
1674 |
+
/* 31 *| * remember original core function $.each()
|
1675 |
+
/* 32 *| */
|
1676 |
+
/* 33 */ originalEach = jQuery.fn.each,
|
1677 |
+
/* 34 */
|
1678 |
+
/* 35 */ /**
|
1679 |
+
/* 36 *| * remember original core function $.on() (or $.bind())
|
1680 |
+
/* 37 *| */
|
1681 |
+
/* 38 */ originalOn = jQuery.fn.on || jQuery.fn.bind,
|
1682 |
+
/* 39 */
|
1683 |
+
/* 40 */ /**
|
1684 |
+
/* 41 *| * remember original core function $.off() (or $.unbind())
|
1685 |
+
/* 42 *| */
|
1686 |
+
/* 43 */ originalOff = jQuery.fn.off || jQuery.fn.unbind,
|
1687 |
+
/* 44 */
|
1688 |
+
/* 45 */ /**
|
1689 |
+
/* 46 *| * .until() and .all() have special meanings
|
1690 |
+
/* 47 *| */
|
1691 |
+
/* 48 */ loopEndMethods = {};
|
1692 |
+
/* 49 */
|
1693 |
+
/* 50 */ function sameOrNextJQuery(before, after) {
|
1694 |
+
|
1695 |
+
/* jquery-timing.min.js */
|
1696 |
+
|
1697 |
+
/* 51 */ after = jQuery(after);
|
1698 |
+
/* 52 */ after.prevObject = before;
|
1699 |
+
/* 53 */ var i = before.length;
|
1700 |
+
/* 54 */ if (i !== after.length) {
|
1701 |
+
/* 55 */ return after;
|
1702 |
+
/* 56 */ }
|
1703 |
+
/* 57 */ while (i--) {
|
1704 |
+
/* 58 */ if (before[i] !== after[i]) {
|
1705 |
+
/* 59 */ return after;
|
1706 |
+
/* 60 */ }
|
1707 |
+
/* 61 */ }
|
1708 |
+
/* 62 */ return before;
|
1709 |
+
/* 63 */ }
|
1710 |
+
/* 64 */
|
1711 |
+
/* 65 */ function loopCounts(loops) {
|
1712 |
+
/* 66 */ var ret = [], i = loops.length;
|
1713 |
+
/* 67 */ while (i--) {
|
1714 |
+
/* 68 */ ret[i] = loops[i]._count;
|
1715 |
+
/* 69 */ }
|
1716 |
+
/* 70 */ return ret;
|
1717 |
+
/* 71 */ }
|
1718 |
+
/* 72 */
|
1719 |
+
/* 73 */ /**
|
1720 |
+
/* 74 *| * Initialize a new timed invocation chain.
|
1721 |
+
/* 75 *| *
|
1722 |
+
/* 76 *| * @author CreativeCouple
|
1723 |
+
/* 77 *| * @author Peter Liske
|
1724 |
+
/* 78 *| *
|
1725 |
+
/* 79 *| * @param context initial context
|
1726 |
+
/* 80 *| * @param methodStack linked list of methods that has been or will be filled by someone else
|
1727 |
+
/* 81 *| * @param ongoingLoops optional arguments for callback parameters
|
1728 |
+
/* 82 *| * @param onStepCallback function to call on each step
|
1729 |
+
/* 83 *| * @returns the timed invocation chain method
|
1730 |
+
/* 84 *| */
|
1731 |
+
/* 85 */ function createTimedInvocationChain(context, methodStack, ongoingLoops, onStepCallback) {
|
1732 |
+
/* 86 */ ongoingLoops = ongoingLoops || [];
|
1733 |
+
/* 87 */ var executionState = {
|
1734 |
+
/* 88 */ _context: context,
|
1735 |
+
/* 89 */ _method: methodStack
|
1736 |
+
/* 90 */ },
|
1737 |
+
/* 91 */ preventRecursion = false,
|
1738 |
+
/* 92 */ method, otherExecutionState, deferred;
|
1739 |
+
/* 93 */
|
1740 |
+
/* 94 */ function hookupToProxy(state, mockup){
|
1741 |
+
/* 95 */ state._canContinue = false;
|
1742 |
+
/* 96 */ function fire(){
|
1743 |
+
/* 97 */ state._next = sameOrNextJQuery(state._context, state._next);
|
1744 |
+
/* 98 */ state._canContinue = true;
|
1745 |
+
/* 99 */ timedInvocationChain();
|
1746 |
+
/* 100 */ }
|
1747 |
+
|
1748 |
+
/* jquery-timing.min.js */
|
1749 |
+
|
1750 |
+
/* 101 */ return typeof mockup.promise == "function" ? mockup.promise().then(fire) : mockup.then(fire, true);
|
1751 |
+
/* 102 */ }
|
1752 |
+
/* 103 */
|
1753 |
+
/* 104 */ /**
|
1754 |
+
/* 105 *| * Invoke all the methods currently in the timed invocation chain.
|
1755 |
+
/* 106 *| *
|
1756 |
+
/* 107 *| * @author CreativeCouple
|
1757 |
+
/* 108 *| * @author Peter Liske
|
1758 |
+
/* 109 *| */
|
1759 |
+
/* 110 */ function timedInvocationChain(deferredReturnValue) {
|
1760 |
+
/* 111 */ while (!preventRecursion) try {
|
1761 |
+
/* 112 */ // keep recursive calls away
|
1762 |
+
/* 113 */ preventRecursion = !preventRecursion;
|
1763 |
+
/* 114 */ // save current context state
|
1764 |
+
/* 115 */ if (typeof onStepCallback == "function") {
|
1765 |
+
/* 116 */ onStepCallback(jQuery.makeArray(executionState._next || executionState._context));
|
1766 |
+
/* 117 */ }
|
1767 |
+
/* 118 */ // leave the chain when waiting for a trigger
|
1768 |
+
/* 119 */ if (executionState._canContinue == false) {
|
1769 |
+
/* 120 */ break;
|
1770 |
+
/* 121 */ }
|
1771 |
+
/* 122 */ // check end of chain
|
1772 |
+
/* 123 */ if (!executionState._method._name) {
|
1773 |
+
/* 124 */ if (deferred && (!ongoingLoops.length || ongoingLoops[0]._allowPromise)) {
|
1774 |
+
/* 125 */ // resolve any waiting promise
|
1775 |
+
/* 126 */ if (executionState._context && typeof executionState._context.promise == "function") {
|
1776 |
+
/* 127 */ executionState._context.promise().then(deferred.resolve);
|
1777 |
+
/* 128 */ } else {
|
1778 |
+
/* 129 */ deferred.resolveWith(executionState._context);
|
1779 |
+
/* 130 */ }
|
1780 |
+
/* 131 */ deferred = null;
|
1781 |
+
/* 132 */ }
|
1782 |
+
/* 133 */ if (!ongoingLoops.length) {
|
1783 |
+
/* 134 */ /*
|
1784 |
+
/* 135 *| * We've reached the end of our TIC
|
1785 |
+
/* 136 *| * and there is nothing left to wait for.
|
1786 |
+
/* 137 *| * So we can safely return the original jQuery object
|
1787 |
+
/* 138 *| * hence enabling instant invocation.
|
1788 |
+
/* 139 *| */
|
1789 |
+
/* 140 */ return executionState._context;
|
1790 |
+
/* 141 */ }
|
1791 |
+
/* 142 */ /*
|
1792 |
+
/* 143 *| * Now we have ongoing loops but reached the chain's end.
|
1793 |
+
/* 144 *| */
|
1794 |
+
/* 145 */ otherExecutionState = ongoingLoops[0]._openEndAction && ongoingLoops[0]._openEndAction(timedInvocationChain, executionState, ongoingLoops);
|
1795 |
+
/* 146 */ if (!otherExecutionState) {
|
1796 |
+
/* 147 */ // if innermost loop can't help us, just leave the chain
|
1797 |
+
/* 148 */ break;
|
1798 |
+
/* 149 */ }
|
1799 |
+
/* 150 */ executionState = otherExecutionState;
|
1800 |
+
|
1801 |
+
/* jquery-timing.min.js */
|
1802 |
+
|
1803 |
+
/* 151 */ continue;
|
1804 |
+
/* 152 */ }
|
1805 |
+
/* 153 */ // check if user tries to use a non-existing function call
|
1806 |
+
/* 154 */ method = executionState._context && executionState._context[executionState._method._name] || loopEndMethods[executionState._method._name];
|
1807 |
+
/* 155 */ if (!method) {
|
1808 |
+
/* 156 */ throw 'no such method "'+executionState._method._name+'" on object ('+executionState._context+')';
|
1809 |
+
/* 157 */ }
|
1810 |
+
/* 158 */ // check whether we came here triggered or not
|
1811 |
+
/* 159 */ if (method.timing && !executionState._canContinue) {
|
1812 |
+
/* 160 */ // prevent automatic re-trigger in case of loops
|
1813 |
+
/* 161 */ executionState._canContinue = false;
|
1814 |
+
/* 162 */ // handle timing method
|
1815 |
+
/* 163 */ executionState = method.timing(timedInvocationChain, executionState, ongoingLoops, onStepCallback) || executionState;
|
1816 |
+
/* 164 */ } else {
|
1817 |
+
/* 165 */ if (!method.timing && !executionState._canContinue) {
|
1818 |
+
/* 166 */ // prevent automatic re-trigger in case of loops
|
1819 |
+
/* 167 */ executionState._next = executionState._context[executionState._method._name].apply(executionState._context, executionState._method._arguments);
|
1820 |
+
/* 168 */ if (ongoingLoops.length && executionState._next && executionState._next instanceof PredictingProxy) {
|
1821 |
+
/* 169 */ hookupToProxy(executionState, executionState._next);
|
1822 |
+
/* 170 */ continue;
|
1823 |
+
/* 171 */ }
|
1824 |
+
/* 172 */ }
|
1825 |
+
/* 173 */ // go to next step
|
1826 |
+
/* 174 */ otherExecutionState = {
|
1827 |
+
/* 175 */ _context: executionState._next,
|
1828 |
+
/* 176 */ _method: executionState._method._next
|
1829 |
+
/* 177 */ };
|
1830 |
+
/* 178 */ // prevent automatic re-trigger in case of loops
|
1831 |
+
/* 179 */ executionState._canContinue = false;
|
1832 |
+
/* 180 */ // invoke callback method with given arguments
|
1833 |
+
/* 181 */ if (typeof executionState._callback == "function") {
|
1834 |
+
/* 182 */ executionState._callback.apply(executionState._context, loopCounts(ongoingLoops));
|
1835 |
+
/* 183 */ }
|
1836 |
+
/* 184 */ executionState = otherExecutionState;
|
1837 |
+
/* 185 */ }
|
1838 |
+
/* 186 */ } catch(e) {
|
1839 |
+
/* 187 */ /*
|
1840 |
+
/* 188 *| * We had a runtime exception.
|
1841 |
+
/* 189 *| * In plain JavaScript live the chain would break now.
|
1842 |
+
/* 190 *| * So we do, too.
|
1843 |
+
/* 191 *| */
|
1844 |
+
/* 192 */ preventRecursion = !preventRecursion;
|
1845 |
+
/* 193 */ throw e;
|
1846 |
+
/* 194 */ } finally {
|
1847 |
+
/* 195 */ preventRecursion = !preventRecursion;
|
1848 |
+
/* 196 */ }
|
1849 |
+
/* 197 */ return deferredReturnValue;
|
1850 |
+
/* 198 */ };
|
1851 |
+
/* 199 */ if (jQuery.Deferred) {
|
1852 |
+
/* 200 */ // add .promise() method to tic
|
1853 |
+
|
1854 |
+
/* jquery-timing.min.js */
|
1855 |
+
|
1856 |
+
/* 201 */ timedInvocationChain.promise = function(type, target){
|
1857 |
+
/* 202 */ var ret = (deferred = deferred || jQuery.Deferred()).promise(target);
|
1858 |
+
/* 203 */ timedInvocationChain();
|
1859 |
+
/* 204 */ return ret;
|
1860 |
+
/* 205 */ };
|
1861 |
+
/* 206 */ }
|
1862 |
+
/* 207 */ return timedInvocationChain;
|
1863 |
+
/* 208 */ }
|
1864 |
+
/* 209 */
|
1865 |
+
/* 210 */ /**
|
1866 |
+
/* 211 *| * Create a placeholder object to collect chained method calls.
|
1867 |
+
/* 212 *| *
|
1868 |
+
/* 213 *| * @author CreativeCouple
|
1869 |
+
/* 214 *| * @author Peter Liske
|
1870 |
+
/* 215 *| *
|
1871 |
+
/* 216 *| * @param context initial context
|
1872 |
+
/* 217 *| * @param methodStack a linked list that this placeholder will fill with call parameters
|
1873 |
+
/* 218 *| * @return the placeholder object
|
1874 |
+
/* 219 *| */
|
1875 |
+
/* 220 */ function PredictingProxy(context, methodStack, onStepCallback) {
|
1876 |
+
/* 221 */ this['.methods'] = methodStack;
|
1877 |
+
/* 222 */ this['.callback'] = onStepCallback;
|
1878 |
+
/* 223 */ this.length = 0;
|
1879 |
+
/* 224 */ Array.prototype.push.apply(this, jQuery.makeArray(this._ = context._ = context));
|
1880 |
+
/* 225 */
|
1881 |
+
/* 226 */ for (var key in context) {
|
1882 |
+
/* 227 */ if (!(key in PredictingProxy.prototype) && typeof context[key] == "function") {
|
1883 |
+
/* 228 */ this[key] = extendMockupPrototype(key);
|
1884 |
+
/* 229 */ }
|
1885 |
+
/* 230 */ }
|
1886 |
+
/* 231 */ }
|
1887 |
+
/* 232 */
|
1888 |
+
/* 233 */ // enabling jQuery.when(tic);
|
1889 |
+
/* 234 */ if (jQuery.Deferred) {
|
1890 |
+
/* 235 */ PredictingProxy.prototype.promise = function(type, target) {
|
1891 |
+
/* 236 */ if (typeof type == "object") {
|
1892 |
+
/* 237 */ target = type;
|
1893 |
+
/* 238 */ type = null;
|
1894 |
+
/* 239 */ }
|
1895 |
+
/* 240 */ return (this['.callback'] && typeof this['.callback'].promise == "function") ? this['.callback'].promise(type, target) : jQuery.Deferred().resolveWith(this).promise(target);
|
1896 |
+
/* 241 */ };
|
1897 |
+
/* 242 */ }
|
1898 |
+
/* 243 */
|
1899 |
+
/* 244 */ /**
|
1900 |
+
/* 245 *| * Create and return a new placeholder function on the prototype of PredictingProxy.
|
1901 |
+
/* 246 *| */
|
1902 |
+
/* 247 */ function extendMockupPrototype(name){
|
1903 |
+
/* 248 */ return PredictingProxy.prototype[name] = function(){
|
1904 |
+
/* 249 */ this['.methods']._name = name;
|
1905 |
+
/* 250 */ this['.methods']._arguments = arguments;
|
1906 |
+
|
1907 |
+
/* jquery-timing.min.js */
|
1908 |
+
|
1909 |
+
/* 251 */ this['.methods'] = this['.methods']._next = {};
|
1910 |
+
/* 252 */ return this['.callback'] ? this['.callback'](this, name, arguments) : this;
|
1911 |
+
/* 253 */ };
|
1912 |
+
/* 254 */ }
|
1913 |
+
/* 255 */
|
1914 |
+
/* 256 */
|
1915 |
+
/* 257 */ /**
|
1916 |
+
/* 258 *| * Create replacement methods for .bind(), .on(), .one(), .live(), and .delegate()
|
1917 |
+
/* 259 *| * that support chaining instead of giving a callback function.
|
1918 |
+
/* 260 *| */
|
1919 |
+
/* 261 */ jQuery.each(['bind','on','one','live','delegate'], function(index, name){
|
1920 |
+
/* 262 */ if (jQuery.fn[name]) {
|
1921 |
+
/* 263 */ var original = jQuery.fn[name];
|
1922 |
+
/* 264 */ jQuery.fn[name] = function(){
|
1923 |
+
/* 265 */ var i, methodStack, placeholder, timedInvocationChain, deferred, context = this;
|
1924 |
+
/* 266 */ for(i=0; i<arguments.length; i++) {
|
1925 |
+
/* 267 */ if (typeof arguments[i] == "function" || (arguments[i] && typeof arguments[i] == "object") || arguments[i] === false) {
|
1926 |
+
/* 268 */ if (arguments[i] !== jQuery) {
|
1927 |
+
/* 269 */ // fix for jQuery 1.6 .one() + .unbind()
|
1928 |
+
/* 270 */ if (typeof arguments[i] == "function" && jQuery.guid) {
|
1929 |
+
/* 271 */ arguments[i].guid = arguments[i].guid || jQuery.guid++;
|
1930 |
+
/* 272 */ }
|
1931 |
+
/* 273 */ return original.apply(context, arguments);
|
1932 |
+
/* 274 */ }
|
1933 |
+
/* 275 */ break;
|
1934 |
+
/* 276 */ }
|
1935 |
+
/* 277 */ }
|
1936 |
+
/* 278 */ Array.prototype.splice.call(arguments, i, 1, function(){
|
1937 |
+
/* 279 */ timedInvocationChain = createTimedInvocationChain(context.$(this), methodStack, [{
|
1938 |
+
/* 280 */ _count: jQuery.extend(Array.prototype.shift.apply(arguments), arguments),
|
1939 |
+
/* 281 */ _allowPromise: true
|
1940 |
+
/* 282 */ }], function(elements){
|
1941 |
+
/* 283 */ placeholder.length = 0;
|
1942 |
+
/* 284 */ Array.prototype.push.apply(placeholder, elements);
|
1943 |
+
/* 285 */ });
|
1944 |
+
/* 286 */ if (deferred) {
|
1945 |
+
/* 287 */ timedInvocationChain.promise().then(deferred.resolve);
|
1946 |
+
/* 288 */ deferred = null;
|
1947 |
+
/* 289 */ }
|
1948 |
+
/* 290 */ return timedInvocationChain();
|
1949 |
+
/* 291 */ });
|
1950 |
+
/* 292 */ function fire(){
|
1951 |
+
/* 293 */ return timedInvocationChain ? timedInvocationChain(placeholder) : placeholder;
|
1952 |
+
/* 294 */ }
|
1953 |
+
/* 295 */ if (jQuery.Deferred) {
|
1954 |
+
/* 296 */ fire.promise = function(type, target){
|
1955 |
+
/* 297 */ if (typeof type == "object") {
|
1956 |
+
/* 298 */ target = type;
|
1957 |
+
/* 299 */ type = null;
|
1958 |
+
/* 300 */ }
|
1959 |
+
|
1960 |
+
/* jquery-timing.min.js */
|
1961 |
+
|
1962 |
+
/* 301 */ return (timedInvocationChain && !type) ? timedInvocationChain.promise(type, target) : (deferred = deferred || jQuery.Deferred()).promise(target);
|
1963 |
+
/* 302 */ };
|
1964 |
+
/* 303 */ }
|
1965 |
+
/* 304 */ return placeholder = new PredictingProxy(original.apply(context, arguments), methodStack = {}, fire);
|
1966 |
+
/* 305 */ };
|
1967 |
+
/* 306 */ }
|
1968 |
+
/* 307 */ });
|
1969 |
+
/* 308 */
|
1970 |
+
/* 309 */ /**
|
1971 |
+
/* 310 *| * Create replacement method for .animate() and .load()
|
1972 |
+
/* 311 *| * that support chaining if $ is given as callback function.
|
1973 |
+
/* 312 *| */
|
1974 |
+
/* 313 */ jQuery.each(['animate','load'], function(index, name){
|
1975 |
+
/* 314 */ if (jQuery.fn[name]) {
|
1976 |
+
/* 315 */ var original = jQuery.fn[name];
|
1977 |
+
/* 316 */ jQuery.fn[name] = function(){
|
1978 |
+
/* 317 */ while (arguments.length && arguments[arguments.length-1] == null) {
|
1979 |
+
/* 318 */ Array.prototype.pop.apply(arguments);
|
1980 |
+
/* 319 */ }
|
1981 |
+
/* 320 */ if (this.length && arguments.length > 1 && arguments[arguments.length-1] === jQuery) {
|
1982 |
+
/* 321 */ var event = '_timing'+tuid++;
|
1983 |
+
/* 322 */ arguments[arguments.length-1] = function(){
|
1984 |
+
/* 323 */ jQuery(this).trigger(event);
|
1985 |
+
/* 324 */ };
|
1986 |
+
/* 325 */ return this.each().one(event).all(original.apply(this, arguments));
|
1987 |
+
/* 326 */ }
|
1988 |
+
/* 327 */ return original.apply(this, arguments);
|
1989 |
+
/* 328 */ };
|
1990 |
+
/* 329 */ }
|
1991 |
+
/* 330 */ });
|
1992 |
+
/* 331 */
|
1993 |
+
/* 332 */ /**
|
1994 |
+
/* 333 *| * Define new methods .wait(), .repeat(), .join(), .then()
|
1995 |
+
/* 334 *| * which will always start a new TIC if invoked outside of a TIC.
|
1996 |
+
/* 335 *| */
|
1997 |
+
/* 336 */ jQuery.each(['wait','repeat','join','then'], function(index, name){
|
1998 |
+
/* 337 */ jQuery.fn[name] = function(){
|
1999 |
+
/* 338 */ var methodStack = {},
|
2000 |
+
/* 339 */ placeholder = new PredictingProxy(this, methodStack, createTimedInvocationChain(this, methodStack, [], function(elements){
|
2001 |
+
/* 340 */ placeholder.length = 0;
|
2002 |
+
/* 341 */ Array.prototype.push.apply(placeholder, elements);
|
2003 |
+
/* 342 */ }));
|
2004 |
+
/* 343 */ return placeholder[name].apply(placeholder, arguments);
|
2005 |
+
/* 344 */ };
|
2006 |
+
/* 345 */ });
|
2007 |
+
/* 346 */
|
2008 |
+
/* 347 */ /**
|
2009 |
+
/* 348 *| * Define to wait for joining all animation queues.
|
2010 |
+
/* 349 *| *
|
2011 |
+
/* 350 *| * @param timedInvocationChain
|
2012 |
+
|
2013 |
+
/* jquery-timing.min.js */
|
2014 |
+
|
2015 |
+
/* 351 *| * @param executionState
|
2016 |
+
/* 352 *| */
|
2017 |
+
/* 353 */ jQuery.fn.join.timing = function(timedInvocationChain, executionState) {
|
2018 |
+
/* 354 */ var queueName,
|
2019 |
+
/* 355 */ promising,
|
2020 |
+
/* 356 */ waitingElements = executionState._context.length;
|
2021 |
+
/* 357 */
|
2022 |
+
/* 358 */ if (typeof executionState._method._arguments[0] == "string") {
|
2023 |
+
/* 359 */ queueName = executionState._method._arguments[0];
|
2024 |
+
/* 360 */ if (typeof executionState._method._arguments[1] == "function") {
|
2025 |
+
/* 361 */ executionState._callback = executionState._method._arguments[1];
|
2026 |
+
/* 362 */ } else {
|
2027 |
+
/* 363 */ promising = executionState._method._arguments[1];
|
2028 |
+
/* 364 */ executionState._callback = executionState._method._arguments[2];
|
2029 |
+
/* 365 */ }
|
2030 |
+
/* 366 */ } else {
|
2031 |
+
/* 367 */ if (typeof executionState._method._arguments[0] == "function") {
|
2032 |
+
/* 368 */ executionState._callback = executionState._method._arguments[0];
|
2033 |
+
/* 369 */ } else {
|
2034 |
+
/* 370 */ promising = executionState._method._arguments[0];
|
2035 |
+
/* 371 */ executionState._callback = executionState._method._arguments[1];
|
2036 |
+
/* 372 */ }
|
2037 |
+
/* 373 */ }
|
2038 |
+
/* 374 */
|
2039 |
+
/* 375 */ executionState._next = executionState._context;
|
2040 |
+
/* 376 */ executionState._canContinue = !waitingElements;
|
2041 |
+
/* 377 */
|
2042 |
+
/* 378 */ // wait for each element to reach the current end of its queue
|
2043 |
+
/* 379 */ if (promising) {
|
2044 |
+
/* 380 */ executionState._context.promise(queueName == null ? 'fx' : queueName).then(function(){
|
2045 |
+
/* 381 */ executionState._canContinue = true;
|
2046 |
+
/* 382 */ timedInvocationChain();
|
2047 |
+
/* 383 */ });
|
2048 |
+
/* 384 */ } else {
|
2049 |
+
/* 385 */ executionState._context.queue(queueName == null ? 'fx' : queueName, function(next){
|
2050 |
+
/* 386 */ executionState._canContinue = !--waitingElements;
|
2051 |
+
/* 387 */ timedInvocationChain();
|
2052 |
+
/* 388 */ next();
|
2053 |
+
/* 389 */ });
|
2054 |
+
/* 390 */ }
|
2055 |
+
/* 391 */ };
|
2056 |
+
/* 392 */
|
2057 |
+
/* 393 */ /**
|
2058 |
+
/* 394 *| * Define to simply run callback method for .then()
|
2059 |
+
/* 395 *| *
|
2060 |
+
/* 396 *| * @param timedInvocationChain
|
2061 |
+
/* 397 *| * @param executionState
|
2062 |
+
/* 398 *| */
|
2063 |
+
/* 399 */ jQuery.fn.then.timing = function(timedInvocationChain, executionState){
|
2064 |
+
/* 400 */ executionState._callback = executionState._method._arguments[0];
|
2065 |
+
|
2066 |
+
/* jquery-timing.min.js */
|
2067 |
+
|
2068 |
+
/* 401 */ executionState._next = executionState._context;
|
2069 |
+
/* 402 */ executionState._canContinue = true;
|
2070 |
+
/* 403 */ if (executionState._method._arguments[1]) {
|
2071 |
+
/* 404 */ Array.prototype.shift.apply(executionState._method._arguments);
|
2072 |
+
/* 405 */ }
|
2073 |
+
/* 406 */ };
|
2074 |
+
/* 407 */
|
2075 |
+
/* 408 */ /**
|
2076 |
+
/* 409 *| * Define timeout or binding to wait for.
|
2077 |
+
/* 410 *| *
|
2078 |
+
/* 411 *| * @param timedInvocationChain
|
2079 |
+
/* 412 *| * @param executionState
|
2080 |
+
/* 413 *| */
|
2081 |
+
/* 414 */ jQuery.fn.wait.timing = function(timedInvocationChain, executionState, ongoingLoops) {
|
2082 |
+
/* 415 */ var trigger, event, timeout, context = executionState._context;
|
2083 |
+
/* 416 */
|
2084 |
+
/* 417 */ trigger = executionState._method._arguments[0];
|
2085 |
+
/* 418 */ executionState._callback = executionState._method._arguments[1];
|
2086 |
+
/* 419 */
|
2087 |
+
/* 420 */ function triggerAction() {
|
2088 |
+
/* 421 */ originalOff.call(event ? originalOff.call(context, event, triggerAction) : context, 'unwait', unwaitAction);
|
2089 |
+
/* 422 */ executionState._canContinue = true;
|
2090 |
+
/* 423 */ executionState._next = sameOrNextJQuery(executionState._context, executionState._next);
|
2091 |
+
/* 424 */ timedInvocationChain();
|
2092 |
+
/* 425 */ }
|
2093 |
+
/* 426 */
|
2094 |
+
/* 427 */ function unwaitAction(evt, skipWait){
|
2095 |
+
/* 428 */ originalOff.call(event ? originalOff.call(jQuery(this), event, triggerAction) : jQuery(this), 'unwait', unwaitAction);
|
2096 |
+
/* 429 */ context = context.not(this);
|
2097 |
+
/* 430 */ if (!skipWait) {
|
2098 |
+
/* 431 */ executionState._next = executionState._next.not(this);
|
2099 |
+
/* 432 */ }
|
2100 |
+
/* 433 */ if (!context.length) {
|
2101 |
+
/* 434 */ executionState._canContinue = executionState._next.length;
|
2102 |
+
/* 435 */ executionState._next = sameOrNextJQuery(executionState._context, executionState._next);
|
2103 |
+
/* 436 */ window.clearTimeout(timeout);
|
2104 |
+
/* 437 */ executionState = { _context: context };
|
2105 |
+
/* 438 */ }
|
2106 |
+
/* 439 */ // just update the snapshot info
|
2107 |
+
/* 440 */ timedInvocationChain();
|
2108 |
+
/* 441 */ }
|
2109 |
+
/* 442 */
|
2110 |
+
/* 443 */ originalOn.call(context, 'unwait', unwaitAction);
|
2111 |
+
/* 444 */ executionState._next = context;
|
2112 |
+
/* 445 */
|
2113 |
+
/* 446 */ if (trigger == null || trigger == jQuery) {
|
2114 |
+
/* 447 */ trigger = context;
|
2115 |
+
/* 448 */ }
|
2116 |
+
/* 449 */ if (typeof trigger == "function") {
|
2117 |
+
/* 450 */ trigger = trigger.apply(context, loopCounts(ongoingLoops));
|
2118 |
+
|
2119 |
+
/* jquery-timing.min.js */
|
2120 |
+
|
2121 |
+
/* 451 */ }
|
2122 |
+
/* 452 */ if (typeof trigger == "string") {
|
2123 |
+
/* 453 */
|
2124 |
+
/* 454 */ originalOn.call(context, event = trigger, triggerAction);
|
2125 |
+
/* 455 */
|
2126 |
+
/* 456 */ } else if (trigger && typeof trigger.promise == "function") {
|
2127 |
+
/* 457 */
|
2128 |
+
/* 458 */ trigger.promise().then(triggerAction);
|
2129 |
+
/* 459 */
|
2130 |
+
/* 460 */ } else if (trigger && typeof trigger.then == "function") {
|
2131 |
+
/* 461 */
|
2132 |
+
/* 462 */ trigger.then(triggerAction, true);
|
2133 |
+
/* 463 */
|
2134 |
+
/* 464 */ } else {
|
2135 |
+
/* 465 */
|
2136 |
+
/* 466 */ timeout = window.setTimeout(triggerAction, Math.max(0,trigger));
|
2137 |
+
/* 467 */
|
2138 |
+
/* 468 */ }
|
2139 |
+
/* 469 */ };
|
2140 |
+
/* 470 */
|
2141 |
+
/* 471 */ /**
|
2142 |
+
/* 472 *| * Define to simply run callback method for .then()
|
2143 |
+
/* 473 *| *
|
2144 |
+
/* 474 *| * @param timedInvocationChain
|
2145 |
+
/* 475 *| * @param executionState
|
2146 |
+
/* 476 *| */
|
2147 |
+
/* 477 */ jQuery.fn.each = function(callback){
|
2148 |
+
/* 478 */ if (!callback || callback === jQuery) {
|
2149 |
+
/* 479 */ var methodStack = {},
|
2150 |
+
/* 480 */ placeholder = new PredictingProxy(this, methodStack, createTimedInvocationChain(this, methodStack, [], function(elements){
|
2151 |
+
/* 481 */ placeholder.length = 0;
|
2152 |
+
/* 482 */ Array.prototype.push.apply(placeholder, elements);
|
2153 |
+
/* 483 */ }));
|
2154 |
+
/* 484 */ return placeholder.each(callback);
|
2155 |
+
/* 485 */ }
|
2156 |
+
/* 486 */ return originalEach.apply(this, arguments);
|
2157 |
+
/* 487 */ };
|
2158 |
+
/* 488 */
|
2159 |
+
/* 489 */ /**
|
2160 |
+
/* 490 *| * Define interval or binding to repeat.
|
2161 |
+
/* 491 *| *
|
2162 |
+
/* 492 *| * @param timedInvocationChain
|
2163 |
+
/* 493 *| * @param executionState
|
2164 |
+
/* 494 *| */
|
2165 |
+
/* 495 */ jQuery.fn.each.timing = function(timedInvocationChain, executionState, ongoingLoops, onStepCallback) {
|
2166 |
+
/* 496 */ if (executionState._method._arguments[0] && executionState._method._arguments[0] !== jQuery) {
|
2167 |
+
/* 497 */ executionState._canContinue = true;
|
2168 |
+
/* 498 */ executionState._next = originalEach.apply(executionState._context, executionState._method._arguments);
|
2169 |
+
/* 499 */ return;
|
2170 |
+
/* 500 */ }
|
2171 |
+
|
2172 |
+
/* jquery-timing.min.js */
|
2173 |
+
|
2174 |
+
/* 501 */
|
2175 |
+
/* 502 */ var size = Math.max(executionState._context.length, 1),
|
2176 |
+
/* 503 */ finished = 0,
|
2177 |
+
/* 504 */ key, methodToGoOn, openLoopTimeout,
|
2178 |
+
/* 505 */ innerTICs = [],
|
2179 |
+
/* 506 */ innerElements = [],
|
2180 |
+
/* 507 */ proxyPlaceholder = jQuery.extend({}, executionState._context),
|
2181 |
+
/* 508 */ stepByStep = executionState._method._arguments[0] === jQuery;
|
2182 |
+
/* 509 */
|
2183 |
+
/* 510 */ if (stepByStep) {
|
2184 |
+
/* 511 */ window.setTimeout(function(){
|
2185 |
+
/* 512 */ openLoopTimeout = true;
|
2186 |
+
/* 513 */ timedInvocationChain();
|
2187 |
+
/* 514 */ },0);
|
2188 |
+
/* 515 */ }
|
2189 |
+
/* 516 */
|
2190 |
+
/* 517 */ function spreadAction(){
|
2191 |
+
/* 518 */ if (stepByStep) {
|
2192 |
+
/* 519 */ if (finished < size) {
|
2193 |
+
/* 520 */ (innerTICs[finished])();
|
2194 |
+
/* 521 */ }
|
2195 |
+
/* 522 */ } else {
|
2196 |
+
/* 523 */ for (var i=0; i<size; i++) {
|
2197 |
+
/* 524 */ (innerTICs[i])();
|
2198 |
+
/* 525 */ }
|
2199 |
+
/* 526 */ }
|
2200 |
+
/* 527 */ return proxyPlaceholder;
|
2201 |
+
/* 528 */ }
|
2202 |
+
/* 529 */
|
2203 |
+
/* 530 */ for (key in PredictingProxy.prototype) {
|
2204 |
+
/* 531 */ proxyPlaceholder[key] = spreadAction;
|
2205 |
+
/* 532 */ }
|
2206 |
+
/* 533 */ proxyPlaceholder.length = size;
|
2207 |
+
/* 534 */ for(key=0; key<size; key++) (function(index){
|
2208 |
+
/* 535 */ var innerLoops = ongoingLoops.slice(),
|
2209 |
+
/* 536 */ context = executionState._context.eq(index);
|
2210 |
+
/* 537 */ innerElements[index] = context.get();
|
2211 |
+
/* 538 */ innerLoops.unshift({
|
2212 |
+
/* 539 */ _count: index,
|
2213 |
+
/* 540 */ _allAction: function(state){
|
2214 |
+
/* 541 */ finished++;
|
2215 |
+
/* 542 */ if (finished == size) {
|
2216 |
+
/* 543 */ methodToGoOn = state._method._next;
|
2217 |
+
/* 544 */ }
|
2218 |
+
/* 545 */ timedInvocationChain();
|
2219 |
+
/* 546 */ },
|
2220 |
+
/* 547 */ _fixOpenLoop: loopEndMethods.all,
|
2221 |
+
/* 548 */ _openEndAction: function(tic, state){
|
2222 |
+
/* 549 */ if (openLoopTimeout) {
|
2223 |
+
/* 550 */ finished++;
|
2224 |
+
|
2225 |
+
/* jquery-timing.min.js */
|
2226 |
+
|
2227 |
+
/* 551 */ if (finished == size) {
|
2228 |
+
/* 552 */ methodToGoOn = state._method;
|
2229 |
+
/* 553 */ }
|
2230 |
+
/* 554 */ timedInvocationChain();
|
2231 |
+
/* 555 */ }
|
2232 |
+
/* 556 */ }
|
2233 |
+
/* 557 */ });
|
2234 |
+
/* 558 */ innerTICs[index] = createTimedInvocationChain(context, executionState._method._next, innerLoops, function(elements){
|
2235 |
+
/* 559 */ innerElements[index] = elements;
|
2236 |
+
/* 560 */ proxyPlaceholder.length = 0;
|
2237 |
+
/* 561 */ for (var i=0; i<size; i++) {
|
2238 |
+
/* 562 */ Array.prototype.push.apply(proxyPlaceholder, innerElements[i]);
|
2239 |
+
/* 563 */ }
|
2240 |
+
/* 564 */ if (onStepCallback)
|
2241 |
+
/* 565 */ onStepCallback(jQuery.makeArray(proxyPlaceholder));
|
2242 |
+
/* 566 */ });
|
2243 |
+
/* 567 */ })(key);
|
2244 |
+
/* 568 */
|
2245 |
+
/* 569 */ executionState._next = proxyPlaceholder;
|
2246 |
+
/* 570 */ executionState._canContinue = true;
|
2247 |
+
/* 571 */ executionState._openEndAction = function(tic, state){
|
2248 |
+
/* 572 */ if (finished == size) {
|
2249 |
+
/* 573 */ ongoingLoops.shift();
|
2250 |
+
/* 574 */ return {
|
2251 |
+
/* 575 */ _context: sameOrNextJQuery(executionState._context, proxyPlaceholder),
|
2252 |
+
/* 576 */ _method: methodToGoOn
|
2253 |
+
/* 577 */ };
|
2254 |
+
/* 578 */ }
|
2255 |
+
/* 579 */ var finishedBefore = finished;
|
2256 |
+
/* 580 */ spreadAction();
|
2257 |
+
/* 581 */ if (finished != finishedBefore) {
|
2258 |
+
/* 582 */ return state;
|
2259 |
+
/* 583 */ }
|
2260 |
+
/* 584 */ };
|
2261 |
+
/* 585 */ executionState._count = size;
|
2262 |
+
/* 586 */
|
2263 |
+
/* 587 */ ongoingLoops.unshift(executionState);
|
2264 |
+
/* 588 */ };
|
2265 |
+
/* 589 */
|
2266 |
+
/* 590 */ loopEndMethods.all = function(executionState){
|
2267 |
+
/* 591 */ jQuery.extend(executionState._method, {
|
2268 |
+
/* 592 */ _next: jQuery.extend({}, executionState._method),
|
2269 |
+
/* 593 */ _name: 'all',
|
2270 |
+
/* 594 */ _arguments: []
|
2271 |
+
/* 595 */ });
|
2272 |
+
/* 596 */ executionState._canContinue = null;
|
2273 |
+
/* 597 */ };
|
2274 |
+
/* 598 */ loopEndMethods.all.timing = function(timedInvocationChain, executionState, ongoingLoops) {
|
2275 |
+
/* 599 */ if (!ongoingLoops.length || !ongoingLoops[0]._fixOpenLoop) {
|
2276 |
+
/* 600 */ throw '.all() method must be used after .each() only';
|
2277 |
+
|
2278 |
+
/* jquery-timing.min.js */
|
2279 |
+
|
2280 |
+
/* 601 */ }
|
2281 |
+
/* 602 */ if (!ongoingLoops[0]._allAction) {
|
2282 |
+
/* 603 */ ongoingLoops[0]._fixOpenLoop(executionState);
|
2283 |
+
/* 604 */ return;
|
2284 |
+
/* 605 */ }
|
2285 |
+
/* 606 */
|
2286 |
+
/* 607 */ ongoingLoops[0]._allAction(executionState);
|
2287 |
+
/* 608 */ };
|
2288 |
+
/* 609 */
|
2289 |
+
/* 610 */ /**
|
2290 |
+
/* 611 *| * Define interval or binding to repeat.
|
2291 |
+
/* 612 *| *
|
2292 |
+
/* 613 *| * @param timedInvocationChain
|
2293 |
+
/* 614 *| * @param executionState
|
2294 |
+
/* 615 *| */
|
2295 |
+
/* 616 */ jQuery.fn.repeat.timing = function(timedInvocationChain, executionState, ongoingLoops) {
|
2296 |
+
/* 617 */ var trigger,
|
2297 |
+
/* 618 */ firstRunNow,
|
2298 |
+
/* 619 */ openLoopTimeout,
|
2299 |
+
/* 620 */ event,
|
2300 |
+
/* 621 */ interval;
|
2301 |
+
/* 622 */
|
2302 |
+
/* 623 */ if (typeof executionState._method._arguments[0] == "function") {
|
2303 |
+
/* 624 */ executionState._callback = executionState._method._arguments[0];
|
2304 |
+
/* 625 */ } else if (typeof executionState._method._arguments[1] == "function") {
|
2305 |
+
/* 626 */ trigger = executionState._method._arguments[0];
|
2306 |
+
/* 627 */ executionState._callback = executionState._method._arguments[1];
|
2307 |
+
/* 628 */ } else {
|
2308 |
+
/* 629 */ trigger = executionState._method._arguments[0];
|
2309 |
+
/* 630 */ firstRunNow = executionState._method._arguments[1];
|
2310 |
+
/* 631 */ executionState._callback = executionState._method._arguments[2];
|
2311 |
+
/* 632 */ }
|
2312 |
+
/* 633 */
|
2313 |
+
/* 634 */ function triggerAction() {
|
2314 |
+
/* 635 */ executionState._next = executionState._next || executionState._context;
|
2315 |
+
/* 636 */ executionState._canContinue = true;
|
2316 |
+
/* 637 */ timedInvocationChain();
|
2317 |
+
/* 638 */ }
|
2318 |
+
/* 639 */
|
2319 |
+
/* 640 */ function unrepeatAction(){
|
2320 |
+
/* 641 */ originalOff.call(event ? originalOff.call(jQuery(this), event, triggerAction) : jQuery(this), 'unrepeat', unrepeatAction);
|
2321 |
+
/* 642 */ var context = executionState._context.not(this);
|
2322 |
+
/* 643 */ executionState._next = (executionState._next == executionState._context) ? context : executionState._next;
|
2323 |
+
/* 644 */ executionState._context = context;
|
2324 |
+
/* 645 */ executionState._canContinue = executionState._context.length && executionState._canContinue;
|
2325 |
+
/* 646 */ trigger = executionState._context.length && trigger;
|
2326 |
+
/* 647 */ window.clearInterval(!executionState._context.length && interval);
|
2327 |
+
/* 648 */ // just update the snapshot info
|
2328 |
+
/* 649 */ timedInvocationChain();
|
2329 |
+
/* 650 */ }
|
2330 |
+
|
2331 |
+
/* jquery-timing.min.js */
|
2332 |
+
|
2333 |
+
/* 651 */
|
2334 |
+
/* 652 */ executionState._openEndAction = function(tic, state){
|
2335 |
+
/* 653 */ if (executionState._canContinue || openLoopTimeout) {
|
2336 |
+
/* 654 */ executionState._count++;
|
2337 |
+
/* 655 */ executionState._next = executionState._next || executionState._context;
|
2338 |
+
/* 656 */ executionState._canContinue = executionState._canContinue || (trigger && state._context && state._context.length);
|
2339 |
+
/* 657 */ return executionState;
|
2340 |
+
/* 658 */ }
|
2341 |
+
/* 659 */ };
|
2342 |
+
/* 660 */
|
2343 |
+
/* 661 */ if (trigger == null) {
|
2344 |
+
/* 662 */
|
2345 |
+
/* 663 */ firstRunNow = trigger = true;
|
2346 |
+
/* 664 */ window.setTimeout(function(){
|
2347 |
+
/* 665 */ openLoopTimeout = true;
|
2348 |
+
/* 666 */ timedInvocationChain();
|
2349 |
+
/* 667 */ },0);
|
2350 |
+
/* 668 */
|
2351 |
+
/* 669 */ } else {
|
2352 |
+
/* 670 */ if (typeof trigger == "string") {
|
2353 |
+
/* 671 */ originalOn.call(executionState._context, event = trigger, triggerAction);
|
2354 |
+
/* 672 */ } else {
|
2355 |
+
/* 673 */ interval = window.setInterval(triggerAction, Math.max(0, trigger));
|
2356 |
+
/* 674 */ }
|
2357 |
+
/* 675 */ trigger = false;
|
2358 |
+
/* 676 */ }
|
2359 |
+
/* 677 */
|
2360 |
+
/* 678 */ originalOn.call(executionState._context, 'unrepeat', unrepeatAction);
|
2361 |
+
/* 679 */
|
2362 |
+
/* 680 */ executionState._next = executionState._context;
|
2363 |
+
/* 681 */ executionState._count = 0;
|
2364 |
+
/* 682 */ executionState._untilAction = function(end){
|
2365 |
+
/* 683 */ if (end) {
|
2366 |
+
/* 684 */ unrepeatAction.apply(executionState._context);
|
2367 |
+
/* 685 */ }
|
2368 |
+
/* 686 */ if (trigger) {
|
2369 |
+
/* 687 */ triggerAction();
|
2370 |
+
/* 688 */ }
|
2371 |
+
/* 689 */ };
|
2372 |
+
/* 690 */ executionState._fixOpenLoop = loopEndMethods.until;
|
2373 |
+
/* 691 */
|
2374 |
+
/* 692 */ if (firstRunNow) {
|
2375 |
+
/* 693 */ triggerAction();
|
2376 |
+
/* 694 */ }
|
2377 |
+
/* 695 */
|
2378 |
+
/* 696 */ ongoingLoops.unshift(executionState);
|
2379 |
+
/* 697 */ };
|
2380 |
+
/* 698 */
|
2381 |
+
/* 699 */ /**
|
2382 |
+
/* 700 *| * Defined to evaluate condition when calling .until()
|
2383 |
+
|
2384 |
+
/* jquery-timing.min.js */
|
2385 |
+
|
2386 |
+
/* 701 *| */
|
2387 |
+
/* 702 */ loopEndMethods.until = function(executionState){
|
2388 |
+
/* 703 */ jQuery.extend(executionState._method, {
|
2389 |
+
/* 704 */ _next: jQuery.extend({}, executionState._method),
|
2390 |
+
/* 705 */ _name: 'until',
|
2391 |
+
/* 706 */ _arguments: []
|
2392 |
+
/* 707 */ });
|
2393 |
+
/* 708 */ executionState._canContinue = null;
|
2394 |
+
/* 709 */ };
|
2395 |
+
/* 710 */ loopEndMethods.until.timing = function(timedInvocationChain, executionState, ongoingLoops) {
|
2396 |
+
/* 711 */ if (!ongoingLoops.length || !ongoingLoops[0]._fixOpenLoop) {
|
2397 |
+
/* 712 */ throw '.until() method must be used after .repeat() only';
|
2398 |
+
/* 713 */ }
|
2399 |
+
/* 714 */ if (!ongoingLoops[0]._untilAction) {
|
2400 |
+
/* 715 */ ongoingLoops[0]._fixOpenLoop(executionState);
|
2401 |
+
/* 716 */ return;
|
2402 |
+
/* 717 */ }
|
2403 |
+
/* 718 */
|
2404 |
+
/* 719 */ var condition = executionState._method._arguments[0],
|
2405 |
+
/* 720 */ loopContext = executionState._method._arguments[1];
|
2406 |
+
/* 721 */ if (condition === jQuery) {
|
2407 |
+
/* 722 */ condition = null;
|
2408 |
+
/* 723 */ loopContext = executionState._method._arguments.length <= 1 || loopContext;
|
2409 |
+
/* 724 */ }
|
2410 |
+
/* 725 */ if (typeof condition == "function") {
|
2411 |
+
/* 726 */ condition = condition.apply(executionState._context, loopCounts(ongoingLoops));
|
2412 |
+
/* 727 */ }
|
2413 |
+
/* 728 */ if (condition == null) {
|
2414 |
+
/* 729 */ condition = !executionState._context.size();
|
2415 |
+
/* 730 */ }
|
2416 |
+
/* 731 */ if (typeof condition == "object") {
|
2417 |
+
/* 732 */ condition = condition.toString();
|
2418 |
+
/* 733 */ }
|
2419 |
+
/* 734 */ if (typeof condition == "number") {
|
2420 |
+
/* 735 */ condition = ongoingLoops[0]._count >= condition-1;
|
2421 |
+
/* 736 */ }
|
2422 |
+
/* 737 */ if (condition) {
|
2423 |
+
/* 738 */ executionState._canContinue = true;
|
2424 |
+
/* 739 */ executionState._next = executionState._context;
|
2425 |
+
/* 740 */ ongoingLoops.shift()._untilAction(condition);
|
2426 |
+
/* 741 */ } else {
|
2427 |
+
/* 742 */ if (loopContext) {
|
2428 |
+
/* 743 */ ongoingLoops[0]._next = executionState._context;
|
2429 |
+
/* 744 */ }
|
2430 |
+
/* 745 */ executionState = ongoingLoops[0];
|
2431 |
+
/* 746 */ executionState._count++;
|
2432 |
+
/* 747 */ executionState._untilAction(condition);
|
2433 |
+
/* 748 */ return executionState;
|
2434 |
+
/* 749 */ }
|
2435 |
+
/* 750 */ };
|
2436 |
+
|
2437 |
+
/* jquery-timing.min.js */
|
2438 |
+
|
2439 |
+
/* 751 */
|
2440 |
+
/* 752 */ // support .until() and .all()
|
2441 |
+
/* 753 */ new PredictingProxy(loopEndMethods);
|
2442 |
+
/* 754 */
|
2443 |
+
/* 755 */ /**
|
2444 |
+
/* 756 *| * Define unwait and unrepeat methods.
|
2445 |
+
/* 757 *| */
|
2446 |
+
/* 758 */ jQuery.each(['unwait','unrepeat'], function(index, name){
|
2447 |
+
/* 759 */ jQuery.fn[name] = function(){
|
2448 |
+
/* 760 */ return this.trigger(name, arguments);
|
2449 |
+
/* 761 */ };
|
2450 |
+
/* 762 */ });
|
2451 |
+
/* 763 */
|
2452 |
+
/* 764 */ /**
|
2453 |
+
/* 765 *| * define all static timing methods:
|
2454 |
+
/* 766 *| * $.wait, $.repeat ,$.join, $.then, $.unwait, $.unrepeat
|
2455 |
+
/* 767 *| */
|
2456 |
+
/* 768 */ jQuery.each(['wait','repeat','join','then','unwait','unrepeat'], function(index, name){
|
2457 |
+
/* 769 */ jQuery[name] = function(){
|
2458 |
+
/* 770 */ var group = typeof arguments[0] == "string" ? Array.prototype.shift.apply(arguments) : '';
|
2459 |
+
/* 771 */ return jQuery.fn[name].apply(THREAD_GROUPS[group] = (THREAD_GROUPS[group] || jQuery('<div>').text(group)), arguments);
|
2460 |
+
/* 772 */ };
|
2461 |
+
/* 773 */ });
|
2462 |
+
/* 774 */
|
2463 |
+
/* 775 */ /**
|
2464 |
+
/* 776 *| * X defines deferred variables that can be used in timed invocation chains
|
2465 |
+
/* 777 *| *
|
2466 |
+
/* 778 *| * @author CreativeCouple
|
2467 |
+
/* 779 *| * @author Peter Liske
|
2468 |
+
/* 780 *| */
|
2469 |
+
/* 781 */ function X(compute, Var, calculation){
|
2470 |
+
/* 782 */ if (typeof compute == "string") {
|
2471 |
+
/* 783 */ calculation = new Function('x','return ['+compute+'\n,x]');
|
2472 |
+
/* 784 */ compute = function(x, result){
|
2473 |
+
/* 785 */ result = calculation(x);
|
2474 |
+
/* 786 */ callbackVariable.x = result[1];
|
2475 |
+
/* 787 */ return result[0];
|
2476 |
+
/* 788 */ };
|
2477 |
+
/* 789 */ }
|
2478 |
+
/* 790 */ var hasRelatedVariable = typeof Var == "function",
|
2479 |
+
/* 791 */ hasComputation = typeof compute == "function",
|
2480 |
+
/* 792 */
|
2481 |
+
/* 793 */ callbackVariable = function(value) {
|
2482 |
+
/* 794 */ if (arguments.length == 1) {
|
2483 |
+
/* 795 */ callbackVariable.x = value;
|
2484 |
+
/* 796 */ if (hasRelatedVariable) {
|
2485 |
+
/* 797 */ Var(value);
|
2486 |
+
/* 798 */ }
|
2487 |
+
/* 799 */ } else {
|
2488 |
+
/* 800 */ return evaluate();
|
2489 |
+
|
2490 |
+
/* jquery-timing.min.js */
|
2491 |
+
|
2492 |
+
/* 801 */ }
|
2493 |
+
/* 802 */ };
|
2494 |
+
/* 803 */ function evaluate(value){
|
2495 |
+
/* 804 */ value = hasRelatedVariable ? Var() : callbackVariable.x;
|
2496 |
+
/* 805 */ return hasComputation ? compute(value) : value;
|
2497 |
+
/* 806 */ }
|
2498 |
+
/* 807 */
|
2499 |
+
/* 808 */ callbackVariable.x = 0;
|
2500 |
+
/* 809 */ callbackVariable._ = { toString: callbackVariable.$ = callbackVariable.toString = evaluate.toString = evaluate };
|
2501 |
+
/* 810 */ callbackVariable.mod = function(val){
|
2502 |
+
/* 811 */ return X(function(x){
|
2503 |
+
/* 812 */ return x % val;
|
2504 |
+
/* 813 */ }, callbackVariable);
|
2505 |
+
/* 814 */ };
|
2506 |
+
/* 815 */ callbackVariable.add = function(val){
|
2507 |
+
/* 816 */ return X(function(x){
|
2508 |
+
/* 817 */ return x + val;
|
2509 |
+
/* 818 */ }, callbackVariable);
|
2510 |
+
/* 819 */ };
|
2511 |
+
/* 820 */ callbackVariable.neg = function(){
|
2512 |
+
/* 821 */ return X('-x', callbackVariable);
|
2513 |
+
/* 822 */ };
|
2514 |
+
/* 823 */ // $$ only for backward compatibility
|
2515 |
+
/* 824 */ callbackVariable.$$ = callbackVariable.X = function(compute){
|
2516 |
+
/* 825 */ return X(compute, callbackVariable);
|
2517 |
+
/* 826 */ };
|
2518 |
+
/* 827 */ jQuery.each('abcdefghij', function(index, character){
|
2519 |
+
/* 828 */ callbackVariable[index] = callbackVariable[character] = function(){
|
2520 |
+
/* 829 */ callbackVariable(arguments[index]);
|
2521 |
+
/* 830 */ };
|
2522 |
+
/* 831 */ });
|
2523 |
+
/* 832 */
|
2524 |
+
/* 833 */ return callbackVariable;
|
2525 |
+
/* 834 */ };
|
2526 |
+
/* 835 */
|
2527 |
+
/* 836 */ // $$ only for backward compatibility
|
2528 |
+
/* 837 */ window.$$ = jQuery.$$ = jQuery.X = X;
|
2529 |
+
/* 838 */
|
2530 |
+
/* 839 */ /**
|
2531 |
+
/* 840 *| * Define chained version of $().
|
2532 |
+
/* 841 *| * This allows to use .end() to come back to previous jQuery selection.
|
2533 |
+
/* 842 *| */
|
2534 |
+
/* 843 */ jQuery.fn.$ = function(){
|
2535 |
+
/* 844 */ var ret = jQuery.apply(window, arguments);
|
2536 |
+
/* 845 */ ret.prevObject = this;
|
2537 |
+
/* 846 */ return ret;
|
2538 |
+
/* 847 */ };
|
2539 |
+
/* 848 */
|
2540 |
+
/* 849 */ })(jQuery, window);
|
2541 |
+
|
2542 |
+
;
|
2543 |
+
/* sk_wp.js */
|
2544 |
+
|
2545 |
+
/* 1 */
|
2546 |
+
/* 2 */ jQuery(document).ready(function($) {
|
2547 |
+
/* 3 */ window.sidekickWP = new SidekickWP.Models.App();
|
2548 |
+
/* 4 */ console.log('window.sidekickWP %o', window.sidekickWP);
|
2549 |
+
/* 5 */ // jQuery('#logo').trigger('click');
|
2550 |
+
/* 6 */ });
|
2551 |
+
/* 7 */
|
license.txt
ADDED
@@ -0,0 +1,281 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
GNU GENERAL PUBLIC LICENSE
|
2 |
+
Version 2, June 1991
|
3 |
+
|
4 |
+
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
5 |
+
51 Franklin St, Fifth Floor, Boston, MA 02110, USA
|
6 |
+
|
7 |
+
Everyone is permitted to copy and distribute verbatim copies
|
8 |
+
of this license document, but changing it is not allowed.
|
9 |
+
|
10 |
+
Preamble
|
11 |
+
|
12 |
+
The licenses for most software are designed to take away your
|
13 |
+
freedom to share and change it. By contrast, the GNU General Public
|
14 |
+
License is intended to guarantee your freedom to share and change free
|
15 |
+
software--to make sure the software is free for all its users. This
|
16 |
+
General Public License applies to most of the Free Software
|
17 |
+
Foundation's software and to any other program whose authors commit to
|
18 |
+
using it. (Some other Free Software Foundation software is covered by
|
19 |
+
the GNU Library General Public License instead.) You can apply it to
|
20 |
+
your programs, too.
|
21 |
+
|
22 |
+
When we speak of free software, we are referring to freedom, not
|
23 |
+
price. Our General Public Licenses are designed to make sure that you
|
24 |
+
have the freedom to distribute copies of free software (and charge for
|
25 |
+
this service if you wish), that you receive source code or can get it
|
26 |
+
if you want it, that you can change the software or use pieces of it
|
27 |
+
in new free programs; and that you know you can do these things.
|
28 |
+
|
29 |
+
To protect your rights, we need to make restrictions that forbid
|
30 |
+
anyone to deny you these rights or to ask you to surrender the rights.
|
31 |
+
These restrictions translate to certain responsibilities for you if you
|
32 |
+
distribute copies of the software, or if you modify it.
|
33 |
+
|
34 |
+
For example, if you distribute copies of such a program, whether
|
35 |
+
gratis or for a fee, you must give the recipients all the rights that
|
36 |
+
you have. You must make sure that they, too, receive or can get the
|
37 |
+
source code. And you must show them these terms so they know their
|
38 |
+
rights.
|
39 |
+
|
40 |
+
We protect your rights with two steps: (1) copyright the software, and
|
41 |
+
(2) offer you this license which gives you legal permission to copy,
|
42 |
+
distribute and/or modify the software.
|
43 |
+
|
44 |
+
Also, for each author's protection and ours, we want to make certain
|
45 |
+
that everyone understands that there is no warranty for this free
|
46 |
+
software. If the software is modified by someone else and passed on, we
|
47 |
+
want its recipients to know that what they have is not the original, so
|
48 |
+
that any problems introduced by others will not reflect on the original
|
49 |
+
authors' reputations.
|
50 |
+
|
51 |
+
Finally, any free program is threatened constantly by software
|
52 |
+
patents. We wish to avoid the danger that redistributors of a free
|
53 |
+
program will individually obtain patent licenses, in effect making the
|
54 |
+
program proprietary. To prevent this, we have made it clear that any
|
55 |
+
patent must be licensed for everyone's free use or not licensed at all.
|
56 |
+
|
57 |
+
The precise terms and conditions for copying, distribution and
|
58 |
+
modification follow.
|
59 |
+
|
60 |
+
GNU GENERAL PUBLIC LICENSE
|
61 |
+
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
62 |
+
|
63 |
+
0. This License applies to any program or other work which contains
|
64 |
+
a notice placed by the copyright holder saying it may be distributed
|
65 |
+
under the terms of this General Public License. The "Program", below,
|
66 |
+
refers to any such program or work, and a "work based on the Program"
|
67 |
+
means either the Program or any derivative work under copyright law:
|
68 |
+
that is to say, a work containing the Program or a portion of it,
|
69 |
+
either verbatim or with modifications and/or translated into another
|
70 |
+
language. (Hereinafter, translation is included without limitation in
|
71 |
+
the term "modification".) Each licensee is addressed as "you".
|
72 |
+
|
73 |
+
Activities other than copying, distribution and modification are not
|
74 |
+
covered by this License; they are outside its scope. The act of
|
75 |
+
running the Program is not restricted, and the output from the Program
|
76 |
+
is covered only if its contents constitute a work based on the
|
77 |
+
Program (independent of having been made by running the Program).
|
78 |
+
Whether that is true depends on what the Program does.
|
79 |
+
|
80 |
+
1. You may copy and distribute verbatim copies of the Program's
|
81 |
+
source code as you receive it, in any medium, provided that you
|
82 |
+
conspicuously and appropriately publish on each copy an appropriate
|
83 |
+
copyright notice and disclaimer of warranty; keep intact all the
|
84 |
+
notices that refer to this License and to the absence of any warranty;
|
85 |
+
and give any other recipients of the Program a copy of this License
|
86 |
+
along with the Program.
|
87 |
+
|
88 |
+
You may charge a fee for the physical act of transferring a copy, and
|
89 |
+
you may at your option offer warranty protection in exchange for a fee.
|
90 |
+
|
91 |
+
2. You may modify your copy or copies of the Program or any portion
|
92 |
+
of it, thus forming a work based on the Program, and copy and
|
93 |
+
distribute such modifications or work under the terms of Section 1
|
94 |
+
above, provided that you also meet all of these conditions:
|
95 |
+
|
96 |
+
a) You must cause the modified files to carry prominent notices
|
97 |
+
stating that you changed the files and the date of any change.
|
98 |
+
|
99 |
+
b) You must cause any work that you distribute or publish, that in
|
100 |
+
whole or in part contains or is derived from the Program or any
|
101 |
+
part thereof, to be licensed as a whole at no charge to all third
|
102 |
+
parties under the terms of this License.
|
103 |
+
|
104 |
+
c) If the modified program normally reads commands interactively
|
105 |
+
when run, you must cause it, when started running for such
|
106 |
+
interactive use in the most ordinary way, to print or display an
|
107 |
+
announcement including an appropriate copyright notice and a
|
108 |
+
notice that there is no warranty (or else, saying that you provide
|
109 |
+
a warranty) and that users may redistribute the program under
|
110 |
+
these conditions, and telling the user how to view a copy of this
|
111 |
+
License. (Exception: if the Program itself is interactive but
|
112 |
+
does not normally print such an announcement, your work based on
|
113 |
+
the Program is not required to print an announcement.)
|
114 |
+
|
115 |
+
These requirements apply to the modified work as a whole. If
|
116 |
+
identifiable sections of that work are not derived from the Program,
|
117 |
+
and can be reasonably considered independent and separate works in
|
118 |
+
themselves, then this License, and its terms, do not apply to those
|
119 |
+
sections when you distribute them as separate works. But when you
|
120 |
+
distribute the same sections as part of a whole which is a work based
|
121 |
+
on the Program, the distribution of the whole must be on the terms of
|
122 |
+
this License, whose permissions for other licensees extend to the
|
123 |
+
entire whole, and thus to each and every part regardless of who wrote it.
|
124 |
+
Thus, it is not the intent of this section to claim rights or contest
|
125 |
+
your rights to work written entirely by you; rather, the intent is to
|
126 |
+
exercise the right to control the distribution of derivative or
|
127 |
+
collective works based on the Program.
|
128 |
+
|
129 |
+
In addition, mere aggregation of another work not based on the Program
|
130 |
+
with the Program (or with a work based on the Program) on a volume of
|
131 |
+
a storage or distribution medium does not bring the other work under
|
132 |
+
the scope of this License.
|
133 |
+
|
134 |
+
3. You may copy and distribute the Program (or a work based on it,
|
135 |
+
under Section 2) in object code or executable form under the terms of
|
136 |
+
Sections 1 and 2 above provided that you also do one of the following:
|
137 |
+
|
138 |
+
a) Accompany it with the complete corresponding machine-readable
|
139 |
+
source code, which must be distributed under the terms of Sections
|
140 |
+
1 and 2 above on a medium customarily used for software interchange; or,
|
141 |
+
|
142 |
+
b) Accompany it with a written offer, valid for at least three
|
143 |
+
years, to give any third party, for a charge no more than your
|
144 |
+
cost of physically performing source distribution, a complete
|
145 |
+
machine-readable copy of the corresponding source code, to be
|
146 |
+
distributed under the terms of Sections 1 and 2 above on a medium
|
147 |
+
customarily used for software interchange; or,
|
148 |
+
|
149 |
+
c) Accompany it with the information you received as to the offer
|
150 |
+
to distribute corresponding source code. (This alternative is
|
151 |
+
allowed only for noncommercial distribution and only if you
|
152 |
+
received the program in object code or executable form with such
|
153 |
+
an offer, in accord with Subsection b above.)
|
154 |
+
|
155 |
+
The source code for a work means the preferred form of the work for
|
156 |
+
making modifications to it. For an executable work, complete source
|
157 |
+
code means all the source code for all modules it contains, plus any
|
158 |
+
associated interface definition files, plus the scripts used to
|
159 |
+
control compilation and installation of the executable. However, as a
|
160 |
+
special exception, the source code distributed need not include
|
161 |
+
anything that is normally distributed (in either source or binary
|
162 |
+
form) with the major components (compiler, kernel, and so on) of the
|
163 |
+
operating system on which the executable runs, unless that component
|
164 |
+
itself accompanies the executable.
|
165 |
+
|
166 |
+
If distribution of executable or object code is made by offering
|
167 |
+
access to copy from a designated place, then offering equivalent
|
168 |
+
access to copy the source code from the same place counts as
|
169 |
+
distribution of the source code, even though third parties are not
|
170 |
+
compelled to copy the source along with the object code.
|
171 |
+
|
172 |
+
4. You may not copy, modify, sublicense, or distribute the Program
|
173 |
+
except as expressly provided under this License. Any attempt
|
174 |
+
otherwise to copy, modify, sublicense or distribute the Program is
|
175 |
+
void, and will automatically terminate your rights under this License.
|
176 |
+
However, parties who have received copies, or rights, from you under
|
177 |
+
this License will not have their licenses terminated so long as such
|
178 |
+
parties remain in full compliance.
|
179 |
+
|
180 |
+
5. You are not required to accept this License, since you have not
|
181 |
+
signed it. However, nothing else grants you permission to modify or
|
182 |
+
distribute the Program or its derivative works. These actions are
|
183 |
+
prohibited by law if you do not accept this License. Therefore, by
|
184 |
+
modifying or distributing the Program (or any work based on the
|
185 |
+
Program), you indicate your acceptance of this License to do so, and
|
186 |
+
all its terms and conditions for copying, distributing or modifying
|
187 |
+
the Program or works based on it.
|
188 |
+
|
189 |
+
6. Each time you redistribute the Program (or any work based on the
|
190 |
+
Program), the recipient automatically receives a license from the
|
191 |
+
original licensor to copy, distribute or modify the Program subject to
|
192 |
+
these terms and conditions. You may not impose any further
|
193 |
+
restrictions on the recipients' exercise of the rights granted herein.
|
194 |
+
You are not responsible for enforcing compliance by third parties to
|
195 |
+
this License.
|
196 |
+
|
197 |
+
7. If, as a consequence of a court judgment or allegation of patent
|
198 |
+
infringement or for any other reason (not limited to patent issues),
|
199 |
+
conditions are imposed on you (whether by court order, agreement or
|
200 |
+
otherwise) that contradict the conditions of this License, they do not
|
201 |
+
excuse you from the conditions of this License. If you cannot
|
202 |
+
distribute so as to satisfy simultaneously your obligations under this
|
203 |
+
License and any other pertinent obligations, then as a consequence you
|
204 |
+
may not distribute the Program at all. For example, if a patent
|
205 |
+
license would not permit royalty-free redistribution of the Program by
|
206 |
+
all those who receive copies directly or indirectly through you, then
|
207 |
+
the only way you could satisfy both it and this License would be to
|
208 |
+
refrain entirely from distribution of the Program.
|
209 |
+
|
210 |
+
If any portion of this section is held invalid or unenforceable under
|
211 |
+
any particular circumstance, the balance of the section is intended to
|
212 |
+
apply and the section as a whole is intended to apply in other
|
213 |
+
circumstances.
|
214 |
+
|
215 |
+
It is not the purpose of this section to induce you to infringe any
|
216 |
+
patents or other property right claims or to contest validity of any
|
217 |
+
such claims; this section has the sole purpose of protecting the
|
218 |
+
integrity of the free software distribution system, which is
|
219 |
+
implemented by public license practices. Many people have made
|
220 |
+
generous contributions to the wide range of software distributed
|
221 |
+
through that system in reliance on consistent application of that
|
222 |
+
system; it is up to the author/donor to decide if he or she is willing
|
223 |
+
to distribute software through any other system and a licensee cannot
|
224 |
+
impose that choice.
|
225 |
+
|
226 |
+
This section is intended to make thoroughly clear what is believed to
|
227 |
+
be a consequence of the rest of this License.
|
228 |
+
|
229 |
+
8. If the distribution and/or use of the Program is restricted in
|
230 |
+
certain countries either by patents or by copyrighted interfaces, the
|
231 |
+
original copyright holder who places the Program under this License
|
232 |
+
may add an explicit geographical distribution limitation excluding
|
233 |
+
those countries, so that distribution is permitted only in or among
|
234 |
+
countries not thus excluded. In such case, this License incorporates
|
235 |
+
the limitation as if written in the body of this License.
|
236 |
+
|
237 |
+
9. The Free Software Foundation may publish revised and/or new versions
|
238 |
+
of the General Public License from time to time. Such new versions will
|
239 |
+
be similar in spirit to the present version, but may differ in detail to
|
240 |
+
address new problems or concerns.
|
241 |
+
|
242 |
+
Each version is given a distinguishing version number. If the Program
|
243 |
+
specifies a version number of this License which applies to it and "any
|
244 |
+
later version", you have the option of following the terms and conditions
|
245 |
+
either of that version or of any later version published by the Free
|
246 |
+
Software Foundation. If the Program does not specify a version number of
|
247 |
+
this License, you may choose any version ever published by the Free Software
|
248 |
+
Foundation.
|
249 |
+
|
250 |
+
10. If you wish to incorporate parts of the Program into other free
|
251 |
+
programs whose distribution conditions are different, write to the author
|
252 |
+
to ask for permission. For software which is copyrighted by the Free
|
253 |
+
Software Foundation, write to the Free Software Foundation; we sometimes
|
254 |
+
make exceptions for this. Our decision will be guided by the two goals
|
255 |
+
of preserving the free status of all derivatives of our free software and
|
256 |
+
of promoting the sharing and reuse of software generally.
|
257 |
+
|
258 |
+
NO WARRANTY
|
259 |
+
|
260 |
+
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
261 |
+
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
262 |
+
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
263 |
+
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
264 |
+
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
265 |
+
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
266 |
+
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
267 |
+
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
268 |
+
REPAIR OR CORRECTION.
|
269 |
+
|
270 |
+
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
271 |
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
272 |
+
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
273 |
+
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
274 |
+
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
275 |
+
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
276 |
+
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
277 |
+
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
278 |
+
POSSIBILITY OF SUCH DAMAGES.
|
279 |
+
|
280 |
+
END OF TERMS AND CONDITIONS
|
281 |
+
|
readme.txt
ADDED
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== Sidekick ===
|
2 |
+
Contributors: bartdabek@gmail.com,ben@flowpress.ca
|
3 |
+
Donate link: http://www.sidekick.pro
|
4 |
+
Tags: help, tutorial, training, learn, learning, sidekick, interactive help, teach, video, manual, videos, wphelp, support, instructions, question, questions, answers, answer, clippy, q&a, chat, wpuniversity, helper, walkthrough,
|
5 |
+
Requires at least: 3.5
|
6 |
+
Tested up to: 3.6.1
|
7 |
+
Stable tag: 1.0
|
8 |
+
License: GNU Version 2 or Any Later Version
|
9 |
+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
+
|
11 |
+
Real-time, voice-guided WordPress support, help and learning at the push of button, inside your Admin Dashboard.
|
12 |
+
|
13 |
+
|
14 |
+
== Description ==
|
15 |
+
|
16 |
+
**SIDEKICK**
|
17 |
+
|
18 |
+
The [Sidekick](http://Sidekick.pro/ "Sidekick") platform provides **real-time, voice-guided support and learning** from within any html or PHP based web application or CMS. Support is provided through modules called “Walkthroughs” that guide users through everything from understanding simple aspects of an application to completing even complicated tasks.
|
19 |
+
|
20 |
+
Walkthroughs are served directly from the Sidekick library. With the users permission, an installed Sidekick module can automatically detect a user’s access level, installed 3rd party extensions and settings. That information is used to pull the appropriate walkthroughs from the Sidekick library. Sidekick also collects anonymous user data (with the user’s permission) to track, amongst other things, which walkthroughs are attempted and completed and how often.
|
21 |
+
|
22 |
+
The Sidekick Plugin for WordPress bridges the gap between the Sidekick Platform and user’s WordPress Dashboard.
|
23 |
+
|
24 |
+
**WPUNIVERSITY**
|
25 |
+
|
26 |
+
Sidekick for WordPress provides real-time, guided WordPress help right from your dashboard, whenever you need it. Core WordPress walkthrough modules are created and maintained by the team at [wpuniversity.com](http://www.wpuniversity.com/ "wpuniversity.com"). Third party plugin and theme walkthroughs are created and maintained by their respective creators.
|
27 |
+
|
28 |
+
The Sidekick plugin for WordPress collects specific, anonymous data (with the user’s permission) which can include a user’s email address, domain name, installed plugins, installed theme(s) etc... Basically, anything PressTrends captures.
|
29 |
+
|
30 |
+
With the click of a button, you’ll get a step-by-step answer to your question instantly. So you can stop waiting for your developer call you back.
|
31 |
+
|
32 |
+
If you have any questions about the Sidekick plugin for WordPress, please contact [info@wpuniversity.com](mailto:info@wpuniveristy.com "Email WPUniversity").
|
33 |
+
|
34 |
+
Try the [demo](http://demo.wpuniversity.com "demo").
|
35 |
+
|
36 |
+
== Installation ==
|
37 |
+
|
38 |
+
This section describes how to install the plugin and get it working.
|
39 |
+
|
40 |
+
1. Unzip and upload the Sidekick plugin to the `/wp-content/plugins/` directory
|
41 |
+
2. Activate the plugin through the 'Plugins' menu in WordPress
|
42 |
+
3. You will see a Help button appear in the bottom right corner of your Dashboard.
|
43 |
+
|
44 |
+
== Upgrade Notice ==
|
45 |
+
|
46 |
+
Upgrade Notice
|
47 |
+
|
48 |
+
== Activation ==
|
49 |
+
|
50 |
+
After installation, you will have access to at least 5 Core WordPress Walkthroughs and all third party walkthroughs that are applicable to your WordPress Dashboard.
|
51 |
+
|
52 |
+
If you choose to register an account by providing your name and email address, you will receive a free upgrade to access all 40+ of our WordPress Core Walkthroughs until at least the end of October 2013 (subject to change). Following the free period, there will be a monthly charge to access the entire library of Core Walkthroughs.
|
53 |
+
|
54 |
+
**Access to at least 5 Core Walkthroughs and all third party walkthroughs will remain free forever.**
|
55 |
+
|
56 |
+
Need more information? Want a clear understanding of the difference between a Core Walkthrough and a Third Party Walkthrough? Check out our FAQ page at www.wpuniversity.com/faq/
|
57 |
+
|
58 |
+
== Frequently Asked Questions ==
|
59 |
+
|
60 |
+
= What is Sidekick for WordPress? =
|
61 |
+
|
62 |
+
The Sidekick platform provides real-time, guided support and learning from within any html or PHP based web application or CMS. Support is provided through modules called “Walkthroughs” that guide users through everything from understanding simple aspects of an application to completing complicated tasks.
|
63 |
+
The Sidekick plugin for WordPress connects the Sidekick platform with any WordPress Dashboard allowing real-time guided walkthroughs of core and 3rd party WordPress features and functions.
|
64 |
+
|
65 |
+
If you’d like to learn more about Sidekick, go to [Sidekick.pro](http://Sidekick.pro/ "Sidekick")
|
66 |
+
|
67 |
+
= So is it Sidekick for WordPress or WPUniversity? =
|
68 |
+
|
69 |
+
Well. Both.
|
70 |
+
|
71 |
+
Sidekick is the web based platform that created the plugin code, stores walkthroughs and operates the library. WPUniversity writes and creates the Core WordPress Walkthroughs for the Sidekick for WordPress plugin.
|
72 |
+
|
73 |
+
= What is a Sidekick Walkthrough? =
|
74 |
+
|
75 |
+
A Sidekick for WordPress Walkthrough is a real-time, guided tutorial that walks you step by step through completing a task inside your WordPress Dashboard. It’s as if your site-builder or theme developer were standing right there with you, helping you get it done.
|
76 |
+
|
77 |
+
= What are Core and 3rd Party WordPress Walkthroughs? =
|
78 |
+
|
79 |
+
When we say “Core Walkthroughs” for WordPress, we are referring to any support and learning that has to do with features and functions provided by a fresh, default install of WordPress, downloaded from WordPress.org. Basically, if a walkthrough is helpng you complete a standard WordPress function like creating a post, it’s a Core Walkthrough and WPUniversity created it.
|
80 |
+
|
81 |
+
Plugin and theme specific Walkthroughs are called Third Party Walkthroughs and are created and maintained by the plugin or theme creator, unless otherwise mentioned.
|
82 |
+
|
83 |
+
= How do I create Walkthroughs for my Plugin(s) or Theme(s)? =
|
84 |
+
|
85 |
+
At the moment Sidekick Composer, the tool we use to create Walkthroughs, is for in-house use only but we plan for that to change by the end of October 2013. If you’re interested in getting a head start, send us an email at info@wpuniversity.com and we’ll let you know how you can get started.
|
86 |
+
|
87 |
+
= What does Sidekick for WordPress cost? =
|
88 |
+
|
89 |
+
The Sidekick plugin for WordPress is and always will be free to download and use. Installing the plugin gives you instant and unlimited access to at least 5 Core WordPress Walkthroughs as well as Walkthroughs created for any plugins or themes that are installed and active on your WordPress site.
|
90 |
+
If you would like access to the full library of Core WordPress Walkthroughs (40+) the cost is $20 per month per user. Price discounts start at just two licenses and go up from there.
|
91 |
+
|
92 |
+
Until the end of October 2013, access to all 40+ Core Walkthroughs is FREE of charge!
|
93 |
+
|
94 |
+
= Ok, the plugin is installed and activated. How do I use it? =
|
95 |
+
|
96 |
+
Click on the little icon in the bottom right of your screen to open the Walkthrough menu. (Think Clippy from Office ’95, only useful.)
|
97 |
+
You will be presented with the Walkthrough menu. Select your category then your walkthrough and away you go.
|
98 |
+
|
99 |
+
= Can I suggest a Walkthrough that I’d like to see or give you feedback on the Sidekick WordPress Plugin? =
|
100 |
+
|
101 |
+
Absolutely. In fact, we rely on users like you to tell us about things that need to be improved or that you’d like to see added to the plugin. Send your email to info@wpuniversity.com. We read and respond to every piece of feedback we get.
|
102 |
+
|
103 |
+
= Are Sidekick and WPUniversity the same company? =
|
104 |
+
|
105 |
+
[WPUniversity](http://wpuniversity.com/ "WPUniversity") and [Sidekick](http://Sidekick.pro/ "Sidekick") are created, owned and managed by [FlowPress Inc.](http://flowpress.ca/ "FlowPress"), a Toronto based Web Development Agency and startup.
|
106 |
+
|
107 |
+
== Screenshots ==
|
108 |
+
|
109 |
+
1. Sidekick in action, shows of the typical screen you will see while a Sidekick walkthrough is playing.
|
110 |
+
2. This widget shows the library of walkthroughs currently available.
|
111 |
+
3. User interaction demonstrated while a user is prompted to perform an action.
|
112 |
+
4. Yet another action requirement by the user is previewed here.
|
113 |
+
|
114 |
+
== Changelog ==
|
115 |
+
|
116 |
+
= 1.00 =
|
117 |
+
* Added support for buckets.
|
118 |
+
|
119 |
+
= 0.78 =
|
120 |
+
* Plugin compatibility issues resolved.
|
121 |
+
|
122 |
+
= 0.76 =
|
123 |
+
* Fixed sizing issues when more walkthroughs were added
|
124 |
+
|
125 |
+
= 0.74 =
|
126 |
+
* Fixed loop function bug
|
127 |
+
|
128 |
+
= 0.73 =
|
129 |
+
* Fixed Activation Bug
|
130 |
+
|
131 |
+
= 0.70 =
|
132 |
+
* Initial Beta Release
|
sidekick.php
ADDED
@@ -0,0 +1,444 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
Plugin Name: Sidekick
|
5 |
+
Plugin URL: http://www.wpuniversity.com/plugin/
|
6 |
+
Description: Adds a real-time WordPress training right into your Dashboard
|
7 |
+
Requires at least: 3.5
|
8 |
+
Tested up to: 3.6.1
|
9 |
+
Version: 1.00
|
10 |
+
Author: WPUniversity.com
|
11 |
+
Author URI: http://www.wpuniversity.com
|
12 |
+
*/
|
13 |
+
|
14 |
+
define('SK_DOMAIN','http://www.wpuniversity.com');
|
15 |
+
define('SK_PLUGIN_VERSION',1.00);
|
16 |
+
define('SK_LIBRARY_VERSION',3);
|
17 |
+
define('SK_PLATFORM_VERSION',3);
|
18 |
+
|
19 |
+
// this is the URL our updater / license checker pings. This should be the URL of the site with EDD installed
|
20 |
+
define( 'SK_STORE_URL', 'http://www.wpuniversity.com' ); // you should use your own CONSTANT name, and be sure to replace it throughout this file
|
21 |
+
|
22 |
+
// the name of your product. This should match the download name in EDD exactly
|
23 |
+
define( 'SK_ITEM_NAME', 'WPUniversity' ); // you should use your own CONSTANT name, and be sure to replace it throughout this file
|
24 |
+
|
25 |
+
if ( ! defined( 'SK_SL_PLUGIN_DIR' ) ) define( 'SK_SL_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
26 |
+
if ( ! defined( 'SK_SL_PLUGIN_URL' ) ) define( 'SK_SL_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
27 |
+
if ( ! defined( 'SK_SL_PLUGIN_FILE' ) ) define( 'SK_SL_PLUGIN_FILE', __FILE__ );
|
28 |
+
if ( !function_exists('mlog')) {
|
29 |
+
function mlog(){}
|
30 |
+
}
|
31 |
+
|
32 |
+
class Sidekick{
|
33 |
+
function enqueue_required(){
|
34 |
+
wp_enqueue_script('jquery' , null );
|
35 |
+
wp_enqueue_script('underscore' , null, array('underscore'));
|
36 |
+
wp_enqueue_script('backbone' , null, array('jquery','underscore'));
|
37 |
+
wp_enqueue_script('jquery-ui-core' , null, array('jquery') );
|
38 |
+
wp_enqueue_script('jquery-ui-position' , null, array('jquery-ui-core') );
|
39 |
+
wp_enqueue_script('jquery-ui-draggable' , null, array('jquery-ui-core') );
|
40 |
+
wp_enqueue_script('jquery-ui-droppable' , null, array('jquery-ui-core') );
|
41 |
+
wp_enqueue_script('jquery-effects-scale' , null, array('jquery-ui-core') );
|
42 |
+
wp_enqueue_script('jquery-effects-highlight' , null, array('jquery-ui-core') );
|
43 |
+
}
|
44 |
+
|
45 |
+
function enqueue(){
|
46 |
+
// mlog('Sidekick Prod');
|
47 |
+
if ($license = get_option("sk_license_key")){
|
48 |
+
define('SK_LIBRARY_FILE', "http://library.sidekick.pro/library/v3/releases/{$license}/library.js");
|
49 |
+
} else {
|
50 |
+
define('SK_LIBRARY_FILE', "http://library.sidekick.pro/library/v3/sources/wpuniversity-free_library.js");
|
51 |
+
}
|
52 |
+
|
53 |
+
wp_enqueue_script('sidekick' ,'http://platform.sidekick.pro/v3/sidekick.min.js', array('backbone','jquery','underscore','jquery-effects-highlight'), SK_PLUGIN_VERSION);
|
54 |
+
wp_enqueue_script('sk' ,plugins_url( '/js/sk.source.js' , __FILE__ ), array('sidekick') ,SK_PLUGIN_VERSION);
|
55 |
+
wp_enqueue_script("sk_library" , SK_LIBRARY_FILE , array("sk") ,rand(1, 5000));
|
56 |
+
wp_enqueue_style('sk-style' ,plugins_url( '/css/sidekick_wordpress.css' , __FILE__ ), null ,SK_PLUGIN_VERSION);
|
57 |
+
}
|
58 |
+
|
59 |
+
function setup_menu(){
|
60 |
+
add_menu_page( 'Sidekick', 'Sidekick', 'activate_plugins', 'sidekick', array(&$this,'admin_page'));
|
61 |
+
}
|
62 |
+
|
63 |
+
function admin_page(){
|
64 |
+
$license = get_option( 'sk_license_key' );
|
65 |
+
$status = get_option( 'sk_license_status' );
|
66 |
+
$email = get_option( 'sk_email' );
|
67 |
+
$first_name = get_option( 'sk_first_name' );
|
68 |
+
$track_data = get_option( 'sk_track_data' );
|
69 |
+
$error = null;
|
70 |
+
|
71 |
+
if (!$license) {
|
72 |
+
$license = get_option( 'wpu_license_key' );
|
73 |
+
if ($license) update_option( 'sk_license_key', $license );
|
74 |
+
$status = get_option( 'wpu_license_status' );
|
75 |
+
if ($status) update_option( 'sk_license_status', $status );
|
76 |
+
$email = get_option( 'wpu_email' );
|
77 |
+
if ($email) update_option( 'sk_email', $email );
|
78 |
+
$first_name = get_option( 'wpu_first_name' );
|
79 |
+
if ($first_name) update_option( 'sk_first_name', $first_name );
|
80 |
+
}
|
81 |
+
|
82 |
+
if (isset($_POST['option_page']) && $_POST['option_page'] == 'sk_license') {
|
83 |
+
if (isset($_POST['first_name'])) {
|
84 |
+
update_option('sk_first_name',$_POST['first_name']);
|
85 |
+
update_option('sk_email',$_POST['email']);
|
86 |
+
if (isset($_POST['sk_track_data'])) {
|
87 |
+
update_option( 'sk_track_data', true );
|
88 |
+
} else {
|
89 |
+
delete_option('sk_track_data');
|
90 |
+
}
|
91 |
+
|
92 |
+
$first_name = $_POST['first_name'];
|
93 |
+
$email = $_POST['email'];
|
94 |
+
$track_data = get_option( 'sk_track_data' );
|
95 |
+
$_POST['item_name'] = SK_ITEM_NAME;
|
96 |
+
|
97 |
+
if (defined('SK_PLUGIN_DEGBUG')) {
|
98 |
+
$url = 'http://dev.wpuniversity.com?action=remote_wpu_register';
|
99 |
+
} else {
|
100 |
+
$url = 'http://www.wpuniversity.com?action=remote_wpu_register';
|
101 |
+
}
|
102 |
+
|
103 |
+
$response = wp_remote_post( $url, array(
|
104 |
+
'method' => 'POST',
|
105 |
+
'timeout' => 45,
|
106 |
+
'redirection' => 5,
|
107 |
+
'httpversion' => '1.0',
|
108 |
+
'blocking' => true,
|
109 |
+
'headers' => array(),
|
110 |
+
'body' => $_POST,
|
111 |
+
'cookies' => array()
|
112 |
+
)
|
113 |
+
);
|
114 |
+
|
115 |
+
if ( is_wp_error( $response ) ) {
|
116 |
+
$error_message = $response->get_error_message();
|
117 |
+
// echo "Something went wrong: $error_message";
|
118 |
+
} else {
|
119 |
+
$success = 'Successfully Activated';
|
120 |
+
update_option('sk_license_key',$response['body']);
|
121 |
+
$license = $response['body'];
|
122 |
+
$email = $_POST['email'];
|
123 |
+
$status = 'valid';
|
124 |
+
|
125 |
+
update_option('sk_license_status','valid');
|
126 |
+
}
|
127 |
+
update_option( 'sk_activated', true );
|
128 |
+
die('<script>window.open("' . get_site_url() . '/wp-admin/admin.php?page=sidekick&firstuse","_self")</script>');
|
129 |
+
}
|
130 |
+
}
|
131 |
+
|
132 |
+
$current_user = wp_get_current_user();
|
133 |
+
if (!$first_name)
|
134 |
+
$first_name = $current_user->user_firstname;
|
135 |
+
|
136 |
+
if (!$email)
|
137 |
+
$email = $current_user->user_email;
|
138 |
+
|
139 |
+
$track_data = get_option( 'sk_track_data' );
|
140 |
+
|
141 |
+
global $wp_version;
|
142 |
+
if (version_compare($wp_version, '3.4', '<=')) {
|
143 |
+
$error = "Sorry, Sidekick requires WordPress 3.5 or higher to function.";
|
144 |
+
}
|
145 |
+
|
146 |
+
if (!$license) {
|
147 |
+
$warn = "You're using the <b>Demo</b> version of Sidekick, to gain full access to the walkthrough library please fill out your name and email address below.";
|
148 |
+
}
|
149 |
+
|
150 |
+
if(preg_match('/(?i)msie [1-8]/',$_SERVER['HTTP_USER_AGENT'])){
|
151 |
+
$error = "Sorry, Sidekick requires Internet Explorer 9 or higher to function.";
|
152 |
+
}
|
153 |
+
|
154 |
+
?>
|
155 |
+
|
156 |
+
<?php if ($_SERVER['QUERY_STRING'] == 'page=sidekick&firstuse'): ?>
|
157 |
+
<script type="text/javascript">
|
158 |
+
jQuery(document).ready(function($) {
|
159 |
+
jQuery('#wpu #logo').trigger('click');
|
160 |
+
});
|
161 |
+
</script>
|
162 |
+
<?php endif ?>
|
163 |
+
|
164 |
+
<div class="wrap">
|
165 |
+
<div class="icon32" id="icon-tools"><br></div><h2>Sidekick</h2>
|
166 |
+
|
167 |
+
<?php if (isset($error_message)): ?>
|
168 |
+
<div class="error" style="padding:15px; position:relative;" id="gf_dashboard_message">
|
169 |
+
There was a problem activating your license. The following error occured <?php echo $error_message ?>
|
170 |
+
</div>
|
171 |
+
<?php elseif (isset($error)): ?>
|
172 |
+
<div class="error" style="padding:15px; position:relative;" id="gf_dashboard_message">
|
173 |
+
<?php echo $error ?>
|
174 |
+
</div>
|
175 |
+
<?php elseif (isset($warn)): ?>
|
176 |
+
<div class="updated" style="padding:15px; position:relative;" id="gf_dashboard_message">
|
177 |
+
<?php echo $warn ?>
|
178 |
+
</div>
|
179 |
+
<?php elseif (isset($success)): ?>
|
180 |
+
<div class="updated" style="padding:15px; position:relative;" id="gf_dashboard_message">
|
181 |
+
<?php echo $success ?>
|
182 |
+
</div>
|
183 |
+
<?php endif ?>
|
184 |
+
|
185 |
+
<?php if (!$error): ?>
|
186 |
+
<?php if ($status == 'valid'): ?>
|
187 |
+
<h2>Your Sidekick Account</h2>
|
188 |
+
<?php else: ?>
|
189 |
+
<h2>Activate <b>Full Library</b></h2>
|
190 |
+
<?php endif ?>
|
191 |
+
|
192 |
+
<form method="post">
|
193 |
+
<?php settings_fields('sk_license'); ?>
|
194 |
+
<table class="form-table">
|
195 |
+
<tbody>
|
196 |
+
<tr valign="top">
|
197 |
+
<th scope="row" valign="top">First Name</th>
|
198 |
+
<td>
|
199 |
+
<input id="first_name" name="first_name" type="text" class="regular-text" <?php if ($status == 'valid'): ?>DISABLED<?php endif ?> value="<?php echo $first_name ?>" />
|
200 |
+
<label class="description" for="first_name"><?php _e('Enter your first name'); ?></label>
|
201 |
+
</td>
|
202 |
+
</tr>
|
203 |
+
|
204 |
+
<tr valign="top">
|
205 |
+
<th scope="row" valign="top">E-Mail</th>
|
206 |
+
<td>
|
207 |
+
<input id="email" name="email" type="text" class="regular-text" <?php if ($status == 'valid'): ?>DISABLED<?php endif ?> value="<?php echo $email ?>" />
|
208 |
+
<label class="description" for="email"><?php _e('Enter your email address'); ?></label>
|
209 |
+
</td>
|
210 |
+
</tr>
|
211 |
+
|
212 |
+
<?php if ($license): ?>
|
213 |
+
<tr valign="top">
|
214 |
+
<th scope="row" valign="top">License</th>
|
215 |
+
<td><span><?php echo $license ?></span></td>
|
216 |
+
</tr>
|
217 |
+
<?php endif ?>
|
218 |
+
|
219 |
+
<?php if ($status): ?>
|
220 |
+
<tr valign="top">
|
221 |
+
<th scope="row" valign="top">Status</th>
|
222 |
+
<td>
|
223 |
+
<?php if ($status == 'valid'): ?>
|
224 |
+
<span style='color: green'><?php echo ucfirst($status) ?></span>
|
225 |
+
<?php else: ?>
|
226 |
+
<span style='color: red'><?php echo ucfirst($status) ?></span>
|
227 |
+
<?php endif ?>
|
228 |
+
</td>
|
229 |
+
</tr>
|
230 |
+
<?php else: ?>
|
231 |
+
<tr valign="top">
|
232 |
+
<th scope="row" valign="top">
|
233 |
+
Status
|
234 |
+
</th>
|
235 |
+
|
236 |
+
<td>
|
237 |
+
<span style='color: blue'>Demo</span>
|
238 |
+
</td>
|
239 |
+
</tr>
|
240 |
+
<?php endif ?>
|
241 |
+
<?php if ($status !== 'valid'): ?>
|
242 |
+
<tr valign="top">
|
243 |
+
<th scope="row" valign="top">
|
244 |
+
Data Tracking
|
245 |
+
</th>
|
246 |
+
<td>
|
247 |
+
<input id="sk_track_data" name="sk_track_data" type="checkbox" class="regular-text" <?php if ($track_data): ?>CHECKED<?php endif ?> />
|
248 |
+
<label class="description" for="sk_track_data">Help Sidekick by providing tracking data which will help us build better help tools.</label>
|
249 |
+
</td>
|
250 |
+
</tr>
|
251 |
+
<?php endif; ?>
|
252 |
+
</tbody>
|
253 |
+
</table>
|
254 |
+
<?php if (defined('SK_PLUGIN_DEGBUG')): ?>
|
255 |
+
<?php submit_button('Activate Library (Debug)'); ?>
|
256 |
+
<?php elseif ($status !== 'valid'): ?>
|
257 |
+
<?php submit_button('Activate Library'); ?>
|
258 |
+
<?php endif ?>
|
259 |
+
</form>
|
260 |
+
<?php endif ?>
|
261 |
+
|
262 |
+
<h2>About Sidekick</h2>
|
263 |
+
<p><b>WordPress is about to get a whole lot easier to learn and use!</b></p>
|
264 |
+
<p>The Sidekick for WordPress Walkthrough library was created and is maintained by the team at http://www.wpuniversity.com. There is currently no charge to access and use the library of walkthroughs. All we ask is that you enter your first name and email address here so we can keep you posted on what's new with the plugin and any upcoming changes that you should be aware of. (entering your email address is not a requirement to use the plugin).</p>
|
265 |
+
<p>Sidekick and our parent company FlowPress adhere strictly to CANSPAM rules and we promise never to lend, sell or otherwise divulge your personal data (including your name and email address) without your express consent.</p>
|
266 |
+
<p>From time to time we send out WordPress tips & tricks, WordPress community updates and the occasional special offer to our users. If you'd like to receive these emails as well, please <a href='http://wpuniversity.us4.list-manage.com/subscribe?u=59d2b3278da2364941b040f74&id=b1a91625c0'>click here</a>.</p>
|
267 |
+
<p>Sidekick for WordPress is still in BETA and there will be the occasional bug. If you have any questions, bug reports or feedback, please send them to <a href='mailto:info@wpuniversity.com'>info@wpuniversity.com</a>.</p>
|
268 |
+
<p>Thank you,</p><br/>
|
269 |
+
|
270 |
+
</div>
|
271 |
+
<?php
|
272 |
+
}
|
273 |
+
|
274 |
+
function footer(){
|
275 |
+
global $current_user, $wp_roles;
|
276 |
+
|
277 |
+
$current_user = wp_get_current_user();
|
278 |
+
$sk_just_activated = get_option( 'sk_just_activated' );
|
279 |
+
$track_data = get_option( 'sk_track_data' );
|
280 |
+
$theme = wp_get_theme();
|
281 |
+
$not_supported_ie = false;
|
282 |
+
|
283 |
+
delete_option( 'sk_just_activated' );
|
284 |
+
foreach($wp_roles->role_names as $role => $Role) {
|
285 |
+
if (array_key_exists($role, $current_user->caps)){
|
286 |
+
$user_role = $role;
|
287 |
+
break;
|
288 |
+
}
|
289 |
+
}
|
290 |
+
|
291 |
+
if(preg_match('/(?i)msie [1-8]/',$_SERVER['HTTP_USER_AGENT'])){
|
292 |
+
$not_supported_ie = true;
|
293 |
+
}
|
294 |
+
|
295 |
+
?>
|
296 |
+
|
297 |
+
<?php if (!$not_supported_ie): ?>
|
298 |
+
|
299 |
+
<script type="text/javascript">
|
300 |
+
var sk_library_file = '<?php echo SK_LIBRARY_FILE ?>';
|
301 |
+
var sk_main_soft_version = '<?php echo get_bloginfo("version"); ?>';
|
302 |
+
var sk_installed_plugins = <?php echo $this->list_plugins() ?>;
|
303 |
+
var sk_installed_theme = '<?php echo $theme->Name ?>';
|
304 |
+
var sk_theme_version = '<?php echo $theme->Version ?>';
|
305 |
+
var sk_domain = '<?php echo SK_DOMAIN ?>';
|
306 |
+
var sk_license_status = '<?php echo get_option( "sk_license_status" ) ?>';
|
307 |
+
<?php if ($license_key = get_option( "sk_license_key" )): ?>
|
308 |
+
var sk_license_key = '<?php echo $license_key ?>';
|
309 |
+
<?php else: ?>
|
310 |
+
var sk_license_key = 'demo';
|
311 |
+
<?php endif ?>
|
312 |
+
var sk_plugin_version = <?php echo SK_PLUGIN_VERSION ?>;
|
313 |
+
var sk_library_version = <?php echo SK_LIBRARY_VERSION ?>;
|
314 |
+
var sk_platform_version = <?php echo SK_PLATFORM_VERSION ?>;
|
315 |
+
var sk_track_data = '<?php echo get_option( 'sk_track_data' ) ?>';
|
316 |
+
var sk_user_level = '<?php echo $user_role ?>';
|
317 |
+
<?php if ($sk_just_activated): ?>var sk_just_activated = true;<?php endif; ?>
|
318 |
+
</script>
|
319 |
+
|
320 |
+
<?php if ($track_data): ?>
|
321 |
+
<script id="IntercomSettingsScriptTag">
|
322 |
+
window.intercomSettings = {
|
323 |
+
email: "<?php echo $current_user->user_email; ?>",
|
324 |
+
created_at: 1234567980,
|
325 |
+
app_id: "75fbe21e31b2881f775fba2ff3ff7928485478e8",
|
326 |
+
// last_date_watched : 0,
|
327 |
+
// walkthroughs_watched: 0,
|
328 |
+
// number_of_plugins: 0,
|
329 |
+
// domain: 0,
|
330 |
+
// first_name: 0,
|
331 |
+
// plugin_version: '<?php echo SK_PLUGIN_VERSION ?>'
|
332 |
+
}
|
333 |
+
</script>
|
334 |
+
<script>(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://static.intercomcdn.com/intercom.v1.js';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}};})()</script>
|
335 |
+
<?php endif ?>
|
336 |
+
<?php endif ?>
|
337 |
+
<?php
|
338 |
+
}
|
339 |
+
|
340 |
+
function list_plugins(){
|
341 |
+
$active_plugins = wp_get_active_and_valid_plugins();
|
342 |
+
echo '[';
|
343 |
+
foreach ($active_plugins as $plugins_key => $plugin) {
|
344 |
+
$data = get_plugin_data( $plugin, false, false );
|
345 |
+
|
346 |
+
$plugins[addslashes($data['Name'])] = $data['Version'];
|
347 |
+
if ($plugins_key > 0) echo ',';
|
348 |
+
$data['Name'] = addslashes($data['Name']);
|
349 |
+
echo "{'{$data['Name']}' : '{$data['Version']}'}";
|
350 |
+
}
|
351 |
+
echo ']';
|
352 |
+
}
|
353 |
+
|
354 |
+
function bal_http_request_args($r){
|
355 |
+
$r['timeout'] = 15;
|
356 |
+
return $r;
|
357 |
+
}
|
358 |
+
|
359 |
+
function bal_http_api_curl($handle){
|
360 |
+
curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT, 15 );
|
361 |
+
curl_setopt( $handle, CURLOPT_TIMEOUT, 15 );
|
362 |
+
}
|
363 |
+
|
364 |
+
function track($data){
|
365 |
+
$response = wp_remote_post( "http://www.wpuniversity.com/wp-admin/admin-ajax.php", array(
|
366 |
+
'method' => 'POST',
|
367 |
+
'timeout' => 45,
|
368 |
+
'redirection' => 5,
|
369 |
+
'httpversion' => '1.0',
|
370 |
+
'blocking' => true,
|
371 |
+
'headers' => array(),
|
372 |
+
'body' => $data,
|
373 |
+
'cookies' => array()
|
374 |
+
)
|
375 |
+
);
|
376 |
+
}
|
377 |
+
|
378 |
+
function activate_plugin(){
|
379 |
+
update_option( 'sk_do_activation_redirect', true );
|
380 |
+
$data = array(
|
381 |
+
'source' => 'plugin',
|
382 |
+
'action' => 'track',
|
383 |
+
'type' => 'activate'
|
384 |
+
);
|
385 |
+
$this->track($data);
|
386 |
+
// $this->redirect();
|
387 |
+
}
|
388 |
+
|
389 |
+
function redirect(){
|
390 |
+
if (get_option('sk_do_activation_redirect', false)) {
|
391 |
+
delete_option('sk_do_activation_redirect');
|
392 |
+
wp_redirect("/wp-admin/admin.php?page=sidekick&firstuse");
|
393 |
+
die();
|
394 |
+
}
|
395 |
+
}
|
396 |
+
|
397 |
+
function deactivate_plugin(){
|
398 |
+
$track_data = get_option( 'sk_track_data' );
|
399 |
+
if ($track_data) {
|
400 |
+
$data = array(
|
401 |
+
'source' => 'plugin',
|
402 |
+
'action' => 'track',
|
403 |
+
'type' => 'deactivate',
|
404 |
+
'user' => get_option( "sk_license_key" )
|
405 |
+
);
|
406 |
+
$this->track($data);
|
407 |
+
?>
|
408 |
+
<script type="text/javascript">
|
409 |
+
window._gaq = window._gaq || [];
|
410 |
+
window._gaq.push(['wpu._setAccount', 'UA-39283622-1']);
|
411 |
+
|
412 |
+
(function() {
|
413 |
+
var ga_wpu = document.createElement('script'); ga_wpu.type = 'text/javascript'; ga_wpu.async = true;
|
414 |
+
ga_wpu.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
415 |
+
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga_wpu, s);
|
416 |
+
})();
|
417 |
+
window._gaq.push(['wpu._trackEvent', 'Plugin - Deactivate', '', <?php echo SK_PLUGIN_VERSION ?>, 0,true]);
|
418 |
+
</script>
|
419 |
+
<?php
|
420 |
+
}
|
421 |
+
}
|
422 |
+
}
|
423 |
+
|
424 |
+
$sidekick = new Sidekick;
|
425 |
+
if (!defined('SK_PLUGIN_DEGBUG')){
|
426 |
+
mlog('Setting up Activation Hooks');
|
427 |
+
register_activation_hook( __FILE__, array($sidekick,'activate_plugin') );
|
428 |
+
register_deactivation_hook( __FILE__, array($sidekick,'deactivate_plugin') );
|
429 |
+
}
|
430 |
+
|
431 |
+
add_filter('http_request_args', array($sidekick,'bal_http_request_args'), 100, 1);
|
432 |
+
add_action('http_api_curl', array($sidekick,'bal_http_api_curl'), 100, 1);
|
433 |
+
add_action('admin_menu', array($sidekick,'setup_menu'));
|
434 |
+
add_action('admin_init', array($sidekick,'redirect'));
|
435 |
+
|
436 |
+
if (!defined('SK_PLUGIN_DEGBUG'))
|
437 |
+
require_once('sk_init.php');
|
438 |
+
|
439 |
+
if (!(isset($_GET['tab']) && $_GET['tab'] == 'plugin-information')) {
|
440 |
+
add_action('admin_footer', array($sidekick,'footer'));
|
441 |
+
add_action('customize_controls_print_footer_scripts', array($sidekick,'footer'));
|
442 |
+
}
|
443 |
+
|
444 |
+
|
sk_init.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if (defined('SK_PLUGIN_DEGBUG')) {
|
4 |
+
mlog('PHP: Sidekick run debug class');
|
5 |
+
$sidekick = new SidekickDev;
|
6 |
+
}
|
7 |
+
|
8 |
+
if (!(isset($_GET['tab']) && $_GET['tab'] == 'plugin-information')) {
|
9 |
+
add_action('admin_enqueue_scripts', array($sidekick,'enqueue'));
|
10 |
+
add_action('admin_enqueue_scripts', array($sidekick,'enqueue_required'));
|
11 |
+
add_action('customize_controls_enqueue_scripts', array($sidekick,'enqueue'));
|
12 |
+
|
13 |
+
if (defined('SK_PLUGIN_DEGBUG')) {
|
14 |
+
add_action('admin_enqueue_scripts', array($sidekick,'enqueue_platform'));
|
15 |
+
add_action('customize_controls_enqueue_scripts', array($sidekick,'enqueue_platform'));
|
16 |
+
add_action('admin_footer', array($sidekick,'footer_dev'));
|
17 |
+
add_action('customize_controls_print_footer_scripts', array($sidekick,'footer_dev'));
|
18 |
+
}
|
19 |
+
}
|
wpu_init.php
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
mlog('WPU: PHP Init');
|
4 |
+
if (defined('WPU_PLUGIN_DEGBUG')) {
|
5 |
+
mlog('WPU: PHP Debug');
|
6 |
+
$wpu = new wpuDev;
|
7 |
+
}
|
8 |
+
|
9 |
+
if (!(isset($_GET['tab']) && $_GET['tab'] == 'plugin-information')) {
|
10 |
+
add_action('admin_enqueue_scripts', array($wpu,'enqueue'));
|
11 |
+
if (defined('WPU_PLUGIN_DEGBUG')) {
|
12 |
+
add_action('admin_footer', array($wpu,'footer_dev'));
|
13 |
+
}
|
14 |
+
}
|