Introduction
This walkthrough will instruct you how to create a new MochiKit library project and get started with your coding using the documented MochiKit library supplied by Aptana.
- Access your projects.
- Click the Project tab to view your Aptana projects.
- Create a new MochiKit project.
- On the New Project wizard, expand Aptana Projects and select Default Web Project.
- Click the Next button.
- In the Project name: field, type a name for your new project.
- Click the Next button.
- From the Select AjAX Libraries list, check the box next to MochiKit.
- On the Jaxer Support screen, click the Select All button if you would like to add Jaxer support to your project.
- Click the Next button.
- On the HTML Preview Settings screen, define any custom preview settings that you might need for your project.
- Click the Next button.
- Click the Finish button.
Aptana creates a new MochiKit project, which includes a lib folder for the MochiKit library, a new MochiKit-linked HTML template file named mochikit_sample.htm, and a new Code Assist Profile.
The mochikit_sample.htm file automatically opens in the HTML Editor. Because mochikit_sample.htm is now the active file, your MochiKit profile now becomes the active Profile in the Code Assist Profiles View.
- Explore the MochiKit project.
- Just below the open mochikit_sample.htm file in the Editor, click the Preview tab.
Aptana displays a preview of the Rounded Corners example from MochiKit.
- Click the Source tab to return to the source view of mochikit_sample.htm.
- In the Project View, expand your project folder to view the files in your MochiKit project.
- In the Code Assist Profiles View, expand the mochikit_sample.htm project folder to view the documented MochiKit library files.
These are the files that will be available to you in Code Assist.
- Just below the open mochikit_sample.htm file in the Editor, click the Preview tab.
- Preview Code Assist.
- In your MochiKit project, double-click the mochikit_sample.js file to open the file in the Editor and view the code for this example.
- In the mochikit_sample.js file, wait a few seconds for Code Assist to load, and then hover your cursor over the swapDOM function to view the documentation for this MochiKit function.
- Insert your cursor somewhere on a new line in the mochikit_sample.js file, type "is".
Code Assist displays a list of MochiKit functions that begin with the letters "is" (e.g. isDateLike, isArrayLike, etc). Use Code Assist to help you code.
- Start coding.
- As you type, notice that Code Assist is now active for the MochiKit objects and functions that you use.
- Press ctrl+space at any time to activate Code Assist.