"+name_var;
+ dom.delay(100).append(dhtml);
+ $rss("#pic_"+pic.id).delay(100).fadeIn(200);
+
+ })
+ if(typeof callbackFn=="function")
+ callbackFn.call(this,json);
+ })
+
+
+ },
+
+//function to get url variables...
+getUrlVars : function(){
+ var vars = [], hash;
+ var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
+ for(var i = 0; i < hashes.length; i++){
+ hash = hashes[i].split('=');
+ vars.push(hash[0]);
+ vars[hash[0]] = hash[1];
+ }
+ if(vars[0] == window.location.href){
+ vars =[];
+ }
+ return vars;
+},
+/*function to open a modalwindow on a page.. self reliant no images, no css needed.
+settings
+
+width:in percentage or pixcel
+height:in percentage or pixcel
+closeBtn:true or false
+envClose:closing through background click, true or flase
+loadDiv:load html from a div
+loadPage:load a page
+loadHtml: load html
+
+*/
+modalWindow : function(settings,callbackFn){
+
+ var envClose = settings.envClose;
+ var dhtml="";
+ if(typeof envClose == "undefined")
+ envClose = true;
+ var closeBtn = settings.closeBtn;
+ if(typeof closeBtn == "undefined")
+ closeBtn = true;
+
+ var rgmaskHeight = $rss(window).height();
+ var rgmaskWidth = $rss(window).width();
+ var tempheight = settings.height;
+ var tempwidth = settings.width;
+
+ var maxheight = (rgmaskHeight*85)/100;
+ var maxwidth = (rgmaskWidth*85)/100;
+
+ if(typeof tempheight!="undefined"){
+ tempheight = tempheight.toString();
+ if(tempheight.charAt(tempheight.length-1)=='%')
+ tempheight=(rgmaskHeight*parseInt(tempheight.substr(0,tempheight.length)))/100;
+ if(tempheight>maxheight)
+ tempheight=maxheight;
+ }else{tempheight="auto";}
+ if(typeof tempwidth!="undefined"){
+ tempwidth = tempwidth.toString();
+ if(tempwidth.charAt(tempwidth.length-1)=='%')
+ tempwidth=(rgmaskWidth*parseInt(tempwidth.substr(0,tempwidth.length)))/100;
+ if(tempwidth>maxwidth)
+ tempwidth=maxwidth;
+ }else{tempwidth="auto";}
+ $rss("body").append('
');
+ $rss("#rgsheath").css({background: "#000", width: "100%", position: "fixed", top: 0, left: 0,opacity:0.5,'z-index':199});
+ $rss("body").append('
');
+ $rss("#rgWindow").css({"position": "fixed", "z-index": "999", "background": "#fff", "border": "solid 1px #ccc", "padding": "10px", "border-radius": "5px", "-webkit-border-radius": "5px", "-moz-border-radius": "5px", "-ms-border-radius": "5px", "box-shadow": "0 0 20px rgba(0,0,0,0.7)","-webkit-box-shadow": "0 0 20px rgba(0,0,0,0.7)","-moz-box-shadow": "0 0 20px rgba(0,0,0,0.7)","-ms-box-shadow": "0 0 20px rgba(0,0,0,0.7)"});
+ var rgWTop = (rgmaskHeight-20)/2;
+ var rgWLeft = (rgmaskWidth-20)/2;
+ $rss("#rgWindow").css({top:rgWTop+"px", left:rgWLeft+"px"});
+ if(typeof settings.loadDiv!="undefined"){
+ dhtml = $rss(settings.loadDiv).html();
+ $rss("#rgWindow").html(dhtml).hide();
+ prepareWindow();
+ }
+ if(typeof settings.loadHtml!="undefined"){
+ dhtml = settings.loadHtml;
+ $rss("#rgWindow").html(dhtml).hide();
+ prepareWindow();
+ }
+ if(typeof settings.loadPage!="undefined"){
+ $rss("#rgWindow").load(settings.loadPage,function(){$rss(this).hide();dhtml=$rss(this).html();prepareWindow();});
+ }
+ function prepareWindow(){
+ if(tempheight!="auto")
+ rgWTop = (rgmaskHeight-tempheight)/2;
+ else{
+ tempheight=$rss("#rgWindow").height()+30;
+ if(tempheight>maxheight)
+ tempheight=maxheight;
+ rgWTop=(rgmaskHeight-tempheight)/2;
+ }
+ if(tempwidth!="auto")
+ rgWLeft = (rgmaskWidth-tempwidth)/2;
+ else{
+ tempwidth=$rss("#rgWindow").width();
+ if(tempwidth>maxwidth)
+ tempwidth=maxwidth;
+ rgWLeft=(rgmaskWidth-tempwidth)/2;
+ }
+ tempwidth=parseInt(tempwidth)+25;
+ $rss("#rgWindow").empty().show();
+ var closebtn = "";
+ if(closeBtn)
+ closebtn='
X';
+ $rss("#rgWindow").animate({"width":tempwidth+"px","height":tempheight+"px",top:rgWTop+"px", left:rgWLeft+"px"},500,function(){$rss("#rgWindow").html(closebtn+"
"+dhtml+"
");
+ $rss("#close_modal").mouseover(function(){$rss(this).css("color","#999");}).mouseout(function(){$rss(this).css("color","#666");})
+ $rss("#close_modal").click(function(){rcom.modalWindowClose(); return false;})
+ if(envClose)
+ $rss("#rgsheath").click(function(){
+ rcom.modalWindowClose();
+ })
+ $rss(document).one("keydown",function(e){
+ if (e.keyCode == 27){
+ rcom.modalWindowClose();
+ return false;
+ }
+ })
+
+ if(typeof callbackFn=="function")
+ callbackFn.call(this,$rss("#rgWindow"));
+ });
+ }
+},
+modalWindowUpdate : function(settings,callbackFn){
+ var rgmaskHeight = $rss(window).height();
+ var rgmaskWidth = $rss(window).width();
+ var tempheight = settings.height;
+ var tempwidth = settings.width;
+ var dhtml = "";
+ var maxheight = (rgmaskHeight*85)/100;
+ var maxwidth = (rgmaskWidth*85)/100;
+ if(typeof tempheight!="undefined"){
+ tempheight = tempheight.toString();
+ if(tempheight.charAt(tempheight.length-1)=='%')
+ tempheight=(rgmaskHeight*parseInt(tempheight.substr(0,tempheight.length)))/100;
+ if(tempheight>maxheight)
+ tempheight=maxheight;
+ }else{tempheight="auto";}
+ if(typeof tempwidth!="undefined"){
+ tempwidth = tempwidth.toString();
+ if(tempwidth.charAt(tempwidth.length-1)=='%')
+ tempwidth=(rgmaskWidth*parseInt(tempwidth.substr(0,tempwidth.length)))/100;
+ if(tempwidth>maxwidth)
+ tempwidth=maxwidth;
+ }else{tempwidth="auto";};
+ $rss("body").append("
");
+
+ if(typeof settings.loadDiv!="undefined"){
+ dhtml = $rss("#"+settings.loadDiv).html();
+ $rss("#rgwindow_temp_div").html(dhtml).hide();
+ prepareWindow();
+ }
+ if(typeof settings.loadHtml!="undefined"){
+ dhtml = settings.loadHtml;
+ $rss("#rgwindow_temp_div").html(dhtml).hide();
+ prepareWindow();
+ }
+ if(typeof settings.loadPage!="undefined"){
+ $rss("#rgwindow_temp_div").load(settings.loadPage,function(){$rss(this).hide();dhtml=$rss(this).html();prepareWindow();});
+ }
+ function prepareWindow(){
+ if(tempheight!="auto")
+ rgWTop = (rgmaskHeight-tempheight)/2;
+ else{
+ tempheight=$rss("#rgwindow_temp_div").height()+30;
+ if(tempheight>maxheight)
+ tempheight=maxheight;
+ rgWTop=(rgmaskHeight-tempheight)/2;
+ }
+ if(tempwidth!="auto")
+ rgWLeft = (rgmaskWidth-tempwidth)/2;
+ else{
+ tempwidth=$rss("#rgwindow_temp_div").width();
+ if(tempwidth>maxwidth)
+ tempwidth=maxwidth;
+ rgWLeft=(rgmaskWidth-tempwidth)/2;
+ }
+ tempwidth=parseInt(tempwidth)+25;
+ $rss("#rgContent").empty();
+ $rss("#rgWindow").animate({"width":tempwidth+"px","height":tempheight+"px",top:rgWTop+"px", left:rgWLeft+"px"},500,function(){$rss("#rgContent").css("height",tempheight+"px").html(dhtml)});
+ $rss("#rgwindow_temp_div").remove();
+ }
+},
+modalWindowClose : function(callbackFn){
+ if($rss("#rgWindow").length>0){
+ $rss("#rgWindow").empty();
+ var rgmaskHeight = $rss(window).height();
+ var rgmaskWidth = $rss(window).width();
+ var x = (rgmaskHeight-20)/2;
+ var y = (rgmaskWidth-20)/2
+ $rss("#rgWindow").animate({top:x+"px", left:y+"px","width":"50px","height":"50px"},300,function(){$rss(this).fadeOut(100).remove();$rss("#rgsheath").fadeOut(500).remove();})
+ }
+ if(typeof callbackFn=="function")
+ callbackFn.call(this,"harry");
+},
+bindDomToHead : function(dom){
+ var gc = dom.css("background");
+ var t = dom.offset();
+ var gw = dom.width();
+ $rss(window).scroll(function(){
+ var wt = $rss(window).scrollTop();
+ if ( wt > t.top ) {
+ var cssObj = {
+ 'position':'fixed',
+ 'top':0,
+ 'width':gw,
+ 'background':gc,
+ 'box-shadow':'0 1px 0 rgba(0,0,0,0.2)',
+ 'z-index':99
+ }
+ dom.css(cssObj);
+ } else {
+ dom.attr('style',"");
+ }
+ });
+},
+progressBar : function(dom,settings){
+ var domid = dom.prop("id");
+ if($rss("#rss_progressbar_div_"+domid).length==0){
+ if(typeof settings.top == "undefined")
+ settings.value = 1;
+ if(typeof settings.top == "undefined")
+ settings.top = (dom.height()-12)/2;
+ dom.append("");
+ $rss("#rss_progressbar_div_"+domid).fadeIn(500);
+ }
+},
+progressBarValue : function(dom,value){
+ var domid = dom.prop("id");
+ if($rss("#rss_progressbar_div_"+domid).length==1){
+ $rss("#rss_progressbar_"+domid).animate({"width":value+"%"},100);
+
+ }
+},
+progressBarClose : function(dom){
+ var domid = dom.prop("id");
+ $rss("#rss_progressbar_div_"+domid).fadeOut(500,function(){$(this).remove();});
+},
+getInternetExplorerVersion: function(){
+ var rv = -1; // Return value assumes failure.
+ if (navigator.appName == 'Microsoft Internet Explorer')
+ {
+ var ua = navigator.userAgent;
+ var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
+ if (re.exec(ua) != null)
+ rv = parseFloat( RegExp.$1 );
+ }
+ return rv;
+ }
+}
+$ = jQuery.noConflict();
diff --git a/custom_gallery/app/assets/javascripts/theater-widget.js b/custom_gallery/app/assets/javascripts/theater-widget.js
new file mode 100644
index 0000000..0f00043
--- /dev/null
+++ b/custom_gallery/app/assets/javascripts/theater-widget.js
@@ -0,0 +1,536 @@
+var CustomGalleryTheaterWidget = function(widget){
+ var parent_divs = widget,
+ parent_div_z_index = parent_divs.eq(parent_divs.length-1).css('z-index')
+ parent_divs.eq(parent_divs.length-1).css('z-index','2000')
+ var gt = this,
+ currentPic = {},
+ windowHeight = 0,
+ windowWidth = 0,
+ swipeController = null,
+ resizing = null;
+ loadingInterval = null,
+ mainPicLoading = 0,
+ nextPicLoading = 0,
+ prevPicLoading = 0,
+ currentSwipeImageDom = null,
+ currentSwipeImageDomLeftPos = 0,
+ windowScreenThresholdForTouch = 0,
+ loadingProcess = 0;
+ gt.stage = null;
+ gt.stripNextBtn = null;
+ gt.stripPrevBtn = null;
+ gt.thumbToggle = null;
+ gt.descriptionToggle = null;
+ gt.closeBtn = null;
+ gt.imageContainer = null;
+ gt.custom_albumData = {};
+ gt.loader = null;
+ gt.thumbStrip = null;
+ gt.descriptionArea = null;
+ gt.isTheaterInitialized = false;
+
+ var play_flag = false;
+ var button_left_string = '
',
+ button_right_string = '
',
+ button_play_string = '
',
+ button_stop_string = '
',
+ playtimeoutID;
+ var initialize = function(){
+ gt.stage = widget.find('#custom_gallery-theater-stage');
+ gt.closeBtn = gt.stage.find(".custom_gallery-close");
+ gt.switchBtn = gt.stage.find(".custom_gallery-theme-switch");
+ gt.imageContainer = gt.stage.find(".image-container");
+ gt.thumbStrip = gt.stage.find(".custom_gallery-thumb-wrap");
+ gt.thumbToggle = gt.stage.find(".custom_gallery-thumb-toggle");
+ gt.loader = gt.stage.find(".custom_gallery-loader");
+ gt.stripNextBtn = gt.stage.find(".custom_gallery-thumb-next");
+ gt.stripPrevBtn = gt.stage.find(".custom_gallery-thumb-prev");
+ gt.descriptionArea = gt.stage.find(".custom_gallery-img-desc");
+ gt.descriptionToggle = gt.stage.find(".custom_gallery-toggle-desc");
+ windowScreenThresholdForTouch = windowWidth / 3;
+ startLoading();
+ windowHeight = $(window).height();
+ windowWidth = $(window).width();
+ var addButton = function () {
+ widget.find('.theaterButton').remove();
+ if (!play_flag){
+ $(button_left_string+button_play_string+button_right_string).insertAfter(widget.find('img.gal-active'));
+ }
+ else{
+ $(button_left_string+button_stop_string+button_right_string).insertAfter(widget.find('img.gal-active'));
+ }
+ if (!widget.find(".gal-prev").length) { widget.find('#theaterPreviousButton').remove(); }
+ if (!widget.find(".gal-next").length) { widget.find('#theaterNextButton').remove(); }
+
+ widget.find('#theaterPreviousButton').click(function () {
+ gt.previousPic();
+ addButton()
+ });
+ widget.find('#theaterNextButton').click(function () {
+ gt.nextPic();
+ addButton()
+ });
+ widget.find('#theaterPlayButton').click(function () {
+ play_flag = true;
+ playtimeoutID = window.setInterval(function(){
+ gt.playallPic();
+ },3000)
+ addButton()
+ });
+ widget.find('#theaterStopButton').click(function () {
+ play_flag = false;
+ addButton()
+ window.clearInterval(playtimeoutID)
+ });
+ }
+ bindHandler();
+ gt.createTheater();
+
+ addButton();
+
+ }
+
+ var bindHandler = function(){
+ // handler to close the theater
+ gt.closeBtn.on("click",gt.destroyTheater);
+
+ // handler to show theater
+ widget.find("div[data-list=images] a").on("click",function(){
+ gt.createTheater();
+ return false;
+ })
+
+ gt.switchBtn.on("click",gt.switchTheme);
+ gt.descriptionToggle.on("click", gt.toggleDescription)
+ gt.stripPrevBtn.on("click", gt.scrollStripRight);
+ gt.stripNextBtn.on("click", gt.scrollStripLeft);
+
+ if(Modernizr.touch){
+ gt.imageContainer.swipe({
+ swipe : function(event, direction, distance, duration, fingerCount){
+ if(direction == "left"){
+ gt.nextPic();
+ }else if(direction == "right"){
+ gt.previousPic();
+ }
+ }
+ })
+ gt.thumbToggle.swipe({
+ swipe : function(event, direction, distance, duration, fingerCount){
+ if(direction == "up"){
+ gt.thumbStrip.parent().addClass("show");
+ gt.thumbToggle.addClass("up");
+ gt.thumbToggle.find("i").removeClass("fa-angle-double-up").addClass("fa-angle-double-down");
+ }else if(direction == "down"){
+ gt.thumbStrip.parent().removeClass("show");
+ gt.thumbToggle.removeClass("up");
+ gt.thumbToggle.find("i").removeClass("fa-angle-double-down").addClass("fa-angle-double-up");
+ }
+ }
+ })
+ }
+
+ //handler for window resize
+ $(window).resize(function(){
+ clearTimeout(resizing);
+ resizing = setTimeout(doneResizing,1000);
+ })
+ }
+
+ var bindKeyHandlers = function(){
+ if(!Modernizr.touch){
+ widget.on("click",".gal-active", gt.nextPic);
+ widget.on("click",".gal-prev", gt.previousPic);
+ widget.on("click",".gal-next", gt.nextPic);
+ $(document).on("keyup",function(e){
+ switch(e.keyCode){
+ case 39:
+ gt.nextPic();
+ break;
+ case 37:
+ gt.previousPic();
+ break;
+ case 27:
+ gt.destroyTheater();
+ break;
+ }
+ })
+ }
+ }
+
+
+ var doneResizing = function(){
+ windowHeight = $(window).height();
+ windowWidth = $(window).width();
+ setThumbNavs();
+ }
+
+ var unBindKeyHandlers = function(){
+ $(document).unbind("keyup");
+ }
+
+ gt.destroyTheater = function(){
+ parent_divs.eq(parent_divs.length-1).css('z-index',parent_div_z_index)
+ gt.stage.hide();
+ widget.removeClass("custom_gallery-mode-on");
+ gt.imageContainer.empty()
+ unBindKeyHandlers();
+ }
+
+ gt.createTheater = function(){
+ gt.stage.show();
+ widget.addClass("custom_gallery-mode-on");
+ bindKeyHandlers();
+ gt.isTheaterInitialized = false;
+ gt.custom_albumData = {}
+ gt.custom_albumData.images = $.map(widget.find('img.custom_gallery-thumb'),function(v){
+ var url = $(v).attr('data-link'),
+ theater_url = $(v).attr('data-theater-url'),
+ thumb_url = $(v).attr('src')
+ return {'url': url,
+ 'file': {'theater': {url: theater_url},
+ 'thumb': {url: thumb_url}
+ }
+ }
+ })
+ var cp = gt.custom_albumData.images[0];
+ currentPic = {"image" : cp, "index" : 0};
+ createThumbStrip();
+
+ currentPic = currentPic;
+ }
+
+ gt.hasNextImage = function(){
+ return (currentPic.index + 1) <= (gt.custom_albumData.images.length - 1);
+ }
+
+ gt.hasPreviousImage = function(){
+ return (currentPic.index > 0);
+ }
+
+ gt.nextPic = function(){
+ if(loadingProcess == 0){
+ if(gt.hasNextImage()){
+ startLoading();
+ currentPic.image = gt.custom_albumData.images[currentPic.index + 1];
+ currentPic.index = currentPic.index + 1;
+ setMainPic("next");
+ }
+ }
+ }
+ gt.playallPic = function(){
+ if(loadingProcess == 0){
+ mainPicLoading = 1;
+ nextPicLoading = 1;
+ prevPicLoading = 1;
+ if(gt.hasNextImage()){
+ currentPic.image = gt.custom_albumData.images[currentPic.index + 1];
+ currentPic.index = currentPic.index + 1;
+ setMainPic("next");
+ }
+ else{
+ currentPic.image = gt.custom_albumData.images[0];
+ currentPic.index = 0;
+ setMainPic();
+ gt.isTheaterInitialized = false;
+ setTimeout(function(){
+ loadingProcess = 0;
+ nextPicLoading = 0;
+ widget.find('.theaterButton').remove()
+ widget.find("img.custom_gallery-image.gal-prev.gal-inactive").remove();
+ img = widget.find("img.custom_gallery-image.gal-active");
+ img.eq(0).remove();
+ },100)
+ }
+ }
+ }
+
+
+ gt.previousPic = function(){
+ if(loadingProcess == 0){
+ if(gt.hasPreviousImage()) {
+ startLoading();
+ currentPic.image = gt.custom_albumData.images[currentPic.index - 1];
+ currentPic.index = currentPic.index - 1;
+ setMainPic("prev");
+ }
+ }
+ }
+
+ gt.scrollStripLeft = function(){
+ pixels_to_move = parseInt(gt.thumbStrip.css("left")) - (66 * 3);
+ maximum_pixels = (windowWidth / 2) - (66 * (gt.custom_albumData.images.length - 1));
+ if(pixels_to_move < maximum_pixels){
+ pixels_to_move = maximum_pixels;
+ }
+ gt.thumbStrip.css("left",pixels_to_move + "px");
+ }
+
+ gt.scrollStripRight = function(){
+ pixels_to_move = parseInt(gt.thumbStrip.css("left")) + (66 * 3);
+ maximum_pixels = (windowWidth / 2);
+ if(pixels_to_move > maximum_pixels){
+ pixels_to_move = maximum_pixels;
+ }
+ gt.thumbStrip.css("left",pixels_to_move + "px");
+ }
+
+
+ gt.switchTheme = function(){
+ var themeWhiteKlass = "theme-white",
+ nightKlass = "fa fa-circle",
+ dayKlass = "fa fa-circle-o",
+ $body = widget;
+
+ if (!gt.switchBtn.hasClass(themeWhiteKlass)) {
+ gt.switchBtn
+ .addClass(themeWhiteKlass)
+ .find("i")
+ .attr("class", dayKlass);
+
+ $body.addClass(themeWhiteKlass);
+
+ } else {
+ gt.switchBtn
+ .removeClass(themeWhiteKlass)
+ .find("i")
+ .attr("class", nightKlass);
+
+ $body.removeClass(themeWhiteKlass);
+
+ }
+ }
+
+ gt.toggleDescription = function(){
+ $(this).toggleClass("active");
+ gt.descriptionArea.toggleClass("active");
+ }
+
+ var startLoading = function(){
+ loadingProcess = 1;
+ mainPicLoading = 0;
+ nextPicLoading = 0;
+ prevPicLoading = 0;
+ gt.loader.show();
+ loadingInterval = setInterval(stopLoading, 300);
+
+ }
+
+ var stopLoading = function(){
+ if(mainPicLoading == 1 && nextPicLoading == 1 && prevPicLoading == 1){
+ clearInterval(loadingInterval);
+ setTimeout(function(){
+ loadingProcess = 0;
+ gt.loader.hide();
+ },100)
+ }
+ }
+
+ var createThumbStrip = function(){
+ if(!gt.isTheaterInitialized){
+ gt.thumbStrip.html('')
+ $.each(gt.custom_albumData.images,function(index, image){
+ var li = $("
"),
+ a = $("
"),
+ img = $("
");
+ a.on("click",function(){
+ startLoading();
+ var old_index = currentPic.index;
+ currentPic.image = gt.custom_albumData.images[index];
+ currentPic.index = index;
+ if(old_index > index){
+ setMainPic("prev",true);
+ }else if(old_index < index){
+ setMainPic("next",true);
+ }
+ return false;
+ })
+
+ img.attr("src",image.file.thumb.url);
+ img.attr("alt",image.alt_title);
+ li.attr("data-index",index);
+ a.append(img);
+ li.append(a);
+ gt.thumbStrip.append(li);
+ })
+ setThumbNavs();
+ }
+ setMainPic();
+ }
+
+
+ var setThumbNavs = function() {
+ var $thumbNav = gt.stage.find('.custom_gallery-thumb-navs'),
+ $thumb = gt.thumbStrip.find('img'),
+ thumbs = $thumb.length,
+ thumbWidth = $thumb.eq(0).width(),
+ thumbGap = parseInt($thumb.closest('li').css('margin-right'), 10),
+ widthSum = (thumbWidth + thumbGap) * thumbs,
+ margin = widthSum * 0.1,
+ totalWidth = widthSum + margin;
+
+ if (windowWidth < totalWidth) {
+ $thumbNav.addClass('show');
+ }else{
+ $thumbNav.removeClass('show');
+ }
+ };
+ function one_load(img){
+ if (img[0].complete){
+ setTimeout(loaded(img),100)
+ }else{
+ setTimeout(one_load,20)
+ }
+ }
+ function loaded(img){
+ calculateHeight(img);
+ mainPicLoading = 1;
+ img.fadeIn(100);
+ }
+ window.setMainPic = function(direction,selectedFromStrip){
+ var img = null;
+ widget.find('div.custom_gallery-show-original a').eq(0).attr('href',currentPic.image.url)
+ if(direction == null){
+ img = $("
");
+ img.hide();
+ img.attr("src", currentPic.image.file.theater.url);
+ gt.imageContainer.append(img);
+ img.one("load", function(){
+ one_load(img)
+ })
+ gt.isTheaterInitialized = true;
+ }else{
+ img = gt.imageContainer.find(".gal-active");
+ if(selectedFromStrip){
+ gt.imageContainer.find(".gal-" + direction).attr("src",currentPic.image.file.theater.url);
+ }
+ if(direction == "next"){
+ gt.imageContainer.find(".gal-prev").remove();
+ img.removeClass("gal-active").addClass("gal-prev gal-inactive temp");
+ gt.imageContainer.find(".gal-next").removeClass("gal-inactive gal-next").addClass("gal-active");
+ gt.thumbStrip.css("left",(parseInt(gt.thumbStrip.css("left")) - 66) + "px");
+ }else if(direction == "prev"){
+ gt.imageContainer.find(".gal-next").remove();
+ img.removeClass("gal-active").addClass("gal-next gal-inactive temp");
+ gt.imageContainer.find(".gal-prev").removeClass("gal-inactive gal-prev").addClass("gal-active");
+ gt.thumbStrip.css("left",(parseInt(gt.thumbStrip.css("left")) + 66) + "px");
+ }
+ mainPicLoading = 1;
+ }
+ gt.descriptionArea.html("
" + currentPic.image.description + "
");
+ if(currentPic.image.description == null){
+ gt.descriptionArea.addClass("hide");
+ }else{
+ gt.descriptionArea.removeClass("hide");
+ }
+ if (direction!=null){
+ calculateHeight(gt.imageContainer.find(".gal-active"));
+ }
+ gt.thumbStrip.find("li.active").removeClass("active");
+ gt.thumbStrip.find("li[data-index=" + currentPic.index + "]").addClass("active");
+
+ setStripToCenter();
+ setNextPic();
+ setPrevPic();
+ }
+
+ var calculateHeight = function(img){
+ var h = 0,
+ w = 0,
+ new_width = 0;
+ if(!Modernizr.touch){
+ if(typeof currentPic.image.height == "undefined"){
+ h = img.height();
+ currentPic.image.height = h;
+ w = img.width();
+ currentPic.image.width = w;
+ }else{
+ h = currentPic.image.height;
+ w = currentPic.image.width;
+ }
+ }else{
+ h = img.height();
+ w = img.width();
+ }
+ if(h > (windowHeight - 150)){
+ new_width = Math.round((windowHeight - 100) * w / h);
+ new_width = (new_width / windowWidth) * 100;
+ img.width(new_width + "%");
+ }else{
+ if(windowWidth < 770){
+ img.width("90%");
+ }else{
+ img.width("65%");
+ }
+ }
+ if (typeof set_custom_gallery_height != 'undefined'){
+ set_custom_gallery_height(widget)
+ }
+ }
+
+ var setStripToCenter = function(){
+ left = (windowWidth / 2) - (66 * currentPic.index);
+ gt.thumbStrip.css("left",left + "px");
+ }
+
+ var setNextPic = function(){
+ gt.imageContainer.find(".gal-next.temp").remove()
+ if(gt.hasNextImage()) {
+ var obj = gt.custom_albumData.images[currentPic.index + 1],
+ nextImg = $("
");
+ nextImg.attr("src",obj.file.theater.url);
+ nextImg.hide();
+ gt.imageContainer.append(nextImg);
+ nextImg.on("load",function(){
+ calculateHeight(nextImg);
+ nextPicLoading = 1;
+ nextImg.fadeIn(100);
+ })
+ }else{
+ nextPicLoading = 1;
+ }
+ }
+
+ var setPrevPic = function(){
+ gt.imageContainer.find(".gal-prev.temp").remove()
+ if(gt.hasPreviousImage()) {
+ var obj = gt.custom_albumData.images[currentPic.index - 1],
+ prevImg = $("
");
+ prevImg.attr("src",obj.file.theater.url);
+ prevImg.hide();
+ gt.imageContainer.prepend(prevImg);
+ prevImg.on("load",function(){
+ calculateHeight(prevImg);
+ prevPicLoading = 1;
+ prevImg.fadeIn(100);
+ })
+ }else{
+ prevPicLoading = 1;
+ }
+ }
+
+ var l = function(x){
+ console.log(x)
+ }
+
+ initialize();
+}
+if (typeof bind_custom_gallery_widget_slide == 'undefined'){
+ function set_custom_gallery_height(widget){
+ var h = widget.find('.custom_gallery-thumb-container').height()+widget.find('.custom_gallery-image.gal-active').height()+widget.find('.custom_gallery-actions').height()+widget.find('.theaterButton').height()+20
+ widget.find('.show-custom_gallery-2.custom_gallery').css('height',h)
+ }
+ var bind_custom_gallery_widget_slide = function(){
+ $('.widget-custom_gallery.widget5').each(function(){
+ CustomGalleryTheaterWidget($(this));
+ $(window).resize(function(){
+ set_custom_gallery_height($(this))
+ });
+ })
+ }
+ $(document).ready(function(){
+ bind_custom_gallery_widget_slide()
+ })
+}
+
+// custom_gallery-image gal-prev gal-inactive
\ No newline at end of file
diff --git a/custom_gallery/app/assets/javascripts/theater_bak.js b/custom_gallery/app/assets/javascripts/theater_bak.js
new file mode 100644
index 0000000..dcc64b2
--- /dev/null
+++ b/custom_gallery/app/assets/javascripts/theater_bak.js
@@ -0,0 +1,261 @@
+var CustomGalleryTheater = function(){
+ var gt = this,
+ currentPic = {},
+ windowHeight = 0,
+ windowWidth = 0;
+ gt.stage = null;
+ gt.closeBtn = null;
+ gt.mainStageImage = null;
+ gt.prevStageImage = null;
+ gt.nextStageImage = null;
+ gt.custom_albumData = {};
+ gt.thumbStrip = null;
+ gt.isTheaterInitialized = false;
+
+ var initialize = function(){
+ gt.stage = $("#custom_gallery-theater-stage");
+ gt.closeBtn = gt.stage.find(".custom_gallery-close");
+ gt.switchBtn = gt.stage.find(".custom_gallery-theme-switch");
+ gt.mainStageImage = gt.stage.find(".gal-active");
+ gt.prevStageImage = gt.stage.find(".gal-prev");
+ gt.nextStageImage = gt.stage.find(".gal-next");
+ gt.thumbStrip = gt.stage.find(".custom_gallery-thumb-wrap");
+ windowHeight = $(window).height();
+ windowWidth = $(window).width();
+ bindHandler();
+ if(window.location.hash != "" && window.location.hash != "#"){
+ var id = window.location.hash.split("#")[1];
+ gt.createTheater("/xhr/custom_galleries/theater/" + id);
+ }
+ }
+
+ var bindHandler = function(){
+ // handler to close the theater
+ gt.closeBtn.on("click",function(){
+ gt.destroyTheater();
+ })
+
+ // handler to show theater
+ $("div[data-list=images] a").on("click",function(){
+ gt.createTheater($(this).attr("href"));
+ return false;
+ })
+
+ // handler to show next image
+ gt.nextStageImage.on("click",function(){
+ if($(this).attr("src") != "#"){
+ gt.nextPic();
+ }
+ })
+ // handler to show prev image
+ gt.prevStageImage.on("click",function(){
+ if($(this).attr("src") != "#"){
+ gt.previousPic();
+ }
+ })
+
+ // handler to go to next image on center image click
+ gt.mainStageImage.on("click",gt.nextPic);
+
+ gt.switchBtn.on("click", function() {
+ var themeWhiteKlass = "theme-white",
+ nightKlass = "fa fa-circle",
+ dayKlass = "fa fa-circle-o",
+ $body = $("body");
+
+ if (!$(this).hasClass(themeWhiteKlass)) {
+ $(this)
+ .addClass(themeWhiteKlass)
+ .find("i")
+ .attr("class", dayKlass);
+
+ $body.addClass(themeWhiteKlass);
+
+ } else {
+ $(this)
+ .removeClass(themeWhiteKlass)
+ .find("i")
+ .attr("class", nightKlass);
+
+ $body.removeClass(themeWhiteKlass);
+
+ }
+
+ });
+
+ //handler for window resize
+ $(window).resize(function(){
+ windowHeight = $(window).height();
+ windowWidth = $(window).width();
+ })
+ }
+
+ var bindKeyHandlers = function(){
+ $(document).on("keyup",function(e){
+ switch(e.keyCode){
+ case 39:
+ gt.nextPic();
+ break;
+ case 37:
+ gt.previousPic();
+ break;
+ case 27:
+ gt.destroyTheater();
+ break;
+ }
+ })
+ }
+
+ var unBindKeyHandlers = function(){
+ $(document).unbind("keypress");
+ }
+
+ gt.destroyTheater = function(){
+ gt.stage.hide();
+ $("body").removeClass("custom_gallery-mode-on");
+ unBindKeyHandlers();
+ window.location.hash = "";
+ }
+
+ gt.createTheater = function(link){
+ gt.stage.show();
+ $("body").addClass("custom_gallery-mode-on");
+ bindKeyHandlers();
+ if(!gt.isTheaterInitialized){
+ $.ajax({
+ url : link,
+ dataType : "json",
+ type : "get"
+ }).done(function(data){
+ gt.custom_albumData = data.data;
+ var cp = gt.custom_albumData.images.filter(function(x){return x._id == gt.custom_albumData.image})[0];
+ currentPic = {"image" : cp, "index" : gt.custom_albumData.images.indexOf(cp)};
+ createThumbStrip();
+ })
+ }else{
+ var id = link.split("/")[4],
+ cp = gt.custom_albumData.images.filter(function(x){return x._id == id})[0];
+ currentPic = {"image" : cp, "index" : gt.custom_albumData.images.indexOf(cp)};
+ createThumbStrip();
+ }
+ }
+
+ gt.nextPic = function(){
+ if((currentPic.index + 1) <= (gt.custom_albumData.images.length - 1)){
+ currentPic.image = gt.custom_albumData.images[currentPic.index + 1];
+ currentPic.index = currentPic.index + 1;
+ setMainPic();
+ }
+ }
+
+ gt.previousPic = function(){
+ if(currentPic.index > 0) {
+ currentPic.image = gt.custom_albumData.images[currentPic.index - 1];
+ currentPic.index = currentPic.index - 1;
+ setMainPic();
+ }
+ }
+
+ var createThumbStrip = function(){
+ if(!gt.isTheaterInitialized){
+ $.each(gt.custom_albumData.images,function(index, image){
+ var li = $("
"),
+ a = $("
"),
+ img = $("
");
+ a.on("click",function(){
+ currentPic.image = gt.custom_albumData.images[index];
+ currentPic.index = index;
+ setMainPic();
+ return false;
+ })
+ img.attr("src",image.file.thumb.url);
+ img.attr("alt",image.alt_title);
+ li.attr("data-index",index);
+ a.append(img);
+ li.append(a);
+ gt.thumbStrip.append(li);
+ })
+ gt.isTheaterInitialized = true;
+ }
+ setMainPic();
+ }
+
+ var setMainPic = function(){
+ var obj = currentPic.image;
+ gt.mainStageImage.fadeOut(100,function(){
+ gt.mainStageImage.attr("src",obj.file.theater.url);
+ gt.mainStageImage.attr("alt",obj.alt_title);
+ gt.mainStageImage.one("load",function(){
+ var h = 0,
+ w = 0,
+ new_width = 0;
+ if(typeof currentPic.image.height == "undefined"){
+ h = gt.mainStageImage.height();
+ currentPic.image.height = h;
+ w = gt.mainStageImage.width();
+ currentPic.image.width = w;
+ }else{
+ h = currentPic.image.height;
+ w = currentPic.image.width;
+ }
+ if(h > (windowHeight - 100)){
+ new_width = Math.round((windowHeight - 100) * w / h);
+ new_width = (new_width / windowWidth) * 100;
+ gt.mainStageImage.width(new_width + "%");
+ }else{
+ if(windowWidth < 770){
+ gt.mainStageImage.width("90%");
+ }else{
+ gt.mainStageImage.width("65%");
+ }
+ }
+ gt.mainStageImage.fadeIn(100);
+ })
+ });
+ gt.thumbStrip.find("li.active").removeClass("active");
+ gt.thumbStrip.find("li[data-index=" + currentPic.index + "]").addClass("active");
+ changeUrl();
+ setNextPic();
+ setPrevPic();
+ }
+
+ var changeUrl = function(){
+ window.location.hash = currentPic.image._id
+ }
+
+ var setNextPic = function(){
+ gt.nextStageImage.attr("src","#");
+ if((currentPic.index + 1) <= (gt.custom_albumData.images.length - 1)) {
+ gt.nextStageImage.hide();
+ var obj = gt.custom_albumData.images[currentPic.index + 1];
+ gt.nextStageImage.attr("src",obj.file.theater.url);
+ gt.nextStageImage.on("load",function(){
+ gt.nextStageImage.show();
+ });
+ }else{
+ gt.nextStageImage.hide();
+ }
+ }
+
+ var setPrevPic = function(){
+ gt.prevStageImage.attr("src","#");
+ if(currentPic.index > 0) {
+ gt.prevStageImage.hide();
+ var obj = gt.custom_albumData.images[currentPic.index - 1];
+ gt.prevStageImage.attr("src",obj.file.theater.url);
+ gt.prevStageImage.on("load",function(){
+ gt.prevStageImage.show();
+ });
+ }else{
+ gt.prevStageImage.hide();
+ }
+ }
+
+ var l = function(x){
+ console.log(x)
+ }
+
+ $(document).ready(function(){
+ initialize();
+ })
+}
\ No newline at end of file
diff --git a/custom_gallery/app/assets/javascripts/upload.js b/custom_gallery/app/assets/javascripts/upload.js
new file mode 100644
index 0000000..efaf107
--- /dev/null
+++ b/custom_gallery/app/assets/javascripts/upload.js
@@ -0,0 +1,39 @@
+//https://github.com/blueimp/jQuery-File-Upload
+
+$(function () {
+
+ 'use strict';
+ // Initialize the jQuery File Upload widget:
+ $('#fileupload').fileupload({
+ acceptFileTypes:/(\.|\/)(jpe?g|png)$/i,
+ headers:{
+ 'X-CSRF-Token': $('meta[name="csrf-token"]').attr("content")
+ }
+ });
+ $('#fileupload').bind("fileuploadadd",function(e,data){$(".fileupload-content").css("background-image","none");})
+ // Load existing files:
+/* $.getJSON($('#fileupload form').prop('action'),{custom_albumid:pagevars['id']}, function (files) {
+ var fu = $('#fileupload').data('fileupload');
+ fu._adjustMaxNumberOfFiles(-files.length);
+ fu._renderDownload(files)
+ .appendTo($('#fileupload .files'))
+ .fadeIn(function () {
+ // Fix for IE7 and lower:
+ $(this).show();
+ });
+ });
+*/
+ // Open download dialogs via iframes,
+ // to prevent aborting current uploads:
+ $('#fileupload .files').delegate(
+ 'a:not([target^=_blank])',
+ 'click',
+ function (e) {
+ e.preventDefault();
+ $('
')
+ .prop('src', this.href)
+ .appendTo('body');
+ }
+ );
+
+});
\ No newline at end of file
diff --git a/custom_gallery/app/assets/stylesheets/cropper.css b/custom_gallery/app/assets/stylesheets/cropper.css
new file mode 100644
index 0000000..6c5dee5
--- /dev/null
+++ b/custom_gallery/app/assets/stylesheets/cropper.css
@@ -0,0 +1,304 @@
+/*!
+ * Cropper.js v1.5.5
+ * https://fengyuanchen.github.io/cropperjs
+ *
+ * Copyright 2015-present Chen Fengyuan
+ * Released under the MIT license
+ *
+ * Date: 2019-08-04T02:26:27.232Z
+ */
+
+.cropper-container {
+ direction: ltr;
+ font-size: 0;
+ line-height: 0;
+ position: relative;
+ -ms-touch-action: none;
+ touch-action: none;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+.cropper-container img {
+ display: block;
+ height: 100%;
+ image-orientation: 0deg;
+ max-height: none !important;
+ max-width: none !important;
+ min-height: 0 !important;
+ min-width: 0 !important;
+ width: 100%;
+}
+
+.cropper-wrap-box,
+.cropper-canvas,
+.cropper-drag-box,
+.cropper-crop-box,
+.cropper-modal {
+ bottom: 0;
+ left: 0;
+ position: absolute;
+ right: 0;
+ top: 0;
+}
+
+.cropper-wrap-box,
+.cropper-canvas {
+ overflow: hidden;
+}
+
+.cropper-drag-box {
+ background-color: #fff;
+ opacity: 0;
+}
+
+.cropper-modal {
+ background-color: #000;
+ opacity: 0.5;
+}
+
+.cropper-view-box {
+ display: block;
+ height: 100%;
+ outline: 1px solid #39f;
+ outline-color: rgba(51, 153, 255, 0.75);
+ overflow: hidden;
+ width: 100%;
+}
+
+.cropper-dashed {
+ border: 0 dashed #eee;
+ display: block;
+ opacity: 0.5;
+ position: absolute;
+}
+
+.cropper-dashed.dashed-h {
+ border-bottom-width: 1px;
+ border-top-width: 1px;
+ height: calc(100% / 3);
+ left: 0;
+ top: calc(100% / 3);
+ width: 100%;
+}
+
+.cropper-dashed.dashed-v {
+ border-left-width: 1px;
+ border-right-width: 1px;
+ height: 100%;
+ left: calc(100% / 3);
+ top: 0;
+ width: calc(100% / 3);
+}
+
+.cropper-center {
+ display: block;
+ height: 0;
+ left: 50%;
+ opacity: 0.75;
+ position: absolute;
+ top: 50%;
+ width: 0;
+}
+
+.cropper-center::before,
+.cropper-center::after {
+ background-color: #eee;
+ content: ' ';
+ display: block;
+ position: absolute;
+}
+
+.cropper-center::before {
+ height: 1px;
+ left: -3px;
+ top: 0;
+ width: 7px;
+}
+
+.cropper-center::after {
+ height: 7px;
+ left: 0;
+ top: -3px;
+ width: 1px;
+}
+
+.cropper-face,
+.cropper-line,
+.cropper-point {
+ display: block;
+ height: 100%;
+ opacity: 0.1;
+ position: absolute;
+ width: 100%;
+}
+
+.cropper-face {
+ background-color: #fff;
+ left: 0;
+ top: 0;
+}
+
+.cropper-line {
+ background-color: #39f;
+}
+
+.cropper-line.line-e {
+ cursor: ew-resize;
+ right: -3px;
+ top: 0;
+ width: 5px;
+}
+
+.cropper-line.line-n {
+ cursor: ns-resize;
+ height: 5px;
+ left: 0;
+ top: -3px;
+}
+
+.cropper-line.line-w {
+ cursor: ew-resize;
+ left: -3px;
+ top: 0;
+ width: 5px;
+}
+
+.cropper-line.line-s {
+ bottom: -3px;
+ cursor: ns-resize;
+ height: 5px;
+ left: 0;
+}
+
+.cropper-point {
+ background-color: #39f;
+ height: 5px;
+ opacity: 0.75;
+ width: 5px;
+}
+
+.cropper-point.point-e {
+ cursor: ew-resize;
+ margin-top: -3px;
+ right: -3px;
+ top: 50%;
+}
+
+.cropper-point.point-n {
+ cursor: ns-resize;
+ left: 50%;
+ margin-left: -3px;
+ top: -3px;
+}
+
+.cropper-point.point-w {
+ cursor: ew-resize;
+ left: -3px;
+ margin-top: -3px;
+ top: 50%;
+}
+
+.cropper-point.point-s {
+ bottom: -3px;
+ cursor: s-resize;
+ left: 50%;
+ margin-left: -3px;
+}
+
+.cropper-point.point-ne {
+ cursor: nesw-resize;
+ right: -3px;
+ top: -3px;
+}
+
+.cropper-point.point-nw {
+ cursor: nwse-resize;
+ left: -3px;
+ top: -3px;
+}
+
+.cropper-point.point-sw {
+ bottom: -3px;
+ cursor: nesw-resize;
+ left: -3px;
+}
+
+.cropper-point.point-se {
+ bottom: -3px;
+ cursor: nwse-resize;
+ height: 20px;
+ opacity: 1;
+ right: -3px;
+ width: 20px;
+}
+
+@media (min-width: 768px) {
+ .cropper-point.point-se {
+ height: 15px;
+ width: 15px;
+ }
+}
+
+@media (min-width: 992px) {
+ .cropper-point.point-se {
+ height: 10px;
+ width: 10px;
+ }
+}
+
+@media (min-width: 1200px) {
+ .cropper-point.point-se {
+ height: 5px;
+ opacity: 0.75;
+ width: 5px;
+ }
+}
+
+.cropper-point.point-se::before {
+ background-color: #39f;
+ bottom: -50%;
+ content: ' ';
+ display: block;
+ height: 200%;
+ opacity: 0;
+ position: absolute;
+ right: -50%;
+ width: 200%;
+}
+
+.cropper-invisible {
+ opacity: 0;
+}
+
+.cropper-bg {
+ background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC');
+}
+
+.cropper-hide {
+ display: block;
+ height: 0;
+ position: absolute;
+ width: 0;
+}
+
+.cropper-hidden {
+ display: none !important;
+}
+
+.cropper-move {
+ cursor: move;
+}
+
+.cropper-crop {
+ cursor: crosshair;
+}
+
+.cropper-disabled .cropper-drag-box,
+.cropper-disabled .cropper-face,
+.cropper-disabled .cropper-line,
+.cropper-disabled .cropper-point {
+ cursor: not-allowed;
+}
diff --git a/custom_gallery/app/assets/stylesheets/custom_gallery.css b/custom_gallery/app/assets/stylesheets/custom_gallery.css
new file mode 100644
index 0000000..904cb52
--- /dev/null
+++ b/custom_gallery/app/assets/stylesheets/custom_gallery.css
@@ -0,0 +1,554 @@
+#orbit_custom_gallery {
+ margin: 0;
+ padding: 0 0 10px;
+ list-style: none;
+}
+#orbit_custom_gallery .rgcustom_album {
+ position: relative;
+ float: left;
+ margin: 5px;
+ padding: 5px;
+ width: 200px;
+ background: #FFFFFF;
+ overflow: hidden;
+ -webkit-box-shadow: 0px 0px 5px rgba(0, 0, 0, .1);
+ -moz-box-shadow: 0px 0px 5px rgba(0, 0, 0, .1);
+ box-shadow: 0px 0px 5px rgba(0, 0, 0, .1);
+ -o-box-shadow: 0px 0px 5px rgba(0, 0, 0, .1);
+ -webkit-transition-property: left, right, top;
+ -moz-transition-property: left, right, top;
+ -ms-transition-property: left, right, top;
+ -o-transition-property: left, right, top;
+ transition-property: left, right, top;
+}
+#orbit_custom_gallery .rgcustom_album:hover {
+ box-shadow: 0px 0px 5px rgba(0,0,0,.2);
+}
+#orbit_custom_gallery .rgcustom_album > a {
+ position: relative;
+ display: block;
+ overflow: hidden;
+ margin: 0 0 10px;
+ width: 200px;
+ height: 200px;
+ -webkit-transition: all .2s linear;
+ -moz-transition: all .2s linear;
+ -o-transition: all .2s linear;
+ transition: all .2s linear;
+}
+#orbit_custom_gallery .rgcustom_album a img {
+ max-width: none;
+}
+#orbit_custom_gallery .rgcustom_album:hover a img {
+ -webkit-filter: blur(2px);
+}
+#orbit_custom_gallery .rgcustom_album > a:after {
+ content: "";
+ position: absolute;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ display: block;
+ margin: 0;
+ background-color: #000000;
+ opacity: .0;
+ -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
+ filter: alpha(opacity=0);
+ -webkit-transition: all .2s linear;
+ -moz-transition: all .2s linear;
+ -o-transition: all .2s linear;
+ transition: all .2s linear;
+}
+#orbit_custom_gallery .rgcustom_album:hover a:after {
+ opacity: .4;
+ -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=40)";
+ filter: alpha(opacity=40);
+}
+#orbit_custom_gallery .rgcustom_album a .custom_albumname {
+ position: absolute;
+ bottom: 0;
+ margin: 0;
+ padding: 10px;
+ color: #F2F2F2;
+ text-shadow: 0px -1px 0 rgba(0,0,0,0.4);
+ letter-spacing: -0.5px;
+ font-size: 30px;
+ font-family: 'Playfair Display SC', sans-serif;
+ line-height: 28px;
+ z-index: 1;
+ opacity: .0;
+ -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
+ filter: alpha(opacity=0);
+ -webkit-transition: all .2s linear;
+ -moz-transition: all .2s linear;
+ -o-transition: all .2s linear;
+ transition: all .2s linear;
+}
+#orbit_custom_gallery .rgcustom_album:hover a .custom_albumname {
+ opacity: 1;
+ -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
+ filter: alpha(opacity=100);
+ -webkit-transition: all .2s linear;
+ -moz-transition: all .2s linear;
+ -o-transition: all .2s linear;
+ transition: all .2s linear;
+}
+#orbit_custom_gallery .rgcustom_album .custom_gallery_info {
+ margin: 0;
+ list-style: none;
+}
+#orbit_custom_gallery .rgcustom_album .custom_gallery_info li {
+ display: inline-block;
+ float: left;
+ color: #777777;
+ font-size: 1.2em;
+ line-height: 20px;
+ cursor: pointer;
+}
+#orbit_custom_gallery .rgcustom_album .custom_gallery_info li > a {
+ display: inline-block;
+ margin-left: 5px;
+ color: #777777;
+}
+#orbit_custom_gallery .rgcustom_album .custom_gallery_info li:hover > a {
+ color: #E41B2B;
+ text-decoration: none;
+}
+#orbit_custom_gallery .rgcustom_album .custom_gallery_info li:hover {
+ color: #0088CC;
+}
+#orbit_custom_gallery .rgcustom_album .custom_gallery_info li .icons-tag {
+ margin-left: 3px;
+}
+#orbit_custom_gallery .rgcustom_album .custom_gallery_info li.custom_albumcateg {
+ float: right;
+ overflow: hidden;
+ max-width: 125px;
+ text-align: right;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+#orbit_custom_gallery .rgcustom_album .custom_gallery_info li.view {
+ overflow: hidden;
+ max-width: 50px;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+#orbit_custom_gallery .rgcustom_album .custom_albumtag {
+ display: none;
+ overflow: hidden;
+ margin: 0;
+}
+
+
+/* CustomGallery Body */
+div.rgbody{
+ margin-bottom:50px;
+}
+.rgbody .custom_gallery-info {
+ padding: 0 5px;
+}
+.rgbody .custom_gallery-info h3 {
+ margin: 5px 0 0;
+ color: #333;
+ text-shadow: 0 1px 0 #ffffff;
+ font-family: 'Playfair Display SC', sans-serif;
+}
+.rgbody .custom_gallery-info .muted {
+ font-family: 'Raleway', sans-serif;
+}
+
+#imgholder {
+ margin: 0;
+ padding: 0 0 10px;
+ list-style: none;
+}
+.rgcustom_album .photo_edit{
+ right: 100%;
+ transition-duration: 0.5s;
+}
+.rgcustom_album:hover .photo_edit{
+ transform: translate(100%);
+}
+#imgholder .rgcustom_album {
+ position: relative;
+ float: left;
+ margin: 5px;
+ padding: 5px;
+ width: 200px;
+ background: #FFFFFF;
+ overflow: hidden;
+ -webkit-box-shadow: 0px 0px 5px rgba(0, 0, 0, .1);
+ -moz-box-shadow: 0px 0px 5px rgba(0, 0, 0, .1);
+ box-shadow: 0px 0px 5px rgba(0, 0, 0, .1);
+ -o-box-shadow: 0px 0px 5px rgba(0, 0, 0, .1);
+ -webkit-transition-property: left, right, top;
+ -moz-transition-property: left, right, top;
+ -ms-transition-property: left, right, top;
+ -o-transition-property: left, right, top;
+ transition-property: left, right, top;
+}
+#imgholder .rgcustom_album.active {
+ background-color: #51a351;
+}
+#imgholder .rgcustom_album.active-single {
+ background-color: #F89406;
+}
+#imgholder .rgcustom_album .photo-action {
+ margin: 0;
+ list-style: none;
+ left: 5px;
+ right: 5px;
+ height: 0;
+ position: absolute;
+ background-color: #FFF;
+ bottom: 5px;
+ opacity: .9;
+ -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=90)";
+ filter: alpha(opacity=90);
+ -webkit-transition: all .2s linear;
+ -moz-transition: all .2s linear;
+ -o-transition: all .2s linear;
+ transition: all .2s linear;
+}
+#imgholder .rgcustom_album:hover .photo-action {
+ padding: 5px;
+ height: 30px;
+}
+#imgholder .rgcustom_album .photo-action li {
+ display: inline-block;
+ float: left;
+ color: #777;
+ font-size: 11px;
+ line-height: 30px;
+ cursor: pointer;
+ width: 33%;
+ text-align: center;
+ font-size: 1.2em;
+}
+#imgholder .rgcustom_album .photo-action a {
+ color: #777;
+ display: block;
+ text-decoration: none;
+ width: 100%;
+ height: 100%;
+}
+#imgholder .rgcustom_album .photo-action li:hover a {
+ color: #08C;
+}
+#imgholder .rgcustom_album .photo-action .icons-star {
+ color: #F8A900;
+ font-size: 1.4em;
+ line-height: 1.4em;
+}
+#imgholder .rgcustom_album a {
+ display: block;
+ overflow: hidden;
+ margin: 0;
+ width: 200px;
+ height: 200px;
+ -webkit-transition: all .2s linear;
+ -moz-transition: all .2s linear;
+ -o-transition: all .2s linear;
+ transition: all .2s linear;
+}
+#imgholder .rgcustom_album a img {
+ max-width: none;
+}
+
+#imgholder .rgcustom_album .check {
+ position: absolute;
+ top: 0;
+ right: 0;
+ width: 40px;
+ height: 40px;
+}
+#imgholder .rgcustom_album .check:after {
+ font-family: FontAwesome;
+ font-weight: normal;
+ font-style: normal;
+ color: #F2F2F2;
+ text-decoration: inherit;
+ content: "\f00c";
+ line-height: 25px;
+ text-indent: 20px;
+ font-size: 1.3em;
+ position: absolute;
+ top: 0;
+ right: 0;
+ width: 0px;
+ height: 0px;
+ border-style: solid;
+ border-width: 0 40px 40px 0;
+ border-color: transparent #FFF transparent transparent;
+}
+#imgholder .rgcustom_album.active .check:after {
+ color: #FFF;
+ border-color: transparent #51a351 transparent transparent;
+}
+#imgholder .rgcustom_album.active-single .check:after {
+ color: #FFF;
+ border-color: transparent #F89406 transparent transparent;
+}
+#imgholder .rgcustom_album input[type="checkbox"] {
+ position: absolute;
+ top: 0;
+ right: 0;
+ z-index: 3;
+ display: block;
+ margin: 0;
+ width: 100%;
+ height: 100%;
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
+ opacity: 0;
+}
+
+/* Page Silde */
+#view-photo-tags .phtot-tags {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+#view-photo-tags .phtot-tags li {
+ margin: 0 5px 5px 0;
+ white-space: nowrap;
+}
+
+/* Dialog */
+.modal-body {
+ min-height: 80px;
+ line-height: 80px;
+ text-align: center;
+}
+.modal-body .spinning {
+ display: none;
+ position: absolute;
+ width: 70px;
+ height: 70px;
+ top: 50%;
+ left: 50%;
+ margin: -35px 0 0 -35px;
+}
+
+/* File Upload */
+#upload-panel {
+ clear: both;
+}
+#upload-panel iframe {
+ width: 100%;
+ border: none;
+}
+#fileupload {
+ position: relative;
+ display: none;
+ clear: both;
+ overflow: hidden;
+ margin: 40px 0 15px;
+ height: 254px;
+ border: 1px solid #d4d4d4;
+ border-radius: 4px;
+ background-color: #FDFDFD;
+ /*-webkit-box-shadow: 0px 0px 10px rgba(0, 0, 0, .15) inset;
+ box-shadow: 0px 0px 10px rgba(0, 0, 0, .15) inset;*/
+}
+#fileupload table {
+ margin: 0;
+}
+#fileupload .fileupload-buttonbar .navbar {
+ margin-bottom: 0;
+}
+#fileupload .fileupload-buttonbar .navbar .add-photo {
+ border: none;
+ border-right: 1px solid #d4d4d4;
+ background-color: transparent;
+ padding: 10px 15px 10px;
+ color: #777777;
+ text-decoration: none;
+ text-shadow: 0 1px 0 #ffffff;
+}
+#fileupload .fileupload-buttonbar .navbar .add-photo:hover {
+ color: #333333;
+ text-decoration: none;
+ background-color: #EDEDED;
+}
+#fileupload .fileupload-buttonbar .navbar .fileinput-button {
+ position: relative;
+ overflow: hidden;
+}
+#fileupload .fileupload-buttonbar .navbar .fileinput-button input {
+ position: absolute;
+ top: 0;
+ right: 0;
+ margin: 0;
+ font-size: 23px;
+ opacity: 0;
+ -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
+ filter: alpha(opacity=0);
+ cursor: pointer;
+ -webkit-transform: translate(-300px, 0) scale(4);
+ -moz-transform: translate(-300px, 0) scale(4);
+ -ms-transform: translate(-300px, 0) scale(4);
+ -o-transform: translate(-300px, 0) scale(4);
+ transform: translate(-300px, 0) scale(4);
+ direction: ltr;
+}
+#fileupload .fileupload-buttonbar .navbar-inner {
+ border-width: 0 0 1px;
+ border-radius: 4px 4px 0 0;
+ padding: 0;
+}
+
+#fileupload .fileupload-progress .progress {
+ position: absolute;
+ right: 0;
+ left: 0;
+ margin-bottom: 0;
+ height: 5px;
+ border-radius: 0;
+ background-color: transparent;
+ background-image: none;
+}
+#fileupload .fileupload-progress .progress-success.progress-striped .bar {
+ background-color: #0088CC;
+}
+#fileupload .fileupload-progress .progress-extended {
+ position: absolute;
+ top: 1px;
+ right: 0;
+ padding-right: 15px;
+ color: #0088CC;
+ text-align: right;
+ text-shadow: 0 1px 0 #ffffff;
+ letter-spacing: -0.1em;
+ font-size: 12px;
+ font-family: 'Varela Round', sans-serif;
+ line-height: 40px;
+}
+#fileupload .fileupload-buttonbar {
+ position: relative;
+ z-index: 3;
+}
+#fileupload #dropzone {
+ margin: 15px 10px 10px;
+ padding: 30px;
+ text-align: center;
+ font-size: 2em;
+ font-family: 'Raleway';
+ line-height: 1.2em;
+ color: #e4e4e4;
+}
+#fileupload #dropzone div[data-icons] {
+ font-size: 4em;
+ height: 70px;
+ padding-top: 30px;
+ text-shadow: 0px -1px 0px #ececec;
+ color: #f5f5f5;
+}
+#fileupload #dropzone.drop {
+ position: absolute;
+ top: 37px;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ border: 2px dashed #0088CC;
+ border-radius: 10px;
+ color: #0088CC;
+ background-color: #FFFFFF;
+ z-index: 0;
+}
+#fileupload #dropzone.fade {
+ opacity: .3;
+}
+#fileupload #dropzone.in {
+ opacity: .7;
+ z-index: 2;
+ border-color: #faa732;
+ color: #faa732;
+}
+#fileupload #dropzone.drop div[data-icons] {
+ text-shadow: 0px -1px 0px #0c5f80;
+ color: #0088CC;
+}
+#fileupload #dropzone.in div[data-icons] {
+ text-shadow: 0px -1px 0px #a28a10;
+ color: #faa732;
+}
+#fileupload #file-list {
+ position: relative;
+ z-index: 1;
+ height: 209px;
+ margin: 2px 0;
+}
+#fileupload #file-list .pane {
+ margin-right: 2px;
+}
+#fileupload #file-list .files {
+ margin: 0;
+ padding: 10px 14px 10px 10px;
+ list-style: none;
+}
+#fileupload #file-list .files > li {
+ padding: 10px;
+}
+#fileupload #file-list .files > li:nth-child(even) {
+ background-color: #e9e9e9;
+ border-radius: 3px;
+}
+#fileupload #file-list .files ul {
+ position: relative;
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+#fileupload #file-list .files ul li {
+ float: left;
+}
+#fileupload #file-list .files ul li.action-bnt {
+ float: right;
+}
+#fileupload #file-list .preview {
+ width: 80px;
+ min-height: 1px;
+ margin-right: 10px;
+ text-align: center;
+}
+#fileupload #file-list .name {
+ width: 150px;
+ max-width: 250px;
+ margin-left: 15px;
+}
+#fileupload #file-list .progress {
+ position: absolute;
+ left: -5px;
+ right: -5px;
+ bottom: -5px;
+ margin-bottom: 0;
+ height: 5px;
+ box-shadow: none;
+ background-color: transparent;
+ background-image: none;
+}
+#fileupload #file-list .size {
+ width: 80px;
+}
+#fileupload #file-list .action-bnt {
+ text-align: right;
+}
+.cke_contents.cke_reset{
+ position: relative;
+}
+.order-edit-notification{
+ background-color: #ffffd5;
+ z-index: 10;
+ display: none;
+ height: 25px;
+ margin-left: 40%;
+ position: fixed;
+ text-align: center;
+ margin-top: 5px;
+ top: 85px;
+ width: 250px;
+ font-size: 13px;
+}
\ No newline at end of file
diff --git a/custom_gallery/app/assets/stylesheets/custom_gallery_card.css b/custom_gallery/app/assets/stylesheets/custom_gallery_card.css
new file mode 100644
index 0000000..0bd9e7e
--- /dev/null
+++ b/custom_gallery/app/assets/stylesheets/custom_gallery_card.css
@@ -0,0 +1,91 @@
+.custom_gallery.card-group .row {
+ position: relative;
+ display: flex;
+ flex-wrap: wrap;
+}
+.custom_gallery.card-group .card-back {
+ transform: rotateY(180deg) translateX(-100%);
+ position: absolute;
+ backface-visibility: hidden;
+ transition: transform 300ms;
+ transition-timing-function: linear;
+ display: block;
+ width: 100%;
+ height: 100%;
+ top: 0;
+ background: white;
+ color: black;
+}
+.custom_gallery.card-group .card.card-flip.h-100:nth-child(4n) {
+ margin-right: 0em;
+}
+
+.custom_gallery.card-group .card.card-flip.h-100 {
+ position: relative;
+ overflow: hidden;
+ width: 25%;
+ width: calc( 25% - 0.75em);
+ background: white;
+ margin-right: 1em;
+ margin-bottom: 1em;
+}
+@media (max-width: 768px){
+ .custom_gallery.card-group .card.card-flip.h-100 {
+ width: 50%;
+ width: calc( 50% - 0.5em);
+ }
+ .custom_gallery.card-group .card.card-flip.h-100:nth-child(2n) {
+ margin-right: 0em;
+ }
+}
+@media (max-width: 575px){
+ .custom_gallery.card-group .card.card-flip.h-100 {
+ width: 100%;
+ margin-right: 0em;
+ }
+}
+.custom_gallery.card-group h3.card-title {
+ padding: 0.5em;
+ margin: 0;
+ font-size: 1.2em;
+}
+.custom_gallery.card-group .card-front{
+ backface-visibility: hidden;
+ width: 100%;
+ height: 100%;
+}
+.custom_gallery.card-group .card.card-flip.h-100:hover .card-back {
+ transform: rotateY(0deg);
+}
+.custom_gallery.card-group .card-button-group{
+ bottom: 0;
+ right: 0;
+ position: absolute;
+ display: flex;
+}
+.custom_gallery.card-group .card-body{
+ width: 100%;
+ position: inherit;
+ display: flex;
+ flex-direction: column;
+ height: 100%;
+}
+.custom_gallery.card-group .card-button-group a {
+ color: #fff;
+ display: block;
+ background: #6c757d;
+ padding: 0.5em;
+ width: 2.3em;
+ height: 2.3em;
+ margin-right: 0.1em;
+ border-radius: 0;
+}
+.custom_gallery.card-group .card-button-group a:hover {
+ color: #fff;
+ background-color: #5a6268;
+ border-color: #545b62;
+}
+.custom_gallery.card-group .card-button-group a:focus {
+ color: #fff;
+ outline: 0.1em dotted !important;
+}
\ No newline at end of file
diff --git a/custom_gallery/app/assets/stylesheets/custom_gallery_frontend.css b/custom_gallery/app/assets/stylesheets/custom_gallery_frontend.css
new file mode 100644
index 0000000..286dcc6
--- /dev/null
+++ b/custom_gallery/app/assets/stylesheets/custom_gallery_frontend.css
@@ -0,0 +1,332 @@
+.rg, .rgp {
+ transition: all 0.3s ease;
+ -webkit-transition: all 0.3s ease;
+ -moz-transition: all 0.3s ease;
+}
+.rg input, .rgp input, .rg textarea, .rgp textarea {
+ resize: none;
+ margin: 0;
+ display: block;
+ font-size: 13px;
+ }
+.rgp textarea { overflow: auto; }
+.rg a, .rgp a {
+ text-decoration: none;
+ outline: none;
+ }
+.rg a:hover { }
+
+/*.rg img { display: block; border: none; }*/
+
+.rgmask { background: #000; width: 100%; position: fixed; top: 0; left: 0; }
+
+.rgui {
+ display: inline-block;
+ cursor: pointer;
+ }
+.rghead, .rgbody { overflow: hidden; }
+.rghead {
+ padding: 10px 0;
+ }
+.rgtitle {
+ color: #333;
+ text-shadow: 0 1px 0 #ddd;
+ font-size: 2em;
+ padding: 0 8px;
+ }
+.rgbody {
+
+ }
+.rgfn { overflow: hidden; }
+.rgcustom_album, .rgphoto { float: left; margin: 0 10px 24px 0; }
+.rgcustom_album {
+ margin: 0 16px 16px 0;
+ padding: 6px;
+ width: 138px;
+ height: 220px;
+ border: solid 1px #ccc;
+
+ transition: all 0.3s ease;
+ -webkit-transition: all 0.3s ease;
+ -moz-transition: all 0.3s ease;
+}
+.rgcustom_album > a {
+ display: block;
+ float: none;
+ margin: -6px -6px 0 -6px;
+}
+.rgcustom_album img {
+ transition: all, 0.5s ease;
+ -webkit-transition: all, 0.5s ease;
+ -moz-transition: all 0.5s ease;
+ -ms-transition: all, 0.5s ease;
+ }
+.rgphoto { }
+.rgphoto a {
+ display: block;
+
+ transition: all, 0.3s ease;
+ -webkit-transition: all, 0.3s ease;
+ -moz-transition: all, 0.3s ease;
+}
+.rgphoto a:hover img {
+ opacity: 0.85;
+}
+.rgphoto img, .rgphoto_edit img {
+ /*display: block;*/
+
+ transition: all, 0.3s ease;
+ -webkit-transition: all, 0.3s ease;
+ -moz-transition: all, 0.3s ease;
+ }
+.rgcustom_album .custom_albumname {
+ font-size: 1.25em;
+ /*line-height: ;*/
+ margin: 6px 0;
+ display: block;
+ height: 45px;
+ overflow: hidden;
+ transition: background 0.3s ease;
+ -webkit-transition: background 0.3s ease;
+ -moz-transition: background 0.3s ease;
+ -ms-transition: background 0.3s ease;
+ }
+.rgcustom_album a:hover img {
+ opacity: 0.85;
+ }
+.rgcustom_album .categoryname {}
+.rgcustom_album .tagnames {
+ display: block;
+ margin-top: 8px;
+ padding-top: 8px;
+ line-height: 22px;
+ height: 22px;
+ overflow: hidden;
+ border-top: solid 1px #ccc;
+ color: #666;
+}
+
+.taglist {
+ padding: 10px 0;
+}
+.taglist_title {
+ font-size: 1.5em;
+ margin: 0 0 10px 0;
+}
+.taglist ul {
+ padding: 10px 0;
+ border-top: solid 1px #ddd;
+ overflow: hidden;
+}
+.taglist li {
+ float: left;
+ margin: 0 8px 8px 0;
+}
+
+.rgp .rgtitle { margin: 0 0 10px 0; }
+
+
+/* Ruling Slide */
+.rslide {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ overflow: hidden;
+ background: #222;
+ clear: both;
+ /*z-index: 99;*/
+ min-height: 250px;
+
+ transition: all 0.3s ease;
+ -webkit-transition: all 0.3s ease;
+ -moz-transition: all 0.3s ease;
+ }
+.rslide.fullscreen { position: fixed; z-index: 99; }
+.rslide.fullscreen .comp img{
+ width: auto;
+}
+.rslideinside {
+ }
+.comp {
+ width: 100%;
+ height: auto;
+ overflow: hidden;
+ position: relative;
+
+ transition: all 0.3s ease;
+ -webkit-transition: all 0.3s ease;
+ -moz-transition: all 0.3s ease;
+ }
+.comp img{ display: block; width: 100%; height: auto; margin: 0 auto; cursor: pointer; min-height: 250px; }
+.comp .full{ width: auto; height: auto; max-width: 100%; max-height: 100%; }
+.rslidenav {
+ position: absolute;
+ top: 50%;
+ left: 0;
+ right: 0;
+ margin-top: -35px;
+ }
+.rslidenav a {
+ position: absolute;
+ display: block;
+ width: 30px;
+ height: 40px;
+ overflow: hidden;
+ text-indent: -999px;
+ background: #000 0 center url(../../../assets/custom_gallery/slidenav.png) no-repeat;
+ background: rgba(0,0,0,0.9) 0 0 url(../../../assets/custom_gallery/slidenav.png) no-repeat;
+
+ transition: all 0.3s ease;
+ -webkit-transition: all 0.3s ease;
+ -moz-transition: all 0.3s ease;
+ -ms-transition: all 0.3s ease;
+ }
+.rslidenav a:hover {
+ background-color: #fff;
+ background-color: rgba(255,255,255,0.9);
+ }
+.rslidenav .navP { left: 0; border-radius: 0 4px 4px 0; background-position: 0 -40px; }
+.rslidenav .navN { right: 0; border-radius: 4px 0 0 4px; background-position: -30px 0; }
+.rslidenav a.navP:hover { background-position: -30px -40px; }
+.rslidenav a.navN:hover { background-position: 0 0; }
+.slidectrl {
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ width: 100%;
+ height: 30px;
+ background: #000 left top url(../../../assets/custom_gallery/slidetitlebg.png) repeat-x;
+ background: rgba(0,0,0,0.9) left top url(../../../assets/custom_gallery/slidetitlebg.png) repeat-x;
+ /*z-index: 999;*/
+ }
+.slidectrl a {
+ display: block;
+ float: right;
+ text-indent: -9999px;
+ overflow: hidden;
+ width: 30px;
+ height: 30px;
+ background: transparent 0 0 url(../../../assets/custom_gallery/slideui.gif) no-repeat;
+ border-left: solid 1px #222;
+ }
+.slidectrl a.togglelist { background-position: 0 -30px; }
+.slidectrl a.togglescreen { background-position: 0 -90px; }
+.slidectrl a.toinline { background-position: -30px 0; }
+.slidectrl a.sharebt { background-position: -30px -30px; }
+.slidectrl a.browserfullscreen { display:none;}
+.slidectrl a.slidestop { background-position: 0 -60px; }
+.fullscreen .slidectrl a.togglescreen { background-position: -30px -90px; }
+.browserFullScreen .slidectrl a.browserfullscreen { background-position: -30px 0; }
+.browserFullScreen .togglescreen { display: none; }
+.slideinfo {
+ height: 30px;
+ line-height: 30px;
+ color: #fff;
+ font-size: 13px;
+ overflow: hidden;
+ }
+.slideinfo .info { padding: 0 0 0 6px; text-transform: uppercase; }
+.slideinfo span.info { color: #ccc; text-transform: none; }
+
+.slidelist {
+ position: absolute;
+ bottom: 30px;
+ z-index: 98;
+ width: 100%;
+ height: 0;
+ overflow: auto;
+ overflow-x: hidden;
+ background: transparent 0 0 url(../../../assets/custom_gallery/slidelistbg.png);
+ }
+.slidelist ul {
+ margin: 0 auto;
+ padding: 10px 0 10px 10px;
+ list-style: none;
+ }
+.slidelist li {
+ display: inline-block;
+ margin: 0 10px 10px 0;
+ }
+.slidelist a {
+ border: solid 2px #fff;
+ display: block;
+ width: 120px;
+ height: 96px;
+ position: relative;
+
+ box-shadow: 0 0 6px rgba(0,0,0,0.7);
+ -webkit-box-shadow: 0 0 6px rgba(0,0,0,0.7);
+ -moz-box-shadow: 0 0 6px rgba(0,0,0,0.7);
+ -ms-box-shadow: 0 0 6px rgba(0,0,0,0.7);
+ }
+.slidelist a.playall {
+ border: none;
+ width: 80px;
+ height: 32px;
+ margin: 31px 0 0 22px;
+ background: transparent 0 0 url(../../../assets/custom_gallery/playall.png) no-repeat;
+
+ box-shadow: none;
+ -webkit-box-shadow: none;
+ -moz-box-shadow: none;
+ -ms-box-shadow: none;
+ }
+.slidelist a.playall:hover { background-position: 0 -32px; }
+#li_play_all { width: 124px; height: 94px; }
+.slidelist img {
+ margin: 0;
+ background: #fff;
+ display: block;
+
+ transition: all 0.2s ease;
+ -webkit-transition: all 0.2s ease;
+ -moz-transition: all 0.2s ease;
+ -ms-transition: all 0.2s ease;
+ }
+.slidelist a:hover img {
+ padding: 4px;
+ margin: -4px;
+ }
+
+.dm {
+ background: #fff;
+ border: solid 1px #a4a4a4;
+ border-right-color: #666;
+ position: absolute;
+ overflow: hidden;
+ padding: 2px 0;
+ display: none;
+
+ border-radius: 4px;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ -ms-border-radius: 4px;
+ }
+.dm ul { margin: 0; padding: 0; list-style: none !important; }
+.dm li {
+ margin: 0;
+ padding: 0;
+ border-bottom: solid 1px #ccc;
+ list-style: none !important;
+ }
+.dm li a {
+ display: block;
+ padding: 6px 10px;
+ font-size: 13px;
+
+ transition: all 0.3s ease;
+ -webkit-transition: all 0.3s ease;
+ -moz-transition: all 0.3s ease;
+ -ms-transition: all 0.3s ease;
+ }
+.dm li a:hover { background: #eee; }
+
+
+
+/* orbit style implementation */
+#orbit_custom_gallery {
+ margin: 0 -10px 30px -10px;
+}
\ No newline at end of file
diff --git a/custom_gallery/app/assets/stylesheets/custom_gallery_old.css b/custom_gallery/app/assets/stylesheets/custom_gallery_old.css
new file mode 100644
index 0000000..021fa5e
--- /dev/null
+++ b/custom_gallery/app/assets/stylesheets/custom_gallery_old.css
@@ -0,0 +1,564 @@
+.rg, .rgp {
+ transition: all 0.3s ease;
+ -webkit-transition: all 0.3s ease;
+ -moz-transition: all 0.3s ease;
+}
+.rg input, .rgp input, .rg textarea, .rgp textarea {
+ resize: none;
+ margin: 0;
+ display: block;
+ font-size: 13px;
+ }
+.rgp textarea { overflow: auto; }
+.rg a, .rgp a {
+ text-decoration: none;
+ outline: none;
+ }
+.rg a:hover { }
+
+/*.rg img { display: block; border: none;}*/
+
+.rgmask { background: #000; width: 100%; position: fixed; top: 0; left: 0; }
+
+.rgui {
+ display: inline-block;
+ cursor: pointer;
+ }
+.rghead, .rgbody { overflow: hidden; }
+.rghead {
+ border-bottom: solid 1px #ccc;
+ padding: 10px 0;
+ background: #fff;
+ }
+.rgtitle {
+ color: #333;
+ text-shadow: 0 1px 0 #ddd;
+ font-size: 2em;
+ padding: 0 8px;
+ }
+.rgbody {
+
+ }
+.rgfn { overflow: hidden; padding: 4px 10px; }
+.rgcustom_album, .rgphoto { float: left; margin: 0 10px 24px 0; }
+.rgcustom_album {
+ padding: 16px;
+ margin: 0 8px 8px 0;
+ border: solid 1px #ccc;
+ width: 300px;
+ height: 120px;
+ border-radius: 4px;
+
+ transition: all 0.3s ease;
+ -webkit-transition: all 0.3s ease;
+ -moz-transition: all 0.3s ease;
+}
+.rgcustom_album > a {
+ display: block;
+ float: left;
+ margin-right: 10px;
+}
+.rgcustom_album:hover {
+ box-shadow: 0 0 6px rgba(0,0,0,0.2);
+}
+.rgcustom_album img {
+ transition: all, 0.5s ease;
+ -webkit-transition: all, 0.5s ease;
+ -moz-transition: all 0.5s ease;
+ -ms-transition: all, 0.5s ease;
+ }
+.rgphoto { }
+.rgphoto a {
+ display: block;
+ padding: 4px;
+ border: solid 1px #ddd;
+ background-color: #fff;
+ border-radius: 4px;
+ transition: all, 0.3s ease;
+ -webkit-transition: all, 0.3s ease;
+ -moz-transition: all, 0.3s ease;
+}
+.rgphoto a:hover {
+ border-color: #999;
+ box-shadow: 0 3px 6px rgba(0,0,0,0.2);
+}
+.rgphoto img, .rgphoto_edit img {
+ /*display: block;*/
+ border-radius: 3px;
+ transition: all, 0.3s ease;
+ -webkit-transition: all, 0.3s ease;
+ -moz-transition: all, 0.3s ease;
+ }
+.rgcustom_album .custom_albumname {
+ font-size: 18px;
+ padding: 6px 0;
+ display: block;
+ transition: background 0.3s ease;
+ -webkit-transition: background 0.3s ease;
+ -moz-transition: background 0.3s ease;
+ -ms-transition: background 0.3s ease;
+ }
+.rgcustom_album a:hover img {
+ opacity: 0.85;
+ }
+
+.rgp .rgtitle { margin: 0 0 10px 0; }
+
+/* Photo Edit */
+.custom_albumname_edit label, .custom_albumname_edit .rginput, .rgphoto_edit > a, .rgphoto_edit .rginput { float: left; }
+.rgphoto_edit, .custom_albumname_edit {
+ clear: both;
+ overflow: hidden;
+ margin-bottom: 10px;
+}
+.custom_albumname_edit label {
+ width: 150px;
+ margin: 0 10px 0 0;
+ text-align: right;
+ padding: 0;
+ line-height: 24px;
+}
+.custom_albumname_edit .rginput { }
+.rgphoto_edit img { margin: 0 10px 10px 0; }
+.rgphoto_edit .rginput { margin-right: 10px; }
+.rgphoto_edit .edit_fn { float: left; margin-bottom: 10px; }
+.rgphoto_edit .edit_fn .bt-dels { }
+
+/* Delete List */
+.rglist { overflow: hidden; padding: 10px 0; }
+.list { table-layout:fixed; width: 100%; margin: 0 0 12px 0; }
+.list thead th { padding: 8px 4px; font-size: 30px; font-weight: bold; }
+.list th img { width: 60px; height: 45px; }
+.list .photoname { padding-left: 6px; }
+.list .photofn { padding-right: 4px; }
+.list .photofn a { float: right; margin-left: 4px; display: block; }
+.list th { padding: 4px 0 4px 4px; }
+.list tbody th, .list tbody td { border-bottom: solid 1px #ccc; }
+.list .odd th, .list .odd td { background: #f6f6f6; }
+.list .c1 { width: 64px; }
+.list .c3 { width: 40px; }
+
+/* Ruling Slide */
+.rslide {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ overflow: hidden;
+ background: #222;
+ clear: both;
+ /*z-index: 99;*/
+ min-height: 250px;
+
+ transition: all 0.3s ease;
+ -webkit-transition: all 0.3s ease;
+ -moz-transition: all 0.3s ease;
+ }
+.rslide.fullscreen { position: fixed; z-index: 99; }
+.rslideinside {
+ /*
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ overflow: hidden;
+ */
+ }
+.comp {
+ width: 100%;
+ height: auto;
+ overflow: hidden;
+ position: relative;
+
+ transition: all 0.3s ease;
+ -webkit-transition: all 0.3s ease;
+ -moz-transition: all 0.3s ease;
+ }
+.comp img{ display: block; width: auto; height: auto; margin: 0 auto; cursor: pointer; min-height: 250px; }
+.comp .full{ width: auto; height: auto; max-width: 100%; max-height: 100%; }
+.rslidenav {
+ position: absolute;
+ top: 50%;
+ left: 0;
+ right: 0;
+ margin-top: -35px;
+ }
+.rslidenav a {
+ position: absolute;
+ display: block;
+ width: 30px;
+ height: 40px;
+ overflow: hidden;
+ text-indent: -999px;
+ background: #000 0 center url(../../../assets/custom_gallery/slidenav.png) no-repeat;
+ background: rgba(0,0,0,0.9) 0 0 url(../../../assets/custom_gallery/slidenav.png) no-repeat;
+
+ transition: all 0.3s ease;
+ -webkit-transition: all 0.3s ease;
+ -moz-transition: all 0.3s ease;
+ -ms-transition: all 0.3s ease;
+ }
+.rslidenav a:hover {
+ background-color: #fff;
+ background-color: rgba(255,255,255,0.9);
+ }
+.rslidenav .navP { left: 0; border-radius: 0 4px 4px 0; background-position: 0 -40px; }
+.rslidenav .navN { right: 0; border-radius: 4px 0 0 4px; background-position: -30px 0; }
+.rslidenav a.navP:hover { background-position: -30px -40px; }
+.rslidenav a.navN:hover { background-position: 0 0; }
+.slidectrl {
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ width: 100%;
+ height: 30px;
+ background: #000 left top url(../../../assets/custom_gallery/slidetitlebg.png) repeat-x;
+ background: rgba(0,0,0,0.9) left top url(../../../assets/custom_gallery/slidetitlebg.png) repeat-x;
+ /*z-index: 999;*/
+ }
+.slidectrl a {
+ display: block;
+ float: right;
+ text-indent: -9999px;
+ overflow: hidden;
+ width: 30px;
+ height: 30px;
+ background: transparent 0 0 url(../../../assets/custom_gallery/slideui.gif) no-repeat;
+ border-left: solid 1px #222;
+ }
+.slidectrl a.togglelist { background-position: 0 -30px; }
+.slidectrl a.togglescreen { background-position: 0 -90px; }
+.slidectrl a.toinline { background-position: -30px 0; }
+.slidectrl a.sharebt { background-position: -30px -30px; }
+.slidectrl a.browserfullscreen { display:none;}
+.slidectrl a.slidestop { background-position: 0 -60px; }
+.fullscreen .slidectrl a.togglescreen { background-position: -30px -90px; }
+.browserFullScreen .slidectrl a.browserfullscreen { background-position: -30px 0; }
+.browserFullScreen .togglescreen { display: none; }
+.slideinfo {
+ height: 30px;
+ line-height: 30px;
+ color: #fff;
+ font-size: 13px;
+ overflow: hidden;
+ }
+.slideinfo .info { padding: 0 0 0 6px; text-transform: uppercase; }
+.slideinfo span.info { color: #ccc; text-transform: none; }
+
+.slidelist {
+ position: absolute;
+ bottom: 30px;
+ z-index: 99;
+ width: 100%;
+ height: 0;
+ overflow: auto;
+ overflow-x: hidden;
+ background: transparent 0 0 url(../../../assets/custom_gallery/slidelistbg.png);
+ }
+.slidelist ul {
+ margin: 0 auto;
+ padding: 10px 0 10px 10px;
+ list-style: none;
+ }
+.slidelist li {
+ display: inline-block;
+ margin: 0 10px 10px 0;
+ }
+.slidelist a {
+ border: solid 2px #fff;
+ display: block;
+ width: 150px;
+ height: 120px;
+ position: relative;
+
+ box-shadow: 0 0 6px rgba(0,0,0,0.7);
+ -webkit-box-shadow: 0 0 6px rgba(0,0,0,0.7);
+ -moz-box-shadow: 0 0 6px rgba(0,0,0,0.7);
+ -ms-box-shadow: 0 0 6px rgba(0,0,0,0.7);
+ }
+.slidelist a.playall {
+ border: none;
+ width: 80px;
+ height: 32px;
+ margin: 31px 0 0 22px;
+ background: transparent 0 0 url(../../../assets/custom_gallery/playall.png) no-repeat;
+
+ box-shadow: none;
+ -webkit-box-shadow: none;
+ -moz-box-shadow: none;
+ -ms-box-shadow: none;
+ }
+.slidelist a.playall:hover { background-position: 0 -32px; }
+#li_play_all { width: 124px; height: 94px; }
+.slidelist img {
+ margin: 0;
+ background: #fff;
+ display: block;
+
+ transition: all 0.2s ease;
+ -webkit-transition: all 0.2s ease;
+ -moz-transition: all 0.2s ease;
+ -ms-transition: all 0.2s ease;
+ }
+.slidelist a:hover img {
+ padding: 4px;
+ margin: -4px;
+ }
+
+.dm {
+ background: #fff;
+ border: solid 1px #a4a4a4;
+ border-right-color: #666;
+ position: absolute;
+ overflow: hidden;
+ padding: 2px 0;
+ display: none;
+
+ border-radius: 4px;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ -ms-border-radius: 4px;
+ }
+.dm ul { margin: 0; padding: 0; list-style: none !important; }
+.dm li {
+ margin: 0;
+ padding: 0;
+ border-bottom: solid 1px #ccc;
+ list-style: none !important;
+ }
+.dm li a {
+ display: block;
+ padding: 6px 10px;
+ font-size: 13px;
+
+ transition: all 0.3s ease;
+ -webkit-transition: all 0.3s ease;
+ -moz-transition: all 0.3s ease;
+ -ms-transition: all 0.3s ease;
+ }
+.dm li a:hover { background: #eee; }
+
+/* Ruling CustomGallery UI */
+.rgbt {
+ padding: 0 0 0 32px;
+ vertical-align: top;
+
+ text-shadow: 0 1px 0 #fff;
+ -webkit-text-shadow: 0 1px 0 #fff;
+ -moz-text-shadow: 0 1px 0 #fff;
+ -ms-text-shadow: 0 1px 0 #fff;
+ }
+.rgbt span {
+ padding: 0 12px 0 8px;
+ display: inline-block;
+ line-height: 30px;
+ height: 32px;
+ font-size: 14px;
+ }
+
+.rgbtsg {
+ padding: 6px;
+ }
+.rgphoto_edit .rgbtsg.active { display: inline-block; }
+.bt-finish { display: block; float: right; clear: both; }
+.bt-addnew {
+ margin: 0 auto;
+ width: 98px;
+ height: 100px;
+ display: block;
+ }
+.bt-next{
+ background-position: 0 -258px;
+ display: block;
+ float: right;
+ clear: both;
+ }
+.bt-next:hover { background-position: 0 -448px; }
+.bt-next:active { background-position: 0 -638px; }
+.bt-close {
+ position: absolute;
+ right: 6px;
+ top: 6px;
+ }
+
+
+.inputui {
+ margin: 0 0 8px 0;
+ }
+.inputui span {
+ padding: 0 4px 0 0;
+ display: block;
+ }
+.rginput { max-width: 400px; }
+.rginput input, .rginput textarea { color: #999; }
+.rginput.focus input, .rginput.focus textarea { color: #333; }
+
+.rgih26 { width: 208px; }
+.rgih26 span { }
+.rgih26 input { width: 356px; }
+.rgih26.focus { }
+.rgih26.focus span { }
+.rgih68 { width: 396px; }
+.rgih68 span { padding: 3px 4px 3px 0; }
+.rgih68 textarea { width: 392px; height: 62px; }
+.rgih68.focus { }
+.rgih68.focus span { }
+.rgih98 { width: 396px; }
+.rgih98 span { }
+.rgih98 textarea { width: 356px; height: 110px; }
+.rgih98.focus { }
+.rgih98.focus span { }
+
+.w380 { width: 386px; }
+
+#imgholder { overflow: hidden; }
+
+/* upload panel */
+#upload_panel_holder {
+ display: none;
+ margin: 16px 0 0 0;
+ clear: both;
+ float: right;
+ width: 100%;
+}
+#upload_panel {
+ background-color: #ddd;
+}
+
+/* tag panel */
+#tag_panel {
+ position: fixed;
+ right: -200px;
+ top: 31px;
+ width: 200px;
+ min-height: 100px;
+ border-left: solid 1px #ccc;
+ background-color: #fff;
+}
+#tag_panel .scrollbar {
+ right: 0px;
+ top: 0px;
+ width: 9px;
+}
+#tag_panel .viewport {
+ height: 100%;
+}
+
+.tag_list {
+ margin: 0;
+ padding: 0;
+}
+.tag_list li {
+ padding: 4px 6px;
+ border-top: solid 1px #f6f6f6;
+}
+.tag_list li:first-child {
+ border: 0;
+}
+.tag_list li:hover {
+ background-color: #08c;
+}
+.tag_list li:hover label {
+ color: #fff;
+}
+.tag_list input[type=checkbox], .tag_list label {
+ display: inline-block;
+ vertical-align: middle;
+ text-transform: capitalize;
+ margin: 0;
+}
+.tag_list label {
+ padding: 0 6px;
+}
+.tag_search {
+ position: absolute;
+ left: -1px;
+ bottom: -30px;
+ width: 200px;
+ height: 32px;
+ background-color: #f5f5f5;
+ border-left: solid 1px #ccc;
+ border-top: solid 1px #ddd;
+}
+.tag_search input[type=text] {
+ box-shadow: none;
+ width: 92px;
+ height: 25px;
+ line-height: 25px;
+ padding: 3px 6px 3px 24px;
+ border: 0;
+ border-top: solid 1px #fff;
+}
+.tag_search input[type=text]:focus {
+ background-color: #fff;
+}
+.tag_search .icon-search {
+ position: absolute;
+ left: 6px;
+ top: 50%;
+ margin-top: -7px;
+}
+#tag_panel .tag_save {
+ position: absolute;
+ right: 0;
+ bottom: 0;
+ height: 31px;
+ border-left: solid 1px #ccc;
+ background-color: #fff;
+ padding: 2px 4px 0 4px;
+}
+
+
+/* orbit style implementation */
+#orbit_custom_gallery {
+ margin-bottom: 30px;
+}
+#orbit_custom_gallery .nav-tabs, #orbit_custom_gallery .tab-pane {
+ margin-left: 8px;
+ margin-right: 8px;
+}
+.tab_content .tab-pane{
+ display: none;
+}
+.tab_content .active{
+ display: block;
+}
+#orbit_custom_gallery .btn { margin: 0; }
+#orbit_custom_gallery .btn i { margin-right: 4px; }
+#orbit_custom_gallery .rgfn .btn {
+ margin-left: 8px;
+}
+#orbit_custom_gallery .form-actions { background-color: whiteSmoke; }
+
+.o_custom_gallery .tagnames {
+ display: block;
+ margin-top: 6px;
+}
+.o_custom_gallery .label-tags {
+ display: inline-block;
+ margin: 0 6px 6px 0;
+}
+
+.o_custom_gallery .rgbody, .o_custom_album .rgbody {
+ padding: 10px 8px;
+}
+
+#categories .add-custom_album .control-label {
+ text-align: left;
+ width: 100px;
+ padding-left: 12px;
+ padding-right: 12px;
+}
+.o_custom_album_edit form {
+ margin-left: 8px;
+}
+
+#loading{
+ background: #fff 0 center url("../../../assets/loading.gif") no-repeat;
+ height: 16px;
+ margin: auto;
+ width: 220px;
+}
diff --git a/custom_gallery/app/assets/stylesheets/custom_theater.css b/custom_gallery/app/assets/stylesheets/custom_theater.css
new file mode 100644
index 0000000..9bc8102
--- /dev/null
+++ b/custom_gallery/app/assets/stylesheets/custom_theater.css
@@ -0,0 +1,536 @@
+@import url(https://fonts.googleapis.com/css?family=Roboto);
+
+/* Reset and basic styles */
+
+body {
+ overflow-x: hidden;
+}
+
+*,
+*:before,
+*:after {
+ box-sizing: border-box;
+}
+
+.custom_gallery-mode-on {
+ /*overflow-y: hidden;*/
+}
+
+
+/* CustomGallery */
+
+#custom_gallery-theater-stage {
+ display: none;
+}
+
+#custom_gallery-theater-stage > .custom_gallery {
+ position: fixed;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ background: #000;
+ z-index: 2000;
+}
+
+.custom_gallery-loader {
+ padding: 10px;
+ position: absolute;
+ display: none;
+ left: 50%;
+ top: 10px;
+ -webkit-transform: translate(-50%, 50%);
+ transform: translate(-50%, 50%);
+ border-radius: 2px;
+ z-index: 2000;
+ background-color: rgba(0, 0, 0, .6);
+ -webkit-transition: .3s all;
+ transition: .3s all;
+}
+
+.spinner {
+ margin: 0 auto;
+ width: 50px;
+ height: 20px;
+ text-align: center;
+ font-size: 0.625rem;
+}
+
+.spinner > div {
+ background-color: #e8e8e8;
+ height: 100%;
+ width: 4px;
+ display: inline-block;
+ -webkit-animation: stretchdelay 1.2s infinite ease-in-out;
+ animation: stretchdelay 1.2s infinite ease-in-out;
+}
+
+.spinner .rect2 {
+ -webkit-animation-delay: -1.1s;
+ animation-delay: -1.1s;
+}
+
+.spinner .rect3 {
+ -webkit-animation-delay: -1.0s;
+ animation-delay: -1.0s;
+}
+
+.spinner .rect4 {
+ -webkit-animation-delay: -0.9s;
+ animation-delay: -0.9s;
+}
+
+.spinner .rect5 {
+ -webkit-animation-delay: -0.8s;
+ animation-delay: -0.8s;
+}
+
+@-webkit-keyframes stretchdelay {
+ 0%,
+ 40%,
+ 100% {
+ -webkit-transform: scaleY(0.4)
+ }
+ 20% {
+ -webkit-transform: scaleY(1.0)
+ }
+}
+
+@keyframes stretchdelay {
+ 0%,
+ 40%,
+ 100% {
+ transform: scaleY(0.4);
+ -webkit-transform: scaleY(0.4);
+ }
+ 20% {
+ transform: scaleY(1.0);
+ -webkit-transform: scaleY(1.0);
+ }
+}
+
+.custom_gallery-actions {
+ position: absolute;
+ right: 1rem;
+ top: 1rem;
+ cursor: pointer;
+ background: rgba(255, 255, 255, .7);
+ border-radius: 2px;
+ z-index: 2000;
+}
+
+.custom_gallery-actions-btn {
+ padding: 8px 12px 8px 10px;
+ display: inline-block;
+}
+
+.custom_gallery-actions-btn:hover {
+ color: #fff;
+}
+
+.touch .custom_gallery-actions-btn {
+ padding: 12px 15px 12px 15px;
+}
+
+.custom_gallery-toggle-desc.active {
+ color: #fff;
+}
+
+.custom_gallery-theme-switch {
+ border-right: 1px solid rgba(255, 255, 255, .2);
+ border-left: 1px solid rgba(255, 255, 255, .2);
+}
+
+.custom_gallery-close {
+ color: #000;
+}
+
+.touch .image-container {
+ height: 100%;
+ padding-bottom: 150px;
+ z-index: 800;
+}
+
+.custom_gallery-image {
+ position: fixed;
+ left: 50%;
+ top: 50%;
+ width: 60%;
+ height: auto;
+ cursor: pointer;
+}
+
+.no-touch .custom_gallery-image {
+ -webkit-transition: .3s all;
+ transition: .3s all;
+}
+
+.gal-prev {
+ display: none;
+ left: 0;
+ -webkit-transform: translate(-95%, -50%);
+ transform: translate(-95%, -50%);
+}
+
+.gal-prev:hover {
+ -webkit-transform: translate(-94%, -50%);
+ transform: translate(-94%, -50%);
+}
+
+.gal-next {
+ display: none;
+ left: auto;
+ right: 0;
+ -webkit-transform: translate(95%, -50%);
+ transform: translate(95%, -50%);
+}
+
+.gal-next:hover {
+ -webkit-transform: translate(94%, -50%);
+ transform: translate(94%, -50%);
+}
+
+.gal-inactive {
+ -webkit-transition: .3s all;
+ transition: .3s all;
+ opacity: .3;
+}
+
+.gal-inactive:hover {
+ opacity: 1;
+}
+
+.gal-active {
+ display: none;
+ -webkit-transform: translate(-50%, -50%);
+ transform: translate(-50%, -50%);
+}
+
+
+/* Thumbnails */
+
+.custom_gallery-thumb-toggle {
+ position: absolute;
+ bottom: -1000px;
+}
+
+.custom_gallery-thumb-wrap {
+ overflow-y: hidden;
+ overflow-x: hidden;
+ list-style: none;
+ margin: 0 auto;
+ padding: 10px 0;
+ text-align: center;
+ white-space: nowrap;
+ position: absolute;
+ left: 50%;
+ bottom: 0;
+ -webkit-transition: .3s all;
+ transition: .3s all;
+}
+
+.custom_gallery-item {
+ margin-right: 1em;
+ display: inline-block;
+}
+
+.custom_gallery-item.active {
+ border-radius: 2px;
+ border-radius: 0.125rem;
+ border: 5px solid #fff;
+}
+
+.custom_gallery-thumb {
+ width: 50px;
+ height: 50px;
+ opacity: .5;
+ -webkit-transition: .3s opacity;
+ transition: .3s opacity;
+}
+
+.custom_gallery-thumb:hover {
+ opacity: 1;
+}
+
+.custom_gallery-thumb-container {
+ height: 80px;
+ position: fixed;
+ left: 0;
+ bottom: 0;
+ width: 100%;
+ background: #1b1b1b;
+}
+
+.custom_gallery-thumb-navs {
+ display: none;
+}
+
+.custom_gallery-thumb-navs.show {
+ display: block;
+}
+
+.custom_gallery-thumb-nav {
+ position: absolute;
+ cursor: pointer;
+ font-size: 1.4rem;
+ color: rgba(255, 255, 255, .7);
+ background: #222;
+ height: 80px;
+ line-height: 80px;
+ width: 50px;
+ text-align: center;
+ z-index: 900;
+}
+
+.custom_gallery-thumb-nav:hover {
+ color: #fff;
+}
+
+.custom_gallery-thumb-prev {
+ left: 0;
+}
+
+.custom_gallery-thumb-next {
+ right: 0;
+}
+
+.active .custom_gallery-thumb {
+ opacity: 1;
+}
+
+.custom_gallery-img-desc {
+ color: #000;
+ line-height: 1.7;
+ padding: 1rem 1.5rem;
+ font-family: 'Roboto', sans-serif;
+ font-size: 0.8125rem;
+ position: fixed;
+ top: 4rem;
+ left: 0;
+ right: 0;
+ margin: auto;
+ border-radius: 2px;
+ width: 90%;
+ background-color: #bdbdbd;
+ opacity: 0;
+ -webkit-transition: .3s all;
+ transition: .3s all;
+ z-index: 1000;
+}
+
+.custom_gallery-img-desc p {
+ overflow: hidden;
+ height: 90px;
+}
+
+.custom_gallery-img-desc:empty {
+ display: none;
+}
+
+.custom_gallery-img-desc.active {
+ opacity: 1;
+}
+
+
+/* White theme */
+
+.theme-white #custom_gallery-theater-stage > .custom_gallery {
+ background-color: #fffdf7;
+}
+
+.theme-white .custom_gallery-actions {
+ background-color: #eee;
+ border: 1px solid #ddd;
+}
+
+.theme-white .custom_gallery-toggle-desc.active {
+ color: #ff4444;
+}
+
+.theme-white .custom_gallery-theme-switch {
+ border-right: 1px solid #ddd;
+ border-left: 1px solid #ddd;
+}
+
+.theme-white .custom_gallery-thumb-toggle,
+.theme-white .custom_gallery-thumb-toggle:before,
+.theme-white .custom_gallery-thumb-toggle:after {
+ color: #777;
+ border-color: #aaa;
+}
+
+.theme-white .custom_gallery-thumb-container {
+ background-color: #e2e2e2;
+ border-top: 1px solid #c7c7c7;
+}
+
+.theme-white .custom_gallery-actions-btn {
+ color: #777;
+}
+
+.theme-white .custom_gallery-actions-btn:hover {
+ color: #ff4444;
+}
+
+.theme-white .custom_gallery-item.active {
+ border-color: #ff4444;
+}
+
+.theme-white .custom_gallery-thumb-nav {
+ color: #777;
+ background-color: #eee;
+}
+
+.theme-white .custom_gallery-thumb-prev {
+ border-right: 1px solid #c7c7c7;
+}
+
+.theme-white .custom_gallery-thumb-next {
+ border-left: 1px solid #c7c7c7;
+}
+
+.theme-white .custom_gallery-thumb-nav:hover {
+ color: #ff4444;
+}
+
+.theme-white .custom_gallery-img-desc {
+ background-color: #eee;
+}
+
+.theme-white .custom_gallery-loader {
+ background-color: #777;
+}
+
+.theme-white .spinner > div {
+ color: #ff4444;
+}
+
+@media screen and (max-width: 768px) {
+ .gal-prev {
+ -webkit-transform: translate(-101%, -50%);
+ transform: translate(-101%, -50%);
+ }
+ .gal-next {
+ -webkit-transform: translate(101%, -50%);
+ transform: translate(101%, -50%);
+ }
+ .custom_gallery-thumb-toggle {
+ bottom: 50px;
+ left: 0;
+ color: #fff;
+ width: 100%;
+ text-align: center;
+ -webkit-transition: .1s all;
+ transition: .1s all;
+ }
+ .custom_gallery-thumb-toggle.up {
+ bottom: 96px;
+ }
+ .custom_gallery-thumb-toggle:before {
+ content: "";
+ position: absolute;
+ top: 50%;
+ left: 10%;
+ margin: auto;
+ width: 38%;
+ border-top: 1px solid rgba(255, 255, 255, .2);
+ height: 1px;
+ }
+ .custom_gallery-thumb-toggle:after {
+ content: "";
+ position: absolute;
+ top: 50%;
+ right: 10%;
+ margin: auto;
+ width: 38%;
+ border-top: 1px solid rgba(255, 255, 255, .2);
+ height: 1px;
+ }
+ .custom_gallery-thumb-container {
+ bottom: -1000px;
+ -webkit-transition: .1s all;
+ transition: .1s all;
+ }
+ .custom_gallery-thumb-container.show {
+ bottom: 0;
+ }
+}
+
+/* CSS for button */
+
+@media(max-width: 769px){
+ .custom_gallery .custom_gallery-thumb-toggle{
+ display: none;
+ }
+ }
+
+/* 相本裡的左右控制鍵 */
+#theaterPlayButton,#theaterStopButton{
+ left:30%;
+}
+#theaterStopButton{
+ -webkit-text-stroke: 0.02em #ffbb35;
+ text-shadow: 0em 0em 0.2em #ff0000;
+}
+.theaterButton{
+position: absolute;
+text-align: center;
+width: 35%;
+bottom: 1.8em;
+background-color: transparent;
+border: none;
+color: white;
+padding: 0.4em 1em;
+text-align: center;
+text-decoration: none;
+display: inline-block;
+font-size: 2.2rem;
+margin: 4px 2px;
+cursor: pointer;
+border-radius: 5px;
+-webkit-text-stroke: 1px #06a2ff;
+text-shadow: 0em 0em 0.2em #8F7;
+}
+
+#theaterNextButton{
+right:0;
+}
+#theaterPreviousButton{
+left:0;
+}
+
+.show-custom_gallery-2 .custom_gallery-thumb-container{
+ overflow: hidden;
+}
+.show-custom_gallery-2 img.custom_gallery-image{
+ position: absolute;
+}
+.show-custom_gallery-2 .image-container{
+ position: relative;
+ height: 100%;
+ width: 100%;
+}
+#custom_gallery-theater-stage > .show-custom_gallery-2.custom_gallery{
+ position: relative;
+ height: 0;
+ width: 100%;
+ z-index: unset;
+ overflow: hidden;
+}
+.show-custom_gallery-2 .custom_gallery-thumb-container{
+ position: absolute;
+}
+.show-custom_gallery-2 .custom_gallery-image {
+ top: 42%;
+}
+.show-custom_gallery-2 .custom_gallery-actions{
+ display: none;
+}
+.show-custom_gallery-2 .custom_gallery-img-desc{
+ position: absolute;
+}
+@media screen and (max-width: 768px){
+ .show-custom_gallery-2 .custom_gallery-thumb-container {
+ bottom: 0px;
+ }
+}
\ No newline at end of file
diff --git a/custom_gallery/app/assets/stylesheets/filter.css b/custom_gallery/app/assets/stylesheets/filter.css
new file mode 100644
index 0000000..6e76a70
--- /dev/null
+++ b/custom_gallery/app/assets/stylesheets/filter.css
@@ -0,0 +1,84 @@
+/* Filter */
+#filter.open {
+ border-bottom: none;
+ padding-bottom: 10px;
+}
+#filter .filter-nav {
+ margin-bottom: 0px;
+}
+#filter.open .filter-nav {
+ margin-bottom: 10px;
+}
+#filter .filter-nav a {
+ text-decoration: none;
+}
+#filter .filter-nav .accordion-group {
+ border: none;
+}
+#filter .filter-nav .accordion-group.active {
+ background-color: #08c;
+ position: relative;
+}
+#filter .filter-nav .accordion-group.active a {
+ color: #FFF;
+}
+#filter .filter-nav .accordion-group.active:after {
+ display: block;
+ height: 0px;
+ width: 0px;
+ position: absolute;
+ bottom: -12px;
+ left: 50%;
+ margin-left: -5px;
+ content: "";
+ border-style: solid;
+ border-width: 0 6px 6px 6px;
+ border-color: transparent transparent #e5e5e5 transparent;
+ z-index: 5
+}
+#filter .filter-group {
+ clear: both;
+ border: none;
+ margin-bottom: 0px;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ -o-border-radius: 4px;
+ border-radius: 4px;
+}
+#filter .filter-group .accordion-body {
+ background-color: #e5e5e5;
+ border-radius: 3px;
+}
+#filter .filter-group .accordion-body .filter-clear {
+ padding: 4px;
+ border-top: 1px solid #D5D5D5;
+ text-align: right;
+ -webkit-box-shadow: inset 0px 1px 0px #ECECEC;
+ -moz-box-shadow: inset 0px 1px 0px #ECECEC;
+ -o-box-shadow: inset 0px 1px 0px #ECECEC;
+ box-shadow: inset 0px 1px 0px #ECECEC;
+}
+#filter .filter-group .accordion-body .filter-clear a {
+ text-decoration: none;
+}
+#filter .filter-group .collapse.in {
+}
+#filter .filter-group .accordion-inner {
+ padding: 8px 8px 5px;
+ /*margin-top: 10px;*/
+}
+#filter .filter-group .accordion-inner > .btn {
+ margin-bottom: 3px;
+}
+
+
+/* Responsive */
+@media (max-width: 480px) {
+ /* Filter */
+ #filter .filter-nav {
+ float: left;
+ }
+ #filter .accordion-inner.pagination-right {
+ text-align: left;
+ }
+}
\ No newline at end of file
diff --git a/custom_gallery/app/assets/stylesheets/jquery-ui.css b/custom_gallery/app/assets/stylesheets/jquery-ui.css
new file mode 100644
index 0000000..759a187
--- /dev/null
+++ b/custom_gallery/app/assets/stylesheets/jquery-ui.css
@@ -0,0 +1,566 @@
+/*
+ * jQuery UI CSS Framework 1.8.16
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Theming/API
+ */
+
+/* Layout helpers
+----------------------------------*/
+.ui-helper-hidden { display: none; }
+.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
+.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
+.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
+.ui-helper-clearfix { display: inline-block; }
+/* required comment for clearfix to work in Opera \*/
+* html .ui-helper-clearfix { height:1%; }
+.ui-helper-clearfix { display:block; }
+/* end clearfix */
+.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
+
+
+/* Interaction Cues
+----------------------------------*/
+.ui-state-disabled { cursor: default !important; }
+
+
+/* Icons
+----------------------------------*/
+
+/* states and images */
+.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
+
+
+/* Misc visuals
+----------------------------------*/
+
+/* Overlays */
+.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
+/*
+ * jQuery UI Accordion 1.8.16
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Accordion#theming
+ */
+/* IE/Win - Fix animation bug - #4615 */
+.ui-accordion { width: 100%; }
+.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
+.ui-accordion .ui-accordion-li-fix { display: inline; }
+.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
+.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; }
+.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
+.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
+.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }
+.ui-accordion .ui-accordion-content-active { display: block; }
+/*
+ * jQuery UI Autocomplete 1.8.16
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Autocomplete#theming
+ */
+.ui-autocomplete { position: absolute; cursor: default; }
+
+/* workarounds */
+* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
+
+/*
+ * jQuery UI Menu 1.8.16
+ *
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Menu#theming
+ */
+.ui-menu {
+ list-style:none;
+ padding: 2px;
+ margin: 0;
+ display:block;
+ float: left;
+}
+.ui-menu .ui-menu {
+ margin-top: -3px;
+}
+.ui-menu .ui-menu-item {
+ margin:0;
+ padding: 0;
+ zoom: 1;
+ float: left;
+ clear: left;
+ width: 100%;
+}
+.ui-menu .ui-menu-item a {
+ text-decoration:none;
+ display:block;
+ padding:.2em .4em;
+ line-height:1.5;
+ zoom:1;
+}
+.ui-menu .ui-menu-item a.ui-state-hover,
+.ui-menu .ui-menu-item a.ui-state-active {
+ font-weight: normal;
+ margin: -1px;
+}
+/*
+ * jQuery UI Button 1.8.16
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Button#theming
+ */
+.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
+.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
+button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
+.ui-button-icons-only { width: 3.4em; }
+button.ui-button-icons-only { width: 3.7em; }
+
+/*button text element */
+.ui-button .ui-button-text { display: block; line-height: 1.4; }
+.ui-button-text-only .ui-button-text { padding: .4em 1em; }
+.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
+.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
+.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
+.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
+/* no icon support for input elements, provide padding by default */
+input.ui-button { padding: .4em 1em; }
+
+/*button icon element(s) */
+.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
+.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
+.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
+.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
+.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
+
+/*button sets*/
+.ui-buttonset { margin-right: 7px; }
+.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
+
+/* workarounds */
+button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
+/*
+ * jQuery UI Datepicker 1.8.16
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Datepicker#theming
+ */
+.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
+.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
+.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
+.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
+.ui-datepicker .ui-datepicker-prev { left:2px; }
+.ui-datepicker .ui-datepicker-next { right:2px; }
+.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
+.ui-datepicker .ui-datepicker-next-hover { right:1px; }
+.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
+.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
+.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
+.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
+.ui-datepicker select.ui-datepicker-month,
+.ui-datepicker select.ui-datepicker-year { width: 49%;}
+.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
+.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
+.ui-datepicker td { border: 0; padding: 1px; }
+.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
+.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
+.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
+.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
+
+/* with multiple calendars */
+.ui-datepicker.ui-datepicker-multi { width:auto; }
+.ui-datepicker-multi .ui-datepicker-group { float:left; }
+.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
+.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
+.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
+.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
+.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
+.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
+.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
+.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
+
+/* RTL support */
+.ui-datepicker-rtl { direction: rtl; }
+.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
+.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
+.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
+.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
+.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
+.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
+.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
+.ui-datepicker-rtl .ui-datepicker-group { float:right; }
+.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
+.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
+
+/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
+.ui-datepicker-cover {
+ display: none; /*sorry for IE5*/
+ display/**/: block; /*sorry for IE5*/
+ position: absolute; /*must have*/
+ z-index: -1; /*must have*/
+ filter: mask(); /*must have*/
+ top: -4px; /*must have*/
+ left: -4px; /*must have*/
+ width: 200px; /*must have*/
+ height: 200px; /*must have*/
+}/*
+ * jQuery UI Dialog 1.8.16
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Dialog#theming
+ */
+.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
+.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
+.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
+.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
+.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
+.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
+.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
+.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
+.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
+.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
+.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
+.ui-draggable .ui-dialog-titlebar { cursor: move; }
+/*
+ * jQuery UI Progressbar 1.8.16
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Progressbar#theming
+ */
+.ui-progressbar { height:2em; text-align: left; }
+.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }/*
+ * jQuery UI Resizable 1.8.16
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Resizable#theming
+ */
+.ui-resizable { position: relative;}
+.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block; }
+.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
+.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
+.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
+.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
+.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
+.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
+.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
+.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
+.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*
+ * jQuery UI Selectable 1.8.16
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Selectable#theming
+ */
+.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
+/*
+ * jQuery UI Slider 1.8.16
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Slider#theming
+ */
+.ui-slider { position: relative; text-align: left; }
+.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
+.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
+
+.ui-slider-horizontal { height: .8em; }
+.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
+.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
+.ui-slider-horizontal .ui-slider-range-min { left: 0; }
+.ui-slider-horizontal .ui-slider-range-max { right: 0; }
+
+.ui-slider-vertical { width: .8em; height: 100px; }
+.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
+.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
+.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
+.ui-slider-vertical .ui-slider-range-max { top: 0; }/*
+ * jQuery UI Tabs 1.8.16
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Tabs#theming
+ */
+.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
+.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
+.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
+.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
+.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
+.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
+.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
+.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
+.ui-tabs .ui-tabs-hide { display: none !important; }
+/*
+ * jQuery UI CSS Framework 1.8.16
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Theming/API
+ *
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/
+ */
+
+
+/* Component containers
+----------------------------------*/
+.ui-widget { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1.1em/*{fsDefault}*/; }
+.ui-widget .ui-widget { font-size: 1em; }
+.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1em; }
+.ui-widget-content { border: 1px solid #aaaaaa/*{borderColorContent}*/; background: #ffffff/*{bgColorContent}*/ url(images/ui-bg_flat_75_ffffff_40x100.png)/*{bgImgUrlContent}*/ 50%/*{bgContentXPos}*/ 50%/*{bgContentYPos}*/ repeat-x/*{bgContentRepeat}*/; color: #222222/*{fcContent}*/; }
+.ui-widget-content a { color: #222222/*{fcContent}*/; }
+.ui-widget-header { border: 1px solid #aaaaaa/*{borderColorHeader}*/; background: #cccccc/*{bgColorHeader}*/ url(images/ui-bg_highlight-soft_75_cccccc_1x100.png)/*{bgImgUrlHeader}*/ 50%/*{bgHeaderXPos}*/ 50%/*{bgHeaderYPos}*/ repeat-x/*{bgHeaderRepeat}*/; color: #222222/*{fcHeader}*/; font-weight: bold; }
+.ui-widget-header a { color: #222222/*{fcHeader}*/; }
+
+/* Interaction states
+----------------------------------*/
+.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3/*{borderColorDefault}*/; background: #e6e6e6/*{bgColorDefault}*/ url(images/ui-bg_glass_75_e6e6e6_1x400.png)/*{bgImgUrlDefault}*/ 50%/*{bgDefaultXPos}*/ 50%/*{bgDefaultYPos}*/ repeat-x/*{bgDefaultRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #555555/*{fcDefault}*/; }
+.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555/*{fcDefault}*/; text-decoration: none; }
+.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999/*{borderColorHover}*/; background: #dadada/*{bgColorHover}*/ url(images/ui-bg_glass_75_dadada_1x400.png)/*{bgImgUrlHover}*/ 50%/*{bgHoverXPos}*/ 50%/*{bgHoverYPos}*/ repeat-x/*{bgHoverRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcHover}*/; }
+.ui-state-hover a, .ui-state-hover a:hover { color: #212121/*{fcHover}*/; text-decoration: none; }
+.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa/*{borderColorActive}*/; background: #ffffff/*{bgColorActive}*/ url(images/ui-bg_glass_65_ffffff_1x400.png)/*{bgImgUrlActive}*/ 50%/*{bgActiveXPos}*/ 50%/*{bgActiveYPos}*/ repeat-x/*{bgActiveRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcActive}*/; }
+.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121/*{fcActive}*/; text-decoration: none; }
+.ui-widget :active { outline: none; }
+
+/* Interaction Cues
+----------------------------------*/
+.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1/*{borderColorHighlight}*/; background: #fbf9ee/*{bgColorHighlight}*/ url(images/ui-bg_glass_55_fbf9ee_1x400.png)/*{bgImgUrlHighlight}*/ 50%/*{bgHighlightXPos}*/ 50%/*{bgHighlightYPos}*/ repeat-x/*{bgHighlightRepeat}*/; color: #363636/*{fcHighlight}*/; }
+.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636/*{fcHighlight}*/; }
+.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a/*{borderColorError}*/; background: #fef1ec/*{bgColorError}*/ url(images/ui-bg_glass_95_fef1ec_1x400.png)/*{bgImgUrlError}*/ 50%/*{bgErrorXPos}*/ 50%/*{bgErrorYPos}*/ repeat-x/*{bgErrorRepeat}*/; color: #cd0a0a/*{fcError}*/; }
+.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a/*{fcError}*/; }
+.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a/*{fcError}*/; }
+.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
+.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
+.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
+
+/* Icons
+----------------------------------*/
+
+/* states and images */
+.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; }
+.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; }
+.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png)/*{iconsHeader}*/; }
+.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png)/*{iconsDefault}*/; }
+.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png)/*{iconsHover}*/; }
+.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png)/*{iconsActive}*/; }
+.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png)/*{iconsHighlight}*/; }
+.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png)/*{iconsError}*/; }
+
+/* positioning */
+.ui-icon-carat-1-n { background-position: 0 0; }
+.ui-icon-carat-1-ne { background-position: -16px 0; }
+.ui-icon-carat-1-e { background-position: -32px 0; }
+.ui-icon-carat-1-se { background-position: -48px 0; }
+.ui-icon-carat-1-s { background-position: -64px 0; }
+.ui-icon-carat-1-sw { background-position: -80px 0; }
+.ui-icon-carat-1-w { background-position: -96px 0; }
+.ui-icon-carat-1-nw { background-position: -112px 0; }
+.ui-icon-carat-2-n-s { background-position: -128px 0; }
+.ui-icon-carat-2-e-w { background-position: -144px 0; }
+.ui-icon-triangle-1-n { background-position: 0 -16px; }
+.ui-icon-triangle-1-ne { background-position: -16px -16px; }
+.ui-icon-triangle-1-e { background-position: -32px -16px; }
+.ui-icon-triangle-1-se { background-position: -48px -16px; }
+.ui-icon-triangle-1-s { background-position: -64px -16px; }
+.ui-icon-triangle-1-sw { background-position: -80px -16px; }
+.ui-icon-triangle-1-w { background-position: -96px -16px; }
+.ui-icon-triangle-1-nw { background-position: -112px -16px; }
+.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
+.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
+.ui-icon-arrow-1-n { background-position: 0 -32px; }
+.ui-icon-arrow-1-ne { background-position: -16px -32px; }
+.ui-icon-arrow-1-e { background-position: -32px -32px; }
+.ui-icon-arrow-1-se { background-position: -48px -32px; }
+.ui-icon-arrow-1-s { background-position: -64px -32px; }
+.ui-icon-arrow-1-sw { background-position: -80px -32px; }
+.ui-icon-arrow-1-w { background-position: -96px -32px; }
+.ui-icon-arrow-1-nw { background-position: -112px -32px; }
+.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
+.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
+.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
+.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
+.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
+.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
+.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
+.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
+.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
+.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
+.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
+.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
+.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
+.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
+.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
+.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
+.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
+.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
+.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
+.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
+.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
+.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
+.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
+.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
+.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
+.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
+.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
+.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
+.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
+.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
+.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
+.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
+.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
+.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
+.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
+.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
+.ui-icon-arrow-4 { background-position: 0 -80px; }
+.ui-icon-arrow-4-diag { background-position: -16px -80px; }
+.ui-icon-extlink { background-position: -32px -80px; }
+.ui-icon-newwin { background-position: -48px -80px; }
+.ui-icon-refresh { background-position: -64px -80px; }
+.ui-icon-shuffle { background-position: -80px -80px; }
+.ui-icon-transfer-e-w { background-position: -96px -80px; }
+.ui-icon-transferthick-e-w { background-position: -112px -80px; }
+.ui-icon-folder-collapsed { background-position: 0 -96px; }
+.ui-icon-folder-open { background-position: -16px -96px; }
+.ui-icon-document { background-position: -32px -96px; }
+.ui-icon-document-b { background-position: -48px -96px; }
+.ui-icon-note { background-position: -64px -96px; }
+.ui-icon-mail-closed { background-position: -80px -96px; }
+.ui-icon-mail-open { background-position: -96px -96px; }
+.ui-icon-suitcase { background-position: -112px -96px; }
+.ui-icon-comment { background-position: -128px -96px; }
+.ui-icon-person { background-position: -144px -96px; }
+.ui-icon-print { background-position: -160px -96px; }
+.ui-icon-trash { background-position: -176px -96px; }
+.ui-icon-locked { background-position: -192px -96px; }
+.ui-icon-unlocked { background-position: -208px -96px; }
+.ui-icon-bookmark { background-position: -224px -96px; }
+.ui-icon-tag { background-position: -240px -96px; }
+.ui-icon-home { background-position: 0 -112px; }
+.ui-icon-flag { background-position: -16px -112px; }
+.ui-icon-calendar { background-position: -32px -112px; }
+.ui-icon-cart { background-position: -48px -112px; }
+.ui-icon-pencil { background-position: -64px -112px; }
+.ui-icon-clock { background-position: -80px -112px; }
+.ui-icon-disk { background-position: -96px -112px; }
+.ui-icon-calculator { background-position: -112px -112px; }
+.ui-icon-zoomin { background-position: -128px -112px; }
+.ui-icon-zoomout { background-position: -144px -112px; }
+.ui-icon-search { background-position: -160px -112px; }
+.ui-icon-wrench { background-position: -176px -112px; }
+.ui-icon-gear { background-position: -192px -112px; }
+.ui-icon-heart { background-position: -208px -112px; }
+.ui-icon-star { background-position: -224px -112px; }
+.ui-icon-link { background-position: -240px -112px; }
+.ui-icon-cancel { background-position: 0 -128px; }
+.ui-icon-plus { background-position: -16px -128px; }
+.ui-icon-plusthick { background-position: -32px -128px; }
+.ui-icon-minus { background-position: -48px -128px; }
+.ui-icon-minusthick { background-position: -64px -128px; }
+.ui-icon-close { background-position: -80px -128px; }
+.ui-icon-closethick { background-position: -96px -128px; }
+.ui-icon-key { background-position: -112px -128px; }
+.ui-icon-lightbulb { background-position: -128px -128px; }
+.ui-icon-scissors { background-position: -144px -128px; }
+.ui-icon-clipboard { background-position: -160px -128px; }
+.ui-icon-copy { background-position: -176px -128px; }
+.ui-icon-contact { background-position: -192px -128px; }
+.ui-icon-image { background-position: -208px -128px; }
+.ui-icon-video { background-position: -224px -128px; }
+.ui-icon-script { background-position: -240px -128px; }
+.ui-icon-alert { background-position: 0 -144px; }
+.ui-icon-info { background-position: -16px -144px; }
+.ui-icon-notice { background-position: -32px -144px; }
+.ui-icon-help { background-position: -48px -144px; }
+.ui-icon-check { background-position: -64px -144px; }
+.ui-icon-bullet { background-position: -80px -144px; }
+.ui-icon-radio-off { background-position: -96px -144px; }
+.ui-icon-radio-on { background-position: -112px -144px; }
+.ui-icon-pin-w { background-position: -128px -144px; }
+.ui-icon-pin-s { background-position: -144px -144px; }
+.ui-icon-play { background-position: 0 -160px; }
+.ui-icon-pause { background-position: -16px -160px; }
+.ui-icon-seek-next { background-position: -32px -160px; }
+.ui-icon-seek-prev { background-position: -48px -160px; }
+.ui-icon-seek-end { background-position: -64px -160px; }
+.ui-icon-seek-start { background-position: -80px -160px; }
+/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
+.ui-icon-seek-first { background-position: -80px -160px; }
+.ui-icon-stop { background-position: -96px -160px; }
+.ui-icon-eject { background-position: -112px -160px; }
+.ui-icon-volume-off { background-position: -128px -160px; }
+.ui-icon-volume-on { background-position: -144px -160px; }
+.ui-icon-power { background-position: 0 -176px; }
+.ui-icon-signal-diag { background-position: -16px -176px; }
+.ui-icon-signal { background-position: -32px -176px; }
+.ui-icon-battery-0 { background-position: -48px -176px; }
+.ui-icon-battery-1 { background-position: -64px -176px; }
+.ui-icon-battery-2 { background-position: -80px -176px; }
+.ui-icon-battery-3 { background-position: -96px -176px; }
+.ui-icon-circle-plus { background-position: 0 -192px; }
+.ui-icon-circle-minus { background-position: -16px -192px; }
+.ui-icon-circle-close { background-position: -32px -192px; }
+.ui-icon-circle-triangle-e { background-position: -48px -192px; }
+.ui-icon-circle-triangle-s { background-position: -64px -192px; }
+.ui-icon-circle-triangle-w { background-position: -80px -192px; }
+.ui-icon-circle-triangle-n { background-position: -96px -192px; }
+.ui-icon-circle-arrow-e { background-position: -112px -192px; }
+.ui-icon-circle-arrow-s { background-position: -128px -192px; }
+.ui-icon-circle-arrow-w { background-position: -144px -192px; }
+.ui-icon-circle-arrow-n { background-position: -160px -192px; }
+.ui-icon-circle-zoomin { background-position: -176px -192px; }
+.ui-icon-circle-zoomout { background-position: -192px -192px; }
+.ui-icon-circle-check { background-position: -208px -192px; }
+.ui-icon-circlesmall-plus { background-position: 0 -208px; }
+.ui-icon-circlesmall-minus { background-position: -16px -208px; }
+.ui-icon-circlesmall-close { background-position: -32px -208px; }
+.ui-icon-squaresmall-plus { background-position: -48px -208px; }
+.ui-icon-squaresmall-minus { background-position: -64px -208px; }
+.ui-icon-squaresmall-close { background-position: -80px -208px; }
+.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
+.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
+.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
+.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
+.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
+.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
+
+
+/* Misc visuals
+----------------------------------*/
+
+/* Corner radius */
+.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; -khtml-border-top-left-radius: 4px/*{cornerRadius}*/; border-top-left-radius: 4px/*{cornerRadius}*/; }
+.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; -khtml-border-top-right-radius: 4px/*{cornerRadius}*/; border-top-right-radius: 4px/*{cornerRadius}*/; }
+.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; -khtml-border-bottom-left-radius: 4px/*{cornerRadius}*/; border-bottom-left-radius: 4px/*{cornerRadius}*/; }
+.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; -khtml-border-bottom-right-radius: 4px/*{cornerRadius}*/; border-bottom-right-radius: 4px/*{cornerRadius}*/; }
+
+/* Overlays */
+.ui-widget-overlay { background: #aaaaaa/*{bgColorOverlay}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlOverlay}*/ 50%/*{bgOverlayXPos}*/ 50%/*{bgOverlayYPos}*/ repeat-x/*{bgOverlayRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityOverlay}*/; }
+.ui-widget-shadow { margin: -8px/*{offsetTopShadow}*/ 0 0 -8px/*{offsetLeftShadow}*/; padding: 8px/*{thicknessShadow}*/; background: #aaaaaa/*{bgColorShadow}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlShadow}*/ 50%/*{bgShadowXPos}*/ 50%/*{bgShadowYPos}*/ repeat-x/*{bgShadowRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityShadow}*/; -moz-border-radius: 8px/*{cornerRadiusShadow}*/; -khtml-border-radius: 8px/*{cornerRadiusShadow}*/; -webkit-border-radius: 8px/*{cornerRadiusShadow}*/; border-radius: 8px/*{cornerRadiusShadow}*/; }
\ No newline at end of file
diff --git a/custom_gallery/app/assets/stylesheets/jquery.fileupload-ui.css b/custom_gallery/app/assets/stylesheets/jquery.fileupload-ui.css
new file mode 100644
index 0000000..71b8d42
--- /dev/null
+++ b/custom_gallery/app/assets/stylesheets/jquery.fileupload-ui.css
@@ -0,0 +1,168 @@
+@charset 'UTF-8';
+/*
+ * jQuery File Upload UI Plugin CSS 5.0.6
+ * https://github.com/blueimp/jQuery-File-Upload
+ *
+ * Copyright 2010, Sebastian Tschan
+ * https://blueimp.net
+ *
+ * Licensed under the MIT license:
+ * http://creativecommons.org/licenses/MIT/
+ */
+body { margin: 0; }
+#fileupload { position: relative; }
+#fileupload form { margin: 0; }
+.fileupload-buttonbar .ui-button input {
+ position: absolute;
+ top: 0;
+ right: 0;
+ margin: 0;
+ border: solid transparent;
+ border-width: 0 0 100px 200px;
+ opacity: 0;
+ filter: alpha(opacity=0);
+ -o-transform: translate(250px, -50px) scale(1);
+ -moz-transform: translate(-300px, 0) scale(4);
+ direction: ltr;
+ cursor: pointer;
+}
+
+.fileinput-button {
+ overflow: hidden;
+}
+
+/* Fix for IE 6: */
+/**html .fileinput-button {
+ padding: 2px 0;
+}*/
+
+/* Fix for IE 7: */
+/**+html .fileinput-button {
+ padding: 2px 0;
+}*/
+
+.fileupload-buttonbar {
+ height: 44px;
+ border-bottom: none;
+ background: transparent 0 0 url(../../../assets/custom_gallery/uppt.png) repeat-x;
+ position: relative;
+ z-index: 9;
+ }
+
+.fileupload-buttonbar .ui-button {
+ vertical-align: middle;
+ font-size: 13px;
+ font-family: mako;
+ border: none;
+ margin: 0;
+ padding: 0;
+ background: none;
+ }
+.fileupload-buttonbar .ui-button .ui-button-text {
+ height: 40px;
+ line-height: 40px;
+ padding: 0 14px 0 26px;
+ background: transparent right center url(../../../assets/custom_gallery/upsep.png) no-repeat;
+ text-shadow: 1px 1px 0 #fff;
+ }
+
+.fileupload-content {
+ border-top-width: 0;
+ height: 250px;
+ overflow: auto;
+ overflow-x:hidden;
+ background: #FAFAFA center center url(../../../assets/custom_gallery/uploadbg.gif) no-repeat;
+ position: relative;
+ margin-top: -2px;
+ z-index: 2;
+ }
+
+.fileupload-content .ui-progressbar {
+ width: auto;
+ height: 18px;
+ }
+
+.fileupload-content .ui-progressbar-value {
+ background: url(../../../assets/custom_gallery/pbar-ani.gif);
+ height: 16px;
+ margin: 0;
+ border-left: none;
+ border-right: none;
+ border-radius: 6px;
+ }
+.files .ui-progressbar-value { border: none; height: 18px; border-radius: 2px; }
+.fileupload-content .fileupload-progressbar {
+ width: 400px;
+ margin: -20px 0 0 -202px;
+ padding: 2px;
+ background: rgba(0,0,0,0.8);
+ position: fixed;
+ top: 50%;
+ left: 50%;
+ border: 0;
+ border-radius: 4px;
+ box-shadow: 0 2px 3px rgba(0,0,0,0.4);
+ -webkit-box-shadow: 0 2px 3px rgba(0,0,0,0.4);
+ -moz-box-shadow: 0 2px 3px rgba(0,0,0,0.4);
+ -ms-box-shadow: 0 2px 3px rgba(0,0,0,0.4);
+ }
+
+.files {
+ margin: 0;
+ border-collapse: collapse;
+ width: 100%;
+ table-layout:fixed;
+ font-family: mako;
+}
+
+.files td {
+ padding: 5px 4px;
+ border-spacing: 0;
+ font-size: 13px;
+ }
+
+.files img { border: none; width: 80px; }
+
+.files .name { }
+
+.files .size {
+ text-align: right;
+ white-space: nowrap;
+ width: 100px;
+ }
+.files .preview { width: 88px; }
+/*.files .progress { width: ; }*/
+.files .start { width: 40px; }
+.files .cancel { width: 40px; }
+
+.ui-state-disabled .ui-state-disabled {
+ opacity: 1;
+ filter: alpha(opacity=100);
+}
+
+.ui-state-disabled input {
+ cursor: default;
+}
+.fileupload-buttonbar .ui-icon {
+ background: transparent center 0 url(../../../assets/custom_gallery/upicon.png) no-repeat;
+ height: 16px;
+ margin: 0;
+ padding: 12px 0;
+ top: 0;
+ }
+.ui-icon.ui-icon-plusthick {}
+.ui-button:hover .ui-icon.ui-icon-plusthick { background-position: center -40px; }
+.ui-icon.ui-icon-circle-arrow-e { background-position: center -80px; }
+.ui-button:hover .ui-icon.ui-icon-circle-arrow-e { background-position: center -120px; }
+.ui-icon.ui-icon-cancel { background-position: center -160px; }
+.ui-button:hover .ui-icon.ui-icon-cancel { background-position: center -200px; }
+.ui-icon.ui-icon-trash { background-position: center -240px; }
+.ui-button:hover .ui-icon.ui-icon-trash { background-position: center -280px; }
+
+.files .ui-icon { background: transparent center 0 url(../../../assets/custom_gallery/upicon.png) no-repeat; }
+.files .ui-icon.ui-icon-circle-arrow-e { background-position: center -91px; }
+.files .ui-button:hover .ui-icon.ui-icon-circle-arrow-e { background-position: center -131px; }
+.files .ui-icon.ui-icon-cancel { background-position: center -171px; }
+.files .ui-button:hover .ui-icon.ui-icon-cancel { background-position: center -211px; }
+.files .ui-icon.ui-icon-trash { background-position: center -251px; }
+.files .ui-button:hover .ui-icon.ui-icon-trash { background-position: center -291px; }
\ No newline at end of file
diff --git a/custom_gallery/app/assets/stylesheets/jquery.minicolors.css b/custom_gallery/app/assets/stylesheets/jquery.minicolors.css
new file mode 100644
index 0000000..a281101
--- /dev/null
+++ b/custom_gallery/app/assets/stylesheets/jquery.minicolors.css
@@ -0,0 +1,432 @@
+.minicolors {
+ position: relative;
+}
+
+.minicolors-sprite {
+ background-image: url(jquery.minicolors.png);
+}
+
+.minicolors-swatch {
+ position: absolute;
+ vertical-align: middle;
+ background-position: -80px 0;
+ border: solid 1px #ccc;
+ cursor: text;
+ padding: 0;
+ margin: 0;
+ display: inline-block;
+}
+
+.minicolors-swatch-color {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+}
+
+.minicolors input[type=hidden] + .minicolors-swatch {
+ width: 28px;
+ position: static;
+ cursor: pointer;
+}
+
+.minicolors input[type=hidden][disabled] + .minicolors-swatch {
+ cursor: default;
+}
+
+/* Panel */
+.minicolors-panel {
+ position: relative;
+ width: 173px;
+ background: white;
+ border: solid 1px #CCC;
+ box-shadow: 0 0 20px rgba(0, 0, 0, .2);
+ z-index: 99999;
+ box-sizing: content-box;
+ display: none;
+}
+
+.minicolors-panel.minicolors-visible {
+ display: block;
+}
+
+/* Panel positioning */
+.minicolors-position-top .minicolors-panel {
+ top: -154px;
+}
+
+.minicolors-position-right .minicolors-panel {
+ right: 0;
+}
+
+.minicolors-position-bottom .minicolors-panel {
+ top: auto;
+}
+
+.minicolors-position-left .minicolors-panel {
+ left: 0;
+}
+
+.minicolors-with-opacity .minicolors-panel {
+ width: 194px;
+}
+
+.minicolors .minicolors-grid {
+ position: relative;
+ top: 1px;
+ left: 1px; /* LTR */
+ width: 150px;
+ height: 150px;
+ margin-bottom: 2px;
+ background-position: -120px 0;
+ cursor: crosshair;
+}
+[dir=rtl] .minicolors .minicolors-grid {
+ right: 1px;
+}
+
+.minicolors .minicolors-grid-inner {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 150px;
+ height: 150px;
+}
+
+.minicolors-slider-saturation .minicolors-grid {
+ background-position: -420px 0;
+}
+
+.minicolors-slider-saturation .minicolors-grid-inner {
+ background-position: -270px 0;
+ background-image: inherit;
+}
+
+.minicolors-slider-brightness .minicolors-grid {
+ background-position: -570px 0;
+}
+
+.minicolors-slider-brightness .minicolors-grid-inner {
+ background-color: black;
+}
+
+.minicolors-slider-wheel .minicolors-grid {
+ background-position: -720px 0;
+}
+
+.minicolors-slider,
+.minicolors-opacity-slider {
+ position: absolute;
+ top: 1px;
+ left: 152px; /* LTR */
+ width: 20px;
+ height: 150px;
+ background-color: white;
+ background-position: 0 0;
+ cursor: row-resize;
+}
+[dir=rtl] .minicolors-slider,
+[dir=rtl] .minicolors-opacity-slider {
+ right: 152px;
+}
+
+.minicolors-slider-saturation .minicolors-slider {
+ background-position: -60px 0;
+}
+
+.minicolors-slider-brightness .minicolors-slider {
+ background-position: -20px 0;
+}
+
+.minicolors-slider-wheel .minicolors-slider {
+ background-position: -20px 0;
+}
+
+.minicolors-opacity-slider {
+ left: 173px; /* LTR */
+ background-position: -40px 0;
+ display: none;
+}
+[dir=rtl] .minicolors-opacity-slider {
+ right: 173px;
+}
+
+.minicolors-with-opacity .minicolors-opacity-slider {
+ display: block;
+}
+
+/* Pickers */
+.minicolors-grid .minicolors-picker {
+ position: absolute;
+ top: 70px;
+ left: 70px;
+ width: 12px;
+ height: 12px;
+ border: solid 1px black;
+ border-radius: 10px;
+ margin-top: -6px;
+ margin-left: -6px;
+ background: none;
+}
+
+.minicolors-grid .minicolors-picker > div {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 8px;
+ height: 8px;
+ border-radius: 8px;
+ border: solid 2px white;
+ box-sizing: content-box;
+}
+
+.minicolors-picker {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 18px;
+ height: 2px;
+ background: white;
+ border: solid 1px black;
+ margin-top: -2px;
+ box-sizing: content-box;
+}
+
+/* Swatches */
+.minicolors-swatches,
+.minicolors-swatches li {
+ margin: 5px 0 3px 5px; /* LTR */
+ padding: 0;
+ list-style: none;
+ overflow: hidden;
+}
+[dir=rtl] .minicolors-swatches,
+[dir=rtl] .minicolors-swatches li {
+ margin: 5px 5px 3px 0;
+}
+
+.minicolors-swatches .minicolors-swatch {
+ position: relative;
+ float: left; /* LTR */
+ cursor: pointer;
+ margin:0 4px 0 0; /* LTR */
+}
+[dir=rtl] .minicolors-swatches .minicolors-swatch {
+ float: right;
+ margin:0 0 0 4px;
+}
+
+.minicolors-with-opacity .minicolors-swatches .minicolors-swatch {
+ margin-right: 7px; /* LTR */
+}
+[dir=rtl] .minicolors-with-opacity .minicolors-swatches .minicolors-swatch {
+ margin-right: 0;
+ margin-left: 7px;
+}
+
+.minicolors-swatch.selected {
+ border-color: #000;
+}
+
+/* Inline controls */
+.minicolors-inline {
+ display: inline-block;
+}
+
+.minicolors-inline .minicolors-input {
+ display: none !important;
+}
+
+.minicolors-inline .minicolors-panel {
+ position: relative;
+ top: auto;
+ left: auto; /* LTR */
+ box-shadow: none;
+ z-index: auto;
+ display: inline-block;
+}
+[dir=rtl] .minicolors-inline .minicolors-panel {
+ right: auto;
+}
+
+/* Default theme */
+.minicolors-theme-default .minicolors-swatch {
+ top: 5px;
+ left: 5px; /* LTR */
+ width: 18px;
+ height: 18px;
+}
+[dir=rtl] .minicolors-theme-default .minicolors-swatch {
+ right: 5px;
+}
+.minicolors-theme-default .minicolors-swatches .minicolors-swatch {
+ margin-bottom: 2px;
+ top: 0;
+ left: 0; /* LTR */
+ width: 18px;
+ height: 18px;
+}
+[dir=rtl] .minicolors-theme-default .minicolors-swatches .minicolors-swatch {
+ right: 0;
+}
+.minicolors-theme-default.minicolors-position-right .minicolors-swatch {
+ left: auto; /* LTR */
+ right: 5px; /* LTR */
+}
+[dir=rtl] .minicolors-theme-default.minicolors-position-left .minicolors-swatch {
+ right: auto;
+ left: 5px;
+}
+.minicolors-theme-default.minicolors {
+ width: auto;
+ display: inline-block;
+}
+.minicolors-theme-default .minicolors-input {
+ height: 20px;
+ width: auto;
+ display: inline-block;
+ padding-left: 26px; /* LTR */
+}
+[dir=rtl] .minicolors-theme-default .minicolors-input {
+ text-align: right;
+ unicode-bidi: plaintext;
+ padding-left: 1px;
+ padding-right: 26px;
+}
+.minicolors-theme-default.minicolors-position-right .minicolors-input {
+ padding-right: 26px; /* LTR */
+ padding-left: inherit; /* LTR */
+}
+[dir=rtl] .minicolors-theme-default.minicolors-position-left .minicolors-input {
+ padding-right: inherit;
+ padding-left: 26px;
+}
+
+/* Bootstrap theme */
+.minicolors-theme-bootstrap .minicolors-swatch {
+ z-index: 2;
+ top: 3px;
+ left: 3px; /* LTR */
+ width: 28px;
+ height: 28px;
+ border-radius: 3px;
+}
+[dir=rtl] .minicolors-theme-bootstrap .minicolors-swatch {
+ right: 3px;
+}
+.minicolors-theme-bootstrap .minicolors-swatches .minicolors-swatch {
+ margin-bottom: 2px;
+ top: 0;
+ left: 0; /* LTR */
+ width: 20px;
+ height: 20px;
+}
+[dir=rtl] .minicolors-theme-bootstrap .minicolors-swatches .minicolors-swatch {
+ right: 0;
+}
+.minicolors-theme-bootstrap .minicolors-swatch-color {
+ border-radius: inherit;
+}
+.minicolors-theme-bootstrap.minicolors-position-right > .minicolors-swatch {
+ left: auto; /* LTR */
+ right: 3px; /* LTR */
+}
+[dir=rtl] .minicolors-theme-bootstrap.minicolors-position-left > .minicolors-swatch {
+ right: auto;
+ left: 3px;
+}
+.minicolors-theme-bootstrap .minicolors-input {
+ float: none;
+ padding-left: 44px; /* LTR */
+}
+[dir=rtl] .minicolors-theme-bootstrap .minicolors-input {
+ text-align: right;
+ unicode-bidi: plaintext;
+ padding-left: 12px;
+ padding-right: 44px;
+}
+.minicolors-theme-bootstrap.minicolors-position-right .minicolors-input {
+ padding-right: 44px; /* LTR */
+ padding-left: 12px; /* LTR */
+}
+[dir=rtl] .minicolors-theme-bootstrap.minicolors-position-left .minicolors-input {
+ padding-right: 12px;
+ padding-left: 44px;
+}
+.minicolors-theme-bootstrap .minicolors-input.input-lg + .minicolors-swatch {
+ top: 4px;
+ left: 4px; /* LTR */
+ width: 37px;
+ height: 37px;
+ border-radius: 5px;
+}
+[dir=rtl] .minicolors-theme-bootstrap .minicolors-input.input-lg + .minicolors-swatch {
+ right: 4px;
+}
+.minicolors-theme-bootstrap .minicolors-input.input-sm + .minicolors-swatch {
+ width: 24px;
+ height: 24px;
+}
+.minicolors-theme-bootstrap .minicolors-input.input-xs + .minicolors-swatch {
+ width: 18px;
+ height: 18px;
+}
+.input-group .minicolors-theme-bootstrap:not(:first-child) .minicolors-input {
+ border-top-left-radius: 0; /* LTR */
+ border-bottom-left-radius: 0; /* LTR */
+}
+[dir=rtl] .input-group .minicolors-theme-bootstrap .minicolors-input {
+ border-radius: 4px;
+}
+[dir=rtl] .input-group .minicolors-theme-bootstrap:not(:first-child) .minicolors-input {
+ border-top-right-radius: 0;
+ border-bottom-right-radius: 0;
+}
+[dir=rtl] .input-group .minicolors-theme-bootstrap:not(:last-child) .minicolors-input {
+ border-top-left-radius: 0;
+ border-bottom-left-radius: 0;
+}
+/* bootstrap input-group rtl override */
+[dir=rtl] .input-group .form-control,
+[dir=rtl] .input-group-addon,
+[dir=rtl] .input-group-btn > .btn,
+[dir=rtl] .input-group-btn > .btn-group > .btn,
+[dir=rtl] .input-group-btn > .dropdown-toggle {
+ border: 1px solid #ccc;
+ border-radius: 4px;
+}
+[dir=rtl] .input-group .form-control:first-child,
+[dir=rtl] .input-group-addon:first-child,
+[dir=rtl] .input-group-btn:first-child > .btn,
+[dir=rtl] .input-group-btn:first-child > .btn-group > .btn,
+[dir=rtl] .input-group-btn:first-child > .dropdown-toggle,
+[dir=rtl] .input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle),
+[dir=rtl] .input-group-btn:last-child > .btn-group:not(:last-child) > .btn {
+ border-top-left-radius: 0;
+ border-bottom-left-radius: 0;
+ border-left: 0;
+}
+[dir=rtl] .input-group .form-control:last-child,
+[dir=rtl] .input-group-addon:last-child,
+[dir=rtl] .input-group-btn:last-child > .btn,
+[dir=rtl] .input-group-btn:last-child > .btn-group > .btn,
+[dir=rtl] .input-group-btn:last-child > .dropdown-toggle,
+[dir=rtl] .input-group-btn:first-child > .btn:not(:first-child),
+[dir=rtl] .input-group-btn:first-child > .btn-group:not(:first-child) > .btn {
+ border-top-right-radius: 0;
+ border-bottom-right-radius: 0;
+}
+
+/* Semantic Ui theme */
+.minicolors-theme-semanticui .minicolors-swatch {
+ top: 0;
+ left: 0; /* LTR */
+ padding: 18px;
+}
+[dir=rtl] .minicolors-theme-semanticui .minicolors-swatch {
+ right: 0;
+}
+.minicolors-theme-semanticui input {
+ text-indent: 30px;
+}
diff --git a/custom_gallery/app/assets/stylesheets/widget_custom_gallery.css b/custom_gallery/app/assets/stylesheets/widget_custom_gallery.css
new file mode 100644
index 0000000..c9537eb
--- /dev/null
+++ b/custom_gallery/app/assets/stylesheets/widget_custom_gallery.css
@@ -0,0 +1,70 @@
+.widget_custom_gallery {
+ margin-bottom: 20px;
+}
+.widget_custom_gallery:after {
+ display: table;
+ width: 100%;
+ content: '';
+}
+.widget_custom_gallery ul {
+ list-style: none;
+ margin: 0;
+ padding: 0;
+}
+.widget_custom_gallery li a {
+ display: block;
+}
+.widget_custom_gallery li a img {
+ height: auto;
+ display: block;
+}
+
+/* widget 1 */
+.w1 ul {
+ margin: 0 -1%;
+}
+.w1 li {
+ float: left;
+ margin: 1%;
+}
+.w1.c2 li { width: 48%; }
+.w1.c3 li { width: 31.3333%; }
+.w1.c4 li { width: 23%; }
+.w1.c5 li { width: 18%; }
+.w1.c6 li { width: 14.6666%; }
+.w1 li a {
+ -webkit-transition: opacity 0.3s ease;
+ -moz-transition: opacity 0.3s ease;
+ transition: opacity 0.3s ease;
+}
+.w1 li a:hover {
+ opacity: 0.8;
+ position: relative;
+}
+.w1 li a img {
+ width: 100%;
+}
+
+/* widget 2 */
+.w2 li {
+ width: 100%;
+}
+.w2 li a img {
+ width: 100%;
+ height: auto;
+}
+.w2 li a {
+ position: relative;
+ overflow: hidden;
+ color: #fff;
+ text-transform: capitalize;
+}
+.w2 li a .desc {
+ position: absolute;
+ bottom: -60px;
+ opacity: 0;
+ display: block;
+ width: 100%;
+ padding: 5%;
+ background-color: rgba(8, 166, 255, 0.8);
+}
\ No newline at end of file
diff --git a/custom_gallery/app/controllers/.keep b/custom_gallery/app/controllers/.keep
new file mode 100644
index 0000000..e69de29
diff --git a/custom_gallery/app/controllers/admin/custom_galleries_controller.rb b/custom_gallery/app/controllers/admin/custom_galleries_controller.rb
new file mode 100644
index 0000000..0dfeeac
--- /dev/null
+++ b/custom_gallery/app/controllers/admin/custom_galleries_controller.rb
@@ -0,0 +1,673 @@
+require 'rubyXL'
+class Admin::CustomGalleriesController < OrbitAdminController
+ include Admin::CustomGalleriesHelper
+ before_filter :setup_vars
+ before_action :authenticate_user, :except => "imgs"
+ before_action :log_user_action
+ layout :compute_layout
+ find_tag = Tag.all.select{|value| value.name==I18n.t('custom_gallery.not_show_desc')}
+ if find_tag.length==0
+ module_app_id = ModuleApp.where(:key=>"custom_gallery").first[:_id]
+ tags = ModuleApp.where(:key=>"custom_gallery").first.tags
+ tag0 = Tag.new(is_default: false,module_app_ids: [module_app_id])
+ tag1 = Tag.new(is_default: false,module_app_ids: [module_app_id])
+ nowlocale = I18n.locale
+ I18n.available_locales.each do |locale|
+ I18n.locale = locale
+ tag0.name = I18n.t('custom_gallery.show_desc')
+ tag1.name = I18n.t('custom_gallery.not_show_desc')
+ end
+ I18n.locale = nowlocale
+ tag0.save
+ tag1.save
+ tags << tag0
+ tags << tag1
+ elsif find_tag.length>1
+ show_tags = Tag.all.select{|value| value.name==I18n.t('custom_gallery.show_desc')}
+ show_tags.each_with_index do |show_tag,index1|
+ if index1>0
+ if show_tag.taggings.count==0
+ show_tag.delete
+ end
+ end
+ end
+ find_tag.each_with_index do |not_show_tag,index1|
+ if index1>0
+ if not_show_tag.taggings.count==0
+ not_show_tag.delete
+ end
+ end
+ end
+ end
+ def compute_layout
+ if action_name== 'index' && !params['page_no'].nil?
+ false
+ else
+ 'back_end'
+ end
+ end
+ def get_tag
+ custom_album = CustomAlbum.find(params['ele_id']) rescue nil
+ if !custom_album.nil?
+ text = custom_album.tags.collect do |tag|
+ "
#{tag.name}"
+ end.join
+ render :text => text
+ else
+ render :text => ''
+ end
+ end
+ def rotate_images
+ begin
+ image_ids = params['image_ids'].split(',')
+ count = image_ids.count
+ rot_ang = params[:rotate_angle].to_i
+ variable = CustomAlbumVariable.first
+ if variable.nil?
+ variable = CustomAlbumVariable.new
+ end
+ variable.finish = false
+ variable.save!
+ Thread.new do
+ variable = CustomAlbumVariable.first
+ image_ids.each_with_index do |image_id,index|
+ image = CustomAlbumImage.find(image_id) rescue nil
+ next if image.nil?
+ if !(image.custom_album_crops.first.nil?)
+ w_and_h = image.file.get_w_and_h
+ cords = image.custom_album_crops.map{|v| [[v.crop_x.to_f,v.crop_y.to_f],
+ [v.crop_x.to_f,v.crop_y.to_f+v.crop_h.to_f],
+ [v.crop_w.to_f+v.crop_x.to_f,v.crop_y.to_f],
+ [v.crop_w.to_f+v.crop_x.to_f,v.crop_y.to_f+v.crop_h.to_f]]}[0]
+ rot_diff = rot_ang/90
+ if (rot_diff) % 2 == 1
+ new_w = (w_and_h[1]).to_f
+ new_h = (w_and_h[0]).to_f
+ else
+ new_w = (w_and_h[0]).to_f
+ new_h = (w_and_h[1]).to_f
+ end
+
+ rot_times = rot_diff % 4
+ deg = (90.0*rot_times/180*Math::PI)
+ cords = cords.collect do |cord|
+ x = cord[0]-w_and_h[0].to_f/2
+ y = cord[1]-w_and_h[1].to_f/2
+ [x*Math.cos(deg)-y*Math.sin(deg)+new_w/2,x*Math.sin(deg)+y*Math.cos(deg)+new_h/2]
+ end
+ all_x = cords.collect do |cord|
+ cord[0]
+ end
+ all_y = cords.collect do |cord|
+ cord[1]
+ end
+ image.custom_album_crops.first.update_attributes(crop_x: all_x.min,crop_y: all_y.min,crop_w: all_x.max - all_x.min,crop_h: all_y.max - all_y.min)
+ end
+ variable.progress_percent = (index*100.0/count).floor.to_s+'%'
+ image.file.rotate_ang(rot_ang)
+ all_version = image.file.versions.map{|k,v| k}
+ begin
+ variable.progress_filename = image[:file].to_s
+ all_version.each do |version|
+ if !(version.to_s == 'resized' && crop_but_no_backup(image))
+ image.file.recreate_versions! version
+ image.save!
+ end
+ end
+ rescue => e
+ variable.progress_filename = e.inspect.to_s
+ puts e.inspect
+ end
+ variable.save!
+ end
+ variable.finish = true
+ variable.save!
+ end
+ rescue => e
+ puts e.inspect
+ end
+ redirect_to :controller=> 'images' ,:action => 'crop_process'
+ end
+
+ def save_crop
+ begin
+ images = CustomAlbumImage.where(:id.in => Array(params[:id]))
+ x = params['x']
+ y = params['y']
+ w = params['w']
+ h = params['h']
+ cords = x.zip(y,w,h)
+ count = cords.length
+ variable = CustomAlbumVariable.first
+ if variable.nil?
+ variable = CustomAlbumVariable.new
+ end
+ variable.finish = false
+ variable.save!
+ Thread.new do
+ variable = CustomAlbumVariable.first
+ image_ids= images.pluck(:id)
+ image_ids.each_with_index do |image_id,index|
+ image = CustomAlbumImage.find(image_id)
+ cord = cords[index]
+ if image.custom_album_crops.first.nil?
+ image.custom_album_crops.create(crop_x: cord[0],crop_y: cord[1],crop_w: cord[2],crop_h: cord[3])
+ else
+ image.custom_album_crops.first.update_attributes(crop_x: cord[0],crop_y: cord[1],crop_w: cord[2],crop_h: cord[3])
+ end
+ variable.progress_percent = (index*100.0/count).floor.to_s+'%'
+ all_version = image.file.versions.map{|k,v| k}
+ begin
+ #org_fname = image.file.path
+ #org_extname = File.extname(org_fname)
+ #org_fname.slice! org_extname
+ #FileUtils.cp(org_fname + org_extname, org_fname + '_resized' + org_extname)
+ variable.progress_filename = image[:file].to_s
+ all_version.each do |version|
+ if !(version.to_s == 'resized' && crop_but_no_backup(image))
+ image.file.recreate_versions! version
+ image.save!
+ end
+ end
+ rescue => e
+ variable.progress_filename = e.inspect.to_s
+ puts e.inspect
+ end
+ variable.save!
+ end
+ variable.finish = true
+ variable.save!
+ end
+ rescue => e
+ puts e.inspect
+ end
+ redirect_url = "/admin/custom_galleries/crop_process"
+ render :json => {'href' => redirect_url}.to_json
+ end
+ def call_translate
+ text = params['text']
+ render :json => {'translate' => "#{t(text.to_s)}" }.to_json
+ end
+ def recreate_image
+ notalive = ((CustomAlbumVariable.first.notalive.nil? ? true : CustomAlbumVariable.first.notalive) rescue true)
+ if notalive
+ if !params['custom_album_id'].to_s.empty?
+ variable = CustomAlbumVariable.first
+ if variable.nil?
+ variable = CustomAlbumVariable.new
+ end
+ variable.finish = false
+ variable.save!
+ choice_ids = params['custom_album_id'].split(',')
+ custom_albums = CustomAlbum.where(:id.in => choice_ids)
+ if !(params['use_default']=='true')
+ color = params['color_choice'].to_s.empty? ? 'transparent' : params['color_choice']
+ custom_albums.each do |custom_album|
+ if custom_album.custom_album_colors.first.nil?
+ custom_album.custom_album_colors.create('color' => color)
+ else
+ custom_album.custom_album_colors.first.update_attributes('color' => color, 'updated_at' => Time.now)
+ end
+ end
+ end
+ count = custom_albums.reduce(0){|x,i| i.custom_album_images.count+x}
+ Thread.new do
+ i = 0
+ custom_album_ids = custom_albums.pluck(:id)
+ custom_album_ids.each do |custom_album_id|
+ custom_album = CustomAlbum.find(custom_album_id) rescue CustomAlbum.new()
+ custom_album_image_ids = custom_album.custom_album_images.pluck(:id)
+ custom_album_image_ids.each do |image_id|
+ image = CustomAlbumImage.find(image_id)
+ error = nil
+ all_version = image.file.versions.map{|k,v| k}
+ begin
+ all_version.each do |version|
+ if !(version.to_s == 'resized' && crop_but_no_backup(image))
+ image.file.recreate_versions! version
+ image.save!
+ end
+ end
+ rescue => error
+ end
+ variable = CustomAlbumVariable.first
+ variable.progress_percent = (i*100.0/count).floor.to_s+'%'
+ if !error.nil?
+ variable.progress_filename = error.inspect.to_s.encode('UTF-8', invalid: :replace, undef: :replace, replace: '?')
+ sleep(1)
+ else
+ variable.progress_filename = image[:file].to_s
+ end
+ variable.save!
+ i+=1
+ end
+ end
+ variable = CustomAlbumVariable.first
+ variable.finish = true
+ variable.save!
+ end
+ else
+ variable = CustomAlbumVariable.first
+ variable.finish = true
+ variable.progress_filename = ''
+ variable.progress_percent = '100%'
+ variable.save!
+ end
+ end
+ end
+ def finish_recreate
+ variable = CustomAlbumVariable.first
+ variable.progress_percent = '0%'
+ variable.progress_filename = ''
+ variable.notalive = true
+ variable.save!
+ render :text => ''
+ end
+ def recreate_progress
+ progress_percent = CustomAlbumVariable.first.progress_percent rescue '0%'
+ progress_filename = CustomAlbumVariable.first.progress_filename rescue ''
+ finish = CustomAlbumVariable.first.finish rescue false
+ render :json => {'percent' => progress_percent, 'filename' => progress_filename, 'finish' => finish }.to_json
+ end
+ def filter_custom_album
+ @tags = @module_app.tags
+ categories = @module_app.categories.enabled
+ @filter_fields = filter_fields(categories, @tags)
+ @filter_fields.delete(:status)
+ custom_albums1 = CustomAlbum.where(:order.in => [nil,-1]).desc(:created_at).with_categories(filters("category")).with_tags(filters("tag"))
+ custom_albums1 = search_data(custom_albums1,[:name])
+ custom_albums2 = CustomAlbum.all.where(:order.ne=>-1).and(:order.ne=>nil).asc(:order).with_categories(filters("category")).with_tags(filters("tag"))
+ custom_albums2 = search_data(custom_albums2,[:name])
+ @fiter_custom_albums = custom_albums1.concat(custom_albums2)
+ end
+ def update_custom_album_setting
+ if params[:custom_album_setting_limit]
+ params_custom_album_setting = {:limit=>params[:custom_album_setting_limit]}
+ else
+ params_custom_album_setting = params.require(:custom_album_setting).permit!
+ end
+ CustomAlbumSetting.first.update_attributes(params_custom_album_setting)
+ redirect_to '/admin/custom_galleries'
+ end
+ def setting
+ @custom_album_setting = CustomAlbumSetting.first
+ end
+ def index
+ custom_album_length = CustomAlbum.where(:custom_module=>params[:custom_module],:bind_uid=>params[:bind_uid]).count
+ custom_album_sort = CustomAlbum.where(:custom_module=>params[:custom_module],:bind_uid=>params[:bind_uid]).asc(:created_at)
+ if (custom_album_sort.first.custom_album_colors.first.nil? rescue false)
+ custom_album_sort.each_with_index do |custom_album|
+ if custom_album.custom_album_colors.first.nil?
+ custom_album.custom_album_colors.create('color' => 'transparent')
+ end
+ end
+ end
+ @url = request.original_fullpath
+ @limit_count = CustomAlbumSetting.first.limit.to_i
+ @limit_count = custom_album_length if @limit_count == 0
+ if params['page_no'].nil?
+ @show_script = true
+ @custom_albums = filter_custom_album.take @limit_count
+ else
+ @show_script = false
+ start = (params['page_no'].to_i - 1)*@limit_count
+ @custom_albums = filter_custom_album[start...start+@limit_count]
+ end
+ if CustomAlbumColor.count!=0
+ if CustomAlbumColor.all.desc('updated_at').first[:color] == 'transparent'
+ @color_save = ''
+ else
+ @color_save = CustomAlbumColor.desc('updated_at').first[:color]
+ end
+ else
+ @color_save = 'transparent'
+ end
+ @custom_album_configs = CustomAlbumConfig.all
+ if request.xhr?
+ render :partial => "custom_albums"
+ elsif params[:custom_module].blank? || params[:bind_uid].blank?
+ render "display_enable_modules"
+ end
+ end
+
+ def show
+ @custom_album = CustomAlbum.find(params[:id])
+ @images = @custom_album.custom_album_images.where(:order.in => [nil,-1]).desc(:created_at)
+ images = @custom_album.custom_album_images.where(:order.gt => -1).asc(:order)
+ @images = @images.concat(images)
+ image_content = []
+ @images.each do |image|
+ image_content << {"id" => image.id.to_s,"title"=> image.title_translations, "description" => image.description_translations,"tags" => image.tags.collect{|t| t.id.to_s}}
+ end
+ @tags = @module_app.tags
+ @photos_data = {"custom_galleries" => image_content}.to_json
+ end
+
+ def new
+ @custom_album = CustomAlbum.new
+ @tags = @module_app.tags
+ @categories = @module_app.categories
+ end
+
+ def create
+ custom_album = CustomAlbum.new(custom_album_params)
+ custom_album.save!
+ custom_module = custom_album.custom_module
+ bind_uid = custom_album.bind_uid
+ if custom_module.present?
+ redirect_to admin_custom_galleries_path + "/#{custom_module}#{bind_uid.present? ? ('-'+bind_uid) : ''}"
+ else
+ redirect_to admin_custom_galleries_path
+ end
+ end
+
+ def destroy
+ custom_album = CustomAlbum.find(params[:id])
+ custom_module = custom_album.custom_module
+ bind_uid = custom_album.bind_uid
+ custom_album.destroy
+ if custom_module.present?
+ redirect_to admin_custom_galleries_path + "/#{custom_module}#{bind_uid.present? ? ('-'+bind_uid) : ''}"
+ else
+ redirect_to admin_custom_galleries_path
+ end
+ end
+
+ def edit
+ @custom_album = CustomAlbum.find(params[:id])
+ if can_edit_or_delete?(@custom_album)
+ @tags = @module_app.tags
+ @categories = @module_app.categories
+ else
+ render_401
+ end
+ end
+
+ def import
+ @custom_album = CustomAlbum.find(params[:id])
+ end
+
+ def importimages
+ custom_album = CustomAlbum.find(params[:id])
+ workbook = RubyXL::Parser.parse(params["import_file"].tempfile)
+ sheet = workbook[0]
+ if sheet.count <= 203
+ sheet.each_with_index do |row, i|
+ next if i < 3
+ v = row.cells.first.value rescue nil
+ next if v.blank?
+ import_this_image(row, custom_album)
+ end
+ redirect_to admin_custom_gallery_path(custom_album.id)
+ else
+ redirect_to import_admin_custom_gallery_path(:error => "1")
+ end
+ end
+
+ def excel_format
+ @custom_album = CustomAlbum.find(params[:id])
+ respond_to do |format|
+ format.xlsx {
+ response.headers['Content-Disposition'] = 'attachment; filename="custom_gallery_import_format.xlsx"'
+ }
+ end
+ end
+
+ def set_cover
+ if params[:set_cover] == "true"
+ custom_album = CustomAlbum.find(params[:custom_album_id])
+ image = CustomAlbumImage.find(params[:image_id])
+ custom_album.update_attributes({:cover_path => image.file.thumb.url, :cover=>params[:image_id]})
+ else
+ custom_album = CustomAlbum.find(params[:custom_album_id])
+ custom_album.update_attributes({:cover_path => nil, :cover=>"default"})
+ end
+ render :json =>{"success"=>true}.to_json
+ end
+
+ def get_photoData_json
+ @custom_album = CustomAlbum.find(params[:id])
+ @images = @custom_album.custom_album_images.where(:order => [nil,-1]).desc(:created_at)
+ images = @custom_album.custom_album_images.where(:order.gt => -1).asc(:order)
+ @images = @images.concat(images)
+ image_content = []
+ @images.each do |image|
+ image_content << {"id" => image.id.to_s,"title"=> image.title_translations, "description" => image.description_translations,"tags" => image.tags.collect{|t| t.id.to_s}}
+ end
+ render :json=>{"custom_galleries" => image_content}.to_json
+ end
+
+ def get_custom_album_json
+ custom_albums = CustomAlbum.all
+ output = Array.new
+
+ custom_albums.each do |custom_album|
+ tag_names = Array.new
+
+ custom_album.tag_ids.each do |tag|
+ tag_names << get_tags.include?(tag)
+ end
+ if custom_album.cover_path
+ cover_path = custom_album.cover_path
+ else
+ cover_path = "/assets/custom_gallery/default.jpg"
+ end
+ output << {
+ custom_album_cover_file: "http://#{request.host_with_port}"+cover_path,
+ custom_album_name: custom_album.name,
+ custom_album_tag_names: tag_names,
+ custom_album_link:"http://#{request.host_with_port}#{panel_custom_gallery_back_end_custom_album_get_imgs_json_path(custom_album)}",
+ }
+ end
+
+ render :json=>JSON.pretty_generate(output)
+ end
+
+ def get_imgs_json
+ custom_album = CustomAlbum.find(params[:custom_album_id])
+ images = custom_album.custom_album_images.all
+ output = Array.new
+
+ images.each do |image|
+ tags = Array.new
+
+ image.tag_ids.each do |tag|
+ tags << get_tags.include?(tag)
+ end
+
+ if image.file.theater.present?
+ @image_file = image.file.theater.url
+ else
+ @image_file = image.file.url
+ end
+
+ output << {
+ image_title: image.title,
+ image_description: image.description,
+ image_file: { url: "http://#{request.host_with_port}#{@image_file}",
+ thumb: "http://#{request.host_with_port}#{image.file.thumb.to_s}"},
+ image_tag_names: tags}
+ end
+
+ render :json=>JSON.pretty_generate(output)
+ end
+
+ def imgs
+ @custom_album = CustomAlbum.find(params[:custom_gallery_id])
+ @tag_names = Array.new
+ @images = @custom_album.custom_album_images.asc(:order)
+ @output = Array.new
+ @images.each do |values|
+ @output << { _id: values.id.to_s,
+ theater_link: admin_image_path(values),
+ description: values.description,
+ title: values.title,
+ file: values.file.as_json[:file],
+ custom_gallery_custom_album_id: values.custom_album_id,
+ order: values.order,
+ tags: values.tags}
+ end
+ render :json=>{"images" => @output, "tags" => @custom_album.tags}.to_json
+ end
+
+
+ def upload_process
+ if CustomAlbumUnprocess.first.upload_success
+ custom_album_unprocess = Array(CustomAlbumUnprocess.all)
+ count = custom_album_unprocess.count
+ Thread.new do
+ custom_album_unprocess.each_with_index do |un_image,i|
+ begin
+ custom_album = CustomAlbumImage.all.select{|value| value.id.to_s == un_image.image_id.to_s}[0]
+ custom_album.file = un_image.save_var
+ custom_album.save!
+ file = un_image.save_var.tempfile
+ file.close
+ File.delete file.path
+ un_image.delete
+ variable = CustomAlbumVariable.first
+ variable.progress_filename = custom_album[:file]
+ variable.progress_percent = ((i+1)*100.0/count).floor.to_s + '%'
+ variable.save!
+ rescue => e
+ puts ['err',un_image.inspect,e.inspect]
+ un_image.destroy
+ end
+ end
+ variable = CustomAlbumVariable.first
+ variable.finish = true
+ variable.save!
+ end
+ custom_album_temp = CustomAlbumUnprocess.first
+ custom_album_temp.upload_success = false
+ custom_album_temp.save!
+ end
+ end
+ def start_upload_process
+ custom_album_temp = CustomAlbumUnprocess.first
+ custom_album_temp.upload_success = true
+ custom_album_temp.save!
+ render :json => {}.to_json
+ end
+ def init_upload
+ variable = CustomAlbumVariable.first
+ if variable.nil?
+ variable = CustomAlbumVariable.new
+ end
+ variable.count = params['all_length'].to_i
+ variable.finish = false
+ variable.progress_percent = '0%'
+ variable.progress_filename = 'processing!!'
+ variable.notalive = true
+ variable.save!
+ render :json => {}.to_json
+ end
+ def upload_image
+ custom_album = CustomAlbum.find(params[:custom_album_id])
+ files = params['files']
+ custom_album_unprocess = CustomAlbumUnprocess.new()
+ files.each do |file|
+ image = custom_album.custom_album_images.new
+ image.tags = (custom_album.tags rescue [])
+ if(CustomAlbumVariable.first.count==1 rescue true)
+ image.file = file
+ else
+ custom_album_unprocess.image_id = image.id
+ custom_album_unprocess.upload_success = false
+ custom_album_unprocess.save_var = file
+ custom_album_unprocess.save!
+ ObjectSpace.undefine_finalizer(file.tempfile)
+ end
+ image.save!
+ end
+ render :json=>{"files"=>[{}]}.to_json
+ end
+
+ def last_image_id
+ custom_album = CustomAlbum.find(params[:custom_albumid])
+ lastimage = custom_album.custom_album_images.last
+ render :json => {"last_image_id" => lastimage.id.to_s}.to_json
+ end
+
+ def new_images
+ @custom_album = CustomAlbum.find(params[:custom_album_id])
+ if params[:last_image_id].present?
+ lastimage = CustomAlbumImage.find(params[:last_image_id])
+ @newimages = @custom_album.custom_album_images.where(:created_at.gt => lastimage.created_at,:order => -1).desc(:created_at)
+ else
+ @newimages = @custom_album.custom_album_images.where(:order => [nil,-1]).desc(:created_at)
+ end
+ render :layout=>false
+ end
+
+
+ def images_tags
+ custom_album = CustomAlbum.find(params[:custom_album_id])
+ tags = Array.new
+ images = custom_album.custom_album_images.all
+ images.each do |image|
+ tags << {"id"=>image.id, "tags" => image.tags}
+ end
+ render :json=>tags.to_json
+ end
+
+ def update
+ custom_album = CustomAlbum.find(params[:id])
+ tagsToDestroy = []
+ tagsToAdd = []
+ new_tags = params[:custom_album][:tags] || []
+ old_tags = custom_album.tags.collect{|t| t.id.to_s}
+ old_tags.each do |tag|
+ if !new_tags.include?(tag)
+ tagsToDestroy << tag
+ end
+ end
+ if new_tags != nil
+ new_tags.each do |tag|
+ if !old_tags.include?(tag)
+ tagsToAdd << tag
+ end
+ end
+ end
+ update_children_image_tag(custom_album,tagsToDestroy,tagsToAdd)
+ custom_album.update_attributes(custom_album_params)
+ redirect_to "/admin/custom_galleries/"+custom_album.id.to_s
+ end
+
+ def update_children_image_tag(custom_album,tagsToDestroy,tagsToAdd)
+ # tagsToDestroy will contain all tag ids which have to be deleted from the galley_images
+ # tagsToAdd will contain all tag ids which ve to be added in tall custom_album_images
+ images = custom_album.custom_album_images
+ images.each do |image|
+ image_tags = image.tags.collect{|t| t.id.to_s}
+ tagsToAdd.each do |tag|
+ image_tags << tag
+ end
+ tagsToDestroy.each do |tag|
+ if image_tags.include?tag
+ image_tags.delete(tag)
+ end
+ end
+ image.tags = image_tags
+ image.save
+ end
+ end
+
+ private
+ def crop_but_no_backup image
+ fname = image.file.path
+ extension = File.extname(fname)
+ base_name = fname.chomp(extension)
+ base_name += ('_resized'+ extension)
+ File.file?(base_name)
+ end
+ def setup_vars
+ @module_app = ModuleApp.where(:key=>"custom_gallery").first
+ end
+
+ def custom_album_params
+ p = params.require(:custom_album).permit!
+ p["tags"] = p["tags"] || []
+ p
+ end
+end
diff --git a/custom_gallery/app/controllers/admin/custom_images_controller.rb b/custom_gallery/app/controllers/admin/custom_images_controller.rb
new file mode 100644
index 0000000..b45724b
--- /dev/null
+++ b/custom_gallery/app/controllers/admin/custom_images_controller.rb
@@ -0,0 +1,107 @@
+class Admin::CustomImagesController < OrbitAdminController
+ before_filter :setup_vars
+ def crop_process
+ end
+ def batch_crop
+ images = params['image_ids'].split(',')
+ @img = []
+ images.each do |image|
+ @img << CustomAlbumImage.find(image)
+ end
+ render 'batch_crop'
+ end
+ def edit
+ @image = CustomAlbumImage.find(params[:id])
+ render 'edit_image'
+ end
+ def show
+ @image = CustomAlbumImage.find(params[:id])
+ @custom_albumid = @image.custom_album_id
+ @custom_album = CustomAlbum.find(@custom_albumid)
+ @images = @custom_album.custom_album_images.asc(:order)
+ end
+
+ def changeorder
+ type = params[:type]
+ if type == "imgholder"
+ images = params[:imageids]
+ images.each_with_index do |image, i|
+ img = CustomAlbumImage.find(image) rescue nil
+ if !img.nil?
+ img.order = i
+ img.save
+ end
+ end
+ elsif type == "orbit_custom_gallery"
+ custom_albums = params[:imageids]
+ custom_albums.each_with_index do |custom_albumid, i|
+ custom_album = CustomAlbum.find(custom_albumid) rescue nil
+ if !custom_album.nil?
+ custom_album.order = i
+ custom_album.save
+ end
+ end
+ end
+ render :json => {"success" => true}.to_json
+ end
+
+ def delete_photos
+ images = params['images']
+ images.each do |image|
+ img = CustomAlbumImage.find(image)
+ begin
+ FileUtils.rm_rf(File.dirname(img.file.path))
+ rescue => e
+ puts ["can't delete",e]
+ end
+ img.delete
+ end
+ if params['delete_cover'] == "true"
+ custom_album = CustomAlbum.find(params['custom_album_id'])
+ custom_album.update_attributes(:cover=>"default",:cover_path => nil)
+ end
+ render :json =>{"success"=>true}.to_json
+ end
+
+ def image_tagging
+ images = params[:image_ids]
+ tags = params[:tag_ids] || []
+ i = nil
+ images.each do |image|
+ img = CustomAlbumImage.find(image)
+ img.tags = tags
+ img.save
+ i = img
+ end
+ @custom_album = CustomAlbum.find(i.custom_album_id.to_s)
+ @images = @custom_album.custom_album_images
+ @image_content = []
+ @images.each do |image|
+ @image_content << {"id" => image.id.to_s, "description" => image.description_translations,"tags" => image.tags.collect{|t| t.id.to_s}}
+ end
+ render :json=>{"custom_galleries" => @image_content}.to_json
+ end
+
+ def update_image
+ image = CustomAlbumImage.find(params[:image_id])
+ image.update_attributes(update_params)
+ image.save!
+ @custom_album = CustomAlbum.find(image.custom_album_id.to_s)
+ @images = @custom_album.custom_album_images
+ @image_content = []
+ @images.each do |image|
+ @image_content << {"id" => image.id.to_s, "description" => image.description_translations,"tags" => image.tags.collect{|t| t.id.to_s}}
+ end
+ render :json=>{"custom_galleries" => @image_content}.to_json
+ end
+
+ private
+
+ def setup_vars
+ @module_app = ModuleApp.where(:key=>"custom_gallery").first
+ end
+
+ def update_params
+ params.require(:custom_album_image).permit!
+ end
+end
\ No newline at end of file
diff --git a/custom_gallery/app/controllers/custom_galleries_controller.rb b/custom_gallery/app/controllers/custom_galleries_controller.rb
new file mode 100644
index 0000000..d4b0f7f
--- /dev/null
+++ b/custom_gallery/app/controllers/custom_galleries_controller.rb
@@ -0,0 +1,284 @@
+class CustomGalleriesController < ApplicationController
+
+ find_tag = Tag.all.select{|value| value.name==I18n.t('custom_gallery.not_show_desc')}
+ if find_tag.length==0
+ module_app_id = ModuleApp.where(:key=>"custom_gallery").first[:_id]
+ tags = ModuleApp.where(:key=>"custom_gallery").first.tags
+ tag0 = Tag.new(is_default: false,module_app_ids: [module_app_id])
+ tag1 = Tag.new(is_default: false,module_app_ids: [module_app_id])
+ nowlocale = I18n.locale
+ I18n.available_locales.each do |locale|
+ I18n.locale = locale
+ tag0.name = I18n.t('custom_gallery.show_desc')
+ tag1.name = I18n.t('custom_gallery.not_show_desc')
+ end
+ I18n.locale = nowlocale
+ tag0.save
+ tag1.save
+ tags << tag0
+ tags << tag1
+ elsif find_tag.length>1
+ show_tags = Tag.all.select{|value| value.name==I18n.t('custom_gallery.show_desc')}
+ show_tags.each_with_index do |show_tag,index1|
+ if index1>0
+ if show_tag.taggings.count==0
+ show_tag.delete
+ end
+ end
+ end
+ find_tag.each_with_index do |not_show_tag,index1|
+ if index1>0
+ if not_show_tag.taggings.count==0
+ not_show_tag.delete
+ end
+ end
+ end
+ end
+
+ def index
+ @custom_album_setting = CustomAlbumSetting.first
+ params = OrbitHelper.params
+ page = OrbitHelper.page rescue nil
+ unless page
+ page = Page.where(url:params['url']).first
+ end
+ custom_data_field = page.custom_data_field rescue nil
+ if custom_data_field.nil?
+ custom_data_field = {}
+ elsif custom_data_field["bind_module_app"]
+ custom_data_field["custom_module"] = custom_data_field["bind_module_app"]
+ custom_data_field.delete('bind_module_app')
+ end
+ custom_album_tp = CustomAlbum.where(custom_data_field).filter_by_categories.filter_by_tags
+ all_count = custom_album_tp.count
+ page_data_count = OrbitHelper.page_data_count
+ no_order_count = custom_album_tp.where(:order.in=>[-1,nil]).count
+ with_order_count = all_count - no_order_count
+ with_order_total_pages = (with_order_count.to_f / page_data_count).ceil
+ custom_albums_with_order = custom_album_tp.asc(:order).where(:order.ne=>-1).and(:order.ne=>nil).to_a rescue []
+ page_no = (params[:page_no] || 1).to_i
+ if page_no < with_order_total_pages
+ custom_albums_no_order = []
+ elsif page_no == with_order_total_pages
+ if custom_albums_with_order.count == page_data_count
+ custom_albums_no_order = []
+ else
+ custom_albums_no_order = custom_album_tp.desc(:created_at).where(:order.in=>[-1,nil]).page(nil).per(all_count)[0...(page_data_count - custom_albums_with_order.count)]
+ end
+ else
+ custom_albums_with_order = []
+ start_index = (page_data_count - (with_order_count % page_data_count) + page_data_count*(page_no - 1 - with_order_total_pages))
+ custom_albums_no_order = custom_album_tp.desc(:created_at).where(:order.in=>[-1,nil]).page(nil).per(all_count)[start_index...(start_index+page_data_count)].to_a
+ end
+ custom_albums = custom_albums_with_order.concat(custom_albums_no_order)
+ custom_album_color_map = CustomAlbumColor.where(:custom_album_id.in=> custom_albums.map{|v| v.id}).pluck(:custom_album_id,:color,:custom_album_card_background_color,:custom_album_card_text_color).map{|v| [v[0],v[1..-1]]}.to_h
+ custom_galleries = custom_albums.collect do |a|
+ doc = Nokogiri::HTML(a.description.to_s)
+ alt_text = doc.text.empty? ? 'custom_gallery image' : doc.text
+ colors = custom_album_color_map[a.id]
+ {
+ "custom_album-name" => a.name,
+ "custom_album-description" => a.description,
+ "alt_title" => alt_text,
+ "link_to_show" => OrbitHelper.url_to_show(a.to_param),
+ "thumb-src" => a.cover_path || "/assets/custom_gallery/default.jpg",
+ "custom_album_color" => iterate_data(colors[1],colors[0],@custom_album_setting.custom_album_card_background_color,'transparent'),
+ "custom_album_card_text_color" => iterate_data(colors[2],@custom_album_setting.custom_album_card_text_color)
+ }
+ end
+ {
+ "custom_albums" => custom_galleries,
+ "extras" => {"widget-title"=>"CustomGallery"},
+ "total_pages" => custom_album_tp.total_pages
+ }
+ end
+ def show
+ @custom_album_setting = CustomAlbumSetting.first
+ params = OrbitHelper.params
+ custom_album = CustomAlbum.find_by_param(params[:uid])
+ flag = show_desc?
+ colors = CustomAlbumColor.where(:custom_album_id=> custom_album.id).pluck(:color,:custom_album_card_background_color,:custom_album_card_text_color)[0] rescue []
+ images = custom_album.custom_album_images.asc(:order).collect do |a|
+ alt_text = (a.description.blank? ? "custom_gallery image" : Nokogiri::HTML(a.description.to_s).text())
+ {
+ "image-description" => (flag ? a.description : ''),
+ "image_short_description" => a.title,
+ "alt_title" => alt_text,
+ "link_to_show" => "#" + a.id.to_s,
+ "thumb-src" => a.file.thumb.url,
+ "thumb-large-src" => a.file.thumb_large.url,
+ "mobile-src" => a.file.mobile.url,
+ "theater-src" => a.file.theater.url,
+
+ "custom_album_color" => iterate_data(colors[1],colors[0],@custom_album_setting.custom_album_card_background_color,'transparent'),
+ "custom_album_card_text_color" => iterate_data(colors[2],@custom_album_setting.custom_album_card_text_color)
+ }
+ end
+ {
+ "images" => images,
+ "data" => {"custom_album-title"=>custom_album.name,
+ "custom_album-description" => (flag ? "
#{custom_album.description}
" : "")}
+ }
+ end
+ def iterate_data(*args)
+ tmp = nil
+ args.each do |arg|
+ if !arg.blank? && arg != 'transparent'
+ tmp = arg
+ break
+ end
+ end
+ tmp
+ end
+ def self.custom_widget_data
+ @custom_configs = CustomAlbumConfig.all.to_a
+ ac = ActionController::Base.new
+ ac.render_to_string("custom_galleries/custom_widget_data",:locals=>{:@custom_data_field=>@custom_data_field,:@custom_configs=>@custom_configs,:@field_name=>@field_name})
+ end
+ def custom_album_widget
+ @custom_album_setting = CustomAlbumSetting.first
+ params = OrbitHelper.params
+ tags = OrbitHelper.widget_tags.empty? ? ["all"] : OrbitHelper.widget_tags
+ custom_album_tp = CustomAlbum.filter_by_widget_categories(OrbitHelper.widget_categories,false).filter_by_tags(tags)
+ all_count = custom_album_tp.count
+ page_data_count = OrbitHelper.widget_data_count
+ no_order_count = custom_album_tp.where(:order.in=>[-1,nil]).count
+ with_order_count = all_count - no_order_count
+ with_order_total_pages = (with_order_count.to_f / page_data_count).ceil
+ custom_albums_with_order = custom_album_tp.asc(:order).where(:order.ne=>-1).and(:order.ne=>nil).to_a rescue []
+ page_no = (params[:page_no] || 1).to_i
+ if page_no < with_order_total_pages
+ custom_albums_no_order = []
+ custom_albums_with_order = custom_albums_with_order[(page_no-1)*page_data_count...page_no*page_data_count]
+ elsif page_no == with_order_total_pages
+ if custom_albums_with_order.count == page_data_count
+ custom_albums_no_order = []
+ else
+ custom_albums_no_order = custom_album_tp.desc(:created_at).where(:order.in=>[-1,nil]).page(nil).per(all_count)[0...(page_data_count - custom_albums_with_order.count)]
+ end
+ else
+ custom_albums_with_order = []
+ start_index = (page_data_count - (with_order_count % page_data_count) + page_data_count*(page_no - 1 - with_order_total_pages))
+ custom_albums_no_order = custom_album_tp.desc(:created_at).where(:order.in=>[-1,nil]).page(nil).per(all_count)[start_index...(start_index+page_data_count)].to_a
+ end
+ custom_albums = custom_albums_with_order.concat(custom_albums_no_order)
+ custom_album_color_map = CustomAlbumColor.where(:custom_album_id.in=> custom_albums.map{|v| v.id}).pluck(:custom_album_id,:color,:custom_album_card_background_color,:custom_album_card_text_color).map{|v| [v[0],v[1..-1]]}.to_h
+ custom_galleries = custom_albums.collect.with_index do |a,i|
+ doc = Nokogiri::HTML(a.description.to_s)
+ alt_text = doc.text.empty? ? 'custom_gallery image' : doc.text.strip
+ colors = custom_album_color_map[a.id]
+ thumb_src = a.cover_path || "/assets/custom_gallery/default.jpg"
+ cover_image = CustomAlbumImage.find(a.cover) rescue a.custom_album_images.first
+ image_description = a.description
+ image_short_description = a.name
+ {
+ "link_text" => a.name,
+ "custom_album-name" => a.name,
+ "custom_album-description" => a.description,
+ "alt_title" => alt_text,
+ "link_to_show" => OrbitHelper.widget_more_url + "/" + a.to_param + "#" + (cover_image.id.to_s rescue ""),
+ "src" => thumb_src.gsub("thumb_",""),
+ "thumb-src" => thumb_src,
+ "thumb-large-src" => thumb_src.gsub("thumb_","thumb_large_"),
+ "mobile-src" => thumb_src.gsub("thumb_","mobile_"),
+ "theater-src" => thumb_src.gsub("thumb_","theater_"),
+ "image_description" => image_description,
+ "image_short_description" => image_short_description,
+ "custom_album_color" => iterate_data(colors[1],colors[0],@custom_album_setting.custom_album_card_background_color,'transparent'),
+ "custom_album_card_text_color" => iterate_data(colors[2],@custom_album_setting.custom_album_card_text_color),
+ "i" => i
+ }
+ end
+ {
+ "images" => custom_galleries,
+ "extras" => {"widget-title"=>"CustomGallery","more_url" => OrbitHelper.widget_more_url,"more_text"=>(locale == :en ? 'more' : '更多照片')}
+ }
+ end
+ def widget
+ @custom_album_setting = CustomAlbumSetting.first
+ tags = OrbitHelper.widget_tags.empty? ? ["all"] : OrbitHelper.widget_tags
+ custom_album_ids = CustomAlbum.filter_by_widget_categories(OrbitHelper.widget_categories,false).filter_by_tags(tags).pluck(:id)
+ custom_album_color_map = CustomAlbumColor.where(:custom_album_id.in=> custom_album_ids).pluck(:custom_album_id,:color,:custom_album_card_background_color,:custom_album_card_text_color).map{|v| [v[0],v[1..-1]]}.to_h
+ params = OrbitHelper.params
+ counts = OrbitHelper.widget_data_count
+ images = CustomAlbumImage.where({custom_album_id:{"$in"=>custom_album_ids}}).desc(:id).limit(counts *5).sample(counts)
+ images = images.each_with_index.collect do |a,i|
+ colors = custom_album_color_map[a.custom_album_id]
+ alt_text = (a.description.blank? ? "custom_gallery image" : Nokogiri::HTML(a.description).text().strip)
+ {
+ "link_text" => "",
+ "link_to_show" => OrbitHelper.widget_more_url + "/" + a.custom_album.to_param + "#" + a.id.to_s,
+ "alt_title" => alt_text,
+ "src" => a.file.url,
+ "thumb-src" => a.file.thumb.url,
+ "thumb-large-src" => a.file.thumb_large.url,
+ "image_description" => a.description,
+ "image_short_description" => a.title,
+ "mobile-src" => a.file.mobile.url,
+ "theater-src" => a.file.theater.url,
+ "custom_album-name" => a.custom_album.name_translations[I18n.locale],
+ "custom_album_color" => iterate_data(colors[1],colors[0],@custom_album_setting.custom_album_card_background_color,'transparent'),
+ "custom_album_card_text_color" => iterate_data(colors[2],@custom_album_setting.custom_album_card_text_color),
+ "i" => i
+ }
+ end
+ {
+ "images" => images,
+ "extras" => {"widget-title"=>"CustomGallery","more_url" => OrbitHelper.widget_more_url,"more_text"=>(locale == :en ? 'more' : '更多照片')}
+ }
+ end
+ def imgs(custom_album_id)
+ custom_album = CustomAlbum.find(custom_album_id)
+ tag_names = Array.new
+ images = custom_album.custom_album_images.asc(:order)
+ output = Array.new
+ images.each do |values|
+ alt_text = (values.description.nil? || values.description == "" ? "custom_gallery image" : values.description)
+ output << { _id: values.id.to_s,
+ description: values.description,
+ title: values.title,
+ alt_title: alt_text,
+ url: values.file.url,
+ file: values.file.as_json[:file],
+ custom_gallery_custom_album_id: values.custom_album_id,
+ tags: values.tags}
+ end
+ return output
+ end
+ def theater
+ if params[:id].include?('page=')
+ custom_album = CustomAlbum.where(uid: params[:id].sub('page=','')).first
+ custom_albumid = custom_album.id
+ image = custom_album.custom_album_images.first
+ else
+ image = CustomAlbumImage.find(params[:id])
+ custom_albumid = image.custom_album_id
+ custom_album = CustomAlbum.find(custom_albumid)
+ end
+ images = custom_album.custom_album_images.asc(:order)
+ data = {
+ "custom_album" => custom_album,
+ "image" => image.id.to_s,
+ "images" => imgs(custom_albumid)
+ }
+ render :json => {"data" => data}.to_json
+ end
+
+ private
+
+ def show_desc?
+ tags = OrbitHelper.page_tags if tags.blank?
+ tags = [tags].flatten.uniq
+ flag = true
+ tag_temp = Tag.all.select{|value| tags.include? value.id.to_s}
+ tag_temp_length = 0
+ tag_temp.each do |value|
+ if value.name==I18n.t('custom_gallery.show_desc')
+ flag = true
+ elsif value.name==I18n.t('custom_gallery.not_show_desc')
+ flag = false
+ end
+ end
+ flag
+ end
+end
\ No newline at end of file
diff --git a/custom_gallery/app/helpers/.keep b/custom_gallery/app/helpers/.keep
new file mode 100644
index 0000000..e69de29
diff --git a/custom_gallery/app/helpers/admin/custom_galleries_helper.rb b/custom_gallery/app/helpers/admin/custom_galleries_helper.rb
new file mode 100644
index 0000000..5e6434f
--- /dev/null
+++ b/custom_gallery/app/helpers/admin/custom_galleries_helper.rb
@@ -0,0 +1,46 @@
+module Admin::CustomGalleriesHelper
+ def back_end_breadcrumb
+ if params[:controller] == "admin/custom_galleries"
+ res = ''
+ divider = "
/"
+ res << "
#{t(:dashboard_)}#{divider}"
+ if params[:custom_module]
+ trans_name = I18n.t("module_name.#{params[:custom_module]}")
+ if trans_name.include?("translation missing")
+ trans_name = params[:custom_module]
+ end
+ res << "
#{trans_name}#{divider}"
+ end
+ if params[:action] != "index"
+ if params[:custom_module]
+ extra_url = "/#{params[:custom_module]}#{params[:bind_uid].present? ? ('-'+params[:bind_uid]) : ''}"
+ end
+ res << "
#{t('module_name.'+@module_app.key)}#{divider}"
+ res << "
#{t(params[:action], scope: 'restful_actions')}"
+ else
+ res << "
#{t('module_name.'+@module_app.key)}"
+ end
+ res.html_safe
+ else
+ super
+ end
+ end
+ def import_this_image(row,custom_album)
+ value = {}
+ image = CustomAlbumImage.new
+ image.custom_album = custom_album
+ row.cells.each_with_index do |cell,index|
+ val = cell.value rescue nil
+ next if val.blank?
+ case index
+ when 0
+ image.remote_file_url = val
+ when 1
+ value["zh_tw"] = val
+ value["en"] = (row.cells[index + 1].value rescue "")
+ image.description_translations = value
+ end
+ end
+ image.save
+ end
+end
diff --git a/custom_gallery/app/mailers/.keep b/custom_gallery/app/mailers/.keep
new file mode 100644
index 0000000..e69de29
diff --git a/custom_gallery/app/models/.keep b/custom_gallery/app/models/.keep
new file mode 100644
index 0000000..e69de29
diff --git a/custom_gallery/app/models/custom_album.rb b/custom_gallery/app/models/custom_album.rb
new file mode 100644
index 0000000..20013a6
--- /dev/null
+++ b/custom_gallery/app/models/custom_album.rb
@@ -0,0 +1,119 @@
+class CustomAlbum
+ include Mongoid::Document
+ include Mongoid::Timestamps
+
+ include OrbitCategory::Categorizable
+ include OrbitTag::Taggable
+ include Slug
+
+ field :custom_module
+ field :bind_uid
+ field :name, as: :slug_title, localize: true
+ field :description, localize: true
+ field :cover, default: "default"
+ field :cover_path #can refact
+ field :tag_names
+ field :uid, type: String
+ field :rss2_id, type: String
+ field :order, type: Integer, default: -1
+ field :resize_gravity
+ # has_and_belongs_to_many :tags, :class_name => "CustomGalleryTag"
+ has_many :custom_album_images, :autosave => true, :dependent => :destroy
+ has_many :custom_album_colors, :autosave => true, :dependent => :destroy
+ accepts_nested_attributes_for :custom_album_images, :allow_destroy => true
+ accepts_nested_attributes_for :custom_album_colors, :allow_destroy => true
+ before_save do |record|
+ if record.order.nil? || record.order == -1
+ topest_order = CustomAlbum.all.pluck(:order).sort{|a,b| a.to_i<=>b.to_i}.first
+ if topest_order.nil? || topest_order == 0
+ record.order = -2
+ else
+ record.order = topest_order - 1
+ end
+ end
+ end
+ after_create do
+ custom_record_callback(1)
+ end
+ after_destroy do
+ custom_record_callback(-1)
+ end
+ def custom_record_callback(num)
+ if self.custom_module && self.bind_uid.present?
+ custom_album_config = CustomAlbumConfig.where(:module=>self.custom_module).first
+ if custom_album_config && custom_album_config.custom_record_callback.present? && custom_album_config.bind_model.present?
+ target_model = custom_album_config.bind_model.constantize rescue nil
+ if target_model
+ target_record = target_model.where(custom_album_config.uid_field=>self.bind_uid).first
+ target_record.send(custom_album_config.custom_record_callback,num)
+ end
+ end
+ end
+ end
+ def resize_gravity
+ """
+ NorthWestGravity
+ Position object at top-left of region
+ NorthGravity
+ Position object at top-center of region
+ NorthEastGravity
+ Position object at top-right of region
+ WestGravity
+ Position object at left-center of region
+ CenterGravity
+ Position object at center of region
+ EastGravity
+ Position object at right-center of region
+ SouthWestGravity
+ Position object at left-bottom of region
+ SouthGravity
+ Position object at bottom-center of region
+ SouthEastGravity
+ Position object at bottom-right of region
+ """
+ tmp = self[:resize_gravity]
+ (tmp.blank? ? (CustomAlbumSetting.first.resize_gravity.blank? ? "Center" : CustomAlbumSetting.first.resize_gravity) : tmp) rescue 'Center'
+ end
+ def self.find_by_param(input)
+ self.find_by(uid: input)
+ end
+ def self.filter_by_tags(tags=[])
+ tags = OrbitHelper.page_tags if tags.blank?
+ tags = [tags].flatten.uniq
+ if !(tags.include?("all"))
+ tag_temp = Tag.all.select{|value| tags.include? value.id.to_s}
+ tag_temp_length = 0
+ tag_temp.each do |value|
+ if value.name==I18n.t('custom_gallery.show_desc') || value.name==I18n.t('custom_gallery.not_show_desc')
+ tag_temp_length+=1
+ end
+ end
+ if tag_temp_length!=0
+ if (tags.length - tag_temp_length) == 0
+ tags = ['all']
+ end
+ end
+ end
+ if tags.blank? || (tags.include?("all") rescue false)
+ self.all
+ else
+ tags
+ taggings = Tagging.where(:tag_id.in=>tags).map{|item| item.taggable_id}
+ self.where(:id.in=>taggings)
+ end
+ end
+ def cover
+ tmp = self['cover']
+ if tmp=='default'
+ tmp = (self.custom_album_images.first.id.to_s rescue 'default')
+ end
+ tmp
+ end
+ def cover_path
+ tmp = self['cover_path']
+ if tmp.nil?
+ tmp = (self.custom_album_images.first.file.thumb.url rescue nil)
+ end
+ tmp
+ end
+end
\ No newline at end of file
diff --git a/custom_gallery/app/models/custom_album_color.rb b/custom_gallery/app/models/custom_album_color.rb
new file mode 100644
index 0000000..30dc125
--- /dev/null
+++ b/custom_gallery/app/models/custom_album_color.rb
@@ -0,0 +1,9 @@
+class CustomAlbumColor
+ include Mongoid::Document
+ include Mongoid::Timestamps
+ field :color, type: String
+ field :custom_album_card_background_color, type: String
+ field :custom_album_card_text_color, type: String
+
+ belongs_to :custom_album
+end
\ No newline at end of file
diff --git a/custom_gallery/app/models/custom_album_config.rb b/custom_gallery/app/models/custom_album_config.rb
new file mode 100644
index 0000000..c6ca1fa
--- /dev/null
+++ b/custom_gallery/app/models/custom_album_config.rb
@@ -0,0 +1,10 @@
+class CustomAlbumConfig
+ include Mongoid::Document
+ include Mongoid::Timestamps
+ field :module
+ field :bind_model , :type => String
+ field :title_field , :type => String , :default => "slug_title"
+ field :uid_field , :type => String , :default => "uid"
+ field :custom_record_callback #if exists, it will call 'custom_record_callback(num)'
+ #where num is 1 when create bulletin, num is -1 when destroy.
+end
\ No newline at end of file
diff --git a/custom_gallery/app/models/custom_album_crop.rb b/custom_gallery/app/models/custom_album_crop.rb
new file mode 100644
index 0000000..ea7665d
--- /dev/null
+++ b/custom_gallery/app/models/custom_album_crop.rb
@@ -0,0 +1,8 @@
+class CustomAlbumCrop
+ include Mongoid::Document
+ field :crop_x, type: String
+ field :crop_y, type: String
+ field :crop_w, type: String
+ field :crop_h, type: String
+ belongs_to :custom_album_image
+end
\ No newline at end of file
diff --git a/custom_gallery/app/models/custom_album_image.rb b/custom_gallery/app/models/custom_album_image.rb
new file mode 100644
index 0000000..a0948a9
--- /dev/null
+++ b/custom_gallery/app/models/custom_album_image.rb
@@ -0,0 +1,27 @@
+require 'net/http'
+class CustomAlbumImage
+ include Mongoid::Document
+ include Mongoid::Timestamps
+ include OrbitTag::Taggable
+ mount_uploader :file, CustomGalleryUploader
+ field :title
+ field :title_translations, type: Hash, default: {}
+ field :description, localize: true
+ field :rss2_id, type: String
+ field :order, type: Integer, default: -1
+
+ # has_and_belongs_to_many :tags, :class_name => "CustomGalleryTag"
+ def title_translations
+ tmp = super || {}
+ if tmp == {}
+ tmp = I18n.available_locales.collect{|locale| [locale,self[:title]]}.to_h
+ end
+ tmp
+ end
+ def title
+ self.title_translations[I18n.locale]
+ end
+ belongs_to :custom_album
+ has_many :custom_album_crops, :autosave => true, :dependent => :destroy
+ accepts_nested_attributes_for :custom_album_crops, :allow_destroy => true
+end
\ No newline at end of file
diff --git a/custom_gallery/app/models/custom_album_setting.rb b/custom_gallery/app/models/custom_album_setting.rb
new file mode 100644
index 0000000..927cfaf
--- /dev/null
+++ b/custom_gallery/app/models/custom_album_setting.rb
@@ -0,0 +1,9 @@
+class CustomAlbumSetting
+ include Mongoid::Document
+ include Mongoid::Timestamps
+ field :limit
+ field :resize_gravity, type: String, default: 'center'
+ ResizeGravities = %w[Center NorthWest North NorthEast West East SouthWest South SouthEast]
+ field :custom_album_card_background_color, default: ''
+ field :custom_album_card_text_color, default: '#000000'
+end
\ No newline at end of file
diff --git a/custom_gallery/app/models/custom_album_unprocess.rb b/custom_gallery/app/models/custom_album_unprocess.rb
new file mode 100644
index 0000000..0182c71
--- /dev/null
+++ b/custom_gallery/app/models/custom_album_unprocess.rb
@@ -0,0 +1,18 @@
+class CustomAlbumUnprocess
+ include Mongoid::Document
+ field :image_id
+ field :save_var, type: String
+ field :upload_success, type: Boolean
+ def save_var
+ temp = YAML.load(self[:save_var])
+ temp[:tempfile] = File.open(temp[:tempfile])
+ ActionDispatch::Http::UploadedFile.new(temp)
+ end
+ def save_var=(value)
+ temp = {:filename => value.original_filename,
+ :type => value.content_type,
+ :head => value.headers,
+ :tempfile => value.tempfile.path}
+ self[:save_var] = temp.to_yaml
+ end
+end
\ No newline at end of file
diff --git a/custom_gallery/app/models/custom_album_variable.rb b/custom_gallery/app/models/custom_album_variable.rb
new file mode 100644
index 0000000..e0240da
--- /dev/null
+++ b/custom_gallery/app/models/custom_album_variable.rb
@@ -0,0 +1,8 @@
+class CustomAlbumVariable
+ include Mongoid::Document
+ field :count, type: Integer
+ field :progress_percent, type: String
+ field :progress_filename, type: String
+ field :finish, type: Boolean
+ field :notalive, type: Boolean
+end
\ No newline at end of file
diff --git a/custom_gallery/app/uploaders/custom_gallery_uploader.rb b/custom_gallery/app/uploaders/custom_gallery_uploader.rb
new file mode 100644
index 0000000..1236986
--- /dev/null
+++ b/custom_gallery/app/uploaders/custom_gallery_uploader.rb
@@ -0,0 +1,183 @@
+# encoding: utf-8
+module CarrierWave
+ module Uploader
+ module Versions
+ def store_dir
+ "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
+ end
+ end
+ end
+end
+
+class CustomGalleryUploader < CarrierWave::Uploader::Base
+ # Include RMagick or ImageScience support:
+ # include CarrierWave::RMagick
+ # include CarrierWave::ImageScience
+ include CarrierWave::MiniMagick
+ # Choose what kind of storage to use for this uploader:
+ # storage :file
+ # storage :s3
+
+ # Override the directory where uploaded files will be stored.
+ # This is a sensible default for uploaders that are meant to be mounted:
+ def store_dir
+ "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
+ end
+ def get_org_url
+ if have_crop?
+ model.file.resized.url
+ else
+ model.file.url
+ end
+ end
+ def fix_exif_rotation
+ manipulate! do |img|
+ img.tap(&:auto_orient)
+ end
+ end
+ # Provide a default URL as a default if there hasn't been a file uploaded:
+ # def default_url
+ # "/images/fallback/" + [version_name, "default.png"].compact.join('_')
+ # end
+
+ # Process files as they are uploaded:
+ # process :scale => [200, 300]
+ #
+ # def scale(width, height)
+ # # do something
+ # end
+
+ # Create different versions of your uploaded files:
+ # version :thumb do
+ # process :scale => [50, 50]
+ # end
+ process :resizer
+ process :optimize
+ version :resized, :if => :have_crop? do #backup
+ def full_filename(for_file)
+ extension = File.extname(super(for_file))
+ base_name = super(for_file).split('resized_').join('').chomp(extension)
+ base_name + '_resized'+ extension
+ end
+ end
+ version :crop_from_org, :if => :have_crop? do
+ process :crop_it
+ def full_filename(for_file)
+ super(for_file).split('crop_from_org_').join('')
+ end
+ end
+ version :thumb do
+ process :convert => 'png', :if => :transparent?
+ process :pad_process => [200,200]
+ end
+ version :thumb_large do
+ process :convert => 'png', :if => :transparent?
+ process :pad_process => [600,600]
+ end
+ version :theater do
+ process :limit_process => [1920, 1080]
+ end
+ version :mobile do
+ process :limit_process => [1152, 768]
+ end
+# Add a white list of extensions which are allowed to be uploaded.
+# For images you might use something like this:
+# def extension_white_list
+# %w(jpg jpeg gif png)
+# end
+
+# Override the filename of the uploaded files:
+# def filename
+# "something.jpg" if original_filename
+# end
+
+# def manipulate!
+# raise current_path.inspect
+# image = ::MiniMagick::Image.open(current_path)
+# image = yield(image)
+# image.write(current_path)
+# ::MiniMagick::Image.open(current_path)
+# rescue ::MiniMagick::Error, ::MiniMagick::Invalid => e
+# raise CarrierWave::ProcessingError.new("Failed to manipulate with MiniMagick, maybe it is not an image? Original Error: #{e}")
+# end
+ def get_w_and_h
+ if have_crop?
+ img = MiniMagick::Image.open(model.file.resized.path)
+ else
+ img = MiniMagick::Image.open(model.file.path)
+ end
+ [img[:width], img[:height]]
+ end
+ def rotate_ang(angle)
+ if have_crop?
+ img_path = model.file.resized.path
+ else
+ img_path = model.file.path
+ end
+ puts img_path
+ img = MiniMagick::Image.open(img_path)
+ img.rotate(angle)
+ puts img
+ img.write(img_path)
+ end
+ def optimize (*arg)
+ manipulate! do |img|
+ return img unless img.mime_type.match /image\/jpeg/
+ img.strip
+ img.combine_options do |c|
+ c.quality "90"
+ c.depth "24"
+ c.interlace "plane"
+ end
+ img
+ end
+ end
+ private
+ def resizer
+ size_of_file = size.to_f / (2**20)
+ if size_of_file > 5
+ img = MiniMagick::Image.open(path)
+ img_width = img[:width]
+ img_height = img[:height]
+ multiple = [img_width/Math.sqrt(size_of_file/5)/1920,img_height/Math.sqrt(size_of_file/5)/1080].max
+ if (multiple - multiple.to_i)>0.5
+ multiple = multiple.to_i + 0.5
+ else
+ multiple = multiple.to_i
+ end
+ resize_to_limit(multiple*1920,multiple*1080)
+ else
+ manipulate! do |img|
+ img
+ end
+ end
+ end
+ def limit_process(w,h)
+ resize_to_limit(w,h)
+ end
+ def have_crop?(*arg)
+ !(model.custom_album_crops.first.nil?)
+ end
+ def crop_it
+ crops = model.custom_album_crops.first
+ x=(crops.crop_x).to_i.abs.to_s
+ y=(crops.crop_y).to_i.abs.to_s
+ w=crops.crop_w.to_i
+ h=crops.crop_h.to_i
+ crop_image("#{w}x#{h}+#{x}+#{y}")
+ end
+ def crop_image(geometry)
+ img = MiniMagick::Image.open(model.file.resized.path)
+ img.crop(geometry)
+ img.write(model.file.crop_from_org.path)
+ end
+ def transparent?(*arg)
+ now_custom_album = model.custom_album
+ now_custom_album.custom_album_colors.first['color']=='transparent' rescue true
+ end
+ def pad_process (w,h)
+ now_custom_album = model.custom_album
+ resize_and_pad(w, h, (transparent? ? :transparent : now_custom_album.custom_album_colors.first['color']), (now_custom_album.resize_gravity rescue 'Center'))
+ end
+end
+
diff --git a/custom_gallery/app/views/.keep b/custom_gallery/app/views/.keep
new file mode 100644
index 0000000..e69de29
diff --git a/custom_gallery/app/views/admin/custom_galleries/_custom_album.html.erb b/custom_gallery/app/views/admin/custom_galleries/_custom_album.html.erb
new file mode 100644
index 0000000..93dae6c
--- /dev/null
+++ b/custom_gallery/app/views/admin/custom_galleries/_custom_album.html.erb
@@ -0,0 +1,29 @@
+
+
+
+
+
+ <% if custom_album.cover == "default" %>
+ <%= image_tag "custom_gallery/default.jpg" %>
+ <% else %>
+
+ <% end %>
+ <%= custom_album.name %>
+
+
+
+
+ <% if can_edit_or_delete?(custom_album) %>
+ - <%= link_to (content_tag(:i,"",:class=>"icon-trash danger")), admin_custom_gallery_path(custom_album.id), "data-confirm" => "Are you sure?", :method=>:delete %>
+ <% end %>
+ - <%= (Category.find(custom_album.category_id).title rescue custom_album.category_id) %>
+
+
+
\ No newline at end of file
diff --git a/custom_gallery/app/views/admin/custom_galleries/_custom_albums.html.erb b/custom_gallery/app/views/admin/custom_galleries/_custom_albums.html.erb
new file mode 100644
index 0000000..0da9a6e
--- /dev/null
+++ b/custom_gallery/app/views/admin/custom_galleries/_custom_albums.html.erb
@@ -0,0 +1,14 @@
+<%= render :partial => "custom_album", :collection => @custom_albums %>
+
\ No newline at end of file
diff --git a/custom_gallery/app/views/admin/custom_galleries/_form.html.erb b/custom_gallery/app/views/admin/custom_galleries/_form.html.erb
new file mode 100644
index 0000000..db571db
--- /dev/null
+++ b/custom_gallery/app/views/admin/custom_galleries/_form.html.erb
@@ -0,0 +1,202 @@
+<% content_for :page_specific_css do %>
+ <%= stylesheet_link_tag "lib/main-forms" %>
+ <%= stylesheet_link_tag "lib/fileupload" %>
+ <%= stylesheet_link_tag "lib/main-list" %>
+ <%= stylesheet_link_tag "jquery.minicolors" %>
+<% end %>
+<% content_for :page_specific_javascript do %>
+ <%= javascript_include_tag "lib/bootstrap-fileupload" %>
+ <%= javascript_include_tag "lib/bootstrap-datetimepicker" %>
+ <%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %>
+ <%= javascript_include_tag "lib/modal-preview" %>
+ <%= javascript_include_tag "lib/file-type" %>
+ <%= javascript_include_tag "jquery.minicolors" %>
+<% end %>
+
+
+
+
\ No newline at end of file
diff --git a/custom_gallery/app/views/admin/custom_galleries/_image.html.erb b/custom_gallery/app/views/admin/custom_galleries/_image.html.erb
new file mode 100644
index 0000000..91d1c33
--- /dev/null
+++ b/custom_gallery/app/views/admin/custom_galleries/_image.html.erb
@@ -0,0 +1,18 @@
+CustomAlbums re-ordering enabled.
+ <%= render 'recreate_thumb' %>
+
+ <%= form_tag '/admin/custom_galleries/update_custom_album_setting',remote: true,:class=>'update_custom_album_setting_form' do %>
+ <%= t('custom_gallery.custom_album_limit_for_one_page') %>:
+ <%= text_field_tag :custom_album_setting_limit, CustomAlbumSetting.first.limit,:placeholder => t('custom_gallery.blank_for_nil') %>
+
+<%= form_for @custom_album, :url => {:action => "create"}, :html => {:class => 'form-horizontal main-forms'} do |f| %>
+ <%= render :partial => 'form', :locals => {:f => f} %>
+<% end %>
+
diff --git a/custom_gallery/app/views/admin/custom_galleries/new_images.html.erb b/custom_gallery/app/views/admin/custom_galleries/new_images.html.erb
new file mode 100644
index 0000000..cdf89ca
--- /dev/null
+++ b/custom_gallery/app/views/admin/custom_galleries/new_images.html.erb
@@ -0,0 +1,3 @@
+<% @newimages.each do |image| %>
+ <%= render :partial=>"image", :object=>image %>
+<% end %>
\ No newline at end of file
diff --git a/custom_gallery/app/views/admin/custom_galleries/recreate_image.html.erb b/custom_gallery/app/views/admin/custom_galleries/recreate_image.html.erb
new file mode 100644
index 0000000..8e9656c
--- /dev/null
+++ b/custom_gallery/app/views/admin/custom_galleries/recreate_image.html.erb
@@ -0,0 +1,39 @@
+<%= t('custom_gallery.progressbar')+':' %>
+Images re-ordering enabled.
+