return original string when highlight is called without query; lazy format annotation date

This commit is contained in:
rlx 2012-06-16 16:17:28 +00:00
parent 77f0c762a3
commit 3fc8a47bf4
2 changed files with 5 additions and 4 deletions

View file

@ -257,10 +257,8 @@ Ox.AnnotationFolder = function(options, self) {
sort: self.sort,
submitOnBlur: false,
tooltipText: self.options.showInfo ? function(item) {
return Ox.formatString('<b>{user}</b> {date}', {
user: Ox.encodeHTMLEntities(item.user),
date: item.date
});
return Ox.encodeHTMLEntities(item.user) + ', '
+ Ox.formatDate(item.modified.slice(0, 10), '%B %e, %Y');
} : '',
width: self.options.width,
maxHeight: self.options.type == 'text' ? Infinity : void 0,

View file

@ -254,6 +254,9 @@
'<span class="c">foo <br>bar</span> baz'
@*/
Ox.highlight = function(string, query, classname, isHTML) {
if (!query) {
return string;
}
var cursor = 0,
entities = [],
matches = [],