Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Update to latest mithgrid #28

Merged
merged 3 commits into from

1 participant

@jgsmith

No description provided.

@jgsmith jgsmith merged commit cc0fe7e into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 15, 2012
  1. @jgsmith

    clearer doc links

    jgsmith authored
Commits on May 16, 2012
  1. @jgsmith

    mithgrid current

    jgsmith authored
Commits on Jul 23, 2012
  1. @jgsmith

    update to latest mithgrid

    jgsmith authored
This page is out of date. Refresh to see the latest.
View
4 _includes/header.html
@@ -6,8 +6,8 @@
<li><a href="https://github.com/umd-mith/mithgrid">Fork On <strong>GitHub</strong></a></li>
</ul>
<ul>
- <li><a href="code/">Documentation of <strong>Code</strong></a></li>
- <li><a href="docs/">Documentation of <strong>APIs</strong></a></li>
+ <li><a href="code/">Code Documentation</a></li>
+ <li><a href="docs/">API Reference</a></li>
<!-- li><a href="tutorials">View <strong>Tutorials</strong></a></li -->
</ul>
</header>
View
10 code/index.html
@@ -2,15 +2,15 @@
layout: docco
title: mithgrid/code/index.html
---
-<div id="container"><div id="background"></div><div id="jump_to">Jump To &hellip;<div id="jump_wrapper"><div id="jump_page"><a href="./index.html" class="source"><span class="file_name">README</span></a><a href="./src/application.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">application.coffee</span></a><a href="./src/controller.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">controller.coffee</span></a><a href="./src/core.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">core.coffee</span></a><a href="./src/data.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">data.coffee</span></a><a href="./src/expression-alt.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">expression-alt.coffee</span></a><a href="./src/expression.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">expression.coffee</span></a><a href="./src/facet.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">facet.coffee</span></a><a href="./src/intro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">intro.coffee</span></a><a href="./src/outro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">outro.coffee</span></a><a href="./src/plugin.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">plugin.coffee</span></a><a href="./src/presentation.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">presentation.coffee</span></a></div></div></div><table cellpadding="0" cellspacing="0"><thead><tr><th class="docs"></th><th class="code"></th></tr></thead><tbody><tr id="section"><td class="docs"><h1>MITHgrid
+<div id="container"><div id="background"></div><div id="jump_to">Jump To &hellip;<div id="jump_wrapper"><div id="jump_page"><a href="./index.html" class="source"><span class="file_name">README</span></a><a href="./src/application.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">application.coffee</span></a><a href="./src/controller.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">controller.coffee</span></a><a href="./src/core.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">core.coffee</span></a><a href="./src/data.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">data.coffee</span></a><a href="./src/expression.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">expression.coffee</span></a><a href="./src/facet.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">facet.coffee</span></a><a href="./src/intro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">intro.coffee</span></a><a href="./src/outro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">outro.coffee</span></a><a href="./src/plugin.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">plugin.coffee</span></a><a href="./src/presentation.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">presentation.coffee</span></a></div></div></div><table cellpadding="0" cellspacing="0"><thead><tr><th class="docs"></th><th class="code"></th></tr></thead><tbody><tr id="section"><td class="docs"><h1>MITHgrid
</h1><p>JavaScript framework for building data-oriented, event-driven browser applications.</p><h3>Version</h3><p>0.0.1</p><h3>Repository</h3><p>git - git://github.com/umd-mith/mithgrid.git</p><h3>Dependencies </h3><ul><li><b>jQuery </b><span>1.7.1</span></li></ul><p><h3>Stats</h3><pre class="code_stats">
-http://cloc.sourceforge.net v 1.55 T=0.5 s (22.0 files/s, 7630.0 lines/s)
+http://cloc.sourceforge.net v 1.55 T=0.5 s (20.0 files/s, 7882.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
-CoffeeScript 11 490 1199 2126
+CoffeeScript 10 505 1222 2214
-------------------------------------------------------------------------------
-SUM: 11 490 1199 2126
+SUM: 10 505 1222 2214
-------------------------------------------------------------------------------
</pre></p></td><td id="content" class="code"><h1>MITHgrid</h1>
@@ -50,4 +50,4 @@
<h2>License</h2>
-<p>MITHgrid is licensed under the <a href="http://opensource.org/licenses/BSD-3-Clause">3-clause BSD license</a> because large parts of the data management code are based on the SIMILE Exhibit project, which is licensed under the 3-clause BSD license.</p> </td></tr></tbody></table><div id="generated">generated Tue May 15 2012 08:37:07 GMT-0400 (EDT) </div><div id="projectname"><a href="./index.html">MITHgrid</a></div></div>
+<p>MITHgrid is licensed under the <a href="http://opensource.org/licenses/BSD-3-Clause">3-clause BSD license</a> because large parts of the data management code are based on the SIMILE Exhibit project, which is licensed under the 3-clause BSD license.</p> </td></tr></tbody></table><div id="generated">generated Mon Jul 23 2012 08:51:42 GMT-0400 (EDT) </div><div id="projectname"><a href="./index.html">MITHgrid</a></div></div>
View
6 code/src/application.coffee.html
@@ -2,7 +2,7 @@
layout: docco
title: mithgrid/code/src/application.coffee.html
---
-<div id="container"><div id="background"></div><div id="jump_to">Jump To &hellip;<div id="jump_wrapper"><div id="jump_page"><a href="../index.html" class="source"><span class="file_name">README</span></a><a href="../src/application.coffee.html" class="source selected"><span class="base_path">src / </span><span class="file_name">application.coffee</span></a><a href="../src/controller.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">controller.coffee</span></a><a href="../src/core.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">core.coffee</span></a><a href="../src/data.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">data.coffee</span></a><a href="../src/expression-alt.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">expression-alt.coffee</span></a><a href="../src/expression.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">expression.coffee</span></a><a href="../src/facet.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">facet.coffee</span></a><a href="../src/intro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">intro.coffee</span></a><a href="../src/outro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">outro.coffee</span></a><a href="../src/plugin.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">plugin.coffee</span></a><a href="../src/presentation.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">presentation.coffee</span></a></div></div></div><table cellpadding="0" cellspacing="0"><thead><tr><th class="docs"><h1>application.coffee</h1><div class="filepath">src/</div></th><th class="code"></th></tr></thead><tbody><tr id="section-1"><td class="docs"><div class="pilwrap"><a href="#section-1" class="pilcrow">&#182;</a></div><h1>Applications</h1>
+<div id="container"><div id="background"></div><div id="jump_to">Jump To &hellip;<div id="jump_wrapper"><div id="jump_page"><a href="../index.html" class="source"><span class="file_name">README</span></a><a href="../src/application.coffee.html" class="source selected"><span class="base_path">src / </span><span class="file_name">application.coffee</span></a><a href="../src/controller.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">controller.coffee</span></a><a href="../src/core.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">core.coffee</span></a><a href="../src/data.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">data.coffee</span></a><a href="../src/expression.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">expression.coffee</span></a><a href="../src/facet.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">facet.coffee</span></a><a href="../src/intro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">intro.coffee</span></a><a href="../src/outro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">outro.coffee</span></a><a href="../src/plugin.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">plugin.coffee</span></a><a href="../src/presentation.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">presentation.coffee</span></a></div></div></div><table cellpadding="0" cellspacing="0"><thead><tr><th class="docs"><h1>application.coffee</h1><div class="filepath">src/</div></th><th class="code"></th></tr></thead><tbody><tr id="section-1"><td class="docs"><div class="pilwrap"><a href="#section-1" class="pilcrow">&#182;</a></div><h1>Applications</h1>
<h2>MITHGrid.Application</h2>
@@ -31,9 +31,9 @@
finishes.</p>
</td><td class="code"><div class="highlight"><pre> <span class="nv">that.run = </span><span class="nf">() -&gt;</span>
<span class="nx">$</span><span class="p">(</span><span class="nb">document</span><span class="p">).</span><span class="nx">ready</span> <span class="nf">() -&gt;</span>
+ <span class="nv">that.ready = </span><span class="nf">(fn) -&gt;</span> <span class="nx">fn</span><span class="p">()</span>
<span class="nx">fn</span><span class="p">()</span> <span class="k">for</span> <span class="nx">fn</span> <span class="k">in</span> <span class="nx">onReady</span>
<span class="nv">onReady = </span><span class="p">[]</span>
- <span class="nv">that.ready = </span><span class="nf">(fn) -&gt;</span> <span class="nx">fn</span><span class="p">()</span>
</pre></div></td></tr><tr id="section-3"><td class="docs"><div class="pilwrap"><a href="#section-3" class="pilcrow">&#182;</a></div><h3>#addDataStore</h3>
<p>Adds a data store to the application.</p>
@@ -315,4 +315,4 @@
<span class="k">for</span> <span class="nx">pconfig</span> <span class="k">in</span> <span class="nx">options</span><span class="p">.</span><span class="nx">plugins</span>
<span class="nx">that</span><span class="p">.</span><span class="nx">addPlugin</span> <span class="nx">pconfig</span>
-</pre></div></td></tr></tbody></table><div id="generated">generated Tue May 15 2012 08:37:07 GMT-0400 (EDT) </div><div id="projectname"><a href="../index.html">MITHgrid</a></div></div>
+</pre></div></td></tr></tbody></table><div id="generated">generated Mon Jul 23 2012 08:51:42 GMT-0400 (EDT) </div><div id="projectname"><a href="../index.html">MITHgrid</a></div></div>
View
4 code/src/controller.coffee.html
@@ -2,7 +2,7 @@
layout: docco
title: mithgrid/code/src/controller.coffee.html
---
-<div id="container"><div id="background"></div><div id="jump_to">Jump To &hellip;<div id="jump_wrapper"><div id="jump_page"><a href="../index.html" class="source"><span class="file_name">README</span></a><a href="../src/application.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">application.coffee</span></a><a href="../src/controller.coffee.html" class="source selected"><span class="base_path">src / </span><span class="file_name">controller.coffee</span></a><a href="../src/core.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">core.coffee</span></a><a href="../src/data.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">data.coffee</span></a><a href="../src/expression-alt.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">expression-alt.coffee</span></a><a href="../src/expression.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">expression.coffee</span></a><a href="../src/facet.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">facet.coffee</span></a><a href="../src/intro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">intro.coffee</span></a><a href="../src/outro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">outro.coffee</span></a><a href="../src/plugin.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">plugin.coffee</span></a><a href="../src/presentation.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">presentation.coffee</span></a></div></div></div><table cellpadding="0" cellspacing="0"><thead><tr><th class="docs"><h1>controller.coffee</h1><div class="filepath">src/</div></th><th class="code"></th></tr></thead><tbody><tr id="section-1"><td class="docs"><div class="pilwrap"><a href="#section-1" class="pilcrow">&#182;</a></div><h1>MITHGrid Controllers</h1>
+<div id="container"><div id="background"></div><div id="jump_to">Jump To &hellip;<div id="jump_wrapper"><div id="jump_page"><a href="../index.html" class="source"><span class="file_name">README</span></a><a href="../src/application.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">application.coffee</span></a><a href="../src/controller.coffee.html" class="source selected"><span class="base_path">src / </span><span class="file_name">controller.coffee</span></a><a href="../src/core.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">core.coffee</span></a><a href="../src/data.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">data.coffee</span></a><a href="../src/expression.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">expression.coffee</span></a><a href="../src/facet.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">facet.coffee</span></a><a href="../src/intro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">intro.coffee</span></a><a href="../src/outro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">outro.coffee</span></a><a href="../src/plugin.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">plugin.coffee</span></a><a href="../src/presentation.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">presentation.coffee</span></a></div></div></div><table cellpadding="0" cellspacing="0"><thead><tr><th class="docs"><h1>controller.coffee</h1><div class="filepath">src/</div></th><th class="code"></th></tr></thead><tbody><tr id="section-1"><td class="docs"><div class="pilwrap"><a href="#section-1" class="pilcrow">&#182;</a></div><h1>MITHGrid Controllers</h1>
<p>Controllers translate UI events into MITHGrid events. The goal is to create programs that only need a different set of
controllers to allow a different manner of user interaction.</p>
@@ -166,4 +166,4 @@
<span class="nx">binding</span>
-</pre></div></td></tr></tbody></table><div id="generated">generated Tue May 15 2012 08:37:08 GMT-0400 (EDT) </div><div id="projectname"><a href="../index.html">MITHgrid</a></div></div>
+</pre></div></td></tr></tbody></table><div id="generated">generated Mon Jul 23 2012 08:51:43 GMT-0400 (EDT) </div><div id="projectname"><a href="../index.html">MITHgrid</a></div></div>
View
55 code/src/core.coffee.html
@@ -2,7 +2,7 @@
layout: docco
title: mithgrid/code/src/core.coffee.html
---
-<div id="container"><div id="background"></div><div id="jump_to">Jump To &hellip;<div id="jump_wrapper"><div id="jump_page"><a href="../index.html" class="source"><span class="file_name">README</span></a><a href="../src/application.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">application.coffee</span></a><a href="../src/controller.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">controller.coffee</span></a><a href="../src/core.coffee.html" class="source selected"><span class="base_path">src / </span><span class="file_name">core.coffee</span></a><a href="../src/data.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">data.coffee</span></a><a href="../src/expression-alt.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">expression-alt.coffee</span></a><a href="../src/expression.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">expression.coffee</span></a><a href="../src/facet.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">facet.coffee</span></a><a href="../src/intro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">intro.coffee</span></a><a href="../src/outro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">outro.coffee</span></a><a href="../src/plugin.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">plugin.coffee</span></a><a href="../src/presentation.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">presentation.coffee</span></a></div></div></div><table cellpadding="0" cellspacing="0"><thead><tr><th class="docs"><h1>core.coffee</h1><div class="filepath">src/</div></th><th class="code"></th></tr></thead><tbody><tr id="section-1"><td class="docs"><div class="pilwrap"><a href="#section-1" class="pilcrow">&#182;</a></div><h1>namespace management</h1>
+<div id="container"><div id="background"></div><div id="jump_to">Jump To &hellip;<div id="jump_wrapper"><div id="jump_page"><a href="../index.html" class="source"><span class="file_name">README</span></a><a href="../src/application.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">application.coffee</span></a><a href="../src/controller.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">controller.coffee</span></a><a href="../src/core.coffee.html" class="source selected"><span class="base_path">src / </span><span class="file_name">core.coffee</span></a><a href="../src/data.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">data.coffee</span></a><a href="../src/expression.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">expression.coffee</span></a><a href="../src/facet.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">facet.coffee</span></a><a href="../src/intro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">intro.coffee</span></a><a href="../src/outro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">outro.coffee</span></a><a href="../src/plugin.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">plugin.coffee</span></a><a href="../src/presentation.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">presentation.coffee</span></a></div></div></div><table cellpadding="0" cellspacing="0"><thead><tr><th class="docs"><h1>core.coffee</h1><div class="filepath">src/</div></th><th class="code"></th></tr></thead><tbody><tr id="section-1"><td class="docs"><div class="pilwrap"><a href="#section-1" class="pilcrow">&#182;</a></div><h1>namespace management</h1>
<p>These functions are available as properties of the global MITHGrid object. The debug() and namespace()
functions are properties of all namespaces created using MITHGrid.</p>
@@ -190,12 +190,12 @@
<p>Returns:</p>
<p>The synchronizer object.</p>
-</td><td class="code"><div class="highlight"><pre><span class="nv">MITHGrid.initSynchronizer = </span><span class="nf">(callbacks) -&gt;</span>
+</td><td class="code"><div class="highlight"><pre><span class="nv">MITHGrid.initSynchronizer = </span><span class="nf">(callback) -&gt;</span>
<span class="nv">that = </span><span class="p">{}</span>
<span class="nv">counter = </span><span class="mi">1</span>
<span class="nv">done = </span><span class="kc">false</span>
<span class="nv">fired = </span><span class="kc">false</span>
- <span class="k">if</span> <span class="o">!</span><span class="nx">callbacks</span><span class="p">.</span><span class="nx">done</span><span class="o">?</span>
+ <span class="k">if</span> <span class="o">!</span><span class="nx">callback</span><span class="o">?</span>
<span class="nv">that.increment = </span><span class="nf">() -&gt;</span>
<span class="nv">that.decrement = </span><span class="nx">that</span><span class="p">.</span><span class="nx">increment</span>
<span class="nv">that.done = </span><span class="nx">that</span><span class="p">.</span><span class="nx">increment</span>
@@ -231,7 +231,7 @@
<span class="nx">counter</span> <span class="o">-=</span> <span class="mi">1</span>
<span class="k">if</span> <span class="nx">counter</span> <span class="o">&lt;=</span> <span class="mi">0</span> <span class="o">and</span> <span class="nx">done</span> <span class="o">and</span> <span class="o">!</span><span class="nx">fired</span>
<span class="nv">fired = </span><span class="kc">true</span>
- <span class="nx">callbacks</span><span class="p">.</span><span class="nx">done</span>
+ <span class="nx">callback</span><span class="p">()</span>
<span class="nx">counter</span></pre></div></td></tr><tr id="section-18"><td class="docs"><div class="pilwrap"><a href="#section-18" class="pilcrow">&#182;</a></div><h3>#done</h3>
<p>Marks the synchronizer as done. The counter should monotonically decrease after this. Once it is zero, the
@@ -270,11 +270,7 @@
<span class="k">if</span> <span class="nx">that</span><span class="p">.</span><span class="nx">isPreventable</span>
<span class="nx">callbackFlags</span><span class="p">.</span><span class="nx">push</span> <span class="s">&quot;stopOnFalse&quot;</span>
- <span class="k">if</span> <span class="nx">that</span><span class="p">.</span><span class="nx">isUnicast</span>
- <span class="nx">callbackFlags</span><span class="p">.</span><span class="nx">push</span> <span class="s">&quot;unique&quot;</span>
- <span class="k">if</span> <span class="nx">that</span><span class="p">.</span><span class="nx">hasMemory</span>
- <span class="nx">callbackFlags</span><span class="p">.</span><span class="nx">push</span> <span class="s">&quot;memory&quot;</span>
-
+
<span class="nv">callbacks = </span><span class="nx">$</span><span class="p">.</span><span class="nx">Callbacks</span><span class="p">(</span><span class="nx">callbackFlags</span><span class="p">.</span><span class="nx">join</span><span class="p">(</span><span class="s">&quot; &quot;</span><span class="p">))</span></pre></div></td></tr><tr id="section-20"><td class="docs"><div class="pilwrap"><a href="#section-20" class="pilcrow">&#182;</a></div><h3>#addListener</h3>
<p>Adds a listener to an event.</p>
@@ -286,8 +282,7 @@
</ul>
<p>Returns: Nothing.</p>
-</td><td class="code"><div class="highlight"><pre> <span class="nv">that.addListener = </span><span class="nf">(listener) -&gt;</span> <span class="nx">callbacks</span><span class="p">.</span><span class="nx">add</span> <span class="nx">listener</span>
-
+</td><td class="code"><div class="highlight"><pre> <span class="nv">adder = </span><span class="nf">(listener) -&gt;</span> <span class="nx">callbacks</span><span class="p">.</span><span class="nx">add</span> <span class="nx">listener</span>
</pre></div></td></tr><tr id="section-21"><td class="docs"><div class="pilwrap"><a href="#section-21" class="pilcrow">&#182;</a></div><h3>#removeListener</h3>
<p>Removes a listener (or set of listeners) from an event firer.</p>
@@ -299,7 +294,8 @@
</ul>
<p>Returns: Nothing.</p>
-</td><td class="code"><div class="highlight"><pre> <span class="nv">that.removeListener = </span><span class="nf">(listener) -&gt;</span> <span class="nx">callbacks</span><span class="p">.</span><span class="nx">remove</span> <span class="nx">listener</span></pre></div></td></tr><tr id="section-22"><td class="docs"><div class="pilwrap"><a href="#section-22" class="pilcrow">&#182;</a></div><h3>#fire</h3>
+</td><td class="code"><div class="highlight"><pre> <span class="nv">remover = </span><span class="nf">(listener) -&gt;</span> <span class="nx">callbacks</span><span class="p">.</span><span class="nx">remove</span> <span class="nx">listener</span>
+ </pre></div></td></tr><tr id="section-22"><td class="docs"><div class="pilwrap"><a href="#section-22" class="pilcrow">&#182;</a></div><h3>#fire</h3>
<p>Fire's behavior depends on the type of event that is firing.</p>
@@ -328,7 +324,38 @@
it will return "true".</p>
<p>If neither unicast nor preventabe, then fire() will return "true" regardless of how many listeners are called.</p>
-</td><td class="code"><div class="highlight"><pre> <span class="nv">that.fire = </span><span class="nf">(args...) -&gt;</span> <span class="nx">callbacks</span><span class="p">.</span><span class="nx">fire</span> <span class="nx">args</span><span class="p">...</span>
+</td><td class="code"><div class="highlight"><pre> <span class="nv">firer = </span><span class="nf">(args...) -&gt;</span> <span class="nx">callbacks</span><span class="p">.</span><span class="nx">fire</span> <span class="nx">args</span><span class="p">...</span>
+
+ <span class="k">if</span> <span class="nx">that</span><span class="p">.</span><span class="nx">isUnicast</span>
+ <span class="nv">callbackFns = </span><span class="p">[]</span>
+ <span class="nv">adder = </span><span class="nf">(listener) -&gt;</span>
+ <span class="nx">callbackFns</span><span class="p">.</span><span class="nx">push</span> <span class="nx">listener</span>
+ <span class="nv">remover = </span><span class="nf">(listener) -&gt;</span>
+ <span class="nv">callbackFns = </span><span class="p">(</span><span class="nx">fn</span> <span class="k">for</span> <span class="nx">fn</span> <span class="k">in</span> <span class="nx">callbackFns</span> <span class="k">when</span> <span class="nx">fn</span> <span class="o">!=</span> <span class="nx">listener</span><span class="p">)</span>
+
+ <span class="nx">callbacks</span><span class="p">.</span><span class="nx">add</span> <span class="nf">(args...) -&gt;</span>
+ <span class="k">if</span> <span class="nx">callbackFns</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">0</span>
+ <span class="nx">callbackFns</span><span class="p">[</span><span class="mi">0</span><span class="p">](</span><span class="nx">args</span><span class="p">...)</span>
+
+ <span class="k">else</span> <span class="k">if</span> <span class="nx">that</span><span class="p">.</span><span class="nx">hasMemory</span>
+ <span class="nv">memory = </span><span class="p">[]</span>
+
+ <span class="nv">oldAdder = </span><span class="nx">adder</span>
+ <span class="nv">adder = </span><span class="nf">(listener) -&gt;</span>
+ <span class="k">for</span> <span class="nx">m</span> <span class="k">in</span> <span class="nx">memory</span>
+ <span class="nx">listener</span><span class="p">(</span><span class="nx">m</span><span class="p">...)</span>
+ <span class="nx">oldAdder</span> <span class="nx">listener</span>
+
+ <span class="nv">oldFirer = </span><span class="nx">firer</span>
+ <span class="nv">firer = </span><span class="nf">(args...) -&gt;</span>
+ <span class="nx">memory</span><span class="p">.</span><span class="nx">push</span> <span class="nx">args</span>
+ <span class="nx">oldFirer</span> <span class="nx">args</span><span class="p">...</span>
+
+ <span class="nv">that.addListener = </span><span class="nx">adder</span>
+
+ <span class="nv">that.removeListener = </span><span class="nx">remover</span>
+
+ <span class="nv">that.fire = </span><span class="nx">firer</span>
<span class="nx">that</span>
</pre></div></td></tr><tr id="section-23"><td class="docs"><div class="pilwrap"><a href="#section-23" class="pilcrow">&#182;</a></div><h1>Object Instances</h1>
@@ -525,4 +552,4 @@
<span class="nx">$</span><span class="p">(</span><span class="nb">document</span><span class="p">).</span><span class="nx">unbind</span> <span class="s">&quot;mouseup&quot;</span>
<span class="nx">oldCB</span>
-</pre></div></td></tr></tbody></table><div id="generated">generated Tue May 15 2012 08:37:08 GMT-0400 (EDT) </div><div id="projectname"><a href="../index.html">MITHgrid</a></div></div>
+</pre></div></td></tr></tbody></table><div id="generated">generated Mon Jul 23 2012 08:51:43 GMT-0400 (EDT) </div><div id="projectname"><a href="../index.html">MITHgrid</a></div></div>
View
45 code/src/data.coffee.html
@@ -2,7 +2,7 @@
layout: docco
title: mithgrid/code/src/data.coffee.html
---
-<div id="container"><div id="background"></div><div id="jump_to">Jump To &hellip;<div id="jump_wrapper"><div id="jump_page"><a href="../index.html" class="source"><span class="file_name">README</span></a><a href="../src/application.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">application.coffee</span></a><a href="../src/controller.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">controller.coffee</span></a><a href="../src/core.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">core.coffee</span></a><a href="../src/data.coffee.html" class="source selected"><span class="base_path">src / </span><span class="file_name">data.coffee</span></a><a href="../src/expression-alt.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">expression-alt.coffee</span></a><a href="../src/expression.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">expression.coffee</span></a><a href="../src/facet.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">facet.coffee</span></a><a href="../src/intro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">intro.coffee</span></a><a href="../src/outro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">outro.coffee</span></a><a href="../src/plugin.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">plugin.coffee</span></a><a href="../src/presentation.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">presentation.coffee</span></a></div></div></div><table cellpadding="0" cellspacing="0"><thead><tr><th class="docs"><h1>data.coffee</h1><div class="filepath">src/</div></th><th class="code"></th></tr></thead><tbody><tr id="section-1"><td class="docs"><div class="pilwrap"><a href="#section-1" class="pilcrow">&#182;</a></div><p>We place most of the data-centric pieces in the MITHGrid.Data namespace.</p>
+<div id="container"><div id="background"></div><div id="jump_to">Jump To &hellip;<div id="jump_wrapper"><div id="jump_page"><a href="../index.html" class="source"><span class="file_name">README</span></a><a href="../src/application.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">application.coffee</span></a><a href="../src/controller.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">controller.coffee</span></a><a href="../src/core.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">core.coffee</span></a><a href="../src/data.coffee.html" class="source selected"><span class="base_path">src / </span><span class="file_name">data.coffee</span></a><a href="../src/expression.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">expression.coffee</span></a><a href="../src/facet.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">facet.coffee</span></a><a href="../src/intro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">intro.coffee</span></a><a href="../src/outro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">outro.coffee</span></a><a href="../src/plugin.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">plugin.coffee</span></a><a href="../src/presentation.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">presentation.coffee</span></a></div></div></div><table cellpadding="0" cellspacing="0"><thead><tr><th class="docs"><h1>data.coffee</h1><div class="filepath">src/</div></th><th class="code"></th></tr></thead><tbody><tr id="section-1"><td class="docs"><div class="pilwrap"><a href="#section-1" class="pilcrow">&#182;</a></div><p>We place most of the data-centric pieces in the MITHGrid.Data namespace.</p>
</td><td class="code"><div class="highlight"><pre><span class="nx">MITHGrid</span><span class="p">.</span><span class="nx">namespace</span> <span class="s">&#39;Data&#39;</span><span class="p">,</span> <span class="nf">(Data) -&gt;</span>
<span class="nx">Data</span><span class="p">.</span><span class="nx">namespace</span> <span class="s">&#39;Set&#39;</span><span class="p">,</span> <span class="nf">(Set) -&gt;</span></pre></div></td></tr><tr id="section-2"><td class="docs"><div class="pilwrap"><a href="#section-2" class="pilcrow">&#182;</a></div><h1>Data Sets</h1>
@@ -340,13 +340,19 @@
<ul>
<li>id - item ID</li>
+<li>cb - optional callback to receive the item</li>
</ul>
<p>Returns:</p>
<p>An object containing the triples related to the item ID. If the item ID is not in the data store, then
and empty object is returned.</p>
-</td><td class="code"><div class="highlight"><pre> <span class="nv">that.getItem = </span><span class="nf">(id) -&gt;</span> <span class="nx">spo</span><span class="p">[</span><span class="nx">id</span><span class="p">]</span><span class="o">?</span><span class="p">.</span><span class="nx">values</span> <span class="o">?</span> <span class="p">{}</span></pre></div></td></tr><tr id="section-26"><td class="docs"><div class="pilwrap"><a href="#section-26" class="pilcrow">&#182;</a></div><h3>#getItems</h3>
+</td><td class="code"><div class="highlight"><pre> <span class="nv">that.getItem = </span><span class="nf">(id, cb) -&gt;</span>
+ <span class="nv">result = </span><span class="nx">spo</span><span class="p">[</span><span class="nx">id</span><span class="p">]</span><span class="o">?</span><span class="p">.</span><span class="nx">values</span> <span class="o">?</span> <span class="p">{}</span>
+ <span class="k">if</span> <span class="nx">cb</span>
+ <span class="nx">cb</span> <span class="kc">null</span><span class="p">,</span> <span class="nx">result</span>
+ <span class="k">else</span>
+ <span class="nx">result</span></pre></div></td></tr><tr id="section-26"><td class="docs"><div class="pilwrap"><a href="#section-26" class="pilcrow">&#182;</a></div><h3>#getItems</h3>
<p>Returns an array of objects holding the triples associated with an array of item IDs.</p>
@@ -354,14 +360,39 @@
<ul>
<li>ids - array of item IDs</li>
+<li>cb - optional callback to receive results</li>
</ul>
<p>Returns:</p>
-<p>An array of objects containing the triples related to the item IDs.</p>
-</td><td class="code"><div class="highlight"><pre> <span class="nv">that.getItems = </span><span class="nf">(ids) -&gt;</span>
- <span class="k">return</span> <span class="p">[</span><span class="nx">that</span><span class="p">.</span><span class="nx">getItem</span> <span class="nx">ids</span><span class="p">]</span> <span class="k">if</span> <span class="o">!</span><span class="nx">$</span><span class="p">.</span><span class="nx">isArray</span> <span class="nx">ids</span>
- <span class="nx">$</span><span class="p">.</span><span class="nx">map</span> <span class="nx">ids</span><span class="p">,</span> <span class="nf">(id, idx) -&gt;</span> <span class="nx">that</span><span class="p">.</span><span class="nx">getItem</span> <span class="nx">id</span>
+<p>An array of objects containing the triples related to the item IDs.
+If you provide a callback function, then the results will be passed to the callback
+one at a time, ending with null.</p>
+
+<p>The callback function has the signature (err, doc):</p>
+
+<pre><code>dataStore.getItems([id list...], function(err, item) { ... });
+</code></pre>
+</td><td class="code"><div class="highlight"><pre> <span class="nv">that.getItems = </span><span class="nf">(ids, cb) -&gt;</span>
+ <span class="k">if</span> <span class="nx">cb</span><span class="o">?</span>
+ <span class="nv">sync = </span><span class="nx">MITHGrid</span><span class="p">.</span><span class="nx">initSyncronizer</span> <span class="nx">cb</span>
+ <span class="k">if</span> <span class="nx">ids</span><span class="p">.</span><span class="nx">length</span><span class="o">?</span>
+ <span class="k">for</span> <span class="nx">id</span> <span class="k">in</span> <span class="nx">ids</span>
+ <span class="nx">sync</span><span class="p">.</span><span class="nx">increment</span><span class="p">()</span>
+ <span class="nx">that</span><span class="p">.</span><span class="nx">getItem</span> <span class="nx">id</span><span class="p">,</span> <span class="nf">(err, res) -&gt;</span>
+ <span class="nx">cb</span> <span class="nx">err</span><span class="p">,</span> <span class="nx">res</span>
+ <span class="nx">sync</span><span class="p">.</span><span class="nx">decrement</span><span class="p">()</span>
+ <span class="k">else</span>
+ <span class="nx">sync</span><span class="p">.</span><span class="nx">increment</span><span class="p">()</span>
+ <span class="nx">that</span><span class="p">.</span><span class="nx">getItem</span> <span class="nx">ids</span><span class="p">,</span> <span class="nf">(err, res) -&gt;</span>
+ <span class="nx">cb</span> <span class="nx">err</span><span class="p">,</span> <span class="nx">res</span>
+ <span class="nx">sync</span><span class="p">.</span><span class="nx">decrement</span><span class="p">()</span>
+ <span class="nx">sync</span><span class="p">.</span><span class="nx">done</span><span class="p">()</span>
+ <span class="k">else</span>
+ <span class="k">if</span> <span class="nx">ids</span><span class="p">.</span><span class="nx">length</span>
+ <span class="p">(</span><span class="nx">that</span><span class="p">.</span><span class="nx">getItem</span> <span class="nx">id</span> <span class="k">for</span> <span class="nx">id</span> <span class="k">in</span> <span class="nx">ids</span><span class="p">)</span>
+ <span class="k">else</span>
+ <span class="p">[</span> <span class="nx">that</span><span class="p">.</span><span class="nx">getItem</span> <span class="nx">ids</span> <span class="p">]</span>
</pre></div></td></tr><tr id="section-27"><td class="docs"><div class="pilwrap"><a href="#section-27" class="pilcrow">&#182;</a></div><h3>#removeItems</h3>
<p>Removes triples associated with the item IDs.</p>
@@ -1280,4 +1311,4 @@
<span class="nx">that</span><span class="p">.</span><span class="nx">events</span><span class="p">.</span><span class="nx">onModelChange</span><span class="p">.</span><span class="nx">addListener</span> <span class="nf">(m, i) -&gt;</span> <span class="nx">ob</span><span class="p">.</span><span class="nx">eventModelChange</span> <span class="nx">m</span><span class="p">,</span> <span class="nx">i</span>
<span class="nx">ob</span><span class="p">.</span><span class="nx">eventModelChange</span> <span class="nx">that</span><span class="p">,</span> <span class="nx">that</span><span class="p">.</span><span class="nx">items</span><span class="p">()</span>
-</pre></div></td></tr></tbody></table><div id="generated">generated Tue May 15 2012 08:37:08 GMT-0400 (EDT) </div><div id="projectname"><a href="../index.html">MITHgrid</a></div></div>
+</pre></div></td></tr></tbody></table><div id="generated">generated Mon Jul 23 2012 08:51:43 GMT-0400 (EDT) </div><div id="projectname"><a href="../index.html">MITHgrid</a></div></div>
View
4 code/src/expression.coffee.html
@@ -2,7 +2,7 @@
layout: docco
title: mithgrid/code/src/expression.coffee.html
---
-<div id="container"><div id="background"></div><div id="jump_to">Jump To &hellip;<div id="jump_wrapper"><div id="jump_page"><a href="../index.html" class="source"><span class="file_name">README</span></a><a href="../src/application.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">application.coffee</span></a><a href="../src/controller.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">controller.coffee</span></a><a href="../src/core.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">core.coffee</span></a><a href="../src/data.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">data.coffee</span></a><a href="../src/expression-alt.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">expression-alt.coffee</span></a><a href="../src/expression.coffee.html" class="source selected"><span class="base_path">src / </span><span class="file_name">expression.coffee</span></a><a href="../src/facet.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">facet.coffee</span></a><a href="../src/intro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">intro.coffee</span></a><a href="../src/outro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">outro.coffee</span></a><a href="../src/plugin.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">plugin.coffee</span></a><a href="../src/presentation.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">presentation.coffee</span></a></div></div></div><table cellpadding="0" cellspacing="0"><thead><tr><th class="docs"><h1>expression.coffee</h1><div class="filepath">src/</div></th><th class="code"></th></tr></thead><tbody><tr id="section-1"><td class="docs"><div class="pilwrap"><a href="#section-1" class="pilcrow">&#182;</a></div><h1>Expression Parser</h1>
+<div id="container"><div id="background"></div><div id="jump_to">Jump To &hellip;<div id="jump_wrapper"><div id="jump_page"><a href="../index.html" class="source"><span class="file_name">README</span></a><a href="../src/application.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">application.coffee</span></a><a href="../src/controller.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">controller.coffee</span></a><a href="../src/core.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">core.coffee</span></a><a href="../src/data.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">data.coffee</span></a><a href="../src/expression.coffee.html" class="source selected"><span class="base_path">src / </span><span class="file_name">expression.coffee</span></a><a href="../src/facet.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">facet.coffee</span></a><a href="../src/intro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">intro.coffee</span></a><a href="../src/outro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">outro.coffee</span></a><a href="../src/plugin.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">plugin.coffee</span></a><a href="../src/presentation.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">presentation.coffee</span></a></div></div></div><table cellpadding="0" cellspacing="0"><thead><tr><th class="docs"><h1>expression.coffee</h1><div class="filepath">src/</div></th><th class="code"></th></tr></thead><tbody><tr id="section-1"><td class="docs"><div class="pilwrap"><a href="#section-1" class="pilcrow">&#182;</a></div><h1>Expression Parser</h1>
<p>Everything here is private except for a few exported objects and functions.</p>
</td><td class="code"><div class="highlight"><pre><span class="nx">MITHGrid</span><span class="p">.</span><span class="nx">namespace</span> <span class="s">&quot;Expression.Basic&quot;</span><span class="p">,</span> <span class="nf">(exports) -&gt;</span>
@@ -688,4 +688,4 @@
<span class="nx">Expression</span><span class="p">.</span><span class="nx">initCollection</span> <span class="nx">set</span><span class="p">,</span> <span class="nx">valueType</span>
-</pre></div></td></tr></tbody></table><div id="generated">generated Tue May 15 2012 08:37:08 GMT-0400 (EDT) </div><div id="projectname"><a href="../index.html">MITHgrid</a></div></div>
+</pre></div></td></tr></tbody></table><div id="generated">generated Mon Jul 23 2012 08:51:43 GMT-0400 (EDT) </div><div id="projectname"><a href="../index.html">MITHgrid</a></div></div>
View
4 code/src/facet.coffee.html
@@ -2,7 +2,7 @@
layout: docco
title: mithgrid/code/src/facet.coffee.html
---
-<div id="container"><div id="background"></div><div id="jump_to">Jump To &hellip;<div id="jump_wrapper"><div id="jump_page"><a href="../index.html" class="source"><span class="file_name">README</span></a><a href="../src/application.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">application.coffee</span></a><a href="../src/controller.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">controller.coffee</span></a><a href="../src/core.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">core.coffee</span></a><a href="../src/data.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">data.coffee</span></a><a href="../src/expression-alt.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">expression-alt.coffee</span></a><a href="../src/expression.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">expression.coffee</span></a><a href="../src/facet.coffee.html" class="source selected"><span class="base_path">src / </span><span class="file_name">facet.coffee</span></a><a href="../src/intro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">intro.coffee</span></a><a href="../src/outro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">outro.coffee</span></a><a href="../src/plugin.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">plugin.coffee</span></a><a href="../src/presentation.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">presentation.coffee</span></a></div></div></div><table cellpadding="0" cellspacing="0"><thead><tr><th class="docs"><h1>facet.coffee</h1><div class="filepath">src/</div></th><th class="code"></th></tr></thead><tbody><tr id="section-1"><td class="docs"><div class="pilwrap"><a href="#section-1" class="pilcrow">&#182;</a></div><h1>Facets</h1>
+<div id="container"><div id="background"></div><div id="jump_to">Jump To &hellip;<div id="jump_wrapper"><div id="jump_page"><a href="../index.html" class="source"><span class="file_name">README</span></a><a href="../src/application.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">application.coffee</span></a><a href="../src/controller.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">controller.coffee</span></a><a href="../src/core.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">core.coffee</span></a><a href="../src/data.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">data.coffee</span></a><a href="../src/expression.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">expression.coffee</span></a><a href="../src/facet.coffee.html" class="source selected"><span class="base_path">src / </span><span class="file_name">facet.coffee</span></a><a href="../src/intro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">intro.coffee</span></a><a href="../src/outro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">outro.coffee</span></a><a href="../src/plugin.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">plugin.coffee</span></a><a href="../src/presentation.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">presentation.coffee</span></a></div></div></div><table cellpadding="0" cellspacing="0"><thead><tr><th class="docs"><h1>facet.coffee</h1><div class="filepath">src/</div></th><th class="code"></th></tr></thead><tbody><tr id="section-1"><td class="docs"><div class="pilwrap"><a href="#section-1" class="pilcrow">&#182;</a></div><h1>Facets</h1>
</td><td class="code"><div class="highlight"><pre><span class="nx">MITHGrid</span><span class="p">.</span><span class="nx">namespace</span> <span class="s">&#39;Facet&#39;</span><span class="p">,</span> <span class="nf">(Facet) -&gt;</span></pre></div></td></tr><tr id="section-2"><td class="docs"><div class="pilwrap"><a href="#section-2" class="pilcrow">&#182;</a></div><h2>Facet.initInstance</h2>
</td><td class="code"><div class="highlight"><pre> <span class="nv">Facet.initInstance = </span><span class="nf">(args...) -&gt;</span>
<span class="nx">MITHGrid</span><span class="p">.</span><span class="nx">initInstance</span> <span class="s">&quot;MITHGrid.Facet&quot;</span><span class="p">,</span> <span class="nx">args</span><span class="p">...,</span> <span class="nf">(that, container) -&gt;</span>
@@ -186,4 +186,4 @@
<span class="nv">that.value = </span><span class="nx">inputElement</span><span class="p">.</span><span class="nx">val</span><span class="p">()</span>
<span class="nx">that</span><span class="p">.</span><span class="nx">events</span><span class="p">.</span><span class="nx">onFilterChange</span><span class="p">.</span><span class="nx">fire</span><span class="p">()</span>
-</pre></div></td></tr></tbody></table><div id="generated">generated Tue May 15 2012 08:37:09 GMT-0400 (EDT) </div><div id="projectname"><a href="../index.html">MITHgrid</a></div></div>
+</pre></div></td></tr></tbody></table><div id="generated">generated Mon Jul 23 2012 08:51:43 GMT-0400 (EDT) </div><div id="projectname"><a href="../index.html">MITHgrid</a></div></div>
View
4 code/src/intro.coffee.html
@@ -2,7 +2,7 @@
layout: docco
title: mithgrid/code/src/intro.coffee.html
---
-<div id="container"><div id="background"></div><div id="jump_to">Jump To &hellip;<div id="jump_wrapper"><div id="jump_page"><a href="../index.html" class="source"><span class="file_name">README</span></a><a href="../src/application.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">application.coffee</span></a><a href="../src/controller.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">controller.coffee</span></a><a href="../src/core.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">core.coffee</span></a><a href="../src/data.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">data.coffee</span></a><a href="../src/expression-alt.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">expression-alt.coffee</span></a><a href="../src/expression.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">expression.coffee</span></a><a href="../src/facet.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">facet.coffee</span></a><a href="../src/intro.coffee.html" class="source selected"><span class="base_path">src / </span><span class="file_name">intro.coffee</span></a><a href="../src/outro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">outro.coffee</span></a><a href="../src/plugin.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">plugin.coffee</span></a><a href="../src/presentation.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">presentation.coffee</span></a></div></div></div><table cellpadding="0" cellspacing="0"><thead><tr><th class="docs"><h1>intro.coffee</h1><div class="filepath">src/</div></th><th class="code"></th></tr></thead><tbody><tr id="section-1"><td class="docs"><div class="pilwrap"><a href="#section-1" class="pilcrow">&#182;</a></div><p><strong>MITHGrid</strong> is a data-centric JavaScript library that provides event-driven application building blocks.
+<div id="container"><div id="background"></div><div id="jump_to">Jump To &hellip;<div id="jump_wrapper"><div id="jump_page"><a href="../index.html" class="source"><span class="file_name">README</span></a><a href="../src/application.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">application.coffee</span></a><a href="../src/controller.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">controller.coffee</span></a><a href="../src/core.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">core.coffee</span></a><a href="../src/data.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">data.coffee</span></a><a href="../src/expression.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">expression.coffee</span></a><a href="../src/facet.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">facet.coffee</span></a><a href="../src/intro.coffee.html" class="source selected"><span class="base_path">src / </span><span class="file_name">intro.coffee</span></a><a href="../src/outro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">outro.coffee</span></a><a href="../src/plugin.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">plugin.coffee</span></a><a href="../src/presentation.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">presentation.coffee</span></a></div></div></div><table cellpadding="0" cellspacing="0"><thead><tr><th class="docs"><h1>intro.coffee</h1><div class="filepath">src/</div></th><th class="code"></th></tr></thead><tbody><tr id="section-1"><td class="docs"><div class="pilwrap"><a href="#section-1" class="pilcrow">&#182;</a></div><p><strong>MITHGrid</strong> is a data-centric JavaScript library that provides event-driven application building blocks.
The library is based loosely on the MIT Simile Exhibit library and the Fluid Infusion project.</p>
</td><td class="code"><div class="highlight"><pre></pre></div></td></tr><tr id="section-2"><td class="docs"><div class="pilwrap"><a href="#section-2" class="pilcrow">&#182;</a></div><h1>#</h1>
@@ -48,4 +48,4 @@
<span class="p">(</span><span class="nf">($, MITHGrid) -&gt;</span>
-</pre></div></td></tr></tbody></table><div id="generated">generated Tue May 15 2012 08:37:09 GMT-0400 (EDT) </div><div id="projectname"><a href="../index.html">MITHgrid</a></div></div>
+</pre></div></td></tr></tbody></table><div id="generated">generated Mon Jul 23 2012 08:51:44 GMT-0400 (EDT) </div><div id="projectname"><a href="../index.html">MITHgrid</a></div></div>
View
4 code/src/outro.coffee.html
@@ -2,7 +2,7 @@
layout: docco
title: mithgrid/code/src/outro.coffee.html
---
-<div id="container"><div id="background"></div><div id="jump_to">Jump To &hellip;<div id="jump_wrapper"><div id="jump_page"><a href="../index.html" class="source"><span class="file_name">README</span></a><a href="../src/application.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">application.coffee</span></a><a href="../src/controller.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">controller.coffee</span></a><a href="../src/core.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">core.coffee</span></a><a href="../src/data.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">data.coffee</span></a><a href="../src/expression-alt.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">expression-alt.coffee</span></a><a href="../src/expression.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">expression.coffee</span></a><a href="../src/facet.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">facet.coffee</span></a><a href="../src/intro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">intro.coffee</span></a><a href="../src/outro.coffee.html" class="source selected"><span class="base_path">src / </span><span class="file_name">outro.coffee</span></a><a href="../src/plugin.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">plugin.coffee</span></a><a href="../src/presentation.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">presentation.coffee</span></a></div></div></div><table cellpadding="0" cellspacing="0"><thead><tr><th class="docs"><h1>outro.coffee</h1><div class="filepath">src/</div></th><th class="code"></th></tr></thead><tbody><tr id="section-1"><td class="docs"><div class="pilwrap"><a href="#section-1" class="pilcrow">&#182;</a></div>
+<div id="container"><div id="background"></div><div id="jump_to">Jump To &hellip;<div id="jump_wrapper"><div id="jump_page"><a href="../index.html" class="source"><span class="file_name">README</span></a><a href="../src/application.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">application.coffee</span></a><a href="../src/controller.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">controller.coffee</span></a><a href="../src/core.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">core.coffee</span></a><a href="../src/data.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">data.coffee</span></a><a href="../src/expression.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">expression.coffee</span></a><a href="../src/facet.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">facet.coffee</span></a><a href="../src/intro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">intro.coffee</span></a><a href="../src/outro.coffee.html" class="source selected"><span class="base_path">src / </span><span class="file_name">outro.coffee</span></a><a href="../src/plugin.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">plugin.coffee</span></a><a href="../src/presentation.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">presentation.coffee</span></a></div></div></div><table cellpadding="0" cellspacing="0"><thead><tr><th class="docs"><h1>outro.coffee</h1><div class="filepath">src/</div></th><th class="code"></th></tr></thead><tbody><tr id="section-1"><td class="docs"><div class="pilwrap"><a href="#section-1" class="pilcrow">&#182;</a></div>
</td><td class="code"><div class="highlight"><pre></pre></div></td></tr><tr id="section-2"><td class="docs"><div class="pilwrap"><a href="#section-2" class="pilcrow">&#182;</a></div><p>Here, we have our deprecated ways of referring to initializers
<strong>These aliases will be removed in the first public release.</strong></p>
</td><td class="code"><div class="highlight"><pre> <span class="nv">MITHGrid.initView = </span><span class="nx">MITHGrid</span><span class="p">.</span><span class="nx">deprecated</span> <span class="s">&quot;MITHGrid.initView&quot;</span><span class="p">,</span> <span class="nx">MITHGrid</span><span class="p">.</span><span class="nx">initInstance</span>
@@ -54,4 +54,4 @@
<span class="nv">facetLabel: </span><span class="s">&quot;Search&quot;</span>
<span class="nv">expressions: </span><span class="p">[</span> <span class="s">&quot;.label&quot;</span> <span class="p">]</span>
-</pre></div></td></tr></tbody></table><div id="generated">generated Tue May 15 2012 08:37:09 GMT-0400 (EDT) </div><div id="projectname"><a href="../index.html">MITHgrid</a></div></div>
+</pre></div></td></tr></tbody></table><div id="generated">generated Mon Jul 23 2012 08:51:44 GMT-0400 (EDT) </div><div id="projectname"><a href="../index.html">MITHgrid</a></div></div>
View
4 code/src/plugin.coffee.html
@@ -2,7 +2,7 @@
layout: docco
title: mithgrid/code/src/plugin.coffee.html
---
-<div id="container"><div id="background"></div><div id="jump_to">Jump To &hellip;<div id="jump_wrapper"><div id="jump_page"><a href="../index.html" class="source"><span class="file_name">README</span></a><a href="../src/application.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">application.coffee</span></a><a href="../src/controller.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">controller.coffee</span></a><a href="../src/core.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">core.coffee</span></a><a href="../src/data.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">data.coffee</span></a><a href="../src/expression-alt.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">expression-alt.coffee</span></a><a href="../src/expression.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">expression.coffee</span></a><a href="../src/facet.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">facet.coffee</span></a><a href="../src/intro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">intro.coffee</span></a><a href="../src/outro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">outro.coffee</span></a><a href="../src/plugin.coffee.html" class="source selected"><span class="base_path">src / </span><span class="file_name">plugin.coffee</span></a><a href="../src/presentation.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">presentation.coffee</span></a></div></div></div><table cellpadding="0" cellspacing="0"><thead><tr><th class="docs"><h1>plugin.coffee</h1><div class="filepath">src/</div></th><th class="code"></th></tr></thead><tbody><tr id="section-1"><td class="docs"><div class="pilwrap"><a href="#section-1" class="pilcrow">&#182;</a></div><h1>Plugins</h1>
+<div id="container"><div id="background"></div><div id="jump_to">Jump To &hellip;<div id="jump_wrapper"><div id="jump_page"><a href="../index.html" class="source"><span class="file_name">README</span></a><a href="../src/application.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">application.coffee</span></a><a href="../src/controller.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">controller.coffee</span></a><a href="../src/core.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">core.coffee</span></a><a href="../src/data.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">data.coffee</span></a><a href="../src/expression.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">expression.coffee</span></a><a href="../src/facet.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">facet.coffee</span></a><a href="../src/intro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">intro.coffee</span></a><a href="../src/outro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">outro.coffee</span></a><a href="../src/plugin.coffee.html" class="source selected"><span class="base_path">src / </span><span class="file_name">plugin.coffee</span></a><a href="../src/presentation.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">presentation.coffee</span></a></div></div></div><table cellpadding="0" cellspacing="0"><thead><tr><th class="docs"><h1>plugin.coffee</h1><div class="filepath">src/</div></th><th class="code"></th></tr></thead><tbody><tr id="section-1"><td class="docs"><div class="pilwrap"><a href="#section-1" class="pilcrow">&#182;</a></div><h1>Plugins</h1>
</td><td class="code"><div class="highlight"><pre><span class="nx">MITHGrid</span><span class="p">.</span><span class="nx">namespace</span> <span class="s">&quot;Plugin&quot;</span><span class="p">,</span> <span class="nf">(exports) -&gt;</span></pre></div></td></tr><tr id="section-2"><td class="docs"><div class="pilwrap"><a href="#section-2" class="pilcrow">&#182;</a></div><p>This is the base of a plugin, which can package together various things that augment
an application.</p>
@@ -53,4 +53,4 @@
<span class="nx">that</span>
-</pre></div></td></tr></tbody></table><div id="generated">generated Tue May 15 2012 08:37:09 GMT-0400 (EDT) </div><div id="projectname"><a href="../index.html">MITHgrid</a></div></div>
+</pre></div></td></tr></tbody></table><div id="generated">generated Mon Jul 23 2012 08:51:44 GMT-0400 (EDT) </div><div id="projectname"><a href="../index.html">MITHgrid</a></div></div>
View
82 code/src/presentation.coffee.html
@@ -2,7 +2,7 @@
layout: docco
title: mithgrid/code/src/presentation.coffee.html
---
-<div id="container"><div id="background"></div><div id="jump_to">Jump To &hellip;<div id="jump_wrapper"><div id="jump_page"><a href="../index.html" class="source"><span class="file_name">README</span></a><a href="../src/application.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">application.coffee</span></a><a href="../src/controller.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">controller.coffee</span></a><a href="../src/core.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">core.coffee</span></a><a href="../src/data.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">data.coffee</span></a><a href="../src/expression-alt.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">expression-alt.coffee</span></a><a href="../src/expression.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">expression.coffee</span></a><a href="../src/facet.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">facet.coffee</span></a><a href="../src/intro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">intro.coffee</span></a><a href="../src/outro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">outro.coffee</span></a><a href="../src/plugin.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">plugin.coffee</span></a><a href="../src/presentation.coffee.html" class="source selected"><span class="base_path">src / </span><span class="file_name">presentation.coffee</span></a></div></div></div><table cellpadding="0" cellspacing="0"><thead><tr><th class="docs"><h1>presentation.coffee</h1><div class="filepath">src/</div></th><th class="code"></th></tr></thead><tbody><tr id="section-1"><td class="docs"><div class="pilwrap"><a href="#section-1" class="pilcrow">&#182;</a></div><h1>Presentations</h1>
+<div id="container"><div id="background"></div><div id="jump_to">Jump To &hellip;<div id="jump_wrapper"><div id="jump_page"><a href="../index.html" class="source"><span class="file_name">README</span></a><a href="../src/application.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">application.coffee</span></a><a href="../src/controller.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">controller.coffee</span></a><a href="../src/core.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">core.coffee</span></a><a href="../src/data.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">data.coffee</span></a><a href="../src/expression.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">expression.coffee</span></a><a href="../src/facet.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">facet.coffee</span></a><a href="../src/intro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">intro.coffee</span></a><a href="../src/outro.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">outro.coffee</span></a><a href="../src/plugin.coffee.html" class="source "><span class="base_path">src / </span><span class="file_name">plugin.coffee</span></a><a href="../src/presentation.coffee.html" class="source selected"><span class="base_path">src / </span><span class="file_name">presentation.coffee</span></a></div></div></div><table cellpadding="0" cellspacing="0"><thead><tr><th class="docs"><h1>presentation.coffee</h1><div class="filepath">src/</div></th><th class="code"></th></tr></thead><tbody><tr id="section-1"><td class="docs"><div class="pilwrap"><a href="#section-1" class="pilcrow">&#182;</a></div><h1>Presentations</h1>
</td><td class="code"><div class="highlight"><pre><span class="nx">MITHGrid</span><span class="p">.</span><span class="nx">namespace</span> <span class="s">&#39;Presentation&#39;</span><span class="p">,</span> <span class="nf">(Presentation) -&gt;</span></pre></div></td></tr><tr id="section-2"><td class="docs"><div class="pilwrap"><a href="#section-2" class="pilcrow">&#182;</a></div><h2>Presentation.initInstance</h2>
<p>Initializes a presentation instance.</p>
@@ -248,6 +248,82 @@
<span class="nx">Presentation</span><span class="p">.</span><span class="nx">namespace</span> <span class="s">&quot;SimpleText&quot;</span><span class="p">,</span> <span class="nf">(SimpleText) -&gt;</span>
<span class="nv">SimpleText.initInstance = </span><span class="nf">(args...) -&gt;</span>
- <span class="nx">MITHGrid</span><span class="p">.</span><span class="nx">Presentation</span><span class="p">.</span><span class="nx">initInstance</span> <span class="s">&quot;MITHGrid.Presentation.SimpleText&quot;</span><span class="p">,</span> <span class="nx">args</span><span class="p">...,</span> <span class="nf">(that, container) -&gt;</span>
+ <span class="nx">MITHGrid</span><span class="p">.</span><span class="nx">Presentation</span><span class="p">.</span><span class="nx">initInstance</span> <span class="s">&quot;MITHGrid.Presentation.SimpleText&quot;</span><span class="p">,</span> <span class="nx">args</span><span class="p">...,</span> <span class="nf">(that, container) -&gt;</span></pre></div></td></tr><tr id="section-19"><td class="docs"><div class="pilwrap"><a href="#section-19" class="pilcrow">&#182;</a></div><h2>Table</h2>
-</pre></div></td></tr></tbody></table><div id="generated">generated Tue May 15 2012 08:37:09 GMT-0400 (EDT) </div><div id="projectname"><a href="../index.html">MITHgrid</a></div></div>
+<p>A table presentation provides a tabular view of the data. Lenses are not used for item types. Instead,
+the data is presented based on the property type.</p>
+
+<p>Options:</p>
+
+<ul>
+<li>columns: list of columns (in the order to show)</li>
+<li>columnLabels</li>
+</ul>
+
+<p><strong>N.B.:</strong> This presentation is a work in progress.</p>
+</td><td class="code"><div class="highlight"><pre> <span class="nx">Presentation</span><span class="p">.</span><span class="nx">namespace</span> <span class="s">&quot;Table&quot;</span><span class="p">,</span> <span class="nf">(Table) -&gt;</span>
+ <span class="nv">Table.initInstance = </span><span class="nf">(args...) -&gt;</span>
+ <span class="nx">MITHGrid</span><span class="p">.</span><span class="nx">Presentation</span><span class="p">.</span><span class="nx">initInstance</span> <span class="s">&quot;MITHGrid.Presentation.Table&quot;</span><span class="p">,</span> <span class="nx">args</span><span class="p">...,</span> <span class="nf">(that, container) -&gt;</span>
+ <span class="nv">options = </span><span class="nx">that</span><span class="p">.</span><span class="nx">options</span>
+
+ <span class="nv">tableEl = </span><span class="nx">$</span><span class="p">(</span><span class="s">&quot;&lt;table&gt;&lt;/table&gt;&quot;</span><span class="p">)</span>
+ <span class="nv">headerEl = </span><span class="nx">$</span><span class="p">(</span><span class="s">&quot;&lt;tr&gt;&lt;/tr&gt;&quot;</span><span class="p">)</span>
+ <span class="nx">tableEl</span><span class="p">.</span><span class="nx">append</span><span class="p">(</span><span class="nx">headerEl</span><span class="p">)</span>
+
+ <span class="k">for</span> <span class="nx">c</span> <span class="k">in</span> <span class="nx">options</span><span class="p">.</span><span class="nx">columns</span>
+ <span class="nx">headerEl</span><span class="p">.</span><span class="nx">append</span><span class="p">(</span><span class="s">&quot;&lt;th&gt;</span><span class="si">#{</span><span class="nx">options</span><span class="p">.</span><span class="nx">columnLabels</span><span class="p">[</span><span class="nx">c</span><span class="p">]</span><span class="si">}</span><span class="s">&lt;/th&gt;&quot;</span><span class="p">)</span>
+
+ <span class="nx">$</span><span class="p">(</span><span class="nx">container</span><span class="p">).</span><span class="nx">append</span><span class="p">(</span><span class="nx">tableEl</span><span class="p">)</span>
+
+ <span class="nv">that.hasLensFor = </span><span class="o">-&gt;</span> <span class="kc">true</span>
+
+ <span class="nv">stringify_list = </span><span class="nf">(list) -&gt;</span>
+ <span class="k">if</span> <span class="nx">list</span><span class="o">?</span>
+ <span class="nv">list = </span><span class="p">[].</span><span class="nx">concat</span> <span class="nx">list</span>
+ <span class="k">if</span> <span class="nx">list</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">1</span>
+ <span class="nv">lastV = </span><span class="nx">list</span><span class="p">.</span><span class="nx">pop</span><span class="p">()</span>
+ <span class="nv">text = </span><span class="nx">list</span><span class="p">.</span><span class="nx">join</span><span class="p">(</span><span class="s">&quot;, &quot;</span><span class="p">)</span>
+ <span class="k">if</span> <span class="nx">list</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">1</span>
+ <span class="nv">text = </span><span class="nx">text</span> <span class="o">+</span> <span class="s">&quot;, and &quot;</span> <span class="o">+</span> <span class="nx">lastV</span>
+ <span class="k">else</span>
+ <span class="nv">text = </span><span class="nx">text</span> <span class="s">&quot; and &quot;</span> <span class="o">+</span> <span class="nx">lastV</span>
+ <span class="k">else</span>
+ <span class="nv">text = </span><span class="nx">list</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
+ <span class="k">else</span>
+ <span class="nv">text = </span><span class="s">&quot;&quot;</span>
+ <span class="nx">text</span>
+
+ <span class="nv">that.render = </span><span class="nf">(container, model, id) -&gt;</span>
+ <span class="nv">columns = </span><span class="p">{}</span>
+ <span class="nv">rendering = </span><span class="p">{}</span>
+ <span class="nv">el = </span><span class="nx">$</span><span class="p">(</span><span class="s">&quot;&lt;tr&gt;&lt;/tr&gt;&quot;</span><span class="p">)</span>
+ <span class="nv">rendering.el = </span><span class="nx">el</span>
+ <span class="nv">item = </span><span class="nx">model</span><span class="p">.</span><span class="nx">getItem</span> <span class="nx">id</span></pre></div></td></tr><tr id="section-20"><td class="docs"><div class="pilwrap"><a href="#section-20" class="pilcrow">&#182;</a></div><p>The <code>isEmpty</code> variable is a fix for a bug in the data store/view code that allows
+an id to report as present even when the id has been deleted. </p>
+</td><td class="code"><div class="highlight"><pre> <span class="nv">isEmpty = </span><span class="kc">true</span>
+ <span class="k">for</span> <span class="nx">c</span> <span class="k">in</span> <span class="nx">options</span><span class="p">.</span><span class="nx">columns</span>
+ <span class="nv">cel = </span><span class="nx">$</span><span class="p">(</span><span class="s">&quot;&lt;td&gt;&lt;/td&gt;&quot;</span><span class="p">)</span>
+ <span class="k">if</span> <span class="nx">item</span><span class="p">[</span><span class="nx">c</span><span class="p">]</span><span class="o">?</span>
+ <span class="nx">cel</span><span class="p">.</span><span class="nx">text</span> <span class="nx">stringify_list</span> <span class="nx">item</span><span class="p">[</span><span class="nx">c</span><span class="p">]</span>
+ <span class="nv">isEmpty = </span><span class="kc">false</span>
+
+ <span class="nx">columns</span><span class="p">[</span><span class="nx">c</span><span class="p">]</span> <span class="o">=</span> <span class="nx">cel</span>
+ <span class="nx">el</span><span class="p">.</span><span class="nx">append</span><span class="p">(</span><span class="nx">cel</span><span class="p">)</span>
+ <span class="k">if</span> <span class="o">not</span> <span class="nx">isEmpty</span>
+ <span class="nx">tableEl</span><span class="p">.</span><span class="nx">append</span><span class="p">(</span><span class="nx">el</span><span class="p">)</span>
+
+ <span class="nv">rendering.update = </span><span class="nf">(item) -&gt;</span>
+ <span class="k">for</span> <span class="nx">c</span> <span class="k">in</span> <span class="nx">options</span><span class="p">.</span><span class="nx">columns</span>
+ <span class="k">if</span> <span class="nx">item</span><span class="p">[</span><span class="nx">c</span><span class="p">]</span><span class="o">?</span>
+ <span class="nx">columns</span><span class="p">[</span><span class="nx">c</span><span class="p">].</span><span class="nx">text</span> <span class="nx">stringify_list</span> <span class="nx">item</span><span class="p">[</span><span class="nx">c</span><span class="p">]</span>
+
+ <span class="nv">rendering.remove = </span><span class="o">-&gt;</span>
+ <span class="nx">el</span><span class="p">.</span><span class="nx">hide</span><span class="p">()</span>
+ <span class="nx">el</span><span class="p">.</span><span class="nx">remove</span><span class="p">()</span>
+
+ <span class="nx">rendering</span>
+ <span class="k">else</span>
+ <span class="nx">el</span><span class="p">.</span><span class="nx">remove</span><span class="p">()</span>
+ <span class="kc">null</span>
+
+</pre></div></td></tr></tbody></table><div id="generated">generated Mon Jul 23 2012 08:51:44 GMT-0400 (EDT) </div><div id="projectname"><a href="../index.html">MITHgrid</a></div></div>
View
208 dist/mithgrid.js
@@ -163,13 +163,13 @@
MITHGridDefaults[namespace] || (MITHGridDefaults[namespace] = {});
return MITHGridDefaults[namespace] = $.extend(true, MITHGridDefaults[namespace], defaults);
};
- MITHGrid.initSynchronizer = function(callbacks) {
+ MITHGrid.initSynchronizer = function(callback) {
var counter, done, fired, that;
that = {};
counter = 1;
done = false;
fired = false;
- if (!(callbacks.done != null)) {
+ if (!(callback != null)) {
that.increment = function() {};
that.decrement = that.increment;
that.done = that.increment;
@@ -185,7 +185,7 @@
counter -= 1;
if (counter <= 0 && done && !fired) {
fired = true;
- callbacks.done;
+ callback();
}
return counter;
};
@@ -197,7 +197,7 @@
return that;
};
MITHGrid.initEventFirer = function(isPreventable, isUnicast, hasMemory) {
- var callbackFlags, callbacks, that;
+ var adder, callbackFlags, callbackFns, callbacks, firer, memory, oldAdder, oldFirer, remover, that;
that = {
isPreventable: !!isPreventable,
isUnicast: !!isUnicast,
@@ -205,20 +205,64 @@
};
callbackFlags = [];
if (that.isPreventable) callbackFlags.push("stopOnFalse");
- if (that.isUnicast) callbackFlags.push("unique");
- if (that.hasMemory) callbackFlags.push("memory");
callbacks = $.Callbacks(callbackFlags.join(" "));
- that.addListener = function(listener) {
+ adder = function(listener) {
return callbacks.add(listener);
};
- that.removeListener = function(listener) {
+ remover = function(listener) {
return callbacks.remove(listener);
};
- that.fire = function() {
+ firer = function() {
var args;
args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
return callbacks.fire.apply(callbacks, args);
};
+ if (that.isUnicast) {
+ callbackFns = [];
+ adder = function(listener) {
+ return callbackFns.push(listener);
+ };
+ remover = function(listener) {
+ var fn;
+ return callbackFns = (function() {
+ var _i, _len, _results;
+ _results = [];
+ for (_i = 0, _len = callbackFns.length; _i < _len; _i++) {
+ fn = callbackFns[_i];
+ if (fn !== listener) _results.push(fn);
+ }
+ return _results;
+ })();
+ };
+ callbacks.add(function() {
+ var args;
+ args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
+ if (callbackFns.length > 0) {
+ return callbackFns[0].apply(callbackFns, args);
+ }
+ });
+ } else if (that.hasMemory) {
+ memory = [];
+ oldAdder = adder;
+ adder = function(listener) {
+ var m, _i, _len;
+ for (_i = 0, _len = memory.length; _i < _len; _i++) {
+ m = memory[_i];
+ listener.apply(null, m);
+ }
+ return oldAdder(listener);
+ };
+ oldFirer = firer;
+ firer = function() {
+ var args;
+ args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
+ memory.push(args);
+ return oldFirer.apply(null, args);
+ };
+ }
+ that.addListener = adder;
+ that.removeListener = remover;
+ that.fire = firer;
return that;
};
initViewCounter = 0;
@@ -590,15 +634,48 @@
var _ref3;
return (_ref3 = types[nom]) != null ? _ref3 : Data.Type.initInstance(nom);
};
- that.getItem = function(id) {
- var _ref3, _ref4;
- return (_ref3 = (_ref4 = spo[id]) != null ? _ref4.values : void 0) != null ? _ref3 : {};
+ that.getItem = function(id, cb) {
+ var result, _ref3, _ref4;
+ result = (_ref3 = (_ref4 = spo[id]) != null ? _ref4.values : void 0) != null ? _ref3 : {};
+ if (cb) {
+ return cb(null, result);
+ } else {
+ return result;
+ }
};
- that.getItems = function(ids) {
- if (!$.isArray(ids)) return [that.getItem(ids)];
- return $.map(ids, function(id, idx) {
- return that.getItem(id);
- });
+ that.getItems = function(ids, cb) {
+ var id, sync, _i, _j, _len, _len2, _results;
+ if (cb != null) {
+ sync = MITHGrid.initSyncronizer(cb);
+ if (ids.length != null) {
+ for (_i = 0, _len = ids.length; _i < _len; _i++) {
+ id = ids[_i];
+ sync.increment();
+ that.getItem(id, function(err, res) {
+ cb(err, res);
+ return sync.decrement();
+ });
+ }
+ } else {
+ sync.increment();
+ that.getItem(ids, function(err, res) {
+ cb(err, res);
+ return sync.decrement();
+ });
+ }
+ return sync.done();
+ } else {
+ if (ids.length) {
+ _results = [];
+ for (_j = 0, _len2 = ids.length; _j < _len2; _j++) {
+ id = ids[_j];
+ _results.push(that.getItem(id));
+ }
+ return _results;
+ } else {
+ return [that.getItem(ids)];
+ }
+ }
};
that.removeItems = function(ids, fn) {
var id, id_list, indexRemove, indexRemoveFn, removeItem, removeValues, _i, _len;
@@ -2602,13 +2679,100 @@
return that.dataView.registerPresentation(that);
}]));
};
- return Presentation.namespace("SimpleText", function(SimpleText) {
+ Presentation.namespace("SimpleText", function(SimpleText) {
return SimpleText.initInstance = function() {
var args, _ref3;
args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
return (_ref3 = MITHGrid.Presentation).initInstance.apply(_ref3, ["MITHGrid.Presentation.SimpleText"].concat(__slice.call(args), [function(that, container) {}]));
};
});
+ return Presentation.namespace("Table", function(Table) {
+ return Table.initInstance = function() {
+ var args, _ref3;
+ args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
+ return (_ref3 = MITHGrid.Presentation).initInstance.apply(_ref3, ["MITHGrid.Presentation.Table"].concat(__slice.call(args), [function(that, container) {
+ var c, headerEl, options, stringify_list, tableEl, _i, _len, _ref3;
+ options = that.options;
+ tableEl = $("<table></table>");
+ headerEl = $("<tr></tr>");
+ tableEl.append(headerEl);
+ _ref3 = options.columns;
+ for (_i = 0, _len = _ref3.length; _i < _len; _i++) {
+ c = _ref3[_i];
+ headerEl.append("<th>" + options.columnLabels[c] + "</th>");
+ }
+ $(container).append(tableEl);
+ that.hasLensFor = function() {
+ return true;
+ };
+ stringify_list = function(list) {
+ var lastV, text;
+ if (list != null) {
+ list = [].concat(list);
+ if (list.length > 1) {
+ lastV = list.pop();
+ text = list.join(", ");
+ if (list.length > 1) {
+ text = text + ", and " + lastV;
+ } else {
+ text = text(" and " + lastV);
+ }
+ } else {
+ text = list[0];
+ }
+ } else {
+ text = "";
+ }
+ return text;
+ };
+ return that.render = function(container, model, id) {
+ var c, cel, columns, el, isEmpty, item, rendering, _j, _len2, _ref4;
+ columns = {};
+ rendering = {};
+ el = $("<tr></tr>");
+ rendering.el = el;
+ item = model.getItem(id);
+ isEmpty = true;
+ _ref4 = options.columns;
+ for (_j = 0, _len2 = _ref4.length; _j < _len2; _j++) {
+ c = _ref4[_j];
+ cel = $("<td></td>");
+ if (item[c] != null) {
+ cel.text(stringify_list(item[c]));
+ isEmpty = false;
+ columns[c] = cel;
+ }
+ el.append(cel);
+ }
+ if (!isEmpty) {
+ tableEl.append(el);
+ rendering.update = function(item) {
+ var c, _k, _len3, _ref5, _results;
+ _ref5 = options.columns;
+ _results = [];
+ for (_k = 0, _len3 = _ref5.length; _k < _len3; _k++) {
+ c = _ref5[_k];
+ if (item[c] != null) {
+ _results.push(columns[c].text(stringify_list(item[c])));
+ } else {
+ _results.push(void 0);
+ }
+ }
+ return _results;
+ };
+ rendering.remove = function() {
+ el.hide();
+ return el.remove();
+ };
+ return rendering;
+ } else {
+ el.remove();
+ return null;
+ }
+ };
+ }]));
+ };
+ });
});
MITHGrid.namespace('Facet', function(Facet) {
Facet.initInstance = function() {
@@ -2941,14 +3105,14 @@
that.run = function() {
return $(document).ready(function() {
var fn, _i, _len;
+ that.ready = function(fn) {
+ return fn();
+ };
for (_i = 0, _len = onReady.length; _i < _len; _i++) {
fn = onReady[_i];
fn();
}
- onReady = [];
- return that.ready = function(fn) {
- return fn();
- };
+ return onReady = [];
});
};
that.addDataStore = function(storeName, config) {
View
4 dist/mithgrid.min.js
@@ -35,6 +35,6 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-(function(){var a,b,c,d,e=Array.prototype.slice,f=Array.prototype.indexOf||function(a){for(var b=0,c=this.length;b<c;b++)if(b in this&&this[b]===a)return b;return-1};a=(c=this.MITHGrid)!=null?c:this.MITHGrid={},b=(d=this.jQuery)!=null?d:this.jQuery={},function(a,b){var c,d,g;(typeof console!="undefined"&&console!==null?console.log:void 0)!=null?b.debug=console.log:b.debug=function(){},b.error=function(){b.debug.call({},arguments);return{arguments:arguments}},b.deprecated=function(a,b){return function(){var c;c=1<=arguments.length?e.call(arguments,0):[],console.log("Call to deprecated function "+a+".");return b.apply(null,c)}},b.namespace=function(a,c){return d(b,a,c)},d=function(a,c,e){var f,g;f=c.split(".");while(f.length>1)a[f[0]]||(a=d(a,f[0]),f.shift());a[f[0]]==null&&(g={namespace:function(a,b){return d(g,a,b)},debug:b.debug},a[f[0]]=g),e!=null&&e(a[f[0]]);return a[f[0]]},b.globalNamespace=function(a,c){var e,f,g;e=window,e[a]||(e[a]={}),(f=e[a]).debug||(f.debug=b.debug),(g=e[a]).namespace||(g.namespace=function(b,c){return d(e[a],b,c)}),c!=null&&c(e[a]);return e[a]},b.normalizeArgs=function(){var b,c,d,f,g,h,i,j,k;b=1<=arguments.length?e.call(arguments,0):[],c=[],g=[],i=b.pop();while(a.isFunction(i)||a.isPlainObject(i))a.isFunction(i)?c.push(i):g.push(i),i=b.pop();b.push(i),c.length===0?d=function(){var a;a=1<=arguments.length?e.call(arguments,0):[]}:c.length===1?d=c[0]:d=function(){var a,b,d,f,g;b=1<=arguments.length?e.call(arguments,0):[],g=[];for(d=0,f=c.length;d<f;d++)a=c[d],g.push(a.apply(null,b));return g},g.length===0?h={}:g.length===1?h=g[0]:(g=g.reverse(),h=a.extend.apply(a,[!0,{}].concat(e.call(g)))),j=[];while(typeof b[0]=="string"){if((k=b[0].substr(0,1))==="#"||k===".")break;j.push(b.shift())}j=j.reverse(),a.isArray(b[0])&&(j=j.concat(b.shift())),b.length>0?f=b.pop():f=null;return[j,f,h,d]},c={},b.defaults=function(b,d){c[b]||(c[b]={});return c[b]=a.extend(!0,c[b],d)},b.initSynchronizer=function(a){var b,c,d,e;e={},b=1,c=!1,d=!1,a.done==null?(e.increment=function(){},e.decrement=e.increment,e.done=e.increment,e.add=function(a){}):(e.increment=function(){return b+=1},e.add=function(a){return b+=a},e.decrement=function(){b-=1,b<=0&&c&&!d&&(d=!0,a.done);return b},e.done=function(){c=!0;return e.decrement()});return e},b.initEventFirer=function(b,c,d){var f,g,h;h={isPreventable:!!b,isUnicast:!!c,hasMemory:!!d},f=[],h.isPreventable&&f.push("stopOnFalse"),h.isUnicast&&f.push("unique"),h.hasMemory&&f.push("memory"),g=a.Callbacks(f.join(" ")),h.addListener=function(a){return g.add(a)},h.removeListener=function(a){return g.remove(a)},h.fire=function(){var a;a=1<=arguments.length?e.call(arguments,0):[];return g.fire.apply(g,a)};return h},g=0,b.initInstance=function(){var d,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;d=1<=arguments.length?e.call(arguments,0):[],w=b.normalizeArgs.apply(b,d),n=w[0],l=w[1],k=w[2],j=w[3],r={_mithgrid_type:"MITHGrid"},q=[];if(n!=null){typeof n=="string"&&(n=[n]),r._mithgrid_type=n[0],n.reverse();for(u=0,v=n.length;u<v;u++){o=n[u],h=o.split("."),o=h.shift(),c[o]!=null&&q.push(c[o]);while(h.length>0)o=o+"."+h.shift(),c[o]!=null&&q.push(c[o])}}k!=null&&q.push(k),p=a.extend.apply(a,[!0,{}].concat(e.call(q))),g+=1,r.id=g,r.options=p,r.container=l,r.events={};if(r.options.events!=null){x=r.options.events;for(m in x)i=x[m],i!=null?typeof i=="string"&&(i=[i]):i=[],r.events[m]=b.initEventFirer(f.call(i,"preventable")>=0,f.call(i,"unicast")>=0,f.call(i,"memory")>=0)}r.addVariable=function(a,c){var d,e,g,h,i,j,k,l,m,n,o;o=c["default"],c.is||(c.is="rw"),f.call(c.is,"w")>=0&&(e=c.filter,n=c.validate,d=c.event||"on"+a+"Change",k=c.setter||"set"+a,h=c.locker||"lock"+a,m=c.unlocker||"unlock"+a,r.events[d]=b.initEventFirer(),e!=null?n!=null?l=function(a){a=n(e(a));if(o!==a){o=a;return r.events[d].fire(o)}}:l=function(a){a=e(a);if(o!==a){o=a;return r.events[d].fire(o)}}:n!=null?l=function(a){a=n(a);if(o!==a){o=a;return r.events[d].fire(o)}}:l=function(a){if(o!==a){o=a;return r.events[d].fire(o)}},f.call(c.is,"l")>=0&&(i=0,r[h]=function(){return i+=1},r[m]=function(){return i-=1},j=l,l=function(a){if(i===0)return j(a)}),r[k]=l);if(f.call(c.is,"r")>=0){g=c.getter||"get"+a;return r[g]=function(){return o}}};if(((y=r.options)!=null?y.variables:void 0)!=null){z=p.variables;for(s in z)k=z[s],r.addVariable(s,k)}(p!=null?p.viewSetup:void 0)!=null&&l!=null&&(t=p.viewSetup,a.isFunction(t)?a(document).ready(function(){return t(a(l))}):a(document).ready(function(){return a(l).append(t)})),j!=null&&j(r,l);return r},b.namespace("events",function(c){c.onWindowResize=b.initEventFirer(!1,!1);return a(document).ready(function(){return a(window).resize(function(){return setTimeout(b.events.onWindowResize.fire,0)})})}),b.namespace("mouse",function(b){var c;c=[],b.capture=function(b){var d;d=c[0],c.unshift(b),c.length===1&&(a(document).mousemove(function(a){a.preventDefault();return c[0].call(a,"mousemove")}),a(document).mouseup(function(a){a.preventDefault();return c[0].call(a,"mouseup")}));return d};return b.uncapture=function(){var b;b=c.shift(),c.length===0&&(a(document).unbind("mousemove"),a(document).unbind("mouseup"));return b}}),b.namespace("Data",function(c){c.namespace("Set",function(a){return a.initInstance=function(a){var b,c,d,e,f,g,h,i;g={},d={},b=0,f=!0,e=[],g.items=function(){var a;if(f){e=[];for(a in d)typeof a=="string"&&d[a]===!0&&e.push(a)}return e},g.add=function(a){if(d[a]==null){d[a]=!0,f=!0;return b+=1}},g.remove=function(a){if(d[a]!=null){delete d[a],f=!0;return b-=1}},g.empty=function(){d={},b=0,f=!1,e=[];return},g.visit=function(a){var b,c;c=[];for(b in d){if(a(b)===!0)break;c.push(void 0)}return c},g.contains=function(a){return d[a]!=null},g.size=function(){return f?g.items().length:e.length};if(a instanceof Array)for(h=0,i=a.length;h<i;h++)c=a[h],g.add(c);return g}}),c.namespace("Type",function(a){return a.initInstance=function(a){var b;return b={name:a,custom:{}}}}),c.namespace("Property",function(a){return a.initInstance=function(a){var b;return b={name:a,getValueType:function(){var a;return(a=b.valueType)!=null?a:"text"}}}}),c.namespace("Store",function(d){return d.initInstance=function(){var d;d=1<=arguments.length?e.call(arguments,0):[];return b.initInstance.apply(b,["MITHGrid.Data.Store"].concat(e.call(d),[function(d){var e,g,h,i,j,k,l,m,n,o;l=!1,m=c.Set.initInstance(),o={},k={},n={},i={},j=d.options,d.items=m.items,d.contains=m.contains,d.visit=m.visit,d.size=m.size,h=function(a,b,c,d){var e,g,h;h=a[b],h==null&&(h={values:{},counts:{}},a[b]=h),e=h.values[c],g=h.counts[c],e==null&&(e=[],h.values[c]=e);if(g==null)g={},h.counts[c]=g;else if(f.call(e,d)>=0){g[d]+=1;return}e.push(d);return g[d]=1},g=function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n;g=a[b];if(g!=null){f=g.values[c];if(f!=null){if(e!=null){m=[];for(i=0,k=f.length;i<k;i++)h=f[i],e.contains(h)?m.push(d.add(h)):m.push(void 0);return m}n=[];for(j=0,l=f.length;j<l;j++)h=f[j],n.push(d.add(h));return n}}},e=function(a,b,d,e,f){e==null&&(e=c.Set.initInstance()),b.visit(function(b){return g(a,b,d,e,f)});return e},d.addProperty=function(a,b){var d;d=c.Property.initInstance(a),(b!=null?b.valueType:void 0)!=null&&(d.valueType=b.valueType,k[a]=d);return d},d.getProperty=function(a){var b;return(b=k[a])!=null?b:c.Property.initInstance(a)},d.addType=function(a,b){var d;d=c.Type.initInstance(a),o[a]=d;return d},d.getType=function(a){var b;return(b=o[a])!=null?b:c.Type.initInstance(a)},d.getItem=function(a){var b,c;return(b=(c=n[a])!=null?c.values:void 0)!=null?b:{}},d.getItems=function(b){if(!a.isArray(b))return[d.getItem(b)];return a.map(b,function(a,b){return d.getItem(a)})},d.removeItems=function(b,c){var e,f,g,h,j,k,l,o;f=[],g=function(b,c,d,e){var f,g,h,i,j,k,l;h=b[c];if(h!=null){f=h.values[d],g=h.counts[d];if(f==null||g==null)return;g[e]-=1;if(g[e]<1){i=a.inArray(e,f),i===0?f=f.slice(1,f.length):i===f.length-1?f=f.slice(0,i):i>0&&(f=f.slice(0,i).concat(f.slice(i+1,f.length))),f.length>0?h.values[d]=f:delete h.values[d],delete g[e],k=0;for(j in g)l=g[j],k+=l;if(k===0)return delete b[c]}}},h=function(a,b,c){g(n,a,b,c);return g(i,c,b,a)},k=function(a,b,c){var d,e,f,g;g=[];for(e=0,f=c.length;e<f;e++)d=c[e],g.push(h(a,b,d));return g},j=function(b){var c,e,f,g;c=d.getItem(b),g=c.type,a.isArray(g)&&(g=g[0]);for(f in c){e=c[f];if(typeof f!="string"||f==="id"||f==="type")continue;k(b,f,e)}return k(b,"type",[g])};for(l=0,o=b.length;l<o;l++)e=b[l],j(e),f.push(e),m.remove(e);d.events.onModelChange.fire(d,f);if(c!=null)return c()},d.updateItems=function(b,c){var e,f,g,j,k,l,m,o;g=[],k=function(b,c,d,e){var f,g,h,i;h=b[c];if(h!=null){f=h.values[d],g=h.counts[d];if(f==null||g==null)return;g[e]-=1;if(g[e]<1){i=a.inArray(e,f),i===0?f=f.slice(1,f.length):i===f.length-1?f=f.slice(0,i):i>0&&(f=f.slice(0,i).concat(f.slice(i+1,f.length))),f.length>0?h.values[d]=f:delete h.values[d];return delete g[e]}}},j=function(a,b,c){h(n,a,b,c);return h(i,c,b,a)},l=function(a,b,c){k(n,a,b,c);return k(i,c,b,a)},o=function(b){var c,e,f,g,h,i,k,m,n,o;e=b.id,o=b.type,c=!1,f=function(a,b){var c,d,e;d=!0;if(a.length!==b.length)return!1;for(c=0,e=a.length;0<=e?c<e:c>e;0<=e?c++:c--)a[c]!==b[c]&&(d=!1);return d},m=function(a,b,c){var d,e,f,g;g=[];for(e=0,f=c.length;e<f;e++)d=c[e],g.push(l(a,b,d));return g},k=function(a,b,c){var d,e,f,g;g=[];for(e=0,f=c.length;e<f;e++)d=c[e],g.push(j(a,b,d));return g},a.isArray(e)&&(e=e[0]),a.isArray(o)&&(o=o[0]),h=d.getItem(e);for(i in b){g=b[i];if(typeof i!="string"||i==="id"||i==="type")continue;a.isArray(g)||(g=[g]),n=g.length,h[i]==null?(k(e,i,g),c=!0):f(g,h[i])||(c=!0,m(e,i,h[i]),k(e,i,g))}return c},d.events.onBeforeUpdating.fire(d),m=b.length,e=parseInt(m/100,10),e>500&&(e=500),e<100&&(e=100),f=function(a){var h,i,j;h=a+e,h>m&&(h=m);for(j=a;a<=h?j<h:j>h;a<=h?j++:j--)i=b[j],typeof i=="object"&&o(i)&&g.push(i.id);if(h<m)return setTimeout(function(){return f(h)},0);d.events.onAfterUpdating.fire(d),d.events.onModelChange.fire(d,g);if(c!=null)return c()};return f(0)},d.loadItems=function(c,e){var f,g,j,k,l,o;j=[],k=function(a,b,c){h(n,a,b,c);return h(i,c,b,a)},l=function(c){var d,e,f,g,h,i;if(c.id==null)throw b.error("Item entry has no id: ",c);if(c.type==null)throw b.error("Item entry has no type: ",c);d=c.id,f=c.type,a.isArray(d)&&(d=d[0]),a.isArray(f)&&(f=f[0]),m.add(d),j.push(d),k(d,"type",f),k(d,"id",d),i=[];for(e in c){g=c[e];if(typeof e!="string")continue;e!=="id"&&e!=="type"?a.isArray(g)?i.push(function(){var a,b,c;c=[];for(a=0,b=g.length;a<b;a++)h=g[a],c.push(k(d,e,h));return c}()):g!=null?i.push(k(d,e,g)):i.push(void 0):i.push(void 0)}return i},d.events.onBeforeLoading.fire(d),o=c.length,e!=null?(f=parseInt(o/100,10),f>500&&(f=500)):f=o,f<100&&(f=100),g=function(a){var b,h,i;b=a+f,b>o&&(b=o);for(i=a;a<=b?i<b:i>b;a<=b?i++:i--)h=c[i],typeof h=="object"&&l(h);if(b<o)return setTimeout(function(){return g(b)},0);d.events.onAfterLoading.fire(d),d.events.onModelChange.fire(d,j);if(e!=null)return e()};return g(0)},d.prepare=function(a){var c,e,f,g;f=b.Expression.Basic.initInstance(),e=function(){var b,d,e;e=[];for(b=0,d=a.length;b<d;b++)c=a[b],e.push(f.parse(c));return e}(),g=void 0;return{evaluate:function(a){var b,c,f,h,i;c=[],g=void 0,f=function(b){var e;e=b.evaluateOnItem(a,d),g||(g=e.valueType);return c=c.concat(e.values.items())};for(h=0,i=e.length;h<i;h++)b=e[h],f(b);return c},valueType:function(){return g}}},d.getObjectsUnion=function(a,b,c,d){return e(n,a,b,c,d)},d.getSubjectsUnion=function(a,b,c,d){return e(i,a,b,c,d)};return d.registerPresentation=function(a){d.events.onModelChange.addListener(function(b,c){return a.eventModelChange(b,c)});return a.eventModelChange(d,d.items())}}]))}}),c.namespace("View",function(a){return a.initInstance=function(){var a;a=1<=arguments.length?e.call(arguments,0):[];return b.initInstance.apply(b,["MITHGrid.Data.View"].concat(e.call(a),[function(a){var d,e,g,h,i,j,k,l,m,n;k=c.Set.initInstance(),i=a.options,e=function(b){return!1!==a.events.onFilterItem.fire(a.dataStore,b)},g=function(b){var c,d,f,g;f=a.dataStore.items(),g=f.length;if(g===0)b();else{g>200?(c=parseInt(g/100,10),c>500&&(c=500)):c=g,c<100&&(c=100),d=function(h){var i,j,l;i=h+c,i>g&&(i=g);for(j=h;h<=i?j<i:j>i;h<=i?j++:j--)l=f[j],e(l)?k.add(l):k.remove(l);if(i<g)return setTimeout(function(){return d(i)},0);a.items=k.items,a.size=k.size,a.contains=k.contains,a.visit=k.visit;if(b!=null)return b()};return d(0)}},a.registerFilter=function(b){a.events.onFilterItem.addListener(function(a,c){return b.eventFilterItem(a,c)}),a.events.onModelChange.addListener(function(a,c){return b.eventModelChange(a,c)});return b.events.onFilterChange.addListener(a.eventFilterChange)},a.registerPresentation=function(b){a.events.onModelChange.addListener(function(a,c){return b.eventModelChange(a,c)});return g(function(){return b.eventModelChange(a,a.items())})},a.items=k.items,a.contains=k.contains,a.visit=k.visit,a.size=k.size,a.eventFilterChange=function(){var b;b=c.Set.initInstance(a.items());return g(function(){var d,e,f,g,h,i,j,k;d=c.Set.initInstance(),j=b.items();for(f=0,h=j.length;f<h;f++)e=j[f],a.contains(e)||d.add(e);k=a.items();for(g=0,i=k.length;g<i;g++)e=k[g],b.contains(e)||d.add(e);if(d.size()>0)return a.events.onModelChange.fire(a,d.items())})},a.eventModelChange=function(b,d){var f,g,h,i;f=c.Set.initInstance();for(h=0,i=d.length;h<i;h++)g=d[h],b.contains(g)?e(g)?(k.add(g),f.add(g)):k.contains(g)&&(f.add(g),k.remove(g)):(f.add(g),k.remove(g));return a.events.onModelChange.fire(a,f.items())},(i!=null?(m=i.types)!=null?m.length:void 0:void 0)>0&&function(b){return a.registerFilter({eventFilterItem:function(a,c){var d,e,g,h;d=a.getItem(c);if(d.type==null)return!1;for(g=0,h=b.length;g<h;g++){e=b[g];if(f.call(d.type,e)>=0)return}return!1},eventModelChange:function(a,b){},events:{onFilterChange:{addListener:function(a){}}}})}(i.types),(i!=null?(n=i.filters)!=null?n.length:void 0:void 0)>0&&function(c){var d,e,f;f=b.Expression.Basic.initInstance(),e=function(){var a,b,e;e=[];for(a=0,b=c.length;a<b;a++)d=c[a],e.push(f.parse(d));return e}();return a.registerFilter({eventFilterItem:function(a,b){var c,d,f,g,h,i,j;for(g=0,i=e.length;g<i;g++){c=e[g],f=c.evaluateOnItem(b,a),f=f.values.items();for(h=0,j=f.length;h<j;h++){d=f[h];if(d!=="false")return}}return!1},eventModelChange:function(a,b){},events:{onFilterChange:{addListener:function(a){}}}})}(i.filters),(i!=null?i.collection:void 0)!=null&&a.registerFilter({eventFilterItem:i.collection,eventModelChange:function(a,b){},events:{onFilterChange:{addListener:function(a){}}}}),(i!=null?i.expressions:void 0)!=null&&(d=i.dataStore.prepare(i.expressions),j=a.eventModelChange,h=b.Data.Store.initInstance({}),l=b.Data.Set.initInstance(),a.eventModelChange=function(a,c){var e,g,i,k,m,n,o,p,q,r,s,t,u;m=[],o=[],i=b.Data.Set.initInstance(),i=h.getObjectsUnion(l,"mapsTo",i);for(q=0,s=c.length;q<s;q++){e=c[q];if(i.contains(e))m.push(e),a.contains(e)||(g=b.Data.Set.initInstance(),h.getSubjectsUnion(b.Data.Set.initInstance([e]),"mapsTo",g),g.visit(function(a){var b,c,d;c=h.getItem(a),d=c.mapsTo;if(d!=null){b=d.indexOf(e),b===0?d=d.slice(1,d.length):b===d.length-1?d=d.slice(0,d.length-1):b>-1&&(d=d.slice(0,b).concat(d.slice(b+1,d.length)));return h.updateItems([{id:a,mapsTo:d}])}}));else if(a.contains(e)){n=b.Data.Set.initInstance(),u=d.evaluate([e]);for(r=0,t=u.length;r<t;r++)p=u[r],n.add(p);h.contains(e)?h.updateItems([{id:e,mapsTo:n.items()}]):h.loadItems([{id:e,mapsTo:n.items()}])}else m=m.concat(h.getItem(e).mapsTo),o.push(e)}o.length>0&&h.removeItems(o),i=b.Data.Set.initInstance(),h.getObjectsUnion(l,"mapsTo",i),m=function(){var a,b,d;d=[];for(a=0,b=m.length;a<b;a++)k=m[a],f.call(c,k)>=0&&d.push(k);return d}();return j(i,m)}),a.dataStore=i.dataStore,a.getItems=a.dataStore.getItems,a.getItem=a.dataStore.getItem,a.removeItems=a.dataStore.removeItems,a.updateItems=a.dataStore.updateItems,a.loadItems=a.dataStore.loadItems,a.prepare=a.dataStore.prepare,a.addType=a.dataStore.addType,a.getType=a.dataStore.getType,a.addProperty=a.dataStore.addProperty,a.getProperty=a.dataStore.getProperty,a.getObjectsUnion=a.dataStore.getObjectsUnion,a.getSubjectsUnion=a.dataStore.getSubjectsUnion,a.dataStore.events.onModelChange.addListener(a.eventModelChange);return a.eventModelChange(a.dataStore,a.dataStore.items())}]))}}),c.namespace("SubSet",function(a){return a.initInstance=function(){var a;a=1<=arguments.length?e.call(arguments,0):[];return b.initInstance.apply(b,["MITHGrid.Data.SubSet"].concat(e.call(a),[function(a){var b,d,e,f;e=a.options,d=e.key,f=c.Set.initInstance(),a.items=f.items,a.contains=f.contains,a.visit=f.visit,a.size=f.size,a.setKey=function(b){d=b;return a.eventModelChange(e.dataStore,e.dataStore.items())},b=e.dataStore.prepare(e.expressions),a.eventModelChange=function(e,g){var h,i,j,k,l;d!=null?j=c.Set.initInstance(b.evaluate([d])):j=c.Set.initInstance(),h=[];for(k=0,l=g.length;k<l;k++)i=g[k],f.contains(i)?(h.push(i),j.contains(i)||f.remove(i)):j.contains(i)&&(f.add(i),h.push(i));if(h.length>0)return a.events.onModelChange.fire(a,h)},a.dataStore=e.dataStore,a.getItems=a.dataStore.getItems,a.getItem=a.dataStore.getItem,a.removeItems=a.dataStore.removeItems,a.fetchData=a.dataStore.fetchData,a.updateItems=a.dataStore.updateItems,a.loadItems=a.dataStore.loadItems,a.prepare=a.dataStore.prepare,a.addType=a.dataStore.addType,a.getType=a.dataStore.getType,a.addProperty=a.dataStore.addProperty,a.getProperty=a.dataStore.getProperty,a.getObjectsUnion=a.dataStore.getObjectsUnion,a.getSubjectsUnion=a.dataStore.getSubjectsUnion,a.dataStore.events.onModelChange.addListener(a.eventModelChange),a.eventModelChange(a.dataStore,a.dataStore.items());return a.registerPresentation=function(b){a.events.onModelChange.addListener(function(a,c){return b.eventModelChange(a,c)});return b.eventModelChange(a,a.items())}}]))}}),c.namespace("ListPager",function(a){return a.initInstance=function(){var a;a=1<=arguments.length?e.call(arguments,0):[];return b.initInstance.apply(b,["MITHGrid.Data.ListPager"].concat(e.call(a),[function(a){var b,d,e,g,h,i,j,k;i=a.options,d=[],e=0,g=-1,h=void 0,j=void 0,b=function(a){return d.indexOf(a)},k=c.Set.initInstance(),a.items=k.items,a.size=k.size,a.contains=k.contains,a.visit=k.visit,a.dataStore=i.dataStore,a.getItems=a.dataStore.getItems,a.getItem=a.dataStore.getItem,a.removeItems=a.dataStore.removeItems,a.fetchData=a.dataStore.fetchData,a.updateItems=a.dataStore.updateItems,a.loadItems=a.dataStore.loadItems,a.prepare=a.dataStore.prepare,a.addType=a.dataStore.addType,a.getType=a.dataStore.getType,a.addProperty=a.dataStore.addProperty,a.getProperty=a.dataStore.getProperty,a.getObjectsUnion=a.dataStore.getObjectsUnion,a.getSubjectsUnion=a.dataStore.getSubjectsUnion,a.setList=function(b){var c,h,i,j,l,m,n,o,p;d=b,c=[];for(i=0,l=d.length;i<l;i++)h=d[i],a.dataStore.contains(h)&&!k.contains(h)?e<=(n=d.indexOf(h))&&n<g&&(c.push(h),k.add(h)):k.contains(h)&&!a.dataStore.contains(h)&&(c.push(h),k.remove(h));o=k.items();for(j=0,m=o.length;j<m;j++){h=o[j];if((p=!h,f.call(d,p)>=0)||!a.dataStore.contains(h))c.push(h),k.remove(h)}if(c.length>0)return a.events.onModelChange.fire(a,c)},a.eventModelChange=function(c,d){var f,h,i,j,l;f=[];for(j=0,l=d.length;j<l;j++)h=d[j],c.contains(h)?(i=b(h),k.contains(h)?(f.push(h),(e>i||i>=g)&&k.remove(h)):e<=i&&i<g&&(k.add(h),f.push(h))):(k.remove(h),f.push(h));if(f.length>0)return a.events.onModelChange.fire(a,f)},a.setKeyRange=function(b,f){var h,i,j,l;b<f?(e=b,g=f):(e=f,g=b),l=k,h=c.Set.initInstance(),k=c.Set.initInstance(),a.items=k.items,a.size=k.size,a.contains=k.contains,a.visit=k.visit;if(e<g)for(i=e;e<=g?i<=g:i>=g;e<=g?i++:i--)j=d[i],l.contains(j)||h.add(j),k.add(j);l.visit(function(a){if(!k.contains(a))return h.add(a)});if(h.size()>0)return a.events.onModelChange.fire(a,h.items())},a.dataStore.registerPresentation(a);return a.registerPresentation=function(b){a.events.onModelChange.addListener(function(a,c){return b.eventModelChange(a,c)});return b.eventModelChange(a,a.items())}}]))}}),c.namespace("Pager",function(a){return a.initInstance=function(){var a;a=1<=arguments.length?e.call(arguments,0):[];return b.initInstance.apply(b,["MITHGrid.Data.Pager"].concat(e.call(a),[function(a){var b,d,e,f,g,h,i,j,k,l,m;k=a.options,g=[],h=-1,i=-1,j=void 0,l=void 0,e=function(a){var b,c,d;if(a==null)return 0;b=0,d=g.length-1;while(b<d)c=~~((b+d)/2),g[c][0]<a?b=c+1:g[c][0]===a?d=c:d=c-1;while(g[b]!=null&&g[b][0]<a)b+=1;return b},f=function(a){var b,c,d;if(a==null)return g.length-1;b=0,d=g.length-1;while(b<d)c=~~((b+d)/2),g[c][0]<a?b=c+1:d=c-1;while(d>=0&&g[d][0]>=a)d-=1;return d},d=function(a){var b,c;for(b=0,c=g.length;0<=c?b<c:b>c;0<=c?b++:b--)if(g[b][1]===a)return b;return-1},m=c.Set.initInstance(),a.items=m.items,a.size=m.size,a.contains=m.contains,a.visit=m.visit,a.dataStore=k.dataStore,a.getItems=a.dataStore.getItems,a.getItem=a.dataStore.getItem,a.removeItems=a.dataStore.removeItems,a.fetchData=a.dataStore.fetchData,a.updateItems=a.dataStore.updateItems,a.loadItems=a.dataStore.loadItems,a.prepare=a.dataStore.prepare,a.addType=a.dataStore.addType,a.getType=a.dataStore.getType,a.addProperty=a.dataStore.addProperty,a.getProperty=a.dataStore.getProperty,a.getObjectsUnion=a.dataStore.getObjectsUnion,a.getSubjectsUnion=a.dataStore.getSubjectsUnion,b=a.prepare(k.expressions),a.eventModelChange=function(c,k){var n,o,p,q,r,s,t;n=[];for(s=0,t=k.length;s<t;s++)p=k[s],c.contains(p)?(r=b.evaluate(p),r.length>0?(b.valueType()==="numeric"?q=parseFloat(r[0]):q=r[0],m.contains(p)?(o=d(p),o===-1?g.push([q,p]):g[o][0]=q,n.push(p),(j!=null&&q<j||l!=null&&q>=l)&&m.remove(p)):(g.push([q,p]),(j==null||q>=j)&&(l==null||q<l)&&(m.add(p),n.push(p)))):m.contains(p)&&(o=d(p),o===0?g=g.slice(1,g.length):o===g.length-1?g=g.slice(0,g.length-1):o!==-1&&(g=g.slice(0,o).concat(g.slice(o+1,g.length))),m.remove(p),n.push(p))):(m.remove(p),n.push(p));g.sort(function(a,b){if(a[0]<b[0])return-1;if(a[0]>b[0])return 1;return 0}),h=e(j),i=f(l);if(n.length>0)return a.events.onModelChange.fire(a,n)},a.setKeyRange=function(b,d){var k,n,o,p;b!=null&&d!=null?b<d?(j=b,l=d):(j=d,l=b):(j=b,l=d),h=e(j),i=f(l),k=c.Set.initInstance(),p=m,m=c.Set.initInstance(),a.items=m.items,a.size=m.size,a.contains=m.contains,a.visit=m.visit;if(h<=i)for(n=h;h<=i?n<=i:n>=i;h<=i?n++:n--)o=g[n][1],p.contains(o)||k.add(o),m.add(o);p.visit(function(a){if(!m.contains(a))return k.add(a)});if(k.size()>0)return a.events.onModelChange.fire(a,k.items())},a.dataStore.registerPresentation(a);return a.registerPresentation=function(b){a.events.onModelChange.addListener(function(a,c){return b.eventModelChange(a,c)});return b.eventModelChange(a,a.items())}}]))}});return c.namespace("RangePager",function(a){return a.initInstance=function(){var a;a=1<=arguments.length?e.call(arguments,0):[];return b.initInstance.apply(b,["MITHGrid.Data.RangePager"].concat(e.call(a),[function(a){var b,d,e,f;d=a.options,b=c.Pager.initInstance({dataStore:d.dataStore,expressions:d.leftExpressions}),e=c.Pager.initInstance({dataStore:d.dataStore,expressions:d.rightExpressions}),f=c.Set.initInstance(),a.items=f.items,a.size=f.size,a.contains=f.contains,a.visit=f.visit,a.dataStore=d.dataStore,a.getItems=a.dataStore.getItems,a.getItem=a.dataStore.getItem,a.removeItems=a.dataStore.removeItems,a.fetchData=a.dataStore.fetchData,a.updateItems=a.dataStore.updateItems,a.loadItems=a.dataStore.loadItems,a.prepare=a.dataStore.prepare,a.addType=a.dataStore.addType,a.getType=a.dataStore.getType,a.addProperty=a.dataStore.addProperty,a.getProperty=a.dataStore.getProperty,a.getObjectsUnion=a.dataStore.getObjectsUnion,a.getSubjectsUnion=a.dataStore.getSubjectsUnion,a.eventModelChange=function(c,d){var g,h,i,j;g=[];for(i=0,j=d.length;i<j;i++)h=d[i],b.contains(h)&&e.contains(h)?(g.push(h),f.add(h)):f.contains(h)&&(g.push(h),f.remove(h));return a.events.onModelChange.fire(a,g)},a.setKeyRange=function(a,c){var d;a!=null&&c!=null&&a>c&&(d=[c,a],a=d[0],c=d[1]),b.setKeyRange(void 0,c);return e.setKeyRange(a,void 0)},b.registerPresentation(a),e.registerPresentation(a),a.setKeyRange(void 0,void 0);return a.registerPresentation=function(b){a.events.onModelChange.addListener(function(a,c){return b.eventModelChange(a,c)});return b.eventModelChange(a,a.items())}}]))}})}),b.namespace("Expression.Basic",function(c){var d,e;d={},e={"+":{argumentType:"number",valueType:"number",f:function(a,b){return a+b}},"-":{argumentType:"number",valueType:"number",f:function(a,b){return a-b}},"*":{argumentType:"number",valueType:"number",f:function(a,b){return a*b}},"/":{argumentType:"number",valueType:"number",f:function(a,b){return a/b}},"=":{valueType:"boolean",f:function(a,b){return a===b}},"<>":{valueType:"boolean",f:function(a,b){return a!==b}},"><":{valueType:"boolean",f:function(a,b){return a!==b}},"<":{valueType:"boolean",f:function(a,b){return a<b}},">":{valueType:"boolean",f:function(a,b){return a>b}},"<=":{valueType:"boolean",f:function(a,b){return a<=b}},">=":{valueType:"boolean",f:function(a,b){return a>=b}}},d.controls=c.controls={"if":{f:function(a,b,c,d,e){var f,g;g=a[0].evaluate(b,c,d,e),f=!1,g.forEachValue(function(a){if(a){f=!0;return!0}});return f?a[1].evaluate(b,c,d,e):a[2].evaluate(b,c,d,e)}},foreach:{f:function(a,b,c,e,f){var g,h,i,j,k;g=a[0].evaluate(b,c,e,f),h=b.value,i=c.value,j=[],k="text",c.value=g.valueType,g.forEachValue(function(d){var g;b.value=d,g=a[1].evaluate(b,c,e,f),k=g.valueType;return g.forEachValue(function(a){return j.push(a)})}),b.value=h,c.value=i;return d.initCollection(j,k)}},"default":{f:function(a,b,c,e,f){var g,h,i,j;for(i=0,j=a.length;i<j;i++){g=a[i],h=g.evaluate(b,c,e,f);if(h.size()>0)return h}return d.initCollection([],"text")}}},d.initExpression=function(a){var b;b={},b.evaluate=function(b,c,d,e){var f;f=a.evaluate(b,c,d,e);return{values:f.getSet(),valueType:f.valueType,size:f.size}},b.evaluateOnItem=function(a,c){return b.evaluate({value:a},{value:"item"},"value",c)},b.evaluateSingle=function(b,c,d,e){var f,g;f=a.evaluate(b,c,d,e),g={value:null,valueType:f.valueType},f.forEachValue(function(a){g.value=a;return!0});return g},b.isPath=a.isPath,b.isPath?(b.getPath=function(){return a},b.testExists=function(b,c,d,e){return a.testExists(b,c,d,e)}):(b.getPath=function(){return null},b.testExists=function(a,c,d,e){return b.evaluate(a,c,d,e).values.size()>0}),b.evaluateBackward=function(b,c,d,e){return a.walkBackward([b],c,d,e)},b.walkForward=function(b,c,d){return a.walkForward(b,c,d)},b.walkBackward=function(b,c,d,e){return a.walkBackward(b,c,d,e)};return b},d.initCollection=c.initCollection=function(a,c){var d;d={valueType:c},a instanceof Array?(d.forEachValue=function(b){var c,d,e,f;f=[];for(d=0,e=a.length;d<e;d++){c=a[d];if(b(c)===!0)break;f.push(void 0)}return f},d.getSet=function(){return b.Data.Set.initInstance(a)},d.contains=function(b){return f.call(a,b)>=0},d.size=function(){return a.length}):(d.forEachValue=a.visit,d.size=a.size,d.getSet=function(){return a},d.contains=a.contains),d.isPath=!1;return d},d.initConstant=function(a,b){var c;c={},c.evaluate=function(c,e,f,g){return d.initCollection([a],b)},c.isPath=!1;return c},d.initOperator=function(a,b){var c,f,g;c={},g=a,f=b,c.evaluate=function(c,h,i,j){var k,l,m,n,o;m=[],b=[];for(n=0,o=f.length;n<o;n++)k=f[n],b.push(k.evaluate(c,h,i,j));a=e[g],l=a.f,a.argumentType==="number"?b[0].forEachValue(function(a){typeof a!="number"&&(a=parseFloat(a));return b[1].forEachValue(function(b){typeof b!="number"&&(b=parseFloat(b));return m.push(l(a,b))})}):b[0].forEachValue(function(a){return b[1].forEachValue(function(b){return m.push(l(a,b))})});return d.initCollection(m,a.valueType)},c.isPath=!1;return c},d.initFunctionCall=function(a,b){var c,e;c={},e=b,c.evaluate=function(c,f,g,h){var i,j,k,l;b=[];for(j=0,k=e.length;j<k;j++)i=e[j],b.push(i.evaluate(c,f,g,h));if(((l=d.functions[a])!=null?l.f:void 0)!=null)return d.functions[a].f(b);throw new Error("No such function named "+_name)},c.isPath=!1;return c},d.initControlCall=function(a,b){var c;c={},c.evaluate=function(c,e,f,g){return d.controls[a].f(b,c,e,f,g)},c.isPath=!1;return c},d.initPath=function(c,e){var f,g,h,i,j;f={},i=null,j=[],h=function(a,b){var e,f,g,h,i,k,l,m;g=function(c){var d;d=[],a.forEachValue(function(a){return b.getObjects(a,c.property).visit(function(a){return d.push(a)})});return d},f=function(c){var d;d=[],a.forEachValue(function(a){return b.getSubjects(a,c.property).visit(function(a){return d.push(a)})});return d};for(h=0,m=j.length;0<=m?h<m:h>m;0<=m?h++:h--)i=j[h],i.isMultiple?(e=[],i.forward?(e=g(i),c=b.getProperty(i.property),k=c!=null?c.getValueType():"text"):(e=f(i),k="item"),a=d.initCollection(e,k)):i.forward?(l=b.getObjectsUnion(a.getSet(),i.property),c=b.getProperty(i.property),k=c!=null?c.getValueType():"text",a=d.initCollection(l,k)):(l=b.getSubjectsUnion(a.getSet(),i.property),a=d.initCollection(l,"item"));return a},g=function(a,e,f){var g,h,i,k,l,m,n,o;i=function(b){var c;c=[],a.forEachValue(function(a){return f.getSubjects(a,b.property).visit(function(a){if(k>0||e==null||e.contains(a))return c.push(a)})});return c},h=function(b){var c;c=[],a.forEachValue(function(a){return f.getObjects(a,b.property).visit(function(a){if(k>0||e==null||e.contains(a))return c.push(a)})});return c},e instanceof Array&&(e=b.Data.Set.initInstance(e));for(k=o=j.length-1;o<=0?k<=0:k>=0;o<=0?k++:k--)l=j[k],l.isMultiple?(g=[],l.forward?(g=i(l),c=f.getProperty(l.property),m=c!=null?c.getValueType():"text"):(g=h(l),m="item"),a=d.initCollection(g,m)):l.forward?(n=f.getSubjectsUnion(a.getSet(),l.property,null,k===0?e:null),a=d.initCollection(n,"item")):(n=f.getObjectsUnion(a.getSet(),l.property,null,k===0?e:null),c=f.getProperty(l.property),m=c!=null?c.getValueType():"text",a=d.initCollection(n,m));return a},c!=null&&j.push({property:c,forward:e,isMultiple:!1}),f.isPath=!0,f.setRootName=function(a){return i=a},f.appendSegment=function(a,b){return j.push({property:a,forward:b[0]===".",isMultiple:b.length>1})},f.getSegment=function(a){var b;if(a<j.length){b=j[a];return{property:b.property,forward:b.forward,isMultiple:b.isMultiple}}return null},f.getLastSegment=function(){return f.getSegment(j.length-1)},f.getSegmentCount=function(){return j.length},f.rangeBackward=function(a,d,e,f){var g,h,i,k,l;i=b.Data.Set.initInstance(),k="item";if(j.length>0){h=j[j.length-1];if(h.forward)f.getSubjectsInRange(h.property,a,d,!1,i,j.length===1?e:null);else throw new Error("Last path of segment must be forward");for(g=l=j.length-2;l<=0?g<=0:g>=0;l<=0?g++:g--)h=j[g],h.forward?(i=f.getSubjectsUnion(i,h.property,null,g===0?e:null),k="item"):(i=f.getObjectsUnion(i,h.property,null,g===0?e:null),c=f.getPropertysegment.property,k=c!=null?c.getValueType():"text")}return{valueType:k,values:i,count:i.size()}},f.evaluate=function(b,c,e,f){var g,j,k,l;k=i!=null?i:e,l=c[k]!=null?c[k]:"text",g=null;if(b[k]!=null){j=b[k],a.isPlainObject(j)||j instanceof Array?g=d.initCollection(j,l):g=d.initCollection([j],l);return h(g,f)}throw new Error("No such variable called "+k)},f.testExists=function(a,b,c,d){return f.evaluate(a,b,c,d).size()>0},f.evaluateBackward=function(a,b,c,e){var f;f=d.initCollection([a],b);return g(f,c,e)},f.walkForward=function(a,b,c){return h(d.initCollection
-(a,b),c)},f.walkBackward=function(a,b,c,e){return g(d.initCollection(a,b),c,e)};return f},d.initParser=c.initInstance=function(){var a,b;b={},a=function(a,b){var c,e,f,g,h,i,j,k,l,m,n,o;m=a.token(),c=d.initScanner,g=function(){a.next();return m=a.token()},i=function(){var a;a=[h()];while(m!=null&&m.type===c.DELIMITER&&m.value===",")g(),a.push(h());return a},f=function(){return m!=null?m.start:a.index()},j=function(){var a,b;b=d.initPath();while(m!=null&&m.type===c.PATH_OPERATOR){a=m.value,g();if(m!=null&&m.type===c.IDENTIFIER)b.appendSegment(m.value,a),g();else throw new Error("Missing property ID at position "+f())}return b},h=function(){var a,b,e;e=null,a=[];if(m==null)throw new Error("Missing factor at end of expression");switch(m.type){case c.NUMBER:e=d.initConstant(m.value,"number"),g();break;case c.STRING:e=d.initConstant(m.value,"text"),g();break;case c.PATH_OPERATOR:e=j();break;case c.IDENTIFIER:b=m.value,g();if(d.controls[b]!=null){if(m==null||m.type!==c.DELIMITER||m.value!=="(")throw new Error("Missing ( to start "+b+" at position "+f());g(),m!=null&&m.type===c.DELIMITER&&m.value===")"?a=[]:a=i(),e=d.initControlCall(b,a);if(m!=null&&m.type===c.DELIMITER&&m.value===")")g();else throw new Error("Missing ) to end "+b+" at position "+f())}else if(m!=null&&m.type===c.DELIMITER&&m.value==="("){g(),m!=null&&m.type===c.DELIMITER&&m.value===")"?a=[]:a=i(),e=d.initFunctionCall(b,a);if(m!=null&&m.type===c.DELIMITER&&m.value===")")g();else throw new Error("Missing ) after function call "+b+" at position "+f())}else e=j(),e.setRootName(b);break;case c.DELIMITER:if(m.value!=="(")throw new Error("Unexpected text "+m.value+" at position "+f());g(),e=h();if(m!=null&&m.type===c.DELIMITER&&m.value===")")g();else throw new Error("Missing ) at position "+f());break;default:throw new Error("Unexpected text "+m.value+" at position "+f())}return e};if(b){l=i(),e=[];for(n=0,o=l.length;n<o;n++)k=l[n],e.push(d.initExpression(k));return e}return[d.initExpression(h())]},b.parse=function(b,c,e){var f;c==null&&(c=0),e==null&&(e={}),f=d.initScanner(b,c);try{return a(f,!1)[0]}finally{e.index=f.token()!=null?f.token().start:f.index()}};return b},d.initScanner=function(a,b){var c,e,f,g,h,i;e={},h=a+" ",g=a.length,f=b,i=null,c=function(a){return"0123456789".indexOf(a)>=0},e.token=function(){return i},e.index=function(){return f},e.next=function(){var a,b,e,j;i=null;while(f<g&&" \t\r\n".indexOf(h.charAt(f))>=0)f+=1;if(f<g){b=h.charAt(f),e=h.charAt(f+1);if(".!".indexOf(b)<0){if("<>".indexOf(b)<0){if("+-*/=".indexOf(b)<0){if("()".indexOf(b)<0){if("\"'".indexOf(b)<0){if(c(b)){j=f;while(j<g&&c(h.charAt(j)))j+=1;if(j<g&&h.charAt(j)==="."){j+=1;while(j<g&&c(h.charAt(j)))j+=1}i={type:d.initScanner.NUMBER,value:parseFloat(h.substring(f,j)),start:f,end:j};return f=j}j=f;while(j<g){a=h.charAt(j);if("(),.!@ \t".indexOf(a)>=0)break;j+=1}i={type:d.initScanner.IDENTIFIER,value:h.substring(f,j),start:f,end:j};return f=j}j=f+1;while(j<g){if(h.charAt(j)===b&&h.charAt(j-1)!=="\\")break;j+=1}if(j<g){i={type:d.initScanner.STRING,value:h.substring(f+1,j).replace(/\\'/g,"'").replace(/\\"/g,'"'),start:f,end:j+1};return f=j+1}throw new Error("Unterminated string starting at "+String(f))}i={type:d.initScanner.DELIMITER,value:b,start:f,end:f+1};return f+=1}i={type:d.initScanner.OPERATOR,value:b,start:f,end:f+1};return f+=1}if(e==="="||"<>".indexOf(e)>=0&&b!==e){i={type:d.initScanner.OPERATOR,value:b+e,start:f,end:f+2};return f+=2}i={type:d.initScanner.OPERATOR,value:b,start:f,end:f+1};return f+=1}if(e==="@"){i={type:d.initScanner.PATH_OPERATOR,value:b+e,start:f,end:f+2};return f+=2}i={type:d.initScanner.PATH_OPERATOR,value:b,start:f,end:f+1};return f+=1}},e.next();return e},d.initScanner.DELIMITER=0,d.initScanner.NUMBER=1,d.initScanner.STRING=2,d.initScanner.IDENTIFIER=3,d.initScanner.OPERATOR=4,d.initScanner.PATH_OPERATOR=5,d.functions={},d.FunctionUtilities={};return c.registerSimpleMappingFunction=function(a,c,e){return d.functions[a]={f:function(a){var f,g,h,i,j;h=b.Data.Set.initInstance(),g=function(a){return a.forEachValue(function(a){var b;b=c(a);if(b!=null)return h.add(b)})};for(i=0,j=a.length;i<j;i++)f=a[i],g(f);return d.initCollection(h,e)}}}}),b.namespace("Presentation",function(c){c.initInstance=function(){var c;c=1<=arguments.length?e.call(arguments,0):[];return b.initInstance.apply(b,["MITHGrid.Presentation"].concat(e.call(c),[function(b,c){var d,e,f,g,h;d=null,h={},f=b.options.lenses||{},g=b.options,a(c).empty(),e=void 0,g.lensKey||(g.lensKey=[".type"]),b.getLens=function(a){var b,c;e!=null&&(c=e.evaluate([a]),b=c[0]);if(b!=null&&f[b]!=null)return{render:f[b]}},b.addLens=function(a,c){f[a]=c;return b.selfRender()},b.removeLens=function(a){return delete f[a]},b.hasLens=function(a){return f[a]!=null},b.visitRenderings=function(a){var b,c;for(b in h){c=h[b];if(!1===a(b,c))return}},b.renderingFor=function(a){return h[a]},b.renderItems=function(a,f){var i,j,k;e==null&&(e=a.prepare(g.lensKey)),j=f.length,k=j,k>200&&(k=parseInt(Math.sqrt(k),10)+1),k<1&&(k=1),i=function(e){var g,l,m,o,p;if(e<j){g=e+k,g>j&&(g=j);for(m=e;e<=g?m<g:m>g;e<=g?m++:m--)o=f[m],l=a.contains(o)&&b.hasLensFor(o),h[o]!=null?l?h[o].update(a.getItem(o)):(d===o&&h[o].eventUnfocus!=null&&h[o].eventUnfocus(),h[o].remove!=null&&h[o].remove(),delete h[o]):l&&(p=b.render(c,a,o),p!=null&&(h[o]=p,d===o&&p.eventFocus!=null&&p.eventFocus()));return setTimeout(function(){return i(g)},0)}return b.finishDisplayUpdate()},b.startDisplayUpdate();return i(0)},b.render=function(a,c,d){var e;e=b.getLens(d);if(e!=null)return e.render(a,b,c,d)},b.hasLensFor=function(a){var c;c=b.getLens(a);return c!=null},b.eventModelChange=b.renderItems,b.startDisplayUpdate=function(){},b.finishDisplayUpdate=function(){},b.selfRender=function(){return b.renderItems(b.dataView,b.dataView.items())},b.eventFocusChange=function(a){var c;d!=null&&(c=b.renderingFor(d)),d!==a&&(c!=null&&c.eventUnfocus!=null&&c.eventUnfocus(),a!=null&&(c=b.renderingFor(a),c!=null&&c.eventFocus!=null&&c.eventFocus()),d=a);return d},b.getFocusedRendering=function(){return d!=null?b.renderingFor(d):null},b.dataView=b.options.dataView;return b.dataView.registerPresentation(b)}]))};return c.namespace("SimpleText",function(a){return a.initInstance=function(){var a,c;a=1<=arguments.length?e.call(arguments,0):[];return(c=b.Presentation).initInstance.apply(c,["MITHGrid.Presentation.SimpleText"].concat(e.call(a),[function(a,b){}]))}})}),b.namespace("Facet",function(c){c.initInstance=function(){var c;c=1<=arguments.length?e.call(arguments,0):[];return b.initInstance.apply(b,["MITHGrid.Facet"].concat(e.call(c),[function(b,c){var d;d=b.options,b.selfRender=function(){},b.eventFilterItem=function(a,b){return!1},b.eventModelChange=function(a,b){},b.constructFacetFrame=function(b,c){var d;d={},a(b).addClass("mithgrid-facet"),d.header=a("<div class='header' />"),c.onClearAllSelections!=null&&(d.controls=a("<div class='control' title='Clear Selection'>"),d.counter=a("<span class='counter'></span>"),d.controls.append(d.counter),d.header.append(d.controls)),d.title=a("<span class='title'></span>"),d.title.text(c.facetLabel||""),d.header.append(d.title),d.bodyFrame=a("<div class='body-frame'></div>"),d.body=a("<div class='body'></div>"),d.bodyFrame.append(d.body),a(b).append(d.header),a(b).append(d.bodyFrame),c.onClearAllSelections!=null&&d.controls.bind("click",c.onClearAllSelections),d.setSelectionCount=function(a){d.counter.innerHTML=a;return a>0?d.counter.show():d.counter.hide()};return d};return d.dataView.registerFilter(b)}]))},c.namespace("TextSearch",function(d){return d.initInstance=function(){var d;d=1<=arguments.length?e.call(arguments,0):[];return c.initInstance.apply(c,["MITHGrid.Facet.TextSearch"].concat(e.call(d),[function(c){var d,e,f,g;e=c.options,e.expressions!=null&&(a.isArray(e.expressions)||(e.expressions=[e.expressions]),g=b.Expression.Basic.initInstance(),f=function(){var a,b,c,f;c=e.expressions,f=[];for(a=0,b=c.length;a<b;a++)d=c[a],f.push(g.parse(d));return f}()),c.eventFilterItem=function(a,b){var d,g,h,i,j,k,l,m;if(c.text!=null&&e.expressions!=null)for(i=0,k=f.length;i<k;i++){d=f[i],g=d.evaluateOnItem(b,a),m=g.values.items();for(j=0,l=m.length;j<l;j++){h=m[j];if(h.toLowerCase().indexOf(c.text)>=0)return}}return!1},c.eventModelChange=function(a,b){};return c.selfRender=function(){var b,d;b=c.constructFacetFrame(container,null,{facetLabel:e.facetLabel}),a(container).addClass("mithgrid-facet-textsearch"),d=a("<input type='text'>"),b.body.append(d);return d.keyup(function(){c.text=a.trim(d.val().toLowerCase());return c.events.onFilterChange.fire()})}}]))}}),c.namespace("List",function(d){return d.initInstance=function(){var d;d=1<=arguments.length?e.call(arguments,0):[];return c.initInstance.apply(c,["MITHGrid.Facet.List"].concat(e.call(d),[function(c){var d,e,g,h;e=c.options,c.selections=[],e.expressions!=null&&(a.isArray(e.expressions)||(e.expressions=[e.expressions]),h=b.Expression.Basic.initInstance(),g=function(){var a,b,c,f;c=e.expressions,f=[];for(a=0,b=c.length;a<b;a++)d=c[a],f.push(h.parse(d));return f}()),c.eventFilterItem=function(a,b){var d,h,i,j,k,l,m,n;if(c.text!=null&&e.expressions!=null)for(j=0,l=g.length;j<l;j++){d=g[j],h=d.evaluateOnItem(b,a),n=h.values.items();for(k=0,m=n.length;k<m;k++){i=n[k];if(f.call(c.selections,i)>=0)return}}};return c.selfRender=function(){var a;return a=c.constructFacetFrame(container,null,{facetLabel:e.facetLabel,resizable:!0})}}]))}});return c.namespace("Range",function(b){return b.initInstance=function(){var b;b=1<=arguments.length?e.call(arguments,0):[];return c.initInstance.apply(c,["MITHGrid.Facet.Range"].concat(e.call(b),[function(b){var c;c=b.options,c.min==null&&(c.min=0),c.max==null&&(c.max=100),c.step==null&&(c.step=1/30);return b.selfRender=function(){var d,e;d=b.constructFacetFrame(container,null,{facetLabel:c.facetLabel,resizable:!1}),e=a("<input type='range'>"),e.attr({min:c.min,max:c.max,step:c.step}),d.body.append(e);return e.event(function(){b.value=e.val();return b.events.onFilterChange.fire()})}}]))}})}),b.namespace("Controller",function(c){c.initInstance=function(){var c;c=1<=arguments.length?e.call(arguments,0):[];return b.initInstance.apply(b,["MITHGrid.Controller"].concat(e.call(c),[function(c){var d,f;d=c.options,d.selectors==null&&(d.selectors={}),(f=d.selectors)[""]==null&&(f[""]=""),c.initBind=function(c){return b.initInstance(d.bind,function(b){var e;e={"":a(c)},b.locate=function(b){var f,g;g=d.selectors[b];if(g!=null){g===""?f=a(c):f=a(c).find(g),e[g]=f;return f}},b.fastLocate=function(a){var c;c=d.selectors[a];if(c!=null){if(e[c]!=null)return e[c];return b.locate(a)}},b.refresh=function(b){var f,g,h,i;for(h=0,i=b.length;h<i;h++)f=b[h],g=d.selectors[f],g!=null&&(g===""?e[""]=a(c):e[g]=a(c).find(g))};return b.clearCache=function(){return e={"":a(c)}}})},c.bind=function(){var a,b,d;d=arguments[0],a=2<=arguments.length?e.call(arguments,1):[],b=c.initBind(d),c.applyBindings.apply(c,[b].concat(e.call(a))),b.unbind=function(){return c.removeBindings.apply(c,[b].concat(e.call(a)))};return b},c.applyBindings=function(){var a,b;b=arguments[0],a=2<=arguments.length?e.call(arguments,1):[]};return c.removeBindings=function(){var a,b;b=arguments[0],a=2<=arguments.length?e.call(arguments,1):[]}}]))};return c.namespace("Raphael",function(a){return a.initInstance=function(){var a,c;a=1<=arguments.length?e.call(arguments,0):[];return(c=b.Controller).initInstance.apply(c,["MITHGrid.Controller.Raphael"].concat(e.call(a),[function(a){var b;b=a.initBind;return a.initBind=function(a){var c,d,e,f,g;c=b(a.node),f=c.locate,e=c.fastLocate,g=c.refresh,d=c.bind,c.locate=function(b){return b==="raphael"?a:f(b)},c.fastLocate=function(b){return b==="raphael"?a:e(b)},c.refresh=function(a){var b;a=function(){var c,d,e;e=[];for(c=0,d=a.length;c<d;c++)b=a[c],b!=="raphael"&&e.push(b);return e}();return g(a)};return c}}]))}})}),b.namespace("Application",function(c){return c.initInstance=function(){var c;c=1<=arguments.length?e.call(arguments,0):[];return b.initInstance.apply(b,["MITHGrid.Application"].concat(e.call(c),[function(c,d){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A;j=[],o=function(){return c},c.presentation={},c.facet={},c.component={},c.dataStore={},c.dataView={},c.controller={},k=c.options,c.ready=function(a){return j.push(a)},c.run=function(){return a(document).ready(function(){var a,b,d;for(b=0,d=j.length;b<d;b++)a=j[b],a();j=[];return c.ready=function(a){return a()}})},c.addDataStore=function(a,d){var e,f,g,h,i,j,k,l;c.dataStore[a]==null?(g=b.Data.Store.initInstance(),c.dataStore[a]=g,g.addType("Item"),g.addProperty("type",{valueType:"text"}),g.addProperty("id",{valueType:"text"})):g=c.dataStore[a];if((d!=null?d.types:void 0)!=null){j=d.types;for(h in j)i=j[h],g.addType(h)}if((d!=null?d.properties:void 0)!=null){k=d.properties,l=[];for(e in k)f=k[e],l.push(g.addProperty(e,f));return l}},c.addDataView=function(a,d){var e,f,g,h,i;d.type!=null&&d.type.initInstance!=null?e=d.type.initInstance:e=b.Data.View.initInstance,i={dataStore:c.dataStore[d.dataStore]||c.dataView[d.dataStore]};if(c.dataView[a]==null){for(f in d)g=d[f],f!=="type"&&!i[f]&&(i[f]=g);h=e(i);return c.dataView[a]=h}},c.addController=function(b,d){var e,f;f=a.extend(!0,{},d),f.application=o,e=d.type.initInstance(f);return c.controller[b]=e},c.addFacet=function(b,e){var f;f=a.extend(!0,{},e);return c.ready(function(){var g,h;h=a(d).find(e.container),a.isArray(h)&&(h=h[0]),f.dataView=c.dataView[e.dataView],f.application=o,g=e.type.initInstance(h,f),c.facet[b]=g;return g.selfRender()})},c.addComponent=function(b,e){var g;g=a.extend(!0,{},f);return c.ready(function(){var f,h,i,j,k,l;i=a(d).find(g.container),a.isArray(i)&&(i=i[0]),g.application=o;if(h.components!=null){g.components={},k=h.components;for(f in k)h=k[f],typeof h=="string"?g.components[f]=c.component[f]:(j=a.extend(!0,{},ccconfig),j.application=o,g.components[f]=h.type.initInstance(j))}if(h.controllers!=null){g.controllers={},l=e.controllers;for(f in l)h=l[f],typeof h=="string"?g.controllers[f]=c.controller[f]:(j=a.extend(!0,{},ccconfig),j.application=o,g.controllers[f]=h.type.initInstance(j))}return c.component[b]=h.type.initInstance(i,g)})},c.addPresentation=function(b,e){var f;f=a.extend(!0,{},e);return c.ready(function(){var g,h,i,j,k,l,m,n,p;l=a(d).find(f.container),a.isArray(l)&&(l=l[0]),f.dataView=c.dataView[e.dataView],f.application=o;if(e.components!=null){f.components={},n=e.components;for(h in n)i=n[h],typeof i=="string"?f.components[h]=c.component[h]:(j=a.extend(!0,{},ccconfig),j.application=o,f.components[h]=i.type.initInstance(j))}if(e.controllers!=null){f.controllers={},p=e.controllers;for(g in p)i=p[g],typeof i=="string"?f.controllers[g]=c.controller[g]:(k=a.extend(!0,{},i),k.application=o,f.controllers[g]=i.type.initInstance(k))}m=e.type.initInstance(l,f),c.presentation[b]=m;return m.selfRender()})},c.addPlugin=function(b){var e,f,g,h,i,j,k,l,m,n,p,q;e=a.extend(!0,{},b),e.application=o,f=e.type.initInstance(e);if(f!=null){if((e!=null?e.dataView:void 0)!=null){f.dataView=c.dataView[e.dataView],m=f.getTypes();for(k in m)l=m[k],f.dataView.addType(k);n=f.getProperties();for(i in n)j=n[i],f.dataView.addProperty(i,j)}p=f.getPresentations(),q=[];for(g in p)h=p[g],q.push(function(b,g){return c.ready(function(){var h,i,j;j=a.extend(!0,{},g.options),h=a(d).find(g.container),a.isArray(h)&&(h=h[0]),(g!=null?g.lenses:void 0)!=null&&(j.lenses=g.lenses),g.dataView!=null?j.dataView=c.dataView[g.dataView]:e.dataView!=null&&(j.dataView=c.dataView[e.dataView]),j.application=o,i=g.type.initInstance(h,j),f.presentation[b]=i;return i.selfRender()})});return q}};if((k!=null?k.dataStores:void 0)!=null){t=k.dataStores;for(n in t)g=t[n],c.addDataStore(n,g)}if((k!=null?k.dataViews:void 0)!=null){u=k.dataViews;for(q in u)p=u[q],c.addDataView(q,p)}if((k!=null?k.controllers:void 0)!=null){v=k.controllers;for(e in v)f=v[e],c.addController(e,f)}if((k!=null?k.facets:void 0)!=null){w=k.facets;for(h in w)i=w[h],c.addFacet(h,i)}if((k!=null?k.components:void 0)!=null){x=k.components;for(e in x)f=x[e],c.addComponent(e,f)}if((k!=null?k.presentations:void 0)!=null){y=k.presentations;for(l in y)m=y[l],c.addPresentation(l,m)}if((k!=null?k.plugins:void 0)!=null){z=k.plugins,A=[];for(r=0,s=z.length;r<s;r++)m=z[r],A.push(c.addPlugin(m));return A}}]))}}),b.namespace("Plugin",function(a){return a.initInstance=function(a,b){var c,d;d={options:b,presentation:{}},c=[],d.getTypes=function(){return(b!=null?b.types:void 0)!=null?b.types:[]},d.getProperties=function(){return(b!=null?b.properties:void 0)!=null?b.properties:[]},d.getComponents=function(){return(b!=null?b.components:void 0)!=null?b.components:[]},d.getPresentations=function(){return(b!=null?b.presentations:void 0)!=null?b.presentations:[]},d.ready=c.push,d.eventReady=function(a){var b,e,f;for(e=0,f=c.length;e<f;e++)b=c[e],b(a);c=[];return d.ready=function(b){return b(a)}};return d}}),b.initView=b.deprecated("MITHGrid.initView",b.initInstance),b.Data.initSet=b.deprecated("MITHGrid.Data.initSet",b.Data.Set.initInstance),b.Data.initType=b.deprecated("MITHGrid.Data.initType",b.Data.Type.initInstance),b.Data.initProperty=b.deprecated("MITHGrid.Data.initProperty",b.Data.Property.initInstance),b.Data.initStore=b.deprecated("MITHGrid.Data.initStore",b.Data.Store.initInstance),b.Data.initView=b.deprecated("MITHGrid.Data.initView",b.Data.View.initInstance),b.Presentation.initPresentation=b.deprecated("MITHGrid.Presentation.initPresentation",b.Presentation.initInstance),b.Presentation.SimpleText.initPresentation=b.deprecated("MITHGrid.Presentation.SimpleText.initPresentation",b.Presentation.SimpleText.initInstance);return b.Application.initApp=b.deprecated("MITHGrid.Application.initApp",b.Application.initInstance)}(b,a),a.defaults("MITHGrid.Data.Store",{events:{onModelChange:null,onBeforeLoading:null,onAfterLoading:null,onBeforeUpdating:null,onAfterUpdating:null}}),a.defaults("MITHGrid.Data.View",{events:{onModelChange:null,onFilterItem:"preventable"}}),a.defaults("MITHGrid.Data.SubSet",{events:{onModelChange:null}}),a.defaults("MITHGrid.Data.Pager",{events:{onModelChange:null}}),a.defaults("MITHGrid.Data.RangePager",{events:{onModelChange:null}}),a.defaults("MITHGrid.Data.ListPager",{events:{onModelChange:null}}),a.defaults("MITHGrid.Facet",{events:{onFilterChange:null}}),a.defaults("MITHGrid.Facet.TextSearch",{facetLabel:"Search",expressions:[".label"]})}).call(this)
+(function(){var a,b,c,d,e=Array.prototype.slice,f=Array.prototype.indexOf||function(a){for(var b=0,c=this.length;b<c;b++)if(b in this&&this[b]===a)return b;return-1};a=(c=this.MITHGrid)!=null?c:this.MITHGrid={},b=(d=this.jQuery)!=null?d:this.jQuery={},function(a,b){var c,d,g;(typeof console!="undefined"&&console!==null?console.log:void 0)!=null?b.debug=console.log:b.debug=function(){},b.error=function(){b.debug.call({},arguments);return{arguments:arguments}},b.deprecated=function(a,b){return function(){var c;c=1<=arguments.length?e.call(arguments,0):[],console.log("Call to deprecated function "+a+".");return b.apply(null,c)}},b.namespace=function(a,c){return d(b,a,c)},d=function(a,c,e){var f,g;f=c.split(".");while(f.length>1)a[f[0]]||(a=d(a,f[0]),f.shift());a[f[0]]==null&&(g={namespace:function(a,b){return d(g,a,b)},debug:b.debug},a[f[0]]=g),e!=null&&e(a[f[0]]);return a[f[0]]},b.globalNamespace=function(a,c){var e,f,g;e=window,e[a]||(e[a]={}),(f=e[a]).debug||(f.debug=b.debug),(g=e[a]).namespace||(g.namespace=function(b,c){return d(e[a],b,c)}),c!=null&&c(e[a]);return e[a]},b.normalizeArgs=function(){var b,c,d,f,g,h,i,j,k;b=1<=arguments.length?e.call(arguments,0):[],c=[],g=[],i=b.pop();while(a.isFunction(i)||a.isPlainObject(i))a.isFunction(i)?c.push(i):g.push(i),i=b.pop();b.push(i),c.length===0?d=function(){var a;a=1<=arguments.length?e.call(arguments,0):[]}:c.length===1?d=c[0]:d=function(){var a,b,d,f,g;b=1<=arguments.length?e.call(arguments,0):[],g=[];for(d=0,f=c.length;d<f;d++)a=c[d],g.push(a.apply(null,b));return g},g.length===0?h={}:g.length===1?h=g[0]:(g=g.reverse(),h=a.extend.apply(a,[!0,{}].concat(e.call(g)))),j=[];while(typeof b[0]=="string"){if((k=b[0].substr(0,1))==="#"||k===".")break;j.push(b.shift())}j=j.reverse(),a.isArray(b[0])&&(j=j.concat(b.shift())),b.length>0?f=b.pop():f=null;return[j,f,h,d]},c={},b.defaults=function(b,d){c[b]||(c[b]={});return c[b]=a.extend(!0,c[b],d)},b.initSynchronizer=function(a){var b,c,d,e;e={},b=1,c=!1,d=!1,a==null?(e.increment=function(){},e.decrement=e.increment,e.done=e.increment,e.add=function(a){}):(e.increment=function(){return b+=1},e.add=function(a){return b+=a},e.decrement=function(){b-=1,b<=0&&c&&!d&&(d=!0,a());return b},e.done=function(){c=!0;return e.decrement()});return e},b.initEventFirer=function(b,c,d){var f,g,h,i,j,k,l,m,n,o;o={isPreventable:!!b,isUnicast:!!c,hasMemory:!!d},g=[],o.isPreventable&&g.push("stopOnFalse"),i=a.Callbacks(g.join(" ")),f=function(a){return i.add(a)},n=function(a){return i.remove(a)},j=function(){var a;a=1<=arguments.length?e.call(arguments,0):[];return i.fire.apply(i,a)},o.isUnicast?(h=[],f=function(a){return h.push(a)},n=function(a){var b;return h=function(){var c,d,e;e=[];for(c=0,d=h.length;c<d;c++)b=h[c],b!==a&&e.push(b);return e}()},i.add(function(){var a;a=1<=arguments.length?e.call(arguments,0):[];if(h.length>0)return h[0].apply(h,a)})):o.hasMemory&&(k=[],l=f,f=function(a){var b,c,d;for(c=0,d=k.length;c<d;c++)b=k[c],a.apply(null,b);return l(a)},m=j,j=function(){var a;a=1<=arguments.length?e.call(arguments,0):[],k.push(a);return m.apply(null,a)}),o.addListener=f,o.removeListener=n,o.fire=j;return o},g=0,b.initInstance=function(){var d,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;d=1<=arguments.length?e.call(arguments,0):[],w=b.normalizeArgs.apply(b,d),n=w[0],l=w[1],k=w[2],j=w[3],r={_mithgrid_type:"MITHGrid"},q=[];if(n!=null){typeof n=="string"&&(n=[n]),r._mithgrid_type=n[0],n.reverse();for(u=0,v=n.length;u<v;u++){o=n[u],h=o.split("."),o=h.shift(),c[o]!=null&&q.push(c[o]);while(h.length>0)o=o+"."+h.shift(),c[o]!=null&&q.push(c[o])}}k!=null&&q.push(k),p=a.extend.apply(a,[!0,{}].concat(e.call(q))),g+=1,r.id=g,r.options=p,r.container=l,r.events={};if(r.options.events!=null){x=r.options.events;for(m in x)i=x[m],i!=null?typeof i=="string"&&(i=[i]):i=[],r.events[m]=b.initEventFirer(f.call(i,"preventable")>=0,f.call(i,"unicast")>=0,f.call(i,"memory")>=0)}r.addVariable=function(a,c){var d,e,g,h,i,j,k,l,m,n,o;o=c["default"],c.is||(c.is="rw"),f.call(c.is,"w")>=0&&(e=c.filter,n=c.validate,d=c.event||"on"+a+"Change",k=c.setter||"set"+a,h=c.locker||"lock"+a,m=c.unlocker||"unlock"+a,r.events[d]=b.initEventFirer(),e!=null?n!=null?l=function(a){a=n(e(a));if(o!==a){o=a;return r.events[d].fire(o)}}:l=function(a){a=e(a);if(o!==a){o=a;return r.events[d].fire(o)}}:n!=null?l=function(a){a=n(a);if(o!==a){o=a;return r.events[d].fire(o)}}:l=function(a){if(o!==a){o=a;return r.events[d].fire(o)}},f.call(c.is,"l")>=0&&(i=0,r[h]=function(){return i+=1},r[m]=function(){return i-=1},j=l,l=function(a){if(i===0)return j(a)}),r[k]=l);if(f.call(c.is,"r")>=0){g=c.getter||"get"+a;return r[g]=function(){return o}}};if(((y=r.options)!=null?y.variables:void 0)!=null){z=p.variables;for(s in z)k=z[s],r.addVariable(s,k)}(p!=null?p.viewSetup:void 0)!=null&&l!=null&&(t=p.viewSetup,a.isFunction(t)?a(document).ready(function(){return t(a(l))}):a(document).ready(function(){return a(l).append(t)})),j!=null&&j(r,l);return r},b.namespace("events",function(c){c.onWindowResize=b.initEventFirer(!1,!1);return a(document).ready(function(){return a(window).resize(function(){return setTimeout(b.events.onWindowResize.fire,0)})})}),b.namespace("mouse",function(b){var c;c=[],b.capture=function(b){var d;d=c[0],c.unshift(b),c.length===1&&(a(document).mousemove(function(a){a.preventDefault();return c[0].call(a,"mousemove")}),a(document).mouseup(function(a){a.preventDefault();return c[0].call(a,"mouseup")}));return d};return b.uncapture=function(){var b;b=c.shift(),c.length===0&&(a(document).unbind("mousemove"),a(document).unbind("mouseup"));return b}}),b.namespace("Data",function(c){c.namespace("Set",function(a){return a.initInstance=function(a){var b,c,d,e,f,g,h,i;g={},d={},b=0,f=!0,e=[],g.items=function(){var a;if(f){e=[];for(a in d)typeof a=="string"&&d[a]===!0&&e.push(a)}return e},g.add=function(a){if(d[a]==null){d[a]=!0,f=!0;return b+=1}},g.remove=function(a){if(d[a]!=null){delete d[a],f=!0;return b-=1}},g.empty=function(){d={},b=0,f=!1,e=[];return},g.visit=function(a){var b,c;c=[];for(b in d){if(a(b)===!0)break;c.push(void 0)}return c},g.contains=function(a){return d[a]!=null},g.size=function(){return f?g.items().length:e.length};if(a instanceof Array)for(h=0,i=a.length;h<i;h++)c=a[h],g.add(c);return g}}),c.namespace("Type",function(a){return a.initInstance=function(a){var b;return b={name:a,custom:{}}}}),c.namespace("Property",function(a){return a.initInstance=function(a){var b;return b={name:a,getValueType:function(){var a;return(a=b.valueType)!=null?a:"text"}}}}),c.namespace("Store",function(d){return d.initInstance=function(){var d;d=1<=arguments.length?e.call(arguments,0):[];return b.initInstance.apply(b,["MITHGrid.Data.Store"].concat(e.call(d),[function(d){var e,g,h,i,j,k,l,m,n,o;l=!1,m=c.Set.initInstance(),o={},k={},n={},i={},j=d.options,d.items=m.items,d.contains=m.contains,d.visit=m.visit,d.size=m.size,h=function(a,b,c,d){var e,g,h;h=a[b],h==null&&(h={values:{},counts:{}},a[b]=h),e=h.values[c],g=h.counts[c],e==null&&(e=[],h.values[c]=e);if(g==null)g={},h.counts[c]=g;else if(f.call(e,d)>=0){g[d]+=1;return}e.push(d);return g[d]=1},g=function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n;g=a[b];if(g!=null){f=g.values[c];if(f!=null){if(e!=null){m=[];for(i=0,k=f.length;i<k;i++)h=f[i],e.contains(h)?m.push(d.add(h)):m.push(void 0);return m}n=[];for(j=0,l=f.length;j<l;j++)h=f[j],n.push(d.add(h));return n}}},e=function(a,b,d,e,f){e==null&&(e=c.Set.initInstance()),b.visit(function(b){return g(a,b,d,e,f)});return e},d.addProperty=function(a,b){var d;d=c.Property.initInstance(a),(b!=null?b.valueType:void 0)!=null&&(d.valueType=b.valueType,k[a]=d);return d},d.getProperty=function(a){var b;return(b=k[a])!=null?b:c.Property.initInstance(a)},d.addType=function(a,b){var d;d=c.Type.initInstance(a),o[a]=d;return d},d.getType=function(a){var b;return(b=o[a])!=null?b:c.Type.initInstance(a)},d.getItem=function(a,b){var c,d,e;c=(d=(e=n[a])!=null?e.values:void 0)!=null?d:{};return b?b(null,c):c},d.getItems=function(a,c){var e,f,g,h,i,j,k;if(c!=null){f=b.initSyncronizer(c);if(a.length!=null)for(g=0,i=a.length;g<i;g++)e=a[g],f.increment(),d.getItem(e,function(a,b){c(a,b);return f.decrement()});else f.increment(),d.getItem(a,function(a,b){c(a,b);return f.decrement()});return f.done()}if(a.length){k=[];for(h=0,j=a.length;h<j;h++)e=a[h],k.push(d.getItem(e));return k}return[d.getItem(a)]},d.removeItems=function(b,c){var e,f,g,h,j,k,l,o;f=[],g=function(b,c,d,e){var f,g,h,i,j,k,l;h=b[c];if(h!=null){f=h.values[d],g=h.counts[d];if(f==null||g==null)return;g[e]-=1;if(g[e]<1){i=a.inArray(e,f),i===0?f=f.slice(1,f.length):i===f.length-1?f=f.slice(0,i):i>0&&(f=f.slice(0,i).concat(f.slice(i+1,f.length))),f.length>0?h.values[d]=f:delete h.values[d],delete g[e],k=0;for(j in g)l=g[j],k+=l;if(k===0)return delete b[c]}}},h=function(a,b,c){g(n,a,b,c);return g(i,c,b,a)},k=function(a,b,c){var d,e,f,g;g=[];for(e=0,f=c.length;e<f;e++)d=c[e],g.push(h(a,b,d));return g},j=function(b){var c,e,f,g;c=d.getItem(b),g=c.type,a.isArray(g)&&(g=g[0]);for(f in c){e=c[f];if(typeof f!="string"||f==="id"||f==="type")continue;k(b,f,e)}return k(b,"type",[g])};for(l=0,o=b.length;l<o;l++)e=b[l],j(e),f.push(e),m.remove(e);d.events.onModelChange.fire(d,f);if(c!=null)return c()},d.updateItems=function(b,c){var e,f,g,j,k,l,m,o;g=[],k=function(b,c,d,e){var f,g,h,i;h=b[c];if(h!=null){f=h.values[d],g=h.counts[d];if(f==null||g==null)return;g[e]-=1;if(g[e]<1){i=a.inArray(e,f),i===0?f=f.slice(1,f.length):i===f.length-1?f=f.slice(0,i):i>0&&(f=f.slice(0,i).concat(f.slice(i+1,f.length))),f.length>0?h.values[d]=f:delete h.values[d];return delete g[e]}}},j=function(a,b,c){h(n,a,b,c);return h(i,c,b,a)},l=function(a,b,c){k(n,a,b,c);return k(i,c,b,a)},o=function(b){var c,e,f,g,h,i,k,m,n,o;e=b.id,o=b.type,c=!1,f=function(a,b){var c,d,e;d=!0;if(a.length!==b.length)return!1;for(c=0,e=a.length;0<=e?c<e:c>e;0<=e?c++:c--)a[c]!==b[c]&&(d=!1);return d},m=function(a,b,c){var d,e,f,g;g=[];for(e=0,f=c.length;e<f;e++)d=c[e],g.push(l(a,b,d));return g},k=function(a,b,c){var d,e,f,g;g=[];for(e=0,f=c.length;e<f;e++)d=c[e],g.push(j(a,b,d));return g},a.isArray(e)&&(e=e[0]),a.isArray(o)&&(o=o[0]),h=d.getItem(e);for(i in b){g=b[i];if(typeof i!="string"||i==="id"||i==="type")continue;a.isArray(g)||(g=[g]),n=g.length,h[i]==null?(k(e,i,g),c=!0):f(g,h[i])||(c=!0,m(e,i,h[i]),k(e,i,g))}return c},d.events.onBeforeUpdating.fire(d),m=b.length,e=parseInt(m/100,10),e>500&&(e=500),e<100&&(e=100),f=function(a){var h,i,j;h=a+e,h>m&&(h=m);for(j=a;a<=h?j<h:j>h;a<=h?j++:j--)i=b[j],typeof i=="object"&&o(i)&&g.push(i.id);if(h<m)return setTimeout(function(){return f(h)},0);d.events.onAfterUpdating.fire(d),d.events.onModelChange.fire(d,g);if(c!=null)return c()};return f(0)},d.loadItems=function(c,e){var f,g,j,k,l,o;j=[],k=function(a,b,c){h(n,a,b,c);return h(i,c,b,a)},l=function(c){var d,e,f,g,h,i;if(c.id==null)throw b.error("Item entry has no id: ",c);if(c.type==null)throw b.error("Item entry has no type: ",c);d=c.id,f=c.type,a.isArray(d)&&(d=d[0]),a.isArray(f)&&(f=f[0]),m.add(d),j.push(d),k(d,"type",f),k(d,"id",d),i=[];for(e in c){g=c[e];if(typeof e!="string")continue;e!=="id"&&e!=="type"?a.isArray(g)?i.push(function(){var a,b,c;c=[];for(a=0,b=g.length;a<b;a++)h=g[a],c.push(k(d,e,h));return c}()):g!=null?i.push(k(d,e,g)):i.push(void 0):i.push(void 0)}return i},d.events.onBeforeLoading.fire(d),o=c.length,e!=null?(f=parseInt(o/100,10),f>500&&(f=500)):f=o,f<100&&(f=100),g=function(a){var b,h,i;b=a+f,b>o&&(b=o);for(i=a;a<=b?i<b:i>b;a<=b?i++:i--)h=c[i],typeof h=="object"&&l(h);if(b<o)return setTimeout(function(){return g(b)},0);d.events.onAfterLoading.fire(d),d.events.onModelChange.fire(d,j);if(e!=null)return e()};return g(0)},d.prepare=function(a){var c,e,f,g;f=b.Expression.Basic.initInstance(),e=function(){var b,d,e;e=[];for(b=0,d=a.length;b<d;b++)c=a[b],e.push(f.parse(c));return e}(),g=void 0;return{evaluate:function(a){var b,c,f,h,i;c=[],g=void 0,f=function(b){var e;e=b.evaluateOnItem(a,d),g||(g=e.valueType);return c=c.concat(e.values.items())};for(h=0,i=e.length;h<i;h++)b=e[h],f(b);return c},valueType:function(){return g}}},d.getObjectsUnion=function(a,b,c,d){return e(n,a,b,c,d)},d.getSubjectsUnion=function(a,b,c,d){return e(i,a,b,c,d)};return d.registerPresentation=function(a){d.events.onModelChange.addListener(function(b,c){return a.eventModelChange(b,c)});return a.eventModelChange(d,d.items())}}]))}}),c.namespace("View",function(a){return a.initInstance=function(){var a;a=1<=arguments.length?e.call(arguments,0):[];return b.initInstance.apply(b,["MITHGrid.Data.View"].concat(e.call(a),[function(a){var d,e,g,h,i,j,k,l,m,n;k=c.Set.initInstance(),i=a.options,e=function(b){return!1!==a.events.onFilterItem.fire(a.dataStore,b)},g=function(b){var c,d,f,g;f=a.dataStore.items(),g=f.length;if(g===0)b();else{g>200?(c=parseInt(g/100,10),c>500&&(c=500)):c=g,c<100&&(c=100),d=function(h){var i,j,l;i=h+c,i>g&&(i=g);for(j=h;h<=i?j<i:j>i;h<=i?j++:j--)l=f[j],e(l)?k.add(l):k.remove(l);if(i<g)return setTimeout(function(){return d(i)},0);a.items=k.items,a.size=k.size,a.contains=k.contains,a.visit=k.visit;if(b!=null)return b()};return d(0)}},a.registerFilter=function(b){a.events.onFilterItem.addListener(function(a,c){return b.eventFilterItem(a,c)}),a.events.onModelChange.addListener(function(a,c){return b.eventModelChange(a,c)});return b.events.onFilterChange.addListener(a.eventFilterChange)},a.registerPresentation=function(b){a.events.onModelChange.addListener(function(a,c){return b.eventModelChange(a,c)});return g(function(){return b.eventModelChange(a,a.items())})},a.items=k.items,a.contains=k.contains,a.visit=k.visit,a.size=k.size,a.eventFilterChange=function(){var b;b=c.Set.initInstance(a.items());return g(function(){var d,e,f,g,h,i,j,k;d=c.Set.initInstance(),j=b.items();for(f=0,h=j.length;f<h;f++)e=j[f],a.contains(e)||d.add(e);k=a.items();for(g=0,i=k.length;g<i;g++)e=k[g],b.contains(e)||d.add(e);if(d.size()>0)return a.events.onModelChange.fire(a,d.items())})},a.eventModelChange=function(b,d){var f,g,h,i;f=c.Set.initInstance();for(h=0,i=d.length;h<i;h++)g=d[h],b.contains(g)?e(g)?(k.add(g),f.add(g)):k.contains(g)&&(f.add(g),k.remove(g)):(f.add(g),k.remove(g));return a.events.onModelChange.fire(a,f.items())},(i!=null?(m=i.types)!=null?m.length:void 0:void 0)>0&&function(b){return a.registerFilter({eventFilterItem:function(a,c){var d,e,g,h;d=a.getItem(c);if(d.type==null)return!1;for(g=0,h=b.length;g<h;g++){e=b[g];if(f.call(d.type,e)>=0)return}return!1},eventModelChange:function(a,b){},events:{onFilterChange:{addListener:function(a){}}}})}(i.types),(i!=null?(n=i.filters)!=null?n.length:void 0:void 0)>0&&function(c){var d,e,f;f=b.Expression.Basic.initInstance(),e=function(){var a,b,e;e=[];for(a=0,b=c.length;a<b;a++)d=c[a],e.push(f.parse(d));return e}();return a.registerFilter({eventFilterItem:function(a,b){var c,d,f,g,h,i,j;for(g=0,i=e.length;g<i;g++){c=e[g],f=c.evaluateOnItem(b,a),f=f.values.items();for(h=0,j=f.length;h<j;h++){d=f[h];if(d!=="false")return}}return!1},eventModelChange:function(a,b){},events:{onFilterChange:{addListener:function(a){}}}})}(i.filters),(i!=null?i.collection:void 0)!=null&&a.registerFilter({eventFilterItem:i.collection,eventModelChange:function(a,b){},events:{onFilterChange:{addListener:function(a){}}}}),(i!=null?i.expressions:void 0)!=null&&(d=i.dataStore.prepare(i.expressions),j=a.eventModelChange,h=b.Data.Store.initInstance({}),l=b.Data.Set.initInstance(),a.eventModelChange=function(a,c){var e,g,i,k,m,n,o,p,q,r,s,t,u;m=[],o=[],i=b.Data.Set.initInstance(),i=h.getObjectsUnion(l,"mapsTo",i);for(q=0,s=c.length;q<s;q++){e=c[q];if(i.contains(e))m.push(e),a.contains(e)||(g=b.Data.Set.initInstance(),h.getSubjectsUnion(b.Data.Set.initInstance([e]),"mapsTo",g),g.visit(function(a){var b,c,d;c=h.getItem(a),d=c.mapsTo;if(d!=null){b=d.indexOf(e),b===0?d=d.slice(1,d.length):b===d.length-1?d=d.slice(0,d.length-1):b>-1&&(d=d.slice(0,b).concat(d.slice(b+1,d.length)));return h.updateItems([{id:a,mapsTo:d}])}}));else if(a.contains(e)){n=b.Data.Set.initInstance(),u=d.evaluate([e]);for(r=0,t=u.length;r<t;r++)p=u[r],n.add(p);h.contains(e)?h.updateItems([{id:e,mapsTo:n.items()}]):h.loadItems([{id:e,mapsTo:n.items()}])}else m=m.concat(h.getItem(e).mapsTo),o.push(e)}o.length>0&&h.removeItems(o),i=b.Data.Set.initInstance(),h.getObjectsUnion(l,"mapsTo",i),m=function(){var a,b,d;d=[];for(a=0,b=m.length;a<b;a++)k=m[a],f.call(c,k)>=0&&d.push(k);return d}();return j(i,m)}),a.dataStore=i.dataStore,a.getItems=a.dataStore.getItems,a.getItem=a.dataStore.getItem,a.removeItems=a.dataStore.removeItems,a.updateItems=a.dataStore.updateItems,a.loadItems=a.dataStore.loadItems,a.prepare=a.dataStore.prepare,a.addType=a.dataStore.addType,a.getType=a.dataStore.getType,a.addProperty=a.dataStore.addProperty,a.getProperty=a.dataStore.getProperty,a.getObjectsUnion=a.dataStore.getObjectsUnion,a.getSubjectsUnion=a.dataStore.getSubjectsUnion,a.dataStore.events.onModelChange.addListener(a.eventModelChange);return a.eventModelChange(a.dataStore,a.dataStore.items())}]))}}),c.namespace("SubSet",function(a){return a.initInstance=function(){var a;a=1<=arguments.length?e.call(arguments,0):[];return b.initInstance.apply(b,["MITHGrid.Data.SubSet"].concat(e.call(a),[function(a){var b,d,e,f;e=a.options,d=e.key,f=c.Set.initInstance(),a.items=f.items,a.contains=f.contains,a.visit=f.visit,a.size=f.size,a.setKey=function(b){d=b;return a.eventModelChange(e.dataStore,e.dataStore.items())},b=e.dataStore.prepare(e.expressions),a.eventModelChange=function(e,g){var h,i,j,k,l;d!=null?j=c.Set.initInstance(b.evaluate([d])):j=c.Set.initInstance(),h=[];for(k=0,l=g.length;k<l;k++)i=g[k],f.contains(i)?(h.push(i),j.contains(i)||f.remove(i)):j.contains(i)&&(f.add(i),h.push(i));if(h.length>0)return a.events.onModelChange.fire(a,h)},a.dataStore=e.dataStore,a.getItems=a.dataStore.getItems,a.getItem=a.dataStore.getItem,a.removeItems=a.dataStore.removeItems,a.fetchData=a.dataStore.fetchData,a.updateItems=a.dataStore.updateItems,a.loadItems=a.dataStore.loadItems,a.prepare=a.dataStore.prepare,a.addType=a.dataStore.addType,a.getType=a.dataStore.getType,a.addProperty=a.dataStore.addProperty,a.getProperty=a.dataStore.getProperty,a.getObjectsUnion=a.dataStore.getObjectsUnion,a.getSubjectsUnion=a.dataStore.getSubjectsUnion,a.dataStore.events.onModelChange.addListener(a.eventModelChange),a.eventModelChange(a.dataStore,a.dataStore.items());return a.registerPresentation=function(b){a.events.onModelChange.addListener(function(a,c){return b.eventModelChange(a,c)});return b.eventModelChange(a,a.items())}}]))}}),c.namespace("ListPager",function(a){return a.initInstance=function(){var a;a=1<=arguments.length?e.call(arguments,0):[];return b.initInstance.apply(b,["MITHGrid.Data.ListPager"].concat(e.call(a),[function(a){var b,d,e,g,h,i,j,k;i=a.options,d=[],e=0,g=-1,h=void 0,j=void 0,b=function(a){return d.indexOf(a)},k=c.Set.initInstance(),a.items=k.items,a.size=k.size,a.contains=k.contains,a.visit=k.visit,a.dataStore=i.dataStore,a.getItems=a.dataStore.getItems,a.getItem=a.dataStore.getItem,a.removeItems=a.dataStore.removeItems,a.fetchData=a.dataStore.fetchData,a.updateItems=a.dataStore.updateItems,a.loadItems=a.dataStore.loadItems,a.prepare=a.dataStore.prepare,a.addType=a.dataStore.addType,a.getType=a.dataStore.getType,a.addProperty=a.dataStore.addProperty,a.getProperty=a.dataStore.getProperty,a.getObjectsUnion=a.dataStore.getObjectsUnion,a.getSubjectsUnion=a.dataStore.getSubjectsUnion,a.setList=function(b){var c,h,i,j,l,m,n,o,p;d=b,c=[];for(i=0,l=d.length;i<l;i++)h=d[i],a.dataStore.contains(h)&&!k.contains(h)?e<=(n=d.indexOf(h))&&n<g&&(c.push(h),k.add(h)):k.contains(h)&&!a.dataStore.contains(h)&&(c.push(h),k.remove(h));o=k.items();for(j=0,m=o.length;j<m;j++){h=o[j];if((p=!h,f.call(d,p)>=0)||!a.dataStore.contains(h))c.push(h),k.remove(h)}if(c.length>0)return a.events.onModelChange.fire(a,c)},a.eventModelChange=function(c,d){var f,h,i,j,l;f=[];for(j=0,l=d.length;j<l;j++)h=d[j],c.contains(h)?(i=b(h),k.contains(h)?(f.push(h),(e>i||i>=g)&&k.remove(h)):e<=i&&i<g&&(k.add(h),f.push(h))):(k.remove(h),f.push(h));if(f.length>0)return a.events.onModelChange.fire(a,f)},a.setKeyRange=function(b,f){var h,i,j,l;b<f?(e=b,g=f):(e=f,g=b),l=k,h=c.Set.initInstance(),k=c.Set.initInstance(),a.items=k.items,a.size=k.size,a.contains=k.contains,a.visit=k.visit;if(e<g)for(i=e;e<=g?i<=g:i>=g;e<=g?i++:i--)j=d[i],l.contains(j)||h.add(j),k.add(j);l.visit(function(a){if(!k.contains(a))return h.add(a)});if(h.size()>0)return a.events.onModelChange.fire(a,h.items())},a.dataStore.registerPresentation(a);return a.registerPresentation=function(b){a.events.onModelChange.addListener(function(a,c){return b.eventModelChange(a,c)});return b.eventModelChange(a,a.items())}}]))}}),c.namespace("Pager",function(a){return a.initInstance=function(){var a;a=1<=arguments.length?e.call(arguments,0):[];return b.initInstance.apply(b,["MITHGrid.Data.Pager"].concat(e.call(a),[function(a){var b,d,e,f,g,h,i,j,k,l,m;k=a.options,g=[],h=-1,i=-1,j=void 0,l=void 0,e=function(a){var b,c,d;if(a==null)return 0;b=0,d=g.length-1;while(b<d)c=~~((b+d)/2),g[c][0]<a?b=c+1:g[c][0]===a?d=c:d=c-1;while(g[b]!=null&&g[b][0]<a)b+=1;return b},f=function(a){var b,c,d;if(a==null)return g.length-1;b=0,d=g.length-1;while(b<d)c=~~((b+d)/2),g[c][0]<a?b=c+1:d=c-1;while(d>=0&&g[d][0]>=a)d-=1;return d},d=function(a){var b,c;for(b=0,c=g.length;0<=c?b<c:b>c;0<=c?b++:b--)if(g[b][1]===a)return b;return-1},m=c.Set.initInstance(),a.items=m.items,a.size=m.size,a.contains=m.contains,a.visit=m.visit,a.dataStore=k.dataStore,a.getItems=a.dataStore.getItems,a.getItem=a.dataStore.getItem,a.removeItems=a.dataStore.removeItems,a.fetchData=a.dataStore.fetchData,a.updateItems=a.dataStore.updateItems,a.loadItems=a.dataStore.loadItems,a.prepare=a.dataStore.prepare,a.addType=a.dataStore.addType,a.getType=a.dataStore.getType,a.addProperty=a.dataStore.addProperty,a.getProperty=a.dataStore.getProperty,a.getObjectsUnion=a.dataStore.getObjectsUnion,a.getSubjectsUnion=a.dataStore.getSubjectsUnion,b=a.prepare(k.expressions),a.eventModelChange=function(c,k){var n,o,p,q,r,s,t;n=[];for(s=0,t=k.length;s<t;s++)p=k[s],c.contains(p)?(r=b.evaluate(p),r.length>0?(b.valueType()==="numeric"?q=parseFloat(r[0]):q=r[0],m.contains(p)?(o=d(p),o===-1?g.push([q,p]):g[o][0]=q,n.push(p),(j!=null&&q<j||l!=null&&q>=l)&&m.remove(p)):(g.push([q,p]),(j==null||q>=j)&&(l==null||q<l)&&(m.add(p),n.push(p)))):m.contains(p)&&(o=d(p),o===0?g=g.slice(1,g.length):o===g.length-1?g=g.slice(0,g.length-1):o!==-1&&(g=g.slice(0,o).concat(g.slice(o+1,g.length))),m.remove(p),n.push(p))):(m.remove(p),n.push(p));g.sort(function(a,b){if(a[0]<b[0])return-1;if(a[0]>b[0])return 1;return 0}),h=e(j),i=f(l);if(n.length>0)return a.events.onModelChange.fire(a,n)},a.setKeyRange=function(b,d){var k,n,o,p;b!=null&&d!=null?b<d?(j=b,l=d):(j=d,l=b):(j=b,l=d),h=e(j),i=f(l),k=c.Set.initInstance(),p=m,m=c.Set.initInstance(),a.items=m.items,a.size=m.size,a.contains=m.contains,a.visit=m.visit;if(h<=i)for(n=h;h<=i?n<=i:n>=i;h<=i?n++:n--)o=g[n][1],p.contains(o)||k.add(o),m.add(o);p.visit(function(a){if(!m.contains(a))return k.add(a)});if(k.size()>0)return a.events.onModelChange.fire(a,k.items())},a.dataStore.registerPresentation(a);return a.registerPresentation=function(b){a.events.onModelChange.addListener(function(a,c){return b.eventModelChange(a,c)});return b.eventModelChange(a,a.items())}}]))}});return c.namespace("RangePager",function(a){return a.initInstance=function(){var a;a=1<=arguments.length?e.call(arguments,0):[];return b.initInstance.apply(b,["MITHGrid.Data.RangePager"].concat(e.call(a),[function(a){var b,d,e,f;d=a.options,b=c.Pager.initInstance({dataStore:d.dataStore,expressions:d.leftExpressions}),e=c.Pager.initInstance({dataStore:d.dataStore,expressions:d.rightExpressions}),f=c.Set.initInstance(),a.items=f.items,a.size=f.size,a.contains=f.contains,a.visit=f.visit,a.dataStore=d.dataStore,a.getItems=a.dataStore.getItems,a.getItem=a.dataStore.getItem,a.removeItems=a.dataStore.removeItems,a.fetchData=a.dataStore.fetchData,a.updateItems=a.dataStore.updateItems,a.loadItems=a.dataStore.loadItems,a.prepare=a.dataStore.prepare,a.addType=a.dataStore.addType,a.getType=a.dataStore.getType,a.addProperty=a.dataStore.addProperty,a.getProperty=a.dataStore.getProperty,a.getObjectsUnion=a.dataStore.getObjectsUnion,a.getSubjectsUnion=a.dataStore.getSubjectsUnion,a.eventModelChange=function(c,d){var g,h,i,j;g=[];for(i=0,j=d.length;i<j;i++)h=d[i],b.contains(h)&&e.contains(h)?(g.push(h),f.add(h)):f.contains(h)&&(g.push(h),f.remove(h));return a.events.onModelChange.fire(a,g)},a.setKeyRange=function(a,c){var d;a!=null&&c!=null&&a>c&&(d=[c,a],a=d[0],c=d[1]),b.setKeyRange(void 0,c);return e.setKeyRange(a,void 0)},b.registerPresentation(a),e.registerPresentation(a),a.setKeyRange(void 0,void 0);return a.registerPresentation=function(b){a.events.onModelChange.addListener(function(a,c){return b.eventModelChange(a,c)});return b.eventModelChange(a,a.items())}}]))}})}),b.namespace("Expression.Basic",function(c){var d,e;d={},e={"+":{argumentType:"number",valueType:"number",f:function(a,b){return a+b}},"-":{argumentType:"number",valueType:"number",f:function(a,b){return a-b}},"*":{argumentType:"number",valueType:"number",f:function(a,b){return a*b}},"/":{argumentType:"number",valueType:"number",f:function(a,b){return a/b}},"=":{valueType:"boolean",f:function(a,b){return a===b}},"<>":{valueType:"boolean",f:function(a,b){return a!==b}},"><":{valueType:"boolean",f:function(a,b){return a!==b}},"<":{valueType:"boolean",f:function(a,b){return a<b}},">":{valueType:"boolean",f:function(a,b){return a>b}},"<=":{valueType:"boolean",f:function(a,b){return a<=b}},">=":{valueType:"boolean",f:function(a,b){return a>=b}}},d.controls=c.controls={"if":{f:function(a,b,c,d,e){var f,g;g=a[0].evaluate(b,c,d,e),f=!1,g.forEachValue(function(a){if(a){f=!0;return!0}});return f?a[1].evaluate(b,c,d,e):a[2].evaluate(b,c,d,e)}},foreach:{f:function(a,b,c,e,f){var g,h,i,j,k;g=a[0].evaluate(b,c,e,f),h=b.value,i=c.value,j=[],k="text",c.value=g.valueType,g.forEachValue(function(d){var g;b.value=d,g=a[1].evaluate(b,c,e,f),k=g.valueType;return g.forEachValue(function(a){return j.push(a)})}),b.value=h,c.value=i;return d.initCollection(j,k)}},"default":{f:function(a,b,c,e,f){var g,h,i,j;for(i=0,j=a.length;i<j;i++){g=a[i],h=g.evaluate(b,c,e,f);if(h.size()>0)return h}return d.initCollection([],"text")}}},d.initExpression=function(a){var b;b={},b.evaluate=function(b,c,d,e){var f;f=a.evaluate(b,c,d,e);return{values:f.getSet(),valueType:f.valueType,size:f.size}},b.evaluateOnItem=function(a,c){return b.evaluate({value:a},{value:"item"},"value",c)},b.evaluateSingle=function(b,c,d,e){var f,g;f=a.evaluate(b,c,d,e),g={value:null,valueType:f.valueType},f.forEachValue(function(a){g.value=a;return!0});return g},b.isPath=a.isPath,b.isPath?(b.getPath=function(){return a},b.testExists=function(b,c,d,e){return a.testExists(b,c,d,e)}):(b.getPath=function(){return null},b.testExists=function(a,c,d,e){return b.evaluate(a,c,d,e).values.size()>0}),b.evaluateBackward=function(b,c,d,e){return a.walkBackward([b],c,d,e)},b.walkForward=function(b,c,d){return a.walkForward(b,c,d)},b.walkBackward=function(b,c,d,e){return a.walkBackward(b,c,d,e)};return b},d.initCollection=c.initCollection=function(a,c){var d;d={valueType:c},a instanceof Array?(d.forEachValue=function(b){var c,d,e,f;f=[];for(d=0,e=a.length;d<e;d++){c=a[d];if(b(c)===!0)break;f.push(void 0)}return f},d.getSet=function(){return b.Data.Set.initInstance(a)},d.contains=function(b){return f.call(a,b)>=0},d.size=function(){return a.length}):(d.forEachValue=a.visit,d.size=a.size,d.getSet=function(){return a},d.contains=a.contains),d.isPath=!1;return d},d.initConstant=function(a,b){var c;c={},c.evaluate=function(c,e,f,g){return d.initCollection([a],b)},c.isPath=!1;return c},d.initOperator=function(a,b){var c,f,g;c={},g=a,f=b,c.evaluate=function(c,h,i,j){var k,l,m,n,o;m=[],b=[];for(n=0,o=f.length;n<o;n++)k=f[n],b.push(k.evaluate(c,h,i,j));a=e[g],l=a.f,a.argumentType==="number"?b[0].forEachValue(function(a){typeof a!="number"&&(a=parseFloat(a));return b[1].forEachValue(function(b){typeof b!="number"&&(b=parseFloat(b));return m.push(l(a,b))})}):b[0].forEachValue(function(a){return b[1].forEachValue(function(b){return m.push(l(a,b))})});return d.initCollection(m,a.valueType)},c.isPath=!1;return c},d.initFunctionCall=function(a,b){var c,e;c={},e=b,c.evaluate=function(c,f,g,h){var i,j,k,l;b=[];for(j=0,k=e.length;j<k;j++)i=e[j],b.push(i.evaluate(c,f,g,h));if(((l=d.functions[a])!=null?l.f:void 0)!=null)return d.functions[a].f(b);throw new Error("No such function named "+_name)},c.isPath=!1;return c},d.initControlCall=function(a,b){var c;c={},c.evaluate=function(c,e,f,g){return d.controls[a].f(b,c,e,f,g)},c.isPath=!1;return c},d.initPath=function(c,e){var f,g,h,i,j;f={},i=null,j=[],h=function(a,b){var e,f,g,h,i,k,l,m;g=function(c){var d;d=[],a.forEachValue(function(a){return b.getObjects(a,c.property).visit(function(a){return d.push(a)})});return d},f=function(c){var d;d=[],a.forEachValue(function(a){return b.getSubjects(a,c.property).visit(function(a){return d.push(a)})});return d};for(h=0,m=j.length;0<=m?h<m:h>m;0<=m?h++:h--)i=j[h],i.isMultiple?(e=[],i.forward?(e=g(i),c=b.getProperty(i.property),k=c!=null?c.getValueType():"text"):(e=f(i),k="item"),a=d.initCollection(e,k)):i.forward?(l=b.getObjectsUnion(a.getSet(),i.property),c=b.getProperty(i.property),k=c!=null?c.getValueType():"text",a=d.initCollection(l,k)):(l=b.getSubjectsUnion(a.getSet(),i.property),a=d.initCollection(l,"item"));return a},g=function(a,e,f){var g,h,i,k,l,m,n,o;i=function(b){var c;c=[],a.forEachValue(function(a){return f.getSubjects(a,b.property).visit(function(a){if(k>0||e==null||e.contains(a))return c.push(a)})});return c},h=function(b){var c;c=[],a.forEachValue(function(a){return f.getObjects(a,b.property).visit(function(a){if(k>0||e==null||e.contains(a))return c.push(a)})});return c},e instanceof Array&&(e=b.Data.Set.initInstance(e));for(k=o=j.length-1;o<=0?k<=0:k>=0;o<=0?k++:k--)l=j[k],l.isMultiple?(g=[],l.forward?(g=i(l),c=f.getProperty(l.property),m=c!=null?c.getValueType():"text"):(g=h(l),m="item"),a=d.initCollection(g,m)):l.forward?(n=f.getSubjectsUnion(a.getSet(),l.property,null,k===0?e:null),a=d.initCollection(n,"item")):(n=f.getObjectsUnion(a.getSet(),l.property,null,k===0?e:null),c=f.getProperty(l.property),m=c!=null?c.getValueType():"text",a=d.initCollection(n,m));return a},c!=null&&j.push({property:c,forward:e,isMultiple:!1}),f.isPath=!0,f.setRootName=function(a){return i=a},f.appendSegment=function(a,b){return j.push({property:a,forward:b[0]===".",isMultiple:b.length>1})},f.getSegment=function(a){var b;if(a<j.length){b=j[a];return{property:b.property,forward:b.forward,isMultiple:b.isMultiple}}return null},f.getLastSegment=function(){return f.getSegment(j.length-1)},f.getSegmentCount=function(){return j.length},f.rangeBackward=function(a,d,e,f){var g,h,i,k,l;i=b.Data.Set.initInstance(),k="item";if(j.length>0){h=j[j.length-1];if(h.forward)f.getSubjectsInRange(h.property,a,d,!1,i,j.length===1?e:null);else throw new Error("Last path of segment must be forward");for(g=
+l=j.length-2;l<=0?g<=0:g>=0;l<=0?g++:g--)h=j[g],h.forward?(i=f.getSubjectsUnion(i,h.property,null,g===0?e:null),k="item"):(i=f.getObjectsUnion(i,h.property,null,g===0?e:null),c=f.getPropertysegment.property,k=c!=null?c.getValueType():"text")}return{valueType:k,values:i,count:i.size()}},f.evaluate=function(b,c,e,f){var g,j,k,l;k=i!=null?i:e,l=c[k]!=null?c[k]:"text",g=null;if(b[k]!=null){j=b[k],a.isPlainObject(j)||j instanceof Array?g=d.initCollection(j,l):g=d.initCollection([j],l);return h(g,f)}throw new Error("No such variable called "+k)},f.testExists=function(a,b,c,d){return f.evaluate(a,b,c,d).size()>0},f.evaluateBackward=function(a,b,c,e){var f;f=d.initCollection([a],b);return g(f,c,e)},f.walkForward=function(a,b,c){return h(d.initCollection(a,b),c)},f.walkBackward=function(a,b,c,e){return g(d.initCollection(a,b),c,e)};return f},d.initParser=c.initInstance=function(){var a,b;b={},a=function(a,b){var c,e,f,g,h,i,j,k,l,m,n,o;m=a.token(),c=d.initScanner,g=function(){a.next();return m=a.token()},i=function(){var a;a=[h()];while(m!=null&&m.type===c.DELIMITER&&m.value===",")g(),a.push(h());return a},f=function(){return m!=null?m.start:a.index()},j=function(){var a,b;b=d.initPath();while(m!=null&&m.type===c.PATH_OPERATOR){a=m.value,g();if(m!=null&&m.type===c.IDENTIFIER)b.appendSegment(m.value,a),g();else throw new Error("Missing property ID at position "+f())}return b},h=function(){var a,b,e;e=null,a=[];if(m==null)throw new Error("Missing factor at end of expression");switch(m.type){case c.NUMBER:e=d.initConstant(m.value,"number"),g();break;case c.STRING:e=d.initConstant(m.value,"text"),g();break;case c.PATH_OPERATOR:e=j();break;case c.IDENTIFIER:b=m.value,g();if(d.controls[b]!=null){if(m==null||m.type!==c.DELIMITER||m.value!=="(")throw new Error("Missing ( to start "+b+" at position "+f());g(),m!=null&&m.type===c.DELIMITER&&m.value===")"?a=[]:a=i(),e=d.initControlCall(b,a);if(m!=null&&m.type===c.DELIMITER&&m.value===")")g();else throw new Error("Missing ) to end "+b+" at position "+f())}else if(m!=null&&m.type===c.DELIMITER&&m.value==="("){g(),m!=null&&m.type===c.DELIMITER&&m.value===")"?a=[]:a=i(),e=d.initFunctionCall(b,a);if(m!=null&&m.type===c.DELIMITER&&m.value===")")g();else throw new Error("Missing ) after function call "+b+" at position "+f())}else e=j(),e.setRootName(b);break;case c.DELIMITER:if(m.value!=="(")throw new Error("Unexpected text "+m.value+" at position "+f());g(),e=h();if(m!=null&&m.type===c.DELIMITER&&m.value===")")g();else throw new Error("Missing ) at position "+f());break;default:throw new Error("Unexpected text "+m.value+" at position "+f())}return e};if(b){l=i(),e=[];for(n=0,o=l.length;n<o;n++)k=l[n],e.push(d.initExpression(k));return e}return[d.initExpression(h())]},b.parse=function(b,c,e){var f;c==null&&(c=0),e==null&&(e={}),f=d.initScanner(b,c);try{return a(f,!1)[0]}finally{e.index=f.token()!=null?f.token().start:f.index()}};return b},d.initScanner=function(a,b){var c,e,f,g,h,i;e={},h=a+" ",g=a.length,f=b,i=null,c=function(a){return"0123456789".indexOf(a)>=0},e.token=function(){return i},e.index=function(){return f},e.next=function(){var a,b,e,j;i=null;while(f<g&&" \t\r\n".indexOf(h.charAt(f))>=0)f+=1;if(f<g){b=h.charAt(f),e=h.charAt(f+1);if(".!".indexOf(b)<0){if("<>".indexOf(b)<0){if("+-*/=".indexOf(b)<0){if("()".indexOf(b)<0){if("\"'".indexOf(b)<0){if(c(b)){j=f;while(j<g&&c(h.charAt(j)))j+=1;if(j<g&&h.charAt(j)==="."){j+=1;while(j<g&&c(h.charAt(j)))j+=1}i={type:d.initScanner.NUMBER,value:parseFloat(h.substring(f,j)),start:f,end:j};return f=j}j=f;while(j<g){a=h.charAt(j);if("(),.!@ \t".indexOf(a)>=0)break;j+=1}i={type:d.initScanner.IDENTIFIER,value:h.substring(f,j),start:f,end:j};return f=j}j=f+1;while(j<g){if(h.charAt(j)===b&&h.charAt(j-1)!=="\\")break;j+=1}if(j<g){i={type:d.initScanner.STRING,value:h.substring(f+1,j).replace(/\\'/g,"'").replace(/\\"/g,'"'),start:f,end:j+1};return f=j+1}throw new Error("Unterminated string starting at "+String(f))}i={type:d.initScanner.DELIMITER,value:b,start:f,end:f+1};return f+=1}i={type:d.initScanner.OPERATOR,value:b,start:f,end:f+1};return f+=1}if(e==="="||"<>".indexOf(e)>=0&&b!==e){i={type:d.initScanner.OPERATOR,value:b+e,start:f,end:f+2};return f+=2}i={type:d.initScanner.OPERATOR,value:b,start:f,end:f+1};return f+=1}if(e==="@"){i={type:d.initScanner.PATH_OPERATOR,value:b+e,start:f,end:f+2};return f+=2}i={type:d.initScanner.PATH_OPERATOR,value:b,start:f,end:f+1};return f+=1}},e.next();return e},d.initScanner.DELIMITER=0,d.initScanner.NUMBER=1,d.initScanner.STRING=2,d.initScanner.IDENTIFIER=3,d.initScanner.OPERATOR=4,d.initScanner.PATH_OPERATOR=5,d.functions={},d.FunctionUtilities={};return c.registerSimpleMappingFunction=function(a,c,e){return d.functions[a]={f:function(a){var f,g,h,i,j;h=b.Data.Set.initInstance(),g=function(a){return a.forEachValue(function(a){var b;b=c(a);if(b!=null)return h.add(b)})};for(i=0,j=a.length;i<j;i++)f=a[i],g(f);return d.initCollection(h,e)}}}}),b.namespace("Presentation",function(c){c.initInstance=function(){var c;c=1<=arguments.length?e.call(arguments,0):[];return b.initInstance.apply(b,["MITHGrid.Presentation"].concat(e.call(c),[function(b,c){var d,e,f,g,h;d=null,h={},f=b.options.lenses||{},g=b.options,a(c).empty(),e=void 0,g.lensKey||(g.lensKey=[".type"]),b.getLens=function(a){var b,c;e!=null&&(c=e.evaluate([a]),b=c[0]);if(b!=null&&f[b]!=null)return{render:f[b]}},b.addLens=function(a,c){f[a]=c;return b.selfRender()},b.removeLens=function(a){return delete f[a]},b.hasLens=function(a){return f[a]!=null},b.visitRenderings=function(a){var b,c;for(b in h){c=h[b];if(!1===a(b,c))return}},b.renderingFor=function(a){return h[a]},b.renderItems=function(a,f){var i,j,k;e==null&&(e=a.prepare(g.lensKey)),j=f.length,k=j,k>200&&(k=parseInt(Math.sqrt(k),10)+1),k<1&&(k=1),i=function(e){var g,l,m,o,p;if(e<j){g=e+k,g>j&&(g=j);for(m=e;e<=g?m<g:m>g;e<=g?m++:m--)o=f[m],l=a.contains(o)&&b.hasLensFor(o),h[o]!=null?l?h[o].update(a.getItem(o)):(d===o&&h[o].eventUnfocus!=null&&h[o].eventUnfocus(),h[o].remove!=null&&h[o].remove(),delete h[o]):l&&(p=b.render(c,a,o),p!=null&&(h[o]=p,d===o&&p.eventFocus!=null&&p.eventFocus()));return setTimeout(function(){return i(g)},0)}return b.finishDisplayUpdate()},b.startDisplayUpdate();return i(0)},b.render=function(a,c,d){var e;e=b.getLens(d);if(e!=null)return e.render(a,b,c,d)},b.hasLensFor=function(a){var c;c=b.getLens(a);return c!=null},b.eventModelChange=b.renderItems,b.startDisplayUpdate=function(){},b.finishDisplayUpdate=function(){},b.selfRender=function(){return b.renderItems(b.dataView,b.dataView.items())},b.eventFocusChange=function(a){var c;d!=null&&(c=b.renderingFor(d)),d!==a&&(c!=null&&c.eventUnfocus!=null&&c.eventUnfocus(),a!=null&&(c=b.renderingFor(a),c!=null&&c.eventFocus!=null&&c.eventFocus()),d=a);return d},b.getFocusedRendering=function(){return d!=null?b.renderingFor(d):null},b.dataView=b.options.dataView;return b.dataView.registerPresentation(b)}]))},c.namespace("SimpleText",function(a){return a.initInstance=function(){var a,c;a=1<=arguments.length?e.call(arguments,0):[];return(c=b.Presentation).initInstance.apply(c,["MITHGrid.Presentation.SimpleText"].concat(e.call(a),[function(a,b){}]))}});return c.namespace("Table",function(c){return c.initInstance=function(){var c,d;c=1<=arguments.length?e.call(arguments,0):[];return(d=b.Presentation).initInstance.apply(d,["MITHGrid.Presentation.Table"].concat(e.call(c),[function(b,c){var d,e,f,g,h,i,j,k;f=b.options,h=a("<table></table>"),e=a("<tr></tr>"),h.append(e),k=f.columns;for(i=0,j=k.length;i<j;i++)d=k[i],e.append("<th>"+f.columnLabels[d]+"</th>");a(c).append(h),b.hasLensFor=function(){return!0},g=function(a){var b,c;a!=null?(a=[].concat(a),a.length>1?(b=a.pop(),c=a.join(", "),a.length>1?c=c+", and "+b:c=c(" and "+b)):c=a[0]):c="";return c};return b.render=function(b,c,d){var e,i,j,k,l,m,n,o,p,q;j={},n={},k=a("<tr></tr>"),n.el=k,m=c.getItem(d),l=!0,q=f.columns;for(o=0,p=q.length;o<p;o++)e=q[o],i=a("<td></td>"),m[e]!=null&&(i.text(g(m[e])),l=!1,j[e]=i),k.append(i);if(!l){h.append(k),n.update=function(a){var b,c,d,e,h;e=f.columns,h=[];for(c=0,d=e.length;c<d;c++)b=e[c],a[b]!=null?h.push(j[b].text(g(a[b]))):h.push(void 0);return h},n.remove=function(){k.hide();return k.remove()};return n}k.remove();return null}}]))}})}),b.namespace("Facet",function(c){c.initInstance=function(){var c;c=1<=arguments.length?e.call(arguments,0):[];return b.initInstance.apply(b,["MITHGrid.Facet"].concat(e.call(c),[function(b,c){var d;d=b.options,b.selfRender=function(){},b.eventFilterItem=function(a,b){return!1},b.eventModelChange=function(a,b){},b.constructFacetFrame=function(b,c){var d;d={},a(b).addClass("mithgrid-facet"),d.header=a("<div class='header' />"),c.onClearAllSelections!=null&&(d.controls=a("<div class='control' title='Clear Selection'>"),d.counter=a("<span class='counter'></span>"),d.controls.append(d.counter),d.header.append(d.controls)),d.title=a("<span class='title'></span>"),d.title.text(c.facetLabel||""),d.header.append(d.title),d.bodyFrame=a("<div class='body-frame'></div>"),d.body=a("<div class='body'></div>"),d.bodyFrame.append(d.body),a(b).append(d.header),a(b).append(d.bodyFrame),c.onClearAllSelections!=null&&d.controls.bind("click",c.onClearAllSelections),d.setSelectionCount=function(a){d.counter.innerHTML=a;return a>0?d.counter.show():d.counter.hide()};return d};return d.dataView.registerFilter(b)}]))},c.namespace("TextSearch",function(d){return d.initInstance=function(){var d;d=1<=arguments.length?e.call(arguments,0):[];return c.initInstance.apply(c,["MITHGrid.Facet.TextSearch"].concat(e.call(d),[function(c){var d,e,f,g;e=c.options,e.expressions!=null&&(a.isArray(e.expressions)||(e.expressions=[e.expressions]),g=b.Expression.Basic.initInstance(),f=function(){var a,b,c,f;c=e.expressions,f=[];for(a=0,b=c.length;a<b;a++)d=c[a],f.push(g.parse(d));return f}()),c.eventFilterItem=function(a,b){var d,g,h,i,j,k,l,m;if(c.text!=null&&e.expressions!=null)for(i=0,k=f.length;i<k;i++){d=f[i],g=d.evaluateOnItem(b,a),m=g.values.items();for(j=0,l=m.length;j<l;j++){h=m[j];if(h.toLowerCase().indexOf(c.text)>=0)return}}return!1},c.eventModelChange=function(a,b){};return c.selfRender=function(){var b,d;b=c.constructFacetFrame(container,null,{facetLabel:e.facetLabel}),a(container).addClass("mithgrid-facet-textsearch"),d=a("<input type='text'>"),b.body.append(d);return d.keyup(function(){c.text=a.trim(d.val().toLowerCase());return c.events.onFilterChange.fire()})}}]))}}),c.namespace("List",function(d){return d.initInstance=function(){var d;d=1<=arguments.length?e.call(arguments,0):[];return c.initInstance.apply(c,["MITHGrid.Facet.List"].concat(e.call(d),[function(c){var d,e,g,h;e=c.options,c.selections=[],e.expressions!=null&&(a.isArray(e.expressions)||(e.expressions=[e.expressions]),h=b.Expression.Basic.initInstance(),g=function(){var a,b,c,f;c=e.expressions,f=[];for(a=0,b=c.length;a<b;a++)d=c[a],f.push(h.parse(d));return f}()),c.eventFilterItem=function(a,b){var d,h,i,j,k,l,m,n;if(c.text!=null&&e.expressions!=null)for(j=0,l=g.length;j<l;j++){d=g[j],h=d.evaluateOnItem(b,a),n=h.values.items();for(k=0,m=n.length;k<m;k++){i=n[k];if(f.call(c.selections,i)>=0)return}}};return c.selfRender=function(){var a;return a=c.constructFacetFrame(container,null,{facetLabel:e.facetLabel,resizable:!0})}}]))}});return c.namespace("Range",function(b){return b.initInstance=function(){var b;b=1<=arguments.length?e.call(arguments,0):[];return c.initInstance.apply(c,["MITHGrid.Facet.Range"].concat(e.call(b),[function(b){var c;c=b.options,c.min==null&&(c.min=0),c.max==null&&(c.max=100),c.step==null&&(c.step=1/30);return b.selfRender=function(){var d,e;d=b.constructFacetFrame(container,null,{facetLabel:c.facetLabel,resizable:!1}),e=a("<input type='range'>"),e.attr({min:c.min,max:c.max,step:c.step}),d.body.append(e);return e.event(function(){b.value=e.val();return b.events.onFilterChange.fire()})}}]))}})}),b.namespace("Controller",function(c){c.initInstance=function(){var c;c=1<=arguments.length?e.call(arguments,0):[];return b.initInstance.apply(b,["MITHGrid.Controller"].concat(e.call(c),[function(c){var d,f;d=c.options,d.selectors==null&&(d.selectors={}),(f=d.selectors)[""]==null&&(f[""]=""),c.initBind=function(c){return b.initInstance(d.bind,function(b){var e;e={"":a(c)},b.locate=function(b){var f,g;g=d.selectors[b];if(g!=null){g===""?f=a(c):f=a(c).find(g),e[g]=f;return f}},b.fastLocate=function(a){var c;c=d.selectors[a];if(c!=null){if(e[c]!=null)return e[c];return b.locate(a)}},b.refresh=function(b){var f,g,h,i;for(h=0,i=b.length;h<i;h++)f=b[h],g=d.selectors[f],g!=null&&(g===""?e[""]=a(c):e[g]=a(c).find(g))};return b.clearCache=function(){return e={"":a(c)}}})},c.bind=function(){var a,b,d;d=arguments[0],a=2<=arguments.length?e.call(arguments,1):[],b=c.initBind(d),c.applyBindings.apply(c,[b].concat(e.call(a))),b.unbind=function(){return c.removeBindings.apply(c,[b].concat(e.call(a)))};return b},c.applyBindings=function(){var a,b;b=arguments[0],a=2<=arguments.length?e.call(arguments,1):[]};return c.removeBindings=function(){var a,b;b=arguments[0],a=2<=arguments.length?e.call(arguments,1):[]}}]))};return c.namespace("Raphael",function(a){return a.initInstance=function(){var a,c;a=1<=arguments.length?e.call(arguments,0):[];return(c=b.Controller).initInstance.apply(c,["MITHGrid.Controller.Raphael"].concat(e.call(a),[function(a){var b;b=a.initBind;return a.initBind=function(a){var c,d,e,f,g;c=b(a.node),f=c.locate,e=c.fastLocate,g=c.refresh,d=c.bind,c.locate=function(b){return b==="raphael"?a:f(b)},c.fastLocate=function(b){return b==="raphael"?a:e(b)},c.refresh=function(a){var b;a=function(){var c,d,e;e=[];for(c=0,d=a.length;c<d;c++)b=a[c],b!=="raphael"&&e.push(b);return e}();return g(a)};return c}}]))}})}),b.namespace("Application",function(c){return c.initInstance=function(){var c;c=1<=arguments.length?e.call(arguments,0):[];return b.initInstance.apply(b,["MITHGrid.Application"].concat(e.call(c),[function(c,d){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A;j=[],o=function(){return c},c.presentation={},c.facet={},c.component={},c.dataStore={},c.dataView={},c.controller={},k=c.options,c.ready=function(a){return j.push(a)},c.run=function(){return a(document).ready(function(){var a,b,d;c.ready=function(a){return a()};for(b=0,d=j.length;b<d;b++)a=j[b],a();return j=[]})},c.addDataStore=function(a,d){var e,f,g,h,i,j,k,l;c.dataStore[a]==null?(g=b.Data.Store.initInstance(),c.dataStore[a]=g,g.addType("Item"),g.addProperty("type",{valueType:"text"}),g.addProperty("id",{valueType:"text"})):g=c.dataStore[a];if((d!=null?d.types:void 0)!=null){j=d.types;for(h in j)i=j[h],g.addType(h)}if((d!=null?d.properties:void 0)!=null){k=d.properties,l=[];for(e in k)f=k[e],l.push(g.addProperty(e,f));return l}},c.addDataView=function(a,d){var e,f,g,h,i;d.type!=null&&d.type.initInstance!=null?e=d.type.initInstance:e=b.Data.View.initInstance,i={dataStore:c.dataStore[d.dataStore]||c.dataView[d.dataStore]};if(c.dataView[a]==null){for(f in d)g=d[f],f!=="type"&&!i[f]&&(i[f]=g);h=e(i);return c.dataView[a]=h}},c.addController=function(b,d){var e,f;f=a.extend(!0,{},d),f.application=o,e=d.type.initInstance(f);return c.controller[b]=e},c.addFacet=function(b,e){var f;f=a.extend(!0,{},e);return c.ready(function(){var g,h;h=a(d).find(e.container),a.isArray(h)&&(h=h[0]),f.dataView=c.dataView[e.dataView],f.application=o,g=e.type.initInstance(h,f),c.facet[b]=g;return g.selfRender()})},c.addComponent=function(b,e){var g;g=a.extend(!0,{},f);return c.ready(function(){var f,h,i,j,k,l;i=a(d).find(g.container),a.isArray(i)&&(i=i[0]),g.application=o;if(h.components!=null){g.components={},k=h.components;for(f in k)h=k[f],typeof h=="string"?g.components[f]=c.component[f]:(j=a.extend(!0,{},ccconfig),j.application=o,g.components[f]=h.type.initInstance(j))}if(h.controllers!=null){g.controllers={},l=e.controllers;for(f in l)h=l[f],typeof h=="string"?g.controllers[f]=c.controller[f]:(j=a.extend(!0,{},ccconfig),j.application=o,g.controllers[f]=h.type.initInstance(j))}return c.component[b]=h.type.initInstance(i,g)})},c.addPresentation=function(b,e){var f;f=a.extend(!0,{},e);return c.ready(function(){var g,h,i,j,k,l,m,n,p;l=a(d).find(f.container),a.isArray(l)&&(l=l[0]),f.dataView=c.dataView[e.dataView],f.application=o;if(e.components!=null){f.components={},n=e.components;for(h in n)i=n[h],typeof i=="string"?f.components[h]=c.component[h]:(j=a.extend(!0,{},ccconfig),j.application=o,f.components[h]=i.type.initInstance(j))}if(e.controllers!=null){f.controllers={},p=e.controllers;for(g in p)i=p[g],typeof i=="string"?f.controllers[g]=c.controller[g]:(k=a.extend(!0,{},i),k.application=o,f.controllers[g]=i.type.initInstance(k))}m=e.type.initInstance(l,f),c.presentation[b]=m;return m.selfRender()})},c.addPlugin=function(b){var e,f,g,h,i,j,k,l,m,n,p,q;e=a.extend(!0,{},b),e.application=o,f=e.type.initInstance(e);if(f!=null){if((e!=null?e.dataView:void 0)!=null){f.dataView=c.dataView[e.dataView],m=f.getTypes();for(k in m)l=m[k],f.dataView.addType(k);n=f.getProperties();for(i in n)j=n[i],f.dataView.addProperty(i,j)}p=f.getPresentations(),q=[];for(g in p)h=p[g],q.push(function(b,g){return c.ready(function(){var h,i,j;j=a.extend(!0,{},g.options),h=a(d).find(g.container),a.isArray(h)&&(h=h[0]),(g!=null?g.lenses:void 0)!=null&&(j.lenses=g.lenses),g.dataView!=null?j.dataView=c.dataView[g.dataView]:e.dataView!=null&&(j.dataView=c.dataView[e.dataView]),j.application=o,i=g.type.initInstance(h,j),f.presentation[b]=i;return i.selfRender()})});return q}};if((k!=null?k.dataStores:void 0)!=null){t=k.dataStores;for(n in t)g=t[n],c.addDataStore(n,g)}if((k!=null?k.dataViews:void 0)!=null){u=k.dataViews;for(q in u)p=u[q],c.addDataView(q,p)}if((k!=null?k.controllers:void 0)!=null){v=k.controllers;for(e in v)f=v[e],c.addController(e,f)}if((k!=null?k.facets:void 0)!=null){w=k.facets;for(h in w)i=w[h],c.addFacet(h,i)}if((k!=null?k.components:void 0)!=null){x=k.components;for(e in x)f=x[e],c.addComponent(e,f)}if((k!=null?k.presentations:void 0)!=null){y=k.presentations;for(l in y)m=y[l],c.addPresentation(l,m)}if((k!=null?k.plugins:void 0)!=null){z=k.plugins,A=[];for(r=0,s=z.length;r<s;r++)m=z[r],A.push(c.addPlugin(m));return A}}]))}}),b.namespace("Plugin",function(a){return a.initInstance=function(a,b){var c,d;d={options:b,presentation:{}},c=[],d.getTypes=function(){return(b!=null?b.types:void 0)!=null?b.types:[]},d.getProperties=function(){return(b!=null?b.properties:void 0)!=null?b.properties:[]},d.getComponents=function(){return(b!=null?b.components:void 0)!=null?b.components:[]},d.getPresentations=function(){return(b!=null?b.presentations:void 0)!=null?b.presentations:[]},d.ready=c.push,d.eventReady=function(a){var b,e,f;for(e=0,f=c.length;e<f;e++)b=c[e],b(a);c=[];return d.ready=function(b){return b(a)}};return d}}),b.initView=b.deprecated("MITHGrid.initView",b.initInstance),b.Data.initSet=b.deprecated("MITHGrid.Data.initSet",b.Data.Set.initInstance),b.Data.initType=b.deprecated("MITHGrid.Data.initType",b.Data.Type.initInstance),b.Data.initProperty=b.deprecated("MITHGrid.Data.initProperty",b.Data.Property.initInstance),b.Data.initStore=b.deprecated("MITHGrid.Data.initStore",b.Data.Store.initInstance),b.Data.initView=b.deprecated("MITHGrid.Data.initView",b.Data.View.initInstance),b.Presentation.initPresentation=b.deprecated("MITHGrid.Presentation.initPresentation",b.Presentation.initInstance),b.Presentation.SimpleText.initPresentation=b.deprecated("MITHGrid.Presentation.SimpleText.initPresentation",b.Presentation.SimpleText.initInstance);return b.Application.initApp=b.deprecated("MITHGrid.Application.initApp",b.Application.initInstance)}(b,a),a.defaults("MITHGrid.Data.Store",{events:{onModelChange:null,onBeforeLoading:null,onAfterLoading:null,onBeforeUpdating:null,onAfterUpdating:null}}),a.defaults("MITHGrid.Data.View",{events:{onModelChange:null,onFilterItem:"preventable"}}),a.defaults("MITHGrid.Data.SubSet",{events:{onModelChange:null}}),a.defaults("MITHGrid.Data.Pager",{events:{onModelChange:null}}),a.defaults("MITHGrid.Data.RangePager",{events:{onModelChange:null}}),a.defaults("MITHGrid.Data.ListPager",{events:{onModelChange:null}}),a.defaults("MITHGrid.Facet",{events:{onFilterChange:null}}),a.defaults("MITHGrid.Facet.TextSearch",{facetLabel:"Search",expressions:[".label"]})}).call(this)
;
Something went wrong with that request. Please try again.