1 2if(typeof g_ugFunctions != "undefined") 3 try { g_ugFunctions.registerTheme("slider"); } catch (ex) { console.log(ex.message); } 4else 5 jQuery(document).ready(function () { try { g_ugFunctions.registerTheme("slider") } catch (ex) { console.log(ex.message); } }); 6 7 8/** 9 * Slider gallery theme 10 */ 11function UGTheme_slider(){ 12 13 var t = this; 14 var g_gallery = new UniteGalleryMain(), g_objGallery, g_objects, g_objWrapper; 15 var g_objThumbs, g_objSlider; 16 var g_functions = new UGFunctions(); 17 18 19 //theme options 20 var g_options = { 21 22 }; 23 24 25 var g_defaults = { 26 gallery_autoplay: true, 27 28 slider_scale_mode:"fill", 29 slider_controls_always_on:true, 30 slider_enable_text_panel:false, 31 slider_controls_appear_ontap: true, //appear controls on tap event on touch devices 32 slider_enable_bullets: true, 33 slider_enable_arrows: true, 34 slider_enable_play_button: false, 35 slider_enable_fullscreen_button:false, 36 slider_enable_zoom_panel: false, 37 slider_vertical_scroll_ondrag: true 38 }; 39 40 41 /** 42 * init 43 */ 44 this.init = function(gallery, customOptions){ 45 46 g_gallery = gallery; 47 48 g_options = jQuery.extend(g_options, g_defaults); 49 g_options = jQuery.extend(g_options, customOptions); 50 51 //set gallery options 52 g_gallery.setOptions(g_options); 53 54 g_gallery.initSlider(g_options); 55 56 g_objects = gallery.getObjects(); 57 58 //get some objects for local use 59 g_objGallery = jQuery(gallery); 60 g_objWrapper = g_objects.g_objWrapper; 61 g_objSlider = g_objects.g_objSlider; 62 } 63 64 65 /** 66 * set gallery html elements 67 */ 68 function setHtml(){ 69 70 //add html elements 71 g_objWrapper.addClass("ug-theme-slider"); 72 73 //set slider html 74 if(g_objSlider) 75 g_objSlider.setHtml(); 76 } 77 78 79 /** 80 * place the slider according the thumbs panel size and position 81 */ 82 function placeSlider(){ 83 84 var sliderHeight = g_gallery.getHeight(); 85 var sliderWidth = g_gallery.getWidth(); 86 87 g_objSlider.setSize(sliderWidth, sliderHeight); 88 g_objSlider.setPosition(0, 0); 89 } 90 91 92 93 /** 94 * on gallery size change - resize the theme. 95 */ 96 function onSizeChange(){ 97 98 placeSlider(); 99 100 } 101 102 103 /** 104 * init buttons functionality and events 105 */ 106 function initEvents(){ 107 108 g_objGallery.on(g_gallery.events.SIZE_CHANGE,onSizeChange); 109 //g_objGallery.on(g_gallery.events.ITEM_CHANGE,onItemChange); 110 } 111 112 /** 113 * init all the theme's elements and set them to their places 114 * according gallery's dimentions. 115 * this function should work on resize too. 116 */ 117 function initAndPlaceElements(){ 118 placeSlider(); 119 g_objSlider.run(); 120 121 } 122 123 /** 124 * run the theme setting 125 */ 126 this.run = function(){ 127 128 setHtml(); 129 130 initAndPlaceElements(); 131 132 initEvents(); 133 } 134 135 136}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.