Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A few fixes and improvements #355

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/classes/BoardItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function toHTML(){

echo "<div class='item $lgcls pure-u-1-2 pure-u-sm-1-2 pure-u-md-1-3 pure-u-lg-1-4 pure-u-xl-1-8'>";
echo "<a href='?f=$this->file'>";
echo "<img src='?$getfile' alt=\"\" />";
echo "<img class='lazy' data-src='?$getfile' alt=\"\" />";
echo "</a>\n";
echo "</div>\n";

Expand Down
2 changes: 1 addition & 1 deletion src/classes/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public function toHTML(){
echo " background: black url(\"?t=".$this->t."&f=$this->fileweb\") no-repeat center center;";
echo " background-size: contain;";
echo " -moz-background-size: contain;";
echo " height:100%;";
echo " height:100%; display: none;";
echo "';>";

echo "<input type='hidden' id='imageurl' value='?t=Big&f=$this->fileweb'>";
Expand Down
12 changes: 5 additions & 7 deletions src/classes/ImageBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ public function __construct($fs=false){
$this->buttons['back'] = "?f=".urlencode(File::a2r(dirname(CurrentUser::$path)));
$this->awesome['back'] = "<i class='fa fa-reply fa-lg'></i>";

if(!Settings::$nodownload){
$this->buttons['img'] = "?t=Big&f=".$file;
$this->awesome['img'] = "<i class='fa fa-eye fa-lg'></i>";
$this->buttons['img'] = "?f=".$file;
$this->awesome['img'] = "<i class='fa fa-eye fa-lg'></i>";

if(!Settings::$nodownload){
$this->buttons['get'] = "?t=BDl&f=".$file;
$this->awesome['get'] = "<i class='fa fa-download fa-lg'></i>";
}
Expand All @@ -87,9 +87,6 @@ public function __construct($fs=false){
$this->awesome['pshere'] = "<img height='20px' src='inc/photosphere_logo.png'/>";
}

$this->buttons['next'] = "?p=n&f=".$file;
$this->awesome['next'] = "<i class='fa fa-chevron-right fa-lg'></i>";

$this->buttons['pause'] = "?f=".$file;
$this->awesome['pause'] = "<i class='fa fa-pause fa-lg'></i>";

Expand All @@ -99,7 +96,8 @@ public function __construct($fs=false){
$this->buttons['stop'] = "?f=".$file;
$this->awesome['stop'] = "<i class='fa fa-stop fa-lg'></i>";


$this->buttons['next'] = "?p=n&f=".$file;
$this->awesome['next'] = "<i class='fa fa-chevron-right fa-lg'></i>";

}

Expand Down
2 changes: 2 additions & 0 deletions src/classes/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ public function header($head_content=NULL){
echo "<script src='src/js/menu.js'></script>\n";
echo "<script src='src/js/panel.js'></script>\n";
echo "<script src='src/js/slideshow.js'></script>\n";
echo "<script src='src/js/waitforimages.js'></script>\n";
echo "<script src='src/js/lazy.js'></script>\n";
echo "<script src='src/js/image_panel.js'></script>\n";
echo "<script src='src/js/keyboard.js'></script>\n";
echo "<script src='src/js/confirmation.js'></script>\n";
Expand Down
47 changes: 39 additions & 8 deletions src/js/image_panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ function init_image_panel(){
url = url.slice(url.indexOf('f='));
$('.linear_panel a[href$="' + url + '"]').parent().addClass("selected");
}

$('#image_big').waitForImages().done(function() {
$("#image_big").fadeIn('slow', function(){
if(slideshow_status == 1){
play_slideshow();
}
});
});

// On clicking the bigimage
$("#bigimage a, #image_bar #back").click(function(){
Expand All @@ -68,9 +76,12 @@ function init_image_panel(){
$(".linear_panel .selected").removeClass("selected");
$(this).parent().addClass("selected");
update_url($(this).attr("href"),"Image");

$(".image_panel").load($(this).attr("href")+"&j=Pan",function(){
init_image_panel();

var elem = $(this);
$("#image_big").fadeOut('normal', function(){
$(".image_panel").load(elem.attr("href")+"&j=Pan",function(){
init_image_panel();
});
});

// Load infos
Expand All @@ -89,12 +100,14 @@ function init_image_panel(){
}

if(! new_select.length){
new_select = $(".linear_panel .item").last();
new_select = $(".linear_panel .item").first();
}

new_url = new_select.children("a").attr("href");

$(".image_panel").load(new_url + "&j=Pan",function(){
var elem = $(this);
$("#image_big").fadeOut('normal', function(){
$(".image_panel").load(new_url + "&j=Pan",function(){
update_url(new_url,"Image");

curr_select.removeClass("selected");
Expand All @@ -105,6 +118,7 @@ function init_image_panel(){
if(slideshow_status != 0){
hide_links();
}
});
});

// Load infos
Expand Down Expand Up @@ -134,12 +148,14 @@ function init_image_panel(){
}

if(! new_select.length){
new_select = $(".linear_panel .item").first();
new_select = $(".linear_panel .item").last();
}

new_url = new_select.children("a").attr("href")

$(".image_panel").load(new_url+"&j=Pan",function(){
var elem = $(this);
$("#image_big").fadeOut('normal', function(){
$(".image_panel").load(new_url+"&j=Pan",function(){

update_url(new_url,"Image");

Expand All @@ -151,6 +167,7 @@ function init_image_panel(){
if(slideshow_status != 0){
hide_links();
}
});
});

// Load infos
Expand All @@ -167,6 +184,14 @@ function init_image_panel(){
}
});

// On scroll
$("#page").scroll(function(){
instance.update();
});
$(".linear_panel").scroll(function(){
instance.update();
});

$(".linear_panel").scrollTo($(".linear_panel .selected")).scrollTo("-="+$(".linear_panel").width()/2);

init_comments();
Expand All @@ -193,6 +218,12 @@ function init_description(){
});
}

$("document").ready(function(){
var instance;

$("document").ready(function(){
instance = $('.lazy').lazy({
chainable: false
});

init_image_panel();
});
Loading