|
|
@ -30,9 +30,9 @@ define(['taskbar'], function(taskbar) {
|
|
|
|
imagelist = $('.post-window .imagelist'),
|
|
|
|
imagelist = $('.post-window .imagelist'),
|
|
|
|
uuid = dropDiv.parents('[data-uuid]').attr('data-uuid'),
|
|
|
|
uuid = dropDiv.parents('[data-uuid]').attr('data-uuid'),
|
|
|
|
posts = composer.posts[uuid];
|
|
|
|
posts = composer.posts[uuid];
|
|
|
|
|
|
|
|
|
|
|
|
$(reader).on('loadend', function(e) {
|
|
|
|
$(reader).on('loadend', function(e) {
|
|
|
|
var bin = this.result;
|
|
|
|
var bin = this.result;
|
|
|
|
bin = bin.split(',')[1];
|
|
|
|
bin = bin.split(',')[1];
|
|
|
|
|
|
|
|
|
|
|
|
var img = {
|
|
|
|
var img = {
|
|
|
@ -47,13 +47,13 @@ define(['taskbar'], function(taskbar) {
|
|
|
|
imagelist.append(imageLabel);
|
|
|
|
imagelist.append(imageLabel);
|
|
|
|
dropDiv.hide();
|
|
|
|
dropDiv.hide();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
reader.readAsDataURL(file);
|
|
|
|
reader.readAsDataURL(file);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function initializeFileReader() {
|
|
|
|
function initializeFileReader() {
|
|
|
|
jQuery.event.props.push( "dataTransfer" );
|
|
|
|
jQuery.event.props.push( "dataTransfer" );
|
|
|
|
|
|
|
|
|
|
|
|
var draggingDocument = false;
|
|
|
|
var draggingDocument = false;
|
|
|
|
|
|
|
|
|
|
|
|
if(window.FileReader) {
|
|
|
|
if(window.FileReader) {
|
|
|
@ -77,12 +77,12 @@ define(['taskbar'], function(taskbar) {
|
|
|
|
drop.off('dragleave');
|
|
|
|
drop.off('dragleave');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
function cancel(e) {
|
|
|
|
function cancel(e) {
|
|
|
|
e.preventDefault();
|
|
|
|
e.preventDefault();
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
drop.on('dragover', cancel);
|
|
|
|
drop.on('dragover', cancel);
|
|
|
|
drop.on('dragenter', cancel);
|
|
|
|
drop.on('dragenter', cancel);
|
|
|
|
|
|
|
|
|
|
|
@ -96,7 +96,7 @@ define(['taskbar'], function(taskbar) {
|
|
|
|
for (var i=0; i<files.length; i++) {
|
|
|
|
for (var i=0; i<files.length; i++) {
|
|
|
|
loadFile(files[i]);
|
|
|
|
loadFile(files[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(!files.length)
|
|
|
|
if(!files.length)
|
|
|
|
drop.hide();
|
|
|
|
drop.hide();
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
@ -157,7 +157,7 @@ define(['taskbar'], function(taskbar) {
|
|
|
|
composer.load(uuid);
|
|
|
|
composer.load(uuid);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
app.alert({
|
|
|
|
app.alert({
|
|
|
|
type: 'error',
|
|
|
|
type: 'danger',
|
|
|
|
timeout: 5000,
|
|
|
|
timeout: 5000,
|
|
|
|
alert_id: 'post_error',
|
|
|
|
alert_id: 'post_error',
|
|
|
|
title: 'Please Log In to Post',
|
|
|
|
title: 'Please Log In to Post',
|
|
|
@ -284,7 +284,7 @@ define(['taskbar'], function(taskbar) {
|
|
|
|
|
|
|
|
|
|
|
|
composer.reposition(post_uuid);
|
|
|
|
composer.reposition(post_uuid);
|
|
|
|
composer.active = post_uuid;
|
|
|
|
composer.active = post_uuid;
|
|
|
|
|
|
|
|
|
|
|
|
composer.postContainer.setAttribute('data-uuid', post_uuid);
|
|
|
|
composer.postContainer.setAttribute('data-uuid', post_uuid);
|
|
|
|
if (parseInt(post_data.tid) > 0) {
|
|
|
|
if (parseInt(post_data.tid) > 0) {
|
|
|
|
titleEl.value = 'Replying to: ' + post_data.title;
|
|
|
|
titleEl.value = 'Replying to: ' + post_data.title;
|
|
|
@ -330,13 +330,13 @@ define(['taskbar'], function(taskbar) {
|
|
|
|
var postData = composer.posts[post_uuid],
|
|
|
|
var postData = composer.posts[post_uuid],
|
|
|
|
titleEl = composer.postContainer.querySelector('input'),
|
|
|
|
titleEl = composer.postContainer.querySelector('input'),
|
|
|
|
bodyEl = composer.postContainer.querySelector('textarea');
|
|
|
|
bodyEl = composer.postContainer.querySelector('textarea');
|
|
|
|
|
|
|
|
|
|
|
|
titleEl.value = titleEl.value.trim();
|
|
|
|
titleEl.value = titleEl.value.trim();
|
|
|
|
bodyEl.value = bodyEl.value.trim();
|
|
|
|
bodyEl.value = bodyEl.value.trim();
|
|
|
|
|
|
|
|
|
|
|
|
if (titleEl.value.length < config.minimumTitleLength) {
|
|
|
|
if (titleEl.value.length < config.minimumTitleLength) {
|
|
|
|
return app.alert({
|
|
|
|
return app.alert({
|
|
|
|
type: 'error',
|
|
|
|
type: 'danger',
|
|
|
|
timeout: 2000,
|
|
|
|
timeout: 2000,
|
|
|
|
title: 'Title too short',
|
|
|
|
title: 'Title too short',
|
|
|
|
message: "Please enter a longer title. At least " + config.minimumTitleLength+ " characters.",
|
|
|
|
message: "Please enter a longer title. At least " + config.minimumTitleLength+ " characters.",
|
|
|
@ -346,7 +346,7 @@ define(['taskbar'], function(taskbar) {
|
|
|
|
|
|
|
|
|
|
|
|
if (bodyEl.value.length < config.minimumPostLength) {
|
|
|
|
if (bodyEl.value.length < config.minimumPostLength) {
|
|
|
|
return app.alert({
|
|
|
|
return app.alert({
|
|
|
|
type: 'error',
|
|
|
|
type: 'danger',
|
|
|
|
timeout: 2000,
|
|
|
|
timeout: 2000,
|
|
|
|
title: 'Content too short',
|
|
|
|
title: 'Content too short',
|
|
|
|
message: "Please enter a longer post. At least " + config.minimumPostLength + " characters.",
|
|
|
|
message: "Please enter a longer post. At least " + config.minimumPostLength + " characters.",
|
|
|
|