[enh] Make frontend nicer + don't use external sources
This commit is contained in:
parent
e60d280be2
commit
69734ba649
4 changed files with 23 additions and 5 deletions
7
public/css/bootstrap.min.css
vendored
Normal file
7
public/css/bootstrap.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -19,6 +19,15 @@ escape = function(string) {
|
|||
return htmlEscapes[match];
|
||||
});
|
||||
};
|
||||
var urlRegex = /(https?://[^\s]+)/g;
|
||||
url = function(string){
|
||||
return ''+string.replace(urlRegex, '<a target="_blank" href="$1">$1</a>')
|
||||
}
|
||||
var titleRegex = /^(.*\n)/;
|
||||
title = function(string){
|
||||
var str=''+string.replace(titleRegex, '<b>$1</b>');
|
||||
return ''+string.replace(titleRegex, '<b>$1</b>');
|
||||
}
|
||||
|
||||
function updatePage(data){
|
||||
|
||||
|
|
@ -31,7 +40,7 @@ function updatePage(data){
|
|||
<div class="log row-fluid">
|
||||
<div class="span9">
|
||||
<p>${escape(item.created_at)} -- ${escape(item.author)} -- ${escape(item.server)}
|
||||
<h4> ${escape(item.content)}</h4>
|
||||
<pre> ${title(url(escape(item.content)))}</pre>
|
||||
</span>
|
||||
</div>
|
||||
`;
|
||||
|
|
@ -60,4 +69,4 @@ $("input").on("keyup",function(e){
|
|||
});
|
||||
});
|
||||
|
||||
updatePage( initData );
|
||||
updatePage( initData );
|
||||
|
|
|
|||
2
public/js/jquery.min.js
vendored
Normal file
2
public/js/jquery.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue