Browse Source

Use object for $.post data instead of string

For readability, mostly.
master
Chimo 2 years ago
parent
commit
97165438ef
No known key found for this signature in database
1 changed files with 8 additions and 3 deletions
  1. 8
    3
      js/chr-notice-preview.js

+ 8
- 3
js/chr-notice-preview.js View File

@@ -41,11 +41,16 @@
$previewContainer = $tabContainer.find( "#chr-notice-preview" ),
parentNotice = $tabContainer.find( "#notice_in-reply-to" ).val(),
$noticeTextarea = $tabContainer.find( ".notice_data-text" ),
noticeText = $noticeTextarea.val(),
encodedNoticeText = encodeURIComponent( noticeText );
noticeText = $noticeTextarea.val();

// TODO: non-absolute url
$.post( "/main/render-notice", "raw_content=" + encodedNoticeText + "&ajax=true&parent_notice=" + parentNotice,
$.post(
"/main/render-notice",
{
"raw_content": noticeText,
"ajax": true,
"parent_notice": parentNotice
},
function( data ) {
$previewContainer.html( $( '#chr-rendered-notice', data ).html() );
}

Loading…
Cancel
Save