HTML based file browser

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
ITAmember
Posts: 167
Joined: Sun 13 Sep 2009, 18:50
Location: The middle of a cornfield

HTML based file browser

#1 Post by ITAmember »

I've been thinking about making a file browser and the idea of basing it on HTML hit me. What if I used the gtk-embed-mozilla widget, generated HTML based on the files in a folder, and then displayed this page. It would allow huge amounts of flexibility, frames, and scripting with javascript.

There could also be files in a folder defining how that folder is displayed, with custom HTML and javascript. You could make a media player folder for example, since music library navigation resembles file navigation this would work well. Using this method good looking multi-page control panels could also be made.

What do you guys think?

bugman

#2 Post by bugman »

i like it

i've always liked the way the kde browser does files and web together

ITAmember
Posts: 167
Joined: Sun 13 Sep 2009, 18:50
Location: The middle of a cornfield

#3 Post by ITAmember »

I've been messing with it a bit and it looks promising, but I'm afraid the large amount of javascript is going to be slow.

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#4 Post by Flash »

Your idea sounds like a good one to me, especially if you can make the "back" arrow work as it does in SeaMonkey. Neither Windows Explorer nor ROX return to the exact same window as before when you click their back arrows. It's very annoying to me to have to resize the window, move it to where I had it, then scroll back to where I was in the window, every time I go back a level in ROX. Windows does return to the same size and (IIRC) location, but I still have to scroll the window back to where it was.

I know nothing about it, but still it seems to me that you might be reinventing the wheel, at least to some extent. Menu -> Internet -> PuppyBrowser web browser seems to be pretty fast. Maybe you could modify or extend it to do what you want. At least, by looking into it you might learn some tricks you hadn't thought of.

ITAmember
Posts: 167
Joined: Sun 13 Sep 2009, 18:50
Location: The middle of a cornfield

#5 Post by ITAmember »

I won't need to work on the GTK part until most of the DHTML is done, right now I'm just prototyping with a web browser.

I'll look into puppybrowser to. :)

Maybe I should use webkit instead of gecko for the HTML engine?

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#6 Post by mikeb »

you want to reinvent the virus spreading joke that microsoft came up with in the nineties...I assume you are not being serious

mike

ITAmember
Posts: 167
Joined: Sun 13 Sep 2009, 18:50
Location: The middle of a cornfield

#7 Post by ITAmember »

I'll bite, what are you talking about? This program won't be any less secure then a web browser.

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#8 Post by mikeb »

It makes me uncomfortable mixing html/web/file system after the disaster which was the integration of internet explorer into the operating system ...as long as you don't start with active x speak I will continue to sleep soundly :D .

Perhaps without the paranoia, reproducing the most annoying aspect of windows XP on linux does seem a little perverse.

I shall leave your thread in peace

mike

ps I was hoping someone could enable the thumbnail feature of gtk2 file browser for firefox/mozilla but no one bit that one :(

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#9 Post by disciple »

That's the file selector dialogue you're talking about, right mike?

There are Firefox extensions to turn it into a file browser, but last time I checked they were very slow (unlike Konqueror).
But what ITAmember's talking about involves adding html content and stuff to folders, turning them into web pages. AFAIK that hasn't been done on Linux before, although it has been a feature of Windows since at least Win98. The thing is, I've never seen anyone actually use the feature... it's rare enough to find someone even putting special things on the Windows desktop.
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#10 Post by mikeb »

That's the file selector dialogue you're talking about, right mike?
yes..more here...
http://www.murga-linux.com/puppy/viewtopic.php?t=50179
And I tried an addon too but as you say it was too slow.
although it has been a feature of Windows since at least Win98
when windows became a virus gateway.

Ok first I flame the subject now I'm hyjacking the thread...off topic in the off topic area...where's my spade?

mike

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#11 Post by technosaurus »

You could write a bash wrapper for a lot of it, but then you would have to pick a wrapper extension that the browser can associate as a mimetype (.BROWSE for example) - here are some probably uninteligible streams of consciousness (probably not functional - just the idea of where to start to make it work)

associate .BROWSE with your script (lets say /usr/bin/browserbrowser)

for a directory link such as file:///usr/share/doc you would need the .BROWSER extension so it could build a new webpage when it is clicked
{to get only the directory name basename $1 .BROWSER}

ls -1 $DIRNAME > tmpfile
echo $HEADER > $DIRNAME/.$ONELINE.htm
for $ONELINE in tmpfile
if [ -d $DIRNAME/$ONELINE ]; then
echo "<a href="$DIRNAME/$ONELINE">$ONELINE</a>" >> $DIRNAME/.$ONELINE.htm
else
SUFFIX={I forget how to do this}
case $SUFFIX in ...
jpg,png,gif,...)
echo <img border="0" src="DIRNAME/$ONELINE" /></a> >> $DIRNAME/.$ONELINE.htm
mp4,avi,...)
echo "<EMBED type='application/x-mplayer2' src="$DIRNAME/$ONELINE" autostart="false" designtimesp='5311' loop="true"></EMBED>" >> $DIRNAME/.$ONELINE.htm

echo $FOOTER >> $DIRNAME/.$ONELINE.htm
#seamonkey -remote "OPENFILE($DIRNAME)"
#note that you may need to do it different for different browsers... you can use "`which firefox`" opera, dillo etc

EDIT Nevermind, Can't do it in the same window this way... unless you can refresh by sending CTRL+R to the open browser using the pidof the browser and a program that I can never remember the name of
Either way that would mean your script is actually browsing and keeping track of the the location and the webpage would be dynamically updated (not moving around in directories)
Last edited by technosaurus on Fri 08 Jan 2010, 01:57, edited 2 times in total.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#12 Post by technosaurus »

If you wanted to get really quirky you could use a modified puppy web desktop as the header and even parse the /usr/share/applications/*.desktop to make a local browser menu
<a href="abiword.EXEC">abiword</a> where abiword.EXEC etc... is just a dummy file

STARTCOMMAND="`basename $1 .EXEC`"
$STARTCOMMAND
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

ITAmember
Posts: 167
Joined: Sun 13 Sep 2009, 18:50
Location: The middle of a cornfield

#13 Post by ITAmember »

I attached my progress thus far, but be warned it's just a patchwork of scripts I found. :P

Unzip + open "test.html"
Attachments
file-browser.zip
(50.65 KiB) Downloaded 590 times

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#14 Post by Flash »

Hey, I note that in "test.html" the top-level directories are all open so they show their subdirectories.

I assume you opened each directory individually, one at a time. I've been wanting a way to toggle open all the directories at once, so they show their subdirectories but not the files those subdirectories contain. There is an application called "tree" which can do this. It's available for both Linux and Windows, in fact I think there's a .pet of it, but it's hard to use and the results don't look good without doing more work on them in a word processor. It would be great to have some aspects of tree incorporated into your file browser.

ITAmember
Posts: 167
Joined: Sun 13 Sep 2009, 18:50
Location: The middle of a cornfield

#15 Post by ITAmember »

Due to the general name of it my searches don't seem to turn up "tree". :) I'll keep looking but if you could find it that would help me out quite a bit.

If you open "drag-drop-folder-tree.html" and scroll to the bottom you will find a line that says

Code: Select all

treeObj.expandAll();
You can comment that out with the // comment and the tree will start collapsed. I'll eventually find a nice place to put a button/link that will toggle the expand/collapse state. I also don't plan on showing files in the treeview, that would make it rather crowded. Instead the user will click on the folder and view the contents in the main window. (which needs a lot of work :) )

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#16 Post by Flash »

I don't remember who made these. I'm sure I got them from the Additional Software section of the forum.
Attachments
tree_DOC-1.5.2.2.pet
(3.55 KiB) Downloaded 437 times
tree-1.5.2.2.pet
(16.28 KiB) Downloaded 473 times

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#17 Post by Pizzasgood »

ITAmember wrote:Due to the general name of it my searches don't seem to turn up "tree". :) I'll keep looking but if you could find it that would help me out quite a bit.
http://www.murga-linux.com/puppy/viewtopic.php?t=47657

EDIT: Oh, I didn't realize there was a second page to this thread, so I didn't realize Flash already posted it.
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#18 Post by Flash »

Thanks for finding the thread, Pizza. I didn't bother looking for it since I had the .pets at hand.

Here's an even earlier thread on tree, that I had bookmarked then forgot about. :oops:

Post Reply