Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

553 lines (538 sloc) 34.849 kb
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<?xml-stylesheet href="chrome://mozapps/content/preferences/preferences.css"?>
<?xml-stylesheet href="chrome://browser/skin/preferences/preferences.css"?>
<?xml-stylesheet href="chrome://keysnail/skin/css/preference.css"?>
<!DOCTYPE dialog SYSTEM "chrome://keysnail/locale/preference.dtd">
<prefwindow id="keysnail-preference"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
title="&keySnail.preference.title;"
ondialogcancel="return ksPreference.onFinish();"
ondialogaccept="return ksPreference.onFinish();"
windowtype="KeySnail:Preference"
minheight="700px"
>
<prefpane id="prefpane-rcfile" label="&keySnail.preference.userscript;"
flex="1"
onpaneload="ksPreference.onGeneralPaneLoad();">
<!-- pref values -->
<preferences>
<preference
id="extensions.keysnail.keyhandler.global_enabled"
name="extensions.keysnail.keyhandler.global_enabled"
type="bool"/>
<preference
id="extensions.keysnail.keyhandler.use_prefix_argument"
name="extensions.keysnail.keyhandler.use_prefix_argument"
type="bool"/>
<preference
id="extensions.keysnail.keyhandler.low_priority"
name="extensions.keysnail.keyhandler.low_priority"
type="bool"/>
<preference
id="extensions.keysnail.plugin.global_enabled"
name="extensions.keysnail.plugin.global_enabled"
type="bool"/>
<preference
id="extensions.keysnail.plugin.run_update_checker_automatically"
name="extensions.keysnail.plugin.run_update_checker_automatically"
type="bool"/>
<preference
id="extensions.keysnail.plugin.update_checker_interval"
name="extensions.keysnail.plugin.update_checker_interval"
type="int"/>
<preference
id="extensions.keysnail.vimp.enabled"
name="extensions.keysnail.vimp.enabled"
type="bool"/>
</preferences>
<!-- Status -->
<groupbox orient="vertical">
<caption label="&keySnail.preference.keyhandler;" />
<vbox flex="1">
<checkbox label="&keySnail.preference.keyhandler.globalEnabled;"
preference="extensions.keysnail.keyhandler.global_enabled" />
<checkbox label="&keySnail.preference.keyhandler.lowPriority;"
preference="extensions.keysnail.keyhandler.low_priority" />
</vbox>
</groupbox>
<groupbox orient="vertical">
<caption label="&keySnail.preference.keyhandler.prefixArgument;" />
<vbox flex="1">
<checkbox id="use-prefix-argument-checkbox"
label="&keySnail.preference.keyhandler.usePrefixArgument;"
preference="extensions.keysnail.keyhandler.use_prefix_argument"
oncommand="ksPreference.toggleEmacsLikePrefixArgument(event);"
/>
<hbox align="center">
<spacer width="30px" />
<label id="digit-argument-description"
disabled="true">&keySnail.preference.keyhandler.degitArgumentType;: </label>
<menulist id="digit-argument-list"
disabled="true">
<menupopup>
<menuitem label="&keySnail.preference.keyhandler.degitArgumentDisable;" value=""/>
<menuitem label="C-[0-9]" value="C"/>
<menuitem label="M-[0-9]" value="M"/>
<menuitem label="C-M-[0-9]" value="C-M"/>
<menuitem label="[0-9]" value="Digit"/>
</menupopup>
</menulist>
</hbox>
</vbox>
</groupbox>
<!-- Init File Settings -->
<groupbox orient="vertical">
<caption label="&keySnail.preference.userscript.settings;" />
<hbox id="init-file-relative"
align="center"
tooltiptext="&keySnail.preference.userscript.relativeDescription;">
<description id="init-file-relative-label" flex="1" />
<spacer flex="1" />
<button label="&keySnail.preference.userscript.openCurrentProcDir;"
oncommand="ksPreference.openCurrentProcDir();" />
</hbox>
<grid flex="1">
<columns>
<column />
<column flex="1"/>
<column />
</columns>
<rows>
<row align="center" flex="1">
<label value="&keySnail.preference.userscript.location;"
control="userScriptLocation"/>
<filefield id="keysnail.preference.userscript.location" flex="1"/>
<button label="&keySnail.preference.reference;"
oncommand="ksPreference.changePathClicked('INITFILE');" />
</row>
<row>
<spacer height="5px" />
</row>
<row align="center" flex="1">
<label value="&keySnail.preference.userscript.editor;"
control="userScriptLocation"/>
<filefield id="keysnail.preference.userscript.editor" flex="1"/>
<button label="&keySnail.preference.reference;"
oncommand="ksPreference.changePathClicked('EDITOR');" />
</row>
</rows>
</grid>
</groupbox>
<!-- Plugin Settings -->
<groupbox orient="vertical">
<caption label="&keySnail.preference.plugin;" />
<hbox align="center" flex="1">
<label value="&keySnail.preference.plugin.location;" flex="1"/>
<filefield id="keysnail.preference.plugin.location" flex="8"/>
<button label="&keySnail.preference.reference;"
oncommand="ksPreference.changePathClicked('PLUGIN');" />
</hbox>
<spacer height="5px" />
<checkbox label="&keySnail.preference.plugin.globalEnabled;"
preference="extensions.keysnail.plugin.global_enabled" />
<!-- update checker -->
<checkbox label="&keySnail.preference.plugin.checkUpdateAutomatically;"
preference="extensions.keysnail.plugin.run_update_checker_automatically"
oncommand="ksPreference.toggleCheckUpdateAutomatically(event);"
/>
<vbox>
<hbox align="center" id="plugin-updater-interval">
<spacer width="30px" />
<label>&keySnail.preference.plugin.checkUpdateInterval;: </label>
<textbox type="number" min="1" max="10000" value="24"
preference="extensions.keysnail.plugin.update_checker_interval" />
</hbox>
</vbox>
</groupbox>
<!-- Vimperator -->
<groupbox orient="vertical">
<caption label="&keySnail.preference.vimp;" />
<checkbox label="&keySnail.preference.vimp.enabled;"
preference="extensions.keysnail.vimp.enabled" />
</groupbox>
</prefpane>
<!-- Init file -->
<prefpane id="prefpane-keys" label="&keySnail.preference.keys;"
flex="1"
onpaneload="ksPreference.onKeyPaneLoad();">
<preferences>
<preference
id="extensions.keysnail.preference.indent_all_function"
name="extensions.keysnail.preference.indent_all_function"
type="bool"/>
</preferences>
<notificationbox id="keysnail-preference-notification" flex="1">
<!-- key bindings list -->
<tabbox flex="1" id="init-file-tabbox">
<tabs>
<tab label="&keySnail.preference.keys.keybindings;"/>
<tab label="&keySnail.preference.keys.specialkey;"/>
<tab label="&keySnail.preference.keys.blacklist;"/>
<tab label="&keySnail.preference.keys.preserved;"/>
</tabs>
<tabpanels flex="1">
<tabpanel id="keybindings" flex="1">
<vbox flex="1">
<vbox id="keybind-tree-box" flex="1">
<vbox id="tree-description-box">
<description class="long-description">&keySnail.preference.keys.treeDescription1;</description>
<description class="long-description">&keySnail.preference.keys.treeDescription2;</description>
<description class="long-description">&keySnail.preference.keys.treeDescription3;</description>
</vbox>
<!-- ====================================================================== -->
<tree id="keybind-tree" flex="1" seltype="single"
onselect="ksPreference.handleTreeEvent(event);"
onclick="ksPreference.handleTreeEvent(event);"
ondblclick="ksPreference.handleTreeEvent(event);"
onkeypress="ksPreference.handleTreeEvent(event);">
<treecols>
<treecol id="binds-mode"
label="&keySnail.preference.keys.treeheader.mode;"
flex="1"/>
<treecol id="binds-key"
label="&keySnail.preference.keys.treeheader.key;"
flex="3"/>
<splitter class="tree-splitter" />
<treecol id="binds-description"
label="&keySnail.preference.keys.treeheader.description;"
flex="5"/>
<splitter class="tree-splitter" />
<treecol id="binds-function"
label="&keySnail.preference.keys.treeheader.function;"
hidden="true"
flex="2"/>
<splitter class="tree-splitter" />
<treecol id="binds-argument"
hidden="true"
label="&keySnail.preference.keys.treeheader.argument;"
flex="1"/>
</treecols>
<treechildren />
</tree>
</vbox>
<!-- ====================================================================== -->
<!-- command editor -->
<vbox flex="1"
id="keybind-edit-box"
collapsed="true">
<description>&keySnail.preference.edit.function;:</description>
<textbox id="keybind-function-body"
class="keysnail-code-editor"
onblur="ksPreference.handleFunctionTextarea(event);"
onkeypress="ksPreference.handleFunctionTextarea(event);"
multiline="true" flex="3">
</textbox>
</vbox>
<!-- ====================================================================== -->
<!-- ====================================================================== -->
<!-- command settings box -->
<spacer height="7px" />
<vbox id="command-setting-box">
<hbox align="center">
<!-- mode -->
<label>&keySnail.preference.keys.treeheader.mode;: </label>
<menulist id="keybind-function-mode"
disabled="true"
oncommand="ksPreference.handleModeMenuList(event);">
<menupopup>
<menuitem label="Global"/>
<menuitem label="View"/>
<menuitem label="Edit"/>
<menuitem label="Caret"/>
</menupopup>
</menulist>
<!-- command name -->
<label>&keySnail.preference.keys.treeheader.description;: </label>
<textbox flex="1"
readonly="true"
onkeyup="ksPreference.handleDescriptionTextarea(event);"
onblur="ksPreference.handleDescriptionTextarea(event);"
onkeypress="ksPreference.handleDescriptionTextarea(event);"
id="keybind-function-description">
</textbox>
</hbox>
<hbox align="center">
<!-- key input area -->
<label>&keySnail.preference.keys.treeheader.key;: </label>
<textbox id="keybind-textarea"
onfocus="ksPreference.handleKeyBindTextareaEvent(event);"
onblur="ksPreference.handleKeyBindTextareaEvent(event);"
onmousedown="ksPreference.handleKeyBindTextareaEvent(event);"
readonly="true"
flex="1" />
<popupset>
<menupopup id="insert-key-menu" />
</popupset>
<dropmarker id="keybind-button-insert"
disabled="true"
popup="insert-key-menu" />
<!-- prefix argument handling -->
<checkbox id="keybind-function-norepeat"
label="&keySnail.preference.edit.noRepeat;"
onclick="ksPreference.noRepeatToggled();"
disabled="true"
checked="false"/>
</hbox>
</vbox>
<!-- ====================================================================== -->
<!-- ====================================================================== -->
<spacer height="13px" />
<!-- command buttons for treeview-->
<hbox id="bottom-for-tree-box" align="center">
<!-- delete button -->
<button label="&keySnail.preference.keys.delete;"
id="keybind-button-delete"
oncommand="if (ksKeybindTreeView.deleteSelectedItem() >= 0)
ksPreference.updateKeyBindTextarea();ksPreference.needsApply = true;"
disabled="true" accesskey="d"
/>
<spacer flex="1" />
<!-- edit button -->
<button label="&keySnail.preference.keys.edit;"
id="keybind-button-edit"
disabled="true"
oncommand="ksPreference.toggleEditView.call(ksPreference);"
accesskey="e"
/>
<!-- add button -->
<popupset>
<menupopup id="add-command-menu">
<menuitem label="&keySnail.preference.command.builtin;"
oncommand="ksPreference.addBuiltinCommand();"/>
<menuitem label="&keySnail.preference.command.original;"
oncommand="ksKeybindTreeView.appendItem();"/>
<menuitem label="&keySnail.preference.command.ext;"
oncommand="ksPreference.addExt();"/>
</menupopup>
</popupset>
<button label="&keySnail.preference.keys.add;"
popup="add-command-menu" accesskey="a"
/>
</hbox>
<!-- ====================================================================== -->
<!-- command buttons for edit box -->
<hbox id="bottom-for-edit-box" align="center" collapsed="true">
<button label="&keySnail.preference.edit.beautifyCode;"
oncommand="ksPreference.beautify.call(ksPreference);"
accesskey="b" />
<button label="&keySnail.preference.edit.insertTemplate;"
oncommand="ksPreference.insertTemplate();"
accesskey="i" />
<spacer flex="1" />
<button label="&keySnail.preference.edit.backToTree;"
oncommand="ksPreference.toggleEditView.call(ksPreference);"
accesskey="v" />
</hbox>
</vbox>
</tabpanel>
<tabpanel id="special-keys">
<vbox flex="1">
<description class="long-description">&keySnail.preference.keys.specialKeyDescription1;</description>
<description class="long-description">&keySnail.preference.keys.specialKeyDescription2;</description>
<hbox align="center" tooltiptext="&keySnail.preference.key.quit.description;">
<description class="keysnail-specialkey-description" flex="1">&keySnail.preference.key.quit;:</description>
<textbox id="keysnail-userscript-key-quit"
onclick="keyCustomizer.set('quit');"
readonly="true"
class="keysnail-specialkey-textbox"/>
<button label="&keySnail.preference.change;"
oncommand="keyCustomizer.set('quit');"
class="keysnail-specialkey-button"/>
</hbox>
<!-- help key -->
<hbox align="center" tooltiptext="&keySnail.preference.key.help.description;">
<description class="keysnail-specialkey-description" flex="1">&keySnail.preference.key.help;:</description>
<textbox id="keysnail-userscript-key-help"
onclick="keyCustomizer.set('help');"
readonly="true"
class="keysnail-specialkey-textbox"/>
<button label="&keySnail.preference.change;"
oncommand="keyCustomizer.set('help');"
class="keysnail-specialkey-button"/>
</hbox>
<!-- escape key -->
<hbox align="center" tooltiptext="&keySnail.preference.key.escape.description;">
<description class="keysnail-specialkey-description" flex="1">&keySnail.preference.key.escape;:</description>
<textbox id="keysnail-userscript-key-escape"
onclick="keyCustomizer.set('escape');"
readonly="true"
class="keysnail-specialkey-textbox"/>
<button label="&keySnail.preference.change;"
oncommand="keyCustomizer.set('escape');"
class="keysnail-specialkey-button"/>
</hbox>
<!-- macroStart key -->
<hbox align="center" tooltiptext="&keySnail.preference.key.macroStart.description;">
<description class="keysnail-specialkey-description" flex="1">&keySnail.preference.key.macroStart;:</description>
<textbox id="keysnail-userscript-key-macroStart"
onclick="keyCustomizer.set('macroStart');"
readonly="true"
class="keysnail-specialkey-textbox"/>
<button label="&keySnail.preference.change;"
oncommand="keyCustomizer.set('macroStart');"
class="keysnail-specialkey-button"/>
</hbox>
<!-- macroEnd key -->
<hbox align="center" tooltiptext="&keySnail.preference.key.macroEnd.description;">
<description class="keysnail-specialkey-description" flex="1">&keySnail.preference.key.macroEnd;:</description>
<textbox id="keysnail-userscript-key-macroEnd"
onclick="keyCustomizer.set('macroEnd');"
readonly="true"
class="keysnail-specialkey-textbox"/>
<button label="&keySnail.preference.change;"
oncommand="keyCustomizer.set('macroEnd');"
class="keysnail-specialkey-button"/>
</hbox>
<!-- suspend key -->
<hbox align="center" tooltiptext="&keySnail.preference.key.suspend.description;">
<description class="keysnail-specialkey-description" flex="1">&keySnail.preference.key.suspend;:</description>
<textbox id="keysnail-userscript-key-suspend"
onclick="keyCustomizer.set('suspend');"
readonly="true"
class="keysnail-specialkey-textbox"/>
<button label="&keySnail.preference.change;"
oncommand="keyCustomizer.set('suspend');"
class="keysnail-specialkey-button"/>
</hbox>
<!-- universalArgument key -->
<hbox align="center" tooltiptext="&keySnail.preference.key.universalArgument.description;">
<description class="keysnail-specialkey-description" flex="1">&keySnail.preference.key.universalArgument;:</description>
<textbox id="keysnail-userscript-key-universalArgument"
onclick="keyCustomizer.set('universalArgument');"
readonly="true"
class="keysnail-specialkey-textbox"/>
<button label="&keySnail.preference.change;"
oncommand="keyCustomizer.set('universalArgument');"
class="keysnail-specialkey-button"/>
</hbox>
<!-- negativeArgument1 key -->
<hbox align="center" tooltiptext="&keySnail.preference.key.negativeArgument.description;">
<description class="keysnail-specialkey-description" flex="1">&keySnail.preference.key.negativeArgument1;:</description>
<textbox id="keysnail-userscript-key-negativeArgument1"
onclick="keyCustomizer.set('negativeArgument1');"
readonly="true"
class="keysnail-specialkey-textbox"/>
<button label="&keySnail.preference.change;"
oncommand="keyCustomizer.set('negativeArgument1');"
class="keysnail-specialkey-button"/>
</hbox>
<!-- negativeArgument2 key -->
<hbox align="center" tooltiptext="&keySnail.preference.key.negativeArgument.description;">
<description class="keysnail-specialkey-description" flex="1">&keySnail.preference.key.negativeArgument2;:</description>
<textbox id="keysnail-userscript-key-negativeArgument2"
onclick="keyCustomizer.set('negativeArgument2');"
readonly="true"
class="keysnail-specialkey-textbox"/>
<button label="&keySnail.preference.change;"
oncommand="keyCustomizer.set('negativeArgument2');"
class="keysnail-specialkey-button"/>
</hbox>
<!-- negativeArgument3 key -->
<hbox align="center" tooltiptext="&keySnail.preference.key.negativeArgument.description;">
<description class="keysnail-specialkey-description" flex="1">&keySnail.preference.key.negativeArgument3;:</description>
<textbox id="keysnail-userscript-key-negativeArgument3"
onclick="keyCustomizer.set('negativeArgument3');"
readonly="true"
class="keysnail-specialkey-textbox"/>
<button label="&keySnail.preference.change;"
oncommand="keyCustomizer.set('negativeArgument3');"
class="keysnail-specialkey-button"/>
</hbox>
</vbox>
</tabpanel>
<tabpanel id="blacklist-settings" flex="1">
<vbox flex="1">
<description class="long-description">&keySnail.preference.key.blacklist.description;</description>
<listbox id="blacklist-listbox" flex="1"
onselect="ksPreference.handleBlackListBoxEvent(event);"
onkeypress="ksPreference.handleBlackListBoxEvent(event);"
>
</listbox>
<hbox>
<textbox rows="1" flex="1"
id="blacklist-url"
type="autocomplete"
enablehistory="true"
autocompletesearch="history"
onkeypress="ksPreference.handleBlackListInputEvent(event);"
>
</textbox>
<button id="blacklist-button-add"
label="&keySnail.preference.keys.add;"
oncommand="ksPreference.addBlackList();"/>
<button id="blacklist-button-delete"
label="&keySnail.preference.keys.delete;"
disabled="true"
oncommand="ksPreference.deleteBlackList();"/>
</hbox>
</vbox>
</tabpanel>
<tabpanel id="preserved-area" flex="1">
<vbox flex="1">
<description class="long-description">&keySnail.preference.key.preserved.description1;</description>
<description class="long-description">&keySnail.preference.key.preserved.description2;</description>
<textbox flex="1"
multiline="true"
class="keysnail-code-editor"
id="preserved-code"
onblur="ksPreference.handlePreservedCodeEditorEvent(event);"
>
</textbox>
</vbox>
</tabpanel>
</tabpanels>
</tabbox>
<!-- command buttons -->
<vbox>
<label id="notification-area" style="color:#b80011;font-weight:bold;" collapsed="true" flex="1">
</label>
<spacer height="5px" />
<hbox id="create-button-area" align="center" flex="1">
<checkbox label="&keySnail.preference.key.indent_all_function;"
preference="extensions.keysnail.preference.indent_all_function"/>
<spacer flex="2"/>
<button label="&keySnail.preference.key.create;"
id="create-button"
accesskey="c"
oncommand="event.preventDefault();ksPreference.onInitFileCreate();"/>
</hbox>
</vbox>
</notificationbox>
</prefpane>
<!-- about panel -->
<prefpane id="prefpane-about" label="&keySnail.preference.about;" flex="1">
<preferences></preferences>
<spacer flex="1"/>
<vbox align="center" flex="1">
<image src="chrome://keysnail/skin/logo.png" width="128" height="128"
tooltiptext="KeySnail" />
<spacer height="10px" />
<description>mooz &lt;stillpedant@gmail.com&gt; &#169; 2009-2010</description>
<description class="text-link"
onclick="ksPreference.modules.key.viewURI('http://wiki.github.com/mooz/keysnail/')"
>KeySnail wiki</description>
<description class="text-link"
onclick="ksPreference.modules.key.viewURI('http://d.hatena.ne.jp/mooz/')"
>Authors blog (Japanese)</description>
<spacer height="10px"/>
<description>Thanks to</description>
<description class="text-link"
onclick="ksPreference.modules.key.viewURI('http://jsbeautifier.org/')"
>Javascript beautifier</description>
<description class="text-link"
onclick="ksPreference.modules.key.viewURI('http://tango.freedesktop.org/Tango_Desktop_Project')"
>Tango icon</description>
<description class="text-link"
onclick="ksPreference.modules.key.viewURI('http://www.famfamfam.com/lab/icons/silk/')"
>Silk icon set</description>
<description class="text-link"
onclick="ksPreference.modules.key.viewURI('http://coderepos.org/share/browser/lang/javascript/vimperator-plugins/trunk/pluginManager.js')"
>Wiki parser (from pluginManager.js)</description>
</vbox>
<spacer flex="1"/>
</prefpane>
<script type="application/x-javascript" src="chrome://keysnail/content/preference.js"/>
<script type="application/x-javascript" src="chrome://keysnail/content/keycustomizer.js"/>
</prefwindow>
Jump to Line
Something went wrong with that request. Please try again.