зеркало из https://github.com/mozilla/pjs.git
Bug 301742. Customize char encoding dialog. r+a=mconnor
This commit is contained in:
Родитель
602531fd4f
Коммит
1a36976c90
|
@ -131,32 +131,6 @@ function LoadActiveCharSets()
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
function SelectAvailableCharset()
|
||||
{
|
||||
//Remove the selection in the active charsets list
|
||||
var active_charsets = document.getElementById('active_charsets');
|
||||
|
||||
if (active_charsets.selectedItems.length > 0)
|
||||
active_charsets.clearSelection();
|
||||
|
||||
update_buttons();
|
||||
} //SelectAvailableCharset
|
||||
|
||||
|
||||
|
||||
function SelectActiveCharset()
|
||||
{
|
||||
//Remove the selection in the available charsets list
|
||||
var available_charsets = document.getElementById('available_charsets');
|
||||
|
||||
if (available_charsets.selectedItems.length > 0)
|
||||
available_charsets.clearSelection();
|
||||
|
||||
update_buttons();
|
||||
} //SelectActiveCharset
|
||||
|
||||
|
||||
function enable_save()
|
||||
{
|
||||
var save_button = document.documentElement.getButton("accept");
|
||||
|
@ -231,25 +205,13 @@ function RemoveActiveCharset()
|
|||
var numSelected = listbox.selectedItems.length;
|
||||
var deleted_all = false;
|
||||
|
||||
while (listbox.selectedItems.length > 0) {
|
||||
var selectedNode = listbox.selectedItems[0];
|
||||
dump(selectedNode + " - " + listbox.selectedItems.length + "\n");
|
||||
nextNode = selectedNode.nextSibling;
|
||||
|
||||
if (!nextNode) {
|
||||
if (selectedNode.previousSibling)
|
||||
nextNode = selectedNode.previousSibling;
|
||||
}
|
||||
|
||||
listbox.removeChild(selectedNode);
|
||||
} //while
|
||||
|
||||
if (nextNode) {
|
||||
listbox.selectItem(nextNode)
|
||||
} else {
|
||||
//listbox.clearSelection();
|
||||
var numSelectedItems = listbox.selectedItems.length;
|
||||
for (count = 0; count < numSelectedItems; count ++) {
|
||||
listbox.removeChild(listbox.selectedItems[0]);
|
||||
}
|
||||
|
||||
listbox.clearSelection();
|
||||
|
||||
enable_save();
|
||||
} //RemoveActiveCharset
|
||||
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#***** END LICENSE BLOCK ***** -->
|
||||
|
||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/arrow.css" type="text/css"?>
|
||||
|
||||
<!DOCTYPE dialog SYSTEM "chrome://global/locale/customizeCharset.dtd">
|
||||
|
||||
|
@ -48,8 +47,7 @@
|
|||
onload="Init();"
|
||||
ondialogaccept="return Save();"
|
||||
persist="width height"
|
||||
headertitle="&left.header;"
|
||||
width="500" height="394">
|
||||
headertitle="&left.header;">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://global/content/customizeCharset.js"/>
|
||||
<script type="application/x-javascript">
|
||||
|
@ -62,42 +60,39 @@
|
|||
<!-- The two-pane -->
|
||||
<hbox flex="1">
|
||||
<vbox flex="1">
|
||||
<label value="&additional.label;"/>
|
||||
<label value="&additional.label;" control="available_charsets"/>
|
||||
<!-- Available Charsets Tree -->
|
||||
<listbox id="available_charsets" flex="1" seltype="multiple"
|
||||
onselect="SelectAvailableCharset();"
|
||||
onfocus = "document.getElementById('active_charsets').clearSelection();"
|
||||
onselect="update_buttons();"
|
||||
ondblclick="AddAvailableCharset();"/>
|
||||
|
||||
<separator class="thin"/>
|
||||
|
||||
<hbox align="center">
|
||||
<button id="add_button" oncommand="AddAvailableCharset();"
|
||||
label="&add.label;" icon="add" disabled="true"/>
|
||||
label="&add.label;" icon="add" accesskey="&add.accessKey;"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
|
||||
<separator orient="vertical"/>
|
||||
|
||||
<vbox flex="1">
|
||||
<label value="¤t.label;"/>
|
||||
<label value="¤t.label;" control="active_charsets"/>
|
||||
<listbox id="active_charsets" flex="1" seltype="multiple"
|
||||
onselect="SelectActiveCharset();"
|
||||
onfocus = "document.getElementById('available_charsets').clearSelection();"
|
||||
onselect="update_buttons();"
|
||||
ondblclick="RemoveActiveCharset();"/>
|
||||
|
||||
<separator class="thin"/>
|
||||
<hbox align="center">
|
||||
<button id="remove_button" oncommand="RemoveActiveCharset();"
|
||||
disabled="true" icon="remove"
|
||||
label="&remove.label;"/>
|
||||
<button id="up_button" label="&moveUp.label;" icon="go-up"
|
||||
accesskey="&moveUp.accessKey;" oncommand="MoveUp();"/>
|
||||
<button id="down_button" label="&moveDown.label;" icon="go-down"
|
||||
accesskey="&moveDown.accessKey;" oncommand="MoveDown();"/>
|
||||
<button id="remove_button" oncommand="RemoveActiveCharset();" icon="remove"
|
||||
label="&remove.label;" accesskey="&remove.accessKey;"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
<vbox>
|
||||
<spacer flex="1"/>
|
||||
<button id="up_button" class="up" disabled="true"
|
||||
oncommand="MoveUp();"/>
|
||||
<button id="down_button" class="down" disabled="true"
|
||||
oncommand="MoveDown();"/>
|
||||
<spacer flex="1"/>
|
||||
</vbox>
|
||||
</hbox>
|
||||
</dialog>
|
|
@ -43,5 +43,11 @@
|
|||
<!ENTITY left.header "Character Encoding">
|
||||
<!ENTITY current.label "Active Character Encodings:">
|
||||
<!ENTITY remove.label "Remove">
|
||||
<!ENTITY remove.accessKey "R">
|
||||
<!ENTITY additional.label "Available Character Encodings:">
|
||||
<!ENTITY add.label "Add">
|
||||
<!ENTITY add.accessKey "A">
|
||||
<!ENTITY moveUp.label "Move Up">
|
||||
<!ENTITY moveUp.accessKey "U">
|
||||
<!ENTITY moveDown.label "Move Down">
|
||||
<!ENTITY moveDown.accessKey "D">
|
||||
|
|
Загрузка…
Ссылка в новой задаче