aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsuVene2008-12-09 13:50:40 +0000
committersuVene2008-12-09 13:50:40 +0000
commit6278509a75eb164feeb40e6104b16eaf3a0c2a09 (patch)
treed3f86143f6e2824a71e35f96b0d6155fbe0ff000
parent29ae6634391ab660a7f7a3420d44488280c451c4 (diff)
downloadvimperator-plugins-6278509a75eb164feeb40e6104b16eaf3a0c2a09.tar.bz2
* _libly.js ver.0.1.4 にあわせた修正. [26222]
* event 追加. git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@26230 d0d07461-0603-4401-acd4-de1884942a52
-rw-r--r--notifier.js13
-rw-r--r--notifier/observer_growl.js2
-rw-r--r--notifier/subject_hatelabo_bottle.js18
3 files changed, 18 insertions, 15 deletions
diff --git a/notifier.js b/notifier.js
index 48a4b8a..2b084ba 100644
--- a/notifier.js
+++ b/notifier.js
@@ -5,10 +5,14 @@ var PLUGIN_INFO =
<description>notice of change framework.</description>
<description lang="ja">変更通知フレームワーク。</description>
<author mail="suvene@zeromemory.info" homepage="http://zeromemory.sblo.jp/">suVene</author>
- <version>0.1.0</version>
+ <version>0.1.1</version>
<minVersion>2.0pre</minVersion>
<maxVersion>2.0pre</maxVersion>
<detail><![CDATA[
+== NEEDS LIBLARY ==
+_libly.js(ver.0.1.4)
+ @see http://coderepos.org/share/browser/lang/javascript/vimperator-plugins/trunk/_libly.js
+
== Command ==
:notifierstart:
変更通知をスタートします。
@@ -223,6 +227,8 @@ function bootstrap() {
this.count = 0;
this.cache;
+ if (typeof this.preInitialize == 'function') this.preInitialize();
+
var req = new libly.Request(
this.options.url,
this.options.headers,
@@ -253,7 +259,10 @@ function bootstrap() {
this.cache = parsed;
if (typeof this.buildMessages == 'function') {
let messages = this.buildMessages([].concat(diff));
- [].concat(messages).forEach($U.bind(this, function(m) this.notify(m)));
+ [].concat(messages).forEach($U.bind(this, function(m) {
+ this.notify(m);
+ liberator.sleep(1500);
+ }));
}
}
}));
diff --git a/notifier/observer_growl.js b/notifier/observer_growl.js
index e585bdc..8f973c6 100644
--- a/notifier/observer_growl.js
+++ b/notifier/observer_growl.js
@@ -8,8 +8,6 @@ var PLUGIN_INFO =
<version>0.1.0</version>
<minVersion>2.0pre</minVersion>
<maxVersion>2.0pre</maxVersion>
- <detail><![CDATA[
- ]]></detail>
</VimperatorPlugin>;
//}}}
(function() {
diff --git a/notifier/subject_hatelabo_bottle.js b/notifier/subject_hatelabo_bottle.js
index abba6cd..2335cad 100644
--- a/notifier/subject_hatelabo_bottle.js
+++ b/notifier/subject_hatelabo_bottle.js
@@ -8,7 +8,6 @@ var PLUGIN_INFO =
<version>0.1.1</version>
<minVersion>2.0pre</minVersion>
<maxVersion>2.0pre</maxVersion>
- <detail/>
</VimperatorPlugin>;
//}}}
(function() {
@@ -21,24 +20,21 @@ var $U = libly.$U;
var logger = $U.getLogger('subject_hatelabo_bottle');
var URL = 'http://bottle.hatelabo.jp';
-//var URL = 'http://localhost/index.html?a';
notifier.subject.register(notifier.SubjectHttp, {
- interval: 40,
+ interval: 60,
options: {
url: URL,
headers: null,
extra: null
},
+ preInitialize: function() {
+ logger.log('preInitialize: ');
+ },
parse: function(res) {
- if (!res.isSuccess() || res.responseText == '') return;
-
- var dom = res.getHTMLDocument('id("body")//div[contains(concat(" ", @class, " "), " entry ")]');
- if (!dom) return;
-
- var ret = [];
- for (let i = 0, len = dom.childNodes.length; i < len; ret.push(dom.childNodes[i++]));
- return ret;
+ // if (this.count == 0) return []; for debug
+ if (!res.isSuccess() || res.responseText == '') return null;
+ return res.getHTMLDocument('id("body")//div[contains(concat(" ", @class, " "), " entry ")]');
},
diff: function(cache, parsed)
parsed.filter(function(element)