Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 31 Oct 2014, 06:52
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
HTML based file browser
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 2 Posts_count   Goto page: 1, 2 Next
Author Message
ITAmember

Joined: 13 Sep 2009
Posts: 168
Location: The middle of a cornfield

PostPosted: Wed 06 Jan 2010, 14:54    Post_subject:  HTML based file browser
Sub_title: good idea?
 

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?
Back to top
View user's profile Send_private_message 
bugman


Joined: 20 Dec 2005
Posts: 2131
Location: buffalo commons

PostPosted: Wed 06 Jan 2010, 15:47    Post_subject:  

i like it

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

_________________
. . . the machines are clean
and the machines are not corrupted


- lee "scratch" perry
Back to top
View user's profile Send_private_message Visit_website 
ITAmember

Joined: 13 Sep 2009
Posts: 168
Location: The middle of a cornfield

PostPosted: Wed 06 Jan 2010, 18:50    Post_subject:  

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.
Back to top
View user's profile Send_private_message 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 11128
Location: Arizona USA

PostPosted: Wed 06 Jan 2010, 19:36    Post_subject:  

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.
Back to top
View user's profile Send_private_message 
ITAmember

Joined: 13 Sep 2009
Posts: 168
Location: The middle of a cornfield

PostPosted: Wed 06 Jan 2010, 20:42    Post_subject:  

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. Smile

Maybe I should use webkit instead of gecko for the HTML engine?
Back to top
View user's profile Send_private_message 
mikeb


Joined: 23 Nov 2006
Posts: 8394

PostPosted: Wed 06 Jan 2010, 21:05    Post_subject:  

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

mike
Back to top
View user's profile Send_private_message 
ITAmember

Joined: 13 Sep 2009
Posts: 168
Location: The middle of a cornfield

PostPosted: Wed 06 Jan 2010, 21:12    Post_subject:  

I'll bite, what are you talking about? This program won't be any less secure then a web browser.
Back to top
View user's profile Send_private_message 
mikeb


Joined: 23 Nov 2006
Posts: 8394

PostPosted: Thu 07 Jan 2010, 09:18    Post_subject:  

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 Very Happy .

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 Sad
Back to top
View user's profile Send_private_message 
disciple

Joined: 20 May 2006
Posts: 6449
Location: Auckland, New Zealand

PostPosted: Thu 07 Jan 2010, 16:47    Post_subject:  

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.

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send_private_message 
mikeb


Joined: 23 Nov 2006
Posts: 8394

PostPosted: Thu 07 Jan 2010, 17:23    Post_subject:  

Quote:
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.
Quote:
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
Back to top
View user's profile Send_private_message 
technosaurus


Joined: 18 May 2008
Posts: 4353

PostPosted: Thu 07 Jan 2010, 21:15    Post_subject:  

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)

_________________
Web Programming - Pet Packaging 100 & 101

Edited_times_total
Back to top
View user's profile Send_private_message 
technosaurus


Joined: 18 May 2008
Posts: 4353

PostPosted: Thu 07 Jan 2010, 21:39    Post_subject:  

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

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
ITAmember

Joined: 13 Sep 2009
Posts: 168
Location: The middle of a cornfield

PostPosted: Thu 07 Jan 2010, 23:29    Post_subject:  

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

Unzip + open "test.html"
file-browser.zip
Description 
zip

 Download 
Filename  file-browser.zip 
Filesize  50.65 KB 
Downloaded  384 Time(s) 
Back to top
View user's profile Send_private_message 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 11128
Location: Arizona USA

PostPosted: Thu 07 Jan 2010, 23:57    Post_subject:  

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.
Back to top
View user's profile Send_private_message 
ITAmember

Joined: 13 Sep 2009
Posts: 168
Location: The middle of a cornfield

PostPosted: Fri 08 Jan 2010, 00:25    Post_subject:  

Due to the general name of it my searches don't seem to turn up "tree". Smile 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:
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 Smile )
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 2 Posts_count   Goto page: 1, 2 Next
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1886s ][ Queries: 12 (0.0474s) ][ GZIP on ]