Revamped image system to use driver-agnotstic storage and be more efficent

This commit is contained in:
Dan Brown
2015-12-07 23:00:34 +00:00
parent 46c905df8a
commit c88096b7e2
12 changed files with 557 additions and 144 deletions

View File

@ -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);

View File

@ -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);
});