<p>Compiles PaperScript code into JavaScript code.</p>
<ulclass="member-list">
<h4>Options:</h4>
<li><tt>options.url: <tt>String</tt></tt>— the url of the source, for source-map generation</li>
<li><tt>options.source: <tt>String</tt></tt>— the source to be used for the source- mapping, in case the code that’s passed in has already been mingled.</li>
<tt><tt>Object</tt></tt> — an object holding the compiled PaperScript translated into JavaScript code along with source-maps and other information.
<p>Compiles the PaperScript code into a compiled function and executes it. The compiled function receives all properties of the passed <ahref="../classes/PaperScope.html"><tt>PaperScope</tt></a> as arguments, to emulate a global scope with unaffected performance. It also installs global view and tool handlers automatically on the respective objects.</p>
<ulclass="member-list">
<h4>Options:</h4>
<li><tt>options.url: <tt>String</tt></tt>— the url of the source, for source-map generation</li>
<li><tt>options.source: <tt>String</tt></tt>— the source to be used for the source- mapping, in case the code that’s passed in has already been mingled.</li>
<p>Loads, compiles and executes PaperScript code in the HTML document. Note that this method is executed automatically for all scripts in the document through a window load event. You can optionally call it earlier (e.g. from a DOM ready event), or you can mark scripts to be ignored by setting the attribute <code>ignore="true"</code> or <code>data-paper-ignore="true"</code>, and call the <code>PaperScript.load(script)</code> method for each script separately when needed.</p>
<ulclass="member-list">
<h4>Parameters:</h4>
<li>
<tt>script:</tt>
<tt>HTMLScriptElement</tt>
— the script to load. If none is provided, all scripts of the HTML document are iterated over and loaded
— optional, default: <tt>null</tt>
</li>
</ul>
<ulclass="member-list">
<h4>Returns:</h4>
<li>
<tt><ahref="../classes/PaperScope.html"><tt>PaperScope</tt></a></tt> — the scope produced for the passed <code>script</code>, or <code>undefined</code> of multiple scripts area loaded
Copyright © 2011—2023 <ahref="http://www.lehni.org"target="_blank">Jürg Lehni</a>&<ahref="http://www.jonathanpuckey.com"target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>