зеркало из https://github.com/mozilla/pjs.git
Backing out changes for 45661- this was causing regression bug 45749.
This commit is contained in:
Родитель
34b198ddff
Коммит
d94493e4c4
|
@ -10,8 +10,6 @@ var filePickerMode;
|
|||
var currentFilter;
|
||||
var lastClicked;
|
||||
|
||||
var bundle = srGetStrBundle("chrome://global/locale/filepicker.properties");
|
||||
|
||||
function onLoad() {
|
||||
|
||||
if (window.arguments) {
|
||||
|
@ -28,8 +26,8 @@ function onLoad() {
|
|||
|
||||
window.title = title;
|
||||
|
||||
textInput = document.getElementById("textInput");
|
||||
if (initialText) {
|
||||
textInput = document.getElementById("textInput");
|
||||
textInput.value = initialText;
|
||||
}
|
||||
/* build filter popup */
|
||||
|
@ -59,8 +57,6 @@ function onLoad() {
|
|||
addToHistory(sfile.path);
|
||||
|
||||
getDirectoryContents(document.getElementById("directoryList"), sfile.directoryEntries);
|
||||
|
||||
textInput.focus();
|
||||
}
|
||||
|
||||
function onFilterChanged(target)
|
||||
|
@ -126,7 +122,7 @@ function onOK()
|
|||
case nsIFilePicker.modeSave:
|
||||
if (isFile) {
|
||||
// we need to pop up a dialog asking if you want to save
|
||||
rv = window.confirm(file.path + bundle.GetStringFromName("confirmFileReplacing"));
|
||||
rv = window.confirm(file.path + "already exists. Do you want to replace it?");
|
||||
if (rv)
|
||||
ret = nsIFilePicker.returnReplace;
|
||||
else
|
||||
|
@ -162,12 +158,10 @@ function onCancel()
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
// node corresponds to a treerow
|
||||
function goIn(node) {
|
||||
function onClick(e) {
|
||||
|
||||
var file = Components.classes[nsILocalFile_PROGID].createInstance(nsILocalFile);
|
||||
file.initWithPath(node.getAttribute("path"));
|
||||
file.initWithPath(e.target.parentNode.getAttribute("path"));
|
||||
|
||||
if (!file.isDirectory()) {
|
||||
textInput = document.getElementById("textInput");
|
||||
|
@ -175,26 +169,17 @@ function goIn(node) {
|
|||
lastClicked = file.leafName;
|
||||
}
|
||||
|
||||
if (file.isDirectory()) {
|
||||
gotoDirectory(file.path);
|
||||
} else if (file.isFile()) {
|
||||
/* what about symlinks? what if they symlink to a directory? */
|
||||
return doOKButton();
|
||||
if (e.detail == 2) {
|
||||
if (file.isDirectory()) {
|
||||
gotoDirectory(file.path);
|
||||
}
|
||||
else if (file.isFile()) {
|
||||
/* what about symlinks? what if they symlink to a directory? */
|
||||
return doOKButton();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onClick(e) {
|
||||
if (e.detail == 2)
|
||||
goIn(e.target.parentNode);
|
||||
}
|
||||
|
||||
function onKeyup(e) {
|
||||
if (e.keyCode == 13)
|
||||
goIn(e.target.selectedItems[0].firstChild);
|
||||
else if (e.keyCode == 8)
|
||||
goUp();
|
||||
}
|
||||
|
||||
function dirSort(e1, e2)
|
||||
{
|
||||
if (e1.leafName == e2.leafName)
|
||||
|
@ -309,10 +294,6 @@ function createTree(parentElement, dirArray)
|
|||
|
||||
/* append treeChildren to parent (tree) */
|
||||
parentElement.appendChild(treeChildren);
|
||||
|
||||
/* select first available treeitem */
|
||||
if (treeChildren.firstChild)
|
||||
parentElement.selectItem(treeChildren.firstChild);
|
||||
}
|
||||
|
||||
function getDirectoryContents(parentElement, dirContents)
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
|
||||
|
||||
<window id="main-window"
|
||||
<window id="main-window" xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
align="vertical"
|
||||
|
@ -12,8 +12,7 @@
|
|||
width="426" height="300"
|
||||
class="dialog">
|
||||
|
||||
<script src="chrome://global/content/strres.js"/>
|
||||
<script src="chrome://global/content/filepicker.js"/>
|
||||
<html:script src="chrome://global/content/filepicker.js"/>
|
||||
|
||||
<box align="horizontal">
|
||||
<text value="Look in:"/>
|
||||
|
@ -25,7 +24,7 @@
|
|||
</box>
|
||||
|
||||
<box align="horizontal" flex="1">
|
||||
<tree id="directoryList" flex="1" onkeyup="onKeyup(event)">
|
||||
<tree id="directoryList" flex="1">
|
||||
<treecolgroup>
|
||||
<treecol flex="1"/>
|
||||
<treecol flex="1"/>
|
||||
|
@ -43,7 +42,7 @@
|
|||
|
||||
<box align="horizontal">
|
||||
<text value="File name:"/>
|
||||
<textfield type="text" id="textInput" onkeypress="if (event.which == 13) { onOK(); }" flex="1"/>
|
||||
<html:input type="text" id="textInput" onkeypress="if (event.which == 13) { onOK(); }" flex="1"/>
|
||||
</box>
|
||||
|
||||
<box align="horizontal">
|
||||
|
|
|
@ -12,4 +12,3 @@ xmlTitle=XML Files
|
|||
xmlFilter=*.xml
|
||||
xulTitle=XUL Files
|
||||
xulFilter=*.xul
|
||||
confirmFileReplacing=already exists. Do you want to replace it?
|
||||
|
|
Загрузка…
Ссылка в новой задаче