Show More
@@ -48,34 +48,23 function showPostPreview(e) { | |||||
48 |
|
48 | |||
49 |
|
49 | |||
50 | var mkPreview = function(cln, html) { |
|
50 | var mkPreview = function(cln, html) { | |
51 |
|
||||
52 | cln.innerHTML = html; |
|
51 | cln.innerHTML = html; | |
53 |
|
52 | |||
54 | addRefLinkPreview(cln); |
|
53 | addRefLinkPreview(cln); | |
55 |
|
||||
56 | //if(!$x('.//small', cln)) showRefMap(post, p_num, refMap) |
|
|||
57 | }; |
|
54 | }; | |
58 |
|
55 | |||
59 |
|
56 | |||
60 | cln.innerHTML = "<div class=\"post\">" + gettext('Loading...') + "</div>"; |
|
57 | cln.innerHTML = "<div class=\"post\">" + gettext('Loading...') + "</div>"; | |
61 |
|
58 | |||
62 | //если пост найден в дереве. |
|
|||
63 | if($('div[id='+pNum+']').length > 0) { |
|
59 | if($('div[id='+pNum+']').length > 0) { | |
64 | var postdata = $('div[id='+pNum+']').wrap("<div/>").parent().html(); |
|
60 | var postdata = $('div[id='+pNum+']').wrap("<div/>").parent().html(); | |
65 |
|
61 | |||
66 | //TODO: временно |
|
|||
67 | //funcInit(postdata); |
|
|||
68 |
|
||||
69 | //make preview |
|
|||
70 | mkPreview(cln, postdata); |
|
62 | mkPreview(cln, postdata); | |
71 | } |
|
63 | } else { | |
72 | //ajax api |
|
|||
73 | else { |
|
|||
74 | $.ajax({ |
|
64 | $.ajax({ | |
75 | url: '/api/post/' + pNum + '/?truncated' |
|
65 | url: '/api/post/' + pNum + '/?truncated' | |
76 | }) |
|
66 | }) | |
77 | .success(function(data) { |
|
67 | .success(function(data) { | |
78 | // TODO get a json, not post itself |
|
|||
79 | var postdata = $(data).wrap("<div/>").parent().html(); |
|
68 | var postdata = $(data).wrap("<div/>").parent().html(); | |
80 |
|
69 | |||
81 | //make preview |
|
70 | //make preview | |
@@ -91,6 +80,7 function showPostPreview(e) { | |||||
91 | $del(doc.getElementById(cln.id)); |
|
80 | $del(doc.getElementById(cln.id)); | |
92 |
|
81 | |||
93 | //add preview |
|
82 | //add preview | |
|
83 | $(cln).fadeIn(); | |||
94 | $('body').append(cln); |
|
84 | $('body').append(cln); | |
95 | } |
|
85 | } | |
96 |
|
86 |
General Comments 0
You need to be logged in to leave comments.
Login now