diff options
author | suVene | 2009-01-06 16:09:15 +0000 |
---|---|---|
committer | suVene | 2009-01-06 16:09:15 +0000 |
commit | 9606bcd4adda1face76e946515405a4670fc25f3 (patch) | |
tree | eaaddb3d1a78ce35fe7c5ba44fa14fad190d6731 /notifier | |
parent | 2243140774caf96b2cf595278f48677789ec97e4 (diff) | |
download | vimperator-plugins-9606bcd4adda1face76e946515405a4670fc25f3.tar.bz2 |
* sticky_keywords を Regexp(keyword, 'i') で比較。
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@28057 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'notifier')
-rw-r--r-- | notifier/observer_growl.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/notifier/observer_growl.js b/notifier/observer_growl.js index a10f2e3..d8c60c1 100644 --- a/notifier/observer_growl.js +++ b/notifier/observer_growl.js @@ -11,7 +11,7 @@ var PLUGIN_INFO = <description>notification from the subjects is notified to you by the Growl style.</description> <description lang="ja">Growl風通知。</description> <author mail="suvene@zeromemory.info" homepage="http://zeromemory.sblo.jp/">suVene</author> - <version>0.1.6</version> + <version>0.1.7</version> <license>MIT</license> <minVersion>2.0pre</minVersion> <maxVersion>2.0pre</maxVersion> @@ -70,6 +70,8 @@ Growl.prototype = { this.node = node; this.created = new Date(); this.options = $U.extend(this.defaults, (options || {})); + this.sticky_keywords_exp = + this.options.sticky_keywords.map(function(k) new RegExp(k, 'i')); this.message = message; var div = node.getElementsByTagName('div'); div[0].addEventListener('click', $U.bind(this, this.remove), false); @@ -186,7 +188,7 @@ notifier.observer.register(notifier.Observer, { var text = growl.message.title + ' ' + growl.message.message.replace(/(?:<[^>]*>)+/g, ''); - if (growl.options.sticky_keywords.some(function(k) text.indexOf(k) > -1) || + if (growl.sticky_keywords_exp.some(function(k) text.match(k)) || growl.created.getTime() + growl.options.life * 1000 > new Date().getTime()) return false; |