if(typeof g_ugFunctions != "undefined")
g_ugFunctions.registerTheme("default");
else
jQuery(document).ready(function(){g_ugFunctions.registerTheme("default")});
/**
* Default gallery theme
*/
function UGTheme_default(){
var t = this;
var g_gallery = new UniteGalleryMain(), g_objGallery, g_objects, g_objWrapper;
var g_objButtonFullscreen, g_objButtonPlay, g_objButtonHidePanel;
var g_objSlider, g_objPanel, g_objStripPanel, g_objTextPanel;
var g_functions = new UGFunctions();
//theme options
var g_options = {
theme_load_slider:true, //this option for debugging only
theme_load_panel:true, //this option for debugging only
theme_enable_fullscreen_button: true, //show, hide the theme fullscreen button. The position in the theme is constant
theme_enable_play_button: true, //show, hide the theme play button. The position in the theme is constant
theme_enable_hidepanel_button: true, //show, hide the hidepanel button
theme_enable_text_panel: true, //enable the panel text panel.
theme_text_padding_left: 20, //left padding of the text in the textpanel
theme_text_padding_right: 5, //right paddin of the text in the textpanel
theme_text_align: "left", //left, center, right - the align of the text in the textpanel
theme_text_type: "description", //title, description, both - text that will be shown on the text panel, title or description or both
theme_hide_panel_under_width: 480, //hide panel under certain browser width, if null, don't hide
strippanel_enable_handle : false, //hide strippanel tip in this theme
};
//default item options:
var g_defaults = {
//slider options:
slider_controls_always_on: true,
slider_zoompanel_align_vert: "top",
slider_zoompanel_offset_vert: 12,
//textpanel options:
slider_textpanel_padding_top: 0,
slider_textpanel_enable_title: false,
slider_textpanel_enable_description: true,
slider_vertical_scroll_ondrag: true,
//strippanel options
strippanel_background_color:"#232323",
strippanel_padding_top:10
};
//options that could not be changed by user
var g_mustOptions = {
slider_enable_text_panel: false,
slider_enable_play_button:false,
slider_enable_fullscreen_button: false,
//text panel options
slider_enable_text_panel: false,
slider_textpanel_height: 50,
slider_textpanel_align:"top",
};
var g_temp = {
isPanelHidden: false
};
/**
* init the theme
*/
function initTheme(gallery, customOptions){
g_gallery = gallery;
g_options = jQuery.extend(g_options, g_defaults);
g_options = jQuery.extend(g_options, customOptions);
g_options = jQuery.extend(g_options, g_mustOptions);
modifyOptions();
//set gallery options
g_gallery.setOptions(g_options);
//include gallery elements
if(g_options.theme_load_panel == true){
g_objStripPanel = new UGStripPanel();
g_objStripPanel.init(gallery, g_options);
}
if(g_options.theme_load_slider == true)
g_gallery.initSlider(g_options);
g_objects = gallery.getObjects();
//get some objects for local use
g_objGallery = jQuery(gallery);
g_objWrapper = g_objects.g_objWrapper;
if(g_options.theme_load_slider == true)
g_objSlider = g_objects.g_objSlider;
//init text panel
if(g_options.theme_enable_text_panel == true){
g_objTextPanel = new UGTextPanel();
g_objTextPanel.init(g_gallery, g_options, "slider");
}
}
/**
* run the theme
*/
function runTheme(){
setHtml();
initAndPlaceElements();
initEvents();
}
/**
* modify some options before implimenting
*/
function modifyOptions(){
var moreOptions = {
slider_textpanel_css_title:{}, //additional css of the title
slider_textpanel_css_description:{} //additional css of the description
};
g_options = jQuery.extend(moreOptions, g_options);
g_options.slider_textpanel_css_title["text-align"] = g_options.theme_text_align;
g_options.slider_textpanel_css_description["text-align"] = g_options.theme_text_align;
switch(g_options.theme_text_type){
case "title":
g_options.slider_textpanel_enable_title = true;
g_options.slider_textpanel_enable_description = false;
break;
case "both":
g_options.slider_textpanel_enable_title = true;
g_options.slider_textpanel_enable_description = true;
break;
default:
case "description": //the description is the default
}
}
/**
* set gallery html elements
*/
function setHtml(){
//add html elements
g_objWrapper.addClass("ug-theme-default");
var htmlAdd = "";
//add panel
htmlAdd += "
";
var classButtonFullscreen = 'ug-default-button-fullscreen';
var classButtonPlay = 'ug-default-button-play';
var svgButtonPlay = '';
var classCaptureButtonFullscreen = '.ug-default-button-fullscreen';
var svgFullscreenButton = '';
var classCaptureButtonPlay = '.ug-default-button-play';
if(!g_objTextPanel){ //take the buttons from default theme
classButtonFullscreen = 'ug-default-button-fullscreen-single';
classButtonPlay = 'ug-default-button-play-single';
classCaptureButtonFullscreen = '.ug-default-button-fullscreen-single';
classCaptureButtonPlay = '.ug-default-button-play-single';
}
//add fullscreen button to the panel
if(g_options.theme_enable_fullscreen_button == true)
htmlAdd += "
" + svgFullscreenButton + "
";
//add play button to the panel
if(g_options.theme_enable_play_button == true)
htmlAdd += "