From 6e4b0f41b4cb636164d040133f434db44e568a9e Mon Sep 17 00:00:00 2001
From: suVene
Date: Sun, 28 Dec 2008 21:09:43 +0000
Subject: add notifier/subject_wassr.js mod libly.js bugfix. etc.
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@27534 d0d07461-0603-4401-acd4-de1884942a52
---
notifier.js | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
(limited to 'notifier.js')
diff --git a/notifier.js b/notifier.js
index d7ca379..7028d7a 100644
--- a/notifier.js
+++ b/notifier.js
@@ -11,7 +11,7 @@ var PLUGIN_INFO =
change notice framework.
変更通知フレームワーク。
suVene
- 0.1.4
+ 0.1.5
MIT
2.0pre
2.0pre
@@ -237,11 +237,13 @@ function bootstrap() {
var SubjectHttp = Subject;//{{{
$U.extend(SubjectHttp.prototype, {
initialize: function() {
+ this.preInitialized = true;
this.initialized = false;
this.count = 0;
this.cache;
- if (typeof this.preInitialize == 'function') this.preInitialize();
+ if (typeof this.preInitialize == 'function') this.preInitialized = this.preInitialize();
+ if (!this.preInitialized) return;
var req = new libly.Request(
this.options.url,
@@ -254,7 +256,12 @@ function bootstrap() {
if (this.cache)
this.initialized = true;
}));
- req.get();
+ req.addEventListener('onFailure', function(res) { logger.log(res); });
+ req.addEventListener('onException', function(res) { logger.log(res); });
+ if (this.method == 'POST')
+ req.post();
+ else
+ req.get();
},
check: function() {
if (!this.initialized) return;
@@ -280,7 +287,10 @@ function bootstrap() {
}
}
}));
- req.get();
+ if (this.method == 'POST')
+ req.post();
+ else
+ req.get();
},
diff: function(cache, parsed) cache
});//}}}
--
cgit v1.2.3