Skip to content
This repository was archived by the owner on Nov 1, 2020. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Update to nextcloud 15.04
Fix code to work with latest nextcloud release

Signed-off-by: François Sylvestre <[email protected]>
  • Loading branch information
fefux committed Feb 16, 2019
commit af44c9e45d0c20f269be49ae07b82f43d53400cb
31 changes: 17 additions & 14 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?xml version="1.0"?>
<info>
<info xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://apps.nextcloud.com/schema/apps/info.xsd">
<id>gallery</id>
<name>Gallery</name>
<summary>Media gallery for Nextcloud</summary>
<description>Media gallery for Nextcloud with the following features:

- Support for large selection of media types (depending on server setup)
Expand Down Expand Up @@ -32,24 +34,25 @@
files app and adds a gallery view to public links.
Compatible with Firefox, Chrome and Internet Explorer 11
</description>
<licence>AGPL</licence>
<version>18.2.0</version>
<licence>agpl</licence>
<author>Olivier Paroz, Robin Appelman</author>
<version>18.1.0</version>
<namespace>Gallery</namespace>
<category>Multimedia</category>
<default_enable />
<category>multimedia</category>

<website>https://github.com/nextcloud/gallery</website>
<bugs>https://github.com/nextcloud/gallery/issues</bugs>
<repository>https://github.com/nextcloud/gallery.git</repository>

<dependencies>
<nextcloud min-version="15" max-version="15"/>
</dependencies>

<documentation>
<user>https://github.com/nextcloud/gallery/blob/master/README.md</user>
<admin>https://github.com/nextcloud/gallery/blob/master/README.md</admin>
<developer>https://github.com/nextcloud/gallery/wiki</developer>
</documentation>
<category>Multimedia</category>
<website>https://github.com/nextcloud/gallery</website>
<bugs>https://github.com/nextcloud/gallery/issues</bugs>
<repository type="git">https://github.com/nextcloud/gallery.git</repository>
<dependencies>
<php min-version="5.6" max-version="7"/>
<nextcloud min-version="14" max-version="14"/>
</dependencies>
<default_enable />
<shipped>true</shipped>
</info>

351 changes: 351 additions & 0 deletions appinfo/signature.json

Large diffs are not rendered by default.

18 changes: 6 additions & 12 deletions css/share.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
right: 17px;
top: 18px;
}
#app #dropdown.shareDropDown .shareWithLoading {
/* The "box-sizing" of "#app" descendants is set to "border-box" in the
* server. To have the same size the padding here has to be set to the
#app-content #dropdown.shareDropDown .shareWithLoading {
/* The "box-sizing" of "#app-content" descendants is set to "border-box" in
* the server. To have the same size the padding here has to be set to the
* min-width/min-height plus the padding set for the icon in the default
* "content-box" sizing. */
padding: 19px;
Expand All @@ -52,9 +52,9 @@
top: 18px;
}

#app #dropdown .shareWithConfirm {
/* The "box-sizing" of "#app" descendants is set to "border-box" in the
* server. To have the same size the padding here has to be set to the
#app-content #dropdown .shareWithConfirm {
/* The "box-sizing" of "#app-content" descendants is set to "border-box" in
* the server. To have the same size the padding here has to be set to the
* min-width/min-height plus the padding set for the icon in the default
* "content-box" sizing. */
padding: 19px;
Expand Down Expand Up @@ -175,12 +175,6 @@ a.showCruds:hover,a.unshare:hover {
width: 90%;
}

.ui-autocomplete { /* limit dropdown height to 4 1/2 entries */
max-height:103px;
overflow-y:auto;
overflow-x:hidden;
}

.notCreatable {
padding-left: 12px;
padding-top: 12px;
Expand Down
8 changes: 0 additions & 8 deletions css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,6 @@ div.crumb.last a {
list-style: initial;
}

#app {
/* #app is the parent of #controls and #gallery, and #controls uses a sticky
* position, so the #app height must contain the full gallery for the
* controls to be stuck while scrolling. The server sets "height: 100%" for
* the app, so that value has to be overriden. */
height: auto;
}

#gallery.hascontrols {
position: relative;
overflow: hidden;
Expand Down
3 changes: 1 addition & 2 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
/* global OC, $, _, Gallery, SlideShow */
$(document).ready(function () {
"use strict";
$('#controls').prependTo($('#app'));
Gallery.utility = new Gallery.Utility();
Gallery.view = new Gallery.View();
Gallery.token = Gallery.utility.getPublicToken();
Expand Down Expand Up @@ -58,7 +57,7 @@ $(document).ready(function () {
});

// This block loads new rows
$('html, #content-wrapper').scroll(function () {
$(window).scroll(function () {
Gallery.view.loadVisibleRows(Gallery.albumMap[Gallery.currentAlbum]);
});

Expand Down
26 changes: 2 additions & 24 deletions js/breadcrumb.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,6 @@
(function ($, OC, t, Gallery) {
"use strict";

var TEMPLATE =
'{{#each crumbs}}' +
' <div class="crumb {{cssClass}}" data-dir="{{dir}}">' +
' {{#if link}}' +
' <a href="{{link}}">' +
' {{#if img}}' +
' {{#with img}}' +
' <img title="{{title}}" src="{{imageSrc}}">' +
' {{/with}}' +
' {{else}}' +
' {{name}}' +
' {{/if}}' +
' </a>' +
' {{else}}' +
' <span>{{name}}</span>' +
' {{/if}}' +
' </div>' +
'{{/each}}';

/**
* Breadcrumbs that represent the path to the current album
*
Expand Down Expand Up @@ -65,9 +46,6 @@
this.albumPath = albumPath;
this.availableWidth = availableWidth;
this.breadcrumbs = [];
if (!this._template) {
this._template = Handlebars.compile(TEMPLATE);
}
this._build();
this._resize(this.availableWidth);
},
Expand Down Expand Up @@ -133,7 +111,7 @@
*/
_build: function () {
var i, crumbs, name, path, currentAlbum;
var albumName = $('#app').data('albumname');
var albumName = $('#app-content').data('albumname');
if (!albumName) {
albumName = t('gallery', 'Gallery');
}
Expand Down Expand Up @@ -225,7 +203,7 @@
_render: function () {
this.breadcrumbsElement.children().remove();

var breadcrumbs = this._template({
var breadcrumbs = Gallery.Templates.breadcrumb({
crumbs: this.breadcrumbs
});

Expand Down
2 changes: 1 addition & 1 deletion js/gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
download: function (event) {
event.preventDefault();

var path = $('#app').data('albumname');
var path = $('#app-content').data('albumname');
var files = Gallery.currentAlbum;
var downloadUrl = Gallery.utility.buildFilesUrl(path, files);

Expand Down
17 changes: 1 addition & 16 deletions js/galleryalbum.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,6 @@
(function ($, Gallery) {
"use strict";

var TEMPLATE =
'<a class="row-element" style="width: {{targetWidth}}px; height: {{targetHeight}}px;" ' +
'data-width="{{targetWidth}}" data-height="{{targetHeight}}"' +
'href="{{targetPath}}" data-dir="{{dir}}" data-path="{{path}}"' +
'data-permissions="{{permissions}}" data-freespace="{{freeSpace}}"' +
'>' +
' <div class="album-loader loading"></div>' +
' <span class="album-label">' +
' <span class="title">{{label}}</span>' +
' </span>' +
' <div class="album container" style="width: {{targetWidth}}px; height: {{targetHeight}}px;" >' +
' </div>' +
'</a>';

/**
* Creates a new album object to store information about an album
*
Expand Down Expand Up @@ -120,8 +106,7 @@
*/
getDom: function (targetHeight) {
if (this.domDef === null) {
var template = Handlebars.compile(TEMPLATE);
var albumElement = template({
var albumElement = Gallery.Templates.galleryalbum({
targetHeight: targetHeight,
targetWidth: targetHeight,
dir: this.path,
Expand Down
13 changes: 1 addition & 12 deletions js/galleryimage.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,6 @@
(function ($, Gallery, oc_requesttoken) {
"use strict";

var TEMPLATE =
'<a class="row-element" style="width: {{targetWidth}}px; height: {{targetHeight}}px;" ' +
'href="" data-path="{{path}}">' +
' <div class="image-loader loading"></div>' +
' <span class="image-label">' +
' <span class="title">{{label}}</span>' +
' </span>' +
' <div class="image container"></div>' +
'</a>';

/**
* Creates a new image object to store information about a media file
*
Expand Down Expand Up @@ -115,8 +105,7 @@
*/
getDom: function (targetHeight) {
if (this.domDef === null) {
var template = Handlebars.compile(TEMPLATE);
var imageElement = template({
var imageElement = Gallery.Templates.galleryimage({
targetHeight: targetHeight,
targetWidth: targetHeight,
label: OC.basename(this.path),
Expand Down
2 changes: 0 additions & 2 deletions js/galleryutility.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,8 @@ window.Gallery = window.Gallery || {};

/* jshint camelcase: false */
var params = {
c: etag,
width: longEdge,
height: longEdge,
requesttoken: oc_requesttoken
};
return this.buildGalleryUrl('preview', '/' + fileId, params);
},
Expand Down
13 changes: 4 additions & 9 deletions js/galleryview.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
* At this stage, there is no loading taking place, so we can look for new rows
*/

var scroll = $('#content-wrapper').scrollTop() + $(window).scrollTop();
var scroll = $(window).scrollTop() + $(window).scrollTop();
// 2 windows worth of rows is the limit from which we need to start loading new rows.
// As we scroll down, it grows
var targetHeight = ($(window).height() * 2) + scroll;
Expand Down Expand Up @@ -490,7 +490,7 @@
* @private
*/
_setBackgroundColour: function () {
var wrapper = $('#content-wrapper');
var wrapper = $('#app-content');
var albumDesign = Gallery.config.albumDesign;
if (!$.isEmptyObject(albumDesign) && albumDesign.background) {
wrapper.css('background-color', albumDesign.background);
Expand Down Expand Up @@ -566,13 +566,8 @@
if (!$actionsContainer.length) {
return;
}
if (!this._addButtonTemplate) {
this._addButtonTemplate = Handlebars.compile(TEMPLATE_ADDBUTTON);
}
var $newButton = $(this._addButtonTemplate({
addText: t('gallery', 'New'),
iconUrl: OC.imagePath('core', 'actions/add')
}));

var $newButton = $(TEMPLATE_ADDBUTTON);

$actionsContainer.prepend($newButton);
$newButton.tooltip({'placement': 'bottom'});
Expand Down
1 change: 1 addition & 0 deletions js/merged.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"vendor/jquery-touch-events/src/1.0.8/jquery.mobile-events.min.js",
"vendor/jquery.ui.touch-punch-custom.js",
"gallery.js",
"templates.js",
"galleryutility.js",
"galleryconfig.js",
"galleryinfobox.js",
Expand Down
Loading