|
|
@ -4,17 +4,20 @@ var components = components || {};
|
|
|
|
|
|
|
|
|
|
|
|
(function() {
|
|
|
|
(function() {
|
|
|
|
components.core = {
|
|
|
|
components.core = {
|
|
|
|
|
|
|
|
'post': function(name, value) {
|
|
|
|
|
|
|
|
return $('[data-' + name + '="' + value + '"]');
|
|
|
|
|
|
|
|
},
|
|
|
|
'post/content': function(pid) {
|
|
|
|
'post/content': function(pid) {
|
|
|
|
var el = $('[data-pid="' + pid + '"]').find('[component="post/content"]');
|
|
|
|
var el = components.core.post('pid', pid).find('[component="post/content"]');
|
|
|
|
return el.length ? el : $('#content_' + pid); // deprecated after 0.7x
|
|
|
|
return el.length ? el : $('#content_' + pid); // deprecated after 0.7x
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'post/header': function(pid) {
|
|
|
|
'post/header': function(pid) {
|
|
|
|
var el = $('[data-pid="' + pid + '"]').find('[component="post/header"]');
|
|
|
|
var el = components.core.post('pid', pid).find('[component="post/header"]');
|
|
|
|
return el.length ? el : $('#topic_title_' + pid); // deprecated after 0.7x
|
|
|
|
return el.length ? el : $('#topic_title_' + pid); // deprecated after 0.7x
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'post/anchor': function(pid) {
|
|
|
|
'post/anchor': function(index) {
|
|
|
|
var el = $('[data-pid="' + pid + '"]').find('[component="post/anchor"]');
|
|
|
|
var el = components.core.post('index', index).find('[component="post/anchor"]');
|
|
|
|
return el.length ? el : $('#post_anchor_' + pid); // deprecated after 0.7x
|
|
|
|
return el.length ? el : $('#post_anchor_' + index); // deprecated after 0.7x
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|