applait / finderjs

Finder and file picker library for Firefox OS
http://finder.js.org
MIT License
14 stars 7 forks source link

Picker images search all files with .jpg (images) #18

Open pdomkar opened 8 years ago

pdomkar commented 8 years ago

I want use FinderJs for pick/choose image in app in FirefoxOS. But i dont understand how i can find all files of images type(jpg) If I understand(I find here:http://stackoverflow.com/questions/23527190/file-picker-on-firefox-os and on this github) its depend on argument searchterm: finder.search(searchterm);. I try "." but result in debug was empty or searchComplete Array [ ".", 0 ] If I try search exist image (in firefox profile fake-card) How i show/write all images in device? Tahnks

kaustavdm commented 8 years ago

You need to specify some more information in the search term. FinderJS does not support wildcards. For example:

var searchterm = ".jpg"
finder.search(searchterm);
pdomkar commented 8 years ago

Yea i tried it, but it dont work. I have this code: var finder = new Applait.Finder({ type: "sdcard", caseSensitive: false }); finder.search(".jpg"); finder.on("searchBegin", function (needle) { console.log("SearchBegin"); }); finder.on("fileFound", function (file, fileinfo, storageName) { console.log("Found file " + fileinfo.name + " at " + fileinfo.path + " in " + storageName, file); }); And I have images on sdcard with *.jpg but it don't write any text to console.

kaustavdm commented 8 years ago

@pdomkar Quick check:

No clue if that does not work.

Also, with the move to remove non-standard APIs in B2G, we may not support FinderJS in near future.

pdomkar commented 8 years ago

I use Firefox OS 2.2 (in simulator in Firefox IDE) Yes, I have set up access to sdcard and pictures.

Sorry, my Englis is not great. I understood it well, that is possiple that you dont support FinderJS in Firefox OS?