[INIT]
woot:*:0:0:WAJAX Root Account:/bin/wash
WAJAX Console Prototype II $Id: console.html,v 1.1 2006/05/09 12:00:00 selcomb Exp $ (c)2005-2006 Scott Elcomb Some Rights Reserved (CC-GNU LGPL) This is prototype quality software, expect bugs! Bug reports can be sent to bugs-at-avidus-dot-ca, or visit us at http://www.avidus.ca/ Welcome to WASH help An introduction to the WAJAX environment and the WASH Shell. Also has the README. startWM Starts the "Window Manager" makeLicense Display license
WASH Commands ============= Table of Contents ----------------- 1. General 2. Commands 1. General ---------- WASH, the WAJAX Application SHell, is a javascript processing aid. It extends the web experience by providing both an interactive and scriptable shell capable of manipulating WAJAX objects. This includes DOMFS objects (files and direcories) and GUI Components (under /proc). As a prototype it's simple and the code is both lousy and lazy. Expect only the minimal amount of functionality from any given command. The WASH engine hasn't been updated much since the creation of WAJAX and it show's in the washCommand() function. Those regex nasties need to be updated with something civilized. lol. WARNING: If you enjoy learning Javascript, you may be at increased risk of becoming a WAJAX addict. 2. Commands ----------- cat src-div [>[>] dest-div] Copy the contents of src-div to the console, or redirect to dest-div. Doesn't fully support paths yet. > outfile clobbers an original, >> outfile appends. dest-div must already exist or cat fails. clear Clears the console display create parent name type Create a component. A simple wrapper for createComponent(). parent is the name of the parent object. name is the name of the component you are creating. type is one of: button code Plaintext file (executable) directory Plaintext file (directory) datasource Asnychronous communications component (not implemented) file Plaintext file (non-executable) image iframe label mdiwindow MDI Window (simulated) menuBar menuItem null panel popupMenu popupMenuItem selectbox timer textbox textarea window echo message [>[>] dest-div] Copies message to the console display. To redirect message to somewhere other than the console output, message must be enclosed in double quotes. (echo "This is a test" > test) empty (disabled) Use with CAUTION. Do not run after liteWM/startWM or you wont have a console! Empty the root WAJAX window... this wipes all of the html, components et al, in the WAJAX root container. Currently doesn't clean up any internal stacks, pointers, or anything fancy like that. For local persistant-storage tests. If you require it, you will need to manually rebuild a filesystem after running this. Use the createComponent() function to generate directories, and cat to copy the rom_ commands back. See the init() function for details. eval expression Evaluate a JavaScript expression file command filename [misc] Where filename is a div or file alias, and command is one of: describe - describes the attributes and properties of the file object attached to a div name - sets the alias to [misc] mkdiv src-div dest-div Creates a plain div inside another one. If you don't want or need an associated WAJAX object, just a container with a name, use this. Ignores the WAJAX component stack. See: the create builtin, /sbin/mkdir, /sbin/touch, and the createComponent() function reboot Reload WAJAX run command Run a washCommand(). The default WASH shell's behavior is to try run if the user's command line did not match any built-ins. style dest-div style-item style-value Change the CSS style properties of dest-div. Very inefficient, but good for rapid prototyping. By way of example, to build an 640x480 window try these lines in your console: create proc MyTestWindow window style MyTestWindow position absolute style MyTestWindow top 0px style MyTestWindow left 0px style MyTestWindow width 640px style MyTestWindow height 480px eval stack[findComponentByName('MyTestWindow')].methods.resize();
WAJAX Introduction ================== Table of Contents ----------------- 1. General 2. DOMFS Filesystem 3. Communications Link 4. Console Commands and Utilities 5. WAJAX Desktop Applications 1. General ---------- If this is your first visit to WAJAX and have not started your WAJAX desktop yet, you may wish to close this window and run 'startWM' from the command line. You can open this window at any time by double clicking the Help icon on your WAJAX desktop, or by running 'help' from the console window. Those familiar with *nix should find that WAJAX is loosely modeled after it. A number of small commands and utilities are available in /bin and /sbin. Most of them are only partially functional and are sorely in need of attention. This is only a prototype. Lot's of things don't work, and more people are needed to make this software work as good as it looks like it should. Web developers with a bit of a background in DHTML should be able to get the hang of WAJAX fairly quickly. If you're not familiar with DHTML or AJAX development, then here's the quick summary: More-or-less, WAJAX just barely works and tries to look halfway decent about it. If you are, then the rest of the documentation is for you. :P Scripting is done in ECMAScript/JavaScript. Wash-scripting isn't supported yet as the I/O streams haven't really been implemented. No pipes either. Partial redirection is available with some commands however. Everything about WAJAX that does work, only does so with minimum of functionality and error-checking. Commands that have been implemented are in various stages of completion, primarily due to the fact that the entire system API is under construction... no fopen(), read(), seek(), or fclose() type stuff yet. Non-API scripts, such as those in /bin or /sbin should also have version strings of their own. The code is hurried and not very clean. Future versions should aim for clear, concise and efficient code. [ed. Just in-case my programming prof ever sees this: I wasn't sleeping, I was visualizing my goals. =D ] 2. DOMFS Filesystem ------------------- Very simple and only partially implemented. Expect to see this corrected shortly, but in the meantime the filesystem has exactly 1 namespace: NO TWO OBJECTS (files or GUI components) may have the same name. Some functionality exists to support the concept of paths, though it isn't enforced yet. You may access any "file" from any "directory" in WAJAX. A "File" is a essentially an HTML DIV element with an associated Javascript object that describes it's properties. Initialized and/or running applications are mounted under /proc. You can look at and modify GUI components at runtime by cd'ing into your running application. GUI components are identified as component files in DOMFS. A note about long ls listings (ls -l). "Permission bits" are as follows: hdrwxt |||||`- file's data type. One of f (file), c (component), a (atom) ||||`-- file is executable |||`--- file is writeable ||`---- file is readable |`----- file is a directory (file container) `------ file is hidden The stat command returns this information as well. Permissions aren't really working yet, so everything's effectively chmod 777. To change permissions settings anyway, try running the following in the console: eval stack[findFileByName('README')].fid.writeable=true; stat README eval stack[findFileByName('README')].fid.writeable=false; stat README The [l (list)] file data type is not implemented. [r (recordset)] is also a possibility (see the rsparser and tdb commands for information about recordsets) 3. Communications Link ---------------------- Recordsets returned via the commSend() function are currently stored as colon-delimeted value files under /tmp. Opening a console at http://www.avidus.ca/wajax/console.html and running 'tdb' will start a sample application with a SQL database for it's backend. Planned improvements include encaspulating the commSend() and commHandler() functions (and their associated global variables) into a standard WAJAX Datasource Component. This will offer WAJAX applications a bit more flexibility in accessing remote databases. 4. Console Commands and Utilities --------------------------------- System Commands ```````````````` cd Change directory dumpHistory List a sessions command history env Display environment variables hostname View or set the hostname as displayed by xPrompt() ls List files. Code is lazy and incomplete. supports -l and -lh mkdir Make a new directory in the current working directory (does not support paths) pwd Prints the current working directory stat Display file information su Switch user (changes the user and current working directory environment variables) which Print the full path of a file useradd Creates a new homedir GUI Related ```````````` createApp Create an running GUI application. (Uses makeMaker and runs the makefile.) defaultWallpaper The original WAJAX wallpaper liteWM Not-so-fancy initalization routine for the desktop makeMaker Build a fresh application-building script. (template needs to be moved into /etc) randomWallpaper Selects a random tileable Wallpaper setWallpaper Sets the Wallpaper. try it with --help (the only command that currently has help) startWM Fancy initialization routine for the desktop stopSampler Stops wallpaperSampler wallpaperSampler Calls randomWallpaper every 15s until stopSampler is run Bleeding-edge `````````````` tdb Tickets database (sample application and integrated bug management tool) * Note: tdb requires a datasource and SQL database. Running WAJAX from www.avidus.ca will connect you to a sample datasource for tdb. 5. WAJAX Desktop Applications ----------------------------- These apps require desktop and/or taskbar to be running. Core Apps `````````` Console Interactive WASH shell (mounts at /proc/xConsole) Textpad Basic text editing (mounts at /proc/ed) Browser An IFRAME wrapped in a WAJAX window ("Tabbed browsing" is planned) Bleeding-edge `````````````` Designer Rapid Application Development Environment (framework only - see raDHTML prototype)
WAJAX README ============ SYNOPSIS WAJAX is a self-contained operating environment for rich web-based applications. VERSION Prototype II $Id: console.html,v 1.1 2006/05/09 12:00:00 selcomb Exp $ LICENSE GNU Lesser General Public License, Free Software Foundation The GNU Lesser General Public License is a Free Software license. Like any Free Software license, it grants to you the four following freedoms: 0. The freedom to run the program for any purpose. 1. The freedom to study how the program works and adapt it to your needs. 2. The freedom to redistribute copies so you can help your neighbor. 3. The freedom to improve the program and release your improvements to the public, so that the whole community benefits. You may exercise the freedoms specified here provided that you comply with the express conditions of this license. The LGPL is intended for software libraries, rather than executable programs. The principal conditions are: !: You must conspicuously and appropriately publish on each copy distributed an appropriate copyright notice and disclaimer of warranty and keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of the GNU Lesser General Public License along with the Program. Any translation of the GNU Lesser General Public License must be accompanied by the GNU Lesser General Public License. SA: If you modify your copy or copies of the library or any portion of it, you may distribute the resulting library provided you do so under the GNU Lesser General Public License. However, programs that link to the library may be licensed under terms of your choice, so long as the library itself can be changed. Any translation of the GNU Lesser General Public License must be accompanied by the GNU Lesser General Public License. SC: If you copy or distribute the library, you must accompany it with the complete corresponding machine-readable source code or with a written offer, valid for at least three years, to furnish the complete corresponding machine-readable source code. You need not provide source code to programs which link to the library. Any of these conditions can be waived if you get permission from the copyright holder. Your fair use and other rights are in no way affected by the above. This is a human-readable summary of the Legal Code (the full GNU Lesser General Public License). A Portuguese translation is also available. SEE ALSO makeLicense AUTHOR (c)2005-2006 Scott Elcomb Some Rights Reserved (CC-GNU LGPL)
This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
		  GNU LESSER GENERAL PUBLIC LICENSE
		       Version 2.1, February 1999

 Copyright (C) 1991, 1999 Free Software Foundation, Inc.
     51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

[This is the first released version of the Lesser GPL.  It also counts
 as the successor of the GNU Library Public License, version 2, hence
 the version number 2.1.]

			    Preamble

  The licenses for most software are designed to take away your
freedom to share and change it.  By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.

  This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it.  You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.

  When we speak of free software, we are referring to freedom of use,
not price.  Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.

  To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights.  These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.

  For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you.  You must make sure that they, too, receive or can get the source
code.  If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it.  And you must show them these terms so they know their rights.

  We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.

  To protect each distributor, we want to make it very clear that
there is no warranty for the free library.  Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.

  Finally, software patents pose a constant threat to the existence of
any free program.  We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder.  Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.

  Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License.  This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License.  We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.

  When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library.  The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom.  The Lesser General
Public License permits more lax criteria for linking other code with
the library.

  We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License.  It also provides other free software developers Less
of an advantage over competing non-free programs.  These disadvantages
are the reason we use the ordinary General Public License for many
libraries.  However, the Lesser license provides advantages in certain
special circumstances.

  For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard.  To achieve this, non-free programs must be
allowed to use the library.  A more frequent case is that a free
library does the same job as widely used non-free libraries.  In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.

  In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software.  For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.

  Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.

  The precise terms and conditions for copying, distribution and
modification follow.  Pay close attention to the difference between a
"work based on the library" and a "work that uses the library".  The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.

		  GNU LESSER GENERAL PUBLIC LICENSE
   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

  0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".

  A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.

  The "Library", below, refers to any such software library or work
which has been distributed under these terms.  A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language.  (Hereinafter, translation is
included without limitation in the term "modification".)

  "Source code" for a work means the preferred form of the work for
making modifications to it.  For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.

  Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope.  The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it).  Whether that is true depends on what the Library does
and what the program that uses the Library does.
  
  1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.

  You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.

  2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:

    a) The modified work must itself be a software library.

    b) You must cause the files modified to carry prominent notices
    stating that you changed the files and the date of any change.

    c) You must cause the whole of the work to be licensed at no
    charge to all third parties under the terms of this License.

    d) If a facility in the modified Library refers to a function or a
    table of data to be supplied by an application program that uses
    the facility, other than as an argument passed when the facility
    is invoked, then you must make a good faith effort to ensure that,
    in the event an application does not supply such function or
    table, the facility still operates, and performs whatever part of
    its purpose remains meaningful.

    (For example, a function in a library to compute square roots has
    a purpose that is entirely well-defined independent of the
    application.  Therefore, Subsection 2d requires that any
    application-supplied function or table used by this function must
    be optional: if the application does not supply it, the square
    root function must still compute square roots.)

These requirements apply to the modified work as a whole.  If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works.  But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.

Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.

In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.

  3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library.  To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License.  (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.)  Do not make any other change in
these notices.

  Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.

  This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.

  4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.

  If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.

  5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library".  Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.

  However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library".  The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.

  When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library.  The
threshold for this to be true is not precisely defined by law.

  If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work.  (Executables containing this object code plus portions of the
Library will still fall under Section 6.)

  Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.

  6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.

  You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License.  You must supply a copy of this License.  If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License.  Also, you must do one
of these things:

    a) Accompany the work with the complete corresponding
    machine-readable source code for the Library including whatever
    changes were used in the work (which must be distributed under
    Sections 1 and 2 above); and, if the work is an executable linked
    with the Library, with the complete machine-readable "work that
    uses the Library", as object code and/or source code, so that the
    user can modify the Library and then relink to produce a modified
    executable containing the modified Library.  (It is understood
    that the user who changes the contents of definitions files in the
    Library will not necessarily be able to recompile the application
    to use the modified definitions.)

    b) Use a suitable shared library mechanism for linking with the
    Library.  A suitable mechanism is one that (1) uses at run time a
    copy of the library already present on the user's computer system,
    rather than copying library functions into the executable, and (2)
    will operate properly with a modified version of the library, if
    the user installs one, as long as the modified version is
    interface-compatible with the version that the work was made with.

    c) Accompany the work with a written offer, valid for at
    least three years, to give the same user the materials
    specified in Subsection 6a, above, for a charge no more
    than the cost of performing this distribution.

    d) If distribution of the work is made by offering access to copy
    from a designated place, offer equivalent access to copy the above
    specified materials from the same place.

    e) Verify that the user has already received a copy of these
    materials or that you have already sent this user a copy.

  For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it.  However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.

  It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system.  Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.

  7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:

    a) Accompany the combined library with a copy of the same work
    based on the Library, uncombined with any other library
    facilities.  This must be distributed under the terms of the
    Sections above.

    b) Give prominent notice with the combined library of the fact
    that part of it is a work based on the Library, and explaining
    where to find the accompanying uncombined form of the same work.

  8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License.  Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License.  However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.

  9. You are not required to accept this License, since you have not
signed it.  However, nothing else grants you permission to modify or
distribute the Library or its derivative works.  These actions are
prohibited by law if you do not accept this License.  Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.

  10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions.  You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.

  11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all.  For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.

If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.

It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices.  Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.

This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.

  12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded.  In such case, this License incorporates the limitation as if
written in the body of this License.

  13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.

Each version is given a distinguishing version number.  If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation.  If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.

  14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission.  For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this.  Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.

			    NO WARRANTY

  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.

		     END OF TERMS AND CONDITIONS

           How to Apply These Terms to Your New Libraries

  If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change.  You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).

  To apply these terms, attach the following notices to the library.  It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.

    
    Copyright (C)   

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

Also add information on how to contact you by electronic and paper mail.

You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary.  Here is a sample; alter the names:

  Yoyodyne, Inc., hereby disclaims all copyright interest in the
  library `Frob' (a library for tweaking knobs) written by James Random Hacker.

  , 1 April 1990
  Ty Coon, President of Vice

That's all there is to it!
CC-GNU LGPL
This software is licensed
under the GNU LGPL
Crystal Clear Icons
Crystal Clear Icons are licensed
under the GNU LGPL

Console

Textpad

Designer

Browser

Help
var argmem = findMemoryByName('argc'); var envmem = findMemoryByName('env'); if (findComponentByName('~APPNAME~') < 1 ) { createComponent('proc','~APPNAME~','window'); stack[findComponentByName('~APPNAME~')].properties.taskbar=true; stack[findComponentByName('~APPNAME~')].methods.updateTaskbar(); document.getElementById('~APPNAME~_switch').innerHTML = '~APPNAME~'; stack[findComponentByName('~APPNAME~_switch')].methods.click=function () { var state = document.getElementById('~APPNAME~').style.visibility; if (state == 'hidden') { stack[findComponentByName('~APPNAME~')].properties.focusOrder = ++maxZ; stack[findComponentByName('~APPNAME~')].methods.updateFocusOrder(); document.getElementById('~APPNAME~').style.visibility = 'visible'; document.getElementById('~APPNAME~_switch').style.border = '2px inset #ddd'; } else { document.getElementById('~APPNAME~').style.visibility = 'hidden'; document.getElementById('~APPNAME~_switch').style.border = '2px outset #ddd'; } } createComponent('~APPNAME~_content','~APPNAME~_menubar','menuBar'); washCommand('style ~APPNAME~_menubar position absolute'); washCommand('style ~APPNAME~_menubar top 32px'); createComponent('~APPNAME~_content','~APPNAME~_mainwindow','panel'); washCommand('style ~APPNAME~_mainwindow backgroundColor #fff'); washCommand('style ~APPNAME~_mainwindow border 2px inset #ddd'); washCommand('style ~APPNAME~_mainwindow height 100%'); washCommand('style ~APPNAME~_mainwindow width 100%'); washCommand('style ~APPNAME~_mainwindow overflow auto'); //File Menu createComponent('~APPNAME~_menubar','~APPNAME~_mnuFile','menuItem'); washCommand('echo "File" > ~APPNAME~_mnuFile_text'); stack[findComponentByName('~APPNAME~_mnuFile_item')].methods.repaint(); createComponent('~APPNAME~_mainwindow','~APPNAME~_popFile','popupMenu'); washCommand('style ~APPNAME~_popFile top 60px'); washCommand('style ~APPNAME~_popFile left 0px'); washCommand('style ~APPNAME~_popFile padding 4px'); createComponent('~APPNAME~_popFile','~APPNAME~_popFile_New','popupMenuItem'); washCommand('echo "New..." > ~APPNAME~_popFile_New_text'); stack[findComponentByName('~APPNAME~_popFile_New_item')].methods.repaint(); document.getElementById('~APPNAME~_popFile_New_click').innerHTML = 'document.getElementById(\'~APPNAME~_popFile\').style.visibility=\'hidden\''; createComponent('~APPNAME~_popFile','~APPNAME~_popFile_Open','popupMenuItem'); washCommand('echo "Open..." > ~APPNAME~_popFile_Open_text'); stack[findComponentByName('~APPNAME~_popFile_Open_item')].methods.repaint(); document.getElementById('~APPNAME~_popFile_Open_click').innerHTML = 'document.getElementById(\'~APPNAME~_popFile\').style.visibility=\'hidden\''; createComponent('~APPNAME~_popFile','~APPNAME~_popFile_Save','popupMenuItem'); washCommand('echo "Save..." > ~APPNAME~_popFile_Save_text'); stack[findComponentByName('~APPNAME~_popFile_Save_item')].methods.repaint(); document.getElementById('~APPNAME~_popFile_Save_click').innerHTML = 'document.getElementById(\'~APPNAME~_popFile\').style.visibility=\'hidden\''; document.getElementById('~APPNAME~_mnuFile_click').innerHTML = 'document.getElementById(\'~APPNAME~_popFile\').style.visibility=\'visible\''; washCommand('style ~APPNAME~_popFile visibility hidden'); //Edit Menu createComponent('~APPNAME~_menubar','~APPNAME~_mnuEdit','menuItem'); washCommand('echo "Edit" > ~APPNAME~_mnuEdit_text'); stack[findComponentByName('~APPNAME~_mnuEdit_item')].methods.repaint(); createComponent('~APPNAME~_mainwindow','~APPNAME~_popEdit','popupMenu'); washCommand('style ~APPNAME~_popEdit top 60px'); washCommand('style ~APPNAME~_popEdit left 30px'); washCommand('style ~APPNAME~_popEdit padding 4px'); createComponent('~APPNAME~_popEdit','~APPNAME~_popEdit_Copy','popupMenuItem'); washCommand('echo "Copy" > ~APPNAME~_popEdit_Copy_text'); stack[findComponentByName('~APPNAME~_popEdit_Copy_item')].methods.repaint(); document.getElementById('~APPNAME~_popEdit_Copy_click').innerHTML = 'document.getElementById(\'~APPNAME~_popEdit\').style.visibility=\'hidden\''; createComponent('~APPNAME~_popEdit','~APPNAME~_popEdit_Paste','popupMenuItem'); washCommand('echo "Paste" > ~APPNAME~_popEdit_Paste_text'); stack[findComponentByName('~APPNAME~_popEdit_Paste_item')].methods.repaint(); document.getElementById('~APPNAME~_popEdit_Paste_click').innerHTML = 'document.getElementById(\'~APPNAME~_popEdit\').style.visibility=\'hidden\''; createComponent('~APPNAME~_popEdit','~APPNAME~_popEdit_SelectAll','popupMenuItem'); washCommand('echo "Select All" > ~APPNAME~_popEdit_SelectAll_text'); stack[findComponentByName('~APPNAME~_popEdit_SelectAll_item')].methods.repaint(); document.getElementById('~APPNAME~_popEdit_SelectAll_click').innerHTML = 'document.getElementById(\'~APPNAME~_popEdit\').style.visibility=\'hidden\''; document.getElementById('~APPNAME~_mnuEdit_click').innerHTML = 'document.getElementById(\'~APPNAME~_popEdit\').style.visibility=\'visible\''; washCommand('style ~APPNAME~_popEdit visibility hidden'); //Help Menu createComponent('~APPNAME~_menubar','~APPNAME~_mnuHelp','menuItem'); washCommand('echo "Help" > ~APPNAME~_mnuHelp_text'); stack[findComponentByName('~APPNAME~_mnuHelp_item')].methods.repaint(); createComponent('~APPNAME~_mainwindow','~APPNAME~_popHelp','popupMenu'); washCommand('style ~APPNAME~_popHelp top 60px'); washCommand('style ~APPNAME~_popHelp left 60px'); washCommand('style ~APPNAME~_popHelp padding 4px'); createComponent('~APPNAME~_popHelp','~APPNAME~_popHelp_Docs','popupMenuItem'); washCommand('echo "Man Page" > ~APPNAME~_popHelp_Docs_text'); stack[findComponentByName('~APPNAME~_popHelp_Docs_item')].methods.repaint(); document.getElementById('~APPNAME~_popHelp_Docs_click').innerHTML = 'document.getElementById(\'~APPNAME~_popHelp\').style.visibility=\'hidden\''; createComponent('~APPNAME~_popHelp','~APPNAME~_popHelp_About','popupMenuItem'); washCommand('echo "About" > ~APPNAME~_popHelp_About_text'); stack[findComponentByName('~APPNAME~_popHelp_About_item')].methods.repaint(); document.getElementById('~APPNAME~_popHelp_About_click').innerHTML = 'document.getElementById(\'~APPNAME~_popHelp\').style.visibility=\'hidden\''; document.getElementById('~APPNAME~_mnuHelp_click').innerHTML = 'document.getElementById(\'~APPNAME~_popHelp\').style.visibility=\'visible\''; washCommand('style ~APPNAME~_popHelp visibility hidden'); } else { writeln('Found existing ~APPNAME~ instance. Destroying previous instance.'); // removeComponent acting strange, affecting fs. writeln('[~APPNAME~] warning: skipping destruction. non-unique filenames may occur.'); // washCommand("removeComponent ~APPNAME~_mainwindow"); // washCommand("removeComponent ~APPNAME~_switch"); // washCommand("removeComponent ~APPNAME~_statusbar"); // washCommand("removeComponent ~APPNAME~_content"); // washCommand("removeComponent ~APPNAME~_titlebar"); // washCommand("removeComponent ~APPNAME~"); // writeln('Component NID for ~APPNAME~: ' + findComponentByName('~APPNAME~')); }
// Add your local startup script here. washCommand('which README');
for (var i=0; i < cmdHistory.length; i++) { writeln(cmdHistory[i]); }
if (! document.getElementById('Help')) { createComponent('proc','Help','window'); document.getElementById('Help').style.width='800px'; document.getElementById('Help').style.height='450px'; stack[findComponentByName('Help')].methods.resize(); createComponent('Help_content','Help_content_btn1','button'); createComponent('Help_content','Help_content_btn2','button'); createComponent('Help_content','Help_content_btn3','button'); createComponent('Help_content','Help_content_txt','textarea'); document.getElementById('Help_content_txt').style.width='100%'; document.getElementById('Help_content_txt').style.height='360px'; document.getElementById('Help_content_btn1').innerHTML='Introduction'; document.getElementById('Help_content_btn2').innerHTML='WASH Shell'; document.getElementById('Help_content_btn3').innerHTML='About'; stack[findComponentByName('Help_content_btn1')].methods.click = function () { document.getElementById('Help_content_txt').value = document.getElementById('rom_introduction').innerHTML; } stack[findComponentByName('Help_content_btn2')].methods.click = function () { var txt = document.getElementById('rom_washBuiltins').innerHTML; // why doesn't this work?? txt = txt.replace('>','>'); var lines = new Array; var i=0; lines = txt.split("\n"); txt = ''; for (i=0; i < lines.length; i++) { while (lines[i].indexOf('gt') > -1) { lines[i] = lines[i].replace('gt','>'); } while (lines[i].indexOf('&') > -1) { lines[i] = lines[i].replace('&',''); } while (lines[i].indexOf(';') > -1) { lines[i] = lines[i].replace(';',''); } txt=txt + lines[i] + "\n"; } // need a wikifier anyway. document.getElementById('Help_content_txt').value = txt; } stack[findComponentByName('Help_content_btn3')].methods.click = function () { document.getElementById('Help_content_txt').value = document.getElementById('README').innerHTML; } stack[findComponentByName('Help_content_btn1')].methods.click(); document.getElementById('Help').style.visibility = 'visible'; } else { document.getElementById('Help').style.visibility = 'visible'; stack[findComponentByName('Help')].methods.updateFocusOrder(); }
createComponent('proc','License','window'); createComponent('License_content','License_mainwindow','panel'); washCommand('style License width 874px'); washCommand('style License height 431px'); washCommand('style License_mainwindow width 98%'); washCommand('style License_mainwindow height 95%'); washCommand('style License_mainwindow border 1px inset #ddd'); stack[findComponentByName('License')].methods.resize(); washCommand('cat license > License_mainwindow'); document.getElementById('License').style.visibility='visible';
washCommand('buildDesktop'); washCommand('buildTaskbar'); washCommand('buildXConsole'); washCommand('makeTextpad');
//washCommand('style consoleWindow visibility hidden'); washCommand('run buildDesktop'); createComponent('desktop','splash','null'); washCommand('style splash visibility hidden'); washCommand('style splash position absolute'); washCommand('style splash top -32px'); washCommand('style splash left 180px'); document.getElementById('splash').innerHTML = ''; washCommand('style splash visibility visible'); washCommand('run buildProgressbar'); washCommand('cat logo > lblprogresslogo'); washCommand('echo "Starting WM Core" > lblprogress'); document.getElementById('completion').style.width = '16%'; document.getElementById('GUIBootProgress_indicator').style.width = '16%'; washCommand('echo "Starting Taskbar" > lblprogress'); washCommand('run buildTaskbar'); document.getElementById('completion').style.width = '32%'; document.getElementById('GUIBootProgress_indicator').style.width = '32%'; washCommand('run buildSystemButton'); washCommand('echo "Starting Console" > lblprogress'); washCommand('run buildXConsole'); document.getElementById('completion').style.width = '48%'; document.getElementById('GUIBootProgress_indicator').style.width = '48%'; washCommand('echo "Building Textpad" > lblprogress'); washCommand('run makeTextpad'); document.getElementById('completion').style.width = '64%'; document.getElementById('GUIBootProgress_indicator').style.width = '64%'; washCommand('echo "Building Designer" > lblprogress'); washCommand('run makeDesigner'); document.getElementById('completion').style.width = '80%'; document.getElementById('GUIBootProgress_indicator').style.width = '80%'; washCommand('echo "Building Browser" > lblprogress'); washCommand('run makeBrowser'); document.getElementById('completion').style.width = '100%'; document.getElementById('GUIBootProgress_indicator').style.width = '100%'; createComponent('progressbar','pbtimer','timer'); washCommand('style pbtimer visibility hidden'); washCommand('style pbtimer position absolute'); washCommand('style pbtimer top -32px'); washCommand('style pbtimer left -32px'); stack[findComponentByName('pbtimer')].methods.timer = function (){ clearTimeout(stack[findComponentByName('pbtimer')].properties.timerId); document.getElementById('progressbar').style.visibility = 'hidden'; document.getElementById('GUIBootProgress').style.visibility = 'hidden'; } stack[findComponentByName('pbtimer')].methods.startTimer(); washCommand('style splash visibility hidden'); //document.getElementById('splash').innerHTML = ' '; washCommand('clear'); document.getElementById('xConsole_switch').focus();
document.getElementById('console').cols='78'; document.getElementById('console').rows='20'; document.getElementById('commandline').size='84'; createComponent('proc','xConsole','window'); washCommand('style xConsole visibility hidden'); washCommand('style xConsole top 32px'); washCommand('style xConsole left 100px'); washCommand('style xConsole width 780px'); washCommand('style xConsole height 440px'); stack[findComponentByName('xConsole')].methods.resize(); document.getElementById('xConsole_title').innerHTML = ' Console'; washCommand('style xConsole_content color #0f0'); washCommand('style xConsole_content fontFamily serif'); washCommand('style xConsole_content fontSize 10pt'); washCommand('style xConsole_content backgroundColor ' + console_background); document.getElementById('xConsole_content').innerHTML = document.getElementById('consoleWindow').innerHTML; document.getElementById('consoleWindow').innerHTML = ''; stack[findComponentByName('xConsole')].properties.taskbar=true; stack[findComponentByName('xConsole')].methods.updateTaskbar(); document.getElementById('xConsole_switch').innerHTML = 'Console'; stack[findComponentByName('xConsole_switch')].methods.click=function () { var state = document.getElementById('xConsole').style.visibility; if (state == 'hidden') { stack[findComponentByName('xConsole')].properties.focusOrder = ++maxZ; stack[findComponentByName('xConsole')].methods.updateFocusOrder(); document.getElementById('xConsole').style.visibility = 'visible'; document.getElementById('xConsole_switch').style.borderStyle = 'inset'; } else { document.getElementById('xConsole').style.visibility = 'hidden'; document.getElementById('xConsole_switch').style.borderStyle = 'outset'; } } createComponent('desktop','iconConsole','null'); document.getElementById('iconConsole').style.position='absolute'; document.getElementById('iconConsole').style.visibility='visible'; document.getElementById('iconConsole').style.top='32px'; document.getElementById('iconConsole').style.left='32px'; document.getElementById('iconConsole').style.width='64px'; washCommand('cat desktop_ConsoleIcon > iconConsole'); snapTo('iconConsole');
createComponent('proc','System','window'); washCommand('style System visibility hidden'); washCommand('style System top 0px'); washCommand('style System left 0px'); washCommand('style System width 1px'); washCommand('style System height 1px'); stack[findComponentByName('System')].properties.taskbar=true; stack[findComponentByName('System')].methods.updateTaskbar(); document.getElementById('System_switch').innerHTML = 'WAJAX'; stack[findComponentByName('System_switch')].methods.click=function () { var state = document.getElementById('desktop_popFile').style.visibility; if (state == 'hidden') { document.getElementById('desktop_popFile').style.zIndex = ++maxZ; var postPaint1 = document.getElementById('desktop_popFile_Prefs_item').innerHTML; if (postPaint1.match(/class="plain"/)) { postPaint1 = postPaint1.replace(/class="plain"/, 'class="reverse"'); document.getElementById('desktop_popFile_Prefs_item').innerHTML = postPaint1; document.getElementById('desktop_popFile_Prefs_text').style.width = '100px'; } var postPaint2 = document.getElementById('desktop_popFile_Demo_item').innerHTML; if (postPaint2.match(/class="plain"/)) { postPaint2 = postPaint2.replace(/class="plain"/, 'class="reverse"'); document.getElementById('desktop_popFile_Demo_item').innerHTML = postPaint2; document.getElementById('desktop_popFile_Demo_text').style.width = '100px'; } var postPaint3 = document.getElementById('desktop_popFile_Reboot_item').innerHTML; if (postPaint3.match(/class="plain"/)) { postPaint3 = postPaint3.replace(/class="plain"/, 'class="reverse"'); document.getElementById('desktop_popFile_Reboot_item').innerHTML = postPaint3; document.getElementById('desktop_popFile_Reboot_text').style.width = '100px'; } document.getElementById('desktop_popFile').style.visibility = 'visible'; document.getElementById('System_switch').style.border = 'inset 2px #ddd'; } else { document.getElementById('desktop_popFile').style.visibility = 'hidden'; document.getElementById('System_switch').style.border = 'outset 2px #ddd'; } }
createComponent('proc','progressbar','panel'); washCommand('style progressbar visibility hidden'); washCommand('style progressbar position absolute'); washCommand('style progressbar top 401px'); washCommand('style progressbar left 395px'); washCommand('style progressbar width 192px'); washCommand('style progressbar height 80px'); washCommand('style progressbar padding 2px'); washCommand('style progressbar backgroundColor #ddd'); washCommand('style progressbar border 2px outset #ddd'); createComponent('progressbar','lblprogresslogo','label'); washCommand('style lblprogresslogo position absolute'); washCommand('style lblprogresslogo top 8px'); washCommand('style lblprogresslogo left 8px'); washCommand('style lblprogresslogo width 32px'); washCommand('style lblprogresslogo height 32px'); createComponent('progressbar','lblprogress','label'); washCommand('style lblprogress position absolute'); washCommand('style lblprogress top 14px'); washCommand('style lblprogress left 44px'); washCommand('style lblprogress float right'); washCommand('style lblprogress color #000'); washCommand('style lblprogress fontWeight bold'); createComponent('progressbar','progress','panel'); washCommand('style progress position absolute'); washCommand('style progress top 45px'); washCommand('style progress left 8px'); washCommand('style progress width 175px'); washCommand('style progress height 25px'); washCommand('style progress backgroundColor #ddd'); washCommand('style progress border 2px inset #ddd'); createComponent('progress','completion','panel'); washCommand('style completion position absolute'); washCommand('style completion top 0px'); washCommand('style completion left 0px'); washCommand('style completion width 1px'); washCommand('style completion height 25px'); washCommand('style completion backgroundColor #00f'); washCommand('style progressbar visibility visible');
createComponent('proc','desktop','panel'); washCommand('style desktop position absolute'); washCommand('style desktop top 0px'); washCommand('style desktop left 0px'); washCommand('style desktop width 100%'); washCommand('style desktop height 100%'); washCommand('style desktop backgroundColor #99a'); washCommand('style desktop backgroundRepeat no-repeat'); //washCommand('style desktop backgroundPosition 50% 0%'); // bug-something pushing the desktop div (or wallpaper) down ~30px // current default wallpaper: (C)2005 Sy Ali CC-Attribution-ShareAlike // http://jrandomhacker.info/Image:Forest_and_mist_1.jpg washCommand('style desktop backgroundImage url(images/wallpaper/Forest_and_mist_1.jpg)'); createComponent('proc','desktop_attrib','panel'); var attrib=document.getElementById('desktop_attrib'); attrib.style.position='absolute'; attrib.style.top='700px'; attrib.style.left='500px'; attrib.style.width='300'; attrib.style.height='64'; attrib.style.color='#000'; attrib.style.fontWeight='bold'; attrib.innerHTML='Wallpaper: Forest and Mist (C)2005 Sy Ali CC-Attribution-ShareAlike'; washCommand('style desktop color #fff'); washCommand('style desktop padding 64'); washCommand('style desktop visibility visible'); createComponent('desktop','desktop_baseplane','image'); document.getElementById('desktop_baseplane').className='bplane'; document.getElementById('desktop_baseplane').style.position='absolute'; document.getElementById('desktop_baseplane').style.top='0px'; document.getElementById('desktop_baseplane').style.left='0px'; document.getElementById('desktop_baseplane').style.width='110%'; document.getElementById('desktop_baseplane').style.height='110%'; document.getElementById('desktop_baseplane').src='images/blank.gif'; createComponent('desktop','desktop_popFile','popupMenu'); document.getElementById('desktop_popFile').style.visibility='hidden'; washCommand('style desktop_popFile top 24px'); washCommand('style desktop_popFile left 0px'); washCommand('style desktop_popFile padding 4px'); washCommand('style desktop_popFile color #000'); washCommand('style desktop_popFile backgroundColor #ddd'); createComponent('desktop_popFile','desktop_popFile_Prefs','popupMenuItem'); washCommand('echo "Preferences" > desktop_popFile_Prefs_text'); stack[findComponentByName('desktop_popFile_Prefs_item')].methods.repaint(); document.getElementById('desktop_popFile_Prefs_click').innerHTML = 'washCommand(\'userPrefs\')'; createComponent('desktop_popFile','desktop_popFile_Demo','popupMenuItem'); washCommand('echo "Wallpaper" > desktop_popFile_Demo_text'); stack[findComponentByName('desktop_popFile_Demo_item')].methods.repaint(); document.getElementById('desktop_popFile_Demo_click').innerHTML = 'washCommand(\'wallpaperSampler -dialog\');'; //alert(\'The Wallpaper Sampler is running and will choose a random wallpaper every 15s. Run stopSampler from the console when finished.\') createComponent('desktop_popFile','desktop_popFile_Reboot','popupMenuItem'); washCommand('echo "Reboot" > desktop_popFile_Reboot_text'); stack[findComponentByName('desktop_popFile_Reboot_item')].methods.repaint(); document.getElementById('desktop_popFile_Reboot_click').innerHTML = 'washCommand(\'reboot\')';
createComponent('proc','taskbar','panel'); washCommand('style taskbar position absolute'); washCommand('style taskbar top 0px'); washCommand('style taskbar left 0px'); washCommand('style taskbar width 100%'); washCommand('style taskbar backgroundColor #ddd'); washCommand('style taskbar color #000'); washCommand('style taskbar padding 2'); washCommand('style taskbar visibility visible');
createComponent('proc','ed','window'); washCommand('style ed visibility hidden'); washCommand('style ed top 64px'); washCommand('style ed left 132px'); washCommand('style ed width 716px'); washCommand('style ed height 495px'); stack[findComponentByName('ed')].methods.resize(); document.getElementById('ed_title').innerHTML = ' Textpad'; washCommand('style ed_content backgroundColor #ddd'); createComponent('ed_content','btnEdCreateFile','button'); washCommand('echo "Create" > btnEdCreateFile'); stack[findComponentByName('btnEdCreateFile')].methods.click=function() { var name = document.getElementById('txtEdFilename').value; if(! document.getElementById(name)) { createComponent('root',name,'null'); } else { alert('File Exists!'); } document.getElementById('txtEdFilename').value = name; } createComponent('ed_content','btnEdOpenFile','button'); washCommand('echo "Open" > btnEdOpenFile'); stack[findComponentByName('btnEdOpenFile')].methods.click=function() {document.getElementById('taEdFileData').value = document.getElementById(document.getElementById('txtEdFilename').value).innerHTML;} createComponent('ed_content','btnEdSaveFile','button'); washCommand('echo "Save" > btnEdSaveFile'); stack[findComponentByName('btnEdSaveFile')].methods.click=function() {var dest = document.getElementById('txtEdFilename').value; document.getElementById(dest).innerHTML = document.getElementById('taEdFileData').value; washCommand('touch ' + dest); } createComponent('ed_content','btnEdExecuteFile','button'); washCommand('echo "Execute" > btnEdExecuteFile'); stack[findComponentByName('btnEdExecuteFile')].methods.click=function() { washCommand('run ' + document.getElementById('txtEdFilename').value); } createComponent('ed_content','btnEdClearFile','button'); washCommand('echo "Clear" > btnEdClearFile'); stack[findComponentByName('btnEdClearFile')].methods.click=function() {document.getElementById('taEdFileData').value = '';} createComponent('ed_content','txtEdFilename','textbox'); document.getElementById('txtEdFilename').style.width='100%'; createComponent('ed_content','taEdFileData','textarea'); document.getElementById('taEdFileData').style.width='100%'; document.getElementById('taEdFileData').rows=24; stack[findComponentByName('ed')].properties.taskbar=true; stack[findComponentByName('ed')].methods.updateTaskbar(); document.getElementById('ed_switch').innerHTML = 'Textpad'; stack[findComponentByName('ed_switch')].methods.click=function () { var state = document.getElementById('ed').style.visibility; if (state == 'hidden') { stack[findComponentByName('ed')].properties.focusOrder = ++maxZ; stack[findComponentByName('ed')].methods.updateFocusOrder(); document.getElementById('ed').style.visibility = 'visible'; document.getElementById('ed_switch').style.borderStyle = 'inset'; } else { document.getElementById('ed').style.visibility = 'hidden'; document.getElementById('ed_switch').style.borderStyle = 'outset'; } } createComponent('desktop','iconTextpad','null'); document.getElementById('iconTextpad').style.visibility='visible'; document.getElementById('iconTextpad').style.position='absolute'; document.getElementById('iconTextpad').style.top='96px'; document.getElementById('iconTextpad').style.left='32px'; document.getElementById('iconTextpad').style.width='64px'; washCommand('cat desktop_TextpadIcon > iconTextpad'); snapTo('iconTextpad');
stack[findComponentByName('btnAddWindow')].methods.click = function () { var myMemory = findMemoryByName('designer'); var count = ++memory[myMemory][1]; var name = 'Form' + count; createComponent('designer_content',name,'window'); document.getElementById(name).style.top = '40px'; document.getElementById(name).style.left = '280px'; document.getElementById(name).style.width = '485px'; document.getElementById(name).style.height = '420px'; stack[findComponentByName(name)].methods.resize(); var scl = document.getElementById('sComponentList'); scl.options[scl.options.length] = new Option(name); }
stack[findComponentByName('btnAddButton')].methods.click = function () { var myMemory = findMemoryByName('designer'); var count = ++memory[myMemory][2]; var name = 'Button' + count; createComponent('Form1',name,'button'); document.getElementById(name).style.position='absolute'; document.getElementById(name).style.top = '48px'; document.getElementById(name).style.left = '16px'; var scl = document.getElementById('sComponentList'); scl.options[scl.options.length] = new Option(name); }
stack[findComponentByName('btnAddTextbox')].methods.click = function () { var myMemory = findMemoryByName('designer'); var count = ++memory[myMemory][3]; var name = 'Textbox' + count; createComponent('Form1',name,'textbox'); document.getElementById(name).style.position='absolute'; document.getElementById(name).style.top = '48px'; document.getElementById(name).style.left = '16px'; var scl = document.getElementById('sComponentList'); scl.options[scl.options.length] = new Option(name); }
stack[findComponentByName('btnAddTextarea')].methods.click = function () { var myMemory = findMemoryByName('designer'); var count = ++memory[myMemory][4]; var name = 'Textarea' + count; createComponent('Form1',name,'textarea'); document.getElementById(name).style.position='absolute'; document.getElementById(name).style.top = '48px'; document.getElementById(name).style.left = '16px'; var scl = document.getElementById('sComponentList'); scl.options[scl.options.length] = new Option(name); }
stack[findComponentByName('btnAddLabel')].methods.click = function () { var myMemory = findMemoryByName('designer'); var count = ++memory[myMemory][5]; var name = 'Label' + count; createComponent('Form1',name,'label'); document.getElementById(name).style.position='absolute'; document.getElementById(name).style.top = '48px'; document.getElementById(name).style.left = '16px'; var scl = document.getElementById('sComponentList'); scl.options[scl.options.length] = new Option(name); }
stack[findComponentByName('btnAddPanel')].methods.click = function () { var myMemory = findMemoryByName('designer'); var count = ++memory[myMemory][6]; var name = 'Panel' + count; createComponent('Form1',name,'panel'); document.getElementById(name).style.position='absolute'; document.getElementById(name).style.top = '48px'; document.getElementById(name).style.left = '16px'; var scl = document.getElementById('sComponentList'); scl.options[scl.options.length] = new Option(name); }
stack[findComponentByName('btnAddTimer')].methods.click = function () { var myMemory = findMemoryByName('designer'); var count = ++memory[myMemory][7]; var name = 'Timer' + count; createComponent('Form1',name,'timer'); document.getElementById(name).style.position='absolute'; document.getElementById(name).style.top = '48px'; document.getElementById(name).style.left = '16px'; document.getElementById('sComponentList').options.push(name); var scl = document.getElementById('sComponentList'); scl.options[scl.options.length] = new Option(name); }
document.getElementById('sComponentList').onchange = function () { var sel = document.getElementById('sComponentList').options.selectedIndex; var name = document.getElementById('sComponentList').options[sel].value; alert('Selected Component: ' + name); // oh, lots and lots of room for optimizations. lol: if(document.getElementById('foobutton')) { washCommand('run removeComponent foobutton'); } createComponent('designer_content','foobutton','image'); document.getElementById('foobutton').innerHTML = ''; }
document.getElementById('sComponentList').onchange = function () { var sel = document.getElementById('sComponentList').options.selectedIndex; var name = document.getElementById('sComponentList').options[sel].value; alert('Selected Component: ' + name); // oh, lots and lots of room for optimizations. lol: // if(document.getElementById('foobutton')) { washCommand('run removeComponent foobutton'); } // // var stkStuckTo = findComponentByName(name); // var domStuckTo = document.getElementById(name); // var pname = stack[stack[stkStuckTo].owner].name; // createComponent(pname,'foobutton','image'); // // var stkFoo = findComponentByName('foobutton'); // var domFoo = document.getElementById('foobutton') // // document.getElementById('foobutton').innerHTML = ''; // // domFoo.style.position='absolute'; // domFoo.style.top = domStuckTo.style.top; // domFoo.style.left = parseInt(domStuckTo.style.left+0,"10") - 32; // domFoo.style.border='2px solid #00f'; //alert('foobutton x,y: ' + domFoo.style.top + ', '+ domFoo.style.left + ' is stuck to x,y: ' + domStuckTo.style.top + ', '+ domStuckTo.style.left); }
createComponent('proc','designer','mdiwindow'); washCommand('style designer visibility hidden'); washCommand('style designer top 96px'); washCommand('style designer left 164px'); washCommand('style designer width 780px'); washCommand('style designer height 510px'); stack[findComponentByName('designer')].methods.resize(); document.getElementById('designer_title').innerHTML = ' Designer'; washCommand('style designer_content backgroundColor #fff'); createComponent('designer_content','palette','window'); washCommand('style palette_content backgroundColor #fff'); washCommand('style palette top 40px'); washCommand('style palette left 10px'); washCommand('style palette height 200px'); stack[findComponentByName('palette')].methods.resize(); document.getElementById('palette_title').innerHTML = ' Component Palette'; createComponent('palette_content','btnAddWindow','button'); document.getElementById('btnAddWindow').innerHTML='New Window'; createComponent('palette_content','btnAddButton','button'); document.getElementById('btnAddButton').innerHTML='New Button'; createComponent('palette_content','btnAddTextbox','button'); document.getElementById('btnAddTextbox').innerHTML='New Textbox'; createComponent('palette_content','btnAddTextarea','button'); document.getElementById('btnAddTextarea').innerHTML='New Textarea'; createComponent('palette_content','btnAddLabel','button'); document.getElementById('btnAddLabel').innerHTML='New Label'; createComponent('palette_content','btnAddPanel','button'); document.getElementById('btnAddPanel').innerHTML='New Panel'; createComponent('palette_content','btnAddTimer','button'); document.getElementById('btnAddTimer').innerHTML='New Timer'; createComponent('designer_content','props','window'); washCommand('style props top 260px'); washCommand('style props left 10px'); washCommand('style props height 200px'); stack[findComponentByName('props')].methods.resize(); washCommand('style props_content backgroundColor #fff'); document.getElementById('props_title').innerHTML = ' Component Properties'; createComponent('props_content','label1','label'); washCommand('style label1 width 80px'); washCommand('echo "Component" > label1'); createComponent('props_content','sComponentList','selectbox'); stack[findComponentByName('designer')].properties.taskbar=true; stack[findComponentByName('designer')].methods.updateTaskbar(); document.getElementById('designer_switch').innerHTML = 'Designer'; stack[findComponentByName('designer_switch')].methods.click=function () { var state = document.getElementById('designer').style.visibility; if (state == 'hidden') { stack[findComponentByName('designer')].properties.focusOrder = ++maxZ; stack[findComponentByName('designer')].methods.updateFocusOrder(); document.getElementById('designer').style.visibility = 'visible'; document.getElementById('designer_switch').style.borderStyle = 'inset'; } else { document.getElementById('designer').style.visibility = 'hidden'; document.getElementById('designer_switch').style.borderStyle = 'outset'; } } createComponent('desktop','iconDesigner','null'); document.getElementById('iconDesigner').style.visibility='visible'; document.getElementById('iconDesigner').style.position='absolute'; document.getElementById('iconDesigner').style.top='180px'; document.getElementById('iconDesigner').style.left='32px'; document.getElementById('iconDesigner').style.width='64px'; washCommand('cat desktop_DesignerIcon > iconDesigner'); washCommand('run dcode_btnAddWindow'); washCommand('run dcode_btnAddButton'); washCommand('run dcode_btnAddTextbox'); washCommand('run dcode_btnAddTextarea'); washCommand('run dcode_btnAddLabel'); washCommand('run dcode_btnAddPanel'); washCommand('run dcode_btnAddTimer'); washCommand('run dcode_sComponentList'); snapTo('iconDesigner'); // setup some RAM malloc('designer'); var myMemory = findMemoryByName('designer'); // form counter memory[myMemory][1] = 0; // button counter memory[myMemory][2] = 0; // textbox counter memory[myMemory][3] = 0; // textarea counter memory[myMemory][4] = 0; // label counter memory[myMemory][5] = 0; // panel counter memory[myMemory][6] = 0; // timer counter memory[myMemory][7] = 0;
createComponent('proc','browser','window'); washCommand('style browser visibility hidden'); washCommand('style browser top 40px'); washCommand('style browser left 50px'); washCommand('style browser width 890px'); washCommand('style browser height 490px'); document.getElementById('browser_title').innerHTML = ' Browser'; stack[findComponentByName('browser')].methods.resize(); createComponent('browser_content','browser_define','button'); createComponent('browser_content','browser_search','button'); createComponent('browser_content','browser_go','button'); createComponent('browser_content','browser_url','textbox'); createComponent('browser_content','browser_atomos','button'); createComponent('browser_content','browser_summary','button'); createComponent('browser_content','browser_admin','button'); createComponent('browser_content','browser_downloads','button'); createComponent('browser_content','browser_media','button'); createComponent('browser_content','browser_frame','iframe'); washCommand('echo "Define" > browser_define'); washCommand('echo "Search" > browser_search'); washCommand('echo "Go" > browser_go'); washCommand('echo "Atomic OS" > browser_atomos'); washCommand('echo "Summary" > browser_summary'); washCommand('echo "Admin" > browser_admin'); washCommand('echo "Downloads" > browser_downloads'); washCommand('echo "Internet Radio" > browser_media'); document.getElementById('browser_url').size='40'; document.getElementById('browser_url').value = document.getElementById('browser_frame_content').src; document.getElementById('browser_url').onkeypress = function (event) { var key = getKey(event); if (checkKey(key, keyENTER)) { stack[findComponentByName('browser_go')].methods.click(); } }; document.getElementById('browser_frame').style.backgroundColor='#fff'; document.getElementById('browser_frame').style.border='0px solid #fff'; stack[findComponentByName('browser_define')].methods.click=function () { var dest = 'http://www.google.ca/search?hl=en&q=define%3A+'+document.getElementById('browser_url').value; document.getElementById('browser_url').value = dest; document.getElementById('browser_frame_content').src=document.getElementById('browser_url').value; } stack[findComponentByName('browser_search')].methods.click=function () { var dest = 'http://www.google.ca/search?hl=en&q=+'+document.getElementById('browser_url').value; document.getElementById('browser_url').value = dest; document.getElementById('browser_frame_content').src=document.getElementById('browser_url').value; } stack[findComponentByName('browser_go')].methods.click=function () { document.getElementById('browser_frame_content').src=document.getElementById('browser_url').value; } stack[findComponentByName('browser_atomos')].methods.click=function () { var dest = 'http://atomos.sourceforge.net/atomos.html'; document.getElementById('browser_url').value = dest; document.getElementById('browser_frame_content').src=document.getElementById('browser_url').value; } stack[findComponentByName('browser_summary')].methods.click=function () { var dest = 'https://sourceforge.net/projects/atomos'; document.getElementById('browser_url').value = dest; document.getElementById('browser_frame_content').src=document.getElementById('browser_url').value; } stack[findComponentByName('browser_admin')].methods.click=function () { var dest = 'https://sourceforge.net/project/admin/?group_id=172188'; document.getElementById('browser_url').value = dest; document.getElementById('browser_frame_content').src=document.getElementById('browser_url').value; } stack[findComponentByName('browser_downloads')].methods.click=function () { var dest = 'https://sourceforge.net/project/showfiles.php?group_id=172188'; document.getElementById('browser_url').value = dest; document.getElementById('browser_frame_content').src=document.getElementById('browser_url').value; } stack[findComponentByName('browser_media')].methods.click=function () { window.open ('http://w3.avidus.ca/player/launch.html','WAJAX: Avidus Player','status=1,toolbar=1,location=1,menubar=1,resizable=1,scrollbars=1,height=459,width=700'); } stack[findComponentByName('browser')].properties.taskbar=true; stack[findComponentByName('browser')].methods.updateTaskbar(); document.getElementById('browser_switch').innerHTML = 'Browser'; stack[findComponentByName('browser_switch')].methods.click=function () { var state = document.getElementById('browser').style.visibility; if (state == 'hidden') { stack[findComponentByName('browser')].properties.focusOrder = ++maxZ; stack[findComponentByName('browser')].methods.updateFocusOrder(); document.getElementById('browser').style.visibility = 'visible'; document.getElementById('browser_switch').style.borderStyle = 'inset'; } else { document.getElementById('browser').style.visibility = 'hidden'; document.getElementById('browser_switch').style.borderStyle = 'outset'; } } document.getElementById('browser_frame_content').style.height="95%"; createComponent('desktop','iconBrowser','null'); document.getElementById('iconBrowser').style.visibility='visible'; document.getElementById('iconBrowser').style.position='absolute'; document.getElementById('iconBrowser').style.top='244px'; document.getElementById('iconBrowser').style.left='32px'; document.getElementById('iconBrowser').style.width='64px'; washCommand('cat desktop_BrowserIcon > iconBrowser'); snapTo('iconBrowser'); createComponent('desktop','dHelpIcon','null'); document.getElementById('dHelpIcon').style.position='absolute'; document.getElementById('dHelpIcon').style.visibility='visible'; document.getElementById('dHelpIcon').style.top='360px'; document.getElementById('dHelpIcon').style.left='32px'; document.getElementById('dHelpIcon').style.width='64px'; washCommand('cat desktop_Help_Icon > dHelpIcon'); snapTo('dHelpIcon');
var imglist = new Array(); imglist.push('redwaveani.gif'); imglist.push('at005.gif'); imglist.push('at003.gif'); imglist.push('blue-snow.gif'); imglist.push('indianhead.jpg'); imglist.push('at010.gif'); imglist.push('at012.gif'); imglist.push('at007.gif'); imglist.push('black-rain.gif'); var argmem = findMemoryByName('argc'); var lookahead = memory[argmem][2]; //washCommand('run stopSampler'); if (lookahead == '--help') { writeln("\nusage\n\n setWallpaper [--list] [--help] filename [css-left css-top]\n setWallpaper\n\n Run with no parameters, setWallpaper will clear the desktop backgroundImage.\n\n"); } else if (lookahead == '--list') { writeln("\nredwaveani.gif\nat005.gif\nat003.gif\nblue-snow.gif\nindianhead.jpg\nat010.gif\nat012.gif\nat007.gif\nblack-rain.gif\n"); } else { document.getElementById('desktop').style.backgroundImage='url(images/'+lookahead+')'; if (isNaN(memory[argmem][3]) && isNaN(memory[argmem][4])) { washCommand('style desktop backgroundPosition '+memory[argmem][3]+' '+memory[argmem][4]); } if(memory[argmem][5]) { washCommand('style desktop backgroundRepeat '+memory[argmem][5]); } else { washCommand('style desktop backgroundRepeat repeat'); } writeln('Using wallpaper: '+lookahead); }
//mark2 - dialogs var argmem = findMemoryByName('argc'); var envmem = findMemoryByName('env'); var noAnim = 0; if (memory[argmem][2] == '-noanim') { noAnim = 1; } var imglist = new Array(); if (noAnim > 0) { imglist.push('indianhead.jpg'); } else { imglist.push('redwaveani.gif'); imglist.push('at005.gif'); imglist.push('at003.gif'); imglist.push('blue-snow.gif'); imglist.push('indianhead.jpg'); imglist.push('at010.gif'); imglist.push('at012.gif'); imglist.push('at007.gif'); imglist.push('black-rain.gif'); } var foo=Math.round(Math.random()*(imglist.length - 1)); document.getElementById('desktop').style.backgroundImage='url(images/'+imglist[foo]+')'; washCommand('style desktop backgroundPosition 0px 0px'); washCommand('style desktop backgroundRepeat repeat'); writeln('Using wallpaper: '+imglist[foo]);
washCommand('run stopSampler'); washCommand('style desktop backgroundRepeat no-repeat'); washCommand('style desktop backgroundPosition 900px 28px'); washCommand('style desktop backgroundImage url(images/djtux_sm.gif)'); writeln('Using wallpaper default: '+imglist[foo]);
//mark2 - create confirm/cancel, input, and messageboxes // note - poor man's dialog, need to get modal on this function or somethin. ;-) // pretty much used only for randomWallpaper/wallpaperSampler at the moment... // returns values through it's memory[][1] block. output pipes for function calls would be really nice. // be sure to test for 0 results, the user may have closed the window without answering. // csched should be converted into a general WM message pump and reshow dialog if a question is outstanding. var argmem = findMemoryByName('argc'); var envmem = findMemoryByName('env'); var message = 'none'; if (memory[argmem][2]) { message = memory[argmem][2]; } // creation doesn't listen to -clear option if (! document.getElementById('Dialog')) { malloc('Dialog'); var mymem = findMemoryByName('Dialog'); createComponent('proc','Dialog','window'); document.getElementById('Dialog').style.width='300px'; document.getElementById('Dialog').style.height='200px'; stack[findComponentByName('Dialog')].methods.resize(); createComponent('Dialog_content','Dialog_content_label','label'); createComponent('Dialog_content','Dialog_content_ok','button'); createComponent('Dialog_content','Dialog_content_cancel','button'); memory[mymem][1] = 0; // document.getElementById('Dialog_content_label').innerHTML=message; var label = 'WARN_ANIM_BACKGROUNDS_OK_OR_CANCEL'; document.getElementById('Dialog_content_label').innerHTML = label; document.getElementById('Dialog_content_ok').innerHTML='OK'; document.getElementById('Dialog_content_cancel').innerHTML='Cancel'; stack[findComponentByName('Dialog_content_ok')].methods.click = function () { var mymem = findMemoryByName('Dialog'); memory[mymem][1] = 1; document.getElementById('Dialog').style.visibility = 'hidden'; } stack[findComponentByName('Dialog_content_cancel')].methods.click = function () { var mymem = findMemoryByName('Dialog'); memory[mymem][1] = -1; document.getElementById('Dialog').style.visibility = 'hidden'; } document.getElementById('Dialog').style.visibility='visible'; stack[findComponentByName('Dialog')].methods.updateFocusOrder(); // Dialog already initialized } else { if (memory[argmem][2] == '-clear') { var mymem = findMemoryByName('Dialog'); memory[mymem][1] = 0; } else { // should reset the dialog window position here too... document.getElementById('Dialog').style.visibility='visible'; stack[findComponentByName('Dialog')].methods.updateFocusOrder(); } }
//mark2 - should provide a warning about the animated wallpapers. // this command does not run under liteWM as-is. requires/re-uses pbtimer from startWM. // requires a confirm/cancel dialog and handling a -noanim flag on cancel var argmem = findMemoryByName('argc'); var envmem = findMemoryByName('env'); var arg1 = memory[argmem][2]; var diamem = findMemoryByName('Dialog'); var noAnim = ' -noanim'; // set default to no animated if (arg1 == '-noanim') { noAnim = ' -noanim'; } if (arg1 == '-dialog') { washCommand('dialog -setup'); // _not_ modal } if (! document.getElementById('samplerLabel')) { createComponent('desktop','samplerLabel','label'); } var samplerLabel = document.getElementById('samplerLabel'); samplerLabel.style.position='absolute'; samplerLabel.style.top = '32px'; samplerLabel.style.left = '840px'; samplerLabel.style.color = '#a00'; samplerLabel.style.backgroundColor = '#000'; samplerLabel.style.fontWeight = 'bold'; samplerLabel.innerHTML = '- Wallpaper Sampler -'; stack[findComponentByName('pbtimer')].methods.timer = function () { clearTimeout(stack[findComponentByName("pbtimer")].properties.timerId); var noAnim = ' -noanim'; var diamem = findMemoryByName('Dialog'); if (memory[diamem][1] == 1) { noAnim = ''; } else { noAnim = ' -noanim'; } washCommand('randomWallpaper' + noAnim); stack[findComponentByName("pbtimer")].properties.timerId = setTimeout('stack[findComponentByName("pbtimer")].methods.timer()', '15000'); } stack[findComponentByName("pbtimer")].methods.timer();
if (stack[findComponentByName("pbtimer")].properties.timerId) { clearTimeout(stack[findComponentByName("pbtimer")].properties.timerId); } if (document.getElementById('samplerLabel')) { document.getElementById('samplerLabel').innerHTML = ''; }
var name = memory[findMemoryByName('argc')][2]; var nid = stack[findComponentByName(name)].nid; var pid = stack[findComponentByName(name)].owner; var pname = stack[pid].name; var componentText = document.getElementById(pname).innerHTML; var tmp = '.*'; var match = componentText.match(new RegExp(tmp, "gi")); //alert("Remove Component Test: Parent innerHTML contains Child NID?\n\nMatch: " + match); componentText = componentText.replace(new RegExp(tmp, "gi"), ''); document.getElementById(pname).innerHTML = componentText; stack[nid]='';
var cwd = simpleFilename(memory[findMemoryByName('env')]['CWD']); var filename = memory[findMemoryByName('argc')][2]; createComponent(cwd,filename,'directory');
washCommand('echo WASH Prototype II $Id: console.html,v 1.1 2006/05/09 12:00:00 selcomb Exp $ // need something resembling real i/o redirection and pipes to process wash scripts not written as js calls
var cwd = simpleFilename(memory[findMemoryByName('env')]['CWD']); var filename = memory[findMemoryByName('argc')][2]; var simple = simpleFilename(filename); if (filename.match(/^\//)) { var parts = filename.split('/'); cwd = parts[(parts.length - 2)]; // filename = parts[(parts.length - 1)]; } var fid = findComponentByName(simple); if (fid > -1) { stack[fid].fid.touchTime = localtime('std'); } else { createComponent(cwd,simple,'file'); }
// lazy way - not compatible with CGI influence //washCommand('echo $CWD'); // easy way var argmem = findMemoryByName('argc'); var envmem = findMemoryByName('env'); var cwd = memory[findMemoryByName('env')]['CWD']; writeln(cwd); // hard way (trace heritage) //var path = ''; //var pid = stack[findComponentByName(cwd)].nid; //var pname = stack[pid].name; //alert("pwd\n\ncwd: "+cwd+', pid: '+pid+', pname: '+pname); //if (cwd != 'root') { // while (pid > 0) { // path = stack[pid].name + '/' + path // pid = stack[pid].owner; // } // path = path.replace(/\/$/,''); //} //path = '/' + path; //writeln(path);
var argmem = findMemoryByName('argc'); var envmem = findMemoryByName('env'); var path = memory[argmem][2]; var cwd = memory[envmem]['CWD']; // alert("cd\n\ncwd: "+cwd+', path: '+path); if (path=='/') { path='root'; } if (path == '.') { path = cwd; } if (path == '..') { // alert('cd executing ..'); var fileobj = findFileByName(cwd); var pid = stack[fileobj].owner; path = stack[pid].name; } if (path.match(/^\//)) { var parts = path.split('/'); path = parts[(parts.length - 1)]; } //memory[envmem]['CWD'] = path; memory[envmem]['CWD'] = fullPath(path);
var argmem = findMemoryByName('argc'); var envmem = findMemoryByName('env'); var arg1 = ''; if (memory[argmem][2]) { arg1 = memory[argmem][2]; } if (findFileByName(arg1)) { washCommand('echo ' + fullPath(arg1)); }
var argmem = findMemoryByName('argc'); var envmem = findMemoryByName('env'); var arg1 = ''; if (memory[argmem][2]) { arg1 = memory[argmem][2]; } var arg2 = ''; if (memory[argmem][3]) { arg2 = memory[argmem][3]; } memory[envmem][arg1] = arg2;
var envmem = findMemoryByName('env'); for (entry in memory[envmem]) { if (entry != 0) { washCommand('echo ' + padStringRight(entry,'.',12) + ' ' + memory[envmem][entry]); } }
var argmem = findMemoryByName('argc'); var envmem = findMemoryByName('env'); var arg1 = ''; if (memory[argmem][2]) { arg1 = memory[argmem][2]; } var arg2 = ''; if (memory[argmem][3]) { arg2 = memory[argmem][3]; } // we want the folder name first. old habits die hard though. if (arg1.match(/\-/)) { var tmp = arg1; arg1 = arg2; arg2 = tmp; } var path = arg1; if (! path) { path = memory[envmem]['CWD']; } if (path == '/') { path = 'root'; } if (path.match(/^\//)) { var parts = path.split('/'); path = parts[(parts.length - 1)]; } //alert("ls:\n\nPath: "+path+"\nArgs: "+arg2); var count = 0; var output=''; for (var i=1;i<stack.length;i++) { var entry=''; var listFilenames = true; var listOwners = false; var listPermissions = false; var listDatatypes = false; var listFilesizes = false; var listCreateTimes = false; var listEditTimes = false; var humanReadable = false; if (arg2.match(/l/)) { listPermissions = false; listDatatypes = true; listOwners = true; listFilesizes = true; } if (arg2.match(/h/)) { humanReadable = true; } listCreateTimes = listDatatypes; //hack var parname=stack[stack[i].owner].name; if (parname==path) { var hidden = '-'; if (stack[i].fid.hidden) { hidden = 'h'; } var dir = '-'; if (stack[i].fid.directory) { dir = 'd'; } var read = '-'; if (stack[i].fid.readable) { read = 'r'; } var write = '-'; if (stack[i].fid.writeable) { write = 'w'; } var exec = '-'; if (stack[i].fid.executable) { exec = 'x'; } var dt = '-'; if (stack[i].fid.datatype == 'atom') { dt = 'a'; } if (stack[i].fid.datatype == 'component') { dt = 'c'; } if (stack[i].fid.datatype == 'file') { dt = 'f'; } if (stack[i].fid.datatype == 'list') { dt = 'l'; } var filesize = document.getElementById(stack[i].name).innerHTML.length; if (humanReadable) { filesize = Math.round(filesize / 1024) + 'K'; } var filename = stack[i].name; var fileowner = stack[i].fid.owner; var datestring = stack[i].fid.touchTime; if (! datestring) { datestring = '01/01/2006 00:01'; } var permissions = hidden + dir + read + write + exec; var permissions2 = permissions + dt; if ((listPermissions) || (listDatatypes)) { filesize = padStringLeft(filesize+'',' ',8); permissions = padStringRight(permissions,' ',12) permissions2 = padStringRight(permissions2,' ',12) fileowner = padStringRight(fileowner,' ',8) var datestamp = padStringRight(datestring,' ',16) if (hidden != 'h') { if (listPermissions) { entry = entry + permissions; } if (listDatatypes) { entry = entry + permissions2; } if (listOwners) { entry = entry + fileowner + fileowner; } // Simulate groupid if (listCreateTimes) { entry = entry + datestamp; } if (listFilesizes) { entry = entry + filesize; } if (listFilenames) { entry = entry + ' ' + filename; } output = output + entry + "\n"; entry = ''; } } else { filename = padStringRight(filename+'',' ',16); if (hidden != 'h') { if (listFilenames) { output = output + filename + ' '; } if (++count > 4) { output = output + "\n"; entry = ''; count = 0; } } } } } writeln(output);
var argmem = findMemoryByName('argc'); var envmem = findMemoryByName('env'); var cwd = memory[envmem]['CWD']; var appname = memory[argmem][2]; createComponent(cwd, 'make'+appname, 'code'); washCommand('cat appTemplate > ' + 'make'+appname); var code=document.getElementById('make'+appname).innerHTML; code=code.replace(/~APPNAME~/g, appname); document.getElementById('make'+appname).innerHTML=code;
var argmem = findMemoryByName('argc'); var envmem = findMemoryByName('env'); var cwd = memory[envmem]['CWD']; var appname = memory[argmem][2]; writeln('Generating application base window'); writeln('Creating makefile for ' + appname); washCommand('makeMaker ' + appname); writeln('Making makefile for ' + appname); washCommand('make' + appname);
var argmem = findMemoryByName('argc'); var envmem = findMemoryByName('env'); var user = memory[argmem][2]; if (user) { if(document.getElementById(user)) { memory[envmem]['USER'] = user; memory[envmem]['HOME'] = fullPath(memory[envmem]['USER']); washCommand('cd ' + user); } else { writeln('User not found, try useradd'); } } else { writeln('usage: su username'); }
var argmem = findMemoryByName('argc'); var envmem = findMemoryByName('env'); var user = memory[argmem][2]; // This is a stub washCommand('useradd ' + user); washCommand('su ' + user);
var argmem = findMemoryByName('argc'); var envmem = findMemoryByName('env'); var host = memory[argmem][2]; if (host) { memory[envmem]['HOSTNAME'] = memory[argmem][2]; } else { writeln(memory[envmem]['HOSTNAME']); }
var argmem = findMemoryByName('argc'); var envmem = findMemoryByName('env'); var user = memory[argmem][2]; if (user) { if(document.getElementById(user)) { writeln('User exists'); } else { createComponent('home',user,'directory'); var updatePasswd = 'echo "' + user + ':*:' + usercount + ':' + usercount + ':User Account:/bin/wash" >> passwd'; washCommand(updatePasswd); usercount++; } } else { writeln('usage: useradd username'); }
var argmem = findMemoryByName('argc'); var envmem = findMemoryByName('env'); var path = memory[argmem][2]; var cwd = memory[envmem]['CWD']; if (path=='/') { path='root'; } if (path == '.') { path = cwd; } if (path == '..') { // alert('cd executing ..'); var fileobj = findFileByName(cwd); var pid = stack[fileobj].owner; path = stack[pid].name; } if (path.match(/^\//)) { var parts = path.split('/'); path = parts[(parts.length - 1)]; } washCommand('file describe ' + path + ' attr');
var argmem = findMemoryByName('argc'); var envmem = findMemoryByName('env'); var inFile = memory[argmem][2]; var i=0; var j=0; var numRecords = 0; var numFields = 0; var recordset = new Array; var fieldset = new Array; var rsDataMem; if (! inFile) { washCommand('echo usage: rsParser inFile'); } else { if(findMemoryByName(inFile) == -1) { malloc(inFile); } else { release(inFile); malloc(inFile); } rsDataMem = findMemoryByName(inFile); washCommand('echo Parsing ' + inFile); var rsSrc = document.getElementById(inFile).innerHTML; recordset = rsSrc.split("\n"); numRecords = recordset.length - 1; for (i=0; i<numRecords; i++) { var fsSrc = recordset[i]; fieldset = fsSrc.split(":"); numFields = fieldset.length; memory[rsDataMem][(i+1)] = new Array; for (j=0; j<numFields; j++) { memory[rsDataMem][(i+1)][j] = fieldset[j]; } } } if (memory[rsDataMem][1].length > 0) { washCommand('echo Successfully processed ' + numRecords + ' records'); } else { washCommand('echo rsData appears to be empty!'); }
if (document.getElementById('Tickets')) { washCommand('style Tickets visibility visible'); stack[findComponentByName('Tickets')].methods.updateFocusOrder(); } else { createComponent('proc','Tickets','window'); washCommand('style Tickets width 460px'); washCommand('style Tickets height 260px'); stack[findComponentByName('Tickets')].methods.resize(); createComponent('Tickets_content','field1','textbox'); createComponent('Tickets_content','field2','selectbox'); createComponent('Tickets_content','field3','selectbox'); createComponent('Tickets_content','field4','selectbox'); createComponent('Tickets_content','field5','textbox'); createComponent('Tickets_content','field6','textbox'); createComponent('Tickets_content','field7','textbox'); createComponent('Tickets_content','field8','textbox'); createComponent('Tickets_content','field9','textbox'); createComponent('Tickets_content','field10','textbox'); createComponent('Tickets_content','field11','textarea'); createComponent('Tickets_content','prev','button'); createComponent('Tickets_content','next','button'); createComponent('Tickets_content','update','button'); createComponent('Tickets_content','reload','button'); createComponent('Tickets_content','new','button'); createComponent('Tickets','startDelay','timer'); var ajax_delay = findComponentByName('startDelay'); stack[ajax_delay].properties.timeOut = '5000'; stack[ajax_delay].properties.repeat = false; stack[ajax_delay].methods.timer = function () { var ajax_delay = findComponentByName('startDelay'); clearTimeout(stack[ajax_delay].properties.timerId); //process the recordset //washCommand('rsparser tdata'); //point to the next record stack[findComponentByName('next')].methods.click(); } stack[ajax_delay].methods.startTimer(); var domPrevBtn = document.getElementById('prev'); domPrevBtn.style.position='absolute'; domPrevBtn.style.top='200px'; domPrevBtn.style.left='5px'; var domNextBtn = document.getElementById('next'); domNextBtn.style.position='absolute'; domNextBtn.style.top='200px'; domNextBtn.style.left='55px'; var domUpdateBtn = document.getElementById('update'); domUpdateBtn.style.position='absolute'; domUpdateBtn.style.top='200px'; domUpdateBtn.style.left='125px'; var domReloadBtn = document.getElementById('reload'); domReloadBtn.style.position='absolute'; domReloadBtn.style.top='200px'; domReloadBtn.style.left='190px'; var domNewBtn = document.getElementById('new'); domNewBtn.style.position='absolute'; domNewBtn.style.top='200px'; domNewBtn.style.left='252px'; var domField11 = document.getElementById('field11'); domField11.style.position='absolute'; domField11.style.top='120px'; domField11.style.left='5px'; domField11.style.height='70px'; domField11.style.width='450px'; //setup application space and the record index pointer malloc('tdata_form'); memory[findMemoryByName('tdata_form')][1] = 0; //prev click: stack[findComponentByName('prev')].methods.click = function () { if (memory[findMemoryByName('tdata_form')][1] > 1) { memory[findMemoryByName('tdata_form')][1]--; } //update display var i=memory[findMemoryByName('tdata_form')][1]; document.getElementById('field1').value = memory[findMemoryByName('tdata')][i][0]; document.getElementById('field2').options.selectedIndex = memory[findMemoryByName('tdata')][i][1] - 1; document.getElementById('field3').options.selectedIndex = memory[findMemoryByName('tdata')][i][2] - 1; document.getElementById('field4').options.selectedIndex = memory[findMemoryByName('tdata')][i][3] - 1; document.getElementById('field5').value = memory[findMemoryByName('tdata')][i][4]; document.getElementById('field6').value = memory[findMemoryByName('tdata')][i][5]; document.getElementById('field7').value = memory[findMemoryByName('tdata')][i][6]; document.getElementById('field8').value = memory[findMemoryByName('tdata')][i][7]; document.getElementById('field9').value = memory[findMemoryByName('tdata')][i][8]; document.getElementById('field10').value = memory[findMemoryByName('tdata')][i][9]; document.getElementById('field11').value = memory[findMemoryByName('tdata')][i][10]; } //next click: stack[findComponentByName('next')].methods.click = function () { if (memory[findMemoryByName('tdata_form')][1] < (memory[findMemoryByName('tdata')].length - 1)) { memory[findMemoryByName('tdata_form')][1]++; } //update display var i=memory[findMemoryByName('tdata_form')][1]; document.getElementById('field1').value = memory[findMemoryByName('tdata')][i][0]; document.getElementById('field2').options.selectedIndex = memory[findMemoryByName('tdata')][i][1] - 1; document.getElementById('field3').options.selectedIndex = memory[findMemoryByName('tdata')][i][2] - 1; document.getElementById('field4').options.selectedIndex = memory[findMemoryByName('tdata')][i][3] - 1; document.getElementById('field5').value = memory[findMemoryByName('tdata')][i][4]; document.getElementById('field6').value = memory[findMemoryByName('tdata')][i][5]; document.getElementById('field7').value = memory[findMemoryByName('tdata')][i][6]; document.getElementById('field8').value = memory[findMemoryByName('tdata')][i][7]; document.getElementById('field9').value = memory[findMemoryByName('tdata')][i][8]; document.getElementById('field10').value = memory[findMemoryByName('tdata')][i][9]; document.getElementById('field11').value = memory[findMemoryByName('tdata')][i][10]; } //update (database) click: stack[findComponentByName('update')].methods.click = function () { // var i=memory[findMemoryByName('tdata_form')][1]; // var id=document.getElementById('field1').value; // var value=document.getElementById('field2').value; // commSend('loadDataIntoDb',"UPDATE test SET name='" + value + "' WHERE id='" + id + "'",''); } //reload (database) click: stack[findComponentByName('reload')].methods.click = function () { var ajax_delay = findComponentByName('startDelay'); stack[ajax_delay].methods.startTimer(); commAsync=false; commSend('loadDataFromDb','SELECT * FROM sites ORDER BY id','tdsites'); commSend('loadDataFromDb','SELECT * FROM types ORDER BY id','tdtypes'); commSend('loadDataFromDb','SELECT * FROM tstatus ORDER BY id','tdstatus'); commSend('loadDataFromDb','SELECT * FROM tickets ORDER BY id','tdata'); commAsync=true; var i=0; var f2 = document.getElementById('field2'); var tds_memory = findMemoryByName('tdsites'); var tds_nr = memory[tds_memory].length - 1; f2.options.length = 0; for (i=0; i < tds_nr; i++) { var tds_id = i+1; var tds_name = memory[tds_memory][tds_id][1]; var tds_value = memory[tds_memory][tds_id][0]; f2.options[f2.options.length] = new Option(tds_name, tds_value); } var f3 = document.getElementById('field3'); tds_memory = findMemoryByName('tdtypes'); tds_nr = memory[tds_memory].length - 1; f3.options.length = 0; for (i=0; i < tds_nr; i++) { var tds_id = i+1; var tds_name = memory[tds_memory][tds_id][1]; var tds_value = memory[tds_memory][tds_id][0]; f3.options[f3.options.length] = new Option(tds_name, tds_value); } var f4 = document.getElementById('field4'); tds_memory = findMemoryByName('tdstatus'); tds_nr = memory[tds_memory].length - 1; f4.options.length = 0; for (i=0; i < tds_nr; i++) { var tds_id = i+1; var tds_name = memory[tds_memory][tds_id][1]; var tds_value = memory[tds_memory][tds_id][0]; f4.options[f4.options.length] = new Option(tds_name, tds_value); } } //new (record) click: stack[findComponentByName('new')].methods.click = function () { // var i=memory[findMemoryByName('tdata_form')][1]; // var value=document.getElementById('field2').value; // commSend('loadDataIntoDb',"INSERT INTO test VALUES(NULL,'" + value + "')",''); } document.getElementById('field1').setAttribute("readonly","readonly") document.getElementById('field1').style.backgroundColor='#ddd'; document.getElementById('field2').setAttribute("readonly","readonly") document.getElementById('field2').style.backgroundColor='#ddd'; document.getElementById('field3').setAttribute("readonly","readonly") document.getElementById('field3').style.backgroundColor='#ddd'; document.getElementById('field5').setAttribute("readonly","readonly") document.getElementById('field5').style.backgroundColor='#ddd'; document.getElementById('field6').setAttribute("readonly","readonly") document.getElementById('field6').style.backgroundColor='#ddd'; document.getElementById('field7').setAttribute("readonly","readonly") document.getElementById('field7').style.backgroundColor='#ddd'; document.getElementById('field8').setAttribute("readonly","readonly") document.getElementById('field8').style.backgroundColor='#ddd'; document.getElementById('field9').setAttribute("readonly","readonly") document.getElementById('field9').style.backgroundColor='#ddd'; document.getElementById('field10').setAttribute("readonly","readonly") document.getElementById('field10').style.backgroundColor='#ddd'; //update the recordset pointer and press Next to start... need a notification... stack[findComponentByName('reload')].methods.click(); document.getElementById('Tickets').style.visibility='visible'; }