added new hooks for rendering help messages in composer, removed markdown text from translation

v1.18.x
Julian Lam 11 years ago
parent 1a85d45567
commit 44ac7ec262

@ -40,7 +40,7 @@
"socket.io-wildcard": "~0.1.1",
"bcryptjs": "~0.7.10",
"nodebb-plugin-mentions": "~0.4",
"nodebb-plugin-markdown": "~0.3",
"nodebb-plugin-markdown": "~0.4",
"nodebb-widget-essentials": "~0.0",
"nodebb-theme-vanilla": "~0.0.14",
"nodebb-theme-cerulean": "~0.0.13",

@ -91,6 +91,5 @@
"composer.thumb_file_label": "Or upload a file",
"composer.thumb_remove": "Clear fields",
"composer.drag_and_drop_images": "Drag and Drop Images Here",
"composer.content_is_parsed_with": "Content is parsed with",
"composer.upload_instructions": "Upload images by dragging & dropping them."
}

@ -638,6 +638,13 @@ define(['taskbar'], function(taskbar) {
}
});
socket.emit('modules.composer.renderHelp', function(err, html) {
if (html && html.length > 0) {
postContainer.find('.help').html(html);
postContainer.find('[data-pane=".tab-help"]').parent().removeClass('hidden');
}
});
$(window).trigger('action:composer.loaded', {
post_uuid: post_uuid
});

@ -58,6 +58,7 @@
<ul class="nav nav-tabs">
<li class="active"><a data-pane=".tab-write" data-toggle="tab">[[topic:composer.write]]</a></li>
<li><a data-pane=".tab-preview" data-toggle="tab">[[topic:composer.preview]]</a></li>
<li class="hidden"><a data-pane=".tab-help" data-toggle="tab">[[topic:composer.help]]</a></li>
<li class="btn-group pull-right action-bar">
<button class="btn btn-default" data-action="discard" tabIndex="5"><i class="fa fa-times"></i> [[topic:composer.discard]]</button>
<button data-action="post" class="btn btn-default btn-primary" tabIndex="3"><i class="fa fa-check"></i> [[topic:composer.submit]]</button>
@ -71,13 +72,15 @@
<div class="tab-pane tab-preview">
<div class="preview well"></div>
</div>
<div class="tab-pane tab-help">
<div class="help well"></div>
</div>
</div>
<div class="imagedrop"><div>[[topic:composer.drag_and_drop_images]]</div></div>
<div class="text-center instructions">
<span>
<small>[[topic:composer.content_is_parsed_with]] <a href="http://daringfireball.net/projects/markdown/syntax">Markdown</a>. </small>
<span class="upload-instructions hide"><small>[[topic:composer.upload_instructions]]</small></span>
</span>

@ -68,7 +68,11 @@ SocketModules.composer.editCheck = function(socket, pid, callback) {
SocketModules.composer.renderPreview = function(socket, content, callback) {
plugins.fireHook('filter:post.parse', content, callback);
}
};
SocketModules.composer.renderHelp = function(socket, data, callback) {
plugins.fireHook('filter:composer.help', '', callback);
};
/* Chat */

Loading…
Cancel
Save