mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-05-30 12:38:12 +08:00
Revamped image system to use driver-agnotstic storage and be more efficent
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
<div v-for="image in images">
|
||||
<img class="anim fadeIn"
|
||||
:class="{selected: (image==selectedImage)}"
|
||||
:src="image.thumbnail" :alt="image.title" :title="image.name"
|
||||
:src="image.thumbs.gallery" :alt="image.title" :title="image.name"
|
||||
@click="imageClick(image)"
|
||||
:style="{animationDelay: ($index > 26) ? '160ms' : ($index * 25) + 'ms'}">
|
||||
</div>
|
||||
@ -88,7 +88,7 @@
|
||||
methods: {
|
||||
fetchData: function () {
|
||||
var _this = this;
|
||||
this.$http.get('/images/all/' + _this.page, function (data) {
|
||||
this.$http.get('/images/gallery/all/' + _this.page, function (data) {
|
||||
_this.images = _this.images.concat(data.images);
|
||||
_this.hasMore = data.hasMore;
|
||||
_this.page++;
|
||||
@ -98,7 +98,7 @@
|
||||
setupDropZone: function () {
|
||||
var _this = this;
|
||||
var dropZone = new Dropzone(_this.$els.dropZone, {
|
||||
url: '/upload/image',
|
||||
url: '/images/gallery/upload',
|
||||
init: function () {
|
||||
var dz = this;
|
||||
this.on("sending", function (file, xhr, data) {
|
||||
@ -110,8 +110,8 @@
|
||||
dz.removeFile(file);
|
||||
});
|
||||
});
|
||||
this.on('error', function(file, errorMessage, xhr) {
|
||||
if(errorMessage.file) {
|
||||
this.on('error', function (file, errorMessage, xhr) {
|
||||
if (errorMessage.file) {
|
||||
$(file.previewElement).find('[data-dz-errormessage]').text(errorMessage.file[0]);
|
||||
}
|
||||
console.log(errorMessage);
|
||||
|
@ -100,7 +100,7 @@ module.exports = {
|
||||
onclick: function() {
|
||||
ImageManager.show(function(image) {
|
||||
var html = '<a href="'+image.url+'" target="_blank">';
|
||||
html += '<img src="'+image.display+'" alt="'+image.name+'">';
|
||||
html += '<img src="'+image.thumbs.display+'" alt="'+image.name+'">';
|
||||
html += '</a>';
|
||||
editor.execCommand('mceInsertContent', false, html);
|
||||
});
|
||||
|
Reference in New Issue
Block a user