Enable tags in pads

This commit is contained in:
yflory
2017-09-19 15:30:08 +02:00
parent 6683434c62
commit 8a09e39f46
12 changed files with 93 additions and 23 deletions

View File

@@ -194,6 +194,24 @@ define([
})
.click(common.prepareFeedback(type));
break;
case 'hashtag':
button = $('<button>', {
'class': 'fa fa-hashtag',
title: Messages.tags_title,
})
.click(common.prepareFeedback(type))
.click(function () {
sframeChan.query('Q_TAGS_GET', null, function (err, res) {
if (err || res.error) { return void console.error(err || res.error); }
var dialog = Cryptpad.dialog.tagPrompt(res.data, function (tags) {
if (!Array.isArray(tags)) { return; }
console.error(tags);
sframeChan.event('EV_TAGS_SET', tags);
});
document.body.appendChild(dialog);
});
});
break;
default:
button = $('<button>', {
'class': "fa fa-question",