[enh] there should be an html styling for commands
This commit is contained in:
parent
381953bbd0
commit
ea411c6cde
@ -17,4 +17,9 @@
|
||||
|
||||
.log p {
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
.log span.cmd {
|
||||
background: #eee;
|
||||
color: #003e80;
|
||||
padding: 3px 8px;
|
||||
}
|
||||
|
@ -25,10 +25,12 @@ url = function(string){
|
||||
}
|
||||
var titleRegex = /^(.*\n)/;
|
||||
title = function(string){
|
||||
var str=''+string.replace(titleRegex, '<b>$1</b>');
|
||||
return ''+string.replace(titleRegex, '<b>$1</b>');
|
||||
}
|
||||
|
||||
var cmdRegex = /```([^`]*?)```/g
|
||||
cmd = function(string) {
|
||||
return ''+string.replace(cmdRegex, '<span class="cmd">$1</span>');
|
||||
}
|
||||
function updatePage(data){
|
||||
|
||||
var content = "";
|
||||
@ -47,7 +49,7 @@ function updatePage(data){
|
||||
<div class="log row-fluid">
|
||||
<div class="span9">
|
||||
<p><a href="/log/${id}">${escape(item.created_at)} -- ${escape(item.author)} -- ${escape(item.server)}</a></p>
|
||||
<pre> ${title(url(escape(item.content)))}</pre>
|
||||
<pre> ${cmd(title(url(escape(item.content))))}</pre>
|
||||
</span>
|
||||
</div>
|
||||
`;
|
||||
|
Loading…
Reference in New Issue
Block a user