Browse Source

autofill the note content with the username being replied to

pull/37/head
Aaron Parecki 8 years ago
parent
commit
42a5e44d17
2 changed files with 10 additions and 1 deletions
  1. +0
    -1
      controllers/controllers.php
  2. +10
    -0
      views/new-post.php

+ 0
- 1
controllers/controllers.php View File

@ -56,7 +56,6 @@ $app->get('/new', function() use($app) {
$params = $app->request()->params(); $params = $app->request()->params();
$entry = false; $entry = false;
$photo_url = false;
$in_reply_to = ''; $in_reply_to = '';
if(array_key_exists('reply', $params)) if(array_key_exists('reply', $params))

+ 10
- 0
views/new-post.php View File

@ -143,6 +143,16 @@ $(function(){
$("#note_content_remaining").addClass("pcheck"+tweet_check); $("#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 // ctrl-s to save
$(window).on('keydown', function(e){ $(window).on('keydown', function(e){
if(e.keyCode == 83 && e.ctrlKey){ if(e.keyCode == 83 && e.ctrlKey){

Loading…
Cancel
Save