Soundy Background Music - Version 1.1

Version Description

  • Corrected a few minor bugs
  • Made Soundy forms of the back-end admin section more responsive
  • Added possibility to disable Soundy for mobile devices. Set variable $disable_soundy_for_mobile to true in soundy.php file to disable Soundy for mobile devices.
Download this release

Release Info

Developer bducouedic
Plugin Icon 128x128 Soundy Background Music
Version 1.1
Comparing to
See all releases

Version 1.1

audio/danse_russe.mp3 ADDED
Binary file
audio/valse.mp3 ADDED
Binary file
css/jquery-ui-v1.10.4.css ADDED
@@ -0,0 +1,1178 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! jQuery UI - v1.10.4 - 2014-01-17
2
+ * http://jqueryui.com
3
+ * Includes: jquery.ui.core.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css, jquery.ui.theme.css
4
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
5
+ * Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
6
+
7
+ /* Layout helpers
8
+ ----------------------------------*/
9
+ .ui-helper-hidden {
10
+ display: none;
11
+ }
12
+ .ui-helper-hidden-accessible {
13
+ border: 0;
14
+ clip: rect(0 0 0 0);
15
+ height: 1px;
16
+ margin: -1px;
17
+ overflow: hidden;
18
+ padding: 0;
19
+ position: absolute;
20
+ width: 1px;
21
+ }
22
+ .ui-helper-reset {
23
+ margin: 0;
24
+ padding: 0;
25
+ border: 0;
26
+ outline: 0;
27
+ line-height: 1.3;
28
+ text-decoration: none;
29
+ font-size: 100%;
30
+ list-style: none;
31
+ }
32
+ .ui-helper-clearfix:before,
33
+ .ui-helper-clearfix:after {
34
+ content: "";
35
+ display: table;
36
+ border-collapse: collapse;
37
+ }
38
+ .ui-helper-clearfix:after {
39
+ clear: both;
40
+ }
41
+ .ui-helper-clearfix {
42
+ min-height: 0; /* support: IE7 */
43
+ }
44
+ .ui-helper-zfix {
45
+ width: 100%;
46
+ height: 100%;
47
+ top: 0;
48
+ left: 0;
49
+ position: absolute;
50
+ opacity: 0;
51
+ filter:Alpha(Opacity=0);
52
+ }
53
+
54
+ .ui-front {
55
+ z-index: 100;
56
+ }
57
+
58
+
59
+ /* Interaction Cues
60
+ ----------------------------------*/
61
+ .ui-state-disabled {
62
+ cursor: default !important;
63
+ }
64
+
65
+
66
+ /* Icons
67
+ ----------------------------------*/
68
+
69
+ /* states and images */
70
+ .ui-icon {
71
+ display: block;
72
+ text-indent: -99999px;
73
+ overflow: hidden;
74
+ background-repeat: no-repeat;
75
+ }
76
+
77
+
78
+ /* Misc visuals
79
+ ----------------------------------*/
80
+
81
+ /* Overlays */
82
+ .ui-widget-overlay {
83
+ position: fixed;
84
+ top: 0;
85
+ left: 0;
86
+ width: 100%;
87
+ height: 100%;
88
+ }
89
+ .ui-accordion .ui-accordion-header {
90
+ display: block;
91
+ cursor: pointer;
92
+ position: relative;
93
+ margin-top: 2px;
94
+ padding: .5em .5em .5em .7em;
95
+ min-height: 0; /* support: IE7 */
96
+ }
97
+ .ui-accordion .ui-accordion-icons {
98
+ padding-left: 2.2em;
99
+ }
100
+ .ui-accordion .ui-accordion-noicons {
101
+ padding-left: .7em;
102
+ }
103
+ .ui-accordion .ui-accordion-icons .ui-accordion-icons {
104
+ padding-left: 2.2em;
105
+ }
106
+ .ui-accordion .ui-accordion-header .ui-accordion-header-icon {
107
+ position: absolute;
108
+ left: .5em;
109
+ top: 50%;
110
+ margin-top: -8px;
111
+ }
112
+ .ui-accordion .ui-accordion-content {
113
+ padding: 1em 2.2em;
114
+ border-top: 0;
115
+ overflow: auto;
116
+ }
117
+ .ui-autocomplete {
118
+ position: absolute;
119
+ top: 0;
120
+ left: 0;
121
+ cursor: default;
122
+ }
123
+ .ui-button {
124
+ display: inline-block;
125
+ position: relative;
126
+ padding: 0;
127
+ line-height: normal;
128
+ margin-right: .1em;
129
+ cursor: pointer;
130
+ vertical-align: middle;
131
+ text-align: center;
132
+ overflow: visible; /* removes extra width in IE */
133
+ }
134
+ .ui-button,
135
+ .ui-button:link,
136
+ .ui-button:visited,
137
+ .ui-button:hover,
138
+ .ui-button:active {
139
+ text-decoration: none;
140
+ }
141
+ /* to make room for the icon, a width needs to be set here */
142
+ .ui-button-icon-only {
143
+ width: 2.2em;
144
+ }
145
+ /* button elements seem to need a little more width */
146
+ button.ui-button-icon-only {
147
+ width: 2.4em;
148
+ }
149
+ .ui-button-icons-only {
150
+ width: 3.4em;
151
+ }
152
+ button.ui-button-icons-only {
153
+ width: 3.7em;
154
+ }
155
+
156
+ /* button text element */
157
+ .ui-button .ui-button-text {
158
+ display: block;
159
+ line-height: normal;
160
+ }
161
+ .ui-button-text-only .ui-button-text {
162
+ padding: .4em 1em;
163
+ }
164
+ .ui-button-icon-only .ui-button-text,
165
+ .ui-button-icons-only .ui-button-text {
166
+ padding: .4em;
167
+ text-indent: -9999999px;
168
+ }
169
+ .ui-button-text-icon-primary .ui-button-text,
170
+ .ui-button-text-icons .ui-button-text {
171
+ padding: .4em 1em .4em 2.1em;
172
+ }
173
+ .ui-button-text-icon-secondary .ui-button-text,
174
+ .ui-button-text-icons .ui-button-text {
175
+ padding: .4em 2.1em .4em 1em;
176
+ }
177
+ .ui-button-text-icons .ui-button-text {
178
+ padding-left: 2.1em;
179
+ padding-right: 2.1em;
180
+ }
181
+ /* no icon support for input elements, provide padding by default */
182
+ input.ui-button {
183
+ padding: .4em 1em;
184
+ }
185
+
186
+ /* button icon element(s) */
187
+ .ui-button-icon-only .ui-icon,
188
+ .ui-button-text-icon-primary .ui-icon,
189
+ .ui-button-text-icon-secondary .ui-icon,
190
+ .ui-button-text-icons .ui-icon,
191
+ .ui-button-icons-only .ui-icon {
192
+ position: absolute;
193
+ top: 50%;
194
+ margin-top: -8px;
195
+ }
196
+ .ui-button-icon-only .ui-icon {
197
+ left: 50%;
198
+ margin-left: -8px;
199
+ }
200
+ .ui-button-text-icon-primary .ui-button-icon-primary,
201
+ .ui-button-text-icons .ui-button-icon-primary,
202
+ .ui-button-icons-only .ui-button-icon-primary {
203
+ left: .5em;
204
+ }
205
+ .ui-button-text-icon-secondary .ui-button-icon-secondary,
206
+ .ui-button-text-icons .ui-button-icon-secondary,
207
+ .ui-button-icons-only .ui-button-icon-secondary {
208
+ right: .5em;
209
+ }
210
+
211
+ /* button sets */
212
+ .ui-buttonset {
213
+ margin-right: 7px;
214
+ }
215
+ .ui-buttonset .ui-button {
216
+ margin-left: 0;
217
+ margin-right: -.3em;
218
+ }
219
+
220
+ /* workarounds */
221
+ /* reset extra padding in Firefox, see h5bp.com/l */
222
+ input.ui-button::-moz-focus-inner,
223
+ button.ui-button::-moz-focus-inner {
224
+ border: 0;
225
+ padding: 0;
226
+ }
227
+ .ui-datepicker {
228
+ width: 17em;
229
+ padding: .2em .2em 0;
230
+ display: none;
231
+ }
232
+ .ui-datepicker .ui-datepicker-header {
233
+ position: relative;
234
+ padding: .2em 0;
235
+ }
236
+ .ui-datepicker .ui-datepicker-prev,
237
+ .ui-datepicker .ui-datepicker-next {
238
+ position: absolute;
239
+ top: 2px;
240
+ width: 1.8em;
241
+ height: 1.8em;
242
+ }
243
+ .ui-datepicker .ui-datepicker-prev-hover,
244
+ .ui-datepicker .ui-datepicker-next-hover {
245
+ top: 1px;
246
+ }
247
+ .ui-datepicker .ui-datepicker-prev {
248
+ left: 2px;
249
+ }
250
+ .ui-datepicker .ui-datepicker-next {
251
+ right: 2px;
252
+ }
253
+ .ui-datepicker .ui-datepicker-prev-hover {
254
+ left: 1px;
255
+ }
256
+ .ui-datepicker .ui-datepicker-next-hover {
257
+ right: 1px;
258
+ }
259
+ .ui-datepicker .ui-datepicker-prev span,
260
+ .ui-datepicker .ui-datepicker-next span {
261
+ display: block;
262
+ position: absolute;
263
+ left: 50%;
264
+ margin-left: -8px;
265
+ top: 50%;
266
+ margin-top: -8px;
267
+ }
268
+ .ui-datepicker .ui-datepicker-title {
269
+ margin: 0 2.3em;
270
+ line-height: 1.8em;
271
+ text-align: center;
272
+ }
273
+ .ui-datepicker .ui-datepicker-title select {
274
+ font-size: 1em;
275
+ margin: 1px 0;
276
+ }
277
+ .ui-datepicker select.ui-datepicker-month,
278
+ .ui-datepicker select.ui-datepicker-year {
279
+ width: 49%;
280
+ }
281
+ .ui-datepicker table {
282
+ width: 100%;
283
+ font-size: .9em;
284
+ border-collapse: collapse;
285
+ margin: 0 0 .4em;
286
+ }
287
+ .ui-datepicker th {
288
+ padding: .7em .3em;
289
+ text-align: center;
290
+ font-weight: bold;
291
+ border: 0;
292
+ }
293
+ .ui-datepicker td {
294
+ border: 0;
295
+ padding: 1px;
296
+ }
297
+ .ui-datepicker td span,
298
+ .ui-datepicker td a {
299
+ display: block;
300
+ padding: .2em;
301
+ text-align: right;
302
+ text-decoration: none;
303
+ }
304
+ .ui-datepicker .ui-datepicker-buttonpane {
305
+ background-image: none;
306
+ margin: .7em 0 0 0;
307
+ padding: 0 .2em;
308
+ border-left: 0;
309
+ border-right: 0;
310
+ border-bottom: 0;
311
+ }
312
+ .ui-datepicker .ui-datepicker-buttonpane button {
313
+ float: right;
314
+ margin: .5em .2em .4em;
315
+ cursor: pointer;
316
+ padding: .2em .6em .3em .6em;
317
+ width: auto;
318
+ overflow: visible;
319
+ }
320
+ .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
321
+ float: left;
322
+ }
323
+
324
+ /* with multiple calendars */
325
+ .ui-datepicker.ui-datepicker-multi {
326
+ width: auto;
327
+ }
328
+ .ui-datepicker-multi .ui-datepicker-group {
329
+ float: left;
330
+ }
331
+ .ui-datepicker-multi .ui-datepicker-group table {
332
+ width: 95%;
333
+ margin: 0 auto .4em;
334
+ }
335
+ .ui-datepicker-multi-2 .ui-datepicker-group {
336
+ width: 50%;
337
+ }
338
+ .ui-datepicker-multi-3 .ui-datepicker-group {
339
+ width: 33.3%;
340
+ }
341
+ .ui-datepicker-multi-4 .ui-datepicker-group {
342
+ width: 25%;
343
+ }
344
+ .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
345
+ .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
346
+ border-left-width: 0;
347
+ }
348
+ .ui-datepicker-multi .ui-datepicker-buttonpane {
349
+ clear: left;
350
+ }
351
+ .ui-datepicker-row-break {
352
+ clear: both;
353
+ width: 100%;
354
+ font-size: 0;
355
+ }
356
+
357
+ /* RTL support */
358
+ .ui-datepicker-rtl {
359
+ direction: rtl;
360
+ }
361
+ .ui-datepicker-rtl .ui-datepicker-prev {
362
+ right: 2px;
363
+ left: auto;
364
+ }
365
+ .ui-datepicker-rtl .ui-datepicker-next {
366
+ left: 2px;
367
+ right: auto;
368
+ }
369
+ .ui-datepicker-rtl .ui-datepicker-prev:hover {
370
+ right: 1px;
371
+ left: auto;
372
+ }
373
+ .ui-datepicker-rtl .ui-datepicker-next:hover {
374
+ left: 1px;
375
+ right: auto;
376
+ }
377
+ .ui-datepicker-rtl .ui-datepicker-buttonpane {
378
+ clear: right;
379
+ }
380
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button {
381
+ float: left;
382
+ }
383
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
384
+ .ui-datepicker-rtl .ui-datepicker-group {
385
+ float: right;
386
+ }
387
+ .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
388
+ .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
389
+ border-right-width: 0;
390
+ border-left-width: 1px;
391
+ }
392
+ .ui-dialog {
393
+ overflow: hidden;
394
+ position: absolute;
395
+ top: 0;
396
+ left: 0;
397
+ padding: .2em;
398
+ outline: 0;
399
+ }
400
+ .ui-dialog .ui-dialog-titlebar {
401
+ padding: .4em 1em;
402
+ position: relative;
403
+ }
404
+ .ui-dialog .ui-dialog-title {
405
+ float: left;
406
+ margin: .1em 0;
407
+ white-space: nowrap;
408
+ width: 90%;
409
+ overflow: hidden;
410
+ text-overflow: ellipsis;
411
+ }
412
+ .ui-dialog .ui-dialog-titlebar-close {
413
+ position: absolute;
414
+ right: .3em;
415
+ top: 50%;
416
+ width: 20px;
417
+ margin: -10px 0 0 0;
418
+ padding: 1px;
419
+ height: 20px;
420
+ }
421
+ .ui-dialog .ui-dialog-content {
422
+ position: relative;
423
+ border: 0;
424
+ padding: .5em 1em;
425
+ background: none;
426
+ overflow: auto;
427
+ }
428
+ .ui-dialog .ui-dialog-buttonpane {
429
+ text-align: left;
430
+ border-width: 1px 0 0 0;
431
+ background-image: none;
432
+ margin-top: .5em;
433
+ padding: .3em 1em .5em .4em;
434
+ }
435
+ .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
436
+ float: right;
437
+ }
438
+ .ui-dialog .ui-dialog-buttonpane button {
439
+ margin: .5em .4em .5em 0;
440
+ cursor: pointer;
441
+ }
442
+ .ui-dialog .ui-resizable-se {
443
+ width: 12px;
444
+ height: 12px;
445
+ right: -5px;
446
+ bottom: -5px;
447
+ background-position: 16px 16px;
448
+ }
449
+ .ui-draggable .ui-dialog-titlebar {
450
+ cursor: move;
451
+ }
452
+ .ui-menu {
453
+ list-style: none;
454
+ padding: 2px;
455
+ margin: 0;
456
+ display: block;
457
+ outline: none;
458
+ }
459
+ .ui-menu .ui-menu {
460
+ margin-top: -3px;
461
+ position: absolute;
462
+ }
463
+ .ui-menu .ui-menu-item {
464
+ margin: 0;
465
+ padding: 0;
466
+ width: 100%;
467
+ /* support: IE10, see #8844 */
468
+ list-style-image: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);
469
+ }
470
+ .ui-menu .ui-menu-divider {
471
+ margin: 5px -2px 5px -2px;
472
+ height: 0;
473
+ font-size: 0;
474
+ line-height: 0;
475
+ border-width: 1px 0 0 0;
476
+ }
477
+ .ui-menu .ui-menu-item a {
478
+ text-decoration: none;
479
+ display: block;
480
+ padding: 2px .4em;
481
+ line-height: 1.5;
482
+ min-height: 0; /* support: IE7 */
483
+ font-weight: normal;
484
+ }
485
+ .ui-menu .ui-menu-item a.ui-state-focus,
486
+ .ui-menu .ui-menu-item a.ui-state-active {
487
+ font-weight: normal;
488
+ margin: -1px;
489
+ }
490
+
491
+ .ui-menu .ui-state-disabled {
492
+ font-weight: normal;
493
+ margin: .4em 0 .2em;
494
+ line-height: 1.5;
495
+ }
496
+ .ui-menu .ui-state-disabled a {
497
+ cursor: default;
498
+ }
499
+
500
+ /* icon support */
501
+ .ui-menu-icons {
502
+ position: relative;
503
+ }
504
+ .ui-menu-icons .ui-menu-item a {
505
+ position: relative;
506
+ padding-left: 2em;
507
+ }
508
+
509
+ /* left-aligned */
510
+ .ui-menu .ui-icon {
511
+ position: absolute;
512
+ top: .2em;
513
+ left: .2em;
514
+ }
515
+
516
+ /* right-aligned */
517
+ .ui-menu .ui-menu-icon {
518
+ position: static;
519
+ float: right;
520
+ }
521
+ .ui-progressbar {
522
+ height: 2em;
523
+ text-align: left;
524
+ overflow: hidden;
525
+ }
526
+ .ui-progressbar .ui-progressbar-value {
527
+ margin: -1px;
528
+ height: 100%;
529
+ }
530
+ .ui-progressbar .ui-progressbar-overlay {
531
+ background: url("images/animated-overlay.gif");
532
+ height: 100%;
533
+ filter: alpha(opacity=25);
534
+ opacity: 0.25;
535
+ }
536
+ .ui-progressbar-indeterminate .ui-progressbar-value {
537
+ background-image: none;
538
+ }
539
+ .ui-resizable {
540
+ position: relative;
541
+ }
542
+ .ui-resizable-handle {
543
+ position: absolute;
544
+ font-size: 0.1px;
545
+ display: block;
546
+ }
547
+ .ui-resizable-disabled .ui-resizable-handle,
548
+ .ui-resizable-autohide .ui-resizable-handle {
549
+ display: none;
550
+ }
551
+ .ui-resizable-n {
552
+ cursor: n-resize;
553
+ height: 7px;
554
+ width: 100%;
555
+ top: -5px;
556
+ left: 0;
557
+ }
558
+ .ui-resizable-s {
559
+ cursor: s-resize;
560
+ height: 7px;
561
+ width: 100%;
562
+ bottom: -5px;
563
+ left: 0;
564
+ }
565
+ .ui-resizable-e {
566
+ cursor: e-resize;
567
+ width: 7px;
568
+ right: -5px;
569
+ top: 0;
570
+ height: 100%;
571
+ }
572
+ .ui-resizable-w {
573
+ cursor: w-resize;
574
+ width: 7px;
575
+ left: -5px;
576
+ top: 0;
577
+ height: 100%;
578
+ }
579
+ .ui-resizable-se {
580
+ cursor: se-resize;
581
+ width: 12px;
582
+ height: 12px;
583
+ right: 1px;
584
+ bottom: 1px;
585
+ }
586
+ .ui-resizable-sw {
587
+ cursor: sw-resize;
588
+ width: 9px;
589
+ height: 9px;
590
+ left: -5px;
591
+ bottom: -5px;
592
+ }
593
+ .ui-resizable-nw {
594
+ cursor: nw-resize;
595
+ width: 9px;
596
+ height: 9px;
597
+ left: -5px;
598
+ top: -5px;
599
+ }
600
+ .ui-resizable-ne {
601
+ cursor: ne-resize;
602
+ width: 9px;
603
+ height: 9px;
604
+ right: -5px;
605
+ top: -5px;
606
+ }
607
+ .ui-selectable-helper {
608
+ position: absolute;
609
+ z-index: 100;
610
+ border: 1px dotted black;
611
+ }
612
+ .ui-slider {
613
+ position: relative;
614
+ text-align: left;
615
+ }
616
+ .ui-slider .ui-slider-handle {
617
+ position: absolute;
618
+ z-index: 2;
619
+ width: 1.2em;
620
+ height: 1.2em;
621
+ cursor: default;
622
+ }
623
+ .ui-slider .ui-slider-range {
624
+ position: absolute;
625
+ z-index: 1;
626
+ font-size: .7em;
627
+ display: block;
628
+ border: 0;
629
+ background-position: 0 0;
630
+ }
631
+
632
+ /* For IE8 - See #6727 */
633
+ .ui-slider.ui-state-disabled .ui-slider-handle,
634
+ .ui-slider.ui-state-disabled .ui-slider-range {
635
+ filter: inherit;
636
+ }
637
+
638
+ .ui-slider-horizontal {
639
+ height: .8em;
640
+ }
641
+ .ui-slider-horizontal .ui-slider-handle {
642
+ top: -.3em;
643
+ margin-left: -.6em;
644
+ }
645
+ .ui-slider-horizontal .ui-slider-range {
646
+ top: 0;
647
+ height: 100%;
648
+ }
649
+ .ui-slider-horizontal .ui-slider-range-min {
650
+ left: 0;
651
+ }
652
+ .ui-slider-horizontal .ui-slider-range-max {
653
+ right: 0;
654
+ }
655
+
656
+ .ui-slider-vertical {
657
+ width: .8em;
658
+ height: 100px;
659
+ }
660
+ .ui-slider-vertical .ui-slider-handle {
661
+ left: -.3em;
662
+ margin-left: 0;
663
+ margin-bottom: -.6em;
664
+ }
665
+ .ui-slider-vertical .ui-slider-range {
666
+ left: 0;
667
+ width: 100%;
668
+ }
669
+ .ui-slider-vertical .ui-slider-range-min {
670
+ bottom: 0;
671
+ }
672
+ .ui-slider-vertical .ui-slider-range-max {
673
+ top: 0;
674
+ }
675
+ .ui-spinner {
676
+ position: relative;
677
+ display: inline-block;
678
+ overflow: hidden;
679
+ padding: 0;
680
+ vertical-align: middle;
681
+ }
682
+ .ui-spinner-input {
683
+ border: none;
684
+ background: none;
685
+ color: inherit;
686
+ padding: 0;
687
+ margin: .2em 0;
688
+ vertical-align: middle;
689
+ margin-left: .4em;
690
+ margin-right: 22px;
691
+ }
692
+ .ui-spinner-button {
693
+ width: 16px;
694
+ height: 50%;
695
+ font-size: .5em;
696
+ padding: 0;
697
+ margin: 0;
698
+ text-align: center;
699
+ position: absolute;
700
+ cursor: default;
701
+ display: block;
702
+ overflow: hidden;
703
+ right: 0;
704
+ }
705
+ /* more specificity required here to override default borders */
706
+ .ui-spinner a.ui-spinner-button {
707
+ border-top: none;
708
+ border-bottom: none;
709
+ border-right: none;
710
+ }
711
+ /* vertically center icon */
712
+ .ui-spinner .ui-icon {
713
+ position: absolute;
714
+ margin-top: -8px;
715
+ top: 50%;
716
+ left: 0;
717
+ }
718
+ .ui-spinner-up {
719
+ top: 0;
720
+ }
721
+ .ui-spinner-down {
722
+ bottom: 0;
723
+ }
724
+
725
+ /* TR overrides */
726
+ .ui-spinner .ui-icon-triangle-1-s {
727
+ /* need to fix icons sprite */
728
+ background-position: -65px -16px;
729
+ }
730
+ .ui-tabs {
731
+ position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
732
+ padding: .2em;
733
+ }
734
+ .ui-tabs .ui-tabs-nav {
735
+ margin: 0;
736
+ padding: .2em .2em 0;
737
+ }
738
+ .ui-tabs .ui-tabs-nav li {
739
+ list-style: none;
740
+ float: left;
741
+ position: relative;
742
+ top: 0;
743
+ margin: 1px .2em 0 0;
744
+ border-bottom-width: 0;
745
+ padding: 0;
746
+ white-space: nowrap;
747
+ }
748
+ .ui-tabs .ui-tabs-nav .ui-tabs-anchor {
749
+ float: left;
750
+ padding: .5em 1em;
751
+ text-decoration: none;
752
+ }
753
+ .ui-tabs .ui-tabs-nav li.ui-tabs-active {
754
+ margin-bottom: -1px;
755
+ padding-bottom: 1px;
756
+ }
757
+ .ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,
758
+ .ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,
759
+ .ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor {
760
+ cursor: text;
761
+ }
762
+ .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor {
763
+ cursor: pointer;
764
+ }
765
+ .ui-tabs .ui-tabs-panel {
766
+ display: block;
767
+ border-width: 0;
768
+ padding: 1em 1.4em;
769
+ background: none;
770
+ }
771
+ .ui-tooltip {
772
+ padding: 8px;
773
+ position: absolute;
774
+ z-index: 9999;
775
+ max-width: 300px;
776
+ -webkit-box-shadow: 0 0 5px #aaa;
777
+ box-shadow: 0 0 5px #aaa;
778
+ }
779
+ body .ui-tooltip {
780
+ border-width: 2px;
781
+ }
782
+
783
+ /* Component containers
784
+ ----------------------------------*/
785
+ .ui-widget {
786
+ font-family: Verdana,Arial,sans-serif;
787
+ font-size: 1.1em;
788
+ }
789
+ .ui-widget .ui-widget {
790
+ font-size: 1em;
791
+ }
792
+ .ui-widget input,
793
+ .ui-widget select,
794
+ .ui-widget textarea,
795
+ .ui-widget button {
796
+ font-family: Verdana,Arial,sans-serif;
797
+ font-size: 1em;
798
+ }
799
+ .ui-widget-content {
800
+ border: 1px solid #aaaaaa;
801
+ background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;
802
+ color: #222222;
803
+ }
804
+ .ui-widget-content a {
805
+ color: #222222;
806
+ }
807
+ .ui-widget-header {
808
+ border: 1px solid #aaaaaa;
809
+ background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;
810
+ color: #222222;
811
+ font-weight: bold;
812
+ }
813
+ .ui-widget-header a {
814
+ color: #222222;
815
+ }
816
+
817
+ /* Interaction states
818
+ ----------------------------------*/
819
+ .ui-state-default,
820
+ .ui-widget-content .ui-state-default,
821
+ .ui-widget-header .ui-state-default {
822
+ border: 1px solid #d3d3d3;
823
+ background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;
824
+ font-weight: normal;
825
+ color: #555555;
826
+ }
827
+ .ui-state-default a,
828
+ .ui-state-default a:link,
829
+ .ui-state-default a:visited {
830
+ color: #555555;
831
+ text-decoration: none;
832
+ }
833
+ .ui-state-hover,
834
+ .ui-widget-content .ui-state-hover,
835
+ .ui-widget-header .ui-state-hover,
836
+ .ui-state-focus,
837
+ .ui-widget-content .ui-state-focus,
838
+ .ui-widget-header .ui-state-focus {
839
+ border: 1px solid #999999;
840
+ background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;
841
+ font-weight: normal;
842
+ color: #212121;
843
+ }
844
+ .ui-state-hover a,
845
+ .ui-state-hover a:hover,
846
+ .ui-state-hover a:link,
847
+ .ui-state-hover a:visited,
848
+ .ui-state-focus a,
849
+ .ui-state-focus a:hover,
850
+ .ui-state-focus a:link,
851
+ .ui-state-focus a:visited {
852
+ color: #212121;
853
+ text-decoration: none;
854
+ }
855
+ .ui-state-active,
856
+ .ui-widget-content .ui-state-active,
857
+ .ui-widget-header .ui-state-active {
858
+ border: 1px solid #aaaaaa;
859
+ background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;
860
+ font-weight: normal;
861
+ color: #212121;
862
+ }
863
+ .ui-state-active a,
864
+ .ui-state-active a:link,
865
+ .ui-state-active a:visited {
866
+ color: #212121;
867
+ text-decoration: none;
868
+ }
869
+
870
+ /* Interaction Cues
871
+ ----------------------------------*/
872
+ .ui-state-highlight,
873
+ .ui-widget-content .ui-state-highlight,
874
+ .ui-widget-header .ui-state-highlight {
875
+ border: 1px solid #fcefa1;
876
+ background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;
877
+ color: #363636;
878
+ }
879
+ .ui-state-highlight a,
880
+ .ui-widget-content .ui-state-highlight a,
881
+ .ui-widget-header .ui-state-highlight a {
882
+ color: #363636;
883
+ }
884
+ .ui-state-error,
885
+ .ui-widget-content .ui-state-error,
886
+ .ui-widget-header .ui-state-error {
887
+ border: 1px solid #cd0a0a;
888
+ background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;
889
+ color: #cd0a0a;
890
+ }
891
+ .ui-state-error a,
892
+ .ui-widget-content .ui-state-error a,
893
+ .ui-widget-header .ui-state-error a {
894
+ color: #cd0a0a;
895
+ }
896
+ .ui-state-error-text,
897
+ .ui-widget-content .ui-state-error-text,
898
+ .ui-widget-header .ui-state-error-text {
899
+ color: #cd0a0a;
900
+ }
901
+ .ui-priority-primary,
902
+ .ui-widget-content .ui-priority-primary,
903
+ .ui-widget-header .ui-priority-primary {
904
+ font-weight: bold;
905
+ }
906
+ .ui-priority-secondary,
907
+ .ui-widget-content .ui-priority-secondary,
908
+ .ui-widget-header .ui-priority-secondary {
909
+ opacity: .7;
910
+ filter:Alpha(Opacity=70);
911
+ font-weight: normal;
912
+ }
913
+ .ui-state-disabled,
914
+ .ui-widget-content .ui-state-disabled,
915
+ .ui-widget-header .ui-state-disabled {
916
+ opacity: .35;
917
+ filter:Alpha(Opacity=35);
918
+ background-image: none;
919
+ }
920
+ .ui-state-disabled .ui-icon {
921
+ filter:Alpha(Opacity=35); /* For IE8 - See #6059 */
922
+ }
923
+
924
+ /* Icons
925
+ ----------------------------------*/
926
+
927
+ /* states and images */
928
+ .ui-icon {
929
+ width: 16px;
930
+ height: 16px;
931
+ }
932
+ .ui-icon,
933
+ .ui-widget-content .ui-icon {
934
+ background-image: url(images/ui-icons_222222_256x240.png);
935
+ }
936
+ .ui-widget-header .ui-icon {
937
+ background-image: url(images/ui-icons_222222_256x240.png);
938
+ }
939
+ .ui-state-default .ui-icon {
940
+ background-image: url(images/ui-icons_888888_256x240.png);
941
+ }
942
+ .ui-state-hover .ui-icon,
943
+ .ui-state-focus .ui-icon {
944
+ background-image: url(images/ui-icons_454545_256x240.png);
945
+ }
946
+ .ui-state-active .ui-icon {
947
+ background-image: url(images/ui-icons_454545_256x240.png);
948
+ }
949
+ .ui-state-highlight .ui-icon {
950
+ background-image: url(images/ui-icons_2e83ff_256x240.png);
951
+ }
952
+ .ui-state-error .ui-icon,
953
+ .ui-state-error-text .ui-icon {
954
+ background-image: url(images/ui-icons_cd0a0a_256x240.png);
955
+ }
956
+
957
+ /* positioning */
958
+ .ui-icon-blank { background-position: 16px 16px; }
959
+ .ui-icon-carat-1-n { background-position: 0 0; }
960
+ .ui-icon-carat-1-ne { background-position: -16px 0; }
961
+ .ui-icon-carat-1-e { background-position: -32px 0; }
962
+ .ui-icon-carat-1-se { background-position: -48px 0; }
963
+ .ui-icon-carat-1-s { background-position: -64px 0; }
964
+ .ui-icon-carat-1-sw { background-position: -80px 0; }
965
+ .ui-icon-carat-1-w { background-position: -96px 0; }
966
+ .ui-icon-carat-1-nw { background-position: -112px 0; }
967
+ .ui-icon-carat-2-n-s { background-position: -128px 0; }
968
+ .ui-icon-carat-2-e-w { background-position: -144px 0; }
969
+ .ui-icon-triangle-1-n { background-position: 0 -16px; }
970
+ .ui-icon-triangle-1-ne { background-position: -16px -16px; }
971
+ .ui-icon-triangle-1-e { background-position: -32px -16px; }
972
+ .ui-icon-triangle-1-se { background-position: -48px -16px; }
973
+ .ui-icon-triangle-1-s { background-position: -64px -16px; }
974
+ .ui-icon-triangle-1-sw { background-position: -80px -16px; }
975
+ .ui-icon-triangle-1-w { background-position: -96px -16px; }
976
+ .ui-icon-triangle-1-nw { background-position: -112px -16px; }
977
+ .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
978
+ .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
979
+ .ui-icon-arrow-1-n { background-position: 0 -32px; }
980
+ .ui-icon-arrow-1-ne { background-position: -16px -32px; }
981
+ .ui-icon-arrow-1-e { background-position: -32px -32px; }
982
+ .ui-icon-arrow-1-se { background-position: -48px -32px; }
983
+ .ui-icon-arrow-1-s { background-position: -64px -32px; }
984
+ .ui-icon-arrow-1-sw { background-position: -80px -32px; }
985
+ .ui-icon-arrow-1-w { background-position: -96px -32px; }
986
+ .ui-icon-arrow-1-nw { background-position: -112px -32px; }
987
+ .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
988
+ .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
989
+ .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
990
+ .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
991
+ .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
992
+ .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
993
+ .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
994
+ .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
995
+ .ui-icon-arrowthick-1-n { background-position: 0 -48px; }
996
+ .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
997
+ .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
998
+ .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
999
+ .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
1000
+ .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
1001
+ .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
1002
+ .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
1003
+ .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
1004
+ .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
1005
+ .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
1006
+ .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
1007
+ .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
1008
+ .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
1009
+ .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
1010
+ .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
1011
+ .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
1012
+ .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
1013
+ .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
1014
+ .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
1015
+ .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
1016
+ .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
1017
+ .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
1018
+ .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
1019
+ .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
1020
+ .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
1021
+ .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
1022
+ .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
1023
+ .ui-icon-arrow-4 { background-position: 0 -80px; }
1024
+ .ui-icon-arrow-4-diag { background-position: -16px -80px; }
1025
+ .ui-icon-extlink { background-position: -32px -80px; }
1026
+ .ui-icon-newwin { background-position: -48px -80px; }
1027
+ .ui-icon-refresh { background-position: -64px -80px; }
1028
+ .ui-icon-shuffle { background-position: -80px -80px; }
1029
+ .ui-icon-transfer-e-w { background-position: -96px -80px; }
1030
+ .ui-icon-transferthick-e-w { background-position: -112px -80px; }
1031
+ .ui-icon-folder-collapsed { background-position: 0 -96px; }
1032
+ .ui-icon-folder-open { background-position: -16px -96px; }
1033
+ .ui-icon-document { background-position: -32px -96px; }
1034
+ .ui-icon-document-b { background-position: -48px -96px; }
1035
+ .ui-icon-note { background-position: -64px -96px; }
1036
+ .ui-icon-mail-closed { background-position: -80px -96px; }
1037
+ .ui-icon-mail-open { background-position: -96px -96px; }
1038
+ .ui-icon-suitcase { background-position: -112px -96px; }
1039
+ .ui-icon-comment { background-position: -128px -96px; }
1040
+ .ui-icon-person { background-position: -144px -96px; }
1041
+ .ui-icon-print { background-position: -160px -96px; }
1042
+ .ui-icon-trash { background-position: -176px -96px; }
1043
+ .ui-icon-locked { background-position: -192px -96px; }
1044
+ .ui-icon-unlocked { background-position: -208px -96px; }
1045
+ .ui-icon-bookmark { background-position: -224px -96px; }
1046
+ .ui-icon-tag { background-position: -240px -96px; }
1047
+ .ui-icon-home { background-position: 0 -112px; }
1048
+ .ui-icon-flag { background-position: -16px -112px; }
1049
+ .ui-icon-calendar { background-position: -32px -112px; }
1050
+ .ui-icon-cart { background-position: -48px -112px; }
1051
+ .ui-icon-pencil { background-position: -64px -112px; }
1052
+ .ui-icon-clock { background-position: -80px -112px; }
1053
+ .ui-icon-disk { background-position: -96px -112px; }
1054
+ .ui-icon-calculator { background-position: -112px -112px; }
1055
+ .ui-icon-zoomin { background-position: -128px -112px; }
1056
+ .ui-icon-zoomout { background-position: -144px -112px; }
1057
+ .ui-icon-search { background-position: -160px -112px; }
1058
+ .ui-icon-wrench { background-position: -176px -112px; }
1059
+ .ui-icon-gear { background-position: -192px -112px; }
1060
+ .ui-icon-heart { background-position: -208px -112px; }
1061
+ .ui-icon-star { background-position: -224px -112px; }
1062
+ .ui-icon-link { background-position: -240px -112px; }
1063
+ .ui-icon-cancel { background-position: 0 -128px; }
1064
+ .ui-icon-plus { background-position: -16px -128px; }
1065
+ .ui-icon-plusthick { background-position: -32px -128px; }
1066
+ .ui-icon-minus { background-position: -48px -128px; }
1067
+ .ui-icon-minusthick { background-position: -64px -128px; }
1068
+ .ui-icon-close { background-position: -80px -128px; }
1069
+ .ui-icon-closethick { background-position: -96px -128px; }
1070
+ .ui-icon-key { background-position: -112px -128px; }
1071
+ .ui-icon-lightbulb { background-position: -128px -128px; }
1072
+ .ui-icon-scissors { background-position: -144px -128px; }
1073
+ .ui-icon-clipboard { background-position: -160px -128px; }
1074
+ .ui-icon-copy { background-position: -176px -128px; }
1075
+ .ui-icon-contact { background-position: -192px -128px; }
1076
+ .ui-icon-image { background-position: -208px -128px; }
1077
+ .ui-icon-video { background-position: -224px -128px; }
1078
+ .ui-icon-script { background-position: -240px -128px; }
1079
+ .ui-icon-alert { background-position: 0 -144px; }
1080
+ .ui-icon-info { background-position: -16px -144px; }
1081
+ .ui-icon-notice { background-position: -32px -144px; }
1082
+ .ui-icon-help { background-position: -48px -144px; }
1083
+ .ui-icon-check { background-position: -64px -144px; }
1084
+ .ui-icon-bullet { background-position: -80px -144px; }
1085
+ .ui-icon-radio-on { background-position: -96px -144px; }
1086
+ .ui-icon-radio-off { background-position: -112px -144px; }
1087
+ .ui-icon-pin-w { background-position: -128px -144px; }
1088
+ .ui-icon-pin-s { background-position: -144px -144px; }
1089
+ .ui-icon-play { background-position: 0 -160px; }
1090
+ .ui-icon-pause { background-position: -16px -160px; }
1091
+ .ui-icon-seek-next { background-position: -32px -160px; }
1092
+ .ui-icon-seek-prev { background-position: -48px -160px; }
1093
+ .ui-icon-seek-end { background-position: -64px -160px; }
1094
+ .ui-icon-seek-start { background-position: -80px -160px; }
1095
+ /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
1096
+ .ui-icon-seek-first { background-position: -80px -160px; }
1097
+ .ui-icon-stop { background-position: -96px -160px; }
1098
+ .ui-icon-eject { background-position: -112px -160px; }
1099
+ .ui-icon-volume-off { background-position: -128px -160px; }
1100
+ .ui-icon-volume-on { background-position: -144px -160px; }
1101
+ .ui-icon-power { background-position: 0 -176px; }
1102
+ .ui-icon-signal-diag { background-position: -16px -176px; }
1103
+ .ui-icon-signal { background-position: -32px -176px; }
1104
+ .ui-icon-battery-0 { background-position: -48px -176px; }
1105
+ .ui-icon-battery-1 { background-position: -64px -176px; }
1106
+ .ui-icon-battery-2 { background-position: -80px -176px; }
1107
+ .ui-icon-battery-3 { background-position: -96px -176px; }
1108
+ .ui-icon-circle-plus { background-position: 0 -192px; }
1109
+ .ui-icon-circle-minus { background-position: -16px -192px; }
1110
+ .ui-icon-circle-close { background-position: -32px -192px; }
1111
+ .ui-icon-circle-triangle-e { background-position: -48px -192px; }
1112
+ .ui-icon-circle-triangle-s { background-position: -64px -192px; }
1113
+ .ui-icon-circle-triangle-w { background-position: -80px -192px; }
1114
+ .ui-icon-circle-triangle-n { background-position: -96px -192px; }
1115
+ .ui-icon-circle-arrow-e { background-position: -112px -192px; }
1116
+ .ui-icon-circle-arrow-s { background-position: -128px -192px; }
1117
+ .ui-icon-circle-arrow-w { background-position: -144px -192px; }
1118
+ .ui-icon-circle-arrow-n { background-position: -160px -192px; }
1119
+ .ui-icon-circle-zoomin { background-position: -176px -192px; }
1120
+ .ui-icon-circle-zoomout { background-position: -192px -192px; }
1121
+ .ui-icon-circle-check { background-position: -208px -192px; }
1122
+ .ui-icon-circlesmall-plus { background-position: 0 -208px; }
1123
+ .ui-icon-circlesmall-minus { background-position: -16px -208px; }
1124
+ .ui-icon-circlesmall-close { background-position: -32px -208px; }
1125
+ .ui-icon-squaresmall-plus { background-position: -48px -208px; }
1126
+ .ui-icon-squaresmall-minus { background-position: -64px -208px; }
1127
+ .ui-icon-squaresmall-close { background-position: -80px -208px; }
1128
+ .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
1129
+ .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
1130
+ .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
1131
+ .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
1132
+ .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
1133
+ .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
1134
+
1135
+
1136
+ /* Misc visuals
1137
+ ----------------------------------*/
1138
+
1139
+ /* Corner radius */
1140
+ .ui-corner-all,
1141
+ .ui-corner-top,
1142
+ .ui-corner-left,
1143
+ .ui-corner-tl {
1144
+ border-top-left-radius: 4px;
1145
+ }
1146
+ .ui-corner-all,
1147
+ .ui-corner-top,
1148
+ .ui-corner-right,
1149
+ .ui-corner-tr {
1150
+ border-top-right-radius: 4px;
1151
+ }
1152
+ .ui-corner-all,
1153
+ .ui-corner-bottom,
1154
+ .ui-corner-left,
1155
+ .ui-corner-bl {
1156
+ border-bottom-left-radius: 4px;
1157
+ }
1158
+ .ui-corner-all,
1159
+ .ui-corner-bottom,
1160
+ .ui-corner-right,
1161
+ .ui-corner-br {
1162
+ border-bottom-right-radius: 4px;
1163
+ }
1164
+
1165
+ /* Overlays */
1166
+ .ui-widget-overlay {
1167
+ background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
1168
+ opacity: .3;
1169
+ filter: Alpha(Opacity=30);
1170
+ }
1171
+ .ui-widget-shadow {
1172
+ margin: -8px 0 0 -8px;
1173
+ padding: 8px;
1174
+ background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
1175
+ opacity: .3;
1176
+ filter: Alpha(Opacity=30);
1177
+ border-radius: 8px;
1178
+ }
css/style-back-end.css ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ table.war_soundy th {
2
+ width: 25% !important;
3
+ vertical-align: top !important;
4
+ text-align: left !important;
5
+ }
6
+
7
+ input[type=button].war_soundy {
8
+ height: 30px !important;
9
+ line-height: 28px !important;
10
+ padding: 0 12px 2px !important;
11
+ color: #ffffff !important;
12
+ background-color: #2eaecc !important;
13
+ border-radius: 3px !important;
14
+ border: #0074a2 1px solid !important;
15
+ cursor: pointer !important;
16
+ }
17
+
18
+ audio.war_soundy,
19
+ img.war_soundy {
20
+ margin: 8px 0 0 2px !important;
21
+ }
22
+
23
+ table.war_soundy_no_border,
24
+ table.war_soundy_no_border th,
25
+ table.war_soundy_no_border td {
26
+ border: 0px solid red !important;
27
+ margin: 0 !important;
28
+ padding: 0 !important;
29
+ }
30
+
31
+
32
+ @media only screen and (max-width: 480px) {
33
+ .war_soundy_url_input {
34
+ width: 260px;
35
+ }
36
+
37
+ .war_soundy_url_input_metabox {
38
+ width: 180px;
39
+ }
40
+
41
+ .war_soundy_audio_title_input {
42
+ width: 300px;
43
+ }
44
+
45
+ .war_soundy_audio_title_input_metabox {
46
+ width: 220px;
47
+ }
48
+ }
49
+
50
+ @media only screen and (min-width: 481px) and (max-width: 768px) {
51
+ .war_soundy_url_input {
52
+ width: 340px;
53
+ }
54
+
55
+ .war_soundy_url_input_metabox {
56
+ width: 200px;
57
+ }
58
+
59
+ .war_soundy_audio_title_input {
60
+ width: 360px;
61
+ }
62
+
63
+ .war_soundy_audio_title_input_metabox {
64
+ width: 300px;
65
+ }
66
+ }
67
+
68
+ @media only screen and (min-width: 769px) and (max-width: 1024px) {
69
+ .war_soundy_url_input {
70
+ width: 500px;
71
+ }
72
+
73
+ .war_soundy_url_input_metabox {
74
+ width: 280px;
75
+ }
76
+
77
+ .war_soundy_audio_title_input {
78
+ width: 600px;
79
+ }
80
+
81
+ .war_soundy_audio_title_input_metabox {
82
+ width: 400px;
83
+ }
84
+ }
85
+
86
+ @media only screen and (min-width: 1025px) {
87
+ .war_soundy_url_input {
88
+ width: 800px;
89
+ }
90
+
91
+ .war_soundy_url_input_metabox {
92
+ width: 600px;
93
+ }
94
+
95
+ .war_soundy_audio_title_input {
96
+ width: 760px;
97
+ }
98
+
99
+ .war_soundy_audio_title_input_metabox {
100
+ width: 700px;
101
+ }
102
+ }
css/style-front-end.css ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ #war_soundy_audio_control {
2
+ border: red 0px solid !important;
3
+ border-radius: 0px !important;
4
+ box-shadow: none !important;
5
+ }
images/buttons/24x24/pause-square-blue.png ADDED
Binary file
images/buttons/24x24/pause-square-grey.png ADDED
Binary file
images/buttons/24x24/play-square-blue.png ADDED
Binary file
images/buttons/24x24/play-square-grey.png ADDED
Binary file
images/buttons/32x32/pause-square-blue.png ADDED
Binary file
images/buttons/32x32/pause-square-grey.png ADDED
Binary file
images/buttons/32x32/play-square-blue.png ADDED
Binary file
images/buttons/32x32/play-square-grey.png ADDED
Binary file
images/buttons/48x48/pause-square-blue.png ADDED
Binary file
images/buttons/48x48/pause-square-grey.png ADDED
Binary file
images/buttons/48x48/play-square-blue.png ADDED
Binary file
images/buttons/48x48/play-square-grey.png ADDED
Binary file
images/buttons/64x64/pause-square-blue.png ADDED
Binary file
images/buttons/64x64/pause-square-grey.png ADDED
Binary file
images/buttons/64x64/play-square-blue.png ADDED
Binary file
images/buttons/64x64/play-square-grey.png ADDED
Binary file
js/back-end.js ADDED
@@ -0,0 +1,169 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function war_setDefaultButtonURL( button_type, url )
2
+ {
3
+ jQuery( '#war_soundy_url_' + button_type ).val( url );
4
+ jQuery( '#war_soundy_url_' + button_type + '_img' ).attr( 'src', url );
5
+
6
+ switch( button_type )
7
+ {
8
+ case 'play_button':
9
+ var button_name = 'Play Button';
10
+ break;
11
+ case 'play_hover':
12
+ var button_name = 'Play Hover';
13
+ break;
14
+ case 'pause_button':
15
+ var button_name = 'Pause Button';
16
+ break;
17
+ case 'pause_hover':
18
+ var button_name = 'Pause Hover';
19
+ break;
20
+ }
21
+
22
+ alert( button_name + ' Image URL reset to default.\n' +
23
+ 'You still have to save the changes.' );
24
+
25
+ if( event.preventDefault ) event.preventDefault(); else event.returnValue = false;
26
+ }
27
+
28
+ function war_setDefaultAudioURL( url, title )
29
+ {
30
+ var audio_type = war_getAudioTypeFromURL( url );
31
+
32
+ var player_was_playing = ! jQuery( '#war_soundy_audio_player' )[ 0 ].paused;
33
+
34
+ jQuery( '#war_soundy_audio_file_url' ).val( url );
35
+ jQuery( '#war_soundy_audio_title' ).val( title );
36
+ jQuery( '#war_soundy_audio_player_source' ).attr( 'src', url );
37
+ jQuery( '#war_soundy_audio_player_source' ).attr( 'type', 'audio/' + audio_type );
38
+ jQuery( '#war_soundy_audio_player' )[ 0 ].load();
39
+
40
+ if( player_was_playing ) jQuery( '#war_soundy_audio_player' )[ 0 ].play();
41
+
42
+ alert( 'Audio File URL reset to default.\n' +
43
+ 'Audio Title reset to default.\n' +
44
+ 'You still have to save the changes.' );
45
+
46
+ if( event.preventDefault ) event.preventDefault(); else event.returnValue = false;
47
+ }
48
+
49
+ function war_lengthUnitChanged( element )
50
+ {
51
+ var element_value = element.options[ element.selectedIndex ].value;
52
+ var unit_map = {
53
+ 'px' : '(pixels)',
54
+ '%' : '(percentage)',
55
+ 'in' : '(inches)',
56
+ 'mm' : '(millimeters)',
57
+ 'cm' : '(centimeters)'
58
+ };
59
+ switch( element.name )
60
+ {
61
+ case 'war_soundy_offset_x_unit':
62
+ jQuery( '#war_soundy_unit_comment_x' ).html( unit_map[ element_value ] );
63
+ break;
64
+ case 'war_soundy_offset_y_unit':
65
+ jQuery( '#war_soundy_unit_comment_y' ).html( unit_map[ element_value ] );
66
+ break;
67
+ }
68
+ }
69
+
70
+ function war_ppPositionChanged( element )
71
+ {
72
+ var element_value = element.options[ element.selectedIndex ].value;
73
+ var position_map = {
74
+ 'document' : '(absolute position)',
75
+ 'window' : '(fixed position)'
76
+ };
77
+ jQuery( '#war_soundy_pp_comment' ).html( position_map[ element_value ] );
78
+ }
79
+
80
+ function war_imgUrlChanged( element )
81
+ {
82
+ jQuery( '#' + element.name + '_img' ).attr( 'src', element.value );
83
+ }
84
+
85
+ function war_getAudioTypeFromURL( url )
86
+ {
87
+ var file_extension = url.substr( url.lastIndexOf( '.' ) + 1 );
88
+ var audio_type = '';
89
+
90
+ switch( file_extension )
91
+ {
92
+ case 'mp3':
93
+ case 'mpg':
94
+ case 'mpeg':
95
+ audio_type = 'mpeg';
96
+ break;
97
+ case 'ogg':
98
+ audio_type = 'ogg';
99
+ break;
100
+ case 'wav':
101
+ case 'wave':
102
+ audio_type = 'wav';
103
+ break;
104
+ }
105
+
106
+ return audio_type;
107
+ }
108
+
109
+ function war_audioUrlChanged( element )
110
+ {
111
+ var url = element.value;
112
+ var audio_type = war_getAudioTypeFromURL( url );
113
+
114
+ jQuery( '#war_soundy_audio_player_source' ).attr( 'src', url );
115
+ jQuery( '#war_soundy_audio_player_source' ).attr( 'type', 'audio/' + audio_type );
116
+ jQuery( '#war_soundy_audio_player' )[ 0 ].load();
117
+ }
118
+
119
+ function war_bindMediaUploader( field_name, button_name, field_type )
120
+ {
121
+ jQuery( document ).ready( function()
122
+ {
123
+ jQuery( '#' + button_name ).click( function()
124
+ {
125
+ jQuery( '#TB_window' ).html( '' ); // to avoid multiple title bars
126
+ tb_show( '', 'media-upload.php?type=' + field_type + '&TB_iframe=true');
127
+
128
+ window.send_to_editor = function( html )
129
+ {
130
+ if( field_type == 'image' )
131
+ {
132
+ var url = jQuery( 'img', html ).attr( 'src' );
133
+ jQuery( '#' + field_name + '_img' ).attr( 'src', url );
134
+ }
135
+ else if( field_type == 'audio' )
136
+ {
137
+ var url = jQuery( html ).attr( 'href' );
138
+ var file_extension = url.substr( url.lastIndexOf( '.' ) + 1 );
139
+ switch( file_extension )
140
+ {
141
+ case 'mp3':
142
+ case 'mpeg':
143
+ var audio_type = 'mpeg';
144
+ break;
145
+ case 'ogg':
146
+ var audio_type = 'ogg';
147
+ break;
148
+ case 'wav':
149
+ var audio_type = 'wav';
150
+ break;
151
+ default:
152
+ alert( 'Audio field_type Error' );
153
+ return;
154
+ }
155
+ var player_was_playing = ! jQuery( '#war_soundy_audio_player' )[ 0 ].paused;
156
+ jQuery( '#war_soundy_audio_player_source' ).attr( 'src', url );
157
+ jQuery( '#war_soundy_audio_player_source' ).attr( 'type', 'audio/' + audio_type );
158
+ jQuery( '#war_soundy_audio_player' )[ 0 ].load();
159
+ if( player_was_playing ) jQuery( '#war_soundy_audio_player' )[ 0 ].play();
160
+ }
161
+
162
+ jQuery( '#' + field_name ).val( url );
163
+ tb_remove();
164
+ }
165
+
166
+ return false;
167
+ } );
168
+ } );
169
+ }
js/front-end.js ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function war_setDefaultButtonURL( button_type, url )
2
+ {
3
+ jQuery( '#war_soundy_button_url_' + button_type ).val( url );
4
+ jQuery( '#war_soundy_img_button_url_' + button_type ).attr( 'src', url );
5
+
6
+ return false;
7
+ }
8
+
9
+ function war_setDefaultAudioURL( url )
10
+ {
11
+ var audio_type = war_getAudioTypeFromURL( url );
12
+
13
+ jQuery( '#war_soundy_audio_file_url' ).val( url );
14
+ jQuery( '#war_soundy_audio_player_source' ).attr( 'src', url );
15
+ jQuery( '#war_soundy_audio_player_source' ).attr( 'type', 'audio/' + audio_type );
16
+ jQuery( '#war_soundy_audio_player' )[ 0 ].load();
17
+
18
+ return false;
19
+ }
20
+
21
+ function war_lengthUnitChanged( element )
22
+ {
23
+ var element_value = element.options[ element.selectedIndex ].value;
24
+ var unit_map = {
25
+ 'px' : '(pixels)',
26
+ '%' : '(percentage)',
27
+ 'in' : '(inches)',
28
+ 'mm' : '(millimeters)',
29
+ 'cm' : '(centimeters)'
30
+ };
31
+ switch( element.name )
32
+ {
33
+ case 'war_soundy_offset_x_unit':
34
+ jQuery( '#war_soundy_unit_comment_x' ).html( unit_map[ element_value ] );
35
+ break;
36
+ case 'war_soundy_offset_y_unit':
37
+ jQuery( '#war_soundy_unit_comment_y' ).html( unit_map[ element_value ] );
38
+ break;
39
+ }
40
+ }
41
+
42
+ function war_imgUrlChanged( element )
43
+ {
44
+ switch( element.name )
45
+ {
46
+ case 'war_soundy_button_url_play':
47
+ jQuery( '#war_soundy_img_button_url_play' ).attr( 'src', element.value );
48
+ break;
49
+ case 'war_soundy_button_url_pause':
50
+ jQuery( '#war_soundy_img_button_url_pause' ).attr( 'src', element.value );
51
+ break;
52
+ }
53
+ }
54
+
55
+ function war_getAudioTypeFromURL( url )
56
+ {
57
+ var file_extension = url.substr( url.lastIndexOf( '.' ) + 1 );
58
+ var audio_type = '';
59
+
60
+ switch( file_extension )
61
+ {
62
+ case 'mp3':
63
+ case 'mpg':
64
+ case 'mpeg':
65
+ audio_type = 'mpeg';
66
+ break;
67
+ case 'ogg':
68
+ audio_type = 'ogg';
69
+ break;
70
+ case 'wav':
71
+ case 'wave':
72
+ audio_type = 'wav';
73
+ break;
74
+ }
75
+
76
+ return audio_type;
77
+ }
78
+
79
+ function war_audioUrlChanged( element )
80
+ {
81
+ var url = element.value;
82
+ var audio_type = war_getAudioTypeFromURL( url );
83
+
84
+ jQuery( '#war_soundy_audio_player_source' ).attr( 'src', url );
85
+ jQuery( '#war_soundy_audio_player_source' ).attr( 'type', 'audio/' + audio_type );
86
+ jQuery( '#war_soundy_audio_player' )[ 0 ].load();
87
+ }
88
+
89
+ function war_bindMediaUploader( field_name, button_name, field_type )
90
+ {
91
+ jQuery( document ).ready( function()
92
+ {
93
+ jQuery( '#' + button_name ).click( function()
94
+ {
95
+ tb_show( '', 'media-upload.php?type=' + field_type + '&TB_iframe=true');
96
+
97
+ window.send_to_editor = function( html )
98
+ {
99
+ if( field_type == 'image' )
100
+ {
101
+ var url = jQuery( 'img', html ).attr( 'src' );
102
+ jQuery( '#img_' + field_name ).attr( 'src', url );
103
+ }
104
+ else if( field_type == 'audio' )
105
+ {
106
+ var url = jQuery( html ).attr( 'href' );
107
+ var file_extension = url.substr( url.lastIndexOf( '.' ) + 1 );
108
+ switch( file_extension )
109
+ {
110
+ case 'mp3':
111
+ case 'mpeg':
112
+ var audio_type = 'mpeg';
113
+ break;
114
+ case 'ogg':
115
+ var audio_type = 'ogg';
116
+ break;
117
+ case 'wav':
118
+ var audio_type = 'wav';
119
+ break;
120
+ default:
121
+ alert( 'Audio field_type Error' );
122
+ return;
123
+ }
124
+ jQuery( '#war_soundy_audio_player_source' ).attr( 'src', url );
125
+ jQuery( '#war_soundy_audio_player_source' ).attr( 'type', 'audio/' + audio_type );
126
+ jQuery( '#war_soundy_audio_player' )[ 0 ].load();
127
+ }
128
+
129
+ jQuery( '#' + field_name ).val( url );
130
+ tb_remove();
131
+ }
132
+
133
+ return false;
134
+ } );
135
+ } );
136
+ }
readme.txt ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Soundy Background Music ===
2
+ Contributors: bducouedic
3
+ Tags: audio, sound, music, background, soundtrack, background sound, background audio, background music, posts, pages
4
+ Requires at least: 3.6
5
+ Tested up to: 3.8.1
6
+ Stable tag: 1.1
7
+ License: GPL2
8
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
+ Donate link: http://webartisan.ch/en/products/soundy#war_donate
10
+
11
+ Soundy allows a page or post to play a sound track while it is displayed.
12
+
13
+ == Description ==
14
+
15
+ The **Soundy** plugin allows to play a background music when a page or post is displayed.
16
+ Each page or post can have its own sound track.
17
+ The sound track is embedded in the page by means of the HTML 5 audio tag. This way, the plugin is compatible with all modern user devices (smartphones, tablets, laptops and desktops of all vendors).
18
+ A background music can be associated with all pages and posts or with individual pages or posts.
19
+ A Play/Pause button can also be displayed anywhere in the pages and posts.
20
+ Defaults can be set in the settings page of the plugin.
21
+ Specific post and page plugin settings can be configured in the Edit Page and Edit Post pages.
22
+ In the plugin settings page, an audio track can be set per default.
23
+ The audio track can be anywhere on the web as it is specified with its URL. It can also be uploaded in the media library of the WP site.
24
+ A play and pause button image can be uploaded to replace the default one and can be positioned anywhere.
25
+ This Play/Pause button can be positioned in a corner of the document or in a corner of the window. It can also be positioned with a template tag typically in the document header or with a shortcode in the content.
26
+ For an example of a Soundy implementation, have a look to the swiss pianist, Magali Bourquin's website: [www.magalibourquin.com](http://magalibourquin.com/)
27
+ A little Soundy example can also be seen in the Description tab of the [Soundy Plugin Home Page](http://webartisan.ch/en/products/soundy/).
28
+
29
+ = Docs & Support =
30
+
31
+ You can find [tutorial](http://webartisan.ch/en/products/soundy#war_tutorial), [FAQ](http://webartisan.ch/en/products/soundy#war_FAQ) and more detailed information about **Soundy** plugin on [WebArtisan.ch](http://webartisan.ch/en/products/soundy/). If you were unable to find the answer to your question on the FAQ or in any of the documentation, you should check the [support forum](http://wordpress.org/support/plugin/soundy-background-music) on WordPress.org. If you can't locate any topics that pertain to your particular issue, post a new topic for it.
32
+ **Soundy** Plugin Home Page: [webartisan.ch/en/products/soundy](http://webartisan.ch/en/products/soundy/)
33
+
34
+ = Soundy Needs Your Support =
35
+
36
+ It is hard to continue development and support for this free plugin without contributions from users like you. If you enjoy using Soundy and find it useful, please consider [__making a donation__](http://webartisan.ch/en/products/soundy#war_donate). Your donation will help encourage and support the plugin's continued development and better user support.
37
+
38
+ == Installation ==
39
+ * In the Admin area (the back-end) of your WordPress Web Site, go to Plugins > Add New.
40
+ * Enter **Soundy** in the search field.
41
+ * **Soundy Background Music** appears.
42
+ * Click on "Install Now".
43
+ * Click on "Activate Plugin".
44
+ * To set up plugin defaults, go to Settings > **Soundy** in the admin area and fill out the input fields.
45
+ * For help, here is a [tutorial](http://webartisan.ch/en/products/soundy#war_tutorial).
46
+ * Happy Soundy Music !
47
+
48
+ == Frequently Asked Questions ==
49
+
50
+ = Is it possible to have different sound tracks for different posts and pages. =
51
+
52
+ Yes, a sound track can be set up on a per post or per page basis.
53
+
54
+ = What kind of audio files can be used with Soundy Plugin ? =
55
+
56
+ The audio files must be in the format MP3, OGG or WAV. The file extension must be .mp3, .mpg, .mpeg, .ogg .wav or .wave.
57
+
58
+ = Is Soundy Plugin compatible with iphone, ipad and smartphones in general? =
59
+
60
+ Yes, it is as the plugin uses the HTML5 audio tag. There is just one issue with ipod, iphone and ipad (IOS Operating System): Autoplay option is deactivated by Apple on this operating system.
61
+
62
+ = Is it possible to position the Play/Pause button anywhere in the page or post header ? =
63
+
64
+ Yes, this can be done with the soundy_button() template tag.
65
+
66
+ = Is it possible to position the Play/Pause button anywhere in the content of a page or post ? =
67
+
68
+ Yes, this can be done with the [soundy button] shortcode.
69
+
70
+ = Is it possible to modify the Play/Pause button look & feel ? =
71
+
72
+ Yes, you can upload and set up your own button images.
73
+
74
+ = Can I really put my audio files anywhere on the web ? =
75
+
76
+ Yes, you can put your audio files anywhere on any cloud or website, except one place: you should not put your audio files in the soundy-background-music plugin directory (or below). If you do, you will loose your files the next time you will install a new version of Soundy. The update process deletes this folder and replace it with a new one. If you want to store the audio files on your WP site, the best place to do so is the media library (/wp-content/uploads/...).
77
+
78
+ == Screenshots ==
79
+
80
+ 1. **Default Audio Track Settings**
81
+ 1. **Play/Pause Button Settings**
82
+ 1. **Play/Pause Button Corner Settings**
83
+ 1. **Play/Pause Button Static Settings**
84
+ 1. **Page or Post Soundy Metabox**
85
+
86
+ == Changelog ==
87
+
88
+ = 1.1 =
89
+ * Corrected a few minor bugs
90
+ * Made Soundy forms of the back-end admin section more responsive
91
+ * Added possibility to disable Soundy for mobile devices. Set variable **$disable_soundy_for_mobile** to **true** in soundy.php file to disable Soundy for mobile devices.
92
+
93
+ = 1.0 =
94
+ * First Version
95
+
96
+ == Upgrade Notice ==
97
+
98
+ = 1.1 =
99
+
100
+ * After having upgraded Soundy to 1.1, please clear the cache of Soundy's admin pages in your browser. The reason is that a few CSS and Javascript files have been modified and these files are typically cached by browsers.
soundy.php ADDED
@@ -0,0 +1,1274 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Soundy_Background_Music
4
+ * @version 1.1
5
+ */
6
+ /*
7
+ Plugin Name: Soundy Background Music
8
+ Plugin URI: http://webartisan.ch/en/products/soundy
9
+ Description: This plugin allows administrators and authors to set a background sound on any post or page.
10
+ Version: 1.1
11
+ Author: Bertrand du Couédic
12
+ Author URI: http://webartisan.ch/en/about
13
+ License: GPL2
14
+
15
+ Copyright 2014 Bertrand du Couédic (email: bducouedic@webartisan.ch)
16
+
17
+ This program is free software; you can redistribute it and/or modify
18
+ it under the terms of the GNU General Public License, version 2, as
19
+ published by the Free Software Foundation.
20
+
21
+ This program is distributed in the hope that it will be useful,
22
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
23
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
+ GNU General Public License for more details.
25
+
26
+ You should have received a copy of the GNU General Public License
27
+ along with this program; if not, write to the Free Software
28
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29
+ */
30
+
31
+ class WarSoundy
32
+ {
33
+ private $disable_soundy_for_mobile = false;
34
+ private $user_agent_is_mobile;
35
+ private $post_id;
36
+ private $plugin_name;
37
+ private $plugin_url;
38
+ private $enable_bg_sound = 'no';
39
+ private $default_audio_url = '/audio/valse.mp3';
40
+ private $default_audio_title = 'Valse - Anonymous (1870)';
41
+ private $autoplay = 'yes';
42
+ private $loop = 'yes';
43
+ private $display_play_pause = 'yes';
44
+ private $pp_position = 'window';
45
+ private $pp_corner = 'upper_right';
46
+ private $offset_x = 35;
47
+ private $offset_x_unit = 'px';
48
+ private $offset_y = 35;
49
+ private $offset_y_unit = 'px';
50
+ private $default_play_button_url = '/images/buttons/48x48/play-square-grey.png';
51
+ private $default_play_hover_url = '/images/buttons/48x48/play-square-blue.png';
52
+ private $default_pause_button_url = '/images/buttons/48x48/pause-square-grey.png';
53
+ private $default_pause_hover_url = '/images/buttons/48x48/pause-square-blue.png';
54
+
55
+ private $units = array(
56
+ 'px' => '(pixels)',
57
+ '%' => '(percentage)',
58
+ 'in' => '(inches)',
59
+ 'mm' => '(millimeters)',
60
+ 'cm' => '(centimeters)'
61
+ );
62
+
63
+ public function __construct()
64
+ {
65
+ $this->user_agent_is_mobile = $this->check_user_agent( 'mobile' );
66
+
67
+ $plugin_path = dirname( __FILE__ );
68
+ $this->plugin_name = substr( $plugin_path, strrpos( $plugin_path, '/' ) + 1 );
69
+ $this->plugin_url = WP_PLUGIN_URL . '/' . $this->plugin_name;
70
+
71
+ $this->default_audio_url = $this->plugin_url . $this->default_audio_url;
72
+ $this->default_play_button_url = $this->plugin_url . $this->default_play_button_url;
73
+ $this->default_play_hover_url = $this->plugin_url . $this->default_play_hover_url;
74
+ $this->default_pause_button_url = $this->plugin_url . $this->default_pause_button_url;
75
+ $this->default_pause_hover_url = $this->plugin_url . $this->default_pause_hover_url;
76
+
77
+ if( is_admin() )
78
+ {
79
+ register_activation_hook( __FILE__, array( $this, 'activate' ) );
80
+ register_deactivation_hook( __FILE__, array( $this, 'deactivate' ) );
81
+
82
+ add_action( 'admin_menu', array( $this, 'add_plugin_settings_menu' ) );
83
+ add_action( 'admin_init', array( $this, 'register_settings' ) );
84
+
85
+ $plugin = plugin_basename( __FILE__ );
86
+ add_filter("plugin_action_links_$plugin", array( $this, 'plugin_settings_link' ) );
87
+
88
+ $uri = $_SERVER[ 'REQUEST_URI' ];
89
+ $is_edit_post = ( strpos( $uri, '/wp-admin/post.php' ) == 0 ) ||
90
+ ( strpos( $uri, '/wp-admin/post-new.php' ) == 0 );
91
+
92
+ if( ( isset( $_GET['page'] ) && ( $_GET['page'] == 'soundy' ) ) || $is_edit_post )
93
+ {
94
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) );
95
+ add_filter( 'get_media_item_args', array( $this, 'get_media_item_args' ) );
96
+ }
97
+
98
+ if( $is_edit_post )
99
+ {
100
+ add_action( 'add_meta_boxes', array( $this, 'add_meta_box' ) );
101
+ add_action( 'save_post', array( $this, 'save_post_data' ) );
102
+ }
103
+ }
104
+ else
105
+ {
106
+ wp_register_style( 'soundy', $this->plugin_url . '/css/style-front-end.css' );
107
+ wp_enqueue_style( 'soundy');
108
+ add_action( 'wp_head', array( $this, 'insert_audio' ) );
109
+ add_shortcode( 'soundy', array( $this, 'soundy_shortcode' ) );
110
+ }
111
+ }
112
+
113
+ public function activate()
114
+ {
115
+ add_option( 'war_soundy_enable_bg_sound', $this->enable_bg_sound );
116
+ add_option( 'war_soundy_audio_file_url', $this->default_audio_url );
117
+ add_option( 'war_soundy_audio_title', $this->default_audio_title );
118
+ add_option( 'war_soundy_autoplay', $this->autoplay );
119
+ add_option( 'war_soundy_loop', $this->loop );
120
+ add_option( 'war_soundy_display_play_pause', $this->display_play_pause );
121
+ add_option( 'war_soundy_url_play_button', $this->default_play_button_url );
122
+ add_option( 'war_soundy_url_play_hover', $this->default_play_hover_url );
123
+ add_option( 'war_soundy_url_pause_button', $this->default_pause_button_url );
124
+ add_option( 'war_soundy_url_pause_hover', $this->default_pause_hover_url );
125
+ add_option( 'war_soundy_pp_position', $this->pp_position );
126
+ add_option( 'war_soundy_pp_corner', $this->pp_corner );
127
+ add_option( 'war_soundy_offset_x', $this->offset_x );
128
+ add_option( 'war_soundy_offset_x_unit', $this->offset_x_unit );
129
+ add_option( 'war_soundy_offset_y', $this->offset_y );
130
+ add_option( 'war_soundy_offset_y_unit', $this->offset_y_unit );
131
+ }
132
+
133
+ public function deactivate()
134
+ {
135
+ }
136
+
137
+ public function add_plugin_settings_menu()
138
+ {
139
+ add_options_page( 'Soundy', 'Soundy', 'manage_options', 'soundy', array( $this, 'create_plugin_settings_page' ) );
140
+ }
141
+
142
+ public function create_plugin_settings_page()
143
+ {
144
+ if( ! current_user_can( 'manage_options' ) )
145
+ {
146
+ wp_die( __('You do not have sufficient permissions to access this page.' ) );
147
+ }
148
+
149
+ include( sprintf( "%s/templates/settings.php", dirname( __FILE__ ) ) );
150
+ }
151
+
152
+ public function get_media_item_args( $args )
153
+ {
154
+ $args[ 'send' ] = true;
155
+ return $args;
156
+ }
157
+
158
+ public function admin_scripts( $hook )
159
+ {
160
+ wp_register_script( 'button-upload',
161
+ $this->plugin_url . '/js/back-end.js',
162
+ array('jquery','media-upload','thickbox'));
163
+
164
+ wp_enqueue_script( 'jquery');
165
+ wp_enqueue_script( 'jquery-ui-core');
166
+ wp_enqueue_script( 'jquery-ui-tabs');
167
+
168
+ wp_enqueue_script( 'media-upload');
169
+ wp_enqueue_script( 'thickbox');
170
+ wp_enqueue_script( 'button-upload');
171
+
172
+ wp_register_style( 'jquery-ui', $this->plugin_url . '/css/jquery-ui-v1.10.4.css' );
173
+ wp_register_style( 'soundy', $this->plugin_url . '/css/style-back-end.css' );
174
+
175
+ wp_enqueue_style( 'jquery-ui');
176
+ wp_enqueue_style( 'thickbox');
177
+ wp_enqueue_style( 'soundy');
178
+ }
179
+
180
+ public function plugin_settings_link( $links )
181
+ {
182
+ $settings_link = '<a href="options-general.php?page=soundy">Settings</a>';
183
+ array_unshift( $links, $settings_link );
184
+ return $links;
185
+ }
186
+
187
+ public function get_audio_type_from_URL( $url )
188
+ {
189
+ $file_extension = pathinfo( $url, PATHINFO_EXTENSION );
190
+ $audio_type = '';
191
+
192
+ switch( $file_extension )
193
+ {
194
+ case 'mp3':
195
+ case 'mpg':
196
+ case 'mpeg':
197
+ $audio_type = 'mpeg';
198
+ break;
199
+ case 'ogg':
200
+ $audio_type = 'ogg';
201
+ break;
202
+ case 'wav':
203
+ case 'wave':
204
+ $audio_type = 'wav';
205
+ break;
206
+ }
207
+
208
+ return $audio_type;
209
+ }
210
+
211
+ public function do_settings_section( $page_id, $section_id )
212
+ {
213
+ global $wp_settings_sections, $wp_settings_fields;
214
+
215
+ if ( ! isset( $wp_settings_fields ) ||
216
+ ! isset( $wp_settings_fields[ $page_id ] ) ||
217
+ ! isset( $wp_settings_fields[ $page_id ][ $section_id ] ) )
218
+ return;
219
+
220
+ $section = $wp_settings_sections[ $page_id ][ $section_id ];
221
+ if ( $section[ 'title' ] )
222
+ echo "<h3>{$section[ 'title' ]}</h3>\n";
223
+
224
+ if ( $section[ 'callback' ] )
225
+ call_user_func( $section[ 'callback' ], $section );
226
+
227
+ echo '<table class="form-table">';
228
+ do_settings_fields( $page_id, $section_id );
229
+ echo '</table>';
230
+ }
231
+
232
+ public function register_settings()
233
+ {
234
+ $this->add_settings_section_audio_track();
235
+ $this->add_settings_section_play_pause_button();
236
+ $this->add_settings_section_play_pause_position_corner();
237
+ $this->add_settings_section_play_pause_position_static();
238
+ }
239
+
240
+ public function add_settings_section_audio_track()
241
+ {
242
+ add_settings_section(
243
+ 'war_soundy_settings_section_audio_track',
244
+ 'Audio Track Options',
245
+ array( $this, 'display_settings_section_audio_track_header' ),
246
+ 'soundy'
247
+ );
248
+
249
+ register_setting( 'war_soundy', 'war_soundy_enable_bg_sound' );
250
+ add_settings_field(
251
+ 'war_soundy_enable_bg_sound',
252
+ 'Enable Background Sound',
253
+ array( $this, 'add_settings_field_enable_bg_sound' ),
254
+ 'soundy',
255
+ 'war_soundy_settings_section_audio_track'
256
+ );
257
+
258
+ register_setting( 'war_soundy', 'war_soundy_audio_file_url', array( $this, 'do_sanitize_field' ) );
259
+ add_settings_field(
260
+ 'war_soundy_audio_file_url',
261
+ 'Audio File URL',
262
+ array( $this, 'add_settings_field_audio_file_URL' ),
263
+ 'soundy',
264
+ 'war_soundy_settings_section_audio_track'
265
+ );
266
+
267
+ register_setting( 'war_soundy', 'war_soundy_audio_title', array( $this, 'do_sanitize_field' ) );
268
+ add_settings_field(
269
+ 'war_soundy_audio_title',
270
+ 'Audio Title',
271
+ array( $this, 'add_settings_field_audio_title' ),
272
+ 'soundy',
273
+ 'war_soundy_settings_section_audio_track'
274
+ );
275
+
276
+ register_setting( 'war_soundy', 'war_soundy_autoplay' );
277
+ add_settings_field(
278
+ 'war_soundy_autoplay',
279
+ 'Autoplay',
280
+ array( $this, 'add_settings_field_autoplay' ),
281
+ 'soundy',
282
+ 'war_soundy_settings_section_audio_track'
283
+ );
284
+
285
+ register_setting( 'war_soundy', 'war_soundy_loop' );
286
+ add_settings_field(
287
+ 'war_soundy_loop',
288
+ 'Audio Repeat Loop',
289
+ array( $this, 'add_settings_field_loop' ),
290
+ 'soundy',
291
+ 'war_soundy_settings_section_audio_track'
292
+ );
293
+ }
294
+
295
+ public function add_settings_section_play_pause_button()
296
+ {
297
+ add_settings_section(
298
+ 'war_soundy_settings_section_play_pause_button',
299
+ 'Play/Pause Button',
300
+ array( $this, 'display_settings_section_play_pause_button_header' ),
301
+ 'soundy'
302
+ );
303
+
304
+ register_setting( 'war_soundy', 'war_soundy_display_play_pause' );
305
+ add_settings_field(
306
+ 'war_soundy_display_play_pause',
307
+ 'Display Play/Pause Button',
308
+ array( $this, 'add_settings_field_display_play_pause_button' ),
309
+ 'soundy',
310
+ 'war_soundy_settings_section_play_pause_button'
311
+ );
312
+
313
+ register_setting( 'war_soundy', 'war_soundy_url_play_button', array( $this, 'do_sanitize_field' ) );
314
+ add_settings_field(
315
+ 'war_soundy_url_play_button',
316
+ 'Play Button Image URL',
317
+ array( $this, 'add_settings_field_url_pp_button' ),
318
+ 'soundy',
319
+ 'war_soundy_settings_section_play_pause_button',
320
+ array( 'play_button' )
321
+ );
322
+
323
+ register_setting( 'war_soundy', 'war_soundy_url_play_hover', array( $this, 'do_sanitize_field' ) );
324
+ add_settings_field(
325
+ 'war_soundy_url_play_hover',
326
+ 'Play Hover Image URL',
327
+ array( $this, 'add_settings_field_url_pp_button' ),
328
+ 'soundy',
329
+ 'war_soundy_settings_section_play_pause_button',
330
+ array( 'play_hover' )
331
+ );
332
+
333
+ register_setting( 'war_soundy', 'war_soundy_url_pause_button', array( $this, 'do_sanitize_field' ) );
334
+ add_settings_field(
335
+ 'war_soundy_url_pause_button',
336
+ 'Pause Button Image URL',
337
+ array( $this, 'add_settings_field_url_pp_button' ),
338
+ 'soundy',
339
+ 'war_soundy_settings_section_play_pause_button',
340
+ array( 'pause_button' )
341
+ );
342
+
343
+ register_setting( 'war_soundy', 'war_soundy_url_pause_hover', array( $this, 'do_sanitize_field' ) );
344
+ add_settings_field(
345
+ 'war_soundy_url_pause_hover',
346
+ 'Pause Hover Image URL',
347
+ array( $this, 'add_settings_field_url_pp_button' ),
348
+ 'soundy',
349
+ 'war_soundy_settings_section_play_pause_button',
350
+ array( 'pause_hover' )
351
+ );
352
+ }
353
+
354
+ public function add_settings_section_play_pause_position_corner()
355
+ {
356
+ add_settings_section(
357
+ 'war_soundy_settings_section_play_pause_position_corner',
358
+ 'Play/Pause Corner Position',
359
+ array( $this, 'display_settings_section_play_pause_position_corner_header' ),
360
+ 'soundy'
361
+ );
362
+
363
+ register_setting( 'war_soundy', 'war_soundy_pp_position' );
364
+ register_setting( 'war_soundy', 'war_soundy_pp_corner' );
365
+ add_settings_field(
366
+ 'war_soundy_pp_corner',
367
+ 'Corner Position',
368
+ array( $this, 'add_settings_field_pp_position' ),
369
+ 'soundy',
370
+ 'war_soundy_settings_section_play_pause_position_corner'
371
+ );
372
+
373
+ register_setting( 'war_soundy', 'war_soundy_offset_x' );
374
+ register_setting( 'war_soundy', 'war_soundy_offset_x_unit' );
375
+ add_settings_field(
376
+ 'war_soundy_offset_x',
377
+ 'Button X Offset',
378
+ array( $this, 'add_settings_field_offset_x' ),
379
+ 'soundy',
380
+ 'war_soundy_settings_section_play_pause_position_corner'
381
+ );
382
+
383
+ register_setting( 'war_soundy', 'war_soundy_offset_y' );
384
+ register_setting( 'war_soundy', 'war_soundy_offset_y_unit' );
385
+ add_settings_field(
386
+ 'war_soundy_offset_y',
387
+ 'Button Y Offset',
388
+ array( $this, 'add_settings_field_offset_y' ),
389
+ 'soundy',
390
+ 'war_soundy_settings_section_play_pause_position_corner'
391
+ );
392
+ }
393
+
394
+ public function add_settings_section_play_pause_position_static()
395
+ {
396
+ add_settings_section(
397
+ 'war_soundy_settings_section_play_pause_position_static',
398
+ 'Play/Pause Static Position',
399
+ array( $this, 'display_settings_section_play_pause_position_static_header' ),
400
+ 'soundy'
401
+ );
402
+
403
+ add_settings_field(
404
+ 'war_soundy_template_tags',
405
+ 'Template Tags',
406
+ array( $this, 'add_settings_field_template_tags' ),
407
+ 'soundy',
408
+ 'war_soundy_settings_section_play_pause_position_static'
409
+ );
410
+
411
+ add_settings_field(
412
+ 'war_soundy_shortcodes',
413
+ 'Shortcodes',
414
+ array( $this, 'add_settings_field_shortcodes' ),
415
+ 'soundy',
416
+ 'war_soundy_settings_section_play_pause_position_static'
417
+ );
418
+ }
419
+
420
+ public function display_settings_section_audio_track_header()
421
+ {
422
+ echo '';
423
+ }
424
+
425
+ public function display_settings_section_play_pause_button_header()
426
+ {
427
+ echo '';
428
+ }
429
+
430
+ public function display_settings_section_play_pause_position_corner_header()
431
+ {
432
+ echo '';
433
+ }
434
+
435
+ public function display_settings_section_play_pause_position_static_header()
436
+ {
437
+ echo '';
438
+ }
439
+
440
+ public function add_settings_field_enable_bg_sound( $args )
441
+ {
442
+ ?>
443
+ <input type="checkbox"
444
+ value="yes"
445
+ name="war_soundy_enable_bg_sound"
446
+ id="war_soundy_enable_bg_sound"
447
+ <?php echo get_option( 'war_soundy_enable_bg_sound' ) == 'yes' ? ' checked' : ''; ?> />
448
+ <label for="war_soundy_enable_bg_sound">Enable background sound per default</label>
449
+ <?php
450
+ }
451
+
452
+ public function add_settings_field_audio_file_URL( $args )
453
+ {
454
+ $file_url = get_option( 'war_soundy_audio_file_url' );
455
+ $file_type = pathinfo( $file_url, PATHINFO_EXTENSION );
456
+
457
+ $this->add_field_audio_file_URL_table( $file_url,
458
+ $file_type,
459
+ $this->default_audio_url,
460
+ $this->default_audio_title,
461
+ false );
462
+ }
463
+
464
+ private function add_field_audio_file_URL_table( $file_url, $file_type, $default_url, $default_title, $is_meta_box )
465
+ {
466
+ if( $is_meta_box )
467
+ {
468
+ $url_input_class = 'war_soundy_url_input_metabox';
469
+ }
470
+ else
471
+ {
472
+ $url_input_class = 'war_soundy_url_input';
473
+ }
474
+
475
+ $default_title = str_replace( "&#039;", "\&#039;", $default_title );
476
+ ?>
477
+ <script>
478
+ war_bindMediaUploader( 'war_soundy_audio_file_url', 'war_audio_library_button', 'audio' );
479
+ </script>
480
+ <table class="war_soundy_no_border">
481
+ <tr>
482
+ <td>
483
+ <input id="war_soundy_audio_file_url"
484
+ name="war_soundy_audio_file_url"
485
+ type="text"
486
+ value="<?php echo $file_url; ?>"
487
+ class="<?php echo $url_input_class; ?>"
488
+ onchange="war_audioUrlChanged( this );" />
489
+ </td>
490
+ <td>
491
+ <input id="war_audio_library_button"
492
+ type="button"
493
+ value="Media Library"
494
+ class="war_soundy" />
495
+ </td>
496
+ </tr>
497
+ <tr>
498
+ <td>
499
+ <audio id="war_soundy_audio_player"
500
+ class="war_soundy"
501
+ controls>
502
+ <source id="war_soundy_audio_player_source"
503
+ src="<?php echo $file_url; ?>"
504
+ type="audio/<?php echo $file_type; ?>">
505
+ </audio>
506
+ </td>
507
+ <td style="text-align: right">
508
+ <a href="#"
509
+ onclick="war_setDefaultAudioURL( '<?php echo $default_url; ?>', '<?php echo $default_title; ?>' );"
510
+ >Default Audio</a>&nbsp;
511
+ </td>
512
+ </tr>
513
+ </table>
514
+ <?php
515
+ }
516
+
517
+ public function add_settings_field_audio_title( $args )
518
+ {
519
+ ?>
520
+ <input type="text"
521
+ class="war_soundy_audio_title_input"
522
+ value="<?php echo get_option( 'war_soundy_audio_title' ); ?>"
523
+ name="war_soundy_audio_title"
524
+ id="war_soundy_audio_title" />
525
+ <?php
526
+ }
527
+
528
+ public function add_settings_field_autoplay( $args )
529
+ {
530
+ ?>
531
+ <input type="checkbox"
532
+ value="yes"
533
+ name="war_soundy_autoplay"
534
+ id="war_soundy_autoplay"
535
+ <?php echo get_option( 'war_soundy_autoplay' ) == 'yes' ? ' checked' : ''; ?> />
536
+ <?php
537
+ }
538
+
539
+ public function add_settings_field_loop( $args )
540
+ {
541
+ ?>
542
+ <input type="checkbox"
543
+ value="yes"
544
+ name="war_soundy_loop"
545
+ id="war_soundy_loop"
546
+ <?php echo get_option( 'war_soundy_loop' ) == 'yes' ? ' checked' : ''; ?> />
547
+ <?php
548
+ }
549
+
550
+ public function add_settings_field_display_play_pause_button( $args )
551
+ {
552
+ ?>
553
+ <input type="checkbox"
554
+ value="yes"
555
+ name="war_soundy_display_play_pause"
556
+ id="war_soundy_display_play_pause"
557
+ <?php echo get_option( 'war_soundy_display_play_pause' ) == 'yes' ? ' checked' : ''; ?> />
558
+ <?php
559
+ }
560
+
561
+ public function add_settings_field_url_pp_button( $args )
562
+ {
563
+ $type = $args[ 0 ];
564
+ ?>
565
+ <script>
566
+ war_bindMediaUploader( 'war_soundy_url_<?php echo $type; ?>',
567
+ 'img_<?php echo $type; ?>_library_button', 'image' );
568
+ </script>
569
+ <table class="war_soundy_no_border">
570
+ <tr>
571
+ <td>
572
+ <input id="war_soundy_url_<?php echo $type; ?>"
573
+ name="war_soundy_url_<?php echo $type; ?>"
574
+ type="text"
575
+ class="war_soundy_url_input"
576
+ value="<?php echo get_option( "war_soundy_url_$type" ); ?>"
577
+ style=""
578
+ onchange="war_imgUrlChanged( this );" />
579
+ </td>
580
+ <td>
581
+ <input id="img_<?php echo $type; ?>_library_button"
582
+ type="button"
583
+ value="Media Library"
584
+ class="war_soundy" />
585
+ </td>
586
+ </tr>
587
+ <tr>
588
+ <td>
589
+ <img id="war_soundy_url_<?php echo $type; ?>_img"
590
+ src="<?php echo get_option( "war_soundy_url_$type" ); ?>"
591
+ class="war_soundy">
592
+ </td>
593
+ <td style="text-align: right">
594
+ <a href="#"
595
+ onclick="war_setDefaultButtonURL( '<?php echo $type; ?>', '<?php echo $this->{"default_${type}_url"}; ?>' );"
596
+ >Default Button</a>&nbsp;
597
+ </td>
598
+ </tr>
599
+ </table>
600
+ <?php
601
+ }
602
+
603
+ public function add_settings_field_pp_position( $args )
604
+ {
605
+ $pp_position = get_option( 'war_soundy_pp_position' );
606
+ $pp_corner = get_option( 'war_soundy_pp_corner' );
607
+
608
+ $pp_comment = $pp_position == 'document' ? '(absolute position)' : '(fixed position)';
609
+
610
+ $positions = array(
611
+ document => 'Document',
612
+ window => 'Window'
613
+ );
614
+ $options_position = '';
615
+ foreach( $positions as $position_id => $position_desc )
616
+ {
617
+ $options_position .= '<option value="' . $position_id. '" ' .
618
+ ( $position_id == $pp_position ? 'selected' : '' ) . '>' . $position_desc . '</option>';
619
+ }
620
+
621
+ $corners = array(
622
+ upper_right => 'Upper Right Corner',
623
+ bottom_right => 'Bottom Right Corner',
624
+ upper_left => 'Upper Left Corner',
625
+ bottom_left => 'Bottom Left Corner'
626
+ );
627
+ $options_corner = '';
628
+ foreach( $corners as $corner_id => $corner_desc )
629
+ {
630
+ $options_corner .= '<option value="' . $corner_id. '" ' .
631
+ ( $corner_id == $pp_corner ? 'selected' : '' ) . '>' . $corner_desc . '</option>';
632
+ }
633
+ ?>
634
+ <select name="war_soundy_pp_position"
635
+ onchange="war_ppPositionChanged( this )">
636
+ <?php echo $options_position; ?>
637
+ </select>
638
+ <select name="war_soundy_pp_corner">
639
+ <?php echo $options_corner; ?>
640
+ </select>
641
+ <span id="war_soundy_pp_comment"><?php echo $pp_comment; ?></span>
642
+ <?php
643
+ }
644
+
645
+ public function add_settings_field_offset_x( $args )
646
+ {
647
+ $unit_x = get_option( 'war_soundy_offset_x_unit' );
648
+ $unit_options_x = '';
649
+ $unit_comment_x = '(pixels)';
650
+ foreach( $this->units as $unit => $comment )
651
+ {
652
+ if( $unit == $unit_x )
653
+ {
654
+ $unit_options_x .= '<option selected>' . $unit . '</option>';
655
+ $unit_comment_x = $comment;
656
+ }
657
+ else
658
+ {
659
+ $unit_options_x .= '<option>' . $unit . '</option>';
660
+ }
661
+ }
662
+ ?>
663
+ <input type="text"
664
+ name="war_soundy_offset_x"
665
+ id="war_soundy_offset_x"
666
+ value="<?php echo get_option( 'war_soundy_offset_x' ); ?>"
667
+ size="4" />
668
+ <select name="war_soundy_offset_x_unit"
669
+ onchange="war_lengthUnitChanged( this )">
670
+ <?php echo $unit_options_x; ?>
671
+ </select>
672
+ <span id="war_soundy_unit_comment_x"><?php echo $unit_comment_x; ?></span>
673
+ Horizontal length between button and vertical corner edge
674
+ <?php
675
+ }
676
+
677
+ public function add_settings_field_offset_y( $args )
678
+ {
679
+ $unit_y = get_option( 'war_soundy_offset_y_unit' );
680
+ $unit_options_y = '';
681
+ $unit_comment_y = '(pixels)';
682
+ foreach( $this->units as $unit => $comment )
683
+ {
684
+ if( $unit == $unit_y )
685
+ {
686
+ $unit_options_y .= '<option selected>' . $unit . '</option>';
687
+ $unit_comment_y = $comment;
688
+ }
689
+ else
690
+ {
691
+ $unit_options_y .= '<option>' . $unit . '</option>';
692
+ }
693
+ }
694
+ ?>
695
+ <input type="text"
696
+ name="war_soundy_offset_y"
697
+ id="war_soundy_offset_y"
698
+ value="<?php echo get_option( 'war_soundy_offset_y' ); ?>"
699
+ size="4" />
700
+ <select name="war_soundy_offset_y_unit"
701
+ onchange="war_lengthUnitChanged( this )">
702
+ <?php echo $unit_options_y; ?>
703
+ </select>
704
+ <span id="war_soundy_unit_comment_y"><?php echo $unit_comment_y; ?></span>
705
+ Vertical length between button and horizontal corner edge
706
+ <?php
707
+ }
708
+
709
+ public function add_settings_field_template_tags( $args )
710
+ {
711
+ ?>
712
+ <p>To display the Play/Pause button in the header of posts and pages, use the template tag: <strong>soundy_button()</strong>.</p>
713
+ <p>To display the audio track title in the header of posts and pages, use the template tag: <strong>soundy_title()</strong>.</p>
714
+ <p>These template tags will typically be used in the header.php file.</p>
715
+ <p>Template tags use examples:</p>
716
+ <ul style="padding-left: 40px;">
717
+ <li><strong>&lt;?php soundy_button(); ?&gt;</strong>
718
+ <li><strong>&lt;?php soundy_title(); ?&gt;</strong>
719
+ </ul>
720
+ <p>Positioning with the soundy_button() template tag will disable corner positioning of the Play/Pause button.</p>
721
+ <?php
722
+ }
723
+
724
+ public function add_settings_field_shortcodes( $args )
725
+ {
726
+ ?>
727
+ <p>To display the Play/Pause button in the content of posts and pages, use the shortcode: <strong>[soundy button]</strong>.</p>
728
+ <p>To display the audio track title in the content of posts and pages, use the template tag: <strong>[soundy title]</strong>.</p>
729
+ <p>Positioning with the [soundy button] shortcode will disable template tag and corner positioning of the Play/Pause button.</p>
730
+ <p>Shortcode positioning has precedence upon template tag positioning, which has precedence upon corner positioning.</p>
731
+ <p>Note that multiple inserts of the Play/Pause button are not supported.</p>
732
+ <?php
733
+ }
734
+
735
+ public function add_meta_box( $post )
736
+ {
737
+ $screen = get_current_screen();
738
+
739
+ add_meta_box( 'soundy-meta-box',
740
+ 'Soundy Background',
741
+ array( $this, 'render_meta_box' ),
742
+ $screen->post_type,
743
+ 'normal',
744
+ 'high' );
745
+ }
746
+
747
+ public function get_meta_data( $meta_data_name, $can_be_default = false )
748
+ {
749
+ $meta_data = get_post_meta( $this->post_id, $meta_data_name, true );
750
+
751
+ if( ( $meta_data == '' || $meta_data == 'default' ) && $can_be_default )
752
+ {
753
+ $meta_data = 'default';
754
+ }
755
+ elseif( $meta_data == '' || $meta_data == 'default' )
756
+ {
757
+ $meta_data = get_option( $meta_data_name );
758
+ }
759
+
760
+ if( $meta_data == 'no_value' )
761
+ {
762
+ $meta_data = '';
763
+ }
764
+
765
+ return $meta_data;
766
+ }
767
+
768
+ public function render_meta_box( $post )
769
+ {
770
+ $this->post_id = $post->ID;
771
+
772
+ $enable_bg_sound = $this->get_meta_data( 'war_soundy_enable_bg_sound', true );
773
+ $audio_file_url = $this->get_meta_data( 'war_soundy_audio_file_url', false );
774
+ $audio_title = $this->get_meta_data( 'war_soundy_audio_title', false );
775
+ $autoplay = $this->get_meta_data( 'war_soundy_autoplay', true );
776
+ $loop = $this->get_meta_data( 'war_soundy_loop', true );
777
+
778
+ $audio_default_url = get_option( 'war_soundy_audio_file_url' );
779
+ $audio_default_title = get_option( 'war_soundy_audio_title' );
780
+ $audio_file_type = pathinfo( $audio_file_url, PATHINFO_EXTENSION );
781
+ ?>
782
+ <script>
783
+ war_bindMediaUploader( 'war_soundy_audio_file_url', 'war_audio_library_button', 'audio' );
784
+ </script>
785
+ <table class="form-table war_soundy">
786
+ <tr>
787
+ <th class="war_soundy">
788
+ <label for="war_soundy_enable_bg_sound">Enable Background Sound</label>
789
+ </th>
790
+ <td>
791
+ <input type="radio"
792
+ id="war_soundy_enable_bg_sound_default"
793
+ name="war_soundy_enable_bg_sound"
794
+ value="default" <?php echo ( $enable_bg_sound == 'default' ? 'checked' : '' ); ?>/>
795
+ <label for="war_soundy_enable_bg_sound_default" style="margin-right: 1em;">Default</label>
796
+
797
+ <input type="radio"
798
+ id="war_soundy_enable_bg_sound_yes"
799
+ name="war_soundy_enable_bg_sound"
800
+ value="yes" <?php echo ( $enable_bg_sound == 'yes' ? 'checked' : '' ); ?>/>
801
+ <label for="war_soundy_enable_bg_sound_yes" style="margin-right: 1em;">Yes</label>
802
+
803
+ <input type="radio"
804
+ id="war_soundy_enable_bg_sound_no"
805
+ name="war_soundy_enable_bg_sound"
806
+ value="no" <?php echo ( $enable_bg_sound == 'no' ? 'checked' : '' ); ?>/>
807
+ <label for="war_soundy_enable_bg_sound_no" style="margin-right: 1em;">No</label>
808
+ </td>
809
+ </tr>
810
+ <tr>
811
+ <th class="war_soundy">
812
+ <label for="war_soundy_audio_file_url">Audio File URL</label>
813
+ </th>
814
+ <td>
815
+ <?php $this->add_field_audio_file_URL_table( $audio_file_url,
816
+ $audio_file_type,
817
+ $audio_default_url,
818
+ $audio_default_title,
819
+ true ); ?>
820
+ </td>
821
+ </tr>
822
+ <tr>
823
+ <th class="war_soundy">
824
+ <label for="war_soundy_audio_title">Audio Title</label>
825
+ </th>
826
+ <td>
827
+ <input type="text"
828
+ class="war_soundy_audio_title_input_metabox"
829
+ value="<?php echo $audio_title; ?>"
830
+ name="war_soundy_audio_title"
831
+ id="war_soundy_audio_title" />
832
+ </td>
833
+ </tr>
834
+ <tr>
835
+ <th class="war_soundy">
836
+ <label for="war_soundy_autoplay">Autoplay</label>
837
+ </th>
838
+ <td>
839
+ <input type="radio"
840
+ id="war_soundy_autoplay_default"
841
+ name="war_soundy_autoplay"
842
+ value="default" <?php echo ( $autoplay == 'default' ? 'checked' : '' ); ?>/>
843
+ <label for="war_soundy_autoplay_default" style="margin-right: 1em;">Default</label>
844
+
845
+ <input type="radio"
846
+ id="war_soundy_autoplay_yes"
847
+ name="war_soundy_autoplay"
848
+ value="yes" <?php echo ( $autoplay == 'yes' ? 'checked' : '' ); ?>/>
849
+ <label for="war_soundy_autoplay_yes" style="margin-right: 1em;">Yes</label>
850
+
851
+ <input type="radio"
852
+ id="war_soundy_autoplay_no"
853
+ name="war_soundy_autoplay"
854
+ value="no" <?php echo ( $autoplay == 'no' ? 'checked' : '' ); ?>/>
855
+ <label for="war_soundy_autoplay_no" style="margin-right: 1em;">No</label>
856
+ </td>
857
+ </tr>
858
+ <tr>
859
+ <th class="war_soundy">
860
+ <label for="war_soundy_loop">Audio Repeat Loop</label>
861
+ </th>
862
+ <td>
863
+ <input type="radio"
864
+ id="war_soundy_loop_default"
865
+ name="war_soundy_loop"
866
+ value="default" <?php echo ( $loop == 'default' ? 'checked' : '' ); ?>/>
867
+ <label for="war_soundy_loop_default" style="margin-right: 1em;">Default</label>
868
+
869
+ <input type="radio"
870
+ id="war_soundy_loop_yes"
871
+ name="war_soundy_loop"
872
+ value="yes" <?php echo ( $loop == 'yes' ? 'checked' : '' ); ?>/>
873
+ <label for="war_soundy_loop_yes" style="margin-right: 1em;">Yes</label>
874
+
875
+ <input type="radio"
876
+ id="war_soundy_loop_no"
877
+ name="war_soundy_loop"
878
+ value="no" <?php echo ( $loop == 'no' ? 'checked' : '' ); ?>/>
879
+ <label for="war_soundy_loop_no" style="margin-right: 1em;">No</label>
880
+ </td>
881
+ </tr>
882
+ </table>
883
+ <!--
884
+ <script>
885
+ function war_show()
886
+ {
887
+ var src = jQuery( '#war_soundy_audio_player_source' ).attr( 'src' );
888
+ var type = jQuery( '#war_soundy_audio_player_source' ).attr( 'type' );
889
+
890
+ alert( 'src = ' + src + ' \ntype = ' + type );
891
+ }
892
+ </script>
893
+ <h1 onclick="war_show();">CLICK</h1>
894
+ -->
895
+
896
+ <?php
897
+ }
898
+
899
+ public function save_post_data( $post_id )
900
+ {
901
+ if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
902
+ return $post_id;
903
+
904
+ if ( 'page' == $_POST[ 'post_type' ] )
905
+ {
906
+ if ( ! current_user_can( 'edit_page', $post_id ) )
907
+ return $post_id;
908
+ }
909
+ else
910
+ {
911
+ if ( ! current_user_can( 'edit_post', $post_id ) )
912
+ return $post_id;
913
+ }
914
+
915
+ update_post_meta( $post_id,
916
+ 'war_soundy_enable_bg_sound',
917
+ $_POST[ 'war_soundy_enable_bg_sound' ] );
918
+
919
+ $audio_file_url = $this->do_sanitize_field( $_POST[ 'war_soundy_audio_file_url' ] );
920
+ update_post_meta( $post_id,
921
+ 'war_soundy_audio_file_url',
922
+ $audio_file_url );
923
+
924
+ $audio_title = $this->do_sanitize_field( $_POST[ 'war_soundy_audio_title' ] );
925
+
926
+ if( trim( $audio_file_url ) == '' )
927
+ {
928
+ $audio_title = '';
929
+ }
930
+ elseif( trim( $audio_title ) == '' )
931
+ {
932
+ $audio_title = 'no_value';
933
+ }
934
+
935
+ update_post_meta( $post_id,
936
+ 'war_soundy_audio_title',
937
+ $audio_title );
938
+
939
+ update_post_meta( $post_id,
940
+ 'war_soundy_autoplay',
941
+ $_POST[ 'war_soundy_autoplay' ] );
942
+
943
+ update_post_meta( $post_id,
944
+ 'war_soundy_loop',
945
+ $_POST[ 'war_soundy_loop' ] );
946
+ }
947
+
948
+ public function insert_audio()
949
+ {
950
+ $this->post_id = get_the_ID();
951
+
952
+ $enable_bg_sound = $this->get_meta_data( 'war_soundy_enable_bg_sound' );
953
+ if( $enable_bg_sound != 'yes' ) return;
954
+
955
+ if( $this->user_agent_is_mobile && $this->disable_soundy_for_mobile ) return;
956
+
957
+ $audio_file_url = $this->get_meta_data( 'war_soundy_audio_file_url' );
958
+ if( $audio_file_url == '' ) return;
959
+ $audio_type = $this->get_audio_type_from_URL( $audio_file_url );
960
+
961
+ $this->autoplay = $this->get_meta_data( 'war_soundy_autoplay' );
962
+ $auto_play = ( $this->autoplay == 'yes' ) ? 'autoplay' : '';
963
+
964
+ $repeat_loop = $this->get_meta_data( 'war_soundy_loop' );
965
+ $audio_loop = ( $repeat_loop == 'yes' ) ? 'loop' : '';
966
+
967
+ $pp_code = $this->get_pp_button_code( 'corner' );
968
+
969
+ $audio_code =
970
+
971
+ '<div style="display: none">' .
972
+ ' <audio id="war_soundy_audio" preload="auto" ' . $auto_play . ' ' . $audio_loop . ' style="display: none;" hidden>' .
973
+ ' <source src="' . $audio_file_url . '" type="audio/' . $audio_type . '">' .
974
+ ' </audio>' .
975
+ '</div>';
976
+
977
+ $pp_code = str_replace( array( "\n", "\r" ), ' ', $pp_code );
978
+ $audio_code = str_replace( array( "\n", "\r" ), ' ', $audio_code );
979
+ wp_enqueue_scripts( 'jquery' );
980
+ ?>
981
+ <link rel="prefetch" href="<?php echo $audio_file_url; ?>">
982
+ <link rel="prefetch" href="<?php echo $this->button_url_play; ?>">
983
+ <link rel="prefetch" href="<?php echo $this->button_url_pause; ?>">
984
+ <link rel="prefetch" href="<?php echo $this->hover_url_play; ?>">
985
+ <link rel="prefetch" href="<?php echo $this->hover_url_pause; ?>">
986
+ <script>
987
+ var war_soundy_pp_button_is_inserted = false;
988
+
989
+ jQuery( document ).ready( function()
990
+ {
991
+ <?php if( $pp_code != '' ): ?>
992
+ if( ! war_soundy_pp_button_is_inserted )
993
+ {
994
+ jQuery( 'body' ).append( '<?php echo $pp_code; ?>' );
995
+ war_soundy_pp_button_is_inserted = true;
996
+ }
997
+ <?php endif; ?>
998
+
999
+ jQuery( 'body' ).append( '<?php echo $audio_code; ?>' );
1000
+
1001
+ war_soundy_player = jQuery( '#war_soundy_audio' )[ 0 ];
1002
+ war_soundy_audio_control = jQuery( '#war_soundy_audio_control' );
1003
+
1004
+ war_soundy_hovering = false;
1005
+
1006
+ if( war_soundy_pp_button_is_inserted )
1007
+ {
1008
+ war_soundy_audio_control.click(
1009
+ function()
1010
+ {
1011
+ if( war_soundy_player.paused )
1012
+ {
1013
+ war_soundy_player.play();
1014
+ war_soundy_audio_control.attr( 'src', '<?php echo $this->hover_url_pause; ?>' );
1015
+ }
1016
+ else
1017
+ {
1018
+ war_soundy_player.pause();
1019
+ war_soundy_audio_control.attr( 'src', '<?php echo $this->hover_url_play; ?>' );
1020
+ }
1021
+ } );
1022
+
1023
+ war_soundy_audio_control.hover(
1024
+ function()
1025
+ {
1026
+ war_soundy_hovering = true;
1027
+ if( war_soundy_player.paused )
1028
+ {
1029
+ war_soundy_audio_control.attr( 'src', '<?php echo $this->hover_url_play; ?>' );
1030
+ }
1031
+ else
1032
+ {
1033
+ war_soundy_audio_control.attr( 'src', '<?php echo $this->hover_url_pause; ?>' );
1034
+ }
1035
+ },
1036
+ function()
1037
+ {
1038
+ war_soundy_hovering = false;
1039
+ if( war_soundy_player.paused )
1040
+ {
1041
+ jQuery( '#war_soundy_audio_control' ).attr( 'src', '<?php echo $this->button_url_play; ?>' );
1042
+ }
1043
+ else
1044
+ {
1045
+ jQuery( '#war_soundy_audio_control' ).attr( 'src', '<?php echo $this->button_url_pause; ?>' );
1046
+ }
1047
+ }
1048
+ );
1049
+
1050
+ jQuery( '#war_soundy_audio' ).bind( 'ended' , function()
1051
+ {
1052
+ if( war_soundy_hovering )
1053
+ {
1054
+ war_soundy_audio_control.attr( 'src', '<?php echo $this->hover_url_play; ?>' );
1055
+ }
1056
+ else
1057
+ {
1058
+ war_soundy_audio_control.attr( 'src', '<?php echo $this->button_url_play; ?>' );
1059
+ }
1060
+ } );
1061
+
1062
+ jQuery( '#war_soundy_audio' ).bind( 'play' , function()
1063
+ {
1064
+ if( war_soundy_hovering )
1065
+ {
1066
+ war_soundy_audio_control.attr( 'src', '<?php echo $this->hover_url_pause; ?>' );
1067
+ }
1068
+ else
1069
+ {
1070
+ war_soundy_audio_control.attr( 'src', '<?php echo $this->button_url_pause; ?>' );
1071
+ }
1072
+ } );
1073
+
1074
+ if( war_soundy_player.autoplay )
1075
+ {
1076
+ if( <?php echo $this->user_agent_is_IOS() ?> )
1077
+ {
1078
+ if( war_soundy_hovering )
1079
+ {
1080
+ war_soundy_audio_control.attr( 'src', '<?php echo $this->hover_url_play; ?>' );
1081
+ }
1082
+ else
1083
+ {
1084
+ war_soundy_audio_control.attr( 'src', '<?php echo $this->button_url_play; ?>' );
1085
+ }
1086
+ }
1087
+ }
1088
+ }
1089
+ } );
1090
+ </script>
1091
+ <?php
1092
+ }
1093
+
1094
+ private $button_url_play;
1095
+ private $hover_url_play;
1096
+ private $button_url_pause;
1097
+ private $hover_url_pause;
1098
+
1099
+ public function get_pp_button_code( $mode )
1100
+ {
1101
+ $display_play_pause = $this->get_meta_data( 'war_soundy_display_play_pause' );
1102
+ if( $display_play_pause != 'yes' ) return '';
1103
+
1104
+ $enable_bg_sound = $this->get_meta_data( 'war_soundy_enable_bg_sound' );
1105
+ if( $enable_bg_sound != 'yes' ) return '';
1106
+
1107
+ $this->button_url_play = get_option( 'war_soundy_url_play_button' );
1108
+ $this->hover_url_play = get_option( 'war_soundy_url_play_hover' );
1109
+ $this->button_url_pause = get_option( 'war_soundy_url_pause_button' );
1110
+ $this->hover_url_pause = get_option( 'war_soundy_url_pause_hover' );
1111
+
1112
+ $button_position = get_option( 'war_soundy_pp_position' );
1113
+ $position = ( $button_position == 'document' ) ? 'absolute' : 'fixed';
1114
+
1115
+ if( $mode == 'corner' )
1116
+ {
1117
+ $button_corner = get_option( 'war_soundy_pp_corner' );
1118
+ switch( $button_corner )
1119
+ {
1120
+ case upper_right:
1121
+ $dim_x = 'right';
1122
+ $dim_y = 'top';
1123
+ break;
1124
+ case upper_left:
1125
+ $dim_x = 'left';
1126
+ $dim_y = 'top';
1127
+ break;
1128
+ case bottom_right:
1129
+ $dim_x = 'right';
1130
+ $dim_y = 'bottom';
1131
+ break;
1132
+ case bottom_left:
1133
+ $dim_x = 'left';
1134
+ $dim_y = 'bottom';
1135
+ break;
1136
+ }
1137
+
1138
+ $button_x = get_option( 'war_soundy_offset_x' ) .
1139
+ get_option( 'war_soundy_offset_x_unit' );
1140
+ $button_y = get_option( 'war_soundy_offset_y' ) .
1141
+ get_option( 'war_soundy_offset_y_unit' );
1142
+
1143
+ $position_css_code = "position: $position; $dim_x: $button_x; $dim_y: $button_y;";
1144
+ }
1145
+ else
1146
+ {
1147
+ $position_css_code = '';
1148
+ }
1149
+
1150
+ $audio_button_url = ( $this->autoplay == 'yes' ) ? $this->button_url_pause : $this->button_url_play;
1151
+
1152
+ $audio_title = $this->get_meta_data( 'war_soundy_audio_title' );
1153
+
1154
+ $pp_code =
1155
+
1156
+ '<img id="war_soundy_audio_control"' .
1157
+ ' src="' . $audio_button_url . '"' .
1158
+ ' title="' . $audio_title . '"' .
1159
+ ' style="' . $position_css_code . ' cursor: pointer; z-index: 99999999;">';
1160
+
1161
+ return $pp_code;
1162
+ }
1163
+
1164
+ public function do_sanitize_field( $value )
1165
+ {
1166
+ return htmlentities( sanitize_text_field( $value ), ENT_QUOTES, 'UTF-8' );
1167
+ }
1168
+
1169
+ public function soundy_shortcode( $atts )
1170
+ {
1171
+ if( $atts[ 0 ] && $atts[ 0 ] == 'title' )
1172
+ {
1173
+ return soundy_get_title();
1174
+ }
1175
+ elseif( $atts[ 0 ] && $atts[ 0 ] == 'button' )
1176
+ {
1177
+ return soundy_get_button();
1178
+ }
1179
+ }
1180
+
1181
+ public function check_user_agent ( $type = NULL )
1182
+ {
1183
+ $user_agent = strtolower ( $_SERVER['HTTP_USER_AGENT'] );
1184
+ if ( $type == 'bot' )
1185
+ {
1186
+ // matches popular bots
1187
+ if ( preg_match ( "/googlebot|adsbot|yahooseeker|yahoobot|msnbot|watchmouse|pingdom\.com|feedfetcher-google/", $user_agent ) )
1188
+ {
1189
+ return true;
1190
+ // watchmouse|pingdom\.com are "uptime services"
1191
+ }
1192
+ }
1193
+ elseif ( $type == 'browser' )
1194
+ {
1195
+ // matches core browser types
1196
+ if ( preg_match ( "/mozilla\/|opera\//", $user_agent ) )
1197
+ {
1198
+ return true;
1199
+ }
1200
+ }
1201
+ elseif ( $type == 'mobile' )
1202
+ {
1203
+ // matches popular mobile devices that have small screens and/or touch inputs
1204
+ // mobile devices have regional trends; some of these will have varying popularity in Europe, Asia, and America
1205
+ // detailed demographics are unknown, and South America, the Pacific Islands, and Africa trends might not be represented, here
1206
+ if ( preg_match ( "/phone|iphone|itouch|ipod|symbian|android|htc_|htc-|palmos|blackberry|opera mini|iemobile|windows ce|nokia|fennec|hiptop|kindle|mot |mot-|webos\/|samsung|sonyericsson|^sie-|nintendo/", $user_agent ) )
1207
+ {
1208
+ // these are the most common
1209
+ return true;
1210
+ }
1211
+ elseif ( preg_match ( "/mobile|pda;|avantgo|eudoraweb|minimo|netfront|brew|teleca|lg;|lge |wap;| wap /", $user_agent ) )
1212
+ {
1213
+ // these are less common, and might not be worth checking
1214
+ return true;
1215
+ }
1216
+ }
1217
+ return false;
1218
+ }
1219
+
1220
+ public function user_agent_is_IOS()
1221
+ {
1222
+ $user_agent = strtolower ( $_SERVER['HTTP_USER_AGENT'] );
1223
+
1224
+ if( preg_match ( "/ipod|iphone|ipad/", $user_agent ) )
1225
+ {
1226
+ return 'true';
1227
+ }
1228
+ else
1229
+ {
1230
+ return 'false';
1231
+ }
1232
+ }
1233
+ }
1234
+
1235
+ $war_soundy = new WarSoundy();
1236
+
1237
+ function soundy_get_button()
1238
+ {
1239
+ global $war_soundy;
1240
+
1241
+ $pp_code = $war_soundy->get_pp_button_code( '' );
1242
+ if( $pp_code != '' )
1243
+ {
1244
+ $pp_code = '<script>' .
1245
+ 'jQuery( "#war_soundy_audio_control" ).remove();' .
1246
+ 'war_soundy_pp_button_is_inserted = true;' .
1247
+ '</script>' .
1248
+ $pp_code;
1249
+ }
1250
+
1251
+ return $pp_code;
1252
+ }
1253
+
1254
+ function soundy_button()
1255
+ {
1256
+ $pp_code = soundy_get_button();
1257
+ echo $pp_code;
1258
+ }
1259
+
1260
+ function soundy_get_title()
1261
+ {
1262
+ global $war_soundy;
1263
+
1264
+ $title = $war_soundy->get_meta_data( 'war_soundy_audio_title' );
1265
+
1266
+ return $title;
1267
+ }
1268
+
1269
+ function soundy_title()
1270
+ {
1271
+ $title = soundy_get_title();
1272
+ echo $title;
1273
+ }
1274
+ ?>
templates/settings.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap">
2
+ <h2>Soundy Plugin Settings</h2>
3
+
4
+ <p>All these settings are default settings for all pages and posts</p>
5
+
6
+ <form method="post" action="options.php">
7
+ <?php settings_fields( 'war_soundy' ); ?>
8
+ <script>
9
+ <?php
10
+ if( isset( $_GET[ 'settings-updated' ] ) && $_GET[ 'settings-updated' ] == 'true' )
11
+ {
12
+ ?>
13
+ if( ! sessionStorage.getItem( 'war_soundy_tab_index' ) )
14
+ sessionStorage.setItem( 'war_soundy_tab_index', 0 );
15
+ <?php
16
+ }
17
+ else
18
+ {
19
+ ?>
20
+ sessionStorage.setItem( 'war_soundy_tab_index', 0 );
21
+ <?php
22
+ }
23
+ ?>
24
+ jQuery( document ).ready( function( $ ) {
25
+ $( "#tabs" ).tabs(
26
+ {
27
+ active: sessionStorage.war_soundy_tab_index,
28
+ activate : function( event, ui )
29
+ {
30
+ // Get future value
31
+ var new_index = ui.newTab.index();
32
+ sessionStorage.setItem( 'war_soundy_tab_index', new_index );
33
+ }
34
+ } );
35
+ } );
36
+ </script>
37
+
38
+ <div id="tabs">
39
+ <ul>
40
+ <li><a href="#war_soundy_audio_track">Audio Track</a></li>
41
+ <li><a href="#war_soundy_play_pause_button">Play/Pause Button</a></li>
42
+ <li><a href="#war_soundy_play_pause_position_corner">Play/Pause Corner Position</a></li>
43
+ <li><a href="#war_soundy_play_pause_position_static">Play/Pause Static Position</a></li>
44
+ </ul>
45
+ <div id="war_soundy_audio_track">
46
+ <?php $this->do_settings_section( 'soundy', 'war_soundy_settings_section_audio_track' ); ?>
47
+ </div>
48
+ <div id="war_soundy_play_pause_button">
49
+ <?php $this->do_settings_section( 'soundy', 'war_soundy_settings_section_play_pause_button' ); ?>
50
+ </div>
51
+ <div id="war_soundy_play_pause_position_corner">
52
+ <?php $this->do_settings_section( 'soundy', 'war_soundy_settings_section_play_pause_position_corner' ); ?>
53
+ </div>
54
+ <div id="war_soundy_play_pause_position_static">
55
+ <?php $this->do_settings_section( 'soundy', 'war_soundy_settings_section_play_pause_position_static' ); ?>
56
+ </div>
57
+ </div>
58
+
59
+ <?php submit_button(); ?>
60
+ </form>
61
+ </div>