Firefox AddonであるVimperatorの解説(主に開発視点)

FrontPage > liberator > liberator.Command


Command (specs, description, action, extraInfo)

Vimperatorコマンドのクラス的なFunctionオブジェクト
specs(Array)
コマンド名の配列
description(String)
コマンドの説明文字列
action(Function)
実行される関数
extraInfo(Object)
その他コマンドの情報(オプション)

メンバー

specs
引数のspecsと同値
shortNames
短縮可能なコマンド名の短い方のリスト
longNames
短縮可能なコマンド名の長い方と短縮不可なコマンド名のリスト
name
logNamesの最初の要素
names
全てのコマンド名リスト
description
引数のdescriptionと同じ
action
引数のactionと同じ
completer
引数のextraInfoに含まれるcompleter、無ければnull
options
引数のextraInfoに含まれるoptions、無ければ空リスト
argCount
引数のextraInfoに含まれるargCount、無ければ空文字列
isUserCommand
引数のextraInfoに含まれるisUserCommand、無ければfalse
liberator.commands.addUserCommandを使用した場合は自動的にtrueが付加される

prototypeメンバー

execute (args, special, count, modifires)
コマンドの実行を受け持つメソッド
args(String)
コマンド引数文字列
special(Boolean)
"!"が使用されたか否か
count(Number)
コマンド先頭に付けれた数値
modifiers
???

optionsリストの長さが1以上またはargCountがある場合はliberator.commands.parseArgsでargsがパースされる。パースされた結果がnullであった場合はコマンドは実行されず、falseを返す
hasName (name)
自身がそのnameのコマンド名を持っているか否かの真偽値を返す

備考

プラグインなどでコマンドを追加したい場合にはコマンド登録方法を参照

コメントをかく


「http://」を含む投稿は禁止されています。

利用規約をご確認のうえご記入下さい

Wiki内検索

メニューバー






どなたでも編集できます