fix file.create: don't create an .empty folder on devices with new API support
feat docs: add Frequently Asked Questions section
This commit is contained in:
parent
8408fd5319
commit
66504df4cb
16
README.md
16
README.md
@ -9,11 +9,25 @@ Firefox OS 2.2 and up are supported. Sadly 2.0 and 1.3 miss a lot of ES6 functio
|
|||||||
|
|
||||||
![Mobile Portrait Mockup](https://github.com/mdibaiee/Hawk/raw/master/Mobile%20Portrait.png)
|
![Mobile Portrait Mockup](https://github.com/mdibaiee/Hawk/raw/master/Mobile%20Portrait.png)
|
||||||
|
|
||||||
#Thanks to
|
# Thanks to
|
||||||
|
|
||||||
Sergio Muriel [@tfeserver](https://twitter.com/tfeserver) for testing application
|
Sergio Muriel [@tfeserver](https://twitter.com/tfeserver) for testing application
|
||||||
Mohammad Jahani [@mamal72](https://twitter.com/mamal72) for ideas, and helping in designing the [webpage](http://dibaiee.ir/Hawk)
|
Mohammad Jahani [@mamal72](https://twitter.com/mamal72) for ideas, and helping in designing the [webpage](http://dibaiee.ir/Hawk)
|
||||||
|
|
||||||
|
# Frequently Asked Questions
|
||||||
|
|
||||||
|
**Q: Why does Hawk create an `.empty` file inside new folders I create?**
|
||||||
|
|
||||||
|
This happens on Firefox OS devices below version 3, and that's because the API doesn't allow
|
||||||
|
listing empty folders, in order to show you the folder, Hawk has to fake the folder to have a child.
|
||||||
|
|
||||||
|
|
||||||
|
**Q: Why is Hawk slow?**
|
||||||
|
|
||||||
|
Hawk is much faster on Firefox OS 3.0 and up, and that's because the way old Device Storage API works,
|
||||||
|
it's slow by nature. Nothing we can do about it, sadly.
|
||||||
|
|
||||||
|
|
||||||
# Features
|
# Features
|
||||||
|
|
||||||
Version 1.0
|
Version 1.0
|
||||||
|
@ -30057,7 +30057,9 @@ var createDirectory = _asyncToGenerator(function* () {
|
|||||||
var parent = yield root();
|
var parent = yield root();
|
||||||
|
|
||||||
return parent.createDirectory.apply(parent, args).then(function () {
|
return parent.createDirectory.apply(parent, args).then(function () {
|
||||||
return createFile(args[0] + '/.empty');
|
if (window.needsShim) {
|
||||||
|
return createFile(args[0] + '/.empty');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -21,8 +21,11 @@ function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPr
|
|||||||
};
|
};
|
||||||
}(Element.prototype));
|
}(Element.prototype));
|
||||||
|
|
||||||
|
window.needsShim = false;
|
||||||
|
|
||||||
function shimDirectory(directory) {
|
function shimDirectory(directory) {
|
||||||
if (!directory.getFilesAndDirectories) {
|
if (!directory.getFilesAndDirectories) {
|
||||||
|
window.needsShim = true;
|
||||||
directory.toString = function() { return '[object Directory]' };
|
directory.toString = function() { return '[object Directory]' };
|
||||||
directory.getFilesAndDirectories = function getFilesAndDirectories() {
|
directory.getFilesAndDirectories = function getFilesAndDirectories() {
|
||||||
var current = (this.path || '') + this.name;
|
var current = (this.path || '') + this.name;
|
||||||
|
Binary file not shown.
@ -84,7 +84,9 @@ export async function createDirectory(...args) {
|
|||||||
let parent = await root();
|
let parent = await root();
|
||||||
|
|
||||||
return parent.createDirectory(...args).then(() => {
|
return parent.createDirectory(...args).then(() => {
|
||||||
return createFile(args[0] + '/.empty');
|
if (window.needsShim) {
|
||||||
|
return createFile(args[0] + '/.empty');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,8 +21,11 @@ function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPr
|
|||||||
};
|
};
|
||||||
}(Element.prototype));
|
}(Element.prototype));
|
||||||
|
|
||||||
|
window.needsShim = false;
|
||||||
|
|
||||||
function shimDirectory(directory) {
|
function shimDirectory(directory) {
|
||||||
if (!directory.getFilesAndDirectories) {
|
if (!directory.getFilesAndDirectories) {
|
||||||
|
window.needsShim = true;
|
||||||
directory.toString = function() { return '[object Directory]' };
|
directory.toString = function() { return '[object Directory]' };
|
||||||
directory.getFilesAndDirectories = function getFilesAndDirectories() {
|
directory.getFilesAndDirectories = function getFilesAndDirectories() {
|
||||||
var current = (this.path || '') + this.name;
|
var current = (this.path || '') + this.name;
|
||||||
|
Loading…
Reference in New Issue
Block a user