var xaraSwidgets_imageGallerySimple_v11Templates = { entry: '
").text(lines[t]).html();
}
return lines.join("
");
}
function xaraSwidgets_imageGallerySimple_v11GetConfig(value, d)
{
var ret = parseInt(value);
if(!isNaN(ret))
{
return ret;
}
else
{
return d;
}
}
// this is the constructor for a component
// it loops through each 'entry' in the array of data and compiles the entry template for it
// it then applies the resulting HTML to the main template before writing the whole lot to the div on the page
// it then initialises the actual jquery plugin for the div (that now contains the required HTML as a result of writing the template to it)
function xaraSwidgets_imageGallerySimple_v11Constructor(divID, data)
{
var entryHTML = '';
var cachedImage = ''; // image caching
// var entryHTML2 = '';
// timeout = (data[0].pause);
// speed = (data[0].speed);
// panelTrans = (data[0].trans);
myCols = (data[0].cols);
myBorder = (data[0].border);
myShadowTrans = (data[0].trans);
myShadowDim = (data[0].shadowdim);
myShadowBlur = (data[0].shadowblur);
myRotation = (data[0].rotation);
myPopupSize = (data[0].popupsize);
var config = data[0];
// set the effect to be applied when hovering over the thumbs
var useTransition = xaraSwidgets_imageGallerySimple_v11GetConfig(config.effect, 0);
var effects = [
'popup',
'scale',
'rotate',
'shake',
'swing',
'tada'
];
var effectName = effects[useTransition];
//console.log(effectName)
var fileFolder = 'index_htm_files';
$('script').each(function() {
var src = $(this).attr('src');
if(src)
{
var parts = src.split('/');
if(parts[1]=='imageGallerySimple_v11_conf.js')
{
fileFolder = parts[0];
}
}
});
//window.hs = window.simpleGalleryHighslide;
window.hs2.outlineType=fileFolder + "/sgcustoms";
window.hs2.addSlideshow({slideshowGroup: divID, interval: 5000,repeat: true,useControls: true,fixedControls: 'fit',overlayOptions: {className: 'controls-in-heading',opacity: '0.75',position: 'bottom center',offsetX: '0',offsetY: '-10',hideOnMouseOut: true}});
// xaraSwidgets_simpleGalleryInit(divID, data);
// loop through each entry in the array and compile the entry template for it
for(var i=1; i
')
this.addedBR = true;
}
}
}
},$('.' + divID +'_gallery li').css('display', 'list-item'));
if (document.createElement("detect").style.textShadow === "") // check to see if text shadow is supported
//if(!$.browser.msie || ($.browser.msie && document.documentMode>=10))
//if($.browser.msie && document.documentMode && document.documentMode <=9)
{
$('.' + divID +'_gallery li').css({
'-moz-transition':'all 0.6s ease',
'-webkit-transition':'all 0.6s ease',
'-o-transition':'all 0.6s ease',
'transition':'all 0.6s ease',
'opacity':'1'
});
};
$('.jp-first').css('font-weight','bold')
$('.jp-previous').css('font-weight','bold')
$('.jp-next').css('font-weight','bold')
$('.jp-last').css('font-weight','bold')
})
//if($.browser.msie && document.documentMode && document.documentMode ==9)
// detecting ie9
if (document.all && document.querySelector && document.addEventListener && !window.atob)
{ // ie 9
$('.' + divID +'_gallery li').css({
'opacity':'1'
});
if (effectName !='popup')
{
// $('.' + divID +'_image').click(function () {return false;});
// $('.' + divID +'_image').css('cursor','default');
}
if (effectName =='popup')
{
}
else if (effectName =='rotate')
{
// $('.' + divID +'_image').css('cursor','default');
$('.' + divID +'_image').hover(
function () {
$(this).animate({scale: '+=0.4', rotate: ''+rotation+'deg'}, {queue: true, duration: 600});
$(this).closest('li').animate({opacity:1});
$(this).closest('li').css({'z-index':'2'});
},
function () {
$(this).animate({scale: '-=0.4', rotate: '0deg'}, {queue: true, duration: 600});
$(this).closest('li').animate({opacity:1});
$(this).closest('li').css({'z-index':'0'});
}
);
}
else
{
// $('.' + divID +'_image').css('cursor','default');
$('.' + divID +'_image').hover(
function () {
$(this).animate({scale: '+=0.4'}, {queue: true, duration: 600});
$(this).closest('li').animate({opacity:1});
$(this).closest('li').css({'z-index':'2'});
},
function () {
$(this).animate({scale: '-=0.4'}, {queue: true, duration: 600});
$(this).closest('li').animate({opacity:1});
$(this).closest('li').css({'z-index':'0'});
}
);
}
$('.' + divID +'_image').css({
'-webkit-box-shadow': shadowCSS,
'-moz-box-shadow': shadowCSS,
'box-shadow': shadowCSS
});
}
//if($.browser.msie && document.documentMode && document.documentMode <=8)
if(document.all && !document.addEventListener) // better check for <=IE8
{ // Test if CSS transitions are supported
$(window).load(function() {
var imgWidth = $('.' + divID +'_col').width();
var imgHeight = $('.' + divID +'_col').height();
$('.' + divID +'_imagepulse').css({
'height': ''+imgHeight+'px',
'width': ''+imgWidth+'px'
});
$('.' + divID +'_col').css({'height': ''+imgHeight+'px'}) // set height
// set the height to see if it fixes camelot preview
// console.log('dimension inside ' +imgWidth +'&'+imgHeight);
// $('.' + divID +'_col').css('padding-bottom', ''+imgHeight+'px') // set space between each row
$('.' + divID +'_image').css('max-width','' ); // remove the max-width as this breaks the fallback
if (effectName!='popup')
{
// $('.' + divID +'_image').css('cursor','default');
$('.' + divID +'_image').hoverpulse({speed: 600}); // call js fallback pulse
// $('.' + divID +'_image').click(function () {return false;});
}
// set shadows for <=ie8
$('head').append("" );
});
}
}