Skip to content

Commit

Permalink
Updated plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
mooz committed Oct 15, 2009
1 parent d3e0e8b commit b2cdce0
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 42 deletions.
2 changes: 1 addition & 1 deletion locale/en-US/installplugindialog.dtd
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
<!ENTITY keySnail.installPluginDialog.theseFilesWillBeInstalled "These files will be installed">

<!ENTITY keySnail.installPluginDialog.notice1 "Plugin can cause crucial damage to your computer.">
<!ENTITY keySnail.installPluginDialog.notice2 "Please check source code before installing the plugin">
<!ENTITY keySnail.installPluginDialog.notice2 "Please check the source code before you install the plugin.">
19 changes: 18 additions & 1 deletion locale/en-US/keysnail.properties
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,21 @@ deletePluginTitle=Delete %S
deletePluginMessage=Really delete %S?
pluginDeleted=Plugin has been deleted

canceledByUser=Canceled by user
canceledByUser=Canceled by user

enable=Enable
disable=Disable
delete=Delete

# filepicker title
selectInitFileDirectory=Select init file directory
selectEditor=Select editor
selectPluginDirectory=Select plugin directory
selectPluginFile=Select plugin file

# plugin updates
checkForUpdates=Check for updates
updateNotFound=No updates found
updateFoundTitle=New version available
updateFoundMessage=%S version %S found. Do you want to update?
pluginUpdated=%S has been updated to version %S
19 changes: 18 additions & 1 deletion locale/ja/keysnail.properties
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,21 @@ deletePluginTitle=%S の削除
deletePluginMessage=%S を本当に削除しますか?
pluginDeleted=プラグインが削除されました

canceledByUser=キャンセルされました
canceledByUser=キャンセルされました

enable=有効化
disable=無効化
delete=削除

# filepicker title
selectInitFileDirectory=初期化ファイルの場所を選んでください
selectEditor=エディタを選んでください
selectPluginDirectory=プラグインの管理に使用するディレクトリを選んでください
selectPluginFile=プラグインファイルを選択してください

# plugin updates
checkForUpdates=更新を確認
updateNotFound=更新は見つかりませんでした
updateFoundTitle=新しいバージョンがリリースされています
updateFoundMessage=「%S」のバージョン %S がリリースされています。アップデートしますか?
pluginUpdated=「%S」がバージョン %S にアップデートされました
4 changes: 2 additions & 2 deletions plugins/clipboard-observer.ks.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ var PLUGIN_INFO =
<name lang="ja">クリップボード監視君</name>
<description>Observe clipboard</description>
<description lang="ja">クリップボードを監視します</description>
<version>1.0</version>
<version>1.1</version>
<updateURL>http://github.com/mooz/keysnail/raw/master/plugins/clipboard-observer.ks.js</updateURL>
<iconURL>http://github.com/mooz/keysnail/raw/master/plugins/clipboard-observer.icon.png</iconURL>
<iconURL>http://github.com/mooz/keysnail/raw/master/plugins/icon/clipboard-observer.icon.png</iconURL>
<author mail="stillpedant@gmail.com" homepage="http://d.hatena.ne.jp/mooz/">mooz</author>
<license>The MIT License</license>
<license lang="ja">MIT ライセンス</license>
Expand Down
5 changes: 3 additions & 2 deletions plugins/github-plugin.ks.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ var PLUGIN_INFO =
<name lang="ja">github プラグインヘルパー</name>
<description>Helps you to install plugin from github</description>
<description lang="ja">github から簡単にプラグインをインストール</description>
<version>1.1</version>
<version>1.2</version>
<updateURL>http://github.com/mooz/keysnail/raw/master/plugins/github-plugin.ks.js</updateURL>
<iconURL>http://github.com/mooz/keysnail/raw/master/plugins/github-plugin.icon.png</iconURL>
<iconURL>http://github.com/mooz/keysnail/raw/master/plugins/icon/github-plugin.icon.png</iconURL>
<author mail="stillpedant@gmail.com" homepage="http://d.hatena.ne.jp/mooz/">mooz</author>
<license>The MIT License</license>
<license lang="ja">MIT ライセンス</license>
Expand All @@ -29,6 +29,7 @@ This ext seek for the KeySnail plugin at the current github page and when plugin
=== 説明 ===
==== サジェスト機能 ====
このプラグインをインストールすることにより、現在閲覧している github のページに KeySnail プラグインが見つかった際に画面上部にへッセージが表れ、指示に従って簡単にプラグインをインストールすることができるようになります。
既にインストール済みのプラグインに対してはサジェストが無効となりますので、明示的にインストールを行いたい場合は次に説明するコマンドを使用してください。
==== コマンド入力によるインストール機能 ====
このプラグインをインストールすることで次のエクステが追加されます。
Expand Down
4 changes: 2 additions & 2 deletions plugins/hateb-keysnail-collabo.ks.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
var PLUGIN_INFO =
<KeySnailPlugin>
<name>Hatebnail</name>
<description>Use Hatena bookmark extensioni from KeySnail!</description>
<description>Use Hatena bookmark extension from KeySnail!</description>
<description lang="ja">はてなブックマーク拡張を KeySnail から使おう!</description>
<version>1.0</version>
<version>1.1</version>
<updateURL>http://github.com/mooz/keysnail/raw/master/plugins/hateb-keysnail-collabo.ks.js</updateURL>
<author mail="stillpedant@gmail.com" homepage="http://d.hatena.ne.jp/mooz/">mooz</author>
<license>The MIT License</license>
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes.
52 changes: 19 additions & 33 deletions plugins/yet-another-twitter-client-keysnail.ks.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ var PLUGIN_INFO =
<name>Yet Another Twitter Client KeySnail</name>
<description>Make KeySnail behave like Twitter client</description>
<description lang="ja">KeySnail を Twitter クライアントに</description>
<version>1.0</version>
<version>1.1</version>
<updateURL>http://github.com/mooz/keysnail/raw/master/plugins/yet-another-twitter-client-keysnail.ks.js</updateURL>
<iconURL>http://github.com/mooz/keysnail/raw/master/plugins/yet-another-twitter-client-keysnail.icon.png</iconURL>
<iconURL>http://github.com/mooz/keysnail/raw/master/plugins/icon/yet-another-twitter-client-keysnail.icon.png</iconURL>
<author mail="stillpedant@gmail.com" homepage="http://d.hatena.ne.jp/mooz/">mooz</author>
<license>The MIT License</license>
<license lang="ja">MIT ライセンス</license>
<minVersion>0.9.4</minVersion>
<minVersion>0.9.6</minVersion>
<provides>
<ext>yet-another-twitter-client-keysnail</ext>
</provides>
<require>
<script>http://github.com/mooz/keysnail/raw/master/plugins/oauth.js</script>
<script>http://github.com/mooz/keysnail/raw/master/plugins/lib/oauth.js</script>
</require>
<options>
<option>
Expand Down Expand Up @@ -116,12 +116,12 @@ var yATwitterClientKeySnail = new
[function (status) {
if (status)
tweet();
}, L("Tweet (つぶやく)")],
}, M({ja: "つぶやく : ", en: ""}) + "Tweet"],
[function (status) {
if (status) {
tweet("@" + status.screen_name + " ", status.id);
}
}, L("Reply (返信)")],
}, M({ja: "返信 : ", en: ""}) + "Send reply message"],
[function (status) {
if (status) {
tweet("RT @" + status.screen_name + ": " + status.text);
Expand All @@ -131,43 +131,43 @@ var yATwitterClientKeySnail = new
if (status) {
showFollowersStatus(status.screen_name);
}
}, L("Show Target status (選択中ユーザのつぶやきを一覧表示)")],
}, M({ja: "選択中ユーザのつぶやきを一覧表示 : ", en: ""}) + "Show Target status"],
[function (status) {
if (status) {
showMentions();
}
}, L("Show mentions (自分への返信を一覧表示)")],
}, M({ja: "自分への返信を一覧表示 : ", en: ""}) + "Show mentions"],
[function (status) {
if (status) {
gBrowser.loadOneTab("http://twitter.com/" + status.screen_name
+ "/status/" + status.id, null, null, null, false);
}
}, L("Show status in web page (Twitter のサイトでそのつぶやきを見る)")],
}, M({ja: "Twitter のサイトでそのつぶやきを見る : ", en: ""}) + "Show status in web page"],
[function (status) {
popUpStatusWhenUpdated = !popUpStatusWhenUpdated;
display.echoStatusBar(M({ja: ("ポップアップ通知を" + (popUpStatusWhenUpdated ? "有効にしました" : "無効にしました")),
en: ("Pop up " + (popUpStatusWhenUpdated ? "enabled" : "disabled"))}));
}, L("Toggle pop up status (ポップアップ通知の切り替え)")],
}, M({ja: "ポップアップ通知の切り替え : ", en: ""}) + "Toggle pop up notification status"],
[function (status) {
reAuthorize();
}, L("Reauthorize (認証しなおす)")],
}, M({ja: "再認証 : ", en: ""}) + "Reauthorize"],
[function (status) {
if (status) {
tweet(content.document.title + " - " + getTinyURL(window.content.location.href));
}
}, L("Tweet with the current web page URL (現在のページのタイトルと URL を使ってつぶやく)")],
}, M({ja: "現在のページのタイトルと URL を使ってつぶやく : ", en: ""}) + "Tweet with the current web page URL"],
[function (status) {
if (status)
search();
}, L("Search keyword (単語を検索)")],
}, M({ja: "単語を検索 : ", en: ""}) + "Search keyword"],
[function (status) {
if (status) {
var matched = status.text.match("(https?|ftp)(://[a-zA-Z0-9/?#_.\\-]+)");
if (matched) {
gBrowser.loadOneTab(matched[1] + matched[2], null, null, null, false);
}
}
}, L("Visit URL in the message (つぶやき中の URL を開く)")]
}, M({ja: "メッセージ中の URL を開く : ", en: ""}) + "Visit URL in the message"]
];
// ============================== Arrange services ============================== //
Expand Down Expand Up @@ -304,33 +304,19 @@ var yATwitterClientKeySnail = new

var context = {};

var loadSucceeded = false;
for (var i = 0; i < userscript.loadPath.length; ++i) {
var baseDir = userscript.loadPath[i];
if (!baseDir) continue;

// loadUserScript return -1 when file not found
if (userscript.loadUserScript(
function (aPath) {
userscript.loadSubScript(aPath, context);
}, baseDir, ["oauth.js"]) == 0) {
loadSucceeded = true;
break;
}
}

if (!loadSucceeded) {
if (!usescript.require("oauth.js", context)) {
display.notify(L(util.xmlGetLocaleString(PLUGIN_INFO.name)) + " :: " +
M({ja: "このプラグインの動作には oauth.js が必要です。 oauth.js をプラグインディレクトリ内に配置した上でお試し下さい。",
en: "This plugin requires oauth.js but not found. Please locate oauth.js to the plugin directory."}));
M({ja: "このプラグインの動作には oauth.js が必要です。 oauth.js をプラグインディレクトリ内に配置した上でお試し下さい。",
en: "This plugin requires oauth.js but not found. Please locate oauth.js to the plugin directory."}));
}

var OAuth = context.OAuth();

function authorizationSequence() {
authorize();

prompt.read("Press Enter When Authorization Finished:",
prompt.read(M({ja: "認証が終了したら Enter キーを押してください",
en: "Press Enter When Authorization Finished:"}),
function (aReadStr) {
if (aReadStr == null)
return;
Expand Down

0 comments on commit b2cdce0

Please sign in to comment.