Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Webian-Shell + TW-OS

42 views
Skip to first unread message

Måns

unread,
Dec 6, 2011, 4:23:58 PM12/6/11
to webian
Hi Ben

I remastered a downscaled Puppy Linux v. 5.10 and 5.11 to serve as a
dedicated TiddlyWiki OS ( http://tiddlywiki.com):

http://tw-os.tiddlyspace.com/

I was wondering if I could customize Webian Shell to run on Puppy
Linux - on top of ie OpenBox.
I would simply set it up to start when OpenBox is loaded effectively
taking over and hide the desktop.
TiddlyWiki has plugins for browsing files and directories - and run
executable files, so it would obviously be a great companion for
webian...

Cheers Måns Mårtensson

Måns

unread,
Dec 6, 2011, 4:27:29 PM12/6/11
to webian
Feature request:
Is it possible to change main.js making Webian Shell open ALL htmls
(tiddlywikis) from a specified folder in different tabs - at once??

Cheers Måns Mårtensson

On 6 Dec., 22:23, Måns <humam...@gmail.com> wrote:
> Hi Ben
>
> I remastered a downscaled Puppy Linux v. 5.10 and 5.11 to serve as a

> dedicated TiddlyWiki OS (http://tiddlywiki.com):

Cody Long

unread,
Dec 6, 2011, 4:40:07 PM12/6/11
to web...@googlegroups.com
Hello Måns!

While I do not speak for Ben in any capacity, there should be no problem with your using Webian in TW-OS. Webian is open-source, so you can take it and do whatever you want with it, just be sure to give credit where credit is due.

As for your feature request, I may be able to throw something together for you, I just need to familiarize myself with TiddlyWiki. From what I have seen, TiddlyWiki seems very cool, and I definitely want to look at it more.

But just to let you know, Webian as it stands now is being deprecated, as it is at the limits of what Mozilla's Chromeless framework can do at the moment.

Ben is now actively working with Mozilla on a new project, Boot2Gecko, which is going to be the new base for Webian.

Thank you for your interest in Webian, and I will let you know when I have your feature request implemented in my github account.

Måns

unread,
Dec 6, 2011, 6:11:32 PM12/6/11
to webian
Hi Cody

> As for your feature request, I may be able to throw something together for you, I just need to familiarize myself with TiddlyWiki.

Great :-) I look forward to see what you might come up with!!

> Ben is now actively working with Mozilla on a new project, Boot2Gecko,
> which is going to be the new base for Webian.

Ok - Thanks for the info.

> Thank you for your interest in Webian, and I will let you know when I have
> your feature request implemented in my github account.

Thanks for answering my post!

Imo we might remove the address line and have icons for specified
htmlapps (like TW) instead.
My point is that if there's no address line then users won't expect
Webian to behave like a normal browser - which imho would be a pity,
because Webian doesn't "remember" browser history, autosuggest
addresses etc...

If we either:
1) have a directory where any local html app will show up as a tab/
icon in Webian - or
2) Feature a simple config (text) file where we could add URLs and
local files as a line separated list - and they would show up as tabs/
icons in Webian

Then it should be quite easy to setup a TiddlyWiki to control either:
what apps are in the directory (save as -> new app) - or: locate/edit
the config file, whenever needed...

Cheers Måns Mårtensson

Ben Francis

unread,
Dec 6, 2011, 8:27:31 PM12/6/11
to web...@googlegroups.com
I can't think of many use cases for this feature for the wider user base, but like Cody said feel free to modify Webian Shell for your specific application. It should be relatively simple to achieve what you're looking to achieve using JavaScript.

Ben
--
Ben Francis
http://tola.me.uk

Måns

unread,
Dec 7, 2011, 7:36:24 AM12/7/11
to webian
Hi Ben

>It should be relatively simple to achieve what you're looking
> to achieve using JavaScript.

Ok - Thanks for joining the thread :-)

Two (simple?) questions.

1) How do I change the link http://webian.org/shell/welcome/0.1/ in
the main.js file, to a *relative* link to a local html file??

I need to use a relative link because I'd like my setup to be
portable..

2) If I should modify/hardcode main.js to open several tabs with
different local htmls (not just one) - what would the code look like?

Cheers Måns Mårtensson

Ben Francis

unread,
Dec 7, 2011, 8:32:03 PM12/7/11
to web...@googlegroups.com
On Wed, Dec 7, 2011 at 8:36 PM, Måns <huma...@gmail.com> wrote:

1) How do I change the link http://webian.org/shell/welcome/0.1/ in
the main.js file, to a *relative* link to a local html file??

You probably need to use a file:// URL? Not sure if that can be relative.
 

2) If I should modify/hardcode main.js to open several tabs with
different local htmls (not just one) - what would the code look like?

I think you need several calls to newTab() in the $(document).ready(function()... section of code, you could iterative over an array of URLs if you want.

Ben

Måns

unread,
Dec 8, 2011, 7:14:48 AM12/8/11
to webian
Hi Ben

> You probably need to use a file:// URL? Not sure if that can be relative.

In FF portable it's possible to set a local homepage as a relative
path in a config.ini file:
LocalHomepage=SubFolderName/SomeTitle.html

I can't find documentation explaining how to use relative file URLs in
FF anywhere - so I guess it's not possible..
I did find some documentation explaining the the new File.url object -
starting with FF v. 4.:
http://hacks.mozilla.org/2010/07/firefox-4-formdata-and-the-new-file-url-object/

I'm not sure if Webian (based on Gecko 2 - which is corresponding to
FF version??) can handle file.urls??

> I think you need several calls to newTab() in the $(document).ready(function()... section of code, you could iterative over an array of URLs if you want.

Thanks for your answer :-)
I really know nothing about javascript - I'm a copy/paste sort of guy.

I guess I need to do sth. about this chunk of code:

* Creates a new tab & corresponding window and selects that tab
*/
function newTab(url) {
// Create new window from template
var newWindow = $("#window_template").clone();

// Generate unique ID for window
var randomNumberString = Math.random() + "";
var windowId = randomNumberString.substring(2);
newWindow.attr("id", "window_" + windowId);

// Add new window to interface
$("#windows").append(newWindow);

// Add corresponding tab
$("#tabs ul").append('<li id="tab_' + windowId +
'" class="tab"><a href="javascript:null()"></a></li>');

// Select new tab
selectTab(windowId);

// Add a new iFrame to new window
var newIframe = makeIframe(windowId);
$("#windows .selected .window_toolbar").after(newIframe);

// Register window event listeners
registerWindowEventListeners(windowId);

// Attach iFrame progress monitor
attachIframeProgressMonitor(windowId);

// Create history array for window, using first element as index
urlHistory[windowId] = [];
urlHistory[windowId][0] = 0;

// Navigate to URL if provided
if(url) {
$("#windows .selected .url_input").val(url);
navigate(windowId);
}
}

/**
* Close Tab
*
* Closes tab & window corresponding to provided windowId
*
* @param {String} windowId
*/
function closeTab(windowId) {
// Remove selected window & corresponding tab
$("#window_" + windowId).remove();
$("#tab_" + windowId).remove();

// If no tabs are open, activate home screen
if($(".window").length < 2) {
activateHomeScreen();

// otherwise, Select last remaining tab (not including the template
window!)
} else {
var newLastWindowId = $
(".window:not(#window_template)").last().attr("id").substring(7);
selectTab(newLastWindowId);
}

// Remove browsing history for tab
urlHistory.splice(windowId, 1);
}

/**
* Navigate
*
* Sets the src attribute of the iFrame belonging to the window
specified by
* windowId in order to navigate to a resource identified by the URI
in the
* address bar of that window. Also fetches favicon for the resource.
*
* @param windowId of window to use
*/
function navigate(windowId) {
// invoked when the user hits the go button or hits enter in
url box
var address = url.guess($.trim($
("#windows .selected .url_input").val()));
// trigger navigation
$("#windows .selected .window_iframe").attr("src", address);
// Fetch favicon for window
favicon.fetch(address, function(faviconUrl) {
var img = $("<img>").attr("src", faviconUrl);
img.attr("width", 16);
img.attr("height", 16);
$("#tab_" + windowId + " a").empty();
$("#tab_" + windowId + " a").append(img);
});
}

/**
* Activate Home Screen
*
* Hides all windows and shows the home screen
*/
function activateHomeScreen() {
$("#windows .selected").removeClass("selected");
$("#tabs .selected").removeClass("selected");
$("#windows").removeClass("active");
$("#home_screen").addClass("active");
$("#home_button").removeClass("active");
$("#tabs").addClass("detached");
}

/**
* Activate Windows
*
* Hides the home screen and makes the windows container active
*/
function activateWindows() {
$("#home_screen").removeClass("active");
$("#windows").addClass("active");
$("#home_button").addClass("active");
$("#tabs").removeClass("detached");
}

// When Shell starts up...
$(document).ready(function() {

// Set clock to be updated every second
self.setInterval("clock()",1000);

// Create first tab
newTab("file:///A:/bsolutePath/To/My/SomeTitle.html");
----

Can I simply add new "newTab("URL.file.html");" lines to the end of
this snippet - or can I write a comma or whitespace separated list of
urls inside the paranthesis??

Sorry if I'm asking questions that would/should be clear to all
JSprogrammers out there - however I don't know javascript - except
from the snippets I encounter when using TiddlyWiki...

Cheers Måns Mårtensson

Adam Hilliker

unread,
Jan 19, 2012, 2:44:08 PM1/19/12
to web...@googlegroups.com
Hey guys, I am really enamored with this shell; the concept of prototyping in HTML/JS/CSS is so awesome.  Cool to see it a reality!

Anyway, one thing I'm having trouble with is opening a file into Webian Shell.  I have set Webian Shell.exe as my default browser for PDFs and local HTML files, but when I open anything it only displays the default tab value.

Is there any way to capture what file the OS is passing to the application?  I can't find it in the JS anywhere.

I was thinking of externalizing the default tab value into PHP or something, but I can't imagine a scenario where that would actually solve my problem.  :)  Any help would be great!

Thanks!

Adam Hilliker

unread,
Jan 19, 2012, 2:45:57 PM1/19/12
to web...@googlegroups.com
Yes!  You should be able to add as many newTab("URL.file.html"); as you want, and they should spawn tabs with the linked content.
Reply all
Reply to author
Forward
0 new messages