This repository has been archived by the owner on Nov 14, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 339
use slideshow as image preview in files & public shares #1123
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
|
||
#slideshow { | ||
position: fixed; | ||
left: 0; | ||
top: 0; | ||
width: 100%; | ||
height: 100%; | ||
z-index: 1000; | ||
display: none; | ||
background-color: black; | ||
background-repeat: no-repeat; | ||
background-image: url("../img/progress.gif"); | ||
background-size: 16px 16px; | ||
background-position: center center; | ||
} | ||
|
||
#slideshow>img { | ||
position: relative; | ||
vertical-align: middle; | ||
display: block; | ||
margin-left: auto; | ||
margin-right: auto; | ||
} | ||
|
||
#slideshow > input { | ||
background: none; | ||
border: 0 transparent; | ||
outline: 0; | ||
box-shadow: none; | ||
width: 52px; | ||
height: 52px; | ||
position: absolute; | ||
z-index: 1100; | ||
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)"; | ||
filter: alpha(opacity=30); | ||
opacity: .3; | ||
background-position: center center; | ||
background-repeat: no-repeat; | ||
} | ||
|
||
#slideshow > * { | ||
-webkit-transition: opacity 300ms; | ||
-moz-transition: opacity 300ms; | ||
-o-transition: opacity 300ms; | ||
transition: opacity 300ms; | ||
} | ||
|
||
#slideshow > input:hover { | ||
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)"; | ||
filter: alpha(opacity=60); | ||
opacity: .6; | ||
} | ||
|
||
#slideshow > .next, #slideshow > .previous { | ||
top: 50%; | ||
margin-top: -21px; | ||
} | ||
|
||
#slideshow > .next { | ||
right: 0; | ||
background-image: url("%webroot%/core/img/actions/view-next.svg"); | ||
} | ||
|
||
#slideshow > .previous { | ||
left: 0; | ||
background-image: url("%webroot%/core/img/actions/view-previous.svg"); | ||
} | ||
|
||
#slideshow > .exit { | ||
right: 0; | ||
top: 0; | ||
background-image: url("%webroot%/core/img/actions/view-close.svg"); | ||
} | ||
|
||
#slideshow > .pause, #slideshow > .play { | ||
bottom: 0; | ||
right: 0; | ||
margin-top: -21px; | ||
} | ||
|
||
#slideshow > .play { | ||
display: none; | ||
background-image: url("%webroot%/core/img/actions/view-play.svg"); | ||
} | ||
|
||
#slideshow > .pause { | ||
background-image: url("%webroot%/core/img/actions/view-pause.svg"); | ||
} | ||
|
||
#slideshow > .progress { | ||
position: fixed; | ||
bottom: 10px; | ||
right: 10px; | ||
background-position: 0 100%; | ||
width: 32px; | ||
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)"; | ||
background-image: url("%webroot%/core/img/actions/view-pause.svg"); | ||
filter: alpha(opacity=30); | ||
opacity: .3; | ||
height: 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,7 +103,7 @@ Gallery.share = function (event) { | |
event.preventDefault(); | ||
event.stopPropagation(); | ||
Gallery.getAlbumInfo(Gallery.currentAlbum).then(function (info) { | ||
$('a.share').data('item', info.fileid) | ||
$('a.share').data('item', info.fileid).data('link', true) | ||
.data('possible-permissions', info.permissions). | ||
click(); | ||
}); | ||
|
@@ -280,105 +280,22 @@ Gallery.view.showUsers = function () { | |
} | ||
}; | ||
|
||
Gallery.slideshow = {}; | ||
Gallery.scrollLocation = 0; | ||
Gallery.slideshow.start = function (start, options) { | ||
var content = $('#content'); | ||
start = start || 0; | ||
Thumbnail.concurrent = 1; //make sure we can load the image and doesn't get blocked by loading thumbnail | ||
if (content.is(":visible")) { | ||
Gallery.scrollLocation = $(window).scrollTop(); | ||
} | ||
$('a.image').slideShow($('#slideshow'), start, options); | ||
content.hide(); | ||
}; | ||
|
||
Gallery.slideshow.end = function () { | ||
jQuery.fn.slideShow.stop(); | ||
}; | ||
|
||
Gallery.slideshow.next = function (event) { | ||
if (event) { | ||
event.stopPropagation(); | ||
} | ||
jQuery.fn.slideShow.hideImage(); | ||
jQuery.fn.slideShow.next(); | ||
}; | ||
|
||
Gallery.slideshow.previous = function (event) { | ||
if (event) { | ||
event.stopPropagation(); | ||
} | ||
jQuery.fn.slideShow.hideImage(); | ||
jQuery.fn.slideShow.previous(); | ||
}; | ||
|
||
Gallery.slideshow.pause = function (event) { | ||
if (event) { | ||
event.stopPropagation(); | ||
} | ||
$('#slideshow').children('.play').show(); | ||
$('#slideshow').children('.pause').hide(); | ||
Gallery.slideshow.playPause.playing = false; | ||
jQuery.fn.slideShow.pause(); | ||
}; | ||
|
||
Gallery.slideshow.play = function (event) { | ||
if (event) { | ||
event.stopPropagation(); | ||
} | ||
$('#slideshow').children('.play').hide(); | ||
$('#slideshow').children('.pause').show(); | ||
Gallery.slideshow.playPause.playing = true; | ||
jQuery.fn.slideShow.play(); | ||
}; | ||
|
||
Gallery.slideshow.playPause = function () { | ||
if (Gallery.slideshow.playPause.playing) { | ||
Gallery.slideshow.pause(); | ||
} else { | ||
Gallery.slideshow.play(); | ||
} | ||
}; | ||
Gallery.slideshow.playPause.playing = true; | ||
|
||
$(document).ready(function () { | ||
Gallery.fillAlbums().then(function () { | ||
Gallery.view.element = $('#gallery'); | ||
OC.Breadcrumb.container = $('#breadcrumbs'); | ||
window.onhashchange() | ||
|
||
//close slideshow on esc | ||
$(document).keyup(function (e) { | ||
if (e.keyCode === 27) { // esc | ||
Gallery.slideshow.end(); | ||
} else if (e.keyCode == 37) { // left | ||
Gallery.slideshow.previous(); | ||
} else if (e.keyCode == 39) { // right | ||
Gallery.slideshow.next(); | ||
} else if (e.keyCode == 32) { // space | ||
Gallery.slideshow.playPause(); | ||
} | ||
}); | ||
var slideshow = $('#slideshow'); | ||
slideshow.children('.next').click(Gallery.slideshow.next); | ||
slideshow.children('.previous').click(Gallery.slideshow.previous); | ||
slideshow.children('.exit').click(jQuery.fn.slideShow.stop); | ||
slideshow.children('.pause').click(Gallery.slideshow.pause); | ||
slideshow.children('.play').click(Gallery.slideshow.play); | ||
slideshow.click(Gallery.slideshow.next); | ||
|
||
window.onhashchange(); | ||
$('button.share').click(Gallery.share); | ||
}); | ||
|
||
$('#gallery').on('click', 'a.image', function (event) { | ||
var i = $('#gallery').children('a.image').index(this), | ||
var images = $('#gallery').children('a.image'); | ||
var i = images.index(this), | ||
image = $(this).data('path'); | ||
event.preventDefault(); | ||
location.hash = image; | ||
Gallery.slideshow.start(i, {play: Gallery.slideshow.playPause.playing}); | ||
Slideshow.start(images, i, {play: Slideshow.playPause.playing}); | ||
}); | ||
$('body').append($('#slideshow')); //move the slideshow outside the content so we can hide the content | ||
|
||
jQuery.fn.slideShow.onstop = function () { | ||
$('#content').show(); | ||
|
@@ -395,10 +312,10 @@ window.onhashchange = function () { | |
} | ||
console.log(OC.dirname(album)); | ||
if (Gallery.images.indexOf(album) === -1) { | ||
Gallery.slideshow.end(); | ||
Slideshow.end(); | ||
Gallery.view.viewAlbum(album); | ||
} else { | ||
Gallery.view.viewAlbum(OC.dirname(album)); | ||
$('#gallery a.image[data-path="' + album + '"]').click(); | ||
//$('#gallery a.image[data-path="' + album + '"]').click(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Commenting this out breaks some of the navigation within the gallery app using the back/foreward buttons |
||
} | ||
}; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be removed ;)