зеркало из https://github.com/mozilla/pjs.git
few more changes
This commit is contained in:
Родитель
328092db3b
Коммит
3147da3bb5
|
@ -100,7 +100,7 @@ function onOK()
|
||||||
if (isFile) {
|
if (isFile) {
|
||||||
retvals.directory = file.parent.path;
|
retvals.directory = file.parent.path;
|
||||||
ret = nsIFilePicker.returnOK;
|
ret = nsIFilePicker.returnOK;
|
||||||
} else if (isDirectory) {
|
} else if (isDir) {
|
||||||
if (!sfile.equals(file)) {
|
if (!sfile.equals(file)) {
|
||||||
gotoDirectory(file.path);
|
gotoDirectory(file.path);
|
||||||
}
|
}
|
||||||
|
@ -338,35 +338,3 @@ function gotoDirectory(directoryName) {
|
||||||
sfile.normalize();
|
sfile.normalize();
|
||||||
loadDirectory();
|
loadDirectory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function textEntered(name) {
|
|
||||||
var file = Components.classes[nsILocalFile_PROGID].createInstance(nsILocalFile);
|
|
||||||
file.initWithPath(name);
|
|
||||||
dump("*** " + file + "\n*** " + file.path + "\n");
|
|
||||||
if (file.exists()) {
|
|
||||||
if (file.isDirectory()) {
|
|
||||||
if (!sfile.equals(file)) {
|
|
||||||
gotoDirectory(name);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
} else if (file.isFile()) {
|
|
||||||
retvals.file = file;
|
|
||||||
window.close();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
/* look for something in our current directory */
|
|
||||||
var nfile = sfile.clone();
|
|
||||||
nfile.append(file.path);
|
|
||||||
dump(nfile.path);
|
|
||||||
if (nfile.isFile()) {
|
|
||||||
retvals.file = nfile;
|
|
||||||
window.close();
|
|
||||||
} else if (nfile.isDirectory()) {
|
|
||||||
gotoDirectory(nfile.path);
|
|
||||||
} else {
|
|
||||||
dump("can't find file \"" + nfile.path + "\"");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
|
|
||||||
<box align="horizontal">
|
<box align="horizontal">
|
||||||
<text value="File name:"/>
|
<text value="File name:"/>
|
||||||
<html:input type="text" id="textInput" onkeyup="if (event.which == 13) { textEntered(event.target.value); }" flex="1"/>
|
<html:input type="text" id="textInput" onkeyup="if (event.which == 13) { onOK(); }" flex="1"/>
|
||||||
</box>
|
</box>
|
||||||
|
|
||||||
<box align="horizontal">
|
<box align="horizontal">
|
||||||
|
|
Загрузка…
Ссылка в новой задаче