Home
Live Examples
Quick Start
Customize the Look
Write Plugins
Download
API
Issues
Community
Links

Quick Start

There are a couple of things you need to do and setup command prompt on your page

1. Include Atlas Javascript libraries in the <head></head> of your html page

<script language="JavaScript" 
        type="text/javascript" 
        src="ScriptLibrary/Atlas/Release/AtlasCompat.js">
</script>
<script language="JavaScript" type="text/javascript" src="ScriptLibrary/Atlas/Release/Atlas.js"> </script> <script language="JavaScript" type="text/javascript" src="ScriptLibrary/AjaxLabCommandPrompt/Engine/Abstract/CMD.js"> </script>
<script language="JavaScript" type="text/javascript" src="ScriptLibrary/AjaxLabCommandPrompt/Engine/Core/CMD.js"> </script>

2. Initialize Command Prompt by adding this function to your <head></head> section. *Note. It must be called pageLoad() because it's a default function Atlas Javascript framework use to initalize when the page loads. More on the function parameter in the next step

<script type="text/javascript">


function pageLoad()
{

var cmd = new AjaxLab.Engine.Core.Cmd(null,"CmdPrompt",null,"http://www.ajaxlab.com");
cmd.setIsDebug(false);
}

</script>

3. Pay attention to the function in step 2. The fucntion takes four parmemters

  • First Parameter: Container div id outside the textarea (optional)
  • Second Parameter: Your textarea id (requried)
  • Third Parameter: Your debug area id (optional)
  • Fourth Parameter: Command Prompt Root (required)

4. Have a textarea in your html page . In my examples here, my textarea has an id="CmdPrompt". Note, you can decorate the background color and textcolor of your command prompt here. Normally, I would use a css class, but for demostration purpose here, I just want to show you how it can be done.


<textarea
style="BACKGROUND:#000000; COLOR:#ffffff" id="CmdPrompt" cols="80" rows="20" wrap="virtual"> </textarea>

5. If you want to have debug window or use the default "enable debug" command, you need to setup a debug area. Simply setup a <div> tag in your page with any "id" and then make sure you sepeficy the id in the third parmater in setp 3. At this point, your have what you need already. If you like to make it look fancy, read Customize the Look.

Credits

AjaxLab.com