summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts/prototype/README
blob: 74761a82bef243a75a2f503cf877b83e79ad84d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
= Prototype
==== An object-oriented JavaScript framework

(c) 2005 Sam Stephenson (mailto:sam@conio.net)

Prototype is a JavaScript framework that aims to ease development of dynamic 
web applications.  Its development is driven heavily by the Ruby on Rails 
framework, but it can be used in any environment.

=== Targeted platforms

Prototype currently targets the following platforms:

* Microsoft Internet Explorer for Windows, version 6.0 and higher
* Mozilla Firefox 1.0/Mozilla 1.7 and higher
* Apple Safari 1.2 and higher

== Using Prototype

To use Prototype in your application, download the latest release from the 
Prototype web site (http://prototype.conio.net/) and copy 
<tt>dist/prototype.js</tt> to a suitable location. Then include it in your HTML
like so:

  <script type="text/javascript" src="/path/to/prototype.js"></script>

=== Building Prototype from source

<tt>prototype.js</tt> is a composite file generated from many source files in 
the <tt>src/</tt> directory. To build Prototype, you'll need:

* a copy of the Prototype source tree, either from a distribution tarball or
  from the darcs repository (see below)
* Ruby 1.8.2 or higher (http://www.ruby-lang.org/)
* Rake -- Ruby Make (http://rake.rubyforge.org/)
* RDoc, if your Ruby distribution does not include it
* darcs 1.0.1 or higher (http://abridgegame.org/darcs/; static binaries 
  available at http://www.scannedinavian.org/DarcsWiki/CategoryBinaries)

From the root Prototype directory,

* <tt>rake dist</tt> will preprocess the Prototype source using ERB and 
  generate the composite <tt>dist/prototype.js</tt>.
* <tt>rake package</tt> will create a distribution tarball in the 
  <tt>pkg/</tt> directory.

== Contributing to Prototype

You'll need the tools mentioned above. Modify the files in <tt>src/</tt>, add 
tests in <tt>test/</tt> if possible, generate a new dist file, and record the 
changes with <tt>darcs record -al</tt>. Then email patches to 
mailto:sam@conio.net using <tt>darcs send</tt>.

== Documentation

Prototype is embarrassingly lacking in documentation. (The source code should 
be fairly easy to comprehend; I'm committed to using a clean style with 
meaningful identifiers. But I know that only goes so far.)

Much of the problem is that there is no easy way to document it from within the
source code itself. I've tried JSDoc[http://jsdoc.sf.net/] and a Perl script 
included with JsUnit[http://www.edwardh.com/jsunit/]; neither groks Prototype's
hash-style class definitions or inheritance scheme. Making them work would 
require major changes, and I don't have the time for that right now.