aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoranekos2009-05-16 16:48:42 +0000
committeranekos2009-05-16 16:48:42 +0000
commitec8f213dea395dfd16dc12b5d3529f2b43cf3931 (patch)
tree249de3a1979510056ae8fa07c7b0f2723e84b203
parent3b504001c07e8736b227a9d1f11ad9b2d5c1299c (diff)
downloadvimperator-plugins-ec8f213dea395dfd16dc12b5d3529f2b43cf3931.tar.bz2
Fastladder など互換性のある他のサーバに対応(?)
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@33354 d0d07461-0603-4401-acd4-de1884942a52
-rw-r--r--pino.js22
1 files changed, 16 insertions, 6 deletions
diff --git a/pino.js b/pino.js
index f9bca9d..cc137cc 100644
--- a/pino.js
+++ b/pino.js
@@ -36,11 +36,11 @@ var PLUGIN_INFO =
<description>Open livedoor Reader pinned items</description>
<description lang="ja">livedoor Reader でピンを立てたページを開く</description>
<minVersion>2.0pre</minVersion>
- <maxVersion>2.0</maxVersion>
+ <maxVersion>2.1pre</maxVersion>
<updateURL>http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk/pino.js</updateURL>
<author mail="snaka.gml@gmail.com" homepage="http://vimperator.g.hatena.ne.jp/snaka72/">snaka</author>
<license>MIT style license</license>
- <version>1.0.0</version>
+ <version>1.1.0</version>
<detail><![CDATA[
== Subject ==
Open livedoor Reader pinned items.
@@ -58,6 +58,10 @@ var PLUGIN_INFO =
g:pinoAscendingOrder:
default: "false"
+ g:pinoBaseURL:
+ If you want to use fastladder, set "fastladder.com" into this variable.
+ default: "reader.livedoor.com"
+
== API ==
plugins.pino.items():
Return pinned items list array.
@@ -102,6 +106,10 @@ var PLUGIN_INFO =
ピンの一覧の表示順を昇順(古い順)とするかどうか
default: "false" (新しい順)
+ g:pinoBaseURL:
+ fastladder を使う場合は、この変数を "fastladder.com" とする。
+ default: "reader.livedoor.com"
+
== API ==
plugins.pino.api.items():
ピンの一覧を配列で取得する。
@@ -166,9 +174,11 @@ liberator.plugins.pino.api = (function() {
function openBehavior()
window.eval(gv.pinoOpenBehavior) || liberator.NEW_BACKGROUND_TAB;
+ function baseURL()
+ "http://" + (gv.pinoBaseURL || "http://reader.livedoor.com");
+
// }}}
// CLASS ///////////////////////////////////////////////////////// {{{
- const LDR_DOMAIN = "http://reader.livedoor.com"
function Pins() {
this.cache = null;
@@ -196,7 +206,7 @@ liberator.plugins.pino.api = (function() {
remove : function(link) {
var unescapedLink = unescapeHTML(link);
var request = new libly.Request(
- LDR_DOMAIN + "/api/pin/remove",
+ baseURL() + "/api/pin/remove",
{
//Cookie: "reader_sid=" + this.apiKey,
//Referer: "http://reader.livedoor.com/reader/"
@@ -218,7 +228,7 @@ liberator.plugins.pino.api = (function() {
_getPinnedItems : function() {
var result = null;
var request = new libly.Request(
- LDR_DOMAIN + "/api/pin/all",
+ baseURL() + "/api/pin/all",
null,
{ asynchronous: false }
);
@@ -243,7 +253,7 @@ liberator.plugins.pino.api = (function() {
function getLDRApiKey() {
var uri = Cc["@mozilla.org/network/io-service;1"]
.getService(Ci.nsIIOService)
- .newURI(LDR_DOMAIN, null, null);
+ .newURI(baseURL(), null, null);
var cookie = Cc["@mozilla.org/cookieService;1"]
.getService(Ci.nsICookieService)
.getCookieString(uri, null);