summaryrefslogtreecommitdiff
path: root/views/new-post.php
diff options
context:
space:
mode:
authorAaron Parecki <aaron@parecki.com>2016-04-07 16:37:56 -0700
committerAaron Parecki <aaron@parecki.com>2016-04-07 16:37:56 -0700
commit42a5e44d176869053db5bc451f4cd0c4a11b8a74 (patch)
tree3356ae0f4dc59bb4dbd78357be4eed6b6cc33892 /views/new-post.php
parent9e817943acfb4c8a8b5824cd7a87a21a654a7fb1 (diff)
autofill the note content with the username being replied to
Diffstat (limited to 'views/new-post.php')
-rw-r--r--views/new-post.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/views/new-post.php b/views/new-post.php
index 6c76f51..53cb01e 100644
--- a/views/new-post.php
+++ b/views/new-post.php
@@ -143,6 +143,16 @@ $(function(){
$("#note_content_remaining").addClass("pcheck"+tweet_check);
});
+ $("#note_in_reply_to").on('change', function(){
+ if(match=$("#note_in_reply_to").val().match(/twitter\.com\/([^\/]+)\/status/)) {
+ $("#note_content").val( "@"+match[1]+" "+$("#note_content").val() );
+ }
+ });
+
+ if($("#note_in_reply_to").val() != "") {
+ $("#note_in_reply_to").change();
+ }
+
// ctrl-s to save
$(window).on('keydown', function(e){
if(e.keyCode == 83 && e.ctrlKey){