second pass, #981

This commit is contained in:
Julian Lam
2014-02-10 13:30:26 -05:00
parent e9852a804c
commit 55b39f1eff
3 changed files with 221 additions and 208 deletions

View File

@@ -61,5 +61,13 @@
"fork_success": "Succesfully forked topic!",
"reputation": "Reputation",
"posts": "Posts"
"posts": "Posts",
"composer.title_placeholder": "Enter your topic title here...",
"composer.write": "Write",
"composer.preview": "Preview",
"composer.discard": "Discard",
"composer.submit": "Submit",
"composer.replying_to": "Replying to",
"composer.new_topic": "New Topic"
}

View File

@@ -82,10 +82,12 @@ define(['taskbar'], function(taskbar) {
function push(post) {
var uuid = utils.generateUUID();
translator.translate('[[topic:composer.new_topic]]', function(newTopicStr) {
taskbar.push('composer', uuid, {
title: post.title ? post.title : 'New Topic',
title: post.title ? post.title : newTopicStr,
icon: post.picture
});
});
composer.posts[uuid] = post;
@@ -103,8 +105,8 @@ define(['taskbar'], function(taskbar) {
composer.createNewComposer = function(post_uuid) {
templates.preload_template('composer', function() {
var composerTemplate = templates['composer'].parse({});
translator.translate(composerTemplate, function(composerTemplate) {
composerTemplate = $(composerTemplate);
composerTemplate.attr('id', 'cmp-uuid-' + post_uuid);
@@ -124,7 +126,9 @@ define(['taskbar'], function(taskbar) {
bodyEl = postContainer.find('textarea');
if (parseInt(postData.tid) > 0) {
titleEl.val('Replying to: ' + postData.title);
translator.translate('[[topic:composer.replying_to]]: ' + postData.title, function(newTitle) {
titleEl.val(newTitle);
});
titleEl.prop('disabled', true);
} else if (parseInt(postData.pid) > 0) {
titleEl.val(postData.title);
@@ -326,6 +330,7 @@ define(['taskbar'], function(taskbar) {
}
});
});
});
}
//http://stackoverflow.com/questions/14441456/how-to-detect-which-device-view-youre-on-using-twitter-bootstrap-api

View File

@@ -1,6 +1,6 @@
<div class="composer">
<div class="composer-container">
<input class="title form-control" type="text" tabIndex="1" placeholder="Enter your topic title here..." />
<input class="title form-control" type="text" tabIndex="1" placeholder="[[topic:composer.title_placeholder]]" />
<div class="btn-toolbar formatting-bar">
<div class="btn-group">
<span class="btn btn-link" tabindex="-1"><i class="fa fa-bold"></i></span>
@@ -20,11 +20,11 @@
</div>
<ul class="nav nav-tabs">
<li class="active"><a data-pane=".tab-write" data-toggle="tab">Write</a></li>
<li><a data-pane=".tab-preview" data-toggle="tab">Preview</a></li>
<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="btn-group pull-right action-bar">
<button class="btn btn-default" data-action="discard" tabIndex="5"><i class="fa fa-times"></i> Discard</button>
<button data-action="post" class="btn btn-default btn-primary" tabIndex="3"><i class="fa fa-check"></i> Submit</button>
<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>
</li>
</ul>