diff --git a/vendor/built_in_modules/gallery/app/assets/javascripts/galleryAPI.js b/vendor/built_in_modules/gallery/app/assets/javascripts/galleryAPI.js index 37db6b92..c052ca17 100644 --- a/vendor/built_in_modules/gallery/app/assets/javascripts/galleryAPI.js +++ b/vendor/built_in_modules/gallery/app/assets/javascripts/galleryAPI.js @@ -181,7 +181,12 @@ var galleryAPI = function(){ var $slidelist = $('.slidelist'), $rslide = $('.rslide'), $rslidenav = $('.rslidenav'), - $img = $("#main_pic img"); + $img = $("#main_pic img"), + wHeight = $(window).height(); + + $("#main_pic").height(picHeight); + $img.height("100%"); + $(".slidectrl a.togglelist").click(function(){ var rslide_h = $rslide.outerHeight(); if ( $slidelist.height() < 1 ){ @@ -195,6 +200,9 @@ var galleryAPI = function(){ $(".slidectrl a.togglescreen").click(function(){ toggleFullscreen(); }) + $(".slidectrl a.browserfullscreen").click(function(){ + browserFullScreen(); + }) $slidelist.find("a.list_element").click(function(){ imagecount = parseInt($(this).parent().attr("for")); changeImage($(this)); @@ -219,12 +227,19 @@ var galleryAPI = function(){ return false; } if(e.keyCode == 27){ - toggleFullscreen(); return false; } + if(e.keyCode == 70 || e.keyCode == 102){ + if($rslide.hasClass("fullscreen")) + browserFullScreen(); + } }); - + var browserFullScreen = function(){ + var el = document.documentElement, + rfs = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen; + rfs.call(el); + } var nextpic = function(dom){ if(imagecount == imageArray.length - 1) imagecount = 0; @@ -232,7 +247,6 @@ var galleryAPI = function(){ imagecount++; changeImage(dom); } - var prevpic = function(dom){ if(imagecount == 0) imagecount = imageArray.length - 1 @@ -240,32 +254,39 @@ var galleryAPI = function(){ imagecount--; changeImage(dom); } - var toggleFullscreen = function(){ if($rslide.hasClass("fullscreen")){ $rslide.css("position","relative"); $rslide.removeClass("fullscreen"); + $(".slidectrl a.browserfullscreen").hide(); $img.css({"padding":""}) + $("#main_pic").height(picHeight); }else{ + $("#main_pic").height(wHeight); + // $img.height("100%"); $rslide.css("position",""); $rslide.addClass("fullscreen"); $img.css({"padding":($rslide.height()-$img.height())/2}) + $(".slidectrl a.browserfullscreen").show(); } } var changeImage = function(dom){ var pageurl = dom.attr('href'); - $img.attr({"src":dom.attr("data-content"),"height":picHeight+"px"}); - if($rslide.hasClass("fullscreen")){ - $img.css({"padding":($rslide.height()-$img.height())/2}) - } - $slidelist.stop().animate({'height':'0px'}, 300); - $slidelist.find("ul").hide(); - if(pageurl!=window.location){ - window.history.pushState({path:pageurl},'',pageurl); - } - // $(".slideinfo b.info").text(imageArray[imagecount].title); - $(".slideinfo span.info").text(imageArray[imagecount].description); - updateNavigation(); + $img.fadeOut(200,function(){ + $img.attr({"src":dom.attr("data-content"),"height":picHeight+"px"}); + $img.fadeIn(200); + if($rslide.hasClass("fullscreen")){ + $img.css({"padding":($rslide.height()-$img.height())/2}) + } + $slidelist.stop().animate({'height':'0px'}, 300); + $slidelist.find("ul").hide(); + if(pageurl!=window.location){ + window.history.pushState({path:pageurl},'',pageurl); + } + // $(".slideinfo b.info").text(imageArray[imagecount].title); + $(".slideinfo span.info").text(imageArray[imagecount].description); + updateNavigation(); + }) } var updateNavigation = function(){ var next, prev; @@ -333,8 +354,8 @@ var galleryAPI = function(){ $("#description_loader .txtchange").each(function(){ dataArray.push({"id":$(this).attr("for"),"text": $(this).val()}); }) - - $.post("update_album",{data:dataArray},function(){ + albumnm = $(".albumname_edit #album_name_text").val(); + $.post("update_album",{data:dataArray,"aid":id,"name":albumnm},function(){ }) }) @@ -365,15 +386,16 @@ var galleryAPI = function(){ doms_to_delete[dom].hide("slide",function(){$(this).remove();}) } } + g.albumArea.find(".rghead .rgfn .bt-delete").hide(); }) } }) } - var head = 'Back to photos'; head+='Delete Selected'; head+='Save'; g.albumArea.find(".rghead .rgfn").html(head); + rcom.bindDomToHead($(".rghead")); g.albumArea.find("#imgholder").load("edit_album?aid="+id,function(data,response,xhr){ if(xhr.status == 404){ $(this).text("Album not found."); diff --git a/vendor/built_in_modules/gallery/app/assets/stylesheets/gallery.css b/vendor/built_in_modules/gallery/app/assets/stylesheets/gallery.css index 7a165417..ab13d90f 100755 --- a/vendor/built_in_modules/gallery/app/assets/stylesheets/gallery.css +++ b/vendor/built_in_modules/gallery/app/assets/stylesheets/gallery.css @@ -241,6 +241,7 @@ body.fullscreen, .fullscreen #container, .fullscreen #container2, .fullscreen #m .slidectrl a.togglelist { background-position: 0 -30px; } .slidectrl a.toinline { background-position: -30px 0; } .slidectrl a.sharebt { background-position: -30px -30px; } +.slidectrl a.browserfullscreen {background-position: -30px -30px; display:none;} .slidectrl a.slidestop { background-position: 0 -60px; } .slideinfo { height: 30px; diff --git a/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/orbit_galleries_controller.rb b/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/orbit_galleries_controller.rb index 89c08146..69fa0090 100644 --- a/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/orbit_galleries_controller.rb +++ b/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/orbit_galleries_controller.rb @@ -2,6 +2,7 @@ class Panel::Gallery::BackEnd::OrbitGalleriesController < OrbitBackendController def index @categorylist = GalleryCategory.all + @cid = params['cat'] end def new_category @@ -115,6 +116,15 @@ class Panel::Gallery::BackEnd::OrbitGalleriesController < OrbitBackendController end def update_album + data = params['data'] + album_name = params['name'] + aid = params['aid'] + data.each do |d| + image = GalleryImage.find(d[1][:id]) + image.update_attributes(:description=>d[1][:text]) + end + album = GalleryAlbum.find(aid) + album.update_attributes(:name => album_name) render :json =>{"success"=>true}.to_json end end diff --git a/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/orbit_galleries/index.html.erb b/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/orbit_galleries/index.html.erb index faee9e21..2030c313 100644 --- a/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/orbit_galleries/index.html.erb +++ b/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/orbit_galleries/index.html.erb @@ -10,7 +10,11 @@ --Select a category-- All <% @categorylist.each do |category| %> + <% if @cid == category.id.to_s %> + <%= category.name %> + <% else %> <%= category.name %> + <% end %> <% end %> diff --git a/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/orbit_galleries/theater.html.erb b/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/orbit_galleries/theater.html.erb index e0a83459..b1c62ae0 100755 --- a/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/orbit_galleries/theater.html.erb +++ b/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/orbit_galleries/theater.html.erb @@ -17,7 +17,7 @@ <% i=0 %> <% @images.each do |image| %> - + <% i=i+1 %> <% end %> @@ -25,6 +25,7 @@ Screen List + F <%= @image.description %>