From df9e03f9f3e4d9c9f0e10a1c1c35045bbaa5f90e Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 18 Jan 2011 07:31:55 +0100 Subject: [PATCH] Allow sender selection on new posts. --- src/main/resources/i18n/sone.en.properties | 3 +++ src/main/resources/static/css/sone.css | 9 +++++++++ src/main/resources/static/javascript/sone.js | 19 +++++++++++++++---- .../resources/templates/include/updateStatus.html | 10 +++++++++- 4 files changed, 36 insertions(+), 5 deletions(-) diff --git a/src/main/resources/i18n/sone.en.properties b/src/main/resources/i18n/sone.en.properties index 7b8450f..b5c7e24 100644 --- a/src/main/resources/i18n/sone.en.properties +++ b/src/main/resources/i18n/sone.en.properties @@ -55,6 +55,7 @@ Page.DeleteSone.Button.No=No, do not delete. Page.Index.Title=Your Sone - Sone Page.Index.Label.Text=Post text: +Page.Index.Label.Sender=Sender: Page.Index.Button.Post=Post! Page.Index.PostList.Title=Post Feed Page.Index.PostList.Text.NoPostYet=Nobody has written any posts yet. You should probably start it right now! @@ -200,6 +201,8 @@ View.Post.Reply.DeleteLink=Delete View.Post.LikeLink=Like View.Post.UnlikeLink=Unlike +View.UpdateStatus.Text.ChooseSenderIdentity=Choose the sender identity + View.Trust.Tooltip.Trust=Trust this person View.Trust.Tooltip.Distrust=Assign negative trust to this person View.Trust.Tooltip.Untrust=Remove your trust assignment for this person diff --git a/src/main/resources/static/css/sone.css b/src/main/resources/static/css/sone.css index 5b1d486..530b2e1 100644 --- a/src/main/resources/static/css/sone.css +++ b/src/main/resources/static/css/sone.css @@ -172,6 +172,15 @@ textarea { float: right; } +#sone #update-status .select-sender { + display: none; +} + +#sone #update-status .select-sender button { + display: inline; + float: none; +} + #sone .nice-name { font-weight: bold; } diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 9d00c5a..c5b3a38 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -1078,17 +1078,28 @@ $(document).ready(function() { /* this initializes the status update input field. */ getTranslation("WebInterface.DefaultText.StatusUpdate", function(defaultText) { registerInputTextareaSwap("#sone #update-status .status-input", defaultText, "text", false, false); + $("#sone #update-status .select-sender").show(); + $("#sone #update-status .sender").hide(); + $("#sone #update-status .select-sender button").click(function() { + $("#sone #update-status .sender").show(); + $("#sone #update-status .select-sender").hide(); + return false; + }); $("#sone #update-status").submit(function() { if ($(this).find(":input.default:enabled").length > 0) { return false; } - text = $(this).find(":input:enabled").val(); - $.getJSON("createPost.ajax", { "formPassword": getFormPassword(), "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(), "sender": sender, "text": text }, function(data, textStatus) { if ((data != null) && data.success) { - loadNewPost(data.postId, getCurrentSoneId()); + loadNewPost(data.postId, data.sone, data.recipient); } }); - $(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; }); }); diff --git a/src/main/resources/templates/include/updateStatus.html b/src/main/resources/templates/include/updateStatus.html index fba951d..43d4d70 100644 --- a/src/main/resources/templates/include/updateStatus.html +++ b/src/main/resources/templates/include/updateStatus.html @@ -1,7 +1,15 @@
- + +
+ +
+
-- 2.7.4