From 363a66408611d27b8b0f22e1d8226b86dbfb9ffc Mon Sep 17 00:00:00 2001 From: drry Date: Mon, 22 Dec 2008 09:01:57 +0000 Subject: * XPath を修正しました。 * ほか。 git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@27220 d0d07461-0603-4401-acd4-de1884942a52 --- _libly.js | 6 +++--- notifier.js | 4 +--- notifier/observer_growl.js | 4 ++-- notifier/subject_weather_yahoo.js | 8 ++++---- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/_libly.js b/_libly.js index 2db2756..f3c4dd3 100644 --- a/_libly.js +++ b/_libly.js @@ -233,8 +233,8 @@ libly.$U = {//{{{ // HTML, XML, DOM, E4X {{{ pathToURL: function(a, baseURL, doc) { if (!a) return ''; - var XHTML_NS = "http://www.w3.org/1999/xhtml" - var XML_NS = "http://www.w3.org/XML/1998/namespace" + var XHTML_NS = "http://www.w3.org/1999/xhtml"; + var XML_NS = "http://www.w3.org/XML/1998/namespace"; //var path = (a.href || a.getAttribute('src') || a.action || a.value || a); var path = (a.getAttribute('href') || a.getAttribute('src') || a.action || a.value || a); if (/^https?:\/\//.test(path)) return path; @@ -263,7 +263,7 @@ libly.$U = {//{{{ if (!xpath) return null; context = context || window.content.document; var result = (context.ownerDocument || context).evaluate(xpath, context, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null); - return result.singleNodeValue ? result.singleNodeValue : null; + return result.singleNodeValue || null; }, getNodesFromXPath: function(xpath, context, callback, thisObj) { var ret = []; diff --git a/notifier.js b/notifier.js index 779d91d..e276702 100644 --- a/notifier.js +++ b/notifier.js @@ -262,9 +262,7 @@ function bootstrap() { var parsed, diff; if (typeof this.parse == 'function') parsed = this.parse(res); if (parsed && typeof this.diff == 'function') diff = this.diff(this.cache, parsed); - if (diff && - (typeof diff.length == 'undefined' || - (typeof diff.length != 'undefined' && diff.length > 0))) { + if (diff && (typeof diff.length == 'undefined' || diff.length > 0)) { this.cache = parsed; if (typeof this.buildMessages == 'function') { let messages = this.buildMessages(diff); diff --git a/notifier/observer_growl.js b/notifier/observer_growl.js index f257230..4a737f3 100644 --- a/notifier/observer_growl.js +++ b/notifier/observer_growl.js @@ -157,7 +157,7 @@ notifier.observer.register(notifier.Observer, { let item = container.childNodes[i]; let growl = item.__data__; if (force || - (growl && growl.created && !growl.options.sticky && + (growl && !growl.options.sticky && growl.created && growl.created.getTime() + (growl.options.life * 1000) < (new Date()).getTime())) { if (item.id != 'observer_growl_closer') removeNodes.push(item); @@ -187,7 +187,7 @@ notifier.observer.register(notifier.Observer, { if (!flg) return; clearInterval(id); this.intervalIDs[id] = false; - }; + } } }); diff --git a/notifier/subject_weather_yahoo.js b/notifier/subject_weather_yahoo.js index 648cc4f..891ff27 100755 --- a/notifier/subject_weather_yahoo.js +++ b/notifier/subject_weather_yahoo.js @@ -2,8 +2,8 @@ var PLUGIN_INFO = {NAME} - yahoo weather forecast notice. - ヤフー天気予報通知。 + Yahoo! Weather forecast notice. + Yahoo!天気予報通知。 suVene 0.1.2 2.0pre @@ -12,7 +12,7 @@ var PLUGIN_INFO = || -liberator.globalVariables.subject_weather_yahoo_urls = [url1, url2,…] +liberator.globalVariables.subject_weather_yahoo_urls = [url1, url2,…] ||< - @see http://weather.yahoo.co.jp/weather/ ]]> @@ -42,7 +42,7 @@ URLs.forEach(function(url) { }, parse: function(res) { var parsed = res.getHTMLDocument( - 'id("cat-pass") | id("yjw_pinpoint_today") | id("yjw_pinpoint_tomorrow")' + 'id("cat-pass yjw_pinpoint_today yjw_pinpoint_tomorrow")' ); if (!parsed.length) return; -- cgit v1.2.3