##// END OF EJS Templates
Load reflink previews of posts that are not present on the current page
neko259 -
r354:34225dd7 default
parent child Browse files
Show More
@@ -55,8 +55,6 b' function showPostPreview(e) {'
55
55
56 cln.innerHTML = 'Загрузка...';
56 cln.innerHTML = 'Загрузка...';
57
57
58 var found = false;
59
60 //если пост найден в дереве.
58 //если пост найден в дереве.
61 if($('div[id='+pNum+']').length > 0) {
59 if($('div[id='+pNum+']').length > 0) {
62 var postdata = $('div[id='+pNum+']').html();
60 var postdata = $('div[id='+pNum+']').html();
@@ -66,34 +64,29 b' function showPostPreview(e) {'
66
64
67 //make preview
65 //make preview
68 mkPreview(cln, postdata);
66 mkPreview(cln, postdata);
69
70 found = true;
71 }
67 }
72 //ajax api
68 //ajax api
73 // else {
69 else {
74 // $.getJSON(mayuri_cfg['board_url']+'api/single/'+pNum)
70 $.ajax({
75 // .success(function(data) {
71 url: '/api/post/' + pNum
76 // //post templates
72 })
77 // var postdata = makeAjaxPost(data).html();
73 .success(function(data) {
78 //
74 // TODO get a json, not post itself
79 // //TODO: временно
75 var postdata = $(data).html();
80 // //funcInit(postdata);
76
81 //
77 //make preview
82 // //make preview
78 mkPreview(cln, postdata);
83 // mkPreview(cln, postdata);
79
84 //
80 })
85 // })//if error
81 .error(function() {
86 // .error(function() {
82 cln.innerHTML = 'Пост не найден.';
87 // cln.innerHTML = 'Пост не найден.';
83 });
88 // });
84 }
89 // }
90
85
91 $del(doc.getElementById(cln.id));
86 $del(doc.getElementById(cln.id));
92
87
93 if (found) {
88 //add preview
94 //add preview
89 $('body').append(cln);
95 $('body').append(cln);
96 }
97 }
90 }
98
91
99 function delPostPreview(e) {
92 function delPostPreview(e) {
@@ -52,5 +52,5 b" urlpatterns = patterns('',"
52 url(r'^jsi18n/$', 'django.views.i18n.javascript_catalog', js_info_dict),
52 url(r'^jsi18n/$', 'django.views.i18n.javascript_catalog', js_info_dict),
53
53
54 # API
54 # API
55 url(r'^get_post/(?P<post_id>\w+)/$', views.get_post, name="get_post"),
55 url(r'^api/post/(?P<post_id>\w+)/$', views.get_post, name="get_post"),
56 )
56 )
General Comments 0
You need to be logged in to leave comments. Login now