v1.18.x
Baris Soner Usakli 12 years ago
parent f83be710a0
commit ff805a704d

@ -53,10 +53,10 @@ define(['taskbar'], function(taskbar) {
function initializeFileReader() { function initializeFileReader() {
jQuery.event.props.push( "dataTransfer" ); jQuery.event.props.push( "dataTransfer" );
console.log(config);
if(window.FileReader) { if(window.FileReader) {
var drop = $('.post-window .imagedrop'); var drop = $('.post-window .imagedrop'),
var textarea = $('.post-window textarea'); textarea = $('.post-window textarea');
textarea.on('dragenter', function() { textarea.on('dragenter', function() {
@ -76,7 +76,7 @@ define(['taskbar'], function(taskbar) {
drop.on('dragover', cancel); drop.on('dragover', cancel);
drop.on('dragenter', cancel); drop.on('dragenter', cancel);
drop.on('drop', function(e) { drop.on('drop', function(e) {
e.preventDefault(); e.preventDefault();
var uuid = drop.parents('[data-uuid]').attr('data-uuid'), var uuid = drop.parents('[data-uuid]').attr('data-uuid'),
@ -90,7 +90,6 @@ define(['taskbar'], function(taskbar) {
return false; return false;
}); });
} }
} }
@ -124,7 +123,8 @@ define(['taskbar'], function(taskbar) {
document.body.insertBefore(composer.postContainer, taskbar); document.body.insertBefore(composer.postContainer, taskbar);
initializeFileReader(); if(config.imgurClientIDSet)
initializeFileReader();
socket.on('api:composer.push', function(threadData) { socket.on('api:composer.push', function(threadData) {
if (!threadData.error) { if (!threadData.error) {

@ -16,18 +16,21 @@ var user = require('./../user.js'),
}); });
app.get('/api/config', function(req, res, next) { app.get('/api/config', function(req, res, next) {
meta.config.getFields(['postDelay', 'minimumTitleLength', 'minimumPostLength'], function(err, metaConfig) { meta.config.getFields(['postDelay', 'minimumTitleLength', 'minimumPostLength', 'imgurClientID'], function(err, metaConfig) {
if(err) return next(); if(err) return next();
var clientConfig = require('../../public/config.json'); var clientConfig = require('../../public/config.json');
for (var attrname in metaConfig) { for (var attrname in metaConfig) {
clientConfig[attrname] = metaConfig[attrname]; clientConfig[attrname] = metaConfig[attrname];
} }
clientConfig['imgurClientIDSet'] = clientConfig['imgurClientID'] !== '';
delete clientConfig['imgurClientID'];
res.json(200, clientConfig); res.json(200, clientConfig);
}) })
}); });
app.get('/api/home', function(req, res) { app.get('/api/home', function(req, res) {
var uid = (req.user) ? req.user.uid : 0; var uid = (req.user) ? req.user.uid : 0;
categories.getAllCategories(function(data) { categories.getAllCategories(function(data) {

Loading…
Cancel
Save