From 3fc8a47bf4217a8bc6d0bbeb65dfaeaaddb1c8fd Mon Sep 17 00:00:00 2001
From: rlx <0x0073@0x2620.org>
Date: Sat, 16 Jun 2012 16:17:28 +0000
Subject: [PATCH] return original string when highlight is called without
query; lazy format annotation date
---
source/Ox.UI/js/Video/AnnotationFolder.js | 6 ++----
source/Ox/js/HTML.js | 3 +++
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/source/Ox.UI/js/Video/AnnotationFolder.js b/source/Ox.UI/js/Video/AnnotationFolder.js
index e8f2036e..def56d93 100644
--- a/source/Ox.UI/js/Video/AnnotationFolder.js
+++ b/source/Ox.UI/js/Video/AnnotationFolder.js
@@ -257,10 +257,8 @@ Ox.AnnotationFolder = function(options, self) {
sort: self.sort,
submitOnBlur: false,
tooltipText: self.options.showInfo ? function(item) {
- return Ox.formatString('{user} {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,
diff --git a/source/Ox/js/HTML.js b/source/Ox/js/HTML.js
index 90330e03..bff193ea 100644
--- a/source/Ox/js/HTML.js
+++ b/source/Ox/js/HTML.js
@@ -254,6 +254,9 @@
'foo
bar baz'
@*/
Ox.highlight = function(string, query, classname, isHTML) {
+ if (!query) {
+ return string;
+ }
var cursor = 0,
entities = [],
matches = [],