margin-bottom: 1em;
}
-#sone #update-status label {
+#sone #update-status label, #sone #post-message label {
display: none;
}
float: right;
}
-#sone #update-status .select-sender, #sone .create-reply .select-sender {
+#sone #update-status .select-sender, #sone .create-reply .select-sender, #sone #post-message .select-sender {
display: none;
}
-#sone #update-status .select-sender button {
+#sone #update-status .select-sender button, #sone #post-message .select-sender button {
display: inline;
float: left;
}
float: right;
}
-#sone .create-reply .select-sender button {
+#sone .create-reply .select-sender button, #sone #post-message .select-sender button {
display: inline;
float: left;
}
/* ajaxify input field on “view Sone” page. */
getTranslation("WebInterface.DefaultText.Message", function(defaultText) {
registerInputTextareaSwap("#sone #post-message input[name=text]", defaultText, "text", false, false);
+ $("#sone #post-message .select-sender").css("display", "inline");
+ $("#sone #post-message .sender").hide();
+ $("#sone #post-message .select-sender button").click(function() {
+ $("#sone #post-message .sender").show();
+ $("#sone #post-message .select-sender").hide();
+ return false;
+ });
$("#sone #post-message").submit(function() {
- text = $(this).find(":input:enabled").val();
- $.getJSON("createPost.ajax", { "formPassword": getFormPassword(), "recipient": getShownSoneId(), "text": text }, function(data, textStatus) {
+ sender = $(this).find(":input[name=sender]").val();
+ text = $(this).find(":input[name=text]:enabled").val();
+ $.getJSON("createPost.ajax", { "formPassword": getFormPassword(), "recipient": getShownSoneId(), "sender": sender, "text": text }, function(data, textStatus) {
if ((data != null) && data.success) {
loadNewPost(data.postId, getCurrentSoneId());
}
});
- $(this).find(":input:enabled").val("").blur();
+ $(this).find(":input[name=sender]").val(getCurrentSoneId());
+ $(this).find(":input[name=text]:enabled").val("").blur();
+ $(this).find(".sender").hide();
+ $(this).find(".select-sender").show();
return false;
});
});
<input type="hidden" name="formPassword" value="<% formPassword|html>" />
<input type="hidden" name="returnPage" value="<% request.uri|html>" />
<input type="hidden" name="recipient" value="<% sone.id|html>" />
+ <label for="sender"><%= Page.Index.Label.Sender|l10n|html></label>
+ <div class="sender">
+ <select name="sender" title="<%= View.UpdateStatus.Text.ChooseSenderIdentity|l10n|html>">
+ <%foreach localSones localSone>
+ <option value="<% localSone.id|html>"<%if localSone.current> selected="selected"<%/if>><% localSone.niceName|html></option>
+ <%/foreach>
+ </select>
+ </div>
+ <div class="select-sender"><button type="button" title="<%= View.UpdateStatus.Text.ChooseSenderIdentity|l10n|html>">+</button></div><label for="text"><%= Page.Index.Label.Text|l10n|html></label>
<input type="text" name="text" value="" />
<button type="submit"><%= Page.CreatePost.Button.Post|l10n|html></button>
</form>