gallery update

This commit is contained in:
devin 2012-08-22 15:59:06 +08:00 committed by Christophe Vilayphiou
parent 887b2d528d
commit 0c624794d5
4 changed files with 33 additions and 27 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 372 B

After

Width:  |  Height:  |  Size: 431 B

View File

@ -203,27 +203,27 @@ var galleryAPI = function(){
var re1 = new RegExp("^[\u4E00-\uFA29]*$"); //Chinese character range
var re2 = new RegExp("^[\uE7C7-\uE7F3]*$");
if ((re1.test(sval) && (re2.test(sval)))){
$("ul#gallery_tag_list li span:not(:contains("+sval+"))").parent().slideUp();
$("#gallery_tag_list li span:not(:contains("+sval+"))").parent().slideUp();
}else{
$("ul#gallery_tag_list li span:not(:containsi("+sval+"))").parent().slideUp();
$("#gallery_tag_list li span:not(:containsi("+sval+"))").parent().slideUp();
}
}else{
$("ul#gallery_tag_list li").slideDown();
$("#gallery_tag_list li").slideDown();
}
})
g.albumArea.find("#tag_panel .bt-save").click(function(){
g.saveTags(id,g.loadArea);
})
g.albumArea.find(".rghead .rgfn a.bt-add").click(function(){
g.albumArea.find(".rghead .rgfn .bt-add").click(function(){
showUploadPanel();
})
g.albumArea.find(".rghead .rgfn a.bt-del").click(function(){
g.albumArea.find(".rghead .rgfn .bt-del").click(function(){
g.deleteAlbum(id);
})
})
var uploadpanel = $('<div id="upload_panel_holder"><div class="rgfn"><a class="bt-cls btn btn-primary pull-right" title="Close" href="" onclick="return false;"><i class="icon-remove icon-white"></i>Close Panel</a></div></div>');
var frame = $('<iframe id="upload_panel" width="100%" scrolling="no" height="294" frameborder="0" src="upload_panel"></iframe>');
uploadpanel.find("a.bt-cls").click(function(){
uploadpanel.find(".bt-cls").click(function(){
uploadpanel.hide("slide");
frame.remove();
g.loadImages(id);
@ -308,13 +308,13 @@ var galleryAPI = function(){
var re1 = new RegExp("^[\u4E00-\uFA29]*$"); //Chinese character range
var re2 = new RegExp("^[\uE7C7-\uE7F3]*$");
if ((re1.test(sval) && (re2.test(sval)))){
$("ul#gallery_tag_list li span:not(:contains("+sval+"))").parent().slideUp();
$("#gallery_tag_list li span:not(:contains("+sval+"))").parent().slideUp();
}else{
$("ul#gallery_tag_list li span:not(:containsi("+sval+"))").parent().slideUp();
$("#gallery_tag_list li span:not(:containsi("+sval+"))").parent().slideUp();
}
}else{
$("ul#gallery_tag_list li").slideDown();
$("#gallery_tag_list li").slideDown();
}
})
g.albumArea.find("#tag_panel .bt-save").click(function(){
@ -330,37 +330,38 @@ var galleryAPI = function(){
$slidelist.find("ul").hide();
}
})
$(".slidectrl a.togglescreen").click(function(){
$(".slidectrl .togglescreen").click(function(){
toggleFullscreen();
})
$(".slidectrl a.browserfullscreen").click(function(){
$(".slidectrl .browserfullscreen").click(function(){
browserFullScreen();
})
$slidelist.find("a.list_element").click(function(){
$slidelist.find(".list_element").click(function(){
imagecount = parseInt($(this).parent().attr("for"));
changeImage($(this));
})
$rslidenav.find("a.navN").click(function(){
$rslidenav.find(".navN").click(function(){
nextpic($(this));
})
$rslidenav.find("a.navP").click(function(){
prevpic($(this));
})
$("a#nextpic").click(function(){
$("#nextpic").click(function(){
nextpic($(this));
})
$(document).keydown(function(e){
if (e.keyCode == 37){
prevpic($rslidenav.find("a.navP"));
prevpic($rslidenav.find(".navP"));
return false;
}
if(e.keyCode == 39){
nextpic($rslidenav.find("a.navN"));
nextpic($rslidenav.find(".navN"));
return false;
}
if(e.keyCode == 27){
toggleFullscreen();
$rslide.removeClass('browserFullScreen');
return false;
}
if(e.keyCode == 70 || e.keyCode == 102){
@ -372,6 +373,7 @@ var galleryAPI = function(){
var el = document.documentElement,
rfs = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen;
rfs.call(el);
$rslide.addClass('browserFullScreen');
}
var nextpic = function(dom){
if(imagecount == imageArray.length - 1)
@ -391,7 +393,7 @@ var galleryAPI = function(){
if($rslide.hasClass("fullscreen")){
$rslide.css("position","relative");
$rslide.removeClass("fullscreen");
$(".slidectrl a.browserfullscreen").hide();
$(".slidectrl .browserfullscreen").hide();
$img.css({"padding":""})
$("#main_pic").height(picHeight );
}else{
@ -400,7 +402,7 @@ var galleryAPI = function(){
$rslide.css("position","");
$rslide.addClass("fullscreen");
$img.css({"padding":($rslide.height()-$img.height())/2})
$(".slidectrl a.browserfullscreen").show();
$(".slidectrl .browserfullscreen").show();
}
}
var changeImage = function(dom){
@ -419,7 +421,7 @@ var galleryAPI = function(){
// $(".slideinfo b.info").text(imageArray[imagecount].title);
if($('.bt-tag').hasClass("active"))
updatePhotoTag();
$(".slideinfo span.info").text(imageArray[imagecount].description);
$(".slideinfo .info").text(imageArray[imagecount].description);
if(imageArray.length > 1)
updateNavigation();
})
@ -437,8 +439,8 @@ var galleryAPI = function(){
next = imagecount + 1;
prev = imagecount - 1;
}
$("a.navN").attr({"href":"orbit_gallery?theater="+imageArray[next]._id,"data-content":imageArray[next].file.url});
$("a.navP").attr({"href":"orbit_gallery?theater="+imageArray[prev]._id,"data-content":imageArray[prev].file.url});
$(".navN").attr({"href":"orbit_gallery?theater="+imageArray[next]._id,"data-content":imageArray[next].file.url});
$(".navP").attr({"href":"orbit_gallery?theater="+imageArray[prev]._id,"data-content":imageArray[prev].file.url});
};
if(imageArray.length > 1)
updateNavigation();
@ -465,8 +467,8 @@ var galleryAPI = function(){
g.loadFooterPanel(g.loadArea,id,function(head){
head = $(head);
g.albumArea.find(".rghead .rgfn").html(head);
g.albumArea.find("a.bt-back").attr("href","orbit_gallery?album="+albumid);
g.albumArea.find("a.bt-edit").attr("href","orbit_gallery?edit="+albumid);
g.albumArea.find(".bt-back").attr("href","orbit_gallery?album="+albumid);
g.albumArea.find(".bt-edit").attr("href","orbit_gallery?edit="+albumid);
})
g.albumArea.css("margin-bottom","0");
picHeight = $(window).height() - ($("#orbit-bar").outerHeight() + $("#orbit_gallery .form-actions").outerHeight());
@ -537,13 +539,13 @@ var galleryAPI = function(){
var re1 = new RegExp("^[\u4E00-\uFA29]*$"); //Chinese character range
var re2 = new RegExp("^[\uE7C7-\uE7F3]*$");
if ((re1.test(sval) && (re2.test(sval)))){
$("ul#gallery_tag_list li span:not(:contains("+sval+"))").parent().slideUp();
$("#gallery_tag_list li span:not(:contains("+sval+"))").parent().slideUp();
}else{
$("ul#gallery_tag_list li span:not(:containsi("+sval+"))").parent().slideUp();
$("#gallery_tag_list li span:not(:containsi("+sval+"))").parent().slideUp();
}
}else{
$("ul#gallery_tag_list li").slideDown();
$("#gallery_tag_list li").slideDown();
}
})
g.albumArea.find("#tag_panel .bt-save").click(function(){

View File

@ -224,10 +224,14 @@
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 {background-position: -30px -30px; display:none;}
.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;