Version Description
- Added option "Compatibility mode"
- Added new button styles
- Added new list styles
- Added new shortcode media
- Added new shortcode table
Download this release
Release Info
Developer | gn_themes |
Plugin | Shortcodes Ultimate |
Version | 1.5.0 |
Comparing to | |
See all releases |
Code changes from version 1.4.1 to 1.5.0
- css/style.css +103 -3
- images/button-style-3.png +0 -0
- images/button-style-4.png +0 -0
- images/list-style-event.png +0 -0
- images/list-style-gear.png +0 -0
- images/list-style-guard.png +0 -0
- images/list-style-idea.png +0 -0
- images/list-style-link.png +0 -0
- images/list-style-note.png +0 -0
- images/list-style-plus.png +0 -0
- images/list-style-settings.png +0 -0
- images/list-style-thumbs.png +0 -0
- images/list-style-time.png +0 -0
- images/list-style-twitter.png +0 -0
- images/media-audio.jpg +0 -0
- js/init.js +4 -0
- js/jwplayer.js +1 -0
- languages/shortcodes-ultimate-ru_RU.mo +0 -0
- languages/shortcodes-ultimate-ru_RU.po +61 -48
- lib/admin.php +190 -0
- lib/color.php +85 -0
- lib/csv.php +110 -0
- lib/media.php +84 -0
- lib/player.swf +0 -0
- lib/shortcodes.php +385 -0
- lib/timthumb.php +762 -0
- readme.txt +8 -1
- screenshot-3.png +0 -0
- shortcodes-ultimate.php +98 -639
css/style.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* Shortcodes Ultimate stylesheet
|
3 |
-
|
4 |
|
5 |
/* Spacer */
|
6 |
.su-spacer {
|
@@ -214,6 +214,17 @@
|
|
214 |
.su-list-style-arrow li { background: 0 50% url(../images/list-style-arrow.png) no-repeat }
|
215 |
.su-list-style-check li { background: 0 50% url(../images/list-style-check.png) no-repeat }
|
216 |
.su-list-style-cross li { background: 0 50% url(../images/list-style-cross.png) no-repeat }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
|
218 |
/* Box */
|
219 |
.su-box {
|
@@ -253,10 +264,15 @@
|
|
253 |
text-decoration: none !important;
|
254 |
}
|
255 |
.su-button span {
|
256 |
-
display: block;
|
257 |
text-decoration: none !important;
|
258 |
}
|
259 |
|
|
|
|
|
|
|
|
|
|
|
260 |
.su-button-style-1 span {
|
261 |
background: 0 -20px url(../images/button-style-1.png) repeat-x;
|
262 |
}
|
@@ -271,6 +287,20 @@
|
|
271 |
background: 100% 50% url(../images/button-style-2.png) repeat-x;
|
272 |
}
|
273 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
274 |
/* Fancy link */
|
275 |
|
276 |
.su-fancy-link {
|
@@ -317,4 +347,74 @@
|
|
317 |
margin: 0 !important;
|
318 |
padding: 0 !important;
|
319 |
}
|
320 |
-
.su-service-content { line-height: 1.4 }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
/**
|
2 |
* Shortcodes Ultimate stylesheet
|
3 |
+
*/
|
4 |
|
5 |
/* Spacer */
|
6 |
.su-spacer {
|
214 |
.su-list-style-arrow li { background: 0 50% url(../images/list-style-arrow.png) no-repeat }
|
215 |
.su-list-style-check li { background: 0 50% url(../images/list-style-check.png) no-repeat }
|
216 |
.su-list-style-cross li { background: 0 50% url(../images/list-style-cross.png) no-repeat }
|
217 |
+
.su-list-style-thumbs li { background: 0 50% url(../images/list-style-thumbs.png) no-repeat }
|
218 |
+
.su-list-style-link li { background: 0 50% url(../images/list-style-link.png) no-repeat }
|
219 |
+
.su-list-style-gear li { background: 0 50% url(../images/list-style-gear.png) no-repeat }
|
220 |
+
.su-list-style-time li { background: 0 50% url(../images/list-style-time.png) no-repeat }
|
221 |
+
.su-list-style-note li { background: 0 50% url(../images/list-style-note.png) no-repeat }
|
222 |
+
.su-list-style-plus li { background: 0 50% url(../images/list-style-plus.png) no-repeat }
|
223 |
+
.su-list-style-guard li { background: 0 50% url(../images/list-style-guard.png) no-repeat }
|
224 |
+
.su-list-style-event li { background: 0 50% url(../images/list-style-event.png) no-repeat }
|
225 |
+
.su-list-style-idea li { background: 0 50% url(../images/list-style-idea.png) no-repeat }
|
226 |
+
.su-list-style-settings li { background: 0 50% url(../images/list-style-settings.png) no-repeat }
|
227 |
+
.su-list-style-twitter li { background: 0 50% url(../images/list-style-twitter.png) no-repeat }
|
228 |
|
229 |
/* Box */
|
230 |
.su-box {
|
264 |
text-decoration: none !important;
|
265 |
}
|
266 |
.su-button span {
|
267 |
+
display: block !important;
|
268 |
text-decoration: none !important;
|
269 |
}
|
270 |
|
271 |
+
.su-button img {
|
272 |
+
display: inline !important;
|
273 |
+
padding: 0 !important;
|
274 |
+
}
|
275 |
+
|
276 |
.su-button-style-1 span {
|
277 |
background: 0 -20px url(../images/button-style-1.png) repeat-x;
|
278 |
}
|
287 |
background: 100% 50% url(../images/button-style-2.png) repeat-x;
|
288 |
}
|
289 |
|
290 |
+
.su-button-style-3 span {
|
291 |
+
background: 0 50% url(../images/button-style-3.png) no-repeat;
|
292 |
+
}
|
293 |
+
.su-button-style-3:hover span {
|
294 |
+
background: -710px 50% url(../images/button-style-3.png) no-repeat;
|
295 |
+
}
|
296 |
+
|
297 |
+
.su-button-style-4 span {
|
298 |
+
background: 0 0 url(../images/button-style-4.png) repeat-x;
|
299 |
+
}
|
300 |
+
.su-button-style-4:hover span {
|
301 |
+
background: 0 0 url(../images/button-style-1.png) repeat-x;
|
302 |
+
}
|
303 |
+
|
304 |
/* Fancy link */
|
305 |
|
306 |
.su-fancy-link {
|
347 |
margin: 0 !important;
|
348 |
padding: 0 !important;
|
349 |
}
|
350 |
+
.su-service-content { line-height: 1.4 }
|
351 |
+
|
352 |
+
/* Media */
|
353 |
+
.su-media {
|
354 |
+
margin: 0 0 1.5em 0;
|
355 |
+
}
|
356 |
+
|
357 |
+
/* Table */
|
358 |
+
.su-table {
|
359 |
+
width: 100% !important;
|
360 |
+
margin: 0 0 1.5em 0 !important;
|
361 |
+
border-collapse: collapse !important;
|
362 |
+
font-size: 1em !important;
|
363 |
+
}
|
364 |
+
.su-table th {
|
365 |
+
text-align: center !important;
|
366 |
+
padding: 10px !important;
|
367 |
+
font-size: 1em !important;
|
368 |
+
font-weight: normal !important;
|
369 |
+
color: #333 !important;
|
370 |
+
}
|
371 |
+
.su-table td {
|
372 |
+
padding: 10px 15px !important;
|
373 |
+
}
|
374 |
+
.su-table .su-even td {}
|
375 |
+
|
376 |
+
.su-table-style-1 table {
|
377 |
+
border: 1px solid #ccc !important;
|
378 |
+
}
|
379 |
+
.su-table-style-1 th {
|
380 |
+
border: 1px solid #ccc !important;
|
381 |
+
background: #f0f0f0 !important;
|
382 |
+
}
|
383 |
+
.su-table-style-1 td {
|
384 |
+
border: 1px solid #ccc !important;
|
385 |
+
background: #fff !important;
|
386 |
+
}
|
387 |
+
.su-table-style-1 .su-even td {
|
388 |
+
background: #f7f7f7 !important;
|
389 |
+
}
|
390 |
+
|
391 |
+
.su-table-style-2 table {
|
392 |
+
border: none !important;
|
393 |
+
}
|
394 |
+
.su-table-style-2 th {
|
395 |
+
border: none !important;
|
396 |
+
background: #f0f0f0 !important;
|
397 |
+
}
|
398 |
+
.su-table-style-2 td {
|
399 |
+
border: none !important;
|
400 |
+
background: #fff !important;
|
401 |
+
}
|
402 |
+
.su-table-style-2 .su-even td {
|
403 |
+
background: #f7f7f7 !important;
|
404 |
+
}
|
405 |
+
|
406 |
+
.su-table-style-3 table {
|
407 |
+
border: none !important;
|
408 |
+
}
|
409 |
+
.su-table-style-3 th {
|
410 |
+
border: none !important;
|
411 |
+
border-bottom: 2px solid #666 !important;
|
412 |
+
background: #fff !important;
|
413 |
+
}
|
414 |
+
.su-table-style-3 td {
|
415 |
+
border: none !important;
|
416 |
+
background: #fff !important;
|
417 |
+
}
|
418 |
+
.su-table-style-3 .su-even td {
|
419 |
+
background: #fff !important;
|
420 |
+
}
|
images/button-style-3.png
ADDED
Binary file
|
images/button-style-4.png
ADDED
Binary file
|
images/list-style-event.png
ADDED
Binary file
|
images/list-style-gear.png
ADDED
Binary file
|
images/list-style-guard.png
ADDED
Binary file
|
images/list-style-idea.png
ADDED
Binary file
|
images/list-style-link.png
ADDED
Binary file
|
images/list-style-note.png
ADDED
Binary file
|
images/list-style-plus.png
ADDED
Binary file
|
images/list-style-settings.png
ADDED
Binary file
|
images/list-style-thumbs.png
ADDED
Binary file
|
images/list-style-time.png
ADDED
Binary file
|
images/list-style-twitter.png
ADDED
Binary file
|
images/media-audio.jpg
ADDED
Binary file
|
js/init.js
CHANGED
@@ -18,4 +18,8 @@ jQuery(document).ready(function($) {
|
|
18 |
$('.su-tabs-nav').delegate('span:not(.su-tabs-current)', 'click', function() {
|
19 |
$(this).addClass('su-tabs-current').siblings().removeClass('su-tabs-current').parents('.su-tabs').find('.su-tabs-pane').hide().eq($(this).index()).show();
|
20 |
});
|
|
|
|
|
|
|
|
|
21 |
});
|
18 |
$('.su-tabs-nav').delegate('span:not(.su-tabs-current)', 'click', function() {
|
19 |
$(this).addClass('su-tabs-current').siblings().removeClass('su-tabs-current').parents('.su-tabs').find('.su-tabs-pane').hide().eq($(this).index()).show();
|
20 |
});
|
21 |
+
|
22 |
+
// Tables
|
23 |
+
$('.su-table tr:even').addClass('su-even');
|
24 |
+
|
25 |
});
|
js/jwplayer.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
var jwplayer=function(a){return jwplayer.constructor(a)};jwplayer.constructor=function(a){};var $jw=jwplayer;jwplayer.version="5.4.1492";(function(b){b.utils=function(){};b.utils.typeOf=function(e){var d=typeof e;if(d==="object"){if(e){if(e instanceof Array){d="array"}}else{d="null"}}return d};b.utils.extend=function(){var d=b.utils.extend["arguments"];if(d.length>1){for(var f=1;f<d.length;f++){for(var e in d[f]){d[0][e]=d[f][e]}}return d[0]}return null};b.utils.clone=function(g){var d;var e=b.utils.clone["arguments"];if(e.length==1){switch(b.utils.typeOf(e[0])){case"object":d={};for(var f in e[0]){d[f]=b.utils.clone(e[0][f])}break;case"array":d=[];for(var f in e[0]){d[f]=b.utils.clone(e[0][f])}break;default:return e[0];break}}return d};b.utils.extension=function(d){d=d.substring(d.lastIndexOf("/")+1,d.length);d=d.split("?")[0];if(d.lastIndexOf(".")>-1){return d.substr(d.lastIndexOf(".")+1,d.length).toLowerCase()}return""};b.utils.html=function(d,e){d.innerHTML=e};b.utils.append=function(d,e){d.appendChild(e)};b.utils.wrap=function(d,e){d.parentNode.replaceChild(e,d);e.appendChild(d)};b.utils.ajax=function(g,f,d){var e;if(window.XMLHttpRequest){e=new XMLHttpRequest()}else{e=new ActiveXObject("Microsoft.XMLHTTP")}e.onreadystatechange=function(){if(e.readyState===4){if(e.status===200){if(f){f(e)}}else{if(d){d(g)}}}};e.open("GET",g,true);e.send(null);return e};b.utils.load=function(e,f,d){e.onreadystatechange=function(){if(e.readyState===4){if(e.status===200){if(f){f()}}else{if(d){d()}}}}};b.utils.find=function(e,d){return e.getElementsByTagName(d)};b.utils.append=function(d,e){d.appendChild(e)};b.utils.isIE=function(){return(!+"\v1")};b.utils.isLegacyAndroid=function(){var d=navigator.userAgent.toLowerCase();return(d.match(/android 2.[012]/i)!==null)};b.utils.isIOS=function(){var d=navigator.userAgent.toLowerCase();return(d.match(/iP(hone|ad)/i)!==null)};b.utils.getFirstPlaylistItemFromConfig=function(d){var e={};var f;if(d.playlist&&d.playlist.length){f=d.playlist[0]}else{f=d}e.file=f.file;e.levels=f.levels;e.streamer=f.streamer;e.playlistfile=f.playlistfile;if(e.file&&e.file.toLowerCase().indexOf("youtube.com")>-1){e.provider="youtube"}if(e.streamer&&e.streamer.toLowerCase().indexOf("rtmp://")==0){e.provider="rtmp"}if(f.type){e.provider=f.type.toLowerCase()}else{if(f.provider){e.provider=f.provider.toLowerCase()}}return e};b.utils.flashSupportsConfig=function(d){if(b.utils.hasFlash()){if(d){var f=b.utils.getFirstPlaylistItemFromConfig(d);if(typeof f.file=="undefined"&&typeof f.levels=="undefined"){return true}else{if(f.file){return b.utils.flashCanPlay(f.file,f.provider)}else{if(f.levels&&f.levels.length){for(var e=0;e<f.levels.length;e++){if(f.levels[e].file&&b.utils.flashCanPlay(f.levels[e].file,f.provider)){return true}}}}}}else{return true}}return false};b.utils.flashCanPlay=function(d,f){var e=["video","http","sound","image"];if(f&&(e.indexOf(f<0))){return true}var g=b.utils.extension(d);if(!g){return true}if(b.utils.extensionmap[g]!==undefined&&b.utils.extensionmap[g].flash===undefined){return false}return true};b.utils.html5SupportsConfig=function(e){var d=document.createElement("video");if(!!d.canPlayType){if(e){var g=b.utils.getFirstPlaylistItemFromConfig(e);if(typeof g.file=="undefined"&&typeof g.levels=="undefined"){return true}else{if(g.file){return b.utils.html5CanPlay(d,g.file,g.provider,g.playlistfile)}else{if(g.levels&&g.levels.length){for(var f=0;f<g.levels.length;f++){if(g.levels[f].file&&b.utils.html5CanPlay(d,g.levels[f].file,g.provider,g.playlistfile)){return true}}}}}}else{return true}}return false};b.utils.html5CanPlay=function(f,e,g,d){if(d){return false}if(g&&g=="youtube"){return true}if(g&&g!="video"){return false}var h=b.utils.extension(e);if(b.utils.isLegacyAndroid()&&h.match(/m4v|mp4/)){return true}return b.utils.browserCanPlay(f,h)};b.utils.browserCanPlay=function(e,f){var d;if(!f){return true}else{if(b.utils.extensionmap[f]!==undefined&&b.utils.extensionmap[f].html5===undefined){return false}else{if(b.utils.extensionmap[f]!==undefined&&b.utils.extensionmap[f].html5!==undefined){d=b.utils.extensionmap[f].html5}else{d="video/"+f+";"}}}return e.canPlayType(d)};b.utils.downloadSupportsConfig=function(d){if(d){var f=b.utils.getFirstPlaylistItemFromConfig(d);if(typeof f.file=="undefined"&&typeof f.levels=="undefined"){return true}else{if(f.file){return b.utils.canDownload(f.file,f.provider,f.playlistfile)}else{if(f.levels&&f.levels.length){for(var e=0;e<f.levels.length;e++){if(f.levels[e].file&&b.utils.canDownload(f.levels[e].file,f.provider,f.playlistfile)){return true}}}}}}else{return true}};b.utils.canDownload=function(e,g,d){if(d){return false}var f=["image","sound","youtube"];if(g&&(f.indexOf(g)>-1)){return true}if(!g||(g&&g=="video")){var h=b.utils.extension(e);if(h&&b.utils.extensionmap[h]){return true}}return false};b.utils.getOuterHTML=function(e){if(e.outerHTML){return e.outerHTML}else{var f=e.parentNode;var d=document.createElement(f.tagName);d.appendChild(e);var g=d.innerHTML;f.appendChild(e);return g}};b.utils.setOuterHTML=function(g,f){if(g.outerHTML){g.outerHTML=f}else{var h=document.createElement("div");h.innerHTML=f;var d=document.createRange();d.selectNodeContents(h);var e=d.extractContents();g.parentNode.insertBefore(e,g);g.parentNode.removeChild(g)}};b.utils.hasFlash=function(){return(typeof navigator.plugins!="undefined"&&typeof navigator.plugins["Shockwave Flash"]!="undefined")||(typeof window.ActiveXObject!="undefined")};b.utils.getPluginName=function(d){if(d.lastIndexOf("/")>=0){d=d.substring(d.lastIndexOf("/")+1,d.length)}if(d.lastIndexOf("-")>=0){d=d.substring(0,d.lastIndexOf("-"))}if(d.lastIndexOf(".swf")>=0){d=d.substring(0,d.lastIndexOf(".swf"))}return d};b.utils.getAbsolutePath=function(k,j){if(j===undefined){j=document.location.href}if(k===undefined){return undefined}if(a(k)){return k}var l=j.substring(0,j.indexOf("://")+3);var h=j.substring(l.length,j.indexOf("/",l.length+1));var e;if(k.indexOf("/")===0){e=k.split("/")}else{var f=j.split("?")[0];f=f.substring(l.length+h.length+1,f.lastIndexOf("/"));e=f.split("/").concat(k.split("/"))}var d=[];for(var g=0;g<e.length;g++){if(!e[g]||e[g]===undefined||e[g]=="."){continue}else{if(e[g]==".."){d.pop()}else{d.push(e[g])}}}return l+h+"/"+d.join("/")};function a(e){if(e===null){return}var f=e.indexOf("://");var d=e.indexOf("?");return(f>0&&(d<0||(d>f)))}b.utils.mapEmpty=function(d){for(var e in d){return false}return true};b.utils.mapLength=function(e){var d=0;for(var f in e){d++}return d};b.utils.log=function(e,d){if(typeof console!="undefined"&&typeof console.log!="undefined"){if(d){console.log(e,d)}else{console.log(e)}}};b.utils.css=function(e,h,d){if(e!==undefined){for(var f in h){try{if(typeof h[f]==="undefined"){continue}else{if(typeof h[f]=="number"&&!(f=="zIndex"||f=="opacity")){if(isNaN(h[f])){continue}if(f.match(/color/i)){h[f]="#"+c(h[f].toString(16),6)}else{h[f]=h[f]+"px"}}}e.style[f]=h[f]}catch(g){}}}};function c(d,e){while(d.length<e){d="0"+d}return d}b.utils.isYouTube=function(d){return d.indexOf("youtube.com")>-1};b.utils.getYouTubeId=function(d){d.indexOf("youtube.com">0)};b.utils.transform=function(d,e){d.style.webkitTransform=e;d.style.MozTransform=e;d.style.OTransform=e};b.utils.stretch=function(i,n,m,g,l,h){if(typeof m=="undefined"||typeof g=="undefined"||typeof l=="undefined"||typeof h=="undefined"){return}var e=m/l;var f=g/h;var k=0;var j=0;n.style.overflow="hidden";b.utils.transform(n,"");var d={};switch(i.toLowerCase()){case b.utils.stretching.NONE:d.width=l;d.height=h;break;case b.utils.stretching.UNIFORM:if(e>f){d.width=l*f;d.height=h*f}else{d.width=l*e;d.height=h*e}break;case b.utils.stretching.FILL:if(e>f){d.width=l*e;d.height=h*e}else{d.width=l*f;d.height=h*f}break;case b.utils.stretching.EXACTFIT:b.utils.transform(n,["scale(",e,",",f,")"," translate(0px,0px)"].join(""));d.width=l;d.height=h;break;default:break}d.top=(g-d.height)/2;d.left=(m-d.width)/2;b.utils.css(n,d)};b.utils.stretching={NONE:"none",FILL:"fill",UNIFORM:"uniform",EXACTFIT:"exactfit"}})(jwplayer);(function(e){e.utils.mediaparser=function(){};var g={element:{width:"width",height:"height",id:"id","class":"className",name:"name"},media:{src:"file",preload:"preload",autoplay:"autostart",loop:"repeat",controls:"controls"},source:{src:"file",type:"type",media:"media","data-jw-width":"width","data-jw-bitrate":"bitrate"},video:{poster:"image"}};var f={};e.utils.mediaparser.parseMedia=function(i){return d(i)};function c(j,i){if(i===undefined){i=g[j]}else{e.utils.extend(i,g[j])}return i}function d(m,i){if(f[m.tagName.toLowerCase()]&&(i===undefined)){return f[m.tagName.toLowerCase()](m)}else{i=c("element",i);var n={};for(var j in i){if(j!="length"){var l=m.getAttribute(j);if(!(l===""||l===undefined||l===null)){n[i[j]]=m.getAttribute(j)}}}var k=m.style["#background-color"];if(k&&!(k=="transparent"||k=="rgba(0, 0, 0, 0)")){n.screencolor=k}return n}}function h(o,k){k=c("media",k);var m=[];if(e.utils.isIE()){var l=o.nextSibling;if(l!==undefined){while(l.tagName.toLowerCase()=="source"){m.push(a(l));l=l.nextSibling}}}else{var j=e.utils.selectors("source",o);for(var n in j){if(!isNaN(n)){m.push(a(j[n]))}}}var p=d(o,k);if(p.file!==undefined){m[0]={file:p.file}}p.levels=m;return p}function a(k,j){j=c("source",j);var i=d(k,j);i.width=i.width?i.width:0;i.bitrate=i.bitrate?i.bitrate:0;return i}function b(k,j){j=c("video",j);var i=h(k,j);return i}e.utils.mediaparser.replaceMediaElement=function(i,k){if(e.utils.isIE()){var l=false;var n=[];var m=i.nextSibling;while(m&&!l){n.push(m);if(m.nodeType==1&&m.tagName.toLowerCase()==("/")+i.tagName.toLowerCase()){l=true}m=m.nextSibling}if(l){while(n.length>0){var j=n.pop();j.parentNode.removeChild(j)}}i.outerHTML=k}};f.media=h;f.audio=h;f.source=a;f.video=b})(jwplayer);(function(a){a.utils.selectors=function(b,d){if(d===undefined){d=document}b=a.utils.strings.trim(b);var c=b.charAt(0);if(c=="#"){return d.getElementById(b.substr(1))}else{if(c=="."){if(d.getElementsByClassName){return d.getElementsByClassName(b.substr(1))}else{return a.utils.selectors.getElementsByTagAndClass("*",b.substr(1))}}else{if(b.indexOf(".")>0){selectors=b.split(".");return a.utils.selectors.getElementsByTagAndClass(selectors[0],selectors[1])}else{return d.getElementsByTagName(b)}}}return null};a.utils.selectors.getElementsByTagAndClass=function(e,h,g){elements=[];if(g===undefined){g=document}var f=g.getElementsByTagName(e);for(var d=0;d<f.length;d++){if(f[d].className!==undefined){var c=f[d].className.split(" ");for(var b=0;b<c.length;b++){if(c[b]==h){elements.push(f[d])}}}}return elements}})(jwplayer);(function(a){a.utils.strings=function(){};a.utils.strings.trim=function(b){return b.replace(/^\s*/,"").replace(/\s*$/,"")}})(jwplayer);(function(c){var d=new RegExp(/^(#|0x)[0-9a-fA-F]{3,6}/);c.utils.typechecker=function(g,f){f=f===null?b(g):f;return e(g,f)};function b(f){var g=["true","false","t","f"];if(g.indexOf(f.toLowerCase().replace(" ",""))>=0){return"boolean"}else{if(d.test(f)){return"color"}else{if(!isNaN(parseInt(f,10))&&parseInt(f,10).toString().length==f.length){return"integer"}else{if(!isNaN(parseFloat(f))&&parseFloat(f).toString().length==f.length){return"float"}}}}return"string"}function e(g,f){if(f===null){return g}switch(f){case"color":if(g.length>0){return a(g)}return null;case"integer":return parseInt(g,10);case"float":return parseFloat(g);case"boolean":if(g.toLowerCase()=="true"){return true}else{if(g=="1"){return true}}return false}return g}function a(f){switch(f.toLowerCase()){case"blue":return parseInt("0000FF",16);case"green":return parseInt("00FF00",16);case"red":return parseInt("FF0000",16);case"cyan":return parseInt("00FFFF",16);case"magenta":return parseInt("FF00FF",16);case"yellow":return parseInt("FFFF00",16);case"black":return parseInt("000000",16);case"white":return parseInt("FFFFFF",16);default:f=f.replace(/(#|0x)?([0-9A-F]{3,6})$/gi,"$2");if(f.length==3){f=f.charAt(0)+f.charAt(0)+f.charAt(1)+f.charAt(1)+f.charAt(2)+f.charAt(2)}return parseInt(f,16)}return parseInt("000000",16)}})(jwplayer);(function(a){var b={};a.utils.animations=function(){};a.utils.animations.transform=function(c,d){c.style.webkitTransform=d;c.style.MozTransform=d;c.style.OTransform=d};a.utils.animations.transformOrigin=function(c,d){c.style.webkitTransformOrigin=d;c.style.MozTransformOrigin=d;c.style.OTransformOrigin=d};a.utils.animations.rotate=function(c,d){a.utils.animations.transform(c,["rotate(",d,"deg)"].join(""))};a.utils.cancelAnimation=function(c){delete b[c.id]};a.utils.fadeTo=function(l,f,e,i,h,d){if(b[l.id]!=d&&d!==undefined){return}var c=new Date().getTime();if(d>c){setTimeout(function(){a.utils.fadeTo(l,f,e,i,0,d)},d-c)}l.style.display="block";if(i===undefined){i=l.style.opacity===""?1:l.style.opacity}if(l.style.opacity==f&&l.style.opacity!==""&&d!==undefined){if(f===0){l.style.display="none"}return}if(d===undefined){d=c;b[l.id]=d}if(h===undefined){h=0}var j=(c-d)/(e*1000);j=j>1?1:j;var k=f-i;var g=i+(j*k);if(g>1){g=1}else{if(g<0){g=0}}l.style.opacity=g;if(h>0){b[l.id]=d+h*1000;a.utils.fadeTo(l,f,e,i,0,b[l.id]);return}setTimeout(function(){a.utils.fadeTo(l,f,e,i,0,d)},10)}})(jwplayer);(function(a){a.utils.extensionmap={"3gp":{html5:"video/3gpp",flash:"video"},"3gpp":{html5:"video/3gpp"},"3g2":{html5:"video/3gpp2",flash:"video"},"3gpp2":{html5:"video/3gpp2"},flv:{flash:"video"},f4a:{html5:"audio/mp4"},f4b:{html5:"audio/mp4",flash:"video"},f4p:{html5:"video/mp4",flash:"video"},f4v:{html5:"video/mp4",flash:"video"},mov:{html5:"video/quicktime",flash:"video"},m4a:{html5:"audio/mp4",flash:"video"},m4b:{html5:"audio/mp4"},m4p:{html5:"audio/mp4"},m4v:{html5:"video/mp4",flash:"video"},mkv:{html5:"video/x-matroska"},mp4:{html5:"video/mp4",flash:"video"},rbs:{flash:"sound"},sdp:{html5:"application/sdp",flash:"video"},vp6:{html5:"video/x-vp6"},aac:{html5:"audio/aac",flash:"video"},mp3:{flash:"sound"},ogg:{html5:"audio/ogg"},ogv:{html5:"video/ogg"},webm:{html5:"video/webm"},m3u8:{html5:"audio/x-mpegurl"},gif:{flash:"image"},jpeg:{flash:"image"},jpg:{flash:"image"},swf:{flash:"image"},png:{flash:"image"}}})(jwplayer);(function(b){var a=[];b.constructor=function(c){return b.api.selectPlayer(c)};b.api=function(){};b.api.events={API_READY:"jwplayerAPIReady",JWPLAYER_READY:"jwplayerReady",JWPLAYER_FULLSCREEN:"jwplayerFullscreen",JWPLAYER_RESIZE:"jwplayerResize",JWPLAYER_ERROR:"jwplayerError",JWPLAYER_MEDIA_BUFFER:"jwplayerMediaBuffer",JWPLAYER_MEDIA_BUFFER_FULL:"jwplayerMediaBufferFull",JWPLAYER_MEDIA_ERROR:"jwplayerMediaError",JWPLAYER_MEDIA_LOADED:"jwplayerMediaLoaded",JWPLAYER_MEDIA_COMPLETE:"jwplayerMediaComplete",JWPLAYER_MEDIA_TIME:"jwplayerMediaTime",JWPLAYER_MEDIA_VOLUME:"jwplayerMediaVolume",JWPLAYER_MEDIA_META:"jwplayerMediaMeta",JWPLAYER_MEDIA_MUTE:"jwplayerMediaMute",JWPLAYER_PLAYER_STATE:"jwplayerPlayerState",JWPLAYER_PLAYLIST_LOADED:"jwplayerPlaylistLoaded",JWPLAYER_PLAYLIST_ITEM:"jwplayerPlaylistItem"};b.api.events.state={BUFFERING:"BUFFERING",IDLE:"IDLE",PAUSED:"PAUSED",PLAYING:"PLAYING"};b.api.PlayerAPI=function(d){this.container=d;this.id=d.id;var j={};var o={};var c=[];var g=undefined;var i=false;var h=[];var m=b.utils.getOuterHTML(d);var n={};var k=0;this.setPlayer=function(p){g=p};this.stateListener=function(p,q){if(!o[p]){o[p]=[];this.eventListener(b.api.events.JWPLAYER_PLAYER_STATE,f(p))}o[p].push(q);return this};function f(p){return function(r){var q=r.newstate,t=r.oldstate;if(q==p){var s=o[q];if(s){for(var u=0;u<s.length;u++){if(typeof s[u]=="function"){s[u].call(this,{oldstate:t,newstate:q})}}}}}}this.addInternalListener=function(p,q){p.jwAddEventListener(q,'function(dat) { jwplayer("'+this.id+'").dispatchEvent("'+q+'", dat); }')};this.eventListener=function(p,q){if(!j[p]){j[p]=[];if(g&&i){this.addInternalListener(g,p)}}j[p].push(q);return this};this.dispatchEvent=function(r){if(j[r]){var q=e(r,arguments[1]);for(var p=0;p<j[r].length;p++){if(typeof j[r][p]=="function"){j[r][p].call(this,q)}}}};function e(r,p){var t=b.utils.extend({},p);if(r==b.api.events.JWPLAYER_FULLSCREEN&&!t.fullscreen){t.fullscreen=t.message=="true"?true:false;delete t.message}else{if(typeof t.data=="object"){t=b.utils.extend(t,t.data);delete t.data}}var q=["position","duration","offset"];for(var s in q){if(t[q[s]]){t[q[s]]=Math.round(t[q[s]]*1000)/1000}}return t}this.callInternal=function(q,p){if(i){if(typeof g!="undefined"&&typeof g[q]=="function"){if(p!==undefined){return(g[q])(p)}else{return(g[q])()}}return null}else{h.push({method:q,parameters:p})}};this.playerReady=function(r){i=true;if(!g){this.setPlayer(document.getElementById(r.id))}this.container=document.getElementById(this.id);for(var p in j){this.addInternalListener(g,p)}this.eventListener(b.api.events.JWPLAYER_PLAYLIST_ITEM,function(s){if(s.index!==undefined){k=s.index}n={}});this.eventListener(b.api.events.JWPLAYER_MEDIA_META,function(s){b.utils.extend(n,s.metadata)});this.dispatchEvent(b.api.events.API_READY);while(h.length>0){var q=h.shift();this.callInternal(q.method,q.parameters)}};this.getItemMeta=function(){return n};this.getCurrentItem=function(){return k};this.destroy=function(){j={};h=[];if(b.utils.getOuterHTML(this.container)!=m){b.api.destroyPlayer(this.id,m)}};function l(r,t,s){var p=[];if(!t){t=0}if(!s){s=r.length-1}for(var q=t;q<=s;q++){p.push(r[q])}return p}};b.api.PlayerAPI.prototype={container:undefined,options:undefined,id:undefined,getBuffer:function(){return this.callInternal("jwGetBuffer")},getDuration:function(){return this.callInternal("jwGetDuration")},getFullscreen:function(){return this.callInternal("jwGetFullscreen")},getHeight:function(){return this.callInternal("jwGetHeight")},getLockState:function(){return this.callInternal("jwGetLockState")},getMeta:function(){return this.getItemMeta()},getMute:function(){return this.callInternal("jwGetMute")},getPlaylist:function(){var d=this.callInternal("jwGetPlaylist");for(var c=0;c<d.length;c++){if(d[c].index===undefined){d[c].index=c}}return d},getPlaylistItem:function(c){if(c===undefined){c=this.getCurrentItem()}return this.getPlaylist()[c]},getPosition:function(){return this.callInternal("jwGetPosition")},getState:function(){return this.callInternal("jwGetState")},getVolume:function(){return this.callInternal("jwGetVolume")},getWidth:function(){return this.callInternal("jwGetWidth")},setFullscreen:function(c){if(c===undefined){this.callInternal("jwSetFullscreen",!this.callInternal("jwGetFullscreen"))}else{this.callInternal("jwSetFullscreen",c)}return this},setMute:function(c){if(c===undefined){this.callInternal("jwSetMute",!this.callInternal("jwGetMute"))}else{this.callInternal("jwSetMute",c)}return this},lock:function(){return this},unlock:function(){return this},load:function(c){this.callInternal("jwLoad",c);return this},playlistItem:function(c){this.callInternal("jwPlaylistItem",c);return this},playlistPrev:function(){this.callInternal("jwPlaylistPrev");return this},playlistNext:function(){this.callInternal("jwPlaylistNext");return this},resize:function(d,c){this.container.width=d;this.container.height=c;return this},play:function(c){if(typeof c=="undefined"){c=this.getState();if(c==b.api.events.state.PLAYING||c==b.api.events.state.BUFFERING){this.callInternal("jwPause")}else{this.callInternal("jwPlay")}}else{this.callInternal("jwPlay",c)}return this},pause:function(c){if(typeof c=="undefined"){c=this.getState();if(c==b.api.events.state.PLAYING||c==b.api.events.state.BUFFERING){this.callInternal("jwPause")}else{this.callInternal("jwPlay")}}else{this.callInternal("jwPause",c)}return this},stop:function(){this.callInternal("jwStop");return this},seek:function(c){this.callInternal("jwSeek",c);return this},setVolume:function(c){this.callInternal("jwSetVolume",c);return this},onBufferChange:function(c){return this.eventListener(b.api.events.JWPLAYER_MEDIA_BUFFER,c)},onBufferFull:function(c){return this.eventListener(b.api.events.JWPLAYER_MEDIA_BUFFER_FULL,c)},onError:function(c){return this.eventListener(b.api.events.JWPLAYER_ERROR,c)},onFullscreen:function(c){return this.eventListener(b.api.events.JWPLAYER_FULLSCREEN,c)},onMeta:function(c){return this.eventListener(b.api.events.JWPLAYER_MEDIA_META,c)},onMute:function(c){return this.eventListener(b.api.events.JWPLAYER_MEDIA_MUTE,c)},onPlaylist:function(c){return this.eventListener(b.api.events.JWPLAYER_PLAYLIST_LOADED,c)},onPlaylistItem:function(c){return this.eventListener(b.api.events.JWPLAYER_PLAYLIST_ITEM,c)},onReady:function(c){return this.eventListener(b.api.events.API_READY,c)},onResize:function(c){return this.eventListener(b.api.events.JWPLAYER_RESIZE,c)},onComplete:function(c){return this.eventListener(b.api.events.JWPLAYER_MEDIA_COMPLETE,c)},onTime:function(c){return this.eventListener(b.api.events.JWPLAYER_MEDIA_TIME,c)},onVolume:function(c){return this.eventListener(b.api.events.JWPLAYER_MEDIA_VOLUME,c)},onBuffer:function(c){return this.stateListener(b.api.events.state.BUFFERING,c)},onPause:function(c){return this.stateListener(b.api.events.state.PAUSED,c)},onPlay:function(c){return this.stateListener(b.api.events.state.PLAYING,c)},onIdle:function(c){return this.stateListener(b.api.events.state.IDLE,c)},setup:function(c){return this},remove:function(){this.destroy()},initializePlugin:function(c,d){return this}};b.api.selectPlayer=function(d){var c;if(d===undefined){d=0}if(d.nodeType){c=d}else{if(typeof d=="string"){c=document.getElementById(d)}}if(c){var e=b.api.playerById(c.id);if(e){return e}else{return b.api.addPlayer(new b.api.PlayerAPI(c))}}else{if(typeof d=="number"){return b.getPlayers()[d]}}return null};b.api.playerById=function(d){for(var c=0;c<a.length;c++){if(a[c].id==d){return a[c]}}return null};b.api.addPlayer=function(c){for(var d=0;d<a.length;d++){if(a[d]==c){return c}}a.push(c);return c};b.api.destroyPlayer=function(f,d){var e=-1;for(var h=0;h<a.length;h++){if(a[h].id==f){e=h;continue}}if(e>=0){var c=document.getElementById(a[e].id);if(c){if(d){b.utils.setOuterHTML(c,d)}else{var g=document.createElement("div");g.setAttribute("id",c.id);c.parentNode.replaceChild(g,c)}}a.splice(e,1)}return null};b.getPlayers=function(){return a.slice(0)}})(jwplayer);var _userPlayerReady=(typeof playerReady=="function")?playerReady:undefined;playerReady=function(b){var a=jwplayer.api.playerById(b.id);if(a){a.playerReady(b)}if(_userPlayerReady){_userPlayerReady.call(this,b)}};(function(a){a.embed=function(){};a.embed.Embedder=function(d){this.constructor(d)};function c(){return[{type:"flash",src:"player.swf"},{type:"html5"},{type:"download"}]}a.embed.defaults={width:400,height:300,players:c(),components:{controlbar:{position:"over"}}};a.embed.Embedder.prototype={config:undefined,api:undefined,events:{},players:undefined,constructor:function(e){this.api=e;var d=a.utils.mediaparser.parseMedia(this.api.container);this.config=this.parseConfig(a.utils.extend({},a.embed.defaults,d,this.api.config))},embedPlayer:function(){var e=this.players[0];if(e&&e.type){switch(e.type){case"flash":if(a.utils.flashSupportsConfig(this.config)){if(this.config.file&&!this.config.provider){switch(a.utils.extension(this.config.file).toLowerCase()){case"webm":case"ogv":case"ogg":this.config.provider="video";break}}if(this.config.levels||this.config.playlist){this.api.onReady(this.loadAfterReady(this.config))}this.config.id=this.api.id;var h=a.embed.embedFlash(document.getElementById(this.api.id),e,this.config);this.api.container=h;this.api.setPlayer(h)}else{this.players.splice(0,1);return this.embedPlayer()}break;case"html5":if(a.utils.html5SupportsConfig(this.config)){var g=a.embed.embedHTML5(document.getElementById(this.api.id),e,this.config);this.api.container=document.getElementById(this.api.id);this.api.setPlayer(g)}else{this.players.splice(0,1);return this.embedPlayer()}break;case"download":if(a.utils.downloadSupportsConfig(this.config)){var f=a.utils.getFirstPlaylistItemFromConfig(this.config);var d=a.embed.embedDownloadLink(document.getElementById(this.api.id),e,this.config);this.api.container=document.getElementById(this.api.id);this.api.setPlayer(d)}else{this.players.splice(0,1);return this.embedPlayer()}break}}else{this.api.container.innerHTML="<p>No suitable players found</p>"}this.setupEvents();return this.api},setupEvents:function(){for(var d in this.events){if(typeof this.api[d]=="function"){(this.api[d]).call(this.api,this.events[d])}}},loadAfterReady:function(d){return function(f){if(d.playlist){this.load(d.playlist)}else{if(d.levels){var e=this.getPlaylistItem(0);if(!e){e=d}if(!e.image){e.image=d.image}if(!e.levels){e.levels=d.levels}this.load(e)}}}},parseConfig:function(d){var e=a.utils.extend({},d);if(e.events){this.events=e.events;delete e.events}if(e.players){this.players=e.players;delete e.players}if(e.plugins){if(typeof e.plugins=="object"){e=a.utils.extend(e,a.embed.parsePlugins(e.plugins))}}if(e.playlist&&typeof e.playlist==="string"&&!e["playlist.position"]){e["playlist.position"]=e.playlist;delete e.playlist}if(e.controlbar&&typeof e.controlbar==="string"&&!e["controlbar.position"]){e["controlbar.position"]=e.controlbar;delete e.controlbar}return e}};a.embed.embedFlash=function(f,h,k){var g=a.utils.extend({},k);var d=g.width;delete g.width;var l=g.height;delete g.height;delete g.levels;delete g.playlist;var e="opaque";if(g.wmode){e=g.wmode}a.embed.parseConfigBlock(g,"components");a.embed.parseConfigBlock(g,"providers");if(a.utils.isIE()){var j='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+d+'" height="'+l+'" id="'+f.id+'" name="'+f.id+'">';j+='<param name="movie" value="'+h.src+'">';j+='<param name="allowfullscreen" value="true">';j+='<param name="allowscriptaccess" value="always">';j+='<param name="wmode" value="'+e+'">';j+='<param name="flashvars" value="'+a.embed.jsonToFlashvars(g)+'">';j+="</object>";if(f.tagName.toLowerCase()=="video"){a.utils.mediaparser.replaceMediaElement(f,j)}else{f.outerHTML=j}return document.getElementById(f.id)}else{var i=document.createElement("object");i.setAttribute("type","application/x-shockwave-flash");i.setAttribute("data",h.src);i.setAttribute("width",d);i.setAttribute("height",l);i.setAttribute("id",f.id);i.setAttribute("name",f.id);a.embed.appendAttribute(i,"allowfullscreen","true");a.embed.appendAttribute(i,"allowscriptaccess","always");a.embed.appendAttribute(i,"wmode",e);a.embed.appendAttribute(i,"flashvars",a.embed.jsonToFlashvars(g));f.parentNode.replaceChild(i,f);return i}};a.embed.embedHTML5=function(e,g,f){if(a.html5){e.innerHTML="";var d=a.utils.extend({screencolor:"0x000000"},f);a.embed.parseConfigBlock(d,"components");if(d.levels&&!d.sources){d.sources=f.levels}if(d.skin&&d.skin.toLowerCase().indexOf(".zip")>0){d.skin=d.skin.replace(/\.zip/i,".xml")}return new (a.html5(e)).setup(d)}else{return null}};a.embed.embedDownloadLink=function(e,h,n){var g=a.utils.extend({},n);var m={};var f=n.width?n.width:480;if(typeof f!="number"){f=parseInt(f,10)}var k=n.height?n.height:320;if(typeof k!="number"){k=parseInt(k,10)}var p,l,j;var o={};if(n.playlist&&n.playlist.length){o.file=n.playlist[0].file;l=n.playlist[0].image;o.levels=n.playlist[0].levels}else{o.file=n.file;l=n.image;o.levels=n.levels}if(o.file){p=o.file}else{if(o.levels&&o.levels.length){p=o.levels[0].file}}j=p?"pointer":"auto";var i={display:{style:{cursor:j,width:f,height:k,backgroundColor:"#000",position:"relative",textDecoration:"none",border:"none",display:"block"}},display_icon:{style:{cursor:j,position:"absolute",display:p?"block":"none",top:0,left:0,border:0,margin:0,padding:0,zIndex:3,width:50,height:50,backgroundImage:"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAALdJREFUeNrs18ENgjAYhmFouDOCcQJGcARHgE10BDcgTOIosAGwQOuPwaQeuFRi2p/3Sb6EC5L3QCxZBgAAAOCorLW1zMn65TrlkH4NcV7QNcUQt7Gn7KIhxA+qNIR81spOGkL8oFJDyLJRdosqKDDkK+iX5+d7huzwM40xptMQMkjIOeRGo+VkEVvIPfTGIpKASfYIfT9iCHkHrBEzf4gcUQ56aEzuGK/mw0rHpy4AAACAf3kJMACBxjAQNRckhwAAAABJRU5ErkJggg==)"}},display_iconBackground:{style:{cursor:j,position:"absolute",display:p?"block":"none",top:((k-50)/2),left:((f-50)/2),border:0,width:50,height:50,margin:0,padding:0,zIndex:2,backgroundImage:"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAEpJREFUeNrszwENADAIA7DhX8ENoBMZ5KR10EryckCJiIiIiIiIiIiIiIiIiIiIiIh8GmkRERERERERERERERERERERERGRHSPAAPlXH1phYpYaAAAAAElFTkSuQmCC)"}},display_image:{style:{width:f,height:k,display:l?"block":"none",position:"absolute",cursor:j,left:0,top:0,margin:0,padding:0,textDecoration:"none",zIndex:1,border:"none"}}};var d=function(q,s,t){var r=document.createElement(q);if(t){r.id=t}else{r.id=e.id+"_jwplayer_"+s}a.utils.css(r,i[s].style);return r};m.display=d("a","display",e.id);if(p){m.display.setAttribute("href",a.utils.getAbsolutePath(p))}m.display_image=d("img","display_image");m.display_image.setAttribute("alt","Click to download...");if(l){m.display_image.setAttribute("src",a.utils.getAbsolutePath(l))}if(true){m.display_icon=d("div","display_icon");m.display_iconBackground=d("div","display_iconBackground");m.display.appendChild(m.display_image);m.display_iconBackground.appendChild(m.display_icon);m.display.appendChild(m.display_iconBackground)}e.parentNode.replaceChild(m.display,e);return m.display};a.embed.appendAttribute=function(e,d,f){var g=document.createElement("param");g.setAttribute("name",d);g.setAttribute("value",f);e.appendChild(g)};a.embed.jsonToFlashvars=function(f){var d=f.netstreambasepath?"":"netstreambasepath="+escape(window.location.href)+"&";for(var e in f){d+=e+"="+escape(f[e])+"&"}return d.substring(0,d.length-1)};a.embed.parsePlugins=function(g){if(!g){return{}}var j={},i=[];for(var d in g){var f=a.utils.getPluginName(d);var e=g[d];i.push(d);for(var h in e){j[f+"."+h]=e[h]}}j.plugins=i.join(",");return j};a.embed.parseConfigBlock=function(g,f){if(g[f]){var i=g[f];for(var e in i){var d=i[e];if(typeof d=="string"){if(!g[e]){g[e]=d}}else{for(var h in d){if(!g[e+"."+h]){g[e+"."+h]=d[h]}}}}delete g[f]}};a.api.PlayerAPI.prototype.setup=function(e,f){if(e&&e.flashplayer&&!e.players){e.players=c();e.players[0].src=e.flashplayer;delete e.flashplayer}if(f&&!e.players){if(typeof f=="string"){e.players=c();e.players[0].src=f}else{if(f instanceof Array){e.players=f}else{if(typeof f=="object"&&f.type){e.players=[f]}}}}var d=this.id;this.remove();var g=a(d);g.config=e;return(new a.embed.Embedder(g)).embedPlayer()};function b(){if(!document.body){return setTimeout(b,15)}var d=a.utils.selectors.getElementsByTagAndClass("video","jwplayer");for(var e=0;e<d.length;e++){var f=d[e];a(f.id).setup({players:[{type:"flash",src:"/jwplayer/player.swf"},{type:"html5"}]})}}b()})(jwplayer);(function(a){a.html5=function(b){var c=b;this.setup=function(d){a.utils.extend(this,new a.html5.api(c,d));return this};return this}})(jwplayer);(function(b){var c=b.utils.css;b.html5.view=function(q,o,e){var t=q;var l=o;var w=e;var v;var f;var A;var r;var B;var n;function y(){v=document.createElement("div");v.id=l.id;v.className=l.className;l.id=v.id+"_video";c(v,{position:"relative",height:w.height,width:w.width,padding:0,backgroundColor:C(),zIndex:0});function C(){if(t.skin.getComponentSettings("display")&&t.skin.getComponentSettings("display").backgroundcolor){return t.skin.getComponentSettings("display").backgroundcolor}return parseInt("000000",16)}c(l,{position:"absolute",width:w.width,height:w.height,top:0,left:0,zIndex:1,margin:"auto",display:"block"});b.utils.wrap(l,v);r=document.createElement("div");r.id=v.id+"_displayarea";v.appendChild(r)}function j(){for(var C=0;C<w.plugins.order.length;C++){var D=w.plugins.order[C];if(w.plugins.object[D].getDisplayElement!==undefined){w.plugins.object[D].height=h(w.plugins.object[D].getDisplayElement().style.height);w.plugins.object[D].width=h(w.plugins.object[D].getDisplayElement().style.width);w.plugins.config[D].currentPosition=w.plugins.config[D].position}}u()}function u(D){if(w.getMedia()!==undefined){for(var C=0;C<w.plugins.order.length;C++){var E=w.plugins.order[C];if(w.plugins.object[E].getDisplayElement!==undefined){if(w.config.chromeless||w.getMedia().hasChrome()){w.plugins.config[E].currentPosition=b.html5.view.positions.NONE}else{w.plugins.config[E].currentPosition=w.plugins.config[E].position}}}}i(w.width,w.height)}function h(C){if(typeof C=="string"){if(C===""){return 0}else{if(C.lastIndexOf("%")>-1){return C}else{return parseInt(C.replace("px",""),10)}}}return C}function p(){n=setInterval(function(){if((typeof w.width=="string"&&w.width.lastIndexOf("%")>-1)||(typeof w.height=="string"&&w.height.lastIndexOf("%")>-1)){return}if(v.width&&v.height&&(w.width!==h(v.width)||w.height!==h(v.height))){i(h(v.width),h(v.height))}else{var C=v.getBoundingClientRect();if(w.width!==C.width||w.height!==C.height){i(C.width,C.height)}delete C}},100)}this.setup=function(C){l=C;y();j();t.jwAddEventListener(b.api.events.JWPLAYER_MEDIA_LOADED,u);t.jwAddEventListener(b.api.events.JWPLAYER_MEDIA_META,function(){x()});p();var D;if(window.onresize!==null){D=window.onresize}window.onresize=function(E){if(D!==undefined){try{D(E)}catch(G){}}if(t.jwGetFullscreen()){var F=document.body.getBoundingClientRect();w.width=Math.abs(F.left)+Math.abs(F.right);w.height=window.innerHeight}i(w.width,w.height)}};function g(C){switch(C.keyCode){case 27:if(t.jwGetFullscreen()){t.jwSetFullscreen(false)}break;case 32:if(t.jwGetState()!=b.api.events.state.IDLE&&t.jwGetState()!=b.api.events.state.PAUSED){t.jwPause()}else{t.jwPlay()}break}}function i(F,C){if(v.style.display=="none"){return}var E=[].concat(w.plugins.order);E.reverse();B=E.length+2;if(!w.fullscreen){w.width=F;w.height=C;f=F;A=C;c(r,{top:0,bottom:0,left:0,right:0,width:F,height:C});c(v,{height:A,width:f});var D=m(s,E);if(D.length>0){B+=D.length;m(k,D,true)}}else{m(z,E,true)}x()}function m(H,E,F){var D=[];for(var C=0;C<E.length;C++){var I=E[C];if(w.plugins.object[I].getDisplayElement!==undefined){if(w.plugins.config[I].currentPosition.toUpperCase()!==b.html5.view.positions.NONE){var G=H(I,B--);if(!G){D.push(I)}else{w.plugins.object[I].resize(G.width,G.height);if(F){delete G.width;delete G.height}c(w.plugins.object[I].getDisplayElement(),G)}}else{c(w.plugins.object[I].getDisplayElement(),{display:"none"})}}}return D}function s(D,E){if(w.plugins.object[D].getDisplayElement!==undefined){if(a(w.plugins.config[D].position)){if(w.plugins.object[D].getDisplayElement().parentNode===null){v.appendChild(w.plugins.object[D].getDisplayElement())}var C=d(D);C.zIndex=E;return C}}return false}function k(E,F){if(w.plugins.object[E].getDisplayElement().parentNode===null){r.appendChild(w.plugins.object[E].getDisplayElement())}var C=w.width,D=w.height;if(typeof w.width=="string"&&w.width.lastIndexOf("%")>-1){percentage=parseFloat(w.width.substring(0,w.width.lastIndexOf("%")))/100;C=Math.round(window.innerWidth*percentage)}if(typeof w.height=="string"&&w.height.lastIndexOf("%")>-1){percentage=parseFloat(w.height.substring(0,w.height.lastIndexOf("%")))/100;D=Math.round(window.innerHeight*percentage)}return{position:"absolute",width:(C-h(r.style.left)-h(r.style.right)),height:(D-h(r.style.top)-h(r.style.bottom)),zIndex:F}}function z(C,D){return{position:"fixed",width:w.width,height:w.height,zIndex:D}}function x(){r.style.position="absolute";w.getMedia().getDisplayElement().style.position="absolute";if(w.getMedia().getDisplayElement().videoWidth==0||w.getMedia().getDisplayElement().videoHeight==0){return}var C,E;if(r.style.width.toString().lastIndexOf("%")>-1||r.style.width.toString().lastIndexOf("%")>-1){var D=r.getBoundingClientRect();C=Math.abs(D.left)+Math.abs(D.right);E=Math.abs(D.top)+Math.abs(D.bottom)}else{C=h(r.style.width);E=h(r.style.height)}b.utils.stretch(t.jwGetStretching(),w.getMedia().getDisplayElement(),C,E,w.getMedia().getDisplayElement().videoWidth,w.getMedia().getDisplayElement().videoHeight)}function d(D){var E={position:"absolute",margin:0,padding:0,top:null};var C=w.plugins.config[D].currentPosition.toLowerCase();switch(C.toUpperCase()){case b.html5.view.positions.TOP:E.top=h(r.style.top);E.left=h(r.style.left);E.width=f-h(r.style.left)-h(r.style.right);E.height=w.plugins.object[D].height;r.style[C]=h(r.style[C])+w.plugins.object[D].height+"px";r.style.height=h(r.style.height)-E.height+"px";break;case b.html5.view.positions.RIGHT:E.top=h(r.style.top);E.right=h(r.style.right);E.width=E.width=w.plugins.object[D].width;E.height=A-h(r.style.top)-h(r.style.bottom);r.style[C]=h(r.style[C])+w.plugins.object[D].width+"px";r.style.width=h(r.style.width)-E.width+"px";break;case b.html5.view.positions.BOTTOM:E.bottom=h(r.style.bottom);E.left=h(r.style.left);E.width=f-h(r.style.left)-h(r.style.right);E.height=w.plugins.object[D].height;r.style[C]=h(r.style[C])+w.plugins.object[D].height+"px";r.style.height=h(r.style.height)-E.height+"px";break;case b.html5.view.positions.LEFT:E.top=h(r.style.top);E.left=h(r.style.left);E.width=w.plugins.object[D].width;E.height=A-h(r.style.top)-h(r.style.bottom);r.style[C]=h(r.style[C])+w.plugins.object[D].width+"px";r.style.width=h(r.style.width)-E.width+"px";break;default:break}return E}this.resize=i;this.fullscreen=function(E){if(navigator.vendor.indexOf("Apple")===0){if(w.getMedia().getDisplayElement().webkitSupportsFullscreen){if(E){w.fullscreen=false;w.getMedia().getDisplayElement().webkitEnterFullscreen()}else{w.getMedia().getDisplayElement().webkitExitFullscreen()}}else{w.fullscreen=false}}else{if(E){document.onkeydown=g;clearInterval(n);var D=document.body.getBoundingClientRect();w.width=Math.abs(D.left)+Math.abs(D.right);w.height=window.innerHeight;var C={position:"fixed",width:"100%",height:"100%",top:0,left:0,zIndex:2147483000};c(v,C);C.zIndex=1;c(w.getMedia().getDisplayElement(),C);C.zIndex=2;c(r,C)}else{document.onkeydown="";p();w.width=f;w.height=A;c(v,{position:"relative",height:w.height,width:w.width,zIndex:0})}i(w.width,w.height)}}};function a(d){return([b.html5.view.positions.TOP,b.html5.view.positions.RIGHT,b.html5.view.positions.BOTTOM,b.html5.view.positions.LEFT].indexOf(d.toUpperCase())>-1)}b.html5.view.positions={TOP:"TOP",RIGHT:"RIGHT",BOTTOM:"BOTTOM",LEFT:"LEFT",OVER:"OVER",NONE:"NONE"}})(jwplayer);(function(a){var b={backgroundcolor:"",margin:10,font:"Arial,sans-serif",fontsize:10,fontcolor:parseInt("000000",16),fontstyle:"normal",fontweight:"bold",buttoncolor:parseInt("ffffff",16),position:a.html5.view.positions.BOTTOM,idlehide:false,layout:{left:{position:"left",elements:[{name:"play",type:"button"},{name:"divider",type:"divider"},{name:"prev",type:"button"},{name:"divider",type:"divider"},{name:"next",type:"button"},{name:"divider",type:"divider"},{name:"elapsed",type:"text"}]},center:{position:"center",elements:[{name:"time",type:"slider"}]},right:{position:"right",elements:[{name:"duration",type:"text"},{name:"blank",type:"button"},{name:"divider",type:"divider"},{name:"mute",type:"button"},{name:"volume",type:"slider"},{name:"divider",type:"divider"},{name:"fullscreen",type:"button"}]}}};_css=a.utils.css;_hide=function(c){_css(c,{display:"none"})};_show=function(c){_css(c,{display:"block"})};a.html5.controlbar=function(j,L){var i=j;var A=a.utils.extend({},b,i.skin.getComponentSettings("controlbar"),L);if(a.utils.mapLength(i.skin.getComponentLayout("controlbar"))>0){A.layout=i.skin.getComponentLayout("controlbar")}var P;var I;var O;var B;var t="none";var f;var h;var Q;var e;var d;var w;var s;var J={};var n=false;var c={};function H(){O=0;B=0;I=0;if(!n){var V={height:i.skin.getSkinElement("controlbar","background").height,backgroundColor:A.backgroundcolor};P=document.createElement("div");P.id=i.id+"_jwplayer_controlbar";_css(P,V)}v("capLeft","left",false,P);var W={position:"absolute",height:i.skin.getSkinElement("controlbar","background").height,background:" url("+i.skin.getSkinElement("controlbar","background").src+") repeat-x center left",left:i.skin.getSkinElement("controlbar","capLeft").width};N("elements",P,W);v("capRight","right",false,P)}this.getDisplayElement=function(){return P};this.resize=function(X,V){a.utils.cancelAnimation(P);document.getElementById(i.id).onmousemove=x;d=X;w=V;x();var W=u();D({id:i.id,duration:Q,position:h});r({id:i.id,bufferPercent:e});return W};function o(){var W=["timeSlider","volumeSlider","timeSliderRail","volumeSliderRail"];for(var X in W){var V=W[X];if(typeof J[V]!="undefined"){c[V]=J[V].getBoundingClientRect()}}}function x(){a.utils.cancelAnimation(P);if(g()){a.utils.fadeTo(P,1,0,1,0)}else{a.utils.fadeTo(P,0,0.1,1,2)}}function g(){if(i.jwGetState()==a.api.events.state.IDLE||i.jwGetState()==a.api.events.state.PAUSED){if(A.idlehide){return false}return true}if(i.jwGetFullscreen()){return false}if(A.position.toUpperCase()==a.html5.view.positions.OVER){return false}return true}function N(Y,X,W){var V;if(!n){V=document.createElement("div");J[Y]=V;V.id=P.id+"_"+Y;X.appendChild(V)}else{V=document.getElementById(P.id+"_"+Y)}if(W!==undefined){_css(V,W)}return V}function G(){U(A.layout.left);U(A.layout.right,-1);U(A.layout.center)}function U(Y,V){var Z=Y.position=="right"?"right":"left";var X=a.utils.extend([],Y.elements);if(V!==undefined){X.reverse()}for(var W=0;W<X.length;W++){z(X[W],Z)}}function E(){return I++}function z(Z,ab){var Y,W,X,V,ad;switch(Z.name){case"play":v("playButton",ab,false);v("pauseButton",ab,true);K("playButton","jwPlay");K("pauseButton","jwPause");break;case"divider":v("divider"+E(),ab,true);break;case"prev":v("prevButton",ab,true);K("prevButton","jwPlaylistPrev");break;case"next":v("nextButton",ab,true);K("nextButton","jwPlaylistNext");break;case"elapsed":v("elapsedText",ab,true);break;case"time":W=i.skin.getSkinElement("controlbar","timeSliderCapLeft")===undefined?0:i.skin.getSkinElement("controlbar","timeSliderCapLeft").width;X=i.skin.getSkinElement("controlbar","timeSliderCapRight")===undefined?0:i.skin.getSkinElement("controlbar","timeSliderCapRight").width;Y=ab=="left"?W:X;V=i.skin.getSkinElement("controlbar","timeSliderRail").width+W+X;ad={height:i.skin.getSkinElement("controlbar","background").height,position:"absolute",top:0,width:V};ad[ab]=ab=="left"?O:B;var aa=N("timeSlider",J.elements,ad);v("timeSliderCapLeft",ab,true,aa,ab=="left"?0:Y);v("timeSliderRail",ab,false,aa,Y);v("timeSliderBuffer",ab,false,aa,Y);v("timeSliderProgress",ab,false,aa,Y);v("timeSliderThumb",ab,false,aa,Y);v("timeSliderCapRight",ab,true,aa,ab=="right"?0:Y);M("time");break;case"fullscreen":v("fullscreenButton",ab,false);v("normalscreenButton",ab,true);K("fullscreenButton","jwSetFullscreen",true);K("normalscreenButton","jwSetFullscreen",false);break;case"volume":W=i.skin.getSkinElement("controlbar","volumeSliderCapLeft")===undefined?0:i.skin.getSkinElement("controlbar","volumeSliderCapLeft").width;X=i.skin.getSkinElement("controlbar","volumeSliderCapRight")===undefined?0:i.skin.getSkinElement("controlbar","volumeSliderCapRight").width;Y=ab=="left"?W:X;V=i.skin.getSkinElement("controlbar","volumeSliderRail").width+W+X;ad={height:i.skin.getSkinElement("controlbar","background").height,position:"absolute",top:0,width:V};ad[ab]=ab=="left"?O:B;var ac=N("volumeSlider",J.elements,ad);v("volumeSliderCapLeft",ab,true,ac,ab=="left"?0:Y);v("volumeSliderRail",ab,true,ac,Y);v("volumeSliderProgress",ab,false,ac,Y);v("volumeSliderCapRight",ab,true,ac,ab=="right"?0:Y);M("volume");break;case"mute":v("muteButton",ab,false);v("unmuteButton",ab,true);K("muteButton","jwSetMute",true);K("unmuteButton","jwSetMute",false);break;case"duration":v("durationText",ab,true);break}}function v(Y,ac,ab,Z,V){if((i.skin.getSkinElement("controlbar",Y)!==undefined||Y.indexOf("Text")>0||Y.indexOf("divider")===0)&&!(Y.indexOf("divider")===0&&s.indexOf("divider")===0)){s=Y;var X={height:i.skin.getSkinElement("controlbar","background").height,position:"absolute",display:"block",top:0};if((Y.indexOf("next")===0||Y.indexOf("prev")===0)&&i.jwGetPlaylist().length<2){ab=false;X.display="none"}var aa;if(Y.indexOf("Text")>0){Y.innerhtml="00:00";X.font=A.fontsize+"px/"+(i.skin.getSkinElement("controlbar","background").height+1)+"px "+A.font;X.color=A.fontcolor;X.textAlign="center";X.fontWeight=A.fontweight;X.fontStyle=A.fontstyle;X.cursor="default";aa=14+3*A.fontsize}else{if(Y.indexOf("divider")===0){X.background="url("+i.skin.getSkinElement("controlbar","divider").src+") repeat-x center left";aa=i.skin.getSkinElement("controlbar","divider").width}else{X.background="url("+i.skin.getSkinElement("controlbar",Y).src+") repeat-x center left";aa=i.skin.getSkinElement("controlbar",Y).width}}if(ac=="left"){X.left=V===undefined?O:V;if(ab){O+=aa}}else{if(ac=="right"){X.right=V===undefined?B:V;if(ab){B+=aa}}}if(Z===undefined){Z=J.elements}X.width=aa;if(n){_css(J[Y],X)}else{var W=N(Y,Z,X);if(i.skin.getSkinElement("controlbar",Y+"Over")!==undefined){W.onmouseover=function(ad){W.style.backgroundImage=["url(",i.skin.getSkinElement("controlbar",Y+"Over").src,")"].join("")};W.onmouseout=function(ad){W.style.backgroundImage=["url(",i.skin.getSkinElement("controlbar",Y).src,")"].join("")}}}}}function C(){i.jwAddEventListener(a.api.events.JWPLAYER_PLAYLIST_LOADED,y);i.jwAddEventListener(a.api.events.JWPLAYER_MEDIA_BUFFER,r);i.jwAddEventListener(a.api.events.JWPLAYER_PLAYER_STATE,p);i.jwAddEventListener(a.api.events.JWPLAYER_MEDIA_TIME,D);i.jwAddEventListener(a.api.events.JWPLAYER_MEDIA_MUTE,T);i.jwAddEventListener(a.api.events.JWPLAYER_MEDIA_VOLUME,k);i.jwAddEventListener(a.api.events.JWPLAYER_MEDIA_COMPLETE,F)}function y(){H();G();u();R()}function R(){D({id:i.id,duration:i.jwGetDuration(),position:0});r({id:i.id,bufferProgress:0});T({id:i.id,mute:i.jwGetMute()});p({id:i.id,newstate:a.api.events.state.IDLE});k({id:i.id,volume:i.jwGetVolume()})}function K(X,Y,W){if(n){return}if(i.skin.getSkinElement("controlbar",X)!==undefined){var V=J[X];if(V!==null){_css(V,{cursor:"pointer"});if(Y=="fullscreen"){V.onmouseup=function(Z){Z.stopPropagation();i.jwSetFullscreen(!i.jwGetFullscreen())}}else{V.onmouseup=function(Z){Z.stopPropagation();if(W!==null){i[Y](W)}else{i[Y]()}}}}}}function M(V){if(n){return}var W=J[V+"Slider"];_css(J.elements,{cursor:"pointer"});_css(W,{cursor:"pointer"});W.onmousedown=function(X){t=V};W.onmouseup=function(X){X.stopPropagation();S(X.pageX)};W.onmousemove=function(X){if(t=="time"){f=true;var Y=X.pageX-c[V+"Slider"].left-window.pageXOffset;_css(J.timeSliderThumb,{left:Y})}}}function S(W){f=false;var V;if(t=="time"){V=W-c.timeSliderRail.left+window.pageXOffset;var Y=V/c.timeSliderRail.width*Q;if(Y<0){Y=0}else{if(Y>Q){Y=Q-3}}i.jwSeek(Y);if(i.jwGetState()!=a.api.events.state.PLAYING){i.jwPlay()}}else{if(t=="volume"){V=W-c.volumeSliderRail.left-window.pageXOffset;var X=Math.round(V/c.volumeSliderRail.width*100);if(X<0){X=0}else{if(X>100){X=100}}if(i.jwGetMute()){i.jwSetMute(false)}i.jwSetVolume(X)}}t="none"}function r(W){if(W.bufferPercent!==null){e=W.bufferPercent}var X=c.timeSliderRail.width;var V=isNaN(Math.round(X*e/100))?0:Math.round(X*e/100);_css(J.timeSliderBuffer,{width:V})}function T(V){if(V.mute){_hide(J.muteButton);_show(J.unmuteButton);_hide(J.volumeSliderProgress)}else{_show(J.muteButton);_hide(J.unmuteButton);_show(J.volumeSliderProgress)}}function p(V){if(V.newstate==a.api.events.state.BUFFERING||V.newstate==a.api.events.state.PLAYING){_show(J.pauseButton);_hide(J.playButton)}else{_hide(J.pauseButton);_show(J.playButton)}x();if(V.newstate==a.api.events.state.IDLE){_hide(J.timeSliderBuffer);_hide(J.timeSliderProgress);_hide(J.timeSliderThumb);D({id:i.id,duration:i.jwGetDuration(),position:0})}else{_show(J.timeSliderBuffer);if(V.newstate!=a.api.events.state.BUFFERING){_show(J.timeSliderProgress);_show(J.timeSliderThumb)}}}function F(V){r({bufferPercent:0});D(a.utils.extend(V,{position:0,duration:Q}))}function D(Y){if(Y.position!==null){h=Y.position}if(Y.duration!==null){Q=Y.duration}var W=(h===Q===0)?0:h/Q;var V=isNaN(Math.round(c.timeSliderRail.width*W))?0:Math.round(c.timeSliderRail.width*W);var X=V;J.timeSliderProgress.style.width=V+"px";if(!f){if(J.timeSliderThumb){J.timeSliderThumb.style.left=X+"px"}}if(J.durationText){J.durationText.innerHTML=m(Q)}if(J.elapsedText){J.elapsedText.innerHTML=m(h)}}function m(V){str="00:00";if(V>0){str=Math.floor(V/60)<10?"0"+Math.floor(V/60)+":":Math.floor(V/60)+":";str+=Math.floor(V%60)<10?"0"+Math.floor(V%60):Math.floor(V%60)}return str}function l(){var Y,W;var X=document.getElementById(P.id+"_elements").childNodes;for(var V in document.getElementById(P.id+"_elements").childNodes){if(isNaN(parseInt(V,10))){continue}if(X[V].id.indexOf(P.id+"_divider")===0&&W.id.indexOf(P.id+"_divider")===0){X[V].style.display="none"}else{if(X[V].id.indexOf(P.id+"_divider")===0&&Y.style.display!="none"){X[V].style.display="block"}}if(X[V].style.display!="none"){W=X[V]}Y=X[V]}}function u(){l();if(i.jwGetFullscreen()){_show(J.normalscreenButton);_hide(J.fullscreenButton)}else{_hide(J.normalscreenButton);_show(J.fullscreenButton)}var W={width:d};var V={};if(A.position.toUpperCase()==a.html5.view.positions.OVER||i.jwGetFullscreen()){W.left=A.margin;W.width-=2*A.margin;W.top=w-i.skin.getSkinElement("controlbar","background").height-A.margin;W.height=i.skin.getSkinElement("controlbar","background").height}else{W.left=0}V.left=i.skin.getSkinElement("controlbar","capLeft").width;V.width=W.width-i.skin.getSkinElement("controlbar","capLeft").width-i.skin.getSkinElement("controlbar","capRight").width;var X=i.skin.getSkinElement("controlbar","timeSliderCapLeft")===undefined?0:i.skin.getSkinElement("controlbar","timeSliderCapLeft").width;_css(J.timeSliderRail,{width:(V.width-O-B),left:X});if(J.timeSliderCapRight!==undefined){_css(J.timeSliderCapRight,{left:X+(V.width-O-B)})}_css(P,W);_css(J.elements,V);o();return W}function k(Z){if(J.volumeSliderRail!==undefined){var X=isNaN(Z.volume/100)?1:Z.volume/100;var Y=parseInt(J.volumeSliderRail.style.width.replace("px",""),10);var V=isNaN(Math.round(Y*X))?0:Math.round(Y*X);var aa=parseInt(J.volumeSliderRail.style.right.replace("px",""),10);var W=i.skin.getSkinElement("controlbar","volumeSliderCapLeft")===undefined?0:i.skin.getSkinElement("controlbar","volumeSliderCapLeft").width;_css(J.volumeSliderProgress,{width:V,left:W});if(J.volumeSliderCapLeft!==undefined){_css(J.volumeSliderCapLeft,{left:0})}}}function q(){H();G();o();n=true;C();R();P.style.opacity=A.idlehide?0:1}q();return this}})(jwplayer);(function(b){var a=["width","height","state","playlist","item","position","buffer","duration","volume","mute","fullscreen"];b.html5.controller=function(t,r,e,q){var w=t;var y=e;var d=q;var k=r;var A=true;var c=-1;var u=(y.config.debug!==undefined)&&(y.config.debug.toString().toLowerCase()=="console");var i=new b.html5.eventdispatcher(k.id,u);b.utils.extend(this,i);function m(D){i.sendEvent(D.type,D)}y.addGlobalListener(m);function p(){try{if(y.playlist[y.item].levels[0].file.length>0){if(A||y.state==b.api.events.state.IDLE){y.addEventListener(b.api.events.JWPLAYER_MEDIA_BUFFER_FULL,function(){y.getMedia().play()});y.addEventListener(b.api.events.JWPLAYER_MEDIA_TIME,function(E){if(E.position>=y.playlist[y.item].start&&c>=0){y.playlist[y.item].start=c;c=-1}});if(y.config.repeat){y.addEventListener(b.api.events.JWPLAYER_MEDIA_COMPLETE,function(E){setTimeout(n,25)})}y.getMedia().load(y.playlist[y.item]);A=false}else{if(y.state==b.api.events.state.PAUSED){y.getMedia().play()}}}return true}catch(D){i.sendEvent(b.api.events.JWPLAYER_ERROR,D)}return false}function B(){try{if(y.playlist[y.item].levels[0].file.length>0){switch(y.state){case b.api.events.state.PLAYING:case b.api.events.state.BUFFERING:y.getMedia().pause();break}}return true}catch(D){i.sendEvent(b.api.events.JWPLAYER_ERROR,D)}return false}function x(D){try{if(y.playlist[y.item].levels[0].file.length>0){if(typeof D!="number"){D=parseFloat(D)}switch(y.state){case b.api.events.state.IDLE:if(c<0){c=y.playlist[y.item].start;y.playlist[y.item].start=D}p();break;case b.api.events.state.PLAYING:case b.api.events.state.PAUSED:case b.api.events.state.BUFFERING:y.getMedia().seek(D);break}}return true}catch(E){i.sendEvent(b.api.events.JWPLAYER_ERROR,E)}return false}function j(){try{if(y.playlist[y.item].levels[0].file.length>0&&y.state!=b.api.events.state.IDLE){y.getMedia().stop()}return true}catch(D){i.sendEvent(b.api.events.JWPLAYER_ERROR,D)}return false}function g(){try{if(y.playlist[y.item].levels[0].file.length>0){if(y.config.shuffle){o(s())}else{if(y.item+1==y.playlist.length){o(0)}else{o(y.item+1)}}}if(y.state!=b.api.events.state.PLAYING&&y.state!=b.api.events.state.BUFFERING){p()}return true}catch(D){i.sendEvent(b.api.events.JWPLAYER_ERROR,D)}return false}function f(){try{if(y.playlist[y.item].levels[0].file.length>0){if(y.config.shuffle){o(s())}else{if(y.item===0){o(y.playlist.length-1)}else{o(y.item-1)}}}if(y.state!=b.api.events.state.PLAYING&&y.state!=b.api.events.state.BUFFERING){p()}return true}catch(D){i.sendEvent(b.api.events.JWPLAYER_ERROR,D)}return false}function s(){var D=null;if(y.playlist.length>1){while(D===null){D=Math.floor(Math.random()*y.playlist.length);if(D==y.item){D=null}}}else{D=0}return D}function o(E){y.resetEventListeners();y.addGlobalListener(m);try{if(y.playlist[E].levels[0].file.length>0){var F=y.state;if(F!==b.api.events.state.IDLE){j()}y.item=E;A=true;y.setActiveMediaProvider(y.playlist[y.item]);i.sendEvent(b.api.events.JWPLAYER_PLAYLIST_ITEM,{index:E});if(F==b.api.events.state.PLAYING||F==b.api.events.state.BUFFERING||y.config.chromeless){p()}}return true}catch(D){i.sendEvent(b.api.events.JWPLAYER_ERROR,D)}return false}function z(E){try{switch(typeof(E)){case"number":y.getMedia().volume(E);break;case"string":y.getMedia().volume(parseInt(E,10));break}return true}catch(D){i.sendEvent(b.api.events.JWPLAYER_ERROR,D)}return false}function l(E){try{if(typeof E=="undefined"){y.getMedia().mute(!y.mute)}else{if(E.toString().toLowerCase()=="true"){y.getMedia().mute(true)}else{y.getMedia().mute(false)}}return true}catch(D){i.sendEvent(b.api.events.JWPLAYER_ERROR,D)}return false}function h(E,D){try{y.width=E;y.height=D;d.resize(E,D);i.sendEvent(b.api.events.JWPLAYER_RESIZE,{width:y.width,height:y.height});return true}catch(F){i.sendEvent(b.api.events.JWPLAYER_ERROR,F)}return false}function v(E){try{if(typeof E=="undefined"){y.fullscreen=!y.fullscreen;d.fullscreen(!y.fullscreen)}else{if(E.toString().toLowerCase()=="true"){y.fullscreen=true;d.fullscreen(true)}else{y.fullscreen=false;d.fullscreen(false)}}i.sendEvent(b.api.events.JWPLAYER_RESIZE,{width:y.width,height:y.height});i.sendEvent(b.api.events.JWPLAYER_FULLSCREEN,{fullscreen:E});return true}catch(D){i.sendEvent(b.api.events.JWPLAYER_ERROR,D)}return false}function C(D){try{j();y.loadPlaylist(D);o(y.item);return true}catch(E){i.sendEvent(b.api.events.JWPLAYER_ERROR,E)}return false}b.html5.controller.repeatoptions={LIST:"LIST",ALWAYS:"ALWAYS",SINGLE:"SINGLE",NONE:"NONE"};function n(){y.resetEventListeners();y.addGlobalListener(m);switch(y.config.repeat.toUpperCase()){case b.html5.controller.repeatoptions.SINGLE:p();break;case b.html5.controller.repeatoptions.ALWAYS:if(y.item==y.playlist.length-1&&!y.config.shuffle){o(0);p()}else{g()}break;case b.html5.controller.repeatoptions.LIST:if(y.item==y.playlist.length-1&&!y.config.shuffle){o(0)}else{g()}break}}this.play=p;this.pause=B;this.seek=x;this.stop=j;this.next=g;this.prev=f;this.item=o;this.setVolume=z;this.setMute=l;this.resize=h;this.setFullscreen=v;this.load=C}})(jwplayer);(function(a){a.html5.defaultSkin=function(){this.text='<?xml version="1.0" ?><skin author="LongTail Video" name="Five" version="1.0"><settings><setting name="backcolor" value="0xFFFFFF"/><setting name="frontcolor" value="0x000000"/><setting name="lightcolor" value="0x000000"/><setting name="screencolor" value="0x000000"/></settings><components><component name="controlbar"><settings><setting name="margin" value="20"/><setting name="fontsize" value="11"/></settings><elements><element name="background" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAIAAABvFaqvAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFJJREFUeNrslLENwAAIwxLU/09j5AiOgD5hVQzNAVY8JK4qEfHMIKBnd2+BQlBINaiRtL/aV2rdzYBsM6CIONbI1NZENTr3RwdB2PlnJgJ6BRgA4hwu5Qg5iswAAAAASUVORK5CYII="/><element name="capLeft" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAYCAIAAAC0rgCNAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAD5JREFUeNosi8ENACAMAgnuv14H0Z8asI19XEjhOiKCMmibVgJTUt7V6fe9KXOtSQCfctJHu2q3/ot79hNgANc2OTz9uTCCAAAAAElFTkSuQmCC"/><element name="capRight" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAYCAIAAAC0rgCNAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAD5JREFUeNosi8ENACAMAgnuv14H0Z8asI19XEjhOiKCMmibVgJTUt7V6fe9KXOtSQCfctJHu2q3/ot79hNgANc2OTz9uTCCAAAAAElFTkSuQmCC"/><element name="divider" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAYCAIAAAC0rgCNAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAD5JREFUeNosi8ENACAMAgnuv14H0Z8asI19XEjhOiKCMmibVgJTUt7V6fe9KXOtSQCfctJHu2q3/ot79hNgANc2OTz9uTCCAAAAAElFTkSuQmCC"/><element name="playButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAYCAYAAAAVibZIAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAEhJREFUeNpiYqABYBo1dNRQ+hr6H4jvA3E8NS39j4SpZvh/LJig4YxEGEqy3kET+w+AOGFQRhTJhrEQkGcczfujhg4CQwECDADpTRWU/B3wHQAAAABJRU5ErkJggg=="/><element name="pauseButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAYCAYAAAAVibZIAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAChJREFUeNpiYBgFo2DwA0YC8v/R1P4nRu+ooaOGUtnQUTAKhgIACDAAFCwQCfAJ4gwAAAAASUVORK5CYII="/><element name="prevButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAYCAYAAAAVibZIAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAEtJREFUeNpiYBgFo2Dog/9QDAPyQHweTYwiQ/2B+D0Wi8g2tB+JTdBQRiIMJVkvEy0iglhDF9Aq9uOpHVEwoE+NJDUKRsFgAAABBgDe2hqZcNNL0AAAAABJRU5ErkJggg=="/><element name="nextButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAYCAYAAAAVibZIAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAElJREFUeNpiYBgFo2Dog/9AfB6I5dHE/lNqKAi/B2J/ahsKw/3EGMpIhKEk66WJoaR6fz61IyqemhEFSlL61ExSo2AUDAYAEGAAiG4hj+5t7M8AAAAASUVORK5CYII="/><element name="timeSliderRail" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADxJREFUeNpiYBgFo2AU0Bwwzluw+D8tLWARFhKiqQ9YuLg4aWsBGxs7bS1gZ6e5BWyjSX0UjIKhDgACDABlYQOGh5pYywAAAABJRU5ErkJggg=="/><element name="timeSliderBuffer" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAD1JREFUeNpiYBgFo2AU0Bww1jc0/aelBSz8/Pw09QELOzs7bS1gY2OjrQWsrKy09gHraFIfBaNgqAOAAAMAvy0DChXHsZMAAAAASUVORK5CYII="/><element name="timeSliderProgress" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAClJREFUeNpiYBgFo2AU0BwwAvF/WlrARGsfjFow8BaMglEwCugAAAIMAOHfAQunR+XzAAAAAElFTkSuQmCC"/><element name="timeSliderThumb" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAICAYAAAA870V8AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABZJREFUeNpiZICA/yCCiQEJUJcDEGAAY0gBD1/m7Q0AAAAASUVORK5CYII="/><element name="muteButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAYCAYAAADKx8xXAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADFJREFUeNpiYBgFIw3MB+L/5Gj8j6yRiRTFyICJXHfTXyMLAXlGati4YDRFDj8AEGAABk8GSqqS4CoAAAAASUVORK5CYII="/><element name="unmuteButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAYCAYAAADKx8xXAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAD1JREFUeNpiYBgFgxz8p7bm+cQa+h8LHy7GhEcjIz4bmAjYykiun/8j0fakGPIfTfPgiSr6aB4FVAcAAQYAWdwR1G1Wd2gAAAAASUVORK5CYII="/><element name="volumeSliderRail" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAYCAYAAADkgu3FAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAGpJREFUeNpi/P//PwM9ABMDncCoRYPfIqqDZcuW1UPp/6AUDcNM1DQYKtRAlaAj1mCSLSLXYIIWUctgDItoZfDA5aOoqKhGEANIM9LVR7SymGDQUctikuOIXkFNdhHEOFrDjlpEd4sAAgwAriRMub95fu8AAAAASUVORK5CYII="/><element name="volumeSliderProgress" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAYCAYAAADkgu3FAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFtJREFUeNpi/P//PwM9ABMDncCoRYPfIlqAeij9H5SiYZiqBqPTlFqE02BKLSLaYFItIttgQhZRzWB8FjENiuRJ7aAbsMQwYMl7wDIsWUUQ42gNO2oR3S0CCDAAKhKq6MLLn8oAAAAASUVORK5CYII="/><element name="fullscreenButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAE5JREFUeNpiYBgFo2DQA0YC8v/xqP1PjDlMRDrEgUgxkgHIlfZoriVGjmzLsLFHAW2D6D8eA/9Tw7L/BAwgJE90PvhPpNgoGAVDEQAEGAAMdhTyXcPKcAAAAABJRU5ErkJggg=="/><element name="normalscreenButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAEZJREFUeNpiYBgFo2DIg/9UUkOUAf8JiFFsyX88fJyAkcQgYMQjNkzBoAgiezyRbE+tFGSPxQJ7auYBmma0UTAKBhgABBgAJAEY6zON61sAAAAASUVORK5CYII="/></elements></component><component name="display"><elements><element name="background" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAEpJREFUeNrszwENADAIA7DhX8ENoBMZ5KR10EryckCJiIiIiIiIiIiIiIiIiIiIiIh8GmkRERERERERERERERERERERERGRHSPAAPlXH1phYpYaAAAAAElFTkSuQmCC"/><element name="playIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAALdJREFUeNrs18ENgjAYhmFouDOCcQJGcARHgE10BDcgTOIosAGwQOuPwaQeuFRi2p/3Sb6EC5L3QCxZBgAAAOCorLW1zMn65TrlkH4NcV7QNcUQt7Gn7KIhxA+qNIR81spOGkL8oFJDyLJRdosqKDDkK+iX5+d7huzwM40xptMQMkjIOeRGo+VkEVvIPfTGIpKASfYIfT9iCHkHrBEzf4gcUQ56aEzuGK/mw0rHpy4AAACAf3kJMACBxjAQNRckhwAAAABJRU5ErkJggg=="/><element name="muteIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNrs1jEOgCAMBVAg7t5/8qaoIy4uoobyXsLCxA+0NCUAAADGUWvdQoQ41x4ixNBB2hBvBskdD3w5ZCkl3+33VqI0kjBBlh9rp+uTcyOP33TnolfsU85XX3yIRpQph8ZQY3wTZtU5AACASA4BBgDHoVuY1/fvOQAAAABJRU5ErkJggg=="/><element name="errorIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAWlJREFUeNrsl+1twjAQhsHq/7BBYQLYIBmBDcoGMAIjtBPQTcII2SDtBDBBwrU6pGsUO7YbO470PtKJkz9iH++d4ywWAAAAAABgljRNsyWr2bZzDuJG1rLdZhcMbTjrBCGDyUKsqQLFciJb9bSvuG/WagRVRUVUI6gqy5HVeKWfSgRyJruKIU//TrZTSn2nmlaXThrloi/v9F2STC1W4+Aw5cBzkquRc09bofFNc6YLxEON0VUZS5FPTftO49vMjRsIF3RhOGr7/D/pJw+FKU+q0vDyq8W42jCunDqI3LC5XxNj2wHLU1XjaRnb0Lhykhqhhd8MtSF5J9tbjCv4mXGvKJz/65FF/qJryyaaIvzP2QRxZTX2nTuXjvV/VPFSwyLnW7mpH99yTh1FEVro6JBSd40/pMrRdV8vPtcKl28T2pT8TnFZ4yNosct3Q0io6JfBiz1FlGdqVQH3VHnepAEAAAAAADDzEGAAcTwB10jWgxcAAAAASUVORK5CYII="/><element name="bufferIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAuhJREFUeNrsWr9rU1EUznuNGqvFQh1ULOhiBx0KDtIuioO4pJuik3FxFfUPaAV1FTdx0Q5d2g4FFxehTnEpZHFoBy20tCIWtGq0TZP4HfkeHB5N8m6Sl/sa74XDybvv3vvOd8/Pe4lXrVZT3dD8VJc0B8QBcUAcEAfESktHGeR5XtMfqFQq/f92zPe/NbtGlKTdCY30kuxrpMGO94BlQCXs+rbh3ONgA6BlzP1p20d80gEI5hmA2A92Qua1Q2PtAFISM+bvjMG8U+Q7oA3rQGASwrYCU6WpNdLGYbA+Pq5jjXIiwi8EEa2UDbQSaKOIuV+SlkcCrfjY8XTI9EpKGwP0C2kru2hLtHqa4zoXtZRWyvi4CLwv9Opr6Hkn6A9HKgEANsQ1iqC3Ub/vRUk2JgmRkatK36kVrnt0qObunwUdUUMXMWYpakJsO5Am8tAw2GBIgwWA+G2S2dMpiw0gDioQRQJoKhRb1QiDwlHZUABYbaXWsm5ae6loTE4ZDxN4CZar8foVzOJ2iyZ2kWF3t7YIevffaMT5yJ70kQb2fQ1sE5SHr2wazs2wgMxgbsEKEAgxAvZUJbQLBGTSBMgNrncJbA6AljtS/eKDJ0Ez+DmrQEzXS2h1Ck25kAg0IZcUOaydCy4sYnN2fOA+2AP16gNoHALlQ+fwH7XO4CxLenUpgj4xr6ugY2roPMbMx+Xs18m/E8CVEIhxsNeg83XWOAN6grG3lGbk8uE5fr4B/WH3cJw+co/l9nTYsSGYCJ/lY5/qv0thn6nrIWmjeJcPSnWOeY++AkF8tpJHIMAUs/MaBBpj3znZfQo5psY+ZrG4gv5HickjEOymKjEeRpgyST6IuZcTcWbnjcgdPi5ghxciRKsl1lDSsgwA1i8fssonJgzmTSqfGUkCENndNdAL7PS6QQ7ZYISTo+1qq0LEWjTWcvY4isa4z+yfQB+7ooyHVg5RI7/i1Ijn/vnggDggDogD4oC00P4KMACd/juEHOrS4AAAAABJRU5ErkJggg=="/></elements></component><component name="dock"><elements><element name="button" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFBJREFUeNrs0cEJACAQA8Eofu0fu/W6EM5ZSAFDRpKTBs00CQQEBAQEBAQEBAQEBAQEBATkK8iqbY+AgICAgICAgICAgICAgICAgIC86QowAG5PAQzEJ0lKAAAAAElFTkSuQmCC"/></elements></component><component name="playlist"><elements><element name="item" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAIAAAC1nk4lAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHhJREFUeNrs2NEJwCAMBcBYuv/CFuIE9VN47WWCR7iocXR3pdWdGPqqwIoMjYfQeAiNh9B4JHc6MHQVHnjggQceeOCBBx77TifyeOY0iHi8DqIdEY8dD5cL094eePzINB5CO/LwcOTptNB4CP25L4TIbZzpU7UEGAA5wz1uF5rF9AAAAABJRU5ErkJggg=="/><element name="sliderRail" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAA8CAIAAADpFA0BAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADhJREFUeNrsy6ENACAMAMHClp2wYxZLAg5Fcu9e3OjuOKqqfTMzbs14CIZhGIZhGIZhGP4VLwEGAK/BBnVFpB0oAAAAAElFTkSuQmCC"/><element name="sliderThumb" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAA8CAIAAADpFA0BAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADRJREFUeNrsy7ENACAMBLE8++8caFFKKiRffU53112SGs3ttOohGIZhGIZhGIZh+Fe8BRgAiaUGde6NOSEAAAAASUVORK5CYII="/></elements></component></components></skin>';this.xml=null;if(window.DOMParser){parser=new DOMParser();this.xml=parser.parseFromString(this.text,"text/xml")}else{this.xml=new ActiveXObject("Microsoft.XMLDOM");this.xml.async="false";this.xml.loadXML(this.text)}return this}})(jwplayer);(function(a){_css=a.utils.css;_hide=function(b){_css(b,{display:"none"})};_show=function(b){_css(b,{display:"block"})};a.html5.display=function(o,y){var v=o;var e={};var g;var z;var k;var w;var x;var p;var j;var n=v.skin.getComponentSettings("display").bufferrotation===undefined?15:parseInt(v.skin.getComponentSettings("display").bufferrotation,10);var f=v.skin.getComponentSettings("display").bufferinterval===undefined?100:parseInt(v.skin.getComponentSettings("display").bufferinterval,10);var d={display:{style:{cursor:"pointer",top:0,left:0,overflow:"hidden"},click:t},display_icon:{style:{cursor:"pointer",position:"absolute",top:((v.skin.getSkinElement("display","background").height-v.skin.getSkinElement("display","playIcon").height)/2),left:((v.skin.getSkinElement("display","background").width-v.skin.getSkinElement("display","playIcon").width)/2),border:0,margin:0,padding:0,zIndex:3}},display_iconBackground:{style:{cursor:"pointer",position:"absolute",top:((z-v.skin.getSkinElement("display","background").height)/2),left:((g-v.skin.getSkinElement("display","background").width)/2),border:0,backgroundImage:(["url(",v.skin.getSkinElement("display","background").src,")"]).join(""),width:v.skin.getSkinElement("display","background").width,height:v.skin.getSkinElement("display","background").height,margin:0,padding:0,zIndex:2}},display_image:{style:{display:"none",width:g,height:z,position:"absolute",cursor:"pointer",left:0,top:0,margin:0,padding:0,textDecoration:"none",zIndex:1}},display_text:{style:{zIndex:4,position:"relative",opacity:0.8,backgroundColor:parseInt("000000",16),color:parseInt("ffffff",16),textAlign:"center",fontFamily:"Arial,sans-serif",padding:"0 5px",fontSize:14}}};v.jwAddEventListener(a.api.events.JWPLAYER_PLAYER_STATE,l);v.jwAddEventListener(a.api.events.JWPLAYER_MEDIA_MUTE,l);v.jwAddEventListener(a.api.events.JWPLAYER_PLAYLIST_ITEM,l);v.jwAddEventListener(a.api.events.JWPLAYER_ERROR,s);A();function A(){e.display=r("div","display");e.display_text=r("div","display_text");e.display.appendChild(e.display_text);e.display_image=r("img","display_image");e.display_image.onerror=function(B){_hide(e.display_image)};e.display_image.onload=m;e.display_icon=r("div","display_icon");e.display_iconBackground=r("div","display_iconBackground");e.display.appendChild(e.display_image);e.display_iconBackground.appendChild(e.display_icon);e.display.appendChild(e.display_iconBackground);b()}this.getDisplayElement=function(){return e.display};this.resize=function(C,B){g=C;z=B;_css(e.display,{width:C,height:B});_css(e.display_text,{width:(C-10),top:((z-e.display_text.getBoundingClientRect().height)/2)});_css(e.display_iconBackground,{top:((z-v.skin.getSkinElement("display","background").height)/2),left:((g-v.skin.getSkinElement("display","background").width)/2)});i();l({})};function m(B){k=e.display_image.naturalWidth;w=e.display_image.naturalHeight;i()}function i(){a.utils.stretch(v.jwGetStretching(),e.display_image,g,z,k,w)}function r(B,D){var C=document.createElement(B);C.id=v.id+"_jwplayer_"+D;_css(C,d[D].style);return C}function b(){for(var B in e){if(d[B].click!==undefined){e[B].onclick=d[B].click}}}function t(B){if(typeof B.preventDefault!="undefined"){B.preventDefault()}else{B.returnValue=false}if(v.jwGetState()!=a.api.events.state.PLAYING){v.jwPlay()}else{v.jwPause()}}function h(B){if(j){return}_show(e.display_iconBackground);e.display_icon.style.backgroundImage=(["url(",v.skin.getSkinElement("display",B).src,")"]).join("");_css(e.display_icon,{display:"block",width:v.skin.getSkinElement("display",B).width,height:v.skin.getSkinElement("display",B).height,top:(v.skin.getSkinElement("display","background").height-v.skin.getSkinElement("display",B).height)/2,left:(v.skin.getSkinElement("display","background").width-v.skin.getSkinElement("display",B).width)/2});if(v.skin.getSkinElement("display",B+"Over")!==undefined){e.display_icon.onmouseover=function(C){e.display_icon.style.backgroundImage=["url(",v.skin.getSkinElement("display",B+"Over").src,")"].join("")};e.display_icon.onmouseout=function(C){e.display_icon.style.backgroundImage=["url(",v.skin.getSkinElement("display",B).src,")"].join("")}}else{e.display_icon.onmouseover=null;e.display_icon.onmouseout=null}}function q(){_hide(e.display_icon);_hide(e.display_iconBackground)}function s(B){j=true;q();e.display_text.innerHTML=B.error;_show(e.display_text);e.display_text.style.top=((z-e.display_text.getBoundingClientRect().height)/2)+"px"}function c(){_css(e.display_image,{display:"none"});delete e.display_image.src}function u(){var B=e.display_image;e.display_image=r("img","display_image");e.display_image.onerror=function(C){_hide(e.display_image)};e.display_image.onload=m;e.display.replaceChild(e.display_image,B)}function l(B){if((B.type==a.api.events.JWPLAYER_PLAYER_STATE||B.type==a.api.events.JWPLAYER_PLAYLIST_ITEM)&&j){j=false;_hide(e.display_text)}if(p!==undefined){clearInterval(p);p=null;a.utils.animations.rotate(e.display_icon,0)}switch(v.jwGetState()){case a.api.events.state.BUFFERING:h("bufferIcon");x=0;p=setInterval(function(){x+=n;a.utils.animations.rotate(e.display_icon,x%360)},f);h("bufferIcon");break;case a.api.events.state.PAUSED:_css(e.display_image,{background:"transparent no-repeat center center"});h("playIcon");break;case a.api.events.state.IDLE:if(v.jwGetPlaylist()[v.jwGetItem()].image){_css(e.display_image,{display:"block"});e.display_image.src=a.utils.getAbsolutePath(v.jwGetPlaylist()[v.jwGetItem()].image)}else{u()}h("playIcon");break;default:if(v.jwGetMute()){u();h("muteIcon")}else{u();_hide(e.display_iconBackground);_hide(e.display_icon)}break}}return this}})(jwplayer);(function(jwplayer){jwplayer.html5.eventdispatcher=function(id,debug){var _id=id;var _debug=debug;var _listeners;var _globallisteners;this.resetEventListeners=function(){_listeners={};_globallisteners=[]};this.resetEventListeners();this.addEventListener=function(type,listener,count){try{if(_listeners[type]===undefined){_listeners[type]=[]}if(typeof(listener)=="string"){eval("listener = "+listener)}_listeners[type].push({listener:listener,count:count})}catch(err){jwplayer.utils.log("error",err)}return false};this.removeEventListener=function(type,listener){try{for(var listenerIndex=0;listenerIndex<_listeners[type].length;listenerIndex++){if(_listeners[type][lisenterIndex].toString()==listener.toString()){_listeners[type].slice(lisenterIndex,lisenterIndex+1);break}}}catch(err){jwplayer.utils.log("error",err)}return false};this.addGlobalListener=function(listener,count){try{if(typeof(listener)=="string"){eval("listener = "+listener)}_globallisteners.push({listener:listener,count:count})}catch(err){jwplayer.utils.log("error",err)}return false};this.removeGlobalListener=function(listener){try{for(var globalListenerIndex=0;globalListenerIndex<_globallisteners.length;globalListenerIndex++){if(_globallisteners[globalListenerIndex].toString()==listener.toString()){_globallisteners.slice(globalListenerIndex,globalListenerIndex+1);break}}}catch(err){jwplayer.utils.log("error",err)}return false};this.sendEvent=function(type,data){if(data===undefined){data={}}jwplayer.utils.extend(data,{id:_id,version:jwplayer.version,type:type});if(_debug){jwplayer.utils.log(type,data)}if(typeof _listeners[type]!="undefined"){for(var listenerIndex=0;listenerIndex<_listeners[type].length;listenerIndex++){try{_listeners[type][listenerIndex].listener(data)}catch(err){jwplayer.utils.log("There was an error while handling a listener",_listeners[type][listenerIndex].listener,err)}if(_listeners[type][listenerIndex].count===1){delete _listeners[type][listenerIndex]}else{if(_listeners[type][listenerIndex].count>0){_listeners[type][listenerIndex].count=_listeners[type][listenerIndex].count-1}}}}for(var globalListenerIndex=0;globalListenerIndex<_globallisteners.length;globalListenerIndex++){try{_globallisteners[globalListenerIndex].listener(data)}catch(err){jwplayer.utils.log("There was an error while handling a listener",_globallisteners[globalListenerIndex].listener,err)}if(_globallisteners[globalListenerIndex].count===1){delete _globallisteners[globalListenerIndex]}else{if(_globallisteners[globalListenerIndex].count>0){_globallisteners[globalListenerIndex].count=_globallisteners[globalListenerIndex].count-1}}}}}})(jwplayer);(function(a){var b={prefix:"http://l.longtailvideo.com/html5/",file:"logo.png",link:"http://www.longtailvideo.com/players/jw-flv-player/",margin:8,out:0.5,over:1,timeout:3,hide:true,position:"bottom-left"};_css=a.utils.css;a.html5.logo=function(l,m){var r=l;var n;var i;var c;j();function j(){p();d();f()}function p(){if(b.prefix){var t=l.version.split(/\W/).splice(0,2).join("/");if(b.prefix.indexOf(t)<0){b.prefix+=t+"/"}}if(m.position==a.html5.view.positions.OVER){m.position=b.position}i=a.utils.extend({},b)}function d(){c=document.createElement("img");c.id=r.id+"_jwplayer_logo";c.style.display="none";c.onload=function(t){_css(c,q());r.jwAddEventListener(a.api.events.JWPLAYER_PLAYER_STATE,s);e()};if(!i.file){return}if(i.file.indexOf("http://")===0){c.src=i.file}else{c.src=i.prefix+i.file}}if(!i.file){return}this.resize=function(u,t){};this.getDisplayElement=function(){return c};function f(){if(i.link){c.onmouseover=h;c.onmouseout=e;c.onclick=o}else{this.mouseEnabled=false}}function o(t){if(typeof t!="undefined"){t.stopPropagation()}r.jwPause();r.jwSetFullscreen(false);if(i.link){window.open(i.link,"_blank")}return}function e(t){if(i.link){c.style.opacity=i.out}return}function h(t){if(i.hide){c.style.opacity=i.over}return}function q(){var v={textDecoration:"none",position:"absolute",cursor:"pointer"};v.display=i.hide?"none":"block";var u=i.position.toLowerCase().split("-");for(var t in u){v[u[t]]=i.margin}return v}function k(){if(i.hide){c.style.display="block";c.style.opacity=0;a.utils.fadeTo(c,i.out,0.1,parseFloat(c.style.opacity));n=setTimeout(function(){g()},i.timeout*1000)}}function g(){if(i.hide){a.utils.fadeTo(c,0,0.1,parseFloat(c.style.opacity))}}function s(t){if(t.newstate==a.api.events.state.BUFFERING){clearTimeout(n);k()}}return this}})(jwplayer);(function(a){var c={ended:a.api.events.state.IDLE,playing:a.api.events.state.PLAYING,pause:a.api.events.state.PAUSED,buffering:a.api.events.state.BUFFERING};var b=a.utils.css;a.html5.mediavideo=function(f,D){var H={abort:t,canplay:m,canplaythrough:m,durationchange:q,emptied:t,ended:m,error:l,loadeddata:q,loadedmetadata:q,loadstart:m,pause:m,play:K,playing:m,progress:A,ratechange:t,seeked:m,seeking:m,stalled:m,suspend:m,timeupdate:K,volumechange:t,waiting:m,canshowcurrentframe:t,dataunavailable:t,empty:t,load:e,loadedfirstframe:t};var I=new a.html5.eventdispatcher();a.utils.extend(this,I);var h=f;var x=D;var E;var G;var d=a.api.events.state.IDLE;var B=null;var n;var g=0;var z=false;var r=false;var M;var L;var i=[];var N;var C=false;function v(){return d}function e(O){}function t(O){}function m(O){if(c[O.type]){s(c[O.type])}}function s(O){if(C){return}if(n){O=a.api.events.state.IDLE}if(O==a.api.events.state.PAUSED&&d==a.api.events.state.IDLE){return}if(O==a.api.events.state.PLAYING&&d==a.api.events.state.IDLE){s(a.api.events.state.BUFFERING);I.sendEvent(a.api.events.JWPLAYER_MEDIA_BUFFER,{bufferPercent:h.buffer});y();return}if(d!=O){var P=d;h.state=O;d=O;var Q=false;if(O==a.api.events.state.IDLE){p();if(h.position>=h.duration&&(h.position||h.duration)){Q=true}if(x.style.display!="none"&&!h.config.chromeless){x.style.display="none"}}I.sendEvent(a.api.events.JWPLAYER_PLAYER_STATE,{oldstate:P,newstate:O});if(Q){I.sendEvent(a.api.events.JWPLAYER_MEDIA_COMPLETE)}}n=false}function q(O){var P={height:O.target.videoHeight,width:O.target.videoWidth,duration:Math.round(O.target.duration*10)/10};if(h.duration===0||isNaN(h.duration)){h.duration=Math.round(O.target.duration*10)/10}h.playlist[h.item]=a.utils.extend(h.playlist[h.item],P);I.sendEvent(a.api.events.JWPLAYER_MEDIA_META,{metadata:P})}function K(P){if(n){return}if(P!==undefined&&P.target!==undefined){if(h.duration===0||isNaN(h.duration)){h.duration=Math.round(P.target.duration*10)/10}if(!z&&x.readyState>0){s(a.api.events.state.PLAYING)}if(d==a.api.events.state.PLAYING){if(!z&&x.readyState>0){z=true;try{x.currentTime=h.playlist[h.item].start}catch(O){}x.volume=h.volume/100;x.muted=h.mute}h.position=Math.round(P.target.currentTime*10)/10;I.sendEvent(a.api.events.JWPLAYER_MEDIA_TIME,{position:P.target.currentTime,duration:P.target.duration})}}A(P)}function y(){if(E===false&&d==a.api.events.state.BUFFERING){I.sendEvent(a.api.events.JWPLAYER_MEDIA_BUFFER_FULL);E=true}}function F(){var O=(i[i.length-1]-i[0])/i.length;N=setTimeout(function(){if(!G){A({lengthComputable:true,loaded:1,total:1})}},O*10)}function A(Q){var P,O;if(Q!==undefined&&Q.lengthComputable&&Q.total){o();P=Q.loaded/Q.total*100;O=P/100*(h.duration-x.currentTime);if(50<P&&!G){clearTimeout(N);F()}}else{if((x.buffered!==undefined)&&(x.buffered.length>0)){maxBufferIndex=0;if(maxBufferIndex>=0){P=x.buffered.end(maxBufferIndex)/x.duration*100;O=x.buffered.end(maxBufferIndex)-x.currentTime}}}y();if(!G){if(P==100&&G===false){G=true}if(P!==null&&(P>h.buffer)){h.buffer=Math.round(P);I.sendEvent(a.api.events.JWPLAYER_MEDIA_BUFFER,{bufferPercent:Math.round(P)})}}}function w(){if(B===null){B=setInterval(function(){K()},100)}}function p(){clearInterval(B);B=null}function l(Q){var P="There was an error: ";if((Q.target.error&&Q.target.tagName.toLowerCase()=="video")||Q.target.parentNode.error&&Q.target.parentNode.tagName.toLowerCase()=="video"){var O=Q.target.error===undefined?Q.target.parentNode.error:Q.target.error;switch(O.code){case O.MEDIA_ERR_ABORTED:P="You aborted the video playback: ";break;case O.MEDIA_ERR_NETWORK:P="A network error caused the video download to fail part-way: ";break;case O.MEDIA_ERR_DECODE:P="The video playback was aborted due to a corruption problem or because the video used features your browser did not support: ";break;case O.MEDIA_ERR_SRC_NOT_SUPPORTED:P="The video could not be loaded, either because the server or network failed or because the format is not supported: ";break;default:P="An unknown error occurred: ";break}}else{if(Q.target.tagName.toLowerCase()=="source"){L--;if(L>0){return}P="The video could not be loaded, either because the server or network failed or because the format is not supported: "}else{a.utils.log("Erroneous error received. Continuing...");return}}u();P+=j();C=true;I.sendEvent(a.api.events.JWPLAYER_ERROR,{error:P});return}function j(){var Q="";for(var P in M.levels){var O=M.levels[P];var R=x.ownerDocument.createElement("source");Q+=a.utils.getAbsolutePath(O.file);if(P<(M.levels.length-1)){Q+=", "}}return Q}this.getDisplayElement=function(){return x};this.play=function(){if(d!=a.api.events.state.PLAYING){if(x.style.display!="block"){x.style.display="block"}x.play();w();if(E){s(a.api.events.state.PLAYING)}}};this.pause=function(){x.pause();s(a.api.events.state.PAUSED)};this.seek=function(O){if(!(h.duration===0||isNaN(h.duration))&&!(h.position===0||isNaN(h.position))){x.currentTime=O;x.play()}};function u(){x.pause();p();h.position=0;n=true;s(a.api.events.state.IDLE)}this.stop=u;this.volume=function(O){x.volume=O/100;h.volume=O;I.sendEvent(a.api.events.JWPLAYER_MEDIA_VOLUME,{volume:Math.round(O)})};this.mute=function(O){x.muted=O;h.mute=O;I.sendEvent(a.api.events.JWPLAYER_MEDIA_MUTE,{mute:O})};this.resize=function(P,O){if(false){b(x,{width:P,height:O})}I.sendEvent(a.api.events.JWPLAYER_MEDIA_RESIZE,{fullscreen:h.fullscreen,width:P,hieght:O})};this.fullscreen=function(O){if(O===true){this.resize("100%","100%")}else{this.resize(h.config.width,h.config.height)}};this.load=function(O){J(O);I.sendEvent(a.api.events.JWPLAYER_MEDIA_LOADED);E=false;G=false;z=false;if(!h.config.chromeless){i=[];o();s(a.api.events.state.BUFFERING);setTimeout(function(){K()},25)}};function o(){var O=new Date().getTime();i.push(O)}this.hasChrome=function(){return r};function J(V){h.duration=V.duration;r=false;M=V;var Q=document.createElement("video");Q.preload="none";C=false;L=0;for(var P=0;P<V.levels.length;P++){var O=V.levels[P];if(a.utils.isYouTube(O.file)){delete Q;k(O.file);return}var R;if(O.type===undefined){var U=a.utils.extension(O.file);if(a.utils.extensionmap[U]!==undefined&&a.utils.extensionmap[U].html5!==undefined){R=a.utils.extensionmap[U].html5}else{R="video/"+U+";"}}else{R=O.type}if(a.utils.html5CanPlay(Q,O.file)){var T=x.ownerDocument.createElement("source");T.src=a.utils.getAbsolutePath(O.file);if(!a.utils.isLegacyAndroid()){T.type=R}L++;Q.appendChild(T)}}if(L===0){C=true;I.sendEvent(a.api.events.JWPLAYER_ERROR,{error:"The video could not be loaded because the format is not supported by your browser: "+j()})}if(h.config.chromeless){Q.poster=a.utils.getAbsolutePath(V.image);Q.controls="controls"}Q.style.position=x.style.position;Q.style.top=x.style.top;Q.style.left=x.style.left;Q.style.width=x.style.width;Q.style.height=x.style.height;Q.style.zIndex=x.style.zIndex;Q.onload=e;Q.volume=0;x.parentNode.replaceChild(Q,x);Q.id=x.id;x=Q;for(var S in H){x.addEventListener(S,function(W){if(W.target.parentNode!==null){H[W.type](W)}},true)}}function k(S){var P=document.createElement("object");S=["http://www.youtube.com/v/",S.replace(/^[^v]+v.(.{11}).*/,"$1"),"&hl=en_US&fs=1&autoplay=1"].join("");var V={movie:S,allowFullScreen:"true",allowscriptaccess:"always"};for(var O in V){var T=document.createElement("param");T.name=O;T.value=V[O];P.appendChild(T)}var U=document.createElement("embed");var Q={src:S,type:"application/x-shockwave-flash",allowscriptaccess:"always",allowfullscreen:"true",width:document.getElementById(f.id).style.width,height:document.getElementById(f.id).style.height};for(var R in Q){U[R]=Q[R]}P.appendChild(U);P.style.position=x.style.position;P.style.top=x.style.top;P.style.left=x.style.left;P.style.width=document.getElementById(f.id).style.width;P.style.height=document.getElementById(f.id).style.height;P.style.zIndex=2147483000;x.parentNode.replaceChild(P,x);P.id=x.id;x=P;r=true}this.embed=J;return this}})(jwplayer);(function(jwplayer){var _configurableStateVariables=["width","height","start","duration","volume","mute","fullscreen","item","plugins","stretching"];jwplayer.html5.model=function(api,container,options){var _api=api;var _container=container;var _model={id:_container.id,playlist:[],state:jwplayer.api.events.state.IDLE,position:0,buffer:0,config:{width:480,height:320,item:-1,skin:undefined,file:undefined,image:undefined,start:0,duration:0,bufferlength:5,volume:90,mute:false,fullscreen:false,repeat:"none",stretching:jwplayer.utils.stretching.UNIFORM,autostart:false,debug:undefined,screencolor:undefined}};var _media;var _eventDispatcher=new jwplayer.html5.eventdispatcher();var _components=["display","logo","controlbar"];jwplayer.utils.extend(_model,_eventDispatcher);for(var option in options){if(typeof options[option]=="string"){var type=/color$/.test(option)?"color":null;options[option]=jwplayer.utils.typechecker(options[option],type)}var config=_model.config;var path=option.split(".");for(var edge in path){if(edge==path.length-1){config[path[edge]]=options[option]}else{if(config[path[edge]]===undefined){config[path[edge]]={}}config=config[path[edge]]}}}for(var index in _configurableStateVariables){var configurableStateVariable=_configurableStateVariables[index];_model[configurableStateVariable]=_model.config[configurableStateVariable]}var pluginorder=_components.concat([]);if(_model.plugins!==undefined){if(typeof _model.plugins=="string"){var userplugins=_model.plugins.split(",");for(var userplugin in userplugins){if(typeof userplugins[userplugin]=="string"){pluginorder.push(userplugins[userplugin].replace(/^\s+|\s+$/g,""))}}}}if(jwplayer.utils.isIOS()){_model.config.chromeless=true}if(_model.config.chromeless){pluginorder=[]}_model.plugins={order:pluginorder,config:{controlbar:{position:jwplayer.html5.view.positions.BOTTOM}},object:{}};if(typeof _model.config.components!="undefined"){for(var component in _model.config.components){_model.plugins.config[component]=_model.config.components[component]}}for(var pluginIndex in _model.plugins.order){var pluginName=_model.plugins.order[pluginIndex];var pluginConfig=_model.config[pluginName]===undefined?{}:_model.config[pluginName];_model.plugins.config[pluginName]=_model.plugins.config[pluginName]===undefined?pluginConfig:jwplayer.utils.extend(_model.plugins.config[pluginName],pluginConfig);if(_model.plugins.config[pluginName].position===undefined){_model.plugins.config[pluginName].position=jwplayer.html5.view.positions.OVER}}_model.loadPlaylist=function(arg,ready){var input;if(typeof arg=="string"){try{input=eval(arg)}catch(err){input=arg}}else{input=arg}var config;switch(jwplayer.utils.typeOf(input)){case"object":config=input;break;case"array":config={playlist:input};break;default:config={file:input};break}_model.playlist=new jwplayer.html5.playlist(config);if(_model.config.shuffle){_model.item=_getShuffleItem()}else{if(_model.config.item>=_model.playlist.length){_model.config.item=_model.playlist.length-1}else{if(_model.config.item<0){_model.config.item=0}}_model.item=_model.config.item}if(!ready){_eventDispatcher.sendEvent(jwplayer.api.events.JWPLAYER_PLAYLIST_LOADED,{playlist:_model.playlist})}_model.setActiveMediaProvider(_model.playlist[_model.item])};function _getShuffleItem(){var result=null;if(_model.playlist.length>1){while(result===null){result=Math.floor(Math.random()*_model.playlist.length);if(result==_model.item){result=null}}}else{result=0}return result}function forward(evt){if(evt.type==jwplayer.api.events.JWPLAYER_MEDIA_LOADED){_container=_media.getDisplayElement()}_eventDispatcher.sendEvent(evt.type,evt)}_model.setActiveMediaProvider=function(playlistItem){if(_media!==undefined){_media.resetEventListeners()}_media=new jwplayer.html5.mediavideo(_model,_container);_media.addGlobalListener(forward);if(_model.config.chromeless){_media.load(playlistItem)}return true};_model.getMedia=function(){return _media};_model.setupPlugins=function(){for(var plugin in _model.plugins.order){try{if(jwplayer.html5[_model.plugins.order[plugin]]!==undefined){_model.plugins.object[_model.plugins.order[plugin]]=new jwplayer.html5[_model.plugins.order[plugin]](_api,_model.plugins.config[_model.plugins.order[plugin]])}else{if(window[_model.plugins.order[plugin]]!==undefined){_model.plugins.object[_model.plugins.order[plugin]]=new window[_model.plugins.order[plugin]](_api,_model.plugins.config[_model.plugins.order[plugin]])}else{_model.plugins.order.splice(plugin,plugin+1)}}}catch(err){jwplayer.utils.log("Could not setup "+_model.plugins.order[plugin])}}};return _model}})(jwplayer);(function(a){a.html5.playlist=function(b){var d=[];if(b.playlist&&b.playlist instanceof Array&&b.playlist.length>0){for(var c in b.playlist){if(!isNaN(parseInt(c))){d.push(new a.html5.playlistitem(b.playlist[c]))}}}else{d.push(new a.html5.playlistitem(b))}return d}})(jwplayer);(function(a){a.html5.playlistitem=function(c){var b={author:"",date:"",description:"",image:"",link:"",mediaid:"",tags:"",title:"",provider:"",file:"",streamer:"",duration:-1,start:0,currentLevel:-1,levels:[]};for(var d in b){if(c[d]!==undefined){b[d]=c[d]}}if(b.levels.length===0){b.levels[0]=new a.html5.playlistitemlevel(b)}return b}})(jwplayer);(function(a){a.html5.playlistitemlevel=function(b){var d={file:"",streamer:"",bitrate:0,width:0};for(var c in d){if(b[c]!==undefined){d[c]=b[c]}}return d}})(jwplayer);(function(a){a.html5.skin=function(){var b={};var c=false;this.load=function(d,e){new a.html5.skinloader(d,function(f){c=true;b=f;e()},function(){new a.html5.skinloader("",function(f){c=true;b=f;e()})})};this.getSkinElement=function(d,e){if(c){try{return b[d].elements[e]}catch(f){a.utils.log("No such skin component / element: ",[d,e])}}return null};this.getComponentSettings=function(d){if(c){return b[d].settings}return null};this.getComponentLayout=function(d){if(c){return b[d].layout}return null}}})(jwplayer);(function(a){a.html5.skinloader=function(f,n,i){var m={};var c=n;var j=i;var e=true;var h;var l=f;var q=false;function k(){if(l===undefined||l===""){d(a.html5.defaultSkin().xml)}else{a.utils.ajax(a.utils.getAbsolutePath(l),function(r){try{if(r.responseXML!==null){d(r.responseXML);return}}catch(s){}d(a.html5.defaultSkin().xml)},function(r){d(a.html5.defaultSkin().xml)})}}function d(w){var C=w.getElementsByTagName("component");if(C.length===0){return}for(var F=0;F<C.length;F++){var A=C[F].getAttribute("name");var z={settings:{},elements:{},layout:{}};m[A]=z;var E=C[F].getElementsByTagName("elements")[0].getElementsByTagName("element");for(var D=0;D<E.length;D++){b(E[D],A)}var x=C[F].getElementsByTagName("settings")[0];if(x!==undefined&&x.childNodes.length>0){var I=x.getElementsByTagName("setting");for(var N=0;N<I.length;N++){var O=I[N].getAttribute("name");var G=I[N].getAttribute("value");var v=/color$/.test(O)?"color":null;m[A].settings[O]=a.utils.typechecker(G,v)}}var J=C[F].getElementsByTagName("layout")[0];if(J!==undefined&&J.childNodes.length>0){var K=J.getElementsByTagName("group");for(var u=0;u<K.length;u++){var y=K[u];m[A].layout[y.getAttribute("position")]={elements:[]};for(var M=0;M<y.attributes.length;M++){var B=y.attributes[M];m[A].layout[y.getAttribute("position")][B.name]=B.value}var L=y.getElementsByTagName("*");for(var t=0;t<L.length;t++){var r=L[t];m[A].layout[y.getAttribute("position")].elements.push({type:r.tagName});for(var s=0;s<r.attributes.length;s++){var H=r.attributes[s];m[A].layout[y.getAttribute("position")].elements[t][H.name]=H.value}if(m[A].layout[y.getAttribute("position")].elements[t].name===undefined){m[A].layout[y.getAttribute("position")].elements[t].name=r.tagName}}}}e=false;p()}}function p(){clearInterval(h);if(!q){h=setInterval(function(){o()},100)}}function b(w,v){var u=new Image();var r=w.getAttribute("name");var t=w.getAttribute("src");var y;if(t.indexOf("data:image/png;base64,")===0){y=t}else{var s=a.utils.getAbsolutePath(l);var x=s.substr(0,s.lastIndexOf("/"));y=[x,v,t].join("/")}m[v].elements[r]={height:0,width:0,src:"",ready:false};u.onload=function(z){g(u,r,v)};u.onerror=function(z){q=true;p();j()};u.src=y}function o(){for(var r in m){if(r!="properties"){for(var s in m[r].elements){if(!m[r].elements[s].ready){return}}}}if(e===false){clearInterval(h);c(m)}}function g(r,t,s){m[s].elements[t].height=r.height;m[s].elements[t].width=r.width;m[s].elements[t].src=r.src;m[s].elements[t].ready=true;p()}k()}})(jwplayer);(function(a){a.html5.api=function(b,k){var j={};if(!a.utils.html5SupportsConfig()){return j}var e=document.createElement("div");b.parentNode.replaceChild(e,b);e.id=b.id;j.version=a.version;j.id=e.id;var i=new a.html5.model(j,e,k);var g=new a.html5.view(j,e,i);var h=new a.html5.controller(j,e,i,g);j.skin=new a.html5.skin();j.jwPlay=function(l){if(typeof l=="undefined"){d()}else{if(l.toString().toLowerCase()=="true"){h.play()}else{h.pause()}}};j.jwPause=function(l){if(typeof l=="undefined"){d()}else{if(l.toString().toLowerCase()=="true"){h.pause()}else{h.play()}}};function d(){if(i.state==a.api.events.state.PLAYING||i.state==a.api.events.state.BUFFERING){h.pause()}else{h.play()}}j.jwStop=h.stop;j.jwSeek=h.seek;j.jwPlaylistItem=h.item;j.jwPlaylistNext=h.next;j.jwPlaylistPrev=h.prev;j.jwResize=h.resize;j.jwLoad=h.load;function f(l){return function(){return i[l]}}j.jwGetItem=f("item");j.jwGetPosition=f("position");j.jwGetDuration=f("duration");j.jwGetBuffer=f("buffer");j.jwGetWidth=f("width");j.jwGetHeight=f("height");j.jwGetFullscreen=f("fullscreen");j.jwSetFullscreen=h.setFullscreen;j.jwGetVolume=f("volume");j.jwSetVolume=h.setVolume;j.jwGetMute=f("mute");j.jwSetMute=h.setMute;j.jwGetStretching=f("stretching");j.jwGetState=f("state");j.jwGetVersion=function(){return j.version};j.jwGetPlaylist=function(){return i.playlist};j.jwAddEventListener=h.addEventListener;j.jwRemoveEventListener=h.removeEventListener;j.jwSendEvent=h.sendEvent;j.jwGetLevel=function(){};j.jwGetBandwidth=function(){};j.jwGetLockState=function(){};j.jwLock=function(){};j.jwUnlock=function(){};function c(n,m,l){return function(){n.loadPlaylist(n.config,true);n.setupPlugins();m.setup(n.getMedia().getDisplayElement());var o={id:j.id,version:j.version};l.sendEvent(a.api.events.JWPLAYER_READY,o);if(playerReady!==undefined){playerReady(o)}if(window[n.config.playerReady]!==undefined){window[n.config.playerReady](o)}n.sendEvent(a.api.events.JWPLAYER_PLAYLIST_LOADED,{playlist:n.playlist});l.item(n.item);if(n.config.autostart===true&&!n.config.chromeless){l.play()}}}if(i.config.chromeless){setTimeout(c(i,g,h),25)}else{j.skin.load(i.config.skin,c(i,g,h))}return j}})(jwplayer);
|
languages/shortcodes-ultimate-ru_RU.mo
CHANGED
Binary file
|
languages/shortcodes-ultimate-ru_RU.po
CHANGED
@@ -2,8 +2,8 @@ msgid ""
|
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: gn_themes\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
-
"POT-Creation-Date: 2011-04-
|
6 |
-
"PO-Revision-Date: 2011-04-
|
7 |
"Last-Translator: Vladimir Anokhin <ano.vladimir@gmail.com>\n"
|
8 |
"Language-Team: \n"
|
9 |
"MIME-Version: 1.0\n"
|
@@ -15,7 +15,7 @@ msgstr ""
|
|
15 |
"X-Poedit-SearchPath-0: .\n"
|
16 |
|
17 |
#: shortcodes-ultimate.php:88
|
18 |
-
#: shortcodes-ultimate.php:
|
19 |
msgid "Spoiler title"
|
20 |
msgstr "Скрытый текст"
|
21 |
|
@@ -23,144 +23,157 @@ msgstr "Скрытый текст"
|
|
23 |
msgid "Top"
|
24 |
msgstr "Вверх"
|
25 |
|
26 |
-
#: shortcodes-ultimate.php:
|
|
|
|
|
|
|
|
|
|
|
27 |
msgid "This is box title"
|
28 |
msgstr "Заголовок блока"
|
29 |
|
30 |
-
#: shortcodes-ultimate.php:
|
31 |
msgid "Shortcodes"
|
32 |
msgstr "Шорткоды"
|
33 |
|
34 |
-
#: shortcodes-ultimate.php:
|
35 |
msgid "Want to support author? Just share this link!"
|
36 |
msgstr "Хотите поддержать автора? Просто опубликйте ссылку!"
|
37 |
|
38 |
-
#: shortcodes-ultimate.php:
|
39 |
-
#: shortcodes-ultimate.php:
|
40 |
msgid "Share on Facebook"
|
41 |
msgstr "Опубликовать на Facebook"
|
42 |
|
43 |
-
#: shortcodes-ultimate.php:
|
44 |
-
#: shortcodes-ultimate.php:
|
45 |
msgid "Share on Twitter"
|
46 |
msgstr "Опубликовать на Twitter"
|
47 |
|
48 |
-
#: shortcodes-ultimate.php:
|
49 |
msgid "Support forum"
|
50 |
msgstr "Форум поддержки"
|
51 |
|
52 |
-
#: shortcodes-ultimate.php:
|
53 |
msgid "Twitter"
|
54 |
msgstr "Твиттер разработчика"
|
55 |
|
56 |
-
#: shortcodes-ultimate.php:
|
57 |
msgid "Bug report"
|
58 |
msgstr "Сообщить об ошибке"
|
59 |
|
60 |
-
#: shortcodes-ultimate.php:
|
61 |
msgid "Settings saved"
|
62 |
msgstr "Настройки сохранены"
|
63 |
|
64 |
-
#: shortcodes-ultimate.php:
|
65 |
msgid "Shortcodes ultimate settings"
|
66 |
msgstr "Настройки Shortcodes Ultimate"
|
67 |
|
68 |
-
#: shortcodes-ultimate.php:
|
69 |
msgid "Disable custom formatting"
|
70 |
msgstr "Отключить специальное форматирование"
|
71 |
|
72 |
-
#: shortcodes-ultimate.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
msgid "Save settings"
|
74 |
msgstr "Сохранить настройки"
|
75 |
|
76 |
-
#: shortcodes-ultimate.php:
|
77 |
msgid "Available shortcodes"
|
78 |
msgstr "Доступные шорткоды"
|
79 |
|
80 |
-
#: shortcodes-ultimate.php:
|
81 |
msgid "Shortcode"
|
82 |
msgstr "Шорткоды"
|
83 |
|
84 |
-
#: shortcodes-ultimate.php:
|
85 |
msgid "Parameters"
|
86 |
msgstr "Параметры"
|
87 |
|
88 |
-
#: shortcodes-ultimate.php:
|
89 |
msgid "Usage"
|
90 |
msgstr "Пример использования"
|
91 |
|
92 |
-
#: shortcodes-ultimate.php:
|
93 |
-
#: shortcodes-ultimate.php:
|
94 |
-
#: shortcodes-ultimate.php:
|
95 |
-
#: shortcodes-ultimate.php:
|
96 |
-
#: shortcodes-ultimate.php:
|
97 |
-
#: shortcodes-ultimate.php:
|
98 |
-
#: shortcodes-ultimate.php:
|
99 |
msgid "Content"
|
100 |
msgstr "Содержимое"
|
101 |
|
102 |
-
#: shortcodes-ultimate.php:
|
103 |
msgid "Tab name"
|
104 |
msgstr "Имя вкладки"
|
105 |
|
106 |
-
#: shortcodes-ultimate.php:
|
107 |
msgid "Tab content"
|
108 |
msgstr "Содержимое вкладки"
|
109 |
|
110 |
-
#: shortcodes-ultimate.php:
|
111 |
msgid "Hidden text"
|
112 |
msgstr "Скрытый текст"
|
113 |
|
114 |
-
#: shortcodes-ultimate.php:
|
115 |
-
#: shortcodes-ultimate.php:
|
116 |
msgid "optional"
|
117 |
msgstr "необяз."
|
118 |
|
119 |
-
#: shortcodes-ultimate.php:
|
120 |
msgid "Button text"
|
121 |
msgstr "Текст кнопки"
|
122 |
|
123 |
-
#: shortcodes-ultimate.php:
|
124 |
msgid "Read more"
|
125 |
msgstr "Подробнее"
|
126 |
|
127 |
-
#: shortcodes-ultimate.php:
|
128 |
msgid "image url"
|
129 |
msgstr "ссылка на изображение"
|
130 |
|
131 |
-
#: shortcodes-ultimate.php:
|
132 |
msgid "icon size"
|
133 |
msgstr "размер иконки"
|
134 |
|
135 |
-
#: shortcodes-ultimate.php:
|
136 |
-
msgid "Service name"
|
137 |
-
msgstr "Название услуги"
|
138 |
-
|
139 |
-
#: shortcodes-ultimate.php:644
|
140 |
msgid "Service description"
|
141 |
msgstr "Описание услуги"
|
142 |
|
143 |
-
#: shortcodes-ultimate.php:
|
144 |
msgid "Box title"
|
145 |
msgstr "Заголовок блока"
|
146 |
|
147 |
-
#: shortcodes-ultimate.php:
|
148 |
msgid "List item"
|
149 |
msgstr "Элемент списка"
|
150 |
|
151 |
-
#: shortcodes-ultimate.php:
|
152 |
msgid "add this to last columns"
|
153 |
msgstr "добавьте к каждой последней колонке"
|
154 |
|
155 |
-
#: shortcodes-ultimate.php:
|
156 |
msgid "Shortcodes Ultimate"
|
157 |
msgstr "Шорткоды"
|
158 |
|
159 |
-
#: shortcodes-ultimate.php:
|
160 |
msgid "Vladimir Anokhin"
|
161 |
msgstr "Владимир Анохин"
|
162 |
|
163 |
-
#: shortcodes-ultimate.php:
|
164 |
msgid "Provides support for many easy to use shortcodes"
|
165 |
msgstr "Предоставляет поддержку множества полезных шорткодов"
|
166 |
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: gn_themes\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2011-04-24 16:49+0300\n"
|
6 |
+
"PO-Revision-Date: 2011-04-24 16:51+0300\n"
|
7 |
"Last-Translator: Vladimir Anokhin <ano.vladimir@gmail.com>\n"
|
8 |
"Language-Team: \n"
|
9 |
"MIME-Version: 1.0\n"
|
15 |
"X-Poedit-SearchPath-0: .\n"
|
16 |
|
17 |
#: shortcodes-ultimate.php:88
|
18 |
+
#: shortcodes-ultimate.php:659
|
19 |
msgid "Spoiler title"
|
20 |
msgstr "Скрытый текст"
|
21 |
|
23 |
msgid "Top"
|
24 |
msgstr "Вверх"
|
25 |
|
26 |
+
#: shortcodes-ultimate.php:302
|
27 |
+
#: shortcodes-ultimate.php:699
|
28 |
+
msgid "Service name"
|
29 |
+
msgstr "Название услуги"
|
30 |
+
|
31 |
+
#: shortcodes-ultimate.php:320
|
32 |
msgid "This is box title"
|
33 |
msgstr "Заголовок блока"
|
34 |
|
35 |
+
#: shortcodes-ultimate.php:555
|
36 |
msgid "Shortcodes"
|
37 |
msgstr "Шорткоды"
|
38 |
|
39 |
+
#: shortcodes-ultimate.php:578
|
40 |
msgid "Want to support author? Just share this link!"
|
41 |
msgstr "Хотите поддержать автора? Просто опубликйте ссылку!"
|
42 |
|
43 |
+
#: shortcodes-ultimate.php:581
|
44 |
+
#: shortcodes-ultimate.php:582
|
45 |
msgid "Share on Facebook"
|
46 |
msgstr "Опубликовать на Facebook"
|
47 |
|
48 |
+
#: shortcodes-ultimate.php:584
|
49 |
+
#: shortcodes-ultimate.php:585
|
50 |
msgid "Share on Twitter"
|
51 |
msgstr "Опубликовать на Twitter"
|
52 |
|
53 |
+
#: shortcodes-ultimate.php:589
|
54 |
msgid "Support forum"
|
55 |
msgstr "Форум поддержки"
|
56 |
|
57 |
+
#: shortcodes-ultimate.php:590
|
58 |
msgid "Twitter"
|
59 |
msgstr "Твиттер разработчика"
|
60 |
|
61 |
+
#: shortcodes-ultimate.php:591
|
62 |
msgid "Bug report"
|
63 |
msgstr "Сообщить об ошибке"
|
64 |
|
65 |
+
#: shortcodes-ultimate.php:599
|
66 |
msgid "Settings saved"
|
67 |
msgstr "Настройки сохранены"
|
68 |
|
69 |
+
#: shortcodes-ultimate.php:607
|
70 |
msgid "Shortcodes ultimate settings"
|
71 |
msgstr "Настройки Shortcodes Ultimate"
|
72 |
|
73 |
+
#: shortcodes-ultimate.php:612
|
74 |
msgid "Disable custom formatting"
|
75 |
msgstr "Отключить специальное форматирование"
|
76 |
|
77 |
+
#: shortcodes-ultimate.php:615
|
78 |
+
msgid "Enable this option if you have some problems with other plugins or content formatting"
|
79 |
+
msgstr "Отметьте этот флажок, если у вас возникли пролемы совместимости с другими плагинами или форматированием контента"
|
80 |
+
|
81 |
+
#: shortcodes-ultimate.php:620
|
82 |
+
msgid "Compatibility mode"
|
83 |
+
msgstr "Режим совместимости"
|
84 |
+
|
85 |
+
#: shortcodes-ultimate.php:623
|
86 |
+
msgid "Enable this option if you have some problems with other plugins that uses similar shortcode names"
|
87 |
+
msgstr "Отметьте этот флажок, если у вас используются другие шорткоды с такими же именами. Все шорткоды этого плагина будут иметь такие имена"
|
88 |
+
|
89 |
+
#: shortcodes-ultimate.php:628
|
90 |
msgid "Save settings"
|
91 |
msgstr "Сохранить настройки"
|
92 |
|
93 |
+
#: shortcodes-ultimate.php:634
|
94 |
msgid "Available shortcodes"
|
95 |
msgstr "Доступные шорткоды"
|
96 |
|
97 |
+
#: shortcodes-ultimate.php:637
|
98 |
msgid "Shortcode"
|
99 |
msgstr "Шорткоды"
|
100 |
|
101 |
+
#: shortcodes-ultimate.php:638
|
102 |
msgid "Parameters"
|
103 |
msgstr "Параметры"
|
104 |
|
105 |
+
#: shortcodes-ultimate.php:639
|
106 |
msgid "Usage"
|
107 |
msgstr "Пример использования"
|
108 |
|
109 |
+
#: shortcodes-ultimate.php:644
|
110 |
+
#: shortcodes-ultimate.php:674
|
111 |
+
#: shortcodes-ultimate.php:679
|
112 |
+
#: shortcodes-ultimate.php:684
|
113 |
+
#: shortcodes-ultimate.php:704
|
114 |
+
#: shortcodes-ultimate.php:709
|
115 |
+
#: shortcodes-ultimate.php:719
|
116 |
msgid "Content"
|
117 |
msgstr "Содержимое"
|
118 |
|
119 |
+
#: shortcodes-ultimate.php:654
|
120 |
msgid "Tab name"
|
121 |
msgstr "Имя вкладки"
|
122 |
|
123 |
+
#: shortcodes-ultimate.php:654
|
124 |
msgid "Tab content"
|
125 |
msgstr "Содержимое вкладки"
|
126 |
|
127 |
+
#: shortcodes-ultimate.php:659
|
128 |
msgid "Hidden text"
|
129 |
msgstr "Скрытый текст"
|
130 |
|
131 |
+
#: shortcodes-ultimate.php:663
|
132 |
+
#: shortcodes-ultimate.php:688
|
133 |
msgid "optional"
|
134 |
msgstr "необяз."
|
135 |
|
136 |
+
#: shortcodes-ultimate.php:689
|
137 |
msgid "Button text"
|
138 |
msgstr "Текст кнопки"
|
139 |
|
140 |
+
#: shortcodes-ultimate.php:694
|
141 |
msgid "Read more"
|
142 |
msgstr "Подробнее"
|
143 |
|
144 |
+
#: shortcodes-ultimate.php:698
|
145 |
msgid "image url"
|
146 |
msgstr "ссылка на изображение"
|
147 |
|
148 |
+
#: shortcodes-ultimate.php:698
|
149 |
msgid "icon size"
|
150 |
msgstr "размер иконки"
|
151 |
|
152 |
+
#: shortcodes-ultimate.php:699
|
|
|
|
|
|
|
|
|
153 |
msgid "Service description"
|
154 |
msgstr "Описание услуги"
|
155 |
|
156 |
+
#: shortcodes-ultimate.php:704
|
157 |
msgid "Box title"
|
158 |
msgstr "Заголовок блока"
|
159 |
|
160 |
+
#: shortcodes-ultimate.php:714
|
161 |
msgid "List item"
|
162 |
msgstr "Элемент списка"
|
163 |
|
164 |
+
#: shortcodes-ultimate.php:718
|
165 |
msgid "add this to last columns"
|
166 |
msgstr "добавьте к каждой последней колонке"
|
167 |
|
168 |
+
#: shortcodes-ultimate.php:731
|
169 |
msgid "Shortcodes Ultimate"
|
170 |
msgstr "Шорткоды"
|
171 |
|
172 |
+
#: shortcodes-ultimate.php:731
|
173 |
msgid "Vladimir Anokhin"
|
174 |
msgstr "Владимир Анохин"
|
175 |
|
176 |
+
#: shortcodes-ultimate.php:731
|
177 |
msgid "Provides support for many easy to use shortcodes"
|
178 |
msgstr "Предоставляет поддержку множества полезных шорткодов"
|
179 |
|
lib/admin.php
ADDED
@@ -0,0 +1,190 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Register administration page
|
5 |
+
*/
|
6 |
+
function shortcodes_ultimate_add_admin() {
|
7 |
+
add_options_page( __( 'Shortcodes', 'shortcodes-ultimate' ), __( 'Shortcodes', 'shortcodes-ultimate' ), 'manage_options', 'shortcodes-ultimate', 'shortcodes_ultimate_admin_page' );
|
8 |
+
}
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Administration page
|
12 |
+
*/
|
13 |
+
function shortcodes_ultimate_admin_page() {
|
14 |
+
?>
|
15 |
+
|
16 |
+
<style type="text/css">
|
17 |
+
#su-top-message {
|
18 |
+
margin: 20px 20px 10px 0;
|
19 |
+
padding: 5px 15px;
|
20 |
+
border: 1px solid #E6DB55;
|
21 |
+
background: #FFFFE0;
|
22 |
+
border-radius: 3px;
|
23 |
+
}
|
24 |
+
.su-new-shortcode td {
|
25 |
+
background: #ffd;
|
26 |
+
}
|
27 |
+
</style>
|
28 |
+
|
29 |
+
<div id="su-top-message">
|
30 |
+
<p><strong><?php _e( 'Want to support author? Just share this link!', 'shortcodes-ultimate' ); ?></strong></p>
|
31 |
+
<p>
|
32 |
+
<input type="text" value="http://ilovecode.ru/?p=122" size="27" onclick="this.select();" />
|
33 |
+
<a href="http://facebook.com/sharer.php?u=http://ilovecode.ru/?p=122" title="<?php _e( 'Share on Facebook', 'shortcodes-ultimate' ); ?>" target="_blank">
|
34 |
+
<img src="<?php echo su_plugin_url(); ?>/images/social/facebook_16.png" title="<?php _e( 'Share on Facebook', 'shortcodes-ultimate' ); ?>" style="margin-bottom:-3px" />
|
35 |
+
</a>
|
36 |
+
<a href="http://twitter.com/home?status=Shortcodes%20Ultimate%20http://ilovecode.ru/?p=122" title="<?php _e( 'Share on Twitter', 'shortcodes-ultimate' ); ?>" target="_blank">
|
37 |
+
<img src="<?php echo su_plugin_url(); ?>/images/social/twitter_16.png" title="<?php _e( 'Share on Twitter', 'shortcodes-ultimate' ); ?>" style="margin-bottom:-3px" />
|
38 |
+
</a>
|
39 |
+
</p>
|
40 |
+
<p>
|
41 |
+
<a href="http://wordpress.org/tags/shortcodes-ultimate?forum_id=10" target="_blank"><?php _e( 'Support forum', 'shortcodes-ultimate' ); ?></a> |
|
42 |
+
<a href="http://twitter.com/gn_themes" target="_blank"><?php _e( 'Twitter', 'shortcodes-ultimate' ); ?></a> |
|
43 |
+
<a href="http://ilovecode.ru/?p=122#commentform" target="_blank" style="color:red"><?php _e( 'Bug report', 'shortcodes-ultimate' ); ?></a>
|
44 |
+
</p>
|
45 |
+
</div>
|
46 |
+
|
47 |
+
<?php
|
48 |
+
if ( $_POST['save'] ) {
|
49 |
+
update_option( 'su_disable_custom_formatting', $_POST['su_disable_custom_formatting'] );
|
50 |
+
update_option( 'su_compatibility_mode', $_POST['su_compatibility_mode'] );
|
51 |
+
echo '<div class="updated"><p><strong>' . __( 'Settings saved', 'shortcodes-ultimate' ) . '</strong></p></div>';
|
52 |
+
}
|
53 |
+
|
54 |
+
$checked_formatting = ( get_option( 'su_disable_custom_formatting' ) == 'on' ) ? ' checked="checked"' : '';
|
55 |
+
$checked_compatibility = ( get_option( 'su_compatibility_mode' ) == 'on' ) ? ' checked="checked"' : '';
|
56 |
+
?>
|
57 |
+
<!-- .wrap -->
|
58 |
+
<div class="wrap">
|
59 |
+
<h2><?php _e( 'Shortcodes ultimate settings', 'shortcodes-ultimate' ); ?></h2>
|
60 |
+
<form action="" method="post">
|
61 |
+
<table class="widefat fixed" style="width:700px;margin-bottom:20px">
|
62 |
+
<tr>
|
63 |
+
<td>
|
64 |
+
<p><label><input type="checkbox" name="su_disable_custom_formatting" <?php echo $checked_formatting; ?> /> <?php _e( 'Disable custom formatting', 'shortcodes-ultimate' ); ?></label></p>
|
65 |
+
</td>
|
66 |
+
<td>
|
67 |
+
<p><small><?php _e( 'Enable this option if you have some problems with other plugins or content formatting', 'shortcodes-ultimate' ); ?></small></p>
|
68 |
+
</td>
|
69 |
+
</tr>
|
70 |
+
<tr>
|
71 |
+
<td>
|
72 |
+
<p><label><input type="checkbox" name="su_compatibility_mode" <?php echo $checked_compatibility; ?> /> <?php _e( 'Compatibility mode', 'shortcodes-ultimate' ); ?></label></p>
|
73 |
+
</td>
|
74 |
+
<td>
|
75 |
+
<p><small><?php _e( 'Enable this option if you have some problems with other plugins that uses similar shortcode names', 'shortcodes-ultimate' ); ?><br/><code>[button] => [gn_button]</code></small></p>
|
76 |
+
</td>
|
77 |
+
</tr>
|
78 |
+
<tr>
|
79 |
+
<td colspan="2">
|
80 |
+
<p><input type="submit" value="<?php _e( 'Save settings', 'shortcodes-ultimate' ); ?>" class="button-primary" /></p>
|
81 |
+
<input type="hidden" name="save" value="true" />
|
82 |
+
</td>
|
83 |
+
</tr>
|
84 |
+
</table>
|
85 |
+
</form>
|
86 |
+
<h2><?php _e( 'Available shortcodes', 'shortcodes-ultimate' ); ?></h2>
|
87 |
+
<table class="widefat fixed" style="width:700px;margin-bottom:20px">
|
88 |
+
<tr>
|
89 |
+
<th width="100"><?php _e( 'Shortcode', 'shortcodes-ultimate' ); ?></th>
|
90 |
+
<th width="200"><?php _e( 'Parameters', 'shortcodes-ultimate' ); ?></th>
|
91 |
+
<th><?php _e( 'Usage', 'shortcodes-ultimate' ); ?></th>
|
92 |
+
</tr>
|
93 |
+
<tr>
|
94 |
+
<td>heading</td>
|
95 |
+
<td>—</td>
|
96 |
+
<td>[heading] <?php _e( 'Content', 'shortcodes-ultimate' ); ?> [/heading]</td>
|
97 |
+
</tr>
|
98 |
+
<tr>
|
99 |
+
<td>frame</td>
|
100 |
+
<td>align="left|center|none|right"</td>
|
101 |
+
<td>[frame align="center"] <img src="image.jpg" alt="" /> [/frame]</td>
|
102 |
+
</tr>
|
103 |
+
<tr>
|
104 |
+
<td>tabs, tab</td>
|
105 |
+
<td>title</td>
|
106 |
+
<td>[tabs] [tab title="<?php _e( 'Tab name', 'shortcodes-ultimate' ); ?>"] <?php _e( 'Tab content', 'shortcodes-ultimate' ); ?> [/tab] [/tabs]</td>
|
107 |
+
</tr>
|
108 |
+
<tr>
|
109 |
+
<td>spoiler</td>
|
110 |
+
<td>title</td>
|
111 |
+
<td>[spoiler title="<?php _e( 'Spoiler title', 'shortcodes-ultimate' ); ?>"] <?php _e( 'Hidden text', 'shortcodes-ultimate' ); ?> [/spoiler]</td>
|
112 |
+
</tr>
|
113 |
+
<tr>
|
114 |
+
<td>divider</td>
|
115 |
+
<td>top (<?php _e( 'optional', 'shortcodes-ultimate' ); ?>)</td>
|
116 |
+
<td>[divider top="1"]</td>
|
117 |
+
</tr>
|
118 |
+
<tr>
|
119 |
+
<td>spacer</td>
|
120 |
+
<td>size</td>
|
121 |
+
<td>[spacer size="20"]</td>
|
122 |
+
</tr>
|
123 |
+
<tr>
|
124 |
+
<td>quote</td>
|
125 |
+
<td>—</td>
|
126 |
+
<td>[quote] <?php _e( 'Content', 'shortcodes-ultimate' ); ?> [/quote]</td>
|
127 |
+
</tr>
|
128 |
+
<tr>
|
129 |
+
<td>pullquote</td>
|
130 |
+
<td>align="left|right"</td>
|
131 |
+
<td>[pullquote align="left"] <?php _e( 'Content', 'shortcodes-ultimate' ); ?> [/pullquote]</td>
|
132 |
+
</tr>
|
133 |
+
<tr>
|
134 |
+
<td>highlight</td>
|
135 |
+
<td>bg="#HEX"<br/>color="#HEX"</td>
|
136 |
+
<td>[highlight bg="#fc0" color="#000"] <?php _e( 'Content', 'shortcodes-ultimate' ); ?> [/highlight]</td>
|
137 |
+
</tr>
|
138 |
+
<tr class="su-new-shortcode">
|
139 |
+
<td>button</td>
|
140 |
+
<td>link<br/>color="#HEX"<br/>size="1-12"<br/>style="1|2|3|4"<br/>dark (<?php _e( 'optional', 'shortcodes-ultimate' ); ?>)<br/>square (<?php _e( 'optional', 'shortcodes-ultimate' ); ?>)<br/>icon (<?php _e( 'optional', 'shortcodes-ultimate' ); ?>)</td>
|
141 |
+
<td>[button link="#" color="#b00" size="3" style="3" dark="1" square="1" icon="image.png"] <?php _e( 'Button text', 'shortcodes-ultimate' ); ?> [/button]</td>
|
142 |
+
</tr>
|
143 |
+
<tr>
|
144 |
+
<td>fancy_link</td>
|
145 |
+
<td>color="black|white"<br/>link</td>
|
146 |
+
<td>[fancy_link color="black" link="http://example.com/"] <?php _e( 'Read more', 'shortcodes-ultimate' ); ?> [/fancy_link]</td>
|
147 |
+
</tr>
|
148 |
+
<tr>
|
149 |
+
<td>service</td>
|
150 |
+
<td>title<br/>icon (<?php _e( 'image url', 'shortcodes-ultimate' ); ?>)<br/>size (<?php _e( 'icon size', 'shortcodes-ultimate' ); ?>)</td>
|
151 |
+
<td>[service title="<?php _e( 'Service name', 'shortcodes-ultimate' ); ?>" icon="images/service-1.png" size="32"] <?php _e( 'Service description', 'shortcodes-ultimate' ); ?> [/service]</td>
|
152 |
+
</tr>
|
153 |
+
<tr>
|
154 |
+
<td>box</td>
|
155 |
+
<td>title<br/>color="#HEX"</td>
|
156 |
+
<td>[box title="<?php _e( 'Box title', 'shortcodes-ultimate' ); ?>" color="#f00"] <?php _e( 'Content', 'shortcodes-ultimate' ); ?> [/box]</td>
|
157 |
+
</tr>
|
158 |
+
<tr>
|
159 |
+
<td>note</td>
|
160 |
+
<td>color="#HEX"</td>
|
161 |
+
<td>[note color="#D1F26D"] <?php _e( 'Content', 'shortcodes-ultimate' ); ?> [/note]</td>
|
162 |
+
</tr>
|
163 |
+
<tr class="su-new-shortcode">
|
164 |
+
<td>list</td>
|
165 |
+
<td>style="star|arrow|check|cross|thumbs|link|gear|time|note|plus|guard|event|idea|settings|twitter"</td>
|
166 |
+
<td>[list style="check"] <ul> <li> <?php _e( 'List item', 'shortcodes-ultimate' ); ?> </li> </ul> [/list]</td>
|
167 |
+
</tr>
|
168 |
+
<tr>
|
169 |
+
<td>column</td>
|
170 |
+
<td>size="1-2|1-3|1-4|1-5|1-6|2-3|3-4|2-5|3-5|4-5|5-6"<br/>last (<?php _e( 'add this to last columns', 'shortcodes-ultimate' ); ?>)</td>
|
171 |
+
<td>[column size="1-2"] <?php _e( 'Content', 'shortcodes-ultimate' ); ?> [/column]<br/>[column size="1-2" last="1"] <?php _e( 'Content', 'shortcodes-ultimate' ); ?> [/column]</td>
|
172 |
+
</tr>
|
173 |
+
<tr class="su-new-shortcode">
|
174 |
+
<td>table</td>
|
175 |
+
<td>style="1|2|3"<br/>file (<?php _e( 'optional', 'shortcodes-ultimate' ); ?>)</td>
|
176 |
+
<td><p><strong><?php _e( 'Plain table', 'shortcodes-ultimate' ); ?></strong><br/>[table style="1"] <table> … <table> [/table]</p><p><strong><?php _e( 'From CSV', 'shortcodes-ultimate' ); ?></strong><br/>[table file=http://example.com/file.csv] [/table]</p></td>
|
177 |
+
</tr>
|
178 |
+
<tr class="su-new-shortcode">
|
179 |
+
<td>media</td>
|
180 |
+
<td>url<br/>width<br/>height</td>
|
181 |
+
<td>[media url="http://www.youtube.com/watch?v=2c2EEacfC1M"]<br/>[media url="http://vimeo.com/15069551"]<br/>[media url="video.mp4"]<br/>[media url="video.flv"]<br/>[media url="audio.mp3"]<br/>[media url="image.jpg"]</td>
|
182 |
+
</tr>
|
183 |
+
</table>
|
184 |
+
</div>
|
185 |
+
<!-- /.wrap -->
|
186 |
+
<?php
|
187 |
+
}
|
188 |
+
|
189 |
+
add_action( 'admin_menu', 'shortcodes_ultimate_add_admin' );
|
190 |
+
?>
|
lib/color.php
ADDED
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Color shift a hex value by a specific percentage factor
|
5 |
+
*
|
6 |
+
* @param string $supplied_hex Any valid hex value. Short forms e.g. #333 accepted.
|
7 |
+
* @param string $shift_method How to shift the value e.g( +,up,lighter,>)
|
8 |
+
* @param integer $percentage Percentage in range of [0-100] to shift provided hex value by
|
9 |
+
* @return string shifted hex value
|
10 |
+
* @version 1.0 2008-03-28
|
11 |
+
*/
|
12 |
+
function su_hex_shift( $supplied_hex, $shift_method, $percentage = 50 ) {
|
13 |
+
$shifted_hex_value = null;
|
14 |
+
$valid_shift_option = FALSE;
|
15 |
+
$current_set = 1;
|
16 |
+
$RGB_values = array( );
|
17 |
+
$valid_shift_up_args = array( 'up', '+', 'lighter', '>' );
|
18 |
+
$valid_shift_down_args = array( 'down', '-', 'darker', '<' );
|
19 |
+
$shift_method = strtolower( trim( $shift_method ) );
|
20 |
+
|
21 |
+
// Check Factor
|
22 |
+
if ( !is_numeric( $percentage ) || ($percentage = ( int ) $percentage) < 0 || $percentage > 100 ) {
|
23 |
+
trigger_error( "Invalid factor", E_USER_ERROR );
|
24 |
+
}
|
25 |
+
|
26 |
+
// Check shift method
|
27 |
+
foreach ( array( $valid_shift_down_args, $valid_shift_up_args ) as $options ) {
|
28 |
+
foreach ( $options as $method ) {
|
29 |
+
if ( $method == $shift_method ) {
|
30 |
+
$valid_shift_option = !$valid_shift_option;
|
31 |
+
$shift_method = ( $current_set === 1 ) ? '+' : '-';
|
32 |
+
break 2;
|
33 |
+
}
|
34 |
+
}
|
35 |
+
++$current_set;
|
36 |
+
}
|
37 |
+
|
38 |
+
if ( !$valid_shift_option ) {
|
39 |
+
trigger_error( "Invalid shift method", E_USER_ERROR );
|
40 |
+
}
|
41 |
+
|
42 |
+
// Check Hex string
|
43 |
+
switch ( strlen( $supplied_hex = ( str_replace( '#', '', trim( $supplied_hex ) ) ) ) ) {
|
44 |
+
case 3:
|
45 |
+
if ( preg_match( '/^([0-9a-f])([0-9a-f])([0-9a-f])/i', $supplied_hex ) ) {
|
46 |
+
$supplied_hex = preg_replace( '/^([0-9a-f])([0-9a-f])([0-9a-f])/i', '\\1\\1\\2\\2\\3\\3', $supplied_hex );
|
47 |
+
} else {
|
48 |
+
trigger_error( "Invalid hex value", E_USER_ERROR );
|
49 |
+
}
|
50 |
+
break;
|
51 |
+
case 6:
|
52 |
+
if ( !preg_match( '/^[0-9a-f]{2}[0-9a-f]{2}[0-9a-f]{2}$/i', $supplied_hex ) ) {
|
53 |
+
trigger_error( "Invalid hex value", E_USER_ERROR );
|
54 |
+
}
|
55 |
+
break;
|
56 |
+
default:
|
57 |
+
trigger_error( "Invalid hex length", E_USER_ERROR );
|
58 |
+
}
|
59 |
+
|
60 |
+
// Start shifting
|
61 |
+
$RGB_values['R'] = hexdec( $supplied_hex{0} . $supplied_hex{1} );
|
62 |
+
$RGB_values['G'] = hexdec( $supplied_hex{2} . $supplied_hex{3} );
|
63 |
+
$RGB_values['B'] = hexdec( $supplied_hex{4} . $supplied_hex{5} );
|
64 |
+
|
65 |
+
foreach ( $RGB_values as $c => $v ) {
|
66 |
+
switch ( $shift_method ) {
|
67 |
+
case '-':
|
68 |
+
$amount = round( ((255 - $v) / 100) * $percentage ) + $v;
|
69 |
+
break;
|
70 |
+
case '+':
|
71 |
+
$amount = $v - round( ($v / 100) * $percentage );
|
72 |
+
break;
|
73 |
+
default:
|
74 |
+
trigger_error( "Oops. Unexpected shift method", E_USER_ERROR );
|
75 |
+
}
|
76 |
+
|
77 |
+
$shifted_hex_value .= $current_value = (
|
78 |
+
strlen( $decimal_to_hex = dechex( $amount ) ) < 2
|
79 |
+
) ? '0' . $decimal_to_hex : $decimal_to_hex;
|
80 |
+
}
|
81 |
+
|
82 |
+
return '#' . $shifted_hex_value;
|
83 |
+
}
|
84 |
+
|
85 |
+
?>
|
lib/csv.php
ADDED
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Csv files parser
|
5 |
+
* Converts csv-files to html-tables
|
6 |
+
*
|
7 |
+
* @param type $file File url to parse
|
8 |
+
*/
|
9 |
+
function su_parse_csv( $file ) {
|
10 |
+
$csv_lines = file( $file );
|
11 |
+
if ( is_array( $csv_lines ) ) {
|
12 |
+
//разбор csv
|
13 |
+
$cnt = count( $csv_lines );
|
14 |
+
for ( $i = 0; $i < $cnt; $i++ ) {
|
15 |
+
$line = $csv_lines[$i];
|
16 |
+
$line = trim( $line );
|
17 |
+
//указатель на то, что через цикл проходит первый символ столбца
|
18 |
+
$first_char = true;
|
19 |
+
//номер столбца
|
20 |
+
$col_num = 0;
|
21 |
+
$length = strlen( $line );
|
22 |
+
for ( $b = 0; $b < $length; $b++ ) {
|
23 |
+
//переменная $skip_char определяет обрабатывать ли данный символ
|
24 |
+
if ( $skip_char != true ) {
|
25 |
+
//определяет обрабатывать/не обрабатывать строку
|
26 |
+
///print $line[$b];
|
27 |
+
$process = true;
|
28 |
+
//определяем маркер окончания столбца по первому символу
|
29 |
+
if ( $first_char == true ) {
|
30 |
+
if ( $line[$b] == '"' ) {
|
31 |
+
$terminator = '";';
|
32 |
+
$process = false;
|
33 |
+
}
|
34 |
+
else
|
35 |
+
$terminator = ';';
|
36 |
+
$first_char = false;
|
37 |
+
}
|
38 |
+
|
39 |
+
//просматриваем парные кавычки, опредляем их природу
|
40 |
+
if ( $line[$b] == '"' ) {
|
41 |
+
$next_char = $line[$b + 1];
|
42 |
+
//удвоенные кавычки
|
43 |
+
if ( $next_char == '"' )
|
44 |
+
$skip_char = true;
|
45 |
+
//маркер конца столбца
|
46 |
+
elseif ( $next_char == ';' ) {
|
47 |
+
if ( $terminator == '";' ) {
|
48 |
+
$first_char = true;
|
49 |
+
$process = false;
|
50 |
+
$skip_char = true;
|
51 |
+
}
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
//определяем природу точки с запятой
|
56 |
+
if ( $process == true ) {
|
57 |
+
if ( $line[$b] == ';' ) {
|
58 |
+
if ( $terminator == ';' ) {
|
59 |
+
|
60 |
+
$first_char = true;
|
61 |
+
$process = false;
|
62 |
+
}
|
63 |
+
}
|
64 |
+
}
|
65 |
+
|
66 |
+
if ( $process == true )
|
67 |
+
$column .= $line[$b];
|
68 |
+
|
69 |
+
if ( $b == ($length - 1) ) {
|
70 |
+
$first_char = true;
|
71 |
+
}
|
72 |
+
|
73 |
+
if ( $first_char == true ) {
|
74 |
+
|
75 |
+
$values[$i][$col_num] = $column;
|
76 |
+
$column = '';
|
77 |
+
$col_num++;
|
78 |
+
}
|
79 |
+
}
|
80 |
+
else
|
81 |
+
$skip_char = false;
|
82 |
+
}
|
83 |
+
}
|
84 |
+
}
|
85 |
+
|
86 |
+
$return = '<table><tr>';
|
87 |
+
|
88 |
+
foreach ( $values[0] as $value ) {
|
89 |
+
$return .= '<th>' . $value . '</th>';
|
90 |
+
}
|
91 |
+
$return .= '</tr>';
|
92 |
+
|
93 |
+
array_shift( $values );
|
94 |
+
|
95 |
+
foreach ( $values as $rows ) {
|
96 |
+
|
97 |
+
$return .= '<tr>';
|
98 |
+
foreach ( $rows as $col ) {
|
99 |
+
$return .= '<td>' . $col . '</td>';
|
100 |
+
}
|
101 |
+
$return .= '</tr>';
|
102 |
+
|
103 |
+
}
|
104 |
+
|
105 |
+
$return .= '</table>';
|
106 |
+
|
107 |
+
return $return;
|
108 |
+
}
|
109 |
+
|
110 |
+
?>
|
lib/media.php
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Get media object by url
|
5 |
+
*
|
6 |
+
* @param string $media_url Media file url
|
7 |
+
* @param int $width Media object width
|
8 |
+
* @param int $height Media object height
|
9 |
+
* @return string Object markup
|
10 |
+
*/
|
11 |
+
function su_get_media( $media_url, $width, $height, $preview = false ) {
|
12 |
+
|
13 |
+
// Youtube video
|
14 |
+
$video_url = parse_url( $media_url );
|
15 |
+
|
16 |
+
if ( $video_url['host'] == 'youtube.com' || $video_url['host'] == 'www.youtube.com' ) {
|
17 |
+
parse_str( $video_url['query'], $youtube );
|
18 |
+
$id = uniqid( '', false );
|
19 |
+
$return = '
|
20 |
+
<iframe width="' . $width . '" height="' . $height . '" src="http://www.youtube.com/embed/' . $youtube['v'] . '" frameborder="0" allowfullscreen="true"></iframe>
|
21 |
+
';
|
22 |
+
}
|
23 |
+
|
24 |
+
// Vimeo video
|
25 |
+
$video_url = parse_url( $media_url );
|
26 |
+
|
27 |
+
if ( $video_url['host'] == 'vimeo.com' || $video_url['host'] == 'www.vimeo.com' ) {
|
28 |
+
$vimeo_id = mb_substr( $video_url['path'], 1 );
|
29 |
+
$return = '<iframe src="http://player.vimeo.com/video/' . $vimeo_id . '?title=0&byline=0&portrait=0&color=ffffff" width="' . $width . '" height="' . $height . '" frameborder="0"></iframe>';
|
30 |
+
}
|
31 |
+
|
32 |
+
// Images (bmp/jpg/jpeg/png/gif)
|
33 |
+
$images = array( '.bmp', '.BMP', '.jpg', '.JPG', '.png', '.PNG', 'jpeg', 'JPEG', '.gif', '.GIF' );
|
34 |
+
$image_ext = mb_substr( $media_url, -4 );
|
35 |
+
|
36 |
+
if ( in_array( $image_ext, $images ) ) {
|
37 |
+
$return = '<img src="' . su_plugin_url() . '/lib/timthumb.php?src=' . $media_url . '&w=' . $width . '&h=' . $height . '&zc=1&q=100" alt="" width="' . $width . '" height="' . $height . '" />';
|
38 |
+
}
|
39 |
+
|
40 |
+
// Video file (mp4/flv)
|
41 |
+
$videos = array( '.mp4', '.MP4', '.flv', '.FLV' );
|
42 |
+
$video_ext = mb_substr( $media_url, -4 );
|
43 |
+
|
44 |
+
if ( in_array( $video_ext, $videos ) ) {
|
45 |
+
$player_id = uniqid( '_', false );
|
46 |
+
|
47 |
+
$return = '
|
48 |
+
<div id="player' . $player_id . '"> </div>
|
49 |
+
<script type="text/javascript">
|
50 |
+
jwplayer("player' . $player_id . '").setup({
|
51 |
+
flashplayer: "' . su_plugin_url() . '/lib/player.swf",
|
52 |
+
file: "' . $media_url . '",
|
53 |
+
height: ' . $height . ',
|
54 |
+
width: ' . $width . '
|
55 |
+
});
|
56 |
+
</script>
|
57 |
+
';
|
58 |
+
}
|
59 |
+
|
60 |
+
// Audio file (mp3)
|
61 |
+
if ( mb_substr( $media_url, -4 ) == '.mp3' ) {
|
62 |
+
$player_id = uniqid( '_', false );
|
63 |
+
|
64 |
+
$return = '
|
65 |
+
<div id="player' . $player_id . '"> </div>
|
66 |
+
<script type="text/javascript">
|
67 |
+
jwplayer("player' . $player_id . '").setup({
|
68 |
+
flashplayer: "' . su_plugin_url() . '/lib/player.swf",
|
69 |
+
file: "' . $media_url . '",
|
70 |
+
height: ' . $height . ',
|
71 |
+
width: ' . $width . ',
|
72 |
+
controlbar: "bottom",
|
73 |
+
image: "' . su_plugin_url() . '/images/media-audio.jpg",
|
74 |
+
icons: "none",
|
75 |
+
screencolor: "F0F0F0"
|
76 |
+
});
|
77 |
+
</script>
|
78 |
+
';
|
79 |
+
}
|
80 |
+
|
81 |
+
return $return;
|
82 |
+
}
|
83 |
+
|
84 |
+
?>
|
lib/player.swf
ADDED
Binary file
|
lib/shortcodes.php
ADDED
@@ -0,0 +1,385 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Shortcode: heading
|
5 |
+
*
|
6 |
+
* @param array $atts Shortcode attributes
|
7 |
+
* @param string $content
|
8 |
+
* @return string Output html
|
9 |
+
*/
|
10 |
+
function su_heading_shortcode( $atts, $content = null ) {
|
11 |
+
extract( shortcode_atts( array(
|
12 |
+
'size' => 3
|
13 |
+
), $atts ) );
|
14 |
+
|
15 |
+
return '<div class="su-heading"><div class="su-heading-shell">' . $content . '</div></div>';
|
16 |
+
}
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Shortcode: frame
|
20 |
+
*
|
21 |
+
* @param array $atts Shortcode attributes
|
22 |
+
* @param string $content
|
23 |
+
* @return string Output html
|
24 |
+
*/
|
25 |
+
function su_frame_shortcode( $atts, $content = null ) {
|
26 |
+
extract( shortcode_atts( array(
|
27 |
+
'align' => 'none'
|
28 |
+
), $atts ) );
|
29 |
+
|
30 |
+
return '<div class="su-frame su-frame-align-' . $align . '"><div class="su-frame-shell">' . do_shortcode( $content ) . '</div></div>';
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Shortcode: tabs
|
35 |
+
*
|
36 |
+
* @param array $atts Shortcode attributes
|
37 |
+
* @param string $content
|
38 |
+
* @return string Output html
|
39 |
+
*/
|
40 |
+
function su_tabs( $atts, $content ) {
|
41 |
+
$GLOBALS['tab_count'] = 0;
|
42 |
+
|
43 |
+
do_shortcode( $content );
|
44 |
+
|
45 |
+
if ( is_array( $GLOBALS['tabs'] ) ) {
|
46 |
+
foreach ( $GLOBALS['tabs'] as $tab ) {
|
47 |
+
$tabs[] = '<span>' . $tab['title'] . '</span>';
|
48 |
+
$panes[] = '<div class="su-tabs-pane">' . $tab['content'] . '</div>';
|
49 |
+
}
|
50 |
+
$return = '<div class="su-tabs"><div class="su-tabs-nav">' . implode( '', $tabs ) . '</div><div class="su-tabs-panes">' . implode( "\n", $panes ) . '</div></div>';
|
51 |
+
}
|
52 |
+
return $return;
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Shortcode: tab
|
57 |
+
*
|
58 |
+
* @param array $atts Shortcode attributes
|
59 |
+
* @param string $content
|
60 |
+
* @return string Output html
|
61 |
+
*/
|
62 |
+
function su_tab( $atts, $content ) {
|
63 |
+
extract( shortcode_atts( array( 'title' => 'Tab %d' ), $atts ) );
|
64 |
+
$x = $GLOBALS['tab_count'];
|
65 |
+
$GLOBALS['tabs'][$x] = array( 'title' => sprintf( $title, $GLOBALS['tab_count'] ), 'content' => do_shortcode( $content ) );
|
66 |
+
$GLOBALS['tab_count']++;
|
67 |
+
}
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Shortcode: spoiler
|
71 |
+
*
|
72 |
+
* @param array $atts Shortcode attributes
|
73 |
+
* @param string $content
|
74 |
+
* @return string Output html
|
75 |
+
*/
|
76 |
+
function su_spoiler_shortcode( $atts, $content = null ) {
|
77 |
+
extract( shortcode_atts( array(
|
78 |
+
'title' => __( 'Spoiler title', 'shortcodes-ultimate' )
|
79 |
+
), $atts ) );
|
80 |
+
|
81 |
+
return '<div class="su-spoiler su-spoiler-open"><div class="su-spoiler-title">' . $title . '</div><div class="su-spoiler-content">' . do_shortcode( $content ) . '</div></div>';
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Shortcode: divider
|
86 |
+
*
|
87 |
+
* @param array $atts Shortcode attributes
|
88 |
+
* @param string $content
|
89 |
+
* @return string Output html
|
90 |
+
*/
|
91 |
+
function su_divider_shortcode( $atts, $content = null ) {
|
92 |
+
extract( shortcode_atts( array(
|
93 |
+
'top' => false
|
94 |
+
), $atts ) );
|
95 |
+
|
96 |
+
return ( $top ) ? '<div class="su-divider"><a href="#">' . __( 'Top', 'shortcodes-ultimate' ) . '</a></div>' : '<div class="su-divider"></div>';
|
97 |
+
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* Shortcode: spacer
|
101 |
+
*
|
102 |
+
* @param array $atts Shortcode attributes
|
103 |
+
* @param string $content
|
104 |
+
* @return string Output html
|
105 |
+
*/
|
106 |
+
function su_spacer_shortcode( $atts, $content = null ) {
|
107 |
+
extract( shortcode_atts( array(
|
108 |
+
'size' => 0
|
109 |
+
), $atts ) );
|
110 |
+
|
111 |
+
return '<div class="su-spacer" style="height:' . $size . 'px"></div>';
|
112 |
+
}
|
113 |
+
|
114 |
+
/**
|
115 |
+
* Shortcode: highlight
|
116 |
+
*
|
117 |
+
* @param array $atts Shortcode attributes
|
118 |
+
* @param string $content
|
119 |
+
* @return string Output html
|
120 |
+
*/
|
121 |
+
function su_highlight_shortcode( $atts, $content = null ) {
|
122 |
+
extract( shortcode_atts( array(
|
123 |
+
'bg' => '#df9',
|
124 |
+
'color' => '#000'
|
125 |
+
), $atts ) );
|
126 |
+
|
127 |
+
return '<span class="su-highlight" style="background:' . $bg . ';color:' . $color . '"> ' . $content . ' </span>';
|
128 |
+
}
|
129 |
+
|
130 |
+
/**
|
131 |
+
* Shortcode: column
|
132 |
+
*
|
133 |
+
* @param array $atts Shortcode attributes
|
134 |
+
* @param string $content
|
135 |
+
* @return string Output html
|
136 |
+
*/
|
137 |
+
function su_column_shortcode( $atts, $content = null ) {
|
138 |
+
extract( shortcode_atts( array(
|
139 |
+
'size' => '1-2',
|
140 |
+
'last' => false
|
141 |
+
), $atts ) );
|
142 |
+
|
143 |
+
return ( $last ) ? '<div class="su-column su-column-' . $size . ' su-column-last">' . do_shortcode( $content ) . '</div><div class="su-spacer su-spacer-20"></div>' : '<div class="su-column su-column-' . $size . '">' . do_shortcode( $content ) . '</div>';
|
144 |
+
}
|
145 |
+
|
146 |
+
/**
|
147 |
+
* Shortcode: list
|
148 |
+
*
|
149 |
+
* @param array $atts Shortcode attributes
|
150 |
+
* @param string $content
|
151 |
+
* @return string Output html
|
152 |
+
*/
|
153 |
+
function su_list_shortcode( $atts, $content = null ) {
|
154 |
+
extract( shortcode_atts( array(
|
155 |
+
'style' => 'star'
|
156 |
+
), $atts ) );
|
157 |
+
|
158 |
+
return '<div class="su-list su-list-style-' . $style . '">' . $content . '</div>';
|
159 |
+
}
|
160 |
+
|
161 |
+
/**
|
162 |
+
* Shortcode: quote
|
163 |
+
*
|
164 |
+
* @param array $atts Shortcode attributes
|
165 |
+
* @param string $content
|
166 |
+
* @return string Output html
|
167 |
+
*/
|
168 |
+
function su_quote_shortcode( $atts, $content = null ) {
|
169 |
+
extract( shortcode_atts( array(
|
170 |
+
'style' => 1
|
171 |
+
), $atts ) );
|
172 |
+
|
173 |
+
return '<div class="su-quote su-quote-style-' . $style . '"><div class="su-quote-shell">' . do_shortcode( $content ) . '</div></div>';
|
174 |
+
}
|
175 |
+
|
176 |
+
/**
|
177 |
+
* Shortcode: pullquote
|
178 |
+
*
|
179 |
+
* @param array $atts Shortcode attributes
|
180 |
+
* @param string $content
|
181 |
+
* @return string Output html
|
182 |
+
*/
|
183 |
+
function su_pullquote_shortcode( $atts, $content = null ) {
|
184 |
+
extract( shortcode_atts( array(
|
185 |
+
'style' => 1,
|
186 |
+
'align' => 'left'
|
187 |
+
), $atts ) );
|
188 |
+
|
189 |
+
return '<div class="su-pullquote su-pullquote-style-' . $style . ' su-pullquote-align-' . $align . '">' . do_shortcode( $content ) . '</div>';
|
190 |
+
}
|
191 |
+
|
192 |
+
/**
|
193 |
+
* Shortcode: button
|
194 |
+
*
|
195 |
+
* @param array $atts Shortcode attributes
|
196 |
+
* @param string $content
|
197 |
+
* @return string Output html
|
198 |
+
*/
|
199 |
+
function su_button_shortcode( $atts, $content = null ) {
|
200 |
+
extract( shortcode_atts( array(
|
201 |
+
'link' => '#',
|
202 |
+
'color' => '#aaa',
|
203 |
+
'dark' => false,
|
204 |
+
'square' => false,
|
205 |
+
'style' => 1,
|
206 |
+
'size' => 3,
|
207 |
+
'icon' => false,
|
208 |
+
), $atts ) );
|
209 |
+
|
210 |
+
$styles = array(
|
211 |
+
'border_radius' => ( $square ) ? 0 : round( $size + 2 ),
|
212 |
+
'dark_color' => su_hex_shift( $color, 'darker', 20 ),
|
213 |
+
'light_color' => su_hex_shift( $color, 'lighter', 70 ),
|
214 |
+
'size' => round( ( $size + 9 ) * 1.3 ),
|
215 |
+
'text_color' => ( $dark ) ? su_hex_shift( $color, 'darker', 70 ) : su_hex_shift( $color, 'lighter', 90 ),
|
216 |
+
'text_shadow' => ( $dark ) ? su_hex_shift( $color, 'lighter', 50 ) : su_hex_shift( $color, 'darker', 20 ),
|
217 |
+
'text_shadow_position' => ( $dark ) ? '1px 1px' : '-1px -1px',
|
218 |
+
'padding_v' => round( ( $size * 2 ) + 2 ),
|
219 |
+
'padding_h' => round( ( ( $size * 3 ) + 10 ) )
|
220 |
+
);
|
221 |
+
|
222 |
+
$link_styles = array(
|
223 |
+
'background-color' => $color,
|
224 |
+
'border' => '1px solid ' . $styles['dark_color'],
|
225 |
+
'border-radius' => $styles['border_radius'] . 'px',
|
226 |
+
'-moz-border-radius' => $styles['border_radius'] . 'px',
|
227 |
+
'-webkit-border-radius' => $styles['border_radius'] . 'px'
|
228 |
+
);
|
229 |
+
|
230 |
+
$span_styles = array(
|
231 |
+
'color' => $styles['text_color'],
|
232 |
+
'padding' => $styles['padding_v'] . 'px ' . $styles['padding_h'] . 'px',
|
233 |
+
'font-size' => $styles['size'] . 'px',
|
234 |
+
'height' => $styles['size'] . 'px',
|
235 |
+
'line-height' => $styles['size'] . 'px',
|
236 |
+
'border-top' => '1px solid ' . $styles['light_color'],
|
237 |
+
'text-transform' => 'uppercase',
|
238 |
+
'border-radius' => $styles['border_radius'] . 'px',
|
239 |
+
'text-shadow' => $styles['text_shadow_position'] . ' 0 ' . $styles['text_shadow'],
|
240 |
+
'-moz-border-radius' => $styles['border_radius'] . 'px',
|
241 |
+
'-moz-text-shadow' => $styles['text_shadow_position'] . ' 0 ' . $styles['text_shadow'],
|
242 |
+
'-webkit-border-radius' => $styles['border_radius'] . 'px',
|
243 |
+
'-webkit-text-shadow' => $styles['text_shadow_position'] . ' 0 ' . $styles['text_shadow']
|
244 |
+
);
|
245 |
+
|
246 |
+
$img_styles = array(
|
247 |
+
'margin' => '0 ' . round( $size * 0.7 ) . 'px -' . round( ( $size * 0.3 ) + 4 ) . 'px -' . round( $size * 0.8 ) . 'px',
|
248 |
+
'height' => ( $styles['size'] + 4 ) . 'px'
|
249 |
+
);
|
250 |
+
|
251 |
+
foreach ( $link_styles as $link_rule => $link_value ) {
|
252 |
+
$link_style .= $link_rule . ':' . $link_value . ';';
|
253 |
+
}
|
254 |
+
|
255 |
+
foreach ( $span_styles as $span_rule => $span_value ) {
|
256 |
+
$span_style .= $span_rule . ':' . $span_value . ';';
|
257 |
+
}
|
258 |
+
|
259 |
+
foreach ( $img_styles as $img_rule => $img_value ) {
|
260 |
+
$img_style .= $img_rule . ':' . $img_value . ';';
|
261 |
+
}
|
262 |
+
|
263 |
+
$icon_image = ( $icon ) ? '<img src="' . $icon . '" alt="' . htmlspecialchars( $content ) . '" style="' . $img_style . '" /> ' : '';
|
264 |
+
|
265 |
+
return '<a href="' . $link . '" class="su-button su-button-style-' . $style . '" style="' . $link_style . '"><span style="' . $span_style . '">' . $icon_image . $content . '</span></a>';
|
266 |
+
}
|
267 |
+
|
268 |
+
/**
|
269 |
+
* Shortcode: fancy-link
|
270 |
+
*
|
271 |
+
* @param string $content
|
272 |
+
* @return string Output html
|
273 |
+
*/
|
274 |
+
function su_fancy_link_shortcode( $atts, $content = null ) {
|
275 |
+
extract( shortcode_atts( array(
|
276 |
+
'link' => '#',
|
277 |
+
'color' => 'black'
|
278 |
+
), $atts ) );
|
279 |
+
|
280 |
+
return '<a class="su-fancy-link su-fancy-link-' . $color . '" href="' . $link . '">' . $content . '</a>';
|
281 |
+
}
|
282 |
+
|
283 |
+
/**
|
284 |
+
* Shortcode: service
|
285 |
+
*
|
286 |
+
* @param array $atts Shortcode attributes
|
287 |
+
* @param string $content
|
288 |
+
* @return string Output html
|
289 |
+
*/
|
290 |
+
function su_service_shortcode( $atts, $content = null ) {
|
291 |
+
extract( shortcode_atts( array(
|
292 |
+
'title' => __( 'Service name', 'shortcodes-ultimate' ),
|
293 |
+
'icon' => su_plugin_url() . '/images/service.png',
|
294 |
+
'size' => 32
|
295 |
+
), $atts ) );
|
296 |
+
|
297 |
+
return '<div class="su-service"><div class="su-service-title" style="padding:' . round( ( $size - 16 ) / 2 ) . 'px 0 ' . round( ( $size - 16 ) / 2 ) . 'px ' . ( $size + 15 ) . 'px"><img src="' . $icon . '" width="' . $size . '" height="' . $size . '" alt="' . $title . '" /> ' . $title . '</div><div class="su-service-content" style="padding:0 0 0 ' . ( $size + 15 ) . 'px">' . do_shortcode( $content ) . '</div></div>';
|
298 |
+
}
|
299 |
+
|
300 |
+
/**
|
301 |
+
* Shortcode: box
|
302 |
+
*
|
303 |
+
* @param array $atts Shortcode attributes
|
304 |
+
* @param string $content
|
305 |
+
* @return string Output html
|
306 |
+
*/
|
307 |
+
function su_box_shortcode( $atts, $content = null ) {
|
308 |
+
extract( shortcode_atts( array(
|
309 |
+
'color' => '#333',
|
310 |
+
'title' => __( 'This is box title', 'shortcodes-ultimate' )
|
311 |
+
), $atts ) );
|
312 |
+
|
313 |
+
$styles = array(
|
314 |
+
'dark_color' => su_hex_shift( $color, 'darker', 20 ),
|
315 |
+
'light_color' => su_hex_shift( $color, 'lighter', 60 ),
|
316 |
+
'text_shadow' => su_hex_shift( $color, 'darker', 70 ),
|
317 |
+
);
|
318 |
+
|
319 |
+
return '<div class="su-box" style="border:1px solid ' . $styles['dark_color'] . '"><div class="su-box-title" style="background-color:' . $color . ';border-top:1px solid ' . $styles['light_color'] . ';text-shadow:1px 1px 0 ' . $styles['text_shadow'] . '">' . $title . '</div><div class="su-box-content">' . do_shortcode( $content ) . '</div></div>';
|
320 |
+
}
|
321 |
+
|
322 |
+
/**
|
323 |
+
* Shortcode: note
|
324 |
+
*
|
325 |
+
* @param array $atts Shortcode attributes
|
326 |
+
* @param string $content
|
327 |
+
* @return string Output html
|
328 |
+
*/
|
329 |
+
function su_note_shortcode( $atts, $content = null ) {
|
330 |
+
extract( shortcode_atts( array(
|
331 |
+
'color' => '#fc0'
|
332 |
+
), $atts ) );
|
333 |
+
|
334 |
+
$styles = array(
|
335 |
+
'dark_color' => su_hex_shift( $color, 'darker', 10 ),
|
336 |
+
'light_color' => su_hex_shift( $color, 'lighter', 20 ),
|
337 |
+
'extra_light_color' => su_hex_shift( $color, 'lighter', 80 ),
|
338 |
+
'text_color' => su_hex_shift( $color, 'darker', 70 )
|
339 |
+
);
|
340 |
+
|
341 |
+
return '<div class="su-note" style="background-color:' . $styles['light_color'] . ';border:1px solid ' . $styles['dark_color'] . '"><div class="su-note-shell" style="border:1px solid ' . $styles['extra_light_color'] . ';color:' . $styles['text_color'] . '">' . do_shortcode( $content ) . '</div></div>';
|
342 |
+
}
|
343 |
+
|
344 |
+
/**
|
345 |
+
* Shortcode: media
|
346 |
+
*
|
347 |
+
* @param array $atts Shortcode attributes
|
348 |
+
* @param string $content
|
349 |
+
* @return string Output html
|
350 |
+
*/
|
351 |
+
function su_media_shortcode( $atts, $content = null ) {
|
352 |
+
extract( shortcode_atts( array(
|
353 |
+
'url' => '',
|
354 |
+
'width' => 600,
|
355 |
+
'height' => 400
|
356 |
+
), $atts ) );
|
357 |
+
|
358 |
+
$return = '<div class="su-media">';
|
359 |
+
$return .= ( $url ) ? su_get_media( $url, $width, $height ) : __( 'Please specify media url', 'shortcodes-ultimate' );
|
360 |
+
$return .= '</div>';
|
361 |
+
|
362 |
+
return $return;
|
363 |
+
}
|
364 |
+
|
365 |
+
/**
|
366 |
+
* Shortcode: table
|
367 |
+
*
|
368 |
+
* @param array $atts Shortcode attributes
|
369 |
+
* @param string $content
|
370 |
+
* @return string Output html
|
371 |
+
*/
|
372 |
+
function su_table_shortcode( $atts, $content = null ) {
|
373 |
+
extract( shortcode_atts( array(
|
374 |
+
'style' => 1,
|
375 |
+
'file' => false
|
376 |
+
), $atts ) );
|
377 |
+
|
378 |
+
$return = '<div class="su-table su-table-style-' . $style . '">';
|
379 |
+
$return .= ( $file ) ? su_parse_csv( $file ) : do_shortcode( $content );
|
380 |
+
$return .= '</div>';
|
381 |
+
|
382 |
+
return $return;
|
383 |
+
}
|
384 |
+
|
385 |
+
?>
|
lib/timthumb.php
ADDED
@@ -0,0 +1,762 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* TimThumb script created by Ben Gillbanks, originally created by Tim McDaniels and Darren Hoyt
|
4 |
+
* http://code.google.com/p/timthumb/
|
5 |
+
*
|
6 |
+
* GNU General Public License, version 2
|
7 |
+
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
8 |
+
*
|
9 |
+
* Examples and documentation available on the project homepage
|
10 |
+
* http://www.binarymoon.co.uk/projects/timthumb/
|
11 |
+
*/
|
12 |
+
|
13 |
+
define ('CACHE_SIZE', 250); // number of files to store before clearing cache
|
14 |
+
define ('CACHE_CLEAR', 5); // maximum number of files to delete on each cache clear
|
15 |
+
define ('CACHE_USE', TRUE); // use the cache files? (mostly for testing)
|
16 |
+
define ('VERSION', '1.19'); // version number (to force a cache refresh)
|
17 |
+
define ('DIRECTORY_CACHE', './cache'); // cache directory
|
18 |
+
define ('MAX_WIDTH', 1000); // maximum image width
|
19 |
+
define ('MAX_HEIGHT', 1000); // maximum image height
|
20 |
+
define ('ALLOW_EXTERNAL', FALSE); // allow external website (override security precaution)
|
21 |
+
|
22 |
+
// external domains that are allowed to be displayed on your website
|
23 |
+
$allowedSites = array (
|
24 |
+
'flickr.com',
|
25 |
+
'picasa.com',
|
26 |
+
'blogger.com',
|
27 |
+
'wordpress.com',
|
28 |
+
'img.youtube.com',
|
29 |
+
'themes.wprender.ru',
|
30 |
+
'democontent.wprender.ru',
|
31 |
+
);
|
32 |
+
|
33 |
+
// STOP MODIFYING HERE!
|
34 |
+
// --------------------
|
35 |
+
|
36 |
+
// sort out image source
|
37 |
+
$src = get_request ('src', '');
|
38 |
+
if ($src == '' || strlen ($src) <= 3) {
|
39 |
+
display_error ('no image specified');
|
40 |
+
}
|
41 |
+
|
42 |
+
// clean params before use
|
43 |
+
$src = clean_source ($src);
|
44 |
+
|
45 |
+
// get mime type of src
|
46 |
+
$mime_type = mime_type ($src);
|
47 |
+
|
48 |
+
// check to see if this image is in the cache already
|
49 |
+
// if already cached then display the image and die
|
50 |
+
check_cache ($mime_type);
|
51 |
+
|
52 |
+
// cache doesn't exist and then process everything
|
53 |
+
// check to see if GD function exist
|
54 |
+
if (!function_exists ('imagecreatetruecolor')) {
|
55 |
+
display_error ('GD Library Error: imagecreatetruecolor does not exist - please contact your webhost and ask them to install the GD library');
|
56 |
+
}
|
57 |
+
|
58 |
+
if (function_exists ('imagefilter') && defined ('IMG_FILTER_NEGATE')) {
|
59 |
+
$imageFilters = array (
|
60 |
+
1 => array (IMG_FILTER_NEGATE, 0),
|
61 |
+
2 => array (IMG_FILTER_GRAYSCALE, 0),
|
62 |
+
3 => array (IMG_FILTER_BRIGHTNESS, 1),
|
63 |
+
4 => array (IMG_FILTER_CONTRAST, 1),
|
64 |
+
5 => array (IMG_FILTER_COLORIZE, 4),
|
65 |
+
6 => array (IMG_FILTER_EDGEDETECT, 0),
|
66 |
+
7 => array (IMG_FILTER_EMBOSS, 0),
|
67 |
+
8 => array (IMG_FILTER_GAUSSIAN_BLUR, 0),
|
68 |
+
9 => array (IMG_FILTER_SELECTIVE_BLUR, 0),
|
69 |
+
10 => array (IMG_FILTER_MEAN_REMOVAL, 0),
|
70 |
+
11 => array (IMG_FILTER_SMOOTH, 0),
|
71 |
+
);
|
72 |
+
}
|
73 |
+
|
74 |
+
// get standard input properties
|
75 |
+
$new_width = (int) abs (get_request ('w', 0));
|
76 |
+
$new_height = (int) abs (get_request ('h', 0));
|
77 |
+
$zoom_crop = (int) get_request ('zc', 1);
|
78 |
+
$quality = (int) abs (get_request ('q', 90));
|
79 |
+
$align = get_request ('a', 'c');
|
80 |
+
$filters = get_request ('f', '');
|
81 |
+
$sharpen = (bool) get_request ('s', 0);
|
82 |
+
|
83 |
+
// set default width and height if neither are set already
|
84 |
+
if ($new_width == 0 && $new_height == 0) {
|
85 |
+
$new_width = 100;
|
86 |
+
$new_height = 100;
|
87 |
+
}
|
88 |
+
|
89 |
+
// ensure size limits can not be abused
|
90 |
+
$new_width = min ($new_width, MAX_WIDTH);
|
91 |
+
$new_height = min ($new_height, MAX_HEIGHT);
|
92 |
+
|
93 |
+
// set memory limit to be able to have enough space to resize larger images
|
94 |
+
ini_set ('memory_limit', '50M');
|
95 |
+
|
96 |
+
if (file_exists ($src)) {
|
97 |
+
|
98 |
+
// open the existing image
|
99 |
+
$image = open_image ($mime_type, $src);
|
100 |
+
if ($image === false) {
|
101 |
+
display_error ('Unable to open image : ' . $src);
|
102 |
+
}
|
103 |
+
|
104 |
+
// Get original width and height
|
105 |
+
$width = imagesx ($image);
|
106 |
+
$height = imagesy ($image);
|
107 |
+
|
108 |
+
// generate new w/h if not provided
|
109 |
+
if ($new_width && !$new_height) {
|
110 |
+
|
111 |
+
$new_height = floor ($height * ($new_width / $width));
|
112 |
+
|
113 |
+
} else if ($new_height && !$new_width) {
|
114 |
+
|
115 |
+
$new_width = floor ($width * ($new_height / $height));
|
116 |
+
|
117 |
+
}
|
118 |
+
|
119 |
+
// create a new true color image
|
120 |
+
$canvas = imagecreatetruecolor ($new_width, $new_height);
|
121 |
+
imagealphablending ($canvas, false);
|
122 |
+
|
123 |
+
// Create a new transparent color for image
|
124 |
+
$color = imagecolorallocatealpha ($canvas, 0, 0, 0, 127);
|
125 |
+
|
126 |
+
// Completely fill the background of the new image with allocated color.
|
127 |
+
imagefill ($canvas, 0, 0, $color);
|
128 |
+
|
129 |
+
// Restore transparency blending
|
130 |
+
imagesavealpha ($canvas, true);
|
131 |
+
|
132 |
+
if ($zoom_crop) {
|
133 |
+
|
134 |
+
$src_x = $src_y = 0;
|
135 |
+
$src_w = $width;
|
136 |
+
$src_h = $height;
|
137 |
+
|
138 |
+
$cmp_x = $width / $new_width;
|
139 |
+
$cmp_y = $height / $new_height;
|
140 |
+
|
141 |
+
// calculate x or y coordinate and width or height of source
|
142 |
+
if ($cmp_x > $cmp_y) {
|
143 |
+
|
144 |
+
$src_w = round (($width / $cmp_x * $cmp_y));
|
145 |
+
$src_x = round (($width - ($width / $cmp_x * $cmp_y)) / 2);
|
146 |
+
|
147 |
+
} else if ($cmp_y > $cmp_x) {
|
148 |
+
|
149 |
+
$src_h = round (($height / $cmp_y * $cmp_x));
|
150 |
+
$src_y = round (($height - ($height / $cmp_y * $cmp_x)) / 2);
|
151 |
+
|
152 |
+
}
|
153 |
+
|
154 |
+
// positional cropping!
|
155 |
+
switch ($align) {
|
156 |
+
case 't':
|
157 |
+
case 'tl':
|
158 |
+
case 'lr':
|
159 |
+
case 'tr':
|
160 |
+
case 'rt':
|
161 |
+
$src_y = 0;
|
162 |
+
break;
|
163 |
+
|
164 |
+
case 'b':
|
165 |
+
case 'bl':
|
166 |
+
case 'lb':
|
167 |
+
case 'br':
|
168 |
+
case 'rb':
|
169 |
+
$src_y = $height - $src_h;
|
170 |
+
break;
|
171 |
+
|
172 |
+
case 'l':
|
173 |
+
case 'tl':
|
174 |
+
case 'lt':
|
175 |
+
case 'bl':
|
176 |
+
case 'lb':
|
177 |
+
$src_x = 0;
|
178 |
+
break;
|
179 |
+
|
180 |
+
case 'r':
|
181 |
+
case 'tr':
|
182 |
+
case 'rt':
|
183 |
+
case 'br':
|
184 |
+
case 'rb':
|
185 |
+
$src_x = $width - $new_width;
|
186 |
+
$src_x = $width - $src_w;
|
187 |
+
break;
|
188 |
+
|
189 |
+
default:
|
190 |
+
break;
|
191 |
+
}
|
192 |
+
|
193 |
+
imagecopyresampled ($canvas, $image, 0, 0, $src_x, $src_y, $new_width, $new_height, $src_w, $src_h);
|
194 |
+
|
195 |
+
} else {
|
196 |
+
|
197 |
+
// copy and resize part of an image with resampling
|
198 |
+
imagecopyresampled ($canvas, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
|
199 |
+
|
200 |
+
}
|
201 |
+
|
202 |
+
if ($filters != '' && function_exists ('imagefilter') && defined ('IMG_FILTER_NEGATE')) {
|
203 |
+
// apply filters to image
|
204 |
+
$filterList = explode ('|', $filters);
|
205 |
+
foreach ($filterList as $fl) {
|
206 |
+
|
207 |
+
$filterSettings = explode (',', $fl);
|
208 |
+
if (isset ($imageFilters[$filterSettings[0]])) {
|
209 |
+
|
210 |
+
for ($i = 0; $i < 4; $i ++) {
|
211 |
+
if (!isset ($filterSettings[$i])) {
|
212 |
+
$filterSettings[$i] = null;
|
213 |
+
} else {
|
214 |
+
$filterSettings[$i] = (int) $filterSettings[$i];
|
215 |
+
}
|
216 |
+
}
|
217 |
+
|
218 |
+
switch ($imageFilters[$filterSettings[0]][1]) {
|
219 |
+
|
220 |
+
case 1:
|
221 |
+
|
222 |
+
imagefilter ($canvas, $imageFilters[$filterSettings[0]][0], $filterSettings[1]);
|
223 |
+
break;
|
224 |
+
|
225 |
+
case 2:
|
226 |
+
|
227 |
+
imagefilter ($canvas, $imageFilters[$filterSettings[0]][0], $filterSettings[1], $filterSettings[2]);
|
228 |
+
break;
|
229 |
+
|
230 |
+
case 3:
|
231 |
+
|
232 |
+
imagefilter ($canvas, $imageFilters[$filterSettings[0]][0], $filterSettings[1], $filterSettings[2], $filterSettings[3]);
|
233 |
+
break;
|
234 |
+
|
235 |
+
case 4:
|
236 |
+
|
237 |
+
imagefilter ($canvas, $imageFilters[$filterSettings[0]][0], $filterSettings[1], $filterSettings[2], $filterSettings[3], $filterSettings[4]);
|
238 |
+
break;
|
239 |
+
|
240 |
+
default:
|
241 |
+
|
242 |
+
imagefilter ($canvas, $imageFilters[$filterSettings[0]][0]);
|
243 |
+
break;
|
244 |
+
|
245 |
+
}
|
246 |
+
}
|
247 |
+
}
|
248 |
+
}
|
249 |
+
|
250 |
+
// sharpen image
|
251 |
+
if ($sharpen && function_exists ('imageconvolution')) {
|
252 |
+
|
253 |
+
$sharpenMatrix = array (
|
254 |
+
array (-1,-1,-1),
|
255 |
+
array (-1,16,-1),
|
256 |
+
array (-1,-1,-1),
|
257 |
+
);
|
258 |
+
|
259 |
+
$divisor = 8;
|
260 |
+
$offset = 0;
|
261 |
+
|
262 |
+
imageconvolution ($canvas, $sharpenMatrix, $divisor, $offset);
|
263 |
+
|
264 |
+
}
|
265 |
+
|
266 |
+
// output image to browser based on mime type
|
267 |
+
show_image ($mime_type, $canvas);
|
268 |
+
|
269 |
+
// remove image from memory
|
270 |
+
imagedestroy ($canvas);
|
271 |
+
|
272 |
+
// if not in cache then clear some space and generate a new file
|
273 |
+
clean_cache ();
|
274 |
+
|
275 |
+
die ();
|
276 |
+
|
277 |
+
} else {
|
278 |
+
|
279 |
+
if (strlen ($src)) {
|
280 |
+
display_error ('image ' . $src . ' not found');
|
281 |
+
} else {
|
282 |
+
display_error ('no source specified');
|
283 |
+
}
|
284 |
+
|
285 |
+
}
|
286 |
+
|
287 |
+
|
288 |
+
/**
|
289 |
+
*
|
290 |
+
* @global <type> $quality
|
291 |
+
* @param <type> $mime_type
|
292 |
+
* @param <type> $image_resized
|
293 |
+
*/
|
294 |
+
function show_image ($mime_type, $image_resized) {
|
295 |
+
|
296 |
+
global $quality;
|
297 |
+
|
298 |
+
// check to see if we can write to the cache directory
|
299 |
+
$cache_file = get_cache_file ($mime_type);
|
300 |
+
|
301 |
+
if (stristr ($mime_type, 'jpeg')) {
|
302 |
+
imagejpeg ($image_resized, $cache_file, $quality);
|
303 |
+
} else {
|
304 |
+
imagepng ($image_resized, $cache_file, floor ($quality * 0.09));
|
305 |
+
}
|
306 |
+
|
307 |
+
show_cache_file ($mime_type);
|
308 |
+
|
309 |
+
}
|
310 |
+
|
311 |
+
|
312 |
+
/**
|
313 |
+
*
|
314 |
+
* @param <type> $property
|
315 |
+
* @param <type> $default
|
316 |
+
* @return <type>
|
317 |
+
*/
|
318 |
+
function get_request ($property, $default = 0) {
|
319 |
+
|
320 |
+
if (isset ($_GET[$property])) {
|
321 |
+
|
322 |
+
return $_GET[$property];
|
323 |
+
|
324 |
+
} else {
|
325 |
+
|
326 |
+
return $default;
|
327 |
+
|
328 |
+
}
|
329 |
+
|
330 |
+
}
|
331 |
+
|
332 |
+
|
333 |
+
/**
|
334 |
+
*
|
335 |
+
* @param <type> $mime_type
|
336 |
+
* @param <type> $src
|
337 |
+
* @return <type>
|
338 |
+
*/
|
339 |
+
function open_image ($mime_type, $src) {
|
340 |
+
|
341 |
+
$mime_type = strtolower ($mime_type);
|
342 |
+
|
343 |
+
if (stristr ($mime_type, 'gif')) {
|
344 |
+
|
345 |
+
$image = imagecreatefromgif ($src);
|
346 |
+
|
347 |
+
} elseif (stristr ($mime_type, 'jpeg')) {
|
348 |
+
|
349 |
+
$image = imagecreatefromjpeg ($src);
|
350 |
+
|
351 |
+
} elseif (stristr ($mime_type, 'png')) {
|
352 |
+
|
353 |
+
$image = imagecreatefrompng ($src);
|
354 |
+
|
355 |
+
}
|
356 |
+
|
357 |
+
return $image;
|
358 |
+
|
359 |
+
}
|
360 |
+
|
361 |
+
/**
|
362 |
+
* clean out old files from the cache
|
363 |
+
* you can change the number of files to store and to delete per loop in the defines at the top of the code
|
364 |
+
*
|
365 |
+
* @return <type>
|
366 |
+
*/
|
367 |
+
function clean_cache () {
|
368 |
+
|
369 |
+
// add an escape
|
370 |
+
// Reduces the amount of cache clearing to save some processor speed
|
371 |
+
if (rand (1, 100) > 10) {
|
372 |
+
return true;
|
373 |
+
}
|
374 |
+
|
375 |
+
flush ();
|
376 |
+
|
377 |
+
$files = glob (DIRECTORY_CACHE . '/*', GLOB_BRACE);
|
378 |
+
|
379 |
+
if (count ($files) > CACHE_SIZE) {
|
380 |
+
|
381 |
+
$yesterday = time () - (24 * 60 * 60);
|
382 |
+
|
383 |
+
usort ($files, 'filemtime_compare');
|
384 |
+
$i = 0;
|
385 |
+
|
386 |
+
foreach ($files as $file) {
|
387 |
+
|
388 |
+
$i ++;
|
389 |
+
|
390 |
+
if ($i >= CACHE_CLEAR) {
|
391 |
+
return;
|
392 |
+
}
|
393 |
+
|
394 |
+
if (@filemtime ($file) > $yesterday) {
|
395 |
+
return;
|
396 |
+
}
|
397 |
+
|
398 |
+
if (file_exists ($file)) {
|
399 |
+
unlink ($file);
|
400 |
+
}
|
401 |
+
|
402 |
+
}
|
403 |
+
|
404 |
+
}
|
405 |
+
|
406 |
+
}
|
407 |
+
|
408 |
+
|
409 |
+
/**
|
410 |
+
* compare the file time of two files
|
411 |
+
*
|
412 |
+
* @param <type> $a
|
413 |
+
* @param <type> $b
|
414 |
+
* @return <type>
|
415 |
+
*/
|
416 |
+
function filemtime_compare ($a, $b) {
|
417 |
+
|
418 |
+
$break = explode ('/', $_SERVER['SCRIPT_FILENAME']);
|
419 |
+
$filename = $break[count ($break) - 1];
|
420 |
+
$filepath = str_replace ($filename, '', $_SERVER['SCRIPT_FILENAME']);
|
421 |
+
|
422 |
+
$file_a = realpath ($filepath . $a);
|
423 |
+
$file_b = realpath ($filepath . $b);
|
424 |
+
|
425 |
+
return filemtime ($file_a) - filemtime ($file_b);
|
426 |
+
|
427 |
+
}
|
428 |
+
|
429 |
+
|
430 |
+
/**
|
431 |
+
* determine the file mime type
|
432 |
+
*
|
433 |
+
* @param <type> $file
|
434 |
+
* @return <type>
|
435 |
+
*/
|
436 |
+
function mime_type ($file) {
|
437 |
+
|
438 |
+
$file_infos = getimagesize ($file);
|
439 |
+
$mime_type = $file_infos['mime'];
|
440 |
+
|
441 |
+
// use mime_type to determine mime type
|
442 |
+
if (!preg_match ("/jpg|jpeg|gif|png/i", $mime_type)) {
|
443 |
+
display_error ('Invalid src mime type: ' . $mime_type);
|
444 |
+
}
|
445 |
+
|
446 |
+
return $mime_type;
|
447 |
+
|
448 |
+
}
|
449 |
+
|
450 |
+
|
451 |
+
/**
|
452 |
+
*
|
453 |
+
* @param <type> $mime_type
|
454 |
+
*/
|
455 |
+
function check_cache ($mime_type) {
|
456 |
+
|
457 |
+
if (CACHE_USE) {
|
458 |
+
|
459 |
+
if (!show_cache_file ($mime_type)) {
|
460 |
+
// make sure cache dir exists
|
461 |
+
if (!file_exists (DIRECTORY_CACHE)) {
|
462 |
+
// give 777 permissions so that developer can overwrite
|
463 |
+
// files created by web server user
|
464 |
+
mkdir (DIRECTORY_CACHE);
|
465 |
+
chmod (DIRECTORY_CACHE, 0777);
|
466 |
+
}
|
467 |
+
}
|
468 |
+
|
469 |
+
}
|
470 |
+
|
471 |
+
}
|
472 |
+
|
473 |
+
|
474 |
+
/**
|
475 |
+
*
|
476 |
+
* @param <type> $mime_type
|
477 |
+
* @return <type>
|
478 |
+
*/
|
479 |
+
function show_cache_file ($mime_type) {
|
480 |
+
|
481 |
+
// use browser cache if available to speed up page load
|
482 |
+
if (isset ($_SERVER['HTTP_IF_MODIFIED_SINCE'])) {
|
483 |
+
if (strtotime ($_SERVER['HTTP_IF_MODIFIED_SINCE']) < strtotime('now')) {
|
484 |
+
header ('HTTP/1.1 304 Not Modified');
|
485 |
+
die ();
|
486 |
+
}
|
487 |
+
}
|
488 |
+
|
489 |
+
$cache_file = get_cache_file ($mime_type);
|
490 |
+
|
491 |
+
if (file_exists ($cache_file)) {
|
492 |
+
|
493 |
+
// change the modified headers
|
494 |
+
$gmdate_expires = gmdate ('D, d M Y H:i:s', strtotime ('now +10 days')) . ' GMT';
|
495 |
+
$gmdate_modified = gmdate ('D, d M Y H:i:s') . ' GMT';
|
496 |
+
|
497 |
+
// send content headers then display image
|
498 |
+
header ('Content-Type: ' . $mime_type);
|
499 |
+
header ('Accept-Ranges: bytes');
|
500 |
+
header ('Last-Modified: ' . $gmdate_modified);
|
501 |
+
header ('Content-Length: ' . filesize ($cache_file));
|
502 |
+
header ('Cache-Control: max-age=864000, must-revalidate');
|
503 |
+
header ('Expires: ' . $gmdate_expires);
|
504 |
+
|
505 |
+
if (!@readfile ($cache_file)) {
|
506 |
+
$content = file_get_contents ($cache_file);
|
507 |
+
if ($content != FALSE) {
|
508 |
+
echo $content;
|
509 |
+
} else {
|
510 |
+
display_error ('cache file could not be loaded');
|
511 |
+
}
|
512 |
+
}
|
513 |
+
|
514 |
+
die ();
|
515 |
+
|
516 |
+
}
|
517 |
+
|
518 |
+
return FALSE;
|
519 |
+
|
520 |
+
}
|
521 |
+
|
522 |
+
|
523 |
+
/**
|
524 |
+
*
|
525 |
+
* @staticvar string $cache_file
|
526 |
+
* @param <type> $mime_type
|
527 |
+
* @return string
|
528 |
+
*/
|
529 |
+
function get_cache_file ($mime_type) {
|
530 |
+
|
531 |
+
static $cache_file;
|
532 |
+
global $src;
|
533 |
+
|
534 |
+
$file_type = '.png';
|
535 |
+
|
536 |
+
if (stristr ($mime_type, 'jpeg')) {
|
537 |
+
$file_type = '.jpg';
|
538 |
+
}
|
539 |
+
|
540 |
+
if (!$cache_file) {
|
541 |
+
// filemtime is used to make sure updated files get recached
|
542 |
+
$cache_file = DIRECTORY_CACHE . '/' . md5 ($_SERVER ['QUERY_STRING'] . VERSION . filemtime ($src)) . $file_type;
|
543 |
+
}
|
544 |
+
|
545 |
+
return $cache_file;
|
546 |
+
|
547 |
+
}
|
548 |
+
|
549 |
+
|
550 |
+
/**
|
551 |
+
*
|
552 |
+
* @global array $allowedSites
|
553 |
+
* @param string $src
|
554 |
+
* @return string
|
555 |
+
*/
|
556 |
+
function check_external ($src) {
|
557 |
+
|
558 |
+
global $allowedSites;
|
559 |
+
|
560 |
+
if (stristr ($src, 'http://') !== false) {
|
561 |
+
|
562 |
+
$url_info = parse_url ($src);
|
563 |
+
|
564 |
+
// convert youtube video urls
|
565 |
+
// need to tidy up the code
|
566 |
+
|
567 |
+
if ($url_info['host'] == 'www.youtube.com' || $url_info['host'] == 'youtube.com') {
|
568 |
+
parse_str ($url_info['query']);
|
569 |
+
|
570 |
+
if (isset ($v)) {
|
571 |
+
$src = 'http://img.youtube.com/vi/' . $v . '/0.jpg';
|
572 |
+
$url_info['host'] = 'img.youtube.com';
|
573 |
+
}
|
574 |
+
}
|
575 |
+
|
576 |
+
// check allowed sites (if required)
|
577 |
+
if (ALLOW_EXTERNAL) {
|
578 |
+
|
579 |
+
$isAllowedSite = true;
|
580 |
+
|
581 |
+
} else {
|
582 |
+
|
583 |
+
$isAllowedSite = false;
|
584 |
+
foreach ($allowedSites as $site) {
|
585 |
+
//$site = '/' . addslashes ($site) . '/';
|
586 |
+
if (stristr($url_info['host'], $site) !== false) {
|
587 |
+
$isAllowedSite = true;
|
588 |
+
}
|
589 |
+
}
|
590 |
+
|
591 |
+
}
|
592 |
+
|
593 |
+
// if allowed
|
594 |
+
if ($isAllowedSite) {
|
595 |
+
|
596 |
+
$fileDetails = pathinfo ($src);
|
597 |
+
$ext = strtolower ($fileDetails['extension']);
|
598 |
+
|
599 |
+
$filename = md5 ($src);
|
600 |
+
$local_filepath = DIRECTORY_CACHE . '/' . $filename . '.' . $ext;
|
601 |
+
|
602 |
+
if (!file_exists ($local_filepath)) {
|
603 |
+
|
604 |
+
if (function_exists ('curl_init')) {
|
605 |
+
|
606 |
+
$fh = fopen ($local_filepath, 'w');
|
607 |
+
$ch = curl_init ($src);
|
608 |
+
|
609 |
+
curl_setopt ($ch, CURLOPT_TIMEOUT, 15);
|
610 |
+
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1");
|
611 |
+
curl_setopt ($ch, CURLOPT_URL, $src);
|
612 |
+
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
613 |
+
curl_setopt ($ch, CURLOPT_HEADER, 0);
|
614 |
+
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
|
615 |
+
curl_setopt ($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0');
|
616 |
+
curl_setopt ($ch, CURLOPT_FILE, $fh);
|
617 |
+
|
618 |
+
if (curl_exec ($ch) === FALSE) {
|
619 |
+
if (file_exists ($local_filepath)) {
|
620 |
+
unlink ($local_filepath);
|
621 |
+
}
|
622 |
+
display_error ('error reading file ' . $src . ' from remote host: ' . curl_error($ch));
|
623 |
+
}
|
624 |
+
|
625 |
+
curl_close ($ch);
|
626 |
+
fclose ($fh);
|
627 |
+
|
628 |
+
} else {
|
629 |
+
|
630 |
+
if (!$img = file_get_contents($src)) {
|
631 |
+
display_error ('remote file for ' . $src . ' can not be accessed. It is likely that the file permissions are restricted');
|
632 |
+
}
|
633 |
+
|
634 |
+
if (file_put_contents ($local_filepath, $img) == FALSE) {
|
635 |
+
display_error ('error writing temporary file');
|
636 |
+
}
|
637 |
+
|
638 |
+
}
|
639 |
+
|
640 |
+
if (!file_exists ($local_filepath)) {
|
641 |
+
display_error ('local file for ' . $src . ' can not be created');
|
642 |
+
}
|
643 |
+
|
644 |
+
}
|
645 |
+
|
646 |
+
$src = $local_filepath;
|
647 |
+
|
648 |
+
} else {
|
649 |
+
|
650 |
+
display_error ('remote host "' . $url_info['host'] . '" not allowed');
|
651 |
+
|
652 |
+
}
|
653 |
+
|
654 |
+
}
|
655 |
+
|
656 |
+
return $src;
|
657 |
+
|
658 |
+
}
|
659 |
+
|
660 |
+
|
661 |
+
/**
|
662 |
+
* tidy up the image source url
|
663 |
+
*
|
664 |
+
* @param <type> $src
|
665 |
+
* @return string
|
666 |
+
*/
|
667 |
+
function clean_source ($src) {
|
668 |
+
|
669 |
+
$host = str_replace ('www.', '', $_SERVER['HTTP_HOST']);
|
670 |
+
$regex = "/^((ht|f)tp(s|):\/\/)(www\.|)" . $host . "/i";
|
671 |
+
|
672 |
+
$src = preg_replace ($regex, '', $src);
|
673 |
+
$src = strip_tags ($src);
|
674 |
+
$src = str_replace (' ', '%20', $src);
|
675 |
+
$src = check_external ($src);
|
676 |
+
|
677 |
+
// remove slash from start of string
|
678 |
+
if (strpos ($src, '/') === 0) {
|
679 |
+
$src = substr ($src, -(strlen ($src) - 1));
|
680 |
+
}
|
681 |
+
|
682 |
+
// don't allow users the ability to use '../'
|
683 |
+
// in order to gain access to files below document root
|
684 |
+
$src = preg_replace ("/\.\.+\//", "", $src);
|
685 |
+
|
686 |
+
// get path to image on file system
|
687 |
+
$src = get_document_root ($src) . '/' . $src;
|
688 |
+
|
689 |
+
return $src;
|
690 |
+
|
691 |
+
}
|
692 |
+
|
693 |
+
|
694 |
+
/**
|
695 |
+
*
|
696 |
+
* @param <type> $src
|
697 |
+
* @return string
|
698 |
+
*/
|
699 |
+
function get_document_root ($src) {
|
700 |
+
|
701 |
+
// check for unix servers
|
702 |
+
if (file_exists ($_SERVER['DOCUMENT_ROOT'] . '/' . $src)) {
|
703 |
+
return $_SERVER['DOCUMENT_ROOT'];
|
704 |
+
}
|
705 |
+
|
706 |
+
// check from script filename (to get all directories to timthumb location)
|
707 |
+
$parts = array_diff (explode ('/', $_SERVER['SCRIPT_FILENAME']), explode ('/', $_SERVER['DOCUMENT_ROOT']));
|
708 |
+
$path = $_SERVER['DOCUMENT_ROOT'];
|
709 |
+
foreach ($parts as $part) {
|
710 |
+
$path .= '/' . $part;
|
711 |
+
if (file_exists ($path . '/' . $src)) {
|
712 |
+
return $path;
|
713 |
+
}
|
714 |
+
}
|
715 |
+
|
716 |
+
// the relative paths below are useful if timthumb is moved outside of document root
|
717 |
+
// specifically if installed in wordpress themes like mimbo pro:
|
718 |
+
// /wp-content/themes/mimbopro/scripts/timthumb.php
|
719 |
+
$paths = array (
|
720 |
+
"./",
|
721 |
+
"../",
|
722 |
+
"../../",
|
723 |
+
"../../../",
|
724 |
+
"../../../../",
|
725 |
+
"../../../../../"
|
726 |
+
);
|
727 |
+
|
728 |
+
foreach ($paths as $path) {
|
729 |
+
if (file_exists ($path . $src)) {
|
730 |
+
return $path;
|
731 |
+
}
|
732 |
+
}
|
733 |
+
|
734 |
+
// special check for microsoft servers
|
735 |
+
if (!isset ($_SERVER['DOCUMENT_ROOT'])) {
|
736 |
+
$path = str_replace ("/", "\\", $_SERVER['ORIG_PATH_INFO']);
|
737 |
+
$path = str_replace ($path, '', $_SERVER['SCRIPT_FILENAME']);
|
738 |
+
|
739 |
+
if (file_exists ($path . '/' . $src)) {
|
740 |
+
return $path;
|
741 |
+
}
|
742 |
+
}
|
743 |
+
|
744 |
+
display_error ('file not found ' . $src, ENT_QUOTES);
|
745 |
+
|
746 |
+
}
|
747 |
+
|
748 |
+
|
749 |
+
/**
|
750 |
+
* generic error message
|
751 |
+
*
|
752 |
+
* @param <type> $errorString
|
753 |
+
*/
|
754 |
+
function display_error ($errorString = '') {
|
755 |
+
|
756 |
+
header ('HTTP/1.1 400 Bad Request');
|
757 |
+
echo '<pre>' . htmlentities ($errorString);
|
758 |
+
echo '<br />Query String : ' . htmlentities ($_SERVER['QUERY_STRING']);
|
759 |
+
echo '<br />TimThumb version : ' . VERSION . '</pre>';
|
760 |
+
die ();
|
761 |
+
|
762 |
+
}
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://ilovecode.ru/
|
|
4 |
Tags: shortcode, shortcodes, short code, shortcodes, tab, tabs, button, buttons, jquery, box, boxes, toggle, spoiler, column, columns, services, service, pullquote, list, lists, frame, images, image, links, fancy, fancy link, fancy links, fancy buttons, jquery tabs, accordeon
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 3.1
|
7 |
-
Stable tag: 1.
|
8 |
|
9 |
Provides support for multiple useful shortcodes
|
10 |
|
@@ -60,6 +60,13 @@ In your dashboard
|
|
60 |
|
61 |
== Changelog ==
|
62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
= 1.4.1 =
|
64 |
* Service shortcode returned
|
65 |
|
4 |
Tags: shortcode, shortcodes, short code, shortcodes, tab, tabs, button, buttons, jquery, box, boxes, toggle, spoiler, column, columns, services, service, pullquote, list, lists, frame, images, image, links, fancy, fancy link, fancy links, fancy buttons, jquery tabs, accordeon
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 3.1
|
7 |
+
Stable tag: 1.5.0
|
8 |
|
9 |
Provides support for multiple useful shortcodes
|
10 |
|
60 |
|
61 |
== Changelog ==
|
62 |
|
63 |
+
= 1.5.0 =
|
64 |
+
* Added option "Compatibility mode"
|
65 |
+
* Added new button styles
|
66 |
+
* Added new list styles
|
67 |
+
* Added new shortcode media
|
68 |
+
* Added new shortcode table
|
69 |
+
|
70 |
= 1.4.1 =
|
71 |
* Service shortcode returned
|
72 |
|
screenshot-3.png
ADDED
Binary file
|
shortcodes-ultimate.php
CHANGED
@@ -1,703 +1,162 @@
|
|
1 |
<?php
|
|
|
2 |
/*
|
3 |
Plugin Name: Shortcodes Ultimate
|
4 |
Plugin URI: http://ilovecode.ru/?p=122
|
5 |
-
Version: 1.
|
6 |
Author: Vladimir Anokhin
|
7 |
Author URI: http://ilovecode.ru/
|
8 |
Description: Provides support for many easy to use shortcodes
|
9 |
Text Domain: shortcodes-ultimate
|
10 |
Domain Path: /languages
|
|
|
11 |
*/
|
12 |
|
13 |
/**
|
14 |
-
*
|
15 |
-
*
|
16 |
-
* @param array $atts Shortcode attributes
|
17 |
-
* @param string $content
|
18 |
-
* @return string Output html
|
19 |
*/
|
20 |
-
function
|
21 |
-
extract( shortcode_atts( array(
|
22 |
-
'size' => 3
|
23 |
-
), $atts ) );
|
24 |
|
25 |
-
|
26 |
-
|
27 |
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
*/
|
35 |
-
function su_frame_shortcode( $atts, $content = null ) {
|
36 |
-
extract( shortcode_atts( array(
|
37 |
-
'align' => 'none'
|
38 |
-
), $atts ) );
|
39 |
|
40 |
-
|
41 |
-
|
42 |
|
43 |
-
|
44 |
-
|
45 |
-
*
|
46 |
-
* @param array $atts Shortcode attributes
|
47 |
-
* @param string $content
|
48 |
-
* @return string Output html
|
49 |
-
*/
|
50 |
-
function su_tabs( $atts, $content ) {
|
51 |
-
$GLOBALS['tab_count'] = 0;
|
52 |
|
53 |
-
|
|
|
|
|
54 |
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
$panes[] = '<div class="su-tabs-pane">' . $tab['content'] . '</div>';
|
59 |
-
}
|
60 |
-
$return = '<div class="su-tabs"><div class="su-tabs-nav">' . implode( '', $tabs ) . '</div><div class="su-tabs-panes">' . implode( "\n", $panes ) . '</div></div>';
|
61 |
}
|
62 |
-
return $return;
|
63 |
-
}
|
64 |
-
|
65 |
-
/**
|
66 |
-
* Shortcode: tab
|
67 |
-
*
|
68 |
-
* @param array $atts Shortcode attributes
|
69 |
-
* @param string $content
|
70 |
-
* @return string Output html
|
71 |
-
*/
|
72 |
-
function su_tab( $atts, $content ) {
|
73 |
-
extract( shortcode_atts( array( 'title' => 'Tab %d' ), $atts ) );
|
74 |
-
$x = $GLOBALS['tab_count'];
|
75 |
-
$GLOBALS['tabs'][$x] = array( 'title' => sprintf( $title, $GLOBALS['tab_count'] ), 'content' => do_shortcode( $content ) );
|
76 |
-
$GLOBALS['tab_count']++;
|
77 |
-
}
|
78 |
-
|
79 |
-
/**
|
80 |
-
* Shortcode: spoiler
|
81 |
-
*
|
82 |
-
* @param array $atts Shortcode attributes
|
83 |
-
* @param string $content
|
84 |
-
* @return string Output html
|
85 |
-
*/
|
86 |
-
function su_spoiler_shortcode( $atts, $content = null ) {
|
87 |
-
extract( shortcode_atts( array(
|
88 |
-
'title' => __( 'Spoiler title', 'shortcodes-ultimate' )
|
89 |
-
), $atts ) );
|
90 |
-
|
91 |
-
return '<div class="su-spoiler su-spoiler-open"><div class="su-spoiler-title">' . $title . '</div><div class="su-spoiler-content">' . do_shortcode( $content ) . '</div></div>';
|
92 |
-
}
|
93 |
-
|
94 |
-
/**
|
95 |
-
* Shortcode: divider
|
96 |
-
*
|
97 |
-
* @param array $atts Shortcode attributes
|
98 |
-
* @param string $content
|
99 |
-
* @return string Output html
|
100 |
-
*/
|
101 |
-
function su_divider_shortcode( $atts, $content = null ) {
|
102 |
-
extract( shortcode_atts( array(
|
103 |
-
'top' => false
|
104 |
-
), $atts ) );
|
105 |
-
|
106 |
-
return ( $top ) ? '<div class="su-divider"><a href="#">' . __( 'Top', 'shortcodes-ultimate' ) . '</a></div>' : '<div class="su-divider"></div>';
|
107 |
-
}
|
108 |
|
109 |
-
|
110 |
-
|
111 |
-
*
|
112 |
-
* @param array $atts Shortcode attributes
|
113 |
-
* @param string $content
|
114 |
-
* @return string Output html
|
115 |
-
*/
|
116 |
-
function su_spacer_shortcode( $atts, $content = null ) {
|
117 |
-
extract( shortcode_atts( array(
|
118 |
-
'size' => 0
|
119 |
-
), $atts ) );
|
120 |
-
|
121 |
-
return '<div class="su-spacer" style="height:' . $size . 'px"></div>';
|
122 |
-
}
|
123 |
-
|
124 |
-
/**
|
125 |
-
* Shortcode: highlight
|
126 |
-
*
|
127 |
-
* @param array $atts Shortcode attributes
|
128 |
-
* @param string $content
|
129 |
-
* @return string Output html
|
130 |
-
*/
|
131 |
-
function su_highlight_shortcode( $atts, $content = null ) {
|
132 |
-
extract( shortcode_atts( array(
|
133 |
-
'bg' => '#df9',
|
134 |
-
'color' => '#000'
|
135 |
-
), $atts ) );
|
136 |
-
|
137 |
-
return '<span class="su-highlight" style="background:' . $bg . ';color:' . $color . '"> ' . $content . ' </span>';
|
138 |
-
}
|
139 |
-
|
140 |
-
/**
|
141 |
-
* Shortcode: column
|
142 |
-
*
|
143 |
-
* @param array $atts Shortcode attributes
|
144 |
-
* @param string $content
|
145 |
-
* @return string Output html
|
146 |
-
*/
|
147 |
-
function su_column_shortcode( $atts, $content = null ) {
|
148 |
-
extract( shortcode_atts( array(
|
149 |
-
'size' => '1-2',
|
150 |
-
'last' => false
|
151 |
-
), $atts ) );
|
152 |
-
|
153 |
-
return ( $last ) ? '<div class="su-column su-column-' . $size . ' su-column-last">' . do_shortcode( $content ) . '</div><div class="su-spacer su-spacer-20"></div>' : '<div class="su-column su-column-' . $size . '">' . do_shortcode( $content ) . '</div>';
|
154 |
-
}
|
155 |
|
156 |
-
|
157 |
-
|
158 |
-
*
|
159 |
-
* @param array $atts Shortcode attributes
|
160 |
-
* @param string $content
|
161 |
-
* @return string Output html
|
162 |
-
*/
|
163 |
-
function su_list_shortcode( $atts, $content = null ) {
|
164 |
-
extract( shortcode_atts( array(
|
165 |
-
'style' => 'star'
|
166 |
-
), $atts ) );
|
167 |
|
168 |
-
|
169 |
-
|
|
|
|
|
170 |
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
*/
|
178 |
-
function su_quote_shortcode( $atts, $content = null ) {
|
179 |
-
extract( shortcode_atts( array(
|
180 |
-
'style' => 1
|
181 |
-
), $atts ) );
|
182 |
|
183 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
184 |
}
|
185 |
|
186 |
-
|
187 |
-
* Shortcode: pullquote
|
188 |
-
*
|
189 |
-
* @param array $atts Shortcode attributes
|
190 |
-
* @param string $content
|
191 |
-
* @return string Output html
|
192 |
-
*/
|
193 |
-
function su_pullquote_shortcode( $atts, $content = null ) {
|
194 |
-
extract( shortcode_atts( array(
|
195 |
-
'style' => 1,
|
196 |
-
'align' => 'left'
|
197 |
-
), $atts ) );
|
198 |
-
|
199 |
-
return '<div class="su-pullquote su-pullquote-style-' . $style . ' su-pullquote-align-' . $align . '">' . do_shortcode( $content ) . '</div>';
|
200 |
-
}
|
201 |
|
202 |
/**
|
203 |
-
*
|
204 |
*
|
205 |
-
* @
|
206 |
-
* @param string $content
|
207 |
-
* @return string Output html
|
208 |
*/
|
209 |
-
function
|
210 |
-
|
211 |
-
|
212 |
-
'color' => '#aaa',
|
213 |
-
'dark' => false,
|
214 |
-
'square' => false,
|
215 |
-
'style' => 1,
|
216 |
-
'size' => 2
|
217 |
-
), $atts ) );
|
218 |
-
|
219 |
-
$styles = array(
|
220 |
-
'border_radius' => ( $square ) ? 0 : $size + 2,
|
221 |
-
'dark_color' => su_hex_shift( $color, 'darker', 20 ),
|
222 |
-
'light_color' => su_hex_shift( $color, 'lighter', 70 ),
|
223 |
-
'size' => round( ( $size + 9 ) * 1.3 ),
|
224 |
-
'text_color' => ( $dark ) ? su_hex_shift( $color, 'darker', 70 ) : su_hex_shift( $color, 'lighter', 90 ),
|
225 |
-
'text_shadow' => ( $dark ) ? su_hex_shift( $color, 'lighter', 50 ) : su_hex_shift( $color, 'darker', 20 ),
|
226 |
-
'text_shadow_position' => ( $dark ) ? '1px 1px' : '-1px -1px',
|
227 |
-
'padding_v' => ( $size * 2 ) + 2,
|
228 |
-
'padding_h' => ( $size * 5 ) + 5
|
229 |
-
);
|
230 |
-
|
231 |
-
$link_styles = array(
|
232 |
-
'background-color' => $color,
|
233 |
-
'border' => '1px solid ' . $styles['dark_color'],
|
234 |
-
'border-radius' => $styles['border_radius'] . 'px',
|
235 |
-
'-moz-border-radius' => $styles['border_radius'] . 'px',
|
236 |
-
'-webkit-border-radius' => $styles['border_radius'] . 'px'
|
237 |
-
);
|
238 |
-
|
239 |
-
$span_styles = array(
|
240 |
-
'color' => $styles['text_color'],
|
241 |
-
'padding' => $styles['padding_v'] . 'px ' . $styles['padding_h'] . 'px',
|
242 |
-
'font-size' => $styles['size'] . 'px',
|
243 |
-
'height' => $styles['size'] . 'px',
|
244 |
-
'line-height' => $styles['size'] . 'px',
|
245 |
-
'border-top' => '1px solid ' . $styles['light_color'],
|
246 |
-
'text-transform' => 'uppercase',
|
247 |
-
'border-radius' => $styles['border_radius'] . 'px',
|
248 |
-
'text-shadow' => $styles['text_shadow_position'] . ' 0 ' . $styles['text_shadow'],
|
249 |
-
'-moz-border-radius' => $styles['border_radius'] . 'px',
|
250 |
-
'-moz-text-shadow' => $styles['text_shadow_position'] . ' 0 ' . $styles['text_shadow'],
|
251 |
-
'-webkit-border-radius' => $styles['border_radius'] . 'px',
|
252 |
-
'-webkit-text-shadow' => $styles['text_shadow_position'] . ' 0 ' . $styles['text_shadow']
|
253 |
-
);
|
254 |
-
|
255 |
-
foreach ( $link_styles as $link_rule => $link_value ) {
|
256 |
-
$link_style .= $link_rule . ':' . $link_value . ';';
|
257 |
}
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
}
|
262 |
-
|
263 |
-
return '<a href="' . $link . '" class="su-button su-button-style-' . $style . '" style="' . $link_style . '"><span style="' . $span_style . '">' . $content . '</span></a>';
|
264 |
}
|
265 |
|
266 |
/**
|
267 |
-
*
|
268 |
*
|
269 |
-
* @
|
270 |
-
* @return string Output html
|
271 |
*/
|
272 |
-
function
|
273 |
-
|
274 |
-
'link' => '#',
|
275 |
-
'color' => 'black'
|
276 |
-
), $atts ) );
|
277 |
-
|
278 |
-
return '<a class="su-fancy-link su-fancy-link-' . $color . '" href="' . $link . '">' . $content . '</a>';
|
279 |
}
|
280 |
|
281 |
/**
|
282 |
-
* Shortcode
|
283 |
*
|
284 |
-
* @
|
285 |
-
* @param string $content
|
286 |
-
* @return string Output html
|
287 |
*/
|
288 |
-
function
|
289 |
-
|
290 |
-
|
291 |
-
'icon' => su_plugin_url() . '/images/service.png',
|
292 |
-
'size' => 32
|
293 |
-
), $atts ) );
|
294 |
-
|
295 |
-
return '<div class="su-service"><div class="su-service-title" style="padding:' . round( ( $size - 16 ) / 2 ) . 'px 0 ' . round( ( $size - 16 ) / 2 ) . 'px ' . ( $size + 15 ) . 'px"><img src="' . $icon . '" width="' . $size . '" height="' . $size . '" alt="' . $title . '" /> ' . $title . '</div><div class="su-service-content" style="padding:0 0 0 ' . ( $size + 15 ) . 'px">' . do_shortcode( $content ) . '</div></div>';
|
296 |
}
|
297 |
|
298 |
/**
|
299 |
-
*
|
300 |
-
*
|
301 |
-
* @param array $atts Shortcode attributes
|
302 |
-
* @param string $content
|
303 |
-
* @return string Output html
|
304 |
*/
|
305 |
-
function
|
306 |
-
|
307 |
-
'color' => '#333',
|
308 |
-
'title' => __( 'This is box title', 'shortcodes-ultimate' )
|
309 |
-
), $atts ) );
|
310 |
-
|
311 |
-
$styles = array(
|
312 |
-
'dark_color' => su_hex_shift( $color, 'darker', 20 ),
|
313 |
-
'light_color' => su_hex_shift( $color, 'lighter', 60 ),
|
314 |
-
'text_shadow' => su_hex_shift( $color, 'darker', 70 ),
|
315 |
-
);
|
316 |
-
|
317 |
-
return '<div class="su-box" style="border:1px solid ' . $styles['dark_color'] . '"><div class="su-box-title" style="background-color:' . $color . ';border-top:1px solid ' . $styles['light_color'] . ';text-shadow:1px 1px 0 ' . $styles['text_shadow'] . '">' . $title . '</div><div class="su-box-content">' . do_shortcode( $content ) . '</div></div>';
|
318 |
}
|
319 |
|
320 |
/**
|
321 |
-
*
|
322 |
*
|
323 |
-
* @param array $atts Shortcode attributes
|
324 |
* @param string $content
|
325 |
-
* @return string
|
326 |
-
*/
|
327 |
-
function su_note_shortcode( $atts, $content = null ) {
|
328 |
-
extract( shortcode_atts( array(
|
329 |
-
'color' => '#fc0'
|
330 |
-
), $atts ) );
|
331 |
-
|
332 |
-
$styles = array(
|
333 |
-
'dark_color' => su_hex_shift( $color, 'darker', 10 ),
|
334 |
-
'light_color' => su_hex_shift( $color, 'lighter', 20 ),
|
335 |
-
'extra_light_color' => su_hex_shift( $color, 'lighter', 80 ),
|
336 |
-
'text_color' => su_hex_shift( $color, 'darker', 70 )
|
337 |
-
);
|
338 |
-
|
339 |
-
return '<div class="su-note" style="background-color:' . $styles['light_color'] . ';border:1px solid ' . $styles['dark_color'] . '"><div class="su-note-shell" style="border:1px solid ' . $styles['extra_light_color'] . ';color:' . $styles['text_color'] . '">' . do_shortcode( $content ) . '</div></div>';
|
340 |
-
}
|
341 |
-
|
342 |
-
/**
|
343 |
-
* Plugin initialization
|
344 |
*/
|
345 |
-
function
|
346 |
-
|
347 |
-
// Make plugin available for tramslation
|
348 |
-
load_plugin_textdomain( 'shortcodes-ultimate', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
349 |
-
|
350 |
-
/**
|
351 |
-
* Returns current plugin version.
|
352 |
-
*
|
353 |
-
* @return string Plugin version
|
354 |
-
*/
|
355 |
-
function su_get_version() {
|
356 |
-
if ( !function_exists( 'get_plugins' ) ) {
|
357 |
-
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
358 |
-
}
|
359 |
-
$plugin_folder = get_plugins( '/' . plugin_basename( dirname( __FILE__ ) ) );
|
360 |
-
$plugin_file = basename( ( __FILE__ ) );
|
361 |
-
return $plugin_folder[$plugin_file]['Version'];
|
362 |
-
}
|
363 |
-
|
364 |
-
/**
|
365 |
-
* Returns current plugin url.
|
366 |
-
*
|
367 |
-
* @return string Plugin url
|
368 |
-
*/
|
369 |
-
function su_plugin_url() {
|
370 |
-
return plugins_url( basename( __FILE__, '.php' ), dirname( __FILE__ ) );
|
371 |
-
}
|
372 |
-
|
373 |
-
/**
|
374 |
-
* Color shift a hex value by a specific percentage factor
|
375 |
-
*
|
376 |
-
* @param string $supplied_hex Any valid hex value. Short forms e.g. #333 accepted.
|
377 |
-
* @param string $shift_method How to shift the value e.g( +,up,lighter,>)
|
378 |
-
* @param integer $percentage Percentage in range of [0-100] to shift provided hex value by
|
379 |
-
* @return string shifted hex value
|
380 |
-
* @version 1.0 2008-03-28
|
381 |
-
*/
|
382 |
-
function su_hex_shift( $supplied_hex, $shift_method, $percentage = 50 ) {
|
383 |
-
$shifted_hex_value = null;
|
384 |
-
$valid_shift_option = FALSE;
|
385 |
-
$current_set = 1;
|
386 |
-
$RGB_values = array( );
|
387 |
-
$valid_shift_up_args = array( 'up', '+', 'lighter', '>' );
|
388 |
-
$valid_shift_down_args = array( 'down', '-', 'darker', '<' );
|
389 |
-
$shift_method = strtolower( trim( $shift_method ) );
|
390 |
-
|
391 |
-
// Check Factor
|
392 |
-
if ( !is_numeric( $percentage ) || ($percentage = ( int ) $percentage) < 0 || $percentage > 100 ) {
|
393 |
-
trigger_error( "Invalid factor", E_USER_ERROR );
|
394 |
-
}
|
395 |
-
|
396 |
-
// Check shift method
|
397 |
-
foreach ( array( $valid_shift_down_args, $valid_shift_up_args ) as $options ) {
|
398 |
-
foreach ( $options as $method ) {
|
399 |
-
if ( $method == $shift_method ) {
|
400 |
-
$valid_shift_option = !$valid_shift_option;
|
401 |
-
$shift_method = ( $current_set === 1 ) ? '+' : '-';
|
402 |
-
break 2;
|
403 |
-
}
|
404 |
-
}
|
405 |
-
++$current_set;
|
406 |
-
}
|
407 |
-
|
408 |
-
if ( !$valid_shift_option ) {
|
409 |
-
trigger_error( "Invalid shift method", E_USER_ERROR );
|
410 |
-
}
|
411 |
-
|
412 |
-
// Check Hex string
|
413 |
-
switch ( strlen( $supplied_hex = ( str_replace( '#', '', trim( $supplied_hex ) ) ) ) ) {
|
414 |
-
case 3:
|
415 |
-
if ( preg_match( '/^([0-9a-f])([0-9a-f])([0-9a-f])/i', $supplied_hex ) ) {
|
416 |
-
$supplied_hex = preg_replace( '/^([0-9a-f])([0-9a-f])([0-9a-f])/i', '\\1\\1\\2\\2\\3\\3', $supplied_hex );
|
417 |
-
} else {
|
418 |
-
trigger_error( "Invalid hex value", E_USER_ERROR );
|
419 |
-
}
|
420 |
-
break;
|
421 |
-
case 6:
|
422 |
-
if ( !preg_match( '/^[0-9a-f]{2}[0-9a-f]{2}[0-9a-f]{2}$/i', $supplied_hex ) ) {
|
423 |
-
trigger_error( "Invalid hex value", E_USER_ERROR );
|
424 |
-
}
|
425 |
-
break;
|
426 |
-
default:
|
427 |
-
trigger_error( "Invalid hex length", E_USER_ERROR );
|
428 |
-
}
|
429 |
-
|
430 |
-
// Start shifting
|
431 |
-
$RGB_values['R'] = hexdec( $supplied_hex{0} . $supplied_hex{1} );
|
432 |
-
$RGB_values['G'] = hexdec( $supplied_hex{2} . $supplied_hex{3} );
|
433 |
-
$RGB_values['B'] = hexdec( $supplied_hex{4} . $supplied_hex{5} );
|
434 |
-
|
435 |
-
foreach ( $RGB_values as $c => $v ) {
|
436 |
-
switch ( $shift_method ) {
|
437 |
-
case '-':
|
438 |
-
$amount = round( ((255 - $v) / 100) * $percentage ) + $v;
|
439 |
-
break;
|
440 |
-
case '+':
|
441 |
-
$amount = $v - round( ($v / 100) * $percentage );
|
442 |
-
break;
|
443 |
-
default:
|
444 |
-
trigger_error( "Oops. Unexpected shift method", E_USER_ERROR );
|
445 |
-
}
|
446 |
-
|
447 |
-
$shifted_hex_value .= $current_value = (
|
448 |
-
strlen( $decimal_to_hex = dechex( $amount ) ) < 2
|
449 |
-
) ? '0' . $decimal_to_hex : $decimal_to_hex;
|
450 |
-
}
|
451 |
|
452 |
-
|
453 |
-
}
|
454 |
-
|
455 |
-
/**
|
456 |
-
* Disable auto-formatting for shortcodes
|
457 |
-
*
|
458 |
-
* @param string $content
|
459 |
-
* @return string Formatted content with clean shortcodes content
|
460 |
-
*/
|
461 |
-
function su_custom_formatter( $content ) {
|
462 |
-
$new_content = '';
|
463 |
-
|
464 |
-
// Matches the contents and the open and closing tags
|
465 |
-
$pattern_full = '{(\[raw\].*?\[/raw\])}is';
|
466 |
-
|
467 |
-
// Matches just the contents
|
468 |
-
$pattern_contents = '{\[raw\](.*?)\[/raw\]}is';
|
469 |
-
|
470 |
-
// Divide content into pieces
|
471 |
-
$pieces = preg_split( $pattern_full, $content, -1, PREG_SPLIT_DELIM_CAPTURE );
|
472 |
-
|
473 |
-
// Loop over pieces
|
474 |
-
foreach ( $pieces as $piece ) {
|
475 |
-
|
476 |
-
// Look for presence of the shortcode
|
477 |
-
if ( preg_match( $pattern_contents, $piece, $matches ) ) {
|
478 |
-
|
479 |
-
// Append to content (no formatting)
|
480 |
-
$new_content .= $matches[1];
|
481 |
-
} else {
|
482 |
-
|
483 |
-
// Format and append to content
|
484 |
-
$new_content .= wptexturize( wpautop( $piece ) );
|
485 |
-
}
|
486 |
-
}
|
487 |
-
|
488 |
-
return $new_content;
|
489 |
-
}
|
490 |
-
|
491 |
-
// Enable shortcodes in widgets
|
492 |
-
add_filter( 'widget_text', 'do_shortcode' );
|
493 |
-
|
494 |
-
if ( get_option( 'su_disable_custom_formatting' ) != 'on' ) {
|
495 |
-
|
496 |
-
// Disable WordPress native formatters
|
497 |
-
remove_filter( 'the_content', 'wpautop' );
|
498 |
-
remove_filter( 'the_content', 'wptexturize' );
|
499 |
-
|
500 |
-
// Apply custom formatter function
|
501 |
-
add_filter( 'the_content', 'su_custom_formatter', 99 );
|
502 |
-
add_filter( 'widget_text', 'su_custom_formatter', 99 );
|
503 |
-
}
|
504 |
|
|
|
|
|
505 |
|
506 |
-
//
|
507 |
-
|
508 |
|
509 |
-
|
510 |
-
|
511 |
-
wp_register_style( 'shortcodes-ultimate', su_plugin_url() . '/css/style.css', false, su_get_version(), 'all' );
|
512 |
-
wp_register_script( 'shortcodes-ultimate', su_plugin_url() . '/js/init.js', false, su_get_version(), false );
|
513 |
|
514 |
-
//
|
515 |
-
|
516 |
-
wp_enqueue_script( 'jquery' );
|
517 |
-
wp_enqueue_script( 'shortcodes-ultimate' );
|
518 |
-
}
|
519 |
-
|
520 |
-
// Add shortcodes
|
521 |
-
add_shortcode( 'heading', 'su_heading_shortcode' );
|
522 |
-
add_shortcode( 'frame', 'su_frame_shortcode' );
|
523 |
-
add_shortcode( 'tabs', 'su_tabs' );
|
524 |
-
add_shortcode( 'tab', 'su_tab' );
|
525 |
-
add_shortcode( 'spoiler', 'su_spoiler_shortcode' );
|
526 |
-
add_shortcode( 'divider', 'su_divider_shortcode' );
|
527 |
-
add_shortcode( 'spacer', 'su_spacer_shortcode' );
|
528 |
-
add_shortcode( 'quote', 'su_quote_shortcode' );
|
529 |
-
add_shortcode( 'pullquote', 'su_pullquote_shortcode' );
|
530 |
-
add_shortcode( 'highlight', 'su_highlight_shortcode' );
|
531 |
-
add_shortcode( 'button', 'su_button_shortcode' );
|
532 |
-
add_shortcode( 'fancy_link', 'su_fancy_link_shortcode' );
|
533 |
-
add_shortcode( 'service', 'su_service_shortcode' );
|
534 |
-
add_shortcode( 'box', 'su_box_shortcode' );
|
535 |
-
add_shortcode( 'note', 'su_note_shortcode' );
|
536 |
-
add_shortcode( 'list', 'su_list_shortcode' );
|
537 |
-
add_shortcode( 'column', 'su_column_shortcode' );
|
538 |
-
|
539 |
-
/**
|
540 |
-
* Register administration page
|
541 |
-
*/
|
542 |
-
function shortcodes_ultimate_add_admin() {
|
543 |
-
add_options_page( __( 'Shortcodes', 'shortcodes-ultimate' ), __( 'Shortcodes', 'shortcodes-ultimate' ), 'manage_options', 'shortcodes-ultimate', 'shortcodes_ultimate_admin_page' );
|
544 |
-
}
|
545 |
-
|
546 |
-
/**
|
547 |
-
* Administration page
|
548 |
-
*/
|
549 |
-
function shortcodes_ultimate_admin_page() {
|
550 |
-
?>
|
551 |
-
|
552 |
-
<style type="text/css">
|
553 |
-
#su-top-message {
|
554 |
-
margin: 20px 20px 10px 0;
|
555 |
-
padding: 5px 15px;
|
556 |
-
border: 1px solid #E6DB55;
|
557 |
-
background: #FFFFE0;
|
558 |
-
border-radius: 3px;
|
559 |
-
}
|
560 |
-
.su-new-shortcode td {
|
561 |
-
background: #ffd;
|
562 |
-
}
|
563 |
-
</style>
|
564 |
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
<input type="text" value="http://ilovecode.ru/?p=122" size="27" onclick="this.select();" />
|
569 |
-
<a href="http://facebook.com/sharer.php?u=http://ilovecode.ru/?p=122" title="<?php _e( 'Share on Facebook', 'shortcodes-ultimate' ); ?>" target="_blank">
|
570 |
-
<img src="<?php echo su_plugin_url(); ?>/images/social/facebook_16.png" title="<?php _e( 'Share on Facebook', 'shortcodes-ultimate' ); ?>" style="margin-bottom:-3px" />
|
571 |
-
</a>
|
572 |
-
<a href="http://twitter.com/home?status=Shortcodes%20Ultimate%20http://ilovecode.ru/?p=122" title="<?php _e( 'Share on Twitter', 'shortcodes-ultimate' ); ?>" target="_blank">
|
573 |
-
<img src="<?php echo su_plugin_url(); ?>/images/social/twitter_16.png" title="<?php _e( 'Share on Twitter', 'shortcodes-ultimate' ); ?>" style="margin-bottom:-3px" />
|
574 |
-
</a>
|
575 |
-
</p>
|
576 |
-
<p>
|
577 |
-
<a href="http://wordpress.org/tags/shortcodes-ultimate?forum_id=10" target="_blank"><?php _e( 'Support forum', 'shortcodes-ultimate' ); ?></a> |
|
578 |
-
<a href="http://twitter.com/gn_themes" target="_blank"><?php _e( 'Twitter', 'shortcodes-ultimate' ); ?></a> |
|
579 |
-
<a href="http://ilovecode.ru/?p=122#commentform" target="_blank" style="color:red"><?php _e( 'Bug report', 'shortcodes-ultimate' ); ?></a>
|
580 |
-
</p>
|
581 |
-
</div>
|
582 |
|
583 |
-
|
584 |
-
|
585 |
-
update_option( 'su_disable_custom_formatting', $_POST['su_disable_custom_formatting'] );
|
586 |
-
echo '<div class="updated"><p><strong>' . __( 'Settings saved', 'shortcodes-ultimate' ) . '</strong></p></div>';
|
587 |
}
|
588 |
-
|
589 |
-
$checked = ( get_option( 'su_disable_custom_formatting' ) == 'on' ) ? ' checked="checked"' : '';
|
590 |
-
?>
|
591 |
-
<!-- .wrap -->
|
592 |
-
<div class="wrap">
|
593 |
-
<h2><?php _e( 'Shortcodes ultimate settings', 'shortcodes-ultimate' ); ?></h2>
|
594 |
-
<form action="" method="post">
|
595 |
-
<p><label><input type="checkbox" name="su_disable_custom_formatting" <?php echo $checked; ?> /> <?php _e( 'Disable custom formatting', 'shortcodes-ultimate' ); ?></label></p>
|
596 |
-
<p><input type="submit" value="<?php _e( 'Save settings', 'shortcodes-ultimate' ); ?>" class="button-primary" /></p>
|
597 |
-
<input type="hidden" name="save" value="true" />
|
598 |
-
</form>
|
599 |
-
<h2><?php _e( 'Available shortcodes', 'shortcodes-ultimate' ); ?></h2>
|
600 |
-
<table class="widefat fixed" style="width:700px;margin-bottom:20px">
|
601 |
-
<tr>
|
602 |
-
<th width="100"><?php _e( 'Shortcode', 'shortcodes-ultimate' ); ?></th>
|
603 |
-
<th width="200"><?php _e( 'Parameters', 'shortcodes-ultimate' ); ?></th>
|
604 |
-
<th><?php _e( 'Usage', 'shortcodes-ultimate' ); ?></th>
|
605 |
-
</tr>
|
606 |
-
<tr>
|
607 |
-
<td>heading</td>
|
608 |
-
<td>—</td>
|
609 |
-
<td>[heading] <?php _e( 'Content', 'shortcodes-ultimate' ); ?> [/heading]</td>
|
610 |
-
</tr>
|
611 |
-
<tr>
|
612 |
-
<td>frame</td>
|
613 |
-
<td>align="left|center|none|right"</td>
|
614 |
-
<td>[frame align="center"] <img src="image.jpg" alt="" /> [/frame]</td>
|
615 |
-
</tr>
|
616 |
-
<tr>
|
617 |
-
<td>tabs, tab</td>
|
618 |
-
<td>title</td>
|
619 |
-
<td>[tabs] [tab title="<?php _e( 'Tab name', 'shortcodes-ultimate' ); ?>"] <?php _e( 'Tab content', 'shortcodes-ultimate' ); ?> [/tab] [/tabs]</td>
|
620 |
-
</tr>
|
621 |
-
<tr>
|
622 |
-
<td>spoiler</td>
|
623 |
-
<td>title</td>
|
624 |
-
<td>[spoiler title="<?php _e( 'Spoiler title', 'shortcodes-ultimate' ); ?>"] <?php _e( 'Hidden text', 'shortcodes-ultimate' ); ?> [/spoiler]</td>
|
625 |
-
</tr>
|
626 |
-
<tr>
|
627 |
-
<td>divider</td>
|
628 |
-
<td>top (<?php _e( 'optional', 'shortcodes-ultimate' ); ?>)</td>
|
629 |
-
<td>[divider top="1"]</td>
|
630 |
-
</tr>
|
631 |
-
<tr>
|
632 |
-
<td>spacer</td>
|
633 |
-
<td>size</td>
|
634 |
-
<td>[spacer size="20"]</td>
|
635 |
-
</tr>
|
636 |
-
<tr>
|
637 |
-
<td>quote</td>
|
638 |
-
<td>—</td>
|
639 |
-
<td>[quote] <?php _e( 'Content', 'shortcodes-ultimate' ); ?> [/quote]</td>
|
640 |
-
</tr>
|
641 |
-
<tr>
|
642 |
-
<td>pullquote</td>
|
643 |
-
<td>align="left|right"</td>
|
644 |
-
<td>[pullquote align="left"] <?php _e( 'Content', 'shortcodes-ultimate' ); ?> [/pullquote]</td>
|
645 |
-
</tr>
|
646 |
-
<tr>
|
647 |
-
<td>highlight</td>
|
648 |
-
<td>bg="#HEX"<br/>color="#HEX"</td>
|
649 |
-
<td>[highlight bg="#fc0" color="#000"] <?php _e( 'Content', 'shortcodes-ultimate' ); ?> [/highlight]</td>
|
650 |
-
</tr>
|
651 |
-
<tr>
|
652 |
-
<td>button</td>
|
653 |
-
<td>link<br/>color="#HEX"<br/>size="1-10"<br/>style="1|2"<br/>dark (<?php _e( 'optional', 'shortcodes-ultimate' ); ?>)<br/>square (<?php _e( 'optional', 'shortcodes-ultimate' ); ?>)</td>
|
654 |
-
<td>[button link="#" color="#b00" size="3" style="2" dark="1" square="1"] <?php _e( 'Button text', 'shortcodes-ultimate' ); ?> [/button]</td>
|
655 |
-
</tr>
|
656 |
-
<tr class="su-new-shortcode">
|
657 |
-
<td>fancy_link</td>
|
658 |
-
<td>color="black|white"<br/>link</td>
|
659 |
-
<td>[fancy_link color="black" link="http://example.com/"] <?php _e( 'Read more', 'shortcodes-ultimate' ); ?> [/fancy_link]</td>
|
660 |
-
</tr>
|
661 |
-
<tr>
|
662 |
-
<td>service</td>
|
663 |
-
<td>title<br/>icon (<?php _e( 'image url', 'shortcodes-ultimate' ); ?>)<br/>size (<?php _e( 'icon size', 'shortcodes-ultimate' ); ?>)</td>
|
664 |
-
<td>[service title="<?php _e( 'Service name', 'shortcodes-ultimate' ); ?>" icon="images/service-1.png" size="32"] <?php _e( 'Service description', 'shortcodes-ultimate' ); ?> [/service]</td>
|
665 |
-
</tr>
|
666 |
-
<tr>
|
667 |
-
<td>box</td>
|
668 |
-
<td>title<br/>color="#HEX"</td>
|
669 |
-
<td>[box title="<?php _e( 'Box title', 'shortcodes-ultimate' ); ?>" color="#f00"] <?php _e( 'Content', 'shortcodes-ultimate' ); ?> [/box]</td>
|
670 |
-
</tr>
|
671 |
-
<tr>
|
672 |
-
<td>note</td>
|
673 |
-
<td>color="#HEX"</td>
|
674 |
-
<td>[note color="#D1F26D"] <?php _e( 'Content', 'shortcodes-ultimate' ); ?> [/note]</td>
|
675 |
-
</tr>
|
676 |
-
<tr>
|
677 |
-
<td>list</td>
|
678 |
-
<td>style="star|arrow|check|cross"</td>
|
679 |
-
<td>[list style="check"] <ul> <li> <?php _e( 'List item', 'shortcodes-ultimate' ); ?> </li> </ul> [/list]</td>
|
680 |
-
</tr>
|
681 |
-
<tr>
|
682 |
-
<td>column</td>
|
683 |
-
<td>size="1-2|1-3|1-4|1-5|1-6|2-3|3-4|2-5|3-5|4-5|5-6"<br/>last (<?php _e( 'add this to last columns', 'shortcodes-ultimate' ); ?>)</td>
|
684 |
-
<td>[column size="1-2"] <?php _e( 'Content', 'shortcodes-ultimate' ); ?> [/column]<br/>[column size="1-2" last="1"] <?php _e( 'Content', 'shortcodes-ultimate' ); ?> [/column]</td>
|
685 |
-
</tr>
|
686 |
-
</table>
|
687 |
-
</div>
|
688 |
-
<!-- /.wrap -->
|
689 |
-
<?php
|
690 |
-
}
|
691 |
-
|
692 |
-
/**
|
693 |
-
* Hook to translate plugin information
|
694 |
-
*/
|
695 |
-
function su_add_locale_strings() {
|
696 |
-
$strings = __( 'Shortcodes Ultimate', 'shortcodes-ultimate' ) . __( 'Vladimir Anokhin', 'shortcodes-ultimate' ) . __( 'Provides support for many easy to use shortcodes', 'shortcodes-ultimate' );
|
697 |
}
|
698 |
|
|
|
699 |
}
|
700 |
-
|
701 |
-
add_action( 'admin_menu', 'shortcodes_ultimate_add_admin' );
|
702 |
-
add_action( 'init', 'su_plugin_init' );
|
703 |
?>
|
1 |
<?php
|
2 |
+
|
3 |
/*
|
4 |
Plugin Name: Shortcodes Ultimate
|
5 |
Plugin URI: http://ilovecode.ru/?p=122
|
6 |
+
Version: 1.5.0
|
7 |
Author: Vladimir Anokhin
|
8 |
Author URI: http://ilovecode.ru/
|
9 |
Description: Provides support for many easy to use shortcodes
|
10 |
Text Domain: shortcodes-ultimate
|
11 |
Domain Path: /languages
|
12 |
+
License: GPL2
|
13 |
*/
|
14 |
|
15 |
/**
|
16 |
+
* Plugin initialization
|
|
|
|
|
|
|
|
|
17 |
*/
|
18 |
+
function su_plugin_init() {
|
|
|
|
|
|
|
19 |
|
20 |
+
// Make plugin available for tramslation
|
21 |
+
load_plugin_textdomain( 'shortcodes-ultimate', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
22 |
|
23 |
+
// Load libs
|
24 |
+
require_once( dirname( __FILE__ ) . '/lib/admin.php' );
|
25 |
+
require_once( dirname( __FILE__ ) . '/lib/color.php' );
|
26 |
+
require_once( dirname( __FILE__ ) . '/lib/csv.php' );
|
27 |
+
require_once( dirname( __FILE__ ) . '/lib/media.php' );
|
28 |
+
require_once( dirname( __FILE__ ) . '/lib/shortcodes.php' );
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
+
// Enable shortcodes in text widgets
|
31 |
+
add_filter( 'widget_text', 'do_shortcode' );
|
32 |
|
33 |
+
// Enable auto-formatting
|
34 |
+
if ( get_option( 'su_disable_custom_formatting' ) != 'on' ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
+
// Disable WordPress native formatters
|
37 |
+
remove_filter( 'the_content', 'wpautop' );
|
38 |
+
remove_filter( 'the_content', 'wptexturize' );
|
39 |
|
40 |
+
// Apply custom formatter function
|
41 |
+
add_filter( 'the_content', 'su_custom_formatter', 99 );
|
42 |
+
add_filter( 'widget_text', 'su_custom_formatter', 99 );
|
|
|
|
|
|
|
43 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
|
45 |
+
// Fix for large posts, http://core.trac.wordpress.org/ticket/8553
|
46 |
+
@ini_set( 'pcre.backtrack_limit', 500000 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
|
48 |
+
// Register and enqueue styles and scripts
|
49 |
+
if ( !is_admin() ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
|
51 |
+
// Register
|
52 |
+
wp_register_style( 'shortcodes-ultimate', su_plugin_url() . '/css/style.css', false, su_get_version(), 'all' );
|
53 |
+
wp_register_script( 'shortcodes-ultimate', su_plugin_url() . '/js/init.js', false, su_get_version(), false );
|
54 |
+
wp_register_script( 'jwplayer', su_plugin_url() . '/js/jwplayer.js', false, su_get_version(), false );
|
55 |
|
56 |
+
// Enqueue
|
57 |
+
wp_enqueue_style( 'shortcodes-ultimate' );
|
58 |
+
wp_enqueue_script( 'jquery' );
|
59 |
+
wp_enqueue_script( 'jwplayer' );
|
60 |
+
wp_enqueue_script( 'shortcodes-ultimate' );
|
61 |
+
}
|
|
|
|
|
|
|
|
|
|
|
62 |
|
63 |
+
// Register shortcodes
|
64 |
+
add_shortcode( su_compatibility_mode_prefix() . 'heading', 'su_heading_shortcode' );
|
65 |
+
add_shortcode( su_compatibility_mode_prefix() . 'frame', 'su_frame_shortcode' );
|
66 |
+
add_shortcode( su_compatibility_mode_prefix() . 'tabs', 'su_tabs' );
|
67 |
+
add_shortcode( su_compatibility_mode_prefix() . 'tab', 'su_tab' );
|
68 |
+
add_shortcode( su_compatibility_mode_prefix() . 'spoiler', 'su_spoiler_shortcode' );
|
69 |
+
add_shortcode( su_compatibility_mode_prefix() . 'divider', 'su_divider_shortcode' );
|
70 |
+
add_shortcode( su_compatibility_mode_prefix() . 'spacer', 'su_spacer_shortcode' );
|
71 |
+
add_shortcode( su_compatibility_mode_prefix() . 'quote', 'su_quote_shortcode' );
|
72 |
+
add_shortcode( su_compatibility_mode_prefix() . 'pullquote', 'su_pullquote_shortcode' );
|
73 |
+
add_shortcode( su_compatibility_mode_prefix() . 'highlight', 'su_highlight_shortcode' );
|
74 |
+
add_shortcode( su_compatibility_mode_prefix() . 'button', 'su_button_shortcode' );
|
75 |
+
add_shortcode( su_compatibility_mode_prefix() . 'fancy_link', 'su_fancy_link_shortcode' );
|
76 |
+
add_shortcode( su_compatibility_mode_prefix() . 'service', 'su_service_shortcode' );
|
77 |
+
add_shortcode( su_compatibility_mode_prefix() . 'box', 'su_box_shortcode' );
|
78 |
+
add_shortcode( su_compatibility_mode_prefix() . 'note', 'su_note_shortcode' );
|
79 |
+
add_shortcode( su_compatibility_mode_prefix() . 'list', 'su_list_shortcode' );
|
80 |
+
add_shortcode( su_compatibility_mode_prefix() . 'column', 'su_column_shortcode' );
|
81 |
+
add_shortcode( su_compatibility_mode_prefix() . 'media', 'su_media_shortcode' );
|
82 |
+
add_shortcode( su_compatibility_mode_prefix() . 'table', 'su_table_shortcode' );
|
83 |
}
|
84 |
|
85 |
+
add_action( 'init', 'su_plugin_init' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
|
87 |
/**
|
88 |
+
* Returns current plugin version.
|
89 |
*
|
90 |
+
* @return string Plugin version
|
|
|
|
|
91 |
*/
|
92 |
+
function su_get_version() {
|
93 |
+
if ( !function_exists( 'get_plugins' ) ) {
|
94 |
+
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
}
|
96 |
+
$plugin_folder = get_plugins( '/' . plugin_basename( dirname( __FILE__ ) ) );
|
97 |
+
$plugin_file = basename( ( __FILE__ ) );
|
98 |
+
return $plugin_folder[$plugin_file]['Version'];
|
|
|
|
|
|
|
99 |
}
|
100 |
|
101 |
/**
|
102 |
+
* Returns current plugin url
|
103 |
*
|
104 |
+
* @return string Plugin url
|
|
|
105 |
*/
|
106 |
+
function su_plugin_url() {
|
107 |
+
return plugins_url( basename( __FILE__, '.php' ), dirname( __FILE__ ) );
|
|
|
|
|
|
|
|
|
|
|
108 |
}
|
109 |
|
110 |
/**
|
111 |
+
* Shortcode names prefix in compatibility mode
|
112 |
*
|
113 |
+
* @return string Special prefix
|
|
|
|
|
114 |
*/
|
115 |
+
function su_compatibility_mode_prefix() {
|
116 |
+
$prefix = ( get_option( 'su_compatibility_mode' ) == 'on' ) ? 'gn_' : '';
|
117 |
+
return $prefix;
|
|
|
|
|
|
|
|
|
|
|
118 |
}
|
119 |
|
120 |
/**
|
121 |
+
* Hook to translate plugin information
|
|
|
|
|
|
|
|
|
122 |
*/
|
123 |
+
function su_add_locale_strings() {
|
124 |
+
$strings = __( 'Shortcodes Ultimate', 'shortcodes-ultimate' ) . __( 'Vladimir Anokhin', 'shortcodes-ultimate' ) . __( 'Provides support for many easy to use shortcodes', 'shortcodes-ultimate' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
}
|
126 |
|
127 |
/**
|
128 |
+
* Disable auto-formatting for shortcodes
|
129 |
*
|
|
|
130 |
* @param string $content
|
131 |
+
* @return string Formatted content with clean shortcodes content
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
132 |
*/
|
133 |
+
function su_custom_formatter( $content ) {
|
134 |
+
$new_content = '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
|
136 |
+
// Matches the contents and the open and closing tags
|
137 |
+
$pattern_full = '{(\[raw\].*?\[/raw\])}is';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
|
139 |
+
// Matches just the contents
|
140 |
+
$pattern_contents = '{\[raw\](.*?)\[/raw\]}is';
|
141 |
|
142 |
+
// Divide content into pieces
|
143 |
+
$pieces = preg_split( $pattern_full, $content, -1, PREG_SPLIT_DELIM_CAPTURE );
|
144 |
|
145 |
+
// Loop over pieces
|
146 |
+
foreach ( $pieces as $piece ) {
|
|
|
|
|
147 |
|
148 |
+
// Look for presence of the shortcode
|
149 |
+
if ( preg_match( $pattern_contents, $piece, $matches ) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
|
151 |
+
// Append to content (no formatting)
|
152 |
+
$new_content .= $matches[1];
|
153 |
+
} else {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
|
155 |
+
// Format and append to content
|
156 |
+
$new_content .= wptexturize( wpautop( $piece ) );
|
|
|
|
|
157 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
}
|
159 |
|
160 |
+
return $new_content;
|
161 |
}
|
|
|
|
|
|
|
162 |
?>
|