diff options
| author | drry | 2008-12-22 09:01:57 +0000 | 
|---|---|---|
| committer | drry | 2008-12-22 09:01:57 +0000 | 
| commit | 363a66408611d27b8b0f22e1d8226b86dbfb9ffc (patch) | |
| tree | 04c064178971ebd5d91af71aedd018b488a37405 | |
| parent | f9dc40f9a3e34ede7f40b7137576243d3dff06f6 (diff) | |
| download | vimperator-plugins-363a66408611d27b8b0f22e1d8226b86dbfb9ffc.tar.bz2 | |
 * XPath を修正しました。
 * ほか。
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@27220 d0d07461-0603-4401-acd4-de1884942a52
| -rw-r--r-- | _libly.js | 6 | ||||
| -rw-r--r-- | notifier.js | 4 | ||||
| -rw-r--r-- | notifier/observer_growl.js | 4 | ||||
| -rwxr-xr-x | notifier/subject_weather_yahoo.js | 8 | 
4 files changed, 10 insertions, 12 deletions
| @@ -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 =  <VimperatorPlugin>      <name>{NAME}</name> -    <description>yahoo weather forecast notice.</description> -    <description lang="ja">ヤフー天気予報通知。</description> +    <description>Yahoo! Weather forecast notice.</description> +    <description lang="ja">Yahoo!天気予報通知。</description>      <author mail="suvene@zeromemory.info" homepage="http://zeromemory.sblo.jp/">suVene</author>      <version>0.1.2</version>      <minVersion>2.0pre</minVersion> @@ -12,7 +12,7 @@ var PLUGIN_INFO =      <detail><![CDATA[  == Options ==  >|| -liberator.globalVariables.subject_weather_yahoo_urls =  [url1, url2,…] +liberator.globalVariables.subject_weather_yahoo_urls = [url1, url2,…]  ||<  - @see http://weather.yahoo.co.jp/weather/      ]]></detail> @@ -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; | 
