mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-25 11:16:51 +00:00
Show annotations on nodes in demo debugger
Change-Id: I41948e8549345c713f1bd0762b08807b8f7617da
This commit is contained in:
parent
49963c75fd
commit
4303e9f30c
|
@ -286,16 +286,21 @@ $html = '<div>' . file_get_contents( $page ) . '</div>';
|
|||
for ( var i = 0; i < ve.instances[0].documentModel.data.length; i++ ) {
|
||||
$li = $('<li>');
|
||||
element = ve.instances[0].documentModel.data[i];
|
||||
if( element.type ) {
|
||||
if ( element.type ) {
|
||||
text = element.type;
|
||||
annotations = element.annotations;
|
||||
} else if ( element.length > 1 ){
|
||||
annotations = [];
|
||||
$.each(element[1].arr, function(index, val) {
|
||||
annotations.push( val.name );
|
||||
});
|
||||
text = element[0] + ' [' + annotations.join(', ') + ']';
|
||||
text = element[0];
|
||||
annotations = element[1];
|
||||
} else {
|
||||
text = element;
|
||||
annotations = undefined;
|
||||
}
|
||||
if ( annotations ) {
|
||||
text += ' [' + annotations.get().map(
|
||||
function( ann ) {
|
||||
return ann.name;
|
||||
} ).join(', ') + ']';
|
||||
}
|
||||
|
||||
$li.text( text );
|
||||
|
|
Loading…
Reference in a new issue