send feedback for uploads

pull/1/head
ansuz 8 years ago
parent 7bee2ba27d
commit 17146d7af9

@ -123,6 +123,7 @@ define([
if (err) { return void console.error(err); } // TODO if (err) { return void console.error(err); } // TODO
console.log(title); console.log(title);
common.log(Messages._getKey('upload_success', [title])); common.log(Messages._getKey('upload_success', [title]));
common.prepareFeedback('upload')();
if (config.onUploaded) { if (config.onUploaded) {
var data = getData(file, href); var data = getData(file, href);

@ -914,7 +914,7 @@ define([
return '_' + parts[0].toUpperCase(); return '_' + parts[0].toUpperCase();
}; };
var prepareFeedback = function (key) { var prepareFeedback = common.prepareFeedback = function (key) {
if (typeof(key) !== 'string') { return $.noop; } if (typeof(key) !== 'string') { return $.noop; }
return function () { return function () {
feedback(key.toUpperCase() + getAppSuffix()); feedback(key.toUpperCase() + getAppSuffix());
@ -929,8 +929,10 @@ define([
button = $('<button>', { button = $('<button>', {
title: Messages.exportButtonTitle, title: Messages.exportButtonTitle,
}).append($('<span>', {'class':'fa fa-download', style: 'font:'+size+' FontAwesome'})); }).append($('<span>', {'class':'fa fa-download', style: 'font:'+size+' FontAwesome'}));
button.click(prepareFeedback(type));
if (callback) { if (callback) {
button.click(prepareFeedback(type)).click(callback); button.click(callback);
} }
break; break;
case 'import': case 'import':
@ -962,7 +964,7 @@ define([
data.FM.handleFile(file, ev); data.FM.handleFile(file, ev);
if (callback) { callback(); } if (callback) { callback(); }
}); });
button.click(function () { $input.click(); }) button.click(function () { $input.click(); });
break; break;
case 'template': case 'template':
if (!AppConfig.enableTemplates) { return; } if (!AppConfig.enableTemplates) { return; }

Loading…
Cancel
Save