You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by th...@apache.org on 2019/09/07 01:20:17 UTC

svn commit: r1049752 [4/5] - /websites/production/tapestry/content/5.4.5/coffeescript/

Added: websites/production/tapestry/content/5.4.5/coffeescript/moment.html
==============================================================================
--- websites/production/tapestry/content/5.4.5/coffeescript/moment.html (added)
+++ websites/production/tapestry/content/5.4.5/coffeescript/moment.html Sat Sep  7 01:20:17 2019
@@ -0,0 +1,222 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+  <title>moment.coffee</title>
+  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+  <meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
+  <link rel="stylesheet" media="all" href="docco.css" />
+</head>
+<body>
+  <div id="container">
+    <div id="background"></div>
+    
+      <ul id="jump_to">
+        <li>
+          <a class="large" href="javascript:void(0);">Jump To &hellip;</a>
+          <a class="small" href="javascript:void(0);">+</a>
+          <div id="jump_wrapper">
+          <div id="jump_page">
+            
+              
+              <a class="source" href="beanvalidator-validation.html">
+                beanvalidator-validation.coffee
+              </a>
+            
+              
+              <a class="source" href="ajax.html">
+                ajax.coffee
+              </a>
+            
+              
+              <a class="source" href="ajaxformloop.html">
+                ajaxformloop.coffee
+              </a>
+            
+              
+              <a class="source" href="alert.html">
+                alert.coffee
+              </a>
+            
+              
+              <a class="source" href="autocomplete.html">
+                autocomplete.coffee
+              </a>
+            
+              
+              <a class="source" href="bootstrap.html">
+                bootstrap.coffee
+              </a>
+            
+              
+              <a class="source" href="confirm-click.html">
+                confirm-click.coffee
+              </a>
+            
+              
+              <a class="source" href="console.html">
+                console.coffee
+              </a>
+            
+              
+              <a class="source" href="datefield.html">
+                datefield.coffee
+              </a>
+            
+              
+              <a class="source" href="events.html">
+                events.coffee
+              </a>
+            
+              
+              <a class="source" href="exception-display.html">
+                exception-display.coffee
+              </a>
+            
+              
+              <a class="source" href="exception-frame.html">
+                exception-frame.coffee
+              </a>
+            
+              
+              <a class="source" href="fields.html">
+                fields.coffee
+              </a>
+            
+              
+              <a class="source" href="form-fragment.html">
+                form-fragment.coffee
+              </a>
+            
+              
+              <a class="source" href="forms.html">
+                forms.coffee
+              </a>
+            
+              
+              <a class="source" href="init.html">
+                init.coffee
+              </a>
+            
+              
+              <a class="source" href="localdate.html">
+                localdate.coffee
+              </a>
+            
+              
+              <a class="source" href="messages.html">
+                messages.coffee
+              </a>
+            
+              
+              <a class="source" href="moment.html">
+                moment.coffee
+              </a>
+            
+              
+              <a class="source" href="pageinit.html">
+                pageinit.coffee
+              </a>
+            
+              
+              <a class="source" href="palette.html">
+                palette.coffee
+              </a>
+            
+              
+              <a class="source" href="select.html">
+                select.coffee
+              </a>
+            
+              
+              <a class="source" href="time-interval.html">
+                time-interval.coffee
+              </a>
+            
+              
+              <a class="source" href="tree.html">
+                tree.coffee
+              </a>
+            
+              
+              <a class="source" href="utils.html">
+                utils.coffee
+              </a>
+            
+              
+              <a class="source" href="validation.html">
+                validation.coffee
+              </a>
+            
+              
+              <a class="source" href="zone-refresh.html">
+                zone-refresh.coffee
+              </a>
+            
+              
+              <a class="source" href="zone.html">
+                zone.coffee
+              </a>
+            
+          </div>
+        </li>
+      </ul>
+    
+    <ul class="sections">
+        
+          <li id="title">
+              <div class="annotation">
+                  <h1>moment.coffee</h1>
+              </div>
+          </li>
+        
+        
+        
+        <li id="section-1">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-1">&#182;</a>
+              </div>
+              <p>Copyright 2013 The Apache Software Foundation</p>
+<p>Licensed under the Apache License, Version 2.0 (the “License”);
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at</p>
+<pre><code><span class="hljs-attribute">http</span>:<span class="hljs-comment">#www.apache.org/licenses/LICENSE-2.0</span>
+</code></pre><p>Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an “AS IS” BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.</p>
+
+            </div>
+            
+        </li>
+        
+        
+        <li id="section-2">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-2">&#182;</a>
+              </div>
+              <h2 id="t5-core-moment">t5/core/moment</h2>
+<p>A wrapper around Moment.js; this simply initializes Moment to
+use the correct locale (as per the data-locale attribute of the document element).</p>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre>define [<span class="hljs-string">"moment"</span>],
+<span class="hljs-function"><span class="hljs-params">(moment)</span> -&gt;</span>
+  locale = (<span class="hljs-built_in">document</span>.documentElement.getAttribute <span class="hljs-string">"data-locale"</span>) <span class="hljs-keyword">or</span> <span class="hljs-string">"en"</span>
+
+  moment.locale(locale)
+
+  <span class="hljs-keyword">return</span> moment</pre></div></div>
+            
+        </li>
+        
+    </ul>
+  </div>
+</body>
+</html>

Added: websites/production/tapestry/content/5.4.5/coffeescript/pageinit.html
==============================================================================
--- websites/production/tapestry/content/5.4.5/coffeescript/pageinit.html (added)
+++ websites/production/tapestry/content/5.4.5/coffeescript/pageinit.html Sat Sep  7 01:20:17 2019
@@ -0,0 +1,677 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+  <title>pageinit.coffee</title>
+  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+  <meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
+  <link rel="stylesheet" media="all" href="docco.css" />
+</head>
+<body>
+  <div id="container">
+    <div id="background"></div>
+    
+      <ul id="jump_to">
+        <li>
+          <a class="large" href="javascript:void(0);">Jump To &hellip;</a>
+          <a class="small" href="javascript:void(0);">+</a>
+          <div id="jump_wrapper">
+          <div id="jump_page">
+            
+              
+              <a class="source" href="beanvalidator-validation.html">
+                beanvalidator-validation.coffee
+              </a>
+            
+              
+              <a class="source" href="ajax.html">
+                ajax.coffee
+              </a>
+            
+              
+              <a class="source" href="ajaxformloop.html">
+                ajaxformloop.coffee
+              </a>
+            
+              
+              <a class="source" href="alert.html">
+                alert.coffee
+              </a>
+            
+              
+              <a class="source" href="autocomplete.html">
+                autocomplete.coffee
+              </a>
+            
+              
+              <a class="source" href="bootstrap.html">
+                bootstrap.coffee
+              </a>
+            
+              
+              <a class="source" href="confirm-click.html">
+                confirm-click.coffee
+              </a>
+            
+              
+              <a class="source" href="console.html">
+                console.coffee
+              </a>
+            
+              
+              <a class="source" href="datefield.html">
+                datefield.coffee
+              </a>
+            
+              
+              <a class="source" href="events.html">
+                events.coffee
+              </a>
+            
+              
+              <a class="source" href="exception-display.html">
+                exception-display.coffee
+              </a>
+            
+              
+              <a class="source" href="exception-frame.html">
+                exception-frame.coffee
+              </a>
+            
+              
+              <a class="source" href="fields.html">
+                fields.coffee
+              </a>
+            
+              
+              <a class="source" href="form-fragment.html">
+                form-fragment.coffee
+              </a>
+            
+              
+              <a class="source" href="forms.html">
+                forms.coffee
+              </a>
+            
+              
+              <a class="source" href="init.html">
+                init.coffee
+              </a>
+            
+              
+              <a class="source" href="localdate.html">
+                localdate.coffee
+              </a>
+            
+              
+              <a class="source" href="messages.html">
+                messages.coffee
+              </a>
+            
+              
+              <a class="source" href="moment.html">
+                moment.coffee
+              </a>
+            
+              
+              <a class="source" href="pageinit.html">
+                pageinit.coffee
+              </a>
+            
+              
+              <a class="source" href="palette.html">
+                palette.coffee
+              </a>
+            
+              
+              <a class="source" href="select.html">
+                select.coffee
+              </a>
+            
+              
+              <a class="source" href="time-interval.html">
+                time-interval.coffee
+              </a>
+            
+              
+              <a class="source" href="tree.html">
+                tree.coffee
+              </a>
+            
+              
+              <a class="source" href="utils.html">
+                utils.coffee
+              </a>
+            
+              
+              <a class="source" href="validation.html">
+                validation.coffee
+              </a>
+            
+              
+              <a class="source" href="zone-refresh.html">
+                zone-refresh.coffee
+              </a>
+            
+              
+              <a class="source" href="zone.html">
+                zone.coffee
+              </a>
+            
+          </div>
+        </li>
+      </ul>
+    
+    <ul class="sections">
+        
+          <li id="title">
+              <div class="annotation">
+                  <h1>pageinit.coffee</h1>
+              </div>
+          </li>
+        
+        
+        
+        <li id="section-1">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-1">&#182;</a>
+              </div>
+              <p>Licensed under the Apache License, Version 2.0 (the “License”);
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at</p>
+<pre><code><span class="hljs-attribute">http</span>:<span class="hljs-comment">#www.apache.org/licenses/LICENSE-2.0</span>
+</code></pre><p>Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an “AS IS” BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.</p>
+
+            </div>
+            
+        </li>
+        
+        
+        <li id="section-2">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-2">&#182;</a>
+              </div>
+              <h2 id="t5-core-pageinit">t5/core/pageinit</h2>
+<p>Module that defines functions used for page initialization.
+The initialize function is passed an array of initializers; each initializer is itself
+an array. The first value in the initializer defines the name of the module to invoke.
+The module name may also indicate the function exported by the module, as a suffix following a colon:
+e.g., “my/module:myfunc”.
+Any additional values in the initializer are passed to the function. The context of the function (this) is null.</p>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre>define [<span class="hljs-string">"underscore"</span>, <span class="hljs-string">"./console"</span>, <span class="hljs-string">"./dom"</span>, <span class="hljs-string">"./events"</span>],
+  <span class="hljs-function"><span class="hljs-params">(_, <span class="hljs-built_in">console</span>, dom, events)</span> -&gt;</span>
+    pathPrefix = <span class="hljs-literal">null</span></pre></div></div>
+            
+        </li>
+        
+        
+        <li id="section-3">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-3">&#182;</a>
+              </div>
+              <p>Borrowed from Prototype:</p>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre>    isOpera = Object.prototype.toString.call(<span class="hljs-built_in">window</span>.opera) == <span class="hljs-string">'[object Opera]'</span>
+    isIE = !!<span class="hljs-built_in">window</span>.attachEvent &amp;&amp; !isOpera
+<span class="hljs-function">
+    <span class="hljs-title">rebuildURL</span> = <span class="hljs-params">(path)</span> -&gt;</span>
+      <span class="hljs-keyword">return</span> path <span class="hljs-keyword">if</span> path.match <span class="hljs-regexp">/^https?:/</span></pre></div></div>
+            
+        </li>
+        
+        
+        <li id="section-4">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-4">&#182;</a>
+              </div>
+              <p>See Tapestry.rebuildURL() for an error about the path not starting with a leading ‘/‘
+We’ll assume that doesn’t happen.</p>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre>
+      <span class="hljs-keyword">if</span> !pathPrefix
+        l = <span class="hljs-built_in">window</span>.location
+        pathPrefix = <span class="hljs-string">"<span class="hljs-subst">#{l.protocol}</span>//<span class="hljs-subst">#{l.host}</span>"</span>
+
+      <span class="hljs-keyword">return</span> pathPrefix + path
+
+    rebuildURLOnIE =
+      <span class="hljs-keyword">if</span> isIE <span class="hljs-keyword">then</span> rebuildURL <span class="hljs-keyword">else</span> _.identity
+<span class="hljs-function">
+    <span class="hljs-title">addStylesheets</span> = <span class="hljs-params">(newStylesheets)</span> -&gt;</span>
+      <span class="hljs-keyword">return</span> <span class="hljs-keyword">unless</span> newStylesheets</pre></div></div>
+            
+        </li>
+        
+        
+        <li id="section-5">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-5">&#182;</a>
+              </div>
+              <p>Figure out which stylesheets are loaded; adjust for IE, and especially, IE 9
+which can report a stylesheet’s URL as null (not empty string).</p>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre>      loaded = _.chain(<span class="hljs-built_in">document</span>.styleSheets)
+      .pluck(<span class="hljs-string">"href"</span>)
+      .without(<span class="hljs-string">""</span>)
+      .without(<span class="hljs-literal">null</span>)
+      .map(rebuildURLOnIE)
+
+      insertionPoint = _.find(<span class="hljs-built_in">document</span>.styleSheets, <span class="hljs-function"><span class="hljs-params">(ss)</span> -&gt;</span>
+        parent = ss.ownerNode || ss.owningElement
+        parent.rel <span class="hljs-keyword">is</span> <span class="hljs-string">"stylesheet ajax-insertion-point"</span>)</pre></div></div>
+            
+        </li>
+        
+        
+        <li id="section-6">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-6">&#182;</a>
+              </div>
+              <p>Most browsers support document.head, but older IE doesn’t:</p>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre>      head = <span class="hljs-built_in">document</span>.head <span class="hljs-keyword">or</span> <span class="hljs-built_in">document</span>.getElementsByTagName(<span class="hljs-string">"head"</span>)[<span class="hljs-number">0</span>]
+
+      _.chain(newStylesheets)
+      .map(<span class="hljs-function"><span class="hljs-params">(ss)</span> -&gt;</span> { <span class="hljs-attribute">href</span>: rebuildURL(ss.href), <span class="hljs-attribute">media</span>: ss.media })
+      .reject(<span class="hljs-function"><span class="hljs-params">(ss)</span> -&gt;</span> loaded.contains(ss.href).value())
+      .each(<span class="hljs-function"><span class="hljs-params">(ss)</span> -&gt;</span>
+        element = <span class="hljs-built_in">document</span>.createElement <span class="hljs-string">"link"</span>
+        element.setAttribute <span class="hljs-string">"type"</span>, <span class="hljs-string">"text/css"</span>
+        element.setAttribute <span class="hljs-string">"rel"</span>, <span class="hljs-string">"stylesheet"</span>
+        element.setAttribute <span class="hljs-string">"href"</span>, ss.href
+        <span class="hljs-keyword">if</span> ss.media
+          element.setAttribute <span class="hljs-string">"media"</span>, ss.media
+
+        <span class="hljs-keyword">if</span> insertionPoint
+          head.insertBefore element, insertionPoint.ownerNode
+        <span class="hljs-keyword">else</span>
+          head.appendChild element
+
+        <span class="hljs-built_in">console</span>.debug <span class="hljs-string">"Added stylesheet <span class="hljs-subst">#{ss.href}</span>"</span>
+      )
+
+      <span class="hljs-keyword">return</span>
+<span class="hljs-function">
+    <span class="hljs-title">invokeInitializer</span> = <span class="hljs-params">(tracker, qualifiedName, initArguments)</span> -&gt;</span>
+      [moduleName, functionName] = qualifiedName.split <span class="hljs-string">':'</span>
+
+      <span class="hljs-built_in">require</span> [moduleName], <span class="hljs-function"><span class="hljs-params">(moduleLib)</span> -&gt;</span>
+
+        <span class="hljs-keyword">try</span></pre></div></div>
+            
+        </li>
+        
+        
+        <li id="section-7">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-7">&#182;</a>
+              </div>
+              <p>Some modules export nothing but do some full-page initialization, such as adding
+event handlers to the body.</p>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre>          <span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> functionName <span class="hljs-keyword">and</span>
+            initArguments.length <span class="hljs-keyword">is</span> <span class="hljs-number">0</span> <span class="hljs-keyword">and</span>
+            <span class="hljs-keyword">not</span> _.isFunction moduleLib
+              <span class="hljs-built_in">console</span>.debug <span class="hljs-string">"Loaded module <span class="hljs-subst">#{moduleName}</span>"</span>
+              <span class="hljs-keyword">return</span>
+
+          fn = <span class="hljs-keyword">if</span> functionName? <span class="hljs-keyword">then</span> moduleLib[functionName] <span class="hljs-keyword">else</span> moduleLib
+
+          <span class="hljs-keyword">unless</span> fn?
+            <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> Error <span class="hljs-string">"Could not locate function `<span class="hljs-subst">#{qualifiedName}</span>'."</span>
+
+          <span class="hljs-keyword">if</span> <span class="hljs-built_in">console</span>.debugEnabled
+            argsString = (JSON.stringify arg <span class="hljs-keyword">for</span> arg <span class="hljs-keyword">in</span> initArguments).join(<span class="hljs-string">", "</span>)
+            <span class="hljs-built_in">console</span>.debug <span class="hljs-string">"Invoking <span class="hljs-subst">#{qualifiedName}</span>(<span class="hljs-subst">#{argsString}</span>)"</span>
+
+          fn.apply <span class="hljs-literal">null</span>, initArguments
+        <span class="hljs-keyword">finally</span>
+          tracker()</pre></div></div>
+            
+        </li>
+        
+        
+        <li id="section-8">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-8">&#182;</a>
+              </div>
+              <p>Loads all specified libraries in order (this includes the core stack, other stacks, and
+any free-standing libraries). It then executes the initializations. Once all initializations have
+completed (which is usually an asynchronous operation, as initializations may require the loading
+of further modules), then the <code>data-page-initialized</code> attribute of the <code>&lt;body&gt;</code> element is set to
+‘true’.</p>
+<p>This is the main export of the module; other functions are attached as properties.</p>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre><span class="hljs-function">    <span class="hljs-title">loadLibrariesAndInitialize</span> = <span class="hljs-params">(libraries, inits)</span> -&gt;</span>
+      <span class="hljs-built_in">console</span>.debug <span class="hljs-string">"Loading <span class="hljs-subst">#{libraries?.length <span class="hljs-keyword">or</span> <span class="hljs-number">0</span>}</span> libraries"</span>
+      exports.loadLibraries libraries,
+        <span class="hljs-function">-&gt;</span> exports.initialize inits,
+          <span class="hljs-function">-&gt;</span></pre></div></div>
+            
+        </li>
+        
+        
+        <li id="section-9">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-9">&#182;</a>
+              </div>
+              <p>At this point, all libraries have been loaded, and all inits should have executed. Unless some of
+the inits triggered Ajax updates (such as a core/ProgressiveDisplay component), then the page should
+be ready to go. We set a flag, mostly used by test suites, to ensure that all is ready.
+Later Ajax requests will cause the data-ajax-active attribute to be incremented (from 0)
+and decremented (when the requests complete).</p>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre>
+            dom.body.attr <span class="hljs-string">"data-page-initialized"</span>, <span class="hljs-string">"true"</span>
+
+            <span class="hljs-keyword">for</span> mask <span class="hljs-keyword">in</span> dom.body.find <span class="hljs-string">".pageloading-mask"</span>
+              mask.remove()
+
+    exports = _.extend loadLibrariesAndInitialize,</pre></div></div>
+            
+        </li>
+        
+        
+        <li id="section-10">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-10">&#182;</a>
+              </div>
+              <p>Passed a list of initializers, executes each initializer in order. Due to asynchronous loading
+of modules, the exact order in which initializer functions are invoked is not predictable.</p>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre>      <span class="hljs-attribute">initialize</span>: <span class="hljs-function"><span class="hljs-params">(inits = [], callback)</span> -&gt;</span>
+        <span class="hljs-built_in">console</span>.debug <span class="hljs-string">"Executing <span class="hljs-subst">#{inits.length}</span> inits"</span>
+        callbackCountdown = inits.length + <span class="hljs-number">1</span></pre></div></div>
+            
+        </li>
+        
+        
+        <li id="section-11">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-11">&#182;</a>
+              </div>
+              <p>tracker gets invoked once after each require/callback, plus once extra
+(to handle the case where there are no inits). When the count hits zero,
+it invokes the callback (if there is one).</p>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre><span class="hljs-function">        <span class="hljs-title">tracker</span> = -&gt;</span>
+          callbackCountdown--
+
+          <span class="hljs-keyword">if</span> callbackCountdown <span class="hljs-keyword">is</span> <span class="hljs-number">0</span>
+            <span class="hljs-built_in">console</span>.debug <span class="hljs-string">"All inits executed"</span>
+            callback() <span class="hljs-keyword">if</span> callback</pre></div></div>
+            
+        </li>
+        
+        
+        <li id="section-12">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-12">&#182;</a>
+              </div>
+              <p>First value in each init is the qualified module name; anything after
+that are arguments to be passed to the identified function. A string
+is the name of a module to load, or function to invoke, that
+takes no parameters.</p>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre>        <span class="hljs-keyword">for</span> init <span class="hljs-keyword">in</span> inits
+          <span class="hljs-keyword">if</span> _.isString init
+            invokeInitializer tracker, init, []
+          <span class="hljs-keyword">else</span>
+            [qualifiedName, initArguments...] = init
+            invokeInitializer tracker, qualifiedName, initArguments
+
+        tracker()</pre></div></div>
+            
+        </li>
+        
+        
+        <li id="section-13">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-13">&#182;</a>
+              </div>
+              <p>Pre-loads a number of libraries in order. When the last library is loaded,
+invokes the callback (with no parameters).</p>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre>      <span class="hljs-attribute">loadLibraries</span>: <span class="hljs-function"><span class="hljs-params">(libraries, callback)</span> -&gt;</span>
+<span class="hljs-function">        <span class="hljs-title">reducer</span> = <span class="hljs-params">(callback, library)</span> -&gt;</span> -&gt;
+          <span class="hljs-built_in">console</span>.debug <span class="hljs-string">"Loading library <span class="hljs-subst">#{library}</span>"</span>
+          <span class="hljs-built_in">require</span> [library], callback
+
+        finalCallback = _.reduceRight libraries, reducer, callback
+
+        finalCallback.call <span class="hljs-literal">null</span>
+
+      <span class="hljs-attribute">evalJavaScript</span>: <span class="hljs-function"><span class="hljs-params">(js)</span> -&gt;</span>
+        <span class="hljs-built_in">console</span>.debug <span class="hljs-string">"Evaluating: <span class="hljs-subst">#{js}</span>"</span>
+        eval js</pre></div></div>
+            
+        </li>
+        
+        
+        <li id="section-14">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-14">&#182;</a>
+              </div>
+              <p>Triggers the focus event on the field, if the field exist. Focus occurs delayed 1/8th of a
+second, which helps ensure that other initializions on the page are in place.</p>
+<ul>
+<li>fieldId - element id of field to focus on</li>
+</ul>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre>      <span class="hljs-attribute">focus</span>: <span class="hljs-function"><span class="hljs-params">(fieldId)</span> -&gt;</span>
+        field = dom fieldId
+
+        <span class="hljs-keyword">if</span> field
+          _.delay (<span class="hljs-function">-&gt;</span> field.focus()), <span class="hljs-number">125</span></pre></div></div>
+            
+        </li>
+        
+        
+        <li id="section-15">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-15">&#182;</a>
+              </div>
+              <p>Passed the response from an Ajax request, when the request is successful.
+This is used for any request that attaches partial-page-render data to the main JSON object
+response.  If no such data is attached, the callback is simply invoked immediately.
+Otherwise, Tapestry processes the partial-page-render data. This may involve loading some number
+of JavaScript libraries and CSS style sheets, and a number of direct updates to the DOM. After DOM updates,
+the callback is invoked, passed the response (with any Tapestry-specific data removed).
+After the callback is invoked, page initializations occur.  This method returns null.</p>
+
+            </div>
+            
+        </li>
+        
+        
+        <li id="section-16">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-16">&#182;</a>
+              </div>
+              <ul>
+<li>response - the Ajax response object</li>
+<li>callback - invoked after scripts are loaded, but before page initializations occur (may be null)</li>
+</ul>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre>      <span class="hljs-attribute">handlePartialPageRenderResponse</span>: <span class="hljs-function"><span class="hljs-params">(response, callback)</span> -&gt;</span></pre></div></div>
+            
+        </li>
+        
+        
+        <li id="section-17">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-17">&#182;</a>
+              </div>
+              <p>Capture the partial page response portion of the overall response, and
+then remove it so it doesn’t interfere elsewhere.</p>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre>        responseJSON = response.json <span class="hljs-keyword">or</span> {}
+        partial = responseJSON._tapestry
+        <span class="hljs-keyword">delete</span> responseJSON._tapestry</pre></div></div>
+            
+        </li>
+        
+        
+        <li id="section-18">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-18">&#182;</a>
+              </div>
+              <p>Extreme case: the data has a redirectURL which forces an immediate redirect to the URL.
+No other initialization or callback invocation occurs.</p>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre>        <span class="hljs-keyword">if</span> partial?.redirectURL
+          <span class="hljs-keyword">if</span> <span class="hljs-built_in">window</span>.location.href <span class="hljs-keyword">is</span> partial.redirectURL
+            <span class="hljs-built_in">window</span>.location.reload <span class="hljs-literal">true</span>
+          <span class="hljs-keyword">else</span>
+            <span class="hljs-built_in">window</span>.location.href = partial.redirectURL
+          <span class="hljs-keyword">return</span>
+
+        addStylesheets partial?.stylesheets</pre></div></div>
+            
+        </li>
+        
+        
+        <li id="section-19">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-19">&#182;</a>
+              </div>
+              <p>Make sure all libraries are loaded</p>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre>        exports.loadLibraries partial?.libraries, <span class="hljs-function">-&gt;</span></pre></div></div>
+            
+        </li>
+        
+        
+        <li id="section-20">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-20">&#182;</a>
+              </div>
+              <p>After libraries are loaded, update each zone:</p>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre>          _(partial?.content).each ([id, content]) -&gt;
+            <span class="hljs-built_in">console</span>.debug <span class="hljs-string">"Updating content for zone <span class="hljs-subst">#{id}</span>"</span>
+
+            zone = dom.wrap id
+
+            <span class="hljs-keyword">if</span> zone
+              zone.trigger events.zone.update, { content }</pre></div></div>
+            
+        </li>
+        
+        
+        <li id="section-21">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-21">&#182;</a>
+              </div>
+              <p>Invoke the callback, if present.  The callback may do its own content updates.</p>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre>          callback <span class="hljs-keyword">and</span> callback(response)</pre></div></div>
+            
+        </li>
+        
+        
+        <li id="section-22">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-22">&#182;</a>
+              </div>
+              <p>Lastly, perform initializations from the partial page render response.</p>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre>          exports.initialize partial?.inits
+
+        <span class="hljs-keyword">return</span></pre></div></div>
+            
+        </li>
+        
+    </ul>
+  </div>
+</body>
+</html>

Added: websites/production/tapestry/content/5.4.5/coffeescript/palette.html
==============================================================================
--- websites/production/tapestry/content/5.4.5/coffeescript/palette.html (added)
+++ websites/production/tapestry/content/5.4.5/coffeescript/palette.html Sat Sep  7 01:20:17 2019
@@ -0,0 +1,658 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+  <title>palette.coffee</title>
+  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+  <meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
+  <link rel="stylesheet" media="all" href="docco.css" />
+</head>
+<body>
+  <div id="container">
+    <div id="background"></div>
+    
+      <ul id="jump_to">
+        <li>
+          <a class="large" href="javascript:void(0);">Jump To &hellip;</a>
+          <a class="small" href="javascript:void(0);">+</a>
+          <div id="jump_wrapper">
+          <div id="jump_page">
+            
+              
+              <a class="source" href="beanvalidator-validation.html">
+                beanvalidator-validation.coffee
+              </a>
+            
+              
+              <a class="source" href="ajax.html">
+                ajax.coffee
+              </a>
+            
+              
+              <a class="source" href="ajaxformloop.html">
+                ajaxformloop.coffee
+              </a>
+            
+              
+              <a class="source" href="alert.html">
+                alert.coffee
+              </a>
+            
+              
+              <a class="source" href="autocomplete.html">
+                autocomplete.coffee
+              </a>
+            
+              
+              <a class="source" href="bootstrap.html">
+                bootstrap.coffee
+              </a>
+            
+              
+              <a class="source" href="confirm-click.html">
+                confirm-click.coffee
+              </a>
+            
+              
+              <a class="source" href="console.html">
+                console.coffee
+              </a>
+            
+              
+              <a class="source" href="datefield.html">
+                datefield.coffee
+              </a>
+            
+              
+              <a class="source" href="events.html">
+                events.coffee
+              </a>
+            
+              
+              <a class="source" href="exception-display.html">
+                exception-display.coffee
+              </a>
+            
+              
+              <a class="source" href="exception-frame.html">
+                exception-frame.coffee
+              </a>
+            
+              
+              <a class="source" href="fields.html">
+                fields.coffee
+              </a>
+            
+              
+              <a class="source" href="form-fragment.html">
+                form-fragment.coffee
+              </a>
+            
+              
+              <a class="source" href="forms.html">
+                forms.coffee
+              </a>
+            
+              
+              <a class="source" href="init.html">
+                init.coffee
+              </a>
+            
+              
+              <a class="source" href="localdate.html">
+                localdate.coffee
+              </a>
+            
+              
+              <a class="source" href="messages.html">
+                messages.coffee
+              </a>
+            
+              
+              <a class="source" href="moment.html">
+                moment.coffee
+              </a>
+            
+              
+              <a class="source" href="pageinit.html">
+                pageinit.coffee
+              </a>
+            
+              
+              <a class="source" href="palette.html">
+                palette.coffee
+              </a>
+            
+              
+              <a class="source" href="select.html">
+                select.coffee
+              </a>
+            
+              
+              <a class="source" href="time-interval.html">
+                time-interval.coffee
+              </a>
+            
+              
+              <a class="source" href="tree.html">
+                tree.coffee
+              </a>
+            
+              
+              <a class="source" href="utils.html">
+                utils.coffee
+              </a>
+            
+              
+              <a class="source" href="validation.html">
+                validation.coffee
+              </a>
+            
+              
+              <a class="source" href="zone-refresh.html">
+                zone-refresh.coffee
+              </a>
+            
+              
+              <a class="source" href="zone.html">
+                zone.coffee
+              </a>
+            
+          </div>
+        </li>
+      </ul>
+    
+    <ul class="sections">
+        
+          <li id="title">
+              <div class="annotation">
+                  <h1>palette.coffee</h1>
+              </div>
+          </li>
+        
+        
+        
+        <li id="section-1">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-1">&#182;</a>
+              </div>
+              <p>Copyright 2012-2013 The Apache Software Foundation</p>
+<p>Licensed under the Apache License, Version 2.0 (the “License”);
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at</p>
+<pre><code><span class="hljs-attribute">http</span>:<span class="hljs-comment">#www.apache.org/licenses/LICENSE-2.0</span>
+</code></pre><p>Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an “AS IS” BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.</p>
+
+            </div>
+            
+        </li>
+        
+        
+        <li id="section-2">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-2">&#182;</a>
+              </div>
+              <h2 id="t5-core-palette">t5/core/palette</h2>
+<p>Support for the <code>core/Palette</code> component.</p>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre>define [<span class="hljs-string">"./dom"</span>, <span class="hljs-string">"underscore"</span>, <span class="hljs-string">"./events"</span>],
+  <span class="hljs-function"><span class="hljs-params">(dom, _, events)</span> -&gt;</span>
+<span class="hljs-function">
+    <span class="hljs-title">isSelected</span> = <span class="hljs-params">(option)</span> -&gt;</span> option.selected
+
+    <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">PaletteController</span></span>
+
+      <span class="hljs-attribute">constructor</span>: <span class="hljs-function"><span class="hljs-params">(id)</span> -&gt;</span>
+        <span class="hljs-property">@selected</span> = (dom id)
+        <span class="hljs-property">@container</span> = <span class="hljs-property">@selected</span>.findParent <span class="hljs-string">".palette"</span>
+        <span class="hljs-property">@available</span> = <span class="hljs-property">@container</span>.findFirst <span class="hljs-string">".palette-available select"</span>
+        <span class="hljs-property">@hidden</span> = <span class="hljs-property">@container</span>.findFirst <span class="hljs-string">"input[type=hidden]"</span>
+
+        <span class="hljs-property">@select</span> = <span class="hljs-property">@container</span>.findFirst <span class="hljs-string">"[data-action=select]"</span>
+        <span class="hljs-property">@deselect</span> = <span class="hljs-property">@container</span>.findFirst <span class="hljs-string">"[data-action=deselect]"</span>
+
+        <span class="hljs-property">@moveUp</span> = <span class="hljs-property">@container</span>.findFirst <span class="hljs-string">"[data-action=move-up]"</span>
+        <span class="hljs-property">@moveDown</span> = <span class="hljs-property">@container</span>.findFirst <span class="hljs-string">"[data-action=move-down]"</span></pre></div></div>
+            
+        </li>
+        
+        
+        <li id="section-3">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-3">&#182;</a>
+              </div>
+              <p>Track where reorder is allowed based on whether the buttons actually exist</p>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre>        <span class="hljs-property">@reorder</span> = <span class="hljs-property">@moveUp</span> <span class="hljs-keyword">isnt</span> <span class="hljs-literal">null</span>
+
+        <span class="hljs-property">@valueToOrderIndex</span> = {}
+
+        <span class="hljs-keyword">for</span> option,i <span class="hljs-keyword">in</span> <span class="hljs-property">@available</span>.element.options
+          <span class="hljs-property">@valueToOrderIndex</span>[option.value] = i</pre></div></div>
+            
+        </li>
+        
+        
+        <li id="section-4">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-4">&#182;</a>
+              </div>
+              <p>This occurs even when the palette is disabled, to present the
+values correctly. Otherwise it looks like nothing is selected.</p>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre>        <span class="hljs-property">@initialTransfer</span>()
+
+        <span class="hljs-keyword">unless</span> <span class="hljs-property">@selected</span>.element.disabled
+          <span class="hljs-property">@updateButtons</span>()
+          <span class="hljs-property">@bindEvents</span>()
+
+      <span class="hljs-attribute">initialTransfer</span>: <span class="hljs-function">-&gt;</span></pre></div></div>
+            
+        </li>
+        
+        
+        <li id="section-5">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-5">&#182;</a>
+              </div>
+              <p>Get the values for options that should move over</p>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre>        values = JSON.parse <span class="hljs-property">@hidden</span>.value()
+        valueToPosition = {}
+
+        <span class="hljs-keyword">for</span> v, i <span class="hljs-keyword">in</span> values
+          valueToPosition[v] = i
+
+        e = <span class="hljs-property">@available</span>.element
+
+        movers = []
+
+        <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> [(e.options.length - <span class="hljs-number">1</span>).<span class="hljs-number">.0</span>] <span class="hljs-keyword">by</span> -<span class="hljs-number">1</span>
+          option = e.options[i]
+          value = option.value
+          pos = valueToPosition[value]
+          <span class="hljs-keyword">unless</span> pos <span class="hljs-keyword">is</span> <span class="hljs-literal">undefined</span>
+            movers[pos] = option
+            e.remove i
+
+        <span class="hljs-keyword">for</span> option <span class="hljs-keyword">in</span> movers
+          <span class="hljs-property">@selected</span>.element.add option</pre></div></div>
+            
+        </li>
+        
+        
+        <li id="section-6">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-6">&#182;</a>
+              </div>
+              <p>Invoked after any change to the selections list to update the hidden field as well as the
+buttons’ state.</p>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre>      <span class="hljs-attribute">updateAfterChange</span>: <span class="hljs-function">-&gt;</span>
+        <span class="hljs-property">@updateHidden</span>()
+        <span class="hljs-property">@updateButtons</span>()
+
+      <span class="hljs-attribute">updateHidden</span>: <span class="hljs-function">-&gt;</span>
+        values = (option.value <span class="hljs-keyword">for</span> option <span class="hljs-keyword">in</span> <span class="hljs-property">@selected</span>.element.options)
+        <span class="hljs-property">@hidden</span>.value JSON.stringify values
+
+      <span class="hljs-attribute">bindEvents</span>: <span class="hljs-function">-&gt;</span>
+        <span class="hljs-property">@container</span>.<span class="hljs-literal">on</span> <span class="hljs-string">"change"</span>, <span class="hljs-string">"select"</span>, <span class="hljs-function">=&gt;</span>
+          <span class="hljs-property">@updateButtons</span>()
+          <span class="hljs-keyword">return</span> <span class="hljs-literal">false</span>
+
+        <span class="hljs-property">@select</span>.<span class="hljs-literal">on</span> <span class="hljs-string">"click"</span>, <span class="hljs-function">=&gt;</span>
+          <span class="hljs-property">@doSelect</span>()
+          <span class="hljs-keyword">return</span> <span class="hljs-literal">false</span>
+
+        <span class="hljs-property">@available</span>.<span class="hljs-literal">on</span> <span class="hljs-string">"dblclick"</span>, <span class="hljs-function">=&gt;</span>
+          <span class="hljs-property">@doSelect</span>()
+          <span class="hljs-keyword">return</span> <span class="hljs-literal">false</span>
+
+        <span class="hljs-property">@deselect</span>.<span class="hljs-literal">on</span> <span class="hljs-string">"click"</span>, <span class="hljs-function">=&gt;</span>
+          <span class="hljs-property">@doDeselect</span>()
+          <span class="hljs-keyword">return</span> <span class="hljs-literal">false</span>
+
+        <span class="hljs-property">@selected</span>.<span class="hljs-literal">on</span> <span class="hljs-string">"dblclick"</span>, <span class="hljs-function">=&gt;</span>
+          <span class="hljs-property">@doDeselect</span>()
+          <span class="hljs-keyword">return</span> <span class="hljs-literal">false</span>
+
+        <span class="hljs-keyword">if</span> <span class="hljs-property">@reorder</span>
+          <span class="hljs-property">@moveUp</span>.<span class="hljs-literal">on</span> <span class="hljs-string">"click"</span>, <span class="hljs-function">=&gt;</span>
+            <span class="hljs-property">@doMoveUp</span>()
+            <span class="hljs-keyword">return</span> <span class="hljs-literal">false</span>
+
+          <span class="hljs-property">@moveDown</span>.<span class="hljs-literal">on</span> <span class="hljs-string">"click"</span>, <span class="hljs-function">=&gt;</span>
+            <span class="hljs-property">@doMoveDown</span>()
+            <span class="hljs-keyword">return</span> <span class="hljs-literal">false</span></pre></div></div>
+            
+        </li>
+        
+        
+        <li id="section-7">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-7">&#182;</a>
+              </div>
+              <p>Invoked whenever the selections in either list changes or after an updates; figures out which buttons
+should be enabled and which disabled.</p>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre>      <span class="hljs-attribute">updateButtons</span>: <span class="hljs-function">-&gt;</span>
+        <span class="hljs-property">@select</span>.element.disabled = <span class="hljs-property">@available</span>.element.selectedIndex &lt; <span class="hljs-number">0</span>
+
+        nothingSelected = <span class="hljs-property">@selected</span>.element.selectedIndex &lt; <span class="hljs-number">0</span>
+
+        <span class="hljs-property">@deselect</span>.element.disabled = nothingSelected
+
+        <span class="hljs-keyword">if</span> <span class="hljs-property">@reorder</span>
+          <span class="hljs-property">@moveUp</span>.element.disabled = nothingSelected <span class="hljs-keyword">or</span> <span class="hljs-property">@allSelectionsAtTop</span>()
+          <span class="hljs-property">@moveDown</span>.element.disabled = nothingSelected <span class="hljs-keyword">or</span> <span class="hljs-property">@allSelectionsAtBottom</span>()
+
+      <span class="hljs-attribute">doSelect</span>: <span class="hljs-function">-&gt;</span> <span class="hljs-property">@transferOptions</span> <span class="hljs-property">@available</span>, <span class="hljs-property">@selected</span>, <span class="hljs-property">@reorder</span>
+
+      <span class="hljs-attribute">doDeselect</span>: <span class="hljs-function">-&gt;</span> <span class="hljs-property">@transferOptions</span> <span class="hljs-property">@selected</span>, <span class="hljs-property">@available</span>, <span class="hljs-literal">false</span>
+
+      <span class="hljs-attribute">doMoveUp</span>: <span class="hljs-function">-&gt;</span>
+        options = _.toArray <span class="hljs-property">@selected</span>.element.options
+
+        groups = _.partition options, isSelected
+
+        movers = groups[<span class="hljs-number">0</span>]</pre></div></div>
+            
+        </li>
+        
+        
+        <li id="section-8">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-8">&#182;</a>
+              </div>
+              <p>The element before the first selected element is the pivot; all the selected elements will
+move before the pivot. If there is no pivot, the elements are shifted to the front of the list.</p>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre>        firstMoverIndex = _.first(movers).index
+        pivot = options[firstMoverIndex - <span class="hljs-number">1</span>]
+
+        options = groups[<span class="hljs-number">1</span>]
+
+        splicePos = <span class="hljs-keyword">if</span> pivot <span class="hljs-keyword">then</span> _.indexOf options, pivot <span class="hljs-keyword">else</span> <span class="hljs-number">0</span>
+
+        movers.reverse()
+
+        <span class="hljs-keyword">for</span> o <span class="hljs-keyword">in</span> movers
+          options.splice splicePos, <span class="hljs-number">0</span>, o
+
+        <span class="hljs-property">@reorderSelected</span> options
+
+
+      <span class="hljs-attribute">doMoveDown</span>: <span class="hljs-function">-&gt;</span>
+        options = _.toArray <span class="hljs-property">@selected</span>.element.options
+
+        groups = _.partition options, isSelected
+
+        movers = groups[<span class="hljs-number">0</span>]</pre></div></div>
+            
+        </li>
+        
+        
+        <li id="section-9">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-9">&#182;</a>
+              </div>
+              <p>The element after the last selected element is the pivot; all the selected elements will
+move after the pivot. If there is no pivot, the elements are shifted to the end of the list.</p>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre>        lastMoverIndex = movers[-<span class="hljs-number">1.</span>.-<span class="hljs-number">1</span>][<span class="hljs-number">0</span>].index
+        pivot = options[lastMoverIndex + <span class="hljs-number">1</span>]
+
+        options = groups[<span class="hljs-number">1</span>]
+
+        splicePos = <span class="hljs-keyword">if</span> pivot <span class="hljs-keyword">then</span> _.indexOf(options, pivot) + <span class="hljs-number">1</span> <span class="hljs-keyword">else</span> options.length
+
+        movers.reverse()
+
+        <span class="hljs-keyword">for</span> o <span class="hljs-keyword">in</span> movers
+          options.splice splicePos, <span class="hljs-number">0</span>, o
+
+        <span class="hljs-property">@reorderSelected</span> options</pre></div></div>
+            
+        </li>
+        
+        
+        <li id="section-10">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-10">&#182;</a>
+              </div>
+              <p>Reorders the selected options to the provided list of options; handles triggering the willUpdate and
+didUpdate events.</p>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre>      <span class="hljs-attribute">reorderSelected</span>: <span class="hljs-function"><span class="hljs-params">(options)</span> -&gt;</span>
+
+        <span class="hljs-property">@performUpdate</span> <span class="hljs-literal">true</span>, options, <span class="hljs-function">=&gt;</span>
+
+          <span class="hljs-property">@deleteOptions</span> <span class="hljs-property">@selected</span>
+
+          <span class="hljs-keyword">for</span> o <span class="hljs-keyword">in</span> options
+            <span class="hljs-property">@selected</span>.element.add o, <span class="hljs-literal">null</span></pre></div></div>
+            
+        </li>
+        
+        
+        <li id="section-11">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-11">&#182;</a>
+              </div>
+              <p>Performs the update, which includes the willChange and didChange events.</p>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre>      <span class="hljs-attribute">performUpdate</span>: <span class="hljs-function"><span class="hljs-params">(reorder, selectedOptions, updateCallback)</span> -&gt;</span>
+
+        canceled = <span class="hljs-literal">false</span>
+<span class="hljs-function">
+        <span class="hljs-title">doUpdate</span> = =&gt;</span>
+          updateCallback()
+
+          <span class="hljs-property">@selected</span>.trigger events.palette.didChange, { selectedOptions, reorder }
+
+          <span class="hljs-property">@updateAfterChange</span>()
+
+        memo =
+          <span class="hljs-attribute">selectedOptions</span>: selectedOptions
+          <span class="hljs-attribute">reorder</span>: reorder
+          <span class="hljs-attribute">cancel</span>: <span class="hljs-function">-&gt;</span> canceled = <span class="hljs-literal">true</span>
+          <span class="hljs-attribute">defer</span>: <span class="hljs-function">-&gt;</span>
+            canceled = <span class="hljs-literal">true</span>
+            <span class="hljs-keyword">return</span> doUpdate
+
+        <span class="hljs-property">@selected</span>.trigger events.palette.willChange, memo
+
+        doUpdate() <span class="hljs-keyword">unless</span> canceled</pre></div></div>
+            
+        </li>
+        
+        
+        <li id="section-12">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-12">&#182;</a>
+              </div>
+              <p>Deletes all options from a select (an ElementWrapper), prior to new options being populated in.</p>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre>      <span class="hljs-attribute">deleteOptions</span>: <span class="hljs-function"><span class="hljs-params">(select)</span> -&gt;</span>
+
+        e = select.element
+
+        <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> [(e.length - <span class="hljs-number">1</span>).<span class="hljs-number">.0</span>] <span class="hljs-keyword">by</span> -<span class="hljs-number">1</span>
+          e.remove i</pre></div></div>
+            
+        </li>
+        
+        
+        <li id="section-13">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-13">&#182;</a>
+              </div>
+              <p>Moves options between the available and selected lists, including event notifiations before and after.</p>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre>      <span class="hljs-attribute">transferOptions</span>: <span class="hljs-function"><span class="hljs-params">(from, to, atEnd)</span> -&gt;</span>
+
+        <span class="hljs-keyword">if</span> from.element.selectedIndex <span class="hljs-keyword">is</span> -<span class="hljs-number">1</span>
+          <span class="hljs-keyword">return</span></pre></div></div>
+            
+        </li>
+        
+        
+        <li id="section-14">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-14">&#182;</a>
+              </div>
+              <p>This could be done in a single pass, but:</p>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre>        movers = _.filter from.element.options, isSelected
+        fromOptions = _.reject from.element.options, isSelected
+
+        toOptions = _.toArray to.element.options
+
+        <span class="hljs-keyword">for</span> o <span class="hljs-keyword">in</span> movers
+          <span class="hljs-property">@insertOption</span> toOptions, o, atEnd
+
+        selectedOptions = <span class="hljs-keyword">if</span> to <span class="hljs-keyword">is</span> <span class="hljs-property">@selected</span> <span class="hljs-keyword">then</span> toOptions <span class="hljs-keyword">else</span> fromOptions
+
+        <span class="hljs-property">@performUpdate</span> <span class="hljs-literal">false</span>, selectedOptions, <span class="hljs-function">=&gt;</span>
+          <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> [(from.element.length - <span class="hljs-number">1</span>).<span class="hljs-number">.0</span>] <span class="hljs-keyword">by</span> -<span class="hljs-number">1</span>
+            <span class="hljs-keyword">if</span> from.element.options[i].selected
+              from.element.remove i</pre></div></div>
+            
+        </li>
+        
+        
+        <li id="section-15">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-15">&#182;</a>
+              </div>
+              <p>A bit ugly: update the to select by removing all, then adding back in.</p>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre>
+          <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> [(to.element.length - <span class="hljs-number">1</span>).<span class="hljs-number">.0</span>] <span class="hljs-keyword">by</span> -<span class="hljs-number">1</span>
+            to.element.options[i].selected = <span class="hljs-literal">false</span>
+            to.element.remove i
+
+          <span class="hljs-keyword">for</span> o <span class="hljs-keyword">in</span> toOptions
+            to.element.add o, <span class="hljs-literal">null</span>
+
+      <span class="hljs-attribute">insertOption</span>: <span class="hljs-function"><span class="hljs-params">(options, option, atEnd)</span> -&gt;</span>
+
+        <span class="hljs-keyword">unless</span> atEnd
+          optionOrder = <span class="hljs-property">@valueToOrderIndex</span>[option.value]
+          before = _.find options, <span class="hljs-function"><span class="hljs-params">(o)</span> =&gt;</span> <span class="hljs-property">@valueToOrderIndex</span>[o.value] &gt; optionOrder
+
+        <span class="hljs-keyword">if</span> before
+          i = _.indexOf options, before
+          options.splice i, <span class="hljs-number">0</span>, option
+        <span class="hljs-keyword">else</span>
+          options.push option
+
+
+      <span class="hljs-attribute">indexOfLastSelection</span>: <span class="hljs-function"><span class="hljs-params">(select)</span> -&gt;</span>
+        e = select.element
+        <span class="hljs-keyword">if</span> e.selectedIndex &lt; <span class="hljs-number">0</span>
+          <span class="hljs-keyword">return</span> -<span class="hljs-number">1</span>
+
+        <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> [(e.options.length - <span class="hljs-number">1</span>)..(e.selectedIndex)] <span class="hljs-keyword">by</span> -<span class="hljs-number">1</span>
+          <span class="hljs-keyword">if</span> e.options[i].selected
+            <span class="hljs-keyword">return</span> i
+
+        <span class="hljs-keyword">return</span> -<span class="hljs-number">1</span>
+
+      <span class="hljs-attribute">allSelectionsAtTop</span>: <span class="hljs-function">-&gt;</span>
+        last = <span class="hljs-property">@indexOfLastSelection</span> <span class="hljs-property">@selected</span>
+        options = _.toArray <span class="hljs-property">@selected</span>.element.options
+
+        _(options[<span class="hljs-number">0.</span>.last]).all (o) -&gt; o.selected
+
+      <span class="hljs-attribute">allSelectionsAtBottom</span>: <span class="hljs-function">-&gt;</span>
+        e = <span class="hljs-property">@selected</span>.element
+        last = e.selectedIndex
+        options = _.toArray e.options
+
+        _(options[last..]).all (o) -&gt; o.selected</pre></div></div>
+            
+        </li>
+        
+        
+        <li id="section-16">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-16">&#182;</a>
+              </div>
+              <p>Export just the initializer function</p>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre>    (id) -&gt; <span class="hljs-keyword">new</span> PaletteController(id)</pre></div></div>
+            
+        </li>
+        
+    </ul>
+  </div>
+</body>
+</html>

Added: websites/production/tapestry/content/5.4.5/coffeescript/select.html
==============================================================================
--- websites/production/tapestry/content/5.4.5/coffeescript/select.html (added)
+++ websites/production/tapestry/content/5.4.5/coffeescript/select.html Sat Sep  7 01:20:17 2019
@@ -0,0 +1,230 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+  <title>select.coffee</title>
+  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+  <meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
+  <link rel="stylesheet" media="all" href="docco.css" />
+</head>
+<body>
+  <div id="container">
+    <div id="background"></div>
+    
+      <ul id="jump_to">
+        <li>
+          <a class="large" href="javascript:void(0);">Jump To &hellip;</a>
+          <a class="small" href="javascript:void(0);">+</a>
+          <div id="jump_wrapper">
+          <div id="jump_page">
+            
+              
+              <a class="source" href="beanvalidator-validation.html">
+                beanvalidator-validation.coffee
+              </a>
+            
+              
+              <a class="source" href="ajax.html">
+                ajax.coffee
+              </a>
+            
+              
+              <a class="source" href="ajaxformloop.html">
+                ajaxformloop.coffee
+              </a>
+            
+              
+              <a class="source" href="alert.html">
+                alert.coffee
+              </a>
+            
+              
+              <a class="source" href="autocomplete.html">
+                autocomplete.coffee
+              </a>
+            
+              
+              <a class="source" href="bootstrap.html">
+                bootstrap.coffee
+              </a>
+            
+              
+              <a class="source" href="confirm-click.html">
+                confirm-click.coffee
+              </a>
+            
+              
+              <a class="source" href="console.html">
+                console.coffee
+              </a>
+            
+              
+              <a class="source" href="datefield.html">
+                datefield.coffee
+              </a>
+            
+              
+              <a class="source" href="events.html">
+                events.coffee
+              </a>
+            
+              
+              <a class="source" href="exception-display.html">
+                exception-display.coffee
+              </a>
+            
+              
+              <a class="source" href="exception-frame.html">
+                exception-frame.coffee
+              </a>
+            
+              
+              <a class="source" href="fields.html">
+                fields.coffee
+              </a>
+            
+              
+              <a class="source" href="form-fragment.html">
+                form-fragment.coffee
+              </a>
+            
+              
+              <a class="source" href="forms.html">
+                forms.coffee
+              </a>
+            
+              
+              <a class="source" href="init.html">
+                init.coffee
+              </a>
+            
+              
+              <a class="source" href="localdate.html">
+                localdate.coffee
+              </a>
+            
+              
+              <a class="source" href="messages.html">
+                messages.coffee
+              </a>
+            
+              
+              <a class="source" href="moment.html">
+                moment.coffee
+              </a>
+            
+              
+              <a class="source" href="pageinit.html">
+                pageinit.coffee
+              </a>
+            
+              
+              <a class="source" href="palette.html">
+                palette.coffee
+              </a>
+            
+              
+              <a class="source" href="select.html">
+                select.coffee
+              </a>
+            
+              
+              <a class="source" href="time-interval.html">
+                time-interval.coffee
+              </a>
+            
+              
+              <a class="source" href="tree.html">
+                tree.coffee
+              </a>
+            
+              
+              <a class="source" href="utils.html">
+                utils.coffee
+              </a>
+            
+              
+              <a class="source" href="validation.html">
+                validation.coffee
+              </a>
+            
+              
+              <a class="source" href="zone-refresh.html">
+                zone-refresh.coffee
+              </a>
+            
+              
+              <a class="source" href="zone.html">
+                zone.coffee
+              </a>
+            
+          </div>
+        </li>
+      </ul>
+    
+    <ul class="sections">
+        
+          <li id="title">
+              <div class="annotation">
+                  <h1>select.coffee</h1>
+              </div>
+          </li>
+        
+        
+        
+        <li id="section-1">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-1">&#182;</a>
+              </div>
+              <p>Licensed under the Apache License, Version 2.0 (the “License”);
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at</p>
+<pre><code><span class="hljs-attribute">http</span>:<span class="hljs-comment">#www.apache.org/licenses/LICENSE-2.0</span>
+</code></pre><p>Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an “AS IS” BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.</p>
+
+            </div>
+            
+        </li>
+        
+        
+        <li id="section-2">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-2">&#182;</a>
+              </div>
+              <h2 id="t5-core-select">t5/core/select</h2>
+<p>Provides a document event handler that triggers an update a zone when the value
+of a select element within the zone changes.</p>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre>define [<span class="hljs-string">"./events"</span>, <span class="hljs-string">"./dom"</span>, <span class="hljs-string">"./zone"</span>],
+
+  <span class="hljs-function"><span class="hljs-params">(events, dom, zone)</span> -&gt;</span>
+
+    dom.onDocument <span class="hljs-string">"change"</span>, <span class="hljs-string">"select[data-update-zone]"</span>, <span class="hljs-function">-&gt;</span>
+
+      containingZone = zone.findZone <span class="hljs-keyword">this</span>
+
+      <span class="hljs-keyword">if</span> containingZone
+        containingZone.trigger events.zone.refresh,
+          <span class="hljs-attribute">url</span>: <span class="hljs-property">@attr</span> <span class="hljs-string">"data-update-url"</span>
+          <span class="hljs-attribute">parameters</span>:
+            <span class="hljs-string">"t:selectvalue"</span>: <span class="hljs-property">@value</span>()
+
+      <span class="hljs-keyword">return</span>
+    <span class="hljs-keyword">return</span></pre></div></div>
+            
+        </li>
+        
+    </ul>
+  </div>
+</body>
+</html>

Added: websites/production/tapestry/content/5.4.5/coffeescript/time-interval.html
==============================================================================
--- websites/production/tapestry/content/5.4.5/coffeescript/time-interval.html (added)
+++ websites/production/tapestry/content/5.4.5/coffeescript/time-interval.html Sat Sep  7 01:20:17 2019
@@ -0,0 +1,264 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+  <title>time-interval.coffee</title>
+  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+  <meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
+  <link rel="stylesheet" media="all" href="docco.css" />
+</head>
+<body>
+  <div id="container">
+    <div id="background"></div>
+    
+      <ul id="jump_to">
+        <li>
+          <a class="large" href="javascript:void(0);">Jump To &hellip;</a>
+          <a class="small" href="javascript:void(0);">+</a>
+          <div id="jump_wrapper">
+          <div id="jump_page">
+            
+              
+              <a class="source" href="beanvalidator-validation.html">
+                beanvalidator-validation.coffee
+              </a>
+            
+              
+              <a class="source" href="ajax.html">
+                ajax.coffee
+              </a>
+            
+              
+              <a class="source" href="ajaxformloop.html">
+                ajaxformloop.coffee
+              </a>
+            
+              
+              <a class="source" href="alert.html">
+                alert.coffee
+              </a>
+            
+              
+              <a class="source" href="autocomplete.html">
+                autocomplete.coffee
+              </a>
+            
+              
+              <a class="source" href="bootstrap.html">
+                bootstrap.coffee
+              </a>
+            
+              
+              <a class="source" href="confirm-click.html">
+                confirm-click.coffee
+              </a>
+            
+              
+              <a class="source" href="console.html">
+                console.coffee
+              </a>
+            
+              
+              <a class="source" href="datefield.html">
+                datefield.coffee
+              </a>
+            
+              
+              <a class="source" href="events.html">
+                events.coffee
+              </a>
+            
+              
+              <a class="source" href="exception-display.html">
+                exception-display.coffee
+              </a>
+            
+              
+              <a class="source" href="exception-frame.html">
+                exception-frame.coffee
+              </a>
+            
+              
+              <a class="source" href="fields.html">
+                fields.coffee
+              </a>
+            
+              
+              <a class="source" href="form-fragment.html">
+                form-fragment.coffee
+              </a>
+            
+              
+              <a class="source" href="forms.html">
+                forms.coffee
+              </a>
+            
+              
+              <a class="source" href="init.html">
+                init.coffee
+              </a>
+            
+              
+              <a class="source" href="localdate.html">
+                localdate.coffee
+              </a>
+            
+              
+              <a class="source" href="messages.html">
+                messages.coffee
+              </a>
+            
+              
+              <a class="source" href="moment.html">
+                moment.coffee
+              </a>
+            
+              
+              <a class="source" href="pageinit.html">
+                pageinit.coffee
+              </a>
+            
+              
+              <a class="source" href="palette.html">
+                palette.coffee
+              </a>
+            
+              
+              <a class="source" href="select.html">
+                select.coffee
+              </a>
+            
+              
+              <a class="source" href="time-interval.html">
+                time-interval.coffee
+              </a>
+            
+              
+              <a class="source" href="tree.html">
+                tree.coffee
+              </a>
+            
+              
+              <a class="source" href="utils.html">
+                utils.coffee
+              </a>
+            
+              
+              <a class="source" href="validation.html">
+                validation.coffee
+              </a>
+            
+              
+              <a class="source" href="zone-refresh.html">
+                zone-refresh.coffee
+              </a>
+            
+              
+              <a class="source" href="zone.html">
+                zone.coffee
+              </a>
+            
+          </div>
+        </li>
+      </ul>
+    
+    <ul class="sections">
+        
+          <li id="title">
+              <div class="annotation">
+                  <h1>time-interval.coffee</h1>
+              </div>
+          </li>
+        
+        
+        
+        <li id="section-1">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-1">&#182;</a>
+              </div>
+              <p>Copyright 2013 The Apache Software Foundation</p>
+<p>Licensed under the Apache License, Version 2.0 (the “License”);
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at</p>
+<pre><code><span class="hljs-attribute">http</span>:<span class="hljs-comment">#www.apache.org/licenses/LICENSE-2.0</span>
+</code></pre><p>Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an “AS IS” BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.</p>
+
+            </div>
+            
+        </li>
+        
+        
+        <li id="section-2">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-2">&#182;</a>
+              </div>
+              <h2 id="t5-core-time-interval">t5/core/time-interval</h2>
+<p>Used with the Interval component to express the interval between two timestamps,
+or the dynamic difference between now and an end point in the past or future.</p>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre>define [<span class="hljs-string">"./dom"</span>, <span class="hljs-string">"./moment"</span>],
+<span class="hljs-function"><span class="hljs-params">(dom, moment)</span> -&gt;</span>
+
+  ATTR = <span class="hljs-string">"data-timeinterval"</span>
+
+  DEFAULT_FORMAT = <span class="hljs-string">'YYYY-MM-DDTHH:mm:ss.SSSZ'</span>
+<span class="hljs-function">
+  <span class="hljs-title">toMoment</span> = <span class="hljs-params">(s)</span> -&gt;</span> <span class="hljs-keyword">if</span> s <span class="hljs-keyword">then</span> (moment s, DEFAULT_FORMAT) <span class="hljs-keyword">else</span> moment()
+<span class="hljs-function">
+  <span class="hljs-title">updateElement</span> = <span class="hljs-params">(el)</span> -&gt;</span>
+    start = toMoment el.attr <span class="hljs-string">"data-timeinterval-start"</span>
+    end = toMoment el.attr <span class="hljs-string">"data-timeinterval-end"</span>
+    plain = el.attr <span class="hljs-string">"data-timeinterval-plain"</span>
+
+    el.update end.from start, plain
+    <span class="hljs-keyword">return</span>
+<span class="hljs-function">
+  <span class="hljs-title">updateDynamics</span> = -&gt;</span>
+    <span class="hljs-keyword">for</span> el <span class="hljs-keyword">in</span> dom.body.find <span class="hljs-string">"[<span class="hljs-subst">#{ATTR}</span>=dynamic]"</span>
+      updateElement el
+    <span class="hljs-keyword">return</span></pre></div></div>
+            
+        </li>
+        
+        
+        <li id="section-3">
+            <div class="annotation">
+              
+              <div class="pilwrap ">
+                <a class="pilcrow" href="#section-3">&#182;</a>
+              </div>
+              <p>Update any dynamic intervals (the ones without a specific start date) about once a second</p>
+
+            </div>
+            
+            <div class="content"><div class='highlight'><pre>  setInterval updateDynamics, <span class="hljs-number">1000</span>
+
+  dom.scanner <span class="hljs-string">"[<span class="hljs-subst">#{ATTR}</span>=true]"</span>, <span class="hljs-function"><span class="hljs-params">(el)</span> -&gt;</span>
+
+    updateElement el
+
+    <span class="hljs-keyword">if</span> (el.attr <span class="hljs-string">"data-timeinterval-start"</span>) <span class="hljs-keyword">and</span> (el.attr <span class="hljs-string">"data-timeinterval-end"</span>)
+      el.attr ATTR, <span class="hljs-literal">null</span>
+    <span class="hljs-keyword">else</span>
+      el.attr ATTR, <span class="hljs-string">"dynamic"</span>
+
+    <span class="hljs-keyword">return</span>
+
+  <span class="hljs-keyword">return</span> <span class="hljs-comment"># no exports</span></pre></div></div>
+            
+        </li>
+        
+    </ul>
+  </div>
+</body>
+</html>