Rails-based website for local business
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

0 lines
8.1 KiB

  1. (function(c){var b=function(){if(!("id" in arguments.callee)){arguments.callee.id=0}return"ugallery_"+arguments.callee.id++};var a=function(d){if(!("cache" in arguments.callee)){arguments.callee.cache={}}if(!(d in arguments.callee.cache)){arguments.callee.cache[d]=new Image();arguments.callee.cache[d].src=d}};c.fn.ugallery=function(f){var e={fade_duration:1200,forward_btn:"right.gif",backward_btn:"left.gif",controls_vpos:150,animate_controls:true,control_fade_duration:300,controls_fade_from:0.2,controls_fade_to:0.7,player:true,play_btn:"play.png",stop_btn:"stop.png",play_vpos:-1,hide_controls:true,show_duration:5000,autostart:false,hide_playbtn_on_mout:true,desc_pos:"top",desc_bg_color:"#000",desc_bg_opacity:0.6,desc_align:"right",desc_height:20,desc_custom_class:null,desc_custom_callback:null,counter_enabled:false,counter_pos:"top",counter_align:"left",counter_custom_class:null,counter_custom_callback:null,counter_height:-1,show_thumb:false,thumb_position:"right",thumb_bg:"filmv.gif",thumb_img_width:90,thumb_img_height:60,thumb_pnl_width:130,thumb_pnl_opacity:0.6,thumb_img_opacity:0.2,thumb_img_fade_from:0.4,thumb_img_fade_to:1};var d=c.extend(e,f);return this.each(function(){var g=c(this);var h=g.find("a");var G="#"+g.attr("id");var H=b();var R=b();var l=b();var m=b();var E=b();var P=b();var B=b();var K=b();var r=b();var x=b();var v=b();var I=g.find("div.collection img");var w=b();var t,s;var y;var z=function(){c(G+" .view_pointer_0").removeClass("view_pointer_0");c(G+" .view_pointer_next").removeClass("view_pointer_next");c(G+" .view_pointer_prev").removeClass("view_pointer_prev")};var A=function(){for(var S=0;S<h.length;S++){if(c(h[S]).hasClass("view_pointer_0")){return S}}return -1};var J=function(){var S=A();return c(h[(S==0?h.length-1:S-1)])};var q=function(){var S=A();return c(h[(S==(h.length-1)?0:S+1)])};var M=function(S){z();c(h[S]).addClass("view_pointer_0");c(h[S==0?h.length-1:S-1]).addClass("view_pointer_prev");c(h[S==(h.length-1)?0:S+1]).addClass("view_pointer_next")};var k=function(){a(c(G+" .view_pointer_next").attr("href"));a(c(G+" .view_pointer_prev").attr("href"))};var p=function(V){var U=this;if("mutex" in U&&U.mutex){return}U.mutex=true;var T=c("#"+H).css("opacity")==0?("#"+H):("#"+R);var S=T=="#"+H?("#"+R):("#"+H);c(T).attr("src",c(V).attr("href"));c(S).animate({opacity:0},d.fade_duration/2,function(){c(T).animate({opacity:1},d.fade_duration/2,function(){U.mutex=false})})};var O=function(S){p(S?G+" .view_pointer_next":G+" .view_pointer_prev");var T=h.length;var U=S?1:T-1;M((A()+U)%h.length);Q();if(d.counter_enabled){C()}k()};var Q=function(){var S=c(G+" .view_pointer_0").attr("title");c("#"+K).text(S);if(d.desc_custom_callback){d.desc_custom_callback(A())}};var C=function(){var S=A()+1;var T=h.length;c("#"+v).text(S+"/"+T);if(d.counter_custom_callback){d.counter_custom_callback(S-1)}};var i=false;var D=function(){i=!i;if(i){c("#"+E).css("display","none");c("#"+P).css("display","block");O(true);setTimeout(N,d.show_duration);j(false)}else{c("#"+E).css("display","block");c("#"+P).css("display","none");j(true)}};var N=function(){if(i){O(true);setTimeout(N,d.show_duration);j(false)}else{j(true)}};var j=function(S){var T=S?"block":"none";c("#"+m+",#"+l).css("display",T)};var L=function(){c(G).css("height",g.css("height"));g.prepend('<div class="viewport"></div>');c(G+" div.viewport").css({width:g.css("width"),height:g.css("height"),position:"absolute",left:0,top:0});c(G+" div.viewport").prepend('<img id="'+H+'" class="aniview" />\n<img id="'+R+'" class="aniview" />\n<img id="'+m+'" src="'+d.forward_btn+'" />\n<img id="'+l+'" src="'+d.backward_btn+'" />\n<img id="'+E+'" src="'+d.play_btn+'" />\n<img id="'+P+'" src="'+d.stop_btn+'" />\n<div id="'+B+'" class="ug_desc_outer"><div id="'+K+'" class="ug_desc_inner'+(d.desc_custom_class?(" "+d.desc_custom_class):"")+'"></div></div>\n<div id="'+r+'" class="ug_desc_black"></div>\n<div id="'+x+'" class="ug_counter_outer"><div id="'+v+'" class="ug_counter_inner'+(d.counter_custom_class?(" "+d.counter_custom_class):"")+'"></div></div>\n');c("#"+H+",#"+R).css({positio