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 @@
41 41
             $previewContainer = $tabContainer.find( "#chr-notice-preview" ),
42 42
             parentNotice = $tabContainer.find( "#notice_in-reply-to" ).val(),
43 43
             $noticeTextarea = $tabContainer.find( ".notice_data-text" ),
44
-            noticeText = $noticeTextarea.val(),
45
-            encodedNoticeText = encodeURIComponent( noticeText );
44
+            noticeText = $noticeTextarea.val();
46 45
 
47 46
         // TODO: non-absolute url
48
-        $.post( "/main/render-notice", "raw_content=" + encodedNoticeText + "&ajax=true&parent_notice=" + parentNotice,
47
+        $.post(
48
+            "/main/render-notice",
49
+            {
50
+                "raw_content": noticeText,
51
+                "ajax": true,
52
+                "parent_notice": parentNotice
53
+            },
49 54
             function( data ) {
50 55
                 $previewContainer.html( $( '#chr-rendered-notice', data ).html() );
51 56
             }

Loading…
Cancel
Save