Skip to content

Commit

Permalink
Add category link to footer of each entry.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sheep-y committed Dec 25, 2016
1 parent 532a6fb commit 8dc65ea
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 3 additions & 1 deletion html/action_view.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,11 @@ <h1 id="act_view_h_title"></h1>
"show_entries" : function act_view_show_entries ( div, cat, idList ) {
var action = od.action.view;
var content = idList.map( function act_view_show_entries_each( id ) {
return '<div class="detail" id="' + id + '">' + cat.data[ id ] + '</div>';
var data = '<div class="detail" id="' + id + '">' + cat.data[ id ] + '</div>';
return data.replace( /(?=<p class=publishedIn>)/, "<a class='cat' href='?list.name."+cat.name+"'>" + cat.getTitle() + "</a>" );
} ).join( '' );
div.innerHTML = od.gui.highlight( content );
// Find title
var h1 = content.match( /<h1[^>]*>(.+?)<\/h1\s*>/ );
action.set_title( h1[1].replace( /<(\w+)[^>]*>.*<\/\1>|<br\/?>| \[Attack Technique\]/g, '' ) );
},
Expand Down
5 changes: 5 additions & 0 deletions html/style_data.css
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@
text-align: right;
}

.detail a.cat {
color: #888;
font-size: smaller;
float: left;
}
.detail .publishedIn {
font-size: smaller;
color: #888;
Expand Down
5 changes: 4 additions & 1 deletion java/db4e/converter/Converter.java
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,13 @@ else synchronized ( book ) {
log.log( Level.WARNING, "Entry with unparsed book: {0} {1} - {2}", new Object[]{ entry.shortid, entry.name, published} );
entry.meta[ entry.meta.length-1 ] = sourceBook.indexOf( ", " ) > 0 ? sourceBook.toString() : lastSource;

if ( regxPublished.find() )
log.log( Level.WARNING, "Entry with multiple publish: {0} {1}", new Object[]{ entry.shortid, entry.name } );

} else if ( entry.data.contains( "ublished in" ) ) {
log.log( Level.WARNING, "Entry with unparsed source: {0} {1}", new Object[]{ entry.shortid, entry.name } );
} else {
log.log( Level.INFO, "Entry without source book: {0} {1}", new Object[]{ entry.shortid, entry.name } );
log.log( Level.WARNING, "Entry without source book: {0} {1}", new Object[]{ entry.shortid, entry.name } );
}
}

Expand Down

0 comments on commit 8dc65ea

Please sign in to comment.