Hi,
I am using a pop-up feature of JCE Editor on the site to show a jpg. from a live camera.
To avoid that images from cache are shown in the popup - the support told me to integrate a script:
jQuery(document).ready(function($) {
WfMediabox.Plugin.add('image', function () {
this.type = "image";
// create image html (leave src blank)
this.html = function (data) {
// add time to the url to prevent caching...
data.src += '?' + new Date().getTime();
var $img = $('<img src="' + data.src + '" class="wf-mediabox-img" alt="' + decodeURIComponent(data.alt || data.title || "") + '" tabindex="0" />');
if (data.params) {
$.each(data.params, function (name, value) {
$img.attr(name, value);
});
}
return $img;
};
this.is = function (data) {
var src = data.src;
// remove query to test extension
src = src.split('?')[0];
return /image\/?/.test(data.type) || /\.(jpg|jpeg|png|gif|bmp|tif|webp)$/i.test(src);
};
});
});
I tried to put this script into the Template Style/ Global Settings / Custom Code / before head:
-> did not work this way, shows the script on frontend.
Question:
Is it possible to place a script there at all?
If yes - what have I done wrong?
If no - what is the easiest way to integrate the script on the website?
Thanks