|
|
@ -62,19 +62,25 @@ function create_main_fragment ( root, component ) {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function create_each_block ( root, each_block_value, comment, comment_index, component ) {
|
|
|
|
function create_each_block ( root, each_block_value, comment, i, component ) {
|
|
|
|
var div = createElement( 'div' );
|
|
|
|
var div = createElement( 'div' );
|
|
|
|
div.className = "comment";
|
|
|
|
div.className = "comment";
|
|
|
|
|
|
|
|
var strong = createElement( 'strong' );
|
|
|
|
|
|
|
|
appendNode( strong, div );
|
|
|
|
|
|
|
|
var text_value = i;
|
|
|
|
|
|
|
|
var text = createText( text_value );
|
|
|
|
|
|
|
|
appendNode( text, strong );
|
|
|
|
|
|
|
|
appendNode( createText( "\n\n\t\t" ), div );
|
|
|
|
var span = createElement( 'span' );
|
|
|
|
var span = createElement( 'span' );
|
|
|
|
appendNode( span, div );
|
|
|
|
appendNode( span, div );
|
|
|
|
span.className = "meta";
|
|
|
|
span.className = "meta";
|
|
|
|
var text_value = comment.author;
|
|
|
|
var text_2_value = comment.author;
|
|
|
|
var text = createText( text_value );
|
|
|
|
|
|
|
|
appendNode( text, span );
|
|
|
|
|
|
|
|
appendNode( createText( " wrote " ), span );
|
|
|
|
|
|
|
|
var text_2_value = root.elapsed(comment.time, root.time);
|
|
|
|
|
|
|
|
var text_2 = createText( text_2_value );
|
|
|
|
var text_2 = createText( text_2_value );
|
|
|
|
appendNode( text_2, span );
|
|
|
|
appendNode( text_2, span );
|
|
|
|
|
|
|
|
appendNode( createText( " wrote " ), span );
|
|
|
|
|
|
|
|
var text_4_value = root.elapsed(comment.time, root.time);
|
|
|
|
|
|
|
|
var text_4 = createText( text_4_value );
|
|
|
|
|
|
|
|
appendNode( text_4, span );
|
|
|
|
appendNode( createText( " ago:" ), span );
|
|
|
|
appendNode( createText( " ago:" ), span );
|
|
|
|
appendNode( createText( "\n\n\t\t" ), div );
|
|
|
|
appendNode( createText( "\n\n\t\t" ), div );
|
|
|
|
var raw_before = createElement( 'noscript' );
|
|
|
|
var raw_before = createElement( 'noscript' );
|
|
|
@ -89,15 +95,19 @@ function create_each_block ( root, each_block_value, comment, comment_index, com
|
|
|
|
insertNode( div, target, anchor );
|
|
|
|
insertNode( div, target, anchor );
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
update: function ( changed, root, each_block_value, comment, comment_index ) {
|
|
|
|
update: function ( changed, root, each_block_value, comment, i ) {
|
|
|
|
if ( text_value !== ( text_value = comment.author ) ) {
|
|
|
|
if ( text_value !== ( text_value = i ) ) {
|
|
|
|
text.data = text_value;
|
|
|
|
text.data = text_value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ( text_2_value !== ( text_2_value = root.elapsed(comment.time, root.time) ) ) {
|
|
|
|
if ( text_2_value !== ( text_2_value = comment.author ) ) {
|
|
|
|
text_2.data = text_2_value;
|
|
|
|
text_2.data = text_2_value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( text_4_value !== ( text_4_value = root.elapsed(comment.time, root.time) ) ) {
|
|
|
|
|
|
|
|
text_4.data = text_4_value;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ( raw_value !== ( raw_value = comment.html ) ) {
|
|
|
|
if ( raw_value !== ( raw_value = comment.html ) ) {
|
|
|
|
detachBetween( raw_before, raw_after );
|
|
|
|
detachBetween( raw_before, raw_after );
|
|
|
|
raw_before.insertAdjacentHTML( 'afterend', raw_value );
|
|
|
|
raw_before.insertAdjacentHTML( 'afterend', raw_value );
|
|
|
|