Răsfoiți Sursa

more cleanup

Nikolay Suslov 7 ani în urmă
părinte
comite
3891e6b16d
100 a modificat fișierele cu 18 adăugiri și 23623 ștergeri
  1. 0 72
      public/web/css/redirect.css
  2. BIN
      public/web/images/vwf-logo.png
  3. 12 6
      public/webapps.json
  4. 0 1479
      support/client/lib/closure/base.js
  5. 0 293
      support/client/lib/closure/deps.js
  6. 0 109
      support/client/lib/closure/vec/float32array.js
  7. 0 109
      support/client/lib/closure/vec/float64array.js
  8. 0 896
      support/client/lib/closure/vec/mat3.js
  9. 0 1615
      support/client/lib/closure/vec/mat4.js
  10. 0 722
      support/client/lib/closure/vec/matrix3.js
  11. 0 1405
      support/client/lib/closure/vec/matrix4.js
  12. 0 513
      support/client/lib/closure/vec/quaternion.js
  13. 0 94
      support/client/lib/closure/vec/ray.js
  14. 0 65
      support/client/lib/closure/vec/vec.js
  15. 0 375
      support/client/lib/closure/vec/vec2.js
  16. 0 473
      support/client/lib/closure/vec/vec3.js
  17. 0 405
      support/client/lib/closure/vec/vec4.js
  18. BIN
      support/client/lib/css/DroidSans-Bold.woff
  19. BIN
      support/client/lib/css/DroidSans.woff
  20. BIN
      support/client/lib/favicon-sample.ico
  21. BIN
      support/client/lib/images/animated-overlay.gif
  22. BIN
      support/client/lib/images/arrow.png
  23. BIN
      support/client/lib/images/back.png
  24. BIN
      support/client/lib/images/check.png
  25. BIN
      support/client/lib/images/compass.png
  26. BIN
      support/client/lib/images/editor.png
  27. BIN
      support/client/lib/images/editorClose.png
  28. BIN
      support/client/lib/images/loading.gif
  29. BIN
      support/client/lib/images/logo.png
  30. BIN
      support/client/lib/images/tab_About.png
  31. BIN
      support/client/lib/images/tab_Application.png
  32. BIN
      support/client/lib/images/tab_CodeEditor.png
  33. BIN
      support/client/lib/images/tab_Hierarchy.png
  34. BIN
      support/client/lib/images/tab_Models.png
  35. BIN
      support/client/lib/images/tab_Time.png
  36. BIN
      support/client/lib/images/tab_Timeline.png
  37. BIN
      support/client/lib/images/tab_UserList.png
  38. BIN
      support/client/lib/images/tab_Users.png
  39. BIN
      support/client/lib/images/tab_X.png
  40. BIN
      support/client/lib/images/ui-bg_diagonals-thick_18_b81900_40x40.png
  41. BIN
      support/client/lib/images/ui-bg_diagonals-thick_20_666666_40x40.png
  42. BIN
      support/client/lib/images/ui-bg_flat_0_aaaaaa_40x100.png
  43. BIN
      support/client/lib/images/ui-bg_flat_10_000000_40x100.png
  44. BIN
      support/client/lib/images/ui-bg_flat_75_ffffff_40x100.png
  45. BIN
      support/client/lib/images/ui-bg_glass_100_f6f6f6_1x400.png
  46. BIN
      support/client/lib/images/ui-bg_glass_100_fdf5ce_1x400.png
  47. BIN
      support/client/lib/images/ui-bg_glass_55_fbf9ee_1x400.png
  48. BIN
      support/client/lib/images/ui-bg_glass_65_ffffff_1x400.png
  49. BIN
      support/client/lib/images/ui-bg_glass_75_dadada_1x400.png
  50. BIN
      support/client/lib/images/ui-bg_glass_75_e6e6e6_1x400.png
  51. BIN
      support/client/lib/images/ui-bg_glass_95_fef1ec_1x400.png
  52. BIN
      support/client/lib/images/ui-bg_gloss-wave_35_f6a828_500x100.png
  53. BIN
      support/client/lib/images/ui-bg_highlight-soft_100_eeeeee_1x100.png
  54. BIN
      support/client/lib/images/ui-bg_highlight-soft_75_cccccc_1x100.png
  55. BIN
      support/client/lib/images/ui-bg_highlight-soft_75_ffe45c_1x100.png
  56. BIN
      support/client/lib/images/ui-icons_222222_256x240.png
  57. BIN
      support/client/lib/images/ui-icons_228ef1_256x240.png
  58. BIN
      support/client/lib/images/ui-icons_2e83ff_256x240.png
  59. BIN
      support/client/lib/images/ui-icons_454545_256x240.png
  60. BIN
      support/client/lib/images/ui-icons_888888_256x240.png
  61. BIN
      support/client/lib/images/ui-icons_cd0a0a_256x240.png
  62. BIN
      support/client/lib/images/ui-icons_ef8c08_256x240.png
  63. BIN
      support/client/lib/images/ui-icons_ffd27a_256x240.png
  64. BIN
      support/client/lib/images/ui-icons_ffffff_256x240.png
  65. BIN
      support/client/lib/images/warning.png
  66. BIN
      support/client/lib/images/x.png
  67. BIN
      support/client/lib/img/glyphicons-halflings-white.png
  68. BIN
      support/client/lib/img/glyphicons-halflings.png
  69. 4 17
      support/client/lib/index.html
  70. 0 1529
      support/client/lib/jquery.hammer.js
  71. 0 2694
      support/client/lib/socket.io.js
  72. 2 32
      support/client/lib/vwf.js
  73. 0 500
      support/client/lib/vwf/model/buzz.js
  74. 0 10
      support/client/lib/vwf/model/buzz/buzz.min.js
  75. 0 119
      support/client/lib/vwf/model/example/scene.js
  76. BIN
      support/client/lib/vwf/model/jPlayer.2.7.1/Jplayer.swf
  77. 0 21
      support/client/lib/vwf/model/jPlayer.2.7.1/MIT-LICENSE.txt
  78. 0 36
      support/client/lib/vwf/model/jPlayer.2.7.1/README.md
  79. 0 34
      support/client/lib/vwf/model/jPlayer.2.7.1/add-on/jplayer.playlist.min.js
  80. 0 338
      support/client/lib/vwf/model/jPlayer.2.7.1/add-on/jquery.jplayer.inspector.js
  81. 0 0
      support/client/lib/vwf/model/jPlayer.2.7.1/jquery.jplayer.min.js
  82. 0 583
      support/client/lib/vwf/model/jPlayer.2.7.1/popcorn/popcorn.jplayer.js
  83. 0 457
      support/client/lib/vwf/model/jPlayer.js
  84. 0 59
      support/client/lib/vwf/model/scenejs.js
  85. 0 837
      support/client/lib/vwf/model/sound.js
  86. 0 33
      support/client/lib/vwf/model/test.js
  87. 0 251
      support/client/lib/vwf/view/audio.js
  88. 0 10
      support/client/lib/vwf/view/buzz/buzz.min.js
  89. 0 2453
      support/client/lib/vwf/view/editor-live.js
  90. 0 1942
      support/client/lib/vwf/view/editor.js
  91. 0 258
      support/client/lib/vwf/view/editor/editor.css
  92. BIN
      support/client/lib/vwf/view/editor/images/toggle-expand-light.png
  93. 0 30
      support/client/lib/vwf/view/sound.js
  94. 0 33
      support/client/lib/vwf/view/test.js
  95. 0 7
      support/client/lib/vwf/view/touch.js
  96. 0 457
      support/client/test/behaviors.html
  97. 0 526
      support/client/test/dispatch.html
  98. 0 186
      support/client/test/drivers.html
  99. 0 584
      support/client/test/events.html
  100. 0 956
      support/client/test/future.html

+ 0 - 72
public/web/css/redirect.css

@@ -1,72 +0,0 @@
-body {
-  padding-top: 50px;
-  text-align: center;
-  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
-  font-size: 18px;
-  color: #222;
-}
-
-a {
-  color: #eb6864;
-  text-decoration: none;
-}
-
-a:hover {
-  color: #e22620;
-  text-decoration: underline;
-}
-
-p {
-  max-width: 600px;
-  margin-left: auto;
-  margin-right: auto;
-}
-
-.small {
-  font-size: 14px;
-  color: #bbb;
-}
-
-.small a {
-  color: #f2a297;
-}
-
-.small a:hover {
-  color: #ef897f;
-}
-
-@-webkit-keyframes flip {
-  from {
-    -webkit-transform: rotateY(0deg) scale(1); 
-  }
-  50% {
-    -webkit-transform: rotateY(180deg) scale(1);
-    -webkit-animation-timing-function: linear;
-  }
-  to {
-    -webkit-transform: rotateY(360deg) scale(1); 
-  }
-}
-
-@-webkit-keyframes unflip {
-  from {
-    -webkit-transform: rotateY(360deg);
-  }
-
-  to {
-    -webkit-transform: rotateY(0deg);
-  }
-}
-
-img.logo {
-  -webkit-animation-duration: 0.8s;
-  -webkit-animation-name: unflip;
-  -webkit-perspective: 800px;
-}
-
-img.logo:hover {
-  -webkit-animation-duration: 0.7s;
-  -webkit-animation-name: flip;
-  -webkit-perspective: 800px;
-  -webkit-animation-timing-function: ease-in-out;
-}

BIN
public/web/images/vwf-logo.png


+ 12 - 6
public/webapps.json

@@ -2,34 +2,40 @@
     "aframe":{
         "title":"Simple VWF & A-Frame app",
         "imgUrl": "./aframe/webimg.jpg",
-        "text": "Example application showing Virtual World Framework & A-Frame integration"
+        "text": "Example application showing Virtual World Framework & A-Frame integration",
+        "featured": false
     },
 
     "aframe2":{
         "title":"Textures and Models in VWF & A-Frame",
         "imgUrl": "./aframe2/webimg.jpg",
-        "text": "Example app with loaded textures and models"
+        "text": "Example app with loaded textures and models",
+        "featured": true
     },
       "ohmlang-calc":{
         "title":"Calculator in Ohm and VWF",
         "imgUrl": "./ohmlang-calc/webimg.jpg",
-        "text": "Example calc app with simple Ohm grammar"
+        "text": "Example calc app with simple Ohm grammar",
+        "featured": true
     },
      "ohmlang-lsys":{
         "title":"L-System parser example in Ohm and VWF",
         "imgUrl": "./ohmlang-lsys/webimg.jpg",
-        "text": "Example app with L-System grammar"
+        "text": "Example app with L-System grammar",
+        "featured": true
     },
 
     "osc-example":{
         "title":"Simple app with Ohm & OSC control",
         "imgUrl": "./osc-example/webimg.jpg",
-        "text": "Example app with OSC control"
+        "text": "Example app with OSC control",
+        "featured": false
     },
 
     "gearvr":{
         "title":"GearVR controller",
         "imgUrl": "",
-        "text": "Example app with GearVR"
+        "text": "Example app with GearVR",
+        "featured": false
     }
 }

+ 0 - 1479
support/client/lib/closure/base.js

@@ -1,1479 +0,0 @@
-// Copyright 2006 The Closure Library Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS-IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-/**
- * @fileoverview Bootstrap for the Google JS Library (Closure).
- *
- * In uncompiled mode base.js will write out Closure's deps file, unless the
- * global <code>CLOSURE_NO_DEPS</code> is set to true.  This allows projects to
- * include their own deps file(s) from different locations.
- *
- */
-
-
-/**
- * @define {boolean} Overridden to true by the compiler when --closure_pass
- *     or --mark_as_compiled is specified.
- */
-var COMPILED = false;
-
-
-/**
- * Base namespace for the Closure library.  Checks to see goog is
- * already defined in the current scope before assigning to prevent
- * clobbering if base.js is loaded more than once.
- *
- * @const
- */
-var goog = goog || {}; // Identifies this file as the Closure base.
-
-
-/**
- * Reference to the global context.  In most cases this will be 'window'.
- */
-goog.global = this;
-
-
-/**
- * @define {boolean} DEBUG is provided as a convenience so that debugging code
- * that should not be included in a production js_binary can be easily stripped
- * by specifying --define goog.DEBUG=false to the JSCompiler. For example, most
- * toString() methods should be declared inside an "if (goog.DEBUG)" conditional
- * because they are generally used for debugging purposes and it is difficult
- * for the JSCompiler to statically determine whether they are used.
- */
-goog.DEBUG = true;
-
-
-/**
- * @define {string} LOCALE defines the locale being used for compilation. It is
- * used to select locale specific data to be compiled in js binary. BUILD rule
- * can specify this value by "--define goog.LOCALE=<locale_name>" as JSCompiler
- * option.
- *
- * Take into account that the locale code format is important. You should use
- * the canonical Unicode format with hyphen as a delimiter. Language must be
- * lowercase, Language Script - Capitalized, Region - UPPERCASE.
- * There are few examples: pt-BR, en, en-US, sr-Latin-BO, zh-Hans-CN.
- *
- * See more info about locale codes here:
- * http://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers
- *
- * For language codes you should use values defined by ISO 693-1. See it here
- * http://www.w3.org/WAI/ER/IG/ert/iso639.htm. There is only one exception from
- * this rule: the Hebrew language. For legacy reasons the old code (iw) should
- * be used instead of the new code (he), see http://wiki/Main/IIISynonyms.
- */
-goog.LOCALE = 'en';  // default to en
-
-
-/**
- * Creates object stubs for a namespace.  The presence of one or more
- * goog.provide() calls indicate that the file defines the given
- * objects/namespaces.  Build tools also scan for provide/require statements
- * to discern dependencies, build dependency files (see deps.js), etc.
- * @see goog.require
- * @param {string} name Namespace provided by this file in the form
- *     "goog.package.part".
- */
-goog.provide = function(name) {
-  if (!COMPILED) {
-    // Ensure that the same namespace isn't provided twice. This is intended
-    // to teach new developers that 'goog.provide' is effectively a variable
-    // declaration. And when JSCompiler transforms goog.provide into a real
-    // variable declaration, the compiled JS should work the same as the raw
-    // JS--even when the raw JS uses goog.provide incorrectly.
-    if (goog.isProvided_(name)) {
-      throw Error('Namespace "' + name + '" already declared.');
-    }
-    delete goog.implicitNamespaces_[name];
-
-    var namespace = name;
-    while ((namespace = namespace.substring(0, namespace.lastIndexOf('.')))) {
-      if (goog.getObjectByName(namespace)) {
-        break;
-      }
-      goog.implicitNamespaces_[namespace] = true;
-    }
-  }
-
-  goog.exportPath_(name);
-};
-
-
-/**
- * Marks that the current file should only be used for testing, and never for
- * live code in production.
- * @param {string=} opt_message Optional message to add to the error that's
- *     raised when used in production code.
- */
-goog.setTestOnly = function(opt_message) {
-  if (COMPILED && !goog.DEBUG) {
-    opt_message = opt_message || '';
-    throw Error('Importing test-only code into non-debug environment' +
-                opt_message ? ': ' + opt_message : '.');
-  }
-};
-
-
-if (!COMPILED) {
-
-  /**
-   * Check if the given name has been goog.provided. This will return false for
-   * names that are available only as implicit namespaces.
-   * @param {string} name name of the object to look for.
-   * @return {boolean} Whether the name has been provided.
-   * @private
-   */
-  goog.isProvided_ = function(name) {
-    return !goog.implicitNamespaces_[name] && !!goog.getObjectByName(name);
-  };
-
-  /**
-   * Namespaces implicitly defined by goog.provide. For example,
-   * goog.provide('goog.events.Event') implicitly declares
-   * that 'goog' and 'goog.events' must be namespaces.
-   *
-   * @type {Object}
-   * @private
-   */
-  goog.implicitNamespaces_ = {};
-}
-
-
-/**
- * Builds an object structure for the provided namespace path,
- * ensuring that names that already exist are not overwritten. For
- * example:
- * "a.b.c" -> a = {};a.b={};a.b.c={};
- * Used by goog.provide and goog.exportSymbol.
- * @param {string} name name of the object that this file defines.
- * @param {*=} opt_object the object to expose at the end of the path.
- * @param {Object=} opt_objectToExportTo The object to add the path to; default
- *     is |goog.global|.
- * @private
- */
-goog.exportPath_ = function(name, opt_object, opt_objectToExportTo) {
-  var parts = name.split('.');
-  var cur = opt_objectToExportTo || goog.global;
-
-  // Internet Explorer exhibits strange behavior when throwing errors from
-  // methods externed in this manner.  See the testExportSymbolExceptions in
-  // base_test.html for an example.
-  if (!(parts[0] in cur) && cur.execScript) {
-    cur.execScript('var ' + parts[0]);
-  }
-
-  // Certain browsers cannot parse code in the form for((a in b); c;);
-  // This pattern is produced by the JSCompiler when it collapses the
-  // statement above into the conditional loop below. To prevent this from
-  // happening, use a for-loop and reserve the init logic as below.
-
-  // Parentheses added to eliminate strict JS warning in Firefox.
-  for (var part; parts.length && (part = parts.shift());) {
-    if (!parts.length && goog.isDef(opt_object)) {
-      // last part and we have an object; use it
-      cur[part] = opt_object;
-    } else if (cur[part]) {
-      cur = cur[part];
-    } else {
-      cur = cur[part] = {};
-    }
-  }
-};
-
-
-/**
- * Returns an object based on its fully qualified external name.  If you are
- * using a compilation pass that renames property names beware that using this
- * function will not find renamed properties.
- *
- * @param {string} name The fully qualified name.
- * @param {Object=} opt_obj The object within which to look; default is
- *     |goog.global|.
- * @return {?} The value (object or primitive) or, if not found, null.
- */
-goog.getObjectByName = function(name, opt_obj) {
-  var parts = name.split('.');
-  var cur = opt_obj || goog.global;
-  for (var part; part = parts.shift(); ) {
-    if (goog.isDefAndNotNull(cur[part])) {
-      cur = cur[part];
-    } else {
-      return null;
-    }
-  }
-  return cur;
-};
-
-
-/**
- * Globalizes a whole namespace, such as goog or goog.lang.
- *
- * @param {Object} obj The namespace to globalize.
- * @param {Object=} opt_global The object to add the properties to.
- * @deprecated Properties may be explicitly exported to the global scope, but
- *     this should no longer be done in bulk.
- */
-goog.globalize = function(obj, opt_global) {
-  var global = opt_global || goog.global;
-  for (var x in obj) {
-    global[x] = obj[x];
-  }
-};
-
-
-/**
- * Adds a dependency from a file to the files it requires.
- * @param {string} relPath The path to the js file.
- * @param {Array} provides An array of strings with the names of the objects
- *                         this file provides.
- * @param {Array} requires An array of strings with the names of the objects
- *                         this file requires.
- */
-goog.addDependency = function(relPath, provides, requires) {
-  if (!COMPILED) {
-    var provide, require;
-    var path = relPath.replace(/\\/g, '/');
-    var deps = goog.dependencies_;
-    for (var i = 0; provide = provides[i]; i++) {
-      deps.nameToPath[provide] = path;
-      if (!(path in deps.pathToNames)) {
-        deps.pathToNames[path] = {};
-      }
-      deps.pathToNames[path][provide] = true;
-    }
-    for (var j = 0; require = requires[j]; j++) {
-      if (!(path in deps.requires)) {
-        deps.requires[path] = {};
-      }
-      deps.requires[path][require] = true;
-    }
-  }
-};
-
-
-
-
-// NOTE(nnaze): The debug DOM loader was included in base.js as an orignal
-// way to do "debug-mode" development.  The dependency system can sometimes
-// be confusing, as can the debug DOM loader's asyncronous nature.
-//
-// With the DOM loader, a call to goog.require() is not blocking -- the
-// script will not load until some point after the current script.  If a
-// namespace is needed at runtime, it needs to be defined in a previous
-// script, or loaded via require() with its registered dependencies.
-// User-defined namespaces may need their own deps file.  See http://go/js_deps,
-// http://go/genjsdeps, or, externally, DepsWriter.
-// http://code.google.com/closure/library/docs/depswriter.html
-//
-// Because of legacy clients, the DOM loader can't be easily removed from
-// base.js.  Work is being done to make it disableable or replaceable for
-// different environments (DOM-less JavaScript interpreters like Rhino or V8,
-// for example). See bootstrap/ for more information.
-
-
-/**
- * @define {boolean} Whether to enable the debug loader.
- *
- * If enabled, a call to goog.require() will attempt to load the namespace by
- * appending a script tag to the DOM (if the namespace has been registered).
- *
- * If disabled, goog.require() will simply assert that the namespace has been
- * provided (and depend on the fact that some outside tool correctly ordered
- * the script).
- */
-goog.ENABLE_DEBUG_LOADER = true;
-
-
-/**
- * Implements a system for the dynamic resolution of dependencies
- * that works in parallel with the BUILD system. Note that all calls
- * to goog.require will be stripped by the JSCompiler when the
- * --closure_pass option is used.
- * @see goog.provide
- * @param {string} name Namespace to include (as was given in goog.provide())
- *     in the form "goog.package.part".
- */
-goog.require = function(name) {
-
-  // if the object already exists we do not need do do anything
-  // TODO(arv): If we start to support require based on file name this has
-  //            to change
-  // TODO(arv): If we allow goog.foo.* this has to change
-  // TODO(arv): If we implement dynamic load after page load we should probably
-  //            not remove this code for the compiled output
-  if (!COMPILED) {
-    if (goog.isProvided_(name)) {
-      return;
-    }
-
-    if (goog.ENABLE_DEBUG_LOADER) {
-      var path = goog.getPathFromDeps_(name);
-      if (path) {
-        goog.included_[path] = true;
-        goog.writeScripts_();
-        return;
-      }
-    }
-
-    var errorMessage = 'goog.require could not find: ' + name;
-    if (goog.global.console) {
-      goog.global.console['error'](errorMessage);
-    }
-
-
-      throw Error(errorMessage);
-
-  }
-};
-
-
-/**
- * Path for included scripts
- * @type {string}
- */
-goog.basePath = '';
-
-
-/**
- * A hook for overriding the base path.
- * @type {string|undefined}
- */
-goog.global.CLOSURE_BASE_PATH;
-
-
-/**
- * Whether to write out Closure's deps file. By default,
- * the deps are written.
- * @type {boolean|undefined}
- */
-goog.global.CLOSURE_NO_DEPS;
-
-
-/**
- * A function to import a single script. This is meant to be overridden when
- * Closure is being run in non-HTML contexts, such as web workers. It's defined
- * in the global scope so that it can be set before base.js is loaded, which
- * allows deps.js to be imported properly.
- *
- * The function is passed the script source, which is a relative URI. It should
- * return true if the script was imported, false otherwise.
- */
-goog.global.CLOSURE_IMPORT_SCRIPT;
-
-
-/**
- * Null function used for default values of callbacks, etc.
- * @return {void} Nothing.
- */
-goog.nullFunction = function() {};
-
-
-/**
- * The identity function. Returns its first argument.
- *
- * @param {...*} var_args The arguments of the function.
- * @return {*} The first argument.
- * @deprecated Use goog.functions.identity instead.
- */
-goog.identityFunction = function(var_args) {
-  return arguments[0];
-};
-
-
-/**
- * When defining a class Foo with an abstract method bar(), you can do:
- *
- * Foo.prototype.bar = goog.abstractMethod
- *
- * Now if a subclass of Foo fails to override bar(), an error
- * will be thrown when bar() is invoked.
- *
- * Note: This does not take the name of the function to override as
- * an argument because that would make it more difficult to obfuscate
- * our JavaScript code.
- *
- * @type {!Function}
- * @throws {Error} when invoked to indicate the method should be
- *   overridden.
- */
-goog.abstractMethod = function() {
-  throw Error('unimplemented abstract method');
-};
-
-
-/**
- * Adds a {@code getInstance} static method that always return the same instance
- * object.
- * @param {!Function} ctor The constructor for the class to add the static
- *     method to.
- */
-goog.addSingletonGetter = function(ctor) {
-  ctor.getInstance = function() {
-    return ctor.instance_ || (ctor.instance_ = new ctor());
-  };
-};
-
-
-if (!COMPILED && goog.ENABLE_DEBUG_LOADER) {
-  /**
-   * Object used to keep track of urls that have already been added. This
-   * record allows the prevention of circular dependencies.
-   * @type {Object}
-   * @private
-   */
-  goog.included_ = {};
-
-
-  /**
-   * This object is used to keep track of dependencies and other data that is
-   * used for loading scripts
-   * @private
-   * @type {Object}
-   */
-  goog.dependencies_ = {
-    pathToNames: {}, // 1 to many
-    nameToPath: {}, // 1 to 1
-    requires: {}, // 1 to many
-    // used when resolving dependencies to prevent us from
-    // visiting the file twice
-    visited: {},
-    written: {} // used to keep track of script files we have written
-  };
-
-
-  /**
-   * Tries to detect whether is in the context of an HTML document.
-   * @return {boolean} True if it looks like HTML document.
-   * @private
-   */
-  goog.inHtmlDocument_ = function() {
-    var doc = goog.global.document;
-    return typeof doc != 'undefined' &&
-           'write' in doc;  // XULDocument misses write.
-  };
-
-
-  /**
-   * Tries to detect the base path of the base.js script that bootstraps Closure
-   * @private
-   */
-  goog.findBasePath_ = function() {
-    if (goog.global.CLOSURE_BASE_PATH) {
-      goog.basePath = goog.global.CLOSURE_BASE_PATH;
-      return;
-    } else if (!goog.inHtmlDocument_()) {
-      return;
-    }
-    var doc = goog.global.document;
-    var scripts = doc.getElementsByTagName('script');
-    // Search backwards since the current script is in almost all cases the one
-    // that has base.js.
-    for (var i = scripts.length - 1; i >= 0; --i) {
-      var src = scripts[i].src;
-      var qmark = src.lastIndexOf('?');
-      var l = qmark == -1 ? src.length : qmark;
-      if (src.substr(l - 7, 7) == 'base.js') {
-        goog.basePath = src.substr(0, l - 7);
-        return;
-      }
-    }
-  };
-
-
-  /**
-   * Imports a script if, and only if, that script hasn't already been imported.
-   * (Must be called at execution time)
-   * @param {string} src Script source.
-   * @private
-   */
-  goog.importScript_ = function(src) {
-    var importScript = goog.global.CLOSURE_IMPORT_SCRIPT ||
-        goog.writeScriptTag_;
-    if (!goog.dependencies_.written[src] && importScript(src)) {
-      goog.dependencies_.written[src] = true;
-    }
-  };
-
-
-  /**
-   * The default implementation of the import function. Writes a script tag to
-   * import the script.
-   *
-   * @param {string} src The script source.
-   * @return {boolean} True if the script was imported, false otherwise.
-   * @private
-   */
-  goog.writeScriptTag_ = function(src) {
-    if (goog.inHtmlDocument_()) {
-      var doc = goog.global.document;
-      doc.write(
-          '<script type="text/javascript" src="' + src + '"></' + 'script>');
-      return true;
-    } else {
-      return false;
-    }
-  };
-
-
-  /**
-   * Resolves dependencies based on the dependencies added using addDependency
-   * and calls importScript_ in the correct order.
-   * @private
-   */
-  goog.writeScripts_ = function() {
-    // the scripts we need to write this time
-    var scripts = [];
-    var seenScript = {};
-    var deps = goog.dependencies_;
-
-    function visitNode(path) {
-      if (path in deps.written) {
-        return;
-      }
-
-      // we have already visited this one. We can get here if we have cyclic
-      // dependencies
-      if (path in deps.visited) {
-        if (!(path in seenScript)) {
-          seenScript[path] = true;
-          scripts.push(path);
-        }
-        return;
-      }
-
-      deps.visited[path] = true;
-
-      if (path in deps.requires) {
-        for (var requireName in deps.requires[path]) {
-          // If the required name is defined, we assume that it was already
-          // bootstrapped by other means.
-          if (!goog.isProvided_(requireName)) {
-            if (requireName in deps.nameToPath) {
-              visitNode(deps.nameToPath[requireName]);
-            } else {
-              throw Error('Undefined nameToPath for ' + requireName);
-            }
-          }
-        }
-      }
-
-      if (!(path in seenScript)) {
-        seenScript[path] = true;
-        scripts.push(path);
-      }
-    }
-
-    for (var path in goog.included_) {
-      if (!deps.written[path]) {
-        visitNode(path);
-      }
-    }
-
-    for (var i = 0; i < scripts.length; i++) {
-      if (scripts[i]) {
-        goog.importScript_(goog.basePath + scripts[i]);
-      } else {
-        throw Error('Undefined script input');
-      }
-    }
-  };
-
-
-  /**
-   * Looks at the dependency rules and tries to determine the script file that
-   * fulfills a particular rule.
-   * @param {string} rule In the form goog.namespace.Class or project.script.
-   * @return {?string} Url corresponding to the rule, or null.
-   * @private
-   */
-  goog.getPathFromDeps_ = function(rule) {
-    if (rule in goog.dependencies_.nameToPath) {
-      return goog.dependencies_.nameToPath[rule];
-    } else {
-      return null;
-    }
-  };
-
-  goog.findBasePath_();
-
-  // Allow projects to manage the deps files themselves.
-  if (!goog.global.CLOSURE_NO_DEPS) {
-    goog.importScript_(goog.basePath + 'deps.js');
-  }
-}
-
-
-
-//==============================================================================
-// Language Enhancements
-//==============================================================================
-
-
-/**
- * This is a "fixed" version of the typeof operator.  It differs from the typeof
- * operator in such a way that null returns 'null' and arrays return 'array'.
- * @param {*} value The value to get the type of.
- * @return {string} The name of the type.
- */
-goog.typeOf = function(value) {
-  var s = typeof value;
-  if (s == 'object') {
-    if (value) {
-      // Check these first, so we can avoid calling Object.prototype.toString if
-      // possible.
-      //
-      // IE improperly marshals tyepof across execution contexts, but a
-      // cross-context object will still return false for "instanceof Object".
-      if (value instanceof Array) {
-        return 'array';
-      } else if (value instanceof Object) {
-        return s;
-      }
-
-      // HACK: In order to use an Object prototype method on the arbitrary
-      //   value, the compiler requires the value be cast to type Object,
-      //   even though the ECMA spec explicitly allows it.
-      var className = Object.prototype.toString.call(
-          /** @type {Object} */ (value));
-      // In Firefox 3.6, attempting to access iframe window objects' length
-      // property throws an NS_ERROR_FAILURE, so we need to special-case it
-      // here.
-      if (className == '[object Window]') {
-        return 'object';
-      }
-
-      // We cannot always use constructor == Array or instanceof Array because
-      // different frames have different Array objects. In IE6, if the iframe
-      // where the array was created is destroyed, the array loses its
-      // prototype. Then dereferencing val.splice here throws an exception, so
-      // we can't use goog.isFunction. Calling typeof directly returns 'unknown'
-      // so that will work. In this case, this function will return false and
-      // most array functions will still work because the array is still
-      // array-like (supports length and []) even though it has lost its
-      // prototype.
-      // Mark Miller noticed that Object.prototype.toString
-      // allows access to the unforgeable [[Class]] property.
-      //  15.2.4.2 Object.prototype.toString ( )
-      //  When the toString method is called, the following steps are taken:
-      //      1. Get the [[Class]] property of this object.
-      //      2. Compute a string value by concatenating the three strings
-      //         "[object ", Result(1), and "]".
-      //      3. Return Result(2).
-      // and this behavior survives the destruction of the execution context.
-      if ((className == '[object Array]' ||
-           // In IE all non value types are wrapped as objects across window
-           // boundaries (not iframe though) so we have to do object detection
-           // for this edge case
-           typeof value.length == 'number' &&
-           typeof value.splice != 'undefined' &&
-           typeof value.propertyIsEnumerable != 'undefined' &&
-           !value.propertyIsEnumerable('splice')
-
-          )) {
-        return 'array';
-      }
-      // HACK: There is still an array case that fails.
-      //     function ArrayImpostor() {}
-      //     ArrayImpostor.prototype = [];
-      //     var impostor = new ArrayImpostor;
-      // this can be fixed by getting rid of the fast path
-      // (value instanceof Array) and solely relying on
-      // (value && Object.prototype.toString.vall(value) === '[object Array]')
-      // but that would require many more function calls and is not warranted
-      // unless closure code is receiving objects from untrusted sources.
-
-      // IE in cross-window calls does not correctly marshal the function type
-      // (it appears just as an object) so we cannot use just typeof val ==
-      // 'function'. However, if the object has a call property, it is a
-      // function.
-      if ((className == '[object Function]' ||
-          typeof value.call != 'undefined' &&
-          typeof value.propertyIsEnumerable != 'undefined' &&
-          !value.propertyIsEnumerable('call'))) {
-        return 'function';
-      }
-
-
-    } else {
-      return 'null';
-    }
-
-  } else if (s == 'function' && typeof value.call == 'undefined') {
-    // In Safari typeof nodeList returns 'function', and on Firefox
-    // typeof behaves similarly for HTML{Applet,Embed,Object}Elements
-    // and RegExps.  We would like to return object for those and we can
-    // detect an invalid function by making sure that the function
-    // object has a call method.
-    return 'object';
-  }
-  return s;
-};
-
-
-/**
- * Returns true if the specified value is not |undefined|.
- * WARNING: Do not use this to test if an object has a property. Use the in
- * operator instead.  Additionally, this function assumes that the global
- * undefined variable has not been redefined.
- * @param {*} val Variable to test.
- * @return {boolean} Whether variable is defined.
- */
-goog.isDef = function(val) {
-  return val !== undefined;
-};
-
-
-/**
- * Returns true if the specified value is |null|
- * @param {*} val Variable to test.
- * @return {boolean} Whether variable is null.
- */
-goog.isNull = function(val) {
-  return val === null;
-};
-
-
-/**
- * Returns true if the specified value is defined and not null
- * @param {*} val Variable to test.
- * @return {boolean} Whether variable is defined and not null.
- */
-goog.isDefAndNotNull = function(val) {
-  // Note that undefined == null.
-  return val != null;
-};
-
-
-/**
- * Returns true if the specified value is an array
- * @param {*} val Variable to test.
- * @return {boolean} Whether variable is an array.
- */
-goog.isArray = function(val) {
-  return goog.typeOf(val) == 'array';
-};
-
-
-/**
- * Returns true if the object looks like an array. To qualify as array like
- * the value needs to be either a NodeList or an object with a Number length
- * property.
- * @param {*} val Variable to test.
- * @return {boolean} Whether variable is an array.
- */
-goog.isArrayLike = function(val) {
-  var type = goog.typeOf(val);
-  return type == 'array' || type == 'object' && typeof val.length == 'number';
-};
-
-
-/**
- * Returns true if the object looks like a Date. To qualify as Date-like
- * the value needs to be an object and have a getFullYear() function.
- * @param {*} val Variable to test.
- * @return {boolean} Whether variable is a like a Date.
- */
-goog.isDateLike = function(val) {
-  return goog.isObject(val) && typeof val.getFullYear == 'function';
-};
-
-
-/**
- * Returns true if the specified value is a string
- * @param {*} val Variable to test.
- * @return {boolean} Whether variable is a string.
- */
-goog.isString = function(val) {
-  return typeof val == 'string';
-};
-
-
-/**
- * Returns true if the specified value is a boolean
- * @param {*} val Variable to test.
- * @return {boolean} Whether variable is boolean.
- */
-goog.isBoolean = function(val) {
-  return typeof val == 'boolean';
-};
-
-
-/**
- * Returns true if the specified value is a number
- * @param {*} val Variable to test.
- * @return {boolean} Whether variable is a number.
- */
-goog.isNumber = function(val) {
-  return typeof val == 'number';
-};
-
-
-/**
- * Returns true if the specified value is a function
- * @param {*} val Variable to test.
- * @return {boolean} Whether variable is a function.
- */
-goog.isFunction = function(val) {
-  return goog.typeOf(val) == 'function';
-};
-
-
-/**
- * Returns true if the specified value is an object.  This includes arrays
- * and functions.
- * @param {*} val Variable to test.
- * @return {boolean} Whether variable is an object.
- */
-goog.isObject = function(val) {
-  var type = typeof val;
-  return type == 'object' && val != null || type == 'function';
-  // return Object(val) === val also works, but is slower, especially if val is
-  // not an object.
-};
-
-
-/**
- * Gets a unique ID for an object. This mutates the object so that further
- * calls with the same object as a parameter returns the same value. The unique
- * ID is guaranteed to be unique across the current session amongst objects that
- * are passed into {@code getUid}. There is no guarantee that the ID is unique
- * or consistent across sessions. It is unsafe to generate unique ID for
- * function prototypes.
- *
- * @param {Object} obj The object to get the unique ID for.
- * @return {number} The unique ID for the object.
- */
-goog.getUid = function(obj) {
-  // TODO(arv): Make the type stricter, do not accept null.
-
-  // In Opera window.hasOwnProperty exists but always returns false so we avoid
-  // using it. As a consequence the unique ID generated for BaseClass.prototype
-  // and SubClass.prototype will be the same.
-  return obj[goog.UID_PROPERTY_] ||
-      (obj[goog.UID_PROPERTY_] = ++goog.uidCounter_);
-};
-
-
-/**
- * Removes the unique ID from an object. This is useful if the object was
- * previously mutated using {@code goog.getUid} in which case the mutation is
- * undone.
- * @param {Object} obj The object to remove the unique ID field from.
- */
-goog.removeUid = function(obj) {
-  // TODO(arv): Make the type stricter, do not accept null.
-
-  // DOM nodes in IE are not instance of Object and throws exception
-  // for delete. Instead we try to use removeAttribute
-  if ('removeAttribute' in obj) {
-    obj.removeAttribute(goog.UID_PROPERTY_);
-  }
-  /** @preserveTry */
-  try {
-    delete obj[goog.UID_PROPERTY_];
-  } catch (ex) {
-  }
-};
-
-
-/**
- * Name for unique ID property. Initialized in a way to help avoid collisions
- * with other closure javascript on the same page.
- * @type {string}
- * @private
- */
-goog.UID_PROPERTY_ = 'closure_uid_' +
-    Math.floor(Math.random() * 2147483648).toString(36);
-
-
-/**
- * Counter for UID.
- * @type {number}
- * @private
- */
-goog.uidCounter_ = 0;
-
-
-/**
- * Adds a hash code field to an object. The hash code is unique for the
- * given object.
- * @param {Object} obj The object to get the hash code for.
- * @return {number} The hash code for the object.
- * @deprecated Use goog.getUid instead.
- */
-goog.getHashCode = goog.getUid;
-
-
-/**
- * Removes the hash code field from an object.
- * @param {Object} obj The object to remove the field from.
- * @deprecated Use goog.removeUid instead.
- */
-goog.removeHashCode = goog.removeUid;
-
-
-/**
- * Clones a value. The input may be an Object, Array, or basic type. Objects and
- * arrays will be cloned recursively.
- *
- * WARNINGS:
- * <code>goog.cloneObject</code> does not detect reference loops. Objects that
- * refer to themselves will cause infinite recursion.
- *
- * <code>goog.cloneObject</code> is unaware of unique identifiers, and copies
- * UIDs created by <code>getUid</code> into cloned results.
- *
- * @param {*} obj The value to clone.
- * @return {*} A clone of the input value.
- * @deprecated goog.cloneObject is unsafe. Prefer the goog.object methods.
- */
-goog.cloneObject = function(obj) {
-  var type = goog.typeOf(obj);
-  if (type == 'object' || type == 'array') {
-    if (obj.clone) {
-      return obj.clone();
-    }
-    var clone = type == 'array' ? [] : {};
-    for (var key in obj) {
-      clone[key] = goog.cloneObject(obj[key]);
-    }
-    return clone;
-  }
-
-  return obj;
-};
-
-
-/**
- * Forward declaration for the clone method. This is necessary until the
- * compiler can better support duck-typing constructs as used in
- * goog.cloneObject.
- *
- * TODO(brenneman): Remove once the JSCompiler can infer that the check for
- * proto.clone is safe in goog.cloneObject.
- *
- * @type {Function}
- */
-Object.prototype.clone;
-
-
-/**
- * A native implementation of goog.bind.
- * @param {Function} fn A function to partially apply.
- * @param {Object|undefined} selfObj Specifies the object which |this| should
- *     point to when the function is run.
- * @param {...*} var_args Additional arguments that are partially
- *     applied to the function.
- * @return {!Function} A partially-applied form of the function bind() was
- *     invoked as a method of.
- * @private
- * @suppress {deprecated} The compiler thinks that Function.prototype.bind
- *     is deprecated because some people have declared a pure-JS version.
- *     Only the pure-JS version is truly deprecated.
- */
-goog.bindNative_ = function(fn, selfObj, var_args) {
-  return /** @type {!Function} */ (fn.call.apply(fn.bind, arguments));
-};
-
-
-/**
- * A pure-JS implementation of goog.bind.
- * @param {Function} fn A function to partially apply.
- * @param {Object|undefined} selfObj Specifies the object which |this| should
- *     point to when the function is run.
- * @param {...*} var_args Additional arguments that are partially
- *     applied to the function.
- * @return {!Function} A partially-applied form of the function bind() was
- *     invoked as a method of.
- * @private
- */
-goog.bindJs_ = function(fn, selfObj, var_args) {
-  if (!fn) {
-    throw new Error();
-  }
-
-  if (arguments.length > 2) {
-    var boundArgs = Array.prototype.slice.call(arguments, 2);
-    return function() {
-      // Prepend the bound arguments to the current arguments.
-      var newArgs = Array.prototype.slice.call(arguments);
-      Array.prototype.unshift.apply(newArgs, boundArgs);
-      return fn.apply(selfObj, newArgs);
-    };
-
-  } else {
-    return function() {
-      return fn.apply(selfObj, arguments);
-    };
-  }
-};
-
-
-/**
- * Partially applies this function to a particular 'this object' and zero or
- * more arguments. The result is a new function with some arguments of the first
- * function pre-filled and the value of |this| 'pre-specified'.<br><br>
- *
- * Remaining arguments specified at call-time are appended to the pre-
- * specified ones.<br><br>
- *
- * Also see: {@link #partial}.<br><br>
- *
- * Usage:
- * <pre>var barMethBound = bind(myFunction, myObj, 'arg1', 'arg2');
- * barMethBound('arg3', 'arg4');</pre>
- *
- * @param {Function} fn A function to partially apply.
- * @param {Object|undefined} selfObj Specifies the object which |this| should
- *     point to when the function is run.
- * @param {...*} var_args Additional arguments that are partially
- *     applied to the function.
- * @return {!Function} A partially-applied form of the function bind() was
- *     invoked as a method of.
- * @suppress {deprecated} See above.
- */
-goog.bind = function(fn, selfObj, var_args) {
-  // TODO(nicksantos): narrow the type signature.
-  if (Function.prototype.bind &&
-      // NOTE(nicksantos): Somebody pulled base.js into the default
-      // Chrome extension environment. This means that for Chrome extensions,
-      // they get the implementation of Function.prototype.bind that
-      // calls goog.bind instead of the native one. Even worse, we don't want
-      // to introduce a circular dependency between goog.bind and
-      // Function.prototype.bind, so we have to hack this to make sure it
-      // works correctly.
-      Function.prototype.bind.toString().indexOf('native code') != -1) {
-    goog.bind = goog.bindNative_;
-  } else {
-    goog.bind = goog.bindJs_;
-  }
-  return goog.bind.apply(null, arguments);
-};
-
-
-/**
- * Like bind(), except that a 'this object' is not required. Useful when the
- * target function is already bound.
- *
- * Usage:
- * var g = partial(f, arg1, arg2);
- * g(arg3, arg4);
- *
- * @param {Function} fn A function to partially apply.
- * @param {...*} var_args Additional arguments that are partially
- *     applied to fn.
- * @return {!Function} A partially-applied form of the function bind() was
- *     invoked as a method of.
- */
-goog.partial = function(fn, var_args) {
-  var args = Array.prototype.slice.call(arguments, 1);
-  return function() {
-    // Prepend the bound arguments to the current arguments.
-    var newArgs = Array.prototype.slice.call(arguments);
-    newArgs.unshift.apply(newArgs, args);
-    return fn.apply(this, newArgs);
-  };
-};
-
-
-/**
- * Copies all the members of a source object to a target object. This method
- * does not work on all browsers for all objects that contain keys such as
- * toString or hasOwnProperty. Use goog.object.extend for this purpose.
- * @param {Object} target Target.
- * @param {Object} source Source.
- */
-goog.mixin = function(target, source) {
-  for (var x in source) {
-    target[x] = source[x];
-  }
-
-  // For IE7 or lower, the for-in-loop does not contain any properties that are
-  // not enumerable on the prototype object (for example, isPrototypeOf from
-  // Object.prototype) but also it will not include 'replace' on objects that
-  // extend String and change 'replace' (not that it is common for anyone to
-  // extend anything except Object).
-};
-
-
-/**
- * @return {number} An integer value representing the number of milliseconds
- *     between midnight, January 1, 1970 and the current time.
- */
-goog.now = Date.now || (function() {
-  // Unary plus operator converts its operand to a number which in the case of
-  // a date is done by calling getTime().
-  return +new Date();
-});
-
-
-/**
- * Evals javascript in the global scope.  In IE this uses execScript, other
- * browsers use goog.global.eval. If goog.global.eval does not evaluate in the
- * global scope (for example, in Safari), appends a script tag instead.
- * Throws an exception if neither execScript or eval is defined.
- * @param {string} script JavaScript string.
- */
-goog.globalEval = function(script) {
-  if (goog.global.execScript) {
-    goog.global.execScript(script, 'JavaScript');
-  } else if (goog.global.eval) {
-    // Test to see if eval works
-    if (goog.evalWorksForGlobals_ == null) {
-      goog.global.eval('var _et_ = 1;');
-      if (typeof goog.global['_et_'] != 'undefined') {
-        delete goog.global['_et_'];
-        goog.evalWorksForGlobals_ = true;
-      } else {
-        goog.evalWorksForGlobals_ = false;
-      }
-    }
-
-    if (goog.evalWorksForGlobals_) {
-      goog.global.eval(script);
-    } else {
-      var doc = goog.global.document;
-      var scriptElt = doc.createElement('script');
-      scriptElt.type = 'text/javascript';
-      scriptElt.defer = false;
-      // Note(user): can't use .innerHTML since "t('<test>')" will fail and
-      // .text doesn't work in Safari 2.  Therefore we append a text node.
-      scriptElt.appendChild(doc.createTextNode(script));
-      doc.body.appendChild(scriptElt);
-      doc.body.removeChild(scriptElt);
-    }
-  } else {
-    throw Error('goog.globalEval not available');
-  }
-};
-
-
-/**
- * Indicates whether or not we can call 'eval' directly to eval code in the
- * global scope. Set to a Boolean by the first call to goog.globalEval (which
- * empirically tests whether eval works for globals). @see goog.globalEval
- * @type {?boolean}
- * @private
- */
-goog.evalWorksForGlobals_ = null;
-
-
-/**
- * Optional map of CSS class names to obfuscated names used with
- * goog.getCssName().
- * @type {Object|undefined}
- * @private
- * @see goog.setCssNameMapping
- */
-goog.cssNameMapping_;
-
-
-/**
- * Optional obfuscation style for CSS class names. Should be set to either
- * 'BY_WHOLE' or 'BY_PART' if defined.
- * @type {string|undefined}
- * @private
- * @see goog.setCssNameMapping
- */
-goog.cssNameMappingStyle_;
-
-
-/**
- * Handles strings that are intended to be used as CSS class names.
- *
- * This function works in tandem with @see goog.setCssNameMapping.
- *
- * Without any mapping set, the arguments are simple joined with a
- * hyphen and passed through unaltered.
- *
- * When there is a mapping, there are two possible styles in which
- * these mappings are used. In the BY_PART style, each part (i.e. in
- * between hyphens) of the passed in css name is rewritten according
- * to the map. In the BY_WHOLE style, the full css name is looked up in
- * the map directly. If a rewrite is not specified by the map, the
- * compiler will output a warning.
- *
- * When the mapping is passed to the compiler, it will replace calls
- * to goog.getCssName with the strings from the mapping, e.g.
- *     var x = goog.getCssName('foo');
- *     var y = goog.getCssName(this.baseClass, 'active');
- *  becomes:
- *     var x= 'foo';
- *     var y = this.baseClass + '-active';
- *
- * If one argument is passed it will be processed, if two are passed
- * only the modifier will be processed, as it is assumed the first
- * argument was generated as a result of calling goog.getCssName.
- *
- * @param {string} className The class name.
- * @param {string=} opt_modifier A modifier to be appended to the class name.
- * @return {string} The class name or the concatenation of the class name and
- *     the modifier.
- */
-goog.getCssName = function(className, opt_modifier) {
-  var getMapping = function(cssName) {
-    return goog.cssNameMapping_[cssName] || cssName;
-  };
-
-  var renameByParts = function(cssName) {
-    // Remap all the parts individually.
-    var parts = cssName.split('-');
-    var mapped = [];
-    for (var i = 0; i < parts.length; i++) {
-      mapped.push(getMapping(parts[i]));
-    }
-    return mapped.join('-');
-  };
-
-  var rename;
-  if (goog.cssNameMapping_) {
-    rename = goog.cssNameMappingStyle_ == 'BY_WHOLE' ?
-        getMapping : renameByParts;
-  } else {
-    rename = function(a) {
-      return a;
-    };
-  }
-
-  if (opt_modifier) {
-    return className + '-' + rename(opt_modifier);
-  } else {
-    return rename(className);
-  }
-};
-
-
-/**
- * Sets the map to check when returning a value from goog.getCssName(). Example:
- * <pre>
- * goog.setCssNameMapping({
- *   "goog": "a",
- *   "disabled": "b",
- * });
- *
- * var x = goog.getCssName('goog');
- * // The following evaluates to: "a a-b".
- * goog.getCssName('goog') + ' ' + goog.getCssName(x, 'disabled')
- * </pre>
- * When declared as a map of string literals to string literals, the JSCompiler
- * will replace all calls to goog.getCssName() using the supplied map if the
- * --closure_pass flag is set.
- *
- * @param {!Object} mapping A map of strings to strings where keys are possible
- *     arguments to goog.getCssName() and values are the corresponding values
- *     that should be returned.
- * @param {string=} opt_style The style of css name mapping. There are two valid
- *     options: 'BY_PART', and 'BY_WHOLE'.
- * @see goog.getCssName for a description.
- */
-goog.setCssNameMapping = function(mapping, opt_style) {
-  goog.cssNameMapping_ = mapping;
-  goog.cssNameMappingStyle_ = opt_style;
-};
-
-
-/**
- * To use CSS renaming in compiled mode, one of the input files should have a
- * call to goog.setCssNameMapping() with an object literal that the JSCompiler
- * can extract and use to replace all calls to goog.getCssName(). In uncompiled
- * mode, JavaScript code should be loaded before this base.js file that declares
- * a global variable, CLOSURE_CSS_NAME_MAPPING, which is used below. This is
- * to ensure that the mapping is loaded before any calls to goog.getCssName()
- * are made in uncompiled mode.
- *
- * A hook for overriding the CSS name mapping.
- * @type {Object|undefined}
- */
-goog.global.CLOSURE_CSS_NAME_MAPPING;
-
-
-if (!COMPILED && goog.global.CLOSURE_CSS_NAME_MAPPING) {
-  // This does not call goog.setCssNameMapping() because the JSCompiler
-  // requires that goog.setCssNameMapping() be called with an object literal.
-  goog.cssNameMapping_ = goog.global.CLOSURE_CSS_NAME_MAPPING;
-}
-
-
-/**
- * Abstract implementation of goog.getMsg for use with localized messages.
- * @param {string} str Translatable string, places holders in the form {$foo}.
- * @param {Object=} opt_values Map of place holder name to value.
- * @return {string} message with placeholders filled.
- */
-goog.getMsg = function(str, opt_values) {
-  var values = opt_values || {};
-  for (var key in values) {
-    var value = ('' + values[key]).replace(/\$/g, '$$$$');
-    str = str.replace(new RegExp('\\{\\$' + key + '\\}', 'gi'), value);
-  }
-  return str;
-};
-
-
-/**
- * Exposes an unobfuscated global namespace path for the given object.
- * Note that fields of the exported object *will* be obfuscated,
- * unless they are exported in turn via this function or
- * goog.exportProperty
- *
- * <p>Also handy for making public items that are defined in anonymous
- * closures.
- *
- * ex. goog.exportSymbol('Foo', Foo);
- *
- * ex. goog.exportSymbol('public.path.Foo.staticFunction',
- *                       Foo.staticFunction);
- *     public.path.Foo.staticFunction();
- *
- * ex. goog.exportSymbol('public.path.Foo.prototype.myMethod',
- *                       Foo.prototype.myMethod);
- *     new public.path.Foo().myMethod();
- *
- * @param {string} publicPath Unobfuscated name to export.
- * @param {*} object Object the name should point to.
- * @param {Object=} opt_objectToExportTo The object to add the path to; default
- *     is |goog.global|.
- */
-goog.exportSymbol = function(publicPath, object, opt_objectToExportTo) {
-  goog.exportPath_(publicPath, object, opt_objectToExportTo);
-};
-
-
-/**
- * Exports a property unobfuscated into the object's namespace.
- * ex. goog.exportProperty(Foo, 'staticFunction', Foo.staticFunction);
- * ex. goog.exportProperty(Foo.prototype, 'myMethod', Foo.prototype.myMethod);
- * @param {Object} object Object whose static property is being exported.
- * @param {string} publicName Unobfuscated name to export.
- * @param {*} symbol Object the name should point to.
- */
-goog.exportProperty = function(object, publicName, symbol) {
-  object[publicName] = symbol;
-};
-
-
-/**
- * Inherit the prototype methods from one constructor into another.
- *
- * Usage:
- * <pre>
- * function ParentClass(a, b) { }
- * ParentClass.prototype.foo = function(a) { }
- *
- * function ChildClass(a, b, c) {
- *   goog.base(this, a, b);
- * }
- * goog.inherits(ChildClass, ParentClass);
- *
- * var child = new ChildClass('a', 'b', 'see');
- * child.foo(); // works
- * </pre>
- *
- * In addition, a superclass' implementation of a method can be invoked
- * as follows:
- *
- * <pre>
- * ChildClass.prototype.foo = function(a) {
- *   ChildClass.superClass_.foo.call(this, a);
- *   // other code
- * };
- * </pre>
- *
- * @param {Function} childCtor Child class.
- * @param {Function} parentCtor Parent class.
- */
-goog.inherits = function(childCtor, parentCtor) {
-  /** @constructor */
-  function tempCtor() {};
-  tempCtor.prototype = parentCtor.prototype;
-  childCtor.superClass_ = parentCtor.prototype;
-  childCtor.prototype = new tempCtor();
-  childCtor.prototype.constructor = childCtor;
-};
-
-
-/**
- * Call up to the superclass.
- *
- * If this is called from a constructor, then this calls the superclass
- * contructor with arguments 1-N.
- *
- * If this is called from a prototype method, then you must pass
- * the name of the method as the second argument to this function. If
- * you do not, you will get a runtime error. This calls the superclass'
- * method with arguments 2-N.
- *
- * This function only works if you use goog.inherits to express
- * inheritance relationships between your classes.
- *
- * This function is a compiler primitive. At compile-time, the
- * compiler will do macro expansion to remove a lot of
- * the extra overhead that this function introduces. The compiler
- * will also enforce a lot of the assumptions that this function
- * makes, and treat it as a compiler error if you break them.
- *
- * @param {!Object} me Should always be "this".
- * @param {*=} opt_methodName The method name if calling a super method.
- * @param {...*} var_args The rest of the arguments.
- * @return {*} The return value of the superclass method.
- */
-goog.base = function(me, opt_methodName, var_args) {
-  var caller = arguments.callee.caller;
-  if (caller.superClass_) {
-    // This is a constructor. Call the superclass constructor.
-    return caller.superClass_.constructor.apply(
-        me, Array.prototype.slice.call(arguments, 1));
-  }
-
-  var args = Array.prototype.slice.call(arguments, 2);
-  var foundCaller = false;
-  for (var ctor = me.constructor;
-       ctor; ctor = ctor.superClass_ && ctor.superClass_.constructor) {
-    if (ctor.prototype[opt_methodName] === caller) {
-      foundCaller = true;
-    } else if (foundCaller) {
-      return ctor.prototype[opt_methodName].apply(me, args);
-    }
-  }
-
-  // If we did not find the caller in the prototype chain,
-  // then one of two things happened:
-  // 1) The caller is an instance method.
-  // 2) This method was not called by the right caller.
-  if (me[opt_methodName] === caller) {
-    return me.constructor.prototype[opt_methodName].apply(me, args);
-  } else {
-    throw Error(
-        'goog.base called from a method of one name ' +
-        'to a method of a different name');
-  }
-};
-
-
-/**
- * Allow for aliasing within scope functions.  This function exists for
- * uncompiled code - in compiled code the calls will be inlined and the
- * aliases applied.  In uncompiled code the function is simply run since the
- * aliases as written are valid JavaScript.
- * @param {function()} fn Function to call.  This function can contain aliases
- *     to namespaces (e.g. "var dom = goog.dom") or classes
- *    (e.g. "var Timer = goog.Timer").
- */
-goog.scope = function(fn) {
-  fn.call(goog.global);
-};
-
-

Fișier diff suprimat deoarece este prea mare
+ 0 - 293
support/client/lib/closure/deps.js


+ 0 - 109
support/client/lib/closure/vec/float32array.js

@@ -1,109 +0,0 @@
-// Copyright 2011 The Closure Library Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS-IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-
-/**
- * @fileoverview Supplies a Float32Array implementation that implements
- *     most of the Float32Array spec and that can be used when a built-in
- *     implementation is not available.
- *
- *     Note that if no existing Float32Array implementation is found then
- *     this class and all its public properties are exported as Float32Array.
- *
- *     Adding support for the other TypedArray classes here does not make sense
- *     since this vector math library only needs Float32Array.
- *
- */
-goog.provide('goog.vec.Float32Array');
-
-
-
-/**
- * Constructs a new Float32Array. The new array is initialized to all zeros.
- *
- * @param {goog.vec.Float32Array|Array|ArrayBuffer|number} p0
- *     The length of the array, or an array to initialize the contents of the
- *     new Float32Array.
- * @constructor
- */
-goog.vec.Float32Array = function(p0) {
-  this.length = p0.length || p0;
-  for (var i = 0; i < this.length; i++) {
-    this[i] = p0[i] || 0;
-  }
-};
-
-
-/**
- * The number of bytes in an element (as defined by the Typed Array
- * specification).
- *
- * @type {number}
- */
-goog.vec.Float32Array.BYTES_PER_ELEMENT = 4;
-
-
-/**
- * The number of bytes in an element (as defined by the Typed Array
- * specification).
- *
- * @type {number}
- */
-goog.vec.Float32Array.prototype.BYTES_PER_ELEMENT = 4;
-
-
-/**
- * Sets elements of the array.
- * @param {Array.<number>|Float32Array} values The array of values.
- * @param {number=} opt_offset The offset in this array to start.
- */
-goog.vec.Float32Array.prototype.set = function(values, opt_offset) {
-  opt_offset = opt_offset || 0;
-  for (var i = 0; i < values.length && opt_offset + i < this.length; i++) {
-    this[opt_offset + i] = values[i];
-  }
-};
-
-
-/**
- * Creates a string representation of this array.
- * @return {string} The string version of this array.
- */
-goog.vec.Float32Array.prototype.toString = Array.prototype.join;
-
-
-/**
- * Note that we cannot implement the subarray() or (deprecated) slice()
- * methods properly since doing so would require being able to overload
- * the [] operator which is not possible in javascript.  So we leave
- * them unimplemented.  Any attempt to call these methods will just result
- * in a javascript error since we leave them undefined.
- */
-
-
-/**
- * If no existing Float32Array implementation is found then we export
- * goog.vec.Float32Array as Float32Array.
- */
-if (typeof Float32Array == 'undefined') {
-  goog.exportProperty(goog.vec.Float32Array, 'BYTES_PER_ELEMENT',
-                      goog.vec.Float32Array.BYTES_PER_ELEMENT);
-  goog.exportProperty(goog.vec.Float32Array.prototype, 'BYTES_PER_ELEMENT',
-                      goog.vec.Float32Array.prototype.BYTES_PER_ELEMENT);
-  goog.exportProperty(goog.vec.Float32Array.prototype, 'set',
-                      goog.vec.Float32Array.prototype.set);
-  goog.exportProperty(goog.vec.Float32Array.prototype, 'toString',
-                      goog.vec.Float32Array.prototype.toString);
-  goog.exportSymbol('Float32Array', goog.vec.Float32Array);
-}

+ 0 - 109
support/client/lib/closure/vec/float64array.js

@@ -1,109 +0,0 @@
-// Copyright 2011 The Closure Library Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS-IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-
-/**
- * @fileoverview Supplies a Float64Array implementation that implements
- * most of the Float64Array spec and that can be used when a built-in
- * implementation is not available.
- *
- * Note that if no existing Float64Array implementation is found then this
- * class and all its public properties are exported as Float64Array.
- *
- * Adding support for the other TypedArray classes here does not make sense
- * since this vector math library only needs Float32Array and Float64Array.
- *
- */
-goog.provide('goog.vec.Float64Array');
-
-
-
-/**
- * Constructs a new Float64Array. The new array is initialized to all zeros.
- *
- * @param {goog.vec.Float64Array|Array|ArrayBuffer|number} p0
- *     The length of the array, or an array to initialize the contents of the
- *     new Float64Array.
- * @constructor
- */
-goog.vec.Float64Array = function(p0) {
-  this.length = p0.length || p0;
-  for (var i = 0; i < this.length; i++) {
-    this[i] = p0[i] || 0;
-  }
-};
-
-
-/**
- * The number of bytes in an element (as defined by the Typed Array
- * specification).
- *
- * @type {number}
- */
-goog.vec.Float64Array.BYTES_PER_ELEMENT = 8;
-
-
-/**
- * The number of bytes in an element (as defined by the Typed Array
- * specification).
- *
- * @type {number}
- */
-goog.vec.Float64Array.prototype.BYTES_PER_ELEMENT = 8;
-
-
-/**
- * Sets elements of the array.
- * @param {Array.<number>|Float64Array} values The array of values.
- * @param {number=} opt_offset The offset in this array to start.
- */
-goog.vec.Float64Array.prototype.set = function(values, opt_offset) {
-  opt_offset = opt_offset || 0;
-  for (var i = 0; i < values.length && opt_offset + i < this.length; i++) {
-    this[opt_offset + i] = values[i];
-  }
-};
-
-
-/**
- * Creates a string representation of this array.
- * @return {string} The string version of this array.
- */
-goog.vec.Float64Array.prototype.toString = Array.prototype.join;
-
-
-/**
- * Note that we cannot implement the subarray() or (deprecated) slice()
- * methods properly since doing so would require being able to overload
- * the [] operator which is not possible in javascript.  So we leave
- * them unimplemented.  Any attempt to call these methods will just result
- * in a javascript error since we leave them undefined.
- */
-
-
-/**
- * If no existing Float64Array implementation is found then we export
- * goog.vec.Float64Array as Float64Array.
- */
-if (typeof Float64Array == 'undefined') {
-  goog.exportProperty(goog.vec.Float64Array, 'BYTES_PER_ELEMENT',
-                      goog.vec.Float64Array.BYTES_PER_ELEMENT);
-  goog.exportProperty(goog.vec.Float64Array.prototype, 'BYTES_PER_ELEMENT',
-                      goog.vec.Float64Array.prototype.BYTES_PER_ELEMENT);
-  goog.exportProperty(goog.vec.Float64Array.prototype, 'set',
-                      goog.vec.Float64Array.prototype.set);
-  goog.exportProperty(goog.vec.Float64Array.prototype, 'toString',
-                      goog.vec.Float64Array.prototype.toString);
-  goog.exportSymbol('Float64Array', goog.vec.Float64Array);
-}

+ 0 - 896
support/client/lib/closure/vec/mat3.js

@@ -1,896 +0,0 @@
-// Copyright 2011 The Closure Library Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS-IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-/**
- * @fileoverview Implements 3x3 matrices and their related functions which are
- * compatible with WebGL. The API is structured to avoid unnecessary memory
- * allocations.  The last parameter will typically be the output vector and
- * an object can be both an input and output parameter to all methods except
- * where noted. Matrix operations follow the mathematical form when multiplying
- * vectors as follows: resultVec = matrix * vec.
- *
- */
-goog.provide('goog.vec.Mat3');
-
-goog.require('goog.vec');
-goog.require('goog.vec.Vec3');
-
-
-/** @typedef {goog.vec.Float32} */ goog.vec.Mat3.Float32;
-/** @typedef {goog.vec.Float64} */ goog.vec.Mat3.Float64;
-/** @typedef {goog.vec.Number} */ goog.vec.Mat3.Number;
-/** @typedef {goog.vec.AnyType} */ goog.vec.Mat3.AnyType;
-
-// The following two types are deprecated - use the above types instead.
-/** @typedef {Float32Array} */ goog.vec.Mat3.Type;
-/** @typedef {goog.vec.ArrayType} */ goog.vec.Mat3.Mat3Like;
-
-
-/**
- * Creates the array representation of a 3x3 matrix of Float32.
- * The use of the array directly instead of a class reduces overhead.
- * The returned matrix is cleared to all zeros.
- *
- * @return {!goog.vec.Mat3.Float32} The new matrix.
- */
-goog.vec.Mat3.createFloat32 = function() {
-  return new Float32Array(9);
-};
-
-
-/**
- * Creates the array representation of a 3x3 matrix of Float64.
- * The returned matrix is cleared to all zeros.
- *
- * @return {!goog.vec.Mat3.Float64} The new matrix.
- */
-goog.vec.Mat3.createFloat64 = function() {
-  return new Float64Array(9);
-};
-
-
-/**
- * Creates the array representation of a 3x3 matrix of Number.
- * The returned matrix is cleared to all zeros.
- *
- * @return {!goog.vec.Mat3.Number} The new matrix.
- */
-goog.vec.Mat3.createNumber = function() {
-  var a = new Array(9);
-  goog.vec.Mat3.setFromValues(a,
-                              0, 0, 0,
-                              0, 0, 0,
-                              0, 0, 0);
-  return a;
-};
-
-
-/**
- * Creates the array representation of a 3x3 matrix of Float32.
- * The returned matrix is cleared to all zeros.
- *
- * @deprecated Use createFloat32.
- * @return {!goog.vec.Mat3.Type} The new matrix.
- */
-goog.vec.Mat3.create = function() {
-  return goog.vec.Mat3.createFloat32();
-};
-
-
-/**
- * Creates a 3x3 identity matrix of Float32.
- *
- * @return {!goog.vec.Mat3.Float32} The new 9 element array.
- */
-goog.vec.Mat3.createFloat32Identity = function() {
-  var mat = goog.vec.Mat3.createFloat32();
-  mat[0] = mat[4] = mat[8] = 1;
-  return mat;
-};
-
-
-/**
- * Creates a 3x3 identity matrix of Float64.
- *
- * @return {!goog.vec.Mat3.Float64} The new 9 element array.
- */
-goog.vec.Mat3.createFloat64Identity = function() {
-  var mat = goog.vec.Mat3.createFloat64();
-  mat[0] = mat[4] = mat[8] = 1;
-  return mat;
-};
-
-
-/**
- * Creates a 3x3 identity matrix of Number.
- * The returned matrix is cleared to all zeros.
- *
- * @return {!goog.vec.Mat3.Number} The new 9 element array.
- */
-goog.vec.Mat3.createNumberIdentity = function() {
-  var a = new Array(9);
-  goog.vec.Mat3.setFromValues(a,
-                              1, 0, 0,
-                              0, 1, 0,
-                              0, 0, 1);
-  return a;
-};
-
-
-/**
- * Creates the array representation of a 3x3 matrix of Float32.
- * The returned matrix is cleared to all zeros.
- *
- * @deprecated Use createFloat32Identity.
- * @return {!goog.vec.Mat3.Type} The new 9 element array.
- */
-goog.vec.Mat3.createIdentity = function() {
-  return goog.vec.Mat3.createFloat32Identity();
-};
-
-
-/**
- * Creates a 3x3 matrix of Float32 initialized from the given array.
- *
- * @param {goog.vec.Mat3.AnyType} matrix The array containing the
- *     matrix values in column major order.
- * @return {!goog.vec.Mat3.Float32} The new, nine element array.
- */
-goog.vec.Mat3.createFloat32FromArray = function(matrix) {
-  var newMatrix = goog.vec.Mat3.createFloat32();
-  goog.vec.Mat3.setFromArray(newMatrix, matrix);
-  return newMatrix;
-};
-
-
-/**
- * Creates a 3x3 matrix of Float32 initialized from the given values.
- *
- * @param {number} v00 The values at (0, 0).
- * @param {number} v10 The values at (1, 0).
- * @param {number} v20 The values at (2, 0).
- * @param {number} v01 The values at (0, 1).
- * @param {number} v11 The values at (1, 1).
- * @param {number} v21 The values at (2, 1).
- * @param {number} v02 The values at (0, 2).
- * @param {number} v12 The values at (1, 2).
- * @param {number} v22 The values at (2, 2).
- * @return {!goog.vec.Mat3.Float32} The new, nine element array.
- */
-goog.vec.Mat3.createFloat32FromValues = function(
-    v00, v10, v20, v01, v11, v21, v02, v12, v22) {
-  var newMatrix = goog.vec.Mat3.createFloat32();
-  goog.vec.Mat3.setFromValues(
-      newMatrix, v00, v10, v20, v01, v11, v21, v02, v12, v22);
-  return newMatrix;
-};
-
-
-/**
- * Creates a clone of a 3x3 matrix of Float32.
- *
- * @param {goog.vec.Mat3.Float32} matrix The source 3x3 matrix.
- * @return {!goog.vec.Mat3.Float32} The new 3x3 element matrix.
- */
-goog.vec.Mat3.cloneFloat32 = goog.vec.Mat3.createFloat32FromArray;
-
-
-/**
- * Creates a 3x3 matrix of Float64 initialized from the given array.
- *
- * @param {goog.vec.Mat3.AnyType} matrix The array containing the
- *     matrix values in column major order.
- * @return {!goog.vec.Mat3.Float64} The new, nine element array.
- */
-goog.vec.Mat3.createFloat64FromArray = function(matrix) {
-  var newMatrix = goog.vec.Mat3.createFloat64();
-  goog.vec.Mat3.setFromArray(newMatrix, matrix);
-  return newMatrix;
-};
-
-
-/**
- * Creates a 3x3 matrix of Float64 initialized from the given values.
- *
- * @param {number} v00 The values at (0, 0).
- * @param {number} v10 The values at (1, 0).
- * @param {number} v20 The values at (2, 0).
- * @param {number} v01 The values at (0, 1).
- * @param {number} v11 The values at (1, 1).
- * @param {number} v21 The values at (2, 1).
- * @param {number} v02 The values at (0, 2).
- * @param {number} v12 The values at (1, 2).
- * @param {number} v22 The values at (2, 2).
- * @return {!goog.vec.Mat3.Float64} The new, nine element array.
- */
-goog.vec.Mat3.createFloat64FromValues = function(
-    v00, v10, v20, v01, v11, v21, v02, v12, v22) {
-  var newMatrix = goog.vec.Mat3.createFloat64();
-  goog.vec.Mat3.setFromValues(
-      newMatrix, v00, v10, v20, v01, v11, v21, v02, v12, v22);
-  return newMatrix;
-};
-
-
-/**
- * Creates a clone of a 3x3 matrix of Float64.
- *
- * @param {goog.vec.Mat3.Float64} matrix The source 3x3 matrix.
- * @return {!goog.vec.Mat3.Float64} The new 3x3 element matrix.
- */
-goog.vec.Mat3.cloneFloat64 = goog.vec.Mat3.createFloat64FromArray;
-
-
-/**
- * Creates a 3x3 matrix of Float32 initialized from the given array.
- *
- * @deprecated Use createFloat32FromArray.
- * @param {goog.vec.Mat3.Mat3Like} matrix The array containing the
- *     matrix values in column major order.
- * @return {!goog.vec.Mat3.Type} The new, nine element array.
- */
-goog.vec.Mat3.createFromArray = function(matrix) {
-  var newMatrix = goog.vec.Mat3.createFloat32();
-  goog.vec.Mat3.setFromArray(newMatrix, matrix);
-  return newMatrix;
-};
-
-
-/**
- * Creates a 3x3 matrix of Float32 initialized from the given values.
- *
- * @deprecated Use createFloat32FromValues.
- * @param {number} v00 The values at (0, 0).
- * @param {number} v10 The values at (1, 0).
- * @param {number} v20 The values at (2, 0).
- * @param {number} v01 The values at (0, 1).
- * @param {number} v11 The values at (1, 1).
- * @param {number} v21 The values at (2, 1).
- * @param {number} v02 The values at (0, 2).
- * @param {number} v12 The values at (1, 2).
- * @param {number} v22 The values at (2, 2).
- * @return {!goog.vec.Mat3.Type} The new, nine element array.
- */
-goog.vec.Mat3.createFromValues = function(
-    v00, v10, v20, v01, v11, v21, v02, v12, v22) {
-  var newMatrix = goog.vec.Mat3.create();
-  goog.vec.Mat3.setFromValues(
-      newMatrix, v00, v10, v20, v01, v11, v21, v02, v12, v22);
-  return newMatrix;
-};
-
-
-/**
- * Creates a clone of a 3x3 matrix of Float32.
- *
- * @deprecated Use cloneFloat32.
- * @param {goog.vec.Mat3.Mat3Like} matrix The source 3x3 matrix.
- * @return {!goog.vec.Mat3.Type} The new 3x3 element matrix.
- */
-goog.vec.Mat3.clone = goog.vec.Mat3.createFromArray;
-
-
-/**
- * Retrieves the element at the requested row and column.
- *
- * @param {goog.vec.Mat3.AnyType} mat The matrix containing the value to
- *     retrieve.
- * @param {number} row The row index.
- * @param {number} column The column index.
- * @return {number} The element value at the requested row, column indices.
- */
-goog.vec.Mat3.getElement = function(mat, row, column) {
-  return mat[row + column * 3];
-};
-
-
-/**
- * Sets the element at the requested row and column.
- *
- * @param {goog.vec.Mat3.AnyType} mat The matrix containing the value to
- *     retrieve.
- * @param {number} row The row index.
- * @param {number} column The column index.
- * @param {number} value The value to set at the requested row, column.
- */
-goog.vec.Mat3.setElement = function(mat, row, column, value) {
-  mat[row + column * 3] = value;
-};
-
-
-/**
- * Initializes the matrix from the set of values. Note the values supplied are
- * in column major order.
- *
- * @param {goog.vec.Mat3.AnyType} mat The matrix to receive the
- *     values.
- * @param {number} v00 The values at (0, 0).
- * @param {number} v10 The values at (1, 0).
- * @param {number} v20 The values at (2, 0).
- * @param {number} v01 The values at (0, 1).
- * @param {number} v11 The values at (1, 1).
- * @param {number} v21 The values at (2, 1).
- * @param {number} v02 The values at (0, 2).
- * @param {number} v12 The values at (1, 2).
- * @param {number} v22 The values at (2, 2).
- * @return {!goog.vec.Mat3.AnyType} return mat so that operations can be
- *     chained together.
- */
-goog.vec.Mat3.setFromValues = function(
-    mat, v00, v10, v20, v01, v11, v21, v02, v12, v22) {
-  mat[0] = v00;
-  mat[1] = v10;
-  mat[2] = v20;
-  mat[3] = v01;
-  mat[4] = v11;
-  mat[5] = v21;
-  mat[6] = v02;
-  mat[7] = v12;
-  mat[8] = v22;
-  return mat;
-};
-
-
-/**
- * Sets the matrix from the array of values stored in column major order.
- *
- * @param {goog.vec.Mat3.AnyType} mat The matrix to receive the values.
- * @param {goog.vec.Mat3.AnyType} values The column major ordered
- *     array of values to store in the matrix.
- * @return {!goog.vec.Mat3.AnyType} return mat so that operations can be
- *     chained together.
- */
-goog.vec.Mat3.setFromArray = function(mat, values) {
-  mat[0] = values[0];
-  mat[1] = values[1];
-  mat[2] = values[2];
-  mat[3] = values[3];
-  mat[4] = values[4];
-  mat[5] = values[5];
-  mat[6] = values[6];
-  mat[7] = values[7];
-  mat[8] = values[8];
-  return mat;
-};
-
-
-/**
- * Sets the matrix from the array of values stored in row major order.
- *
- * @param {goog.vec.Mat3.AnyType} mat The matrix to receive the values.
- * @param {goog.vec.Mat3.AnyType} values The row major ordered array
- *     of values to store in the matrix.
- * @return {!goog.vec.Mat3.AnyType} return mat so that operations can be
- *     chained together.
- */
-goog.vec.Mat3.setFromRowMajorArray = function(mat, values) {
-  mat[0] = values[0];
-  mat[1] = values[3];
-  mat[2] = values[6];
-  mat[3] = values[1];
-  mat[4] = values[4];
-  mat[5] = values[7];
-  mat[6] = values[2];
-  mat[7] = values[5];
-  mat[8] = values[8];
-  return mat;
-};
-
-
-/**
- * Sets the diagonal values of the matrix from the given values.
- *
- * @param {goog.vec.Mat3.AnyType} mat The matrix to receive the values.
- * @param {number} v00 The values for (0, 0).
- * @param {number} v11 The values for (1, 1).
- * @param {number} v22 The values for (2, 2).
- * @return {!goog.vec.Mat3.AnyType} return mat so that operations can be
- *     chained together.
- */
-goog.vec.Mat3.setDiagonalValues = function(mat, v00, v11, v22) {
-  mat[0] = v00;
-  mat[4] = v11;
-  mat[8] = v22;
-  return mat;
-};
-
-
-/**
- * Sets the diagonal values of the matrix from the given vector.
- *
- * @param {goog.vec.Mat3.AnyType} mat The matrix to receive the values.
- * @param {goog.vec.Vec3.AnyType} vec The vector containing the values.
- */
-goog.vec.Mat3.setDiagonal = function(mat, vec) {
-  mat[0] = vec[0];
-  mat[4] = vec[1];
-  mat[8] = vec[2];
-};
-
-
-/**
- * Sets the specified column with the supplied values.
- *
- * @param {goog.vec.Mat3.AnyType} mat The matrix to recieve the values.
- * @param {number} column The column index to set the values on.
- * @param {number} v0 The value for row 0.
- * @param {number} v1 The value for row 1.
- * @param {number} v2 The value for row 2.
- */
-goog.vec.Mat3.setColumnValues = function(mat, column, v0, v1, v2) {
-  var i = column * 3;
-  mat[i] = v0;
-  mat[i + 1] = v1;
-  mat[i + 2] = v2;
-};
-
-
-/**
- * Sets the specified column with the value from the supplied array.
- *
- * @param {goog.vec.Mat3.AnyType} mat The matrix to receive the values.
- * @param {number} column The column index to set the values on.
- * @param {goog.vec.Vec3.AnyType} vec The vector elements for the column.
- */
-goog.vec.Mat3.setColumn = function(mat, column, vec) {
-  var i = column * 3;
-  mat[i] = vec[0];
-  mat[i + 1] = vec[1];
-  mat[i + 2] = vec[2];
-};
-
-
-/**
- * Retrieves the specified column from the matrix into the given vector
- * array.
- *
- * @param {goog.vec.Mat3.AnyType} mat The matrix supplying the values.
- * @param {number} column The column to get the values from.
- * @param {goog.vec.Vec3.AnyType} vec The vector elements to receive the
- *     column.
- */
-goog.vec.Mat3.getColumn = function(mat, column, vec) {
-  var i = column * 3;
-  vec[0] = mat[i];
-  vec[1] = mat[i + 1];
-  vec[2] = mat[i + 2];
-};
-
-
-/**
- * Sets the columns of the matrix from the set of vector elements.
- *
- * @param {goog.vec.Mat3.AnyType} mat The matrix to receive the values.
- * @param {goog.vec.Vec3.AnyType} vec0 The values for column 0.
- * @param {goog.vec.Vec3.AnyType} vec1 The values for column 1.
- * @param {goog.vec.Vec3.AnyType} vec2 The values for column 2.
- */
-goog.vec.Mat3.setColumns = function(mat, vec0, vec1, vec2) {
-  goog.vec.Mat3.setColumn(mat, 0, vec0);
-  goog.vec.Mat3.setColumn(mat, 1, vec1);
-  goog.vec.Mat3.setColumn(mat, 2, vec2);
-};
-
-
-/**
- * Retrieves the column values from the given matrix into the given vector
- * elements.
- *
- * @param {goog.vec.Mat3.AnyType} mat The matrix supplying the columns.
- * @param {goog.vec.Vec3.AnyType} vec0 The vector to receive column 0.
- * @param {goog.vec.Vec3.AnyType} vec1 The vector to receive column 1.
- * @param {goog.vec.Vec3.AnyType} vec2 The vector to receive column 2.
- */
-goog.vec.Mat3.getColumns = function(mat, vec0, vec1, vec2) {
-  goog.vec.Mat3.getColumn(mat, 0, vec0);
-  goog.vec.Mat3.getColumn(mat, 1, vec1);
-  goog.vec.Mat3.getColumn(mat, 2, vec2);
-};
-
-
-/**
- * Sets the row values from the supplied values.
- *
- * @param {goog.vec.Mat3.AnyType} mat The matrix to receive the values.
- * @param {number} row The index of the row to receive the values.
- * @param {number} v0 The value for column 0.
- * @param {number} v1 The value for column 1.
- * @param {number} v2 The value for column 2.
- */
-goog.vec.Mat3.setRowValues = function(mat, row, v0, v1, v2) {
-  mat[row] = v0;
-  mat[row + 3] = v1;
-  mat[row + 6] = v2;
-};
-
-
-/**
- * Sets the row values from the supplied vector.
- *
- * @param {goog.vec.Mat3.AnyType} mat The matrix to receive the row values.
- * @param {number} row The index of the row.
- * @param {goog.vec.Vec3.AnyType} vec The vector containing the values.
- */
-goog.vec.Mat3.setRow = function(mat, row, vec) {
-  mat[row] = vec[0];
-  mat[row + 3] = vec[1];
-  mat[row + 6] = vec[2];
-};
-
-
-/**
- * Retrieves the row values into the given vector.
- *
- * @param {goog.vec.Mat3.AnyType} mat The matrix supplying the values.
- * @param {number} row The index of the row supplying the values.
- * @param {goog.vec.Vec3.AnyType} vec The vector to receive the row.
- */
-goog.vec.Mat3.getRow = function(mat, row, vec) {
-  vec[0] = mat[row];
-  vec[1] = mat[row + 3];
-  vec[2] = mat[row + 6];
-};
-
-
-/**
- * Sets the rows of the matrix from the supplied vectors.
- *
- * @param {goog.vec.Mat3.AnyType} mat The matrix to receive the values.
- * @param {goog.vec.Vec3.AnyType} vec0 The values for row 0.
- * @param {goog.vec.Vec3.AnyType} vec1 The values for row 1.
- * @param {goog.vec.Vec3.AnyType} vec2 The values for row 2.
- */
-goog.vec.Mat3.setRows = function(mat, vec0, vec1, vec2) {
-  goog.vec.Mat3.setRow(mat, 0, vec0);
-  goog.vec.Mat3.setRow(mat, 1, vec1);
-  goog.vec.Mat3.setRow(mat, 2, vec2);
-};
-
-
-/**
- * Retrieves the rows of the matrix into the supplied vectors.
- *
- * @param {goog.vec.Mat3.AnyType} mat The matrix to supplying the values.
- * @param {goog.vec.Vec3.AnyType} vec0 The vector to receive row 0.
- * @param {goog.vec.Vec3.AnyType} vec1 The vector to receive row 1.
- * @param {goog.vec.Vec3.AnyType} vec2 The vector to receive row 2.
- */
-goog.vec.Mat3.getRows = function(mat, vec0, vec1, vec2) {
-  goog.vec.Mat3.getRow(mat, 0, vec0);
-  goog.vec.Mat3.getRow(mat, 1, vec1);
-  goog.vec.Mat3.getRow(mat, 2, vec2);
-};
-
-
-/**
- * Makes the given 3x3 matrix the zero matrix.
- *
- * @param {goog.vec.Mat3.AnyType} mat The matrix.
- * @return {!goog.vec.Mat3.AnyType} return mat so operations can be chained.
- */
-goog.vec.Mat3.makeZero = function(mat) {
-  mat[0] = 0;
-  mat[1] = 0;
-  mat[2] = 0;
-  mat[3] = 0;
-  mat[4] = 0;
-  mat[5] = 0;
-  mat[6] = 0;
-  mat[7] = 0;
-  mat[8] = 0;
-  return mat;
-};
-
-
-/**
- * Makes the given 3x3 matrix the identity matrix.
- *
- * @param {goog.vec.Mat3.AnyType} mat The matrix.
- * @return {!goog.vec.Mat3.AnyType} return mat so operations can be chained.
- */
-goog.vec.Mat3.makeIdentity = function(mat) {
-  mat[0] = 1;
-  mat[1] = 0;
-  mat[2] = 0;
-  mat[3] = 0;
-  mat[4] = 1;
-  mat[5] = 0;
-  mat[6] = 0;
-  mat[7] = 0;
-  mat[8] = 1;
-  return mat;
-};
-
-
-/**
- * Performs a per-component addition of the matrices mat0 and mat1, storing
- * the result into resultMat.
- *
- * @param {goog.vec.Mat3.AnyType} mat0 The first addend.
- * @param {goog.vec.Mat3.AnyType} mat1 The second addend.
- * @param {goog.vec.Mat3.AnyType} resultMat The matrix to
- *     receive the results (may be either mat0 or mat1).
- * @return {!goog.vec.Mat3.AnyType} return resultMat so that operations can be
- *     chained together.
- */
-goog.vec.Mat3.addMat = function(mat0, mat1, resultMat) {
-  resultMat[0] = mat0[0] + mat1[0];
-  resultMat[1] = mat0[1] + mat1[1];
-  resultMat[2] = mat0[2] + mat1[2];
-  resultMat[3] = mat0[3] + mat1[3];
-  resultMat[4] = mat0[4] + mat1[4];
-  resultMat[5] = mat0[5] + mat1[5];
-  resultMat[6] = mat0[6] + mat1[6];
-  resultMat[7] = mat0[7] + mat1[7];
-  resultMat[8] = mat0[8] + mat1[8];
-  return resultMat;
-};
-
-
-/**
- * Performs a per-component subtraction of the matrices mat0 and mat1,
- * storing the result into resultMat.
- *
- * @param {goog.vec.Mat3.AnyType} mat0 The minuend.
- * @param {goog.vec.Mat3.AnyType} mat1 The subtrahend.
- * @param {goog.vec.Mat3.AnyType} resultMat The matrix to receive
- *     the results (may be either mat0 or mat1).
- * @return {!goog.vec.Mat3.AnyType} return resultMat so that operations can be
- *     chained together.
- */
-goog.vec.Mat3.subMat = function(mat0, mat1, resultMat) {
-  resultMat[0] = mat0[0] - mat1[0];
-  resultMat[1] = mat0[1] - mat1[1];
-  resultMat[2] = mat0[2] - mat1[2];
-  resultMat[3] = mat0[3] - mat1[3];
-  resultMat[4] = mat0[4] - mat1[4];
-  resultMat[5] = mat0[5] - mat1[5];
-  resultMat[6] = mat0[6] - mat1[6];
-  resultMat[7] = mat0[7] - mat1[7];
-  resultMat[8] = mat0[8] - mat1[8];
-  return resultMat;
-};
-
-
-/**
- * Multiplies matrix mat0 with the given scalar, storing the result
- * into resultMat.
- *
- * @param {goog.vec.Mat3.AnyType} mat The matrix.
- * @param {number} scalar The scalar value to multiple to each element of mat.
- * @param {goog.vec.Mat3.AnyType} resultMat The matrix to receive
- *     the results (may be mat).
- * @return {!goog.vec.Mat3.AnyType} return resultMat so that operations can be
- *     chained together.
- */
-goog.vec.Mat3.multScalar = function(mat, scalar, resultMat) {
-  resultMat[0] = mat[0] * scalar;
-  resultMat[1] = mat[1] * scalar;
-  resultMat[2] = mat[2] * scalar;
-  resultMat[3] = mat[3] * scalar;
-  resultMat[4] = mat[4] * scalar;
-  resultMat[5] = mat[5] * scalar;
-  resultMat[6] = mat[6] * scalar;
-  resultMat[7] = mat[7] * scalar;
-  resultMat[8] = mat[8] * scalar;
-  return resultMat;
-};
-
-
-/**
- * Multiplies the two matrices mat0 and mat1 using matrix multiplication,
- * storing the result into resultMat.
- *
- * @param {goog.vec.Mat3.AnyType} mat0 The first (left hand) matrix.
- * @param {goog.vec.Mat3.AnyType} mat1 The second (right hand) matrix.
- * @param {goog.vec.Mat3.AnyType} resultMat The matrix to receive
- *     the results (may be either mat0 or mat1).
- * @return {!goog.vec.Mat3.AnyType} return resultMat so that operations can be
- *     chained together.
- */
-goog.vec.Mat3.multMat = function(mat0, mat1, resultMat) {
-  var a00 = mat0[0], a10 = mat0[1], a20 = mat0[2];
-  var a01 = mat0[3], a11 = mat0[4], a21 = mat0[5];
-  var a02 = mat0[6], a12 = mat0[7], a22 = mat0[8];
-
-  var b00 = mat1[0], b10 = mat1[1], b20 = mat1[2];
-  var b01 = mat1[3], b11 = mat1[4], b21 = mat1[5];
-  var b02 = mat1[6], b12 = mat1[7], b22 = mat1[8];
-
-  resultMat[0] = a00 * b00 + a01 * b10 + a02 * b20;
-  resultMat[1] = a10 * b00 + a11 * b10 + a12 * b20;
-  resultMat[2] = a20 * b00 + a21 * b10 + a22 * b20;
-  resultMat[3] = a00 * b01 + a01 * b11 + a02 * b21;
-  resultMat[4] = a10 * b01 + a11 * b11 + a12 * b21;
-  resultMat[5] = a20 * b01 + a21 * b11 + a22 * b21;
-  resultMat[6] = a00 * b02 + a01 * b12 + a02 * b22;
-  resultMat[7] = a10 * b02 + a11 * b12 + a12 * b22;
-  resultMat[8] = a20 * b02 + a21 * b12 + a22 * b22;
-  return resultMat;
-};
-
-
-/**
- * Transposes the given matrix mat storing the result into resultMat.
- *
- * @param {goog.vec.Mat3.AnyType} mat The matrix to transpose.
- * @param {goog.vec.Mat3.AnyType} resultMat The matrix to receive
- *     the results (may be mat).
- * @return {!goog.vec.Mat3.AnyType} return resultMat so that operations can be
- *     chained together.
- */
-goog.vec.Mat3.transpose = function(mat, resultMat) {
-  if (resultMat == mat) {
-    var a10 = mat[1], a20 = mat[2], a21 = mat[5];
-    resultMat[1] = mat[3];
-    resultMat[2] = mat[6];
-    resultMat[3] = a10;
-    resultMat[5] = mat[7];
-    resultMat[6] = a20;
-    resultMat[7] = a21;
-  } else {
-    resultMat[0] = mat[0];
-    resultMat[1] = mat[3];
-    resultMat[2] = mat[6];
-    resultMat[3] = mat[1];
-    resultMat[4] = mat[4];
-    resultMat[5] = mat[7];
-    resultMat[6] = mat[2];
-    resultMat[7] = mat[5];
-    resultMat[8] = mat[8];
-  }
-  return resultMat;
-};
-
-
-/**
- * Computes the inverse of mat0 storing the result into resultMat. If the
- * inverse is defined, this function returns true, false otherwise.
- *
- * @param {goog.vec.Mat3.AnyType} mat0 The matrix to invert.
- * @param {goog.vec.Mat3.AnyType} resultMat The matrix to receive
- *     the result (may be mat0).
- * @return {boolean} True if the inverse is defined. If false is returned,
- *     resultMat is not modified.
- */
-goog.vec.Mat3.invert = function(mat0, resultMat) {
-  var a00 = mat0[0], a10 = mat0[1], a20 = mat0[2];
-  var a01 = mat0[3], a11 = mat0[4], a21 = mat0[5];
-  var a02 = mat0[6], a12 = mat0[7], a22 = mat0[8];
-
-  var t00 = a11 * a22 - a12 * a21;
-  var t10 = a12 * a20 - a10 * a22;
-  var t20 = a10 * a21 - a11 * a20;
-  var det = a00 * t00 + a01 * t10 + a02 * t20;
-  if (det == 0) {
-    return false;
-  }
-
-  var idet = 1 / det;
-  resultMat[0] = t00 * idet;
-  resultMat[3] = (a02 * a21 - a01 * a22) * idet;
-  resultMat[6] = (a01 * a12 - a02 * a11) * idet;
-
-  resultMat[1] = t10 * idet;
-  resultMat[4] = (a00 * a22 - a02 * a20) * idet;
-  resultMat[7] = (a02 * a10 - a00 * a12) * idet;
-
-  resultMat[2] = t20 * idet;
-  resultMat[5] = (a01 * a20 - a00 * a21) * idet;
-  resultMat[8] = (a00 * a11 - a01 * a10) * idet;
-  return true;
-};
-
-
-/**
- * Returns true if the components of mat0 are equal to the components of mat1.
- *
- * @param {goog.vec.Mat3.AnyType} mat0 The first matrix.
- * @param {goog.vec.Mat3.AnyType} mat1 The second matrix.
- * @return {boolean} True if the the two matrices are equivalent.
- */
-goog.vec.Mat3.equals = function(mat0, mat1) {
-  return mat0.length == mat1.length &&
-      mat0[0] == mat1[0] && mat0[1] == mat1[1] && mat0[2] == mat1[2] &&
-      mat0[3] == mat1[3] && mat0[4] == mat1[4] && mat0[5] == mat1[5] &&
-      mat0[6] == mat1[6] && mat0[7] == mat1[7] && mat0[8] == mat1[8];
-};
-
-
-/**
- * Transforms the given vector with the given matrix storing the resulting,
- * transformed matrix into resultVec.
- *
- * @param {!goog.vec.Mat3.AnyType} mat The matrix supplying the transformation.
- * @param {goog.vec.Vec3.AnyType} vec The vector to transform.
- * @param {goog.vec.Vec3.AnyType} resultVec The vector to
- *     receive the results (may be vec).
- * @return {!goog.vec.Vec3.AnyType} return resultVec so that operations can be
- *     chained together.
- */
-goog.vec.Mat3.multVec3 = function(mat, vec, resultVec) {
-  var x = vec[0], y = vec[1], z = vec[2];
-  resultVec[0] = x * mat[0] + y * mat[3] + z * mat[6];
-  resultVec[1] = x * mat[1] + y * mat[4] + z * mat[7];
-  resultVec[2] = x * mat[2] + y * mat[5] + z * mat[8];
-  return resultVec;
-};
-
-
-/**
- * Makes the given 3x3 matrix a translation matrix with x and y
- * translation values.
- *
- * @param {!goog.vec.Mat3.AnyType} mat The matrix.
- * @param {number} x The translation along the x axis.
- * @param {number} y The translation along the y axis.
- * @return {!goog.vec.Mat3.AnyType} return mat so that operations can be
- *     chained.
- */
-goog.vec.Mat3.makeTranslate = function(mat, x, y) {
-  goog.vec.Mat3.makeIdentity(mat);
-  goog.vec.Mat3.setColumnValues(mat, 2, x, y, 1);
-  return mat;
-};
-
-
-/**
- * Makes the given 3x3 matrix a scale matrix with x, y, and z scale factors.
- *
- * @param {!goog.vec.Mat3.AnyType} mat The 3x3 (9-element) matrix
- *     array to receive the new scale matrix.
- * @param {number} x The scale along the x axis.
- * @param {number} y The scale along the y axis.
- * @param {number} z The scale along the z axis.
- * @return {!goog.vec.Mat3.AnyType} return mat so that operations can be
- *     chained.
- */
-goog.vec.Mat3.makeScale = function(mat, x, y, z) {
-  goog.vec.Mat3.makeIdentity(mat);
-  goog.vec.Mat3.setDiagonalValues(mat, x, y, z);
-  return mat;
-};
-
-
-/**
- * Makes the given 3x3 matrix a rotation matrix with the given rotation
- * angle about the axis defined by the vector (ax, ay, az).
- *
- * @param {!goog.vec.Mat3.AnyType} mat The matrix.
- * @param {number} angle The rotation angle in radians.
- * @param {number} ax The x component of the rotation axis.
- * @param {number} ay The y component of the rotation axis.
- * @param {number} az The z component of the rotation axis.
- * @return {!goog.vec.Mat3.AnyType} return mat so that operations can be
- *     chained.
- */
-goog.vec.Mat3.makeRotate = function(mat, angle, ax, ay, az) {
-  var c = Math.cos(angle);
-  var d = 1 - c;
-  var s = Math.sin(angle);
-
-  goog.vec.Mat3.setFromValues(mat,
-      ax * ax * d + c,
-      ax * ay * d + az * s,
-      ax * az * d - ay * s,
-
-      ax * ay * d - az * s,
-      ay * ay * d + c,
-      ay * az * d + ax * s,
-
-      ax * az * d + ay * s,
-      ay * az * d - ax * s,
-      az * az * d + c);
-  return mat;
-};

+ 0 - 1615
support/client/lib/closure/vec/mat4.js

@@ -1,1615 +0,0 @@
-// Copyright 2011 The Closure Library Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS-IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-/**
- * @fileoverview Implements 4x4 matrices and their related functions which are
- * compatible with WebGL. The API is structured to avoid unnecessary memory
- * allocations.  The last parameter will typically be the output vector and
- * an object can be both an input and output parameter to all methods except
- * where noted. Matrix operations follow the mathematical form when multiplying
- * vectors as follows: resultVec = matrix * vec.
- *
- */
-goog.provide('goog.vec.Mat4');
-
-goog.require('goog.vec');
-goog.require('goog.vec.Vec3');
-goog.require('goog.vec.Vec4');
-
-
-/** @typedef {goog.vec.Float32} */ goog.vec.Mat4.Float32;
-/** @typedef {goog.vec.Float64} */ goog.vec.Mat4.Float64;
-/** @typedef {goog.vec.Number} */ goog.vec.Mat4.Number;
-/** @typedef {goog.vec.AnyType} */ goog.vec.Mat4.AnyType;
-
-// The following two types are deprecated - use the above types instead.
-/** @typedef {Float32Array} */ goog.vec.Mat4.Type;
-/** @typedef {goog.vec.ArrayType} */ goog.vec.Mat4.Mat4Like;
-
-
-/**
- * Creates the array representation of a 4x4 matrix of Float32.
- * The use of the array directly instead of a class reduces overhead.
- * The returned matrix is cleared to all zeros.
- *
- * @return {!goog.vec.Mat4.Float32} The new matrix.
- */
-goog.vec.Mat4.createFloat32 = function() {
-  return new Float32Array(16);
-};
-
-
-/**
- * Creates the array representation of a 4x4 matrix of Float64.
- * The returned matrix is cleared to all zeros.
- *
- * @return {!goog.vec.Mat4.Float64} The new matrix.
- */
-goog.vec.Mat4.createFloat64 = function() {
-  return new Float64Array(16);
-};
-
-
-/**
- * Creates the array representation of a 4x4 matrix of Number.
- * The returned matrix is cleared to all zeros.
- *
- * @return {!goog.vec.Mat4.Number} The new matrix.
- */
-goog.vec.Mat4.createNumber = function() {
-  var a = new Array(16);
-  goog.vec.Mat4.setFromValues(a,
-                              0, 0, 0, 0,
-                              0, 0, 0, 0,
-                              0, 0, 0, 0,
-                              0, 0, 0, 0);
-  return a;
-};
-
-
-/**
- * Creates the array representation of a 4x4 matrix of Float32.
- * The returned matrix is cleared to all zeros.
- *
- * @deprecated Use createFloat32.
- * @return {!goog.vec.Mat4.Type} The new matrix.
- */
-goog.vec.Mat4.create = function() {
-  return goog.vec.Mat4.createFloat32();
-};
-
-
-/**
- * Creates a 4x4 identity matrix of Float32.
- *
- * @return {!goog.vec.Mat4.Float32} The new 16 element array.
- */
-goog.vec.Mat4.createFloat32Identity = function() {
-  var mat = goog.vec.Mat4.createFloat32();
-  mat[0] = mat[5] = mat[10] = mat[15] = 1;
-  return mat;
-};
-
-
-/**
- * Creates a 4x4 identity matrix of Float64.
- *
- * @return {!goog.vec.Mat4.Float64} The new 16 element array.
- */
-goog.vec.Mat4.createFloat64Identity = function() {
-  var mat = goog.vec.Mat4.createFloat64();
-  mat[0] = mat[5] = mat[10] = mat[15] = 1;
-  return mat;
-};
-
-
-/**
- * Creates a 4x4 identity matrix of Number.
- * The returned matrix is cleared to all zeros.
- *
- * @return {!goog.vec.Mat4.Number} The new 16 element array.
- */
-goog.vec.Mat4.createNumberIdentity = function() {
-  var a = new Array(16);
-  goog.vec.Mat4.setFromValues(a,
-                              1, 0, 0, 0,
-                              0, 1, 0, 0,
-                              0, 0, 1, 0,
-                              0, 0, 0, 1);
-  return a;
-};
-
-
-/**
- * Creates the array representation of a 4x4 matrix of Float32.
- * The returned matrix is cleared to all zeros.
- *
- * @deprecated Use createFloat32Identity.
- * @return {!goog.vec.Mat4.Type} The new 16 element array.
- */
-goog.vec.Mat4.createIdentity = function() {
-  return goog.vec.Mat4.createFloat32Identity();
-};
-
-
-/**
- * Creates a 4x4 matrix of Float32 initialized from the given array.
- *
- * @param {goog.vec.Mat4.AnyType} matrix The array containing the
- *     matrix values in column major order.
- * @return {!goog.vec.Mat4.Float32} The new, 16 element array.
- */
-goog.vec.Mat4.createFloat32FromArray = function(matrix) {
-  var newMatrix = goog.vec.Mat4.createFloat32();
-  goog.vec.Mat4.setFromArray(newMatrix, matrix);
-  return newMatrix;
-};
-
-
-/**
- * Creates a 4x4 matrix of Float32 initialized from the given values.
- *
- * @param {number} v00 The values at (0, 0).
- * @param {number} v10 The values at (1, 0).
- * @param {number} v20 The values at (2, 0).
- * @param {number} v30 The values at (3, 0).
- * @param {number} v01 The values at (0, 1).
- * @param {number} v11 The values at (1, 1).
- * @param {number} v21 The values at (2, 1).
- * @param {number} v31 The values at (3, 1).
- * @param {number} v02 The values at (0, 2).
- * @param {number} v12 The values at (1, 2).
- * @param {number} v22 The values at (2, 2).
- * @param {number} v32 The values at (3, 2).
- * @param {number} v03 The values at (0, 3).
- * @param {number} v13 The values at (1, 3).
- * @param {number} v23 The values at (2, 3).
- * @param {number} v33 The values at (3, 3).
- * @return {!goog.vec.Mat4.Float32} The new, 16 element array.
- */
-goog.vec.Mat4.createFloat32FromValues = function(
-    v00, v10, v20, v30,
-    v01, v11, v21, v31,
-    v02, v12, v22, v32,
-    v03, v13, v23, v33) {
-  var newMatrix = goog.vec.Mat4.createFloat32();
-  goog.vec.Mat4.setFromValues(
-      newMatrix, v00, v10, v20, v30, v01, v11, v21, v31, v02, v12, v22, v32,
-      v03, v13, v23, v33);
-  return newMatrix;
-};
-
-
-/**
- * Creates a clone of a 4x4 matrix of Float32.
- *
- * @param {goog.vec.Mat4.Float32} matrix The source 4x4 matrix.
- * @return {!goog.vec.Mat4.Float32} The new 4x4 element matrix.
- */
-goog.vec.Mat4.cloneFloat32 = goog.vec.Mat4.createFloat32FromArray;
-
-
-/**
- * Creates a 4x4 matrix of Float64 initialized from the given array.
- *
- * @param {goog.vec.Mat4.AnyType} matrix The array containing the
- *     matrix values in column major order.
- * @return {!goog.vec.Mat4.Float64} The new, nine element array.
- */
-goog.vec.Mat4.createFloat64FromArray = function(matrix) {
-  var newMatrix = goog.vec.Mat4.createFloat64();
-  goog.vec.Mat4.setFromArray(newMatrix, matrix);
-  return newMatrix;
-};
-
-
-/**
- * Creates a 4x4 matrix of Float64 initialized from the given values.
- *
- * @param {number} v00 The values at (0, 0).
- * @param {number} v10 The values at (1, 0).
- * @param {number} v20 The values at (2, 0).
- * @param {number} v30 The values at (3, 0).
- * @param {number} v01 The values at (0, 1).
- * @param {number} v11 The values at (1, 1).
- * @param {number} v21 The values at (2, 1).
- * @param {number} v31 The values at (3, 1).
- * @param {number} v02 The values at (0, 2).
- * @param {number} v12 The values at (1, 2).
- * @param {number} v22 The values at (2, 2).
- * @param {number} v32 The values at (3, 2).
- * @param {number} v03 The values at (0, 3).
- * @param {number} v13 The values at (1, 3).
- * @param {number} v23 The values at (2, 3).
- * @param {number} v33 The values at (3, 3).
- * @return {!goog.vec.Mat4.Float64} The new, 16 element array.
- */
-goog.vec.Mat4.createFloat64FromValues = function(
-    v00, v10, v20, v30,
-    v01, v11, v21, v31,
-    v02, v12, v22, v32,
-    v03, v13, v23, v33) {
-  var newMatrix = goog.vec.Mat4.createFloat64();
-  goog.vec.Mat4.setFromValues(
-      newMatrix, v00, v10, v20, v30, v01, v11, v21, v31, v02, v12, v22, v32,
-      v03, v13, v23, v33);
-  return newMatrix;
-};
-
-
-/**
- * Creates a clone of a 4x4 matrix of Float64.
- *
- * @param {goog.vec.Mat4.Float64} matrix The source 4x4 matrix.
- * @return {!goog.vec.Mat4.Float64} The new 4x4 element matrix.
- */
-goog.vec.Mat4.cloneFloat64 = goog.vec.Mat4.createFloat64FromArray;
-
-
-/**
- * Creates a 4x4 matrix of Float32 initialized from the given array.
- *
- * @deprecated Use createFloat32FromArray.
- * @param {goog.vec.Mat4.Mat4Like} matrix The array containing the
- *     matrix values in column major order.
- * @return {!goog.vec.Mat4.Type} The new, nine element array.
- */
-goog.vec.Mat4.createFromArray = function(matrix) {
-  var newMatrix = goog.vec.Mat4.createFloat32();
-  goog.vec.Mat4.setFromArray(newMatrix, matrix);
-  return newMatrix;
-};
-
-
-/**
- * Creates a 4x4 matrix of Float32 initialized from the given values.
- *
- * @deprecated Use createFloat32FromValues.
- * @param {number} v00 The values at (0, 0).
- * @param {number} v10 The values at (1, 0).
- * @param {number} v20 The values at (2, 0).
- * @param {number} v30 The values at (3, 0).
- * @param {number} v01 The values at (0, 1).
- * @param {number} v11 The values at (1, 1).
- * @param {number} v21 The values at (2, 1).
- * @param {number} v31 The values at (3, 1).
- * @param {number} v02 The values at (0, 2).
- * @param {number} v12 The values at (1, 2).
- * @param {number} v22 The values at (2, 2).
- * @param {number} v32 The values at (3, 2).
- * @param {number} v03 The values at (0, 3).
- * @param {number} v13 The values at (1, 3).
- * @param {number} v23 The values at (2, 3).
- * @param {number} v33 The values at (3, 3).
- * @return {!goog.vec.Mat4.Type} The new, 16 element array.
- */
-goog.vec.Mat4.createFromValues = function(
-    v00, v10, v20, v30,
-    v01, v11, v21, v31,
-    v02, v12, v22, v32,
-    v03, v13, v23, v33) {
-  return goog.vec.Mat4.createFloat32FromValues(
-      v00, v10, v20, v30, v01, v11, v21, v31, v02, v12, v22, v32,
-      v03, v13, v23, v33);
-};
-
-
-/**
- * Creates a clone of a 4x4 matrix of Float32.
- *
- * @deprecated Use cloneFloat32.
- * @param {goog.vec.Mat4.Mat4Like} matrix The source 4x4 matrix.
- * @return {!goog.vec.Mat4.Type} The new 4x4 element matrix.
- */
-goog.vec.Mat4.clone = goog.vec.Mat4.createFromArray;
-
-
-/**
- * Retrieves the element at the requested row and column.
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix containing the
- *     value to retrieve.
- * @param {number} row The row index.
- * @param {number} column The column index.
- * @return {number} The element value at the requested row, column indices.
- */
-goog.vec.Mat4.getElement = function(mat, row, column) {
-  return mat[row + column * 4];
-};
-
-
-/**
- * Sets the element at the requested row and column.
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix to set the value on.
- * @param {number} row The row index.
- * @param {number} column The column index.
- * @param {number} value The value to set at the requested row, column.
- */
-goog.vec.Mat4.setElement = function(mat, row, column, value) {
-  mat[row + column * 4] = value;
-};
-
-
-/**
- * Initializes the matrix from the set of values. Note the values supplied are
- * in column major order.
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix to receive the
- *     values.
- * @param {number} v00 The values at (0, 0).
- * @param {number} v10 The values at (1, 0).
- * @param {number} v20 The values at (2, 0).
- * @param {number} v30 The values at (3, 0).
- * @param {number} v01 The values at (0, 1).
- * @param {number} v11 The values at (1, 1).
- * @param {number} v21 The values at (2, 1).
- * @param {number} v31 The values at (3, 1).
- * @param {number} v02 The values at (0, 2).
- * @param {number} v12 The values at (1, 2).
- * @param {number} v22 The values at (2, 2).
- * @param {number} v32 The values at (3, 2).
- * @param {number} v03 The values at (0, 3).
- * @param {number} v13 The values at (1, 3).
- * @param {number} v23 The values at (2, 3).
- * @param {number} v33 The values at (3, 3).
- */
-goog.vec.Mat4.setFromValues = function(
-    mat, v00, v10, v20, v30, v01, v11, v21, v31, v02, v12, v22, v32,
-    v03, v13, v23, v33) {
-  mat[0] = v00;
-  mat[1] = v10;
-  mat[2] = v20;
-  mat[3] = v30;
-  mat[4] = v01;
-  mat[5] = v11;
-  mat[6] = v21;
-  mat[7] = v31;
-  mat[8] = v02;
-  mat[9] = v12;
-  mat[10] = v22;
-  mat[11] = v32;
-  mat[12] = v03;
-  mat[13] = v13;
-  mat[14] = v23;
-  mat[15] = v33;
-};
-
-
-/**
- * Sets the matrix from the array of values stored in column major order.
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix to receive the values.
- * @param {goog.vec.Mat4.AnyType} values The column major ordered
- *     array of values to store in the matrix.
- */
-goog.vec.Mat4.setFromArray = function(mat, values) {
-  mat[0] = values[0];
-  mat[1] = values[1];
-  mat[2] = values[2];
-  mat[3] = values[3];
-  mat[4] = values[4];
-  mat[5] = values[5];
-  mat[6] = values[6];
-  mat[7] = values[7];
-  mat[8] = values[8];
-  mat[9] = values[9];
-  mat[10] = values[10];
-  mat[11] = values[11];
-  mat[12] = values[12];
-  mat[13] = values[13];
-  mat[14] = values[14];
-  mat[15] = values[15];
-};
-
-
-/**
- * Sets the matrix from the array of values stored in row major order.
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix to receive the values.
- * @param {goog.vec.Mat4.AnyType} values The row major ordered array of
- *     values to store in the matrix.
- */
-goog.vec.Mat4.setFromRowMajorArray = function(mat, values) {
-  mat[0] = values[0];
-  mat[1] = values[4];
-  mat[2] = values[8];
-  mat[3] = values[12];
-
-  mat[4] = values[1];
-  mat[5] = values[5];
-  mat[6] = values[9];
-  mat[7] = values[13];
-
-  mat[8] = values[2];
-  mat[9] = values[6];
-  mat[10] = values[10];
-  mat[11] = values[14];
-
-  mat[12] = values[3];
-  mat[13] = values[7];
-  mat[14] = values[11];
-  mat[15] = values[15];
-};
-
-
-/**
- * Sets the diagonal values of the matrix from the given values.
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix to receive the values.
- * @param {number} v00 The values for (0, 0).
- * @param {number} v11 The values for (1, 1).
- * @param {number} v22 The values for (2, 2).
- * @param {number} v33 The values for (3, 3).
- */
-goog.vec.Mat4.setDiagonalValues = function(mat, v00, v11, v22, v33) {
-  mat[0] = v00;
-  mat[5] = v11;
-  mat[10] = v22;
-  mat[15] = v33;
-};
-
-
-/**
- * Sets the diagonal values of the matrix from the given vector.
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix to receive the values.
- * @param {goog.vec.Vec4.AnyType} vec The vector containing the values.
- */
-goog.vec.Mat4.setDiagonal = function(mat, vec) {
-  mat[0] = vec[0];
-  mat[5] = vec[1];
-  mat[10] = vec[2];
-  mat[15] = vec[3];
-};
-
-
-/**
- * Gets the diagonal values of the matrix into the given vector.
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix containing the values.
- * @param {goog.vec.Vec4.AnyType} vec The vector to receive the values.
- * @param {number=} opt_diagonal Which diagonal to get. A value of 0 selects the
- *     main diagonal, a positive number selects a super diagonal and a negative
- *     number selects a sub diagonal.
- */
-goog.vec.Mat4.getDiagonal = function(mat, vec, opt_diagonal) {
-  if (!opt_diagonal) {
-    // This is the most common case, so we avoid the for loop.
-    vec[0] = mat[0];
-    vec[1] = mat[5];
-    vec[2] = mat[10];
-    vec[3] = mat[15];
-  } else {
-    var offset = opt_diagonal > 0 ? 4 * opt_diagonal : -opt_diagonal;
-    for (var i = 0; i < 4 - Math.abs(opt_diagonal); i++) {
-      vec[i] = mat[offset + 5 * i];
-    }
-  }
-};
-
-
-/**
- * Sets the specified column with the supplied values.
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix to recieve the values.
- * @param {number} column The column index to set the values on.
- * @param {number} v0 The value for row 0.
- * @param {number} v1 The value for row 1.
- * @param {number} v2 The value for row 2.
- * @param {number} v3 The value for row 3.
- */
-goog.vec.Mat4.setColumnValues = function(mat, column, v0, v1, v2, v3) {
-  var i = column * 4;
-  mat[i] = v0;
-  mat[i + 1] = v1;
-  mat[i + 2] = v2;
-  mat[i + 3] = v3;
-};
-
-
-/**
- * Sets the specified column with the value from the supplied vector.
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix to receive the values.
- * @param {number} column The column index to set the values on.
- * @param {goog.vec.Vec4.AnyType} vec The vector of elements for the column.
- */
-goog.vec.Mat4.setColumn = function(mat, column, vec) {
-  var i = column * 4;
-  mat[i] = vec[0];
-  mat[i + 1] = vec[1];
-  mat[i + 2] = vec[2];
-  mat[i + 3] = vec[3];
-};
-
-
-/**
- * Retrieves the specified column from the matrix into the given vector.
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix supplying the values.
- * @param {number} column The column to get the values from.
- * @param {goog.vec.Vec4.AnyType} vec The vector of elements to
- *     receive the column.
- */
-goog.vec.Mat4.getColumn = function(mat, column, vec) {
-  var i = column * 4;
-  vec[0] = mat[i];
-  vec[1] = mat[i + 1];
-  vec[2] = mat[i + 2];
-  vec[3] = mat[i + 3];
-};
-
-
-/**
- * Sets the columns of the matrix from the given vectors.
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix to receive the values.
- * @param {goog.vec.Vec4.AnyType} vec0 The values for column 0.
- * @param {goog.vec.Vec4.AnyType} vec1 The values for column 1.
- * @param {goog.vec.Vec4.AnyType} vec2 The values for column 2.
- * @param {goog.vec.Vec4.AnyType} vec3 The values for column 3.
- */
-goog.vec.Mat4.setColumns = function(mat, vec0, vec1, vec2, vec3) {
-  goog.vec.Mat4.setColumn(mat, 0, vec0);
-  goog.vec.Mat4.setColumn(mat, 1, vec1);
-  goog.vec.Mat4.setColumn(mat, 2, vec2);
-  goog.vec.Mat4.setColumn(mat, 3, vec3);
-};
-
-
-/**
- * Retrieves the column values from the given matrix into the given vectors.
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix supplying the columns.
- * @param {goog.vec.Vec4.AnyType} vec0 The vector to receive column 0.
- * @param {goog.vec.Vec4.AnyType} vec1 The vector to receive column 1.
- * @param {goog.vec.Vec4.AnyType} vec2 The vector to receive column 2.
- * @param {goog.vec.Vec4.AnyType} vec3 The vector to receive column 3.
- */
-goog.vec.Mat4.getColumns = function(mat, vec0, vec1, vec2, vec3) {
-  goog.vec.Mat4.getColumn(mat, 0, vec0);
-  goog.vec.Mat4.getColumn(mat, 1, vec1);
-  goog.vec.Mat4.getColumn(mat, 2, vec2);
-  goog.vec.Mat4.getColumn(mat, 3, vec3);
-};
-
-
-/**
- * Sets the row values from the supplied values.
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix to receive the values.
- * @param {number} row The index of the row to receive the values.
- * @param {number} v0 The value for column 0.
- * @param {number} v1 The value for column 1.
- * @param {number} v2 The value for column 2.
- * @param {number} v3 The value for column 3.
- */
-goog.vec.Mat4.setRowValues = function(mat, row, v0, v1, v2, v3) {
-  mat[row] = v0;
-  mat[row + 4] = v1;
-  mat[row + 8] = v2;
-  mat[row + 12] = v3;
-};
-
-
-/**
- * Sets the row values from the supplied vector.
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix to receive the row values.
- * @param {number} row The index of the row.
- * @param {goog.vec.Vec4.AnyType} vec The vector containing the values.
- */
-goog.vec.Mat4.setRow = function(mat, row, vec) {
-  mat[row] = vec[0];
-  mat[row + 4] = vec[1];
-  mat[row + 8] = vec[2];
-  mat[row + 12] = vec[3];
-};
-
-
-/**
- * Retrieves the row values into the given vector.
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix supplying the values.
- * @param {number} row The index of the row supplying the values.
- * @param {goog.vec.Vec4.AnyType} vec The vector to receive the row.
- */
-goog.vec.Mat4.getRow = function(mat, row, vec) {
-  vec[0] = mat[row];
-  vec[1] = mat[row + 4];
-  vec[2] = mat[row + 8];
-  vec[3] = mat[row + 12];
-};
-
-
-/**
- * Sets the rows of the matrix from the supplied vectors.
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix to receive the values.
- * @param {goog.vec.Vec4.AnyType} vec0 The values for row 0.
- * @param {goog.vec.Vec4.AnyType} vec1 The values for row 1.
- * @param {goog.vec.Vec4.AnyType} vec2 The values for row 2.
- * @param {goog.vec.Vec4.AnyType} vec3 The values for row 3.
- */
-goog.vec.Mat4.setRows = function(mat, vec0, vec1, vec2, vec3) {
-  goog.vec.Mat4.setRow(mat, 0, vec0);
-  goog.vec.Mat4.setRow(mat, 1, vec1);
-  goog.vec.Mat4.setRow(mat, 2, vec2);
-  goog.vec.Mat4.setRow(mat, 3, vec3);
-};
-
-
-/**
- * Retrieves the rows of the matrix into the supplied vectors.
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix to supply the values.
- * @param {goog.vec.Vec4.AnyType} vec0 The vector to receive row 0.
- * @param {goog.vec.Vec4.AnyType} vec1 The vector to receive row 1.
- * @param {goog.vec.Vec4.AnyType} vec2 The vector to receive row 2.
- * @param {goog.vec.Vec4.AnyType} vec3 The vector to receive row 3.
- */
-goog.vec.Mat4.getRows = function(mat, vec0, vec1, vec2, vec3) {
-  goog.vec.Mat4.getRow(mat, 0, vec0);
-  goog.vec.Mat4.getRow(mat, 1, vec1);
-  goog.vec.Mat4.getRow(mat, 2, vec2);
-  goog.vec.Mat4.getRow(mat, 3, vec3);
-};
-
-
-/**
- * Makes the given 4x4 matrix the zero matrix.
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix.
- * @return {!goog.vec.Mat4.AnyType} return mat so operations can be chained.
- */
-goog.vec.Mat4.makeZero = function(mat) {
-  mat[0] = 0;
-  mat[1] = 0;
-  mat[2] = 0;
-  mat[3] = 0;
-  mat[4] = 0;
-  mat[5] = 0;
-  mat[6] = 0;
-  mat[7] = 0;
-  mat[8] = 0;
-  mat[9] = 0;
-  mat[10] = 0;
-  mat[11] = 0;
-  mat[12] = 0;
-  mat[13] = 0;
-  mat[14] = 0;
-  mat[15] = 0;
-  return mat;
-};
-
-
-/**
- * Makes the given 4x4 matrix the identity matrix.
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix.
- * @return {!goog.vec.Mat4.AnyType} return mat so operations can be chained.
- */
-goog.vec.Mat4.makeIdentity = function(mat) {
-  mat[0] = 1;
-  mat[1] = 0;
-  mat[2] = 0;
-  mat[3] = 0;
-  mat[4] = 0;
-  mat[5] = 1;
-  mat[6] = 0;
-  mat[7] = 0;
-  mat[8] = 0;
-  mat[9] = 0;
-  mat[10] = 1;
-  mat[11] = 0;
-  mat[12] = 0;
-  mat[13] = 0;
-  mat[14] = 0;
-  mat[15] = 1;
-  return mat;
-};
-
-
-/**
- * Performs a per-component addition of the matrix mat0 and mat1, storing
- * the result into resultMat.
- *
- * @param {goog.vec.Mat4.AnyType} mat0 The first addend.
- * @param {goog.vec.Mat4.AnyType} mat1 The second addend.
- * @param {goog.vec.Mat4.AnyType} resultMat The matrix to
- *     receive the results (may be either mat0 or mat1).
- * @return {!goog.vec.Mat4.AnyType} return resultMat so that operations can be
- *     chained together.
- */
-goog.vec.Mat4.addMat = function(mat0, mat1, resultMat) {
-  resultMat[0] = mat0[0] + mat1[0];
-  resultMat[1] = mat0[1] + mat1[1];
-  resultMat[2] = mat0[2] + mat1[2];
-  resultMat[3] = mat0[3] + mat1[3];
-  resultMat[4] = mat0[4] + mat1[4];
-  resultMat[5] = mat0[5] + mat1[5];
-  resultMat[6] = mat0[6] + mat1[6];
-  resultMat[7] = mat0[7] + mat1[7];
-  resultMat[8] = mat0[8] + mat1[8];
-  resultMat[9] = mat0[9] + mat1[9];
-  resultMat[10] = mat0[10] + mat1[10];
-  resultMat[11] = mat0[11] + mat1[11];
-  resultMat[12] = mat0[12] + mat1[12];
-  resultMat[13] = mat0[13] + mat1[13];
-  resultMat[14] = mat0[14] + mat1[14];
-  resultMat[15] = mat0[15] + mat1[15];
-  return resultMat;
-};
-
-
-/**
- * Performs a per-component subtraction of the matrix mat0 and mat1,
- * storing the result into resultMat.
- *
- * @param {goog.vec.Mat4.AnyType} mat0 The minuend.
- * @param {goog.vec.Mat4.AnyType} mat1 The subtrahend.
- * @param {goog.vec.Mat4.AnyType} resultMat The matrix to receive
- *     the results (may be either mat0 or mat1).
- * @return {!goog.vec.Mat4.AnyType} return resultMat so that operations can be
- *     chained together.
- */
-goog.vec.Mat4.subMat = function(mat0, mat1, resultMat) {
-  resultMat[0] = mat0[0] - mat1[0];
-  resultMat[1] = mat0[1] - mat1[1];
-  resultMat[2] = mat0[2] - mat1[2];
-  resultMat[3] = mat0[3] - mat1[3];
-  resultMat[4] = mat0[4] - mat1[4];
-  resultMat[5] = mat0[5] - mat1[5];
-  resultMat[6] = mat0[6] - mat1[6];
-  resultMat[7] = mat0[7] - mat1[7];
-  resultMat[8] = mat0[8] - mat1[8];
-  resultMat[9] = mat0[9] - mat1[9];
-  resultMat[10] = mat0[10] - mat1[10];
-  resultMat[11] = mat0[11] - mat1[11];
-  resultMat[12] = mat0[12] - mat1[12];
-  resultMat[13] = mat0[13] - mat1[13];
-  resultMat[14] = mat0[14] - mat1[14];
-  resultMat[15] = mat0[15] - mat1[15];
-  return resultMat;
-};
-
-
-/**
- * Multiplies matrix mat with the given scalar, storing the result
- * into resultMat.
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix.
- * @param {number} scalar The scalar value to multiply to each element of mat.
- * @param {goog.vec.Mat4.AnyType} resultMat The matrix to receive
- *     the results (may be mat).
- * @return {!goog.vec.Mat4.AnyType} return resultMat so that operations can be
- *     chained together.
- */
-goog.vec.Mat4.multScalar = function(mat, scalar, resultMat) {
-  resultMat[0] = mat[0] * scalar;
-  resultMat[1] = mat[1] * scalar;
-  resultMat[2] = mat[2] * scalar;
-  resultMat[3] = mat[3] * scalar;
-  resultMat[4] = mat[4] * scalar;
-  resultMat[5] = mat[5] * scalar;
-  resultMat[6] = mat[6] * scalar;
-  resultMat[7] = mat[7] * scalar;
-  resultMat[8] = mat[8] * scalar;
-  resultMat[9] = mat[9] * scalar;
-  resultMat[10] = mat[10] * scalar;
-  resultMat[11] = mat[11] * scalar;
-  resultMat[12] = mat[12] * scalar;
-  resultMat[13] = mat[13] * scalar;
-  resultMat[14] = mat[14] * scalar;
-  resultMat[15] = mat[15] * scalar;
-  return resultMat;
-};
-
-
-/**
- * Multiplies the two matrices mat0 and mat1 using matrix multiplication,
- * storing the result into resultMat.
- *
- * @param {goog.vec.Mat4.AnyType} mat0 The first (left hand) matrix.
- * @param {goog.vec.Mat4.AnyType} mat1 The second (right hand) matrix.
- * @param {goog.vec.Mat4.AnyType} resultMat The matrix to receive
- *     the results (may be either mat0 or mat1).
- * @return {!goog.vec.Mat4.AnyType} return resultMat so that operations can be
- *     chained together.
- */
-goog.vec.Mat4.multMat = function(mat0, mat1, resultMat) {
-  var a00 = mat0[0], a10 = mat0[1], a20 = mat0[2], a30 = mat0[3];
-  var a01 = mat0[4], a11 = mat0[5], a21 = mat0[6], a31 = mat0[7];
-  var a02 = mat0[8], a12 = mat0[9], a22 = mat0[10], a32 = mat0[11];
-  var a03 = mat0[12], a13 = mat0[13], a23 = mat0[14], a33 = mat0[15];
-
-  var b00 = mat1[0], b10 = mat1[1], b20 = mat1[2], b30 = mat1[3];
-  var b01 = mat1[4], b11 = mat1[5], b21 = mat1[6], b31 = mat1[7];
-  var b02 = mat1[8], b12 = mat1[9], b22 = mat1[10], b32 = mat1[11];
-  var b03 = mat1[12], b13 = mat1[13], b23 = mat1[14], b33 = mat1[15];
-
-  resultMat[0] = a00 * b00 + a01 * b10 + a02 * b20 + a03 * b30;
-  resultMat[1] = a10 * b00 + a11 * b10 + a12 * b20 + a13 * b30;
-  resultMat[2] = a20 * b00 + a21 * b10 + a22 * b20 + a23 * b30;
-  resultMat[3] = a30 * b00 + a31 * b10 + a32 * b20 + a33 * b30;
-
-  resultMat[4] = a00 * b01 + a01 * b11 + a02 * b21 + a03 * b31;
-  resultMat[5] = a10 * b01 + a11 * b11 + a12 * b21 + a13 * b31;
-  resultMat[6] = a20 * b01 + a21 * b11 + a22 * b21 + a23 * b31;
-  resultMat[7] = a30 * b01 + a31 * b11 + a32 * b21 + a33 * b31;
-
-  resultMat[8] = a00 * b02 + a01 * b12 + a02 * b22 + a03 * b32;
-  resultMat[9] = a10 * b02 + a11 * b12 + a12 * b22 + a13 * b32;
-  resultMat[10] = a20 * b02 + a21 * b12 + a22 * b22 + a23 * b32;
-  resultMat[11] = a30 * b02 + a31 * b12 + a32 * b22 + a33 * b32;
-
-  resultMat[12] = a00 * b03 + a01 * b13 + a02 * b23 + a03 * b33;
-  resultMat[13] = a10 * b03 + a11 * b13 + a12 * b23 + a13 * b33;
-  resultMat[14] = a20 * b03 + a21 * b13 + a22 * b23 + a23 * b33;
-  resultMat[15] = a30 * b03 + a31 * b13 + a32 * b23 + a33 * b33;
-  return resultMat;
-};
-
-
-/**
- * Transposes the given matrix mat storing the result into resultMat.
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix to transpose.
- * @param {goog.vec.Mat4.AnyType} resultMat The matrix to receive
- *     the results (may be mat).
- * @return {!goog.vec.Mat4.AnyType} return resultMat so that operations can be
- *     chained together.
- */
-goog.vec.Mat4.transpose = function(mat, resultMat) {
-  if (resultMat == mat) {
-    var a10 = mat[1], a20 = mat[2], a30 = mat[3];
-    var a21 = mat[6], a31 = mat[7];
-    var a32 = mat[11];
-    resultMat[1] = mat[4];
-    resultMat[2] = mat[8];
-    resultMat[3] = mat[12];
-    resultMat[4] = a10;
-    resultMat[6] = mat[9];
-    resultMat[7] = mat[13];
-    resultMat[8] = a20;
-    resultMat[9] = a21;
-    resultMat[11] = mat[14];
-    resultMat[12] = a30;
-    resultMat[13] = a31;
-    resultMat[14] = a32;
-  } else {
-    resultMat[0] = mat[0];
-    resultMat[1] = mat[4];
-    resultMat[2] = mat[8];
-    resultMat[3] = mat[12];
-
-    resultMat[4] = mat[1];
-    resultMat[5] = mat[5];
-    resultMat[6] = mat[9];
-    resultMat[7] = mat[13];
-
-    resultMat[8] = mat[2];
-    resultMat[9] = mat[6];
-    resultMat[10] = mat[10];
-    resultMat[11] = mat[14];
-
-    resultMat[12] = mat[3];
-    resultMat[13] = mat[7];
-    resultMat[14] = mat[11];
-    resultMat[15] = mat[15];
-  }
-  return resultMat;
-};
-
-
-/**
- * Computes the determinant of the matrix.
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix to compute the matrix for.
- * @return {number} The determinant of the matrix.
- */
-goog.vec.Mat4.determinant = function(mat) {
-  var m00 = mat[0], m10 = mat[1], m20 = mat[2], m30 = mat[3];
-  var m01 = mat[4], m11 = mat[5], m21 = mat[6], m31 = mat[7];
-  var m02 = mat[8], m12 = mat[9], m22 = mat[10], m32 = mat[11];
-  var m03 = mat[12], m13 = mat[13], m23 = mat[14], m33 = mat[15];
-
-  var a0 = m00 * m11 - m10 * m01;
-  var a1 = m00 * m21 - m20 * m01;
-  var a2 = m00 * m31 - m30 * m01;
-  var a3 = m10 * m21 - m20 * m11;
-  var a4 = m10 * m31 - m30 * m11;
-  var a5 = m20 * m31 - m30 * m21;
-  var b0 = m02 * m13 - m12 * m03;
-  var b1 = m02 * m23 - m22 * m03;
-  var b2 = m02 * m33 - m32 * m03;
-  var b3 = m12 * m23 - m22 * m13;
-  var b4 = m12 * m33 - m32 * m13;
-  var b5 = m22 * m33 - m32 * m23;
-
-  return a0 * b5 - a1 * b4 + a2 * b3 + a3 * b2 - a4 * b1 + a5 * b0;
-};
-
-
-/**
- * Computes the inverse of mat storing the result into resultMat. If the
- * inverse is defined, this function returns true, false otherwise.
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix to invert.
- * @param {goog.vec.Mat4.AnyType} resultMat The matrix to receive
- *     the result (may be mat).
- * @return {boolean} True if the inverse is defined. If false is returned,
- *     resultMat is not modified.
- */
-goog.vec.Mat4.invert = function(mat, resultMat) {
-  var m00 = mat[0], m10 = mat[1], m20 = mat[2], m30 = mat[3];
-  var m01 = mat[4], m11 = mat[5], m21 = mat[6], m31 = mat[7];
-  var m02 = mat[8], m12 = mat[9], m22 = mat[10], m32 = mat[11];
-  var m03 = mat[12], m13 = mat[13], m23 = mat[14], m33 = mat[15];
-
-  var a0 = m00 * m11 - m10 * m01;
-  var a1 = m00 * m21 - m20 * m01;
-  var a2 = m00 * m31 - m30 * m01;
-  var a3 = m10 * m21 - m20 * m11;
-  var a4 = m10 * m31 - m30 * m11;
-  var a5 = m20 * m31 - m30 * m21;
-  var b0 = m02 * m13 - m12 * m03;
-  var b1 = m02 * m23 - m22 * m03;
-  var b2 = m02 * m33 - m32 * m03;
-  var b3 = m12 * m23 - m22 * m13;
-  var b4 = m12 * m33 - m32 * m13;
-  var b5 = m22 * m33 - m32 * m23;
-
-  var det = a0 * b5 - a1 * b4 + a2 * b3 + a3 * b2 - a4 * b1 + a5 * b0;
-  if (det == 0) {
-    return false;
-  }
-
-  var idet = 1.0 / det;
-  resultMat[0] = (m11 * b5 - m21 * b4 + m31 * b3) * idet;
-  resultMat[1] = (-m10 * b5 + m20 * b4 - m30 * b3) * idet;
-  resultMat[2] = (m13 * a5 - m23 * a4 + m33 * a3) * idet;
-  resultMat[3] = (-m12 * a5 + m22 * a4 - m32 * a3) * idet;
-  resultMat[4] = (-m01 * b5 + m21 * b2 - m31 * b1) * idet;
-  resultMat[5] = (m00 * b5 - m20 * b2 + m30 * b1) * idet;
-  resultMat[6] = (-m03 * a5 + m23 * a2 - m33 * a1) * idet;
-  resultMat[7] = (m02 * a5 - m22 * a2 + m32 * a1) * idet;
-  resultMat[8] = (m01 * b4 - m11 * b2 + m31 * b0) * idet;
-  resultMat[9] = (-m00 * b4 + m10 * b2 - m30 * b0) * idet;
-  resultMat[10] = (m03 * a4 - m13 * a2 + m33 * a0) * idet;
-  resultMat[11] = (-m02 * a4 + m12 * a2 - m32 * a0) * idet;
-  resultMat[12] = (-m01 * b3 + m11 * b1 - m21 * b0) * idet;
-  resultMat[13] = (m00 * b3 - m10 * b1 + m20 * b0) * idet;
-  resultMat[14] = (-m03 * a3 + m13 * a1 - m23 * a0) * idet;
-  resultMat[15] = (m02 * a3 - m12 * a1 + m22 * a0) * idet;
-  return true;
-};
-
-
-/**
- * Returns true if the components of mat0 are equal to the components of mat1.
- *
- * @param {goog.vec.Mat4.AnyType} mat0 The first matrix.
- * @param {goog.vec.Mat4.AnyType} mat1 The second matrix.
- * @return {boolean} True if the the two matrices are equivalent.
- */
-goog.vec.Mat4.equals = function(mat0, mat1) {
-  return mat0.length == mat1.length &&
-      mat0[0] == mat1[0] &&
-      mat0[1] == mat1[1] &&
-      mat0[2] == mat1[2] &&
-      mat0[3] == mat1[3] &&
-      mat0[4] == mat1[4] &&
-      mat0[5] == mat1[5] &&
-      mat0[6] == mat1[6] &&
-      mat0[7] == mat1[7] &&
-      mat0[8] == mat1[8] &&
-      mat0[9] == mat1[9] &&
-      mat0[10] == mat1[10] &&
-      mat0[11] == mat1[11] &&
-      mat0[12] == mat1[12] &&
-      mat0[13] == mat1[13] &&
-      mat0[14] == mat1[14] &&
-      mat0[15] == mat1[15];
-};
-
-
-/**
- * Transforms the given vector with the given matrix storing the resulting,
- * transformed vector into resultVec. The input vector is multiplied against the
- * upper 3x4 matrix omitting the projective component.
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix supplying the transformation.
- * @param {goog.vec.Vec3.AnyType} vec The 3 element vector to transform.
- * @param {goog.vec.Vec3.AnyType} resultVec The 3 element vector to
- *     receive the results (may be vec).
- * @return {!goog.vec.Vec3.AnyType} return resultVec so that operations can be
- *     chained together.
- */
-goog.vec.Mat4.multVec3 = function(mat, vec, resultVec) {
-  var x = vec[0], y = vec[1], z = vec[2];
-  resultVec[0] = x * mat[0] + y * mat[4] + z * mat[8] + mat[12];
-  resultVec[1] = x * mat[1] + y * mat[5] + z * mat[9] + mat[13];
-  resultVec[2] = x * mat[2] + y * mat[6] + z * mat[10] + mat[14];
-  return resultVec;
-};
-
-
-/**
- * Transforms the given vector with the given matrix storing the resulting,
- * transformed vector into resultVec. The input vector is multiplied against the
- * upper 3x3 matrix omitting the projective component and translation
- * components.
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix supplying the transformation.
- * @param {goog.vec.Vec3.AnyType} vec The 3 element vector to transform.
- * @param {goog.vec.Vec3.AnyType} resultVec The 3 element vector to
- *     receive the results (may be vec).
- * @return {!goog.vec.Vec3.AnyType} return resultVec so that operations can be
- *     chained together.
- */
-goog.vec.Mat4.multVec3NoTranslate = function(mat, vec, resultVec) {
-  var x = vec[0], y = vec[1], z = vec[2];
-  resultVec[0] = x * mat[0] + y * mat[4] + z * mat[8];
-  resultVec[1] = x * mat[1] + y * mat[5] + z * mat[9];
-  resultVec[2] = x * mat[2] + y * mat[6] + z * mat[10];
-  return resultVec;
-};
-
-
-/**
- * Transforms the given vector with the given matrix storing the resulting,
- * transformed vector into resultVec. The input vector is multiplied against the
- * full 4x4 matrix with the homogeneous divide applied to reduce the 4 element
- * vector to a 3 element vector.
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix supplying the transformation.
- * @param {goog.vec.Vec3.AnyType} vec The 3 element vector to transform.
- * @param {goog.vec.Vec3.AnyType} resultVec The 3 element vector
- *     to receive the results (may be vec).
- * @return {!goog.vec.Vec3.AnyType} return resultVec so that operations can be
- *     chained together.
- */
-goog.vec.Mat4.multVec3Projective = function(mat, vec, resultVec) {
-  var x = vec[0], y = vec[1], z = vec[2];
-  var invw = 1 / (x * mat[3] + y * mat[7] + z * mat[11] + mat[15]);
-  resultVec[0] = (x * mat[0] + y * mat[4] + z * mat[8] + mat[12]) * invw;
-  resultVec[1] = (x * mat[1] + y * mat[5] + z * mat[9] + mat[13]) * invw;
-  resultVec[2] = (x * mat[2] + y * mat[6] + z * mat[10] + mat[14]) * invw;
-  return resultVec;
-};
-
-
-/**
- * Transforms the given vector with the given matrix storing the resulting,
- * transformed vector into resultVec.
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix supplying the transformation.
- * @param {goog.vec.Vec4.AnyType} vec The vector to transform.
- * @param {goog.vec.Vec4.AnyType} resultVec The vector to
- *     receive the results (may be vec).
- * @return {!goog.vec.Vec4.AnyType} return resultVec so that operations can be
- *     chained together.
- */
-goog.vec.Mat4.multVec4 = function(mat, vec, resultVec) {
-  var x = vec[0], y = vec[1], z = vec[2], w = vec[3];
-  resultVec[0] = x * mat[0] + y * mat[4] + z * mat[8] + w * mat[12];
-  resultVec[1] = x * mat[1] + y * mat[5] + z * mat[9] + w * mat[13];
-  resultVec[2] = x * mat[2] + y * mat[6] + z * mat[10] + w * mat[14];
-  resultVec[3] = x * mat[3] + y * mat[7] + z * mat[11] + w * mat[15];
-  return resultVec;
-};
-
-
-/**
- * Makes the given 4x4 matrix a translation matrix with x, y and z
- * translation factors.
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix.
- * @param {number} x The translation along the x axis.
- * @param {number} y The translation along the y axis.
- * @param {number} z The translation along the z axis.
- * @return {goog.vec.Mat4.AnyType} return mat so that operations can be
- *     chained.
- */
-goog.vec.Mat4.makeTranslate = function(mat, x, y, z) {
-  goog.vec.Mat4.makeIdentity(mat);
-  goog.vec.Mat4.setColumnValues(mat, 3, x, y, z, 1);
-  return mat;
-};
-
-
-/**
- * Makes the given 4x4 matrix as a scale matrix with x, y and z scale factors.
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix.
- * @param {number} x The scale along the x axis.
- * @param {number} y The scale along the y axis.
- * @param {number} z The scale along the z axis.
- * @return {goog.vec.Mat4.AnyType} return mat so that operations can be
- *     chained.
- */
-goog.vec.Mat4.makeScale = function(mat, x, y, z) {
-  goog.vec.Mat4.makeIdentity(mat);
-  goog.vec.Mat4.setDiagonalValues(mat, x, y, z, 1);
-  return mat;
-};
-
-
-/**
- * Makes the given 4x4 matrix a rotation matrix with the given rotation
- * angle about the axis defined by the vector (ax, ay, az).
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix.
- * @param {number} angle The rotation angle in radians.
- * @param {number} ax The x component of the rotation axis.
- * @param {number} ay The y component of the rotation axis.
- * @param {number} az The z component of the rotation axis.
- * @return {goog.vec.Mat4.AnyType} return mat so that operations can be
- *     chained.
- */
-goog.vec.Mat4.makeRotate = function(mat, angle, ax, ay, az) {
-  var c = Math.cos(angle);
-  var d = 1 - c;
-  var s = Math.sin(angle);
-
-  goog.vec.Mat4.setFromValues(mat,
-      ax * ax * d + c,
-      ax * ay * d + az * s,
-      ax * az * d - ay * s,
-      0,
-
-      ax * ay * d - az * s,
-      ay * ay * d + c,
-      ay * az * d + ax * s,
-      0,
-
-      ax * az * d + ay * s,
-      ay * az * d - ax * s,
-      az * az * d + c,
-      0,
-
-      0, 0, 0, 1);
-  return mat;
-};
-
-
-/**
- * Makes the given 4x4 matrix a perspective projection matrix.
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix.
- * @param {number} left The coordinate of the left clipping plane.
- * @param {number} right The coordinate of the right clipping plane.
- * @param {number} bottom The coordinate of the bottom clipping plane.
- * @param {number} top The coordinate of the top clipping plane.
- * @param {number} near The distance to the near clipping plane.
- * @param {number} far The distance to the far clipping plane.
- * @return {goog.vec.Mat4.AnyType} return mat so that operations can be
- *     chained.
- */
-goog.vec.Mat4.makeFrustum = function(mat, left, right, bottom, top, near, far) {
-  var x = (2 * near) / (right - left);
-  var y = (2 * near) / (top - bottom);
-  var a = (right + left) / (right - left);
-  var b = (top + bottom) / (top - bottom);
-  var c = -(far + near) / (far - near);
-  var d = -(2 * far * near) / (far - near);
-
-  goog.vec.Mat4.setFromValues(mat,
-      x, 0, 0, 0,
-      0, y, 0, 0,
-      a, b, c, -1,
-      0, 0, d, 0
-  );
-  return mat;
-};
-
-
-/**
- * Makse the given 4x4 matrix  perspective projection matrix given a
- * field of view and aspect ratio.
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix.
- * @param {number} fovy The field of view along the y (vertical) axis in
- *     radians.
- * @param {number} aspect The x (width) to y (height) aspect ratio.
- * @param {number} near The distance to the near clipping plane.
- * @param {number} far The distance to the far clipping plane.
- * @return {goog.vec.Mat4.AnyType} return mat so that operations can be
- *     chained.
- */
-goog.vec.Mat4.makePerspective = function(mat, fovy, aspect, near, far) {
-  var angle = fovy / 2;
-  var dz = far - near;
-  var sinAngle = Math.sin(angle);
-  if (dz == 0 || sinAngle == 0 || aspect == 0) {
-    return /** @type {!goog.vec.Mat4.AnyType} */ (mat);
-  }
-
-  var cot = Math.cos(angle) / sinAngle;
-  goog.vec.Mat4.setFromValues(mat,
-      cot / aspect, 0, 0, 0,
-      0, cot, 0, 0,
-      0, 0, -(far + near) / dz, -1,
-      0, 0, -(2 * near * far) / dz, 0
-  );
-  return /** @type {!goog.vec.Mat4.AnyType} */ (mat);
-};
-
-
-/**
- * Makes the given 4x4 matrix an orthographic projection matrix.
- *
- * @param {!goog.vec.Mat4.AnyType} mat The matrix.
- * @param {number} left The coordinate of the left clipping plane.
- * @param {number} right The coordinate of the right clipping plane.
- * @param {number} bottom The coordinate of the bottom clipping plane.
- * @param {number} top The coordinate of the top clipping plane.
- * @param {number} near The distance to the near clipping plane.
- * @param {number} far The distance to the far clipping plane.
- * @return {!goog.vec.Mat4.AnyType} return mat so that operations can be
- *     chained.
- */
-goog.vec.Mat4.makeOrtho = function(mat, left, right, bottom, top, near, far) {
-  var x = 2 / (right - left);
-  var y = 2 / (top - bottom);
-  var z = -2 / (far - near);
-  var a = -(right + left) / (right - left);
-  var b = -(top + bottom) / (top - bottom);
-  var c = -(far + near) / (far - near);
-
-  goog.vec.Mat4.setFromValues(mat,
-      x, 0, 0, 0,
-      0, y, 0, 0,
-      0, 0, z, 0,
-      a, b, c, 1
-  );
-  return /** @type {!goog.vec.Mat4.AnyType} */ (mat);
-};
-
-
-/**
- * Makes the given 4x4 matrix a modelview matrix of a camera so that
- * the camera is 'looking at' the given center point.
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix.
- * @param {goog.vec.Vec3.AnyType} eyePt The position of the eye point
- *     (camera origin).
- * @param {goog.vec.Vec3.AnyType} centerPt The point to aim the camera at.
- * @param {goog.vec.Vec3.AnyType} worldUpVec The vector that identifies
- *     the up direction for the camera.
- * @return {goog.vec.Mat4.AnyType} return mat so that operations can be
- *     chained.
- */
-goog.vec.Mat4.makeLookAt = function(mat, eyePt, centerPt, worldUpVec) {
-  // Compute the direction vector from the eye point to the center point and
-  // normalize.
-  var fwdVec = goog.vec.Mat4.tmpVec4_[0];
-  goog.vec.Vec3.subtract(centerPt, eyePt, fwdVec);
-  goog.vec.Vec3.normalize(fwdVec, fwdVec);
-  fwdVec[3] = 0;
-
-  // Compute the side vector from the forward vector and the input up vector.
-  var sideVec = goog.vec.Mat4.tmpVec4_[1];
-  goog.vec.Vec3.cross(fwdVec, worldUpVec, sideVec);
-  goog.vec.Vec3.normalize(sideVec, sideVec);
-  sideVec[3] = 0;
-
-  // Now the up vector to form the orthonormal basis.
-  var upVec = goog.vec.Mat4.tmpVec4_[2];
-  goog.vec.Vec3.cross(sideVec, fwdVec, upVec);
-  goog.vec.Vec3.normalize(upVec, upVec);
-  upVec[3] = 0;
-
-  // Update the view matrix with the new orthonormal basis and position the
-  // camera at the given eye point.
-  goog.vec.Vec3.negate(fwdVec, fwdVec);
-  goog.vec.Mat4.setRow(mat, 0, sideVec);
-  goog.vec.Mat4.setRow(mat, 1, upVec);
-  goog.vec.Mat4.setRow(mat, 2, fwdVec);
-  goog.vec.Mat4.setRowValues(mat, 3, 0, 0, 0, 1);
-  goog.vec.Mat4.translate(
-      mat, -eyePt[0], -eyePt[1], -eyePt[2]);
-
-  return mat;
-};
-
-
-/**
- * Decomposes a matrix into the lookAt vectors eyePt, fwdVec and worldUpVec.
- * The matrix represents the modelview matrix of a camera. It is the inverse
- * of lookAt except for the output of the fwdVec instead of centerPt.
- * The centerPt itself cannot be recovered from a modelview matrix.
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix.
- * @param {goog.vec.Vec3.AnyType} eyePt The position of the eye point
- *     (camera origin).
- * @param {goog.vec.Vec3.AnyType} fwdVec The vector describing where
- *     the camera points to.
- * @param {goog.vec.Vec3.AnyType} worldUpVec The vector that
- *     identifies the up direction for the camera.
- * @return {boolean} True if the method succeeds, false otherwise.
- *     The method can only fail if the inverse of viewMatrix is not defined.
- */
-goog.vec.Mat4.toLookAt = function(mat, eyePt, fwdVec, worldUpVec) {
-  // Get eye of the camera.
-  var matInverse = goog.vec.Mat4.tmpMat4_[0];
-  if (!goog.vec.Mat4.invert(mat, matInverse)) {
-    // The input matrix does not have a valid inverse.
-    return false;
-  }
-
-  if (eyePt) {
-    eyePt[0] = matInverse[12];
-    eyePt[1] = matInverse[13];
-    eyePt[2] = matInverse[14];
-  }
-
-  // Get forward vector from the definition of lookAt.
-  if (fwdVec || worldUpVec) {
-    if (!fwdVec) {
-      fwdVec = goog.vec.Mat4.tmpVec3_[0];
-    }
-    fwdVec[0] = -mat[2];
-    fwdVec[1] = -mat[6];
-    fwdVec[2] = -mat[10];
-    // Normalize forward vector.
-    goog.vec.Vec3.normalize(fwdVec, fwdVec);
-  }
-
-  if (worldUpVec) {
-    // Get side vector from the definition of gluLookAt.
-    var side = goog.vec.Mat4.tmpVec3_[1];
-    side[0] = mat[0];
-    side[1] = mat[4];
-    side[2] = mat[8];
-    // Compute up vector as a up = side x forward.
-    goog.vec.Vec3.cross(side, fwdVec, worldUpVec);
-    // Normalize up vector.
-    goog.vec.Vec3.normalize(worldUpVec, worldUpVec);
-  }
-  return true;
-};
-
-
-/**
- * Makes the given 4x4 matrix a rotation matrix given Euler angles using
- * the ZXZ convention.
- * Given the euler angles [theta1, theta2, theta3], the rotation is defined as
- * rotation = rotation_z(theta1) * rotation_x(theta2) * rotation_z(theta3),
- * with theta1 in [0, 2 * pi], theta2 in [0, pi] and theta3 in [0, 2 * pi].
- * rotation_x(theta) means rotation around the X axis of theta radians,
- *
- * @param {!goog.vec.Mat4.AnyType} mat The matrix.
- * @param {number} theta1 The angle of rotation around the Z axis in radians.
- * @param {number} theta2 The angle of rotation around the X axis in radians.
- * @param {number} theta3 The angle of rotation around the Z axis in radians.
- * @return {!goog.vec.Mat4.AnyType} return mat so that operations can be
- *     chained.
- */
-goog.vec.Mat4.makeEulerZXZ = function(mat, theta1, theta2, theta3) {
-  var c1 = Math.cos(theta1);
-  var s1 = Math.sin(theta1);
-
-  var c2 = Math.cos(theta2);
-  var s2 = Math.sin(theta2);
-
-  var c3 = Math.cos(theta3);
-  var s3 = Math.sin(theta3);
-
-  mat[0] = c1 * c3 - c2 * s1 * s3;
-  mat[1] = c2 * c1 * s3 + c3 * s1;
-  mat[2] = s3 * s2;
-  mat[3] = 0;
-
-  mat[4] = -c1 * s3 - c3 * c2 * s1;
-  mat[5] = c1 * c2 * c3 - s1 * s3;
-  mat[6] = c3 * s2;
-  mat[7] = 0;
-
-  mat[8] = s2 * s1;
-  mat[9] = -c1 * s2;
-  mat[10] = c2;
-  mat[11] = 0;
-
-  mat[12] = 0;
-  mat[13] = 0;
-  mat[14] = 0;
-  mat[15] = 1;
-
-  return mat;
-};
-
-
-/**
- * Decomposes a rotation matrix into Euler angles using the ZXZ convention so
- * that rotation = rotation_z(theta1) * rotation_x(theta2) * rotation_z(theta3),
- * with theta1 in [0, 2 * pi], theta2 in [0, pi] and theta3 in [0, 2 * pi].
- * rotation_x(theta) means rotation around the X axis of theta radians.
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix.
- * @param {goog.vec.Mat4.AnyType} euler The ZXZ Euler angles in
- *     radians as [theta1, theta2, theta3].
- * @param {boolean=} opt_theta2IsNegative Whether theta2 is in [-pi, 0] instead
- *     of the default [0, pi].
- */
-goog.vec.Mat4.toEulerZXZ = function(mat, euler, opt_theta2IsNegative) {
-  // There is an ambiguity in the sign of sinTheta2 because of the sqrt.
-  var sinTheta2 = Math.sqrt(mat[2] * mat[2] + mat[6] * mat[6]);
-
-  // By default we explicitely constrain theta2 to be in [0, pi],
-  // so sinTheta2 is always positive. We can change the behavior and specify
-  // theta2 to be negative in [-pi, 0] with opt_Theta2IsNegative.
-  var signTheta2 = opt_theta2IsNegative ? -1 : 1;
-
-  if (sinTheta2 > goog.vec.EPSILON) {
-    euler[2] = Math.atan2(mat[2] * signTheta2, mat[6] * signTheta2);
-    euler[1] = Math.atan2(sinTheta2 * signTheta2, mat[10]);
-    euler[0] = Math.atan2(mat[8] * signTheta2, -mat[9] * signTheta2);
-  } else {
-    // There is also an arbitrary choice for roll = 0 or pan = 0 in this case.
-    // We assume roll = 0 as some applications do not allow the camera to roll.
-    euler[0] = 0;
-    euler[1] = Math.atan2(sinTheta2 * signTheta2, mat[10]);
-    euler[2] = Math.atan2(mat[1], mat[0]);
-  }
-
-  // Atan2 outputs angles in [-pi, pi] so we bring them back to [0, 2 * pi].
-  euler[0] = (euler[0] + Math.PI * 2) % (Math.PI * 2);
-  euler[2] = (euler[2] + Math.PI * 2) % (Math.PI * 2);
-  // For theta2 we want the angle to be in [0, pi] or [-pi, 0] depending on
-  // signTheta2.
-  euler[1] = ((euler[1] * signTheta2 + Math.PI * 2) % (Math.PI * 2)) *
-      signTheta2;
-};
-
-
-/**
- * Translates the given matrix by x,y,z.  Equvialent to:
- * goog.vec.Mat4.multMat(
- *     mat,
- *     goog.vec.Mat4.makeTranslate(goog.vec.Mat4.create(), x, y, z),
- *     mat);
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix.
- * @param {number} x The translation along the x axis.
- * @param {number} y The translation along the y axis.
- * @param {number} z The translation along the z axis.
- * @return {goog.vec.Mat4.AnyType} return mat so that operations can be
- *     chained.
- */
-goog.vec.Mat4.translate = function(mat, x, y, z) {
-  goog.vec.Mat4.setColumnValues(
-      mat, 3,
-      mat[0] * x + mat[4] * y + mat[8] * z + mat[12],
-      mat[1] * x + mat[5] * y + mat[9] * z + mat[13],
-      mat[2] * x + mat[6] * y + mat[10] * z + mat[14],
-      mat[3] * x + mat[7] * y + mat[11] * z + mat[15]);
-  return mat;
-};
-
-
-/**
- * Scales the given matrix by x,y,z.  Equivalent to:
- * goog.vec.Mat4.multMat(
- *     mat,
- *     goog.vec.Mat4.makeScale(goog.vec.Mat4.create(), x, y, z),
- *     mat);
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix.
- * @param {number} x The x scale factor.
- * @param {number} y The y scale factor.
- * @param {number} z The z scale factor.
- * @return {goog.vec.Mat4.AnyType} return mat so that operations can be
- *     chained.
- */
-goog.vec.Mat4.scale = function(mat, x, y, z) {
-  goog.vec.Mat4.setFromValues(
-      mat,
-      mat[0] * x, mat[1] * x, mat[2] * x, mat[3] * x,
-      mat[4] * y, mat[5] * y, mat[6] * y, mat[7] * y,
-      mat[8] * z, mat[9] * z, mat[10] * z, mat[11] * z,
-      mat[12], mat[13], mat[14], mat[15]);
-  return mat;
-};
-
-
-/**
- * Rotation the given matrix by angle about the x,y,z axis.  Equivalent to:
- * goog.vec.Mat4.multMat(
- *     mat,
- *     goog.vec.Mat4.makeRotate(goog.vec.Mat4.create(), angle, x, y, z),
- *     mat);
- *
- * @param {goog.vec.Mat4.AnyType} mat The matrix.
- * @param {number} angle The angle in radians.
- * @param {number} x The x component of the rotation axis.
- * @param {number} y The y component of the rotation axis.
- * @param {number} z The z component of the rotation axis.
- * @return {goog.vec.Mat4.AnyType} return mat so that operations can be
- *     chained.
- */
-goog.vec.Mat4.rotate = function(mat, angle, x, y, z) {
-  var m00 = mat[0], m10 = mat[1], m20 = mat[2], m30 = mat[3];
-  var m01 = mat[4], m11 = mat[5], m21 = mat[6], m31 = mat[7];
-  var m02 = mat[8], m12 = mat[9], m22 = mat[10], m32 = mat[11];
-  var m03 = mat[12], m13 = mat[13], m23 = mat[14], m33 = mat[15];
-
-  var cosAngle = Math.cos(angle);
-  var sinAngle = Math.sin(angle);
-  var diffCosAngle = 1 - cosAngle;
-  var r00 = x * x * diffCosAngle + cosAngle;
-  var r10 = x * y * diffCosAngle + z * sinAngle;
-  var r20 = x * z * diffCosAngle - y * sinAngle;
-
-  var r01 = x * y * diffCosAngle - z * sinAngle;
-  var r11 = y * y * diffCosAngle + cosAngle;
-  var r21 = y * z * diffCosAngle + x * sinAngle;
-
-  var r02 = x * z * diffCosAngle + y * sinAngle;
-  var r12 = y * z * diffCosAngle - x * sinAngle;
-  var r22 = z * z * diffCosAngle + cosAngle;
-
-  goog.vec.Mat4.setFromValues(
-      mat,
-      m00 * r00 + m01 * r10 + m02 * r20,
-      m10 * r00 + m11 * r10 + m12 * r20,
-      m20 * r00 + m21 * r10 + m22 * r20,
-      m30 * r00 + m31 * r10 + m32 * r20,
-
-      m00 * r01 + m01 * r11 + m02 * r21,
-      m10 * r01 + m11 * r11 + m12 * r21,
-      m20 * r01 + m21 * r11 + m22 * r21,
-      m30 * r01 + m31 * r11 + m32 * r21,
-
-      m00 * r02 + m01 * r12 + m02 * r22,
-      m10 * r02 + m11 * r12 + m12 * r22,
-      m20 * r02 + m21 * r12 + m22 * r22,
-      m30 * r02 + m31 * r12 + m32 * r22,
-
-      m03, m13, m23, m33);
-
-  return mat;
-};
-
-
-/**
- * @type {Array.<goog.vec.Vec3.Type>}
- * @private
- */
-goog.vec.Mat4.tmpVec3_ = [
-  goog.vec.Vec3.createFloat64(),
-  goog.vec.Vec3.createFloat64()
-];
-
-
-/**
- * @type {Array.<goog.vec.Vec4.Type>}
- * @private
- */
-goog.vec.Mat4.tmpVec4_ = [
-  goog.vec.Vec4.createFloat64(),
-  goog.vec.Vec4.createFloat64(),
-  goog.vec.Vec4.createFloat64()
-];
-
-
-/**
- * @type {Array.<goog.vec.Mat4.Type>}
- * @private
- */
-goog.vec.Mat4.tmpMat4_ = [
-  goog.vec.Mat4.createFloat64()
-];

+ 0 - 722
support/client/lib/closure/vec/matrix3.js

@@ -1,722 +0,0 @@
-// Copyright 2011 The Closure Library Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS-IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-/**
- * @fileoverview WARNING: DEPRECATED.  Use Mat3 instead.
- * Implements 3x3 matrices and their related functions which are
- * compatible with WebGL. The API is structured to avoid unnecessary memory
- * allocations.  The last parameter will typically be the output vector and
- * an object can be both an input and output parameter to all methods except
- * where noted. Matrix operations follow the mathematical form when multiplying
- * vectors as follows: resultVec = matrix * vec.
- *
- */
-goog.provide('goog.vec.Matrix3');
-
-goog.require('goog.vec');
-
-
-/**
- * @typedef {goog.vec.ArrayType}
- */
-goog.vec.Matrix3.Type;
-
-
-/**
- * Creates the array representation of a 3x3 matrix. The use of the array
- * directly eliminates any overhead associated with the class representation
- * defined above. The returned matrix is cleared to all zeros.
- *
- * @return {goog.vec.Matrix3.Type} The new, nine element array.
- */
-goog.vec.Matrix3.create = function() {
-  return new Float32Array(9);
-};
-
-
-/**
- * Creates the array representation of a 3x3 matrix. The use of the array
- * directly eliminates any overhead associated with the class representation
- * defined above. The returned matrix is initialized with the identity.
- *
- * @return {goog.vec.Matrix3.Type} The new, nine element array.
- */
-goog.vec.Matrix3.createIdentity = function() {
-  var mat = goog.vec.Matrix3.create();
-  mat[0] = mat[4] = mat[8] = 1;
-  return mat;
-};
-
-
-/**
- * Creates a 3x3 matrix initialized from the given array.
- *
- * @param {goog.vec.ArrayType} matrix The array containing the
- *     matrix values in column major order.
- * @return {goog.vec.Matrix3.Type} The new, nine element array.
- */
-goog.vec.Matrix3.createFromArray = function(matrix) {
-  var newMatrix = goog.vec.Matrix3.create();
-  goog.vec.Matrix3.setFromArray(newMatrix, matrix);
-  return newMatrix;
-};
-
-
-/**
- * Creates a 3x3 matrix initialized from the given values.
- *
- * @param {number} v00 The values at (0, 0).
- * @param {number} v10 The values at (1, 0).
- * @param {number} v20 The values at (2, 0).
- * @param {number} v01 The values at (0, 1).
- * @param {number} v11 The values at (1, 1).
- * @param {number} v21 The values at (2, 1).
- * @param {number} v02 The values at (0, 2).
- * @param {number} v12 The values at (1, 2).
- * @param {number} v22 The values at (2, 2).
- * @return {goog.vec.Matrix3.Type} The new, nine element array.
- */
-goog.vec.Matrix3.createFromValues = function(
-    v00, v10, v20, v01, v11, v21, v02, v12, v22) {
-  var newMatrix = goog.vec.Matrix3.create();
-  goog.vec.Matrix3.setFromValues(
-      newMatrix, v00, v10, v20, v01, v11, v21, v02, v12, v22);
-  return newMatrix;
-};
-
-
-/**
- * Creates a clone of a 3x3 matrix.
- *
- * @param {goog.vec.Matrix3.Type} matrix The source 3x3 matrix.
- * @return {goog.vec.Matrix3.Type} The new 3x3 element matrix.
- */
-goog.vec.Matrix3.clone =
-    goog.vec.Matrix3.createFromArray;
-
-
-/**
- * Retrieves the element at the requested row and column.
- *
- * @param {goog.vec.ArrayType} mat The matrix containing the
- *     value to retrieve.
- * @param {number} row The row index.
- * @param {number} column The column index.
- * @return {number} The element value at the requested row, column indices.
- */
-goog.vec.Matrix3.getElement = function(mat, row, column) {
-  return mat[row + column * 3];
-};
-
-
-/**
- * Sets the element at the requested row and column.
- *
- * @param {goog.vec.ArrayType} mat The matrix containing the
- *     value to retrieve.
- * @param {number} row The row index.
- * @param {number} column The column index.
- * @param {number} value The value to set at the requested row, column.
- */
-goog.vec.Matrix3.setElement = function(mat, row, column, value) {
-  mat[row + column * 3] = value;
-};
-
-
-/**
- * Initializes the matrix from the set of values. Note the values supplied are
- * in column major order.
- *
- * @param {goog.vec.ArrayType} mat The matrix to receive the
- *     values.
- * @param {number} v00 The values at (0, 0).
- * @param {number} v10 The values at (1, 0).
- * @param {number} v20 The values at (2, 0).
- * @param {number} v01 The values at (0, 1).
- * @param {number} v11 The values at (1, 1).
- * @param {number} v21 The values at (2, 1).
- * @param {number} v02 The values at (0, 2).
- * @param {number} v12 The values at (1, 2).
- * @param {number} v22 The values at (2, 2).
- */
-goog.vec.Matrix3.setFromValues = function(
-    mat, v00, v10, v20, v01, v11, v21, v02, v12, v22) {
-  mat[0] = v00;
-  mat[1] = v10;
-  mat[2] = v20;
-  mat[3] = v01;
-  mat[4] = v11;
-  mat[5] = v21;
-  mat[6] = v02;
-  mat[7] = v12;
-  mat[8] = v22;
-};
-
-
-/**
- * Sets the matrix from the array of values stored in column major order.
- *
- * @param {goog.vec.ArrayType} mat The matrix to receive the
- *     values.
- * @param {goog.vec.ArrayType} values The column major ordered
- *     array of values to store in the matrix.
- */
-goog.vec.Matrix3.setFromArray = function(mat, values) {
-  mat[0] = values[0];
-  mat[1] = values[1];
-  mat[2] = values[2];
-  mat[3] = values[3];
-  mat[4] = values[4];
-  mat[5] = values[5];
-  mat[6] = values[6];
-  mat[7] = values[7];
-  mat[8] = values[8];
-};
-
-
-/**
- * Sets the matrix from the array of values stored in row major order.
- *
- * @param {goog.vec.ArrayType} mat The matrix to receive the
- *     values.
- * @param {goog.vec.ArrayType} values The row major ordered array
- *     of values to store in the matrix.
- */
-goog.vec.Matrix3.setFromRowMajorArray = function(mat, values) {
-  mat[0] = values[0];
-  mat[1] = values[3];
-  mat[2] = values[6];
-  mat[3] = values[1];
-  mat[4] = values[4];
-  mat[5] = values[7];
-  mat[6] = values[2];
-  mat[7] = values[5];
-  mat[8] = values[8];
-};
-
-
-/**
- * Sets the diagonal values of the matrix from the given values.
- *
- * @param {goog.vec.ArrayType} mat The matrix to receive the
- *     values.
- * @param {number} v00 The values for (0, 0).
- * @param {number} v11 The values for (1, 1).
- * @param {number} v22 The values for (2, 2).
- */
-goog.vec.Matrix3.setDiagonalValues = function(mat, v00, v11, v22) {
-  mat[0] = v00;
-  mat[4] = v11;
-  mat[8] = v22;
-};
-
-
-/**
- * Sets the diagonal values of the matrix from the given vector.
- *
- * @param {goog.vec.ArrayType} mat The matrix to receive the
- *     values.
- * @param {goog.vec.ArrayType} vec The vector containing the
- *     values.
- */
-goog.vec.Matrix3.setDiagonal = function(mat, vec) {
-  mat[0] = vec[0];
-  mat[4] = vec[1];
-  mat[8] = vec[2];
-};
-
-
-/**
- * Sets the specified column with the supplied values.
- *
- * @param {goog.vec.ArrayType} mat The matrix to recieve the
- *     values.
- * @param {number} column The column index to set the values on.
- * @param {number} v0 The value for row 0.
- * @param {number} v1 The value for row 1.
- * @param {number} v2 The value for row 2.
- */
-goog.vec.Matrix3.setColumnValues = function(
-    mat, column, v0, v1, v2) {
-  var i = column * 3;
-  mat[i] = v0;
-  mat[i + 1] = v1;
-  mat[i + 2] = v2;
-};
-
-
-/**
- * Sets the specified column with the value from the supplied array.
- *
- * @param {goog.vec.ArrayType} mat The matrix to receive the
- *     values.
- * @param {number} column The column index to set the values on.
- * @param {goog.vec.ArrayType} vec The vector elements for the
- *     column.
- */
-goog.vec.Matrix3.setColumn = function(mat, column, vec) {
-  var i = column * 3;
-  mat[i] = vec[0];
-  mat[i + 1] = vec[1];
-  mat[i + 2] = vec[2];
-};
-
-
-/**
- * Retrieves the specified column from the matrix into the given vector
- * array.
- *
- * @param {goog.vec.ArrayType} mat The matrix supplying the
- *     values.
- * @param {number} column The column to get the values from.
- * @param {goog.vec.ArrayType} vec The vector elements to receive
- *     the column.
- */
-goog.vec.Matrix3.getColumn = function(mat, column, vec) {
-  var i = column * 3;
-  vec[0] = mat[i];
-  vec[1] = mat[i + 1];
-  vec[2] = mat[i + 2];
-};
-
-
-/**
- * Sets the columns of the matrix from the set of vector elements.
- *
- * @param {goog.vec.ArrayType} mat The matrix to receive the
- *     values.
- * @param {goog.vec.ArrayType} vec0 The values for column 0.
- * @param {goog.vec.ArrayType} vec1 The values for column 1.
- * @param {goog.vec.ArrayType} vec2 The values for column 2.
- */
-goog.vec.Matrix3.setColumns = function(
-    mat, vec0, vec1, vec2) {
-  goog.vec.Matrix3.setColumn(mat, 0, vec0);
-  goog.vec.Matrix3.setColumn(mat, 1, vec1);
-  goog.vec.Matrix3.setColumn(mat, 2, vec2);
-};
-
-
-/**
- * Retrieves the column values from the given matrix into the given vector
- * elements.
- *
- * @param {goog.vec.ArrayType} mat The matrix containing the
- *     columns to retrieve.
- * @param {goog.vec.ArrayType} vec0 The vector elements to receive
- *     column 0.
- * @param {goog.vec.ArrayType} vec1 The vector elements to receive
- *     column 1.
- * @param {goog.vec.ArrayType} vec2 The vector elements to receive
- *     column 2.
- */
-goog.vec.Matrix3.getColumns = function(
-    mat, vec0, vec1, vec2) {
-  goog.vec.Matrix3.getColumn(mat, 0, vec0);
-  goog.vec.Matrix3.getColumn(mat, 1, vec1);
-  goog.vec.Matrix3.getColumn(mat, 2, vec2);
-};
-
-
-/**
- * Sets the row values from the supplied values.
- *
- * @param {goog.vec.ArrayType} mat The matrix to receive the
- *     values.
- * @param {number} row The index of the row to receive the values.
- * @param {number} v0 The value for column 0.
- * @param {number} v1 The value for column 1.
- * @param {number} v2 The value for column 2.
- */
-goog.vec.Matrix3.setRowValues = function(mat, row, v0, v1, v2) {
-  mat[row] = v0;
-  mat[row + 3] = v1;
-  mat[row + 6] = v2;
-};
-
-
-/**
- * Sets the row values from the supplied vector.
- *
- * @param {goog.vec.ArrayType} mat The matrix to receive the
- *     row values.
- * @param {number} row The index of the row.
- * @param {goog.vec.ArrayType} vec The vector containing the values.
- */
-goog.vec.Matrix3.setRow = function(mat, row, vec) {
-  mat[row] = vec[0];
-  mat[row + 3] = vec[1];
-  mat[row + 6] = vec[2];
-};
-
-
-/**
- * Retrieves the row values into the given vector.
- *
- * @param {goog.vec.ArrayType} mat The matrix supplying the
- *     values.
- * @param {number} row The index of the row supplying the values.
- * @param {goog.vec.ArrayType} vec The vector to receive the row.
- */
-goog.vec.Matrix3.getRow = function(mat, row, vec) {
-  vec[0] = mat[row];
-  vec[1] = mat[row + 3];
-  vec[2] = mat[row + 6];
-};
-
-
-/**
- * Sets the rows of the matrix from the supplied vectors.
- *
- * @param {goog.vec.ArrayType} mat The matrix to receive the
- *     values.
- * @param {goog.vec.ArrayType} vec0 The values for row 0.
- * @param {goog.vec.ArrayType} vec1 The values for row 1.
- * @param {goog.vec.ArrayType} vec2 The values for row 2.
- */
-goog.vec.Matrix3.setRows = function(
-    mat, vec0, vec1, vec2) {
-  goog.vec.Matrix3.setRow(mat, 0, vec0);
-  goog.vec.Matrix3.setRow(mat, 1, vec1);
-  goog.vec.Matrix3.setRow(mat, 2, vec2);
-};
-
-
-/**
- * Retrieves the rows of the matrix into the supplied vectors.
- *
- * @param {goog.vec.ArrayType} mat The matrix to supplying
- *     the values.
- * @param {goog.vec.ArrayType} vec0 The vector to receive row 0.
- * @param {goog.vec.ArrayType} vec1 The vector to receive row 1.
- * @param {goog.vec.ArrayType} vec2 The vector to receive row 2.
- */
-goog.vec.Matrix3.getRows = function(
-    mat, vec0, vec1, vec2) {
-  goog.vec.Matrix3.getRow(mat, 0, vec0);
-  goog.vec.Matrix3.getRow(mat, 1, vec1);
-  goog.vec.Matrix3.getRow(mat, 2, vec2);
-};
-
-
-/**
- * Clears the given matrix to zero.
- *
- * @param {goog.vec.ArrayType} mat The matrix to clear.
- */
-goog.vec.Matrix3.setZero = function(mat) {
-  mat[0] = 0;
-  mat[1] = 0;
-  mat[2] = 0;
-  mat[3] = 0;
-  mat[4] = 0;
-  mat[5] = 0;
-  mat[6] = 0;
-  mat[7] = 0;
-  mat[8] = 0;
-};
-
-
-/**
- * Sets the given matrix to the identity matrix.
- *
- * @param {goog.vec.ArrayType} mat The matrix to set.
- */
-goog.vec.Matrix3.setIdentity = function(mat) {
-  mat[0] = 1;
-  mat[1] = 0;
-  mat[2] = 0;
-  mat[3] = 0;
-  mat[4] = 1;
-  mat[5] = 0;
-  mat[6] = 0;
-  mat[7] = 0;
-  mat[8] = 1;
-};
-
-
-/**
- * Performs a per-component addition of the matrices mat0 and mat1, storing
- * the result into resultMat.
- *
- * @param {goog.vec.ArrayType} mat0 The first addend.
- * @param {goog.vec.ArrayType} mat1 The second addend.
- * @param {goog.vec.ArrayType} resultMat The matrix to
- *     receive the results (may be either mat0 or mat1).
- * @return {goog.vec.ArrayType} return resultMat so that operations can be
- *     chained together.
- */
-goog.vec.Matrix3.add = function(mat0, mat1, resultMat) {
-  resultMat[0] = mat0[0] + mat1[0];
-  resultMat[1] = mat0[1] + mat1[1];
-  resultMat[2] = mat0[2] + mat1[2];
-  resultMat[3] = mat0[3] + mat1[3];
-  resultMat[4] = mat0[4] + mat1[4];
-  resultMat[5] = mat0[5] + mat1[5];
-  resultMat[6] = mat0[6] + mat1[6];
-  resultMat[7] = mat0[7] + mat1[7];
-  resultMat[8] = mat0[8] + mat1[8];
-  return resultMat;
-};
-
-
-/**
- * Performs a per-component subtraction of the matrices mat0 and mat1,
- * storing the result into resultMat.
- *
- * @param {goog.vec.ArrayType} mat0 The minuend.
- * @param {goog.vec.ArrayType} mat1 The subtrahend.
- * @param {goog.vec.ArrayType} resultMat The matrix to receive
- *     the results (may be either mat0 or mat1).
- * @return {goog.vec.ArrayType} return resultMat so that operations can be
- *     chained together.
- */
-goog.vec.Matrix3.subtract = function(mat0, mat1, resultMat) {
-  resultMat[0] = mat0[0] - mat1[0];
-  resultMat[1] = mat0[1] - mat1[1];
-  resultMat[2] = mat0[2] - mat1[2];
-  resultMat[3] = mat0[3] - mat1[3];
-  resultMat[4] = mat0[4] - mat1[4];
-  resultMat[5] = mat0[5] - mat1[5];
-  resultMat[6] = mat0[6] - mat1[6];
-  resultMat[7] = mat0[7] - mat1[7];
-  resultMat[8] = mat0[8] - mat1[8];
-  return resultMat;
-};
-
-
-/**
- * Performs a component-wise multiplication of mat0 with the given scalar
- * storing the result into resultMat.
- *
- * @param {goog.vec.ArrayType} mat0 The matrix to scale.
- * @param {number} scalar The scalar value to multiple to each element of mat0.
- * @param {goog.vec.ArrayType} resultMat The matrix to receive
- *     the results (may be mat0).
- * @return {goog.vec.ArrayType} return resultMat so that operations can be
- *     chained together.
- */
-goog.vec.Matrix3.scale = function(mat0, scalar, resultMat) {
-  resultMat[0] = mat0[0] * scalar;
-  resultMat[1] = mat0[1] * scalar;
-  resultMat[2] = mat0[2] * scalar;
-  resultMat[3] = mat0[3] * scalar;
-  resultMat[4] = mat0[4] * scalar;
-  resultMat[5] = mat0[5] * scalar;
-  resultMat[6] = mat0[6] * scalar;
-  resultMat[7] = mat0[7] * scalar;
-  resultMat[8] = mat0[8] * scalar;
-  return resultMat;
-};
-
-
-/**
- * Multiplies the two matrices mat0 and mat1 using matrix multiplication,
- * storing the result into resultMat.
- *
- * @param {goog.vec.ArrayType} mat0 The first (left hand) matrix.
- * @param {goog.vec.ArrayType} mat1 The second (right hand)
- *     matrix.
- * @param {goog.vec.ArrayType} resultMat The matrix to receive
- *     the results (may be either mat0 or mat1).
- * @return {goog.vec.ArrayType} return resultMat so that operations can be
- *     chained together.
- */
-goog.vec.Matrix3.multMat = function(mat0, mat1, resultMat) {
-  var a00 = mat0[0], a10 = mat0[1], a20 = mat0[2];
-  var a01 = mat0[3], a11 = mat0[4], a21 = mat0[5];
-  var a02 = mat0[6], a12 = mat0[7], a22 = mat0[8];
-
-  var b00 = mat1[0], b10 = mat1[1], b20 = mat1[2];
-  var b01 = mat1[3], b11 = mat1[4], b21 = mat1[5];
-  var b02 = mat1[6], b12 = mat1[7], b22 = mat1[8];
-
-  resultMat[0] = a00 * b00 + a01 * b10 + a02 * b20;
-  resultMat[1] = a10 * b00 + a11 * b10 + a12 * b20;
-  resultMat[2] = a20 * b00 + a21 * b10 + a22 * b20;
-  resultMat[3] = a00 * b01 + a01 * b11 + a02 * b21;
-  resultMat[4] = a10 * b01 + a11 * b11 + a12 * b21;
-  resultMat[5] = a20 * b01 + a21 * b11 + a22 * b21;
-  resultMat[6] = a00 * b02 + a01 * b12 + a02 * b22;
-  resultMat[7] = a10 * b02 + a11 * b12 + a12 * b22;
-  resultMat[8] = a20 * b02 + a21 * b12 + a22 * b22;
-  return resultMat;
-};
-
-
-/**
- * Transposes the given matrix mat storing the result into resultMat.
- * @param {goog.vec.ArrayType} mat The matrix to transpose.
- * @param {goog.vec.ArrayType} resultMat The matrix to receive
- *     the results (may be mat).
- * @return {goog.vec.ArrayType} return resultMat so that operations can be
- *     chained together.
- */
-goog.vec.Matrix3.transpose = function(mat, resultMat) {
-  if (resultMat == mat) {
-    var a10 = mat[1], a20 = mat[2], a21 = mat[5];
-    resultMat[1] = mat[3];
-    resultMat[2] = mat[6];
-    resultMat[3] = a10;
-    resultMat[5] = mat[7];
-    resultMat[6] = a20;
-    resultMat[7] = a21;
-  } else {
-    resultMat[0] = mat[0];
-    resultMat[1] = mat[3];
-    resultMat[2] = mat[6];
-    resultMat[3] = mat[1];
-    resultMat[4] = mat[4];
-    resultMat[5] = mat[7];
-    resultMat[6] = mat[2];
-    resultMat[7] = mat[5];
-    resultMat[8] = mat[8];
-  }
-  return resultMat;
-};
-
-
-/**
- * Computes the inverse of mat0 storing the result into resultMat. If the
- * inverse is defined, this function returns true, false otherwise.
- * @param {goog.vec.ArrayType} mat0 The matrix to invert.
- * @param {goog.vec.ArrayType} resultMat The matrix to receive
- *     the result (may be mat0).
- * @return {boolean} True if the inverse is defined. If false is returned,
- *     resultMat is not modified.
- */
-goog.vec.Matrix3.invert = function(mat0, resultMat) {
-  var a00 = mat0[0], a10 = mat0[1], a20 = mat0[2];
-  var a01 = mat0[3], a11 = mat0[4], a21 = mat0[5];
-  var a02 = mat0[6], a12 = mat0[7], a22 = mat0[8];
-
-  var t00 = a11 * a22 - a12 * a21;
-  var t10 = a12 * a20 - a10 * a22;
-  var t20 = a10 * a21 - a11 * a20;
-  var det = a00 * t00 + a01 * t10 + a02 * t20;
-  if (det == 0) {
-    return false;
-  }
-
-  var idet = 1 / det;
-  resultMat[0] = t00 * idet;
-  resultMat[3] = (a02 * a21 - a01 * a22) * idet;
-  resultMat[6] = (a01 * a12 - a02 * a11) * idet;
-
-  resultMat[1] = t10 * idet;
-  resultMat[4] = (a00 * a22 - a02 * a20) * idet;
-  resultMat[7] = (a02 * a10 - a00 * a12) * idet;
-
-  resultMat[2] = t20 * idet;
-  resultMat[5] = (a01 * a20 - a00 * a21) * idet;
-  resultMat[8] = (a00 * a11 - a01 * a10) * idet;
-  return true;
-};
-
-
-/**
- * Returns true if the components of mat0 are equal to the components of mat1.
- *
- * @param {goog.vec.ArrayType} mat0 The first matrix.
- * @param {goog.vec.ArrayType} mat1 The second matrix.
- * @return {boolean} True if the the two matrices are equivalent.
- */
-goog.vec.Matrix3.equals = function(mat0, mat1) {
-  return mat0.length == mat1.length &&
-      mat0[0] == mat1[0] && mat0[1] == mat1[1] && mat0[2] == mat1[2] &&
-      mat0[3] == mat1[3] && mat0[4] == mat1[4] && mat0[5] == mat1[5] &&
-      mat0[6] == mat1[6] && mat0[7] == mat1[7] && mat0[8] == mat1[8];
-};
-
-
-/**
- * Transforms the given vector with the given matrix storing the resulting,
- * transformed matrix into resultVec.
- *
- * @param {goog.vec.ArrayType} mat The matrix supplying the
- *     transformation.
- * @param {goog.vec.ArrayType} vec The vector to transform.
- * @param {goog.vec.ArrayType} resultVec The vector to
- *     receive the results (may be vec).
- * @return {goog.vec.ArrayType} return resultVec so that operations can be
- *     chained together.
- */
-goog.vec.Matrix3.multVec3 = function(mat, vec, resultVec) {
-  var x = vec[0], y = vec[1], z = vec[2];
-  resultVec[0] = x * mat[0] + y * mat[3] + z * mat[6];
-  resultVec[1] = x * mat[1] + y * mat[4] + z * mat[7];
-  resultVec[2] = x * mat[2] + y * mat[5] + z * mat[8];
-  return resultVec;
-};
-
-
-/**
- * Initializes the given 3x3 matrix as a translation matrix with x and y
- * translation values.
- *
- * @param {goog.vec.ArrayType} mat The 3x3 (9-element) matrix
- *     array to receive the new translation matrix.
- * @param {number} x The translation along the x axis.
- * @param {number} y The translation along the y axis.
- */
-goog.vec.Matrix3.makeTranslate = function(mat, x, y) {
-  goog.vec.Matrix3.setIdentity(mat);
-  goog.vec.Matrix3.setColumnValues(mat, 2, x, y, 1);
-};
-
-
-/**
- * Initializes the given 3x3 matrix as a scale matrix with x, y and z scale
- * factors.
- * @param {goog.vec.ArrayType} mat The 3x3 (9-element) matrix
- *     array to receive the new scale matrix.
- * @param {number} x The scale along the x axis.
- * @param {number} y The scale along the y axis.
- * @param {number} z The scale along the z axis.
- */
-goog.vec.Matrix3.makeScale = function(mat, x, y, z) {
-  goog.vec.Matrix3.setIdentity(mat);
-  goog.vec.Matrix3.setDiagonalValues(mat, x, y, z);
-};
-
-
-/**
- * Initializes the given 3x3 matrix as a rotation matrix with the given rotation
- * angle about the axis defined by the vector (ax, ay, az).
- * @param {goog.vec.ArrayType} mat The 3x3 (9-element) matrix
- *     array to receive the new scale matrix.
- * @param {number} angle The rotation angle in radians.
- * @param {number} ax The x component of the rotation axis.
- * @param {number} ay The y component of the rotation axis.
- * @param {number} az The z component of the rotation axis.
- */
-goog.vec.Matrix3.makeAxisAngleRotate = function(
-    mat, angle, ax, ay, az) {
-  var c = Math.cos(angle);
-  var d = 1 - c;
-  var s = Math.sin(angle);
-
-  goog.vec.Matrix3.setFromValues(mat,
-      ax * ax * d + c,
-      ax * ay * d + az * s,
-      ax * az * d - ay * s,
-
-      ax * ay * d - az * s,
-      ay * ay * d + c,
-      ay * az * d + ax * s,
-
-      ax * az * d + ay * s,
-      ay * az * d - ax * s,
-      az * az * d + c);
-};

+ 0 - 1405
support/client/lib/closure/vec/matrix4.js

@@ -1,1405 +0,0 @@
-// Copyright 2011 The Closure Library Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS-IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-/**
- * @fileoverview WARNING: DEPRECATED.  Use Mat4 instead.
- * Implements 4x4 matrices and their related functions which are
- * compatible with WebGL. The API is structured to avoid unnecessary memory
- * allocations.  The last parameter will typically be the output vector and
- * an object can be both an input and output parameter to all methods except
- * where noted. Matrix operations follow the mathematical form when multiplying
- * vectors as follows: resultVec = matrix * vec.
- *
- */
-goog.provide('goog.vec.Matrix4');
-
-goog.require('goog.vec');
-goog.require('goog.vec.Vec3');
-goog.require('goog.vec.Vec4');
-
-
-/**
- * @typedef {goog.vec.ArrayType}
- */
-goog.vec.Matrix4.Type;
-
-
-/**
- * Creates the array representation of a 4x4 matrix. The use of the array
- * directly eliminates any overhead associated with the class representation
- * defined above. The returned matrix is cleared to all zeros.
- *
- * @return {goog.vec.Matrix4.Type} The new, sixteen element array.
- */
-goog.vec.Matrix4.create = function() {
-  return new Float32Array(16);
-};
-
-
-/**
- * Creates the array representation of a 4x4 matrix. The use of the array
- * directly eliminates any overhead associated with the class representation
- * defined above. The returned matrix is initialized with the identity
- *
- * @return {goog.vec.Matrix4.Type} The new, sixteen element array.
- */
-goog.vec.Matrix4.createIdentity = function() {
-  var mat = goog.vec.Matrix4.create();
-  mat[0] = mat[5] = mat[10] = mat[15] = 1;
-  return mat;
-};
-
-
-/**
- * Creates a 4x4 matrix initialized from the given array.
- *
- * @param {goog.vec.ArrayType} matrix The array containing the
- *     matrix values in column major order.
- * @return {goog.vec.Matrix4.Type} The new, 16 element array.
- */
-goog.vec.Matrix4.createFromArray = function(matrix) {
-  var newMatrix = goog.vec.Matrix4.create();
-  goog.vec.Matrix4.setFromArray(newMatrix, matrix);
-  return newMatrix;
-};
-
-
-/**
- * Creates a 4x4 matrix initialized from the given values.
- *
- * @param {number} v00 The values at (0, 0).
- * @param {number} v10 The values at (1, 0).
- * @param {number} v20 The values at (2, 0).
- * @param {number} v30 The values at (3, 0).
- * @param {number} v01 The values at (0, 1).
- * @param {number} v11 The values at (1, 1).
- * @param {number} v21 The values at (2, 1).
- * @param {number} v31 The values at (3, 1).
- * @param {number} v02 The values at (0, 2).
- * @param {number} v12 The values at (1, 2).
- * @param {number} v22 The values at (2, 2).
- * @param {number} v32 The values at (3, 2).
- * @param {number} v03 The values at (0, 3).
- * @param {number} v13 The values at (1, 3).
- * @param {number} v23 The values at (2, 3).
- * @param {number} v33 The values at (3, 3).
- * @return {goog.vec.Matrix4.Type} The new, 16 element array.
- */
-goog.vec.Matrix4.createFromValues = function(
-    v00, v10, v20, v30, v01, v11, v21, v31, v02, v12, v22, v32,
-    v03, v13, v23, v33) {
-  var newMatrix = goog.vec.Matrix4.create();
-  goog.vec.Matrix4.setFromValues(
-      newMatrix, v00, v10, v20, v30, v01, v11, v21, v31, v02, v12, v22, v32,
-      v03, v13, v23, v33);
-  return newMatrix;
-};
-
-
-/**
- * Creates a clone of a 4x4 matrix.
- *
- * @param {goog.vec.Matrix4.Type} matrix The source 4x4 matrix.
- * @return {goog.vec.Matrix4.Type} The new, 16 element matrix.
- */
-goog.vec.Matrix4.clone =
-    goog.vec.Matrix4.createFromArray;
-
-
-/**
- * Retrieves the element at the requested row and column.
- *
- * @param {goog.vec.ArrayType} mat The matrix containing the
- *     value to retrieve.
- * @param {number} row The row index.
- * @param {number} column The column index.
- * @return {number} The element value at the requested row, column indices.
- */
-goog.vec.Matrix4.getElement = function(mat, row, column) {
-  return mat[row + column * 4];
-};
-
-
-/**
- * Sets the element at the requested row and column.
- *
- * @param {goog.vec.ArrayType} mat The matrix containing the
- *     value to retrieve.
- * @param {number} row The row index.
- * @param {number} column The column index.
- * @param {number} value The value to set at the requested row, column.
- */
-goog.vec.Matrix4.setElement = function(mat, row, column, value) {
-  mat[row + column * 4] = value;
-};
-
-
-/**
- * Initializes the matrix from the set of values. Note the values supplied are
- * in column major order.
- *
- * @param {goog.vec.ArrayType} mat The matrix to receive the
- *     values.
- * @param {number} v00 The values at (0, 0).
- * @param {number} v10 The values at (1, 0).
- * @param {number} v20 The values at (2, 0).
- * @param {number} v30 The values at (3, 0).
- * @param {number} v01 The values at (0, 1).
- * @param {number} v11 The values at (1, 1).
- * @param {number} v21 The values at (2, 1).
- * @param {number} v31 The values at (3, 1).
- * @param {number} v02 The values at (0, 2).
- * @param {number} v12 The values at (1, 2).
- * @param {number} v22 The values at (2, 2).
- * @param {number} v32 The values at (3, 2).
- * @param {number} v03 The values at (0, 3).
- * @param {number} v13 The values at (1, 3).
- * @param {number} v23 The values at (2, 3).
- * @param {number} v33 The values at (3, 3).
- */
-goog.vec.Matrix4.setFromValues = function(
-    mat, v00, v10, v20, v30, v01, v11, v21, v31, v02, v12, v22, v32,
-    v03, v13, v23, v33) {
-  mat[0] = v00;
-  mat[1] = v10;
-  mat[2] = v20;
-  mat[3] = v30;
-  mat[4] = v01;
-  mat[5] = v11;
-  mat[6] = v21;
-  mat[7] = v31;
-  mat[8] = v02;
-  mat[9] = v12;
-  mat[10] = v22;
-  mat[11] = v32;
-  mat[12] = v03;
-  mat[13] = v13;
-  mat[14] = v23;
-  mat[15] = v33;
-};
-
-
-/**
- * Sets the matrix from the array of values stored in column major order.
- *
- * @param {goog.vec.ArrayType} mat The matrix to receive the
- *     values.
- * @param {goog.vec.ArrayType} values The column major ordered
- *     array of values to store in the matrix.
- */
-goog.vec.Matrix4.setFromArray = function(mat, values) {
-  mat[0] = values[0];
-  mat[1] = values[1];
-  mat[2] = values[2];
-  mat[3] = values[3];
-  mat[4] = values[4];
-  mat[5] = values[5];
-  mat[6] = values[6];
-  mat[7] = values[7];
-  mat[8] = values[8];
-  mat[9] = values[9];
-  mat[10] = values[10];
-  mat[11] = values[11];
-  mat[12] = values[12];
-  mat[13] = values[13];
-  mat[14] = values[14];
-  mat[15] = values[15];
-};
-
-
-/**
- * Sets the matrix from the array of values stored in row major order.
- *
- * @param {goog.vec.ArrayType} mat The matrix to receive the
- *     values.
- * @param {goog.vec.ArrayType} values The row major ordered array of
- *     values to store in the matrix.
- */
-goog.vec.Matrix4.setFromRowMajorArray = function(mat, values) {
-  mat[0] = values[0];
-  mat[1] = values[4];
-  mat[2] = values[8];
-  mat[3] = values[12];
-
-  mat[4] = values[1];
-  mat[5] = values[5];
-  mat[6] = values[9];
-  mat[7] = values[13];
-
-  mat[8] = values[2];
-  mat[9] = values[6];
-  mat[10] = values[10];
-  mat[11] = values[14];
-
-  mat[12] = values[3];
-  mat[13] = values[7];
-  mat[14] = values[11];
-  mat[15] = values[15];
-};
-
-
-/**
- * Sets the diagonal values of the matrix from the given values.
- *
- * @param {goog.vec.ArrayType} mat The matrix to receive the
- *     values.
- * @param {number} v00 The values for (0, 0).
- * @param {number} v11 The values for (1, 1).
- * @param {number} v22 The values for (2, 2).
- * @param {number} v33 The values for (3, 3).
- */
-goog.vec.Matrix4.setDiagonalValues = function(
-    mat, v00, v11, v22, v33) {
-  mat[0] = v00;
-  mat[5] = v11;
-  mat[10] = v22;
-  mat[15] = v33;
-};
-
-
-/**
- * Sets the diagonal values of the matrix from the given vector.
- *
- * @param {goog.vec.ArrayType} mat The matrix to receive the
- *     values.
- * @param {goog.vec.ArrayType} vec The vector containing the
- *     values.
- */
-goog.vec.Matrix4.setDiagonal = function(mat, vec) {
-  mat[0] = vec[0];
-  mat[5] = vec[1];
-  mat[10] = vec[2];
-  mat[15] = vec[3];
-};
-
-
-/**
- * Sets the specified column with the supplied values.
- *
- * @param {goog.vec.ArrayType} mat The matrix to recieve the
- *     values.
- * @param {number} column The column index to set the values on.
- * @param {number} v0 The value for row 0.
- * @param {number} v1 The value for row 1.
- * @param {number} v2 The value for row 2.
- * @param {number} v3 The value for row 3.
- */
-goog.vec.Matrix4.setColumnValues = function(
-    mat, column, v0, v1, v2, v3) {
-  var i = column * 4;
-  mat[i] = v0;
-  mat[i + 1] = v1;
-  mat[i + 2] = v2;
-  mat[i + 3] = v3;
-};
-
-
-/**
- * Sets the specified column with the value from the supplied array.
- *
- * @param {goog.vec.ArrayType} mat The matrix to receive the
- *     values.
- * @param {number} column The column index to set the values on.
- * @param {goog.vec.ArrayType} vec The vector of elements for the
- *     column.
- */
-goog.vec.Matrix4.setColumn = function(mat, column, vec) {
-  var i = column * 4;
-  mat[i] = vec[0];
-  mat[i + 1] = vec[1];
-  mat[i + 2] = vec[2];
-  mat[i + 3] = vec[3];
-};
-
-
-/**
- * Retrieves the specified column from the matrix into the given vector
- * array.
- *
- * @param {goog.vec.ArrayType} mat The matrix supplying the
- *     values.
- * @param {number} column The column to get the values from.
- * @param {goog.vec.ArrayType} vec The vector of elements to
- *     receive the column.
- */
-goog.vec.Matrix4.getColumn = function(mat, column, vec) {
-  var i = column * 4;
-  vec[0] = mat[i];
-  vec[1] = mat[i + 1];
-  vec[2] = mat[i + 2];
-  vec[3] = mat[i + 3];
-};
-
-
-/**
- * Sets the columns of the matrix from the set of vector elements.
- *
- * @param {goog.vec.ArrayType} mat The matrix to receive the
- *     values.
- * @param {goog.vec.ArrayType} vec0 The values for column 0.
- * @param {goog.vec.ArrayType} vec1 The values for column 1.
- * @param {goog.vec.ArrayType} vec2 The values for column 2.
- * @param {goog.vec.ArrayType} vec3 The values for column 3.
- */
-goog.vec.Matrix4.setColumns = function(
-    mat, vec0, vec1, vec2, vec3) {
-  goog.vec.Matrix4.setColumn(mat, 0, vec0);
-  goog.vec.Matrix4.setColumn(mat, 1, vec1);
-  goog.vec.Matrix4.setColumn(mat, 2, vec2);
-  goog.vec.Matrix4.setColumn(mat, 3, vec3);
-};
-
-
-/**
- * Retrieves the column values from the given matrix into the given vector
- * elements.
- *
- * @param {goog.vec.ArrayType} mat The matrix containing the
- *     columns to retrieve.
- * @param {goog.vec.ArrayType} vec0 The vector elements to receive
- *     column 0.
- * @param {goog.vec.ArrayType} vec1 The vector elements to receive
- *     column 1.
- * @param {goog.vec.ArrayType} vec2 The vector elements to receive
- *     column 2.
- * @param {goog.vec.ArrayType} vec3 The vector elements to receive
- *     column 3.
- */
-goog.vec.Matrix4.getColumns = function(
-    mat, vec0, vec1, vec2, vec3) {
-  goog.vec.Matrix4.getColumn(mat, 0, vec0);
-  goog.vec.Matrix4.getColumn(mat, 1, vec1);
-  goog.vec.Matrix4.getColumn(mat, 2, vec2);
-  goog.vec.Matrix4.getColumn(mat, 3, vec3);
-};
-
-
-/**
- * Sets the row values from the supplied values.
- *
- * @param {goog.vec.ArrayType} mat The matrix to receive the
- *     values.
- * @param {number} row The index of the row to receive the values.
- * @param {number} v0 The value for column 0.
- * @param {number} v1 The value for column 1.
- * @param {number} v2 The value for column 2.
- * @param {number} v3 The value for column 3.
- */
-goog.vec.Matrix4.setRowValues = function(mat, row, v0, v1, v2, v3) {
-  mat[row] = v0;
-  mat[row + 4] = v1;
-  mat[row + 8] = v2;
-  mat[row + 12] = v3;
-};
-
-
-/**
- * Sets the row values from the supplied vector.
- *
- * @param {goog.vec.ArrayType} mat The matrix to receive the
- *     row values.
- * @param {number} row The index of the row.
- * @param {goog.vec.ArrayType} vec The vector containing the
- *     values.
- */
-goog.vec.Matrix4.setRow = function(mat, row, vec) {
-  mat[row] = vec[0];
-  mat[row + 4] = vec[1];
-  mat[row + 8] = vec[2];
-  mat[row + 12] = vec[3];
-};
-
-
-/**
- * Retrieves the row values into the given vector.
- *
- * @param {goog.vec.ArrayType} mat The matrix supplying the
- *     values.
- * @param {number} row The index of the row supplying the values.
- * @param {goog.vec.ArrayType} vec The vector to receive the
- *     row.
- */
-goog.vec.Matrix4.getRow = function(mat, row, vec) {
-  vec[0] = mat[row];
-  vec[1] = mat[row + 4];
-  vec[2] = mat[row + 8];
-  vec[3] = mat[row + 12];
-};
-
-
-/**
- * Sets the rows of the matrix from the supplied vectors.
- *
- * @param {goog.vec.ArrayType} mat The matrix to receive the
- *     values.
- * @param {goog.vec.ArrayType} vec0 The values for row 0.
- * @param {goog.vec.ArrayType} vec1 The values for row 1.
- * @param {goog.vec.ArrayType} vec2 The values for row 2.
- * @param {goog.vec.ArrayType} vec3 The values for row 3.
- */
-goog.vec.Matrix4.setRows = function(
-    mat, vec0, vec1, vec2, vec3) {
-  goog.vec.Matrix4.setRow(mat, 0, vec0);
-  goog.vec.Matrix4.setRow(mat, 1, vec1);
-  goog.vec.Matrix4.setRow(mat, 2, vec2);
-  goog.vec.Matrix4.setRow(mat, 3, vec3);
-};
-
-
-/**
- * Retrieves the rows of the matrix into the supplied vectors.
- *
- * @param {goog.vec.ArrayType} mat The matrix to supply the
- *     values.
- * @param {goog.vec.ArrayType} vec0 The vector to receive row 0.
- * @param {goog.vec.ArrayType} vec1 The vector to receive row 1.
- * @param {goog.vec.ArrayType} vec2 The vector to receive row 2.
- * @param {goog.vec.ArrayType} vec3 The vector to receive row 3.
- */
-goog.vec.Matrix4.getRows = function(
-    mat, vec0, vec1, vec2, vec3) {
-  goog.vec.Matrix4.getRow(mat, 0, vec0);
-  goog.vec.Matrix4.getRow(mat, 1, vec1);
-  goog.vec.Matrix4.getRow(mat, 2, vec2);
-  goog.vec.Matrix4.getRow(mat, 3, vec3);
-};
-
-
-/**
- * Clears the given matrix to zero.
- *
- * @param {goog.vec.ArrayType} mat The matrix to clear.
- */
-goog.vec.Matrix4.setZero = function(mat) {
-  mat[0] = 0;
-  mat[1] = 0;
-  mat[2] = 0;
-  mat[3] = 0;
-  mat[4] = 0;
-  mat[5] = 0;
-  mat[6] = 0;
-  mat[7] = 0;
-  mat[8] = 0;
-  mat[9] = 0;
-  mat[10] = 0;
-  mat[11] = 0;
-  mat[12] = 0;
-  mat[13] = 0;
-  mat[14] = 0;
-  mat[15] = 0;
-};
-
-
-/**
- * Sets the given matrix to the identity matrix.
- *
- * @param {goog.vec.ArrayType} mat The matrix to set.
- */
-goog.vec.Matrix4.setIdentity = function(mat) {
-  mat[0] = 1;
-  mat[1] = 0;
-  mat[2] = 0;
-  mat[3] = 0;
-  mat[4] = 0;
-  mat[5] = 1;
-  mat[6] = 0;
-  mat[7] = 0;
-  mat[8] = 0;
-  mat[9] = 0;
-  mat[10] = 1;
-  mat[11] = 0;
-  mat[12] = 0;
-  mat[13] = 0;
-  mat[14] = 0;
-  mat[15] = 1;
-};
-
-
-/**
- * Performs a per-component addition of the matrix mat0 and mat1, storing
- * the result into resultMat.
- *
- * @param {goog.vec.ArrayType} mat0 The first addend.
- * @param {goog.vec.ArrayType} mat1 The second addend.
- * @param {goog.vec.ArrayType} resultMat The matrix to
- *     receive the results (may be either mat0 or mat1).
- * @return {goog.vec.ArrayType} return resultMat so that operations can be
- *     chained together.
- */
-goog.vec.Matrix4.add = function(mat0, mat1, resultMat) {
-  resultMat[0] = mat0[0] + mat1[0];
-  resultMat[1] = mat0[1] + mat1[1];
-  resultMat[2] = mat0[2] + mat1[2];
-  resultMat[3] = mat0[3] + mat1[3];
-  resultMat[4] = mat0[4] + mat1[4];
-  resultMat[5] = mat0[5] + mat1[5];
-  resultMat[6] = mat0[6] + mat1[6];
-  resultMat[7] = mat0[7] + mat1[7];
-  resultMat[8] = mat0[8] + mat1[8];
-  resultMat[9] = mat0[9] + mat1[9];
-  resultMat[10] = mat0[10] + mat1[10];
-  resultMat[11] = mat0[11] + mat1[11];
-  resultMat[12] = mat0[12] + mat1[12];
-  resultMat[13] = mat0[13] + mat1[13];
-  resultMat[14] = mat0[14] + mat1[14];
-  resultMat[15] = mat0[15] + mat1[15];
-  return resultMat;
-};
-
-
-/**
- * Performs a per-component subtraction of the matrix mat0 and mat1,
- * storing the result into resultMat.
- *
- * @param {goog.vec.ArrayType} mat0 The minuend.
- * @param {goog.vec.ArrayType} mat1 The subtrahend.
- * @param {goog.vec.ArrayType} resultMat The matrix to receive
- *     the results (may be either mat0 or mat1).
- * @return {goog.vec.ArrayType} return resultMat so that operations can be
- *     chained together.
- */
-goog.vec.Matrix4.subtract = function(mat0, mat1, resultMat) {
-  resultMat[0] = mat0[0] - mat1[0];
-  resultMat[1] = mat0[1] - mat1[1];
-  resultMat[2] = mat0[2] - mat1[2];
-  resultMat[3] = mat0[3] - mat1[3];
-  resultMat[4] = mat0[4] - mat1[4];
-  resultMat[5] = mat0[5] - mat1[5];
-  resultMat[6] = mat0[6] - mat1[6];
-  resultMat[7] = mat0[7] - mat1[7];
-  resultMat[8] = mat0[8] - mat1[8];
-  resultMat[9] = mat0[9] - mat1[9];
-  resultMat[10] = mat0[10] - mat1[10];
-  resultMat[11] = mat0[11] - mat1[11];
-  resultMat[12] = mat0[12] - mat1[12];
-  resultMat[13] = mat0[13] - mat1[13];
-  resultMat[14] = mat0[14] - mat1[14];
-  resultMat[15] = mat0[15] - mat1[15];
-  return resultMat;
-};
-
-
-/**
- * Performs a component-wise multiplication of mat0 with the given scalar
- * storing the result into resultMat.
- *
- * @param {goog.vec.ArrayType} mat0 The matrix to scale.
- * @param {number} scalar The scalar value to multiple to each element of mat0.
- * @param {goog.vec.ArrayType} resultMat The matrix to receive
- *     the results (may be mat0).
- * @return {goog.vec.ArrayType} return resultMat so that operations can be
- *     chained together.
- */
-goog.vec.Matrix4.scale = function(mat0, scalar, resultMat) {
-  resultMat[0] = mat0[0] * scalar;
-  resultMat[1] = mat0[1] * scalar;
-  resultMat[2] = mat0[2] * scalar;
-  resultMat[3] = mat0[3] * scalar;
-  resultMat[4] = mat0[4] * scalar;
-  resultMat[5] = mat0[5] * scalar;
-  resultMat[6] = mat0[6] * scalar;
-  resultMat[7] = mat0[7] * scalar;
-  resultMat[8] = mat0[8] * scalar;
-  resultMat[9] = mat0[9] * scalar;
-  resultMat[10] = mat0[10] * scalar;
-  resultMat[11] = mat0[11] * scalar;
-  resultMat[12] = mat0[12] * scalar;
-  resultMat[13] = mat0[13] * scalar;
-  resultMat[14] = mat0[14] * scalar;
-  resultMat[15] = mat0[15] * scalar;
-  return resultMat;
-};
-
-
-/**
- * Multiplies the two matrices mat0 and mat1 using matrix multiplication,
- * storing the result into resultMat.
- *
- * @param {goog.vec.ArrayType} mat0 The first (left hand) matrix.
- * @param {goog.vec.ArrayType} mat1 The second (right hand)
- *     matrix.
- * @param {goog.vec.ArrayType} resultMat The matrix to receive
- *     the results (may be either mat0 or mat1).
- * @return {goog.vec.ArrayType} return resultMat so that operations can be
- *     chained together.
- */
-goog.vec.Matrix4.multMat = function(mat0, mat1, resultMat) {
-  var a00 = mat0[0], a10 = mat0[1], a20 = mat0[2], a30 = mat0[3];
-  var a01 = mat0[4], a11 = mat0[5], a21 = mat0[6], a31 = mat0[7];
-  var a02 = mat0[8], a12 = mat0[9], a22 = mat0[10], a32 = mat0[11];
-  var a03 = mat0[12], a13 = mat0[13], a23 = mat0[14], a33 = mat0[15];
-
-  var b00 = mat1[0], b10 = mat1[1], b20 = mat1[2], b30 = mat1[3];
-  var b01 = mat1[4], b11 = mat1[5], b21 = mat1[6], b31 = mat1[7];
-  var b02 = mat1[8], b12 = mat1[9], b22 = mat1[10], b32 = mat1[11];
-  var b03 = mat1[12], b13 = mat1[13], b23 = mat1[14], b33 = mat1[15];
-
-  resultMat[0] = a00 * b00 + a01 * b10 + a02 * b20 + a03 * b30;
-  resultMat[1] = a10 * b00 + a11 * b10 + a12 * b20 + a13 * b30;
-  resultMat[2] = a20 * b00 + a21 * b10 + a22 * b20 + a23 * b30;
-  resultMat[3] = a30 * b00 + a31 * b10 + a32 * b20 + a33 * b30;
-
-  resultMat[4] = a00 * b01 + a01 * b11 + a02 * b21 + a03 * b31;
-  resultMat[5] = a10 * b01 + a11 * b11 + a12 * b21 + a13 * b31;
-  resultMat[6] = a20 * b01 + a21 * b11 + a22 * b21 + a23 * b31;
-  resultMat[7] = a30 * b01 + a31 * b11 + a32 * b21 + a33 * b31;
-
-  resultMat[8] = a00 * b02 + a01 * b12 + a02 * b22 + a03 * b32;
-  resultMat[9] = a10 * b02 + a11 * b12 + a12 * b22 + a13 * b32;
-  resultMat[10] = a20 * b02 + a21 * b12 + a22 * b22 + a23 * b32;
-  resultMat[11] = a30 * b02 + a31 * b12 + a32 * b22 + a33 * b32;
-
-  resultMat[12] = a00 * b03 + a01 * b13 + a02 * b23 + a03 * b33;
-  resultMat[13] = a10 * b03 + a11 * b13 + a12 * b23 + a13 * b33;
-  resultMat[14] = a20 * b03 + a21 * b13 + a22 * b23 + a23 * b33;
-  resultMat[15] = a30 * b03 + a31 * b13 + a32 * b23 + a33 * b33;
-  return resultMat;
-};
-
-
-/**
- * Transposes the given matrix mat storing the result into resultMat.
- * @param {goog.vec.ArrayType} mat The matrix to transpose.
- * @param {goog.vec.ArrayType} resultMat The matrix to receive
- *     the results (may be mat).
- * @return {goog.vec.ArrayType} return resultMat so that operations can be
- *     chained together.
- */
-goog.vec.Matrix4.transpose = function(mat, resultMat) {
-  if (resultMat == mat) {
-    var a10 = mat[1], a20 = mat[2], a30 = mat[3];
-    var a21 = mat[6], a31 = mat[7];
-    var a32 = mat[11];
-    resultMat[1] = mat[4];
-    resultMat[2] = mat[8];
-    resultMat[3] = mat[12];
-    resultMat[4] = a10;
-    resultMat[6] = mat[9];
-    resultMat[7] = mat[13];
-    resultMat[8] = a20;
-    resultMat[9] = a21;
-    resultMat[11] = mat[14];
-    resultMat[12] = a30;
-    resultMat[13] = a31;
-    resultMat[14] = a32;
-  } else {
-    resultMat[0] = mat[0];
-    resultMat[1] = mat[4];
-    resultMat[2] = mat[8];
-    resultMat[3] = mat[12];
-
-    resultMat[4] = mat[1];
-    resultMat[5] = mat[5];
-    resultMat[6] = mat[9];
-    resultMat[7] = mat[13];
-
-    resultMat[8] = mat[2];
-    resultMat[9] = mat[6];
-    resultMat[10] = mat[10];
-    resultMat[11] = mat[14];
-
-    resultMat[12] = mat[3];
-    resultMat[13] = mat[7];
-    resultMat[14] = mat[11];
-    resultMat[15] = mat[15];
-  }
-  return resultMat;
-};
-
-
-/**
- * Computes the determinant of the matrix.
- *
- * @param {goog.vec.ArrayType} mat The matrix to compute the
- *     matrix for.
- * @return {number} The determinant of the matrix.
- */
-goog.vec.Matrix4.determinant = function(mat) {
-  var m00 = mat[0], m10 = mat[1], m20 = mat[2], m30 = mat[3];
-  var m01 = mat[4], m11 = mat[5], m21 = mat[6], m31 = mat[7];
-  var m02 = mat[8], m12 = mat[9], m22 = mat[10], m32 = mat[11];
-  var m03 = mat[12], m13 = mat[13], m23 = mat[14], m33 = mat[15];
-
-  var a0 = m00 * m11 - m10 * m01;
-  var a1 = m00 * m21 - m20 * m01;
-  var a2 = m00 * m31 - m30 * m01;
-  var a3 = m10 * m21 - m20 * m11;
-  var a4 = m10 * m31 - m30 * m11;
-  var a5 = m20 * m31 - m30 * m21;
-  var b0 = m02 * m13 - m12 * m03;
-  var b1 = m02 * m23 - m22 * m03;
-  var b2 = m02 * m33 - m32 * m03;
-  var b3 = m12 * m23 - m22 * m13;
-  var b4 = m12 * m33 - m32 * m13;
-  var b5 = m22 * m33 - m32 * m23;
-
-  return a0 * b5 - a1 * b4 + a2 * b3 + a3 * b2 - a4 * b1 + a5 * b0;
-};
-
-
-/**
- * Computes the inverse of mat storing the result into resultMat. If the
- * inverse is defined, this function returns true, false otherwise.
- *
- * @param {goog.vec.ArrayType} mat The matrix to invert.
- * @param {goog.vec.ArrayType} resultMat The matrix to receive
- *     the result (may be mat).
- * @return {boolean} True if the inverse is defined. If false is returned,
- *     resultMat is not modified.
- */
-goog.vec.Matrix4.invert = function(mat, resultMat) {
-  var m00 = mat[0], m10 = mat[1], m20 = mat[2], m30 = mat[3];
-  var m01 = mat[4], m11 = mat[5], m21 = mat[6], m31 = mat[7];
-  var m02 = mat[8], m12 = mat[9], m22 = mat[10], m32 = mat[11];
-  var m03 = mat[12], m13 = mat[13], m23 = mat[14], m33 = mat[15];
-
-  var a0 = m00 * m11 - m10 * m01;
-  var a1 = m00 * m21 - m20 * m01;
-  var a2 = m00 * m31 - m30 * m01;
-  var a3 = m10 * m21 - m20 * m11;
-  var a4 = m10 * m31 - m30 * m11;
-  var a5 = m20 * m31 - m30 * m21;
-  var b0 = m02 * m13 - m12 * m03;
-  var b1 = m02 * m23 - m22 * m03;
-  var b2 = m02 * m33 - m32 * m03;
-  var b3 = m12 * m23 - m22 * m13;
-  var b4 = m12 * m33 - m32 * m13;
-  var b5 = m22 * m33 - m32 * m23;
-
-  var det = a0 * b5 - a1 * b4 + a2 * b3 + a3 * b2 - a4 * b1 + a5 * b0;
-  if (det == 0) {
-    return false;
-  }
-
-  var idet = 1.0 / det;
-  resultMat[0] = (m11 * b5 - m21 * b4 + m31 * b3) * idet;
-  resultMat[1] = (-m10 * b5 + m20 * b4 - m30 * b3) * idet;
-  resultMat[2] = (m13 * a5 - m23 * a4 + m33 * a3) * idet;
-  resultMat[3] = (-m12 * a5 + m22 * a4 - m32 * a3) * idet;
-  resultMat[4] = (-m01 * b5 + m21 * b2 - m31 * b1) * idet;
-  resultMat[5] = (m00 * b5 - m20 * b2 + m30 * b1) * idet;
-  resultMat[6] = (-m03 * a5 + m23 * a2 - m33 * a1) * idet;
-  resultMat[7] = (m02 * a5 - m22 * a2 + m32 * a1) * idet;
-  resultMat[8] = (m01 * b4 - m11 * b2 + m31 * b0) * idet;
-  resultMat[9] = (-m00 * b4 + m10 * b2 - m30 * b0) * idet;
-  resultMat[10] = (m03 * a4 - m13 * a2 + m33 * a0) * idet;
-  resultMat[11] = (-m02 * a4 + m12 * a2 - m32 * a0) * idet;
-  resultMat[12] = (-m01 * b3 + m11 * b1 - m21 * b0) * idet;
-  resultMat[13] = (m00 * b3 - m10 * b1 + m20 * b0) * idet;
-  resultMat[14] = (-m03 * a3 + m13 * a1 - m23 * a0) * idet;
-  resultMat[15] = (m02 * a3 - m12 * a1 + m22 * a0) * idet;
-  return true;
-};
-
-
-/**
- * Returns true if the components of mat0 are equal to the components of mat1.
- *
- * @param {goog.vec.ArrayType} mat0 The first matrix.
- * @param {goog.vec.ArrayType} mat1 The second matrix.
- * @return {boolean} True if the the two matrices are equivalent.
- */
-goog.vec.Matrix4.equals = function(mat0, mat1) {
-  return mat0.length == mat1.length &&
-      mat0[0] == mat1[0] &&
-      mat0[1] == mat1[1] &&
-      mat0[2] == mat1[2] &&
-      mat0[3] == mat1[3] &&
-      mat0[4] == mat1[4] &&
-      mat0[5] == mat1[5] &&
-      mat0[6] == mat1[6] &&
-      mat0[7] == mat1[7] &&
-      mat0[8] == mat1[8] &&
-      mat0[9] == mat1[9] &&
-      mat0[10] == mat1[10] &&
-      mat0[11] == mat1[11] &&
-      mat0[12] == mat1[12] &&
-      mat0[13] == mat1[13] &&
-      mat0[14] == mat1[14] &&
-      mat0[15] == mat1[15];
-};
-
-
-/**
- * Transforms the given vector with the given matrix storing the resulting,
- * transformed vector into resultVec. The input vector is multiplied against the
- * upper 3x4 matrix omitting the projective component.
- *
- * @param {goog.vec.ArrayType} mat The matrix supplying the
- *     transformation.
- * @param {goog.vec.ArrayType} vec The 3 element vector to
- *     transform.
- * @param {goog.vec.ArrayType} resultVec The 3 element vector to
- *     receive the results (may be vec).
- * @return {goog.vec.ArrayType} return resultVec so that operations can be
- *     chained together.
- */
-goog.vec.Matrix4.multVec3 = function(mat, vec, resultVec) {
-  var x = vec[0], y = vec[1], z = vec[2];
-  resultVec[0] = x * mat[0] + y * mat[4] + z * mat[8] + mat[12];
-  resultVec[1] = x * mat[1] + y * mat[5] + z * mat[9] + mat[13];
-  resultVec[2] = x * mat[2] + y * mat[6] + z * mat[10] + mat[14];
-  return resultVec;
-};
-
-
-/**
- * Transforms the given vector with the given matrix storing the resulting,
- * transformed vector into resultVec. The input vector is multiplied against the
- * upper 3x3 matrix omitting the projective component and translation
- * components.
- *
- * @param {goog.vec.ArrayType} mat The matrix supplying the
- *     transformation.
- * @param {goog.vec.ArrayType} vec The 3 element vector to
- *     transform.
- * @param {goog.vec.ArrayType} resultVec The 3 element vector to
- *     receive the results (may be vec).
- * @return {goog.vec.ArrayType} return resultVec so that operations can be
- *     chained together.
- */
-goog.vec.Matrix4.multVec3NoTranslate = function(
-    mat, vec, resultVec) {
-  var x = vec[0], y = vec[1], z = vec[2];
-  resultVec[0] = x * mat[0] + y * mat[4] + z * mat[8];
-  resultVec[1] = x * mat[1] + y * mat[5] + z * mat[9];
-  resultVec[2] = x * mat[2] + y * mat[6] + z * mat[10];
-  return resultVec;
-};
-
-
-/**
- * Transforms the given vector with the given matrix storing the resulting,
- * transformed vector into resultVec. The input vector is multiplied against the
- * full 4x4 matrix with the homogeneous divide applied to reduce the 4 element
- * vector to a 3 element vector.
- *
- * @param {goog.vec.ArrayType} mat The matrix supplying the
- *     transformation.
- * @param {goog.vec.ArrayType} vec The 3 element vector to
- *     transform.
- * @param {goog.vec.ArrayType} resultVec The 3 element vector
- *     to receive the results (may be vec).
- * @return {goog.vec.ArrayType} return resultVec so that operations can be
- *     chained together.
- */
-goog.vec.Matrix4.multVec3Projective = function(
-    mat, vec, resultVec) {
-  var x = vec[0], y = vec[1], z = vec[2];
-  var invw = 1 / (x * mat[3] + y * mat[7] + z * mat[11] + mat[15]);
-  resultVec[0] = (x * mat[0] + y * mat[4] + z * mat[8] + mat[12]) * invw;
-  resultVec[1] = (x * mat[1] + y * mat[5] + z * mat[9] + mat[13]) * invw;
-  resultVec[2] = (x * mat[2] + y * mat[6] + z * mat[10] + mat[14]) * invw;
-  return resultVec;
-};
-
-
-/**
- * Transforms the given vector with the given matrix storing the resulting,
- * transformed vector into resultVec.
- *
- * @param {goog.vec.ArrayType} mat The matrix supplying the
- *     transformation.
- * @param {goog.vec.ArrayType} vec The vector to transform.
- * @param {goog.vec.ArrayType} resultVec The vector to
- *     receive the results (may be vec).
- * @return {goog.vec.ArrayType} return resultVec so that operations can be
- *     chained together.
- */
-goog.vec.Matrix4.multVec4 = function(mat, vec, resultVec) {
-  var x = vec[0], y = vec[1], z = vec[2], w = vec[3];
-  resultVec[0] = x * mat[0] + y * mat[4] + z * mat[8] + w * mat[12];
-  resultVec[1] = x * mat[1] + y * mat[5] + z * mat[9] + w * mat[13];
-  resultVec[2] = x * mat[2] + y * mat[6] + z * mat[10] + w * mat[14];
-  resultVec[3] = x * mat[3] + y * mat[7] + z * mat[11] + w * mat[15];
-  return resultVec;
-};
-
-
-/**
- * Transforms the given vector with the given matrix storing the resulting,
- * transformed vector into resultVec. The input matrix is multiplied against the
- * upper 3x4 matrix omitting the projective component.
- *
- * @param {goog.vec.ArrayType} mat The matrix supplying the
- *     transformation.
- * @param {goog.vec.ArrayType} vec The 3 element vector to
- *     transform.
- * @param {goog.vec.ArrayType} resultVec The 3 element vector to
- *     receive the results (may be vec).
- * @return {goog.vec.ArrayType} return resultVec so that operations can be
- *     chained together.
- */
-goog.vec.Matrix4.multVec3ToArray = function(mat, vec, resultVec) {
-  goog.vec.Matrix4.multVec3(
-      mat, vec, (/** @type {goog.vec.ArrayType} */ resultVec));
-  return resultVec;
-};
-
-
-/**
- * Transforms the given vector with the given matrix storing the resulting,
- * transformed vector into resultVec.
- *
- * @param {goog.vec.ArrayType} mat The matrix supplying the
- *     transformation.
- * @param {goog.vec.ArrayType} vec The vector to transform.
- * @param {goog.vec.ArrayType} resultVec The vector to
- *     receive the results (may be vec).
- * @return {goog.vec.ArrayType} return resultVec so that operations can be
- *     chained together.
- */
-goog.vec.Matrix4.multVec4ToArray = function(mat, vec, resultVec) {
-  goog.vec.Matrix4.multVec4(
-      mat, vec, (/** @type {goog.vec.ArrayType} */ resultVec));
-  return resultVec;
-};
-
-
-/**
- * Initializes the given 4x4 matrix as a translation matrix with x, y and z
- * translation factors.
- * @param {goog.vec.ArrayType} mat The 4x4 (16-element) matrix
- *     array to receive the new translation matrix.
- * @param {number} x The translation along the x axis.
- * @param {number} y The translation along the y axis.
- * @param {number} z The translation along the z axis.
- */
-goog.vec.Matrix4.makeTranslate = function(mat, x, y, z) {
-  goog.vec.Matrix4.setIdentity(mat);
-  goog.vec.Matrix4.setColumnValues(mat, 3, x, y, z, 1);
-};
-
-
-/**
- * Initializes the given 4x4 matrix as a scale matrix with x, y and z scale
- * factors.
- * @param {goog.vec.ArrayType} mat The 4x4 (16-element) matrix
- *     array to receive the new translation matrix.
- * @param {number} x The scale along the x axis.
- * @param {number} y The scale along the y axis.
- * @param {number} z The scale along the z axis.
- */
-goog.vec.Matrix4.makeScale = function(mat, x, y, z) {
-  goog.vec.Matrix4.setIdentity(mat);
-  goog.vec.Matrix4.setDiagonalValues(mat, x, y, z, 1);
-};
-
-
-/**
- * Initializes the given 4x4 matrix as a rotation matrix with the given rotation
- * angle about the axis defined by the vector (ax, ay, az).
- * @param {goog.vec.ArrayType} mat The 4x4 (16-element) matrix
- *     array to receive the new translation matrix.
- * @param {number} angle The rotation angle in radians.
- * @param {number} ax The x component of the rotation axis.
- * @param {number} ay The y component of the rotation axis.
- * @param {number} az The z component of the rotation axis.
- */
-goog.vec.Matrix4.makeAxisAngleRotate = function(
-    mat, angle, ax, ay, az) {
-  var c = Math.cos(angle);
-  var d = 1 - c;
-  var s = Math.sin(angle);
-
-  goog.vec.Matrix4.setFromValues(mat,
-      ax * ax * d + c,
-      ax * ay * d + az * s,
-      ax * az * d - ay * s,
-      0,
-
-      ax * ay * d - az * s,
-      ay * ay * d + c,
-      ay * az * d + ax * s,
-      0,
-
-      ax * az * d + ay * s,
-      ay * az * d - ax * s,
-      az * az * d + c,
-      0,
-
-      0, 0, 0, 1);
-};
-
-
-/**
- * Initializes the given 4x4 matrix as a perspective projection matrix.
- * @param {goog.vec.ArrayType} mat The 4x4 (16-element) matrix
- *     array to receive the new translation matrix.
- * @param {number} left The coordinate of the left clipping plane.
- * @param {number} right The coordinate of the right clipping plane.
- * @param {number} bottom The coordinate of the bottom clipping plane.
- * @param {number} top The coordinate of the top clipping plane.
- * @param {number} near The distance to the near clipping plane.
- * @param {number} far The distance to the far clipping plane.
- */
-goog.vec.Matrix4.makeFrustum = function(
-    mat, left, right, bottom, top, near, far) {
-  var x = (2 * near) / (right - left);
-  var y = (2 * near) / (top - bottom);
-  var a = (right + left) / (right - left);
-  var b = (top + bottom) / (top - bottom);
-  var c = -(far + near) / (far - near);
-  var d = -(2 * far * near) / (far - near);
-
-  goog.vec.Matrix4.setFromValues(mat,
-      x, 0, 0, 0,
-      0, y, 0, 0,
-      a, b, c, -1,
-      0, 0, d, 0
-  );
-};
-
-
-/**
- * Initializes the given 4x4 matrix as a perspective projection matrix given a
- * field of view and aspect ratio.
- * @param {goog.vec.ArrayType} mat The 4x4 (16-element) matrix
- *     array to receive the new translation matrix.
- * @param {number} fovy The field of view along the y (vertical) axis in
- *     radians.
- * @param {number} aspect The x (width) to y (height) aspect ratio.
- * @param {number} near The distance to the near clipping plane.
- * @param {number} far The distance to the far clipping plane.
- */
-goog.vec.Matrix4.makePerspective = function(
-    mat, fovy, aspect, near, far) {
-  var angle = fovy / 2;
-  var dz = far - near;
-  var sinAngle = Math.sin(angle);
-  if (dz == 0 || sinAngle == 0 || aspect == 0) return;
-
-  var cot = Math.cos(angle) / sinAngle;
-  goog.vec.Matrix4.setFromValues(mat,
-      cot / aspect, 0, 0, 0,
-      0, cot, 0, 0,
-      0, 0, -(far + near) / dz, -1,
-      0, 0, -(2 * near * far) / dz, 0
-  );
-};
-
-
-/**
- * Initializes the given 4x4 matrix as an orthographic projection matrix.
- * @param {goog.vec.ArrayType} mat The 4x4 (16-element) matrix
- *     array to receive the new translation matrix.
- * @param {number} left The coordinate of the left clipping plane.
- * @param {number} right The coordinate of the right clipping plane.
- * @param {number} bottom The coordinate of the bottom clipping plane.
- * @param {number} top The coordinate of the top clipping plane.
- * @param {number} near The distance to the near clipping plane.
- * @param {number} far The distance to the far clipping plane.
- */
-goog.vec.Matrix4.makeOrtho = function(
-    mat, left, right, bottom, top, near, far) {
-  var x = 2 / (right - left);
-  var y = 2 / (top - bottom);
-  var z = -2 / (far - near);
-  var a = -(right + left) / (right - left);
-  var b = -(top + bottom) / (top - bottom);
-  var c = -(far + near) / (far - near);
-
-  goog.vec.Matrix4.setFromValues(mat,
-      x, 0, 0, 0,
-      0, y, 0, 0,
-      0, 0, z, 0,
-      a, b, c, 1
-  );
-};
-
-
-/**
- * Updates a matrix representing the modelview matrix of a camera so that
- * the camera is 'looking at' the given center point.
- * @param {goog.vec.ArrayType} viewMatrix The matrix.
- * @param {goog.vec.ArrayType} eyePt The position of the eye point
- *     (camera origin).
- * @param {goog.vec.ArrayType} centerPt The point to aim the camera
- *     at.
- * @param {goog.vec.ArrayType} worldUpVec The vector that
- *     identifies the up direction for the camera.
- */
-goog.vec.Matrix4.lookAt = function(
-    viewMatrix, eyePt, centerPt, worldUpVec) {
-  // Compute the direction vector from the eye point to the center point and
-  // normalize.
-  var fwdVec = goog.vec.Matrix4.tmpVec4_[0];
-  goog.vec.Vec3.subtract(centerPt, eyePt, fwdVec);
-  goog.vec.Vec3.normalize(fwdVec, fwdVec);
-  fwdVec[3] = 0;
-
-  // Compute the side vector from the forward vector and the input up vector.
-  var sideVec = goog.vec.Matrix4.tmpVec4_[1];
-  goog.vec.Vec3.cross(fwdVec, worldUpVec, sideVec);
-  goog.vec.Vec3.normalize(sideVec, sideVec);
-  sideVec[3] = 0;
-
-  // Now the up vector to form the orthonormal basis.
-  var upVec = goog.vec.Matrix4.tmpVec4_[2];
-  goog.vec.Vec3.cross(sideVec, fwdVec, upVec);
-  goog.vec.Vec3.normalize(upVec, upVec);
-  upVec[3] = 0;
-
-  // Update the view matrix with the new orthonormal basis and position the
-  // camera at the given eye point.
-  goog.vec.Vec3.negate(fwdVec, fwdVec);
-  goog.vec.Matrix4.setRow(viewMatrix, 0, sideVec);
-  goog.vec.Matrix4.setRow(viewMatrix, 1, upVec);
-  goog.vec.Matrix4.setRow(viewMatrix, 2, fwdVec);
-  goog.vec.Matrix4.setRowValues(viewMatrix, 3, 0, 0, 0, 1);
-  goog.vec.Matrix4.applyTranslate(
-      viewMatrix, -eyePt[0], -eyePt[1], -eyePt[2]);
-};
-
-
-/**
- * Decomposes a matrix into the lookAt vectors eyePt, fwdVec and worldUpVec.
- * The matrix represents the modelview matrix of a camera. It is the inverse
- * of lookAt except for the output of the fwdVec instead of centerPt.
- * The centerPt itself cannot be recovered from a modelview matrix.
- * @param {goog.vec.ArrayType} viewMatrix The matrix.
- * @param {goog.vec.ArrayType} eyePt The position of the eye point
- *     (camera origin).
- * @param {goog.vec.ArrayType} fwdVec The vector describing where
- *     the camera points to.
- * @param {goog.vec.ArrayType} worldUpVec The vector that
- *     identifies the up direction for the camera.
- * @return {boolean} True if the method succeeds, false otherwise.
- *     The method can only fail if the inverse of viewMatrix is not defined.
- */
-goog.vec.Matrix4.toLookAt = function(
-    viewMatrix, eyePt, fwdVec, worldUpVec) {
-  // Get eye of the camera.
-  var viewMatrixInverse = goog.vec.Matrix4.tmpMatrix4_[0];
-  if (!goog.vec.Matrix4.invert(viewMatrix, viewMatrixInverse)) {
-    // The input matrix does not have a valid inverse.
-    return false;
-  }
-
-  if (eyePt) {
-    eyePt[0] = viewMatrixInverse[12];
-    eyePt[1] = viewMatrixInverse[13];
-    eyePt[2] = viewMatrixInverse[14];
-  }
-
-  // Get forward vector from the definition of lookAt.
-  if (fwdVec || worldUpVec) {
-    if (!fwdVec) {
-      fwdVec = goog.vec.Matrix4.tmpVec3_[0];
-    }
-    fwdVec[0] = -viewMatrix[2];
-    fwdVec[1] = -viewMatrix[6];
-    fwdVec[2] = -viewMatrix[10];
-    // Normalize forward vector.
-    goog.vec.Vec3.normalize(fwdVec, fwdVec);
-  }
-
-  if (worldUpVec) {
-    // Get side vector from the definition of gluLookAt.
-    var side = goog.vec.Matrix4.tmpVec3_[1];
-    side[0] = viewMatrix[0];
-    side[1] = viewMatrix[4];
-    side[2] = viewMatrix[8];
-    // Compute up vector as a up = side x forward.
-    goog.vec.Vec3.cross(side, fwdVec, worldUpVec);
-    // Normalize up vector.
-    goog.vec.Vec3.normalize(worldUpVec, worldUpVec);
-  }
-  return true;
-};
-
-
-/**
- * Constructs a rotation matrix from its Euler angles using the ZXZ convention.
- * Given the euler angles [theta1, theta2, theta3], the rotation is defined as
- * rotation = rotation_z(theta1) * rotation_x(theta2) * rotation_z(theta3),
- * where rotation_x(theta) means rotation around the X axis of theta radians.
- * @param {goog.vec.ArrayType} matrix The rotation matrix.
- * @param {number} theta1 The angle of rotation around the Z axis in radians.
- * @param {number} theta2 The angle of rotation around the X axis in radians.
- * @param {number} theta3 The angle of rotation around the Z axis in radians.
- */
-goog.vec.Matrix4.fromEulerZXZ = function(
-    matrix, theta1, theta2, theta3) {
-  var c1 = Math.cos(theta1);
-  var s1 = Math.sin(theta1);
-
-  var c2 = Math.cos(theta2);
-  var s2 = Math.sin(theta2);
-
-  var c3 = Math.cos(theta3);
-  var s3 = Math.sin(theta3);
-
-  matrix[0] = c1 * c3 - c2 * s1 * s3;
-  matrix[1] = c2 * c1 * s3 + c3 * s1;
-  matrix[2] = s3 * s2;
-  matrix[3] = 0;
-
-  matrix[4] = -c1 * s3 - c3 * c2 * s1;
-  matrix[5] = c1 * c2 * c3 - s1 * s3;
-  matrix[6] = c3 * s2;
-  matrix[7] = 0;
-
-  matrix[8] = s2 * s1;
-  matrix[9] = -c1 * s2;
-  matrix[10] = c2;
-  matrix[11] = 0;
-
-  matrix[12] = 0;
-  matrix[13] = 0;
-  matrix[14] = 0;
-  matrix[15] = 1;
-};
-
-
-/**
- * Decomposes a rotation matrix into Euler angles using the ZXZ convention.
- * @param {goog.vec.ArrayType} matrix The rotation matrix.
- * @param {goog.vec.ArrayType} euler The ZXZ Euler angles in
- *     radians. euler = [roll, tilt, pan].
- */
-goog.vec.Matrix4.toEulerZXZ = function(matrix, euler) {
-  var s2 = Math.sqrt(matrix[2] * matrix[2] + matrix[6] * matrix[6]);
-
-  // There is an ambiguity in the sign of s2. We assume the tilt value
-  // is between [-pi/2, 0], so s2 is always negative.
-  if (s2 > goog.vec.EPSILON) {
-    euler[2] = Math.atan2(-matrix[2], -matrix[6]);
-    euler[1] = Math.atan2(-s2, matrix[10]);
-    euler[0] = Math.atan2(-matrix[8], matrix[9]);
-  } else {
-    // There is also an arbitrary choice for roll = 0 or pan = 0 in this case.
-    // We assume roll = 0 as some applications do not allow the camera to roll.
-    euler[0] = 0;
-    euler[1] = Math.atan2(-s2, matrix[10]);
-    euler[2] = Math.atan2(matrix[1], matrix[0]);
-  }
-};
-
-
-/**
- * Applies a translation by x,y,z to the given matrix.
- *
- * @param {goog.vec.ArrayType} mat The matrix.
- * @param {number} x The translation along the x axis.
- * @param {number} y The translation along the y axis.
- * @param {number} z The translation along the z axis.
- */
-goog.vec.Matrix4.applyTranslate = function(mat, x, y, z) {
-  goog.vec.Matrix4.setColumnValues(
-      mat, 3,
-      mat[0] * x + mat[4] * y + mat[8] * z + mat[12],
-      mat[1] * x + mat[5] * y + mat[9] * z + mat[13],
-      mat[2] * x + mat[6] * y + mat[10] * z + mat[14],
-      mat[3] * x + mat[7] * y + mat[11] * z + mat[15]);
-};
-
-
-/**
- * Applies an x,y,z scale to the given matrix.
- *
- * @param {goog.vec.ArrayType} mat The matrix.
- * @param {number} x The x scale factor.
- * @param {number} y The y scale factor.
- * @param {number} z The z scale factor.
- */
-goog.vec.Matrix4.applyScale = function(mat, x, y, z) {
-  goog.vec.Matrix4.setFromValues(
-      mat,
-      mat[0] * x, mat[1] * x, mat[2] * x, mat[3] * x,
-      mat[4] * y, mat[5] * y, mat[6] * y, mat[7] * y,
-      mat[8] * z, mat[9] * z, mat[10] * z, mat[11] * z,
-      mat[12], mat[13], mat[14], mat[15]);
-};
-
-
-/**
- * Applies a rotation by angle about the x,y,z axis to the given matrix.
- *
- * @param {goog.vec.ArrayType} mat The matrix.
- * @param {number} angle The angle in radians.
- * @param {number} x The x component of the rotation axis.
- * @param {number} y The y component of the rotation axis.
- * @param {number} z The z component of the rotation axis.
- */
-goog.vec.Matrix4.applyRotate = function(mat, angle, x, y, z) {
-  var m00 = mat[0], m10 = mat[1], m20 = mat[2], m30 = mat[3];
-  var m01 = mat[4], m11 = mat[5], m21 = mat[6], m31 = mat[7];
-  var m02 = mat[8], m12 = mat[9], m22 = mat[10], m32 = mat[11];
-  var m03 = mat[12], m13 = mat[13], m23 = mat[14], m33 = mat[15];
-
-  var cosAngle = Math.cos(angle);
-  var sinAngle = Math.sin(angle);
-  var diffCosAngle = 1 - cosAngle;
-  var r00 = x * x * diffCosAngle + cosAngle;
-  var r10 = x * y * diffCosAngle + z * sinAngle;
-  var r20 = x * z * diffCosAngle - y * sinAngle;
-
-  var r01 = x * y * diffCosAngle - z * sinAngle;
-  var r11 = y * y * diffCosAngle + cosAngle;
-  var r21 = y * z * diffCosAngle + x * sinAngle;
-
-  var r02 = x * z * diffCosAngle + y * sinAngle;
-  var r12 = y * z * diffCosAngle - x * sinAngle;
-  var r22 = z * z * diffCosAngle + cosAngle;
-
-  goog.vec.Matrix4.setFromValues(
-      mat,
-      m00 * r00 + m01 * r10 + m02 * r20,
-      m10 * r00 + m11 * r10 + m12 * r20,
-      m20 * r00 + m21 * r10 + m22 * r20,
-      m30 * r00 + m31 * r10 + m32 * r20,
-
-      m00 * r01 + m01 * r11 + m02 * r21,
-      m10 * r01 + m11 * r11 + m12 * r21,
-      m20 * r01 + m21 * r11 + m22 * r21,
-      m30 * r01 + m31 * r11 + m32 * r21,
-
-      m00 * r02 + m01 * r12 + m02 * r22,
-      m10 * r02 + m11 * r12 + m12 * r22,
-      m20 * r02 + m21 * r12 + m22 * r22,
-      m30 * r02 + m31 * r12 + m32 * r22,
-
-      m03, m13, m23, m33);
-};
-
-
-/**
- * @type {Array.<goog.vec.Vec3.Type>}
- * @private
- */
-goog.vec.Matrix4.tmpVec3_ = [
-  goog.vec.Vec3.createNumber(),
-  goog.vec.Vec3.createNumber()
-];
-
-
-/**
- * @type {Array.<goog.vec.Vec4.Type>}
- * @private
- */
-goog.vec.Matrix4.tmpVec4_ = [
-  goog.vec.Vec4.createNumber(),
-  goog.vec.Vec4.createNumber(),
-  goog.vec.Vec4.createNumber()
-];
-
-
-/**
- * @type {Array.<goog.vec.Matrix4.Type>}
- * @private
- */
-goog.vec.Matrix4.tmpMatrix4_ = [
-  goog.vec.Matrix4.create()
-];

+ 0 - 513
support/client/lib/closure/vec/quaternion.js

@@ -1,513 +0,0 @@
-// Copyright 2011 The Closure Library Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS-IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-
-/**
- * @fileoverview Implements quaternions and their conversion functions. In this
- * implementation, quaternions are represented as 4 element vectors with the
- * first 3 elements holding the imaginary components and the 4th element holding
- * the real component.
- *
- */
-goog.provide('goog.vec.Quaternion');
-
-goog.require('goog.vec');
-goog.require('goog.vec.Vec3');
-goog.require('goog.vec.Vec4');
-
-
-/** @typedef {goog.vec.Float32} */ goog.vec.Quaternion.Float32;
-/** @typedef {goog.vec.Float64} */ goog.vec.Quaternion.Float64;
-/** @typedef {goog.vec.Number} */ goog.vec.Quaternion.Number;
-/** @typedef {goog.vec.AnyType} */ goog.vec.Quaternion.AnyType;
-
-//The following type are deprecated - use the above types instead.
-/** @typedef {goog.vec.Vec4.Type} */ goog.vec.Quaternion.Type;
-/** @typedef {goog.vec.ArrayType} */ goog.vec.Quaternion.QuaternionLike;
-
-
-/**
- * @typedef {goog.vec.Vec4.Type}
- */
-goog.vec.Quaternion.Type;
-
-
-/**
- * Creates a Float32 quaternion, initialized to zero.
- *
- * @return {!goog.vec.Quaternion.Float32} The new quaternion.
- */
-goog.vec.Quaternion.createFloat32 = goog.vec.Vec4.createFloat32;
-
-
-/**
- * Creates a Float64 quaternion, initialized to zero.
- *
- * @return {goog.vec.Quaternion.Float64} The new quaternion.
- */
-goog.vec.Quaternion.createFloat64 = goog.vec.Vec4.createFloat64;
-
-
-/**
- * Creates a Number quaternion, initialized to zero.
- *
- * @return {goog.vec.Quaternion.Number} The new quaternion.
- */
-goog.vec.Quaternion.createNumber = goog.vec.Vec4.createNumber;
-
-
-/**
- * Creates a quaternion, initialized to zero.
- *
- * @deprecated Use createFloat32.
- * @return {!goog.vec.Quaternion.Type} The new quaternion.
- */
-goog.vec.Quaternion.create = goog.vec.Vec4.create;
-
-
-/**
- * Creates a new Float32 quaternion initialized with the values from the
- * supplied array.
- *
- * @param {goog.vec.AnyType} vec The source 4 element array.
- * @return {!goog.vec.Quaternion.Float32} The new quaternion.
- */
-goog.vec.Quaternion.createFloat32FromArray =
-    goog.vec.Vec4.createFloat32FromArray;
-
-
-/**
- * Creates a new Float64 quaternion initialized with the values from the
- * supplied array.
- *
- * @param {goog.vec.AnyType} vec The source 4 element array.
- * @return {!goog.vec.Quaternion.Float64} The new quaternion.
- */
-goog.vec.Quaternion.createFloat64FromArray =
-    goog.vec.Vec4.createFloat64FromArray;
-
-
-/**
- * Creates a new quaternion initialized with the values from the supplied
- * array.
- *
- * @deprecated Use createFloat32FromArray.
- * @param {!goog.vec.Quaternion.QuaternionLike} vec The source 4 element array.
- * @return {!goog.vec.Quaternion.Type} The new quaternion.
- */
-goog.vec.Quaternion.createFromArray =
-    goog.vec.Vec4.createFromArray;
-
-
-/**
- * Creates a new Float32 quaternion initialized with the supplied values.
- *
- * @param {number} v0 The value for element at index 0.
- * @param {number} v1 The value for element at index 1.
- * @param {number} v2 The value for element at index 2.
- * @param {number} v3 The value for element at index 3.
- * @return {!goog.vec.Quaternion.Float32} The new quaternion.
- */
-goog.vec.Quaternion.createFloat32FromValues =
-    goog.vec.Vec4.createFloat32FromValues;
-
-
-/**
- * Creates a new Float64 quaternion initialized with the supplied values.
- *
- * @param {number} v0 The value for element at index 0.
- * @param {number} v1 The value for element at index 1.
- * @param {number} v2 The value for element at index 2.
- * @param {number} v3 The value for element at index 3.
- * @return {!goog.vec.Quaternion.Float64} The new quaternion.
- */
-goog.vec.Quaternion.createFloat64FromValues =
-    goog.vec.Vec4.createFloat64FromValues;
-
-
-/**
- * Creates a new quaternion initialized with the supplied values.
- *
- * @deprecated Use createFloat32FromValues.
- * @param {number} v0 The value for element at index 0.
- * @param {number} v1 The value for element at index 1.
- * @param {number} v2 The value for element at index 2.
- * @param {number} v3 The value for element at index 3.
- * @return {!goog.vec.Quaternion.Type} The new quaternion.
- */
-goog.vec.Quaternion.createFromValues =
-    goog.vec.Vec4.createFromValues;
-
-
-/**
- * Creates a clone of the given Float32 quaternion.
- *
- * @param {goog.vec.Quaternion.Float32} q The source quaternion.
- * @return {goog.vec.Quaternion.Float32} The new quaternion.
- */
-goog.vec.Quaternion.cloneFloat32 = goog.vec.Vec4.cloneFloat32;
-
-
-/**
- * Creates a clone of the given Float64 quaternion.
- *
- * @param {goog.vec.Quaternion.Float64} q The source quaternion.
- * @return {goog.vec.Quaternion.Float64} The new quaternion.
- */
-goog.vec.Quaternion.cloneFloat64 = goog.vec.Vec4.cloneFloat64;
-
-
-/**
- * Creates a clone of the given quaternion.
- *
- * @deprecated Use cloneFloat32.
- * @param {goog.vec.Quaternion.QuaternionLike} q The source quaternion.
- * @return {!goog.vec.Quaternion.Type} The new quaternion.
- */
-goog.vec.Quaternion.clone = goog.vec.Vec4.clone;
-
-
-/**
- * Initializes the quaternion with the given values.
- *
- * @param {goog.vec.Quaternion.AnyType} q The quaternion to receive
- *     the values.
- * @param {number} v0 The value for element at index 0.
- * @param {number} v1 The value for element at index 1.
- * @param {number} v2 The value for element at index 2.
- * @param {number} v3 The value for element at index 3.
- * @return {!goog.vec.Vec4.AnyType} return q so that operations can be
- *     chained together.
- */
-goog.vec.Quaternion.setFromValues = goog.vec.Vec4.setFromValues;
-
-
-/**
- * Initializes the quaternion with the given array of values.
- *
- * @param {goog.vec.Quaternion.AnyType} q The quaternion to receive
- *     the values.
- * @param {goog.vec.AnyType} values The array of values.
- * @return {!goog.vec.Quaternion.AnyType} return q so that operations can be
- *     chained together.
- */
-goog.vec.Quaternion.setFromArray = goog.vec.Vec4.setFromArray;
-
-
-/**
- * Adds the two quaternions.
- *
- * @param {goog.vec.Quaternion.AnyType} quat0 The first addend.
- * @param {goog.vec.Quaternion.AnyType} quat1 The second addend.
- * @param {goog.vec.Quaternion.AnyType} resultQuat The quaternion to
- *     receive the result. May be quat0 or quat1.
- */
-goog.vec.Quaternion.add = goog.vec.Vec4.add;
-
-
-/**
- * Negates a quaternion, storing the result into resultQuat.
- *
- * @param {goog.vec.Quaternion.AnyType} quat0 The quaternion to negate.
- * @param {goog.vec.Quaternion.AnyType} resultQuat The quaternion to
- *     receive the result. May be quat0.
- */
-goog.vec.Quaternion.negate = goog.vec.Vec4.negate;
-
-
-/**
- * Multiplies each component of quat0 with scalar storing the product into
- * resultVec.
- *
- * @param {goog.vec.Quaternion.AnyType} quat0 The source quaternion.
- * @param {number} scalar The value to multiply with each component of quat0.
- * @param {goog.vec.Quaternion.AnyType} resultQuat The quaternion to
- *     receive the result. May be quat0.
- */
-goog.vec.Quaternion.scale = goog.vec.Vec4.scale;
-
-
-/**
- * Returns the square magnitude of the given quaternion.
- *
- * @param {goog.vec.Quaternion.AnyType} quat0 The quaternion.
- * @return {number} The magnitude of the quaternion.
- */
-goog.vec.Quaternion.magnitudeSquared =
-    goog.vec.Vec4.magnitudeSquared;
-
-
-/**
- * Returns the magnitude of the given quaternion.
- *
- * @param {goog.vec.Quaternion.AnyType} quat0 The quaternion.
- * @return {number} The magnitude of the quaternion.
- */
-goog.vec.Quaternion.magnitude =
-    goog.vec.Vec4.magnitude;
-
-
-/**
- * Normalizes the given quaternion storing the result into resultVec.
- *
- * @param {goog.vec.Quaternion.AnyType} quat0 The quaternion to
- *     normalize.
- * @param {goog.vec.Quaternion.AnyType} resultQuat The quaternion to
- *     receive the result. May be quat0.
- */
-goog.vec.Quaternion.normalize = goog.vec.Vec4.normalize;
-
-
-/**
- * Computes the dot (scalar) product of two quaternions.
- *
- * @param {goog.vec.Quaternion.AnyType} q0 The first quaternion.
- * @param {goog.vec.Quaternion.AnyType} q1 The second quaternion.
- * @return {number} The scalar product.
- */
-goog.vec.Quaternion.dot = goog.vec.Vec4.dot;
-
-
-/**
- * Computes the conjugate of the quaternion in quat storing the result into
- * resultQuat.
- *
- * @param {goog.vec.Quaternion.AnyType} quat The source quaternion.
- * @param {goog.vec.Quaternion.AnyType} resultQuat The quaternion to
- *     receive the result.
- * @return {!goog.vec.Quaternion.AnyType} Return q so that
- *     operations can be chained together.
- */
-goog.vec.Quaternion.conjugate = function(quat, resultQuat) {
-  resultQuat[0] = -quat[0];
-  resultQuat[1] = -quat[1];
-  resultQuat[2] = -quat[2];
-  resultQuat[3] = quat[3];
-  return resultQuat;
-};
-
-
-/**
- * Concatenates the two quaternions storing the result into resultQuat.
- *
- * @param {goog.vec.Quaternion.AnyType} quat0 The first quaternion.
- * @param {goog.vec.Quaternion.AnyType} quat1 The second quaternion.
- * @param {goog.vec.Quaternion.AnyType} resultQuat The quaternion to
- *     receive the result.
- * @return {!goog.vec.Quaternion.AnyType} Return q so that
- *     operations can be chained together.
- */
-goog.vec.Quaternion.concat = function(quat0, quat1, resultQuat) {
-  var x0 = quat0[0], y0 = quat0[1], z0 = quat0[2], w0 = quat0[3];
-  var x1 = quat1[0], y1 = quat1[1], z1 = quat1[2], w1 = quat1[3];
-  resultQuat[0] = w0 * x1 + x0 * w1 + y0 * z1 - z0 * y1;
-  resultQuat[1] = w0 * y1 - x0 * z1 + y0 * w1 + z0 * x1;
-  resultQuat[2] = w0 * z1 + x0 * y1 - y0 * x1 + z0 * w1;
-  resultQuat[3] = w0 * w1 - x0 * x1 - y0 * y1 - z0 * z1;
-  return resultQuat;
-};
-
-
-/**
- * Generates a unit quaternion from the given angle-axis rotation pair.
- * The rotation axis is not required to be a unit vector, but should
- * have non-zero length.  The angle should be specified in radians.
- *
- * @param {number} angle The angle (in radians) to rotate about the axis.
- * @param {goog.vec.Quaternion.AnyType} axis Unit vector specifying the
- *     axis of rotation.
- * @param {goog.vec.Quaternion.AnyType} quat Unit quaternion to store the
- *     result.
- * @return {goog.vec.Quaternion.AnyType} Return q so that
- *     operations can be chained together.
- */
-goog.vec.Quaternion.fromAngleAxis = function(angle, axis, quat) {
-  // Normalize the axis of rotation.
-  goog.vec.Vec3.normalize(axis, axis);
-
-  var halfAngle = 0.5 * angle;
-  var sin = Math.sin(halfAngle);
-  goog.vec.Quaternion.setFromValues(
-      quat, sin * axis[0], sin * axis[1], sin * axis[2], Math.cos(halfAngle));
-
-  // Normalize the resulting quaternion.
-  goog.vec.Quaternion.normalize(quat, quat);
-  return quat;
-};
-
-
-/**
- * Generates an angle-axis rotation pair from a unit quaternion.
- * The quaternion is assumed to be of unit length.  The calculated
- * values are returned via the passed 'axis' object and the 'angle'
- * number returned by the function itself. The returned rotation axis
- * is a non-zero length unit vector, and the returned angle is in
- * radians in the range of [-PI, +PI].
- *
- * @param {goog.vec.Quaternion.AnyType} quat Unit quaternion to convert.
- * @param {goog.vec.Quaternion.AnyType} axis Vector to store the returned
- *     rotation axis.
- * @return {number} angle Angle (in radians) to rotate about 'axis'.
- *     The range of the returned angle is [-PI, +PI].
- */
-goog.vec.Quaternion.toAngleAxis = function(quat, axis) {
-  var angle = 2 * Math.acos(quat[3]);
-  var magnitude = Math.min(Math.max(1 - quat[3] * quat[3], 0), 1);
-  if (magnitude < goog.vec.EPSILON) {
-    // This is nearly an identity rotation, so just use a fixed +X axis.
-    goog.vec.Vec3.setFromValues(axis, 1, 0, 0);
-  } else {
-    // Compute the proper rotation axis.
-    goog.vec.Vec3.setFromValues(axis, quat[0], quat[1], quat[2]);
-    // Make sure the rotation axis is of unit length.
-    goog.vec.Vec3.normalize(axis, axis);
-  }
-  // Adjust the range of the returned angle to [-PI, +PI].
-  if (angle > Math.PI) {
-    angle -= 2 * Math.PI;
-  }
-  return angle;
-};
-
-
-/**
- * Generates the quaternion from the given rotation matrix.
- *
- * @param {goog.vec.Quaternion.AnyType} matrix The source matrix.
- * @param {goog.vec.Quaternion.AnyType} quat The resulting quaternion.
- * @return {!goog.vec.Quaternion.AnyType} Return q so that
- *     operations can be chained together.
- */
-goog.vec.Quaternion.fromRotationMatrix4 = function(matrix, quat) {
-  var sx = matrix[0], sy = matrix[5], sz = matrix[10];
-  quat[3] = Math.sqrt(Math.max(0, 1 + sx + sy + sz)) / 2;
-  quat[0] = Math.sqrt(Math.max(0, 1 + sx - sy - sz)) / 2;
-  quat[1] = Math.sqrt(Math.max(0, 1 - sx + sy - sz)) / 2;
-  quat[2] = Math.sqrt(Math.max(0, 1 - sx - sy + sz)) / 2;
-
-  quat[0] = (matrix[6] - matrix[9] < 0) != (quat[0] < 0) ? -quat[0] : quat[0];
-  quat[1] = (matrix[8] - matrix[2] < 0) != (quat[1] < 0) ? -quat[1] : quat[1];
-  quat[2] = (matrix[1] - matrix[4] < 0) != (quat[2] < 0) ? -quat[2] : quat[2];
-  return quat;
-};
-
-
-/**
- * Generates the rotation matrix from the given quaternion.
- *
- * @param {goog.vec.Quaternion.AnyType} quat The source quaternion.
- * @param {goog.vec.AnyType} matrix The resulting matrix.
- * @return {!goog.vec.AnyType} Return resulting matrix so that
- *     operations can be chained together.
- */
-goog.vec.Quaternion.toRotationMatrix4 = function(quat, matrix) {
-  var x = quat[0], y = quat[1], z = quat[2], w = quat[3];
-  var x2 = 2 * x, y2 = 2 * y, z2 = 2 * z;
-  var wx = x2 * w;
-  var wy = y2 * w;
-  var wz = z2 * w;
-  var xx = x2 * x;
-  var xy = y2 * x;
-  var xz = z2 * x;
-  var yy = y2 * y;
-  var yz = z2 * y;
-  var zz = z2 * z;
-
-  matrix[0] = 1 - (yy + zz);
-  matrix[1] = xy + wz;
-  matrix[2] = xz - wy;
-  matrix[3] = 0;
-  matrix[4] = xy - wz;
-  matrix[5] = 1 - (xx + zz);
-  matrix[6] = yz + wx;
-  matrix[7] = 0;
-  matrix[8] = xz + wy;
-  matrix[9] = yz - wx;
-  matrix[10] = 1 - (xx + yy);
-  matrix[11] = 0;
-  matrix[12] = 0;
-  matrix[13] = 0;
-  matrix[14] = 0;
-  matrix[15] = 1;
-  return matrix;
-};
-
-
-/**
- * Computes the spherical linear interpolated value from the given quaternions
- * q0 and q1 according to the coefficient t. The resulting quaternion is stored
- * in resultQuat.
- *
- * @param {goog.vec.Quaternion.AnyType} q0 The first quaternion.
- * @param {goog.vec.Quaternion.AnyType} q1 The second quaternion.
- * @param {number} t The interpolating coefficient.
- * @param {goog.vec.Quaternion.AnyType} resultQuat The quaternion to
- *     receive the result.
- * @return {goog.vec.Quaternion.AnyType} Return q so that
- *     operations can be chained together.
- */
-goog.vec.Quaternion.slerp = function(q0, q1, t, resultQuat) {
-  // Compute the dot product between q0 and q1 (cos of the angle between q0 and
-  // q1). If it's outside the interval [-1,1], then the arccos is not defined.
-  // The usual reason for this is that q0 and q1 are colinear. In this case
-  // the angle between the two is zero, so just return q1.
-  var cosVal = goog.vec.Quaternion.dot(q0, q1);
-  if (cosVal > 1 || cosVal < -1) {
-    goog.vec.Vec4.setFromArray(resultQuat, q1);
-    return resultQuat;
-  }
-
-  // Quaternions are a double cover on the space of rotations. That is, q and -q
-  // represent the same rotation. Thus we have two possibilities when
-  // interpolating between q0 and q1: going the short way or the long way. We
-  // prefer the short way since that is the likely expectation from users.
-  var factor = 1;
-  if (cosVal < 0) {
-    factor = -1;
-    cosVal = -cosVal;
-  }
-
-  // Compute the angle between q0 and q1. If it's very small, then just return
-  // q1 to avoid a very large denominator below.
-  var angle = Math.acos(cosVal);
-  if (angle <= goog.vec.EPSILON) {
-    goog.vec.Vec4.setFromArray(resultQuat, q1);
-    return resultQuat;
-  }
-
-  // Compute the coefficients and interpolate.
-  var invSinVal = 1 / Math.sin(angle);
-  var c0 = Math.sin((1 - t) * angle) * invSinVal;
-  var c1 = factor * Math.sin(t * angle) * invSinVal;
-
-  resultQuat[0] = q0[0] * c0 + q1[0] * c1;
-  resultQuat[1] = q0[1] * c0 + q1[1] * c1;
-  resultQuat[2] = q0[2] * c0 + q1[2] * c1;
-  resultQuat[3] = q0[3] * c0 + q1[3] * c1;
-  return resultQuat;
-};
-
-
-/**
- * Compute the simple linear interpolation of the two quaternions q0 and q1
- * according to the coefficient t. The resulting quaternion is stored in
- * resultVec.
- *
- * @param {goog.vec.Quaternion.AnyType} q0 The first quaternion.
- * @param {goog.vec.Quaternion.AnyType} q1 The second quaternion.
- * @param {number} t The interpolation factor.
- * @param {goog.vec.Quaternion.AnyType} resultQuat The quaternion to
- *     receive the results (may be q0 or q1).
- */
-goog.vec.Quaternion.nlerp = goog.vec.Vec4.lerp;

+ 0 - 94
support/client/lib/closure/vec/ray.js

@@ -1,94 +0,0 @@
-// Copyright 2011 The Closure Library Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS-IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-/**
- * @fileoverview Implements a 3D ray that are compatible with WebGL.
- * Each element is a float64 in case high precision is required.
- * The API is structured to avoid unnecessary memory allocations.
- * The last parameter will typically be the output vector and an
- * object can be both an input and output parameter to all methods
- * except where noted.
- *
- */
-goog.provide('goog.vec.Ray');
-
-goog.require('goog.vec.Vec3');
-
-
-
-/**
- * Constructs a new ray with an optional origin and direction. If not specified,
- * the default is [0, 0, 0].
- * @param {goog.vec.Vec3.AnyType=} opt_origin The optional origin.
- * @param {goog.vec.Vec3.AnyType=} opt_dir The optional direction.
- * @constructor
- */
-goog.vec.Ray = function(opt_origin, opt_dir) {
-  /**
-   * @type {goog.vec.Vec3.Number}
-   */
-  this.origin = goog.vec.Vec3.createNumber();
-  if (opt_origin) {
-    goog.vec.Vec3.setFromArray(this.origin, opt_origin);
-  }
-
-  /**
-   * @type {goog.vec.Vec3.Number}
-   */
-  this.dir = goog.vec.Vec3.createNumber();
-  if (opt_dir) {
-    goog.vec.Vec3.setFromArray(this.dir, opt_dir);
-  }
-};
-
-
-/**
- * Sets the origin and direction of the ray.
- * @param {goog.vec.AnyType} origin The new origin.
- * @param {goog.vec.AnyType} dir The new direction.
- */
-goog.vec.Ray.prototype.set = function(origin, dir) {
-  goog.vec.Vec3.setFromArray(this.origin, origin);
-  goog.vec.Vec3.setFromArray(this.dir, dir);
-};
-
-
-/**
- * Sets the origin of the ray.
- * @param {goog.vec.AnyType} origin the new origin.
- */
-goog.vec.Ray.prototype.setOrigin = function(origin) {
-  goog.vec.Vec3.setFromArray(this.origin, origin);
-};
-
-
-/**
- * Sets the direction of the ray.
- * @param {goog.vec.AnyType} dir The new direction.
- */
-goog.vec.Ray.prototype.setDir = function(dir) {
-  goog.vec.Vec3.setFromArray(this.dir, dir);
-};
-
-
-/**
- * Returns true if this ray is equal to the other ray.
- * @param {goog.vec.Ray} other The other ray.
- * @return {boolean} True if this ray is equal to the other ray.
- */
-goog.vec.Ray.prototype.equals = function(other) {
-  return other != null &&
-      goog.vec.Vec3.equals(this.origin, other.origin) &&
-      goog.vec.Vec3.equals(this.dir, other.dir);
-};

+ 0 - 65
support/client/lib/closure/vec/vec.js

@@ -1,65 +0,0 @@
-// Copyright 2011 The Closure Library Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS-IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-
-/**
- * @fileoverview Supplies global data types and constants for the vector math
- *     library.
- */
-goog.provide('goog.vec');
-
-/**
- * On platforms that don't have native Float32Array or Float64Array support we
- * use a javascript implementation so that this math library can be used on all
- * platforms.
- */
-goog.require('goog.vec.Float32Array');
-goog.require('goog.vec.Float64Array');
-
-// All vector and matrix operations are based upon arrays of numbers using
-// either Float32Array, Float64Array, or a standard Javascript Array of
-// Numbers.
-
-
-/** @typedef {Float32Array} */
-goog.vec.Float32;
-
-
-/** @typedef {Float64Array} */
-goog.vec.Float64;
-
-
-/** @typedef {Array.<number>} */
-goog.vec.Number;
-
-
-/** @typedef {goog.vec.Float32|goog.vec.Float64|goog.vec.Number} */
-goog.vec.AnyType;
-
-
-/**
- * @deprecated Use AnyType.
- * @typedef {Float32Array|Array.<number>}
- */
-goog.vec.ArrayType;
-
-
-/**
- * For graphics work, 6 decimal places of accuracy are typically all that is
- * required.
- *
- * @type {number}
- * @const
- */
-goog.vec.EPSILON = 1e-6;

+ 0 - 375
support/client/lib/closure/vec/vec2.js

@@ -1,375 +0,0 @@
-// Copyright 2012 The Closure Library Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS-IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-/**
- * @fileoverview Definition of 2 element vectors.  This follows the same design
- * patterns as Vec3 and Vec4.
- *
- */
-
-goog.provide('goog.vec.Vec2');
-
-goog.require('goog.vec');
-
-
-/** @typedef {goog.vec.Float32} */ goog.vec.Vec2.Float32;
-/** @typedef {goog.vec.Float64} */ goog.vec.Vec2.Float64;
-/** @typedef {goog.vec.Number} */ goog.vec.Vec2.Number;
-/** @typedef {goog.vec.AnyType} */ goog.vec.Vec2.AnyType;
-
-
-/**
- * Creates a 2 element vector of Float32. The array is initialized to zero.
- *
- * @return {!goog.vec.Vec2.Float32} The new 2 element array.
- */
-goog.vec.Vec2.createFloat32 = function() {
-  return new Float32Array(2);
-};
-
-
-/**
- * Creates a 2 element vector of Float64. The array is initialized to zero.
- *
- * @return {!goog.vec.Vec2.Float64} The new 2 element array.
- */
-goog.vec.Vec2.createFloat64 = function() {
-  return new Float64Array(2);
-};
-
-
-/**
- * Creates a 2 element vector of Number. The array is initialized to zero.
- *
- * @return {!goog.vec.Vec2.Number} The new 2 element array.
- */
-goog.vec.Vec2.createNumber = function() {
-  var a = new Array(2);
-  goog.vec.Vec2.setFromValues(a, 0, 0);
-  return a;
-};
-
-
-/**
- * Creates a new 2 element FLoat32 vector initialized with the value from the
- * given array.
- *
- * @param {goog.vec.Vec2.AnyType} vec The source 2 element array.
- * @return {!goog.vec.Vec2.Float32} The new 2 element array.
- */
-goog.vec.Vec2.createFloat32FromArray = function(vec) {
-  var newVec = goog.vec.Vec2.createFloat32();
-  goog.vec.Vec2.setFromArray(newVec, vec);
-  return newVec;
-};
-
-
-/**
- * Creates a new 2 element Float32 vector initialized with the supplied values.
- *
- * @param {number} vec0 The value for element at index 0.
- * @param {number} vec1 The value for element at index 1.
- * @return {!goog.vec.Vec2.Float32} The new vector.
- */
-goog.vec.Vec2.createFloat32FromValues = function(vec0, vec1) {
-  var a = goog.vec.Vec2.createFloat32();
-  goog.vec.Vec2.setFromValues(a, vec0, vec1);
-  return a;
-};
-
-
-/**
- * Creates a clone of the given 2 element Float32 vector.
- *
- * @param {goog.vec.Vec2.Float32} vec The source 2 element vector.
- * @return {!goog.vec.Vec2.Float32} The new cloned vector.
- */
-goog.vec.Vec2.cloneFloat32 = goog.vec.Vec2.createFloat32FromArray;
-
-
-/**
- * Creates a new 2 element Float64 vector initialized with the value from the
- * given array.
- *
- * @param {goog.vec.Vec2.AnyType} vec The source 2 element array.
- * @return {!goog.vec.Vec2.Float64} The new 2 element array.
- */
-goog.vec.Vec2.createFloat64FromArray = function(vec) {
-  var newVec = goog.vec.Vec2.createFloat64();
-  goog.vec.Vec2.setFromArray(newVec, vec);
-  return newVec;
-};
-
-
-/**
-* Creates a new 2 element Float64 vector initialized with the supplied values.
-*
-* @param {number} vec0 The value for element at index 0.
-* @param {number} vec1 The value for element at index 1.
-* @return {!goog.vec.Vec2.Float64} The new vector.
-*/
-goog.vec.Vec2.createFloat64FromValues = function(vec0, vec1) {
-  var vec = goog.vec.Vec2.createFloat64();
-  goog.vec.Vec2.setFromValues(vec, vec0, vec1);
-  return vec;
-};
-
-
-/**
- * Creates a clone of the given 2 element vector.
- *
- * @param {goog.vec.Vec2.Float64} vec The source 2 element vector.
- * @return {!goog.vec.Vec2.Float64} The new cloned vector.
- */
-goog.vec.Vec2.cloneFloat64 = goog.vec.Vec2.createFloat64FromArray;
-
-
-/**
- * Initializes the vector with the given values.
- *
- * @param {goog.vec.Vec2.AnyType} vec The vector to receive the values.
- * @param {number} vec0 The value for element at index 0.
- * @param {number} vec1 The value for element at index 1.
- * @return {!goog.vec.Vec2.AnyType} Return vec so that operations can be
- *     chained together.
- */
-goog.vec.Vec2.setFromValues = function(vec, vec0, vec1) {
-  vec[0] = vec0;
-  vec[1] = vec1;
-  return vec;
-};
-
-
-/**
- * Initializes the vector with the given array of values.
- *
- * @param {goog.vec.Vec2.AnyType} vec The vector to receive the
- *     values.
- * @param {goog.vec.Vec2.AnyType} values The array of values.
- * @return {!goog.vec.Vec2.AnyType} Return vec so that operations can be
- *     chained together.
- */
-goog.vec.Vec2.setFromArray = function(vec, values) {
-  vec[0] = values[0];
-  vec[1] = values[1];
-  return vec;
-};
-
-
-/**
- * Performs a component-wise addition of vec0 and vec1 together storing the
- * result into resultVec.
- *
- * @param {goog.vec.Vec2.AnyType} vec0 The first addend.
- * @param {goog.vec.Vec2.AnyType} vec1 The second addend.
- * @param {goog.vec.Vec2.AnyType} resultVec The vector to
- *     receive the result. May be vec0 or vec1.
- * @return {!goog.vec.Vec2.AnyType} Return resultVec so that operations can be
- *     chained together.
- */
-goog.vec.Vec2.add = function(vec0, vec1, resultVec) {
-  resultVec[0] = vec0[0] + vec1[0];
-  resultVec[1] = vec0[1] + vec1[1];
-  return resultVec;
-};
-
-
-/**
- * Performs a component-wise subtraction of vec1 from vec0 storing the
- * result into resultVec.
- *
- * @param {goog.vec.Vec2.AnyType} vec0 The minuend.
- * @param {goog.vec.Vec2.AnyType} vec1 The subtrahend.
- * @param {goog.vec.Vec2.AnyType} resultVec The vector to
- *     receive the result. May be vec0 or vec1.
- * @return {!goog.vec.Vec2.AnyType} Return resultVec so that operations can be
- *     chained together.
- */
-goog.vec.Vec2.subtract = function(vec0, vec1, resultVec) {
-  resultVec[0] = vec0[0] - vec1[0];
-  resultVec[1] = vec0[1] - vec1[1];
-  return resultVec;
-};
-
-
-/**
- * Negates vec0, storing the result into resultVec.
- *
- * @param {goog.vec.Vec2.AnyType} vec0 The vector to negate.
- * @param {goog.vec.Vec2.AnyType} resultVec The vector to
- *     receive the result. May be vec0.
- * @return {!goog.vec.Vec2.AnyType} Return resultVec so that operations can be
- *     chained together.
- */
-goog.vec.Vec2.negate = function(vec0, resultVec) {
-  resultVec[0] = -vec0[0];
-  resultVec[1] = -vec0[1];
-  return resultVec;
-};
-
-
-/**
- * Multiplies each component of vec0 with scalar storing the product into
- * resultVec.
- *
- * @param {goog.vec.Vec2.AnyType} vec0 The source vector.
- * @param {number} scalar The value to multiply with each component of vec0.
- * @param {goog.vec.Vec2.AnyType} resultVec The vector to
- *     receive the result. May be vec0.
- * @return {!goog.vec.Vec2.AnyType} Return resultVec so that operations can be
- *     chained together.
- */
-goog.vec.Vec2.scale = function(vec0, scalar, resultVec) {
-  resultVec[0] = vec0[0] * scalar;
-  resultVec[1] = vec0[1] * scalar;
-  return resultVec;
-};
-
-
-/**
- * Returns the magnitudeSquared of the given vector.
- *
- * @param {goog.vec.Vec2.AnyType} vec0 The vector.
- * @return {number} The magnitude of the vector.
- */
-goog.vec.Vec2.magnitudeSquared = function(vec0) {
-  var x = vec0[0], y = vec0[1];
-  return x * x + y * y;
-};
-
-
-/**
- * Returns the magnitude of the given vector.
- *
- * @param {goog.vec.Vec2.AnyType} vec0 The vector.
- * @return {number} The magnitude of the vector.
- */
-goog.vec.Vec2.magnitude = function(vec0) {
-  var x = vec0[0], y = vec0[1];
-  return Math.sqrt(x * x + y * y);
-};
-
-
-/**
- * Normalizes the given vector storing the result into resultVec.
- *
- * @param {goog.vec.Vec2.AnyType} vec0 The vector to normalize.
- * @param {goog.vec.Vec2.AnyType} resultVec The vector to
- *     receive the result. May be vec0.
- * @return {!goog.vec.Vec2.AnyType} Return resultVec so that operations can be
- *     chained together.
- */
-goog.vec.Vec2.normalize = function(vec0, resultVec) {
-  var ilen = 1 / goog.vec.Vec2.magnitude(vec0);
-  resultVec[0] = vec0[0] * ilen;
-  resultVec[1] = vec0[1] * ilen;
-  return resultVec;
-};
-
-
-/**
- * Returns the scalar product of vectors vec0 and vec1.
- *
- * @param {goog.vec.Vec2.AnyType} vec0 The first vector.
- * @param {goog.vec.Vec2.AnyType} vec1 The second vector.
- * @return {number} The scalar product.
- */
-goog.vec.Vec2.dot = function(vec0, vec1) {
-  return vec0[0] * vec1[0] + vec0[1] * vec1[1];
-};
-
-
-/**
- * Returns the squared distance between two points.
- *
- * @param {goog.vec.Vec2.AnyType} vec0 First point.
- * @param {goog.vec.Vec2.AnyType} vec1 Second point.
- * @return {number} The squared distance between the points.
- */
-goog.vec.Vec2.distanceSquared = function(vec0, vec1) {
-  var x = vec0[0] - vec1[0];
-  var y = vec0[1] - vec1[1];
-  return x * x + y * y;
-};
-
-
-/**
- * Returns the distance between two points.
- *
- * @param {goog.vec.Vec2.AnyType} vec0 First point.
- * @param {goog.vec.Vec2.AnyType} vec1 Second point.
- * @return {number} The distance between the points.
- */
-goog.vec.Vec2.distance = function(vec0, vec1) {
-  return Math.sqrt(goog.vec.Vec2.distanceSquared(vec0, vec1));
-};
-
-
-/**
- * Returns a unit vector pointing from one point to another.
- * If the input points are equal then the result will be all zeros.
- *
- * @param {goog.vec.Vec2.AnyType} vec0 Origin point.
- * @param {goog.vec.Vec2.AnyType} vec1 Target point.
- * @param {goog.vec.Vec2.AnyType} resultVec The vector to receive the
- *     results (may be vec0 or vec1).
- * @return {!goog.vec.Vec2.AnyType} Return resultVec so that operations can be
- *     chained together.
- */
-goog.vec.Vec2.direction = function(vec0, vec1, resultVec) {
-  var x = vec1[0] - vec0[0];
-  var y = vec1[1] - vec0[1];
-  var d = Math.sqrt(x * x + y * y);
-  if (d) {
-    d = 1 / d;
-    resultVec[0] = x * d;
-    resultVec[1] = y * d;
-  } else {
-    resultVec[0] = resultVec[1] = 0;
-  }
-  return resultVec;
-};
-
-
-/**
- * Linearly interpolate from vec0 to vec1 according to f. The value of f should
- * be in the range [0..1] otherwise the results are undefined.
- *
- * @param {goog.vec.Vec2.AnyType} vec0 The first vector.
- * @param {goog.vec.Vec2.AnyType} vec1 The second vector.
- * @param {number} f The interpolation factor.
- * @param {goog.vec.Vec2.AnyType} resultVec The vector to receive the
- *     results (may be vec0 or vec1).
- * @return {!goog.vec.Vec2.AnyType} Return resultVec so that operations can be
- *     chained together.
- */
-goog.vec.Vec2.lerp = function(vec0, vec1, f, resultVec) {
-  var x = vec0[0], y = vec0[1];
-  resultVec[0] = (vec1[0] - x) * f + x;
-  resultVec[1] = (vec1[1] - y) * f + y;
-  return resultVec;
-};
-
-
-/**
- * Returns true if the components of vec0 are equal to the components of vec1.
- *
- * @param {goog.vec.Vec2.AnyType} vec0 The first vector.
- * @param {goog.vec.Vec2.AnyType} vec1 The second vector.
- * @return {boolean} True if the vectors are equal, false otherwise.
- */
-goog.vec.Vec2.equals = function(vec0, vec1) {
-  return vec0.length == vec1.length &&
-      vec0[0] == vec1[0] && vec0[1] == vec1[1];
-};

+ 0 - 473
support/client/lib/closure/vec/vec3.js

@@ -1,473 +0,0 @@
-// Copyright 2011 The Closure Library Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS-IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-
-/**
- * @fileoverview Supplies 3 element vectors that are compatible with WebGL.
- * Each element is a float32 since that is typically the desired size of a
- * 3-vector in the GPU.  The API is structured to avoid unnecessary memory
- * allocations.  The last parameter will typically be the output vector and
- * an object can be both an input and output parameter to all methods except
- * where noted.
- *
- */
-goog.provide('goog.vec.Vec3');
-
-goog.require('goog.vec');
-
-/** @typedef {goog.vec.Float32} */ goog.vec.Vec3.Float32;
-/** @typedef {goog.vec.Float64} */ goog.vec.Vec3.Float64;
-/** @typedef {goog.vec.Number} */ goog.vec.Vec3.Number;
-/** @typedef {goog.vec.AnyType} */ goog.vec.Vec3.AnyType;
-
-// The following two types are deprecated - use the above types instead.
-/** @typedef {Float32Array} */ goog.vec.Vec3.Type;
-/** @typedef {goog.vec.ArrayType} */ goog.vec.Vec3.Vec3Like;
-
-
-/**
- * Creates a 3 element vector of Float32. The array is initialized to zero.
- *
- * @return {!goog.vec.Vec3.Float32} The new 3 element array.
- */
-goog.vec.Vec3.createFloat32 = function() {
-  return new Float32Array(3);
-};
-
-
-/**
- * Creates a 3 element vector of Float64. The array is initialized to zero.
- *
- * @return {!goog.vec.Vec3.Float64} The new 3 element array.
- */
-goog.vec.Vec3.createFloat64 = function() {
-  return new Float64Array(3);
-};
-
-
-/**
- * Creates a 3 element vector of Number. The array is initialized to zero.
- *
- * @return {!goog.vec.Vec3.Number} The new 3 element array.
- */
-goog.vec.Vec3.createNumber = function() {
-  var a = new Array(3);
-  goog.vec.Vec3.setFromValues(a, 0, 0, 0);
-  return a;
-};
-
-
-/**
- * Creates a 3 element vector of Float32Array. The array is initialized to zero.
- *
- * @deprecated Use createFloat32.
- * @return {!goog.vec.Vec3.Type} The new 3 element array.
- */
-goog.vec.Vec3.create = function() {
-  return new Float32Array(3);
-};
-
-
-/**
- * Creates a new 3 element FLoat32 vector initialized with the value from the
- * given array.
- *
- * @param {goog.vec.Vec3.AnyType} vec The source 3 element array.
- * @return {!goog.vec.Vec3.Float32} The new 3 element array.
- */
-goog.vec.Vec3.createFloat32FromArray = function(vec) {
-  var newVec = goog.vec.Vec3.createFloat32();
-  goog.vec.Vec3.setFromArray(newVec, vec);
-  return newVec;
-};
-
-
-/**
- * Creates a new 3 element Float32 vector initialized with the supplied values.
- *
- * @param {number} v0 The value for element at index 0.
- * @param {number} v1 The value for element at index 1.
- * @param {number} v2 The value for element at index 2.
- * @return {!goog.vec.Vec3.Float32} The new vector.
- */
-goog.vec.Vec3.createFloat32FromValues = function(v0, v1, v2) {
-  var a = goog.vec.Vec3.createFloat32();
-  goog.vec.Vec3.setFromValues(a, v0, v1, v2);
-  return a;
-};
-
-
-/**
- * Creates a clone of the given 3 element Float32 vector.
- *
- * @param {goog.vec.Vec3.Float32} vec The source 3 element vector.
- * @return {!goog.vec.Vec3.Float32} The new cloned vector.
- */
-goog.vec.Vec3.cloneFloat32 = goog.vec.Vec3.createFloat32FromArray;
-
-
-/**
- * Creates a new 3 element Float64 vector initialized with the value from the
- * given array.
- *
- * @param {goog.vec.Vec3.AnyType} vec The source 3 element array.
- * @return {!goog.vec.Vec3.Float64} The new 3 element array.
- */
-goog.vec.Vec3.createFloat64FromArray = function(vec) {
-  var newVec = goog.vec.Vec3.createFloat64();
-  goog.vec.Vec3.setFromArray(newVec, vec);
-  return newVec;
-};
-
-
-/**
-* Creates a new 3 element Float64 vector initialized with the supplied values.
-*
-* @param {number} v0 The value for element at index 0.
-* @param {number} v1 The value for element at index 1.
-* @param {number} v2 The value for element at index 2.
-* @return {!goog.vec.Vec3.Float64} The new vector.
-*/
-goog.vec.Vec3.createFloat64FromValues = function(v0, v1, v2) {
-  var vec = goog.vec.Vec3.createFloat64();
-  goog.vec.Vec3.setFromValues(vec, v0, v1, v2);
-  return vec;
-};
-
-
-/**
- * Creates a clone of the given 3 element vector.
- *
- * @param {goog.vec.Vec3.Float64} vec The source 3 element vector.
- * @return {!goog.vec.Vec3.Float64} The new cloned vector.
- */
-goog.vec.Vec3.cloneFloat64 = goog.vec.Vec3.createFloat64FromArray;
-
-
-/**
- * Creates a new 3 element vector initialized with the value from the given
- * array.
- *
- * @deprecated Use createFloat32FromArray.
- * @param {goog.vec.Vec3.Vec3Like} vec The source 3 element array.
- * @return {!goog.vec.Vec3.Type} The new 3 element array.
- */
-goog.vec.Vec3.createFromArray = function(vec) {
-  var newVec = goog.vec.Vec3.create();
-  goog.vec.Vec3.setFromArray(newVec, vec);
-  return newVec;
-};
-
-
-/**
- * Creates a new 3 element vector initialized with the supplied values.
- *
- * @deprecated Use createFloat32FromValues.
- * @param {number} v0 The value for element at index 0.
- * @param {number} v1 The value for element at index 1.
- * @param {number} v2 The value for element at index 2.
- * @return {!goog.vec.Vec3.Type} The new vector.
- */
-goog.vec.Vec3.createFromValues = function(v0, v1, v2) {
-  var vec = goog.vec.Vec3.create();
-  goog.vec.Vec3.setFromValues(vec, v0, v1, v2);
-  return vec;
-};
-
-
-/**
- * Creates a clone of the given 3 element vector.
- *
- * @deprecated Use cloneFloat32.
- * @param {goog.vec.Vec3.Vec3Like} vec The source 3 element vector.
- * @return {!goog.vec.Vec3.Type} The new cloned vector.
- */
-goog.vec.Vec3.clone = function(vec) {
-  var newVec = goog.vec.Vec3.create();
-  goog.vec.Vec3.setFromArray(newVec, vec);
-  return newVec;
-};
-
-
-/**
- * Initializes the vector with the given values.
- *
- * @param {goog.vec.Vec3.AnyType} vec The vector to receive the values.
- * @param {number} v0 The value for element at index 0.
- * @param {number} v1 The value for element at index 1.
- * @param {number} v2 The value for element at index 2.
- * @return {!goog.vec.Vec3.AnyType} return vec so that operations can be
- *     chained together.
- */
-goog.vec.Vec3.setFromValues = function(vec, v0, v1, v2) {
-  vec[0] = v0;
-  vec[1] = v1;
-  vec[2] = v2;
-  return vec;
-};
-
-
-/**
- * Initializes the vector with the given array of values.
- *
- * @param {goog.vec.Vec3.AnyType} vec The vector to receive the
- *     values.
- * @param {goog.vec.Vec3.AnyType} values The array of values.
- * @return {!goog.vec.Vec3.AnyType} return vec so that operations can be
- *     chained together.
- */
-goog.vec.Vec3.setFromArray = function(vec, values) {
-  vec[0] = values[0];
-  vec[1] = values[1];
-  vec[2] = values[2];
-  return vec;
-};
-
-
-/**
- * Performs a component-wise addition of vec0 and vec1 together storing the
- * result into resultVec.
- *
- * @param {goog.vec.Vec3.AnyType} vec0 The first addend.
- * @param {goog.vec.Vec3.AnyType} vec1 The second addend.
- * @param {goog.vec.Vec3.AnyType} resultVec The vector to
- *     receive the result. May be vec0 or vec1.
- * @return {!goog.vec.Vec3.AnyType} return resultVec so that operations can be
- *     chained together.
- */
-goog.vec.Vec3.add = function(vec0, vec1, resultVec) {
-  resultVec[0] = vec0[0] + vec1[0];
-  resultVec[1] = vec0[1] + vec1[1];
-  resultVec[2] = vec0[2] + vec1[2];
-  return resultVec;
-};
-
-
-/**
- * Performs a component-wise subtraction of vec1 from vec0 storing the
- * result into resultVec.
- *
- * @param {goog.vec.Vec3.AnyType} vec0 The minuend.
- * @param {goog.vec.Vec3.AnyType} vec1 The subtrahend.
- * @param {goog.vec.Vec3.AnyType} resultVec The vector to
- *     receive the result. May be vec0 or vec1.
- * @return {!goog.vec.Vec3.AnyType} return resultVec so that operations can be
- *     chained together.
- */
-goog.vec.Vec3.subtract = function(vec0, vec1, resultVec) {
-  resultVec[0] = vec0[0] - vec1[0];
-  resultVec[1] = vec0[1] - vec1[1];
-  resultVec[2] = vec0[2] - vec1[2];
-  return resultVec;
-};
-
-
-/**
- * Negates vec0, storing the result into resultVec.
- *
- * @param {goog.vec.Vec3.AnyType} vec0 The vector to negate.
- * @param {goog.vec.Vec3.AnyType} resultVec The vector to
- *     receive the result. May be vec0.
- * @return {!goog.vec.Vec3.AnyType} return resultVec so that operations can be
- *     chained together.
- */
-goog.vec.Vec3.negate = function(vec0, resultVec) {
-  resultVec[0] = -vec0[0];
-  resultVec[1] = -vec0[1];
-  resultVec[2] = -vec0[2];
-  return resultVec;
-};
-
-
-/**
- * Multiplies each component of vec0 with scalar storing the product into
- * resultVec.
- *
- * @param {goog.vec.Vec3.AnyType} vec0 The source vector.
- * @param {number} scalar The value to multiply with each component of vec0.
- * @param {goog.vec.Vec3.AnyType} resultVec The vector to
- *     receive the result. May be vec0.
- * @return {!goog.vec.Vec3.AnyType} return resultVec so that operations can be
- *     chained together.
- */
-goog.vec.Vec3.scale = function(vec0, scalar, resultVec) {
-  resultVec[0] = vec0[0] * scalar;
-  resultVec[1] = vec0[1] * scalar;
-  resultVec[2] = vec0[2] * scalar;
-  return resultVec;
-};
-
-
-/**
- * Returns the magnitudeSquared of the given vector.
- *
- * @param {goog.vec.Vec3.AnyType} vec0 The vector.
- * @return {number} The magnitude of the vector.
- */
-goog.vec.Vec3.magnitudeSquared = function(vec0) {
-  var x = vec0[0], y = vec0[1], z = vec0[2];
-  return x * x + y * y + z * z;
-};
-
-
-/**
- * Returns the magnitude of the given vector.
- *
- * @param {goog.vec.Vec3.AnyType} vec0 The vector.
- * @return {number} The magnitude of the vector.
- */
-goog.vec.Vec3.magnitude = function(vec0) {
-  var x = vec0[0], y = vec0[1], z = vec0[2];
-  return Math.sqrt(x * x + y * y + z * z);
-};
-
-
-/**
- * Normalizes the given vector storing the result into resultVec.
- *
- * @param {goog.vec.Vec3.AnyType} vec0 The vector to normalize.
- * @param {goog.vec.Vec3.AnyType} resultVec The vector to
- *     receive the result. May be vec0.
- * @return {!goog.vec.Vec3.AnyType} return resultVec so that operations can be
- *     chained together.
- */
-goog.vec.Vec3.normalize = function(vec0, resultVec) {
-  var ilen = 1 / goog.vec.Vec3.magnitude(vec0);
-  resultVec[0] = vec0[0] * ilen;
-  resultVec[1] = vec0[1] * ilen;
-  resultVec[2] = vec0[2] * ilen;
-  return resultVec;
-};
-
-
-/**
- * Returns the scalar product of vectors v0 and v1.
- *
- * @param {goog.vec.Vec3.AnyType} v0 The first vector.
- * @param {goog.vec.Vec3.AnyType} v1 The second vector.
- * @return {number} The scalar product.
- */
-goog.vec.Vec3.dot = function(v0, v1) {
-  return v0[0] * v1[0] + v0[1] * v1[1] + v0[2] * v1[2];
-};
-
-
-/**
- * Computes the vector (cross) product of v0 and v1 storing the result into
- * resultVec.
- *
- * @param {goog.vec.Vec3.AnyType} v0 The first vector.
- * @param {goog.vec.Vec3.AnyType} v1 The second vector.
- * @param {goog.vec.Vec3.AnyType} resultVec The vector to receive the
- *     results. May be either v0 or v1.
- * @return {!goog.vec.Vec3.AnyType} return resultVec so that operations can be
- *     chained together.
- */
-goog.vec.Vec3.cross = function(v0, v1, resultVec) {
-  var x0 = v0[0], y0 = v0[1], z0 = v0[2];
-  var x1 = v1[0], y1 = v1[1], z1 = v1[2];
-  resultVec[0] = y0 * z1 - z0 * y1;
-  resultVec[1] = z0 * x1 - x0 * z1;
-  resultVec[2] = x0 * y1 - y0 * x1;
-  return resultVec;
-};
-
-
-/**
- * Returns the squared distance between two points.
- *
- * @param {goog.vec.Vec3.AnyType} vec0 First point.
- * @param {goog.vec.Vec3.AnyType} vec1 Second point.
- * @return {number} The squared distance between the points.
- */
-goog.vec.Vec3.distanceSquared = function(vec0, vec1) {
-  var x = vec0[0] - vec1[0];
-  var y = vec0[1] - vec1[1];
-  var z = vec0[2] - vec1[2];
-  return x * x + y * y + z * z;
-};
-
-
-/**
- * Returns the distance between two points.
- *
- * @param {goog.vec.Vec3.AnyType} vec0 First point.
- * @param {goog.vec.Vec3.AnyType} vec1 Second point.
- * @return {number} The distance between the points.
- */
-goog.vec.Vec3.distance = function(vec0, vec1) {
-  return Math.sqrt(goog.vec.Vec3.distanceSquared(vec0, vec1));
-};
-
-
-/**
- * Returns a unit vector pointing from one point to another.
- * If the input points are equal then the result will be all zeros.
- *
- * @param {goog.vec.Vec3.AnyType} vec0 Origin point.
- * @param {goog.vec.Vec3.AnyType} vec1 Target point.
- * @param {goog.vec.Vec3.AnyType} resultVec The vector to receive the
- *     results (may be vec0 or vec1).
- * @return {!goog.vec.Vec3.AnyType} return resultVec so that operations can be
- *     chained together.
- */
-goog.vec.Vec3.direction = function(vec0, vec1, resultVec) {
-  var x = vec1[0] - vec0[0];
-  var y = vec1[1] - vec0[1];
-  var z = vec1[2] - vec0[2];
-  var d = Math.sqrt(x * x + y * y + z * z);
-  if (d) {
-    d = 1 / d;
-    resultVec[0] = x * d;
-    resultVec[1] = y * d;
-    resultVec[2] = z * d;
-  } else {
-    resultVec[0] = resultVec[1] = resultVec[2] = 0;
-  }
-  return resultVec;
-};
-
-
-/**
- * Linearly interpolate from vec0 to v1 according to f. The value of f should be
- * in the range [0..1] otherwise the results are undefined.
- *
- * @param {goog.vec.Vec3.AnyType} v0 The first vector.
- * @param {goog.vec.Vec3.AnyType} v1 The second vector.
- * @param {number} f The interpolation factor.
- * @param {goog.vec.Vec3.AnyType} resultVec The vector to receive the
- *     results (may be v0 or v1).
- * @return {!goog.vec.Vec3.AnyType} return resultVec so that operations can be
- *     chained together.
- */
-goog.vec.Vec3.lerp = function(v0, v1, f, resultVec) {
-  var x = v0[0], y = v0[1], z = v0[2];
-  resultVec[0] = (v1[0] - x) * f + x;
-  resultVec[1] = (v1[1] - y) * f + y;
-  resultVec[2] = (v1[2] - z) * f + z;
-  return resultVec;
-};
-
-
-/**
- * Returns true if the components of v0 are equal to the components of v1.
- *
- * @param {goog.vec.Vec3.AnyType} v0 The first vector.
- * @param {goog.vec.Vec3.AnyType} v1 The second vector.
- * @return {boolean} True if the vectors are equal, false otherwise.
- */
-goog.vec.Vec3.equals = function(v0, v1) {
-  return v0.length == v1.length &&
-      v0[0] == v1[0] && v0[1] == v1[1] && v0[2] == v1[2];
-};

+ 0 - 405
support/client/lib/closure/vec/vec4.js

@@ -1,405 +0,0 @@
-// Copyright 2011 The Closure Library Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS-IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-
-/**
- * @fileoverview Supplies 4 element vectors that are compatible with WebGL.
- * Each element is a float32 since that is typically the desired size of a
- * 4-vector in the GPU.  The API is structured to avoid unnecessary memory
- * allocations.  The last parameter will typically be the output vector and
- * an object can be both an input and output parameter to all methods except
- * where noted.
- *
- */
-goog.provide('goog.vec.Vec4');
-
-goog.require('goog.vec');
-
-/** @typedef {goog.vec.Float32} */ goog.vec.Vec4.Float32;
-/** @typedef {goog.vec.Float64} */ goog.vec.Vec4.Float64;
-/** @typedef {goog.vec.Number} */ goog.vec.Vec4.Number;
-/** @typedef {goog.vec.AnyType} */ goog.vec.Vec4.AnyType;
-
-// The following two types are deprecated - use the above types instead.
-/** @typedef {Float32Array} */ goog.vec.Vec4.Type;
-/** @typedef {goog.vec.ArrayType} */ goog.vec.Vec4.Vec4Like;
-
-
-/**
- * Creates a 4 element vector of Float32. The array is initialized to zero.
- *
- * @return {!goog.vec.Vec4.Float32} The new 3 element array.
- */
-goog.vec.Vec4.createFloat32 = function() {
-  return new Float32Array(4);
-};
-
-
-/**
- * Creates a 4 element vector of Float64. The array is initialized to zero.
- *
- * @return {!goog.vec.Vec4.Float64} The new 4 element array.
- */
-goog.vec.Vec4.createFloat64 = function() {
-  return new Float64Array(4);
-};
-
-
-/**
- * Creates a 4 element vector of Number. The array is initialized to zero.
- *
- * @return {!goog.vec.Vec4.Number} The new 4 element array.
- */
-goog.vec.Vec4.createNumber = function() {
-  var v = new Array(4);
-  goog.vec.Vec4.setFromValues(v, 0, 0, 0, 0);
-  return v;
-};
-
-
-/**
- * Creates a 4 element vector of Float32Array. The array is initialized to zero.
- *
- * @deprecated Use createFloat32.
- * @return {!goog.vec.Vec4.Type} The new 4 element array.
- */
-goog.vec.Vec4.create = function() {
-  return new Float32Array(4);
-};
-
-
-/**
- * Creates a new 4 element vector initialized with the value from the given
- * array.
- *
- * @deprecated Use createFloat32FromArray.
- * @param {goog.vec.Vec4.Vec4Like} vec The source 4 element array.
- * @return {!goog.vec.Vec4.Type} The new 4 element array.
- */
-goog.vec.Vec4.createFromArray = function(vec) {
-  var newVec = goog.vec.Vec4.create();
-  goog.vec.Vec4.setFromArray(newVec, vec);
-  return newVec;
-};
-
-
-/**
- * Creates a new 4 element FLoat32 vector initialized with the value from the
- * given array.
- *
- * @param {goog.vec.Vec4.AnyType} vec The source 3 element array.
- * @return {!goog.vec.Vec4.Float32} The new 3 element array.
- */
-goog.vec.Vec4.createFloat32FromArray = function(vec) {
-  var newVec = goog.vec.Vec4.createFloat32();
-  goog.vec.Vec4.setFromArray(newVec, vec);
-  return newVec;
-};
-
-
-/**
- * Creates a new 4 element Float32 vector initialized with the supplied values.
- *
- * @param {number} v0 The value for element at index 0.
- * @param {number} v1 The value for element at index 1.
- * @param {number} v2 The value for element at index 2.
- * @param {number} v3 The value for element at index 3.
- * @return {!goog.vec.Vec4.Float32} The new vector.
- */
-goog.vec.Vec4.createFloat32FromValues = function(v0, v1, v2, v3) {
-  var vec = goog.vec.Vec4.createFloat32();
-  goog.vec.Vec4.setFromValues(vec, v0, v1, v2, v3);
-  return vec;
-};
-
-
-/**
- * Creates a clone of the given 4 element Float32 vector.
- *
- * @param {goog.vec.Vec4.Float32} vec The source 3 element vector.
- * @return {!goog.vec.Vec4.Float32} The new cloned vector.
- */
-goog.vec.Vec4.cloneFloat32 = goog.vec.Vec4.createFloat32FromArray;
-
-
-/**
- * Creates a new 4 element Float64 vector initialized with the value from the
- * given array.
- *
- * @param {goog.vec.Vec4.AnyType} vec The source 4 element array.
- * @return {!goog.vec.Vec4.Float64} The new 4 element array.
- */
-goog.vec.Vec4.createFloat64FromArray = function(vec) {
-  var newVec = goog.vec.Vec4.createFloat64();
-  goog.vec.Vec4.setFromArray(newVec, vec);
-  return newVec;
-};
-
-
-/**
-* Creates a new 4 element Float64 vector initialized with the supplied values.
-*
-* @param {number} v0 The value for element at index 0.
-* @param {number} v1 The value for element at index 1.
-* @param {number} v2 The value for element at index 2.
-* @param {number} v3 The value for element at index 3.
-* @return {!goog.vec.Vec4.Float64} The new vector.
-*/
-goog.vec.Vec4.createFloat64FromValues = function(v0, v1, v2, v3) {
-  var vec = goog.vec.Vec4.createFloat64();
-  goog.vec.Vec4.setFromValues(vec, v0, v1, v2, v3);
-  return vec;
-};
-
-
-/**
- * Creates a clone of the given 4 element vector.
- *
- * @param {goog.vec.Vec4.Float64} vec The source 4 element vector.
- * @return {!goog.vec.Vec4.Float64} The new cloned vector.
- */
-goog.vec.Vec4.cloneFloat64 = goog.vec.Vec4.createFloat64FromArray;
-
-
-/**
- * Creates a new 4 element vector initialized with the supplied values.
- *
- * @deprecated Use createFloat32FromValues.
- * @param {number} v0 The value for element at index 0.
- * @param {number} v1 The value for element at index 1.
- * @param {number} v2 The value for element at index 2.
- * @param {number} v3 The value for element at index 3.
- * @return {!goog.vec.Vec4.Type} The new vector.
- */
-goog.vec.Vec4.createFromValues = function(v0, v1, v2, v3) {
-  var vec = goog.vec.Vec4.create();
-  goog.vec.Vec4.setFromValues(vec, v0, v1, v2, v3);
-  return vec;
-};
-
-
-/**
- * Creates a clone of the given 4 element vector.
- *
- * @deprecated Use cloneFloat32.
- * @param {goog.vec.Vec4.Vec4Like} vec The source 4 element vector.
- * @return {!goog.vec.Vec4.Type} The new cloned vector.
- */
-goog.vec.Vec4.clone = goog.vec.Vec4.createFromArray;
-
-
-/**
- * Initializes the vector with the given values.
- *
- * @param {goog.vec.Vec4.AnyType} vec The vector to receive the values.
- * @param {number} v0 The value for element at index 0.
- * @param {number} v1 The value for element at index 1.
- * @param {number} v2 The value for element at index 2.
- * @param {number} v3 The value for element at index 3.
- * @return {!goog.vec.Vec4.AnyType} return vec so that operations can be
- *     chained together.
- */
-goog.vec.Vec4.setFromValues = function(vec, v0, v1, v2, v3) {
-  vec[0] = v0;
-  vec[1] = v1;
-  vec[2] = v2;
-  vec[3] = v3;
-  return vec;
-};
-
-
-/**
- * Initializes the vector with the given array of values.
- *
- * @param {goog.vec.Vec4.AnyType} vec The vector to receive the
- *     values.
- * @param {goog.vec.Vec4.AnyType} values The array of values.
- * @return {!goog.vec.Vec4.AnyType} return vec so that operations can be
- *     chained together.
- */
-goog.vec.Vec4.setFromArray = function(vec, values) {
-  vec[0] = values[0];
-  vec[1] = values[1];
-  vec[2] = values[2];
-  vec[3] = values[3];
-  return vec;
-};
-
-
-/**
- * Performs a component-wise addition of vec0 and vec1 together storing the
- * result into resultVec.
- *
- * @param {goog.vec.Vec4.AnyType} vec0 The first addend.
- * @param {goog.vec.Vec4.AnyType} vec1 The second addend.
- * @param {goog.vec.Vec4.AnyType} resultVec The vector to
- *     receive the result. May be vec0 or vec1.
- * @return {!goog.vec.Vec4.AnyType} return resultVec so that operations can be
- *     chained together.
- */
-goog.vec.Vec4.add = function(vec0, vec1, resultVec) {
-  resultVec[0] = vec0[0] + vec1[0];
-  resultVec[1] = vec0[1] + vec1[1];
-  resultVec[2] = vec0[2] + vec1[2];
-  resultVec[3] = vec0[3] + vec1[3];
-  return resultVec;
-};
-
-
-/**
- * Performs a component-wise subtraction of vec1 from vec0 storing the
- * result into resultVec.
- *
- * @param {goog.vec.Vec4.AnyType} vec0 The minuend.
- * @param {goog.vec.Vec4.AnyType} vec1 The subtrahend.
- * @param {goog.vec.Vec4.AnyType} resultVec The vector to
- *     receive the result. May be vec0 or vec1.
- * @return {!goog.vec.Vec4.AnyType} return resultVec so that operations can be
- *     chained together.
- */
-goog.vec.Vec4.subtract = function(vec0, vec1, resultVec) {
-  resultVec[0] = vec0[0] - vec1[0];
-  resultVec[1] = vec0[1] - vec1[1];
-  resultVec[2] = vec0[2] - vec1[2];
-  resultVec[3] = vec0[3] - vec1[3];
-  return resultVec;
-};
-
-
-/**
- * Negates vec0, storing the result into resultVec.
- *
- * @param {goog.vec.Vec4.AnyType} vec0 The vector to negate.
- * @param {goog.vec.Vec4.AnyType} resultVec The vector to
- *     receive the result. May be vec0.
- * @return {!goog.vec.Vec4.AnyType} return resultVec so that operations can be
- *     chained together.
- */
-goog.vec.Vec4.negate = function(vec0, resultVec) {
-  resultVec[0] = -vec0[0];
-  resultVec[1] = -vec0[1];
-  resultVec[2] = -vec0[2];
-  resultVec[3] = -vec0[3];
-  return resultVec;
-};
-
-
-/**
- * Multiplies each component of vec0 with scalar storing the product into
- * resultVec.
- *
- * @param {goog.vec.Vec4.AnyType} vec0 The source vector.
- * @param {number} scalar The value to multiply with each component of vec0.
- * @param {goog.vec.Vec4.AnyType} resultVec The vector to
- *     receive the result. May be vec0.
- * @return {!goog.vec.Vec4.AnyType} return resultVec so that operations can be
- *     chained together.
- */
-goog.vec.Vec4.scale = function(vec0, scalar, resultVec) {
-  resultVec[0] = vec0[0] * scalar;
-  resultVec[1] = vec0[1] * scalar;
-  resultVec[2] = vec0[2] * scalar;
-  resultVec[3] = vec0[3] * scalar;
-  return resultVec;
-};
-
-
-/**
- * Returns the magnitudeSquared of the given vector.
- *
- * @param {goog.vec.Vec4.AnyType} vec0 The vector.
- * @return {number} The magnitude of the vector.
- */
-goog.vec.Vec4.magnitudeSquared = function(vec0) {
-  var x = vec0[0], y = vec0[1], z = vec0[2], w = vec0[3];
-  return x * x + y * y + z * z + w * w;
-};
-
-
-/**
- * Returns the magnitude of the given vector.
- *
- * @param {goog.vec.Vec4.AnyType} vec0 The vector.
- * @return {number} The magnitude of the vector.
- */
-goog.vec.Vec4.magnitude = function(vec0) {
-  var x = vec0[0], y = vec0[1], z = vec0[2], w = vec0[3];
-  return Math.sqrt(x * x + y * y + z * z + w * w);
-};
-
-
-/**
- * Normalizes the given vector storing the result into resultVec.
- *
- * @param {goog.vec.Vec4.AnyType} vec0 The vector to normalize.
- * @param {goog.vec.Vec4.AnyType} resultVec The vector to
- *     receive the result. May be vec0.
- * @return {!goog.vec.Vec4.AnyType} return resultVec so that operations can be
- *     chained together.
- */
-goog.vec.Vec4.normalize = function(vec0, resultVec) {
-  var ilen = 1 / goog.vec.Vec4.magnitude(vec0);
-  resultVec[0] = vec0[0] * ilen;
-  resultVec[1] = vec0[1] * ilen;
-  resultVec[2] = vec0[2] * ilen;
-  resultVec[3] = vec0[3] * ilen;
-  return resultVec;
-};
-
-
-/**
- * Returns the scalar product of vectors v0 and v1.
- *
- * @param {goog.vec.Vec4.AnyType} v0 The first vector.
- * @param {goog.vec.Vec4.AnyType} v1 The second vector.
- * @return {number} The scalar product.
- */
-goog.vec.Vec4.dot = function(v0, v1) {
-  return v0[0] * v1[0] + v0[1] * v1[1] + v0[2] * v1[2] + v0[3] * v1[3];
-};
-
-
-/**
- * Linearly interpolate from v0 to v1 according to f. The value of f should be
- * in the range [0..1] otherwise the results are undefined.
- *
- * @param {goog.vec.Vec4.AnyType} v0 The first vector.
- * @param {goog.vec.Vec4.AnyType} v1 The second vector.
- * @param {number} f The interpolation factor.
- * @param {goog.vec.Vec4.AnyType} resultVec The vector to receive the
- *     results (may be v0 or v1).
- * @return {!goog.vec.Vec4.AnyType} return resultVec so that operations can be
- *     chained together.
- */
-goog.vec.Vec4.lerp = function(v0, v1, f, resultVec) {
-  var x = v0[0], y = v0[1], z = v0[2], w = v0[3];
-  resultVec[0] = (v1[0] - x) * f + x;
-  resultVec[1] = (v1[1] - y) * f + y;
-  resultVec[2] = (v1[2] - z) * f + z;
-  resultVec[3] = (v1[3] - w) * f + w;
-  return resultVec;
-};
-
-
-/**
- * Returns true if the components of v0 are equal to the components of v1.
- *
- * @param {goog.vec.Vec4.AnyType} v0 The first vector.
- * @param {goog.vec.Vec4.AnyType} v1 The second vector.
- * @return {boolean} True if the vectors are equal, false otherwise.
- */
-goog.vec.Vec4.equals = function(v0, v1) {
-  return v0.length == v1.length &&
-      v0[0] == v1[0] && v0[1] == v1[1] && v0[2] == v1[2] && v0[3] == v1[3];
-};

BIN
support/client/lib/css/DroidSans-Bold.woff


BIN
support/client/lib/css/DroidSans.woff


BIN
support/client/lib/favicon-sample.ico


BIN
support/client/lib/images/animated-overlay.gif


BIN
support/client/lib/images/arrow.png


BIN
support/client/lib/images/back.png


BIN
support/client/lib/images/check.png


BIN
support/client/lib/images/compass.png


BIN
support/client/lib/images/editor.png


BIN
support/client/lib/images/editorClose.png


BIN
support/client/lib/images/loading.gif


BIN
support/client/lib/images/logo.png


BIN
support/client/lib/images/tab_About.png


BIN
support/client/lib/images/tab_Application.png


BIN
support/client/lib/images/tab_CodeEditor.png


BIN
support/client/lib/images/tab_Hierarchy.png


BIN
support/client/lib/images/tab_Models.png


BIN
support/client/lib/images/tab_Time.png


BIN
support/client/lib/images/tab_Timeline.png


BIN
support/client/lib/images/tab_UserList.png


BIN
support/client/lib/images/tab_Users.png


BIN
support/client/lib/images/tab_X.png


BIN
support/client/lib/images/ui-bg_diagonals-thick_18_b81900_40x40.png


BIN
support/client/lib/images/ui-bg_diagonals-thick_20_666666_40x40.png


BIN
support/client/lib/images/ui-bg_flat_0_aaaaaa_40x100.png


BIN
support/client/lib/images/ui-bg_flat_10_000000_40x100.png


BIN
support/client/lib/images/ui-bg_flat_75_ffffff_40x100.png


BIN
support/client/lib/images/ui-bg_glass_100_f6f6f6_1x400.png


BIN
support/client/lib/images/ui-bg_glass_100_fdf5ce_1x400.png


BIN
support/client/lib/images/ui-bg_glass_55_fbf9ee_1x400.png


BIN
support/client/lib/images/ui-bg_glass_65_ffffff_1x400.png


BIN
support/client/lib/images/ui-bg_glass_75_dadada_1x400.png


BIN
support/client/lib/images/ui-bg_glass_75_e6e6e6_1x400.png


BIN
support/client/lib/images/ui-bg_glass_95_fef1ec_1x400.png


BIN
support/client/lib/images/ui-bg_gloss-wave_35_f6a828_500x100.png


BIN
support/client/lib/images/ui-bg_highlight-soft_100_eeeeee_1x100.png


BIN
support/client/lib/images/ui-bg_highlight-soft_75_cccccc_1x100.png


BIN
support/client/lib/images/ui-bg_highlight-soft_75_ffe45c_1x100.png


BIN
support/client/lib/images/ui-icons_222222_256x240.png


BIN
support/client/lib/images/ui-icons_228ef1_256x240.png


BIN
support/client/lib/images/ui-icons_2e83ff_256x240.png


BIN
support/client/lib/images/ui-icons_454545_256x240.png


BIN
support/client/lib/images/ui-icons_888888_256x240.png


BIN
support/client/lib/images/ui-icons_cd0a0a_256x240.png


BIN
support/client/lib/images/ui-icons_ef8c08_256x240.png


BIN
support/client/lib/images/ui-icons_ffd27a_256x240.png


BIN
support/client/lib/images/ui-icons_ffffff_256x240.png


BIN
support/client/lib/images/warning.png


BIN
support/client/lib/images/x.png


BIN
support/client/lib/img/glyphicons-halflings-white.png


BIN
support/client/lib/img/glyphicons-halflings.png


+ 4 - 17
support/client/lib/index.html

@@ -44,16 +44,6 @@
 
     <script type="text/javascript" src="async.js"></script>
 
-    <script type="text/javascript" src="closure/base.js"></script>
-    <script type="text/javascript">
-        goog.require('goog.vec.Vec2')
-    </script>
-    <script type="text/javascript">
-        goog.require('goog.vec.Mat4')
-    </script>
-    <script type="text/javascript">
-        goog.require('goog.vec.Quaternion')
-    </script>
 
     <script type="text/javascript" src="crypto.js"></script>
     <script type="text/javascript" src="md5.js"></script>
@@ -90,22 +80,19 @@
         var application;
         var regex = /([^&=]+)=?([^&]*)/g;
 
+        
+
         var requireConfig = {
             paths: {
                 jquery: "jquery-1.10.2.min",
-                "jquery-ui": "jquery-ui-1.10.3.custom.min",
-                hammer: "jquery.hammer",
+                "jquery-ui": "jquery-ui-1.10.3.custom.min"
             },
             shim: {
                 "jquery-ui": {
                     deps: ["jquery"],
                     exports: "$"
                 },
-                "jquery-encoder-0.1.0": ["jquery"],
-                "hammer": {
-                    deps: ["jquery"],
-                    exports: "Hammer"
-                }
+                "jquery-encoder-0.1.0": ["jquery"] 
             }
         };
         require(requireConfig, ["jquery", "jquery-encoder-0.1.0"], function ($) {

+ 0 - 1529
support/client/lib/jquery.hammer.js

@@ -1,1529 +0,0 @@
-/*! Hammer.JS - v1.0.5 - 2013-04-07
- * http://eightmedia.github.com/hammer.js
- *
- * Copyright (c) 2013 Jorik Tangelder <j.tangelder@gmail.com>;
- * Licensed under the MIT license */
-
-(function(window, undefined) {
-    'use strict';
-
-/**
- * Hammer
- * use this to create instances
- * @param   {HTMLElement}   element
- * @param   {Object}        options
- * @returns {Hammer.Instance}
- * @constructor
- */
-var Hammer = function(element, options) {
-    return new Hammer.Instance(element, options || {});
-};
-
-// default settings
-Hammer.defaults = {
-    // add styles and attributes to the element to prevent the browser from doing
-    // its native behavior. this doesnt prevent the scrolling, but cancels
-    // the contextmenu, tap highlighting etc
-    // set to false to disable this
-    stop_browser_behavior: {
-		// this also triggers onselectstart=false for IE
-        userSelect: 'none',
-		// this makes the element blocking in IE10 >, you could experiment with the value
-		// see for more options this issue; https://github.com/EightMedia/hammer.js/issues/241
-        touchAction: 'none',
-		touchCallout: 'none',
-        contentZooming: 'none',
-        userDrag: 'none',
-        tapHighlightColor: 'rgba(0,0,0,0)'
-    }
-
-    // more settings are defined per gesture at gestures.js
-};
-
-// detect touchevents
-Hammer.HAS_POINTEREVENTS = navigator.pointerEnabled || navigator.msPointerEnabled;
-Hammer.HAS_TOUCHEVENTS = ('ontouchstart' in window);
-
-// dont use mouseevents on mobile devices
-Hammer.MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;
-Hammer.NO_MOUSEEVENTS = Hammer.HAS_TOUCHEVENTS && navigator.userAgent.match(Hammer.MOBILE_REGEX);
-
-// eventtypes per touchevent (start, move, end)
-// are filled by Hammer.event.determineEventTypes on setup
-Hammer.EVENT_TYPES = {};
-
-// direction defines
-Hammer.DIRECTION_DOWN = 'down';
-Hammer.DIRECTION_LEFT = 'left';
-Hammer.DIRECTION_UP = 'up';
-Hammer.DIRECTION_RIGHT = 'right';
-
-// pointer type
-Hammer.POINTER_MOUSE = 'mouse';
-Hammer.POINTER_TOUCH = 'touch';
-Hammer.POINTER_PEN = 'pen';
-
-// touch event defines
-Hammer.EVENT_START = 'start';
-Hammer.EVENT_MOVE = 'move';
-Hammer.EVENT_END = 'end';
-
-// hammer document where the base events are added at
-Hammer.DOCUMENT = document;
-
-// plugins namespace
-Hammer.plugins = {};
-
-// if the window events are set...
-Hammer.READY = false;
-
-/**
- * setup events to detect gestures on the document
- */
-function setup() {
-    if(Hammer.READY) {
-        return;
-    }
-
-    // find what eventtypes we add listeners to
-    Hammer.event.determineEventTypes();
-
-    // Register all gestures inside Hammer.gestures
-    for(var name in Hammer.gestures) {
-        if(Hammer.gestures.hasOwnProperty(name)) {
-            Hammer.detection.register(Hammer.gestures[name]);
-        }
-    }
-
-    // Add touch events on the document
-    Hammer.event.onTouch(Hammer.DOCUMENT, Hammer.EVENT_MOVE, Hammer.detection.detect);
-    Hammer.event.onTouch(Hammer.DOCUMENT, Hammer.EVENT_END, Hammer.detection.detect);
-
-    // Hammer is ready...!
-    Hammer.READY = true;
-}
-
-/**
- * create new hammer instance
- * all methods should return the instance itself, so it is chainable.
- * @param   {HTMLElement}       element
- * @param   {Object}            [options={}]
- * @returns {Hammer.Instance}
- * @constructor
- */
-Hammer.Instance = function(element, options) {
-    var self = this;
-
-    // setup HammerJS window events and register all gestures
-    // this also sets up the default options
-    setup();
-
-    this.element = element;
-
-    // start/stop detection option
-    this.enabled = true;
-
-    // merge options
-    this.options = Hammer.utils.extend(
-        Hammer.utils.extend({}, Hammer.defaults),
-        options || {});
-
-    // add some css to the element to prevent the browser from doing its native behavoir
-    if(this.options.stop_browser_behavior) {
-        Hammer.utils.stopDefaultBrowserBehavior(this.element, this.options.stop_browser_behavior);
-    }
-
-    // start detection on touchstart
-    Hammer.event.onTouch(element, Hammer.EVENT_START, function(ev) {
-        if(self.enabled) {
-            Hammer.detection.startDetect(self, ev);
-        }
-    });
-
-    // return instance
-    return this;
-};
-
-
-Hammer.Instance.prototype = {
-    /**
-     * bind events to the instance
-     * @param   {String}      gesture
-     * @param   {Function}    handler
-     * @returns {Hammer.Instance}
-     */
-    on: function onEvent(gesture, handler){
-        var gestures = gesture.split(' ');
-        for(var t=0; t<gestures.length; t++) {
-            this.element.addEventListener(gestures[t], handler, false);
-        }
-        return this;
-    },
-
-
-    /**
-     * unbind events to the instance
-     * @param   {String}      gesture
-     * @param   {Function}    handler
-     * @returns {Hammer.Instance}
-     */
-    off: function offEvent(gesture, handler){
-        var gestures = gesture.split(' ');
-        for(var t=0; t<gestures.length; t++) {
-            this.element.removeEventListener(gestures[t], handler, false);
-        }
-        return this;
-    },
-
-
-    /**
-     * trigger gesture event
-     * @param   {String}      gesture
-     * @param   {Object}      eventData
-     * @returns {Hammer.Instance}
-     */
-    trigger: function triggerEvent(gesture, eventData){
-        // create DOM event
-        var event = Hammer.DOCUMENT.createEvent('Event');
-		event.initEvent(gesture, true, true);
-		event.gesture = eventData;
-
-        // trigger on the target if it is in the instance element,
-        // this is for event delegation tricks
-        var element = this.element;
-        if(Hammer.utils.hasParent(eventData.target, element)) {
-            element = eventData.target;
-        }
-
-        element.dispatchEvent(event);
-        return this;
-    },
-
-
-    /**
-     * enable of disable hammer.js detection
-     * @param   {Boolean}   state
-     * @returns {Hammer.Instance}
-     */
-    enable: function enable(state) {
-        this.enabled = state;
-        return this;
-    }
-};
-
-/**
- * this holds the last move event,
- * used to fix empty touchend issue
- * see the onTouch event for an explanation
- * @type {Object}
- */
-var last_move_event = null;
-
-
-/**
- * when the mouse is hold down, this is true
- * @type {Boolean}
- */
-var enable_detect = false;
-
-
-/**
- * when touch events have been fired, this is true
- * @type {Boolean}
- */
-var touch_triggered = false;
-
-
-Hammer.event = {
-    /**
-     * simple addEventListener
-     * @param   {HTMLElement}   element
-     * @param   {String}        type
-     * @param   {Function}      handler
-     */
-    bindDom: function(element, type, handler) {
-        var types = type.split(' ');
-        for(var t=0; t<types.length; t++) {
-            element.addEventListener(types[t], handler, false);
-        }
-    },
-
-
-    /**
-     * touch events with mouse fallback
-     * @param   {HTMLElement}   element
-     * @param   {String}        eventType        like Hammer.EVENT_MOVE
-     * @param   {Function}      handler
-     */
-    onTouch: function onTouch(element, eventType, handler) {
-		var self = this;
-
-        this.bindDom(element, Hammer.EVENT_TYPES[eventType], function bindDomOnTouch(ev) {
-            var sourceEventType = ev.type.toLowerCase();
-
-            // onmouseup, but when touchend has been fired we do nothing.
-            // this is for touchdevices which also fire a mouseup on touchend
-            if(sourceEventType.match(/mouse/) && touch_triggered) {
-                return;
-            }
-
-            // mousebutton must be down or a touch event
-            else if( sourceEventType.match(/touch/) ||   // touch events are always on screen
-                sourceEventType.match(/pointerdown/) || // pointerevents touch
-                (sourceEventType.match(/mouse/) && ev.which === 1)   // mouse is pressed
-            ){
-                enable_detect = true;
-            }
-
-            // we are in a touch event, set the touch triggered bool to true,
-            // this for the conflicts that may occur on ios and android
-            if(sourceEventType.match(/touch|pointer/)) {
-                touch_triggered = true;
-            }
-
-            // count the total touches on the screen
-            var count_touches = 0;
-
-            // when touch has been triggered in this detection session
-            // and we are now handling a mouse event, we stop that to prevent conflicts
-            if(enable_detect) {
-                // update pointerevent
-                if(Hammer.HAS_POINTEREVENTS && eventType != Hammer.EVENT_END) {
-                    count_touches = Hammer.PointerEvent.updatePointer(eventType, ev);
-                }
-                // touch
-                else if(sourceEventType.match(/touch/)) {
-                    count_touches = ev.touches.length;
-                }
-                // mouse
-                else if(!touch_triggered) {
-                    count_touches = sourceEventType.match(/up/) ? 0 : 1;
-                }
-
-                // if we are in a end event, but when we remove one touch and
-                // we still have enough, set eventType to move
-                if(count_touches > 0 && eventType == Hammer.EVENT_END) {
-                    eventType = Hammer.EVENT_MOVE;
-                }
-                // no touches, force the end event
-                else if(!count_touches) {
-                    eventType = Hammer.EVENT_END;
-                }
-
-                // because touchend has no touches, and we often want to use these in our gestures,
-                // we send the last move event as our eventData in touchend
-                if(!count_touches && last_move_event !== null) {
-                    ev = last_move_event;
-                }
-                // store the last move event
-                else {
-                    last_move_event = ev;
-                }
-
-                // trigger the handler
-                handler.call(Hammer.detection, self.collectEventData(element, eventType, ev));
-
-                // remove pointerevent from list
-                if(Hammer.HAS_POINTEREVENTS && eventType == Hammer.EVENT_END) {
-                    count_touches = Hammer.PointerEvent.updatePointer(eventType, ev);
-                }
-            }
-
-            //debug(sourceEventType +" "+ eventType);
-
-            // on the end we reset everything
-            if(!count_touches) {
-                last_move_event = null;
-                enable_detect = false;
-                touch_triggered = false;
-                Hammer.PointerEvent.reset();
-            }
-        });
-    },
-
-
-    /**
-     * we have different events for each device/browser
-     * determine what we need and set them in the Hammer.EVENT_TYPES constant
-     */
-    determineEventTypes: function determineEventTypes() {
-        // determine the eventtype we want to set
-        var types;
-
-        // pointerEvents magic
-        if(Hammer.HAS_POINTEREVENTS) {
-            types = Hammer.PointerEvent.getEvents();
-        }
-        // on Android, iOS, blackberry, windows mobile we dont want any mouseevents
-        else if(Hammer.NO_MOUSEEVENTS) {
-            types = [
-                'touchstart',
-                'touchmove',
-                'touchend touchcancel'];
-        }
-        // for non pointer events browsers and mixed browsers,
-        // like chrome on windows8 touch laptop
-        else {
-            types = [
-                'touchstart mousedown',
-                'touchmove mousemove',
-                'touchend touchcancel mouseup'];
-        }
-
-        Hammer.EVENT_TYPES[Hammer.EVENT_START]  = types[0];
-        Hammer.EVENT_TYPES[Hammer.EVENT_MOVE]   = types[1];
-        Hammer.EVENT_TYPES[Hammer.EVENT_END]    = types[2];
-    },
-
-
-    /**
-     * create touchlist depending on the event
-     * @param   {Object}    ev
-     * @param   {String}    eventType   used by the fakemultitouch plugin
-     */
-    getTouchList: function getTouchList(ev/*, eventType*/) {
-        // get the fake pointerEvent touchlist
-        if(Hammer.HAS_POINTEREVENTS) {
-            return Hammer.PointerEvent.getTouchList();
-        }
-        // get the touchlist
-        else if(ev.touches) {
-            return ev.touches;
-        }
-        // make fake touchlist from mouse position
-        else {
-            return [{
-                identifier: 1,
-                pageX: ev.pageX,
-                pageY: ev.pageY,
-                target: ev.target
-            }];
-        }
-    },
-
-
-    /**
-     * collect event data for Hammer js
-     * @param   {HTMLElement}   element
-     * @param   {String}        eventType        like Hammer.EVENT_MOVE
-     * @param   {Object}        eventData
-     */
-    collectEventData: function collectEventData(element, eventType, ev) {
-        var touches = this.getTouchList(ev, eventType);
-
-        // find out pointerType
-        var pointerType = Hammer.POINTER_TOUCH;
-        if(ev.type.match(/mouse/) || Hammer.PointerEvent.matchType(Hammer.POINTER_MOUSE, ev)) {
-            pointerType = Hammer.POINTER_MOUSE;
-        }
-
-        return {
-            center      : Hammer.utils.getCenter(touches),
-            timeStamp   : new Date().getTime(),
-            target      : ev.target,
-            touches     : touches,
-            eventType   : eventType,
-            pointerType : pointerType,
-            srcEvent    : ev,
-
-            /**
-             * prevent the browser default actions
-             * mostly used to disable scrolling of the browser
-             */
-            preventDefault: function() {
-                if(this.srcEvent.preventManipulation) {
-                    this.srcEvent.preventManipulation();
-                }
-
-                if(this.srcEvent.preventDefault) {
-                    this.srcEvent.preventDefault();
-                }
-            },
-
-            /**
-             * stop bubbling the event up to its parents
-             */
-            stopPropagation: function() {
-                this.srcEvent.stopPropagation();
-            },
-
-            /**
-             * immediately stop gesture detection
-             * might be useful after a swipe was detected
-             * @return {*}
-             */
-            stopDetect: function() {
-                return Hammer.detection.stopDetect();
-            }
-        };
-    }
-};
-
-Hammer.PointerEvent = {
-    /**
-     * holds all pointers
-     * @type {Object}
-     */
-    pointers: {},
-
-    /**
-     * get a list of pointers
-     * @returns {Array}     touchlist
-     */
-    getTouchList: function() {
-        var self = this;
-        var touchlist = [];
-
-        // we can use forEach since pointerEvents only is in IE10
-        Object.keys(self.pointers).sort().forEach(function(id) {
-            touchlist.push(self.pointers[id]);
-        });
-        return touchlist;
-    },
-
-    /**
-     * update the position of a pointer
-     * @param   {String}   type             Hammer.EVENT_END
-     * @param   {Object}   pointerEvent
-     */
-    updatePointer: function(type, pointerEvent) {
-        if(type == Hammer.EVENT_END) {
-            this.pointers = {};
-        }
-        else {
-            pointerEvent.identifier = pointerEvent.pointerId;
-            this.pointers[pointerEvent.pointerId] = pointerEvent;
-        }
-
-        return Object.keys(this.pointers).length;
-    },
-
-    /**
-     * check if ev matches pointertype
-     * @param   {String}        pointerType     Hammer.POINTER_MOUSE
-     * @param   {PointerEvent}  ev
-     */
-    matchType: function(pointerType, ev) {
-        if(!ev.pointerType) {
-            return false;
-        }
-
-        var types = {};
-        types[Hammer.POINTER_MOUSE] = (ev.pointerType == ev.MSPOINTER_TYPE_MOUSE || ev.pointerType == Hammer.POINTER_MOUSE);
-        types[Hammer.POINTER_TOUCH] = (ev.pointerType == ev.MSPOINTER_TYPE_TOUCH || ev.pointerType == Hammer.POINTER_TOUCH);
-        types[Hammer.POINTER_PEN] = (ev.pointerType == ev.MSPOINTER_TYPE_PEN || ev.pointerType == Hammer.POINTER_PEN);
-        return types[pointerType];
-    },
-
-
-    /**
-     * get events
-     */
-    getEvents: function() {
-        return [
-            'pointerdown MSPointerDown',
-            'pointermove MSPointerMove',
-            'pointerup pointercancel MSPointerUp MSPointerCancel'
-        ];
-    },
-
-    /**
-     * reset the list
-     */
-    reset: function() {
-        this.pointers = {};
-    }
-};
-
-
-Hammer.utils = {
-    /**
-     * extend method,
-     * also used for cloning when dest is an empty object
-     * @param   {Object}    dest
-     * @param   {Object}    src
-	 * @parm	{Boolean}	merge		do a merge
-     * @returns {Object}    dest
-     */
-    extend: function extend(dest, src, merge) {
-        for (var key in src) {
-			if(dest[key] !== undefined && merge) {
-				continue;
-			}
-            dest[key] = src[key];
-        }
-        return dest;
-    },
-
-
-    /**
-     * find if a node is in the given parent
-     * used for event delegation tricks
-     * @param   {HTMLElement}   node
-     * @param   {HTMLElement}   parent
-     * @returns {boolean}       has_parent
-     */
-    hasParent: function(node, parent) {
-        while(node){
-            if(node == parent) {
-                return true;
-            }
-            node = node.parentNode;
-        }
-        return false;
-    },
-
-
-    /**
-     * get the center of all the touches
-     * @param   {Array}     touches
-     * @returns {Object}    center
-     */
-    getCenter: function getCenter(touches) {
-        var valuesX = [], valuesY = [];
-
-        for(var t= 0,len=touches.length; t<len; t++) {
-            valuesX.push(touches[t].pageX);
-            valuesY.push(touches[t].pageY);
-        }
-
-        return {
-            pageX: ((Math.min.apply(Math, valuesX) + Math.max.apply(Math, valuesX)) / 2),
-            pageY: ((Math.min.apply(Math, valuesY) + Math.max.apply(Math, valuesY)) / 2)
-        };
-    },
-
-
-    /**
-     * calculate the velocity between two points
-     * @param   {Number}    delta_time
-     * @param   {Number}    delta_x
-     * @param   {Number}    delta_y
-     * @returns {Object}    velocity
-     */
-    getVelocity: function getVelocity(delta_time, delta_x, delta_y) {
-        return {
-            x: Math.abs(delta_x / delta_time) || 0,
-            y: Math.abs(delta_y / delta_time) || 0
-        };
-    },
-
-
-    /**
-     * calculate the angle between two coordinates
-     * @param   {Touch}     touch1
-     * @param   {Touch}     touch2
-     * @returns {Number}    angle
-     */
-    getAngle: function getAngle(touch1, touch2) {
-        var y = touch2.pageY - touch1.pageY,
-            x = touch2.pageX - touch1.pageX;
-        return Math.atan2(y, x) * 180 / Math.PI;
-    },
-
-
-    /**
-     * angle to direction define
-     * @param   {Touch}     touch1
-     * @param   {Touch}     touch2
-     * @returns {String}    direction constant, like Hammer.DIRECTION_LEFT
-     */
-    getDirection: function getDirection(touch1, touch2) {
-        var x = Math.abs(touch1.pageX - touch2.pageX),
-            y = Math.abs(touch1.pageY - touch2.pageY);
-
-        if(x >= y) {
-            return touch1.pageX - touch2.pageX > 0 ? Hammer.DIRECTION_LEFT : Hammer.DIRECTION_RIGHT;
-        }
-        else {
-            return touch1.pageY - touch2.pageY > 0 ? Hammer.DIRECTION_UP : Hammer.DIRECTION_DOWN;
-        }
-    },
-
-
-    /**
-     * calculate the distance between two touches
-     * @param   {Touch}     touch1
-     * @param   {Touch}     touch2
-     * @returns {Number}    distance
-     */
-    getDistance: function getDistance(touch1, touch2) {
-        var x = touch2.pageX - touch1.pageX,
-            y = touch2.pageY - touch1.pageY;
-        return Math.sqrt((x*x) + (y*y));
-    },
-
-
-    /**
-     * calculate the scale factor between two touchLists (fingers)
-     * no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out
-     * @param   {Array}     start
-     * @param   {Array}     end
-     * @returns {Number}    scale
-     */
-    getScale: function getScale(start, end) {
-        // need two fingers...
-        if(start.length >= 2 && end.length >= 2) {
-            return this.getDistance(end[0], end[1]) /
-                this.getDistance(start[0], start[1]);
-        }
-        return 1;
-    },
-
-
-    /**
-     * calculate the rotation degrees between two touchLists (fingers)
-     * @param   {Array}     start
-     * @param   {Array}     end
-     * @returns {Number}    rotation
-     */
-    getRotation: function getRotation(start, end) {
-        // need two fingers
-        if(start.length >= 2 && end.length >= 2) {
-            return this.getAngle(end[1], end[0]) -
-                this.getAngle(start[1], start[0]);
-        }
-        return 0;
-    },
-
-
-    /**
-     * boolean if the direction is vertical
-     * @param    {String}    direction
-     * @returns  {Boolean}   is_vertical
-     */
-    isVertical: function isVertical(direction) {
-        return (direction == Hammer.DIRECTION_UP || direction == Hammer.DIRECTION_DOWN);
-    },
-
-
-    /**
-     * stop browser default behavior with css props
-     * @param   {HtmlElement}   element
-     * @param   {Object}        css_props
-     */
-    stopDefaultBrowserBehavior: function stopDefaultBrowserBehavior(element, css_props) {
-        var prop,
-            vendors = ['webkit','khtml','moz','ms','o',''];
-
-        if(!css_props || !element.style) {
-            return;
-        }
-
-        // with css properties for modern browsers
-        for(var i = 0; i < vendors.length; i++) {
-            for(var p in css_props) {
-                if(css_props.hasOwnProperty(p)) {
-                    prop = p;
-
-                    // vender prefix at the property
-                    if(vendors[i]) {
-                        prop = vendors[i] + prop.substring(0, 1).toUpperCase() + prop.substring(1);
-                    }
-
-                    // set the style
-                    element.style[prop] = css_props[p];
-                }
-            }
-        }
-
-        // also the disable onselectstart
-        if(css_props.userSelect == 'none') {
-            element.onselectstart = function() {
-                return false;
-            };
-        }
-    }
-};
-
-Hammer.detection = {
-    // contains all registred Hammer.gestures in the correct order
-    gestures: [],
-
-    // data of the current Hammer.gesture detection session
-    current: null,
-
-    // the previous Hammer.gesture session data
-    // is a full clone of the previous gesture.current object
-    previous: null,
-
-    // when this becomes true, no gestures are fired
-    stopped: false,
-
-
-    /**
-     * start Hammer.gesture detection
-     * @param   {Hammer.Instance}   inst
-     * @param   {Object}            eventData
-     */
-    startDetect: function startDetect(inst, eventData) {
-        // already busy with a Hammer.gesture detection on an element
-        if(this.current) {
-            return;
-        }
-
-        this.stopped = false;
-
-        this.current = {
-            inst        : inst, // reference to HammerInstance we're working for
-            startEvent  : Hammer.utils.extend({}, eventData), // start eventData for distances, timing etc
-            lastEvent   : false, // last eventData
-            name        : '' // current gesture we're in/detected, can be 'tap', 'hold' etc
-        };
-
-        this.detect(eventData);
-    },
-
-
-    /**
-     * Hammer.gesture detection
-     * @param   {Object}    eventData
-     * @param   {Object}    eventData
-     */
-    detect: function detect(eventData) {
-        if(!this.current || this.stopped) {
-            return;
-        }
-
-        // extend event data with calculations about scale, distance etc
-        eventData = this.extendEventData(eventData);
-
-        // instance options
-        var inst_options = this.current.inst.options;
-
-        // call Hammer.gesture handlers
-        for(var g=0,len=this.gestures.length; g<len; g++) {
-            var gesture = this.gestures[g];
-
-            // only when the instance options have enabled this gesture
-            if(!this.stopped && inst_options[gesture.name] !== false) {
-                // if a handler returns false, we stop with the detection
-                if(gesture.handler.call(gesture, eventData, this.current.inst) === false) {
-                    this.stopDetect();
-                    break;
-                }
-            }
-        }
-
-        // store as previous event event
-        if(this.current) {
-            this.current.lastEvent = eventData;
-        }
-
-        // endevent, but not the last touch, so dont stop
-        if(eventData.eventType == Hammer.EVENT_END && !eventData.touches.length-1) {
-            this.stopDetect();
-        }
-
-        return eventData;
-    },
-
-
-    /**
-     * clear the Hammer.gesture vars
-     * this is called on endDetect, but can also be used when a final Hammer.gesture has been detected
-     * to stop other Hammer.gestures from being fired
-     */
-    stopDetect: function stopDetect() {
-        // clone current data to the store as the previous gesture
-        // used for the double tap gesture, since this is an other gesture detect session
-        this.previous = Hammer.utils.extend({}, this.current);
-
-        // reset the current
-        this.current = null;
-
-        // stopped!
-        this.stopped = true;
-    },
-
-
-    /**
-     * extend eventData for Hammer.gestures
-     * @param   {Object}   ev
-     * @returns {Object}   ev
-     */
-    extendEventData: function extendEventData(ev) {
-        var startEv = this.current.startEvent;
-
-        // if the touches change, set the new touches over the startEvent touches
-        // this because touchevents don't have all the touches on touchstart, or the
-        // user must place his fingers at the EXACT same time on the screen, which is not realistic
-        // but, sometimes it happens that both fingers are touching at the EXACT same time
-        if(startEv && (ev.touches.length != startEv.touches.length || ev.touches === startEv.touches)) {
-            // extend 1 level deep to get the touchlist with the touch objects
-            startEv.touches = [];
-            for(var i=0,len=ev.touches.length; i<len; i++) {
-                startEv.touches.push(Hammer.utils.extend({}, ev.touches[i]));
-            }
-        }
-
-        var delta_time = ev.timeStamp - startEv.timeStamp,
-            delta_x = ev.center.pageX - startEv.center.pageX,
-            delta_y = ev.center.pageY - startEv.center.pageY,
-            velocity = Hammer.utils.getVelocity(delta_time, delta_x, delta_y);
-
-        Hammer.utils.extend(ev, {
-            deltaTime   : delta_time,
-
-            deltaX      : delta_x,
-            deltaY      : delta_y,
-
-            velocityX   : velocity.x,
-            velocityY   : velocity.y,
-
-            distance    : Hammer.utils.getDistance(startEv.center, ev.center),
-            angle       : Hammer.utils.getAngle(startEv.center, ev.center),
-            direction   : Hammer.utils.getDirection(startEv.center, ev.center),
-
-            scale       : Hammer.utils.getScale(startEv.touches, ev.touches),
-            rotation    : Hammer.utils.getRotation(startEv.touches, ev.touches),
-
-            startEvent  : startEv
-        });
-
-        return ev;
-    },
-
-
-    /**
-     * register new gesture
-     * @param   {Object}    gesture object, see gestures.js for documentation
-     * @returns {Array}     gestures
-     */
-    register: function register(gesture) {
-        // add an enable gesture options if there is no given
-        var options = gesture.defaults || {};
-        if(options[gesture.name] === undefined) {
-            options[gesture.name] = true;
-        }
-
-        // extend Hammer default options with the Hammer.gesture options
-        Hammer.utils.extend(Hammer.defaults, options, true);
-
-        // set its index
-        gesture.index = gesture.index || 1000;
-
-        // add Hammer.gesture to the list
-        this.gestures.push(gesture);
-
-        // sort the list by index
-        this.gestures.sort(function(a, b) {
-            if (a.index < b.index) {
-                return -1;
-            }
-            if (a.index > b.index) {
-                return 1;
-            }
-            return 0;
-        });
-
-        return this.gestures;
-    }
-};
-
-
-Hammer.gestures = Hammer.gestures || {};
-
-/**
- * Custom gestures
- * ==============================
- *
- * Gesture object
- * --------------------
- * The object structure of a gesture:
- *
- * { name: 'mygesture',
- *   index: 1337,
- *   defaults: {
- *     mygesture_option: true
- *   }
- *   handler: function(type, ev, inst) {
- *     // trigger gesture event
- *     inst.trigger(this.name, ev);
- *   }
- * }
-
- * @param   {String}    name
- * this should be the name of the gesture, lowercase
- * it is also being used to disable/enable the gesture per instance config.
- *
- * @param   {Number}    [index=1000]
- * the index of the gesture, where it is going to be in the stack of gestures detection
- * like when you build an gesture that depends on the drag gesture, it is a good
- * idea to place it after the index of the drag gesture.
- *
- * @param   {Object}    [defaults={}]
- * the default settings of the gesture. these are added to the instance settings,
- * and can be overruled per instance. you can also add the name of the gesture,
- * but this is also added by default (and set to true).
- *
- * @param   {Function}  handler
- * this handles the gesture detection of your custom gesture and receives the
- * following arguments:
- *
- *      @param  {Object}    eventData
- *      event data containing the following properties:
- *          timeStamp   {Number}        time the event occurred
- *          target      {HTMLElement}   target element
- *          touches     {Array}         touches (fingers, pointers, mouse) on the screen
- *          pointerType {String}        kind of pointer that was used. matches Hammer.POINTER_MOUSE|TOUCH
- *          center      {Object}        center position of the touches. contains pageX and pageY
- *          deltaTime   {Number}        the total time of the touches in the screen
- *          deltaX      {Number}        the delta on x axis we haved moved
- *          deltaY      {Number}        the delta on y axis we haved moved
- *          velocityX   {Number}        the velocity on the x
- *          velocityY   {Number}        the velocity on y
- *          angle       {Number}        the angle we are moving
- *          direction   {String}        the direction we are moving. matches Hammer.DIRECTION_UP|DOWN|LEFT|RIGHT
- *          distance    {Number}        the distance we haved moved
- *          scale       {Number}        scaling of the touches, needs 2 touches
- *          rotation    {Number}        rotation of the touches, needs 2 touches *
- *          eventType   {String}        matches Hammer.EVENT_START|MOVE|END
- *          srcEvent    {Object}        the source event, like TouchStart or MouseDown *
- *          startEvent  {Object}        contains the same properties as above,
- *                                      but from the first touch. this is used to calculate
- *                                      distances, deltaTime, scaling etc
- *
- *      @param  {Hammer.Instance}    inst
- *      the instance we are doing the detection for. you can get the options from
- *      the inst.options object and trigger the gesture event by calling inst.trigger
- *
- *
- * Handle gestures
- * --------------------
- * inside the handler you can get/set Hammer.detection.current. This is the current
- * detection session. It has the following properties
- *      @param  {String}    name
- *      contains the name of the gesture we have detected. it has not a real function,
- *      only to check in other gestures if something is detected.
- *      like in the drag gesture we set it to 'drag' and in the swipe gesture we can
- *      check if the current gesture is 'drag' by accessing Hammer.detection.current.name
- *
- *      @readonly
- *      @param  {Hammer.Instance}    inst
- *      the instance we do the detection for
- *
- *      @readonly
- *      @param  {Object}    startEvent
- *      contains the properties of the first gesture detection in this session.
- *      Used for calculations about timing, distance, etc.
- *
- *      @readonly
- *      @param  {Object}    lastEvent
- *      contains all the properties of the last gesture detect in this session.
- *
- * after the gesture detection session has been completed (user has released the screen)
- * the Hammer.detection.current object is copied into Hammer.detection.previous,
- * this is usefull for gestures like doubletap, where you need to know if the
- * previous gesture was a tap
- *
- * options that have been set by the instance can be received by calling inst.options
- *
- * You can trigger a gesture event by calling inst.trigger("mygesture", event).
- * The first param is the name of your gesture, the second the event argument
- *
- *
- * Register gestures
- * --------------------
- * When an gesture is added to the Hammer.gestures object, it is auto registered
- * at the setup of the first Hammer instance. You can also call Hammer.detection.register
- * manually and pass your gesture object as a param
- *
- */
-
-/**
- * Hold
- * Touch stays at the same place for x time
- * @events  hold
- */
-Hammer.gestures.Hold = {
-    name: 'hold',
-    index: 10,
-    defaults: {
-        hold_timeout	: 500,
-        hold_threshold	: 1
-    },
-    timer: null,
-    handler: function holdGesture(ev, inst) {
-        switch(ev.eventType) {
-            case Hammer.EVENT_START:
-                // clear any running timers
-                clearTimeout(this.timer);
-
-                // set the gesture so we can check in the timeout if it still is
-                Hammer.detection.current.name = this.name;
-
-                // set timer and if after the timeout it still is hold,
-                // we trigger the hold event
-                this.timer = setTimeout(function() {
-                    if(Hammer.detection.current.name == 'hold') {
-                        inst.trigger('hold', ev);
-                    }
-                }, inst.options.hold_timeout);
-                break;
-
-            // when you move or end we clear the timer
-            case Hammer.EVENT_MOVE:
-                if(ev.distance > inst.options.hold_threshold) {
-                    clearTimeout(this.timer);
-                }
-                break;
-
-            case Hammer.EVENT_END:
-                clearTimeout(this.timer);
-                break;
-        }
-    }
-};
-
-
-/**
- * Tap/DoubleTap
- * Quick touch at a place or double at the same place
- * @events  tap, doubletap
- */
-Hammer.gestures.Tap = {
-    name: 'tap',
-    index: 100,
-    defaults: {
-        tap_max_touchtime	: 250,
-        tap_max_distance	: 10,
-		tap_always			: true,
-        doubletap_distance	: 20,
-        doubletap_interval	: 300
-    },
-    handler: function tapGesture(ev, inst) {
-        if(ev.eventType == Hammer.EVENT_END) {
-            // previous gesture, for the double tap since these are two different gesture detections
-            var prev = Hammer.detection.previous,
-				did_doubletap = false;
-
-            // when the touchtime is higher then the max touch time
-            // or when the moving distance is too much
-            if(ev.deltaTime > inst.options.tap_max_touchtime ||
-                ev.distance > inst.options.tap_max_distance) {
-                return;
-            }
-
-            // check if double tap
-            if(prev && prev.name == 'tap' &&
-                (ev.timeStamp - prev.lastEvent.timeStamp) < inst.options.doubletap_interval &&
-                ev.distance < inst.options.doubletap_distance) {
-				inst.trigger('doubletap', ev);
-				did_doubletap = true;
-            }
-
-			// do a single tap
-			if(!did_doubletap || inst.options.tap_always) {
-				Hammer.detection.current.name = 'tap';
-				inst.trigger(Hammer.detection.current.name, ev);
-			}
-        }
-    }
-};
-
-
-/**
- * Swipe
- * triggers swipe events when the end velocity is above the threshold
- * @events  swipe, swipeleft, swiperight, swipeup, swipedown
- */
-Hammer.gestures.Swipe = {
-    name: 'swipe',
-    index: 40,
-    defaults: {
-        // set 0 for unlimited, but this can conflict with transform
-        swipe_max_touches  : 1,
-        swipe_velocity     : 0.7
-    },
-    handler: function swipeGesture(ev, inst) {
-        if(ev.eventType == Hammer.EVENT_END) {
-            // max touches
-            if(inst.options.swipe_max_touches > 0 &&
-                ev.touches.length > inst.options.swipe_max_touches) {
-                return;
-            }
-
-            // when the distance we moved is too small we skip this gesture
-            // or we can be already in dragging
-            if(ev.velocityX > inst.options.swipe_velocity ||
-                ev.velocityY > inst.options.swipe_velocity) {
-                // trigger swipe events
-                inst.trigger(this.name, ev);
-                inst.trigger(this.name + ev.direction, ev);
-            }
-        }
-    }
-};
-
-
-/**
- * Drag
- * Move with x fingers (default 1) around on the page. Blocking the scrolling when
- * moving left and right is a good practice. When all the drag events are blocking
- * you disable scrolling on that area.
- * @events  drag, drapleft, dragright, dragup, dragdown
- */
-Hammer.gestures.Drag = {
-    name: 'drag',
-    index: 50,
-    defaults: {
-        drag_min_distance : 10,
-        // set 0 for unlimited, but this can conflict with transform
-        drag_max_touches  : 1,
-        // prevent default browser behavior when dragging occurs
-        // be careful with it, it makes the element a blocking element
-        // when you are using the drag gesture, it is a good practice to set this true
-        drag_block_horizontal   : false,
-        drag_block_vertical     : false,
-        // drag_lock_to_axis keeps the drag gesture on the axis that it started on,
-        // It disallows vertical directions if the initial direction was horizontal, and vice versa.
-        drag_lock_to_axis       : false,
-        // drag lock only kicks in when distance > drag_lock_min_distance
-        // This way, locking occurs only when the distance has become large enough to reliably determine the direction
-        drag_lock_min_distance : 25
-    },
-    triggered: false,
-    handler: function dragGesture(ev, inst) {
-        // current gesture isnt drag, but dragged is true
-        // this means an other gesture is busy. now call dragend
-        if(Hammer.detection.current.name != this.name && this.triggered) {
-            inst.trigger(this.name +'end', ev);
-            this.triggered = false;
-            return;
-        }
-
-        // max touches
-        if(inst.options.drag_max_touches > 0 &&
-            ev.touches.length > inst.options.drag_max_touches) {
-            return;
-        }
-
-        switch(ev.eventType) {
-            case Hammer.EVENT_START:
-                this.triggered = false;
-                break;
-
-            case Hammer.EVENT_MOVE:
-                // when the distance we moved is too small we skip this gesture
-                // or we can be already in dragging
-                if(ev.distance < inst.options.drag_min_distance &&
-                    Hammer.detection.current.name != this.name) {
-                    return;
-                }
-
-                // we are dragging!
-                Hammer.detection.current.name = this.name;
-
-                // lock drag to axis?
-                if(Hammer.detection.current.lastEvent.drag_locked_to_axis || (inst.options.drag_lock_to_axis && inst.options.drag_lock_min_distance<=ev.distance)) {
-                    ev.drag_locked_to_axis = true;
-                }
-                var last_direction = Hammer.detection.current.lastEvent.direction;
-                if(ev.drag_locked_to_axis && last_direction !== ev.direction) {
-                    // keep direction on the axis that the drag gesture started on
-                    if(Hammer.utils.isVertical(last_direction)) {
-                        ev.direction = (ev.deltaY < 0) ? Hammer.DIRECTION_UP : Hammer.DIRECTION_DOWN;
-                    }
-                    else {
-                        ev.direction = (ev.deltaX < 0) ? Hammer.DIRECTION_LEFT : Hammer.DIRECTION_RIGHT;
-                    }
-                }
-
-                // first time, trigger dragstart event
-                if(!this.triggered) {
-                    inst.trigger(this.name +'start', ev);
-                    this.triggered = true;
-                }
-
-                // trigger normal event
-                inst.trigger(this.name, ev);
-
-                // direction event, like dragdown
-                inst.trigger(this.name + ev.direction, ev);
-
-                // block the browser events
-                if( (inst.options.drag_block_vertical && Hammer.utils.isVertical(ev.direction)) ||
-                    (inst.options.drag_block_horizontal && !Hammer.utils.isVertical(ev.direction))) {
-                    ev.preventDefault();
-                }
-                break;
-
-            case Hammer.EVENT_END:
-                // trigger dragend
-                if(this.triggered) {
-                    inst.trigger(this.name +'end', ev);
-                }
-
-                this.triggered = false;
-                break;
-        }
-    }
-};
-
-
-/**
- * Transform
- * User want to scale or rotate with 2 fingers
- * @events  transform, pinch, pinchin, pinchout, rotate
- */
-Hammer.gestures.Transform = {
-    name: 'transform',
-    index: 45,
-    defaults: {
-        // factor, no scale is 1, zoomin is to 0 and zoomout until higher then 1
-        transform_min_scale     : 0.01,
-        // rotation in degrees
-        transform_min_rotation  : 1,
-        // prevent default browser behavior when two touches are on the screen
-        // but it makes the element a blocking element
-        // when you are using the transform gesture, it is a good practice to set this true
-        transform_always_block  : false
-    },
-    triggered: false,
-    handler: function transformGesture(ev, inst) {
-        // current gesture isnt drag, but dragged is true
-        // this means an other gesture is busy. now call dragend
-        if(Hammer.detection.current.name != this.name && this.triggered) {
-            inst.trigger(this.name +'end', ev);
-            this.triggered = false;
-            return;
-        }
-
-        // atleast multitouch
-        if(ev.touches.length < 2) {
-            return;
-        }
-
-        // prevent default when two fingers are on the screen
-        if(inst.options.transform_always_block) {
-            ev.preventDefault();
-        }
-
-        switch(ev.eventType) {
-            case Hammer.EVENT_START:
-                this.triggered = false;
-                break;
-
-            case Hammer.EVENT_MOVE:
-                var scale_threshold = Math.abs(1-ev.scale);
-                var rotation_threshold = Math.abs(ev.rotation);
-
-                // when the distance we moved is too small we skip this gesture
-                // or we can be already in dragging
-                if(scale_threshold < inst.options.transform_min_scale &&
-                    rotation_threshold < inst.options.transform_min_rotation) {
-                    return;
-                }
-
-                // we are transforming!
-                Hammer.detection.current.name = this.name;
-
-                // first time, trigger dragstart event
-                if(!this.triggered) {
-                    inst.trigger(this.name +'start', ev);
-                    this.triggered = true;
-                }
-
-                inst.trigger(this.name, ev); // basic transform event
-
-                // trigger rotate event
-                if(rotation_threshold > inst.options.transform_min_rotation) {
-                    inst.trigger('rotate', ev);
-                }
-
-                // trigger pinch event
-                if(scale_threshold > inst.options.transform_min_scale) {
-                    inst.trigger('pinch', ev);
-                    inst.trigger('pinch'+ ((ev.scale < 1) ? 'in' : 'out'), ev);
-                }
-                break;
-
-            case Hammer.EVENT_END:
-                // trigger dragend
-                if(this.triggered) {
-                    inst.trigger(this.name +'end', ev);
-                }
-
-                this.triggered = false;
-                break;
-        }
-    }
-};
-
-
-/**
- * Touch
- * Called as first, tells the user has touched the screen
- * @events  touch
- */
-Hammer.gestures.Touch = {
-    name: 'touch',
-    index: -Infinity,
-    defaults: {
-        // call preventDefault at touchstart, and makes the element blocking by
-        // disabling the scrolling of the page, but it improves gestures like
-        // transforming and dragging.
-        // be careful with using this, it can be very annoying for users to be stuck
-        // on the page
-        prevent_default: false,
-
-        // disable mouse events, so only touch (or pen!) input triggers events
-        prevent_mouseevents: false
-    },
-    handler: function touchGesture(ev, inst) {
-        if(inst.options.prevent_mouseevents && ev.pointerType == Hammer.POINTER_MOUSE) {
-            ev.stopDetect();
-            return;
-        }
-
-        if(inst.options.prevent_default) {
-            ev.preventDefault();
-        }
-
-        if(ev.eventType ==  Hammer.EVENT_START) {
-            inst.trigger(this.name, ev);
-        }
-    }
-};
-
-
-/**
- * Release
- * Called as last, tells the user has released the screen
- * @events  release
- */
-Hammer.gestures.Release = {
-    name: 'release',
-    index: Infinity,
-    handler: function releaseGesture(ev, inst) {
-        if(ev.eventType ==  Hammer.EVENT_END) {
-            inst.trigger(this.name, ev);
-        }
-    }
-};
-
-// node export
-if(typeof module === 'object' && typeof module.exports === 'object'){
-    module.exports = Hammer;
-}
-// just window export
-else {
-    window.Hammer = Hammer;
-
-    // requireJS module definition
-    if(typeof window.define === 'function' && window.define.amd) {
-        window.define('hammer', [], function() {
-            return Hammer;
-        });
-    }
-}
-})(this);
-
-(function($, undefined) {
-    'use strict';
-
-    // no jQuery or Zepto!
-    if($ === undefined) {
-        return;
-    }
-
-    /**
-     * bind dom events
-     * this overwrites addEventListener
-     * @param   {HTMLElement}   element
-     * @param   {String}        eventTypes
-     * @param   {Function}      handler
-     */
-    Hammer.event.bindDom = function(element, eventTypes, handler) {
-        $(element).on(eventTypes, function(ev) {
-            var data = ev.originalEvent || ev;
-
-            // IE pageX fix
-            if(data.pageX === undefined) {
-                data.pageX = ev.pageX;
-                data.pageY = ev.pageY;
-            }
-
-            // IE target fix
-            if(!data.target) {
-                data.target = ev.target;
-            }
-
-            // IE button fix
-            if(data.which === undefined) {
-                data.which = data.button;
-            }
-
-            // IE preventDefault
-            if(!data.preventDefault) {
-                data.preventDefault = ev.preventDefault;
-            }
-
-            // IE stopPropagation
-            if(!data.stopPropagation) {
-                data.stopPropagation = ev.stopPropagation;
-            }
-
-            handler.call(this, data);
-        });
-    };
-
-    /**
-     * the methods are called by the instance, but with the jquery plugin
-     * we use the jquery event methods instead.
-     * @this    {Hammer.Instance}
-     * @return  {jQuery}
-     */
-    Hammer.Instance.prototype.on = function(types, handler) {
-        return $(this.element).on(types, handler);
-    };
-    Hammer.Instance.prototype.off = function(types, handler) {
-        return $(this.element).off(types, handler);
-    };
-
-
-    /**
-     * trigger events
-     * this is called by the gestures to trigger an event like 'tap'
-     * @this    {Hammer.Instance}
-     * @param   {String}    gesture
-     * @param   {Object}    eventData
-     * @return  {jQuery}
-     */
-    Hammer.Instance.prototype.trigger = function(gesture, eventData){
-        var el = $(this.element);
-        if(el.has(eventData.target).length) {
-            el = $(eventData.target);
-        }
-
-        return el.trigger({
-            type: gesture,
-            gesture: eventData
-        });
-    };
-
-
-    /**
-     * jQuery plugin
-     * create instance of Hammer and watch for gestures,
-     * and when called again you can change the options
-     * @param   {Object}    [options={}]
-     * @return  {jQuery}
-     */
-    $.fn.hammer = function(options) {
-        return this.each(function() {
-            var el = $(this);
-            var inst = el.data('hammer');
-            // start new hammer instance
-            if(!inst) {
-                el.data('hammer', new Hammer(this, options || {}));
-            }
-            // change the options
-            else if(inst && options) {
-                Hammer.utils.extend(inst.options, options);
-            }
-        });
-    };
-
-})(window.jQuery || window.Zepto);

Fișier diff suprimat deoarece este prea mare
+ 0 - 2694
support/client/lib/socket.io.js


+ 2 - 32
support/client/lib/vwf.js

@@ -323,9 +323,6 @@
                 { library: "vwf/kernel/model", active: true },
                 { library: "vwf/model/javascript", active: true },
 
-                { library: "vwf/model/scenejs", active: false },
-
-                { library: "vwf/model/sound", active: false },
                 { library: "vwf/model/object", active: true },
                 { library: "vwf/model/stage/log", active: true },
 
@@ -347,18 +344,10 @@
                 },
 
                 { library: "vwf/model/aframeComponent", active: true },
-                { library: "vwf/model/buzz", 
-                    linkedLibraries: ["vwf/model/buzz/buzz.min"], 
-                    active: false 
-                },
-                { library: "vwf/model/jPlayer", 
-                    linkedLibraries: ["vwf/model/jPlayer.2.7.1/jquery.jplayer.min"], 
-                    active: false 
-                },
+
                 { library: "vwf/kernel/view", active: true },
                 { library: "vwf/view/document", active: true },
-                { library: "vwf/view/editor", active: false },
-                { library: "vwf/view/editor-live", active: false },
+
                 { library: "vwf/view/editor-new", active: false },
 
                 { library: "vwf/view/webrtc", 
@@ -366,9 +355,6 @@
                     active: false 
                 },
 
-                { library: "vwf/view/sound", active: false },
-                { library: "vwf/view/touch", active: false },
-
                 { library: "vwf/view/ohm", active: true },
                 { library: "vwf/view/osc", active: true },
 
@@ -383,18 +369,13 @@
                 { library: "vwf/model/aframe/addon/TransformControls", active: false },
                 { library: "vwf/model/aframe/addon/THREE.MeshLine", active: false },
                 
-                
-              
 
                 { library: "vwf/view/aframeComponent", active: true },
 
-                { library: "vwf/view/audio", active: false },
                 { library: "vwf/kernel/utility", active: true },
                 { library: "vwf/utility", active: true },
                 { library: "vwf/view/webrtc/adapter", active: false },
 
-                { library: "vwf/model/buzz/buzz.min", active: false }, 
-                { library: "vwf/model/jPlayer.2.7.1/jquery.jplayer.min", active: false },
                 { library: "vwf/admin", active: true }
 
                
@@ -404,35 +385,24 @@
                 model: [
                     { library: "vwf/model/javascript", active: true },
 
-                    { library: "vwf/model/sound", active: false },
-
                      { library: "vwf/model/ohm", active: true },
                      { library: "vwf/model/osc", active: true },
                   
                      { library: "vwf/model/aframe", active: false },
                      { library: "vwf/model/aframeComponent", active: true },
 
-                    { library: "vwf/model/buzz", active: false },
-                    { library: "vwf/model/jPlayer", active: false },
-
                     { library: "vwf/model/object", active: true }
                 ],
                 view: [
                     { library: "vwf/view/document", active: true },
-                    { library: "vwf/view/editor", active: false },
-                    { library: "vwf/view/editor-live", active: false },
                     { library: "vwf/view/editor-new", active: false },
 
-                    { library: "vwf/view/sound", active: false },
-                    { library: "vwf/view/touch", active: false },
-
                      { library: "vwf/view/ohm", active: true },
                      { library: "vwf/view/osc", active: true },
                      
                       { library: "vwf/view/aframe", active: false },
                       { library: "vwf/view/aframeComponent", active: true },
 
-                    { library: "vwf/view/audio", active: false },
                     { library: "vwf/view/webrtc", active: false}
 
                   

+ 0 - 500
support/client/lib/vwf/model/buzz.js

@@ -1,500 +0,0 @@
-"use strict";
-
-/// vwf/model/buzz.js is a sound driver
-/// 
-/// @module vwf/model/buzz
-/// @requires vwf/model
-
-define( [   
-        "module", 
-        "vwf/model", 
-        "vwf/utility" 
-    ], function( module, model, utility ) {
-
-    var modelDriver;
-
-    return model.load( module, {
-
-        // == Module Definition ====================================================================
-
-        // -- initialize ---------------------------------------------------------------------------
-
-        initialize: function( options ) {
-            
-        	modelDriver = this;
-
-            this.arguments = Array.prototype.slice.call( arguments );
-
-            this.options = options || {};
-
-            this.state = {
-                "nodes": {},
-                "stages": {},
-                "prototypes": {},
-                "createLocalNode": function( nodeID, childID, childExtendsID, childImplementsIDs,
-                                childSource, childType, childIndex, childName, callback ) {
-                    return {
-                        "parentID": nodeID,
-                        "ID": childID,
-                        "extendsID": childExtendsID,
-                        "implementsIDs": childImplementsIDs,
-                        "source": childSource,
-                        "type": childType,
-                        "name": childName,
-                        "prototypes": undefined,
-                        "delayedProperties": undefined,
-                        "soundObj": undefined,
-                        "playState": "unloaded",
-                        "playOnReady": false
-                    };
-                },
-                "is3DSoundComponent": function( prototypes ) {
-                    var found = false;
-                    if ( prototypes ) {
-                        for ( var i = 0; i < prototypes.length && !found; i++ ) {
-                            found = ( prototypes[ i ] === "http://vwf.example.com/sound3.vwf" );
-                        }
-                    }
-                    return found;
-                },
-                "isSoundComponent": function( prototypes ) {
-                    var found = false;
-                    if ( prototypes ) {
-                        for ( var i = 0; i < prototypes.length && !found; i++ ) {
-                            found = ( prototypes[ i ] === "http://vwf.example.com/sound.vwf" );
-                        }
-                    }
-                    return found;
-                }
-            };
-
-            // turns on logger debugger console messages 
-            this.debug = {
-                "creation": false,
-                "initializing": false,
-                "parenting": false,
-                "deleting": false,
-                "properties": false,
-                "setting": false,
-                "getting": false,
-                "method": false,
-                "prototypes": false
-            };
-
-        },
-
-        creatingNode: function( nodeID, childID, childExtendsID, childImplementsIDs,
-                                childSource, childType, childIndex, childName, callback ) {
-
-            var appID = this.kernel.application();
-            if ( this.debug.creation ) {
-                this.logger.infox( "creatingNode", nodeID, childID, childExtendsID, childImplementsIDs, childSource, childType, childName );
-            }
-
-            // If the node being created is a prototype, construct it and add it to the array of prototypes,
-            // and then return
-            var prototypeID = utility.ifPrototypeGetId( appID, this.state.prototypes, nodeID, childID );
-            if ( prototypeID !== undefined ) {
-                
-                if ( this.debug.prototypes ) {
-                    this.logger.infox( "prototype: ", prototypeID );
-                }
-
-                this.state.prototypes[ prototypeID ] = {
-                    parentID: nodeID,
-                    ID: childID,
-                    extendsID: childExtendsID,
-                    implementsID: childImplementsIDs,
-                    source: childSource, 
-                    type: childType,
-                    name: childName
-                };
-                return;                
-            }
-
-            var protos = getPrototypes( this.kernel, childExtendsID );
-            var node;
-
-            if ( this.state.isSoundComponent( protos ) ) {
-
-                // Create the local copy of the node properties
-                if ( this.state.nodes[ childID ] === undefined ){
-                    this.state.nodes[ childID ] = this.state.createLocalNode( nodeID, childID, 
-                        childExtendsID, childImplementsIDs, childSource, 
-                        childType, childIndex, childName, callback );
-                }
-
-                node = this.state.nodes[ childID ];
-                
-                node.prototypes = protos;
-                node.is3DSound = this.state.is3DSoundComponent( protos );
-            } 
-        },
-
-        initializingNode: function( nodeID, childID, childExtendsID, childImplementsIDs,
-            childSource, childType, childIndex, childName ) {
-
-            if ( this.debug.initializing ) {
-                this.logger.infox( "initializingNode", nodeID, childID, childExtendsID, childImplementsIDs, childSource, childType, childName );
-            } 
-
-            var node = this.state.nodes[ childID ];
-            if ( node !== undefined ) {
-                if ( utility.validObject( childSource ) ) {
-                    createSound( node, childSource );
-                }                
-            } 
-        },
-
-        deletingNode: function( nodeID ) {
-            
-            if ( this.debug.deleting ) {
-                this.logger.infox( "deletingNode", nodeID );
-            }
-
-            if ( this.state.nodes[ nodeID ] ) {
-                delete this.state.nodes[ nodeID ];
-            }
-
-        },
-
-        // addingChild: function( nodeID, childID, childName ) {
-        //     if ( this.debug.parenting ) {
-        //         this.logger.infox( "addingChild", nodeID, childID, childName );
-        //     }
-        // },
-
-        // movingChild: function( nodeID, childID, childName ) {
-        //     if ( this.debug.parenting ) {
-        //         this.logger.infox( "movingChild", nodeID, childID, childName );
-        //     }
-        // },
-
-        // removingChild: function( nodeID, childID, childName ) {
-        //     if ( this.debug.parenting ) {
-        //         this.logger.infox( "removingChild", nodeID, childID, childName );
-        //     }
-        // },
-
-        // -- creatingProperty ---------------------------------------------------------------------
-
-        creatingProperty: function( nodeID, propertyName, propertyValue ) {
-            if ( this.debug.properties ) {
-                this.logger.infox( "C === creatingProperty ", nodeID, propertyName, propertyValue );
-            }
-            return this.settingProperty( nodeID, propertyName, propertyValue );
-        },
-
-        // -- initializingProperty -----------------------------------------------------------------
-
-        initializingProperty: function( nodeID, propertyName, propertyValue ) {
-
-            if ( this.debug.properties ) {
-                this.logger.infox( "  I === initializingProperty ", nodeID, propertyName, propertyValue );
-            }
-
-            return this.settingProperty( nodeID, propertyName, propertyValue );
-            
-        },
-
-        // -- settingProperty ----------------------------------------------------------------------
-
-        settingProperty: function( nodeID, propertyName, propertyValue ) {
-
-            if ( this.debug.properties || this.debug.setting ) {
-                this.logger.infox( "    S === settingProperty ", nodeID, propertyName, propertyValue );
-            }
-
-            var node = this.state.nodes[ nodeID ]; // { name: childName, glgeObject: undefined }
-            var value = undefined;
-
-            //this driver has no representation of this node, so there is nothing to do.
-            if( node === undefined ) return;
-
-
-            if ( propertyName !== "url" && node.soundObj === undefined ) {
-
-                if ( node.delayedProperties === undefined ) {
-                    node.delayedProperties = {};    
-                }
-                node.delayedProperties[ propertyName ] = propertyValue; 
-
-            } else {
-                
-                value = propertyValue;
-                switch ( propertyName ) {
-                    
-                    case "url": 
-                        if ( node.soundObj !== undefined ) {
-                            node.soundObj.set( "src", propertyValue );
-                        } else {
-                            createSound( node, propertyValue )
-                        }                    
-                        break;
-
-                    case "time":
-                        if ( node.soundObj !== undefined ) {
-                            node.soundObj.setTime( parseFloat( propertyValue ) );
-                        }                      
-                        break;
-
-                    case "percent":
-                        if ( node.soundObj !== undefined ) {
-                            node.soundObj.setPercent( parseFloat( propertyValue ) );
-                        }                      
-                        break;
-
-                    case "speed":
-                        if ( node.soundObj !== undefined ) {
-                            node.soundObj.setSpeed( parseFloat( propertyValue ) );
-                        }                      
-                        break;
-
-                    case "muted":
-                        if ( node.soundObj !== undefined ) {
-                            if ( Boolean( propertyValue ) ) {
-                                node.soundObj.mute();
-                            } else {
-                                node.soundObj.unmute();
-                            }
-                        }
-                        break;
-
-                    case "volume":
-                        if ( node.soundObj !== undefined ) {
-                            var newVolume = Number( propertyValue );
-                            if ( newVolume >= 0 && newVolume <= 100 ) {
-                                node.soundObj.setVolume( newVolume );    
-                            }
-                        }
-                        break;
-
-                    case "loop":
-                        if ( node.soundObj !== undefined ) {
-                            if ( Boolean( propertyValue ) ) {
-                                node.soundObj.loop();
-                            } else {
-                                node.soundObj.unloop();
-                            }
-                        }
-                        break;
-
-                    default:
-                        value = undefined;
-                        break;
-
-
-                }                
-            }
-
-
-
-            return value;
-        },
-
-        // -- gettingProperty ----------------------------------------------------------------------
-
-        gettingProperty: function( nodeID, propertyName ) {
-
-            if ( this.debug.properties || this.debug.getting ) {
-                this.logger.infox( "   G === gettingProperty ", nodeID, propertyName );
-            }
-
-            var node = this.state.nodes[ nodeID ]; // { name: childName, glgeObject: undefined }
-            var value = undefined;
-
-            //this driver has no representation of this node, so there is nothing to do.
-            if( node === undefined || node.soundObj === undefined ) return;
-
-            switch ( propertyName ) {
-                
-                case "url": 
-                    value = node.soundObj.get( "src" );
-                    break;
-                
-                case "playState":
-                    value = node.playState;
-                    break;
-
-                case "time":
-                    value = node.soundObj.getTime();
-                    break;
-
-                case "percent":
-                    value = node.soundObj.getPercent();                    
-                    break;
-
-                case "speed":
-                    value = node.soundObj.getSpeed();
-                    break;
-
-                case "muted":
-                    value = node.soundObj.isMuted();
-                    break;
-
-                case "volume":
-                    value = node.soundObj.getVolume();
-                    break;
-
-                case "loop":
-                    value = node.soundObj.get( "loop" );
-                    break;
-
-
-            } 
-
-
-            return value;
-        },
-
-
-        // TODO: deletingMethod
-
-        // -- callingMethod --------------------------------------------------------------------------
-
-        callingMethod: function( nodeID, methodName, methodParameters ) { 
-
-            if ( this.debug.method ) {
-                this.logger.infox( "   G === gettingProperty ", nodeID, propertyName );
-            }
-
-            var node = this.state.nodes[ nodeID ]; 
-            var value = undefined;  
-
-            if ( node !== undefined && node.soundObj !== undefined ) {
-                
-                if ( node.playState !== "unloaded" ) {
-                    
-                    switch( methodName ) {
-                        
-                        case "play":
-                            if ( node.soundObj !== undefined ) {
-                                node.soundObj.play();
-                            } 
-                            break;
-
-                        case "stop":
-                            if ( node.soundObj !== undefined ) {
-                                node.soundObj.stop();
-                            } 
-                            break;
-
-
-                        case "pause":
-                            if ( node.soundObj !== undefined ) {
-                                node.soundObj.pause();
-                            }
-                            break;
-                    }  
-                } else {
-                    
-                    node.playOnReady = ( methodName === 'play' );
-                }
-
-            }
-
-        
-        },
-
-
-        // TODO: creatingEvent, deltetingEvent, firingEvent
-
-        // -- executing ------------------------------------------------------------------------------
-
-        // executing: function( nodeID, scriptText, scriptType ) {
-        //     return undefined;
-        // },
-
-        // == ticking =============================================================================
-
-        // ticking: function( vwfTime ) {
-            
-        // }
-
-
-
-    } );
-
-    function getPrototypes( kernel, extendsID ) {
-        var prototypes = [];
-        var id = extendsID;
-
-        while ( id !== undefined ) {
-            prototypes.push( id );
-            id = kernel.prototype( id );
-        }
-                
-        return prototypes;
-    }
-
-    function createSound( node, url ) {
-        
-        var soundProps;
-        if ( url.indexOf( 'data:audio' ) === 0 ) {
-            soundProps = { 
-                "preload": "metadata"
-            };
-        } else if ( require( "vwf/utility" ).hasFileType( url ) ) {
-            var fType = require( "vwf/utility" ).fileType( url );
-            soundProps= { 
-                "preload": "metadata",
-                "formats": [ fType ]
-            };                                 
-        } else {
-            soundProps= { 
-                "preload": "metadata",
-                "formats": [ "ogg", "mp3", "aac", "wav" ]
-            };                                 
-        }
-
-        if ( node.delayedProperties !== undefined ) {
-            for ( var prop in node.delayedProperties ) {
-                switch ( prop ) {
-
-                    default:
-                        soundProps[ prop ] = node.delayedProperties[ prop ];
-                        break;
-                }
-            }
-            node.delayedProperties = undefined;
-        }
-        
-        var buzz = require( "vwf/model/buzz/buzz.min" );
-        node.soundObj = new buzz.sound( url, soundProps ); 
-
-        // http://buzz.jaysalvat.com/documentation/events/
-        node.soundObj.bind( "ended", function( e ) {
-            if ( node.playState === "playing" ) {
-                node.playState = "stopped";
-            }
-            modelDriver.kernel.fireEvent( node.ID, "soundEnded", [ true ] );
-        } );      
-
-        node.soundObj.bind( "playing", function( e ) {
-            node.playState = "playing";
-            modelDriver.kernel.fireEvent( node.ID, "soundPlaying", [ true ] );
-        } );  
-
-        node.soundObj.bind( "canplay", function( e ) {
-            node.playState = "loaded";
-            if ( node.playOnReady ) {
-                node.soundObj.play(); 
-                node.playOnReady = false;    
-            }
-            modelDriver.kernel.fireEvent( node.ID, "soundReady", [ true ] );
-        } );  
-
-        // "play" is sent when the sound had been paused
-        node.soundObj.bind( "play", function( e ) {
-            node.playState = "playing";
-            modelDriver.kernel.fireEvent( node.ID, "soundReady", [ true ] );
-        } ); 
-
-        node.soundObj.bind( "pause", function( e ) {
-            node.playState = "paused";
-            modelDriver.kernel.fireEvent( node.ID, "soundReady", [ true ] );
-        } ); 
-
-    }
-
-} );

Fișier diff suprimat deoarece este prea mare
+ 0 - 10
support/client/lib/vwf/model/buzz/buzz.min.js


+ 0 - 119
support/client/lib/vwf/model/example/scene.js

@@ -1,119 +0,0 @@
-// Copyright 2012 United States Government, as represented by the Secretary of Defense, Under
-// Secretary of Defense (Personnel & Readiness).
-// 
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-// 
-//   http://www.apache.org/licenses/LICENSE-2.0
-// 
-// Unless required by applicable law or agreed to in writing, software distributed under the License
-// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
-// or implied. See the License for the specific language governing permissions and limitations under
-// the License.
-
-/// vwf/model/example/scene.js is a demonstration of a scene manager.
-/// 
-/// @module vwf/model/example/scene
-/// @requires vwf/model
-
-define( [ "module", "vwf/model" ], function( module, model ) {
-
-    return model.load( module, {
-
-        // == Module Definition ====================================================================
-
-        // -- pipeline -----------------------------------------------------------------------------
-
-        // pipeline: [ log ], // vwf <=> log <=> scene
-
-        // -- initialize ---------------------------------------------------------------------------
-
-        initialize: function() {
-            this.objects = {}; // maps id => { property: value, ... }
-        },
-
-        // == Model API ============================================================================
-
-        // -- creatingNode -------------------------------------------------------------------------
-
-        creatingNode: function( nodeID, childID, childExtendsID, childImplementsIDs,
-            childSource, childType, childIndex, childName, callback /* ( ready ) */ ) {
-        },
-
-        // -- deletingNode -------------------------------------------------------------------------
-
-        deletingNode: function( nodeID ) {
-        },
-
-        // -- addingChild --------------------------------------------------------------------------
-
-        addingChild: function( nodeID, childID, childName ) {
-        },
-
-        // -- removingChild ------------------------------------------------------------------------
-
-        removingChild: function( nodeID, childID ) {
-        },
-
-        // -- creatingProperty ---------------------------------------------------------------------
-
-        creatingProperty: function( nodeID, propertyName, propertyValue ) {
-            var object = this.objects[nodeID] || ( this.objects[nodeID] = {} );
-            return object[propertyName] = propertyValue;
-        },
-
-        // -- initializingProperty -----------------------------------------------------------------
-
-        initializingProperty: function( nodeID, propertyName, propertyValue ) {
-            var object = this.objects[nodeID] || ( this.objects[nodeID] = {} );
-            return object[propertyName] = propertyValue;
-        },
-
-        // TODO: deletingProperty
-
-        // -- settingProperty ----------------------------------------------------------------------
-
-        settingProperty: function( nodeID, propertyName, propertyValue ) {
-            var object = this.objects[nodeID] || ( this.objects[nodeID] = {} );
-            return object[propertyName] = propertyValue;
-        },
-
-        // -- gettingProperty ----------------------------------------------------------------------
-
-        gettingProperty: function( nodeID, propertyName, propertyValue ) {
-            var object = this.objects[nodeID];
-            return object && object[propertyName];
-        },
-
-        // -- creatingMethod -----------------------------------------------------------------------
-
-        creatingMethod: function( nodeID, methodName, methodParameters, methodBody ) {
-        },
-
-        // TODO: deletingMethod
-
-        // -- callingMethod ------------------------------------------------------------------------
-
-        callingMethod: function( nodeID, methodName, methodParameters ) {
-        },
-
-        // -- creatingEvent ------------------------------------------------------------------------
-
-        creatingEvent: function( nodeID, eventName, eventParameters ) {
-        },
-
-        // TODO: deletingEvent
-
-        // -- firingEvent --------------------------------------------------------------------------
-
-        firingEvent: function( nodeID, eventName, eventParameters ) {
-        },
-
-        // -- executing ----------------------------------------------------------------------------
-
-        executing: function( nodeID, scriptText, scriptType ) {
-        },
-
-    } );
-
-} );

BIN
support/client/lib/vwf/model/jPlayer.2.7.1/Jplayer.swf


+ 0 - 21
support/client/lib/vwf/model/jPlayer.2.7.1/MIT-LICENSE.txt

@@ -1,21 +0,0 @@
-Copyright (c) 2009 - 2013 Happyworm Ltd
-http://happyworm.com
-http://jplayer.org
-
-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.

+ 0 - 36
support/client/lib/vwf/model/jPlayer.2.7.1/README.md

@@ -1,36 +0,0 @@
-# [jPlayer](http://jplayer.org/) : HTML5 Audio & Video for [jQuery](http://jquery.com/)
-
-Support for [Zepto](http://zeptojs.com/) 1.0+ compiled with the data module.
-
-## What is jPlayer?
-
-### jPlayer is a jQuery/Zepto plugin that allows you to:
-* **play and control media** files in your webpage.
-* create a **consistent interface** and experience across all browsers.
-* create and style a media player using **just HTML and CSS**.
-* add **audio** and **video** to your jQuery/Zepto projects.
-* support more devices using **HTML5**.
-* support older browsers using a Flash _fall-back/forward_.
-* control media on your website using a [JavaScript API](http://www.jplayer.org/latest/developer-guide/).
-
-### jPlayer supports:
-* HTML5: **mp3, m4a (AAC), m4v (H.264),** ogv*, oga*, wav*, webm*
-* Flash: **mp3, m4a (AAC), m4v (H.264),** rtmp, flv.
-
-_(*) Optional counterpart formats to increase HTML5 cross-browser support._
-
-## Bower Install
-* simple install using `bower install jplayer`
-* see <http://bower.io/> for more information.
-
-## License
-[jPlayer](http://jplayer.org/) is licensed under the [MIT license](http://opensource.org/licenses/MIT).
-
-## More information:
-* [jPlayer.org](http://jplayer.org/)
-* [Quick Start Guide](http://www.jplayer.org/latest/quick-start-guide/)
-* [Developer Guide and API Reference](http://www.jplayer.org/latest/developer-guide/)
-
-## Author:
-Mark J Panaghiston [@thepag](http://twitter.com/thepag)
-[happyworm.com](http://happyworm.com/)

+ 0 - 34
support/client/lib/vwf/model/jPlayer.2.7.1/add-on/jplayer.playlist.min.js

@@ -1,34 +0,0 @@
-/*
- * Playlist Object for the jPlayer Plugin
- * http://www.jplayer.org
- *
- * Copyright (c) 2009 - 2014 Happyworm Ltd
- * Licensed under the MIT license.
- * http://www.opensource.org/licenses/MIT
- *
- * Author: Mark J Panaghiston
- * Version: 2.4.0
- * Date: 1st September 2014
- *
- * Requires:
- *  - jQuery 1.7.0+
- *  - jPlayer 2.7.0+
- */
-
-(function(b,f){jPlayerPlaylist=function(a,c,d){var e=this;this.current=0;this.removing=this.shuffled=this.loop=!1;this.cssSelector=b.extend({},this._cssSelector,a);this.options=b.extend(!0,{keyBindings:{next:{key:39,fn:function(){e.next()}},previous:{key:37,fn:function(){e.previous()}}},stateClass:{shuffled:"jp-state-shuffled"}},this._options,d);this.playlist=[];this.original=[];this._initPlaylist(c);this.cssSelector.details=this.cssSelector.cssSelectorAncestor+" .jp-details";this.cssSelector.playlist=
-this.cssSelector.cssSelectorAncestor+" .jp-playlist";this.cssSelector.next=this.cssSelector.cssSelectorAncestor+" .jp-next";this.cssSelector.previous=this.cssSelector.cssSelectorAncestor+" .jp-previous";this.cssSelector.shuffle=this.cssSelector.cssSelectorAncestor+" .jp-shuffle";this.cssSelector.shuffleOff=this.cssSelector.cssSelectorAncestor+" .jp-shuffle-off";this.options.cssSelectorAncestor=this.cssSelector.cssSelectorAncestor;this.options.repeat=function(a){e.loop=a.jPlayer.options.loop};b(this.cssSelector.jPlayer).bind(b.jPlayer.event.ready,
-function(){e._init()});b(this.cssSelector.jPlayer).bind(b.jPlayer.event.ended,function(){e.next()});b(this.cssSelector.jPlayer).bind(b.jPlayer.event.play,function(){b(this).jPlayer("pauseOthers")});b(this.cssSelector.jPlayer).bind(b.jPlayer.event.resize,function(a){a.jPlayer.options.fullScreen?b(e.cssSelector.details).show():b(e.cssSelector.details).hide()});b(this.cssSelector.previous).click(function(a){a.preventDefault();e.previous();e.blur(this)});b(this.cssSelector.next).click(function(a){a.preventDefault();
-e.next();e.blur(this)});b(this.cssSelector.shuffle).click(function(a){a.preventDefault();e.shuffled&&b(e.cssSelector.jPlayer).jPlayer("option","useStateClassSkin")?e.shuffle(!1):e.shuffle(!0);e.blur(this)});b(this.cssSelector.shuffleOff).click(function(a){a.preventDefault();e.shuffle(!1);e.blur(this)}).hide();this.options.fullScreen||b(this.cssSelector.details).hide();b(this.cssSelector.playlist+" ul").empty();this._createItemHandlers();b(this.cssSelector.jPlayer).jPlayer(this.options)};jPlayerPlaylist.prototype=
-{_cssSelector:{jPlayer:"#jquery_jplayer_1",cssSelectorAncestor:"#jp_container_1"},_options:{playlistOptions:{autoPlay:!1,loopOnPrevious:!1,shuffleOnLoop:!0,enableRemoveControls:!1,displayTime:"slow",addTime:"fast",removeTime:"fast",shuffleTime:"slow",itemClass:"jp-playlist-item",freeGroupClass:"jp-free-media",freeItemClass:"jp-playlist-item-free",removeItemClass:"jp-playlist-item-remove"}},option:function(a,b){if(b===f)return this.options.playlistOptions[a];this.options.playlistOptions[a]=b;switch(a){case "enableRemoveControls":this._updateControls();
-break;case "itemClass":case "freeGroupClass":case "freeItemClass":case "removeItemClass":this._refresh(!0),this._createItemHandlers()}return this},_init:function(){var a=this;this._refresh(function(){a.options.playlistOptions.autoPlay?a.play(a.current):a.select(a.current)})},_initPlaylist:function(a){this.current=0;this.removing=this.shuffled=!1;this.original=b.extend(!0,[],a);this._originalPlaylist()},_originalPlaylist:function(){var a=this;this.playlist=[];b.each(this.original,function(b){a.playlist[b]=
-a.original[b]})},_refresh:function(a){var c=this;if(a&&!b.isFunction(a))b(this.cssSelector.playlist+" ul").empty(),b.each(this.playlist,function(a){b(c.cssSelector.playlist+" ul").append(c._createListItem(c.playlist[a]))}),this._updateControls();else{var d=b(this.cssSelector.playlist+" ul").children().length?this.options.playlistOptions.displayTime:0;b(this.cssSelector.playlist+" ul").slideUp(d,function(){var d=b(this);b(this).empty();b.each(c.playlist,function(a){d.append(c._createListItem(c.playlist[a]))});
-c._updateControls();b.isFunction(a)&&a();c.playlist.length?b(this).slideDown(c.options.playlistOptions.displayTime):b(this).show()})}},_createListItem:function(a){var c=this,d="<li><div>",d=d+("<a href='javascript:;' class='"+this.options.playlistOptions.removeItemClass+"'>&times;</a>");if(a.free){var e=!0,d=d+("<span class='"+this.options.playlistOptions.freeGroupClass+"'>(");b.each(a,function(a,f){b.jPlayer.prototype.format[a]&&(e?e=!1:d+=" | ",d+="<a class='"+c.options.playlistOptions.freeItemClass+
-"' href='"+f+"' tabindex='-1'>"+a+"</a>")});d+=")</span>"}d+="<a href='javascript:;' class='"+this.options.playlistOptions.itemClass+"' tabindex='0'>"+a.title+(a.artist?" <span class='jp-artist'>by "+a.artist+"</span>":"")+"</a>";return d+="</div></li>"},_createItemHandlers:function(){var a=this;b(this.cssSelector.playlist).off("click","a."+this.options.playlistOptions.itemClass).on("click","a."+this.options.playlistOptions.itemClass,function(c){c.preventDefault();c=b(this).parent().parent().index();
-a.current!==c?a.play(c):b(a.cssSelector.jPlayer).jPlayer("play");a.blur(this)});b(this.cssSelector.playlist).off("click","a."+this.options.playlistOptions.freeItemClass).on("click","a."+this.options.playlistOptions.freeItemClass,function(c){c.preventDefault();b(this).parent().parent().find("."+a.options.playlistOptions.itemClass).click();a.blur(this)});b(this.cssSelector.playlist).off("click","a."+this.options.playlistOptions.removeItemClass).on("click","a."+this.options.playlistOptions.removeItemClass,
-function(c){c.preventDefault();c=b(this).parent().parent().index();a.remove(c);a.blur(this)})},_updateControls:function(){this.options.playlistOptions.enableRemoveControls?b(this.cssSelector.playlist+" ."+this.options.playlistOptions.removeItemClass).show():b(this.cssSelector.playlist+" ."+this.options.playlistOptions.removeItemClass).hide();this.shuffled?b(this.cssSelector.jPlayer).jPlayer("addStateClass","shuffled"):b(this.cssSelector.jPlayer).jPlayer("removeStateClass","shuffled");b(this.cssSelector.shuffle).length&&
-b(this.cssSelector.shuffleOff).length&&(this.shuffled?(b(this.cssSelector.shuffleOff).show(),b(this.cssSelector.shuffle).hide()):(b(this.cssSelector.shuffleOff).hide(),b(this.cssSelector.shuffle).show()))},_highlight:function(a){this.playlist.length&&a!==f&&(b(this.cssSelector.playlist+" .jp-playlist-current").removeClass("jp-playlist-current"),b(this.cssSelector.playlist+" li:nth-child("+(a+1)+")").addClass("jp-playlist-current").find(".jp-playlist-item").addClass("jp-playlist-current"))},setPlaylist:function(a){this._initPlaylist(a);
-this._init()},add:function(a,c){b(this.cssSelector.playlist+" ul").append(this._createListItem(a)).find("li:last-child").hide().slideDown(this.options.playlistOptions.addTime);this._updateControls();this.original.push(a);this.playlist.push(a);c?this.play(this.playlist.length-1):1===this.original.length&&this.select(0)},remove:function(a){var c=this;if(a===f)return this._initPlaylist([]),this._refresh(function(){b(c.cssSelector.jPlayer).jPlayer("clearMedia")}),!0;if(this.removing)return!1;a=0>a?c.original.length+
-a:a;0<=a&&a<this.playlist.length&&(this.removing=!0,b(this.cssSelector.playlist+" li:nth-child("+(a+1)+")").slideUp(this.options.playlistOptions.removeTime,function(){b(this).remove();if(c.shuffled){var d=c.playlist[a];b.each(c.original,function(a){if(c.original[a]===d)return c.original.splice(a,1),!1})}else c.original.splice(a,1);c.playlist.splice(a,1);c.original.length?a===c.current?(c.current=a<c.original.length?c.current:c.original.length-1,c.select(c.current)):a<c.current&&c.current--:(b(c.cssSelector.jPlayer).jPlayer("clearMedia"),
-c.current=0,c.shuffled=!1,c._updateControls());c.removing=!1}));return!0},select:function(a){a=0>a?this.original.length+a:a;0<=a&&a<this.playlist.length?(this.current=a,this._highlight(a),b(this.cssSelector.jPlayer).jPlayer("setMedia",this.playlist[this.current])):this.current=0},play:function(a){a=0>a?this.original.length+a:a;0<=a&&a<this.playlist.length?this.playlist.length&&(this.select(a),b(this.cssSelector.jPlayer).jPlayer("play")):a===f&&b(this.cssSelector.jPlayer).jPlayer("play")},pause:function(){b(this.cssSelector.jPlayer).jPlayer("pause")},
-next:function(){var a=this.current+1<this.playlist.length?this.current+1:0;this.loop?0===a&&this.shuffled&&this.options.playlistOptions.shuffleOnLoop&&1<this.playlist.length?this.shuffle(!0,!0):this.play(a):0<a&&this.play(a)},previous:function(){var a=0<=this.current-1?this.current-1:this.playlist.length-1;(this.loop&&this.options.playlistOptions.loopOnPrevious||a<this.playlist.length-1)&&this.play(a)},shuffle:function(a,c){var d=this;a===f&&(a=!this.shuffled);(a||a!==this.shuffled)&&b(this.cssSelector.playlist+
-" ul").slideUp(this.options.playlistOptions.shuffleTime,function(){(d.shuffled=a)?d.playlist.sort(function(){return.5-Math.random()}):d._originalPlaylist();d._refresh(!0);c||!b(d.cssSelector.jPlayer).data("jPlayer").status.paused?d.play(0):d.select(0);b(this).slideDown(d.options.playlistOptions.shuffleTime)})},blur:function(a){b(this.cssSelector.jPlayer).jPlayer("option","autoBlur")&&b(a).blur()}}})(jQuery);

+ 0 - 338
support/client/lib/vwf/model/jPlayer.2.7.1/add-on/jquery.jplayer.inspector.js

@@ -1,338 +0,0 @@
-/*
- * jPlayerInspector Plugin for jPlayer Plugin for jQuery JavaScript Library
- * http://www.jplayer.org
- *
- * Copyright (c) 2009 - 2014 Happyworm Ltd
- * Licensed under the MIT license.
- * http://www.opensource.org/licenses/MIT
- *
- * Author: Mark J Panaghiston
- * Version: 1.0.5
- * Date: 1st April 2014
- *
- * For use with jPlayer Version: 2.6.0+
- *
- * Note: Declare inspector instances after jPlayer instances. ie., Otherwise the jPlayer instance is nonsense.
- */
-
-(function($, undefined) {
-	$.jPlayerInspector = {};
-	$.jPlayerInspector.i = 0;
-	$.jPlayerInspector.defaults = {
-		jPlayer: undefined, // The jQuery selector of the jPlayer instance to inspect.
-		idPrefix: "jplayer_inspector_",
-		visible: false
-	};
-	
-	var methods = {
-		init: function(options) {
-			var self = this;
-			var $this = $(this);
-			
-			var config = $.extend({}, $.jPlayerInspector.defaults, options);
-			$(this).data("jPlayerInspector", config);
-
-			config.id = $(this).attr("id");
-			config.jPlayerId = config.jPlayer.attr("id");
-
-			config.windowId = config.idPrefix + "window_" + $.jPlayerInspector.i;
-			config.statusId = config.idPrefix + "status_" + $.jPlayerInspector.i;
-			config.configId = config.idPrefix + "config_" + $.jPlayerInspector.i;
-			config.toggleId = config.idPrefix + "toggle_" + $.jPlayerInspector.i;
-			config.eventResetId = config.idPrefix + "event_reset_" + $.jPlayerInspector.i;
-			config.updateId = config.idPrefix + "update_" + $.jPlayerInspector.i;
-			config.eventWindowId = config.idPrefix + "event_window_" + $.jPlayerInspector.i;
-			
-			config.eventId = {};
-			config.eventJq = {};
-			config.eventTimeout = {};
-			config.eventOccurrence = {};
-			
-			$.each($.jPlayer.event, function(eventName,eventType) {
-				config.eventId[eventType] = config.idPrefix + "event_" + eventName + "_" + $.jPlayerInspector.i;
-				config.eventOccurrence[eventType] = 0;
-			});
-			
-			var structure = 
-				'<p><a href="#" id="' + config.toggleId + '">' + (config.visible ? "Hide" : "Show") + '</a> jPlayer Inspector</p>' 
-				+ '<div id="' + config.windowId + '">'
-					+ '<div id="' + config.statusId + '"></div>'
-					+ '<div id="' + config.eventWindowId + '" style="padding:5px 5px 0 5px;background-color:#eee;border:1px dotted #000;">'
-						+ '<p style="margin:0 0 10px 0;"><strong>jPlayer events that have occurred over the past 1 second:</strong>'
-						+ '<br />(Backgrounds: <span style="padding:0 5px;background-color:#eee;border:1px dotted #000;">Never occurred</span> <span style="padding:0 5px;background-color:#fff;border:1px dotted #000;">Occurred before</span> <span style="padding:0 5px;background-color:#9f9;border:1px dotted #000;">Occurred</span> <span style="padding:0 5px;background-color:#ff9;border:1px dotted #000;">Multiple occurrences</span> <a href="#" id="' + config.eventResetId + '">reset</a>)</p>';
-			
-			// MJP: Would use the next 3 lines for ease, but the events are just slapped on the page.
-			// $.each($.jPlayer.event, function(eventName,eventType) {
-			// 	structure += '<div id="' + config.eventId[eventType] + '" style="float:left;">' + eventName + '</div>';
-			// });
-			
-			var eventStyle = "float:left;margin:0 5px 5px 0;padding:0 5px;border:1px dotted #000;";
-			// MJP: Doing it longhand so order and layout easier to control.
-			structure +=
-						'<div id="' + config.eventId[$.jPlayer.event.ready] + '" style="' + eventStyle + '"></div>'
-						+ '<div id="' + config.eventId[$.jPlayer.event.setmedia] + '" style="' + eventStyle + '"></div>'
-						+ '<div id="' + config.eventId[$.jPlayer.event.flashreset] + '" style="' + eventStyle + '"></div>'
-						+ '<div id="' + config.eventId[$.jPlayer.event.resize] + '" style="' + eventStyle + '"></div>'
-						+ '<div id="' + config.eventId[$.jPlayer.event.repeat] + '" style="' + eventStyle + '"></div>'
-						+ '<div id="' + config.eventId[$.jPlayer.event.click] + '" style="' + eventStyle + '"></div>'
-						+ '<div id="' + config.eventId[$.jPlayer.event.warning] + '" style="' + eventStyle + '"></div>'
-
-						+ '<div id="' + config.eventId[$.jPlayer.event.loadstart] + '" style="clear:left;' + eventStyle + '"></div>'
-						+ '<div id="' + config.eventId[$.jPlayer.event.progress] + '" style="' + eventStyle + '"></div>'
-						+ '<div id="' + config.eventId[$.jPlayer.event.timeupdate] + '" style="' + eventStyle + '"></div>'
-						+ '<div id="' + config.eventId[$.jPlayer.event.volumechange] + '" style="' + eventStyle + '"></div>'
-						+ '<div id="' + config.eventId[$.jPlayer.event.error] + '" style="' + eventStyle + '"></div>'
-
-						+ '<div id="' + config.eventId[$.jPlayer.event.play] + '" style="clear:left;' + eventStyle + '"></div>'
-						+ '<div id="' + config.eventId[$.jPlayer.event.pause] + '" style="' + eventStyle + '"></div>'
-						+ '<div id="' + config.eventId[$.jPlayer.event.waiting] + '" style="' + eventStyle + '"></div>'
-						+ '<div id="' + config.eventId[$.jPlayer.event.playing] + '" style="' + eventStyle + '"></div>'
-						+ '<div id="' + config.eventId[$.jPlayer.event.seeking] + '" style="' + eventStyle + '"></div>'
-						+ '<div id="' + config.eventId[$.jPlayer.event.seeked] + '" style="' + eventStyle + '"></div>'
-						+ '<div id="' + config.eventId[$.jPlayer.event.ended] + '" style="' + eventStyle + '"></div>'
-
-						+ '<div id="' + config.eventId[$.jPlayer.event.loadeddata] + '" style="clear:left;' + eventStyle + '"></div>'
-						+ '<div id="' + config.eventId[$.jPlayer.event.loadedmetadata] + '" style="' + eventStyle + '"></div>'
-						+ '<div id="' + config.eventId[$.jPlayer.event.canplay] + '" style="' + eventStyle + '"></div>'
-						+ '<div id="' + config.eventId[$.jPlayer.event.canplaythrough] + '" style="' + eventStyle + '"></div>'
-
-						+ '<div id="' + config.eventId[$.jPlayer.event.suspend] + '" style="clear:left;' + eventStyle + '"></div>'
-						+ '<div id="' + config.eventId[$.jPlayer.event.abort] + '" style="' + eventStyle + '"></div>'
-						+ '<div id="' + config.eventId[$.jPlayer.event.emptied] + '" style="' + eventStyle + '"></div>'
-						+ '<div id="' + config.eventId[$.jPlayer.event.stalled] + '" style="' + eventStyle + '"></div>'
-						+ '<div id="' + config.eventId[$.jPlayer.event.ratechange] + '" style="' + eventStyle + '"></div>'
-						+ '<div id="' + config.eventId[$.jPlayer.event.durationchange] + '" style="' + eventStyle + '"></div>'
-
-						+ '<div style="clear:both"></div>';
-
-			// MJP: Would like a check here in case we missed an event.
-
-			// MJP: Check fails, since it is not on the page yet.
-/*			$.each($.jPlayer.event, function(eventName,eventType) {
-				if($("#" + config.eventId[eventType])[0] === undefined) {
-					structure += '<div id="' + config.eventId[eventType] + '" style="clear:left;' + eventStyle + '">' + eventName + '</div>';
-				}
-			});
-*/
-			structure +=
-					'</div>'
-					+ '<p><a href="#" id="' + config.updateId + '">Update</a> jPlayer Inspector</p>'
-					+ '<div id="' + config.configId + '"></div>'
-				+ '</div>';
-			$(this).html(structure);
-			
-			config.windowJq = $("#" + config.windowId);
-			config.statusJq = $("#" + config.statusId);
-			config.configJq = $("#" + config.configId);
-			config.toggleJq = $("#" + config.toggleId);
-			config.eventResetJq = $("#" + config.eventResetId);
-			config.updateJq = $("#" + config.updateId);
-
-			$.each($.jPlayer.event, function(eventName,eventType) {
-				config.eventJq[eventType] = $("#" + config.eventId[eventType]);
-				config.eventJq[eventType].text(eventName + " (" + config.eventOccurrence[eventType] + ")"); // Sets the text to the event name and (0);
-				
-				config.jPlayer.bind(eventType + ".jPlayerInspector", function(e) {
-					config.eventOccurrence[e.type]++;
-					if(config.eventOccurrence[e.type] > 1) {
-						config.eventJq[e.type].css("background-color","#ff9");
-					} else {
-						config.eventJq[e.type].css("background-color","#9f9");
-					}
-					config.eventJq[e.type].text(eventName + " (" + config.eventOccurrence[e.type] + ")");
-					// The timer to handle the color
-					clearTimeout(config.eventTimeout[e.type]);
-					config.eventTimeout[e.type] = setTimeout(function() {
-						config.eventJq[e.type].css("background-color","#fff");
-					}, 1000);
-					// The timer to handle the occurences.
-					setTimeout(function() {
-						config.eventOccurrence[e.type]--;
-						config.eventJq[e.type].text(eventName + " (" + config.eventOccurrence[e.type] + ")");
-					}, 1000);
-					if(config.visible) { // Update the status, if inspector open.
-						$this.jPlayerInspector("updateStatus");
-					}
-				});
-			});
-
-			config.jPlayer.bind($.jPlayer.event.ready + ".jPlayerInspector", function(e) {
-				$this.jPlayerInspector("updateConfig");
-			});
-
-			config.toggleJq.click(function() {
-				if(config.visible) {
-					$(this).text("Show");
-					config.windowJq.hide();
-					config.statusJq.empty();
-					config.configJq.empty();
-				} else {
-					$(this).text("Hide");
-					config.windowJq.show();
-					config.updateJq.click();
-				}
-				config.visible = !config.visible;
-				$(this).blur();
-				return false;
-			});
-
-			config.eventResetJq.click(function() {
-				$.each($.jPlayer.event, function(eventName,eventType) {
-					config.eventJq[eventType].css("background-color","#eee");
-				});
-				$(this).blur();
-				return false;
-			});
-
-			config.updateJq.click(function() {
-				$this.jPlayerInspector("updateStatus");
-				$this.jPlayerInspector("updateConfig");
-				return false;
-			});
-
-			if(!config.visible) {
-				config.windowJq.hide();
-			} else {
-				// config.updateJq.click();
-			}
-			
-			$.jPlayerInspector.i++;
-
-			return this;
-		},
-		destroy: function() {
-			$(this).data("jPlayerInspector") && $(this).data("jPlayerInspector").jPlayer.unbind(".jPlayerInspector");
-			$(this).empty();
-		},
-		updateConfig: function() { // This displays information about jPlayer's configuration in inspector
-		
-			var jPlayerInfo = "<p>This jPlayer instance is running in your browser where:<br />"
-
-			for(i = 0; i < $(this).data("jPlayerInspector").jPlayer.data("jPlayer").solutions.length; i++) {
-				var solution = $(this).data("jPlayerInspector").jPlayer.data("jPlayer").solutions[i];
-				jPlayerInfo += "&nbsp;jPlayer's <strong>" + solution + "</strong> solution is";				
-				if($(this).data("jPlayerInspector").jPlayer.data("jPlayer")[solution].used) {
-					jPlayerInfo += " being <strong>used</strong> and will support:<strong>";
-					for(format in $(this).data("jPlayerInspector").jPlayer.data("jPlayer")[solution].support) {
-						if($(this).data("jPlayerInspector").jPlayer.data("jPlayer")[solution].support[format]) {
-							jPlayerInfo += " " + format;
-						}
-					}
-					jPlayerInfo += "</strong><br />";
-				} else {
-					jPlayerInfo += " <strong>not required</strong><br />";
-				}
-			}
-			jPlayerInfo += "</p>";
-
-			if($(this).data("jPlayerInspector").jPlayer.data("jPlayer").html.active) {
-				if($(this).data("jPlayerInspector").jPlayer.data("jPlayer").flash.active) {
-					jPlayerInfo += "<strong>Problem with jPlayer since both HTML5 and Flash are active.</strong>";
-				} else {
-					jPlayerInfo += "The <strong>HTML5 is active</strong>.";
-				}
-			} else {
-				if($(this).data("jPlayerInspector").jPlayer.data("jPlayer").flash.active) {
-					jPlayerInfo += "The <strong>Flash is active</strong>.";
-				} else {
-					jPlayerInfo += "No solution is currently active. jPlayer needs a setMedia().";
-				}
-			}
-			jPlayerInfo += "</p>";
-
-			var formatType = $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.formatType;
-			jPlayerInfo += "<p><code>status.formatType = '" + formatType + "'</code><br />";
-			if(formatType) {
-				jPlayerInfo += "<code>Browser canPlay('" + $.jPlayer.prototype.format[formatType].codec + "')</code>";
-			} else {
-				jPlayerInfo += "</p>";
-			}
-			
-			jPlayerInfo += "<p><code>status.src = '" + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.src + "'</code></p>";
-
-			jPlayerInfo += "<p><code>status.media = {<br />";
-			for(prop in $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.media) {
-				jPlayerInfo += "&nbsp;" + prop + ": " + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.media[prop] + "<br />"; // Some are strings
-			}
-			jPlayerInfo += "};</code></p>"
-
-			jPlayerInfo += "<p>";
-			jPlayerInfo += "<code>status.videoWidth = '" + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.videoWidth + "'</code>";
-			jPlayerInfo += " | <code>status.videoHeight = '" + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.videoHeight + "'</code>";
-			jPlayerInfo += "<br /><code>status.width = '" + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.width + "'</code>";
-			jPlayerInfo += " | <code>status.height = '" + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.height + "'</code>";
-			jPlayerInfo += "</p>";
-
-			+ "<p>Raw browser test for HTML5 support. Should equal a function if HTML5 is available.<br />";
-			if($(this).data("jPlayerInspector").jPlayer.data("jPlayer").html.audio.available) {
-				jPlayerInfo += "<code>htmlElement.audio.canPlayType = " + (typeof $(this).data("jPlayerInspector").jPlayer.data("jPlayer").htmlElement.audio.canPlayType) +"</code><br />"
-			}
-			if($(this).data("jPlayerInspector").jPlayer.data("jPlayer").html.video.available) {
-				jPlayerInfo += "<code>htmlElement.video.canPlayType = " + (typeof $(this).data("jPlayerInspector").jPlayer.data("jPlayer").htmlElement.video.canPlayType) +"</code>";
-			}
-			jPlayerInfo += "</p>";
-
-			jPlayerInfo += "<p>This instance is using the constructor options:<br />"
-			+ "<code>$('#" + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").internal.self.id + "').jPlayer({<br />"
-
-			+ "&nbsp;swfPath: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "swfPath") + "',<br />"
-
-			+ "&nbsp;solution: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "solution") + "',<br />"
-
-			+ "&nbsp;supplied: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "supplied") + "',<br />"
-
-			+ "&nbsp;preload: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "preload") + "',<br />"
-			
-			+ "&nbsp;volume: " + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "volume") + ",<br />"
-			
-			+ "&nbsp;muted: " + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "muted") + ",<br />"
-
-			+ "&nbsp;backgroundColor: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "backgroundColor") + "',<br />"
-
-			+ "&nbsp;cssSelectorAncestor: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "cssSelectorAncestor") + "',<br />"
-
-			+ "&nbsp;cssSelector: {";
-
-			var cssSelector = $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "cssSelector");
-			for(prop in cssSelector) {
-				
-				// jPlayerInfo += "<br />&nbsp;&nbsp;" + prop + ": '" + cssSelector[prop] + "'," // This works too of course, but want to use option method for deep keys.
-				jPlayerInfo += "<br />&nbsp;&nbsp;" + prop + ": '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "cssSelector." + prop) + "',"
-			}
-
-			jPlayerInfo = jPlayerInfo.slice(0, -1); // Because the sloppy comma was bugging me.
-
-			jPlayerInfo += "<br />&nbsp;},<br />"
-
-			+ "&nbsp;errorAlerts: " + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "errorAlerts") + ",<br />"
-			
-			+ "&nbsp;warningAlerts: " + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "warningAlerts") + "<br />"
-
-			+ "});</code></p>";
-			$(this).data("jPlayerInspector").configJq.html(jPlayerInfo);
-			return this;
-		},
-		updateStatus: function() { // This displays information about jPlayer's status in the inspector
-			$(this).data("jPlayerInspector").statusJq.html(
-				"<p>jPlayer is " +
-				($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.paused ? "paused" : "playing") +
-				" at time: " + Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.currentTime*10)/10 + "s." +
-				" (d: " + Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.duration*10)/10 + "s" +
-				", sp: " + Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.seekPercent) + "%" +
-				", cpr: " + Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.currentPercentRelative) + "%" +
-				", cpa: " + Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.currentPercentAbsolute) + "%)</p>"
-			);
-			return this;
-		}
-	};
-	$.fn.jPlayerInspector = function( method ) {
-		// Method calling logic
-		if ( methods[method] ) {
-			return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ));
-		} else if ( typeof method === 'object' || ! method ) {
-			return methods.init.apply( this, arguments );
-		} else {
-			$.error( 'Method ' +  method + ' does not exist on jQuery.jPlayerInspector' );
-		}    
-	};
-})(jQuery);

Fișier diff suprimat deoarece este prea mare
+ 0 - 0
support/client/lib/vwf/model/jPlayer.2.7.1/jquery.jplayer.min.js


+ 0 - 583
support/client/lib/vwf/model/jPlayer.2.7.1/popcorn/popcorn.jplayer.js

@@ -1,583 +0,0 @@
-/*
- * jPlayer Player Plugin for Popcorn JavaScript Library
- * http://www.jplayer.org
- *
- * Copyright (c) 2012 - 2014 Happyworm Ltd
- * Licensed under the MIT license.
- * http://opensource.org/licenses/MIT
- *
- * Author: Mark J Panaghiston
- * Version: 1.1.4
- * Date: 1st September 2014
- *
- * For Popcorn Version: 1.3
- * For jPlayer Version: 2.7.0
- * Requires: jQuery 1.7+
- * Note: jQuery dependancy cannot be removed since jPlayer 2 is a jQuery plugin. Use of jQuery will be kept to a minimum.
- */
-
-/* Code verified using http://www.jshint.com/ */
-/*jshint asi:false, bitwise:false, boss:false, browser:true, curly:false, debug:false, eqeqeq:true, eqnull:false, evil:false, forin:false, immed:false, jquery:true, laxbreak:false, newcap:true, noarg:true, noempty:true, nonew:true, onevar:false, passfail:false, plusplus:false, regexp:false, undef:true, sub:false, strict:false, white:false, smarttabs:true */
-/*global Popcorn:false, console:false */
-
-(function(Popcorn) {
-
-	var JQUERY_SCRIPT = '//code.jquery.com/jquery-1.11.1.min.js', // Used if jQuery not already present.
-	JPLAYER_SCRIPT = '//www.jplayer.org/2.7.0/js/jquery.jplayer.min.js', // Used if jPlayer not already present.
-	JPLAYER_SWFPATH = '//www.jplayer.org/2.7.0/js/Jplayer.swf', // Used if not specified in jPlayer options via SRC Object.
-	SOLUTION = 'html,flash', // The default solution option.
-	DEBUG = false, // Decided to leave the debugging option and console output in for the time being. Overhead is trivial.
-	jQueryDownloading = false, // Flag to stop multiple instances from each pulling in jQuery, thus corrupting it.
-	jPlayerDownloading = false, // Flag to stop multiple instances from each pulling in jPlayer, thus corrupting it.
-	format = { // Duplicate of jPlayer 2.5.0 object, to avoid always requiring jQuery and jPlayer to be loaded before performing the _canPlayType() test.
-		mp3: {
-			codec: 'audio/mpeg;',
-			flashCanPlay: true,
-			media: 'audio'
-		},
-		m4a: { // AAC / MP4
-			codec: 'audio/mp4; codecs="mp4a.40.2"',
-			flashCanPlay: true,
-			media: 'audio'
-		},
-		m3u8a: { // AAC / MP4 / Apple HLS
-			codec: 'application/vnd.apple.mpegurl; codecs="mp4a.40.2"',
-			flashCanPlay: false,
-			media: 'audio'
-		},
-		m3ua: { // M3U
-			codec: 'audio/mpegurl',
-			flashCanPlay: false,
-			media: 'audio'
-		},
-		oga: { // OGG
-			codec: 'audio/ogg; codecs="vorbis, opus"',
-			flashCanPlay: false,
-			media: 'audio'
-		},
-		flac: { // FLAC
-			codec: 'audio/x-flac',
-			flashCanPlay: false,
-			media: 'audio'
-		},
-		wav: { // PCM
-			codec: 'audio/wav; codecs="1"',
-			flashCanPlay: false,
-			media: 'audio'
-		},
-		webma: { // WEBM
-			codec: 'audio/webm; codecs="vorbis"',
-			flashCanPlay: false,
-			media: 'audio'
-		},
-		fla: { // FLV / F4A
-			codec: 'audio/x-flv',
-			flashCanPlay: true,
-			media: 'audio'
-		},
-		rtmpa: { // RTMP AUDIO
-			codec: 'audio/rtmp; codecs="rtmp"',
-			flashCanPlay: true,
-			media: 'audio'
-		},
-		m4v: { // H.264 / MP4
-			codec: 'video/mp4; codecs="avc1.42E01E, mp4a.40.2"',
-			flashCanPlay: true,
-			media: 'video'
-		},
-		m3u8v: { // H.264 / AAC / MP4 / Apple HLS
-			codec: 'application/vnd.apple.mpegurl; codecs="avc1.42E01E, mp4a.40.2"',
-			flashCanPlay: false,
-			media: 'video'
-		},
-		m3uv: { // M3U
-			codec: 'audio/mpegurl',
-			flashCanPlay: false,
-			media: 'video'
-		},
-		ogv: { // OGG
-			codec: 'video/ogg; codecs="theora, vorbis"',
-			flashCanPlay: false,
-			media: 'video'
-		},
-		webmv: { // WEBM
-			codec: 'video/webm; codecs="vorbis, vp8"',
-			flashCanPlay: false,
-			media: 'video'
-		},
-		flv: { // FLV / F4V
-			codec: 'video/x-flv',
-			flashCanPlay: true,
-			media: 'video'
-		},
-		rtmpv: { // RTMP VIDEO
-			codec: 'video/rtmp; codecs="rtmp"',
-			flashCanPlay: true,
-			media: 'video'
-		}
-	},
-	isObject = function(val) { // Basic check for Object
-		if(val && typeof val === 'object' && val.hasOwnProperty) {
-			return true;
-		} else {
-			return false;
-		}
-	},
-	getMediaType = function(url) { // Function to gleam the media type from the URL
-		var mediaType = false;
-		if(/\.mp3$/i.test(url)) {
-			mediaType = 'mp3';
-		} else if(/\.mp4$/i.test(url) || /\.m4v$/i.test(url)) {
-			mediaType = 'm4v';
-		} else if(/\.m4a$/i.test(url)) {
-			mediaType = 'm4a';
-		} else if(/\.ogg$/i.test(url) || /\.oga$/i.test(url)) {
-			mediaType = 'oga';
-		} else if(/\.ogv$/i.test(url)) {
-			mediaType = 'ogv';
-		} else if(/\.webm$/i.test(url)) {
-			mediaType = 'webmv';
-		}
-		return mediaType;
-	},
-	getSupplied = function(url) { // Function to generate a supplied option from an src object. ie., When supplied not specified.
-		var supplied = '',
-		separator = '';
-		if(isObject(url)) {
-			// Generate supplied option from object's properties. Non-format properties would be ignored by jPlayer. Order is unpredictable.
-			for(var prop in url) {
-				if(url.hasOwnProperty(prop)) {
-					supplied += separator + prop;
-					separator = ',';
-				}
-			}
-		}
-		if(DEBUG) console.log('getSupplied(): Generated: supplied = "' + supplied + '"');
-		return supplied;
-	};
-
-	Popcorn.player( 'jplayer', {
-		_canPlayType: function( containerType, url ) {
-			// url : Either a String or an Object structured similar a jPlayer media object. ie., As used by setMedia in jPlayer.
-			// The url object may also contain a solution and supplied property.
-
-			// Define the src object structure here!
-
-			var cType = containerType.toLowerCase(),
-			srcObj = {
-				media:{},
-				options:{}
-			},
-			rVal = false, // Only a boolean false means it is not supported.
-			mediaType;
-
-			if(cType !== 'video' && cType !== 'audio') {
-
-				if(typeof url === 'string') {
-					// Check it starts with http, so the URL is absolute... Well, it is not a perfect check.
-					if(/^http.*/i.test(url)) {
-						mediaType = getMediaType(url);
-						if(mediaType) {
-							srcObj.media[mediaType] = url;
-							srcObj.options.solution = SOLUTION;
-							srcObj.options.supplied = mediaType;
-						}
-					}
-				} else {
-					srcObj = url; // Assume the url is an src object.
-				}
-
-				// Check for Object and appropriate minimum data structure.
-				if(isObject(srcObj) && isObject(srcObj.media)) {
-
-					if(!isObject(srcObj.options)) {
-						srcObj.options = {};
-					}
-
-					if(!srcObj.options.solution) {
-						srcObj.options.solution = SOLUTION;
-					}
-
-					if(!srcObj.options.supplied) {
-						srcObj.options.supplied = getSupplied(srcObj.media);
-					}
-
-					// Figure out how jPlayer will play it.
-					// This may not work properly when both audio and video is supplied. ie., A media player. But it should return truethy and jPlayer can figure it out.
-					
-					var solution = srcObj.options.solution.toLowerCase().split(","), // Create the solution array, with prority based on the order of the solution string.
-					supplied = srcObj.options.supplied.toLowerCase().split(","); // Create the supplied formats array, with prority based on the order of the supplied formats string.
-
-					for(var sol = 0; sol < solution.length; sol++) {
-
-						var solutionType = solution[sol].replace(/^\s+|\s+$/g, ""), //trim
-						checkingHtml = solutionType === 'html',
-						checkingFlash = solutionType === 'flash',
-						mediaElem;
-
-						for(var fmt = 0; fmt < supplied.length; fmt++) {
-							mediaType = supplied[fmt].replace(/^\s+|\s+$/g, ""); //trim
-							if(format[mediaType]) { // Check format is valid.
-
-								// Create an HTML5 media element for the type of media.
-								if(!mediaElem && checkingHtml) {
-									mediaElem = document.createElement(format[mediaType].media);
-								}
-								// See if the HTML5 media element can play the MIME / Codec type.
-								// Flash also returns the object if the format is playable, so it is truethy, but that html property is false.
-								// This assumes Flash is available, but that should be dealt with by jPlayer if that happens.
-								var htmlCanPlay = !!(mediaElem && mediaElem.canPlayType && mediaElem.canPlayType(format[mediaType].codec)),
-								htmlWillPlay = htmlCanPlay && checkingHtml,
-								flashWillPlay = format[mediaType].flashCanPlay && checkingFlash;
-								// The first one found will match what jPlayer uses.
-								if(htmlWillPlay || flashWillPlay) {
-									rVal = {
-										html: htmlWillPlay,
-										type: mediaType
-									};
-									sol = solution.length; // Exit solution loop
-									fmt = supplied.length; // Exit supplied loop
-								}
-							}
-						}
-					}
-				}
-			}
-			return rVal;
-		},
-		// _setup: function( options ) { // Warning: options is deprecated.
-		_setup: function() {
-			var media = this,
-			myPlayer, // The jQuery selector of the jPlayer element. Usually a <div>
-			jPlayerObj, // The jPlayer data instance. For performance and DRY code.
-			mediaType = 'unknown',
-			jpMedia = {},
-			jpOptions = {},
-			ready = false, // Used during init to override the annoying duration dependance in the track event padding during Popcorn's isReady(). ie., We is ready after loadeddata and duration can then be set real value at leisure.
-			duration = 0, // For the durationchange event with both HTML5 and Flash solutions. Used with 'ready' to keep control during the Popcorn isReady() via loadeddata event. (Duration=0 is bad.)
-			durationchangeId = null, // A timeout ID used with delayed durationchange event. (Because of the duration=NaN fudge to avoid Popcorn track event corruption.)
-			canplaythrough = false,
-			error = null, // The MediaError object.
-
-			dispatchDurationChange = function() {
-				if(ready) {
-					if(DEBUG) console.log('Dispatched event : durationchange : ' + duration);
-					media.dispatchEvent('durationchange');
-				} else {
-					if(DEBUG) console.log('DELAYED EVENT (!ready) : durationchange : ' + duration);
-					clearTimeout(durationchangeId); // Stop multiple triggers causing multiple timeouts running in parallel.
-					durationchangeId = setTimeout(dispatchDurationChange, 250);
-				}
-			},
-
-			jPlayerFlashEventsPatch = function() {
-
-				/* Events already supported by jPlayer Flash:
-				 * loadstart
-				 * loadedmetadata (M4A, M4V)
-				 * progress
-				 * play
-				 * pause
-				 * seeking
-				 * seeked
-				 * timeupdate
-				 * ended
-				 * volumechange
-				 * error <- See the custom handler in jPlayerInit()
-				 */
-
-				/* Events patched:
-				 * loadeddata
-				 * durationchange
-				 * canplaythrough
-				 * playing
-				 */
-
-				/* Events NOT patched:
-				 * suspend
-				 * abort
-				 * emptied
-				 * stalled
-				 * loadedmetadata (MP3)
-				 * waiting
-				 * canplay
-				 * ratechange
-				 */
-
-				// Triggering patched events through the jPlayer Object so the events are homogeneous. ie., The contain the event.jPlayer data structure.
-
-				var checkDuration = function(event) {
-					if(event.jPlayer.status.duration !== duration) {
-						duration = event.jPlayer.status.duration;
-						dispatchDurationChange();
-					}
-				},
-
-				checkCanPlayThrough = function(event) {
-					if(!canplaythrough && event.jPlayer.status.seekPercent === 100) {
-						canplaythrough = true;
-						setTimeout(function() {
-							if(DEBUG) console.log('Trigger : canplaythrough');
-							jPlayerObj._trigger($.jPlayer.event.canplaythrough);
-						}, 0);
-					}
-				};
-
-				myPlayer.bind($.jPlayer.event.loadstart, function() {
-					setTimeout(function() {
-						if(DEBUG) console.log('Trigger : loadeddata');
-						jPlayerObj._trigger($.jPlayer.event.loadeddata);
-					}, 0);
-				})
-				.bind($.jPlayer.event.progress, function(event) {
-					checkDuration(event);
-					checkCanPlayThrough(event);
-				})
-				.bind($.jPlayer.event.timeupdate, function(event) {
-					checkDuration(event);
-					checkCanPlayThrough(event);
-				})
-				.bind($.jPlayer.event.play, function() {
-					setTimeout(function() {
-						if(DEBUG) console.log('Trigger : playing');
-						jPlayerObj._trigger($.jPlayer.event.playing);
-					}, 0);
-				});
-
-				if(DEBUG) console.log('Created CUSTOM event handlers for FLASH');
-			},
-
-			jPlayerInit = function() {
-				(function($) {
-
-					myPlayer = $('#' +  media.id);
-
-					if(typeof media.src === 'string') {
-						mediaType = getMediaType(media.src);
-						jpMedia[mediaType] = media.src;
-						jpOptions.supplied = mediaType;
-						jpOptions.solution = SOLUTION;
-					} else if(isObject(media.src)) {
-						jpMedia = isObject(media.src.media) ? media.src.media : {};
-						jpOptions = isObject(media.src.options) ? media.src.options : {};
-						jpOptions.solution = jpOptions.solution || SOLUTION;
-						jpOptions.supplied = jpOptions.supplied || getSupplied(media.src.media);
-					}
-
-					// Allow the swfPath to be set to local server. ie., If the jPlayer Plugin is local and already on the page, then you can also use the local SWF.
-					jpOptions.swfPath = jpOptions.swfPath || JPLAYER_SWFPATH;
-
-					myPlayer.bind($.jPlayer.event.ready, function(event) {
-						if(event.jPlayer.flash.used) {
-							jPlayerFlashEventsPatch();
-						}
-						// Set the media andd load it, so that the Flash solution behaves similar to HTML5 solution.
-						// This also allows the loadstart event to be used to know jPlayer is ready.
-						$(this).jPlayer('setMedia', jpMedia).jPlayer('load');
-					});
-
-					// Do not auto-bubble the reserved events, nor the loadeddata and durationchange event, since the duration must be carefully handled when loadeddata event occurs.
-					// See the duration property code for more details. (Ranting.)
-
-					var reservedEvents = $.jPlayer.reservedEvent + ' loadeddata durationchange',
-					reservedEvent = reservedEvents.split(/\s+/g);
-
-					// Generate event handlers for all the standard HTML5 media events. (Except durationchange)
-
-					var bindEvent = function(name) {
-						myPlayer.bind($.jPlayer.event[name], function(event) {
-							if(DEBUG) console.log('Dispatched event: ' + name + (event && event.jPlayer ? ' (' + event.jPlayer.status.currentTime + 's)' : '')); // Must be after dispatch for some reason on Firefox/Opera
-							media.dispatchEvent(name);
-						});
-						if(DEBUG) console.log('Created event handler for: ' + name);
-					};
-
-					for(var eventName in $.jPlayer.event) {
-						if($.jPlayer.event.hasOwnProperty(eventName)) {
-							var nativeEvent = true;
-							for(var iRes in reservedEvent) {
-								if(reservedEvent.hasOwnProperty(iRes)) {
-									if(reservedEvent[iRes] === eventName) {
-										nativeEvent = false;
-										break;
-									}
-								}
-							}
-							if(nativeEvent) {
-								bindEvent(eventName);
-							} else {
-								if(DEBUG) console.log('Skipped auto event handler creation for: ' + eventName);
-							}
-						}
-					}
-
-					myPlayer.bind($.jPlayer.event.loadeddata, function(event) {
-						if(DEBUG) console.log('Dispatched event: loadeddata' + (event && event.jPlayer ? ' (' + event.jPlayer.status.currentTime + 's)' : ''));
-						media.dispatchEvent('loadeddata');
-						ready = true;
-					});
-					if(DEBUG) console.log('Created CUSTOM event handler for: loadeddata');
-
-					myPlayer.bind($.jPlayer.event.durationchange, function(event) {
-						duration = event.jPlayer.status.duration;
-						dispatchDurationChange();
-					});
-					if(DEBUG) console.log('Created CUSTOM event handler for: durationchange');
-
-					// The error event is a special case. Plus jPlayer error event assumes it is a broken URL. (It could also be a decoder error... Or aborted or a Network error.)
-					myPlayer.bind($.jPlayer.event.error, function(event) {
-						// Not sure how to handle the error situation. Popcorn does not appear to have the error or error.code property documented here: http://popcornjs.org/popcorn-docs/media-methods/
-						// If any error event happens, then something has gone pear shaped.
-
-						error = event.jPlayer.error; // Saving object pointer, not a copy of the object. Possible garbage collection issue... But the player is dead anyway, so don't care.
-
-						if(error.type === $.jPlayer.error.URL) {
-							error.code = 4; // MEDIA_ERR_SRC_NOT_SUPPORTED since jPlayer makes this assumption. It is the most common error, then the decode error. Never seen either of the other 2 error types occur.
-						} else {
-							error.code = 0; // It was a jPlayer error, not an HTML5 media error.
-						}
-
-						if(DEBUG) console.log('Dispatched event: error');
-						if(DEBUG) console.dir(error);
-						media.dispatchEvent('error');
-					});
-					if(DEBUG) console.log('Created CUSTOM event handler for: error');
-
-					Popcorn.player.defineProperty( media, 'error', {
-						set: function() {
-							// Read-only property
-							return error;
-						},
-						get: function() {
-							return error;
-						}
-					});
-
-					Popcorn.player.defineProperty( media, 'currentTime', {
-						set: function( val ) {
-							if(jPlayerObj.status.paused) {
-								myPlayer.jPlayer('pause', val);
-							} else {
-								myPlayer.jPlayer('play', val);
-							}
-							return val;
-						},
-						get: function() {
-							return jPlayerObj.status.currentTime;
-						}
-					});
-
-					/* The joy of duration and the loadeddata event isReady() handler
-					 * The duration is assumed to be a NaN or a valid duration.
-					 * jPlayer uses zero instead of a NaN and this screws up the Popcorn track event start/end arrays padding.
-					 * This line here:
-					 *  videoDurationPlus = duration != duration ? Number.MAX_VALUE : duration + 1;
-					 * Not sure why it is not simply:
-					 *  videoDurationPlus = Number.MAX_VALUE; // Who cares if the padding is close to the real duration?
-					 * So if you trigger loadeddata before the duration is correct, the track event padding is screwed up. (It pads the start, not the end... Well, duration+1 = 0+1 = 1s)
-					 * That line makes the MP3 Flash fallback difficult to setup. The whole MP3 will need to load before the duration is known.
-					 * Planning on using a NaN for duration until a >0 value is found... Except with MP3, where seekPercent must be 100% before setting the duration.
-					 * Why not just use a NaN during init... And then correct the duration later?
-					 */
-
-					Popcorn.player.defineProperty( media, 'duration', {
-						set: function() {
-							// Read-only property
-							if(ready) {
-								return duration;
-							} else {
-								return NaN;
-							}
-						},
-						get: function() {
-							if(ready) {
-								return duration; // Popcorn has initialized, we can now use duration zero or whatever without fear.
-							} else {
-								return NaN; // Keep the duration a NaN until after loadeddata event has occurred. Otherwise Popcorn track event padding is corrupted.
-							}
-						}
-					});
-
-					Popcorn.player.defineProperty( media, 'muted', {
-						set: function( val ) {
-							myPlayer.jPlayer('mute', val);
-							return jPlayerObj.options.muted;
-						},
-						get: function() {
-							return jPlayerObj.options.muted;
-						}
-					});
-
-					Popcorn.player.defineProperty( media, 'volume', {
-						set: function( val ) {
-							myPlayer.jPlayer('volume', val);
-							return jPlayerObj.options.volume;
-						},
-						get: function() {
-							return jPlayerObj.options.volume;
-						}
-					});
-
-					Popcorn.player.defineProperty( media, 'paused', {
-						set: function() {
-							// Read-only property
-							return jPlayerObj.status.paused;
-						},
-						get: function() {
-							return jPlayerObj.status.paused;
-						}
-					});
-
-					media.play = function() {
-						myPlayer.jPlayer('play');
-					};
-					media.pause = function() {
-						myPlayer.jPlayer('pause');
-					};
-
-					myPlayer.jPlayer(jpOptions); // Instance jPlayer. Note that the options should not have a ready event defined... Kill it by default?
-					jPlayerObj = myPlayer.data('jPlayer');
-
-				}(jQuery));
-			},
-
-			jPlayerCheck = function() {
-				if (!jQuery.jPlayer) {
-					if (!jPlayerDownloading) {
-						jPlayerDownloading = true;
-						Popcorn.getScript(JPLAYER_SCRIPT, function() {
-							jPlayerDownloading = false;
-							jPlayerInit();
-						});
-					} else {
-						setTimeout(jPlayerCheck, 250);
-					}
-				} else {
-					jPlayerInit();
-				}
-			},
-
-			jQueryCheck = function() {
-				if (!window.jQuery) {
-					if (!jQueryDownloading) {
-						jQueryDownloading = true;
-						Popcorn.getScript(JQUERY_SCRIPT, function() {
-							jQueryDownloading = false;
-							jPlayerCheck();
-						});
-					} else {
-						setTimeout(jQueryCheck, 250);
-					}
-				} else {
-					jPlayerCheck();
-				}
-			};
-
-			jQueryCheck();
-		},
-		_teardown: function() {
-			jQuery('#' +  this.id).jPlayer('destroy');
-		}
-	});
-
-}(Popcorn));

+ 0 - 457
support/client/lib/vwf/model/jPlayer.js

@@ -1,457 +0,0 @@
-/// vwf/model/jPlayer.js is a sound driver
-/// 
-/// @module vwf/model/jPlayer
-/// @requires vwf/model
-
-define( [   
-        "module", 
-        "vwf/model", 
-        "vwf/utility",
-        "jquery"
-    ], function( module, model, utility, $ ) {
-
-    var modelDriver;
-    var jPlayerInstanceCreated = false;
-    var audioManagerProtoId = "http://vwf.example.com/jplayer/audioManager.vwf";
-    var videoManagerProtoId = "http://vwf.example.com/jplayer/videoManager.vwf";
-
-    return model.load( module, {
-
-        // == Module Definition ====================================================================
-
-        // -- initialize ---------------------------------------------------------------------------
-
-        initialize: function( options ) {
-            
-        	modelDriver = this;
-
-            this.arguments = Array.prototype.slice.call( arguments );
-
-            this.options = options || {};
-
-            this.state = {
-                "nodes": {},
-                "stages": {},
-                "prototypes": {},
-                "createLocalNode": function( nodeID, childID, childExtendsID, childImplementsIDs,
-                                childSource, childType, childIndex, childName, callback ) {
-                    return {
-                        "parentID": nodeID,
-                        "ID": childID,
-                        "extendsID": childExtendsID,
-                        "implementsIDs": childImplementsIDs,
-                        "source": childSource,
-                        "type": childType,
-                        "name": childName,
-                        "prototypes": undefined,
-                        "delayedProperties": undefined,
-                        "soundObj": undefined,
-                        "playState": "unloaded",
-                        "playOnReady": false
-                    };
-                },
-                "isAudioManager": function( prototypes ) {
-                    var found = false;
-                    if ( prototypes ) {
-                        for ( var i = 0; i < prototypes.length && !found; i++ ) {
-                            found = ( prototypes[ i ].indexOf( audioManagerProtoId ) !== -1 );    
-                        }
-                    }
-                    return found;
-                },
-                "isVideoManager": function( prototypes ) {
-                    var found = false;
-                    if ( prototypes ) {
-                        for ( var i = 0; i < prototypes.length && !found; i++ ) {
-                            found = ( prototypes[ i ].indexOf( videoManagerProtoId ) !== -1 );    
-                        }
-                    }
-                    return found;
-                }
-            };
-
-            // turns on logger debugger console messages 
-            this.debug = {
-                "creation": false,
-                "initializing": false,
-                "parenting": false,
-                "deleting": false,
-                "properties": false,
-                "setting": false,
-                "getting": false,
-                "method": false,
-                "prototypes": false
-            };
-        },
-
-        creatingNode: function( nodeID, childID, childExtendsID, childImplementsIDs,
-                                childSource, childType, childIndex, childName, callback ) {
-
-            if ( this.debug.creation ) {
-                this.logger.infox( "creatingNode", nodeID, childID, childExtendsID, childImplementsIDs, childSource, childType, childName );
-            }
-
-            // If the node being created is a prototype, construct it and add it to the array of prototypes,
-            // and then return
-            var prototypeID = utility.ifPrototypeGetId.call( this, this.kernel.application(), 
-                this.state.prototypes, nodeID, childID );
-            if ( prototypeID !== undefined ) {
-                
-                if ( this.debug.prototypes ) {
-                    this.logger.infox( "prototype: ", prototypeID );
-                }
-
-                this.state.prototypes[ prototypeID ] = {
-                    parentID: nodeID,
-                    ID: childID,
-                    extendsID: childExtendsID,
-                    implementsID: childImplementsIDs,
-                    source: childSource, 
-                    type: childType,
-                    name: childName
-                };
-
-                if ( prototypeID.indexOf( audioManagerProtoId ) !== -1 ) {
-                    this.state.audioManagerProto = this.state.prototypes[ prototypeID ];
-                } else if ( prototypeID.indexOf( videoManagerProtoId ) !== -1 ) {
-                    this.state.videoManagerProto = this.state.prototypes[ prototypeID ];
-                }
-
-                return;                
-            }
-
-            var protos = getPrototypes( this.kernel, childExtendsID );
-
-            var isAudioManager = this.state.isAudioManager( protos );
-            var isVideoManager = this.state.isVideoManager( protos );
-            if ( isAudioManager || isVideoManager ) {
-
-                // Create the local copy of the node properties
-                if ( this.state.nodes[ childID ] === undefined ){
-                    this.state.nodes[ childID ] = this.state.createLocalNode( nodeID, childID, 
-                        childExtendsID, childImplementsIDs, childSource, 
-                        childType, childIndex, childName, callback );
-                }
-
-                node = this.state.nodes[ childID ];
-                
-                node.prototypes = protos;
-
-                if ( isAudioManager ) {
-                    node.managerType = "audio";
-                    setWithPrototypeProperties( this.state.audioManagerProto );
-                } else {
-                    node.managerType = "video";
-                    setWithPrototypeProperties( this.state.videoManagerProto );
-                }
-            }
-        },
-
-        deletingNode: function( nodeID ) {
-            
-            if ( this.debug.deleting ) {
-                this.logger.infox( "deletingNode", nodeID );
-            }
-
-            if ( this.state.nodes[ nodeID ] ) {
-                delete this.state.nodes[ nodeID ];
-            }
-
-        },
-
-        // -- creatingProperty ---------------------------------------------------------------------
-
-        creatingProperty: function( nodeID, propertyName, propertyValue ) {
-            if ( this.debug.properties ) {
-                this.logger.infox( "C === creatingProperty ", nodeID, propertyName, propertyValue );
-            }
-            return this.settingProperty( nodeID, propertyName, propertyValue );
-        },
-
-        // -- initializingProperty -----------------------------------------------------------------
-
-        initializingProperty: function( nodeID, propertyName, propertyValue ) {
-
-            if ( this.debug.properties ) {
-                this.logger.infox( "  I === initializingProperty ", nodeID, propertyName, propertyValue );
-            }
-
-            return this.settingProperty( nodeID, propertyName, propertyValue );
-            
-        },
-
-        // -- settingProperty ----------------------------------------------------------------------
-
-        settingProperty: function( nodeID, propertyName, propertyValue ) {
-
-            if ( this.debug.properties || this.debug.setting ) {
-                this.logger.infox( "    S === settingProperty ", nodeID, propertyName, propertyValue );
-            }
-
-            // Prepare return value
-            var value = undefined;
-
-            var node = this.state.nodes[ nodeID ];
- 
-            if ( node !== undefined ) {
-                switch ( propertyName ) {
-                    case "url":
-                        setUrl( node, propertyValue );
-                        value = node.url;
-                        break;
-                    case "loop":
-                        setLoop( node, propertyValue );
-                        value = node.loop;
-                        break;
-                    case "playerDivId":
-                        if ( propertyValue === node.playerDivId ) {
-                            break;
-                        }
-                        if ( node.playerDivId ) {
-                            $( "#" + node.playerDivId ).remove();
-                        }
-                        node.playerDivId = propertyValue;
-                        var $existingElement = $( "#" + node.playerDivId );
-                        if ( $existingElement.length ) {
-                            node.jPlayerElement = $existingElement;
-                        } else {
-                            node.jPlayerElement = $( "<div/>", {
-                                id: node.playerDivId
-                            } );
-                            $( "body" ).append( node.jPlayerElement );
-                        }
-                        var fileTypes = ( node.managerType === "audio" ) ? "mp3,wav" : "m4v";
-                        node.jPlayerElement.jPlayer( {
-                            ready: function() {
-                                if ( node.url !== undefined ) {
-                                    setUrl( node, node.url );
-                                }
-                                if ( node.loop !== undefined ) {
-                                    setLoop( node, node.loop );
-                                }
-                                if ( node.containerDivId !== undefined ) {
-                                    setControlDivId( node, node.containerDivId );
-                                }
-                            },
-                            supplied: fileTypes
-                        } );
-                        value = node.playerDivId;
-                        break;
-                    case "containerDivId":
-                        setControlDivId( node, propertyValue );
-                        value = node.containerDivId;
-                        break;
-                    case "posterImageUrl":
-                        setPosterImageUrl( node, propertyValue );
-                        value = node.posterImageUrl;
-                        break;
-                    default:
-                        break;
-                }
-            } else {
-                var proto;
-                var audioManagerProto = this.state.audioManagerProto;
-                var videoManagerProto = this.state.videoManagerProto;
-                if ( audioManagerProto && ( nodeID === audioManagerProto.ID ) ) {
-                    proto = this.state.audioManagerProto;
-                } else if ( videoManagerProto && ( nodeID === videoManagerProto.ID ) ) {
-                    proto = this.state.videoManagerProto;
-                }
-                if ( proto ) {
-                    switch ( propertyName ) {
-                        case "url":
-                            proto.url = propertyValue;
-                            value = proto.url;
-                            break;
-                        case "loop":
-                            proto.loop = propertyValue;
-                            value = proto.loop;
-                            break;
-                        case "playerDivId":
-                            proto.playerDivId = propertyValue;
-                            value = proto.playerDivId;
-                            break;
-                        case "containerDivId":
-                            proto.containerDivId = propertyValue;
-                            value = proto.containerDivId;
-                            break;
-                        case "posterImageUrl":
-                            proto.posterImageUrl = propertyValue;
-                            value = proto.posterImageUrl;
-                            break;
-                        default:
-                            break;
-                    }
-                }
-            }
-
-            return value;
-        },
-
-        // -- gettingProperty ----------------------------------------------------------------------
-
-        gettingProperty: function( nodeID, propertyName ) {
-
-            if ( this.debug.properties || this.debug.getting ) {
-                this.logger.infox( "   G === gettingProperty ", nodeID, propertyName );
-            }
-
-            var node = this.state.nodes[ nodeID ]; // { name: childName, glgeObject: undefined }
-
-            return node && node[ propertyName ];
-        },
-
-
-        // TODO: deletingMethod
-
-        // -- callingMethod --------------------------------------------------------------------------
-
-        callingMethod: function( nodeID, methodName, methodParameters ) { 
-
-            if ( this.debug.method ) {
-                this.logger.infox( "   G === gettingProperty ", nodeID, propertyName );
-            }
-
-            var node = this.state.nodes[ nodeID ];   
-
-            if ( !node ) {
-                return;
-            }
-            
-            if ( node.jPlayerElement ) {
-
-                switch( methodName ) {
-                    
-                    case "play":
-                        node.jPlayerElement.jPlayer( "play" ); 
-                        break;
-
-                    case "pause":
-                        node.jPlayerElement.jPlayer( "pause" );
-                        break;
-
-                    case "stop":
-                        node.jPlayerElement.jPlayer( "stop" );
-                        break;
-
-                }  
-
-            }
-       
-        },
-
-    } );
-
-    function getPrototypes( kernel, extendsID ) {
-        var prototypes = [];
-        var id = extendsID;
-
-        while ( id !== undefined ) {
-            prototypes.push( id );
-            id = kernel.prototype( id );
-        }
-                
-        return prototypes;
-    }
-
-    function setWithPrototypeProperties( proto ) {
-        if ( proto.url !== null ) {
-            vwf.setProperty( node.ID, "url", proto.url );
-        }
-        if ( proto.loop !== null ) {
-            vwf.setProperty( node.ID, "loop", proto.loop );
-        }
-        if ( proto.playerDivId !== null ) {
-            vwf.setProperty( node.ID, "playerDivId", proto.playerDivId );
-        }
-        if ( proto.containerDivId !== null ) {
-            vwf.setProperty( node.ID, "containerDivId", proto.containerDivId );
-        }
-        if ( proto.posterImageUrl !== null ) {
-            vwf.setProperty( node.ID, "posterImageUrl", proto.posterImageUrl );
-        }
-    }
-
-    function setUrl( node, url ) {
-        node.url = url;
-
-        // If there is no jPlayerElement, there is nothing to do yet so we return.
-        // Once the jPlayerElement is created, setUrl will run again using the saved value
-        if ( !node.jPlayerElement ) {
-            return;
-        }
-
-        // If there is a url, set the media for the jPlayer object appropriately
-        // Otherwise, clear the media
-        if ( url ) {
-
-            // Construct the media object based on the type of file being passed in
-            var mediaObject;
-            switch ( node.managerType ) {
-                case "audio":
-                    if ( url.search( "data:audio/mp3" ) === 0 ) {
-                        mediaObject = {
-                            mp3: url
-                        };
-                    } else if ( url.search( "data:audio/wav" ) === 0 ) {
-                        mediaObject = {
-                            wav: url
-                        };
-                    } else {
-                        modelDriver.logger.errorx( "setUrl", 
-                            "Unsupported sound type for '", url, "'" );
-                    }
-                    break;
-                case "video":
-                    if ( url.search( "data:video/mp4" ) === 0 ) {
-                        mediaObject = {
-                            m4v: url,
-                            poster: node.posterImageUrl
-                        };
-                    } else {
-                        modelDriver.logger.errorx( "setUrl", 
-                            "Unsupported video type for '", url, "'" );
-                    }
-                    break;
-                default:
-                    modelDriver.logger.errorx( "setUrl",
-                            "Unsupported manager type '", node.managerType, "'" );
-                    break;
-            }
-
-            // If we succeeded in creating a media object, set it on the jPlayer object
-            // Otherwise, clear the current media
-            if ( mediaObject ) {
-                node.jPlayerElement.jPlayer( "setMedia", mediaObject );
-            }  else {
-                node.jPlayerElement.jPlayer( "clearMedia" );
-            }
-        } else {
-            node.jPlayerElement.jPlayer( "clearMedia" );
-        }
-    }
-
-    function setLoop( node, loop ) {
-        node.loop = loop;
-        if ( node.jPlayerElement ) {
-            node.jPlayerElement.jPlayer( "option", { loop: loop } );
-        }
-    }
-
-    function setControlDivId( node, containerDivId ) {
-        node.containerDivId = containerDivId;
-        if ( node.jPlayerElement ) {
-            node.jPlayerElement.jPlayer( "option", { cssSelectorAncestor: "#" + containerDivId } );
-        }
-    }
-
-    function setPosterImageUrl( node, posterImageUrl ) {
-        node.posterImageUrl = posterImageUrl;
-        if ( node.jPlayerElement ) {
-            node.jPlayerElement.jPlayer( "setMedia", {
-                m4v: node.url,
-                poster: posterImageUrl
-            } );
-        }
-    }
-} );

+ 0 - 59
support/client/lib/vwf/model/scenejs.js

@@ -1,59 +0,0 @@
-"use strict";
-
-// Copyright 2012 United States Government, as represented by the Secretary of Defense, Under
-// Secretary of Defense (Personnel & Readiness).
-// 
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-// 
-//   http://www.apache.org/licenses/LICENSE-2.0
-// 
-// Unless required by applicable law or agreed to in writing, software distributed under the License
-// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
-// or implied. See the License for the specific language governing permissions and limitations under
-// the License.
-
-/// vwf/model/scenejs.js is a placeholder for a 3-D scene manager.
-/// 
-/// @module vwf/model/scenejs
-/// @requires vwf/model
-
-define( [ "module", "vwf/model" ], function( module, model ) {
-
-    return model.load( module, {
-
-        // == Module Definition ====================================================================
-
-        // This is a placeholder for connecting to the SceneJS WebGL scene manager.
-
-        // -- initialize ---------------------------------------------------------------------------
-
-        initialize: function() {
-        },
-
-        // == Model API ============================================================================
-
-        // -- creatingNode -------------------------------------------------------------------------
-
-        creatingNode: function( nodeID, childID, childExtendsID, childImplementsIDs,
-            childSource, childType, childIndex, childName, callback /* ( ready ) */ ) {
-        },
-
-        // -- deletingNode -------------------------------------------------------------------------
-
-        //deletingNode: function( nodeID ) {
-        //},
-
-        // -- settingProperty ----------------------------------------------------------------------
-
-        //settingProperty: function( nodeID, propertyName, propertyValue ) {
-        //},
-
-        // -- gettingProperty ----------------------------------------------------------------------
-
-        //gettingProperty: function( nodeID, propertyName, propertyValue ) {
-        //},
-
-    } );
-
-} );

+ 0 - 837
support/client/lib/vwf/model/sound.js

@@ -1,837 +0,0 @@
-"use strict";
-
-/// vwf/model/sound.js is a sound driver that wraps the capabilities of the 
-/// HTML5 web audio API.
-/// 
-/// @module vwf/model/sound
-/// @requires vwf/model
-
-// References:
-//  http://www.html5rocks.com/en/tutorials/webaudio/intro/
-//  https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html
-//  http://www.html5rocks.com/en/tutorials/webaudio/fieldrunners/
-
-define( [ "module", "vwf/model" ], function( module, model ) {
-
-    // TODO: should these be stored in this.state so that the view can access them?
-    var context;
-    var soundData = {};
-    var soundGroups = {};
-    var masterVolume = 1.0;
-    var logger;
-    var soundDriver;
-    var startTime = Date.now();
-    var driver = model.load( module, {
-
-        initialize: function() {
-            // In case somebody tries to reference it before we get a chance to create it.
-            // (it's created in the view)
-            this.state.soundManager = {};
-            soundDriver = this;
-            logger = this.logger;
-
-            try {
-                // I quote: "For WebKit- and Blink-based browsers, you 
-                // currently need to use the webkit prefix, i.e. 
-                // webkitAudioContext."
-                // http://www.html5rocks.com/en/tutorials/webaudio/intro/
-                if ( !window.AudioContext ) {
-                    window.AudioContext = window.webkitAudioContext;
-                }
-                context = new AudioContext();
-            }
-            catch( e ) {
-                // alert( 'Web Audio API is not supported in this browser' );
-                logger.warnx( "initialize", "Web Audio API is not supported in this browser." );
-            }
-        },
-
-        callingMethod: function( nodeID, methodName, params ) { 
-            if ( nodeID !== this.state.soundManager.nodeID ) {
-                return undefined;
-            }
-
-            if ( !context ) {
-                return undefined;
-            }
-
-            // variables that we'll need in the switch statement below.  These all have function
-            // scope, might as well declare them here.
-            var soundDefinition, successCallback, failureCallback, exitCallback;
-            var soundName, soundNames, soundDatum, soundDefinition, soundInstance;
-            var instanceIDs, instanceID, i, volume, fadeTime, fadeMethod, instanceHandle;
-            var soundGroup, groupName;
-
-            switch( methodName ) {
-                // arguments: soundDefinition, successCallback, failureCallback
-                case "loadSound":
-                    soundDefinition = params[ 0 ];
-                    successCallback = params[ 1 ];
-                    failureCallback = params[ 2 ];
-
-                    if ( soundDefinition === undefined ) {
-                        logger.errorx( "loadSound", "The 'loadSound' method requires " +
-                                       "a definition for the sound." );
-                        return undefined;
-                    }
-
-                    soundName = soundDefinition.soundName;
-                    if ( soundName === undefined ) {
-                        logger.errorx( "loadSound", "The sound definition must contain soundName." );
-                        return undefined;
-                    }
-
-                    if ( soundData[ soundName ] !== undefined ) {
-                        logger.errorx( "loadSound", "Duplicate sound named '" + soundName + "'." );
-                        return undefined;
-                    }
-
-                    soundData[ soundName ] = new SoundDatum( soundDefinition, 
-                                                             successCallback, 
-                                                             failureCallback );
-
-                    return;
-
-                // arguments: soundName 
-                // returns: true if sound is done loading and is playable
-                case "isReady":
-                    soundDatum = getSoundDatum( params[ 0 ] );
-                    return soundDatum !== undefined ? !!soundDatum.buffer : false;
-
-                // arguments: soundName, exitCallback (which is called when the sound stops) 
-                // returns: an instance handle, which is an object: 
-                //   { soundName: value, instanceID: value }
-                //   instanceID is -1 on failure  
-                case "playSound":
-                    soundName = params[ 0 ];
-                    soundDatum = getSoundDatum( soundName );
-                    exitCallback = params[ 1 ];
-                    return soundDatum ? soundDatum.playSound( exitCallback ) 
-                                      : { soundName: soundName, instanceID: -1 };
-
-                case "playSequence":
-                    soundNames = params;
-                    soundDatum = getSoundDatum( soundNames[ 0 ] );
-
-                    var playNext = function ( soundNames, current ){
-
-                        if (current !== soundNames.length){
-                        soundDatum = getSoundDatum( soundNames[ current ] );
-                        soundDatum.playSound( playNext ( soundNames, current + 1 ) );
-                        }
-
-                    }
-                    return soundDatum ? soundDatum.playSound( playNext ( soundNames, 0 ) ) 
-                                      : { soundName: soundName, instanceID: - 1 };
-
-                // arguments: soundName
-                // returns: true if sound is currently playing
-                case "isSoundPlaying":
-                    soundDatum = getSoundDatum( params[ 0 ] );
-                    return soundDatum ? soundDatum.isPlaying() : false;
-
-                // arguments: instanceHandle
-                // returns: true if sound is currently playing
-                case "isInstancePlaying":
-                    return getSoundInstance( params[ 0 ] ) !== undefined;
-
-                // // arguments: instanceHandle, volume, fadeTime, fadeMethod
-                case "setVolume":
-                    instanceHandle = params [ 0 ];
-                    soundDatum = getSoundDatum( instanceHandle.soundName );
-
-                    if ( soundDatum ){
-                        soundDatum.setVolume ( params [ 0 ], params [ 1 ], params [ 2 ], params [ 3 ] );
-                    }
-                
-                // // arguments: volume (0.0-1.0)
-                case "setMasterVolume":
-                    masterVolume = params [ 0 ];
-
-                    for ( soundName in soundData ){
-                        soundDatum = soundData[ soundName ];
-                        if ( soundDatum ) {
-                            soundDatum.resetOnMasterVolumeChange();
-                        }
-                    }
-
-                // // arguments: instanceHandle
-                case "hasSubtitle":
-                    instanceHandle = params [ 0 ];
-                    soundDatum = getSoundDatum( instanceHandle.soundName );
-
-                    return soundDatum ? !!soundDatum.subtitle : undefined;
-
-                // // arguments: instanceHandle
-                case "getSubtitle":
-                    instanceHandle = params [ 0 ];
-                    soundDatum = getSoundDatum( instanceHandle.soundName );
-
-                    return soundDatum ? soundDatum.subtitle : undefined;
-
-                // arguments: instanceHandle
-                // returns: the duration of the sound
-                case "getDuration":
-                    instanceHandle = params[ 0 ];
-                    soundDatum = getSoundDatum( instanceHandle.soundName );
-
-                    return soundDatum && soundDatum.buffer ? soundDatum.buffer.duration : undefined;
-
-                // arguments: instanceHandle
-                case "stopSoundInstance":
-                    instanceHandle = params[ 0 ];
-
-                    //If a user chooses to pass just a soundName, stop all instances with that name.
-                    if ( !instanceHandle.soundName ){
-                        soundName = params[ 0 ];
-                        soundDatum = getSoundDatum( soundName );
-                        soundDatum && soundDatum.stopDatumSoundInstances();
-                    } else {
-                    //Otherwise stop the specific instance.
-                        soundDatum = getSoundDatum( instanceHandle.soundName );
-                        soundDatum && soundDatum.stopInstance( instanceHandle );
-                    }
-                    return;
-
-                // arguments: groupName
-                case "stopSoundGroup":
-                    groupName = params[ 0 ];
-                    soundGroup = soundGroups[ groupName ];
-
-                    soundGroup && soundGroup.clearQueue();
-                    soundGroup && soundGroup.stopPlayingSound();
-
-                    return;
-
-                // arguments: none
-                case "stopAllSoundInstances":
-                    for ( groupName in soundGroups ) {
-                        soundGroup = soundGroups[ groupName ];
-                        soundGroup && soundGroup.clearQueue();
-                    }
-
-                    for ( soundName in soundData ) {
-                        soundDatum = soundData[ soundName ];
-                        soundDatum && soundDatum.stopDatumSoundInstances();
-                    }
-                    return undefined;
-
-                // arguments: soundName
-                case "getSoundDefinition":
-                    soundDatum = getSoundDatum( params[ 0 ] );
-                    return soundDatum ? soundDatum.soundDefinition : undefined;
-                    
-            }
-
-            return undefined;
-        }
-
-    } );
-
-    function SoundDatum( soundDefinition, successCallback, failureCallback ) {
-        this.initialize( soundDefinition, successCallback, failureCallback );
-        return this;
-    }
-
-    SoundDatum.prototype = {
-        constructor: SoundDatum,
-
-        // the name
-        name: "",
-
-        // the actual sound
-        buffer: null,
-
-        // a hashtable of sound instances
-        playingInstances: null,
-
-        // control parameters
-        initialVolume: 1.0,
-        isLooping: false,
-        allowMultiplay: false,
-        soundDefinition: null,
-        playOnLoad: false,
-
-        subtitle: undefined,
-
-        soundGroup: undefined,
-        groupReplacementMethod: undefined,
-        queueDelayTime: undefined,  // in seconds
-
-        // a counter for creating instance IDs
-        instanceIDCounter: 0,
-
-        initialize: function( soundDefinition, successCallback, failureCallback ) {
-
-            this.name = soundDefinition.soundName;
-            this.playingInstances = {};
-            this.soundDefinition = soundDefinition;
-
-            if ( this.soundDefinition.isLooping !== undefined ) {
-                this.isLooping = soundDefinition.isLooping;
-            }
-
-            if ( this.soundDefinition.allowMultiplay !== undefined ) {
-                this.allowMultiplay = soundDefinition.allowMultiplay;
-            }
-
-            if (this.soundDefinition.initialVolume !== undefined ) {
-                this.initialVolume = soundDefinition.initialVolume;
-            }
-
-            if ( this.soundDefinition.playOnLoad !== undefined ) {
-                this.playOnLoad = soundDefinition.playOnLoad;
-            }
-
-            this.subtitle = this.soundDefinition.subtitle;
-
-            var soundGroupName = this.soundDefinition.soundGroup;
-            if ( soundGroupName ) {
-                if ( !soundGroups[ soundGroupName ] ) {
-                    soundGroups[ soundGroupName ] = 
-                        new SoundGroup( soundGroupName );
-                }
-
-                this.soundGroup = soundGroups[ soundGroupName ];
-            }
-
-            this.groupReplacementMethod = this.soundDefinition.groupReplacementMethod;
-            if ( this.groupReplacementMethod && !this.soundGroup ) {
-                logger.warnx( "SoundDatum.initialize", 
-                              "You defined a replacement method but not a sound " +
-                              "group.  Replacement is only done when you replace " +
-                              "another sound in the same group!" );
-            }
-
-            if ( this.soundDefinition.queueDelayTime !== undefined ) {
-                this.queueDelayTime = this.soundDefinition.queueDelayTime;
-                if ( this.groupReplacementMethod !== "queue" ) {
-                    logger.warnx( "SoundDatum.initialize", 
-                                  "You defined a queue delay time, but " +
-                                  "the replacement method is not 'queue'.");
-                }
-            } else {
-                this.queueDelayTime = 
-                    this.groupReplacementMethod === "queue" ? 0.8 : 0;
-
-            }
-
-            // Create & send the request to load the sound asynchronously
-            var request = new XMLHttpRequest();
-            request.open( 'GET', soundDefinition.soundURL, true );
-            request.responseType = 'arraybuffer';
-
-            var thisSoundDatum = this;
-            request.onload = function() {
-                context.decodeAudioData(
-                    request.response, 
-                    function( buffer ) {
-                        thisSoundDatum.buffer = buffer;
-
-                        if ( thisSoundDatum.playOnLoad === true ) {
-                            thisSoundDatum.playSound( null, true );
-                        }
-
-                        successCallback && successCallback();
-                    }, 
-                    function() {
-                        logger.warnx( "SoundDatum.initialize", "Failed to load sound: '" + 
-                                      thisSoundDatum.name + "'." );
-
-                        delete soundData[ thisSoundDatum.name ];
-
-                        failureCallback && failureCallback();
-                    }
-                );
-            }
-            request.send();
-        },
-
-        playSound: function( exitCallback ) {
-
-            if ( !this.buffer ) {
-                logger.errorx( "SoundDatum.playSound", "Sound '" + this.name + "' hasn't finished " +
-                               "loading, or loaded improperly." );
-                return { soundName: this.name, instanceID: -1 };
-            }
-
-            if ( !this.allowMultiplay && this.isPlaying() ) {
-                return { soundName: this.name, 
-                         instanceID: this.playingInstances[ 0 ] };
-            }
-
-            var id = this.instanceIDCounter;
-            ++this.instanceIDCounter;
-
-            this.playingInstances[ id ] = new PlayingInstance( this, id, exitCallback );
-            return { soundName: this.name, instanceID: id };
-        },
-
-        stopInstance: function( instanceHandle ) {
-            var soundInstance = this.playingInstances[ instanceHandle.instanceID ];
-            soundInstance && soundInstance.stop();
-        },
-
-        stopDatumSoundInstances: function () {
-            for ( var instanceID in this.playingInstances ) {
-                var soundInstance = this.playingInstances[ instanceID ];
-                soundInstance && soundInstance.stop();
-            }
-
-            // I have no freaking idea why uncommenting this breaks absolutely 
-            //  everything, but it does!
-            // this.playingInstances = {};
-        },
-
-        resetOnMasterVolumeChange: function () {
-            for ( var instanceID in this.playingInstances ) {
-                var soundInstance = this.playingInstances[ instanceID ];
-                if ( soundInstance ) {
-                    soundInstance.resetVolume();
-                }
-            }
-        },
-
-        setVolume: function ( instanceHandle, volume, fadeTime, fadeMethod ) {
-           // arguments: instanceHandle, volume, fadeTime, fadeMethod
-            var soundInstance = getSoundInstance( instanceHandle );
-            soundInstance && soundInstance.setVolume( volume, fadeTime, fadeMethod );
-        },
-
-        isPlaying: function() {
-            var instanceIDs = Object.keys( this.playingInstances );
-            return instanceIDs.length > 0;
-        },
-    }
-
-    function PlayingInstance( soundDatum, id, exitCallback, successCallback ) {
-        this.initialize( soundDatum, id, exitCallback, successCallback );
-        return this;
-    }
-
-    PlayingInstance.prototype = {
-        constructor: PlayingInstance,
-
-        // our id, for future reference
-        id: undefined,
-
-        // a reference back to the soundDatum
-        soundDatum: null,
-
-        // the control nodes for the flowgraph
-        sourceNode: undefined,
-        gainNode: undefined,
-
-        // we need to know the volume for this node *before* the master volume
-        //  adjustment is applied.  This is that value.
-        localVolume$: undefined,
-
-        // stopped, delayed, playing, stopping, delayCancelled
-        playStatus: undefined, 
-
-        initialize: function( soundDatum, id, exitCallback, successCallback ) {
-            // NOTE: from http://www.html5rocks.com/en/tutorials/webaudio/intro/:
-            //
-            // An important point to note is that on iOS, Apple currently mutes all sound 
-            // output until the first time a sound is played during a user interaction 
-            // event - for example, calling playSound() inside a touch event handler. 
-            // You may struggle with Web Audio on iOS "not working" unless you circumvent 
-            // this - in order to avoid problems like this, just play a sound (it can even
-            // be muted by connecting to a Gain Node with zero gain) inside an early UI
-            // event - e.g. "touch here to play".
-            this.id = id;
-            this.soundDatum = soundDatum;
-
-            this.playStatus = "stopped";
-
-            this.sourceNode = context.createBufferSource();
-            this.sourceNode.buffer = this.soundDatum.buffer;
-            this.sourceNode.loop = this.soundDatum.isLooping;
-
-            this.localVolume$ = this.soundDatum.initialVolume;
-            this.gainNode = context.createGain();
-            this.sourceNode.connect( this.gainNode );
-            this.gainNode.connect( context.destination );
-            this.resetVolume();
-
-            var group = soundDatum.soundGroup;
-
-            // Browsers will handle onended differently depending on audio 
-            //   filetype - needs support.
-            var thisInstance = this;
-            this.sourceNode.onended =  function() {
-                thisInstance.playStatus = "stopped";
-                fireSoundEvent( "soundFinished", thisInstance );
-
-                // logger.logx( "PlayingInstance.onended",
-                //              "Sound ended: '" + thisInstance.soundDatum.name +
-                //              "', Timestamp: " + timestamp() );
-
-                if ( group ) {
-                    group.soundFinished( thisInstance );
-
-                    var nextInstance = group.unQueueSound();
-                    if ( nextInstance ) {
-                        var delaySeconds = nextInstance.soundDatum.queueDelayTime;
-
-                        // logger.logx( "PlayingInstance.onended", 
-                        //              "Popped from the queue: '" + 
-                        //              nextInstance.soundDatum.name +
-                        //              ", Timeout: " + delaySeconds +
-                        //              ", Timestamp: " + timestamp() );
-
-                        if ( delaySeconds > 0 ) {
-                            nextInstance.startDelayed( delaySeconds );
-                        } else {
-                            nextInstance.start();
-                        }
-                    }
-                }
-
-                delete soundDatum.playingInstances[ id ];
-                exitCallback && exitCallback();
-            }
-
-            if ( group ) {
-                switch ( soundDatum.groupReplacementMethod ) {
-                    case "queue":
-                        // We're only going to play the sound if there isn't 
-                        //   already a sound from this group playing.  
-                        //   Otherwise, add it to a queue to play later.
-                        if ( group.getPlayingSound() )  {
-                            group.queueSound( this );
-                        } else {
-                            this.start();
-                        }
-
-                        break;
-
-                    case "replace":
-                        group.clearQueue();
-                        group.stopPlayingSound();
-                        this.start();
-                        break;
-
-                    default:
-                        logger.errorx( "PlayingInstance.initialize",
-                                       "This sound ('" + 
-                                       thisInstance.soundDatum.name + 
-                                       "') is in a group, but doesn't " +
-                                       "have a valid replacement method!" );
-
-                        group.clearQueue();
-                        group.stopPlayingSound();
-                        this.start();
-                }
-            } else {
-                this.start();
-            }
-        },
-
-        getVolume: function() {
-            return this.localVolume$ * ( masterVolume !== undefined ? masterVolume : 1.0 );
-        },
-
-        setVolume: function( volume, fadeTime, fadeMethod ) {
-            if ( !volume ) {
-                logger.errorx( "PlayingInstance.setVolume", "The 'setVolume' " +
-                               "method requires a volume." );
-                return;
-            }
-
-            this.localVolume$ = volume;
-
-            if ( !fadeTime || ( fadeTime <= 0 ) ) {
-                fadeMethod = "immediate";
-            } 
-
-            var now = context.currentTime;
-            this.gainNode.gain.cancelScheduledValues( now );
-
-            switch( fadeMethod ) {
-                case "linear":
-                    var endTime = now + fadeTime;
-                    this.gainNode.gain.linearRampToValueAtTime( this.getVolume(), 
-                                                                endTime );
-                    break;
-                case "exponential":
-                case undefined:
-                    this.gainNode.gain.setTargetValueAtTime( this.getVolume(), 
-                                                             now, fadeTime );
-                    break;
-                case "immediate":
-                    this.gainNode.gain.value = this.getVolume();
-                    break;
-                default:
-                    logger.errorx( "PlayingInstance.setVolume", "Unknown fade method: '" +
-                                   fadeMethod + "'.  Using an exponential " +
-                                   "fade." );
-                    this.gainNode.gain.setTargetValueAtTime( this.getVolume(), 
-                                                             now, fadeTime );
-            }
-        },
-
-        resetVolume: function() {
-            this.setVolume(this.localVolume$);
-        },
-
-        start: function() {
-            switch ( this.playStatus ) {
-                case "playing":
-                    logger.warnx( "PlayingInstance.start", 
-                                  "Duplicate call to start. Sound: '" +
-                                  this.soundDatum.name + "'." );
-                    break;
-
-                case "stopping":
-                    logger.warnx( "PlayingInstance.start", "Start is being " +
-                                  "called, but we're not done stopping yet. " +
-                                  "Is that bad?" );
-                    // deliberately drop through - we can restart it.
-                case "delayed":
-                case "stopped":
-                    var group = this.soundDatum.soundGroup;
-                    var playingSound = group ? group.getPlayingSound() 
-                                             : undefined;
-                    if ( !group ||
-                         !playingSound ||
-                         ( ( playingSound === this ) &&
-                           ( this.playStatus !== "stopping" ) ) ) {
-
-                        this.playStatus = "playing";
-                        group && group.setPlayingSound( this );
-                        this.sourceNode.start( 0 ); 
-
-                        // logger.logx( "startSoundInstance",
-                        //              "Sound started: '" + this.soundDatum.name + 
-                        //              "', Timestamp: " + timestamp() );
-
-                        fireSoundEvent( "soundStarted", this );
-                    } else {
-                        if ( ( playingSound !== this ) && 
-                             ( playingSound.playStatus != "stopping" ) ) {
-
-                            logger.errorx( "PlayingInstance.start", 
-                                          "We are trying to start a sound " + 
-                                          "('" + this.soundDatum.name + 
-                                          "') that is in a sound group, " + 
-                                          "but the currently playing sound " +
-                                          "in that group ('" + 
-                                          playingSound.soundDatum.name + 
-                                          "') isn't in the process of " +
-                                          "stopping. This is probably bad." );
-                        }
-
-                        // Because the sound API is asynchronous, this happens
-                        //  fairly often. The trick is to just stuff this 
-                        //  sound onto the front of the queue, and let it run
-                        //  whenever whatever is playing right now finishes.
-                        group.jumpQueue( this );
-                    }
-                    break;
-
-                case "delayCancelled":
-                    // don't start - we've been trumped.
-                    // NOTE: it's theoretically possible to re-queue the sound
-                    //  in between when the delay is cancelled and when it 
-                    //  finishes the delay and calls start.  In this case the
-                    //  sound might be delayed more than desired, but should 
-                    //  still eventually play (I think).  If you're restarting
-                    //  sounds alot, consider looking into this.  
-                    this.playStatus = "stopped";
-                    break;
-
-                default:
-                    logger.errorx( "PlayingInstance.start", "Invalid " +
-                                   "playStatus: '" + this.playStatus + "'!" );
-            }
-        },
-
-        startDelayed: function( delaySeconds ) {
-            var group = this.soundDatum.soundGroup;
-            if ( group ) {
-                if ( group.getPlayingSound() ) {
-                    logger.errorx( "PlayingInstance.startDelayed", 
-                                   "How is there already a sound playing " +
-                                   "when startDelayed() is called?" );
-                    return;
-                }
-
-                group.setPlayingSound( this );
-            }
-
-            this.playStatus = "delayed";
-            setTimeout( this.start.bind(this), delaySeconds * 1000 );
-        },
-
-        stop: function() {
-            switch ( this.playStatus ) {
-                case "playing":
-                    this.playStatus = "stopping";
-                    this.sourceNode.stop();
-                    break;
-                case "delayed":
-                    this.playStatus = "delayCancelled";
-                    var group = this.soundDatum.soundGroup;
-                    if ( group ) {
-                        group.soundFinished( this );
-                    }
-                    break;
-                case "delayCancelled":
-                case "stopping":
-                case "stopped":
-                    logger.warnx( "PlayingInstance.stop", "Duplicate call " +
-                                  "to stop (or it was never started). " +
-                                  "Sound: '" + this.soundDatum.name + "'." );
-                    break;
-                default:
-                    logger.errorx( "PlayingInstance.stop", "Invalid " +
-                                   "playStatus: '" + this.playStatus + "'!" );
-            }
-        },
-    }
-
-    function SoundGroup( groupName ) {
-        this.initialize( groupName );
-        return this;
-    }
-
-    SoundGroup.prototype = {
-        constructor: SoundGroup,
-
-        // Trying out a new convention - make the values in the prototype be
-        //  something obvious, so I can tell if they don't get reset.
-        name$: "PROTOTYPE",             // the name of the group, for debugging
-        queue$: "PROTOTYPE",            // for storing queued sounds while they wait
-        playingSound$: "PROTOTYPE",     // the sound that is currently playing
-
-        initialize: function( groupName ) {
-            this.name$ = groupName;
-            this.queue$ = [];
-            this.playingSound$ = undefined;
-        },
-
-        getPlayingSound: function() {
-            return this.playingSound$;
-        },
-
-        setPlayingSound: function( playingInstance ) {
-            if ( this.playingSound$ ) {
-                if ( this.playingSound$ !== playingInstance ) {
-                    logger.errorx( "SoundGroup.setPlayingSound", 
-                                   "Trying to set playingSound to '" + 
-                                   playingInstance.soundDatum.name +
-                                   "', but it is already set to '" +
-                                   this.playingSound$.soundDatum.name + "'!");
-                } else if ( !this.playingSound$.playStatus !== "delayed" ) {
-                    logger.errorx("SoundGroup.setPlayingSound", 
-                                   "How are we re-setting the playing sound " +
-                                   "when we're not in a delay? Sound: '" +
-                                   this.playingSound$.soundDatum.name + "'." );
-                } 
-            } else {
-                this.playingSound$ = playingInstance;
-            }
-        },
-
-        soundFinished: function( playingInstance ) {
-            if ( playingInstance !== this.playingSound$ ) {
-                logger.errorx( "SoundGroup.soundFinished", "'" + 
-                               playingInstance.soundDatum.name + "' just " +
-                               "repored that it is finished, but we thought " +
-                               "that '" + this.playingSound$.soundDatum.name + 
-                               "' was playing!");
-
-                return;
-            }
-
-            this.playingSound$ = undefined;
-        },
-
-        stopPlayingSound: function() {
-            this.playingSound$ && this.playingSound$.stop();
-        },
-
-        // get in the back of the queue of sounds to play
-        queueSound: function( playingInstance ) {
-            this.queue$.unshift( playingInstance );
-        },
-
-        // jump to the front of the queue of sounds to play
-        jumpQueue: function( playingInstance ) {
-            this.queue$.push( playingInstance );
-        },
-
-        unQueueSound: function() {
-            return this.queue$.pop();
-        },
-
-        clearQueue: function() {
-            this.queue$.length = 0;
-        },
-
-        hasQueuedSounds: function() {
-            return queue$.length > 0;
-        },
-    }
-
-    function getSoundDatum( soundName ) {
-        if ( soundName === undefined ) {
-            logger.errorx( "getSoundDatum", "The 'getSoundDatum' method " +
-                           "requires the sound name." );
-            return undefined;
-        }
-
-        var soundDatum = soundData[ soundName ];
-        if ( soundDatum === undefined ) {
-            logger.errorx( "getSoundDatum", "Sound '" + soundName + 
-                           "' not found." );
-            return undefined;
-        }
-
-        return soundDatum;
-    }
-
-    function getSoundInstance( instanceHandle ) {
-        if ( instanceHandle === undefined ) {
-            logger.errorx( "getSoundInstance", "The 'GetSoundInstance' " +
-                           "method requires the instance ID." );
-            return undefined;
-        }
-
-        if ( ( instanceHandle.soundName === undefined ) || 
-             ( instanceHandle.instanceID === undefined ) ) {
-            logger.errorx( "getSoundInstance", "The instance handle must " +
-                           "contain soundName and instanceID values");
-            return undefined;
-        }
-
-        var soundDatum = getSoundDatum( instanceHandle.soundName );
-
-        if ( soundDatum.isLayered === true ) {
-            return soundDatum;
-        } else {
-            return soundDatum ? soundDatum.playingInstances[ instanceHandle.instanceID ] 
-                              : undefined;
-        }
-    }
-
-    function fireSoundEvent( eventString, instance ) {
-        vwf_view.kernel.fireEvent( soundDriver.state.soundManager.nodeID, 
-                                   eventString,
-                                   [ { soundName: instance.soundDatum.name, 
-                                       instanceID: instance.id } ] );
-    }
-
-    function timestamp() {
-        var delta = Date.now() - startTime;
-        var minutes = Math.floor( delta / 60000 );
-        var seconds = ( delta % 60000 ) / 1000;
-
-        return "" + minutes + ":" + seconds;
-    }
-
-    return driver;
-} );
-
-

+ 0 - 33
support/client/lib/vwf/model/test.js

@@ -1,33 +0,0 @@
-// Copyright 2012 United States Government, as represented by the Secretary of Defense, Under
-// Secretary of Defense (Personnel & Readiness).
-// 
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-// 
-//   http://www.apache.org/licenses/LICENSE-2.0
-// 
-// Unless required by applicable law or agreed to in writing, software distributed under the License
-// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
-// or implied. See the License for the specific language governing permissions and limitations under
-// the License.
-
-/// vwf/model/test.js is a dummy driver used for tests.
-/// 
-/// @module vwf/model/test
-/// @requires vwf/model
-
-define( [ "module", "vwf/model" ], function( module, model ) {
-
-    return model.load( module, {
-
-        // == Module Definition ====================================================================
-
-        // -- initialize ---------------------------------------------------------------------------
-
-        initialize: function() {
-            this.arguments = Array.prototype.slice.call( arguments );
-        },
-
-    } );
-
-} );

+ 0 - 251
support/client/lib/vwf/view/audio.js

@@ -1,251 +0,0 @@
-/*
- * WebRTC.js : Behaves as a wrapper for vwf/view/rtcObject
- * Maps simple 1:1 signal model to a broadcast model using target and sender ids
- */
-
-define( [ "module", "vwf/view", "vwf/view/buzz/buzz.min" ], function( module, view, buzz ) {
-
-    var self = this;        
-    
-    //a simple structure to hold the BUZZ sound reference and position data
-    function SoundSource() {
-        
-        this.id = null;
-        this.sound = null;
-        this.position = null;
-        this.volume = 1;
-        this.endrange = 100;
-        this.startrange = 1;
-        this.looping = false;
-        this.playing = false;
-        
-        this.play = function() {
-
-            if ( !this.playing ) {
-                this.sound.play();
-            }
-
-            if ( this.playing &&  this.sound.getPercent() == 100 ) {
-                this.sound.stop();
-                this.sound.play();
-            }
-
-            this.playing = true;
-        };
-
-        this.pause = function() {
-            
-            if ( this.playing ) {
-                this.sound.pause();
-            }
-            
-            this.playing = false;
-        };
-
-        this.stop = function() {
-
-            if ( this.playing ) {
-                this.sound.stop();
-            }
-            
-            this.playing = false;
-        };
-    }
-
-    SoundSource.prototype.loop = function() {
-        
-        if ( !this.looping ) {
-            this.looping = true;
-            this.sound.loop();
-        }
-    }
-
-    SoundSource.prototype.unloop = function() {
-        
-        if ( this.looping ) {
-            this.looping = false;
-            this.sound.unloop();
-        }
-    }
-
-    //Get the position of your source object
-    //note: the 3D driver must keep track of this
-    SoundSource.prototype.updateSourcePosition = function() {
-        
-        this.position = vwf.getProperty( this.id, 'worldPosition' );
-    }
-
-    //use inverse falloff, adjust the range parameters of the falloff curve by the "volume"
-    //since HTML cant actually play it louder, but we can make it 'carry' farther
-    SoundSource.prototype.updateVolume = function( camerapos ) {
-        
-        var x = Vec3.distance( camerapos, this.position );
-        x = Math.max( 0, x );
-        var v = this.volume;
-        
-        var vol = ( ( -x + v ) / ( v || 1 ) ) * ( ( -x + v ) / ( v || 1 ) );
-        if( x > v ) { 
-            vol = 0; 
-        }
-        this.sound.setVolume( Math.max( Math.min( vol, 1 ), 0 ) * 100 );
-    }
-
-    //the driver
-    return view.load( module, {
-
-        initialize: function( options ) {
-
-            this.buzz = require( "buzz" );
-            window._buzz = this.buzz;
-            
-            this.sounds = {};
-            this.soundSources = {};
-            //set this up as a global, so that we can play a click to indicate GUI actions
-            window._SoundManager = this;
-            
-        },
-
-        //simple function for gui elements to play sounds
-        playSound: function( url, volume ) {
-
-            this.calledMethod( this.kernel.application(), 'playSound', [ url, false, volume ] );
-        },
-
-        calledMethod : function( nodeID, methodName, methodParameters ) {
-            //if the scene played the sound, it has no position and just plays at full volume
-            
-            if ( nodeID === this.kernel.application() && methodsName === "playSound" ) {
-                var url = params[0];
-                var loop = params[1] || false;
-                
-                //cache the sound - can only be played simultainously by different nodes
-                if( this.sounds[ url ] ) {
-                    
-                    if( this.sounds[ url ].getPercent() == 100 ) {
-                        this.sounds[ url ].stop();    
-                    }
-                    this.sounds[ url ].play();
-                    if ( loop ) {
-                        this.sounds[ url ].loop();
-                    } else {
-                        this.sounds[ url ].unloop();
-                    }
-                } else {
-                    
-                    var mySound = new this.buzz.sound( url, {
-                        autoplay: false,
-                        loop: false
-                    } );
-                    this.sounds[ url ] = mySound;
-                    mySound.play();
-                }
-            
-            } else {
-
-                var url, loop, vol, soundID, soundSrc;
-
-                switch ( methodName ) {
-                    
-                    case 'playSound':
-                        url = params[0];
-                        loop = params[1] || false;
-                        vol =  params[2] || 1;
-                        soundID = id + url;
-                        soundSrc = this.soundSources[ soundID ];
-                        //cache the sound - can only be played simultainously by different nodes
-                        if ( !soundSrc ) {
-                            soundSrc = this.soundSources[ soundID ] = new SoundSource();
-                            soundSrc.id = id;
-                            soundSrc.url = url;
-                            
-                            soundSrc.volume = vol;
-                            soundSrc.sound = new this.buzz.sound( url, {
-                                    autoplay: true,
-                                    loop: loop
-                                    
-                            } );
-                            soundSrc.looping = loop;
-                            soundSrc.position = [ 0, 0, 0 ];
-                            window._dSound = Sound;
-                        } else {
-                            
-                            if( soundSrc.sound.getPercent() == 100 ) {
-                                soundSrc.stop();
-                            }
-
-                            soundSrc.sound.setPercent( 0 );
-                            soundSrc.play();
-
-                            if( loop ) {
-                                soundSrc.loop();
-                            } else {
-                                soundSrc.unloop();
-                            }
-                            soundSrc.volume = vol;
-                        }
-                        break;
-
-                    case 'pauseSound':
-                        url = params[ 0 ];
-                        soundID = id + url;
-                        soundSrc = this.soundSources[ soundID ];
-                        if ( soundSrc ) {
-                            soundSrc.pause();
-                        }
-                        break;
-
-                    case 'stopSound':
-                        url = params[0];
-                        soundID = id + url;
-                        soundSrc = this.soundSources[ soundID ];
-                        if ( soundSrc ) {
-                            soundSrc.stop();
-                        }
-                        break;
-
-                    case 'deleteSound':
-                        url = params[0];
-                        soundID = id + url;
-                        soundSrc = this.soundSources[ soundID ];
-                        if ( soundSrc ) {
-                            soundSrc.stop();
-                            soundSrc.sound = null;
-                        }
-                        delete this.soundSources[ soundID ];
-                        break;
-
-                }
-
-
-
-            }
-        },
-        //Update the sound volume based on the position of the camera and the position of the object
-        ticked : function()
-        {
-            try { 
-                var campos = [
-                    _dView.getCamera().matrixWorld.elements[12],
-                    _dView.getCamera().matrixWorld.elements[13],
-                    _dView.getCamera().matrixWorld.elements[14]
-                ];
-                for ( var i in this.soundSources )
-                {
-                    this.soundSources[ i ].updateSourcePosition();
-                    this.soundSources[ i ].updateVolume( campos );
-                }
-            } catch( e ) {
-            
-            }
-        
-        },
-        deletedNode: function( nodeID ) {
-            for ( var id in this.soundSources ) {
-
-                if( this.soundSources[ id ].id === nodeID )
-                    delete this.soundSources[ id ];
-            
-            }
-        }
-    } )
-} );

Fișier diff suprimat deoarece este prea mare
+ 0 - 10
support/client/lib/vwf/view/buzz/buzz.min.js


+ 0 - 2453
support/client/lib/vwf/view/editor-live.js

@@ -1,2453 +0,0 @@
-"use strict";
-
-// Copyright 2012 United States Government, as represented by the Secretary of Defense, Under
-// Secretary of Defense (Personnel & Readiness).
-// 
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-// 
-//   http://www.apache.org/licenses/LICENSE-2.0
-// 
-// Unless required by applicable law or agreed to in writing, software distributed under the License
-// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
-// or implied. See the License for the specific language governing permissions and limitations under
-// the License.
-
-/// vwf/view/editor creates a view interface for editor functions. 
-/// 
-/// @module vwf/view/editor
-/// @requires version
-/// @requires vwf/view
-/// @requires vwf/utility
-
-define( [ 
-    "module", 
-    "version", 
-    "vwf/view", 
-    "vwf/utility",
-    "vwf/view/lib/ace/ace", 
-    "jquery", 
-    "jquery-ui", 
-    "jquery-encoder-0.1.0" 
-    ], function( module, version, view, utility, ace, $ ) {
-
-    return view.load( module, {
-
-        // == Module Definition ====================================================================
-
-        initialize: function() {
-            var self = this;
-            this.ace = window.ace;
-
-            this.nodes = {};
-            this.scenes = {};
-            this.allScripts = {};
-
-            // EDITOR CLOSED  --> 0
-            // HIERARCHY OPEN --> 1
-            // USER LIST OPEN --> 2
-            // TIMELINE OPEN  --> 3
-            // ABOUT OPEN     --> 4
-            this.editorView = 0;
-            this.editorOpen = false;
-            this.timelineInit = false;
-            this.aboutInit = false;
-            this.codeEditorInit = false;
-            this.modelsInit = false;
-            this.editingScript = false;
-
-            this.topdownName = '#topdown_a';
-            this.topdownTemp = '#topdown_b';
-            this.clientList = '#client_list';
-            this.timeline = '#time_control';
-            this.about = '#about_tab';
-            this.codeEditor = '#codeEditor_tab';
-            this.models = '#model_a';
-            this.modelsTemp = '#model_b';
-            this.currentNodeID = '';
-            this.currentModelID = '';
-            this.currentModelURL = '';
-            this.highlightedChild = '';
-            this.intervalTimer = 0;
-
-            this.activeCameraID = undefined;
-            
-           $(document.head).append('<style type="text/css" media="screen"> #editorlive { height: 500px; width: 800px; } </style>');
-
-            $('body').append(
-                "<div id='editor' class='relClass'>\n" +
-                "  <div class='uiContainer'>\n" +
-                "    <div class='editor-tabs' id='tabs'>\n" +
-                "      <img id='x' style='display:none' src='images/tab_X.png' alt='x' />\n" +
-                "      <img id='hierarchy' src='images/tab_Application.png' alt='application' />\n" +
-                "      <img id='userlist' src='images/tab_Users.png' alt='users' />\n" +
-                "      <img id='timeline' src='images/tab_Time.png' alt='time' />\n" + 
-                "      <img id='models' src='images/tab_Models.png' alt='models' />\n" +
-                "      <img id='about' src='images/tab_About.png' alt='about' />\n" +
-                "      <img id='codeEditor' src='images/tab_CodeEditor.png' alt='code' />\n" +
-                "    </div>\n" +
-                "  </div>\n" + 
-                "</div>" + 
-                "<div class='relClass'><div class='uiContainer'><div class='vwf-tree' id='topdown_a'></div></div></div>" + 
-                "<div class='relClass'><div class='uiContainer'><div class='vwf-tree' id='topdown_b'></div></div></div>" + 
-                "<div class='relClass'><div class='uiContainer'><div class='vwf-tree' id='client_list'></div></div></div>" +
-                "<div class='relClass'><div class='uiContainer'><div class='vwf-tree' id='time_control'></div></div></div>" +
-                "<div class='relClass'><div class='uiContainer'><div class='vwf-tree' id='about_tab'></div></div></div>" +
-                 "<div class='relClass'><div class='uiContainer'><div class='vwf-tree' id='codeEditor_tab'></div></div></div>" +
-                "<div class='relClass'><div class='uiContainer'><div class='vwf-tree' id='model_a'></div></div></div>" +
-                "<div class='relClass'><div class='uiContainer'><div class='vwf-tree' id='model_b'></div></div></div>"
-            );
-
-           
-            
-            $('#tabs').stop().animate({ opacity:0.0 }, 0);
-            
-            $('#tabs').mouseenter( function(evt) { 
-                evt.stopPropagation();
-                $('#tabs').stop().animate({ opacity:1.0 }, 175);
-                return false; 
-            });
-            
-            $('#tabs').mouseleave( function(evt) { 
-                evt.stopPropagation(); 
-                $('#tabs').stop().animate({ opacity:0.0 }, 175);
-                return false; 
-            });
-            
-            $('#hierarchy').click ( function(evt) {
-                openEditor.call(self, 1);
-            });
-
-            $('#userlist').click ( function(evt) {
-                openEditor.call(self, 2);
-            });
-
-            $('#timeline').click ( function(evt) {
-                openEditor.call(self, 3);
-            });
-
-            $('#about').click ( function(evt) {
-                openEditor.call(self, 4);
-            });
-
-            $('#models').click ( function(evt) {
-                openEditor.call(self, 5);
-            });
-
-            $('#codeEditor').click ( function(evt) {
-                openEditor.call(self, 6);
-            });
-
-            $('#x').click ( function(evt) {
-                closeEditor.call(self);
-            });
-
-            $('#topdown_a').hide();
-            $('#topdown_b').hide();
-            $('#client_list').hide();
-            $('#time_control').hide();
-            $('#about_tab').hide();
-            $('#codeEditor_tab').hide();
-            $('#model_a').hide();
-            $('#model_b').hide();
-            
-            var canvas = document.getElementById(vwf_view.kernel.find("", "/")[0]);
-            if ( canvas ) {
-                $('#topdown_a').height(canvas.height);
-                $('#topdown_b').height(canvas.height);
-                $('#client_list').height(canvas.height);
-                $('#time_control').height(canvas.height);
-                $('#about_tab').height(canvas.height);
-                $('#codeEditor_tab').height(canvas.height);
-                $('#model_a').height(canvas.height);
-                $('#model_b').height(canvas.height);
-            }
-            else
-            {    
-                $('#topdown_a').height(window.innerHeight-20);
-                $('#topdown_b').height(window.innerHeight-20);
-                $('#client_list').height(window.innerHeight-20);
-                $('#time_control').height(window.innerHeight-20);
-                $('#about_tab').height(window.innerHeight-20);
-                $('#codeEditor_tab').height(window.innerHeight-20);
-                $('#model_a').height(window.innerHeight-20);
-                $('#model_b').height(window.innerHeight-20);
-            }
-        },
-        
-        createdNode: function( nodeID, childID, childExtendsID, childImplementsIDs,
-            childSource, childType, childIndex, childName, callback /* ( ready ) */ ) {
-
-            var nodeIDAttribute = $.encoder.encodeForHTMLAttribute("id", nodeID, true);
-            var childIDAttribute = $.encoder.encodeForHTMLAttribute("id", childID, true);
-            var childIDAlpha = $.encoder.encodeForAlphaNumeric(childID);
-            
-            var kernel = this.kernel;
-            var self = this;
-            var parent = this.nodes[ nodeID ];
-            var node = this.nodes[ childID ] = {
-                children: [],
-                properties: [],
-                events: {},
-                methods: {},
-                parent: parent,
-                parentID: nodeID,
-                ID: childID,
-                extendsID: childExtendsID,
-                implementsIDs: childImplementsIDs,
-                source: childSource, 
-                name: childName,
-            };
-
-            if ( parent ) {
-                parent.children.push( node );
-            }
-
-            if ( childID == vwf_view.kernel.find("", "/")[0] && childExtendsID && this.kernel.test( childExtendsID,
-                    "self::element(*,'http://vwf.example.com/aframe/ascene.vwf')", childExtendsID ) ) {
-                this.scenes[ childID ] = node;
-            }
-            
-            if ( nodeID === this.currentNodeID && this.editingScript == false )
-            {
-                $('#children > div:last').css('border-bottom-width', '1px');
-                $("#children").append("<div id='" + childIDAlpha + "' data-nodeID='" + childIDAttribute + "' class='childContainer'><div class='childEntry'><b>" + $.encoder.encodeForHTML(childName) + "</b></div></div>");
-                $('#' + childIDAlpha).click( function(evt) {
-                    drillDown.call(self, $(this).attr("data-nodeID"), nodeIDAttribute);
-                });
-                $('#children > div:last').css('border-bottom-width', '3px');
-            }
-
-            if ( nodeID === this.kernel.application() && childName === 'camera' ) {
-                this.activeCameraID = childID;    
-            }
-        },
-        
-        createdProperty: function (nodeID, propertyName, propertyValue) {
-
-            return this.initializedProperty(nodeID, propertyName, propertyValue);   
-        },
-        
-        initializedProperty: function (nodeID, propertyName, propertyValue) {
-   
-            var node = this.nodes[ nodeID ];
-
-            if ( ! node ) return;  // TODO: patch until full-graph sync is working; drivers should be able to assume that nodeIDs refer to valid objects
-
-            var property = node.properties[ propertyName ] = createProperty.call( this, node, propertyName, propertyValue );
-            
-            node.properties.push( property );
-        },
-        
-        deletedNode: function (nodeID) {
-            var node = this.nodes[ nodeID ];
-            node.parent.children.splice( node.parent.children.indexOf(node), 1 );
-            delete this.nodes[ nodeID ];
-            var nodeIDAttribute = $.encoder.encodeForAlphaNumeric(nodeID); // $.encoder.encodeForHTMLAttribute("id", nodeID, true);
-            $('#' + nodeIDAttribute).remove();
-            $('#children > div:last').css('border-bottom-width', '3px');
-        },
-
-        //addedChild: [ /* nodeID, childID, childName */ ],
-        //removedChild: [ /* nodeID, childID */ ],
-
-        satProperty: function (nodeID, propertyName, propertyValue) {
-            var node = this.nodes[ nodeID ];
-
-            if ( ! node ) return;  // TODO: patch until full-graph sync is working; drivers should be able to assume that nodeIDs refer to valid objects
-            
-            // It is possible for a property to have satProperty called for it without ever getting an
-            // initializedProperty (if that property delegated to itself or another on replication)
-            // Catch that case here and create the property
-            if ( ! node.properties[ propertyName ] ) {
-
-                var property = node.properties[ propertyName ] = createProperty.call( this, node, propertyName, propertyValue );
-
-                node.properties.push( property );
-            }
-            
-            if ( propertyName === "activeCamera" ) {
-                if ( this.nodes[ propertyValue ] !== undefined ) {
-                    this.activeCameraID = propertyValue;
-                }
-            }
-
-            try {
-                propertyValue = utility.transform( propertyValue, utility.transforms.transit );
-                node.properties[ propertyName ].value = JSON.stringify( propertyValue );
-                node.properties[ propertyName ].rawValue = propertyValue ;
-            } catch (e) {
-                this.logger.warnx( "satProperty", nodeID, propertyName, propertyValue,
-                    "stringify error:", e.message );
-                node.properties[ propertyName ].value = propertyValue;
-            }
-
-            if ( ( this.editorView == 1 ) && ( this.currentNodeID == nodeID ) ) {
-                var nodeIDAttribute = $.encoder.encodeForAlphaNumeric(nodeID); // $.encoder.encodeForHTMLAttribute("id", nodeID, true);
-                var propertyNameAttribute = $.encoder.encodeForAlphaNumeric("id", propertyName, true);
-            
-                // No need to escape propertyValue, because .val does its own escaping
-                $( '#input-' + nodeIDAttribute + '-' + propertyNameAttribute ).val( node.properties[ propertyName ].getValue() );
-            }
-        },
-        
-        //gotProperty: [ /* nodeID, propertyName, propertyValue */ ],
-        
-        createdMethod: function( nodeID, methodName, methodParameters, methodBody ){
-            var node = this.nodes[ nodeID ];
-            if ( node ) {
-                node.methods[ methodName ] = methodParameters;
-            }
-        },
-
-        //calledMethod: function( nodeID, methodName, methodParameters, methodValue ) {
-
-        //},
-
-        createdEvent: function( nodeID, eventName, eventParameters ) {
-            var node = this.nodes[ nodeID ];
-            if ( node ) {
-                node.events[ eventName ] = eventParameters;
-            }         
-        },
-
-        firedEvent: function ( nodeID, eventName, eventParameters ) {
-            if(eventName == "pointerHover") {
-                highlightChildInHierarchy.call(this, nodeID);
-            }
-        },
-
-        executed: function( nodeID, scriptText, scriptType ) {
-
-            // var nodeScript = {
-            //     text: scriptText,
-            //     type: scriptType,
-            // };
-
-            // if ( !this.allScripts[ nodeID ] ) {
-            //     var nodeScripts = new Array();
-            //     nodeScripts.push(nodeScript);
-
-            //     this.allScripts[ nodeID ] = nodeScripts;
-            // }
-
-            // else {
-            //     this.allScripts[ nodeID ].push(nodeScript);
-            // }
-        },
-
-        //ticked: [ /* time */ ],
-        
-    } );
-    
-    // -- getChildByName --------------------------------------------------------------------
-    
-    function getChildByName( node, childName ) {
-        var childNode = undefined;
-        for ( var i = 0; i < node.children.length && childNode === undefined; i++ ) {
-            if ( node.children[i].name == childName ) {
-                childNode = node.children[i];    
-            }
-        }
-        return childNode;
-    };
-
-    function updateCameraProperties () {
-
-        if ( this.currentNodeID == this.activeCameraID ) {
-            if ( !this.intervalTimer ) {
-                var self = this;
-                this.intervalTimer = setInterval( function() { updateProperties.call( self, self.activeCameraID ) }, 200 );
-            }
-        }
-        else {
-            if ( this.intervalTimer ) {
-                clearInterval( this.intervalTimer );
-                this.intervalTimer = 0;
-            } 
-        }
-    }
-
-    function updateProperties( nodeName ) {
-
-        var nodeID = nodeName;
-        var properties = getProperties.call( this, this.kernel, nodeID );
-
-        for ( var i in properties ) { 
-            try {
-                var propertyName = properties[i].prop.name;
-                var propertyValue = JSON.stringify( utility.transform( vwf.getProperty( nodeID, propertyName, [] ), utility.transforms.transit ));
-            } catch ( e ) {
-                this.logger.warnx( "satProperty", nodeID, propertyName, propertyValue, "stringify error:", e.message );
-            }
-
-            if ( propertyValue ) {
-                var nodeIDAttribute = $.encoder.encodeForAlphaNumeric( nodeID ); 
-                var propertyNameAttribute = $.encoder.encodeForHTMLAttribute( "id", propertyName, true );
-                var inputElement$ = $( '#input-' + nodeIDAttribute + '-' + propertyNameAttribute );
-                // Only update if property value input is not in focus
-                // If in focus, change font style to italic
-                if ( ! inputElement$.is(":focus") ) {
-                    inputElement$.val( propertyValue );
-                    inputElement$.css( "font-style", "normal");
-                } else {
-                    inputElement$.css( "font-style", "italic");
-                }  
-            }
-        }
-    }
-    
-    // -- openEditor ------------------------------------------------------------------------
-
-    function openEditor(eView) // invoke with the view as "this"
-    {
-        if(eView == 0)
-        {
-            closeEditor.call(this);
-        }
-        
-        if(this.editorView != eView)
-        {
-            // Hierarchy
-            if(eView == 1)
-            {
-                var topdownName = this.topdownName;
-                var topdownTemp = this.topdownTemp;
-
-                if( !this.currentNodeID )
-                {
-                    this.currentNodeID = vwf_view.kernel.find("", "/")[0];
-                }
-
-                drill.call(this, this.currentNodeID, undefined);
-                $(this.clientList).hide();
-                $(this.timeline).hide();
-                $(this.about).hide();
-                $(this.codeEditor).hide();
-                $(this.models).hide();
-
-                if(this.editorOpen)
-                {
-                    $(topdownName).hide();
-                    $(topdownTemp).show();
-                }
-
-                else
-                {
-                    $(topdownTemp).show('slide', {direction: 'right'}, 175);    
-                }
-
-                this.topdownName = topdownTemp;
-                this.topdownTemp = topdownName;
-            }
-
-            else if (this.editingScript)
-            {
-                // Reset width if on script
-                this.editingScript = false;
-                $('#editor').animate({ 'left' : "-260px" }, 175);
-                $('.vwf-tree').animate({ 'width' : "260px" }, 175);
-            }
-
-            // User List
-            if(eView == 2)
-            {
-                $(this.topdownName).hide();
-                $(this.topdownTemp).hide();
-                $(this.timeline).hide();
-                $(this.about).hide();
-                $(this.codeEditor).hide();
-                $(this.models).hide();
-                $(this.modelsTemp).hide();
-                showUserList.call(this);
-            }
-
-            // Timeline
-            else if(eView == 3)
-            {
-                $(this.topdownName).hide();
-                $(this.topdownTemp).hide();
-                $(this.clientList).hide();
-                $(this.about).hide();
-                $(this.codeEditor).hide();
-                $(this.models).hide();
-                $(this.modelsTemp).hide();
-                showTimeline.call(this);
-            }
-
-            // About
-            else if(eView == 4)
-            {
-                $(this.topdownName).hide();
-                $(this.topdownTemp).hide();
-                $(this.clientList).hide();
-                $(this.timeline).hide();
-                $(this.models).hide();
-                $(this.modelsTemp).hide();
-                $(this.codeEditor).hide();
-                showAboutTab.call(this);
-            }
-
-            // Models
-            else if(eView == 5)
-            {
-                var models = this.models;
-                var modelsTemp = this.modelsTemp;
-
-                showModelsTab.call(this, this.currentModelID, this.currentModelURL);
-                $(this.topdownName).hide();
-                $(this.topdownTemp).hide();
-                $(this.clientList).hide();
-                $(this.timeline).hide();
-                $(this.about).hide();
-                $(this.codeEditor).hide();
-
-                if(this.editorOpen)
-                {
-                    $(models).hide();
-                    $(modelsTemp).show();
-                }
-
-                else
-                {                
-                    $(modelsTemp).show('slide', {direction: 'right'}, 175);    
-                }
-
-                this.models = modelsTemp;
-                this.modelsTemp = models;
-            }
-
-            // Code Editor
-            else if(eView == 6)
-            {
-                $(this.topdownName).hide();
-                $(this.topdownTemp).hide();
-                $(this.clientList).hide();
-                $(this.timeline).hide();
-                $(this.models).hide();
-                $(this.modelsTemp).hide();
-                $(this.about).hide();
-                showCodeEditorTab.call(this);
-            }
-
-            if(this.editorView == 0)
-            {
-                $('#vwf-root').animate({ 'left' : "-=260px" }, 175);
-                $('#editor').animate({ 'left' : "-260px" }, 175);
-                $('#x').delay(1000).css({ 'display' : 'inline' });
-            }
-
-            this.editorView = eView;
-            this.editorOpen = true;
-        }
-    }
-
-    // -- closeEditor -----------------------------------------------------------------------
-
-    function closeEditor() // invoke with the view as "this"
-    {
-        var topdownName = this.topdownName;
-
-        if (this.editorOpen && this.editorView == 1) // Hierarchy view open
-        {
-            $(topdownName).hide('slide', {direction: 'right'}, 175);
-            $(topdownName).empty();
-            $(this.clientList).hide();
-            $(this.timeline).hide();
-            $(this.about).hide();
-             $(this.codeEditor).hide();
-            $(this.models).hide();
-        }
-
-        else if (this.editorOpen && this.editorView == 2) // Client list open
-        {
-            $(this.clientList).hide('slide', {direction: 'right'}, 175);
-            $(topdownName).hide();
-            $(this.timeline).hide();
-            $(this.about).hide();
-             $(this.codeEditor).hide();
-            $(this.models).hide();
-        }
-
-        else if (this.editorOpen && this.editorView == 3) // Timeline open
-        {
-            $(this.timeline).hide('slide', {direction: 'right'}, 175);
-            $(topdownName).hide();
-            $(this.clientList).hide();
-            $(this.about).hide();
-            $(this.models).hide();
-        }
-
-        else if (this.editorOpen && this.editorView == 4) // About open
-        {
-            $(this.about).hide('slide', {direction: 'right'}, 175);
-             $(this.codeEditor).hide();
-            $(topdownName).hide();
-            $(this.clientList).hide();
-            $(this.timeline).hide();
-            $(this.models).hide();
-        }
-
-        else if (this.editorOpen && this.editorView == 5) // Models open
-        {
-            $(this.models).hide('slide', {direction: 'right'}, 175);
-            $(topdownName).hide();
-            $(this.clientList).hide();
-            $(this.timeline).hide();
-            $(this.about).hide();
-             $(this.codeEditor).hide();
-        }
-        else if (this.editorOpen && this.editorView == 6) // Code Editor open
-        {
-            $(this.codeEditor).hide('slide', {direction: 'right'}, 175);
-             $(this.about).hide();
-            $(topdownName).hide();
-            $(this.clientList).hide();
-            $(this.timeline).hide();
-            $(this.models).hide();
-        }
-
-        
-        $('#vwf-root').animate({ 'left' : "+=260px" }, 175);
-        $('#editor').animate({ 'left' : "0px" }, 175);
-        $('#x').css({ 'display' : 'none' });
-        this.editorView = 0;
-        this.editorOpen = false;
-    }
-
-    // -- showUserList ----------------------------------------------------------------------
-
-    function showUserList() // invoke with the view as "this"
-    {
-        var clientList = this.clientList;
-
-        viewClients.call(this);
-
-        if (!this.editorOpen)
-        {
-            $(clientList).show('slide', {direction: 'right'}, 175);    
-        }
-        else
-        {
-            $(clientList).show();
-        }
-    }
-
-    // -- viewClients -----------------------------------------------------------------------
-
-    function viewClients() {
-        var self = this;
-        var app = window.location.pathname;
-        var pathSplit = app.split('/');
-        if ( pathSplit[0] == "" ) {          
-            pathSplit.shift();
-        }
-        if ( pathSplit[ pathSplit.length - 1 ] == "" ) {
-            pathSplit.pop();
-        }            
-        var instIndex = pathSplit.length - 1;
-        if ( pathSplit.length > 2 ) {
-            if ( pathSplit[ pathSplit.length - 2 ] == "load" ) {
-                instIndex = pathSplit.length - 3;
-            }
-        }
-        if ( pathSplit.length > 3 ) {
-            if ( pathSplit[ pathSplit.length - 3 ] == "load" ) {
-                instIndex = pathSplit.length - 4;
-            }
-        }
-
-        var root = "";
-        for ( var i=0; i < instIndex; i++ ) {
-            if ( root != "" ) {
-                root = root + "/";
-            } 
-            root = root + pathSplit[i];
-        }
-
-        if(root.indexOf('.vwf') != -1) root = root.substring(0, root.lastIndexOf('/'));
-        
-        var clients$ = $(this.clientList);
-        var node = this.nodes[ "http://vwf.example.com/clients.vwf" ];
-
-        clients$.html("<div class='header'>Connected Clients</div>");
-
-        // Add node children
-        clients$.append("<div id='clientsChildren'></div>");
-        for ( var i = 0; i < node.children.length; i++ ) {
-            var nodeChildIDAttribute = $.encoder.encodeForHTMLAttribute("id", node.children[i].ID, true);
-            var nodeChildIDAlpha = $.encoder.encodeForAlphaNumeric(node.children[i].ID);
-            var nodeChildNameHTML = $.encoder.encodeForHTML(node.children[i].name);
-            $('#clientsChildren').append("<div id='" + nodeChildIDAlpha + "' data-nodeID='" + nodeChildIDAttribute + "' class='childContainer'><div class='childEntry'><b>" + nodeChildNameHTML + "</b></div></div>");
-            $('#' + nodeChildIDAlpha).click( function(evt) {
-                viewClient.call(self, $(this).attr("data-nodeID"));
-            });
-        }
-
-        // Login Information
-        clients$.append("<div style='padding:6px'><input class='filename_entry' type='text' id='userName' placeholder='Username' /><!-- <input class='filename_entry' type='password' id='password' placeholder='Password'/> --><input class='update_button' type='button' id='login' value='Login' /></div>"); 
-        clients$.append("<hr/>");
-        $('#userName').keydown( function(evt) {
-            evt.stopPropagation();
-        });
-        $('#userName').keypress( function(evt) {
-            evt.stopPropagation();
-        });
-        $('#userName').keyup( function(evt) {
-            evt.stopPropagation();
-        });
-        $('#password').keydown( function(evt) {
-            evt.stopPropagation();
-        });
-        $('#password').keypress( function(evt) {
-            evt.stopPropagation();
-        });
-        $('#password').keyup( function(evt) {
-            evt.stopPropagation();
-        });
-        $('#login').click(function(evt) {
-            // Future call to validate username and password
-            //login.call(self, $('#userName').val(), $('#password').val());
-
-            var moniker = vwf_view.kernel.moniker();
-            var clients = vwf_view.kernel.findClients("", "/*");
-            var client = undefined;
-            for (var i=0; i < clients.length; i++)
-            {
-                if ( clients[i].indexOf(moniker) != -1 )
-                {
-                    client = clients[i];
-                    break;
-                }
-            }
-            // var client = vwf_view.kernel.findClients("", "/" + moniker)[0];
-            
-            if ( client ) {
-                vwf_view.kernel.setProperty( client, "displayName", $('#userName').val() );
-            }
-        });
-
-
-        // clients$.append("<div style='padding:6px'><input class='live_button' type='button' id='liveeditor' value='Open Code Editor' /></div>");
-        //  $('#liveeditor').click(function(evt) {
-        //     openLiveEditor.call(self);
-        // });
-
-        // Save / Load
-        clients$.append("<div style='padding:6px'><input class='filename_entry' type='text' id='fileName' /><input class='update_button' type='button' id='save' value='Save' /></div>");
-        $('#fileName').keydown( function(evt) {
-            evt.stopPropagation();
-        });
-        $('#fileName').keypress( function(evt) {
-            evt.stopPropagation();
-        });
-        $('#fileName').keyup( function(evt) {
-            evt.stopPropagation();
-        });
-        $('#save').click(function(evt) {
-            saveStateAsFile.call(self, $('#fileName').val());
-        });
-
-        clients$.append("<div style='padding:6px'><select class='filename_select' id='fileToLoad' /></select></div>");
-        $('#fileToLoad').append("<option value='none'></option>");
-
-        $.getJSON( "/" + root + "/listallsaves", function( data ) {
-            $.each( data, function( key, value ) {
-                var applicationName = value[ 'applicationpath' ].split( "/" );
-                if ( applicationName.length > 0 ) {
-                    applicationName = applicationName[ applicationName.length - 1 ];
-                }
-                if ( applicationName.length > 0 ) {
-                    applicationName = applicationName.charAt(0).toUpperCase() + applicationName.slice(1);
-                }
-                if ( value['latestsave'] ) {
-                    $('#fileToLoad').append("<option value='"+value['savename']+"' applicationpath='"+value['applicationpath']+"'>"+applicationName+": "+value['savename']+"</option>");
-                }
-                else {
-                    $('#fileToLoad').append("<option value='"+value['savename']+"' applicationpath='"+value['applicationpath']+"' revision='"+value['revision']+"'>"+applicationName+": "+value['savename']+" Rev(" + value['revision'] + ")</option>");
-                }
-            } );
-        } );
-
-        clients$.append("<div style='padding:6px'><input class='update_button' type='button' id='load' value='Load' /></div>");
-        $('#load').click(function(evt) {
-            loadSavedState.call(self, $('#fileToLoad').val(), $('#fileToLoad').find(':selected').attr('applicationpath'), $('#fileToLoad').find(':selected').attr('revision'));
-        });
-    }
-
-    // -- editor ---
-
-    function openLiveEditor(value) {
-
-        //this.liveditor = document.createElement('div');
-        //this.liveditor.setAttribute('id', "editorlive");
-        // $('body').append(this.liveditor); 
-
-        var editor = this.ace.edit("editorlive");
-        editor.setTheme("ace/theme/monokai");
-        editor.getSession().setMode("ace/mode/javascript");
-
-
-    }
-
-    // -- viewClient ------------------------------------------------------------------------
-
-    function viewClient( clientID ) {
-        var self = this;
-
-        var clients$ = $(this.clientList);
-        var node = this.nodes[ clientID ];
-
-        clients$.html("<div class='header'><img src='images/back.png' id='back' alt='back'/> " + $.encoder.encodeForHTML(node.name) + "</div>");
-        $('#back').click ( function(evt) {
-            viewClients.call( self );
-        });
-
-        // Add node properties
-        clients$.append("<div id='clientProperties'></div>");
-        var displayedProperties = {};
-        for ( var i = 0; i < node.properties.length; i++ ) {
-            if ( !displayedProperties[ node.properties[i].name ] ) {
-                displayedProperties[ node.properties[i].name ] = "instance";
-                var nodeIDAlpha = $.encoder.encodeForAlphaNumeric(clientID);
-                var propertyNameAttribute = $.encoder.encodeForHTMLAttribute("id", node.properties[i].name, true);
-                var propertyNameAlpha = $.encoder.encodeForAlphaNumeric(node.properties[i].name);
-                var propertyNameHTML = $.encoder.encodeForHTML(node.properties[i].name);
-                var propertyValueAttribute = $.encoder.encodeForHTMLAttribute("val", node.properties[i].getValue(), true);
-                $('#clientProperties').append("<div id='" + nodeIDAlpha + "-" + propertyNameAlpha + "' class='propEntry'><table><tr><td><b>" + propertyNameHTML + " </b></td><td><input type='text' class='input_text' id='input-" + nodeIDAlpha + "-" + propertyNameAlpha + "' value='" + propertyValueAttribute + "' data-propertyName='" + propertyNameAttribute + "' readonly></td></tr></table></div>");
-            }
-        }
-    }
-
-    // -- drillDown -------------------------------------------------------------------------
-
-    function drillDown(nodeID, drillBackID) // invoke with the view as "this"
-    {
-        var topdownName = this.topdownName;
-        var topdownTemp = this.topdownTemp;
-        
-        drill.call(this, nodeID, drillBackID);
-        
-        if(nodeID != vwf_view.kernel.find("", "/")[0]) $(topdownName).hide('slide', {direction: 'left'}, 175); 
-        $(topdownTemp).show('slide', {direction: 'right'}, 175);    
-        
-        this.topdownName = topdownTemp;
-        this.topdownTemp = topdownName;
-    }
-    
-    // -- drillUp ---------------------------------------------------------------------------
-
-    function drillUp(nodeID) // invoke with the view as "this"
-    {
-        var topdownName = this.topdownName;
-        var topdownTemp = this.topdownTemp;
-        
-        drill.call(this, nodeID, undefined);
-        
-        $(topdownName).hide('slide', {direction: 'right'}, 175); 
-        $(topdownTemp).show('slide', {direction: 'left'}, 175);    
-        
-        this.topdownName = topdownTemp;
-        this.topdownTemp = topdownName;
-    }
-
-    // -- drillBack---------------------------------------------------------------------------
-
-    function drillBack(nodeID) // invoke with the view as "this"
-    {
-        var topdownName = this.topdownName;
-        var topdownTemp = this.topdownTemp;
-        
-        drill.call(this, nodeID, undefined);
-        
-        // No slide motion, when resizing script window back to normal
-        $(topdownName).hide();
-        $(topdownTemp).show();
-        
-        this.topdownName = topdownTemp;
-        this.topdownTemp = topdownName;
-    }
-    
-    // -- drill -----------------------------------------------------------------------------
-
-    function drill(nodeID, drillBackID) // invoke with the view as "this"
-    {
-        var node = this.nodes[ nodeID ];
-
-        if ( !node ) {
-            this.logger.errorx( "drill: Cannot find node '" + nodeID + "'" );
-            return;
-        }
-
-        var self = this;
-        var topdownName = this.topdownName;
-        var topdownTemp = this.topdownTemp;
-        var nodeIDAlpha = $.encoder.encodeForAlphaNumeric(nodeID);
-
-        $(topdownName).html(''); // Clear alternate div first to ensure content is added correctly
-        this.currentNodeID = nodeID;
-
-        if(!drillBackID) drillBackID = node.parentID;
-     
-        if(nodeID == vwf_view.kernel.find("", "/")[0]) 
-        {
-            $(topdownTemp).html("<div class='header'>index</div>");
-        }
-        else
-        {
-            $(topdownTemp).html("<div class='header'><img src='images/back.png' id='" + nodeIDAlpha + "-back' alt='back'/> " + $.encoder.encodeForHTML(node.name) + "</div>");
-            $('#' + nodeIDAlpha + '-back').click ( function(evt) {
-                drillUp.call(self, drillBackID);
-            });
-        }
-
-        // Add node children
-        $(topdownTemp).append("<div id='children'></div>");
-        for ( var i = 0; i < node.children.length; i++ ) {
-            var nodeChildIDAttribute = $.encoder.encodeForHTMLAttribute("id", node.children[i].ID, true);
-            var nodeChildIDAlpha = $.encoder.encodeForAlphaNumeric(node.children[i].ID);
-            $('#children').append("<div id='" + nodeChildIDAlpha + "' data-nodeID='" + nodeChildIDAttribute + "' class='childContainer'><div class='childEntry'><b>" + $.encoder.encodeForHTML(node.children[i].name) + "</b></div></div>");
-            $('#' + nodeChildIDAlpha).click( function(evt) {
-                drillDown.call(self, $(this).attr("data-nodeID"), nodeID);
-            });
-        }
-
-        $('#children > div:last').css('border-bottom-width', '3px');
-
-        // Add prototype children
-        // TODO: Commented out until prototype children inherit from prototypes
-        /*
-        $(topdownTemp).append("<div id='prototypeChildren'></div>");
-        var prototypeChildren = getChildren.call( this, this.kernel, node.extendsID ); 
-        for ( var key in prototypeChildren)       
-        {
-            var child = prototypeChildren[key];
-            var prototypeChildIDAttribute = $.encoder.encodeForHTMLAttribute("id", child.ID, true);
-            var prototypeChildIDAlpha = $.encoder.encodeForAlphaNumeric(child.ID);
-            $('#prototypeChildren').append("<div id='" + prototypeChildIDAlpha + "' data-nodeID='" + prototypeChildIDAttribute + "' class='childContainer'><div class='childEntry'><b>" + $.encoder.encodeForHTML(child.name) + "</b></div></div>");
-            $('#' + prototypeChildIDAlpha).click( function(evt) {
-                drillDown.call(self, $(this).attr("data-nodeID"), nodeID);
-            });
-        } 
-        */   // END TODO:
-        
-        $('#prototypeChildren > div:last').css('border-bottom-width', '3px');
-
-        // Add node properties
-        $(topdownTemp).append("<div id='properties'></div>");
-        var displayedProperties = {};
-        for ( var i = 0; i < node.properties.length; i++ ) {
-            if ( !displayedProperties[ node.properties[i].name ] && node.properties[i].name.indexOf('$') === -1) {
-                displayedProperties[ node.properties[i].name ] = "instance";
-                var propertyNameAttribute = $.encoder.encodeForHTMLAttribute("id", node.properties[i].name, true);
-                var propertyNameAlpha = $.encoder.encodeForAlphaNumeric(node.properties[i].name);
-                var propertyNameHTML = $.encoder.encodeForHTML(node.properties[i].name);
-                var propertyValueAttribute = $.encoder.encodeForHTMLAttribute("val", node.properties[i].getValue(), true);
-                 
-               if (propertyNameAlpha.indexOf("semantics") > -1) {
-
-               } else if (propertyNameAlpha.indexOf("grammar") > -1) {
-
-               } else if (propertyNameAlpha.indexOf("ohm") > -1) {
-
-                let propName = propertyNameAlpha;
-                let propValue = node.properties[i].rawValue;
-
-                $(topdownTemp).append("<div id='" + nodeIDAlpha + "-" + propertyNameAlpha + "'></div>");
-            $('#' + nodeIDAlpha + '-' + propertyNameAlpha).append("<div class='childContainer'><div class='childEntry'><b>"+propertyNameHTML+"</div></div>");
-
-            $('#' + nodeIDAlpha + '-' + propertyNameAlpha).click( function (evt) {
-            editOhmLang.call(self, nodeID, propName, propValue);
-            });
-
-                    // $('#properties').append("<div id='" + nodeIDAlpha + "-" + propertyNameAlpha + "' class='propEntry'><table><tr><td><b>" + propertyNameHTML + " </b></td><td><input type='text' class='input_text' id='input-" + nodeIDAlpha + "-" + propertyNameAlpha + "' value='" + propertyValueAttribute + "' data-propertyName='" + propertyNameAttribute + "'></td></tr></table></div>");
-
-                } else {
-
-                     $('#properties').append("<div id='" + nodeIDAlpha + "-" + propertyNameAlpha + "' class='propEntry'><table><tr><td><b>" + propertyNameHTML + " </b></td><td><input type='text' class='input_text' id='input-" + nodeIDAlpha + "-" + propertyNameAlpha + "' value='" + propertyValueAttribute + "' data-propertyName='" + propertyNameAttribute + "'></td></tr></table></div>");
-
-                }
-
-               
-                $('#input-' + nodeIDAlpha + '-' + propertyNameAttribute).change( function(evt) {
-                    var propName = $.encoder.canonicalize($(this).attr("data-propertyName"));
-                    var propValue = $(this).val();
-                
-                    try {
-                        propValue = JSON.parse($.encoder.canonicalize(propValue));
-                        self.kernel.setProperty(nodeID, propName, propValue);
-                    } catch (e) {
-                        // restore the original value on error
-                        $(this).val(propValue);
-                    }
-                } );
-
-                $('#input-' + nodeIDAlpha + '-' + propertyNameAlpha).keydown( function(evt) {
-                    evt.stopPropagation();
-                });
-
-                $('#input-' + nodeIDAlpha + '-' + propertyNameAlpha).keypress( function(evt) {
-                    evt.stopPropagation();
-                });
-
-                $('#input-' + nodeIDAlpha + '-' + propertyNameAlpha).keyup( function(evt) {
-                    evt.stopPropagation();
-                });
-            }
-        }
-
-        $('#properties > div:last').css('border-bottom-width', '3px');
-
-        this.logger.info(self + "    " + nodeID);
-
-        // Add prototype properties
-        $(topdownTemp).append("<div id='prototypeProperties'></div>");
-        var prototypeProperties = getProperties.call( this, this.kernel, node.extendsID );
-        for ( var key in prototypeProperties ) {
-            var prop = prototypeProperties[key].prop;
-            if ( !displayedProperties[ prop.name ]  ) {
-                displayedProperties[ prop.name ] = prototypeProperties[key].prototype;
-                if(prop.value == undefined)
-                {
-                    prop.value = JSON.stringify( utility.transform( vwf.getProperty( nodeID, prop.name, []), utility.transforms.transit ) );
-                }
-
-                var propertyNameAttribute = $.encoder.encodeForHTMLAttribute("id", prop.name, true);
-                var propertyNameAlpha = $.encoder.encodeForAlphaNumeric(prop.name);
-                var propertyNameHTML = $.encoder.encodeForHTML(prop.name);
-                var propertyValueAttribute = $.encoder.encodeForHTMLAttribute("val", prop.value, true);
-                $('#prototypeProperties').append("<div id='" + nodeIDAlpha + "-" + propertyNameAlpha + "' class='propEntry'><table><tr><td><b>" + propertyNameHTML + " </b></td><td><input type='text' class='input_text' id='input-" + nodeIDAlpha + "-" + propertyNameAlpha + "' value='" + propertyValueAttribute + "' data-propertyName='" + propertyNameAttribute + "'></td></tr></table></div>");
-            
-                $('#input-' + nodeIDAlpha + '-' + propertyNameAlpha).change( function(evt) {
-                    var propName = $.encoder.canonicalize($(this).attr("data-propertyName"));
-                    var propValue = $(this).val();
-                
-                    try {
-                        propValue = JSON.parse($.encoder.canonicalize(propValue));
-                        self.kernel.setProperty(nodeID, propName, propValue);
-                    } catch (e) {
-                        // restore the original value on error
-                        $(this).val(propValue);
-                    }
-                } );
-
-                $('#input-' + nodeIDAlpha + '-' + propertyNameAlpha).keydown( function(evt) {
-                    evt.stopPropagation();
-                });
-
-                $('#input-' + nodeIDAlpha + '-' + propertyNameAlpha).keypress( function(evt) {
-                    evt.stopPropagation();
-                });
-
-                $('#input-' + nodeIDAlpha + '-' + propertyNameAlpha).keyup( function(evt) {
-                    evt.stopPropagation();
-                });
-            }
-        }
-
-        $('#prototypeProperties > div:last').css('border-bottom-width', '3px');
-
-        // Add node methods
-        $(topdownTemp).append("<div id='methods'></div>");
-        for ( var key in node.methods ) {
-            var method = node.methods[key];
-            var methodNameAlpha = $.encoder.encodeForAlphaNumeric(key);
-            var methodNameAttribute = $.encoder.encodeForHTMLAttribute("id", key, true);
-            var methodNameHTML = $.encoder.encodeForHTML(key);
-            $('#methods').append("<div id='" + methodNameAlpha + "' class='methodEntry'><table><tr><td><b>" + methodNameHTML + " </b></td><td style='text-align:right;overflow:visible'><div id='rollover-" + methodNameAlpha + "' style='position:relative;left:12px'><input type='button' class='input_button_call' id='call-" + methodNameAlpha + "' value='Call' data-methodName='" + methodNameAttribute + "'><img id='param-" + methodNameAlpha + "' data-methodName='" + methodNameAttribute + "' src='images/arrow.png' alt='arrow' style='position:relative;top:4px;left:2px;visibility:hidden'></div></td></tr></table></div>");
-            $('#rollover-' + methodNameAlpha).mouseover( function(evt) {
-                $('#param-' + $(this).attr("id").substring(9)).css('visibility', 'visible');
-            });
-            $('#rollover-' + methodNameAlpha).mouseleave( function(evt) {
-                $('#param-' + $(this).attr("id").substring(9)).css('visibility', 'hidden');
-            });
-            $('#call-' + methodNameAlpha).click( function(evt) {
-                self.kernel.callMethod( nodeID, $.encoder.canonicalize($(this).attr("data-methodName")) );
-            });
-            $('#param-' + methodNameAlpha).click( function(evt) {
-                setParams.call(self, $.encoder.canonicalize($(this).attr("data-methodName")), method, nodeID);                
-            });
-        }
-
-        $('#methods > div:last').css('border-bottom-width', '3px');
-
-        // Add prototype methods
-        $(topdownTemp).append("<div id='prototypeMethods'></div>");
-        var prototypeMethods = getMethods.call( this, this.kernel, node.extendsID );
-        for ( var key in prototypeMethods ) {
-            var method = prototypeMethods[key];
-            var prototypeMethodNameAlpha = $.encoder.encodeForAlphaNumeric(key);
-            var prototypeMethodNameAttribute = $.encoder.encodeForHTMLAttribute("id", key, true);
-            var prototypeMethodNameHTML = $.encoder.encodeForHTML(key);
-            $('#prototypeMethods').append("<div id='" + prototypeMethodNameAlpha + "' class='methodEntry'><table><tr><td><b>" + prototypeMethodNameHTML + " </b></td><td style='text-align:right;overflow:visible'><div id='rollover-" + prototypeMethodNameAlpha + "' style='position:relative;left:12px'><input type='button' class='input_button_call' id='call-" + prototypeMethodNameAlpha + "' value='Call' data-methodName='" + prototypeMethodNameAttribute + "'><img id='param-" + prototypeMethodNameAlpha + "' data-methodName='" + prototypeMethodNameAttribute + "' src='images/arrow.png' alt='arrow' style='position:relative;top:4px;left:2px;visibility:hidden'></div></td></tr></table></div>");
-            $('#rollover-' + prototypeMethodNameAlpha).mouseover( function(evt) {
-                $('#param-' + $(this).attr("id").substring(9)).css('visibility', 'visible');
-            });
-            $('#rollover-' + prototypeMethodNameAlpha).mouseleave( function(evt) {
-                $('#param-' + $(this).attr("id").substring(9)).css('visibility', 'hidden');
-            });
-            $('#call-' + prototypeMethodNameAlpha).click( function(evt) {
-                self.kernel.callMethod( nodeID, $.encoder.canonicalize($(this).attr("data-methodName")) );
-            });
-            $('#param-' + prototypeMethodNameAlpha).click( function(evt) {
-                setParams.call(self, $.encoder.canonicalize($(this).attr("data-methodName")), method, nodeID);                
-            });
-        }
-
-        $('#prototypeMethods > div:last').css('border-bottom-width', '3px');
-
-        // Add node events
-        $(topdownTemp).append("<div id='events'></div>");
-        for ( var key in node.events ) {
-            var nodeEvent = node.events[key];
-            var eventNameAlpha = $.encoder.encodeForAlphaNumeric(key);
-            var eventNameAttribute = $.encoder.encodeForHTMLAttribute("id", key, true);
-            var eventNameHTML = $.encoder.encodeForHTML(key);
-            $('#events').append("<div id='" + eventNameAlpha + "' class='methodEntry'><table><tr><td><b>" + eventNameHTML + " </b></td><td style='text-align:right;overflow:visible'><div id='rollover-" + eventNameAlpha + "' style='position:relative;left:12px'><input type='button' class='input_button_call' id='fire-" + eventNameAlpha + "' value='Fire' data-eventName='" + eventNameAttribute + "'><img id='arg-" + eventNameAlpha + "' data-eventName='" + eventNameAttribute + "' src='images/arrow.png' alt='arrow' style='position:relative;top:4px;left:2px;visibility:hidden'></div></td></tr></table></div>");
-            $('#rollover-' + eventNameAlpha).mouseover( function(evt) {
-                $('#arg-' + $(this).attr("id").substring(9)).css('visibility', 'visible');
-            });
-            $('#rollover-' + eventNameAlpha).mouseleave( function(evt) {
-                $('#arg-' + $(this).attr("id").substring(9)).css('visibility', 'hidden');
-            });
-            $('#fire-' + eventNameAlpha).click( function(evt) {
-                self.kernel.fireEvent( nodeID, $.encoder.canonicalize($(this).attr("data-eventName")) );
-            });
-            $('#arg-' + eventNameAlpha).click( function(evt) {
-                setArgs.call(self, $.encoder.canonicalize($(this).attr("data-eventName")), nodeEvent, nodeID); 
-            });
-        }
-
-        $('#events > div:last').css('border-bottom-width', '3px');
-
-        // Add prototype events
-        $(topdownTemp).append("<div id='prototypeEvents'></div>");
-        var prototypeEvents = getEvents.call( this, this.kernel, node.extendsID );
-        for ( var key in prototypeEvents ) {
-            var nodeEvent = prototypeEvents[key];
-            var prototypeEventNameAlpha = $.encoder.encodeForAlphaNumeric(key);
-            var prototypeEventNameAttribute = $.encoder.encodeForHTMLAttribute("id", key, true);
-            var prototypeEventNameHTML = $.encoder.encodeForHTML(key);
-            $('#prototypeEvents').append("<div id='" + prototypeEventNameAlpha + "' class='methodEntry'><table><tr><td><b>" + prototypeEventNameHTML + " </b></td><td style='text-align:right;overflow:visible'><div id='rollover-" + prototypeEventNameAlpha + "' style='position:relative;left:12px'><input type='button' class='input_button_call' id='fire-" + prototypeEventNameAlpha + "' value='Fire' data-eventName='" + prototypeEventNameAttribute + "'><img id='arg-" + prototypeEventNameAlpha + "' data-eventName='" + prototypeEventNameAttribute + "' src='images/arrow.png' alt='arrow' style='position:relative;top:4px;left:2px;visibility:hidden'></div></td></tr></table></div>");
-            $('#rollover-' + prototypeEventNameAlpha).mouseover( function(evt) {
-                $('#arg-' + $(this).attr("id").substring(9)).css('visibility', 'visible');
-            });
-            $('#rollover-' + prototypeEventNameAlpha).mouseleave( function(evt) {
-                $('#arg-' + $(this).attr("id").substring(9)).css('visibility', 'hidden');
-            });
-            $('#fire-' + prototypeEventNameAlpha).click( function(evt) {
-                self.kernel.fireEvent( nodeID, $.encoder.canonicalize($(this).attr("data-eventName")) );
-            });
-            $('#arg-' + prototypeEventNameAlpha).click( function(evt) {
-                setArgs.call(self, $.encoder.canonicalize($(this).attr("data-eventName")), nodeEvent, nodeID); 
-            });
-        }
-
-        $('#prototypeEvents > div:last').css('border-bottom-width', '3px');
-
-        // Add node behaviors
-        $(topdownTemp).append("<div id='behaviors'></div>");
-        for ( var i = 0; i < node.implementsIDs.length; i++ ) {
-            var nodeImplementsIDAlpha = $.encoder.encodeForAlphaNumeric(node.implementsIDs[i]);
-            var nodeImplementsIDHTML = $.encoder.encodeForHTML(node.implementsIDs[i]);
-            $('#behaviors').append("<div class='propEntry'><table><tr><td style='width:92%'><b>" + nodeImplementsIDHTML + "</b></td><td><input id='" + nodeImplementsIDAlpha + "-enable' type='checkbox' checked='checked' disabled='disabled' /></td></tr></table></div>");
-
-            /* 
-            //Placeholder to Enable/Disable behaviors
-            $('#' + node.implementsID[i] + '-enable').change( function(evt) {
-            
-            }); 
-            */
-        }
-
-        $('#behaviors > div:last').css('border-bottom-width', '3px');
-
-        // Add prototype behaviors
-        $(topdownTemp).append("<div id='prototypeBehaviors'></div>");
-        var prototypeNode = this.nodes[ node.extendsID ];
-        for ( var i=0; i < prototypeNode.implementsIDs.length; i++)
-        {
-            var prototypeImplementsIDAlpha = $.encoder.encodeForAlphaNumeric(prototypeNode.implementsIDs[i]);
-            var prototypeImplementsIDHTML = $.encoder.encodeForHTML(prototypeNode.implementsIDs[i]);
-            $('#prototypeBehaviors').append("<div class='propEntry'><table><tr><td style='width:92%'><b>" + prototypeImplementsIDHTML + "</b></td><td><input id='" + prototypeImplementsIDAlpha + "-enable' type='checkbox' checked='checked' disabled='disabled' /></td></tr></table></div>");
-        }
-
-        $('#prototypeBehaviors > div:last').css('border-bottom-width', '3px');
-
-        // Create new method
-
-        $(topdownTemp).append("<div id='createMethodID'></div>");
-        $('#createMethodID').append("<div class='childContainer'><div class='childEntry'><b>New Method</div></div>");
-        $('#createMethodID').click( function (evt) {
-            createMethod.call(self, nodeID);
-        });
-
-         // Create new Event
-
-        $(topdownTemp).append("<div id='createEventID'></div>");
-        $('#createEventID').append("<div class='childContainer'><div class='childEntry'><b>New Event</div></div>");
-        $('#createEventID').click( function (evt) {
-            createEvent.call(self, nodeID);
-        });
-
-        // Create new script
-        $(topdownTemp).append("<div id='createScript'></div>");
-        $('#createScript').append("<div class='childContainer'><div class='childEntry'><b>New Script</div></div>");
-        $('#createScript').click( function (evt) {
-            createScript.call(self, nodeID);
-        });
-        $('#createScript > div:last').css('border-bottom-width', '3px');
-
-        if ( this.allScripts[ nodeID ] !== undefined ) {
-            // Add node scripts
-            $(topdownTemp).append("<div id='scripts'></div>");
-            for( var i=0; i < this.allScripts[ nodeID ].length; i++ )
-            {
-                var scriptFull = this.allScripts[nodeID][i].text;
-                if(scriptFull != undefined)
-                {
-                    var scriptName = scriptFull.substring(0, scriptFull.indexOf('='));
-                    $('#scripts').append("<div id='script-" + nodeIDAlpha + "-" + i + "' class='childContainer'><div class='childEntry'><b>script </b>" + scriptName + "</div></div>");
-                    $('#script-' + nodeIDAlpha + "-" + i).click( function(evt) {
-                        var scriptID = $(this).attr("id").substring($(this).attr("id").lastIndexOf('-')+1);
-                        viewScript.call(self, nodeID, scriptID, undefined);
-                    });
-                }
-            }
-
-            $('#scripts > div:last').css('border-bottom-width', '3px');
-        }
-
-        if ( this.allScripts[ node.extendsID ] !== undefined ) {
-            // Add prototype scripts
-            $(topdownTemp).append("<div id='prototypeScripts'></div>");
-            for( var i=0; i < this.allScripts[ node.extendsID ].length; i++ )
-            {
-                var scriptFull = this.allScripts[node.extendsID][i].text;
-                if(scriptFull != undefined)
-                {
-                    var nodeExtendsIDAlpha = $.encoder.encodeForAlphaNumeric(node.extendsID);
-                    var nodeExtendsIDAttribute = $.encoder.encodeForHTMLAttribute("id", node.extendsID, true);
-                    var scriptName = scriptFull.substring(0, scriptFull.indexOf('='));
-                    $('#prototypeScripts').append("<div id='script-" + nodeExtendsIDAlpha + "-" + i + "' class='childContainer' data-nodeExtendsID='" + nodeExtendsIDAttribute + "'><div class='childEntry'><b>script </b>" + scriptName + "</div></div>");
-                    $('#script-' + nodeExtendsIDAlpha + "-" + i).click( function(evt) {
-                        var extendsId = $.encoder.canonicalize($(this).attr("data-nodeExtendsID"));
-                        var scriptID = $(this).attr("id").substring($(this).attr("id").lastIndexOf('-')+1);
-                        viewScript.call(self, nodeID, scriptID, extendsId);
-                    });
-                }
-            }
-
-            $('#prototypeScripts > div:last').css('border-bottom-width', '3px');
-        }
-        updateCameraProperties.call(self);
-    }
-
-    // createEvent
-
-    function createEvent (nodeID) // invoke with the view as "this"
-    {
-        var self = this;
-        var topdownName = this.topdownName;
-        var topdownTemp = this.topdownTemp;
-
-        var nodeIDAlpha = $.encoder.encodeForAlphaNumeric(nodeID);
-        
-        $(topdownTemp).html("<div class='header'><img src='images/back.png' id='script-" + nodeIDAlpha + "-back' alt='back'/> New event</div>");
-        $('#script-' + nodeIDAlpha + '-back').click ( function(evt) {
-            self.editingScript = false;
-            drillBack.call(self, nodeID);
-
-            // Return editor to normal width
-            $('#editor').animate({ 'left' : "-260px" }, 175);
-            $('.vwf-tree').animate({ 'width' : "260px" }, 175);
-        });
-
-        $(topdownTemp).append("<div id='cm'>Name:<br/><input type='text' class='input_text' id='eventName'/><br/>Parameters:<br/><input type='text' class='input_text' id='eventParams'/></div><hr><input class='update_button' type='button' id='createEvent' value='Create' />");
-
-
-        $("#createEvent").click ( function(evt) {
-            console.log("not yet created");
-
-              
-                if( $('#eventName').val() )
-                {
-                    var eventName = $('#eventName').val();
-                    //prmtr = JSON.parse(JSON.stringify($.encoder.canonicalize(prmtr)));
-                    console.log(eventName);
-                
-                if( $('#eventParams').val() )
-                {
-                    var params = $('#eventParams').val();
-                    params = params.split(',');
-					var cleanParams = [];
-
-					for (var i = 0; i < params.length; i++) {
-						params[i] = $.trim(params[i]);
-						if (params[i] != '' && params[i] != null && params[i] !== undefined)
-							cleanParams.push(params[i]);
-					}
-                    console.log(cleanParams);
-                    //prmtr = JSON.parse(JSON.stringify($.encoder.canonicalize(prmtr)));
-                }
-
-                let body = '';
-                self.kernel.createEvent(nodeID, eventName, cleanParams);
-        }  
-            //self.kernel.execute( nodeID, editor.getValue() );
-           // self.kernel.execute( nodeID, $("#newScriptArea").val() );
-        });
-
-        $(topdownName).hide();
-        $(topdownTemp).show();
-        
-        this.topdownName = topdownTemp;
-        this.topdownTemp = topdownName;
-    }
-
-    // -- createMethod
-
-     function createMethod (nodeID) // invoke with the view as "this"
-    {
-        var self = this;
-        var topdownName = this.topdownName;
-        var topdownTemp = this.topdownTemp;
-
-        var nodeIDAlpha = $.encoder.encodeForAlphaNumeric(nodeID);
-        
-        $(topdownTemp).html("<div class='header'><img src='images/back.png' id='script-" + nodeIDAlpha + "-back' alt='back'/> New method</div>");
-        $('#script-' + nodeIDAlpha + '-back').click ( function(evt) {
-            self.editingScript = false;
-            drillBack.call(self, nodeID);
-
-            // Return editor to normal width
-            $('#editor').animate({ 'left' : "-260px" }, 175);
-            $('.vwf-tree').animate({ 'width' : "260px" }, 175);
-        });
-
-        $(topdownTemp).append("<div id='cm'>Name:<br/><input type='text' class='input_text' id='methodName'/><br/>Parameters:<br/><input type='text' class='input_text' id='methodParams'/></div><hr><input class='update_button' type='button' id='createMethod' value='Create' />");
-
-
-        $("#createMethod").click ( function(evt) {
-            console.log("not yet created");
-
-              
-                if( $('#methodName').val() )
-                {
-                    var methodName = $('#methodName').val();
-                    //prmtr = JSON.parse(JSON.stringify($.encoder.canonicalize(prmtr)));
-                    console.log(methodName);
-                
-                if( $('#methodParams').val() )
-                {
-                    var params = $('#methodParams').val();
-                    params = params.split(',');
-					var cleanParams = [];
-
-					for (var i = 0; i < params.length; i++) {
-						params[i] = $.trim(params[i]);
-						if (params[i] != '' && params[i] != null && params[i] !== undefined)
-							cleanParams.push(params[i]);
-					}
-                    console.log(cleanParams);
-                    //prmtr = JSON.parse(JSON.stringify($.encoder.canonicalize(prmtr)));
-                }
-
-                let body = '';
-                self.kernel.createMethod(nodeID, methodName, cleanParams, body);
-        }  
-            //self.kernel.execute( nodeID, editor.getValue() );
-           // self.kernel.execute( nodeID, $("#newScriptArea").val() );
-        });
-
-        $(topdownName).hide();
-        $(topdownTemp).show();
-        
-        this.topdownName = topdownTemp;
-        this.topdownTemp = topdownName;
-    }
-
-    // -- createScript ----------------------------------------------------------------------
-
-    function createScript (nodeID) // invoke with the view as "this"
-    {
-        var self = this;
-        var topdownName = this.topdownName;
-        var topdownTemp = this.topdownTemp;
-        var allScripts = this.allScripts;
-
-        var nodeIDAlpha = $.encoder.encodeForAlphaNumeric(nodeID);
-        
-        $(topdownTemp).html("<div class='header'><img src='images/back.png' id='script-" + nodeIDAlpha + "-back' alt='back'/> script</div>");
-        $('#script-' + nodeIDAlpha + '-back').click ( function(evt) {
-            self.editingScript = false;
-            drillBack.call(self, nodeID);
-
-            // Return editor to normal width
-            $('#editor').animate({ 'left' : "-260px" }, 175);
-            $('.vwf-tree').animate({ 'width' : "260px" }, 175);
-        });
-
-        // $(topdownTemp).append("<div class='scriptEntry'><pre class='scriptCode'><textarea id='newScriptArea' class='scriptEdit' spellcheck='false' wrap='off'></textarea></pre><input class='update_button' type='button' id='create-" + nodeIDAlpha + "' value='Create' /></div><hr>");
-
-          $(topdownTemp).append("<div class='scriptEntry'><pre class='scriptCode'> <div id='editorlive'></div></pre><input class='update_button' type='button' id='create-" + nodeIDAlpha + "' value='Create' /></div><hr>");
-
-           var editor = createAceEditor(self, nodeID);
-
-
-        $("#create-" + nodeIDAlpha).click ( function(evt) {
-            self.kernel.execute( nodeID, editor.getValue() );
-           // self.kernel.execute( nodeID, $("#newScriptArea").val() );
-        });
-
-        // $('#newScriptArea').focus( function(evt) { 
-        //     // Expand the script editor
-        //     self.editingScript = true;
-        //     $('#editor').animate({ 'left' : "-500px" }, 175);
-        //     $('.vwf-tree').animate({ 'width' : "500px" }, 175);
-        // });
-        $('#editorlive').keydown( function(evt) { 
-            evt.stopPropagation();
-        });
-
-        $(topdownName).hide();
-        $(topdownTemp).show();
-        
-        this.topdownName = topdownTemp;
-        this.topdownTemp = topdownName;
-    }
-
-    // -- viewScript ------------------------------------------------------------------------
-
-    function createAceEditor(view, nodeID) {
-        var editor = view.ace.edit("editorlive");
-        editor.setTheme("ace/theme/monokai");
-        editor.setFontSize(16);
-        editor.getSession().setMode("ace/mode/javascript");
-
-        editor.commands.addCommand({
-                name: "doit",
-                bindKey: { win: "Ctrl-e", mac: "Command-e" },                
-                exec: function() {
-                    codeEditorDoit(editor, nodeID);
-                }
-});     
-
-    editor.commands.addCommand({
-                name: "printit",
-                bindKey: { win: "Ctrl-b", mac: "Command-b" },                
-                exec: function() {
-                    codeEditorPrintit(editor, nodeID);
-                }
-});     
-
-        editor.on('focus', function (event, editor) {
-            // Expand the script editor
-            self.editingScript = true;
-            $('#editor').animate({ 'left': "-800px" }, 175);
-            $('.vwf-tree').animate({ 'width': "800px" }, 175);
-        });
-
-        editor.on('blur', function (event, editor) {
-            //    $('#editor').animate({ 'left' : "-260px" }, 175);
-            //     $('.vwf-tree').animate({ 'width' : "260px" }, 175);
-      
-        });
-
-        return editor;
-
-    }
-
-    function editOhmLang (nodeID, propertyName, propertyValue) {
-
-        var self = this;
-        var topdownName = this.topdownName;
-        var topdownTemp = this.topdownTemp;
-
-        var nodeIDAlpha = $.encoder.encodeForAlphaNumeric(nodeID);
-        
-        $(topdownTemp).html("<div class='header'><img src='images/back.png' id='script-" + nodeIDAlpha + "-back' alt='back'/> script</div>");
-        $('#script-' + nodeIDAlpha + '-back').click ( function(evt) {
-            self.editingScript = false;
-            drillBack.call(self, nodeID);
-
-            // Return editor to normal width
-            $('#editor').animate({ 'left' : "-260px" }, 175);
-            $('.vwf-tree').animate({ 'width' : "260px" }, 175);
-        });
-
-        if(propertyValue != undefined)
-        {
-
-        var propText =  propertyValue;
-       // var propText = propertyValue.split("\n").map($.trim).filter(function(line) { return line != "" }).join("\n");
-
-         $(topdownTemp).append("<div style='padding:6px'><input class='live_button' type='button' id='update-" + nodeIDAlpha + "-" + propertyName + "' value='Update' /></div>");
-
-         $(topdownTemp).append("<div class='scriptEntry'><pre class='scriptCode'> <div id='editorlive'> </div></pre></div><hr>");
-
-         var editor = createAceEditor(self, nodeID);
-         editor.setValue(propText);
-        
-            $("#update-" + nodeIDAlpha + "-" + propertyName).click ( function(evt) {
-                var evalText = editor.getValue();
-                 self.kernel.setProperty( nodeID, propertyName, evalText);
-            });
-          
-            $('#editorlive').keydown( function(evt) { 
-                evt.stopPropagation();
-            });
-        }
-        
-        $(topdownName).hide();
-        $(topdownTemp).show();
-        
-        this.topdownName = topdownTemp;
-        this.topdownTemp = topdownName;
-
-
-    }
-
-
-
-    function viewScript (nodeID, scriptID, extendsID) // invoke with the view as "this"
-    {
-        var self = this;
-        var topdownName = this.topdownName;
-        var topdownTemp = this.topdownTemp;
-        var allScripts = this.allScripts;
-
-        var nodeIDAlpha = $.encoder.encodeForAlphaNumeric(nodeID);
-        
-        $(topdownTemp).html("<div class='header'><img src='images/back.png' id='script-" + nodeIDAlpha + "-back' alt='back'/> script</div>");
-        $('#script-' + nodeIDAlpha + '-back').click ( function(evt) {
-            self.editingScript = false;
-            drillBack.call(self, nodeID);
-
-            // Return editor to normal width
-            $('#editor').animate({ 'left' : "-260px" }, 175);
-            $('.vwf-tree').animate({ 'width' : "260px" }, 175);
-        });
-
-        if(extendsID) {
-            nodeID = extendsID;
-            nodeIDAlpha = $.encoder.encodeForAlphaNumeric(extendsID);
-        }
-
-        var scriptText = self.allScripts[nodeID][scriptID].text;
-        if(scriptText != undefined)
-        {
-            // $(topdownTemp).append("<div class='scriptEntry'><pre class='scriptCode'><textarea id='scriptTextArea' class='scriptEdit' spellcheck='false' wrap='off'>" + scriptText + "</textarea></pre><input class='update_button' type='button' id='update-" + nodeIDAlpha + "-" + scriptID + "' value='Update' /></div><hr>");
-
-             //Open Live Editor
-        
-         $(topdownTemp).append("<div style='padding:6px'><input class='live_button' type='button' id='printit' value='Print It' /><span> </span><input class='live_button' type='button' id='doit-" + nodeIDAlpha + "-" + scriptID + "' value='DoIt' /><span> </span><input class='live_button' type='button' id='update-" + nodeIDAlpha + "-" + scriptID + "' value='Update' /></div>");
-
-         $(topdownTemp).append("<div class='scriptEntry'><pre class='scriptCode'> <div id='editorlive'>" + scriptText + "</div></pre></div><hr>");
-
-         var editor = createAceEditor(self, nodeID);
-
-        //  $(topdownTemp).append("<div style='padding:6px'><input class='live_button' type='button' id='doit' value='DoIt' /></div>");
-         $("#doit-" + nodeIDAlpha + "-" + scriptID).click(function(evt) {
-              var s_id = $(this).attr("id").substring($(this).attr("id").lastIndexOf('-') + 1);
-                self.allScripts[nodeID][s_id].text = undefined;;
-            codeEditorDoit.call(self, editor, nodeID);
-        });
-
-         $("#printit").click(function(evt) {
-            codeEditorPrintit.call(self, editor, nodeID);
-        });
-        
-            $("#update-" + nodeIDAlpha + "-" + scriptID).click ( function(evt) {
-                var s_id = $(this).attr("id").substring($(this).attr("id").lastIndexOf('-') + 1);
-                self.allScripts[nodeID][s_id].text = undefined;
-
-                var evalText = editor.getValue();
-                self.kernel.execute( nodeID, evalText );
-            });
-            // $('#editorlive').focus( function(evt) { 
-            //     // Expand the script editor
-            //     self.editingScript = true;
-            //     $('#editor').animate({ 'left' : "-500px" }, 175);
-            //     $('.vwf-tree').animate({ 'width' : "500px" }, 175);
-            // });
-            $('#editorlive').keydown( function(evt) { 
-                evt.stopPropagation();
-            });
-        }
-        
-        $(topdownName).hide();
-        $(topdownTemp).show();
-        
-        this.topdownName = topdownTemp;
-        this.topdownTemp = topdownName;
-    }
-
-    // -- setParams -------------------------------------------------------------------------
-
-    function setParams (methodName, methodParams, nodeID) // invoke with the view as "this"
-    {
-        var self = this;
-        var topdownName = this.topdownName;
-        var topdownTemp = this.topdownTemp;
-
-        var methodNameAlpha = $.encoder.encodeForAlphaNumeric(methodName);
-        var methodNameHTML = $.encoder.encodeForHTML(methodName);
-     
-        $(topdownTemp).html("<div class='header'><img src='images/back.png' id='" + methodNameAlpha + "-back' alt='back'/> " + methodNameHTML + "</div>");
-        $('#' + methodNameAlpha + '-back').click ( function(evt) {
-            
-             self.editingScript = false;
-
-             drillUp.call(self, nodeID);
-
-            // Return editor to normal width
-            $('#editor').animate({ 'left' : "-260px" }, 175);
-            $('.vwf-tree').animate({ 'width' : "260px" }, 175);
-
-            
-        });
-
-            var nodeIDAlpha = $.encoder.encodeForAlphaNumeric(nodeID);
-
-            var method = vwf.getMethod(nodeID, methodNameAlpha);
-
-           $(topdownTemp).append("<div style='padding:6px'><input class='live_button' type='button' id='printit' value='Print It' /><span> </span><input class='live_button' type='button' id='doit' value='Do It' /><span> </span><input class='live_button' type='button' id='update-" + nodeIDAlpha + "-" + methodNameAlpha + "' value='Update' /><span> </span> <input class='live_button' type='button' id='call' value='Call' /></div>");
-
-            //$(topdownTemp).append("<input class='update_button' type='button' id='call' value='Call' />");
-           
-
-          $(topdownTemp).append("<div id='editorlive'>" + method.body + "</div>");
-
-          
-
-        var editor = createAceEditor(self, nodeID);
-
-         $("#printit").click(function(evt) {
-            codeEditorPrintit.call(self, editor, nodeID);
-        });
-        
-
-        $("#doit").click(function(evt) {
-            codeEditorDoit.call(self, editor, nodeID);
-        });
-
-          $("#update-" + nodeIDAlpha + "-" + methodNameAlpha).click ( function(evt) {
-                var evalText = editor.getValue();
-                self.kernel.setMethod( nodeID, methodNameAlpha,
-                { body: evalText, type: "application/javascript", parameters: method.parameters } );
-            });
-
-
-          var params = [];
-          if (method.parameters) {
-              params = method.parameters.length
-          };
-
-          if (params >= 1) {
-
-        for(var i=1; i<=params; i++)
-        {
-            $(topdownTemp).append("<div id='param" + i + "' class='propEntry'><table><tr><td><b>" + method.parameters[i-1] + ": " + i + ": </b></td><td><input type='text' class='input_text' id='input-param" + i + "'></td></tr></table></div>");
-            $('#input-param'+ i).keydown( function(evt) {
-                    evt.stopPropagation();
-                });
-            $('#input-param'+ i).keypress( function(evt) {
-                evt.stopPropagation();
-            });
-            $('#input-param'+ i).keyup( function(evt) {
-                evt.stopPropagation();
-            });
-        }
-          }
-
-          
-
-        $('#call').click ( function (evt) {
-
-            if (params >= 1) {
-            var parameters = new Array();
-            for(var i=1; i<=params; i++)
-            {
-                if( $('#input-param'+ i).val() )
-                {
-                    var prmtr = $('#input-param'+ i).val();
-                    try {
-                        prmtr = JSON.parse(JSON.stringify($.encoder.canonicalize(prmtr)));
-                        parameters.push( prmtr );
-                    } catch (e) {
-                        self.logger.error('Invalid Value');
-                    }
-                }
-            }
-        }
-        
-            self.kernel.callMethod(nodeID, methodName, parameters);
-        });
-
-        $(topdownName).hide('slide', {direction: 'left'}, 175); 
-        $(topdownTemp).show('slide', {direction: 'right'}, 175);    
-
-        this.topdownName = topdownTemp;
-        this.topdownTemp = topdownName;
-    }
-
-    // -- setArgs ---------------------------------------------------------------------------
-
-   function setArgs (eventName, eventArgs, nodeID) // invoke with the view as "this"
-    {
-        var self = this;
-        var topdownName = this.topdownName;
-        var topdownTemp = this.topdownTemp;
-
-        var eventNameAlpha = $.encoder.encodeForAlphaNumeric(eventName);
-        var eventNameHTML = $.encoder.encodeForHTML(eventName);
-     
-        $(topdownTemp).html("<div class='header'><img src='images/back.png' id='" + eventNameAlpha + "-back' alt='back'/> " + eventNameHTML + "<input type='button' class='input_button_call' id='fire' value='Fire' style='float:right;position:relative;top:5px;right:33px'></input></div>");
-        $('#' + eventNameAlpha + '-back').click ( function(evt) {
-            drillUp.call(self, nodeID);
-        });
-
-        for(var i=1; i<=8; i++)
-        {
-            $(topdownTemp).append("<div id='arg" + i + "' class='propEntry'><table><tr><td><b>Argument " + i + ": </b></td><td><input type='text' class='input_text' id='input-arg" + i + "'></td></tr></table></div>");
-            $('#input-arg'+ i).keydown( function(evt) {
-                    evt.stopPropagation();
-                });
-            $('#input-arg'+ i).keypress( function(evt) {
-                evt.stopPropagation();
-            });
-            $('#input-arg'+ i).keyup( function(evt) {
-                evt.stopPropagation();
-            });
-        }
-
-        $(topdownTemp).append("<div style='font-weight:bold;text-align:right;padding-right:10px'></div>");
-        $('#fire').click ( function (evt) {
-
-            var args = new Array();
-            for(var i=1; i<=8; i++)
-            {
-                if( $('#input-arg'+ i).val() )
-                {
-                    var arg = $('#input-arg'+ i).val();
-                    try {
-                        arg = JSON.parse($.encoder.canonicalize(arg));
-                        args.push( arg );
-                    } catch (e) {
-                        self.logger.error('Invalid Value');
-                    }
-                }
-            }
-
-            self.kernel.fireEvent(nodeID, eventName, args);
-        });
-
-        $(topdownName).hide('slide', {direction: 'left'}, 175); 
-        $(topdownTemp).show('slide', {direction: 'right'}, 175);    
-
-        this.topdownName = topdownTemp;
-        this.topdownTemp = topdownName;
-
-    }
-
-    function getPrototypes( kernel, extendsID ) {
-        var prototypes = [];
-        var id = extendsID;
-
-        while ( id !== undefined ) {
-            prototypes.push( id );
-            id = kernel.prototype( id );
-        }
-                
-        return prototypes;
-    }
-
-    function getPrototypes( kernel, extendsID ) {
-        var prototypes = [];
-        var id = extendsID;
-
-        while ( id !== undefined ) {
-            prototypes.push( id );
-            id = kernel.prototype( id );
-        }
-                
-        return prototypes;
-    }
-
-    function createProperty( node, propertyName, propertyValue ) {
-        var property = {
-            name: propertyName,
-            rawValue: propertyValue,
-            value: undefined,
-            getValue: function() {
-                var propertyValue;
-                if ( this.value == undefined ) {
-                    try {
-                        propertyValue = utility.transform( this.rawValue, utility.transforms.transit );
-                        this.value = JSON.stringify( propertyValue );
-                    } catch (e) {
-                        this.logger.warnx( "createdProperty", nodeID, this.propertyName, this.rawValue,
-                            "stringify error:", e.message );
-                        this.value = this.rawValue;
-                    }
-                }
-                return this.value;
-            }
-        };
-
-        return property;
-    }
-
-
-    function getProperties( kernel, extendsID ) {
-        var pTypes = getPrototypes( kernel, extendsID );
-        var pProperties = {};
-        if ( pTypes ) {
-            for ( var i=0; i < pTypes.length; i++ ) {
-                var nd = this.nodes[ pTypes[i] ];
-                if ( nd && nd.properties ) {
-                    for ( var key in nd.properties ) {
-                        pProperties[ key ] = { "prop": nd.properties[ key ], "prototype": pTypes[i]  };
-                    }
-                }
-            }
-        }
-        return pProperties;
-    }
-
-    function getChildren( kernel, extendsID ) {
-        var pTypes = getPrototypes( kernel, extendsID );
-        var pChildren = {};
-        if ( pTypes ) {
-            for ( var i=0; i < pTypes.length; i++ ) {
-                var nd = this.nodes[ pTypes[i] ];
-                if ( nd && nd.children ) {
-                    for ( var key in nd.children ) {
-                        pChildren[ key ] = nd.children[key];
-                    }
-                }
-            }
-        }
-        return pChildren;
-    }
-
-    function getEvents( kernel, extendsID ) {
-        var pTypes = getPrototypes( kernel, extendsID );
-        var events = {};
-        if ( pTypes ) {
-            for ( var i = 0; i < pTypes.length; i++ ) {
-                var nd = this.nodes[ pTypes[i] ];
-                if  ( nd && nd.events ) {
-                    for ( var key in nd.events ) {
-                        events[ key ] = nd.events[key];
-                    }
-                }
-            }
-        }
-        return events;
-    }
-
-    function getMethods( kernel, extendsID ) {
-        var pTypes = getPrototypes( kernel, extendsID );
-        var methods = {};
-        if ( pTypes ) {
-            for ( var i = 0; i < pTypes.length; i++ ) {
-                var nd = this.nodes[ pTypes[i] ];
-                if  ( nd && nd.methods ) {
-                    for ( var key in nd.methods ) {
-                        methods[ key ] = nd.methods[key];
-                    }
-                }
-            }
-        }
-        return methods;
-    }
-
-    function highlightChildInHierarchy(nodeID) {
-        if (this.editorOpen && this.editorView == 1) // Hierarchy view open
-        {
-            var childDiv = $("div[id='" + nodeID +"']");
-            if(childDiv.length > 0) {
-                var previousChild = $("div[id='" + this.highlightedChild +"']");
-                if(previousChild.length > 0) {
-                    previousChild.removeClass('childContainerHighlight');
-                }
-                childDiv.addClass('childContainerHighlight');
-                this.highlightedChild = nodeID;
-            }
-        }
-    }
-
-    // -- showTimeline ----------------------------------------------------------------------
-
-    function showTimeline() // invoke with the view as "this"
-    {
-        var timeline = this.timeline;
-
-        if(!this.timelineInit)
-        {
-            $('#time_control').append("<div class='header'>Timeline</div>" + 
-                "<div style='text-align:center;padding-top:10px'><span><button id='play'></button><button id='stop'></button></span>" +
-                "<span><span class='rate slider'></span>&nbsp;" + 
-                "<span class='rate vwf-label' style='display: inline-block; width:8ex'></span></span></div>");
-
-            var options = {};
-
-            [ "play", "pause", "stop" ].forEach( function( state ) {
-                options[state] = { icons: { primary: "ui-icon-" + state }, label: state, text: false };
-            } );
-
-            options.rate = { value: 0, min: -2, max: 2, step: 0.1, };
-
-            var state = {};
-
-            $.get(
-                "admin/state", 
-                undefined, 
-                function( data ) {
-                    state = data;
-
-                    $( "button#play" ).button( "option", state.playing ? options.pause : options.play );
-                    $( "button#stop" ).button( "option", "disabled", state.stopped );
-
-                    $( ".rate.slider" ).slider( "value", Math.log( state.rate ) / Math.LN10 );
-
-                    if ( state.rate < 1.0 ) {
-                        var label_rate = 1.0 / state.rate;
-                    } 
-                    else {
-                        var label_rate = state.rate;
-                    }
-
-                    var label = label_rate.toFixed(2).toString().replace( /(\.\d*?)0+$/, "$1" ).replace( /\.$/, "" );
-
-                    if ( state.rate < 1.0 ) {
-                        label = "&#x2215; " + label;
-                    } else {
-                        label = label + " &times;";
-                    }
-
-                    $( ".rate.vwf-label" ).html( label );
-                }, 
-                "json" 
-            );
-
-            $( "button#play" ).button(
-                options.pause
-            ). click( function() {
-                $.post(
-                    state.playing ? "admin/pause" : "admin/play", 
-                    undefined, 
-                    function( data ) {
-                        state = data;
-
-                        $( "button#play" ).button( "option", state.playing ? options.pause : options.play );
-                        $( "button#stop" ).button( "option", "disabled", state.stopped );
-                    },
-                    "json" 
-                );
-            } );
-
-
-            $( "button#stop" ).button(
-                options.stop
-            ). click( function() {
-                $.post(
-                    "admin/stop", 
-                    undefined, 
-                    function( data ) {
-                        state = data;
-
-                        $( "button#play" ).button( "option", state.playing ? options.pause : options.play );
-                        $( "button#stop" ).button( "option", "disabled", state.stopped );
-                    }, 
-                    "json" 
-                );
-            } );
-
-            $( ".rate.slider" ).slider(
-                options.rate
-            ) .bind( "slide", function( event, ui ) {
-                $.get( 
-                    "admin/state", 
-
-                    { "rate": Math.pow( 10, Number(ui.value) ) }, 
-
-                    function( data ) {
-                        state = data;
-
-                        $( ".rate.slider" ).slider( "value", Math.log( state.rate ) / Math.LN10 );
-
-                        if ( state.rate < 1.0 ) {
-                            var label_rate = 1.0 / state.rate;
-                        } 
-                        else {
-                            var label_rate = state.rate;
-                        }
-
-                        var label = label_rate.toFixed(2).toString().replace( /(\.\d*?)0+$/, "$1" ).replace( /\.$/, "" );
-
-                        if ( state.rate < 1.0 ) {
-                            label = "&#x2215; " + label;
-                        } else {
-                            label = label + " &times;";
-                        }
-
-                        $( ".rate.vwf-label" ).html( label );
-                    }, 
-                    "json"
-                );
-            } );
-
-            this.timelineInit = true;
-        }
-
-        if (!this.editorOpen)
-        {
-            $(timeline).show('slide', {direction: 'right'}, 175);    
-        }
-        else
-        {
-            $(timeline).show();
-        }
-    }
-
-    // -- Show Code Editor tab
-
-function showCodeEditorTab() // invoke with the view as "this"
-    {
-       var self = this;
-        var codeEditor= this.codeEditor;
-
-        if(!this.codeEditorInit)
-        {
-            $('#codeEditor_tab').append("<div class='header'>Live Code Editor</div>");
-
-         $('#codeEditor_tab').append("<div style='padding:6px'><input type='button' id='min' value='Min Window' /><span> </span><input class='live_button' type='button' id='printit' value='Print It' /><span> </span><input class='live_button' type='button' id='doit' value='Do It' /></div>");
-
-           $("#doit").click(function(evt) {
-            codeEditorDoit.call(self, editor, sceneID);
-        });
-
-         $("#printit").click(function(evt) {
-            codeEditorPrintit.call(self, editor, sceneID);
-        });
-
-         // $('#codeEditor_tab').append("<div style='padding:6px'></div>");
-         $('#min').click(function(evt) {
-               $('#editor').animate({ 'left' : "-260px" }, 175);
-             $('.vwf-tree').animate({ 'width' : "260px" }, 175);
-        });
-
-        //Open Live Editor
-         $('#codeEditor_tab').append('<div id="editorlive">console.log("test")</div>');
-         
-     var sceneID = self.kernel.application();    
-     var editor = createAceEditor(self, sceneID);
-
-    editor.on('blur', function (event, editor) {
-            //    $('#editor').animate({ 'left' : "-260px" }, 175);
-            //     $('.vwf-tree').animate({ 'width' : "260px" }, 175);
-            });
-
-
-            this.codeEditorInit = true;
-        }
-
-        if (!this.editorOpen)
-        {
-            $(codeEditor).show('slide', {direction: 'right'}, 175);    
-        }
-        else
-        {
-            $(codeEditor).show();
-                // $('#editor').animate({ 'left' : "-500px" }, 175);
-                // $('.vwf-tree').animate({ 'width' : "500px" }, 175);
-        }
-    }
-
-    function codeEditorDoit(editor, nodeID)
-		{
-			var selectedText = editor.getSession().doc.getTextRange(editor.selection.getRange());
-
-			if (selectedText == "") {
-
-				var currline = editor.getSelectionRange().start.row;
-				var selectedText = editor.session.getLine(currline);
-
-			}
-
-			//console.log(selectedText);
-            //var sceneID = self.kernel.application();
-			vwf_view.kernel.execute(nodeID, selectedText);
-
-		}
-
- function codeEditorPrintit(editor, nodeID)
-		{
-			var selectedText = editor.getSession().doc.getTextRange(editor.selection.getRange());
-
-			if (selectedText == "") {
-
-				var currline = editor.getSelectionRange().start.row;
-				var selectedText = editor.session.getLine(currline);
-
-			}
-
-			//console.log(selectedText);
-            //var sceneID = self.kernel.application();
-            let scriptText = 'console.log('+selectedText+');'
-			self.kernel.execute(nodeID, scriptText);
-
-		}
-         
-
-
-
-        // -- showAboutTab ----------------------------------------------------------------------
-
-    function showAboutTab() // invoke with the view as "this"
-    {
-        var about = this.about;
-
-        if(!this.aboutInit)
-        {
-            $('#about_tab').append("<div class='header'>About</div>" + 
-                "<div class='about'><p style='font:bold 12pt Arial'>Virtual World Framework & LiveCode editor</p>" +
-                "<p><b>Version: </b> 0.1 <b>VWF version: </b>" + version.toString() + "</p>" +
-                "<p><b>This project site: </b><a href='http://demo.krestianstvo.org' target='_blank'>http://demo.krestianstvo.org</a></p>" +
-                "<p><b>Site VWF: </b><a href='http://virtualworldframework.com' target='_blank'>http://virtualworldframework.com</a></p>" +
-                "<p><b>Project source: </b><a href='https://github.com/NikolaySuslov/vwf/tree/aframe' target='_blank'>https://github.com/NikolaySuslov/vwf/tree/aframe</a></p></div>");
-
-            this.aboutInit = true;
-        }
-
-        if (!this.editorOpen)
-        {
-            $(about).show('slide', {direction: 'right'}, 175);    
-        }
-        else
-        {
-            $(about).show();
-        }
-    }
-
-    //  -- showModelsTab ----------------------------------------------------------------------
-
-    function showModelsTab(modelID, modelURL) // invoke with the view as "this"
-    {
-        var self = this;
-        var models = this.models;
-        var modelsTemp = this.modelsTemp;
-        this.currentModelID = modelID;
-        this.currentModelURL = modelURL;
-
-        $(models).html("");
-        
-        if(modelID == "") {
-            $(modelsTemp).html("<div class='header'>Models</div>");
-
-            $.getJSON("admin/models", function( data ) {
-                if(data.length > 0) {
-                    $.each( data, function( key, value ) {
-                        var fileName = encodeURIComponent(value['basename']);
-                        var divId = fileName;
-                        if(divId.indexOf('.') != -1) {
-                            divId = divId.replace(/\./g, "_");
-                        }
-                        var url = value['url'];
-
-                        $(modelsTemp).append("<div class='childContainer'><div id='" + divId + "' class='modelEntry' data-url='" + url + "'>"
-                            + fileName + "</div></div>");
-                        $("#" + divId).click(function(e) {
-                            modelDrillDown.call(self, e.target.textContent, e.target.getAttribute("data-url"));
-                        })
-                    });
-                }
-                else {
-                    $(modelsTemp).append("<div class='childEntry'><p style='font:bold 12pt Arial'>No Models Found</p></div>");
-                }
-            } );
-        }
-        else {
-            var divId = modelID;
-            if(divId.indexOf('.') != -1) {
-                divId = divId.replace(/\./g, "_");
-            }
-            $(modelsTemp).html("<div id='" + divId + "-backDiv' class='header'><img src='images/back.png' id='" + divId + "-back' alt='back'/>" + modelID + "</div>");
-            $("#" + divId + "-back").click(function(e) {
-                modelDrillUp.call(self, '');
-            });
-
-            $(modelsTemp).append("<div id='" + divId + "-rotation' class='propEntry'><table><tr><td><b>Rotation</b></td><td>" +
-                "<input type='text' class='input_text' id='input-" + divId + "-rotation' value='[1,0,0,0]'></td></tr></table></div>");
-            $('#input-' + divId + '-rotation').keydown( function(evt) {
-                evt.stopPropagation();
-            });
-            $('#input-' + divId + '-rotation').keypress( function(evt) {
-                evt.stopPropagation();
-            });
-            $('#input-' + divId + '-rotation').keyup( function(evt) {
-                evt.stopPropagation();
-            });
-
-            $(modelsTemp).append("<div id='" + divId + "-scale' class='propEntry'><table><tr><td><b>Scale</b></td><td>" +
-                "<input type='text' class='input_text' id='input-" + divId + "-scale' value='[1,1,1]'></td></tr></table></div>");
-            $('#input-' + divId + '-scale').keydown( function(evt) {
-                    evt.stopPropagation();
-                });
-            $('#input-' + divId + '-scale').keypress( function(evt) {
-                evt.stopPropagation();
-            });
-            $('#input-' + divId + '-scale').keyup( function(evt) {
-                evt.stopPropagation();
-            });
-
-            $(modelsTemp).append("<div id='" + divId + "-translation' class='propEntry'><table><tr><td><b>Translation Offset</b></td><td>" +
-                "<input type='text' class='input_text' id='input-" + divId + "-translation' value='[0,0,0]'></td></tr></table></div>");
-            $('#input-' + divId + '-translation').keydown( function(evt) {
-                    evt.stopPropagation();
-                });
-            $('#input-' + divId + '-translation').keypress( function(evt) {
-                evt.stopPropagation();
-            });
-            $('#input-' + divId + '-translation').keyup( function(evt) {
-                evt.stopPropagation();
-            });
-
-            $(modelsTemp).append("<div class='drag'><div id='" + divId + "-drag' class='modelEntry' draggable='true' data-escaped-name='" + divId +"' data-url='" + modelURL + "'>Drag To Create</div></div>");
-
-            $("#" + divId + "-drag").on("dragstart", function (e) {
-                var fileName = $("#" + e.target.getAttribute("data-escaped-name") + "-backDiv").text();
-                var rotation = encodeURIComponent($("#input-" + e.target.getAttribute("data-escaped-name") + "-rotation").val());
-                var scale = encodeURIComponent($("#input-" + e.target.getAttribute("data-escaped-name") + "-scale").val());
-                var translation = encodeURIComponent($("#input-" + e.target.getAttribute("data-escaped-name") + "-translation").val());
-                var fileData = "{\"fileName\":\""+fileName+"\", \"fileUrl\":\""+e.target.getAttribute("data-url")+"\", " +
-                    "\"rotation\":\"" + rotation + "\", \"scale\":\"" + scale + "\", \"translation\":\"" + translation + "\"}";
-                e.originalEvent.dataTransfer.setData('text/plain', fileData);
-                e.originalEvent.dataTransfer.setDragImage(e.target, 0, 0);
-                return true;
-            });
-        }
-    }
-
-    // -- Model drillDown -------------------------------------------------------------------------
-
-    function modelDrillDown(modelID, modelURL) // invoke with the view as "this"
-    {
-        var models = this.models;
-        var modelsTemp = this.modelsTemp;
-        
-        showModelsTab.call(this, modelID, modelURL);
-        
-        if(modelID != "") $(models).hide('slide', {direction: 'left'}, 175); 
-        $(modelsTemp).show('slide', {direction: 'right'}, 175);    
-        
-        this.models = modelsTemp;
-        this.modelsTemp = models;
-    }
-    
-    // -- Model drillUp ---------------------------------------------------------------------------
-
-    function modelDrillUp(modelID) // invoke with the view as "this"
-    {
-        var models = this.models;
-        var modelsTemp = this.modelsTemp;
-        
-        showModelsTab.call(this, modelID);
-        
-        $(models).hide('slide', {direction: 'right'}, 175); 
-        $(modelsTemp).show('slide', {direction: 'left'}, 175);    
-        
-        this.models = modelsTemp;
-        this.modelsTemp = models;
-    }
-
-    // -- SaveStateAsFile -------------------------------------------------------------------------
-
-    function saveStateAsFile(filename) // invoke with the view as "this"
-    {
-        this.logger.info("Saving: " + filename);
-
-        if(supportAjaxUploadWithProgress.call(this))
-        {
-            var xhr = new XMLHttpRequest();
-
-            // Save State Information
-            var state = vwf.getState();
-
-            var timestamp = state["queue"].time;
-            timestamp = Math.round(timestamp * 1000);
-
-            var objectIsTypedArray = function( candidate ) {
-                var typedArrayTypes = [
-                    Int8Array,
-                    Uint8Array,
-                    // Uint8ClampedArray,
-                    Int16Array,
-                    Uint16Array,
-                    Int32Array,
-                    Uint32Array,
-                    Float32Array,
-                    Float64Array
-                ];
-
-                var isTypedArray = false;
-
-                if ( typeof candidate == "object" && candidate != null ) {
-                    typedArrayTypes.forEach( function( typedArrayType ) {
-                        isTypedArray = isTypedArray || candidate instanceof typedArrayType;
-                    } );
-                }
-
-                return isTypedArray;
-            };
-
-            var transitTransformation = function( object ) {
-                return objectIsTypedArray( object ) ?
-                    Array.prototype.slice.call( object ) : object;
-            };
-
-            var json = JSON.stringify(
-                require("vwf/utility").transform(
-                    state, transitTransformation
-                )
-            );
-
-            json = $.encoder.encodeForURL(json);
-
-            var path = window.location.pathname;
-            var pathSplit = path.split('/');
-            if ( pathSplit[0] == "" ) {          
-                pathSplit.shift();
-            }
-            if ( pathSplit[ pathSplit.length - 1 ] == "" ) {
-                pathSplit.pop();
-            }            
-            var inst = undefined;
-            var instIndex = pathSplit.length - 1;
-            if ( pathSplit.length > 2 ) {
-                if ( pathSplit[ pathSplit.length - 2 ] == "load" ) {
-                    instIndex = pathSplit.length - 3;
-                }
-            }
-            if ( pathSplit.length > 3 ) {
-                if ( pathSplit[ pathSplit.length - 3 ] == "load" ) {
-                    instIndex = pathSplit.length - 4;
-                }
-            }
-            inst = pathSplit[ instIndex ];
-
-            var root = "";
-            for ( var i=0; i < instIndex; i++ ) {
-                if ( root != "" ) {
-                    root = root + "/";
-                } 
-                root = root + pathSplit[i];
-            }
-
-            if(filename == '') filename = inst;
-
-            if(root.indexOf('.vwf') != -1) root = root.substring(0, root.lastIndexOf('/'));
-
-            xhr.open("POST", "/"+root+"/save/"+filename, true);
-            xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
-            xhr.send("root="+root+"/"+filename+"&filename=saveState&inst="+inst+"&timestamp="+timestamp+"&extension=.vwf.json"+"&jsonState="+json);
-
-            // Save Config Information
-            var config = {"info":{}, "model":{}, "view":{} };
-
-            // Save browser title
-            config["info"]["title"] = $('title').html();
-
-            // Save model drivers
-            Object.keys(vwf_view.kernel.kernel.models).forEach(function(modelDriver) {
-                if(modelDriver.indexOf('vwf/model/') != -1) config["model"][modelDriver] = "";
-            });
-
-            // If neither glge or threejs model drivers are defined, specify nodriver
-            if(config["model"]["vwf/model/glge"] === undefined && config["model"]["vwf/model/threejs"] === undefined) config["model"]["nodriver"] = "";
-
-            // Save view drivers and associated parameters, if any
-            Object.keys(vwf_view.kernel.kernel.views).forEach(function(viewDriver) {
-                if(viewDriver.indexOf('vwf/view/') != -1)
-                {
-                    if( vwf_view.kernel.kernel.views[viewDriver].parameters )
-                    {
-                        config["view"][viewDriver] = vwf_view.kernel.kernel.views[viewDriver].parameters;
-                    }
-                    else config["view"][viewDriver] = "";
-                }
-            });
-
-            var jsonConfig = $.encoder.encodeForURL( JSON.stringify( config ) );
-
-            // Save config file to server
-            var xhrConfig = new XMLHttpRequest();
-            xhrConfig.open("POST", "/"+root+"/save/"+filename, true);
-            xhrConfig.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
-            xhrConfig.send("root="+root+"/"+filename+"&filename=saveState&inst="+inst+"&timestamp="+timestamp+"&extension=.vwf.config.json"+"&jsonState="+jsonConfig);
-        }
-
-        else
-        {
-            console.error("Unable to save state.");
-        }
-    }
-
-    // -- LoadSavedState --------------------------------------------------------------------------
-
-    function loadSavedState(filename, applicationpath, revision) 
-    {
-        this.logger.info("Loading: " + filename);
-
-        // Redirect until setState ID conflict is resolved
-        var path = window.location.pathname;
-        var inst = path.substring(path.length-17, path.length-1);
-        
-        var pathSplit = path.split('/');
-        if ( pathSplit[0] == "" ) {          
-            pathSplit.shift();
-        }
-        if ( pathSplit[ pathSplit.length - 1 ] == "" ) {
-            pathSplit.pop();
-        }            
-        var inst = undefined;
-        var instIndex = pathSplit.length - 1;
-        if ( pathSplit.length > 2 ) {
-            if ( pathSplit[ pathSplit.length - 2 ] == "load" ) {
-                instIndex = pathSplit.length - 3;
-            }
-        }
-        if ( pathSplit.length > 3 ) {
-            if ( pathSplit[ pathSplit.length - 3 ] == "load" ) {
-                instIndex = pathSplit.length - 4;
-            }
-        }
-        inst = pathSplit[ instIndex ];
-        if ( revision ) {
-            window.location.pathname = applicationpath + "/" + inst + '/load/' + filename + '/' + revision + '/';
-        }
-        else {
-            window.location.pathname = applicationpath + "/" + inst + '/load/' + filename + '/';
-        }
-
-        // $.get(filename,function(data,status){
-        //     vwf.setState(data);
-        // });
-    }
-
-    // -- SupportAjax -----------------------------------------------------------------------------
-
-    function supportAjaxUploadWithProgress()
-    {
-        return supportAjaxUploadProgressEvents();
-
-        function supportAjaxUploadProgressEvents() 
-        {
-            var xhr = new XMLHttpRequest();
-            return !! (xhr && ('upload' in xhr) && ('onprogress' in xhr.upload));
-        }
-    }
-} );

+ 0 - 1942
support/client/lib/vwf/view/editor.js

@@ -1,1942 +0,0 @@
-"use strict";
-
-// Copyright 2012 United States Government, as represented by the Secretary of Defense, Under
-// Secretary of Defense (Personnel & Readiness).
-// 
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-// 
-//   http://www.apache.org/licenses/LICENSE-2.0
-// 
-// Unless required by applicable law or agreed to in writing, software distributed under the License
-// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
-// or implied. See the License for the specific language governing permissions and limitations under
-// the License.
-
-/// vwf/view/editor creates a view interface for editor functions. 
-/// 
-/// @module vwf/view/editor
-/// @requires version
-/// @requires vwf/view
-/// @requires vwf/utility
-
-define( [ 
-    "module", 
-    "version", 
-    "vwf/view", 
-    "vwf/utility", 
-    "jquery", 
-    "jquery-ui", 
-    "jquery-encoder-0.1.0" 
-    ], function( module, version, view, utility, $ ) {
-
-    return view.load( module, {
-
-        // == Module Definition ====================================================================
-
-        initialize: function() {
-            var self = this;
-
-            this.nodes = {};
-            this.scenes = {};
-            this.allScripts = {};
-
-            // EDITOR CLOSED  --> 0
-            // HIERARCHY OPEN --> 1
-            // USER LIST OPEN --> 2
-            // TIMELINE OPEN  --> 3
-            // ABOUT OPEN     --> 4
-            this.editorView = 0;
-            this.editorOpen = false;
-            this.timelineInit = false;
-            this.aboutInit = false;
-            this.modelsInit = false;
-            this.editingScript = false;
-
-            this.topdownName = '#topdown_a';
-            this.topdownTemp = '#topdown_b';
-            this.clientList = '#client_list';
-            this.timeline = '#time_control';
-            this.about = '#about_tab';
-            this.models = '#model_a';
-            this.modelsTemp = '#model_b';
-            this.currentNodeID = '';
-            this.currentModelID = '';
-            this.currentModelURL = '';
-            this.highlightedChild = '';
-            this.intervalTimer = 0;
-
-            this.activeCameraID = undefined;
-            
-            $('body').append(
-                "<div id='editor' class='relClass'>\n" +
-                "  <div class='uiContainer'>\n" +
-                "    <div class='editor-tabs' id='tabs'>\n" +
-                "      <img id='x' style='display:none' src='images/tab_X.png' alt='x' />\n" +
-                "      <img id='hierarchy' src='images/tab_Application.png' alt='application' />\n" +
-                "      <img id='userlist' src='images/tab_Users.png' alt='users' />\n" +
-                "      <img id='timeline' src='images/tab_Time.png' alt='time' />\n" + 
-                "      <img id='models' src='images/tab_Models.png' alt='models' />\n" +
-                "      <img id='about' src='images/tab_About.png' alt='about' />\n" +
-                "    </div>\n" +
-                "  </div>\n" + 
-                "</div>" + 
-                "<div class='relClass'><div class='uiContainer'><div class='vwf-tree' id='topdown_a'></div></div></div>" + 
-                "<div class='relClass'><div class='uiContainer'><div class='vwf-tree' id='topdown_b'></div></div></div>" + 
-                "<div class='relClass'><div class='uiContainer'><div class='vwf-tree' id='client_list'></div></div></div>" +
-                "<div class='relClass'><div class='uiContainer'><div class='vwf-tree' id='time_control'></div></div></div>" +
-                "<div class='relClass'><div class='uiContainer'><div class='vwf-tree' id='about_tab'></div></div></div>" +
-                "<div class='relClass'><div class='uiContainer'><div class='vwf-tree' id='model_a'></div></div></div>" +
-                "<div class='relClass'><div class='uiContainer'><div class='vwf-tree' id='model_b'></div></div></div>"
-            );
-            
-            $('#tabs').stop().animate({ opacity:0.0 }, 0);
-            
-            $('#tabs').mouseenter( function(evt) { 
-                evt.stopPropagation();
-                $('#tabs').stop().animate({ opacity:1.0 }, 175);
-                return false; 
-            });
-            
-            $('#tabs').mouseleave( function(evt) { 
-                evt.stopPropagation(); 
-                $('#tabs').stop().animate({ opacity:0.0 }, 175);
-                return false; 
-            });
-            
-            $('#hierarchy').click ( function(evt) {
-                openEditor.call(self, 1);
-            });
-
-            $('#userlist').click ( function(evt) {
-                openEditor.call(self, 2);
-            });
-
-            $('#timeline').click ( function(evt) {
-                openEditor.call(self, 3);
-            });
-
-            $('#about').click ( function(evt) {
-                openEditor.call(self, 4);
-            });
-
-            $('#models').click ( function(evt) {
-                openEditor.call(self, 5);
-            });
-
-            $('#x').click ( function(evt) {
-                closeEditor.call(self);
-            });
-
-            $('#topdown_a').hide();
-            $('#topdown_b').hide();
-            $('#client_list').hide();
-            $('#time_control').hide();
-            $('#about_tab').hide();
-            $('#model_a').hide();
-            $('#model_b').hide();
-            
-            var canvas = document.getElementById(vwf_view.kernel.find("", "/")[0]);
-            if ( canvas ) {
-                $('#topdown_a').height(canvas.height);
-                $('#topdown_b').height(canvas.height);
-                $('#client_list').height(canvas.height);
-                $('#time_control').height(canvas.height);
-                $('#about_tab').height(canvas.height);
-                $('#model_a').height(canvas.height);
-                $('#model_b').height(canvas.height);
-            }
-            else
-            {    
-                $('#topdown_a').height(window.innerHeight-20);
-                $('#topdown_b').height(window.innerHeight-20);
-                $('#client_list').height(window.innerHeight-20);
-                $('#time_control').height(window.innerHeight-20);
-                $('#about_tab').height(window.innerHeight-20);
-                $('#model_a').height(window.innerHeight-20);
-                $('#model_b').height(window.innerHeight-20);
-            }
-        },
-        
-        createdNode: function( nodeID, childID, childExtendsID, childImplementsIDs,
-            childSource, childType, childIndex, childName, callback /* ( ready ) */ ) {
-
-            var nodeIDAttribute = $.encoder.encodeForHTMLAttribute("id", nodeID, true);
-            var childIDAttribute = $.encoder.encodeForHTMLAttribute("id", childID, true);
-            var childIDAlpha = $.encoder.encodeForAlphaNumeric(childID);
-            
-            var kernel = this.kernel;
-            var self = this;
-            var parent = this.nodes[ nodeID ];
-            var node = this.nodes[ childID ] = {
-                children: [],
-                properties: [],
-                events: {},
-                methods: {},
-                parent: parent,
-                parentID: nodeID,
-                ID: childID,
-                extendsID: childExtendsID,
-                implementsIDs: childImplementsIDs,
-                source: childSource, 
-                name: childName,
-            };
-
-            if ( parent ) {
-                parent.children.push( node );
-            }
-
-            if ( childID == vwf_view.kernel.find("", "/")[0] && childExtendsID && this.kernel.test( childExtendsID,
-                    "self::element(*,'http://vwf.example.com/scene.vwf')", childExtendsID ) ) {
-                this.scenes[ childID ] = node;
-            }
-            
-            if ( nodeID === this.currentNodeID && this.editingScript == false )
-            {
-                $('#children > div:last').css('border-bottom-width', '1px');
-                $("#children").append("<div id='" + childIDAlpha + "' data-nodeID='" + childIDAttribute + "' class='childContainer'><div class='childEntry'><b>" + $.encoder.encodeForHTML(childName) + "</b></div></div>");
-                $('#' + childIDAlpha).click( function(evt) {
-                    drillDown.call(self, $(this).attr("data-nodeID"), nodeIDAttribute);
-                });
-                $('#children > div:last').css('border-bottom-width', '3px');
-            }
-
-            if ( nodeID === this.kernel.application() && childName === 'camera' ) {
-                this.activeCameraID = childID;    
-            }
-        },
-        
-        createdProperty: function (nodeID, propertyName, propertyValue) {
-
-            return this.initializedProperty(nodeID, propertyName, propertyValue);   
-        },
-        
-        initializedProperty: function (nodeID, propertyName, propertyValue) {
-   
-            var node = this.nodes[ nodeID ];
-
-            if ( ! node ) return;  // TODO: patch until full-graph sync is working; drivers should be able to assume that nodeIDs refer to valid objects
-
-            var property = node.properties[ propertyName ] = createProperty.call( this, node, propertyName, propertyValue );
-            
-            node.properties.push( property );
-        },
-        
-        deletedNode: function (nodeID) {
-            var node = this.nodes[ nodeID ];
-            node.parent.children.splice( node.parent.children.indexOf(node), 1 );
-            delete this.nodes[ nodeID ];
-            var nodeIDAttribute = $.encoder.encodeForAlphaNumeric(nodeID); // $.encoder.encodeForHTMLAttribute("id", nodeID, true);
-            $('#' + nodeIDAttribute).remove();
-            $('#children > div:last').css('border-bottom-width', '3px');
-        },
-
-        //addedChild: [ /* nodeID, childID, childName */ ],
-        //removedChild: [ /* nodeID, childID */ ],
-
-        satProperty: function (nodeID, propertyName, propertyValue) {
-            var node = this.nodes[ nodeID ];
-
-            if ( ! node ) return;  // TODO: patch until full-graph sync is working; drivers should be able to assume that nodeIDs refer to valid objects
-            
-            // It is possible for a property to have satProperty called for it without ever getting an
-            // initializedProperty (if that property delegated to itself or another on replication)
-            // Catch that case here and create the property
-            if ( ! node.properties[ propertyName ] ) {
-
-                var property = node.properties[ propertyName ] = createProperty.call( this, node, propertyName, propertyValue );
-
-                node.properties.push( property );
-            }
-            
-            if ( propertyName === "activeCamera" ) {
-                if ( this.nodes[ propertyValue ] !== undefined ) {
-                    this.activeCameraID = propertyValue;
-                }
-            }
-
-            try {
-                propertyValue = utility.transform( propertyValue, utility.transforms.transit );
-                node.properties[ propertyName ].value = JSON.stringify( propertyValue );
-            } catch (e) {
-                this.logger.warnx( "satProperty", nodeID, propertyName, propertyValue,
-                    "stringify error:", e.message );
-                node.properties[ propertyName ].value = propertyValue;
-            }
-
-            if ( ( this.editorView == 1 ) && ( this.currentNodeID == nodeID ) ) {
-                var nodeIDAttribute = $.encoder.encodeForAlphaNumeric(nodeID); // $.encoder.encodeForHTMLAttribute("id", nodeID, true);
-                var propertyNameAttribute = $.encoder.encodeForAlphaNumeric("id", propertyName, true);
-            
-                // No need to escape propertyValue, because .val does its own escaping
-                $( '#input-' + nodeIDAttribute + '-' + propertyNameAttribute ).val( node.properties[ propertyName ].getValue() );
-            }
-        },
-        
-        //gotProperty: [ /* nodeID, propertyName, propertyValue */ ],
-        
-        createdMethod: function( nodeID, methodName, methodParameters, methodBody ){
-            var node = this.nodes[ nodeID ];
-            if ( node ) {
-                node.methods[ methodName ] = methodParameters;
-            }
-        },
-
-        //calledMethod: function( nodeID, methodName, methodParameters, methodValue ) {
-
-        //},
-
-        createdEvent: function( nodeID, eventName, eventParameters ) {
-            var node = this.nodes[ nodeID ];
-            if ( node ) {
-                node.events[ eventName ] = eventParameters;
-            }         
-        },
-
-        firedEvent: function ( nodeID, eventName, eventParameters ) {
-            if(eventName == "pointerHover") {
-                highlightChildInHierarchy.call(this, nodeID);
-            }
-        },
-
-        executed: function( nodeID, scriptText, scriptType ) {
-
-            var nodeScript = {
-                text: scriptText,
-                type: scriptType,
-            };
-
-            if ( !this.allScripts[ nodeID ] ) {
-                var nodeScripts = new Array();
-                nodeScripts.push(nodeScript);
-
-                this.allScripts[ nodeID ] = nodeScripts;
-            }
-
-            else {
-                this.allScripts[ nodeID ].push(nodeScript);
-            }
-        },
-
-        //ticked: [ /* time */ ],
-        
-    } );
-    
-    // -- getChildByName --------------------------------------------------------------------
-    
-    function getChildByName( node, childName ) {
-        var childNode = undefined;
-        for ( var i = 0; i < node.children.length && childNode === undefined; i++ ) {
-            if ( node.children[i].name == childName ) {
-                childNode = node.children[i];    
-            }
-        }
-        return childNode;
-    };
-
-    function updateCameraProperties () {
-
-        if ( this.currentNodeID == this.activeCameraID ) {
-            if ( !this.intervalTimer ) {
-                var self = this;
-                this.intervalTimer = setInterval( function() { updateProperties.call( self, self.activeCameraID ) }, 200 );
-            }
-        }
-        else {
-            if ( this.intervalTimer ) {
-                clearInterval( this.intervalTimer );
-                this.intervalTimer = 0;
-            } 
-        }
-    }
-
-    function updateProperties( nodeName ) {
-
-        var nodeID = nodeName;
-        var properties = getProperties.call( this, this.kernel, nodeID );
-
-        for ( var i in properties ) { 
-            try {
-                var propertyName = properties[i].prop.name;
-                var propertyValue = JSON.stringify( utility.transform( vwf.getProperty( nodeID, propertyName, [] ), utility.transforms.transit ));
-            } catch ( e ) {
-                this.logger.warnx( "satProperty", nodeID, propertyName, propertyValue, "stringify error:", e.message );
-            }
-
-            if ( propertyValue ) {
-                var nodeIDAttribute = $.encoder.encodeForAlphaNumeric( nodeID ); 
-                var propertyNameAttribute = $.encoder.encodeForHTMLAttribute( "id", propertyName, true );
-                var inputElement$ = $( '#input-' + nodeIDAttribute + '-' + propertyNameAttribute );
-                // Only update if property value input is not in focus
-                // If in focus, change font style to italic
-                if ( ! inputElement$.is(":focus") ) {
-                    inputElement$.val( propertyValue );
-                    inputElement$.css( "font-style", "normal");
-                } else {
-                    inputElement$.css( "font-style", "italic");
-                }  
-            }
-        }
-    }
-    
-    // -- openEditor ------------------------------------------------------------------------
-
-    function openEditor(eView) // invoke with the view as "this"
-    {
-        if(eView == 0)
-        {
-            closeEditor.call(this);
-        }
-        
-        if(this.editorView != eView)
-        {
-            // Hierarchy
-            if(eView == 1)
-            {
-                var topdownName = this.topdownName;
-                var topdownTemp = this.topdownTemp;
-
-                if( !this.currentNodeID )
-                {
-                    this.currentNodeID = vwf_view.kernel.find("", "/")[0];
-                }
-
-                drill.call(this, this.currentNodeID, undefined);
-                $(this.clientList).hide();
-                $(this.timeline).hide();
-                $(this.about).hide();
-                $(this.models).hide();
-
-                if(this.editorOpen)
-                {
-                    $(topdownName).hide();
-                    $(topdownTemp).show();
-                }
-
-                else
-                {
-                    $(topdownTemp).show('slide', {direction: 'right'}, 175);    
-                }
-
-                this.topdownName = topdownTemp;
-                this.topdownTemp = topdownName;
-            }
-
-            else if (this.editingScript)
-            {
-                // Reset width if on script
-                this.editingScript = false;
-                $('#editor').animate({ 'left' : "-260px" }, 175);
-                $('.vwf-tree').animate({ 'width' : "260px" }, 175);
-            }
-
-            // User List
-            if(eView == 2)
-            {
-                $(this.topdownName).hide();
-                $(this.topdownTemp).hide();
-                $(this.timeline).hide();
-                $(this.about).hide();
-                $(this.models).hide();
-                $(this.modelsTemp).hide();
-                showUserList.call(this);
-            }
-
-            // Timeline
-            else if(eView == 3)
-            {
-                $(this.topdownName).hide();
-                $(this.topdownTemp).hide();
-                $(this.clientList).hide();
-                $(this.about).hide();
-                $(this.models).hide();
-                $(this.modelsTemp).hide();
-                showTimeline.call(this);
-            }
-
-            // About
-            else if(eView == 4)
-            {
-                $(this.topdownName).hide();
-                $(this.topdownTemp).hide();
-                $(this.clientList).hide();
-                $(this.timeline).hide();
-                $(this.models).hide();
-                $(this.modelsTemp).hide();
-                showAboutTab.call(this);
-            }
-
-            // Models
-            else if(eView == 5)
-            {
-                var models = this.models;
-                var modelsTemp = this.modelsTemp;
-
-                showModelsTab.call(this, this.currentModelID, this.currentModelURL);
-                $(this.topdownName).hide();
-                $(this.topdownTemp).hide();
-                $(this.clientList).hide();
-                $(this.timeline).hide();
-                $(this.about).hide();
-
-                if(this.editorOpen)
-                {
-                    $(models).hide();
-                    $(modelsTemp).show();
-                }
-
-                else
-                {                
-                    $(modelsTemp).show('slide', {direction: 'right'}, 175);    
-                }
-
-                this.models = modelsTemp;
-                this.modelsTemp = models;
-            }
-
-
-            if(this.editorView == 0)
-            {
-                $('#vwf-root').animate({ 'left' : "-=260px" }, 175);
-                $('#editor').animate({ 'left' : "-260px" }, 175);
-                $('#x').delay(1000).css({ 'display' : 'inline' });
-            }
-
-            this.editorView = eView;
-            this.editorOpen = true;
-        }
-    }
-
-    // -- closeEditor -----------------------------------------------------------------------
-
-    function closeEditor() // invoke with the view as "this"
-    {
-        var topdownName = this.topdownName;
-
-        if (this.editorOpen && this.editorView == 1) // Hierarchy view open
-        {
-            $(topdownName).hide('slide', {direction: 'right'}, 175);
-            $(topdownName).empty();
-            $(this.clientList).hide();
-            $(this.timeline).hide();
-            $(this.about).hide();
-            $(this.models).hide();
-        }
-
-        else if (this.editorOpen && this.editorView == 2) // Client list open
-        {
-            $(this.clientList).hide('slide', {direction: 'right'}, 175);
-            $(topdownName).hide();
-            $(this.timeline).hide();
-            $(this.about).hide();
-            $(this.models).hide();
-        }
-
-        else if (this.editorOpen && this.editorView == 3) // Timeline open
-        {
-            $(this.timeline).hide('slide', {direction: 'right'}, 175);
-            $(topdownName).hide();
-            $(this.clientList).hide();
-            $(this.about).hide();
-            $(this.models).hide();
-        }
-
-        else if (this.editorOpen && this.editorView == 4) // About open
-        {
-            $(this.about).hide('slide', {direction: 'right'}, 175);
-            $(topdownName).hide();
-            $(this.clientList).hide();
-            $(this.timeline).hide();
-            $(this.models).hide();
-        }
-
-        else if (this.editorOpen && this.editorView == 5) // Models open
-        {
-            $(this.models).hide('slide', {direction: 'right'}, 175);
-            $(topdownName).hide();
-            $(this.clientList).hide();
-            $(this.timeline).hide();
-            $(this.about).hide();
-        }
-        
-        $('#vwf-root').animate({ 'left' : "+=260px" }, 175);
-        $('#editor').animate({ 'left' : "0px" }, 175);
-        $('#x').css({ 'display' : 'none' });
-        this.editorView = 0;
-        this.editorOpen = false;
-    }
-
-    // -- showUserList ----------------------------------------------------------------------
-
-    function showUserList() // invoke with the view as "this"
-    {
-        var clientList = this.clientList;
-
-        viewClients.call(this);
-
-        if (!this.editorOpen)
-        {
-            $(clientList).show('slide', {direction: 'right'}, 175);    
-        }
-        else
-        {
-            $(clientList).show();
-        }
-    }
-
-    // -- viewClients -----------------------------------------------------------------------
-
-    function viewClients() {
-        var self = this;
-        var app = window.location.pathname;
-        var pathSplit = app.split('/');
-        if ( pathSplit[0] == "" ) {          
-            pathSplit.shift();
-        }
-        if ( pathSplit[ pathSplit.length - 1 ] == "" ) {
-            pathSplit.pop();
-        }            
-        var instIndex = pathSplit.length - 1;
-        if ( pathSplit.length > 2 ) {
-            if ( pathSplit[ pathSplit.length - 2 ] == "load" ) {
-                instIndex = pathSplit.length - 3;
-            }
-        }
-        if ( pathSplit.length > 3 ) {
-            if ( pathSplit[ pathSplit.length - 3 ] == "load" ) {
-                instIndex = pathSplit.length - 4;
-            }
-        }
-
-        var root = "";
-        for ( var i=0; i < instIndex; i++ ) {
-            if ( root != "" ) {
-                root = root + "/";
-            } 
-            root = root + pathSplit[i];
-        }
-
-        if(root.indexOf('.vwf') != -1) root = root.substring(0, root.lastIndexOf('/'));
-        
-        var clients$ = $(this.clientList);
-        var node = this.nodes[ "http://vwf.example.com/clients.vwf" ];
-
-        clients$.html("<div class='header'>Connected Clients</div>");
-
-        // Add node children
-        clients$.append("<div id='clientsChildren'></div>");
-        for ( var i = 0; i < node.children.length; i++ ) {
-            var nodeChildIDAttribute = $.encoder.encodeForHTMLAttribute("id", node.children[i].ID, true);
-            var nodeChildIDAlpha = $.encoder.encodeForAlphaNumeric(node.children[i].ID);
-            var nodeChildNameHTML = $.encoder.encodeForHTML(node.children[i].name);
-            $('#clientsChildren').append("<div id='" + nodeChildIDAlpha + "' data-nodeID='" + nodeChildIDAttribute + "' class='childContainer'><div class='childEntry'><b>" + nodeChildNameHTML + "</b></div></div>");
-            $('#' + nodeChildIDAlpha).click( function(evt) {
-                viewClient.call(self, $(this).attr("data-nodeID"));
-            });
-        }
-
-        // Login Information
-        clients$.append("<div style='padding:6px'><input class='filename_entry' type='text' id='userName' placeholder='Username' /><!-- <input class='filename_entry' type='password' id='password' placeholder='Password'/> --><input class='update_button' type='button' id='login' value='Login' /></div>"); 
-        clients$.append("<hr/>");
-        $('#userName').keydown( function(evt) {
-            evt.stopPropagation();
-        });
-        $('#userName').keypress( function(evt) {
-            evt.stopPropagation();
-        });
-        $('#userName').keyup( function(evt) {
-            evt.stopPropagation();
-        });
-        $('#password').keydown( function(evt) {
-            evt.stopPropagation();
-        });
-        $('#password').keypress( function(evt) {
-            evt.stopPropagation();
-        });
-        $('#password').keyup( function(evt) {
-            evt.stopPropagation();
-        });
-        $('#login').click(function(evt) {
-            // Future call to validate username and password
-            //login.call(self, $('#userName').val(), $('#password').val());
-
-            var moniker = vwf_view.kernel.moniker();
-            var clients = vwf_view.kernel.findClients("", "/*");
-            var client = undefined;
-            for (var i=0; i < clients.length; i++)
-            {
-                if ( clients[i].indexOf(moniker) != -1 )
-                {
-                    client = clients[i];
-                    break;
-                }
-            }
-            // var client = vwf_view.kernel.findClients("", "/" + moniker)[0];
-            
-            if ( client ) {
-                vwf_view.kernel.setProperty( client, "displayName", $('#userName').val() );
-            }
-        });
-
-        // Save / Load
-        clients$.append("<div style='padding:6px'><input class='filename_entry' type='text' id='fileName' /><input class='update_button' type='button' id='save' value='Save' /></div>");
-        $('#fileName').keydown( function(evt) {
-            evt.stopPropagation();
-        });
-        $('#fileName').keypress( function(evt) {
-            evt.stopPropagation();
-        });
-        $('#fileName').keyup( function(evt) {
-            evt.stopPropagation();
-        });
-        $('#save').click(function(evt) {
-            saveStateAsFile.call(self, $('#fileName').val());
-        });
-
-        clients$.append("<div style='padding:6px'><select class='filename_select' id='fileToLoad' /></select></div>");
-        $('#fileToLoad').append("<option value='none'></option>");
-
-        $.getJSON( "/" + root + "/listallsaves", function( data ) {
-            $.each( data, function( key, value ) {
-                var applicationName = value[ 'applicationpath' ].split( "/" );
-                if ( applicationName.length > 0 ) {
-                    applicationName = applicationName[ applicationName.length - 1 ];
-                }
-                if ( applicationName.length > 0 ) {
-                    applicationName = applicationName.charAt(0).toUpperCase() + applicationName.slice(1);
-                }
-                if ( value['latestsave'] ) {
-                    $('#fileToLoad').append("<option value='"+value['savename']+"' applicationpath='"+value['applicationpath']+"'>"+applicationName+": "+value['savename']+"</option>");
-                }
-                else {
-                    $('#fileToLoad').append("<option value='"+value['savename']+"' applicationpath='"+value['applicationpath']+"' revision='"+value['revision']+"'>"+applicationName+": "+value['savename']+" Rev(" + value['revision'] + ")</option>");
-                }
-            } );
-        } );
-
-        clients$.append("<div style='padding:6px'><input class='update_button' type='button' id='load' value='Load' /></div>");
-        $('#load').click(function(evt) {
-            loadSavedState.call(self, $('#fileToLoad').val(), $('#fileToLoad').find(':selected').attr('applicationpath'), $('#fileToLoad').find(':selected').attr('revision'));
-        });
-    }
-
-    // -- viewClient ------------------------------------------------------------------------
-
-    function viewClient( clientID ) {
-        var self = this;
-
-        var clients$ = $(this.clientList);
-        var node = this.nodes[ clientID ];
-
-        clients$.html("<div class='header'><img src='images/back.png' id='back' alt='back'/> " + $.encoder.encodeForHTML(node.name) + "</div>");
-        $('#back').click ( function(evt) {
-            viewClients.call( self );
-        });
-
-        // Add node properties
-        clients$.append("<div id='clientProperties'></div>");
-        var displayedProperties = {};
-        for ( var i = 0; i < node.properties.length; i++ ) {
-            if ( !displayedProperties[ node.properties[i].name ] ) {
-                displayedProperties[ node.properties[i].name ] = "instance";
-                var nodeIDAlpha = $.encoder.encodeForAlphaNumeric(clientID);
-                var propertyNameAttribute = $.encoder.encodeForHTMLAttribute("id", node.properties[i].name, true);
-                var propertyNameAlpha = $.encoder.encodeForAlphaNumeric(node.properties[i].name);
-                var propertyNameHTML = $.encoder.encodeForHTML(node.properties[i].name);
-                var propertyValueAttribute = $.encoder.encodeForHTMLAttribute("val", node.properties[i].getValue(), true);
-                $('#clientProperties').append("<div id='" + nodeIDAlpha + "-" + propertyNameAlpha + "' class='propEntry'><table><tr><td><b>" + propertyNameHTML + " </b></td><td><input type='text' class='input_text' id='input-" + nodeIDAlpha + "-" + propertyNameAlpha + "' value='" + propertyValueAttribute + "' data-propertyName='" + propertyNameAttribute + "' readonly></td></tr></table></div>");
-            }
-        }
-    }
-
-    // -- drillDown -------------------------------------------------------------------------
-
-    function drillDown(nodeID, drillBackID) // invoke with the view as "this"
-    {
-        var topdownName = this.topdownName;
-        var topdownTemp = this.topdownTemp;
-        
-        drill.call(this, nodeID, drillBackID);
-        
-        if(nodeID != vwf_view.kernel.find("", "/")[0]) $(topdownName).hide('slide', {direction: 'left'}, 175); 
-        $(topdownTemp).show('slide', {direction: 'right'}, 175);    
-        
-        this.topdownName = topdownTemp;
-        this.topdownTemp = topdownName;
-    }
-    
-    // -- drillUp ---------------------------------------------------------------------------
-
-    function drillUp(nodeID) // invoke with the view as "this"
-    {
-        var topdownName = this.topdownName;
-        var topdownTemp = this.topdownTemp;
-        
-        drill.call(this, nodeID, undefined);
-        
-        $(topdownName).hide('slide', {direction: 'right'}, 175); 
-        $(topdownTemp).show('slide', {direction: 'left'}, 175);    
-        
-        this.topdownName = topdownTemp;
-        this.topdownTemp = topdownName;
-    }
-
-    // -- drillBack---------------------------------------------------------------------------
-
-    function drillBack(nodeID) // invoke with the view as "this"
-    {
-        var topdownName = this.topdownName;
-        var topdownTemp = this.topdownTemp;
-        
-        drill.call(this, nodeID, undefined);
-        
-        // No slide motion, when resizing script window back to normal
-        $(topdownName).hide();
-        $(topdownTemp).show();
-        
-        this.topdownName = topdownTemp;
-        this.topdownTemp = topdownName;
-    }
-    
-    // -- drill -----------------------------------------------------------------------------
-
-    function drill(nodeID, drillBackID) // invoke with the view as "this"
-    {
-        var node = this.nodes[ nodeID ];
-
-        if ( !node ) {
-            this.logger.errorx( "drill: Cannot find node '" + nodeID + "'" );
-            return;
-        }
-
-        var self = this;
-        var topdownName = this.topdownName;
-        var topdownTemp = this.topdownTemp;
-        var nodeIDAlpha = $.encoder.encodeForAlphaNumeric(nodeID);
-
-        $(topdownName).html(''); // Clear alternate div first to ensure content is added correctly
-        this.currentNodeID = nodeID;
-
-        if(!drillBackID) drillBackID = node.parentID;
-     
-        if(nodeID == vwf_view.kernel.find("", "/")[0]) 
-        {
-            $(topdownTemp).html("<div class='header'>index</div>");
-        }
-        else
-        {
-            $(topdownTemp).html("<div class='header'><img src='images/back.png' id='" + nodeIDAlpha + "-back' alt='back'/> " + $.encoder.encodeForHTML(node.name) + "</div>");
-            $('#' + nodeIDAlpha + '-back').click ( function(evt) {
-                drillUp.call(self, drillBackID);
-            });
-        }
-
-        // Add node children
-        $(topdownTemp).append("<div id='children'></div>");
-        for ( var i = 0; i < node.children.length; i++ ) {
-            var nodeChildIDAttribute = $.encoder.encodeForHTMLAttribute("id", node.children[i].ID, true);
-            var nodeChildIDAlpha = $.encoder.encodeForAlphaNumeric(node.children[i].ID);
-            $('#children').append("<div id='" + nodeChildIDAlpha + "' data-nodeID='" + nodeChildIDAttribute + "' class='childContainer'><div class='childEntry'><b>" + $.encoder.encodeForHTML(node.children[i].name) + "</b></div></div>");
-            $('#' + nodeChildIDAlpha).click( function(evt) {
-                drillDown.call(self, $(this).attr("data-nodeID"), nodeID);
-            });
-        }
-
-        $('#children > div:last').css('border-bottom-width', '3px');
-
-        // Add prototype children
-        // TODO: Commented out until prototype children inherit from prototypes
-        /*
-        $(topdownTemp).append("<div id='prototypeChildren'></div>");
-        var prototypeChildren = getChildren.call( this, this.kernel, node.extendsID ); 
-        for ( var key in prototypeChildren)       
-        {
-            var child = prototypeChildren[key];
-            var prototypeChildIDAttribute = $.encoder.encodeForHTMLAttribute("id", child.ID, true);
-            var prototypeChildIDAlpha = $.encoder.encodeForAlphaNumeric(child.ID);
-            $('#prototypeChildren').append("<div id='" + prototypeChildIDAlpha + "' data-nodeID='" + prototypeChildIDAttribute + "' class='childContainer'><div class='childEntry'><b>" + $.encoder.encodeForHTML(child.name) + "</b></div></div>");
-            $('#' + prototypeChildIDAlpha).click( function(evt) {
-                drillDown.call(self, $(this).attr("data-nodeID"), nodeID);
-            });
-        } 
-        */   // END TODO:
-        
-        $('#prototypeChildren > div:last').css('border-bottom-width', '3px');
-
-        // Add node properties
-        $(topdownTemp).append("<div id='properties'></div>");
-        var displayedProperties = {};
-        for ( var i = 0; i < node.properties.length; i++ ) {
-            if ( !displayedProperties[ node.properties[i].name ] && node.properties[i].name.indexOf('$') === -1) {
-                displayedProperties[ node.properties[i].name ] = "instance";
-                var propertyNameAttribute = $.encoder.encodeForHTMLAttribute("id", node.properties[i].name, true);
-                var propertyNameAlpha = $.encoder.encodeForAlphaNumeric(node.properties[i].name);
-                var propertyNameHTML = $.encoder.encodeForHTML(node.properties[i].name);
-                var propertyValueAttribute = $.encoder.encodeForHTMLAttribute("val", node.properties[i].getValue(), true);
-                $('#properties').append("<div id='" + nodeIDAlpha + "-" + propertyNameAlpha + "' class='propEntry'><table><tr><td><b>" + propertyNameHTML + " </b></td><td><input type='text' class='input_text' id='input-" + nodeIDAlpha + "-" + propertyNameAlpha + "' value='" + propertyValueAttribute + "' data-propertyName='" + propertyNameAttribute + "'></td></tr></table></div>");
-            
-                $('#input-' + nodeIDAlpha + '-' + propertyNameAttribute).change( function(evt) {
-                    var propName = $.encoder.canonicalize($(this).attr("data-propertyName"));
-                    var propValue = $(this).val();
-                
-                    try {
-                        propValue = JSON.parse($.encoder.canonicalize(propValue));
-                        self.kernel.setProperty(nodeID, propName, propValue);
-                    } catch (e) {
-                        // restore the original value on error
-                        $(this).val(propValue);
-                    }
-                } );
-
-                $('#input-' + nodeIDAlpha + '-' + propertyNameAlpha).keydown( function(evt) {
-                    evt.stopPropagation();
-                });
-
-                $('#input-' + nodeIDAlpha + '-' + propertyNameAlpha).keypress( function(evt) {
-                    evt.stopPropagation();
-                });
-
-                $('#input-' + nodeIDAlpha + '-' + propertyNameAlpha).keyup( function(evt) {
-                    evt.stopPropagation();
-                });
-            }
-        }
-
-        $('#properties > div:last').css('border-bottom-width', '3px');
-
-        this.logger.info(self + "    " + nodeID);
-
-        // Add prototype properties
-        $(topdownTemp).append("<div id='prototypeProperties'></div>");
-        var prototypeProperties = getProperties.call( this, this.kernel, node.extendsID );
-        for ( var key in prototypeProperties ) {
-            var prop = prototypeProperties[key].prop;
-            if ( !displayedProperties[ prop.name ]  ) {
-                displayedProperties[ prop.name ] = prototypeProperties[key].prototype;
-                if(prop.value == undefined)
-                {
-                    prop.value = JSON.stringify( utility.transform( vwf.getProperty( nodeID, prop.name, []), utility.transforms.transit ) );
-                }
-
-                var propertyNameAttribute = $.encoder.encodeForHTMLAttribute("id", prop.name, true);
-                var propertyNameAlpha = $.encoder.encodeForAlphaNumeric(prop.name);
-                var propertyNameHTML = $.encoder.encodeForHTML(prop.name);
-                var propertyValueAttribute = $.encoder.encodeForHTMLAttribute("val", prop.value, true);
-                $('#prototypeProperties').append("<div id='" + nodeIDAlpha + "-" + propertyNameAlpha + "' class='propEntry'><table><tr><td><b>" + propertyNameHTML + " </b></td><td><input type='text' class='input_text' id='input-" + nodeIDAlpha + "-" + propertyNameAlpha + "' value='" + propertyValueAttribute + "' data-propertyName='" + propertyNameAttribute + "'></td></tr></table></div>");
-            
-                $('#input-' + nodeIDAlpha + '-' + propertyNameAlpha).change( function(evt) {
-                    var propName = $.encoder.canonicalize($(this).attr("data-propertyName"));
-                    var propValue = $(this).val();
-                
-                    try {
-                        propValue = JSON.parse($.encoder.canonicalize(propValue));
-                        self.kernel.setProperty(nodeID, propName, propValue);
-                    } catch (e) {
-                        // restore the original value on error
-                        $(this).val(propValue);
-                    }
-                } );
-
-                $('#input-' + nodeIDAlpha + '-' + propertyNameAlpha).keydown( function(evt) {
-                    evt.stopPropagation();
-                });
-
-                $('#input-' + nodeIDAlpha + '-' + propertyNameAlpha).keypress( function(evt) {
-                    evt.stopPropagation();
-                });
-
-                $('#input-' + nodeIDAlpha + '-' + propertyNameAlpha).keyup( function(evt) {
-                    evt.stopPropagation();
-                });
-            }
-        }
-
-        $('#prototypeProperties > div:last').css('border-bottom-width', '3px');
-
-        // Add node methods
-        $(topdownTemp).append("<div id='methods'></div>");
-        for ( var key in node.methods ) {
-            var method = node.methods[key];
-            var methodNameAlpha = $.encoder.encodeForAlphaNumeric(key);
-            var methodNameAttribute = $.encoder.encodeForHTMLAttribute("id", key, true);
-            var methodNameHTML = $.encoder.encodeForHTML(key);
-            $('#methods').append("<div id='" + methodNameAlpha + "' class='methodEntry'><table><tr><td><b>" + methodNameHTML + " </b></td><td style='text-align:right;overflow:visible'><div id='rollover-" + methodNameAlpha + "' style='position:relative;left:12px'><input type='button' class='input_button_call' id='call-" + methodNameAlpha + "' value='Call' data-methodName='" + methodNameAttribute + "'><img id='param-" + methodNameAlpha + "' data-methodName='" + methodNameAttribute + "' src='images/arrow.png' alt='arrow' style='position:relative;top:4px;left:2px;visibility:hidden'></div></td></tr></table></div>");
-            $('#rollover-' + methodNameAlpha).mouseover( function(evt) {
-                $('#param-' + $(this).attr("id").substring(9)).css('visibility', 'visible');
-            });
-            $('#rollover-' + methodNameAlpha).mouseleave( function(evt) {
-                $('#param-' + $(this).attr("id").substring(9)).css('visibility', 'hidden');
-            });
-            $('#call-' + methodNameAlpha).click( function(evt) {
-                self.kernel.callMethod( nodeID, $.encoder.canonicalize($(this).attr("data-methodName")) );
-            });
-            $('#param-' + methodNameAlpha).click( function(evt) {
-                setParams.call(self, $.encoder.canonicalize($(this).attr("data-methodName")), method, nodeID);                
-            });
-        }
-
-        $('#methods > div:last').css('border-bottom-width', '3px');
-
-        // Add prototype methods
-        $(topdownTemp).append("<div id='prototypeMethods'></div>");
-        var prototypeMethods = getMethods.call( this, this.kernel, node.extendsID );
-        for ( var key in prototypeMethods ) {
-            var method = prototypeMethods[key];
-            var prototypeMethodNameAlpha = $.encoder.encodeForAlphaNumeric(key);
-            var prototypeMethodNameAttribute = $.encoder.encodeForHTMLAttribute("id", key, true);
-            var prototypeMethodNameHTML = $.encoder.encodeForHTML(key);
-            $('#prototypeMethods').append("<div id='" + prototypeMethodNameAlpha + "' class='methodEntry'><table><tr><td><b>" + prototypeMethodNameHTML + " </b></td><td style='text-align:right;overflow:visible'><div id='rollover-" + prototypeMethodNameAlpha + "' style='position:relative;left:12px'><input type='button' class='input_button_call' id='call-" + prototypeMethodNameAlpha + "' value='Call' data-methodName='" + prototypeMethodNameAttribute + "'><img id='param-" + prototypeMethodNameAlpha + "' data-methodName='" + prototypeMethodNameAttribute + "' src='images/arrow.png' alt='arrow' style='position:relative;top:4px;left:2px;visibility:hidden'></div></td></tr></table></div>");
-            $('#rollover-' + prototypeMethodNameAlpha).mouseover( function(evt) {
-                $('#param-' + $(this).attr("id").substring(9)).css('visibility', 'visible');
-            });
-            $('#rollover-' + prototypeMethodNameAlpha).mouseleave( function(evt) {
-                $('#param-' + $(this).attr("id").substring(9)).css('visibility', 'hidden');
-            });
-            $('#call-' + prototypeMethodNameAlpha).click( function(evt) {
-                self.kernel.callMethod( nodeID, $.encoder.canonicalize($(this).attr("data-methodName")) );
-            });
-            $('#param-' + prototypeMethodNameAlpha).click( function(evt) {
-                setParams.call(self, $.encoder.canonicalize($(this).attr("data-methodName")), method, nodeID);                
-            });
-        }
-
-        $('#prototypeMethods > div:last').css('border-bottom-width', '3px');
-
-        // Add node events
-        $(topdownTemp).append("<div id='events'></div>");
-        for ( var key in node.events ) {
-            var nodeEvent = node.events[key];
-            var eventNameAlpha = $.encoder.encodeForAlphaNumeric(key);
-            var eventNameAttribute = $.encoder.encodeForHTMLAttribute("id", key, true);
-            var eventNameHTML = $.encoder.encodeForHTML(key);
-            $('#events').append("<div id='" + eventNameAlpha + "' class='methodEntry'><table><tr><td><b>" + eventNameHTML + " </b></td><td style='text-align:right;overflow:visible'><div id='rollover-" + eventNameAlpha + "' style='position:relative;left:12px'><input type='button' class='input_button_call' id='fire-" + eventNameAlpha + "' value='Fire' data-eventName='" + eventNameAttribute + "'><img id='arg-" + eventNameAlpha + "' data-eventName='" + eventNameAttribute + "' src='images/arrow.png' alt='arrow' style='position:relative;top:4px;left:2px;visibility:hidden'></div></td></tr></table></div>");
-            $('#rollover-' + eventNameAlpha).mouseover( function(evt) {
-                $('#arg-' + $(this).attr("id").substring(9)).css('visibility', 'visible');
-            });
-            $('#rollover-' + eventNameAlpha).mouseleave( function(evt) {
-                $('#arg-' + $(this).attr("id").substring(9)).css('visibility', 'hidden');
-            });
-            $('#fire-' + eventNameAlpha).click( function(evt) {
-                self.kernel.fireEvent( nodeID, $.encoder.canonicalize($(this).attr("data-eventName")) );
-            });
-            $('#arg-' + eventNameAlpha).click( function(evt) {
-                setArgs.call(self, $.encoder.canonicalize($(this).attr("data-eventName")), nodeEvent, nodeID); 
-            });
-        }
-
-        $('#events > div:last').css('border-bottom-width', '3px');
-
-        // Add prototype events
-        $(topdownTemp).append("<div id='prototypeEvents'></div>");
-        var prototypeEvents = getEvents.call( this, this.kernel, node.extendsID );
-        for ( var key in prototypeEvents ) {
-            var nodeEvent = prototypeEvents[key];
-            var prototypeEventNameAlpha = $.encoder.encodeForAlphaNumeric(key);
-            var prototypeEventNameAttribute = $.encoder.encodeForHTMLAttribute("id", key, true);
-            var prototypeEventNameHTML = $.encoder.encodeForHTML(key);
-            $('#prototypeEvents').append("<div id='" + prototypeEventNameAlpha + "' class='methodEntry'><table><tr><td><b>" + prototypeEventNameHTML + " </b></td><td style='text-align:right;overflow:visible'><div id='rollover-" + prototypeEventNameAlpha + "' style='position:relative;left:12px'><input type='button' class='input_button_call' id='fire-" + prototypeEventNameAlpha + "' value='Fire' data-eventName='" + prototypeEventNameAttribute + "'><img id='arg-" + prototypeEventNameAlpha + "' data-eventName='" + prototypeEventNameAttribute + "' src='images/arrow.png' alt='arrow' style='position:relative;top:4px;left:2px;visibility:hidden'></div></td></tr></table></div>");
-            $('#rollover-' + prototypeEventNameAlpha).mouseover( function(evt) {
-                $('#arg-' + $(this).attr("id").substring(9)).css('visibility', 'visible');
-            });
-            $('#rollover-' + prototypeEventNameAlpha).mouseleave( function(evt) {
-                $('#arg-' + $(this).attr("id").substring(9)).css('visibility', 'hidden');
-            });
-            $('#fire-' + prototypeEventNameAlpha).click( function(evt) {
-                self.kernel.fireEvent( nodeID, $.encoder.canonicalize($(this).attr("data-eventName")) );
-            });
-            $('#arg-' + prototypeEventNameAlpha).click( function(evt) {
-                setArgs.call(self, $.encoder.canonicalize($(this).attr("data-eventName")), nodeEvent, nodeID); 
-            });
-        }
-
-        $('#prototypeEvents > div:last').css('border-bottom-width', '3px');
-
-        // Add node behaviors
-        $(topdownTemp).append("<div id='behaviors'></div>");
-        for ( var i = 0; i < node.implementsIDs.length; i++ ) {
-            var nodeImplementsIDAlpha = $.encoder.encodeForAlphaNumeric(node.implementsIDs[i]);
-            var nodeImplementsIDHTML = $.encoder.encodeForHTML(node.implementsIDs[i]);
-            $('#behaviors').append("<div class='propEntry'><table><tr><td style='width:92%'><b>" + nodeImplementsIDHTML + "</b></td><td><input id='" + nodeImplementsIDAlpha + "-enable' type='checkbox' checked='checked' disabled='disabled' /></td></tr></table></div>");
-
-            /* 
-            //Placeholder to Enable/Disable behaviors
-            $('#' + node.implementsID[i] + '-enable').change( function(evt) {
-            
-            }); 
-            */
-        }
-
-        $('#behaviors > div:last').css('border-bottom-width', '3px');
-
-        // Add prototype behaviors
-        $(topdownTemp).append("<div id='prototypeBehaviors'></div>");
-        var prototypeNode = this.nodes[ node.extendsID ];
-        for ( var i=0; i < prototypeNode.implementsIDs.length; i++)
-        {
-            var prototypeImplementsIDAlpha = $.encoder.encodeForAlphaNumeric(prototypeNode.implementsIDs[i]);
-            var prototypeImplementsIDHTML = $.encoder.encodeForHTML(prototypeNode.implementsIDs[i]);
-            $('#prototypeBehaviors').append("<div class='propEntry'><table><tr><td style='width:92%'><b>" + prototypeImplementsIDHTML + "</b></td><td><input id='" + prototypeImplementsIDAlpha + "-enable' type='checkbox' checked='checked' disabled='disabled' /></td></tr></table></div>");
-        }
-
-        $('#prototypeBehaviors > div:last').css('border-bottom-width', '3px');
-
-        // Create new script
-        $(topdownTemp).append("<div id='createScript'></div>");
-        $('#createScript').append("<div class='childContainer'><div class='childEntry'><b>New Script</div></div>");
-        $('#createScript').click( function (evt) {
-            createScript.call(self, nodeID);
-        });
-        $('#createScript > div:last').css('border-bottom-width', '3px');
-
-        if ( this.allScripts[ nodeID ] !== undefined ) {
-            // Add node scripts
-            $(topdownTemp).append("<div id='scripts'></div>");
-            for( var i=0; i < this.allScripts[ nodeID ].length; i++ )
-            {
-                var scriptFull = this.allScripts[nodeID][i].text;
-                if(scriptFull != undefined)
-                {
-                    var scriptName = scriptFull.substring(0, scriptFull.indexOf('='));
-                    $('#scripts').append("<div id='script-" + nodeIDAlpha + "-" + i + "' class='childContainer'><div class='childEntry'><b>script </b>" + scriptName + "</div></div>");
-                    $('#script-' + nodeIDAlpha + "-" + i).click( function(evt) {
-                        var scriptID = $(this).attr("id").substring($(this).attr("id").lastIndexOf('-')+1);
-                        viewScript.call(self, nodeID, scriptID, undefined);
-                    });
-                }
-            }
-
-            $('#scripts > div:last').css('border-bottom-width', '3px');
-        }
-
-        if ( this.allScripts[ node.extendsID ] !== undefined ) {
-            // Add prototype scripts
-            $(topdownTemp).append("<div id='prototypeScripts'></div>");
-            for( var i=0; i < this.allScripts[ node.extendsID ].length; i++ )
-            {
-                var scriptFull = this.allScripts[node.extendsID][i].text;
-                if(scriptFull != undefined)
-                {
-                    var nodeExtendsIDAlpha = $.encoder.encodeForAlphaNumeric(node.extendsID);
-                    var nodeExtendsIDAttribute = $.encoder.encodeForHTMLAttribute("id", node.extendsID, true);
-                    var scriptName = scriptFull.substring(0, scriptFull.indexOf('='));
-                    $('#prototypeScripts').append("<div id='script-" + nodeExtendsIDAlpha + "-" + i + "' class='childContainer' data-nodeExtendsID='" + nodeExtendsIDAttribute + "'><div class='childEntry'><b>script </b>" + scriptName + "</div></div>");
-                    $('#script-' + nodeExtendsIDAlpha + "-" + i).click( function(evt) {
-                        var extendsId = $.encoder.canonicalize($(this).attr("data-nodeExtendsID"));
-                        var scriptID = $(this).attr("id").substring($(this).attr("id").lastIndexOf('-')+1);
-                        viewScript.call(self, nodeID, scriptID, extendsId);
-                    });
-                }
-            }
-
-            $('#prototypeScripts > div:last').css('border-bottom-width', '3px');
-        }
-        updateCameraProperties.call(self);
-    }
-
-    // -- createScript ----------------------------------------------------------------------
-
-    function createScript (nodeID) // invoke with the view as "this"
-    {
-        var self = this;
-        var topdownName = this.topdownName;
-        var topdownTemp = this.topdownTemp;
-        var allScripts = this.allScripts;
-
-        var nodeIDAlpha = $.encoder.encodeForAlphaNumeric(nodeID);
-        
-        $(topdownTemp).html("<div class='header'><img src='images/back.png' id='script-" + nodeIDAlpha + "-back' alt='back'/> script</div>");
-        $('#script-' + nodeIDAlpha + '-back').click ( function(evt) {
-            self.editingScript = false;
-            drillBack.call(self, nodeID);
-
-            // Return editor to normal width
-            $('#editor').animate({ 'left' : "-260px" }, 175);
-            $('.vwf-tree').animate({ 'width' : "260px" }, 175);
-        });
-
-        $(topdownTemp).append("<div class='scriptEntry'><pre class='scriptCode'><textarea id='newScriptArea' class='scriptEdit' spellcheck='false' wrap='off'></textarea></pre><input class='update_button' type='button' id='create-" + nodeIDAlpha + "' value='Create' /></div><hr>");
-        $("#create-" + nodeIDAlpha).click ( function(evt) {
-            self.kernel.execute( nodeID, $("#newScriptArea").val() );
-        });
-        $('#newScriptArea').focus( function(evt) { 
-            // Expand the script editor
-            self.editingScript = true;
-            $('#editor').animate({ 'left' : "-500px" }, 175);
-            $('.vwf-tree').animate({ 'width' : "500px" }, 175);
-        });
-        $('#newScriptArea').keydown( function(evt) { 
-            evt.stopPropagation();
-        });
-
-        $(topdownName).hide();
-        $(topdownTemp).show();
-        
-        this.topdownName = topdownTemp;
-        this.topdownTemp = topdownName;
-    }
-
-    // -- viewScript ------------------------------------------------------------------------
-
-    function viewScript (nodeID, scriptID, extendsID) // invoke with the view as "this"
-    {
-        var self = this;
-        var topdownName = this.topdownName;
-        var topdownTemp = this.topdownTemp;
-        var allScripts = this.allScripts;
-
-        var nodeIDAlpha = $.encoder.encodeForAlphaNumeric(nodeID);
-        
-        $(topdownTemp).html("<div class='header'><img src='images/back.png' id='script-" + nodeIDAlpha + "-back' alt='back'/> script</div>");
-        $('#script-' + nodeIDAlpha + '-back').click ( function(evt) {
-            self.editingScript = false;
-            drillBack.call(self, nodeID);
-
-            // Return editor to normal width
-            $('#editor').animate({ 'left' : "-260px" }, 175);
-            $('.vwf-tree').animate({ 'width' : "260px" }, 175);
-        });
-
-        if(extendsID) {
-            nodeID = extendsID;
-            nodeIDAlpha = $.encoder.encodeForAlphaNumeric(extendsID);
-        }
-
-        var scriptText = self.allScripts[nodeID][scriptID].text;
-        if(scriptText != undefined)
-        {
-            $(topdownTemp).append("<div class='scriptEntry'><pre class='scriptCode'><textarea id='scriptTextArea' class='scriptEdit' spellcheck='false' wrap='off'>" + scriptText + "</textarea></pre><input class='update_button' type='button' id='update-" + nodeIDAlpha + "-" + scriptID + "' value='Update' /></div><hr>");
-            $("#update-" + nodeIDAlpha + "-" + scriptID).click ( function(evt) {
-                var s_id = $(this).attr("id").substring($(this).attr("id").lastIndexOf('-') + 1);
-                self.allScripts[nodeID][s_id].text = undefined;
-                self.kernel.execute( nodeID, $("#scriptTextArea").val() );
-            });
-            $('#scriptTextArea').focus( function(evt) { 
-                // Expand the script editor
-                self.editingScript = true;
-                $('#editor').animate({ 'left' : "-500px" }, 175);
-                $('.vwf-tree').animate({ 'width' : "500px" }, 175);
-            });
-            $('#scriptTextArea').keydown( function(evt) { 
-                evt.stopPropagation();
-            });
-        }
-        
-        $(topdownName).hide();
-        $(topdownTemp).show();
-        
-        this.topdownName = topdownTemp;
-        this.topdownTemp = topdownName;
-    }
-
-    // -- setParams -------------------------------------------------------------------------
-
-    function setParams (methodName, methodParams, nodeID) // invoke with the view as "this"
-    {
-        var self = this;
-        var topdownName = this.topdownName;
-        var topdownTemp = this.topdownTemp;
-
-        var methodNameAlpha = $.encoder.encodeForAlphaNumeric(methodName);
-        var methodNameHTML = $.encoder.encodeForHTML(methodName);
-     
-        $(topdownTemp).html("<div class='header'><img src='images/back.png' id='" + methodNameAlpha + "-back' alt='back'/> " + methodNameHTML + "<input type='button' class='input_button_call' id='call' value='Call' style='float:right;position:relative;top:5px;right:33px'></input></div>");
-        $('#' + methodNameAlpha + '-back').click ( function(evt) {
-            
-            drillUp.call(self, nodeID);
-        });
-
-        for(var i=1; i<=16; i++)
-        {
-            $(topdownTemp).append("<div id='param" + i + "' class='propEntry'><table><tr><td><b>Parameter " + i + ": </b></td><td><input type='text' class='input_text' id='input-param" + i + "'></td></tr></table></div>");
-            $('#input-param'+ i).keydown( function(evt) {
-                    evt.stopPropagation();
-                });
-            $('#input-param'+ i).keypress( function(evt) {
-                evt.stopPropagation();
-            });
-            $('#input-param'+ i).keyup( function(evt) {
-                evt.stopPropagation();
-            });
-        }
-
-        $('#call').click ( function (evt) {
-
-            var parameters = new Array();
-            for(var i=1; i<=16; i++)
-            {
-                if( $('#input-param'+ i).val() )
-                {
-                    var prmtr = $('#input-param'+ i).val();
-                    try {
-                        prmtr = JSON.parse(JSON.stringify($.encoder.canonicalize(prmtr)));
-                        parameters.push( prmtr );
-                    } catch (e) {
-                        self.logger.error('Invalid Value');
-                    }
-                }
-            }
-
-            self.kernel.callMethod(nodeID, methodName, parameters);
-        });
-
-        $(topdownName).hide('slide', {direction: 'left'}, 175); 
-        $(topdownTemp).show('slide', {direction: 'right'}, 175);    
-
-        this.topdownName = topdownTemp;
-        this.topdownTemp = topdownName;
-    }
-
-    // -- setArgs ---------------------------------------------------------------------------
-
-    function setArgs (eventName, eventArgs, nodeID) // invoke with the view as "this"
-    {
-        var self = this;
-        var topdownName = this.topdownName;
-        var topdownTemp = this.topdownTemp;
-
-        var eventNameAlpha = $.encoder.encodeForAlphaNumeric(eventName);
-        var eventNameHTML = $.encoder.encodeForHTML(eventName);
-     
-        $(topdownTemp).html("<div class='header'><img src='images/back.png' id='" + eventNameAlpha + "-back' alt='back'/> " + eventNameHTML + "<input type='button' class='input_button_call' id='fire' value='Fire' style='float:right;position:relative;top:5px;right:33px'></input></div>");
-        $('#' + eventNameAlpha + '-back').click ( function(evt) {
-            drillUp.call(self, nodeID);
-        });
-
-        for(var i=1; i<=8; i++)
-        {
-            $(topdownTemp).append("<div id='arg" + i + "' class='propEntry'><table><tr><td><b>Argument " + i + ": </b></td><td><input type='text' class='input_text' id='input-arg" + i + "'></td></tr></table></div>");
-            $('#input-arg'+ i).keydown( function(evt) {
-                    evt.stopPropagation();
-                });
-            $('#input-arg'+ i).keypress( function(evt) {
-                evt.stopPropagation();
-            });
-            $('#input-arg'+ i).keyup( function(evt) {
-                evt.stopPropagation();
-            });
-        }
-
-        $(topdownTemp).append("<div style='font-weight:bold;text-align:right;padding-right:10px'></div>");
-        $('#fire').click ( function (evt) {
-
-            var args = new Array();
-            for(var i=1; i<=8; i++)
-            {
-                if( $('#input-arg'+ i).val() )
-                {
-                    var arg = $('#input-arg'+ i).val();
-                    try {
-                        arg = JSON.parse($.encoder.canonicalize(arg));
-                        args.push( arg );
-                    } catch (e) {
-                        self.logger.error('Invalid Value');
-                    }
-                }
-            }
-
-            self.kernel.fireEvent(nodeID, eventName, args);
-        });
-
-        $(topdownName).hide('slide', {direction: 'left'}, 175); 
-        $(topdownTemp).show('slide', {direction: 'right'}, 175);    
-
-        this.topdownName = topdownTemp;
-        this.topdownTemp = topdownName;
-
-    }
-
-    function getPrototypes( kernel, extendsID ) {
-        var prototypes = [];
-        var id = extendsID;
-
-        while ( id !== undefined ) {
-            prototypes.push( id );
-            id = kernel.prototype( id );
-        }
-                
-        return prototypes;
-    }
-
-    function createProperty( node, propertyName, propertyValue ) {
-        var property = {
-            name: propertyName,
-            rawValue: propertyValue,
-            value: undefined,
-            getValue: function() {
-                var propertyValue;
-                if ( this.value == undefined ) {
-                    try {
-                        propertyValue = utility.transform( this.rawValue, utility.transforms.transit );
-                        this.value = JSON.stringify( propertyValue );
-                    } catch (e) {
-                        this.logger.warnx( "createdProperty", nodeID, this.propertyName, this.rawValue,
-                            "stringify error:", e.message );
-                        this.value = this.rawValue;
-                    }
-                }
-                return this.value;
-            }
-        };
-
-        return property;
-    }
-
-
-    function getProperties( kernel, extendsID ) {
-        var pTypes = getPrototypes( kernel, extendsID );
-        var pProperties = {};
-        if ( pTypes ) {
-            for ( var i=0; i < pTypes.length; i++ ) {
-                var nd = this.nodes[ pTypes[i] ];
-                if ( nd && nd.properties ) {
-                    for ( var key in nd.properties ) {
-                        pProperties[ key ] = { "prop": nd.properties[ key ], "prototype": pTypes[i]  };
-                    }
-                }
-            }
-        }
-        return pProperties;
-    }
-
-    function getChildren( kernel, extendsID ) {
-        var pTypes = getPrototypes( kernel, extendsID );
-        var pChildren = {};
-        if ( pTypes ) {
-            for ( var i=0; i < pTypes.length; i++ ) {
-                var nd = this.nodes[ pTypes[i] ];
-                if ( nd && nd.children ) {
-                    for ( var key in nd.children ) {
-                        pChildren[ key ] = nd.children[key];
-                    }
-                }
-            }
-        }
-        return pChildren;
-    }
-
-    function getEvents( kernel, extendsID ) {
-        var pTypes = getPrototypes( kernel, extendsID );
-        var events = {};
-        if ( pTypes ) {
-            for ( var i = 0; i < pTypes.length; i++ ) {
-                var nd = this.nodes[ pTypes[i] ];
-                if  ( nd && nd.events ) {
-                    for ( var key in nd.events ) {
-                        events[ key ] = nd.events[key];
-                    }
-                }
-            }
-        }
-        return events;
-    }
-
-    function getMethods( kernel, extendsID ) {
-        var pTypes = getPrototypes( kernel, extendsID );
-        var methods = {};
-        if ( pTypes ) {
-            for ( var i = 0; i < pTypes.length; i++ ) {
-                var nd = this.nodes[ pTypes[i] ];
-                if  ( nd && nd.methods ) {
-                    for ( var key in nd.methods ) {
-                        methods[ key ] = nd.methods[key];
-                    }
-                }
-            }
-        }
-        return methods;
-    }
-
-    function highlightChildInHierarchy(nodeID) {
-        if (this.editorOpen && this.editorView == 1) // Hierarchy view open
-        {
-            var childDiv = $("div[id='" + nodeID +"']");
-            if(childDiv.length > 0) {
-                var previousChild = $("div[id='" + this.highlightedChild +"']");
-                if(previousChild.length > 0) {
-                    previousChild.removeClass('childContainerHighlight');
-                }
-                childDiv.addClass('childContainerHighlight');
-                this.highlightedChild = nodeID;
-            }
-        }
-    }
-
-    // -- showTimeline ----------------------------------------------------------------------
-
-    function showTimeline() // invoke with the view as "this"
-    {
-        var timeline = this.timeline;
-
-        if(!this.timelineInit)
-        {
-            $('#time_control').append("<div class='header'>Timeline</div>" + 
-                "<div style='text-align:center;padding-top:10px'><span><button id='play'></button><button id='stop'></button></span>" +
-                "<span><span class='rate slider'></span>&nbsp;" + 
-                "<span class='rate vwf-label' style='display: inline-block; width:8ex'></span></span></div>");
-
-            var options = {};
-
-            [ "play", "pause", "stop" ].forEach( function( state ) {
-                options[state] = { icons: { primary: "ui-icon-" + state }, label: state, text: false };
-            } );
-
-            options.rate = { value: 0, min: -2, max: 2, step: 0.1, };
-
-            var state = {};
-
-            $.get(
-                "admin/state", 
-                undefined, 
-                function( data ) {
-                    state = data;
-
-                    $( "button#play" ).button( "option", state.playing ? options.pause : options.play );
-                    $( "button#stop" ).button( "option", "disabled", state.stopped );
-
-                    $( ".rate.slider" ).slider( "value", Math.log( state.rate ) / Math.LN10 );
-
-                    if ( state.rate < 1.0 ) {
-                        var label_rate = 1.0 / state.rate;
-                    } 
-                    else {
-                        var label_rate = state.rate;
-                    }
-
-                    var label = label_rate.toFixed(2).toString().replace( /(\.\d*?)0+$/, "$1" ).replace( /\.$/, "" );
-
-                    if ( state.rate < 1.0 ) {
-                        label = "&#x2215; " + label;
-                    } else {
-                        label = label + " &times;";
-                    }
-
-                    $( ".rate.vwf-label" ).html( label );
-                }, 
-                "json" 
-            );
-
-            $( "button#play" ).button(
-                options.pause
-            ). click( function() {
-                $.post(
-                    state.playing ? "admin/pause" : "admin/play", 
-                    undefined, 
-                    function( data ) {
-                        state = data;
-
-                        $( "button#play" ).button( "option", state.playing ? options.pause : options.play );
-                        $( "button#stop" ).button( "option", "disabled", state.stopped );
-                    },
-                    "json" 
-                );
-            } );
-
-
-            $( "button#stop" ).button(
-                options.stop
-            ). click( function() {
-                $.post(
-                    "admin/stop", 
-                    undefined, 
-                    function( data ) {
-                        state = data;
-
-                        $( "button#play" ).button( "option", state.playing ? options.pause : options.play );
-                        $( "button#stop" ).button( "option", "disabled", state.stopped );
-                    }, 
-                    "json" 
-                );
-            } );
-
-            $( ".rate.slider" ).slider(
-                options.rate
-            ) .bind( "slide", function( event, ui ) {
-                $.get( 
-                    "admin/state", 
-
-                    { "rate": Math.pow( 10, Number(ui.value) ) }, 
-
-                    function( data ) {
-                        state = data;
-
-                        $( ".rate.slider" ).slider( "value", Math.log( state.rate ) / Math.LN10 );
-
-                        if ( state.rate < 1.0 ) {
-                            var label_rate = 1.0 / state.rate;
-                        } 
-                        else {
-                            var label_rate = state.rate;
-                        }
-
-                        var label = label_rate.toFixed(2).toString().replace( /(\.\d*?)0+$/, "$1" ).replace( /\.$/, "" );
-
-                        if ( state.rate < 1.0 ) {
-                            label = "&#x2215; " + label;
-                        } else {
-                            label = label + " &times;";
-                        }
-
-                        $( ".rate.vwf-label" ).html( label );
-                    }, 
-                    "json"
-                );
-            } );
-
-            this.timelineInit = true;
-        }
-
-        if (!this.editorOpen)
-        {
-            $(timeline).show('slide', {direction: 'right'}, 175);    
-        }
-        else
-        {
-            $(timeline).show();
-        }
-    }
-
-        // -- showAboutTab ----------------------------------------------------------------------
-
-    function showAboutTab() // invoke with the view as "this"
-    {
-        var about = this.about;
-
-        if(!this.aboutInit)
-        {
-            $('#about_tab').append("<div class='header'>About</div>" + 
-                "<div class='about'><p style='font:bold 12pt Arial'>Virtual World Framework</p>" +
-                "<p><b>Version: </b>" + version.toString() + "</p>" +
-                "<p><b>Site: </b><a href='http://virtualworldframework.com' target='_blank'>http://virtualworldframework.com</a></p>" +
-                "<p><b>Source: </b><a href='https://github.com/virtual-world-framework' target='_blank'>https://github.com/virtual-world-framework</a></p></div>");
-
-            this.aboutInit = true;
-        }
-
-        if (!this.editorOpen)
-        {
-            $(about).show('slide', {direction: 'right'}, 175);    
-        }
-        else
-        {
-            $(about).show();
-        }
-    }
-
-    //  -- showModelsTab ----------------------------------------------------------------------
-
-    function showModelsTab(modelID, modelURL) // invoke with the view as "this"
-    {
-        var self = this;
-        var models = this.models;
-        var modelsTemp = this.modelsTemp;
-        this.currentModelID = modelID;
-        this.currentModelURL = modelURL;
-
-        $(models).html("");
-        
-        if(modelID == "") {
-            $(modelsTemp).html("<div class='header'>Models</div>");
-
-            $.getJSON("admin/models", function( data ) {
-                if(data.length > 0) {
-                    $.each( data, function( key, value ) {
-                        var fileName = encodeURIComponent(value['basename']);
-                        var divId = fileName;
-                        if(divId.indexOf('.') != -1) {
-                            divId = divId.replace(/\./g, "_");
-                        }
-                        var url = value['url'];
-
-                        $(modelsTemp).append("<div class='childContainer'><div id='" + divId + "' class='modelEntry' data-url='" + url + "'>"
-                            + fileName + "</div></div>");
-                        $("#" + divId).click(function(e) {
-                            modelDrillDown.call(self, e.target.textContent, e.target.getAttribute("data-url"));
-                        })
-                    });
-                }
-                else {
-                    $(modelsTemp).append("<div class='childEntry'><p style='font:bold 12pt Arial'>No Models Found</p></div>");
-                }
-            } );
-        }
-        else {
-            var divId = modelID;
-            if(divId.indexOf('.') != -1) {
-                divId = divId.replace(/\./g, "_");
-            }
-            $(modelsTemp).html("<div id='" + divId + "-backDiv' class='header'><img src='images/back.png' id='" + divId + "-back' alt='back'/>" + modelID + "</div>");
-            $("#" + divId + "-back").click(function(e) {
-                modelDrillUp.call(self, '');
-            });
-
-            $(modelsTemp).append("<div id='" + divId + "-rotation' class='propEntry'><table><tr><td><b>Rotation</b></td><td>" +
-                "<input type='text' class='input_text' id='input-" + divId + "-rotation' value='[1,0,0,0]'></td></tr></table></div>");
-            $('#input-' + divId + '-rotation').keydown( function(evt) {
-                evt.stopPropagation();
-            });
-            $('#input-' + divId + '-rotation').keypress( function(evt) {
-                evt.stopPropagation();
-            });
-            $('#input-' + divId + '-rotation').keyup( function(evt) {
-                evt.stopPropagation();
-            });
-
-            $(modelsTemp).append("<div id='" + divId + "-scale' class='propEntry'><table><tr><td><b>Scale</b></td><td>" +
-                "<input type='text' class='input_text' id='input-" + divId + "-scale' value='[1,1,1]'></td></tr></table></div>");
-            $('#input-' + divId + '-scale').keydown( function(evt) {
-                    evt.stopPropagation();
-                });
-            $('#input-' + divId + '-scale').keypress( function(evt) {
-                evt.stopPropagation();
-            });
-            $('#input-' + divId + '-scale').keyup( function(evt) {
-                evt.stopPropagation();
-            });
-
-            $(modelsTemp).append("<div id='" + divId + "-translation' class='propEntry'><table><tr><td><b>Translation Offset</b></td><td>" +
-                "<input type='text' class='input_text' id='input-" + divId + "-translation' value='[0,0,0]'></td></tr></table></div>");
-            $('#input-' + divId + '-translation').keydown( function(evt) {
-                    evt.stopPropagation();
-                });
-            $('#input-' + divId + '-translation').keypress( function(evt) {
-                evt.stopPropagation();
-            });
-            $('#input-' + divId + '-translation').keyup( function(evt) {
-                evt.stopPropagation();
-            });
-
-            $(modelsTemp).append("<div class='drag'><div id='" + divId + "-drag' class='modelEntry' draggable='true' data-escaped-name='" + divId +"' data-url='" + modelURL + "'>Drag To Create</div></div>");
-
-            $("#" + divId + "-drag").on("dragstart", function (e) {
-                var fileName = $("#" + e.target.getAttribute("data-escaped-name") + "-backDiv").text();
-                var rotation = encodeURIComponent($("#input-" + e.target.getAttribute("data-escaped-name") + "-rotation").val());
-                var scale = encodeURIComponent($("#input-" + e.target.getAttribute("data-escaped-name") + "-scale").val());
-                var translation = encodeURIComponent($("#input-" + e.target.getAttribute("data-escaped-name") + "-translation").val());
-                var fileData = "{\"fileName\":\""+fileName+"\", \"fileUrl\":\""+e.target.getAttribute("data-url")+"\", " +
-                    "\"rotation\":\"" + rotation + "\", \"scale\":\"" + scale + "\", \"translation\":\"" + translation + "\"}";
-                e.originalEvent.dataTransfer.setData('text/plain', fileData);
-                e.originalEvent.dataTransfer.setDragImage(e.target, 0, 0);
-                return true;
-            });
-        }
-    }
-
-    // -- Model drillDown -------------------------------------------------------------------------
-
-    function modelDrillDown(modelID, modelURL) // invoke with the view as "this"
-    {
-        var models = this.models;
-        var modelsTemp = this.modelsTemp;
-        
-        showModelsTab.call(this, modelID, modelURL);
-        
-        if(modelID != "") $(models).hide('slide', {direction: 'left'}, 175); 
-        $(modelsTemp).show('slide', {direction: 'right'}, 175);    
-        
-        this.models = modelsTemp;
-        this.modelsTemp = models;
-    }
-    
-    // -- Model drillUp ---------------------------------------------------------------------------
-
-    function modelDrillUp(modelID) // invoke with the view as "this"
-    {
-        var models = this.models;
-        var modelsTemp = this.modelsTemp;
-        
-        showModelsTab.call(this, modelID);
-        
-        $(models).hide('slide', {direction: 'right'}, 175); 
-        $(modelsTemp).show('slide', {direction: 'left'}, 175);    
-        
-        this.models = modelsTemp;
-        this.modelsTemp = models;
-    }
-
-    // -- SaveStateAsFile -------------------------------------------------------------------------
-
-    function saveStateAsFile(filename) // invoke with the view as "this"
-    {
-        this.logger.info("Saving: " + filename);
-
-        if(supportAjaxUploadWithProgress.call(this))
-        {
-            var xhr = new XMLHttpRequest();
-
-            // Save State Information
-            var state = vwf.getState();
-
-            var timestamp = state["queue"].time;
-            timestamp = Math.round(timestamp * 1000);
-
-            var objectIsTypedArray = function( candidate ) {
-                var typedArrayTypes = [
-                    Int8Array,
-                    Uint8Array,
-                    // Uint8ClampedArray,
-                    Int16Array,
-                    Uint16Array,
-                    Int32Array,
-                    Uint32Array,
-                    Float32Array,
-                    Float64Array
-                ];
-
-                var isTypedArray = false;
-
-                if ( typeof candidate == "object" && candidate != null ) {
-                    typedArrayTypes.forEach( function( typedArrayType ) {
-                        isTypedArray = isTypedArray || candidate instanceof typedArrayType;
-                    } );
-                }
-
-                return isTypedArray;
-            };
-
-            var transitTransformation = function( object ) {
-                return objectIsTypedArray( object ) ?
-                    Array.prototype.slice.call( object ) : object;
-            };
-
-            var json = JSON.stringify(
-                require("vwf/utility").transform(
-                    state, transitTransformation
-                )
-            );
-
-            json = $.encoder.encodeForURL(json);
-
-            var path = window.location.pathname;
-            var pathSplit = path.split('/');
-            if ( pathSplit[0] == "" ) {          
-                pathSplit.shift();
-            }
-            if ( pathSplit[ pathSplit.length - 1 ] == "" ) {
-                pathSplit.pop();
-            }            
-            var inst = undefined;
-            var instIndex = pathSplit.length - 1;
-            if ( pathSplit.length > 2 ) {
-                if ( pathSplit[ pathSplit.length - 2 ] == "load" ) {
-                    instIndex = pathSplit.length - 3;
-                }
-            }
-            if ( pathSplit.length > 3 ) {
-                if ( pathSplit[ pathSplit.length - 3 ] == "load" ) {
-                    instIndex = pathSplit.length - 4;
-                }
-            }
-            inst = pathSplit[ instIndex ];
-
-            var root = "";
-            for ( var i=0; i < instIndex; i++ ) {
-                if ( root != "" ) {
-                    root = root + "/";
-                } 
-                root = root + pathSplit[i];
-            }
-
-            if(filename == '') filename = inst;
-
-            if(root.indexOf('.vwf') != -1) root = root.substring(0, root.lastIndexOf('/'));
-
-            xhr.open("POST", "/"+root+"/save/"+filename, true);
-            xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
-            xhr.send("root="+root+"/"+filename+"&filename=saveState&inst="+inst+"&timestamp="+timestamp+"&extension=.vwf.json"+"&jsonState="+json);
-
-            // Save Config Information
-            var config = {"info":{}, "model":{}, "view":{} };
-
-            // Save browser title
-            config["info"]["title"] = $('title').html();
-
-            // Save model drivers
-            Object.keys(vwf_view.kernel.kernel.models).forEach(function(modelDriver) {
-                if(modelDriver.indexOf('vwf/model/') != -1) config["model"][modelDriver] = "";
-            });
-
-            // If neither glge or threejs model drivers are defined, specify nodriver
-            if(config["model"]["vwf/model/glge"] === undefined && config["model"]["vwf/model/threejs"] === undefined) config["model"]["nodriver"] = "";
-
-            // Save view drivers and associated parameters, if any
-            Object.keys(vwf_view.kernel.kernel.views).forEach(function(viewDriver) {
-                if(viewDriver.indexOf('vwf/view/') != -1)
-                {
-                    if( vwf_view.kernel.kernel.views[viewDriver].parameters )
-                    {
-                        config["view"][viewDriver] = vwf_view.kernel.kernel.views[viewDriver].parameters;
-                    }
-                    else config["view"][viewDriver] = "";
-                }
-            });
-
-            var jsonConfig = $.encoder.encodeForURL( JSON.stringify( config ) );
-
-            // Save config file to server
-            var xhrConfig = new XMLHttpRequest();
-            xhrConfig.open("POST", "/"+root+"/save/"+filename, true);
-            xhrConfig.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
-            xhrConfig.send("root="+root+"/"+filename+"&filename=saveState&inst="+inst+"&timestamp="+timestamp+"&extension=.vwf.config.json"+"&jsonState="+jsonConfig);
-        }
-
-        else
-        {
-            console.error("Unable to save state.");
-        }
-    }
-
-    // -- LoadSavedState --------------------------------------------------------------------------
-
-    function loadSavedState(filename, applicationpath, revision) 
-    {
-        this.logger.info("Loading: " + filename);
-
-        // Redirect until setState ID conflict is resolved
-        var path = window.location.pathname;
-        var inst = path.substring(path.length-17, path.length-1);
-        
-        var pathSplit = path.split('/');
-        if ( pathSplit[0] == "" ) {          
-            pathSplit.shift();
-        }
-        if ( pathSplit[ pathSplit.length - 1 ] == "" ) {
-            pathSplit.pop();
-        }            
-        var inst = undefined;
-        var instIndex = pathSplit.length - 1;
-        if ( pathSplit.length > 2 ) {
-            if ( pathSplit[ pathSplit.length - 2 ] == "load" ) {
-                instIndex = pathSplit.length - 3;
-            }
-        }
-        if ( pathSplit.length > 3 ) {
-            if ( pathSplit[ pathSplit.length - 3 ] == "load" ) {
-                instIndex = pathSplit.length - 4;
-            }
-        }
-        inst = pathSplit[ instIndex ];
-        if ( revision ) {
-            window.location.pathname = applicationpath + "/" + inst + '/load/' + filename + '/' + revision + '/';
-        }
-        else {
-            window.location.pathname = applicationpath + "/" + inst + '/load/' + filename + '/';
-        }
-
-        // $.get(filename,function(data,status){
-        //     vwf.setState(data);
-        // });
-    }
-
-    // -- SupportAjax -----------------------------------------------------------------------------
-
-    function supportAjaxUploadWithProgress()
-    {
-        return supportAjaxUploadProgressEvents();
-
-        function supportAjaxUploadProgressEvents() 
-        {
-            var xhr = new XMLHttpRequest();
-            return !! (xhr && ('upload' in xhr) && ('onprogress' in xhr.upload));
-        }
-    }
-} );

+ 0 - 258
support/client/lib/vwf/view/editor/editor.css

@@ -1,258 +0,0 @@
-.relClass {
-	position:relative;
-	z-index: 2000;
-}
-
-.uiContainer {
-	text-align:right;
-	position:absolute;
-	right:0px;
-	pointer-events:none;
-}
-
-.vwf-tree {
-	width:260px;
-	text-align:left;
-	font:10pt Arial;
-	border:1px solid #888;
-	background-color:#1F497D;
-	color:white;
-	/*opacity:1.0;*/
-	overflow-y:auto;
-	pointer-events:all;
-}
-
-.editor-tabs {
-	width:22px;
-	position:relative;
-	right:3px;
-	pointer-events:all;
-	overflow-y:hidden;
-}
-
-hr 
-{
-	background-color:#153255;
-	border:0;
-	height:1px;
-}
-
-td
-{
-	font:10pt Arial;
-	width:105px;
-	max-width:105px;
-	padding:0px;
-	overflow:hidden;
-}
-
-.input_text
-{
-	height:16px;
-	width:90px;
-	font:9pt Arial;
-	padding:3px;
-	color:#153255;
-	/*background-color:#153255;*/
-	border:1px;
-}
-
-.input_button
-{
-	width:50px;
-	font:8pt Arial;
-	padding:0px;
-}
-
-.input_button_call
-{
-	width:30px;
-	font:8pt Arial;
-	padding:0px;
-}
-
-form
-{
-	margin:0px;
-}
-
-textarea:focus, input:focus{
-    outline: none;
-}
-
-.header 
-{
-	font:16pt Arial;
-	font-weight:bold;
-	padding-left:10px;
-	padding-right:10px;
-	padding-top:5px;
-	padding-bottom:10px;
-	margin-bottom:5px;
-	background:#153255;
-	overflow:hidden;
-}
-
-.propEntry 
-{
-	padding-left:10px;
-	padding-right:10px;
-	padding-top:0.5em;
-	padding-bottom:0.5em;
-	border-bottom-style:solid;
-	border-bottom-width:1px;
-	border-bottom-color: #153255;
-}
-
-.childContainer {
-	background-image:url('images/toggle-expand-light.png');
-	background-repeat:no-repeat;
-	background-position: right center;
-	padding-top:0.5em;
-	padding-bottom:0.5em;
-	border-bottom-style:solid;
-	border-bottom-width:1px;
-	border-bottom-color: #153255;
-}
-
-.childContainerHighlight {
-	background-color: #4C6D97;
-}
-
-.childEntry {
-	padding-left:10px;
-	padding-right:10px;
-}
-
-.methodEntry 
-{
-	padding-left:10px;
-	padding-right:10px;
-	padding-top:0.5em;
-	padding-bottom:0.5em;
-	border-bottom-style:solid;
-	border-bottom-width:1px;
-	border-bottom-color: #153255;
-}
-
-.methodEntry td
-{
-	font:10pt Arial;
-	width:130px;
-	padding:0px;
-	overflow:hidden;
-}
-
-.clientEntry
-{
-	font:10pt Arial;
-	font-weight:bold;
-	padding-left:10px;
-	padding-right:10px;
-	padding-top:0.5em;
-	padding-bottom:0.5em;
-	border-bottom-style:solid;
-	border-bottom-width:1px;
-	border-bottom-color: #153255;
-}
-
-.scriptEntry 
-{
-	padding-left:10px;
-	padding-right:10px;
-	height:85%;
-}
-
-.scriptCode
-{
-	height:100%;
-}
-
-.scriptEdit
-{
-	width:99%;
-	height:99%;
-	color:white;
-	background-color:#1F497D;
-	border: 1px solid #153255;
-}
-
-.scriptCode textarea:focus
-{
-	border: 1px solid #153255;
-}
-
-.scriptEdit::-webkit-scrollbar {
-    height:12px;
-	width:12px;
-	background:#1B456F;
-}
-.scriptEdit::-webkit-scrollbar-thumb {
-    background:#153255;
-    -webkit-border-radius: 0.8ex;
-}
-.scriptEdit::-webkit-scrollbar-corner {
-    background: #153255;
-}
-
-.update_button
-{
-	width:100%;
-	font:10pt Arial;
-	padding:2px;
-	color:white;
-	background:#153255;
-}
-
-.filename_entry
-{
-	width:240px;
-	font:10pt Arial;
-	padding:2px;
-}
-
-.filename_select
-{
-	width:247px;
-	font:10pt Arial;
-	padding:2px;
-}
-
-/* TIMELINE */
-.rate.slider {
-	display: inline-block;
-	width: 10em;
-}
-
-.about {
-	padding-left:10px;
-}
-
-.about a:link {
-	color:white;
-}
-
-.about a:visited {
-	color:white;
-}
-
-.modelEntry {
-	font:10pt Arial;
-	font-weight:bold;
-	padding-left:10px;
-	padding-right:10px;
-}
-
-.drag {
-	padding-top:5px;
-	padding-bottom:5px;
-	border-style:solid;
-	border-width:medium;
-	border-color: #153255;
-	text-align: center;
-}
-
-.drag:hover {
-	cursor: move;
-	background-color: #4C6D97;
-}

BIN
support/client/lib/vwf/view/editor/images/toggle-expand-light.png


+ 0 - 30
support/client/lib/vwf/view/sound.js

@@ -1,30 +0,0 @@
-"use strict";
-
-define( [ "module", "vwf/view" ], function( module, view ) {
-
-    return view.load( module, {
-
-        createdNode: function( nodeID, childID, childExtendsID, childImplementsIDs,
-                               childSource, childType, childIndex, childName, callback ) {
-            if ( this.kernel.test( childID,
-                                   "self::element(*,'http://vwf.example.com/sound/soundManager.vwf')",
-                                   childID ) ) {
-
-                // If this is the prototype, exit early - we want to register the actual sound manager.
-                if (nodeID === 0 && ( childID !== this.kernel.application() ) ) {
-                    return undefined;
-                }
-
-                if ( this.state.soundManager.nodeID !== undefined ) {
-                    this.logger.errorx( "createdNode", "Sound manager already exists!  Ignoring this one..." );
-                    return undefined;
-                } 
-
-                this.state.soundManager = {
-                    "nodeID": childID,
-                    "name": childName
-                };
-            }
-        }
-    } );
-} );

+ 0 - 33
support/client/lib/vwf/view/test.js

@@ -1,33 +0,0 @@
-// Copyright 2012 United States Government, as represented by the Secretary of Defense, Under
-// Secretary of Defense (Personnel & Readiness).
-// 
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-// 
-//   http://www.apache.org/licenses/LICENSE-2.0
-// 
-// Unless required by applicable law or agreed to in writing, software distributed under the License
-// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
-// or implied. See the License for the specific language governing permissions and limitations under
-// the License.
-
-/// @module vwf/view/test
-/// @requires vwf/view
-
-define( [ "module", "vwf/view" ], function( module, view ) {
-
-    // vwf/view/test.js is a dummy driver used for tests.
-
-    return view.load( module, {
-
-        // == Module Definition ====================================================================
-
-        // -- initialize ---------------------------------------------------------------------------
-
-        initialize: function() {
-            this.arguments = Array.prototype.slice.call( arguments );
-        },
-
-    } );
-
-} );

+ 0 - 7
support/client/lib/vwf/view/touch.js

@@ -1,7 +0,0 @@
-define( [ "module", "vwf/view", "hammer" ], function( module, view, Hammer ) {
-
-    // vwf/view/touch.js is a driver used to enable touch events.
-
-    return view.load( module, {} );
-
-} );

+ 0 - 457
support/client/test/behaviors.html

@@ -1,457 +0,0 @@
-<!DOCTYPE html>
-
-<html>
-
-  <head>
-
-    <title>Virtual World Framework</title>
-
-    <script type="text/javascript" src="qunit.js"></script>
-
-    <script type="text/javascript" src="../lib/async.js"></script>
-
-    <script type="text/javascript" src="../lib/crypto.js"></script>
-    <script type="text/javascript" src="../lib/md5.js"></script>
-
-    <script type="text/javascript" src="../lib/alea.js"></script>
-    <script type="text/javascript" src="../lib/mash.js"></script>
-
-    <script type="text/javascript" src="../lib/vwf.js"></script>
-
-    <script type="text/javascript" src="../lib/require.js"></script>
-
-    <script type="text/javascript">
-
-      require( {
-
-        baseUrl: "../lib",
-        paths: {
-          jquery: "jquery-1.10.2.min",
-        },
-
-      }, [
-        "domReady",
-        "utility.js",
-
-        "jquery",
-        "vwf/configuration",
-        "vwf/kernel/model",
-        "vwf/model/javascript",
-        "vwf/model/object",
-        "vwf/model/stage/log",
-        "vwf/kernel/view",
-        "vwf/kernel/utility",
-        "vwf/utility",
-        "logger",
-
-      ], function( ready, testUtility ) {
-
-        // Test behavior inheritance.
-
-        ready( function() {
-
-          vwf.initialize(
-            /* models */ [ "vwf/model/javascript", "vwf/model/object" ],
-            /*  views */ [ ]
-          );
-
-          asyncTest( "No behaviors", function() {  // Base
-
-            createFixture( function( doubleDerivedOtherBehaviorDerivedBaseBehaviorID,
-                derivedID, derivedBaseBehaviorID, derivedBaseBehaviorOtherBehaviorID, derivedDerivedBehaviorID,
-                baseID, derivedBehaviorID, baseBehaviorID, otherBehaviorID, cleanup ) {
-
-              equal( vwf.execute( baseID, "this.base" ), "base", "base property visible on base" );
-              equal( vwf.execute( baseID, "this.baseAccessor" ), "BASE", "base property visible on base through accessor" );
-
-              cleanup();
-              start();
-
-            } );
-
-          } );
-
-          asyncTest( "Inheritance with no behaviors", function() {  // Derived extends Base
-
-            createFixture( function( doubleDerivedOtherBehaviorDerivedBaseBehaviorID,
-                derivedID, derivedBaseBehaviorID, derivedBaseBehaviorOtherBehaviorID, derivedDerivedBehaviorID,
-                baseID, derivedBehaviorID, baseBehaviorID, otherBehaviorID, cleanup ) {
-
-              equal( vwf.execute( derivedID, "this.derived" ), "derived", "derived property visible on derived" );
-              equal( vwf.execute( derivedID, "this.base" ), "base", "base property visible on derived" );
-
-              equal( vwf.execute( derivedID, "this.derivedAccessor" ), "DERIVED", "derived property visible on derived through accessor" );
-              equal( vwf.execute( derivedID, "this.baseAccessor" ), "BASE", "base property visible on derived through accessor" );
-
-              cleanup();
-              start();
-
-            } );
-
-          } );
-
-          asyncTest( "Inheritance through behavior", function() {  // DerivedBaseBehavior implements BaseBehavior extends Base
-
-            createFixture( function( doubleDerivedOtherBehaviorDerivedBaseBehaviorID,
-                derivedID, derivedBaseBehaviorID, derivedBaseBehaviorOtherBehaviorID, derivedDerivedBehaviorID,
-                baseID, derivedBehaviorID, baseBehaviorID, otherBehaviorID, cleanup ) {
-
-              equal( vwf.execute( derivedBaseBehaviorID, "this.derivedBaseBehavior" ), "derivedBaseBehavior", "derived property visible on derived with base behavior" );
-              equal( vwf.execute( derivedBaseBehaviorID, "this.baseBehavior" ), "baseBehavior", "base behavior property visible on derived with base behavior" );
-              equal( vwf.execute( derivedBaseBehaviorID, "this.base" ), "base", "base property visible on derived with base behavior" );
-
-              equal( vwf.execute( derivedBaseBehaviorID, "this.derivedBaseBehaviorAccessor" ), "DERIVEDBASEBEHAVIOR", "derived property visible on derived with base behavior through accessor" );
-              equal( vwf.execute( derivedBaseBehaviorID, "this.baseBehaviorAccessor" ), "BASEBEHAVIOR", "base behavior property visible on derived with base behavior through accessor" );
-              equal( vwf.execute( derivedBaseBehaviorID, "this.baseAccessor" ), "BASE", "base property visible on derived with base behavior through accessor" );
-
-              vwf.setProperty( derivedBaseBehaviorID, "derivedBaseBehavior", "UpDaTeD" );
-              vwf.setProperty( derivedBaseBehaviorID, "baseBehavior", "UpDaTeD" );
-              vwf.setProperty( derivedBaseBehaviorID, "base", "UpDaTeD" );
-
-              equal( vwf.execute( derivedBaseBehaviorID, "this.derivedBaseBehavior" ), "UpDaTeD", "derived property after initialization on derived with base behavior" );
-              equal( vwf.execute( derivedBaseBehaviorID, "this.baseBehavior" ), "UpDaTeD", "base behavior property after initialization on derived with base behavior" );
-              equal( vwf.execute( derivedBaseBehaviorID, "this.base" ), "UpDaTeD", "base property after initialization on derived with base behavior" );
-
-              equal( vwf.execute( derivedBaseBehaviorID, "this.derivedBaseBehaviorAccessor" ), "UPDATED", "derived property after initialization on derived with base behavior through accessor" );
-              equal( vwf.execute( derivedBaseBehaviorID, "this.baseBehaviorAccessor" ), "UPDATED", "base behavior property after initialization on derived with base behavior through accessor" );
-              equal( vwf.execute( derivedBaseBehaviorID, "this.baseAccessor" ), "UPDATED", "base property after initialization on derived with base behavior through accessor" );
-
-              cleanup();
-              start();
-
-            } );
-
-          } );
-
-          asyncTest( "Inheritance through two behaviors", function() {  // DerivedBaseBehaviorOtherBehavior implements BaseBehavior, OtherBehavior extends Base
-
-            createFixture( function( doubleDerivedOtherBehaviorDerivedBaseBehaviorID,
-                derivedID, derivedBaseBehaviorID, derivedBaseBehaviorOtherBehaviorID, derivedDerivedBehaviorID,
-                baseID, derivedBehaviorID, baseBehaviorID, otherBehaviorID, cleanup ) {
-
-              equal( vwf.execute( derivedBaseBehaviorOtherBehaviorID, "this.derivedBaseBehaviorOtherBehavior" ), "derivedBaseBehaviorOtherBehavior", "derived property visible on derived with base and other behaviors" );
-              equal( vwf.execute( derivedBaseBehaviorOtherBehaviorID, "this.baseBehavior" ), "baseBehavior", "base behavior property visible on derived with base and other behaviors" );
-              equal( vwf.execute( derivedBaseBehaviorOtherBehaviorID, "this.otherBehavior" ), "otherBehavior", "other behavior property visible on derived with base and other behaviors" );
-              equal( vwf.execute( derivedBaseBehaviorOtherBehaviorID, "this.base" ), "base", "base property visible on derived with base and other behaviors" );
-
-              equal( vwf.execute( derivedBaseBehaviorOtherBehaviorID, "this.derivedBaseBehaviorOtherBehaviorAccessor" ), "DERIVEDBASEBEHAVIOROTHERBEHAVIOR", "derived property visible on derived with base and other behaviors through accessor" );
-              equal( vwf.execute( derivedBaseBehaviorOtherBehaviorID, "this.baseBehaviorAccessor" ), "BASEBEHAVIOR", "base behavior property visible on derived with base and other behaviors through accessor" );
-              equal( vwf.execute( derivedBaseBehaviorOtherBehaviorID, "this.otherBehaviorAccessor" ), "OTHERBEHAVIOR", "other behavior property visible on derived with base and other behaviors through accessor" );
-              equal( vwf.execute( derivedBaseBehaviorOtherBehaviorID, "this.baseAccessor" ), "BASE", "base property visible on derived with base and other behaviors through accessor" );
-
-              vwf.setProperty( derivedBaseBehaviorOtherBehaviorID, "derivedBaseBehaviorOtherBehavior", "UpDaTeD" );
-              vwf.setProperty( derivedBaseBehaviorOtherBehaviorID, "baseBehavior", "UpDaTeD" );
-              vwf.setProperty( derivedBaseBehaviorOtherBehaviorID, "otherBehavior", "UpDaTeD" );
-              vwf.setProperty( derivedBaseBehaviorOtherBehaviorID, "base", "UpDaTeD" );
-
-              equal( vwf.execute( derivedBaseBehaviorOtherBehaviorID, "this.derivedBaseBehaviorOtherBehavior" ), "UpDaTeD", "derived property after initialization on derived with base and other behaviors" );
-              equal( vwf.execute( derivedBaseBehaviorOtherBehaviorID, "this.baseBehavior" ), "UpDaTeD", "base behavior property after initialization on derived with base and other behaviors" );
-              equal( vwf.execute( derivedBaseBehaviorOtherBehaviorID, "this.otherBehavior" ), "UpDaTeD", "other behavior property after initialization on derived with base and other behaviors" );
-              equal( vwf.execute( derivedBaseBehaviorOtherBehaviorID, "this.base" ), "UpDaTeD", "base property after initialization on derived with base and other behaviors" );
-
-              equal( vwf.execute( derivedBaseBehaviorOtherBehaviorID, "this.derivedBaseBehaviorOtherBehaviorAccessor" ), "UPDATED", "derived property after initialization on derived with base and other behaviors through accessor" );
-              equal( vwf.execute( derivedBaseBehaviorOtherBehaviorID, "this.baseBehaviorAccessor" ), "UPDATED", "base behavior property after initialization on derived with base and other behaviors through accessor" );
-              equal( vwf.execute( derivedBaseBehaviorOtherBehaviorID, "this.otherBehaviorAccessor" ), "UPDATED", "other behavior property after initialization on derived with base and other behaviors through accessor" );
-              equal( vwf.execute( derivedBaseBehaviorOtherBehaviorID, "this.baseAccessor" ), "UPDATED", "base property after initialization on derived with base and other behaviors through accessor" );
-
-              cleanup();
-              start();
-
-            } );
-
-          } );
-
-          asyncTest( "Inheritance through behavior with own inheritance", function() {  // DerivedDerivedBehavior implements DerivedBehavior extends Base; DerivedBehavior extends BaseBehavior
-
-            createFixture( function( doubleDerivedOtherBehaviorDerivedBaseBehaviorID,
-                derivedID, derivedBaseBehaviorID, derivedBaseBehaviorOtherBehaviorID, derivedDerivedBehaviorID,
-                baseID, derivedBehaviorID, baseBehaviorID, otherBehaviorID, cleanup ) {
-
-              equal( vwf.execute( derivedDerivedBehaviorID, "this.derivedDerivedBehavior" ), "derivedDerivedBehavior", "derived property visible on derived with derived behavior" );
-              equal( vwf.execute( derivedDerivedBehaviorID, "this.derivedBehavior" ), "derivedBehavior", "derived behavior property visible on derived with derived behavior" );
-              equal( vwf.execute( derivedDerivedBehaviorID, "'baseBehavior' in this" ), false, "base behavior property not visible on derived with derived behavior (JavaScript binding)" );
-              equal( vwf.getProperty( derivedDerivedBehaviorID, "baseBehavior" ), undefined, "base behavior property not visible on derived with derived behavior (kernel delegation)" );
-              equal( vwf.execute( derivedDerivedBehaviorID, "this.base" ), "base", "base property visible on derived with derived behavior" );
-
-              equal( vwf.execute( derivedDerivedBehaviorID, "this.derivedDerivedBehaviorAccessor" ), "DERIVEDDERIVEDBEHAVIOR", "derived property visible on derived with derived behavior through accessor" );
-              equal( vwf.execute( derivedDerivedBehaviorID, "this.derivedBehaviorAccessor" ), "DERIVEDBEHAVIOR", "derived behavior property visible on derived with derived behavior through accessor" );
-              equal( vwf.execute( derivedDerivedBehaviorID, "'baseBehaviorAccessor' in this" ), false, "base behavior property not visible on derived with derived behavior through accessor (JavaScript binding)" );
-              // equal( vwf.getProperty( derivedDerivedBehaviorID, "baseBehaviorAccessor" ), undefined, "base behavior property not visible on derived with derived behavior through accessor (kernel delegation)" );  // TODO: would need to handle ignorePrototype in vwf.model.javascript.gettingProperty() to prevent accessor inheritance in behaviors
-              equal( vwf.execute( derivedDerivedBehaviorID, "this.baseAccessor" ), "BASE", "base property visible on derived with derived behavior through accessor" );
-
-              vwf.setProperty( derivedDerivedBehaviorID, "derivedDerivedBehavior", "UpDaTeD" );
-              vwf.setProperty( derivedDerivedBehaviorID, "derivedBehavior", "UpDaTeD" );
-              vwf.setProperty( derivedDerivedBehaviorID, "baseBehavior", "CrEaTeD" );
-              vwf.setProperty( derivedDerivedBehaviorID, "base", "UpDaTeD" );
-
-              equal( vwf.execute( derivedDerivedBehaviorID, "this.derivedDerivedBehavior" ), "UpDaTeD", "derived property after initialization on derived with derived behavior" );
-              equal( vwf.execute( derivedDerivedBehaviorID, "this.derivedBehavior" ), "UpDaTeD", "derived behavior property after initialization on derived with derived behavior" );
-              equal( vwf.execute( derivedDerivedBehaviorID, "'baseBehavior' in this" ), true, "base behavior property created on derived with derived behavior (JavaScript binding)" );  // TODO: kernel doesn't prevent this yet
-              equal( vwf.getProperty( derivedDerivedBehaviorID, "baseBehavior" ), "CrEaTeD", "base behavior property created on derived with derived behavior (kernel delegation)" );  // TODO: kernel doesn't prevent this yet
-              equal( vwf.execute( derivedDerivedBehaviorID, "this.base" ), "UpDaTeD", "base property after initialization on derived with derived behavior" );
-
-              equal( vwf.execute( derivedDerivedBehaviorID, "this.derivedDerivedBehaviorAccessor" ), "UPDATED", "derived property after initialization on derived with derived behavior through accessor" );
-              equal( vwf.execute( derivedDerivedBehaviorID, "this.derivedBehaviorAccessor" ), "UPDATED", "derived behavior property after initialization on derived with derived behavior through accessor" );
-              equal( vwf.execute( derivedDerivedBehaviorID, "'baseBehaviorAccessor' in this" ), false, "base behavior property not initialized on derived with derived behavior through accessor (JavaScript binding)" );
-              // equal( vwf.getProperty( derivedDerivedBehaviorID, "baseBehaviorAccessor" ), undefined, "base behavior property not initialized on derived with derived behavior through accessor (kernel delegation)" );  // TODO: would need to handle ignorePrototype in vwf.model.javascript.gettingProperty() to prevent accessor inheritance in behaviors
-              equal( vwf.execute( derivedDerivedBehaviorID, "this.baseAccessor" ), "UPDATED", "base property after initialization on derived with derived behavior through accessor" );
-
-              cleanup();
-              start();
-
-            } );
-
-          } );
-
-          asyncTest( "Multiple behavior inheritance order", function() {  // DerivedBaseBehaviorOtherBehavior implements BaseBehavior, OtherBehavior extends Base
-
-            createFixture( function( doubleDerivedOtherBehaviorDerivedBaseBehaviorID,
-                derivedID, derivedBaseBehaviorID, derivedBaseBehaviorOtherBehaviorID, derivedDerivedBehaviorID,
-                baseID, derivedBehaviorID, baseBehaviorID, otherBehaviorID, cleanup ) {
-
-              vwf.createProperty( derivedBaseBehaviorOtherBehaviorID, "a", "derivedBaseBehaviorOtherBehavior" );
-
-              vwf.createProperty( baseBehaviorID, "a", "baseBehavior" );
-              vwf.createProperty( baseBehaviorID, "b", "baseBehavior" );
-
-              vwf.createProperty( otherBehaviorID, "a", "otherBehavior" );
-              vwf.createProperty( otherBehaviorID, "b", "otherBehavior" );
-              vwf.createProperty( otherBehaviorID, "c", "otherBehavior" );
-
-              vwf.createProperty( baseID, "a", "base" );
-              vwf.createProperty( baseID, "b", "base" );
-              vwf.createProperty( baseID, "c", "base" );
-              vwf.createProperty( baseID, "d", "base" );
-
-              equal( vwf.execute( derivedBaseBehaviorOtherBehaviorID, "this.a" ), "derivedBaseBehaviorOtherBehavior", "derived property visible above behaviors and prototype" );
-              equal( vwf.execute( derivedBaseBehaviorOtherBehaviorID, "this.b" ), "baseBehavior", "second behavior property visible above first behavior and prototype" );
-              equal( vwf.execute( derivedBaseBehaviorOtherBehaviorID, "this.c" ), "otherBehavior", "first behavior property visible above prototype" );
-              equal( vwf.execute( derivedBaseBehaviorOtherBehaviorID, "this.d" ), "base", "prototype property visible" );
-
-              cleanup();
-              start();
-
-            } );
-
-          } );
-
-          asyncTest( "Inheritance queries", function() {
-
-            createFixture( function( doubleDerivedOtherBehaviorDerivedBaseBehaviorID,
-                derivedID, derivedBaseBehaviorID, derivedBaseBehaviorOtherBehaviorID, derivedDerivedBehaviorID,
-                baseID, derivedBehaviorID, baseBehaviorID, otherBehaviorID, cleanup ) {
-
-              var protoNodeURI = require( "vwf/kernel/utility" ).protoNodeURI;
-
-              // Base node.
-
-              equal( vwf.prototype( baseID ), protoNodeURI, "base prototype" );
-              deepEqual( vwf.behaviors( baseID ), [], "base behaviors" );
-              deepEqual( vwf.prototypes( baseID ), [ protoNodeURI ], "base prototypes" );
-              deepEqual( vwf.prototypes( baseID, true ), [ protoNodeURI ], "base prototypes with behaviors" );
-
-              // Derived node without behaviors.
-
-              equal( vwf.prototype( derivedID ), baseID, "derived prototype" );
-              deepEqual( vwf.behaviors( derivedID ), [], "derived behaviors" );
-              deepEqual( vwf.prototypes( derivedID ), [ baseID, protoNodeURI ], "derived prototypes" );
-              deepEqual( vwf.prototypes( derivedID, true ), [ baseID, protoNodeURI ], "derived prototypes with behaviors" );
-
-              // Derived node with two behaviors. A node's behaviors should be inserted before its
-              // prototype, and the behaviors should be in descending order of inheritance.
-
-              equal( vwf.prototype( derivedBaseBehaviorOtherBehaviorID ),
-                baseID, "derived-with-behaviors prototype" );
-              deepEqual( vwf.behaviors( derivedBaseBehaviorOtherBehaviorID ),
-                [ otherBehaviorID, baseBehaviorID ], "derived-with-behaviors behaviors" );
-              deepEqual( vwf.prototypes( derivedBaseBehaviorOtherBehaviorID ),
-                [ baseID, protoNodeURI ], "derived-with-behaviors prototypes" );
-              deepEqual( vwf.prototypes( derivedBaseBehaviorOtherBehaviorID, true ),
-                [ baseBehaviorID, otherBehaviorID, baseID, protoNodeURI ], "derived-with-behaviors prototypes with behaviors" );
-
-              // Node with a behavior derived from a derived node with a behavior. Each node's
-              // behaviors should be inserted before their prototypes.
-
-              equal( vwf.prototype( doubleDerivedOtherBehaviorDerivedBaseBehaviorID ),
-                derivedBaseBehaviorID, "double-derived prototype" );
-              deepEqual( vwf.behaviors( doubleDerivedOtherBehaviorDerivedBaseBehaviorID ),
-                [ otherBehaviorID ], "double-derived behaviors" );
-              deepEqual( vwf.prototypes( doubleDerivedOtherBehaviorDerivedBaseBehaviorID ),
-                [ derivedBaseBehaviorID, baseID, protoNodeURI ], "double-derived prototypes" );
-              deepEqual( vwf.prototypes( doubleDerivedOtherBehaviorDerivedBaseBehaviorID, true ),
-                [ otherBehaviorID, derivedBaseBehaviorID, baseBehaviorID, baseID, protoNodeURI ],
-                "double-derived prototypes with behaviors" );
-
-              cleanup();
-              start();
-
-            } );
-
-          } );
-
-          asyncTest( "Behavior as single URI", function() {
-
-            var uri = testUtility.dataURIFromDescriptor( { properties: { property: "uri" } } );
-
-            vwf.createChild( 0, testUtility.uniqueName( "node" ), {
-
-              implements: uri
-
-            }, undefined, function( nodeID ) {
-
-              var behaviorIDs = vwf.behaviors( nodeID );
-              equal( behaviorIDs.length, 1, "one behavior created from lone specifier" );
-              equal( vwf.getProperty( behaviorIDs[0], "property" ), "uri", "specifier recognized as URI behavior" );
-
-              vwf.deleteNode( nodeID );
-              vwf.deleteNode( behaviorIDs[0] );
-
-              start();
-            } );
-
-          } );
-
-          asyncTest( "Behavior as single descriptor", function() {
-
-            var descriptor = { properties: { property: "descriptor" } };
-
-            vwf.createChild( 0, testUtility.uniqueName( "node" ), {
-
-              implements: descriptor
-
-            }, undefined, function( nodeID ) {
-
-              var behaviorIDs = vwf.behaviors( nodeID );
-              equal( behaviorIDs.length, 1, "one behavior created from lone specifier" );
-              equal( vwf.getProperty( behaviorIDs[0], "property" ), "descriptor", "specifier recognized as descriptor behavior" );
-
-              vwf.deleteNode( nodeID );
-              vwf.deleteNode( behaviorIDs[0] );
-
-              start();
-            } );
-
-          } );
-
-          asyncTest( "Multiple behaviors as array of URI and descriptor", function() {
-
-            var uri = testUtility.dataURIFromDescriptor( { properties: { property: "uri" } } );
-            var descriptor = { properties: { property: "descriptor" } };
-
-            vwf.createChild( 0, testUtility.uniqueName( "node" ), {
-
-              implements: [ uri, descriptor ]
-
-            }, undefined, function( nodeID ) {
-
-              var behaviorIDs = vwf.behaviors( nodeID );
-              equal( behaviorIDs.length, 2, "multiple behaviors created from array of specifiers" );
-              equal( vwf.getProperty( behaviorIDs[0], "property" ), "uri", "first specifier recognized as URI behavior" );
-              equal( vwf.getProperty( behaviorIDs[1], "property" ), "descriptor", "second specifier recognized as descriptor behavior" );
-
-              vwf.deleteNode( nodeID );
-              vwf.deleteNode( behaviorIDs[0] );
-              vwf.deleteNode( behaviorIDs[1] );
-
-              start();
-            } );
-
-          } );
-
-          // == Helper functions =====================================================================
-
-          // Create nodes in this arrangement:
-          // 
-          //   DoubleDerivedOtherBehaviorDerivedBaseBehavior implements OtherBehavior extends DerivedBaseBehavior
-          //     (=> implements BaseBehavior extends Base)
-          //   
-          //   DerivedBaseBehavior implements BaseBehavior extends Base
-          //   DerivedBaseBehaviorOtherBehavior implements BaseBehavior, OtherBehavior extends Base
-          //   DerivedDerivedBehavior implements DerivedBehavior extends Base
-          //   
-          //   Derived extends Base
-          //   Base
-          //   
-          //   DerivedBehavior extends BaseBehavior
-          //   BaseBehavior
-          //   
-          //   OtherBehavior
-
-          function createFixture( callback ) {
-
-            createNode( "otherBehavior", undefined, undefined, function( otherBehaviorID ) {
-              createNode( "baseBehavior", undefined, undefined, function( baseBehaviorID ) {
-                createNode( "derivedBehavior", undefined, baseBehaviorID, function( derivedBehaviorID ) {
-                  createNode( "base", undefined, undefined, function( baseID ) {
-                    createNode( "derived", undefined, baseID, function( derivedID ) {
-                      createNode( "derivedBaseBehavior", [ baseBehaviorID ], baseID, function( derivedBaseBehaviorID ) {
-                        createNode( "derivedBaseBehaviorOtherBehavior", [ otherBehaviorID, baseBehaviorID ], baseID, function( derivedBaseBehaviorOtherBehaviorID ) {
-                          createNode( "derivedDerivedBehavior", [ derivedBehaviorID ], baseID, function( derivedDerivedBehaviorID ) {
-                            createNode( "doubleDerivedOtherBehaviorDerivedBaseBehavior", [ otherBehaviorID ], derivedBaseBehaviorID, function( doubleDerivedOtherBehaviorDerivedBaseBehaviorID ) {
-
-                              var nodes = [ doubleDerivedOtherBehaviorDerivedBaseBehaviorID,
-                                derivedID, derivedBaseBehaviorID, derivedBaseBehaviorOtherBehaviorID, derivedDerivedBehaviorID,
-                                baseID, derivedBehaviorID, baseBehaviorID, otherBehaviorID ];
-
-                              callback.apply( undefined, nodes.concat( function() {
-                                nodes.forEach( function( nodeID ) { vwf.deleteNode( nodeID ) } );
-                              } ) );
-
-                            } );
-                          } );
-                        } );
-                      } );
-                    } );
-                  } );
-                } );
-              } );
-            } );
-  
-          }
-
-          // Create a node with the given prototype and behaviors and a property of the given name
-          // having that same name as its value. A second property wraps the first property using
-          // accessor methods that convert to upper case on get and to lower case on set.
-
-          function createNode( which, behaviors, prototype, callback /* nodeID */ ) {
-
-            var descriptor = {
-              properties: {}
-            };
-
-            descriptor.extends = prototype;
-            descriptor.implements = behaviors;
-
-            descriptor.properties[which] = which;
-
-            descriptor.properties[which+"Accessor"] = {
-              get: "return this." + which + ".toUpperCase()",
-              set: "this." + which + " = value.toLowerCase()",
-            };
-
-            vwf.createNode( descriptor, callback );
-          }
-
-        } );
-
-      } );
-
-    </script>
-
-    <link rel="stylesheet" type="text/css" href="qunit.css" />
-
-  </head>
-
-  <body>
-
-    <h1 id="qunit-header">Virtual World Framework</h1>
-    <h2 id="qunit-banner"></h2>
-    <div id="qunit-testrunner-toolbar"></div>
-    <h2 id="qunit-userAgent"></h2>
-    <ol id="qunit-tests"></ol>
-
-    <div id="qunit-fixture">test markup, will be hidden</div>
-
-  </body>
-
-</html>

+ 0 - 526
support/client/test/dispatch.html

@@ -1,526 +0,0 @@
-<!DOCTYPE html>
-
-<html>
-
-  <head>
-
-    <title>Virtual World Framework</title>
-
-    <script type="text/javascript" src="qunit.js"></script>
-
-    <script type="text/javascript" src="../lib/async.js"></script>
-
-    <script type="text/javascript" src="../lib/crypto.js"></script>
-    <script type="text/javascript" src="../lib/md5.js"></script>
-
-    <script type="text/javascript" src="../lib/alea.js"></script>
-    <script type="text/javascript" src="../lib/mash.js"></script>
-
-    <script type="text/javascript" src="../lib/vwf.js"></script>
-
-    <script type="text/javascript" src="../lib/require.js"></script>
-
-    <script type="text/javascript">
-
-      require( {
-
-        baseUrl: "../lib",
-        paths: {
-          jquery: "jquery-1.10.2.min",
-        },
-
-      }, [
-
-        "domReady",
-        "utility.js",
-
-        "jquery",
-        "vwf/configuration",
-        "vwf/kernel/model",
-        "vwf/model/javascript",
-        "vwf/model/object",
-        "vwf/model/stage/log",
-        "vwf/kernel/view",
-        "vwf/kernel/utility",
-        "vwf/utility",
-        "logger",
-
-      ], function( ready, testUtility ) {
-
-        // Test dispatching events.
-
-        ready( function() {
-
-          vwf.initialize(
-            /* models */ [ "vwf/model/javascript", "vwf/model/object" ],
-            /*  views */ [ ]
-          );
-
-          var emptyParameters = [ {} ]; // eventData == {}
-          var emptyNodeParameters = { "": [ {} ] }; // eventNodeData == {} for all nodes
-
-          // Regular, non-dispatching event to the top.
-
-          asyncTest( "Regular event top", function() {
-
-            createFixture( function( topID, middleID, bottomID, baseID, cleanup ) {
-
-              vwf.fireEvent( topID, "test" );
-              deepEqual( vwf.execute( baseID, "this.properties.targets" ), [ "top bubble" ], "top fireEvent only visits top" );
-
-              cleanup();
-              start();
-
-            } );
-
-          } );
-
-          // Dispatching event to the top.
-
-          asyncTest( "Dispatching event top", function() {
-
-            createFixture( function( topID, middleID, bottomID, baseID, cleanup ) {
-
-              vwf.dispatchEvent( topID, "test", emptyParameters, emptyNodeParameters );
-              deepEqual( vwf.execute( baseID, "this.properties.targets" ), [ "top bubble" ], "top dispatchEvent only visits top" );
-
-              cleanup();
-              start();
-
-            } );
-
-          } );
-
-          // Regular, non-dispatching event to the bottom.
-
-          asyncTest( "Regular event bottom", function() {
-
-            createFixture( function( topID, middleID, bottomID, baseID, cleanup ) {
-
-              vwf.fireEvent( bottomID, "test" );
-              deepEqual( vwf.execute( baseID, "this.properties.targets" ), [ "bottom bubble" ], "bottom fireEvent only visits bottom" );
-
-              cleanup();
-              start();
-
-            } );
-
-          } );
-
-          // Dispatching event to the bottom.
-
-          asyncTest( "Dispatching event bottom", function() {
-
-            createFixture( function( topID, middleID, bottomID, baseID, cleanup ) {
-
-              vwf.dispatchEvent( bottomID, "test", emptyParameters, emptyNodeParameters );
-
-              deepEqual( vwf.execute( baseID, "this.properties.targets" ), [ "top capture", "middle capture", "bottom bubble", "middle bubble", "top bubble" ],
-                "bottom fireEvent captures from and bubbles to top" );
-
-              cleanup();
-              start();
-
-            } );
-
-          } );
-
-          // Handled (cancelled) at target.
-
-          asyncTest( "Handle at target", function() {
-
-            createFixture( false, false, { capture: false, bubble: true }, function( topID, middleID, bottomID, baseID, cleanup ) {
-
-              vwf.dispatchEvent( bottomID, "test", emptyParameters, emptyNodeParameters );
-
-              deepEqual( vwf.execute( baseID, "this.properties.targets" ), [ "top capture", "middle capture", "bottom bubble" ],
-                "handling at target prevents bubbling" );
-
-              cleanup();
-              start();
-
-            } );
-
-          } );
-
-          // Handled (cancelled) at middle during capture.
-
-          asyncTest( "Handle at middle capture", function() {
-
-            createFixture( false, { capture: true }, false, function( topID, middleID, bottomID, baseID, cleanup ) {
-
-              vwf.dispatchEvent( bottomID, "test", emptyParameters, emptyNodeParameters );
-
-              deepEqual( vwf.execute( baseID, "this.properties.targets" ), [ "top capture", "middle capture" ],
-                "handling at middle capture prevents further capture and bubbling" );
-
-              cleanup();
-              start();
-
-            } );
-
-          } );
-
-          // Handled (cancelled) at middle during bubbling.
-
-          asyncTest( "Handle at middle bubble", function() {
-
-            createFixture( false, { capture: false, bubble: true }, false, function( topID, middleID, bottomID, baseID, cleanup ) {
-
-              vwf.dispatchEvent( bottomID, "test", emptyParameters, emptyNodeParameters );
-
-              deepEqual( vwf.execute( baseID, "this.properties.targets" ), [ "top capture", "middle capture", "bottom bubble", "middle bubble" ],
-                "handling at middle bubble prevents further bubbling" );
-
-              cleanup();
-              start();
-
-            } );
-
-          } );
-
-          // Implicit "handled" return value from the handlers.
-
-          asyncTest( "Implicit 'handled'", function() {
-
-            createFixture( {}, {}, {}, function( topID, middleID, bottomID, baseID, cleanup ) {
-
-              vwf.dispatchEvent( bottomID, "test", emptyParameters, emptyNodeParameters );
-
-              deepEqual( vwf.execute( baseID, "this.properties.targets" ), [ "top capture" ],
-                "implicit undefined return in handler same as explicit true return" );
-
-              cleanup();
-              start();
-
-            } );
-
-          } );
-
-          // Dispatching to the top with no arguments.
-
-          asyncTest( "Dispatching with no parameters", function() {
-
-            createFixture( function( topID, middleID, bottomID, baseID, cleanup ) {
-
-              vwf.dispatchEvent( topID, "test" );
-
-              deepEqual( vwf.execute( baseID, "this.properties.argumentss[0]" ), [ undefined ],
-                "no parameters, no node-parameters, phase" );
-
-              cleanup();
-              start();
-
-            } );
-
-          } );
-
-          // Dispatching to the top with parameters.
-
-          asyncTest( "Dispatching with parameters", function() {
-
-            createFixture( function( topID, middleID, bottomID, baseID, cleanup ) {
-
-              vwf.dispatchEvent( topID, "test", [ { parameters: true } ] );
-
-              deepEqual( vwf.execute( baseID, "this.properties.argumentss[0]" ), [ { parameters: true }, undefined ],
-                "parameters, no node-parameters, phase" );
-
-              cleanup();
-              start();
-
-            } );
-
-          } );
-
-          // Dispatching to the top with parameters and node-parameters.
-
-          asyncTest( "Dispatching with parameters and node-parameters", function() {
-
-            createFixture( function( topID, middleID, bottomID, baseID, cleanup ) {
-
-              vwf.dispatchEvent( topID, "test", [ { parameters: true } ], { "": [ { nodeParameters: true } ] } );
-
-              deepEqual( vwf.execute( baseID, "this.properties.argumentss[0]" ), [ { parameters: true }, { nodeParameters: true }, undefined ],
-                "parameters, node-parameters, phase" );
-
-              cleanup();
-              start();
-
-            } );
-
-          } );
-
-          // Dispatching to the bottom with default node-parameters.
-
-          asyncTest( "Default node-parameters cascade to every target", function() {
-
-            createFixture( function( topID, middleID, bottomID, baseID, cleanup ) {
-
-              var nodeParameters = {
-                "": [ { nodeParameters: true, default: true } ] // default
-              };
-
-              vwf.dispatchEvent( bottomID, "test", [ { parameters: true } ], nodeParameters );
-
-              equal( vwf.execute( baseID, "this.properties.argumentss.length" ), 5, "two captures, three bubbles" ); // top capture, middle capture, bottom bubble, middle bubble, top bubble
-
-              deepEqual( vwf.execute( baseID, "this.properties.argumentss[0][1]" ),
-                { nodeParameters: true, default: true }, "default node-parameters at top capture" );
-              deepEqual( vwf.execute( baseID, "this.properties.argumentss[1][1]" ),
-                { nodeParameters: true, default: true }, "default node-parameters at middle capture" );
-              deepEqual( vwf.execute( baseID, "this.properties.argumentss[2][1]" ),
-                { nodeParameters: true, default: true }, "default node-parameters at bottom bubble" );
-              deepEqual( vwf.execute( baseID, "this.properties.argumentss[3][1]" ),
-                { nodeParameters: true, default: true }, "default node-parameters at middle bubble" );
-              deepEqual( vwf.execute( baseID, "this.properties.argumentss[4][1]" ),
-                { nodeParameters: true, default: true }, "default node-parameters at top bubble" );
-
-              cleanup();
-              start();
-
-            } );
-
-          } );
-
-          // Dispatching to the bottom with default and top node-parameters.
-
-          asyncTest( "Top node-parameters replace default and cascade to targets below", function() {
-
-            createFixture( function( topID, middleID, bottomID, baseID, cleanup ) {
-
-              var nodeParameters = {
-                "": [ { nodeParameters: true, default: true } ] // default
-              };
-
-              nodeParameters[topID] = [ { nodeParameters: true, top: true } ]; // for top
-
-              vwf.dispatchEvent( bottomID, "test", [ { parameters: true } ], nodeParameters );
-
-              equal( vwf.execute( baseID, "this.properties.argumentss.length" ), 5, "two captures, three bubbles" ); // top capture, middle capture, bottom bubble, middle bubble, top bubble
-
-              deepEqual( vwf.execute( baseID, "this.properties.argumentss[0][1]" ),
-                { nodeParameters: true, top: true }, "top node-parameters at top capture" );
-              deepEqual( vwf.execute( baseID, "this.properties.argumentss[1][1]" ),
-                { nodeParameters: true, top: true }, "top node-parameters at middle capture" );
-              deepEqual( vwf.execute( baseID, "this.properties.argumentss[2][1]" ),
-                { nodeParameters: true, top: true }, "top node-parameters at bottom bubble" );
-              deepEqual( vwf.execute( baseID, "this.properties.argumentss[3][1]" ),
-                { nodeParameters: true, top: true }, "top node-parameters at middle bubble" );
-              deepEqual( vwf.execute( baseID, "this.properties.argumentss[4][1]" ),
-                { nodeParameters: true, top: true }, "top node-parameters at top bubble" );
-
-              cleanup();
-              start();
-
-            } );
-
-          } );
-
-          // Dispatching to the bottom with default and middle node-parameters.
-
-          asyncTest( "Middle node-parameters replace default and cascade to targets below", function() {
-
-            createFixture( function( topID, middleID, bottomID, baseID, cleanup ) {
-
-              var nodeParameters = {
-                "": [ { nodeParameters: true, default: true } ] // default
-              };
-
-              nodeParameters[middleID] = [ { nodeParameters: true, middle: true } ]; // for middle
-
-              vwf.dispatchEvent( bottomID, "test", [ { parameters: true } ], nodeParameters );
-
-              equal( vwf.execute( baseID, "this.properties.argumentss.length" ), 5, "two captures, three bubbles" ); // top capture, middle capture, bottom bubble, middle bubble, top bubble
-
-              deepEqual( vwf.execute( baseID, "this.properties.argumentss[0][1]" ),
-                { nodeParameters: true, default: true }, "default node-parameters at top capture" );
-              deepEqual( vwf.execute( baseID, "this.properties.argumentss[1][1]" ),
-                { nodeParameters: true, middle: true }, "middle node-parameters at middle capture" );
-              deepEqual( vwf.execute( baseID, "this.properties.argumentss[2][1]" ),
-                { nodeParameters: true, middle: true }, "middle node-parameters at bottom bubble" );
-              deepEqual( vwf.execute( baseID, "this.properties.argumentss[3][1]" ),
-                { nodeParameters: true, middle: true }, "middle node-parameters at middle bubble" );
-              deepEqual( vwf.execute( baseID, "this.properties.argumentss[4][1]" ),
-                { nodeParameters: true, default: true }, "default node-parameters at top bubble" );
-
-              cleanup();
-              start();
-
-            } );
-
-          } );
-
-          // Dispatching to the bottom with default and bottom node-parameters.
-
-          asyncTest( "Bottom node-parameters replace default", function() {
-
-            createFixture( function( topID, middleID, bottomID, baseID, cleanup ) {
-
-              var nodeParameters = {
-                "": [ { nodeParameters: true, default: true } ] // default
-              };
-
-              nodeParameters[bottomID] = [ { nodeParameters: true, bottom: true } ]; // for bottom
-
-              vwf.dispatchEvent( bottomID, "test", [ { parameters: true } ], nodeParameters );
-
-              equal( vwf.execute( baseID, "this.properties.argumentss.length" ), 5, "two captures, three bubbles" ); // top capture, middle capture, bottom bubble, middle bubble, top bubble
-
-              deepEqual( vwf.execute( baseID, "this.properties.argumentss[0][1]" ),
-                { nodeParameters: true, default: true }, "default node-parameters at top capture" );
-              deepEqual( vwf.execute( baseID, "this.properties.argumentss[1][1]" ),
-                { nodeParameters: true, default: true }, "default node-parameters at middle capture" );
-              deepEqual( vwf.execute( baseID, "this.properties.argumentss[2][1]" ),
-                { nodeParameters: true, bottom: true }, "bottom node-parameters at bottom bubble" );
-              deepEqual( vwf.execute( baseID, "this.properties.argumentss[3][1]" ),
-                { nodeParameters: true, default: true }, "default node-parameters at middle bubble" );
-              deepEqual( vwf.execute( baseID, "this.properties.argumentss[4][1]" ),
-                { nodeParameters: true, default: true }, "default node-parameters at top bubble" );
-
-              cleanup();
-              start();
-
-            } );
-
-          } );
-
-          // == Helper functions =====================================================================
-
-          // Create parent, child, and grandchild nodes with default and capture- and bubble-phase
-          // event handlers.
-
-          function createFixture( /* topResult, middleResult, bottomResult, callback */ ) {
-
-            var args = Array.prototype.slice.call(arguments);
-
-            // Parse the arguments.
-
-            var callback = args.pop(); // callback is the last argument, regardless
-            var result = {};
-
-            [ "top", "middle", "bottom" ].forEach( function( which ) {
-
-              result[which] = args.shift();
-
-              if ( result[which] === undefined ) {
-                result[which] = false; // explicitly return false ("not handled") by default
-              }
-
-              if ( typeof result[which] == "boolean" ) {
-                result[which] = { capture: result[which], bubble: result[which] };
-              }
-              
-            } );
-
-            // Prototype for the three nodes.
-
-            vwf.createNode( {
-
-              extends: "http://vwf.example.com/node.vwf",
-
-              properties: {
-                targets: [],
-                argumentss: [],
-              },
-
-              events: {
-                test: undefined
-              },
-
-              scripts: [
-
-                "var handler = function() { " +
-
-                  "return function( eventData, eventNodeData, phase ) { " +
-
-                    "var tag = this.name.split( '-' )[0] + ' ' + ( phase || 'bubble' ); " +
-                    "var result = this.properties.result[ phase || 'bubble' ]; " +
-
-                    "Object.getPrototypeOf( this ).properties.targets.push( tag ); " +
-                    "Object.getPrototypeOf( this ).properties.argumentss.push( Array.prototype.slice.call( arguments ) ); " +
-
-                    "if ( result !== undefined ) { " +
-                      "return result; " + // do an explicit return if a value is provided
-                    "} " + // otherwise fall out with a default return value of undefined
-
-                  "}; " +
-
-                "}; " +
-
-                "this.events.test = this.events.add( handler(), 'capture', this );"
-
-              ],
-
-            }, function( baseID ) {
-
-              // Parent node.
-
-              vwf.createChild( 0, testUtility.uniqueName( "top" ), {
-
-                extends: baseID,
-                properties: { result: result.top },
-
-              }, undefined, function( topID ) {
-
-                // Child node.
-
-                vwf.createChild( topID, testUtility.uniqueName( "middle" ), {
-
-                  extends: baseID,
-                  properties: { result: result.middle },
-
-                }, undefined, function( middleID ) {
-
-                  // Grandchild node.
-
-                  vwf.createChild( middleID, testUtility.uniqueName( "bottom" ), {
-
-                    extends: baseID,
-                    properties: { result: result.bottom },
-
-                  }, undefined, function( bottomID ) {
-
-                    // Call the test's callback to let it run its assertions. Then clean up after it
-                    // finishes and calls us back.
-
-                    callback( topID, middleID, bottomID, baseID, function() {
-                      vwf.deleteNode( bottomID );
-                      vwf.deleteNode( middleID );
-                      vwf.deleteNode( topID );
-                      vwf.deleteNode( baseID );
-                    } );
-
-                  } );
-
-                } );
-
-              } );
-
-            } );
-
-          }
-
-       } );
-
-      } );
-
-    </script>
-
-    <link rel="stylesheet" type="text/css" href="qunit.css" />
-
-  </head>
-
-  <body>
-
-    <h1 id="qunit-header">Virtual World Framework</h1>
-    <h2 id="qunit-banner"></h2>
-    <div id="qunit-testrunner-toolbar"></div>
-    <h2 id="qunit-userAgent"></h2>
-    <ol id="qunit-tests"></ol>
-
-    <div id="qunit-fixture">test markup, will be hidden</div>
-
-  </body>
-
-</html>

+ 0 - 186
support/client/test/drivers.html

@@ -1,186 +0,0 @@
-<!DOCTYPE html>
-
-<html>
-
-  <head>
-
-    <title>Virtual World Framework</title>
-
-    <script type="text/javascript" src="qunit.js"></script>
-
-    <script type="text/javascript" src="../lib/async.js"></script>
-
-    <script type="text/javascript" src="../lib/alea.js"></script>
-    <script type="text/javascript" src="../lib/mash.js"></script>
-
-    <script type="text/javascript" src="../lib/vwf.js"></script>
-    <script type="text/javascript" src="../lib/vwf/model/glge/glge-compiled.js"></script>
-
-    <script type="text/javascript" src="../lib/require.js"></script>
-
-    <script type="text/javascript">
-
-      require( {
-
-        baseUrl: "../lib",
-        paths: {
-          jquery: "jquery-1.10.2.min",
-        },
-
-      }, [
-
-        "domReady",
-        "utility.js",
-
-        // This is the common model implementation and an example model that connects the
-        // simulation to a WebGL scene manager.
-
-        "jquery",
-        "vwf/configuration",
-        "vwf/kernel/model", // explicitly loaded until vwf can load its dependencies
-        "vwf/model/glge",
-        "vwf/model/object",
-        "vwf/model/test",
-        "vwf/model/stage/log", // explicitly loaded until vwf can load its dependencies
-        "vwf/kernel/view", // explicitly loaded until vwf can load its dependencies
-        "vwf/view/test",
-        "vwf/view/glge",
-        "vwf/kernel/utility",
-        "vwf/utility",
-        "logger",
-
-      ], function( ready, testUtility ) {
-
-        // Test the kernel-driver interface.
-
-        ready( function() {
-
-          vwf.initialize(
-
-            // Models
-
-            [
-
-              "vwf/model/glge",
-              "vwf/model/object",
-
-              "vwf/model/test",
-              { "vwf/model/test": undefined },
-              { "vwf/model/test": null },
-              { "vwf/model/test": "single" },
-              { "vwf/model/test": [ "first", "second" ] },
-              { "vwf/model/test": [ [ "array" ] ] },
-
-            ],
-
-            // Views
-
-            [
-
-              "vwf/view/glge",
-              "vwf/view/test", // dummy to make the rest have the same indexes as the models
-
-              "vwf/view/test",
-              { "vwf/view/test": undefined },
-              { "vwf/view/test": null },
-              { "vwf/view/test": "single" },
-              { "vwf/view/test": [ "first", "second" ] },
-              { "vwf/view/test": [ [ "array" ] ] },
-
-            ]
-
-          );
-
-          test( "Models", function() {
-
-            equal( vwf.models.actual[0].module.id, "vwf/model/glge", "GLGE Model by number" );
-            equal( vwf.models.actual["vwf/model/glge"].module.id, "vwf/model/glge", "GLGE Model by name" );
-            equal( vwf.models.actual[0].module.id, vwf.models.actual["vwf/model/glge"].module.id, "GLGE Model by number and name" );
-
-            equal( vwf.models.actual[1].module.id, "vwf/model/object", "Object Model by number" );
-            equal( vwf.models.actual["vwf/model/object"].module.id, "vwf/model/object", "Object Model by name" );
-            equal( vwf.models.actual[1].module.id, vwf.models.actual["vwf/model/object"].module.id, "Object Model by number and name" );
-
-          } );
-
-          test ( "Model parameters", function() {
-
-            deepEqual( vwf.models.actual[2].arguments, [], "No arguments" );
-            deepEqual( vwf.models.actual[3].arguments, [], "No arguments, explict undefined " );
-            deepEqual( vwf.models.actual[4].arguments, [], "No arguments, explict null" );
-            deepEqual( vwf.models.actual[5].arguments, [ "single" ], "Single argument as a value" );
-            deepEqual( vwf.models.actual[6].arguments, [ "first", "second" ], "Multiple arguments as an array" );
-            deepEqual( vwf.models.actual[7].arguments, [ [ "array" ] ], "Array as an argument" );
-
-          } );
-
-          test( "Views", function() {
-            equal( vwf.views.actual[0].module.id, "vwf/view/glge", "GLGE View" );
-          } );
-
-          test ( "View parameters", function() {
-
-            deepEqual( vwf.views[2].arguments, [], "No arguments" );
-            deepEqual( vwf.views[3].arguments, [], "No arguments, explict undefined " );
-            deepEqual( vwf.views[4].arguments, [], "No arguments, explict null" );
-            deepEqual( vwf.views[5].arguments, [ "single" ], "Single argument as a value" );
-            deepEqual( vwf.views[6].arguments, [ "first", "second" ], "Multiple arguments as an array" );
-            deepEqual( vwf.views[7].arguments, [ [ "array" ] ], "Array as an argument" );
-
-          } );
-
-          test( "Shared state", function() {
-
-            var model_glge = vwf.models.actual["vwf/model/glge"];
-            var view_glge = vwf.views.actual["vwf/view/glge"];
-
-            var state_glge = model_glge.state; // === view_glge.state, hopefully.
-
-            // The GLGE model and view share state.
-
-            strictEqual( model_glge.state, view_glge.state, "GLGE state shared between " +
-                model_glge.module.id + " and " + view_glge.module.id );
-
-            // But they don't share it with any other model stage.
-
-            vwf.models.forEach( function( model ) {
-                while ( model ) {
-                    model === model_glge || notStrictEqual( model.state, state_glge, "GLGE state not shared with " + model.module.id );
-                    model = model.model;
-                }
-            } );
-
-            // Or with any other view stage.
-
-            vwf.views.forEach( function( view ) {
-                while ( view ) {
-                    view === view_glge || notStrictEqual( view.state, state_glge, "GLGE state not shared with " + view.module.id );
-                    view = view.view;
-                }
-            } );
-
-          } );
-         
-        } );
-
-      } );
-
-    </script>
-
-    <link rel="stylesheet" type="text/css" href="qunit.css" />
-
-  </head>
-
-  <body>
-
-    <h1 id="qunit-header">Virtual World Framework</h1>
-    <h2 id="qunit-banner"></h2>
-    <div id="qunit-testrunner-toolbar"></div>
-    <h2 id="qunit-userAgent"></h2>
-    <ol id="qunit-tests"></ol>
-
-    <div id="qunit-fixture">test markup, will be hidden</div>
-
-  </body>
-
-</html>

+ 0 - 584
support/client/test/events.html

@@ -1,584 +0,0 @@
-<!DOCTYPE html>
-
-<html>
-
-  <head>
-
-    <title>Virtual World Framework</title>
-
-    <script type="text/javascript" src="qunit.js"></script>
-
-    <script type="text/javascript" src="../lib/async.js"></script>
-
-    <script type="text/javascript" src="../lib/crypto.js"></script>
-    <script type="text/javascript" src="../lib/md5.js"></script>
-
-    <script type="text/javascript" src="../lib/alea.js"></script>
-    <script type="text/javascript" src="../lib/mash.js"></script>
-
-    <script type="text/javascript" src="../lib/vwf.js"></script>
-
-    <script type="text/javascript" src="../lib/require.js"></script>
-
-    <script type="text/javascript">
-
-      require( {
-
-        baseUrl: "../lib",
-        paths: {
-          jquery: "jquery-1.10.2.min",
-        },
-
-      }, [
-
-        "domReady",
-        "utility.js",
-        "vwf/utility",
-
-        "jquery",
-        "vwf/configuration",
-        "vwf/kernel/model",
-        "vwf/model/javascript",
-        "vwf/model/object",
-        "vwf/model/stage/log",
-        "vwf/kernel/view",
-        "vwf/kernel/utility",
-        "logger",
-
-      ], function( ready, testUtility, utility ) {
-
-        // Test events.
-          
-        ready( function() {
-
-          vwf.initialize(
-            /* models */ [ "vwf/model/javascript", "vwf/model/object" ],
-            /*  views */ [ ]
-          );
-
-          // Event firing directly from the kernel
-
-          asyncTest( "Event firing kernel", function() {
-
-            createFixture( function( nodeID, cleanup ) {
-
-              vwf.fireEvent( nodeID, "empty" );
-              deepEqual( vwf.execute( nodeID, "this.result" ), { event: "empty", result: [] }, "no parameters declared, no parameters passed" );
-
-              vwf.fireEvent( nodeID, "empty", [ true, 1 ] );
-              deepEqual( vwf.execute( nodeID, "this.result" ), { event: "empty", result: [ true, 1 ] }, "no parameters declared, parameters passed" );
-
-              vwf.fireEvent( nodeID, "parameters" );
-              deepEqual( vwf.execute( nodeID, "this.result" ), { event: "parameters", result: [] }, "parameters declared, no parameters passed" );
-
-              vwf.fireEvent( nodeID, "parameters", [ 'abc', false, 2 ] );
-              deepEqual( vwf.execute( nodeID, "this.result" ), { event: "parameters", result: [ 'abc', false, 2 ] }, "parameters declared, parameters passed" );
-
-              cleanup();
-              start();
-
-            } );
-
-          } );
-
-          // Event firing from JavaScript
-
-          asyncTest( "Event firing JavaScript", function() {
-
-            createFixture( function( nodeID, cleanup ) {
-
-              vwf.execute( nodeID, "this.empty()" );
-              deepEqual( vwf.execute( nodeID, "this.result" ), { event: "empty", result: [] }, "no parameters declared, no parameters passed" );
-
-              vwf.execute( nodeID, "this.empty( true, 1 )" );
-              deepEqual( vwf.execute( nodeID, "this.result" ), { event: "empty", result: [ true, 1 ] }, "no parameters declared, parameters passed" );
-
-              vwf.execute( nodeID, "this.parameters()" );
-              deepEqual( vwf.execute( nodeID, "this.result" ), { event: "parameters", result: [] }, "parameters declared, no parameters passed" );
-
-              vwf.execute( nodeID, "this.parameters( 'abc', false, 2 )" );
-              deepEqual( vwf.execute( nodeID, "this.result" ), { event: "parameters", result: [ 'abc', false, 2 ] }, "parameters declared, parameters passed" );
-
-              cleanup();
-              start();
-
-            } );
-
-          } );
-
-          // JavaScript handler with explicit context
-
-          asyncTest( "JavaScript handler explicit context", function() {
-
-            createFixtureParentChild( function( parentID, childID, baseID, cleanup ) {
-
-              vwf.execute( childID, "this.parent.base = this.events.add( function( result ) { this.result = result }, this )" );
-              vwf.fireEvent( parentID, "base", [ "explicit context" ] );
-              equal( vwf.execute( childID, "this.result" ), "explicit context", "invoked on child" );
-
-              cleanup();
-              start();
-
-            } );
-
-          } );
-
-          // JavaScript handler with no context
-
-          asyncTest( "JavaScript handler no context", function() {
-
-            createFixtureParentChild( function( parentID, childID, baseID, cleanup ) {
-
-              vwf.execute( childID, "this.parent.base = this.events.add( function( result ) { this.result = result } )" );
-              vwf.fireEvent( parentID, "base", [ "no context" ] );
-              equal( vwf.execute( 0, "this.result" ), "no context", "invoked on global root" );
-
-              cleanup();
-              start();
-
-            } );
-
-          } );
-
-          // JavaScript handler with implicit context
-
-          asyncTest( "JavaScript handler implicit context", function() {
-
-            createFixtureParentChild( function( parentID, childID, baseID, cleanup ) {
-
-              vwf.execute( childID, "this.parent.base = function( result ) { this.result = result }" );
-              vwf.fireEvent( parentID, "base", [ "implicit context" ] );
-              equal( vwf.execute( parentID, "this.result" ), "implicit context", "invoked on parent" ); // invoked on target
-
-              cleanup();
-              start();
-
-            } );
-
-          } );
-
-          // Event inheritance directly from the kernel
-
-          asyncTest( "Event inheritance kernel", function() {
-
-            createFixtureDerivedBase( function( derivedID, baseID, cleanup ) {
-
-              vwf.execute( derivedID, "this.derived = this.events.add( function( result ) { this.result = result }, this )" );
-              vwf.execute( derivedID, "this.base = this.events.add( function( result ) { this.result = result }, this )" );
-
-              vwf.execute( baseID, "this.derived = this.events.add( function( result ) { this.result = result }, this )" );
-              vwf.execute( baseID, "this.base = this.events.add( function( result ) { this.result = result }, this )" );
-
-              vwf.fireEvent( derivedID, "derived", [ 'derived-' + derivedID ] );
-              equal( vwf.execute( derivedID, "this.result" ), "derived-" + derivedID, "derived event from derived" );
-
-              vwf.fireEvent( derivedID, "base", [ 'base-' + derivedID ] );
-              equal( vwf.execute( derivedID, "this.result" ), "base-" + derivedID, "base event from derived" );
-
-              vwf.fireEvent( baseID, "derived", [ 'derived-' + baseID ] );
-              equal( vwf.execute( baseID, "this.result" ), undefined, "derived event not visible in base" );
-
-              vwf.fireEvent( baseID, "base", [ 'base-' + baseID ] );
-              equal( vwf.execute( baseID, "this.result" ), "base-" + baseID, "base event from base" );
-              
-              cleanup();
-              start();
-
-            } );
-
-          } );
-
-          // Event inheritance from JavaScript direct properties
-
-          asyncTest( "Event inheritance JavaScript direct", function() {
-
-            createFixtureDerivedBase( function( derivedID, baseID, cleanup ) {
-
-              vwf.execute( derivedID, "this.derived = this.events.add( function( result ) { this.result = result }, this )" );
-              vwf.execute( derivedID, "this.base = this.events.add( function( result ) { this.result = result }, this )" );
-
-              vwf.execute( baseID, "this.derived && ( this.derived = this.events.add( function( result ) { this.result = result } ), this )" );
-              vwf.execute( baseID, "this.base = this.events.add( function( result ) { this.result = result }, this )" );
-
-              vwf.execute( derivedID, "this.derived( 'derived-' + this.id )" );
-              equal( vwf.execute( derivedID, "this.result" ), "derived-" + derivedID, "derived event from derived" );
-
-              vwf.execute( derivedID, "this.base( 'base-' + this.id )" );
-              equal( vwf.execute( derivedID, "this.result" ), "base-" + derivedID, "base event from derived" );
-
-              vwf.execute( baseID, "this.derived && this.derived( 'derived-' + this.id )" );
-              equal( vwf.execute( baseID, "this.result" ), undefined, "derived event not visible in base" );
-
-              vwf.execute( baseID, "this.base( 'base-' + this.id )" );
-              equal( vwf.execute( baseID, "this.result" ), "base-" + baseID, "base event from base" );
-              
-              cleanup();
-              start();
-
-            } );
-
-          } );
-
-          // Event inheritance from JavaScript collection properties
-
-          asyncTest( "Event inheritance JavaScript collection", function() {
-
-            createFixtureDerivedBase( function( derivedID, baseID, cleanup ) {
-
-              vwf.execute( derivedID, "this.events.derived = this.events.add( function( result ) { this.result = result }, this )" );
-              vwf.execute( derivedID, "this.events.base = this.events.add( function( result ) { this.result = result }, this )" );
-
-              vwf.execute( baseID, "this.events.derived && ( this.events.derived = this.events.add( function( result ) { this.result = result } ), this )" );
-              vwf.execute( baseID, "this.events.base = this.events.add( function( result ) { this.result = result }, this )" );
-
-              vwf.execute( derivedID, "this.events.derived( 'derived-' + this.id )" );
-              equal( vwf.execute( derivedID, "this.result" ), "derived-" + derivedID, "derived event from derived" );
-
-              vwf.execute( derivedID, "this.events.base( 'base-' + this.id )" );
-              equal( vwf.execute( derivedID, "this.result" ), "base-" + derivedID, "base event from derived" );
-
-              vwf.execute( baseID, "this.events.derived && this.events.derived( 'derived-' + this.id )" );
-              equal( vwf.execute( baseID, "this.result" ), undefined, "derived event not visible in base" );
-
-              vwf.execute( baseID, "this.events.base( 'base-' + this.id )" );
-              equal( vwf.execute( baseID, "this.result" ), "base-" + baseID, "base event from base" );
-              
-              cleanup();
-              start();
-
-            } );
-
-          } );
-
-          // Event inheritance with self-targeted handlers
-
-          asyncTest( "Event inheritance self-targeted handlers", function() {
-
-            createFixtureDerivedBase( function( derivedID, baseID, cleanup ) {
-
-              vwf.execute( derivedID, "this.derived = function( result ) { this.result = ( this.result || [] ).concat( result + '-derived' ) }" );
-              vwf.execute( derivedID, "this.base = function( result ) { this.result = ( this.result || [] ).concat( result + '-derived' ) }" );
-
-              vwf.execute( baseID, "this.derived = function( result ) { this.result = ( this.result || [] ).concat( result + '-base' ) }" );
-              vwf.execute( baseID, "this.base = function( result ) { this.result = ( this.result || [] ).concat( result + '-base' ) }" );
-
-              vwf.fireEvent( derivedID, "derived", [ 'derived-' + derivedID ] );
-              deepEqual( vwf.execute( derivedID, "this.result" ), [ "derived-" + derivedID + "-derived" ], "derived event from derived receives handlers from derived" );
-              vwf.execute( derivedID, "this.result = []" );
-
-              vwf.fireEvent( derivedID, "base", [ 'base-' + derivedID ] );
-              deepEqual( vwf.execute( derivedID, "this.result" ), [ "base-" + derivedID + "-base", "base-" + derivedID + "-derived" ], "base event from derived receives handlers from base and derived" );
-
-              vwf.fireEvent( baseID, "derived", [ 'derived-' + baseID ] );
-              deepEqual( vwf.execute( baseID, "this.result" ), undefined, "derived event not visible in base" );
-
-              vwf.fireEvent( baseID, "base", [ 'base-' + baseID ] );
-              deepEqual( vwf.execute( baseID, "this.result" ), [ "base-" + baseID + "-base" ], "base event from base receives handlers from base" );
-              
-              cleanup();
-              start();
-
-            } );
-
-          } );
-
-          // Event listeners through JavaScript
-
-          asyncTest( "Event listeners JavaScript", function() {
-
-            createFixture( function( nodeID, cleanup ) {
-
-              // Create two functions on the `result` object to serve as listeners.
-
-              vwf.execute( nodeID, "this.result.listener1 = function() { this.result.count1 = ( this.result.count1 || 0 ) + 5 }" );
-              vwf.execute( nodeID, "this.result.listener2 = function() { this.result.count2 = ( this.result.count2 || 0 ) + 7 }" );
-
-              // Add the listeners to the `empty` event and save the listener IDs on the `result` object.
-
-              vwf.execute( nodeID, "this.empty = this.events.add( this.result.listener1, this, function( listenerID ) { this.result.listener1ID = listenerID } )" );
-              vwf.execute( nodeID, "this.empty = this.events.add( this.result.listener2, this, function( listenerID ) { this.result.listener2ID = listenerID } )" );
-
-              // Fire the event. Both listeners should execute.
-
-              vwf.execute( nodeID, "this.empty()" );
-              equal( vwf.execute( nodeID, "this.result.count1" ), 5, "" );
-              equal( vwf.execute( nodeID, "this.result.count2" ), 7, "" );
-
-              // Remove the first listener by ID and fire the event. Only the second listener should
-              // execute. `result.listener1ID` is not valid after the listener has been removed.
-
-              vwf.execute( nodeID, "this.empty = this.events.remove( this.result.listener1ID )" );
-              vwf.execute( nodeID, "this.empty()" );
-              equal( vwf.execute( nodeID, "this.result.count1" ), 5, "" );
-              equal( vwf.execute( nodeID, "this.result.count2" ), 14, "" );
-
-              // Add the first listener back and fire the event. Both listeners should execute.
-
-              vwf.execute( nodeID, "this.empty = this.events.add( this.result.listener1, this )" );
-              vwf.execute( nodeID, "this.empty()" );
-              equal( vwf.execute( nodeID, "this.result.count1" ), 10, "" );
-              equal( vwf.execute( nodeID, "this.result.count2" ), 21, "" );
-
-              // Remove the second listener by ID and fire the event. Only the first listener should
-              // execute. `result.listener2ID` is not valid after the listener has been removed.
-
-              vwf.execute( nodeID, "this.empty = this.events.remove( this.result.listener2ID )" );
-              vwf.execute( nodeID, "this.empty()" );
-              equal( vwf.execute( nodeID, "this.result.count1" ), 15, "" );
-              equal( vwf.execute( nodeID, "this.result.count2" ), 21, "" );
-
-              // Remove the first listener by function reference and fire the event. Neither
-              // listener should execute.
-
-              vwf.execute( nodeID, "this.empty = this.events.remove( this.result.listener1 )" );
-              vwf.execute( nodeID, "this.empty()" );
-              equal( vwf.execute( nodeID, "this.result.count1" ), 15, "" );
-              equal( vwf.execute( nodeID, "this.result.count2" ), 21, "" );
-
-              // Add both listeners back and fire the event. Both listeners should execute.
-
-              vwf.execute( nodeID, "this.empty = this.events.add( this.result.listener1, this )" );
-              vwf.execute( nodeID, "this.empty = this.events.add( this.result.listener2, this )" );
-              vwf.execute( nodeID, "this.empty()" );
-              equal( vwf.execute( nodeID, "this.result.count1" ), 20, "" );
-              equal( vwf.execute( nodeID, "this.result.count2" ), 28, "" );
-
-              // Flush all listeners with the context of the target node and fire the event. Both
-              // listeners should be removed and neither should execute.
-
-              vwf.execute( nodeID, "this.empty = this.events.flush( this )" );
-              vwf.execute( nodeID, "this.empty()" );
-              equal( vwf.execute( nodeID, "this.result.count1" ), 20, "" );
-              equal( vwf.execute( nodeID, "this.result.count2" ), 28, "" );
-
-              // Do a getEvent to verify that kernel recognizes that event listeners are gone
-
-              try {
-                var testEvent = vwf.getEvent( nodeID, "empty" );
-                equal( testEvent.listeners, undefined, "" );
-              } catch( e ) {
-                equal( e.message, "No error", "" );
-              }
-
-              // Add a listener with no context, which should execute in the context of the global
-              // node.
-
-              vwf.execute( nodeID, "this.empty = function() {}" );
-              vwf.execute( nodeID, "this.empty()" );  // TODO: how to test?
-
-              cleanup();
-              start();
-
-            } );
-
-          } );
-
-          // Event changes and node state
-
-          var changesComponentDescriptor = {
-            events: {
-              event: null
-            },
-            scripts: [
-              "this.events.event = this.events.add( function() { return 'original' } )"
-            ]
-          };
-
-          var changesComponentURI =
-            testUtility.dataURIFromDescriptor( changesComponentDescriptor );
-
-          var changesEventDescriptor = {
-            listeners: [ {
-              id: 1,  // from the node's sequence counter when the listener was added
-              body: "return 'original'",
-              type: "application/javascript",
-            } ]
-          };
-
-          var changesEventNewBody = "return 'changed'";
-
-          var changesEventDescriptorChanged = {
-            listeners: [
-              utility.merge( {}, changesEventDescriptor.listeners[0], {
-                body: changesEventNewBody
-              } )
-            ]
-          };
-
-          asyncTest( "Event changes in node state", function() {
-
-            vwf.createNode( changesComponentURI, function( nodeID ) {
-
-              deepEqual( vwf.getEvent( nodeID, "event" ), changesEventDescriptor, "Unchanged" );
-
-              vwf.setEventListener( nodeID, "event", 1, changesEventNewBody );
-
-              deepEqual( vwf.getNode( nodeID ), {
-                patches:
-                  changesComponentURI,
-                events: {
-                  event: changesEventDescriptorChanged,
-                }
-              }, "Event changed" );
-
-              vwf.deleteNode( nodeID );
-              start();
-
-            } );
-
-          } );
-
-          asyncTest( "Event changes to node state", function() {
-
-            vwf.createNode( changesComponentURI, function( nodeID ) {
-
-              deepEqual( vwf.getEvent( nodeID, "event" ), changesEventDescriptor, "Unchanged" );
-
-              vwf.setNode( nodeID, {
-                patches:
-                  changesComponentURI,
-                events: {
-                  event: changesEventDescriptorChanged,
-                }
-              } );
-
-              deepEqual( vwf.getEvent( nodeID, "event" ).listeners[0].body, changesEventNewBody, "Event changed from node state" );
-
-              vwf.deleteNode( nodeID );
-              start();
-
-            } );
-
-          } );
-
-          // == Helper functions =====================================================================
-
-          // Create a node with events to fire.
-
-          function createFixture( callback ) {
-
-            vwf.createChild( 0, testUtility.uniqueName( "node" ), {
-
-              extends:
-                "http://vwf.example.com/node.vwf",
-
-              events: {
-
-                empty: undefined,
-                parameters: { parameters: [] },
-
-              },
-
-              scripts: [
-                "this.result = {}",
-                "this.empty = this.events.add( function() { this.result.event = 'empty'; this.result.result = Array.prototype.slice.call( arguments ) }, this )",
-                "this.parameters = this.events.add( function() { this.result.event = 'parameters'; this.result.result = Array.prototype.slice.call( arguments ) }, this )",
-              ],
-
-            }, undefined, function( nodeID ) {
-
-                callback( nodeID, function() {
-                  vwf.deleteNode( nodeID );
-                } );
-
-            } );
-
-          }
-
-          // Create a parent and two child nodes with events to fire.
-
-          function createFixtureParentChild( callback ) {
-
-            // Prototype for the nodes.
-
-            vwf.createNode( {
-
-              extends: "http://vwf.example.com/node.vwf",
-              events: { base: undefined },
-
-            }, function( baseID ) {
-
-              // Parent node.
-
-              vwf.createChild( 0, testUtility.uniqueName( "parent" ), {
-
-                extends: baseID,
-
-              }, undefined, function( parentID ) {
-
-                // Child node.
-
-                vwf.createChild( parentID, testUtility.uniqueName( "child" ), {
-
-                  extends: baseID,
-
-                }, undefined, function( childID ) {
-
-                  callback( parentID, childID, baseID, function() {
-                    vwf.deleteNode( childID );
-                    vwf.deleteNode( parentID );
-                    vwf.deleteNode( baseID );
-                  } );
-
-                } );
-
-              } );
-
-            } );
-
-          }
-         
-          // Create a node with two levels of inheritance and events to fire.
-
-          function createFixtureDerivedBase( callback ) {
-
-            vwf.createNode( {
-
-              extends: "http://vwf.example.com/node.vwf",
-              events: { base: undefined },
-              scripts: [ ],
-
-            }, function( baseID ) {
-
-              vwf.createNode( {
-
-                extends: baseID,
-                events: { derived: undefined },
-                scripts: [ ],
-
-              }, function( derivedID ) {
-
-                callback( derivedID, baseID, function() {
-                  vwf.deleteNode( derivedID );
-                  vwf.deleteNode( baseID );
-                } );
-
-              } );
-
-            } );
-
-          }
-
-       } );
-
-      } );
-
-    </script>
-
-    <link rel="stylesheet" type="text/css" href="qunit.css" />
-
-  </head>
-
-  <body>
-
-    <h1 id="qunit-header">Virtual World Framework</h1>
-    <h2 id="qunit-banner"></h2>
-    <div id="qunit-testrunner-toolbar"></div>
-    <h2 id="qunit-userAgent"></h2>
-    <ol id="qunit-tests"></ol>
-
-    <div id="qunit-fixture">test markup, will be hidden</div>
-
-  </body>
-
-</html>

+ 0 - 956
support/client/test/future.html

@@ -1,956 +0,0 @@
-<!DOCTYPE html>
-
-<html>
-
-  <head>
-
-    <title>Virtual World Framework</title>
-
-    <script type="text/javascript" src="qunit.js"></script>
-
-    <script type="text/javascript" src="../lib/async.js"></script>
-
-    <script type="text/javascript" src="../lib/crypto.js"></script>
-    <script type="text/javascript" src="../lib/md5.js"></script>
-
-    <script type="text/javascript" src="../lib/alea.js"></script>
-    <script type="text/javascript" src="../lib/mash.js"></script>
-
-    <script type="text/javascript" src="../lib/vwf.js"></script>
-
-    <script type="text/javascript" src="../lib/require.js"></script>
-
-    <script type="text/javascript">
-
-      require( {
-
-        baseUrl: "../lib",
-        paths: {
-          jquery: "jquery-1.10.2.min",
-        },
-
-      }, [
-
-        "domReady",
-        "utility.js",
-
-        "jquery",
-        "vwf/configuration",
-        "vwf/kernel/model",
-        "vwf/model/javascript",
-        "vwf/model/object",
-        "vwf/model/stage/log",
-        "vwf/kernel/view",
-        "vwf/view/document",
-        "vwf/kernel/utility",
-        "vwf/utility",
-        "logger",
-
-      ], function( ready, testUtility ) {
-
-        // Test the kernel "future" interface.
-
-        ready( function() {
-
-          vwf.initialize(
-            /* models */ [ "vwf/model/javascript", "vwf/model/object" ],
-            /*  views */ [ "vwf/view/document" ]
-          );
-
-          var kernel = require( "vwf/kernel/model" ).create( vwf ); // connect through the kernel's model interface
-
-          // Time passage from future actions and the periodic interval.
-
-          asyncTest( "Time passage", function() {
-
-            createFixture( function( fixtureID, cleanup ) {
-
-              // Calculate times. We need to find two system tick times and additional times between
-              // the system ticks. This calculation will need to be adjusted if the single-user tick
-              // interval changes.
-
-              var interval = 10; // assumed periodic tick interval
-
-              var timeStart = ( Math.floor( Math.round( vwf.time() * 1000 ) / interval ) *
-                interval + interval ) / 1000; // next periodic tick
-
-              var timeStop = ( Math.floor( Math.round( vwf.time() * 1000 ) / interval ) *
-                interval + interval + interval ) / 1000; // the following periodic tick
-
-              var time1 = fixed3( timeStart + 0.001 );
-              var time2 = fixed3( timeStart + 0.002 );
-              var time3 = fixed3( timeStart + 0.003 );
-
-              timeStart = fixed3( timeStart );
-              timeStop = fixed3( timeStop );
-
-              // Create a function to drop tags by timestamp in this.property.
-
-              kernel.execute( fixtureID, "this.mark = function( tag ) { " +
-                "var time = this.time.toFixed(3); " +
-                "this.property[time] || ( this.property[time] = [] ); " +
-                "this.property[time].push( tag ); " +
-              "}" );
-
-              kernel.execute( fixtureID, "this.property = {}" );
-
-              // Schedule the actions.
-
-              kernel.execute( fixtureID, "", undefined, time1 ); // nothing
-
-              kernel.execute( fixtureID, "this.mark( 'one' )", undefined, time2 ); // one thing
-
-              kernel.execute( fixtureID, "this.mark( 'two' )", undefined, time3 ); // two things
-              kernel.execute( fixtureID, "this.mark( 'three' )", undefined, time3 );
-
-              kernel.execute( fixtureID, "", undefined, timeStop ); // nothing, exactly on the tick
-
-              // Wait and test.
-
-              testUtility.runFutureAssertions( function( time ) {
-
-                vwf.execute( fixtureID, "this.mark( 'tick' )" ); // tick, just before assertions
-                
-              }, [
-
-                { absolute: timeStart, assertion: function() {
-                    deepEqual( vwf.execute( fixtureID, "this.property" )[ timeStart ], [ "tick" ], "tick at the periodic interval" ) } },
-
-                { absolute: time1, assertion: function() {
-                    deepEqual( vwf.execute( fixtureID, "this.property" )[ time1 ], [ "tick" ], "tick when a future action executes" ) } },
-
-                { absolute: time2, assertion: function() {
-                    deepEqual( vwf.execute( fixtureID, "this.property" )[ time2 ], [ "tick", "one" ], "tick is before the future action" ) } },
-
-                { absolute: time3, assertion: function() {
-                    deepEqual( vwf.execute( fixtureID, "this.property" )[ time3 ], [ "tick", "two", "three" ], "one tick per group of future actions" ) } },
-
-                { absolute: timeStop, assertion: function() {
-                    deepEqual( vwf.execute( fixtureID, "this.property" )[ timeStop ], [ "tick" ], "one tick with the future action at the periodic interval time" ) } },
-
-              ], cleanup );
-
-            } );
-
-          } );
-
-          // Future JavaScript API
-
-          asyncTest( "Future JavaScript", function() {
-
-            createFixture( function( fixtureID, cleanup ) {
-
-              vwf.setProperty( fixtureID, "property", undefined );
-
-              var time0 = fixed3( vwf.time() );
-              var time1 = fixed3( time0 + 0.011 );
-              var time2 = fixed3( time0 + 0.012 );
-              var time3 = fixed3( time0 + 0.013 );
-
-              vwf.execute( fixtureID, "this.in( " + "0.011" + " ).property = 'in'" );
-              vwf.execute( fixtureID, "this.at( " + time2 + " ).property = 'at'" );
-              vwf.execute( fixtureID, "this.future( " + "0.013" + " ).property = 'future'" );
-
-              testUtility.runFutureAssertions( [
-
-                { absolute: time1, assertion: function() {
-                    equal( vwf.getProperty( fixtureID, "property" ), "in", "relative" ) } },
-
-                { absolute: time2, assertion: function() {
-                    equal( vwf.getProperty( fixtureID, "property" ), "at", "absolute" ) } },
-
-                { absolute: time3, assertion: function() {
-                    equal( vwf.getProperty( fixtureID, "property" ), "future", "relative alias" ) } },
-
-              ], cleanup );
-
-            } );
-
-          } );
-
-          // Immediate actions directly to the kernel
-
-          asyncTest( "Immediate kernel", function() {
-
-            createFixture( function( fixtureID, cleanup ) {
-
-              kernel.setProperty( fixtureID, "property", "property", undefined );
-              equal( vwf.getProperty( fixtureID, "property" ), "property", "immediate property" );
-
-              kernel.callMethod( fixtureID, "method", [ "method" ], undefined );
-              equal( vwf.getProperty( fixtureID, "property" ), "method", "immediate method" );
-
-              kernel.fireEvent( fixtureID, "event", [ "event" ], undefined );
-              equal( vwf.getProperty( fixtureID, "property" ), "event", "immediate event" );
-
-              cleanup();
-              start();
-
-            } );
-
-          } );
-
-          // Immediate actions through JavaScript
-
-          asyncTest( "Immediate JavaScript", function() {
-
-            createFixture( function( fixtureID, cleanup ) {
-
-              vwf.execute( fixtureID, "this.property = 'property'" );
-              equal( vwf.getProperty( fixtureID, "property" ), "property", "immediate property" );
-
-              vwf.execute( fixtureID, "this.method( 'method' )" );
-              equal( vwf.getProperty( fixtureID, "property" ), "method", "immediate method" );
-
-              vwf.execute( fixtureID, "this.event( 'event' )" );
-              equal( vwf.getProperty( fixtureID, "property" ), "event", "immediate event" );
-
-              cleanup();
-              start();
-
-            } );
-
-          } );
-
-          // Future actions directly to the kernel
-
-          asyncTest( "Future kernel", function() {
-
-            createFixture( function( fixtureID, cleanup ) {
-
-              vwf.setProperty( fixtureID, "property", undefined );
-              equal( vwf.getProperty( fixtureID, "property" ), undefined, "future initialized" );
-
-              kernel.setProperty( fixtureID, "property", "property", -0.001 );
-              kernel.callMethod( fixtureID, "method", [ "method" ], -0.002 );
-              kernel.fireEvent( fixtureID, "event", [ "event" ], -0.003 );
-
-              equal( vwf.getProperty( fixtureID, "property" ), undefined, "future queued" );
-
-              testUtility.runFutureAssertions( [
-
-                { relative: 0.001, assertion: function() {
-                    equal( vwf.getProperty( fixtureID, "property" ), "property", "future property" ) } },
-
-                { relative: 0.002, assertion: function() {
-                    equal( vwf.getProperty( fixtureID, "property" ), "method", "future method" ) } },
-
-                { relative: 0.003, assertion: function() {
-                    equal( vwf.getProperty( fixtureID, "property" ), "event", "future event" ) } },
-
-              ], cleanup );
-
-            } );
-
-          } );
-
-          // Future actions through JavaScript
-
-          asyncTest( "Future JavaScript", function() {
-
-            createFixture( function( fixtureID, cleanup ) {
-
-              vwf.setProperty( fixtureID, "property", undefined );
-              equal( vwf.getProperty( fixtureID, "property" ), undefined, "future initialized" );
-
-              vwf.execute( fixtureID, "this.future( 0.001 ).property = 'property'" );
-              vwf.execute( fixtureID, "this.future( 0.002 ).method( 'method' )" );
-              vwf.execute( fixtureID, "this.future( 0.003 ).event( 'event' )" );
-
-              equal( vwf.getProperty( fixtureID, "property" ), undefined, "future queued" );
-
-              testUtility.runFutureAssertions( [
-
-                { relative: 0.001, assertion: function() {
-                    equal( vwf.getProperty( fixtureID, "property" ), "property", "future property" ) } },
-
-                { relative: 0.002, assertion: function() {
-                    equal( vwf.getProperty( fixtureID, "property" ), "method", "future method" ) } },
-
-                { relative: 0.003, assertion: function() {
-                    equal( vwf.getProperty( fixtureID, "property" ), "event", "future event" ) } },
-
-              ], cleanup );
-
-            } );
-
-          } );
-
-          // Future inherited actions through JavaScript direct properties
-
-          asyncTest( "Future JavaScript inherited direct", function() {
-
-            createFixtureDerivedBase( function( derivedID, baseID, cleanup ) {
-
-              equal( vwf.getProperty( derivedID, "derived" ), "derived", "derived in derived initialized" );
-              equal( vwf.getProperty( derivedID, "base" ), "base", "base in derived initialized" ); // inherited
-              equal( vwf.getProperty( baseID, "base" ), "base", "base in base" );
-
-              vwf.execute( derivedID, "this.future( 0.001 ).derived = 'derived updated'" );
-              vwf.execute( derivedID, "this.future( 0.002 ).base = 'base updated'" ); // inherit from base, assign to derived
-              
-              equal( vwf.getProperty( derivedID, "derived" ), "derived", "derived in derived queued" );
-              equal( vwf.getProperty( derivedID, "base" ), "base", "base in derived queued" ); // still inherited
-              equal( vwf.getProperty( baseID, "base" ), "base", "base in base unchanged" );
-
-              testUtility.runFutureAssertions( [
-
-                { relative: 0.001, assertion: function() {
-                    equal( vwf.getProperty( derivedID, "derived" ), "derived updated", "derived in derived executed" ) } },
-
-                { relative: 0.002, assertion: function() {
-                    equal( vwf.getProperty( derivedID, "base" ), "base updated", "base in derived executed" ) // no longer inherited
-                    equal( vwf.getProperty( baseID, "base" ), "base", "base in base unchanged" ) } },
-
-              ], cleanup );
-
-            } );
-
-          } );
-
-          // Future inherited actions through JavaScript collection properties
-
-          asyncTest( "Future JavaScript inherited collection", function() {
-
-            createFixtureDerivedBase( function( derivedID, baseID, cleanup ) {
-
-              equal( vwf.getProperty( derivedID, "derived" ), "derived", "derived in derived initialized" );
-              equal( vwf.getProperty( derivedID, "base" ), "base", "base in derived initialized" ); // inherited
-              equal( vwf.getProperty( baseID, "base" ), "base", "base in base" );
-
-              vwf.execute( derivedID, "this.future( 0.001 ).properties.derived = 'derived updated'" );
-              vwf.execute( derivedID, "this.future( 0.002 ).properties.base = 'base updated'" ); // inherit from base, assign to derived
-              
-              equal( vwf.getProperty( derivedID, "derived" ), "derived", "derived in derived queued" );
-              equal( vwf.getProperty( derivedID, "base" ), "base", "base in derived queued" ); // still inherited
-              equal( vwf.getProperty( baseID, "base" ), "base", "base in base unchanged" );
-
-              testUtility.runFutureAssertions( [
-
-                { relative: 0.001, assertion: function() {
-                    equal( vwf.getProperty( derivedID, "derived" ), "derived updated", "derived in derived executed" ) } },
-
-                { relative: 0.002, assertion: function() {
-                    equal( vwf.getProperty( derivedID, "base" ), "base updated", "base in derived executed" ) // no longer inherited
-                    equal( vwf.getProperty( baseID, "base" ), "base", "base in base unchanged" ) } },
-
-              ], cleanup );
-
-            } );
-
-          } );
-
-          // -- Interactions between reflector messages and future messages ------------------------
-
-          // The queue is must retain a well-defined order when future actions and reflector actions
-          // share the same time, even when reflector messages have not arrived at the client yet.
-          // 
-          // For a sequence of messages having the same time:
-          // 
-          //   - New future messages are inserted after other future messages and before any
-          //     reflector messages.
-          //     
-          //   - New reflector messages are appended after any future messages and after any other
-          //     reflector messages.
-
-          // r0( f0 ) => r0 f0
-
-          asyncTest( "Reflector action generating a future action for the same time", function() {
-
-            createFixtureQueue( function( fixtureID, cleanup ) {
-
-              vwf.execute( fixtureID, "this.methods.log( '- r0 scheduled' )" );
-              vwf.send( fixtureID, "callMethod", "reflector", [ [ "r0", [ 0, "f0" ] ] ], 0 );
-
-              testUtility.runFutureAssertions( [
-
-                { relative: 0.010, assertion: function() {
-                    deepEqual( vwf.getProperty( fixtureID, "log" ), [
-                      "- r0 scheduled",   // at time 0, for time 0
-                      "r0 executed",      // at time 0
-                      "- f0 scheduled",   // at time 0, for time 0
-                      "f0 executed",      // at time 0
-                    ], "reflector action then future action" ) } },
-
-              ], cleanup );
-
-            } );
-
-          } );
-
-          // r0( f1 ) => r0 f1
-
-          asyncTest( "Reflector action generating a future action for a later time", function() {
-
-            createFixtureQueue( function( fixtureID, cleanup ) {
-
-              vwf.execute( fixtureID, "this.methods.log( '- r0 scheduled' )" );
-              vwf.send( fixtureID, "callMethod", "reflector", [ [ "r0", [ 0.001, "f1" ] ] ], 0 );
-
-              testUtility.runFutureAssertions( [
-
-                { relative: 0.010, assertion: function() {
-                    deepEqual( vwf.getProperty( fixtureID, "log" ), [
-                      "- r0 scheduled",   // at time 0, for time 0
-                      "r0 executed",      // at time 0
-                      "- f1 scheduled",   // at time 0, for time 1
-                      "f1 executed"       // at time 1
-                    ], "reflector action then future action" ) } },
-
-              ], cleanup );
-
-            } );
-
-          } );
-
-          // r0( f0a, f0b ) => r0 f0a f0b
-
-          asyncTest( "Reflector action generating multiple future actions for the same time", function() {
-
-            createFixtureQueue( function( fixtureID, cleanup ) {
-
-              vwf.execute( fixtureID, "this.methods.log( '- r0 scheduled' )" );
-              vwf.send( fixtureID, "callMethod", "reflector", [ [ "r0", [ 0, "f0a", 0, "f0b" ] ] ], 0 );
-
-              testUtility.runFutureAssertions( [
-
-                { relative: 0.010, assertion: function() {
-                    deepEqual( vwf.getProperty( fixtureID, "log" ), [
-                      "- r0 scheduled",   // at time 0, for time 0
-                      "r0 executed",      // at time 0
-                      "- f0a scheduled",  // at time 0, for time 0
-                      "- f0b scheduled",  // at time 0, for time 0
-                      "f0a executed",     // at time 0
-                      "f0b executed",     // at time 0
-                    ], "reflector action then future actions in the order of arrival" ) } },
-
-              ], cleanup );
-
-            } );
-
-          } );
-
-          // r0( f1a, f1b ) => r0 f1a f1b
-
-          asyncTest( "Reflector action generating multiple future actions for the same later time", function() {
-
-            createFixtureQueue( function( fixtureID, cleanup ) {
-
-              vwf.execute( fixtureID, "this.methods.log( '- r0 scheduled' )" );
-              vwf.send( fixtureID, "callMethod", "reflector", [ [ "r0", [ 0.001, "f1a", 0.001, "f1b" ] ] ], 0 );
-
-              testUtility.runFutureAssertions( [
-
-                { relative: 0.010, assertion: function() {
-                    deepEqual( vwf.getProperty( fixtureID, "log" ), [
-                      "- r0 scheduled",   // at time 0, for time 0
-                      "r0 executed",      // at time 0
-                      "- f1a scheduled",  // at time 0, for time 1
-                      "- f1b scheduled",  // at time 0, for time 1
-                      "f1a executed",     // at time 1
-                      "f1b executed",     // at time 1
-                    ], "reflector action then future actions in the order of arrival" ) } },
-
-              ], cleanup );
-
-            } );
-
-          } );
-
-          // r0( f1 ) r1 ...  => r0 f1 r1
-
-          asyncTest( "Reflector action generating a future action for a later time, with a reflector " +
-            "action for that same time arriving beforehand", function() {
-
-            createFixtureQueue( function( fixtureID, cleanup ) {
-
-              vwf.execute( fixtureID, "this.methods.log( '- r0 scheduled' )" );
-              vwf.send( fixtureID, "callMethod", "reflector", [ [ "r0", [ 0.001, "f1" ] ] ], 0 );
-
-              vwf.execute( fixtureID, "this.methods.log( '- r1 scheduled' )" );
-              vwf.send( fixtureID, "callMethod", "reflector", [ [ "r1" ] ], -0.001 );
-
-              testUtility.runFutureAssertions( [
-
-                { relative: 0.010, assertion: function() {
-                    deepEqual( vwf.getProperty( fixtureID, "log" ), [
-                      "- r0 scheduled",   // at time 0, for time 0
-                      "- r1 scheduled",   // at time 0, for time 1
-                      "r0 executed",      // at time 0
-                      "- f1 scheduled",   // at time 0, for time 1
-                      "f1 executed",      // at time 1
-                      "r1 executed",      // at time 1
-                    ], "reflector action, later future action, then bounding reflector action" ) } },
-
-              ], cleanup );
-
-            } );
-
-          } );
-
-          // r0( f1 ) ... r1 => r0 f1 r1
-
-          asyncTest( "Reflector action generating a future action for a later time, with a reflector " +
-              "action for that same time arriving afterwards", function() {
-
-            createFixtureQueue( function( fixtureID, cleanup ) {
-
-              vwf.execute( fixtureID, "this.methods.log( '- r0 scheduled' )" );
-              vwf.send( fixtureID, "callMethod", "reflector", [ [ "r0", [ 0.001, "f1" ] ] ], 0 );
-
-              testUtility.runFutureAssertions( [
-
-                { relative: 0.000, assertion: function() {
-                    vwf.execute( fixtureID, "this.methods.log( '- r1 scheduled' )" );
-                    vwf.send( fixtureID, "callMethod", "reflector", [ [ "r1" ] ], -0.001 ) } },
-
-                { relative: 0.010, assertion: function() {
-                    deepEqual( vwf.getProperty( fixtureID, "log" ), [
-                      "- r0 scheduled",   // at time 0, for time 0
-                      "r0 executed",      // at time 0
-                      "- f1 scheduled",   // at time 0, for time 1
-                      "- r1 scheduled",   // at time 0+, for time 1
-                      "f1 executed",      // at time 1
-                      "r1 executed",      // at time 1
-                    ], "reflector action, later future action, then bounding reflector action" ) } },
-
-              ], cleanup );
-
-            } );
-
-          } );
-
-          // r0( f1a, f1b ) r1a r1b ... => r0 f1a f1b r1a r1b
-
-          asyncTest( "Reflector action generating multiple future actions for the same later time, " +
-            "with multiple reflector actions for that time arriving beforehand", function() {
-
-            createFixtureQueue( function( fixtureID, cleanup ) {
-
-              vwf.execute( fixtureID, "this.methods.log( '- r0 scheduled' )" );
-              vwf.send( fixtureID, "callMethod", "reflector", [ [ "r0", [ 0.001, "f1a", 0.001, "f1b" ] ] ], 0 );
-
-              vwf.execute( fixtureID, "this.methods.log( '- r1a scheduled' )" );
-              vwf.send( fixtureID, "callMethod", "reflector", [ [ "r1a" ] ], -0.001 );
-
-              vwf.execute( fixtureID, "this.methods.log( '- r1b scheduled' )" );
-              vwf.send( fixtureID, "callMethod", "reflector", [ [ "r1b" ] ], -0.001 );
-
-              testUtility.runFutureAssertions( [
-
-                { relative: 0.010, assertion: function() {
-                    deepEqual( vwf.getProperty( fixtureID, "log" ), [
-                      "- r0 scheduled",   // at time 0, for time 0
-                      "- r1a scheduled",  // at time 0, for time 1
-                      "- r1b scheduled",  // at time 0, for time 1
-                      "r0 executed",      // at time 0
-                      "- f1a scheduled",  // at time 0, for time 1
-                      "- f1b scheduled",  // at time 0, for time 1
-                      "f1a executed",     // at time 1
-                      "f1b executed",     // at time 1
-                      "r1a executed",     // at time 1
-                      "r1b executed",     // at time 1
-                    ], "reflector action, later future actions, then bounding reflector actions" ) } },
-
-              ], cleanup );
-
-            } );
-
-          } );
-
-          // r0( f1a, f1b ) ... r1a r1b => r0 f1a f1b r1a r1b
-
-          asyncTest( "Reflector action generating multiple future actions for the same later time, " +
-            "with multiple reflector actions for that time arriving afterwards", function() {
-
-            createFixtureQueue( function( fixtureID, cleanup ) {
-
-              vwf.execute( fixtureID, "this.methods.log( '- r0 scheduled' )" );
-              vwf.send( fixtureID, "callMethod", "reflector", [ [ "r0", [ 0.001, "f1a", 0.001, "f1b" ] ] ], 0 );
-
-              testUtility.runFutureAssertions( [
-
-                { relative: 0.000, assertion: function() {
-                    vwf.execute( fixtureID, "this.methods.log( '- r1a scheduled' )" );
-                    vwf.send( fixtureID, "callMethod", "reflector", [ [ "r1a" ] ], -0.001 ) } },
-
-                { relative: 0.000, assertion: function() {
-                    vwf.execute( fixtureID, "this.methods.log( '- r1b scheduled' )" );
-                    vwf.send( fixtureID, "callMethod", "reflector", [ [ "r1b" ] ], -0.001 ) } },
-
-                { relative: 0.010, assertion: function() {
-                    deepEqual( vwf.getProperty( fixtureID, "log" ), [
-                      "- r0 scheduled",   // at time 0, for time 0
-                      "r0 executed",      // at time 0
-                      "- f1a scheduled",  // at time 0, for time 1
-                      "- f1b scheduled",  // at time 0, for time 1
-                      "- r1a scheduled",  // at time 0+, for time 1
-                      "- r1b scheduled",  // at time 0+, for time 1
-                      "f1a executed",     // at time 1
-                      "f1b executed",     // at time 1
-                      "r1a executed",     // at time 1
-                      "r1b executed",     // at time 1
-                    ], "reflector action, later future actions, then bounding reflector actions" ) } },
-
-              ], cleanup );
-
-            } );
-
-          } );
-
-          // r0( f1 ) r1a( f1a ) r1b ... => r0 f1 r1a f1a r1b
-
-          asyncTest( "Reflector action generating a future action for a later time, " +
-            "with a reflector action for that same time generating a future action for the same time, " +
-            "followed by another reflector action for that same time", function() {
-
-            createFixtureQueue( function( fixtureID, cleanup ) {
-
-              vwf.execute( fixtureID, "this.methods.log( '- r0 scheduled' )" );
-              vwf.send( fixtureID, "callMethod", "reflector", [ [ "r0", [ 0.001, "f1" ] ] ], 0 );
-
-              vwf.execute( fixtureID, "this.methods.log( '- r1a scheduled' )" );
-              vwf.send( fixtureID, "callMethod", "reflector", [ [ "r1a", [ 0, "f1a" ] ] ], -0.001 );
-
-              vwf.execute( fixtureID, "this.methods.log( '- r1b scheduled' )" );
-              vwf.send( fixtureID, "callMethod", "reflector", [ [ "r1b" ] ], -0.001 );
-
-              testUtility.runFutureAssertions( [
-
-                { relative: 0.020, assertion: function() {
-                    deepEqual( vwf.getProperty( fixtureID, "log" ), [
-                      "- r0 scheduled",   // at time 0, for time 0
-                      "- r1a scheduled",  // at time 0, for time 1
-                      "- r1b scheduled",  // at time 0, for time 1
-                      "r0 executed",      // at time 0
-                      "- f1 scheduled",   // at time 0, for time 1
-                      "f1 executed",      // at time 1
-                      "r1a executed",     // at time 1
-                      "- f1a scheduled",  // at time 1, for time 1
-                      "f1a executed",     // at time 1
-                      "r1b executed",     // at time 1
-                    ], "reflector action, future action, first bounding reflector action, " +
-                        "its future action, then second bounding reflector action" ) } },
-
-              ], cleanup );
-
-            } );
-
-          } );
-
-          // r0( ff1( ff1a ) ) r1 ... => r0 ff1 ff1a r1
-
-          asyncTest( "Reflector action generating a future action for a later time, " +
-            "which generates a future action for that same time, " +
-            "followed by another reflector action for the same time", function() {
-
-            createFixtureQueue( function( fixtureID, cleanup ) {
-
-              vwf.execute( fixtureID, "this.methods.log( '- r0 scheduled' )" );
-              vwf.send( fixtureID, "callMethod", "reflector", [ [ "r0", [ 0.001, "ff1" ] ] ], 0 );
-
-              vwf.execute( fixtureID, "this.methods.log( '- r1 scheduled' )" );
-              vwf.send( fixtureID, "callMethod", "reflector", [ [ "r1" ] ], -0.001 );
-
-              testUtility.runFutureAssertions( [
-
-                { relative: 0.010, assertion: function() {
-                    deepEqual( vwf.getProperty( fixtureID, "log" ), [
-                      "- r0 scheduled",   // at time 0, for time 0
-                      "- r1 scheduled",   // at time 0, for time 1
-                      "r0 executed",      // at time 0
-                      "- ff1 scheduled",  // at time 0, for time 1
-                      "ff1 executed",     // at time 1
-                      "- ff1a scheduled",  // at time 1, for time 1
-                      "ff1a executed",     // at time 1
-                      "r1 executed",      // at time 1
-                    ], "reflector action, future action, its future action, then bounding reflector action" ) } },
-
-              ], cleanup );
-
-            } );
-
-          } );
-
-          // setState should remove any messages from the queue that pre-date the setState action,
-          // remove messages generated while initializing nodes during the setState action, insert
-          // messages from the setState incoming queue, and leave messages in place that arrived
-          // after the setState message.
-
-          asyncTest( "setState queue", function() {
-
-            createFixtureQueue( function( fixtureID, cleanup ) {
-
-              // Add reflector and future messages that pre-date the setState message but that would
-              // execute after it at times 2 and 3, respectively. These represent the prior state of
-              // the queue. setState should remove them.
-
-              vwf.plan( fixtureID, "callMethod", "future_", [ [ "f2" ] ], -0.002 );
-              vwf.send( fixtureID, "callMethod", "reflector", [ [ "r3" ] ], -0.003 );
-
-              // Add the setState message at time 1.
-
-              vwf.send( undefined, "setState", undefined, [ {
-
-                // The created node generates a future message during initialize that would run at
-                // time 1, immediately following the setState action. setState should remove it.
-
-                nodes: [
-                  testUtility.dataURIFromDescriptor( {
-                    extends:
-                      fixtureID,
-                    scripts: [
-                      "this.initialize = function() { " +
-                        "Object.getPrototypeOf( this ).future( 0 ).future_( 'f1' ); " +
-                      "}"
-                    ],
-                  } )
-                ],
-
-                // Include a future message at time 4 and a reflector message at time 5 in the
-                // incoming queue. These should be retained.
-
-                queue: {
-                  time:
-                    vwf.time() + 0.001,
-                  queue: [ {
-                    time: vwf.time() + 0.004,
-                    node: fixtureID,
-                    action: "callMethod",
-                    member: "future_",
-                    parameters: [ [ "f4" ] ],
-                    origin: "future"
-                  }, {
-                    time: vwf.time() + 0.005,
-                    node: fixtureID,
-                    action: "callMethod",
-                    member: "reflector",
-                    parameters: [ [ "r5" ] ],
-                    origin: "reflector"
-                  } ]
-                }
-
-              } ], -0.001 );
-
-              // Add a reflector message at time 1. This represents a new action that the reflector
-              // sent following the setState action. It should be retained and should execute after
-              // setState.
-
-              vwf.send( fixtureID, "callMethod", "reflector", [ [ "r1" ] ], -0.001 );
-
-              // The expected result is that setState runs and doesn't leave a trace (other than the
-              // transformed system state), the following reflector action runs, then the actions
-              // from the incoming queue scheduled later run.
-
-              testUtility.runFutureAssertions( [
-
-                { relative: 0.010, assertion: function() {
-                    deepEqual( vwf.getProperty( fixtureID, "log" ), [
-                      "r1 executed",      // second reflector action at time 1
-                      "f4 executed",      // future action from the incoming queue at time 4
-                      "r5 executed",      // reflector action from the incoming queue at time 5
-                    ], "setState discarded prior actions, added incoming actions, and retained following actions" ) } },
-
-              ], cleanup );
-
-            } );
-
-          } );
-
-          // == Helper functions =====================================================================
-
-          // Create a node with a property, a method and an event.
-
-          function createFixture( callback /* fixtureID, cleanup */ ) {
-
-            vwf.createChild( 0, testUtility.uniqueName( "fixture" ), {
-
-              extends:
-                "http://vwf.example.com/node.vwf",
-              
-              properties: {
-                property: undefined,
-              },
-
-              methods: {
-                method: "this.property = arguments[0]",
-              },
-
-              events: {
-                event: undefined,
-              },
-
-              scripts: [
-                "this.event = this.events.add( function() { this.property = arguments[0] }, this )",
-              ],
-
-            }, undefined, function( fixtureID ) {
-
-              callback( fixtureID, function() {
-                vwf.deleteNode( fixtureID );
-              } );
-
-            } );
-
-          }
-
-          // Create a node with two levels of inheritance and properties to manipulate.
-
-          function createFixtureDerivedBase( callback /* derivedID, baseID, cleanup */ ) {
-
-            vwf.createNode( {
-
-              extends:
-                "http://vwf.example.com/node.vwf",
-              
-              properties: {
-                base: "base",
-              },
-
-            }, function( baseID ) {
-
-              vwf.createNode( {
-
-                extends:
-                  baseID,
-                
-                properties: {
-                  derived: "derived",
-                },
-
-              }, function( derivedID ) {
-
-                callback( derivedID, baseID, function() {
-                  vwf.deleteNode( derivedID );
-                  vwf.deleteNode( baseID );
-                } );
-
-              } );
-
-            } );
-
-          }
-
-          // Create a node with methods to be called as reflector and future actions that will keep
-          // a log.
-
-          function createFixtureQueue( callback /* fixtureID, cleanup */ ) {
-
-            vwf.createChild( 0, testUtility.uniqueName( "fixture" ), {
-
-              extends:
-                "http://vwf.example.com/node.vwf",
-              
-              properties: {
-                log: [], // log of methods called on the node
-              },
-
-              methods: {
-
-                // A method to be called as a reflector action. Append the first parameter to the
-                // log to record that this call occurred, then schedule calls to `future` for each
-                // time/tag pair in the `futures` array.
-
-                reflector: {
-
-                  parameters:
-                    [ "tag", "futures" ],
-
-                  body:
-                    "this.methods.log( tag + ' executed' ); " + // the reflector action executes
-                    "while ( ( futures || [] ).length ) { " +
-                      "var time = futures.shift(); " +
-                      "var tag = futures.shift(); " +
-                      "this.methods.log( '- ' + tag + ' scheduled' ); " + // the future action is scheduled
-                      "tag.match( /ff/ ) ? " +
-                        "this.future( time ).methods.futurefuture( tag, tag + 'a' ) : " + // special case for future to call future
-                        "this.future( time ).methods.future_( tag ); " +
-                    "}"
-
-                },
-
-                // A method to be called as a future action. Append the parameter to the log to
-                // record that this called occurred.
-
-                future_: {
-
-                  parameters:
-                    [ "tag" ],
- 
-                  body:
-                    "this.methods.log( tag + ' executed' )" // the future action executes
- 
-                },
-
-                // A method to be called as a future action that generates another future action.
-                // Append the first parameter to the log to record that this call occurred, then
-                // schedule an additional call to `future` with the second tag.
-
-                futurefuture: {
-
-                  parameters:
-                    [ "tag1", "tag2" ],
- 
-                  body:
-                    "this.methods.log( tag1 + ' executed' ); " + // the future action executes
-                    "this.methods.log( '- ' + tag2 + ' scheduled' ); " + // another future action is scheduled
-                    "this.future( 0 ).methods.future_( tag2 )"
- 
-                },
-
-                // Append a tag to the log.
-
-                log: {
-                  parameters: [ "tag" ],
-                  body: "this.properties.log = this.properties.log.concat( tag )"
-                },
-
-              },
-
-            }, undefined, function( fixtureID ) {
-
-              callback( fixtureID, function() {
-                vwf.deleteNode( fixtureID );
-              } );
-
-            } );
-
-          }
-
-          // Convert a number to a Number object that expresses itself in 3-point fixed precision
-          // when referenced in string context.
-
-          function fixed3( number ) {
-
-            var number3 = new Number( number );
-
-            number3.toString = function() {
-              return this.toFixed( 3 )
-            }
-
-            return number3;            
-          }
-
-        } );
-
-      } );
-
-    </script>
-
-    <link rel="stylesheet" type="text/css" href="qunit.css" />
-
-  </head>
-
-  <body>
-
-    <h1 id="qunit-header">Virtual World Framework</h1>
-    <h2 id="qunit-banner"></h2>
-    <div id="qunit-testrunner-toolbar"></div>
-    <h2 id="qunit-userAgent"></h2>
-    <ol id="qunit-tests"></ol>
-
-    <div id="qunit-fixture">test markup, will be hidden</div>
-
-  </body>
-
-</html>

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff