| |||
|
Go to a section, resize, or stretch the desktop by dragging any window past its edges |
|||
| [Help] [Navbox] | Load URL: |
| Help |
|
Javascript IDE: (Reference) (Examples)
(see source for more)
Examples of the API(Reference)
// xample 0: Hello world (in a window)
CreateWindow($text("hello world"), "program1", "hi");
// xampl 1: Make the whole desktop draggable, moves if
// you ry to drag the [http://...] url box $("newurl").onmousedown = function() { StartMoving("desktop"); }
// xampl 2: Restore destkop to former self
$("newurl").onmousedown=""; XIs("desktop", 1); YIs("desktop", 1);
// xampl 3: Sample application, moveable google bar.
// No title, searches when you tab out of it: googlebar = $input("text", "googlebar", "search text"); // This function fires on [Tab] and creates a window: googlebar.onblur = function() {CreateWindow("http://google.com/search?q=" + this.value, "gwindow", "Google Search for "+this.value);} // Make it movable googlebar.onmousedown = function(){StartMoving(this.id);} // Place to the right of the "open" button googlebar.style.position="absolute"; googlebar.style.top = 10; googlebar.style.left = 660; // Put googlebar in desktop PutIn(googlebar, $("desktop")); googlebar.focus(); // set focus, start typing
// xampl 4: Function for generic moveable search bar with title:
// Press enter to search instead of tab. After running this script // the function will be available to use from the javascript box. // Paste it into the source to make it permanent. // Run in imperative script after the desktop loads in // the source, to make permanent search forms. SearchForm = function (name, prefixurl) { // Search Box sb = $make("form", "search_"+name); // Search Text st= $input("text", sb.id + "_searchtext", "search"); PutIn($text("Search "+name), sb); PutIn(st, sb); sb.onmousedown = function() {StartMoving(this.id);} sb.onsubmit=function() { searchstring = $(this.id + "_searchtext").value; searchurl = prefixurl + searchstring; CreateWindow(searchurl, name + "_" + Windows++, name + ": "+searchstring); return false; } sb.style.position="absolute"; sb.style.top=50;sb.style.left=150; PutIn(sb, $("desktop")); sb.style.zIndex = ++TopZIndex; }
// xample 5: Make a music and video search form
// (requires running xampl 4) SearchForm("singingfish", "http://search.singingfish.com/sfw/search" + "?fmp3=1&freal=1&favi=1&fmpeg=1&fwin=1"+ "&fqt=1&fflash=1&rpp=10&query=");
// xample 6: Delete it.
// (requires xampl 4 and 5) $del("search_singingfish"); |