You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by sz...@apache.org on 2013/04/17 16:06:22 UTC
svn commit: r1468918 - in /stanbol/trunk/demos/webvie: ./ src/license/
src/main/resources/META-INF/resources/static/enhancervie/lib/json/
src/main/resources/META-INF/resources/static/enhancervie/lib/underscore/
Author: szabyg
Date: Wed Apr 17 14:06:22 2013
New Revision: 1468918
URL: http://svn.apache.org/r1468918
Log:
Updating README and Checking licenses, listing them in src/license/NOTICE
Added:
stanbol/trunk/demos/webvie/src/license/NOTICE
stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/json/NOTICE
stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/json/cycle.js
stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/json/json.js
stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/json/json_parse.js
stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/json/json_parse_state.js
stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/underscore/
stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/underscore/LICENSE
stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/underscore/underscore-min.js
Modified:
stanbol/trunk/demos/webvie/README.md
stanbol/trunk/demos/webvie/pom.xml
stanbol/trunk/demos/webvie/src/license/THIRD-PARTY.properties
stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/json/README
stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/json/json2.js
Modified: stanbol/trunk/demos/webvie/README.md
URL: http://svn.apache.org/viewvc/stanbol/trunk/demos/webvie/README.md?rev=1468918&r1=1468917&r2=1468918&view=diff
==============================================================================
--- stanbol/trunk/demos/webvie/README.md (original)
+++ stanbol/trunk/demos/webvie/README.md Wed Apr 17 14:06:22 2013
@@ -18,7 +18,25 @@
VIE based Stanbol Enhancer UI
=============================
-Adapter to add a VIE based interface for the Stanbol Enhancer
+Adapter to add a VIE based user interface for the Stanbol Enhancer.
+
+Features
+--------
+
+ * Text Enhancement visualisation using highlighting
+ * Entity Enhancement visualisation using selection
+ * HTML Editing and RDFa extension in the browser
+ * Selection of enhancement chain using dropdown
+ * Using Stanbol's REST endpoints through VIE and VIE's Stanbol service
+
+Supported Browsers
+------------------
+
+ * Chrome
+ * Firefox
+ * Internet Explorer 7+ (6?)
+ * Opera
+ * Safari
Deploy
------
@@ -27,53 +45,13 @@ After building stanbol in a different fo
mvn install -DskipTests -PinstallBundle -Dsling.url=http://localhost:8080/system/console
-Development Guide
-=================
-
-The widget development is done in CoffeeScript. Use the following command to
-automatically compile the script in the background
-
- coffee -c -w -o lib annotate.coffee
-
-This will as well show you compile errors right after each save.
-
-To simplify work with the deep directory structure I created a directory for
-shortcuts to the most important directories called 'sc':
-
- ls -ln sc/
- lrwxrwxrwx 1 1000 1000 52 2011-06-01 11:44 java -> ../src/main/java/org/apache/stanbol/enhancer/webvie/
- lrwxrwxrwx 1 1000 1000 63 2011-06-01 11:43 static -> ../src/main/resources/org/apache/stanbol/enhancer/webvie/static
- lrwxrwxrwx 1 1000 1000 135 2011-06-01 11:44 template -> ../src/main/resources/org/apache/stanbol/enhancer/webvie/templates/org/apache/stanbol/enhancer/webvie/resource/EnhancerVieRootResource/
-
-Annotate widget API
-===================
-Options:
---------
-
-Methods:
---------
-**enable**:
- Analyze text and highlight TextAnnotations. Make TextAnnotations
- interactive.
-
-**disable**:
- Remove TextAnnotation highlighting.
-
-Events
-------
-**select**:
- Triggered on annotating a suggested TextEnhancement
+Components
+----------
-**decline**:
- Triggered on declining a suggested TextEnhancement
+Main components used for the component:
-**remove**:
- Triggered when an annotation is removed
-
- function (event, ui)
-
- The ui object has the following attributes:
- `textEnhancement`,
- `entityEnhancement`
- `linkedEntity`
+ * [Annotate.js](https://github.com/szabyg/annotate.js)
+ * [VIE](http://viejs.org)
+ * [VIE.autocomplete](https://github.com/szabyg/VIE.autocomplete)
+ * [VIE.entitypreview](https://github.com/szabyg/vie.entitypreview)
Modified: stanbol/trunk/demos/webvie/pom.xml
URL: http://svn.apache.org/viewvc/stanbol/trunk/demos/webvie/pom.xml?rev=1468918&r1=1468917&r2=1468918&view=diff
==============================================================================
--- stanbol/trunk/demos/webvie/pom.xml (original)
+++ stanbol/trunk/demos/webvie/pom.xml Wed Apr 17 14:06:22 2013
@@ -17,110 +17,80 @@
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.stanbol</groupId>
+ <artifactId>stanbol-parent</artifactId>
+ <version>4-SNAPSHOT</version>
+ <relativePath>../../parent</relativePath>
+ </parent>
- <parent>
<groupId>org.apache.stanbol</groupId>
- <artifactId>stanbol-parent</artifactId>
- <version>4-SNAPSHOT</version>
- <relativePath>../../parent</relativePath>
- </parent>
-
- <groupId>org.apache.stanbol</groupId>
- <artifactId>org.apache.stanbol.demos.enhancer.vie</artifactId>
- <version>0.10.0-SNAPSHOT</version>
- <packaging>bundle</packaging>
-
- <name>Apache Stanbol Demos Enhancer VIE UI</name>
- <description>VIE (https://github.com/bergie/VIE) based user interface for Stanbol (Enhancer and Entityhub)</description>
-
- <build>
- <!-- make it an OSGi bundle -->
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-scr-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Import-Package>
- javax.ws.rs.*; version="[0,2)",
- *
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.rat</groupId>
- <artifactId>apache-rat-plugin</artifactId>
- <version>0.8</version>
- <configuration>
- <excludes>
- <exclude>.svnignore</exclude>
- <exclude>README.md</exclude>
- <exclude>src/license/THIRD-PARTY.properties</exclude>
- <!-- rdfQuery has MIT licence -->
- <exclude>src/main/resources/org/apache/stanbol/commons/web/vie/static/lib/jquery.rdfquery.min.js</exclude>
- <exclude>src/main/resources/META-INF/resources/static/enhancervie/annotate.css</exclude>
- <!--
- Annotate.js: MIT License
- underscore.js: MIT license
- backbone.js: MIT license
- <exclude>src/main/resources/org/apache/stanbol/commons/web/vie/static/lib/underscore-min.js</exclude>
- <exclude>src/main/resources/org/apache/stanbol/commons/web/vie/static/lib/annotate.js</exclude>
- <exclude>src/main/resources/org/apache/stanbol/commons/web/vie/static/lib/backbone.js</exclude>
- <exclude>src/main/resources/org/apache/stanbol/commons/web/vie/static/lib/vie/vie-latest.js</exclude>
- <exclude>src/main/resources/org/apache/stanbol/commons/web/vie/static/lib/vie/vie-latest.debug.js</exclude>
- <exclude>src/main/resources/org/apache/stanbol/commons/web/vie/static/lib/backbone-min.js</exclude>
- <exclude>src/main/resources/org/apache/stanbol/commons/web/vie/static/lib/jquery.rdfquery.min.js</exclude>
- <exclude>src/main/resources/org/apache/stanbol/commons/web/vie/static/annotate.coffee</exclude>
- <exclude>src/main/resources/org/apache/stanbol/commons/web/vie/static/annotate.css</exclude>
- <exclude>src/main/resources/org/apache/stanbol/commons/web/vie/static/lib/hallo/format.js</exclude>
- <exclude>src/main/resources/org/apache/stanbol/commons/web/vie/static/lib/hallo/hallo.js</exclude>
- <exclude>src/main/resources/org/apache/stanbol/commons/web/vie/static/test.js</exclude>
- -->
- </excludes>
- <licenses>
- <license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
- <licenseFamilyCategory>MIT</licenseFamilyCategory>
- <licenseFamilyName>The MIT License (MIT)</licenseFamilyName>
- <notes></notes>
- <patterns>
- <pattern>the MIT license</pattern>
- </patterns>
- </license>
- </licenses>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
-
- <!-- dependencies on other IKS modules -->
- <dependency>
- <groupId>org.apache.stanbol</groupId>
- <artifactId>org.apache.stanbol.commons.web.base</artifactId>
- <version>0.12.0-SNAPSHOT</version>
- </dependency>
-
- <!-- Jersey -->
- <dependency>
- <groupId>org.apache.stanbol</groupId>
- <artifactId>org.apache.stanbol.commons.web.viewable</artifactId>
- <version>0.11.0</version>
- </dependency>
-
- <!-- OSGi tax -->
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.scr.annotations</artifactId>
- </dependency>
+ <artifactId>org.apache.stanbol.demos.enhancer.vie</artifactId>
+ <version>0.10.0-SNAPSHOT</version>
+ <packaging>bundle</packaging>
+
+ <name>Apache Stanbol Demos Enhancer VIE UI</name>
+ <description>VIE (https://github.com/bergie/VIE) based user interface for Stanbol (Enhancer and Entityhub)
+ </description>
+
+ <build>
+ <!-- make it an OSGi bundle -->
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-scr-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Import-Package>
+ javax.ws.rs.*; version="[0,2)",
+ *
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ <version>0.8</version>
+ <configuration>
+ <excludes>
+ <exclude>src/main/resources/META-INF/resources/static/enhancervie/annotate.css</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+
+ <dependencies>
+
+ <!-- dependencies on other IKS modules -->
+ <dependency>
+ <groupId>org.apache.stanbol</groupId>
+ <artifactId>org.apache.stanbol.commons.web.base</artifactId>
+ <version>0.12.0-SNAPSHOT</version>
+ </dependency>
+
+ <!-- Jersey -->
+ <dependency>
+ <groupId>org.apache.stanbol</groupId>
+ <artifactId>org.apache.stanbol.commons.web.viewable</artifactId>
+ <version>0.11.0</version>
+ </dependency>
+
+ <!-- OSGi tax -->
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.scr.annotations</artifactId>
+ </dependency>
- </dependencies>
+ </dependencies>
</project>
Added: stanbol/trunk/demos/webvie/src/license/NOTICE
URL: http://svn.apache.org/viewvc/stanbol/trunk/demos/webvie/src/license/NOTICE?rev=1468918&view=auto
==============================================================================
--- stanbol/trunk/demos/webvie/src/license/NOTICE (added)
+++ stanbol/trunk/demos/webvie/src/license/NOTICE Wed Apr 17 14:06:22 2013
@@ -0,0 +1,36 @@
+MIT License:
+ src/main/resources/META-INF/resources/static/enhancervie/annotate.css
+ src/main/resources/META-INF/resources/static/enhancervie/lib/vie.entitypreview.js
+ src/main/resources/META-INF/resources/static/enhancervie/lib/annotate.js
+ src/main/resources/META-INF/resources/static/enhancervie/lib/vie/vie-latest.js
+ src/main/resources/META-INF/resources/static/enhancervie/lib/vie/vie-latest.debug.js
+ src/main/resources/META-INF/resources/static/enhancervie/lib/Aristo/jquery-ui-1.8.7.custom.css
+ src/main/resources/META-INF/resources/static/enhancervie/lib/Aristo/jquery.ui.menu.css
+ src/main/resources/META-INF/resources/static/enhancervie/lib/jquery/jquery-ui.min.css
+ src/main/resources/META-INF/resources/static/enhancervie/lib/Smoothness/jquery.ui.base.css
+ src/main/resources/META-INF/resources/static/enhancervie/lib/Smoothness/jquery.ui.selectable.css
+ src/main/resources/META-INF/resources/static/enhancervie/lib/Smoothness/jquery.ui.datepicker.css
+ src/main/resources/META-INF/resources/static/enhancervie/lib/Smoothness/jquery-ui-1.8.13.custom.css
+ src/main/resources/META-INF/resources/static/enhancervie/lib/Smoothness/jquery.ui.autocomplete.css
+ src/main/resources/META-INF/resources/static/enhancervie/lib/Smoothness/jquery.ui.progressbar.css
+ src/main/resources/META-INF/resources/static/enhancervie/lib/Smoothness/jquery.ui.core.css
+ src/main/resources/META-INF/resources/static/enhancervie/lib/Smoothness/jquery.ui.tabs.css
+ src/main/resources/META-INF/resources/static/enhancervie/lib/Smoothness/jquery.ui.accordion.css
+ src/main/resources/META-INF/resources/static/enhancervie/lib/Smoothness/jquery.ui.theme.css
+ src/main/resources/META-INF/resources/static/enhancervie/lib/Smoothness/jquery.ui.button.css
+ src/main/resources/META-INF/resources/static/enhancervie/lib/Smoothness/jquery.ui.dialog.css
+ src/main/resources/META-INF/resources/static/enhancervie/lib/Smoothness/jquery.ui.resizable.css
+ src/main/resources/META-INF/resources/static/enhancervie/lib/Smoothness/jquery.ui.all.css
+ src/main/resources/META-INF/resources/static/enhancervie/lib/Smoothness/jquery.ui.slider.css
+ src/main/resources/META-INF/resources/static/enhancervie/lib/underscore/underscore-min.js
+ src/main/resources/META-INF/resources/static/enhancervie/lib/jqueryui/jquery-ui.1.9.2.js
+ src/main/resources/META-INF/resources/static/enhancervie/lib/jquery/jquery-1.8.2.js
+ src/main/resources/META-INF/resources/static/enhancervie/lib/backbone.js
+ src/main/resources/META-INF/resources/static/enhancervie/lib/backbone-min.js
+ src/main/resources/META-INF/resources/static/enhancervie/lib/jquery.rdfquery.min.js
+ src/main/resources/META-INF/resources/static/enhancervie/lib/jquery.rdfquery.debug.js
+ src/main/resources/META-INF/resources/static/enhancervie/lib/hallo/format.js
+ src/main/resources/META-INF/resources/static/enhancervie/lib/hallo/hallo.js
+
+Public Domain:
+ src/main/resources/META-INF/resources/static/enhancervie/lib/json/json2.js
Modified: stanbol/trunk/demos/webvie/src/license/THIRD-PARTY.properties
URL: http://svn.apache.org/viewvc/stanbol/trunk/demos/webvie/src/license/THIRD-PARTY.properties?rev=1468918&r1=1468917&r2=1468918&view=diff
==============================================================================
--- stanbol/trunk/demos/webvie/src/license/THIRD-PARTY.properties (original)
+++ stanbol/trunk/demos/webvie/src/license/THIRD-PARTY.properties Wed Apr 17 14:06:22 2013
@@ -20,7 +20,7 @@
# Please fill the missing licenses for dependencies :
#
#
-#Mon Apr 08 19:47:07 CEST 2013
+#Fri Apr 12 15:59:03 CEST 2013
javax.servlet--servlet-api--2.5=Common Development And Distribution License (CDDL), Version 1.0
org.codehaus.jettison--jettison--1.3=The Apache Software License, Version 2.0
org.osgi--org.osgi.compendium--4.1.0=The Apache Software License, Version 2.0
Added: stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/json/NOTICE
URL: http://svn.apache.org/viewvc/stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/json/NOTICE?rev=1468918&view=auto
==============================================================================
--- stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/json/NOTICE (added)
+++ stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/json/NOTICE Wed Apr 17 14:06:22 2013
@@ -0,0 +1 @@
+The json2.js file is taken from https://github.com/douglascrockford/JSON-js
\ No newline at end of file
Modified: stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/json/README
URL: http://svn.apache.org/viewvc/stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/json/README?rev=1468918&r1=1468917&r2=1468918&view=diff
==============================================================================
--- stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/json/README (original)
+++ stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/json/README Wed Apr 17 14:06:22 2013
@@ -1 +1,42 @@
-The json2.js file is taken from https://github.com/douglascrockford/JSON-js
\ No newline at end of file
+JSON in JavaScript
+
+
+Douglas Crockford
+douglas@crockford.com
+
+2010-11-18
+
+
+JSON is a light-weight, language independent, data interchange format.
+See http://www.JSON.org/
+
+The files in this collection implement JSON encoders/decoders in JavaScript.
+
+JSON became a built-in feature of JavaScript when the ECMAScript Programming
+Language Standard - Fifth Edition was adopted by the ECMA General Assembly
+in December 2009. Most of the files in this collection are for applications
+that are expected to run in obsolete web browsers. For most purposes, json2.js
+is the best choice.
+
+
+json2.js: This file creates a JSON property in the global object, if there
+isn't already one, setting its value to an object containing a stringify
+method and a parse method. The parse method uses the eval method to do the
+parsing, guarding it with several regular expressions to defend against
+accidental code execution hazards. On current browsers, this file does nothing,
+prefering the built-in JSON object.
+
+json.js: This file does everything that json2.js does. It also adds a
+toJSONString method and a parseJSON method to Object.prototype. Use of this
+file is not recommended.
+
+json_parse.js: This file contains an alternative JSON parse function that
+uses recursive descent instead of eval.
+
+json_parse_state.js: This files contains an alternative JSON parse function that
+uses a state machine instead of eval.
+
+cycle.js: This file contains two functions, JSON.decycle and JSON.retrocycle,
+which make it possible to encode cyclical structures and dags in JSON, and to
+then recover them. JSONPath is used to represent the links.
+http://GOESSNER.net/articles/JsonPath/
Added: stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/json/cycle.js
URL: http://svn.apache.org/viewvc/stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/json/cycle.js?rev=1468918&view=auto
==============================================================================
--- stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/json/cycle.js (added)
+++ stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/json/cycle.js Wed Apr 17 14:06:22 2013
@@ -0,0 +1,172 @@
+/*
+ cycle.js
+ 2013-02-19
+
+ Public Domain.
+
+ NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
+
+ This code should be minified before deployment.
+ See http://javascript.crockford.com/jsmin.html
+
+ USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
+ NOT CONTROL.
+*/
+
+/*jslint evil: true, regexp: true */
+
+/*members $ref, apply, call, decycle, hasOwnProperty, length, prototype, push,
+ retrocycle, stringify, test, toString
+*/
+
+if (typeof JSON.decycle !== 'function') {
+ JSON.decycle = function decycle(object) {
+ 'use strict';
+
+// Make a deep copy of an object or array, assuring that there is at most
+// one instance of each object or array in the resulting structure. The
+// duplicate references (which might be forming cycles) are replaced with
+// an object of the form
+// {$ref: PATH}
+// where the PATH is a JSONPath string that locates the first occurance.
+// So,
+// var a = [];
+// a[0] = a;
+// return JSON.stringify(JSON.decycle(a));
+// produces the string '[{"$ref":"$"}]'.
+
+// JSONPath is used to locate the unique object. $ indicates the top level of
+// the object or array. [NUMBER] or [STRING] indicates a child member or
+// property.
+
+ var objects = [], // Keep a reference to each unique object or array
+ paths = []; // Keep the path to each unique object or array
+
+ return (function derez(value, path) {
+
+// The derez recurses through the object, producing the deep copy.
+
+ var i, // The loop counter
+ name, // Property name
+ nu; // The new object or array
+
+// typeof null === 'object', so go on if this value is really an object but not
+// one of the weird builtin objects.
+
+ if (typeof value === 'object' && value !== null &&
+ !(value instanceof Boolean) &&
+ !(value instanceof Date) &&
+ !(value instanceof Number) &&
+ !(value instanceof RegExp) &&
+ !(value instanceof String)) {
+
+// If the value is an object or array, look to see if we have already
+// encountered it. If so, return a $ref/path object. This is a hard way,
+// linear search that will get slower as the number of unique objects grows.
+
+ for (i = 0; i < objects.length; i += 1) {
+ if (objects[i] === value) {
+ return {$ref: paths[i]};
+ }
+ }
+
+// Otherwise, accumulate the unique value and its path.
+
+ objects.push(value);
+ paths.push(path);
+
+// If it is an array, replicate the array.
+
+ if (Object.prototype.toString.apply(value) === '[object Array]') {
+ nu = [];
+ for (i = 0; i < value.length; i += 1) {
+ nu[i] = derez(value[i], path + '[' + i + ']');
+ }
+ } else {
+
+// If it is an object, replicate the object.
+
+ nu = {};
+ for (name in value) {
+ if (Object.prototype.hasOwnProperty.call(value, name)) {
+ nu[name] = derez(value[name],
+ path + '[' + JSON.stringify(name) + ']');
+ }
+ }
+ }
+ return nu;
+ }
+ return value;
+ }(object, '$'));
+ };
+}
+
+
+if (typeof JSON.retrocycle !== 'function') {
+ JSON.retrocycle = function retrocycle($) {
+ 'use strict';
+
+// Restore an object that was reduced by decycle. Members whose values are
+// objects of the form
+// {$ref: PATH}
+// are replaced with references to the value found by the PATH. This will
+// restore cycles. The object will be mutated.
+
+// The eval function is used to locate the values described by a PATH. The
+// root object is kept in a $ variable. A regular expression is used to
+// assure that the PATH is extremely well formed. The regexp contains nested
+// * quantifiers. That has been known to have extremely bad performance
+// problems on some browsers for very long strings. A PATH is expected to be
+// reasonably short. A PATH is allowed to belong to a very restricted subset of
+// Goessner's JSONPath.
+
+// So,
+// var s = '[{"$ref":"$"}]';
+// return JSON.retrocycle(JSON.parse(s));
+// produces an array containing a single element which is the array itself.
+
+ var px =
+ /^\$(?:\[(?:\d+|\"(?:[^\\\"\u0000-\u001f]|\\([\\\"\/bfnrt]|u[0-9a-zA-Z]{4}))*\")\])*$/;
+
+ (function rez(value) {
+
+// The rez function walks recursively through the object looking for $ref
+// properties. When it finds one that has a value that is a path, then it
+// replaces the $ref object with a reference to the value that is found by
+// the path.
+
+ var i, item, name, path;
+
+ if (value && typeof value === 'object') {
+ if (Object.prototype.toString.apply(value) === '[object Array]') {
+ for (i = 0; i < value.length; i += 1) {
+ item = value[i];
+ if (item && typeof item === 'object') {
+ path = item.$ref;
+ if (typeof path === 'string' && px.test(path)) {
+ value[i] = eval(path);
+ } else {
+ rez(item);
+ }
+ }
+ }
+ } else {
+ for (name in value) {
+ if (typeof value[name] === 'object') {
+ item = value[name];
+ if (item) {
+ path = item.$ref;
+ if (typeof path === 'string' && px.test(path)) {
+ value[name] = eval(path);
+ } else {
+ rez(item);
+ }
+ }
+ }
+ }
+ }
+ }
+ }($));
+ return $;
+ };
+}
Added: stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/json/json.js
URL: http://svn.apache.org/viewvc/stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/json/json.js?rev=1468918&view=auto
==============================================================================
--- stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/json/json.js (added)
+++ stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/json/json.js Wed Apr 17 14:06:22 2013
@@ -0,0 +1,529 @@
+/*
+ json.js
+ 2012-10-08
+
+ Public Domain
+
+ No warranty expressed or implied. Use at your own risk.
+
+ This file has been superceded by http://www.JSON.org/json2.js
+
+ See http://www.JSON.org/js.html
+
+ This code should be minified before deployment.
+ See http://javascript.crockford.com/jsmin.html
+
+ USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
+ NOT CONTROL.
+
+ This file adds these methods to JavaScript:
+
+ object.toJSONString(whitelist)
+ This method produce a JSON text from a JavaScript value.
+ It must not contain any cyclical references. Illegal values
+ will be excluded.
+
+ The default conversion for dates is to an ISO string. You can
+ add a toJSONString method to any date object to get a different
+ representation.
+
+ The object and array methods can take an optional whitelist
+ argument. A whitelist is an array of strings. If it is provided,
+ keys in objects not found in the whitelist are excluded.
+
+ string.parseJSON(filter)
+ This method parses a JSON text to produce an object or
+ array. It can throw a SyntaxError exception.
+
+ The optional filter parameter is a function which can filter and
+ transform the results. It receives each of the keys and values, and
+ its return value is used instead of the original value. If it
+ returns what it received, then structure is not modified. If it
+ returns undefined then the member is deleted.
+
+ Example:
+
+ // Parse the text. If a key contains the string 'date' then
+ // convert the value to a date.
+
+ myData = text.parseJSON(function (key, value) {
+ return key.indexOf('date') >= 0 ? new Date(value) : value;
+ });
+
+ This file will break programs with improper for..in loops. See
+ http://yuiblog.com/blog/2006/09/26/for-in-intrigue/
+
+ This file creates a global JSON object containing two methods: stringify
+ and parse.
+
+ JSON.stringify(value, replacer, space)
+ value any JavaScript value, usually an object or array.
+
+ replacer an optional parameter that determines how object
+ values are stringified for objects. It can be a
+ function or an array of strings.
+
+ space an optional parameter that specifies the indentation
+ of nested structures. If it is omitted, the text will
+ be packed without extra whitespace. If it is a number,
+ it will specify the number of spaces to indent at each
+ level. If it is a string (such as '\t' or ' '),
+ it contains the characters used to indent at each level.
+
+ This method produces a JSON text from a JavaScript value.
+
+ When an object value is found, if the object contains a toJSON
+ method, its toJSON method will be called and the result will be
+ stringified. A toJSON method does not serialize: it returns the
+ value represented by the name/value pair that should be serialized,
+ or undefined if nothing should be serialized. The toJSON method
+ will be passed the key associated with the value, and this will be
+ bound to the object holding the key.
+
+ For example, this would serialize Dates as ISO strings.
+
+ Date.prototype.toJSON = function (key) {
+ function f(n) {
+ // Format integers to have at least two digits.
+ return n < 10 ? '0' + n : n;
+ }
+
+ return this.getUTCFullYear() + '-' +
+ f(this.getUTCMonth() + 1) + '-' +
+ f(this.getUTCDate()) + 'T' +
+ f(this.getUTCHours()) + ':' +
+ f(this.getUTCMinutes()) + ':' +
+ f(this.getUTCSeconds()) + 'Z';
+ };
+
+ You can provide an optional replacer method. It will be passed the
+ key and value of each member, with this bound to the containing
+ object. The value that is returned from your method will be
+ serialized. If your method returns undefined, then the member will
+ be excluded from the serialization.
+
+ If the replacer parameter is an array of strings, then it will be
+ used to select the members to be serialized. It filters the results
+ such that only members with keys listed in the replacer array are
+ stringified.
+
+ Values that do not have JSON representations, such as undefined or
+ functions, will not be serialized. Such values in objects will be
+ dropped; in arrays they will be replaced with null. You can use
+ a replacer function to replace those with JSON values.
+ JSON.stringify(undefined) returns undefined.
+
+ The optional space parameter produces a stringification of the
+ value that is filled with line breaks and indentation to make it
+ easier to read.
+
+ If the space parameter is a non-empty string, then that string will
+ be used for indentation. If the space parameter is a number, then
+ the indentation will be that many spaces.
+
+ Example:
+
+ text = JSON.stringify(['e', {pluribus: 'unum'}]);
+ // text is '["e",{"pluribus":"unum"}]'
+
+
+ text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
+ // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
+
+ text = JSON.stringify([new Date()], function (key, value) {
+ return this[key] instanceof Date ?
+ 'Date(' + this[key] + ')' : value;
+ });
+ // text is '["Date(---current time---)"]'
+
+
+ JSON.parse(text, reviver)
+ This method parses a JSON text to produce an object or array.
+ It can throw a SyntaxError exception.
+
+ The optional reviver parameter is a function that can filter and
+ transform the results. It receives each of the keys and values,
+ and its return value is used instead of the original value.
+ If it returns what it received, then the structure is not modified.
+ If it returns undefined then the member is deleted.
+
+ Example:
+
+ // Parse the text. Values that look like ISO date strings will
+ // be converted to Date objects.
+
+ myData = JSON.parse(text, function (key, value) {
+ var a;
+ if (typeof value === 'string') {
+ a =
+/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
+ if (a) {
+ return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
+ +a[5], +a[6]));
+ }
+ }
+ return value;
+ });
+
+ myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
+ var d;
+ if (typeof value === 'string' &&
+ value.slice(0, 5) === 'Date(' &&
+ value.slice(-1) === ')') {
+ d = new Date(value.slice(5, -1));
+ if (d) {
+ return d;
+ }
+ }
+ return value;
+ });
+
+
+ This is a reference implementation. You are free to copy, modify, or
+ redistribute.
+*/
+
+/*jslint evil: true, regexp: true, unparam: true */
+
+/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
+ call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
+ getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
+ lastIndex, length, parse, parseJSON, prototype, push, replace, slice,
+ stringify, test, toJSON, toJSONString, toString, valueOf
+*/
+
+
+// Create a JSON object only if one does not already exist. We create the
+// methods in a closure to avoid creating global variables.
+
+if (typeof JSON !== 'object') {
+ JSON = {};
+}
+
+(function () {
+ 'use strict';
+
+ function f(n) {
+ // Format integers to have at least two digits.
+ return n < 10 ? '0' + n : n;
+ }
+
+ if (typeof Date.prototype.toJSON !== 'function') {
+
+ Date.prototype.toJSON = function (key) {
+
+ return isFinite(this.valueOf()) ?
+ this.getUTCFullYear() + '-' +
+ f(this.getUTCMonth() + 1) + '-' +
+ f(this.getUTCDate()) + 'T' +
+ f(this.getUTCHours()) + ':' +
+ f(this.getUTCMinutes()) + ':' +
+ f(this.getUTCSeconds()) + 'Z' : null;
+ };
+
+ String.prototype.toJSON =
+ Number.prototype.toJSON =
+ Boolean.prototype.toJSON = function (key) {
+ return this.valueOf();
+ };
+ }
+
+ var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
+ escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
+ gap,
+ indent,
+ meta = { // table of character substitutions
+ '\b': '\\b',
+ '\t': '\\t',
+ '\n': '\\n',
+ '\f': '\\f',
+ '\r': '\\r',
+ '"' : '\\"',
+ '\\': '\\\\'
+ },
+ rep;
+
+
+ function quote(string) {
+
+// If the string contains no control characters, no quote characters, and no
+// backslash characters, then we can safely slap some quotes around it.
+// Otherwise we must also replace the offending characters with safe escape
+// sequences.
+
+ escapable.lastIndex = 0;
+ return escapable.test(string) ? '"' + string.replace(escapable, function (a) {
+ var c = meta[a];
+ return typeof c === 'string' ? c :
+ '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
+ }) + '"' : '"' + string + '"';
+ }
+
+
+ function str(key, holder) {
+
+// Produce a string from holder[key].
+
+ var i, // The loop counter.
+ k, // The member key.
+ v, // The member value.
+ length,
+ mind = gap,
+ partial,
+ value = holder[key];
+
+// If the value has a toJSON method, call it to obtain a replacement value.
+
+ if (value && typeof value === 'object' &&
+ typeof value.toJSON === 'function') {
+ value = value.toJSON(key);
+ }
+
+// If we were called with a replacer function, then call the replacer to
+// obtain a replacement value.
+
+ if (typeof rep === 'function') {
+ value = rep.call(holder, key, value);
+ }
+
+// What happens next depends on the value's type.
+
+ switch (typeof value) {
+ case 'string':
+ return quote(value);
+
+ case 'number':
+
+// JSON numbers must be finite. Encode non-finite numbers as null.
+
+ return isFinite(value) ? String(value) : 'null';
+
+ case 'boolean':
+ case 'null':
+
+// If the value is a boolean or null, convert it to a string. Note:
+// typeof null does not produce 'null'. The case is included here in
+// the remote chance that this gets fixed someday.
+
+ return String(value);
+
+// If the type is 'object', we might be dealing with an object or an array or
+// null.
+
+ case 'object':
+
+// Due to a specification blunder in ECMAScript, typeof null is 'object',
+// so watch out for that case.
+
+ if (!value) {
+ return 'null';
+ }
+
+// Make an array to hold the partial results of stringifying this object value.
+
+ gap += indent;
+ partial = [];
+
+// Is the value an array?
+
+ if (Object.prototype.toString.apply(value) === '[object Array]') {
+
+// The value is an array. Stringify every element. Use null as a placeholder
+// for non-JSON values.
+
+ length = value.length;
+ for (i = 0; i < length; i += 1) {
+ partial[i] = str(i, value) || 'null';
+ }
+
+// Join all of the elements together, separated with commas, and wrap them in
+// brackets.
+
+ v = partial.length === 0 ? '[]' : gap ?
+ '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' :
+ '[' + partial.join(',') + ']';
+ gap = mind;
+ return v;
+ }
+
+// If the replacer is an array, use it to select the members to be stringified.
+
+ if (rep && typeof rep === 'object') {
+ length = rep.length;
+ for (i = 0; i < length; i += 1) {
+ k = rep[i];
+ if (typeof k === 'string') {
+ v = str(k, value);
+ if (v) {
+ partial.push(quote(k) + (gap ? ': ' : ':') + v);
+ }
+ }
+ }
+ } else {
+
+// Otherwise, iterate through all of the keys in the object.
+
+ for (k in value) {
+ if (Object.prototype.hasOwnProperty.call(value, k)) {
+ v = str(k, value);
+ if (v) {
+ partial.push(quote(k) + (gap ? ': ' : ':') + v);
+ }
+ }
+ }
+ }
+
+// Join all of the member texts together, separated with commas,
+// and wrap them in braces.
+
+ v = partial.length === 0 ? '{}' : gap ?
+ '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' :
+ '{' + partial.join(',') + '}';
+ gap = mind;
+ return v;
+ }
+ }
+
+// If the JSON object does not yet have a stringify method, give it one.
+
+ if (typeof JSON.stringify !== 'function') {
+ JSON.stringify = function (value, replacer, space) {
+
+// The stringify method takes a value and an optional replacer, and an optional
+// space parameter, and returns a JSON text. The replacer can be a function
+// that can replace values, or an array of strings that will select the keys.
+// A default replacer method can be provided. Use of the space parameter can
+// produce text that is more easily readable.
+
+ var i;
+ gap = '';
+ indent = '';
+
+// If the space parameter is a number, make an indent string containing that
+// many spaces.
+
+ if (typeof space === 'number') {
+ for (i = 0; i < space; i += 1) {
+ indent += ' ';
+ }
+
+// If the space parameter is a string, it will be used as the indent string.
+
+ } else if (typeof space === 'string') {
+ indent = space;
+ }
+
+// If there is a replacer, it must be a function or an array.
+// Otherwise, throw an error.
+
+ rep = replacer;
+ if (replacer && typeof replacer !== 'function' &&
+ (typeof replacer !== 'object' ||
+ typeof replacer.length !== 'number')) {
+ throw new Error('JSON.stringify');
+ }
+
+// Make a fake root object containing our value under the key of ''.
+// Return the result of stringifying the value.
+
+ return str('', {'': value});
+ };
+ }
+
+
+// If the JSON object does not yet have a parse method, give it one.
+
+ if (typeof JSON.parse !== 'function') {
+ JSON.parse = function (text, reviver) {
+
+// The parse method takes a text and an optional reviver function, and returns
+// a JavaScript value if the text is a valid JSON text.
+
+ var j;
+
+ function walk(holder, key) {
+
+// The walk method is used to recursively walk the resulting structure so
+// that modifications can be made.
+
+ var k, v, value = holder[key];
+ if (value && typeof value === 'object') {
+ for (k in value) {
+ if (Object.prototype.hasOwnProperty.call(value, k)) {
+ v = walk(value, k);
+ if (v !== undefined) {
+ value[k] = v;
+ } else {
+ delete value[k];
+ }
+ }
+ }
+ }
+ return reviver.call(holder, key, value);
+ }
+
+
+// Parsing happens in four stages. In the first stage, we replace certain
+// Unicode characters with escape sequences. JavaScript handles many characters
+// incorrectly, either silently deleting them, or treating them as line endings.
+
+ text = String(text);
+ cx.lastIndex = 0;
+ if (cx.test(text)) {
+ text = text.replace(cx, function (a) {
+ return '\\u' +
+ ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
+ });
+ }
+
+// In the second stage, we run the text against regular expressions that look
+// for non-JSON patterns. We are especially concerned with '()' and 'new'
+// because they can cause invocation, and '=' because it can cause mutation.
+// But just to be safe, we want to reject all unexpected forms.
+
+// We split the second stage into 4 regexp operations in order to work around
+// crippling inefficiencies in IE's and Safari's regexp engines. First we
+// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
+// replace all simple value tokens with ']' characters. Third, we delete all
+// open brackets that follow a colon or comma or that begin the text. Finally,
+// we look to see that the remaining characters are only whitespace or ']' or
+// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
+
+ if (/^[\],:{}\s]*$/
+ .test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
+ .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
+ .replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
+
+// In the third stage we use the eval function to compile the text into a
+// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
+// in JavaScript: it can begin a block or an object literal. We wrap the text
+// in parens to eliminate the ambiguity.
+
+ j = eval('(' + text + ')');
+
+// In the optional fourth stage, we recursively walk the new structure, passing
+// each name/value pair to a reviver function for possible transformation.
+
+ return typeof reviver === 'function' ?
+ walk({'': j}, '') : j;
+ }
+
+// If the text is not JSON parseable, then a SyntaxError is thrown.
+
+ throw new SyntaxError('JSON.parse');
+ };
+ }
+
+// Augment the basic prototypes if they have not already been augmented.
+// These forms are obsolete. It is recommended that JSON.stringify and
+// JSON.parse be used instead.
+
+ if (!Object.prototype.toJSONString) {
+ Object.prototype.toJSONString = function (filter) {
+ return JSON.stringify(this, filter);
+ };
+ Object.prototype.parseJSON = function (filter) {
+ return JSON.parse(this, filter);
+ };
+ }
+}());
Modified: stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/json/json2.js
URL: http://svn.apache.org/viewvc/stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/json/json2.js?rev=1468918&r1=1468917&r2=1468918&view=diff
==============================================================================
--- stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/json/json2.js (original)
+++ stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/json/json2.js Wed Apr 17 14:06:22 2013
@@ -1,6 +1,6 @@
/*
- http://www.JSON.org/json2.js
- 2011-10-19
+ json2.js
+ 2012-10-08
Public Domain.
@@ -159,8 +159,7 @@
// Create a JSON object only if one does not already exist. We create the
// methods in a closure to avoid creating global variables.
-var JSON;
-if (!JSON) {
+if (typeof JSON !== 'object') {
JSON = {};
}
@@ -484,4 +483,4 @@ if (!JSON) {
throw new SyntaxError('JSON.parse');
};
}
-}());
\ No newline at end of file
+}());
Added: stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/json/json_parse.js
URL: http://svn.apache.org/viewvc/stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/json/json_parse.js?rev=1468918&view=auto
==============================================================================
--- stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/json/json_parse.js (added)
+++ stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/json/json_parse.js Wed Apr 17 14:06:22 2013
@@ -0,0 +1,349 @@
+/*
+ json_parse.js
+ 2012-06-20
+
+ Public Domain.
+
+ NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
+
+ This file creates a json_parse function.
+
+ json_parse(text, reviver)
+ This method parses a JSON text to produce an object or array.
+ It can throw a SyntaxError exception.
+
+ The optional reviver parameter is a function that can filter and
+ transform the results. It receives each of the keys and values,
+ and its return value is used instead of the original value.
+ If it returns what it received, then the structure is not modified.
+ If it returns undefined then the member is deleted.
+
+ Example:
+
+ // Parse the text. Values that look like ISO date strings will
+ // be converted to Date objects.
+
+ myData = json_parse(text, function (key, value) {
+ var a;
+ if (typeof value === 'string') {
+ a =
+/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
+ if (a) {
+ return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
+ +a[5], +a[6]));
+ }
+ }
+ return value;
+ });
+
+ This is a reference implementation. You are free to copy, modify, or
+ redistribute.
+
+ This code should be minified before deployment.
+ See http://javascript.crockford.com/jsmin.html
+
+ USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
+ NOT CONTROL.
+*/
+
+/*members "", "\"", "\/", "\\", at, b, call, charAt, f, fromCharCode,
+ hasOwnProperty, message, n, name, prototype, push, r, t, text
+*/
+
+var json_parse = (function () {
+ "use strict";
+
+// This is a function that can parse a JSON text, producing a JavaScript
+// data structure. It is a simple, recursive descent parser. It does not use
+// eval or regular expressions, so it can be used as a model for implementing
+// a JSON parser in other languages.
+
+// We are defining the function inside of another function to avoid creating
+// global variables.
+
+ var at, // The index of the current character
+ ch, // The current character
+ escapee = {
+ '"': '"',
+ '\\': '\\',
+ '/': '/',
+ b: '\b',
+ f: '\f',
+ n: '\n',
+ r: '\r',
+ t: '\t'
+ },
+ text,
+
+ error = function (m) {
+
+// Call error when something is wrong.
+
+ throw {
+ name: 'SyntaxError',
+ message: m,
+ at: at,
+ text: text
+ };
+ },
+
+ next = function (c) {
+
+// If a c parameter is provided, verify that it matches the current character.
+
+ if (c && c !== ch) {
+ error("Expected '" + c + "' instead of '" + ch + "'");
+ }
+
+// Get the next character. When there are no more characters,
+// return the empty string.
+
+ ch = text.charAt(at);
+ at += 1;
+ return ch;
+ },
+
+ number = function () {
+
+// Parse a number value.
+
+ var number,
+ string = '';
+
+ if (ch === '-') {
+ string = '-';
+ next('-');
+ }
+ while (ch >= '0' && ch <= '9') {
+ string += ch;
+ next();
+ }
+ if (ch === '.') {
+ string += '.';
+ while (next() && ch >= '0' && ch <= '9') {
+ string += ch;
+ }
+ }
+ if (ch === 'e' || ch === 'E') {
+ string += ch;
+ next();
+ if (ch === '-' || ch === '+') {
+ string += ch;
+ next();
+ }
+ while (ch >= '0' && ch <= '9') {
+ string += ch;
+ next();
+ }
+ }
+ number = +string;
+ if (!isFinite(number)) {
+ error("Bad number");
+ } else {
+ return number;
+ }
+ },
+
+ string = function () {
+
+// Parse a string value.
+
+ var hex,
+ i,
+ string = '',
+ uffff;
+
+// When parsing for string values, we must look for " and \ characters.
+
+ if (ch === '"') {
+ while (next()) {
+ if (ch === '"') {
+ next();
+ return string;
+ }
+ if (ch === '\\') {
+ next();
+ if (ch === 'u') {
+ uffff = 0;
+ for (i = 0; i < 4; i += 1) {
+ hex = parseInt(next(), 16);
+ if (!isFinite(hex)) {
+ break;
+ }
+ uffff = uffff * 16 + hex;
+ }
+ string += String.fromCharCode(uffff);
+ } else if (typeof escapee[ch] === 'string') {
+ string += escapee[ch];
+ } else {
+ break;
+ }
+ } else {
+ string += ch;
+ }
+ }
+ }
+ error("Bad string");
+ },
+
+ white = function () {
+
+// Skip whitespace.
+
+ while (ch && ch <= ' ') {
+ next();
+ }
+ },
+
+ word = function () {
+
+// true, false, or null.
+
+ switch (ch) {
+ case 't':
+ next('t');
+ next('r');
+ next('u');
+ next('e');
+ return true;
+ case 'f':
+ next('f');
+ next('a');
+ next('l');
+ next('s');
+ next('e');
+ return false;
+ case 'n':
+ next('n');
+ next('u');
+ next('l');
+ next('l');
+ return null;
+ }
+ error("Unexpected '" + ch + "'");
+ },
+
+ value, // Place holder for the value function.
+
+ array = function () {
+
+// Parse an array value.
+
+ var array = [];
+
+ if (ch === '[') {
+ next('[');
+ white();
+ if (ch === ']') {
+ next(']');
+ return array; // empty array
+ }
+ while (ch) {
+ array.push(value());
+ white();
+ if (ch === ']') {
+ next(']');
+ return array;
+ }
+ next(',');
+ white();
+ }
+ }
+ error("Bad array");
+ },
+
+ object = function () {
+
+// Parse an object value.
+
+ var key,
+ object = {};
+
+ if (ch === '{') {
+ next('{');
+ white();
+ if (ch === '}') {
+ next('}');
+ return object; // empty object
+ }
+ while (ch) {
+ key = string();
+ white();
+ next(':');
+ if (Object.hasOwnProperty.call(object, key)) {
+ error('Duplicate key "' + key + '"');
+ }
+ object[key] = value();
+ white();
+ if (ch === '}') {
+ next('}');
+ return object;
+ }
+ next(',');
+ white();
+ }
+ }
+ error("Bad object");
+ };
+
+ value = function () {
+
+// Parse a JSON value. It could be an object, an array, a string, a number,
+// or a word.
+
+ white();
+ switch (ch) {
+ case '{':
+ return object();
+ case '[':
+ return array();
+ case '"':
+ return string();
+ case '-':
+ return number();
+ default:
+ return ch >= '0' && ch <= '9' ? number() : word();
+ }
+ };
+
+// Return the json_parse function. It will have access to all of the above
+// functions and variables.
+
+ return function (source, reviver) {
+ var result;
+
+ text = source;
+ at = 0;
+ ch = ' ';
+ result = value();
+ white();
+ if (ch) {
+ error("Syntax error");
+ }
+
+// If there is a reviver function, we recursively walk the new structure,
+// passing each name/value pair to the reviver function for possible
+// transformation, starting with a temporary root object that holds the result
+// in an empty key. If there is not a reviver function, we simply return the
+// result.
+
+ return typeof reviver === 'function'
+ ? (function walk(holder, key) {
+ var k, v, value = holder[key];
+ if (value && typeof value === 'object') {
+ for (k in value) {
+ if (Object.prototype.hasOwnProperty.call(value, k)) {
+ v = walk(value, k);
+ if (v !== undefined) {
+ value[k] = v;
+ } else {
+ delete value[k];
+ }
+ }
+ }
+ }
+ return reviver.call(holder, key, value);
+ }({'': result}, ''))
+ : result;
+ };
+}());
Added: stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/json/json_parse_state.js
URL: http://svn.apache.org/viewvc/stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/json/json_parse_state.js?rev=1468918&view=auto
==============================================================================
--- stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/json/json_parse_state.js (added)
+++ stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/json/json_parse_state.js Wed Apr 17 14:06:22 2013
@@ -0,0 +1,397 @@
+/*
+ json_parse_state.js
+ 2012-06-01
+
+ Public Domain.
+
+ NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
+
+ This file creates a json_parse function.
+
+ json_parse(text, reviver)
+ This method parses a JSON text to produce an object or array.
+ It can throw a SyntaxError exception.
+
+ The optional reviver parameter is a function that can filter and
+ transform the results. It receives each of the keys and values,
+ and its return value is used instead of the original value.
+ If it returns what it received, then the structure is not modified.
+ If it returns undefined then the member is deleted.
+
+ Example:
+
+ // Parse the text. Values that look like ISO date strings will
+ // be converted to Date objects.
+
+ myData = json_parse(text, function (key, value) {
+ var a;
+ if (typeof value === 'string') {
+ a =
+/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
+ if (a) {
+ return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
+ +a[5], +a[6]));
+ }
+ }
+ return value;
+ });
+
+ This is a reference implementation. You are free to copy, modify, or
+ redistribute.
+
+ This code should be minified before deployment.
+ See http://javascript.crockford.com/jsmin.html
+
+ USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
+ NOT CONTROL.
+*/
+
+/*jslint regexp: false*/
+
+/*members "", "\"", ",", "\/", ":", "[", "\\", "]", acomma, avalue, b,
+ call, colon, container, exec, f, false, firstavalue, firstokey,
+ fromCharCode, go, hasOwnProperty, key, length, n, null, ocomma, okey,
+ ovalue, pop, prototype, push, r, replace, slice, state, t, test, true,
+ value, "{", "}"
+*/
+
+var json_parse = (function () {
+ "use strict";
+
+// This function creates a JSON parse function that uses a state machine rather
+// than the dangerous eval function to parse a JSON text.
+
+ var state, // The state of the parser, one of
+ // 'go' The starting state
+ // 'ok' The final, accepting state
+ // 'firstokey' Ready for the first key of the object or
+ // the closing of an empty object
+ // 'okey' Ready for the next key of the object
+ // 'colon' Ready for the colon
+ // 'ovalue' Ready for the value half of a key/value pair
+ // 'ocomma' Ready for a comma or closing }
+ // 'firstavalue' Ready for the first value of an array or
+ // an empty array
+ // 'avalue' Ready for the next value of an array
+ // 'acomma' Ready for a comma or closing ]
+ stack, // The stack, for controlling nesting.
+ container, // The current container object or array
+ key, // The current key
+ value, // The current value
+ escapes = { // Escapement translation table
+ '\\': '\\',
+ '"': '"',
+ '/': '/',
+ 't': '\t',
+ 'n': '\n',
+ 'r': '\r',
+ 'f': '\f',
+ 'b': '\b'
+ },
+ string = { // The actions for string tokens
+ go: function () {
+ state = 'ok';
+ },
+ firstokey: function () {
+ key = value;
+ state = 'colon';
+ },
+ okey: function () {
+ key = value;
+ state = 'colon';
+ },
+ ovalue: function () {
+ state = 'ocomma';
+ },
+ firstavalue: function () {
+ state = 'acomma';
+ },
+ avalue: function () {
+ state = 'acomma';
+ }
+ },
+ number = { // The actions for number tokens
+ go: function () {
+ state = 'ok';
+ },
+ ovalue: function () {
+ state = 'ocomma';
+ },
+ firstavalue: function () {
+ state = 'acomma';
+ },
+ avalue: function () {
+ state = 'acomma';
+ }
+ },
+ action = {
+
+// The action table describes the behavior of the machine. It contains an
+// object for each token. Each object contains a method that is called when
+// a token is matched in a state. An object will lack a method for illegal
+// states.
+
+ '{': {
+ go: function () {
+ stack.push({state: 'ok'});
+ container = {};
+ state = 'firstokey';
+ },
+ ovalue: function () {
+ stack.push({container: container, state: 'ocomma', key: key});
+ container = {};
+ state = 'firstokey';
+ },
+ firstavalue: function () {
+ stack.push({container: container, state: 'acomma'});
+ container = {};
+ state = 'firstokey';
+ },
+ avalue: function () {
+ stack.push({container: container, state: 'acomma'});
+ container = {};
+ state = 'firstokey';
+ }
+ },
+ '}': {
+ firstokey: function () {
+ var pop = stack.pop();
+ value = container;
+ container = pop.container;
+ key = pop.key;
+ state = pop.state;
+ },
+ ocomma: function () {
+ var pop = stack.pop();
+ container[key] = value;
+ value = container;
+ container = pop.container;
+ key = pop.key;
+ state = pop.state;
+ }
+ },
+ '[': {
+ go: function () {
+ stack.push({state: 'ok'});
+ container = [];
+ state = 'firstavalue';
+ },
+ ovalue: function () {
+ stack.push({container: container, state: 'ocomma', key: key});
+ container = [];
+ state = 'firstavalue';
+ },
+ firstavalue: function () {
+ stack.push({container: container, state: 'acomma'});
+ container = [];
+ state = 'firstavalue';
+ },
+ avalue: function () {
+ stack.push({container: container, state: 'acomma'});
+ container = [];
+ state = 'firstavalue';
+ }
+ },
+ ']': {
+ firstavalue: function () {
+ var pop = stack.pop();
+ value = container;
+ container = pop.container;
+ key = pop.key;
+ state = pop.state;
+ },
+ acomma: function () {
+ var pop = stack.pop();
+ container.push(value);
+ value = container;
+ container = pop.container;
+ key = pop.key;
+ state = pop.state;
+ }
+ },
+ ':': {
+ colon: function () {
+ if (Object.hasOwnProperty.call(container, key)) {
+ throw new SyntaxError('Duplicate key "' + key + '"');
+ }
+ state = 'ovalue';
+ }
+ },
+ ',': {
+ ocomma: function () {
+ container[key] = value;
+ state = 'okey';
+ },
+ acomma: function () {
+ container.push(value);
+ state = 'avalue';
+ }
+ },
+ 'true': {
+ go: function () {
+ value = true;
+ state = 'ok';
+ },
+ ovalue: function () {
+ value = true;
+ state = 'ocomma';
+ },
+ firstavalue: function () {
+ value = true;
+ state = 'acomma';
+ },
+ avalue: function () {
+ value = true;
+ state = 'acomma';
+ }
+ },
+ 'false': {
+ go: function () {
+ value = false;
+ state = 'ok';
+ },
+ ovalue: function () {
+ value = false;
+ state = 'ocomma';
+ },
+ firstavalue: function () {
+ value = false;
+ state = 'acomma';
+ },
+ avalue: function () {
+ value = false;
+ state = 'acomma';
+ }
+ },
+ 'null': {
+ go: function () {
+ value = null;
+ state = 'ok';
+ },
+ ovalue: function () {
+ value = null;
+ state = 'ocomma';
+ },
+ firstavalue: function () {
+ value = null;
+ state = 'acomma';
+ },
+ avalue: function () {
+ value = null;
+ state = 'acomma';
+ }
+ }
+ };
+
+ function debackslashify(text) {
+
+// Remove and replace any backslash escapement.
+
+ return text.replace(/\\(?:u(.{4})|([^u]))/g, function (a, b, c) {
+ return b ? String.fromCharCode(parseInt(b, 16)) : escapes[c];
+ });
+ }
+
+ return function (source, reviver) {
+
+// A regular expression is used to extract tokens from the JSON text.
+// The extraction process is cautious.
+
+ var r, // The result of the exec method.
+ tx = /^[\x20\t\n\r]*(?:([,:\[\]{}]|true|false|null)|(-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)|"((?:[^\r\n\t\\\"]|\\(?:["\\\/trnfb]|u[0-9a-fA-F]{4}))*)")/;
+
+// Set the starting state.
+
+ state = 'go';
+
+// The stack records the container, key, and state for each object or array
+// that contains another object or array while processing nested structures.
+
+ stack = [];
+
+// If any error occurs, we will catch it and ultimately throw a syntax error.
+
+ try {
+
+// For each token...
+
+ for (;;) {
+ r = tx.exec(source);
+ if (!r) {
+ break;
+ }
+
+// r is the result array from matching the tokenizing regular expression.
+// r[0] contains everything that matched, including any initial whitespace.
+// r[1] contains any punctuation that was matched, or true, false, or null.
+// r[2] contains a matched number, still in string form.
+// r[3] contains a matched string, without quotes but with escapement.
+
+ if (r[1]) {
+
+// Token: Execute the action for this state and token.
+
+ action[r[1]][state]();
+
+ } else if (r[2]) {
+
+// Number token: Convert the number string into a number value and execute
+// the action for this state and number.
+
+ value = +r[2];
+ number[state]();
+ } else {
+
+// String token: Replace the escapement sequences and execute the action for
+// this state and string.
+
+ value = debackslashify(r[3]);
+ string[state]();
+ }
+
+// Remove the token from the string. The loop will continue as long as there
+// are tokens. This is a slow process, but it allows the use of ^ matching,
+// which assures that no illegal tokens slip through.
+
+ source = source.slice(r[0].length);
+ }
+
+// If we find a state/token combination that is illegal, then the action will
+// cause an error. We handle the error by simply changing the state.
+
+ } catch (e) {
+ state = e;
+ }
+
+// The parsing is finished. If we are not in the final 'ok' state, or if the
+// remaining source contains anything except whitespace, then we did not have
+//a well-formed JSON text.
+
+ if (state !== 'ok' || /[^\x20\t\n\r]/.test(source)) {
+ throw state instanceof SyntaxError ? state : new SyntaxError('JSON');
+ }
+
+// If there is a reviver function, we recursively walk the new structure,
+// passing each name/value pair to the reviver function for possible
+// transformation, starting with a temporary root object that holds the current
+// value in an empty key. If there is not a reviver function, we simply return
+// that value.
+
+ return typeof reviver === 'function' ? (function walk(holder, key) {
+ var k, v, value = holder[key];
+ if (value && typeof value === 'object') {
+ for (k in value) {
+ if (Object.prototype.hasOwnProperty.call(value, k)) {
+ v = walk(value, k);
+ if (v !== undefined) {
+ value[k] = v;
+ } else {
+ delete value[k];
+ }
+ }
+ }
+ }
+ return reviver.call(holder, key, value);
+ }({'': value}, '')) : value;
+ };
+}());
Added: stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/underscore/LICENSE
URL: http://svn.apache.org/viewvc/stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/underscore/LICENSE?rev=1468918&view=auto
==============================================================================
--- stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/underscore/LICENSE (added)
+++ stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/underscore/LICENSE Wed Apr 17 14:06:22 2013
@@ -0,0 +1,22 @@
+Copyright (c) 2009-2013 Jeremy Ashkenas, DocumentCloud
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
Added: stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/underscore/underscore-min.js
URL: http://svn.apache.org/viewvc/stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/underscore/underscore-min.js?rev=1468918&view=auto
==============================================================================
--- stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/underscore/underscore-min.js (added)
+++ stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/underscore/underscore-min.js Wed Apr 17 14:06:22 2013
@@ -0,0 +1 @@
+(function(){var n=this,t=n._,r={},e=Array.prototype,u=Object.prototype,i=Function.prototype,a=e.push,o=e.slice,c=e.concat,l=u.toString,f=u.hasOwnProperty,s=e.forEach,p=e.map,v=e.reduce,h=e.reduceRight,g=e.filter,d=e.every,m=e.some,y=e.indexOf,b=e.lastIndexOf,x=Array.isArray,_=Object.keys,j=i.bind,w=function(n){return n instanceof w?n:this instanceof w?(this._wrapped=n,void 0):new w(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=w),exports._=w):n._=w,w.VERSION="1.4.3";var A=w.each=w.forEach=function(n,t,e){if(null!=n)if(s&&n.forEach===s)n.forEach(t,e);else if(n.length===+n.length){for(var u=0,i=n.length;i>u;u++)if(t.call(e,n[u],u,n)===r)return}else for(var a in n)if(w.has(n,a)&&t.call(e,n[a],a,n)===r)return};w.map=w.collect=function(n,t,r){var e=[];return null==n?e:p&&n.map===p?n.map(t,r):(A(n,function(n,u,i){e[e.length]=t.call(r,n,u,i)}),e)};var O="Reduce of empty array with no initial value";w.reduce=w.foldl=w.inject=fun
ction(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduce===v)return e&&(t=w.bind(t,e)),u?n.reduce(t,r):n.reduce(t);if(A(n,function(n,i,a){u?r=t.call(e,r,n,i,a):(r=n,u=!0)}),!u)throw new TypeError(O);return r},w.reduceRight=w.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduceRight===h)return e&&(t=w.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=w.keys(n);i=a.length}if(A(n,function(o,c,l){c=a?a[--i]:--i,u?r=t.call(e,r,n[c],c,l):(r=n[c],u=!0)}),!u)throw new TypeError(O);return r},w.find=w.detect=function(n,t,r){var e;return E(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},w.filter=w.select=function(n,t,r){var e=[];return null==n?e:g&&n.filter===g?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&(e[e.length]=n)}),e)},w.reject=function(n,t,r){return w.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},w.every=w.all=function(n,t,e){t||(t=w.identity);var u=!0;return null==n?u:d&&n.ever
y===d?n.every(t,e):(A(n,function(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var E=w.some=w.any=function(n,t,e){t||(t=w.identity);var u=!1;return null==n?u:m&&n.some===m?n.some(t,e):(A(n,function(n,i,a){return u||(u=t.call(e,n,i,a))?r:void 0}),!!u)};w.contains=w.include=function(n,t){return null==n?!1:y&&n.indexOf===y?-1!=n.indexOf(t):E(n,function(n){return n===t})},w.invoke=function(n,t){var r=o.call(arguments,2);return w.map(n,function(n){return(w.isFunction(t)?t:n[t]).apply(n,r)})},w.pluck=function(n,t){return w.map(n,function(n){return n[t]})},w.where=function(n,t){return w.isEmpty(t)?[]:w.filter(n,function(n){for(var r in t)if(t[r]!==n[r])return!1;return!0})},w.max=function(n,t,r){if(!t&&w.isArray(n)&&n[0]===+n[0]&&65535>n.length)return Math.max.apply(Math,n);if(!t&&w.isEmpty(n))return-1/0;var e={computed:-1/0,value:-1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;a>=e.computed&&(e={value:n,computed:a})}),e.value},w.min=function(n,t,r){if(!t&&w.isArra
y(n)&&n[0]===+n[0]&&65535>n.length)return Math.min.apply(Math,n);if(!t&&w.isEmpty(n))return 1/0;var e={computed:1/0,value:1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;e.computed>a&&(e={value:n,computed:a})}),e.value},w.shuffle=function(n){var t,r=0,e=[];return A(n,function(n){t=w.random(r++),e[r-1]=e[t],e[t]=n}),e};var F=function(n){return w.isFunction(n)?n:function(t){return t[n]}};w.sortBy=function(n,t,r){var e=F(t);return w.pluck(w.map(n,function(n,t,u){return{value:n,index:t,criteria:e.call(r,n,t,u)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||void 0===r)return 1;if(e>r||void 0===e)return-1}return n.index<t.index?-1:1}),"value")};var k=function(n,t,r,e){var u={},i=F(t||w.identity);return A(n,function(t,a){var o=i.call(r,t,a,n);e(u,o,t)}),u};w.groupBy=function(n,t,r){return k(n,t,r,function(n,t,r){(w.has(n,t)?n[t]:n[t]=[]).push(r)})},w.countBy=function(n,t,r){return k(n,t,r,function(n,t){w.has(n,t)||(n[t]=0),n[t]++})},w.sortedIndex=fu
nction(n,t,r,e){r=null==r?w.identity:F(r);for(var u=r.call(e,t),i=0,a=n.length;a>i;){var o=i+a>>>1;u>r.call(e,n[o])?i=o+1:a=o}return i},w.toArray=function(n){return n?w.isArray(n)?o.call(n):n.length===+n.length?w.map(n,w.identity):w.values(n):[]},w.size=function(n){return null==n?0:n.length===+n.length?n.length:w.keys(n).length},w.first=w.head=w.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:o.call(n,0,t)},w.initial=function(n,t,r){return o.call(n,0,n.length-(null==t||r?1:t))},w.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:o.call(n,Math.max(n.length-t,0))},w.rest=w.tail=w.drop=function(n,t,r){return o.call(n,null==t||r?1:t)},w.compact=function(n){return w.filter(n,w.identity)};var R=function(n,t,r){return A(n,function(n){w.isArray(n)?t?a.apply(r,n):R(n,t,r):r.push(n)}),r};w.flatten=function(n,t){return R(n,t,[])},w.without=function(n){return w.difference(n,o.call(arguments,1))},w.uniq=w.unique=function(n,t,r,e){w.isFunction(t)&&(e=r,r=t,t=!
1);var u=r?w.map(n,r,e):n,i=[],a=[];return A(u,function(r,e){(t?e&&a[a.length-1]===r:w.contains(a,r))||(a.push(r),i.push(n[e]))}),i},w.union=function(){return w.uniq(c.apply(e,arguments))},w.intersection=function(n){var t=o.call(arguments,1);return w.filter(w.uniq(n),function(n){return w.every(t,function(t){return w.indexOf(t,n)>=0})})},w.difference=function(n){var t=c.apply(e,o.call(arguments,1));return w.filter(n,function(n){return!w.contains(t,n)})},w.zip=function(){for(var n=o.call(arguments),t=w.max(w.pluck(n,"length")),r=Array(t),e=0;t>e;e++)r[e]=w.pluck(n,""+e);return r},w.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},w.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=w.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}if(y&&n.indexOf===y)return n.indexOf(t,r);for(;u>e;e++)if(n[e]===t)return e;return-1},w.lastIndexOf=function(n,t,r){if(nul
l==n)return-1;var e=null!=r;if(b&&n.lastIndexOf===b)return e?n.lastIndexOf(t,r):n.lastIndexOf(t);for(var u=e?r:n.length;u--;)if(n[u]===t)return u;return-1},w.range=function(n,t,r){1>=arguments.length&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=Array(e);e>u;)i[u++]=n,n+=r;return i};var I=function(){};w.bind=function(n,t){var r,e;if(n.bind===j&&j)return j.apply(n,o.call(arguments,1));if(!w.isFunction(n))throw new TypeError;return r=o.call(arguments,2),e=function(){if(!(this instanceof e))return n.apply(t,r.concat(o.call(arguments)));I.prototype=n.prototype;var u=new I;I.prototype=null;var i=n.apply(u,r.concat(o.call(arguments)));return Object(i)===i?i:u}},w.bindAll=function(n){var t=o.call(arguments,1);return 0==t.length&&(t=w.functions(n)),A(t,function(t){n[t]=w.bind(n[t],n)}),n},w.memoize=function(n,t){var r={};return t||(t=w.identity),function(){var e=t.apply(this,arguments);return w.has(r,e)?r[e]:r[e]=n.apply(this,arguments)}},w.delay=fun
ction(n,t){var r=o.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},w.defer=function(n){return w.delay.apply(w,[n,1].concat(o.call(arguments,1)))},w.throttle=function(n,t){var r,e,u,i,a=0,o=function(){a=new Date,u=null,i=n.apply(r,e)};return function(){var c=new Date,l=t-(c-a);return r=this,e=arguments,0>=l?(clearTimeout(u),u=null,a=c,i=n.apply(r,e)):u||(u=setTimeout(o,l)),i}},w.debounce=function(n,t,r){var e,u;return function(){var i=this,a=arguments,o=function(){e=null,r||(u=n.apply(i,a))},c=r&&!e;return clearTimeout(e),e=setTimeout(o,t),c&&(u=n.apply(i,a)),u}},w.once=function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},w.wrap=function(n,t){return function(){var r=[n];return a.apply(r,arguments),t.apply(this,r)}},w.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length-1;r>=0;r--)t=[n[r].apply(this,t)];return t[0]}},w.after=function(n,t){return 0>=n?t():function(){return 1>--n
?t.apply(this,arguments):void 0}},w.keys=_||function(n){if(n!==Object(n))throw new TypeError("Invalid object");var t=[];for(var r in n)w.has(n,r)&&(t[t.length]=r);return t},w.values=function(n){var t=[];for(var r in n)w.has(n,r)&&t.push(n[r]);return t},w.pairs=function(n){var t=[];for(var r in n)w.has(n,r)&&t.push([r,n[r]]);return t},w.invert=function(n){var t={};for(var r in n)w.has(n,r)&&(t[n[r]]=r);return t},w.functions=w.methods=function(n){var t=[];for(var r in n)w.isFunction(n[r])&&t.push(r);return t.sort()},w.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},w.pick=function(n){var t={},r=c.apply(e,o.call(arguments,1));return A(r,function(r){r in n&&(t[r]=n[r])}),t},w.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)w.contains(r,u)||(t[u]=n[u]);return t},w.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)null==n[r]&&(n[r]=t[r])}),n},w.clone=function(n){return w.isObje
ct(n)?w.isArray(n)?n.slice():w.extend({},n):n},w.tap=function(n,t){return t(n),n};var S=function(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;n instanceof w&&(n=n._wrapped),t instanceof w&&(t=t._wrapped);var u=l.call(n);if(u!=l.call(t))return!1;switch(u){case"[object String]":return n==t+"";case"[object Number]":return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]==n)return e[i]==t;r.push(n),e.push(t);var a=0,o=!0;if("[object Array]"==u){if(a=n.length,o=a==t.length)for(;a--&&(o=S(n[a],t[a],r,e)););}else{var c=n.constructor,f=t.constructor;if(c!==f&&!(w.isFunction(c)&&c instanceof c&&w.isFunction(f)&&f instanceof f))return!1;for(var s in n)if(w.has(n,s)&&(a++,!(o=w.has(t,s)&&S(n[s],t[s],r,e))))break;if(o)
{for(s in t)if(w.has(t,s)&&!a--)break;o=!a}}return r.pop(),e.pop(),o};w.isEqual=function(n,t){return S(n,t,[],[])},w.isEmpty=function(n){if(null==n)return!0;if(w.isArray(n)||w.isString(n))return 0===n.length;for(var t in n)if(w.has(n,t))return!1;return!0},w.isElement=function(n){return!(!n||1!==n.nodeType)},w.isArray=x||function(n){return"[object Array]"==l.call(n)},w.isObject=function(n){return n===Object(n)},A(["Arguments","Function","String","Number","Date","RegExp"],function(n){w["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),w.isArguments(arguments)||(w.isArguments=function(n){return!(!n||!w.has(n,"callee"))}),w.isFunction=function(n){return"function"==typeof n},w.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},w.isNaN=function(n){return w.isNumber(n)&&n!=+n},w.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},w.isNull=function(n){return null===n},w.isUndefined=function(n){return void 0===n},w.has=function(n,t){return
f.call(n,t)},w.noConflict=function(){return n._=t,this},w.identity=function(n){return n},w.times=function(n,t,r){for(var e=Array(n),u=0;n>u;u++)e[u]=t.call(r,u);return e},w.random=function(n,t){return null==t&&(t=n,n=0),n+(0|Math.random()*(t-n+1))};var T={escape:{"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"}};T.unescape=w.invert(T.escape);var M={escape:RegExp("["+w.keys(T.escape).join("")+"]","g"),unescape:RegExp("("+w.keys(T.unescape).join("|")+")","g")};w.each(["escape","unescape"],function(n){w[n]=function(t){return null==t?"":(""+t).replace(M[n],function(t){return T[n][t]})}}),w.result=function(n,t){if(null==n)return null;var r=n[t];return w.isFunction(r)?r.call(n):r},w.mixin=function(n){A(w.functions(n),function(t){var r=w[t]=n[t];w.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),z.call(this,r.apply(w,n))}})};var N=0;w.uniqueId=function(n){var t=""+ ++N;return n?n+t:t},w.templateSettings={evaluate:/<%([\s\S]+?)%>/g,
interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var q=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\t|\u2028|\u2029/g;w.template=function(n,t,r){r=w.defaults({},r,w.templateSettings);var e=RegExp([(r.escape||q).source,(r.interpolate||q).source,(r.evaluate||q).source].join("|")+"|$","g"),u=0,i="__p+='";n.replace(e,function(t,r,e,a,o){return i+=n.slice(u,o).replace(D,function(n){return"\\"+B[n]}),r&&(i+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),e&&(i+="'+\n((__t=("+e+"))==null?'':__t)+\n'"),a&&(i+="';\n"+a+"\n__p+='"),u=o+t.length,t}),i+="';\n",r.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var a=Function(r.variable||"obj","_",i)}catch(o){throw o.source=i,o}if(t)return a(t,w);var c=function(n){return a.call(this,n,w)};return c.source="function("+(r.variable||"obj")+"){\n"+i+"}",c},w.chain=fun
ction(n){return w(n).chain()};var z=function(n){return this._chain?w(n).chain():n};w.mixin(w),A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];w.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],z.call(this,r)}}),A(["concat","join","slice"],function(n){var t=e[n];w.prototype[n]=function(){return z.call(this,t.apply(this._wrapped,arguments))}}),w.extend(w.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this);
\ No newline at end of file