<commit_before>/**
 * @license
 * Copyright 2016 Google Inc. 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.
 */

/**
 * List of all FOAM files available to be loaded in a JSONP
 * format, so it can used from both nodejs scripts, and web
 * pages via script tags easily.
 */

FOAM_FILES([
  { name: "foam/core/lib" },
  { name: "foam/core/stdlib" },
  { name: "foam/core/events" },
  { name: "foam/core/Context" },
  { name: "foam/core/Boot" },
  { name: "foam/core/FObject" },
  { name: "foam/core/Model" },
  { name: "foam/core/Property" },
  { name: "foam/core/Method" },
  { name: "foam/core/Boolean" },
  { name: "foam/core/AxiomArray" },
  { name: "foam/core/EndBoot" },
  { name: "foam/core/FObjectArray" },
  { name: "foam/core/Constant" },
  { name: "foam/core/Validation" },
  { name: "foam/pattern/Faceted" },
  { name: "foam/core/types" },
  { name: "foam/core/Topic" },
  { name: "foam/core/InnerClass" },
  { name: "foam/core/InnerEnum" },
  { name: "foam/core/Implements" },
  { name: "foam/core/ImportsExports" },
  { name: "foam/core/Listener" },
  { name: "foam/core/IDSupport" },
  { name: "foam/core/Requires" },
  { name: "foam/core/Slot" },
  { name: "foam/core/Proxy" },
  { name: "foam/core/Promised" },
  { name: "foam/core/Interface" },
  { name: "foam/core/ContextMethod" },
  { name: "foam/core/Window" },
  { name: "foam/core/ContextMultipleInheritence" },
  { name: "foam/classloader/ClassLoader" },
  { name: "foam/core/Argument" },
  { name: "foam/core/MultiMethod" },
  { name: "foam/core/debug", flags: ['debug'] },
  { name: "foam/pattern/Singleton" },
  { name: "foam/pattern/Multiton" },
  { name: "foam/core/Enum" },
  { name: "foam/core/JSON" },
  { name: "foam/parse/parse" },
  { name: "foam/parse/json" },
  { name: "foam/parsers/FON" },
  { name: "foam/core/templates" },
  { name: "foam/i18n/Messages" },
  { name: "foam/core/Action" },
  { name: "foam/core/Reaction" },
  { name: "foam/core/Serializable" },
  { name: "foam/java/Argument", flags: ['java'] },
  { name: "foam/java/Class", flags: ['java'] },
  { name: "foam/java/ClassInfo", flags: ['java'] },
  { name: "foam/java/Code", flags: ['java'] },
  { name: "foam/java/CodeProperty", flags: ['java'] },
  { name: "foam/java/Field", flags: ['java'] },
  { name: "foam/java/Interface", flags: ['java'] },
  { name: "foam/java/InterfaceMethod", flags: ['java'] },
  { name: "foam/java/Method", flags: ['java'] },
  { name: "foam/java/Enum", flags: ['java'] },
  { name: "foam/java/MultiPartGetter", flags: ['java'] },
  { name: "foam/java/MultiPartSetter", flags: ['java'] },
  { name: "foam/java/Outputter", flags: ['java'] },
  { name: "foam/java/PropertyInfo", flags: ['java'] },
  { name: "foam/java/PropertyRefinement", flags: ['java'] },
  { name: "foam/java/Skeleton", flags: ['java'] },
  { name: "foam/java/JavaImport", flags: ['java'] },
  { name: "foam/java/refinements", flags: ['java'] },
  { name: "foam/util/Timer" },
  { name: "foam/memento/MementoMgr" },
  { name: "lib/input", flags: ['web'] },
  { name: "foam/u2/AttrSlot" },
  { name: "foam/u2/ViewSpec" },
  { name: "foam/u2/Element" },
//  { name: "foam/u2/AttrSlot", flags: ['web'] },
//  { name: "foam/u2/Element", flags: ['web'] },
  { name: "foam/u2/ProgressView", flags: ['web'] },
  { name: "foam/dao/Sink" },
  { name: "foam/dao/SinkJava", flags: ['java'] },
  { name: "foam/dao/DAO" },
  { name: "foam/dao/DAOJava", flags: ['java'] },
  { name: "foam/dao/daoUtils" },
  { name: "foam/dao/DAODecorator" },
  { name: "foam/dao/AbstractDAO" },
  { name: "foam/dao/DAOProperty" },
  { name: "foam/mlang/mlang" },
  { name: "foam/mlang/mlangJava", flags: ['java'] },
  { name: "foam/mlang/LabeledValue" },
  { name: "foam/dao/index/Plan" },
  { name: "foam/dao/index/Index" },
  { name: "foam/dao/index/ProxyIndex" },
  { name: "foam/dao/index/AltIndex" },
  { name: "foam/dao/index/ValueIndex" },
  { name: "foam/dao/index/AATree" },
  { name: "foam/dao/index/TreeIndex" },
  { name: "foam/dao/index/AutoIndex" },
  { name: "foam/dao/MDAO" },
  { name: "foam/dao/ArrayDAO" },
  { name: "foam/dao/TimestampDAO" },
  { name: "foam/dao/GUIDDAO" },
  { name: "foam/dao/ReadOnlyDAO" },
  { name: "foam/dao/JournaledDAO" },
  { name: "foam/dao/Relationship" },
  { name: "foam/dao/RelationshipDAO" },
  { name: "foam/dao/ManyToManyRelationshipDAO" },
  { name: "foam/dao/LazyCacheDAO" },
  { name: "foam/dao/CachingDAO" },
  { name: "foam/dao/DeDupDAO" },
  { name: "foam/dao/LRUDAOManager" },
  { name: "foam/dao/SequenceNumberDAO" },
  { name: "foam/dao/ContextualizingDAO" },
  { name: "foam/dao/SyncDAO" },
  { name: "foam/dao/EasyDAO" },
  { name: "foam/dao/NoSelectAllDAO" },
  { name: "foam/dao/NullDAO" },
  { name: "foam/dao/TimingDAO" },
  { name: "foam/dao/LoggingDAO" },
  { name: "foam/dao/IDBDAO", flags: ['web'] },
  { name: "foam/dao/RestDAO" },
  { name: "foam/dao/EnabledAwareDAO" },
  { name: "foam/dao/LastModifiedAwareDAO" },
  { name: "foam/dao/ValidationDAODecorator" },
  { name: "foam/dao/SQL", flags: ['sql'] },
  { name: "foam/parse/QueryParser" },
  { name: "foam/physics/Physical" },
  { name: "foam/physics/Collider" },
  { name: "foam/physics/PhysicsEngine" },
  { name: "foam/blob/Blob" },
  { name: "lib/node/json_dao", flags: ['node'] },
  { name: "lib/utf8" },
  { name: "lib/web/net" }, // No flags: ['web']: base classes for lib/node/net.
  { name: "lib/messageport", flags: ['web'] },
  { name: "lib/node/net", flags: ['node'] },
  { name: "lib/firebase" },
  { name: "lib/fcm" },
  { name: "lib/Stub" },
  { name: "lib/box" },
  { name: "lib/boxJava", flags: ['java'] },
  { name: "foam/core/async" },
  { name: "foam/u2/ViewFactory", flags: ['web'] },
  { name: "foam/u2/daos", flags: ['web'] },
  { name: "foam/u2/TableView", flags: ['web'] },
  { name: "foam/u2/TableSelection", flags: ['web'] },
  { name: "foam/u2/Scroller", flags: ['web'] },
  { name: "foam/u2/ActionView", flags: ['web'] },
  { name: "foam/u2/DetailPropertyView", flags: ['web'] },
  { name: "foam/u2/DetailView", flags: ['web'] },
  { name: "foam/u2/tag/Image", flags: ['web'] },
  { name: "foam/u2/tag/Input", flags: ['web'] },
  { name: "foam/u2/tag/TextArea", flags: ['web'] },
  { name: "foam/u2/TextField", flags: ['web'] },
  { name: "foam/u2/IntView", flags: ['web'] },
  { name: "foam/u2/FloatView", flags: ['web'] },
  { name: "foam/u2/CheckBox", flags: ['web'] },
  { name: "foam/u2/CitationView", flags: ['web'] },
  { name: "foam/u2/PopupView", flags: ['web'] },
  { name: "foam/u2/DateView", flags: ['web'] },
  { name: "foam/u2/DateTimeView", flags: ['web'] },
  { name: "foam/u2/RangeView", flags: ['web'] },
  { name: "foam/u2/ReadWriteView", flags: ['web'] },
  { name: "foam/u2/HTMLElement", flags: ['web'] },
  { name: "foam/u2/tag/Select", flags: ['web'] },
  { name: "foam/u2/Tabs", flags: ['web'] },
  { name: "foam/u2/view/ChoiceView", flags: ['web'] },
  { name: "foam/u2/view/RadioView", flags: ['web'] },
  { name: "foam/u2/view/TextField", flags: ['web'] },
  { name: "foam/u2/view/TreeView", flags: ['web'] },
  { name: "foam/u2/view/DualView", flags: ['web'] },
  { name: "foam/u2/view/ColorPicker", flags: ['web'] },
  { name: "foam/u2/view/TableView", flags: ['web'] },
  { name: "foam/u2/view/ScrollTableView", flags: ['web'] },
  { name: "foam/u2/view/BlobView", flags: ['web'] },
  { name: "foam/u2/view/StringArrayView", flags: ['web'] },
  { name: "foam/u2/view/ImageView", flags: ['web'] },
  { name: "foam/u2/EnumView", flags: ['web'] },
  { name: "foam/u2/ClassView", flags: ['web'] },
  { name: "foam/u2/view/ReferenceView", flags: ['web'] },
  { name: "foam/u2/tag/Card", flags: ['web'] },
  { name: "foam/u2/dialog/Popup", flags: ['web'] },
  { name: "foam/u2/Autocompleter", flags: ['web'] },
  { name: "foam/u2/search/FilterController", flags: ['web'] },
  { name: "foam/u2/search/GroupCompleter", flags: ['web'] },
  { name: "foam/u2/search/GroupAutocompleteSearchView", flags: ['web'] },
  { name: "foam/u2/search/GroupBySearchView", flags: ['web'] },
  { name: "foam/u2/search/SearchManager", flags: ['web'] },
  { name: "foam/u2/search/TextSearchView", flags: ['web'] },
  { name: "foam/u2/stack/Stack", flags: ['web'] },
  { name: "foam/u2/stack/StackView", flags: ['web'] },
  { name: "foam/u2/FoamTagLoader", flags: ['loader'] },
  { name: "foam/graphics/CView", flags: ['web'] },
  { name: "foam/graphics/ScrollCView", flags: ['web'] },
  { name: "foam/physics/PhysicalCircle", flags: ['web'] },
  { name: "foam/comics/DAOController" },
  { name: "foam/comics/DAOControllerView", flags: ['web'] },
  { name: "foam/comics/InlineDAOControllerView", flags: ['web'] },
  { name: "foam/comics/DAOCreateController" },
  { name: "foam/comics/DAOCreateControllerView", flags: ['web'] },
  { name: "foam/comics/DAOUpdateController" },
  { name: "foam/comics/DAOUpdateControllerView", flags: ['web'] },
  { name: "foam/comics/BrowserView", flags: ['web'] },
  { name: "foam/comics/InlineBrowserView", flags: ['web'] },
  { name: "foam/comics/RelationshipView", flags: ['web'] },
  { name: "foam/u2/view/RecipricalSearch", flags: ['web'] },
  { name: "lib/node/box", flags: ['node'] },
  { name: "foam/net/HTTPMethod" },
  { name: "lib/net" },
  { name: "foam/net/auth/TokenBearerCredential" },
  { name: "foam/net/auth/AuthAwareHTTPRequest" },
  { name: "foam/net/auth/TokenBearerHTTPRequest" },
  { name: "foam/net/auth/AuthAgent" },
  { name: "foam/doc/DocBrowser", flags: ['debug'] },
  { name: "com/google/net/node/Google2LOAuthAgent", flags: ['node', 'gcloud'] },
  { name: "com/google/cloud/datastore/types", flags: ['gcloud'] },
  { name: "com/google/cloud/datastore/mlang", flags: ['gcloud'] },
  { name: "com/google/cloud/datastore/DatastoreDAO", flags: ['gcloud'] },
  { name: "com/google/cloud/datastore/BatchMutationDatastoreDAO", flags: ['gcloud'] },
  { name: "foam/net/node/Handler", flags: ['node'] },
  { name: "foam/net/node/FileHandler", flags: ['node'] },
  { name: "foam/net/node/StaticFileHandler", flags: ['node'] },
  { name: "foam/net/node/RestDAOHandler", flags: ['node'] },
  { name: "foam/net/node/Server", flags: ['node'] },
  { name: "foam/classloader/ClassLoader", flags: ['debug'] },
  { name: "foam/classloader/OrDAO", flags: ['debug'] },
  { name: "foam/classloader/WebModelFileDAO", flags: ['web', 'debug'] },
  { name: "foam/classloader/NodeModelFileDAO", flags: ['node', 'debug'] },
  { name: "foam/classloader/NodeJsModelExecutor", flags: ['node', 'debug'] },
  { name: "foam/parsers/html/Attribute" },
  { name: "foam/parsers/html/HTMLLexer" },
  { name: "foam/parsers/html/lib" },
  { name: "foam/parsers/html/Tag" },
  { name: "foam/parsers/html/TagType" },
  { name: "foam/core/ContextAware", flags: ['java'] }
]);
<commit_msg>Reordering dependencies in files.js<commit_after>/**
 * @license
 * Copyright 2016 Google Inc. 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.
 */

/**
 * List of all FOAM files available to be loaded in a JSONP
 * format, so it can used from both nodejs scripts, and web
 * pages via script tags easily.
 */

FOAM_FILES([
  { name: "foam/core/lib" },
  { name: "foam/core/stdlib" },
  { name: "foam/core/events" },
  { name: "foam/core/Context" },
  { name: "foam/core/Boot" },
  { name: "foam/core/FObject" },
  { name: "foam/core/Model" },
  { name: "foam/core/Property" },
  { name: "foam/core/Method" },
  { name: "foam/core/Boolean" },
  { name: "foam/core/AxiomArray" },
  { name: "foam/core/EndBoot" },
  { name: "foam/core/FObjectArray" },
  { name: "foam/core/Constant" },
  { name: "foam/core/Validation" },
  { name: "foam/pattern/Faceted" },
  { name: "foam/core/types" },
  { name: "foam/core/Topic" },
  { name: "foam/core/InnerClass" },
  { name: "foam/core/InnerEnum" },
  { name: "foam/core/Implements" },
  { name: "foam/core/ImportsExports" },
  { name: "foam/core/Listener" },
  { name: "foam/core/IDSupport" },
  { name: "foam/core/Requires" },
  { name: "foam/core/Slot" },
  { name: "foam/core/Proxy" },
  { name: "foam/core/Promised" },
  { name: "foam/core/Interface" },
  { name: "foam/core/ContextMethod" },
  { name: "foam/core/Window" },
  { name: "foam/core/ContextMultipleInheritence" },
  { name: "foam/classloader/ClassLoader" },
  { name: "foam/core/Argument" },
  { name: "foam/core/MultiMethod" },
  { name: "foam/core/debug", flags: ['debug'] },
  { name: "foam/pattern/Singleton" },
  { name: "foam/pattern/Multiton" },
  { name: "foam/core/Enum" },
  { name: "foam/core/JSON" },
  { name: "foam/parse/parse" },
  { name: "foam/parse/json" },
  { name: "foam/parsers/FON" },
  { name: "foam/core/templates" },
  { name: "foam/i18n/Messages" },
  { name: "foam/core/Action" },
  { name: "foam/core/Reaction" },
  { name: "foam/core/Serializable" },
  { name: "foam/java/Argument", flags: ['java'] },
  { name: "foam/java/Class", flags: ['java'] },
  { name: "foam/java/ClassInfo", flags: ['java'] },
  { name: "foam/java/Code", flags: ['java'] },
  { name: "foam/java/CodeProperty", flags: ['java'] },
  { name: "foam/java/Field", flags: ['java'] },
  { name: "foam/java/Interface", flags: ['java'] },
  { name: "foam/java/InterfaceMethod", flags: ['java'] },
  { name: "foam/java/Method", flags: ['java'] },
  { name: "foam/java/Enum", flags: ['java'] },
  { name: "foam/java/MultiPartGetter", flags: ['java'] },
  { name: "foam/java/MultiPartSetter", flags: ['java'] },
  { name: "foam/java/Outputter", flags: ['java'] },
  { name: "foam/java/PropertyInfo", flags: ['java'] },
  { name: "foam/java/PropertyRefinement", flags: ['java'] },
  { name: "foam/java/Skeleton", flags: ['java'] },
  { name: "foam/java/JavaImport", flags: ['java'] },
  { name: "foam/java/refinements", flags: ['java'] },
  { name: "foam/util/Timer" },
  { name: "foam/memento/MementoMgr" },
  { name: "lib/input", flags: ['web'] },
  { name: "foam/u2/AttrSlot" },
  { name: "foam/u2/ViewSpec" },
  { name: "foam/u2/Element" },
//  { name: "foam/u2/AttrSlot", flags: ['web'] },
//  { name: "foam/u2/Element", flags: ['web'] },
  { name: "foam/u2/ProgressView", flags: ['web'] },
  { name: "foam/dao/Sink" },
  { name: "foam/dao/SinkJava", flags: ['java'] },
  { name: "foam/dao/DAO" },
  { name: "foam/dao/DAOJava", flags: ['java'] },
  { name: "foam/dao/daoUtils" },
  { name: "foam/dao/DAODecorator" },
  { name: "foam/dao/AbstractDAO" },
  { name: "foam/dao/DAOProperty" },
  { name: "foam/mlang/mlang" },
  { name: "foam/mlang/mlangJava", flags: ['java'] },
  { name: "foam/mlang/LabeledValue" },
  { name: "foam/dao/index/Plan" },
  { name: "foam/dao/index/Index" },
  { name: "foam/dao/index/ProxyIndex" },
  { name: "foam/dao/index/AltIndex" },
  { name: "foam/dao/index/ValueIndex" },
  { name: "foam/dao/index/AATree" },
  { name: "foam/dao/index/TreeIndex" },
  { name: "foam/dao/index/AutoIndex" },
  { name: "foam/dao/MDAO" },
  { name: "foam/dao/ArrayDAO" },
  { name: "foam/dao/TimestampDAO" },
  { name: "foam/dao/GUIDDAO" },
  { name: "foam/dao/ReadOnlyDAO" },
  { name: "foam/dao/JournaledDAO" },
  { name: "foam/dao/Relationship" },
  { name: "foam/dao/RelationshipDAO" },
  { name: "foam/dao/ManyToManyRelationshipDAO" },
  { name: "foam/dao/LazyCacheDAO" },
  { name: "foam/dao/CachingDAO" },
  { name: "foam/dao/DeDupDAO" },
  { name: "foam/dao/LRUDAOManager" },
  { name: "foam/dao/SequenceNumberDAO" },
  { name: "foam/dao/ContextualizingDAO" },
  { name: "foam/dao/SyncDAO" },
  { name: "foam/dao/EasyDAO" },
  { name: "foam/dao/NoSelectAllDAO" },
  { name: "foam/dao/NullDAO" },
  { name: "foam/dao/TimingDAO" },
  { name: "foam/dao/LoggingDAO" },
  { name: "foam/dao/IDBDAO", flags: ['web'] },
  { name: "foam/dao/RestDAO" },
  { name: "foam/dao/EnabledAwareDAO" },
  { name: "foam/dao/LastModifiedAwareDAO" },
  { name: "foam/dao/ValidationDAODecorator" },
  { name: "foam/dao/SQL", flags: ['sql'] },
  { name: "foam/parse/QueryParser" },
  { name: "foam/physics/Physical" },
  { name: "foam/physics/Collider" },
  { name: "foam/physics/PhysicsEngine" },
  { name: "foam/blob/Blob" },
  { name: "lib/node/json_dao", flags: ['node'] },
  { name: "lib/utf8" },
  { name: "lib/web/net" }, // No flags: ['web']: base classes for lib/node/net.
  { name: "lib/messageport", flags: ['web'] },
  { name: "lib/node/net", flags: ['node'] },
  { name: "lib/firebase" },
  { name: "lib/fcm" },
  { name: "lib/Stub" },
  { name: "lib/box" },
  { name: "lib/boxJava", flags: ['java'] },
  { name: "foam/core/async" },
  { name: "foam/u2/ViewFactory", flags: ['web'] },
  { name: "foam/u2/daos", flags: ['web'] },
  { name: "foam/u2/TableView", flags: ['web'] },
  { name: "foam/u2/TableSelection", flags: ['web'] },
  { name: "foam/u2/Scroller", flags: ['web'] },
  { name: "foam/u2/ActionView", flags: ['web'] },
  { name: "foam/u2/DetailPropertyView", flags: ['web'] },
  { name: "foam/u2/DetailView", flags: ['web'] },
  { name: "foam/u2/tag/Image", flags: ['web'] },
  { name: "foam/u2/tag/Input", flags: ['web'] },
  { name: "foam/u2/tag/TextArea", flags: ['web'] },
  { name: "foam/u2/TextField", flags: ['web'] },
  { name: "foam/u2/IntView", flags: ['web'] },
  { name: "foam/u2/FloatView", flags: ['web'] },
  { name: "foam/u2/CheckBox", flags: ['web'] },
  { name: "foam/u2/CitationView", flags: ['web'] },
  { name: "foam/u2/PopupView", flags: ['web'] },
  { name: "foam/u2/DateView", flags: ['web'] },
  { name: "foam/u2/DateTimeView", flags: ['web'] },
  { name: "foam/u2/RangeView", flags: ['web'] },
  { name: "foam/u2/ReadWriteView", flags: ['web'] },
  { name: "foam/u2/HTMLElement", flags: ['web'] },
  { name: "foam/u2/tag/Select", flags: ['web'] },
  { name: "foam/u2/Tabs", flags: ['web'] },
  { name: "foam/u2/view/ChoiceView", flags: ['web'] },
  { name: "foam/u2/view/RadioView", flags: ['web'] },
  { name: "foam/u2/view/TextField", flags: ['web'] },
  { name: "foam/u2/view/TreeView", flags: ['web'] },
  { name: "foam/u2/view/DualView", flags: ['web'] },
  { name: "foam/u2/view/ColorPicker", flags: ['web'] },
  { name: "foam/u2/view/TableView", flags: ['web'] },
  { name: "foam/u2/view/ScrollTableView", flags: ['web'] },
  { name: "foam/u2/view/BlobView", flags: ['web'] },
  { name: "foam/u2/view/StringArrayView", flags: ['web'] },
  { name: "foam/u2/view/ImageView", flags: ['web'] },
  { name: "foam/u2/EnumView", flags: ['web'] },
  { name: "foam/u2/ClassView", flags: ['web'] },
  { name: "foam/u2/view/ReferenceView", flags: ['web'] },
  { name: "foam/u2/tag/Card", flags: ['web'] },
  { name: "foam/u2/dialog/Popup", flags: ['web'] },
  { name: "foam/u2/Autocompleter", flags: ['web'] },
  { name: "foam/u2/search/FilterController", flags: ['web'] },
  { name: "foam/u2/search/GroupCompleter", flags: ['web'] },
  { name: "foam/u2/search/GroupAutocompleteSearchView", flags: ['web'] },
  { name: "foam/u2/search/GroupBySearchView", flags: ['web'] },
  { name: "foam/u2/search/SearchManager", flags: ['web'] },
  { name: "foam/u2/search/TextSearchView", flags: ['web'] },
  { name: "foam/u2/stack/Stack", flags: ['web'] },
  { name: "foam/u2/stack/StackView", flags: ['web'] },
  { name: "foam/u2/FoamTagLoader", flags: ['loader'] },
  { name: "foam/graphics/CView", flags: ['web'] },
  { name: "foam/graphics/ScrollCView", flags: ['web'] },
  { name: "foam/physics/PhysicalCircle", flags: ['web'] },
  { name: "foam/comics/DAOController" },
  { name: "foam/comics/DAOControllerView", flags: ['web'] },
  { name: "foam/comics/InlineDAOControllerView", flags: ['web'] },
  { name: "foam/comics/DAOCreateController" },
  { name: "foam/comics/DAOCreateControllerView", flags: ['web'] },
  { name: "foam/comics/DAOUpdateController" },
  { name: "foam/comics/DAOUpdateControllerView", flags: ['web'] },
  { name: "foam/comics/BrowserView", flags: ['web'] },
  { name: "foam/comics/InlineBrowserView", flags: ['web'] },
  { name: "foam/comics/RelationshipView", flags: ['web'] },
  { name: "foam/u2/view/RecipricalSearch", flags: ['web'] },
  { name: "lib/node/box", flags: ['node'] },
  { name: "foam/net/HTTPMethod" },
  { name: "lib/net" },
  { name: "foam/net/auth/TokenBearerCredential" },
  { name: "foam/net/auth/AuthAwareHTTPRequest" },
  { name: "foam/net/auth/TokenBearerHTTPRequest" },
  { name: "foam/net/auth/AuthAgent" },
  { name: "foam/doc/DocBrowser", flags: ['debug'] },
  { name: "com/google/net/node/Google2LOAuthAgent", flags: ['node', 'gcloud'] },
  { name: "com/google/cloud/datastore/types", flags: ['gcloud'] },
  { name: "com/google/cloud/datastore/mlang", flags: ['gcloud'] },
  { name: "com/google/cloud/datastore/DatastoreDAO", flags: ['gcloud'] },
  { name: "com/google/cloud/datastore/BatchMutationDatastoreDAO", flags: ['gcloud'] },
  { name: "foam/net/node/Handler", flags: ['node'] },
  { name: "foam/net/node/FileHandler", flags: ['node'] },
  { name: "foam/net/node/StaticFileHandler", flags: ['node'] },
  { name: "foam/net/node/RestDAOHandler", flags: ['node'] },
  { name: "foam/net/node/Server", flags: ['node'] },
  { name: "foam/classloader/ClassLoader", flags: ['debug'] },
  { name: "foam/classloader/OrDAO", flags: ['debug'] },
  { name: "foam/classloader/WebModelFileDAO", flags: ['web', 'debug'] },
  { name: "foam/classloader/NodeModelFileDAO", flags: ['node', 'debug'] },
  { name: "foam/classloader/NodeJsModelExecutor", flags: ['node', 'debug'] },
  { name: "foam/parsers/html/lib" },
  { name: "foam/parsers/html/Attribute" },
  { name: "foam/parsers/html/TagType" },
  { name: "foam/parsers/html/Tag" },
  { name: "foam/parsers/html/HTMLLexer" },
  { name: "foam/core/ContextAware", flags: ['java'] }
]);
<|endoftext|>


<commit_before>/**
 * @license
 * Copyright 2016 Google Inc. 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.
 */

/**
 * List of all FOAM files available to be loaded in a JSONP
 * format, so it can used from both nodejs scripts, and web
 * pages via script tags easily.
 */

FOAM_FILES([
  { name: "foam/core/lib" },
  { name: "foam/core/stdlib" },
  { name: "foam/core/events" },
  { name: "foam/core/Context" },
  { name: "foam/core/Boot" },
  { name: "foam/core/FObject" },
  { name: "foam/core/Model" },
  { name: "foam/core/Property" },
  { name: "foam/core/Method" },
  { name: "foam/core/Boolean" },
  { name: "foam/core/AxiomArray" },
  { name: "foam/core/EndBoot" },
  { name: "foam/core/FObjectArray" },
  { name: "foam/core/Constant" },
  { name: "foam/core/Validation" },
  { name: "foam/pattern/Faceted" },
  { name: "foam/core/types" },
  { name: "foam/core/Topic" },
  { name: "foam/core/InnerClass" },
  { name: "foam/core/InnerEnum" },
  { name: "foam/core/Implements" },
  { name: "foam/core/ImportsExports" },
  { name: "foam/core/Listener" },
  { name: "foam/core/IDSupport" },
  { name: "foam/core/Requires" },
  { name: "foam/core/Slot" },
  { name: "foam/core/Proxy" },
  { name: "foam/core/Promised" },
  { name: "foam/core/Interface" },
  { name: "foam/core/ContextMethod" },
  { name: "foam/core/Window" },
  { name: "foam/core/ContextMultipleInheritence" },
  { name: "foam/classloader/ClassLoader" },
  { name: "foam/core/Argument" },
  { name: "foam/core/MultiMethod" },
  { name: "foam/core/debug", flags: ['debug'] },
  { name: "foam/pattern/Singleton" },
  { name: "foam/pattern/Multiton" },
  { name: "foam/core/Enum" },
  { name: "foam/core/JSON" },
  { name: "foam/parse/parse" },
  { name: "foam/parse/json" },
  { name: "foam/parsers/FON" },
  { name: "foam/core/templates" },
  { name: "foam/i18n/Messages" },
  { name: "foam/core/Action" },
  { name: "foam/core/Reaction" },
  { name: "foam/core/Serializable" },
  { name: "foam/java/Argument", flags: ['java'] },
  { name: "foam/java/Class", flags: ['java'] },
  { name: "foam/java/ClassInfo", flags: ['java'] },
  { name: "foam/java/Code", flags: ['java'] },
  { name: "foam/java/CodeProperty", flags: ['java'] },
  { name: "foam/java/Field", flags: ['java'] },
  { name: "foam/java/Interface", flags: ['java'] },
  { name: "foam/java/InterfaceMethod", flags: ['java'] },
  { name: "foam/java/Method", flags: ['java'] },
  { name: "foam/java/Enum", flags: ['java'] },
  { name: "foam/java/MultiPartGetter", flags: ['java'] },
  { name: "foam/java/MultiPartSetter", flags: ['java'] },
  { name: "foam/java/Outputter", flags: ['java'] },
  { name: "foam/java/PropertyInfo", flags: ['java'] },
  { name: "foam/java/PropertyRefinement", flags: ['java'] },
  { name: "foam/java/Skeleton", flags: ['java'] },
  { name: "foam/java/JavaImport", flags: ['java'] },
  { name: "foam/java/refinements", flags: ['java'] },
  { name: "foam/util/Timer" },
  { name: "foam/memento/MementoMgr" },
  { name: "lib/input", flags: ['web'] },
  { name: "foam/u2/AttrSlot" },
  { name: "foam/u2/ViewSpec" },
  { name: "foam/u2/Element" },
//  { name: "foam/u2/AttrSlot", flags: ['web'] },
//  { name: "foam/u2/Element", flags: ['web'] },
  { name: "foam/u2/ProgressView", flags: ['web'] },
  { name: "foam/dao/Sink" },
  { name: "foam/dao/SinkJava", flags: ['java'] },
  { name: "foam/dao/DAO" },
  { name: "foam/dao/DAOJava", flags: ['java'] },
  { name: "foam/dao/daoUtils" },
  { name: "foam/dao/DAODecorator" },
  { name: "foam/dao/AbstractDAO" },
  { name: "foam/dao/DAOProperty" },
  { name: "foam/mlang/mlang" },
  { name: "foam/mlang/mlangJava", flags: ['java'] },
  { name: "foam/mlang/LabeledValue" },
  { name: "foam/dao/index/Plan" },
  { name: "foam/dao/index/Index" },
  { name: "foam/dao/index/ProxyIndex" },
  { name: "foam/dao/index/AltIndex" },
  { name: "foam/dao/index/ValueIndex" },
  { name: "foam/dao/index/AATree" },
  { name: "foam/dao/index/TreeIndex" },
  { name: "foam/dao/index/AutoIndex" },
  { name: "foam/dao/MDAO" },
  { name: "foam/dao/ArrayDAO" },
  { name: "foam/dao/TimestampDAO" },
  { name: "foam/dao/GUIDDAO" },
  { name: "foam/dao/ReadOnlyDAO" },
  { name: "foam/dao/JournaledDAO" },
  { name: "foam/dao/Relationship" },
  { name: "foam/dao/RelationshipDAO" },
  { name: "foam/dao/ManyToManyRelationshipDAO" },
  { name: "foam/dao/LazyCacheDAO" },
  { name: "foam/dao/CachingDAO" },
  { name: "foam/dao/DeDupDAO" },
  { name: "foam/dao/LRUDAOManager" },
  { name: "foam/dao/SequenceNumberDAO" },
  { name: "foam/dao/ContextualizingDAO" },
  { name: "foam/dao/SyncDAO" },
  { name: "foam/dao/EasyDAO" },
  { name: "foam/dao/NoSelectAllDAO" },
  { name: "foam/dao/NullDAO" },
  { name: "foam/dao/TimingDAO" },
  { name: "foam/dao/LoggingDAO" },
  { name: "foam/dao/IDBDAO", flags: ['web'] },
  { name: "foam/dao/RestDAO" },
  { name: "foam/dao/EnabledAwareDAO" },
  { name: "foam/dao/LastModifiedAwareDAO" },
  { name: "foam/dao/SQL", flags: ['sql'] },
  { name: "foam/parse/QueryParser" },
  { name: "foam/physics/Physical" },
  { name: "foam/physics/Collider" },
  { name: "foam/physics/PhysicsEngine" },
  { name: "foam/blob/Blob" },
  { name: "lib/node/json_dao", flags: ['node'] },
  { name: "lib/utf8" },
  { name: "lib/web/net" }, // No flags: ['web']: base classes for lib/node/net.
  { name: "lib/messageport", flags: ['web'] },
  { name: "lib/node/net", flags: ['node'] },
  { name: "lib/firebase" },
  { name: "lib/fcm" },
  { name: "lib/Stub" },
  { name: "lib/box" },
  { name: "lib/boxJava", flags: ['java'] },
  { name: "foam/core/async" },
  { name: "foam/u2/ViewFactory", flags: ['web'] },
  { name: "foam/u2/daos", flags: ['web'] },
  { name: "foam/u2/TableView", flags: ['web'] },
  { name: "foam/u2/TableSelection", flags: ['web'] },
  { name: "foam/u2/Scroller", flags: ['web'] },
  { name: "foam/u2/ActionView", flags: ['web'] },
  { name: "foam/u2/DetailPropertyView", flags: ['web'] },
  { name: "foam/u2/DetailView", flags: ['web'] },
  { name: "foam/u2/tag/Image", flags: ['web'] },
  { name: "foam/u2/tag/Input", flags: ['web'] },
  { name: "foam/u2/tag/TextArea", flags: ['web'] },
  { name: "foam/u2/TextField", flags: ['web'] },
  { name: "foam/u2/IntView", flags: ['web'] },
  { name: "foam/u2/FloatView", flags: ['web'] },
  { name: "foam/u2/CheckBox", flags: ['web'] },
  { name: "foam/u2/CitationView", flags: ['web'] },
  { name: "foam/u2/PopupView", flags: ['web'] },
  { name: "foam/u2/DateView", flags: ['web'] },
  { name: "foam/u2/DateTimeView", flags: ['web'] },
  { name: "foam/u2/RangeView", flags: ['web'] },
  { name: "foam/u2/ReadWriteView", flags: ['web'] },
  { name: "foam/u2/HTMLElement", flags: ['web'] },
  { name: "foam/u2/tag/Select", flags: ['web'] },
  { name: "foam/u2/Tabs", flags: ['web'] },
  { name: "foam/u2/view/ChoiceView", flags: ['web'] },
  { name: "foam/u2/view/RadioView", flags: ['web'] },
  { name: "foam/u2/view/TextField", flags: ['web'] },
  { name: "foam/u2/view/TreeView", flags: ['web'] },
  { name: "foam/u2/view/DualView", flags: ['web'] },
  { name: "foam/u2/view/ColorPicker", flags: ['web'] },
  { name: "foam/u2/view/TableView", flags: ['web'] },
  { name: "foam/u2/view/ScrollTableView", flags: ['web'] },
  { name: "foam/u2/view/BlobView", flags: ['web'] },
  { name: "foam/u2/view/StringArrayView", flags: ['web'] },
  { name: "foam/u2/view/ImageView", flags: ['web'] },
  { name: "foam/u2/EnumView", flags: ['web'] },
  { name: "foam/u2/ClassView", flags: ['web'] },
  { name: "foam/u2/view/ReferenceView", flags: ['web'] },
  { name: "foam/u2/tag/Card", flags: ['web'] },
  { name: "foam/u2/dialog/Popup", flags: ['web'] },
  { name: "foam/u2/Autocompleter", flags: ['web'] },
  { name: "foam/u2/search/FilterController", flags: ['web'] },
  { name: "foam/u2/search/GroupCompleter", flags: ['web'] },
  { name: "foam/u2/search/GroupAutocompleteSearchView", flags: ['web'] },
  { name: "foam/u2/search/GroupBySearchView", flags: ['web'] },
  { name: "foam/u2/search/SearchManager", flags: ['web'] },
  { name: "foam/u2/search/TextSearchView", flags: ['web'] },
  { name: "foam/u2/stack/Stack", flags: ['web'] },
  { name: "foam/u2/stack/StackView", flags: ['web'] },
  { name: "foam/u2/FoamTagLoader", flags: ['loader'] },
  { name: "foam/graphics/CView", flags: ['web'] },
  { name: "foam/graphics/ScrollCView", flags: ['web'] },
  { name: "foam/physics/PhysicalCircle", flags: ['web'] },
  { name: "foam/comics/DAOController" },
  { name: "foam/comics/DAOControllerView", flags: ['web'] },
  { name: "foam/comics/InlineDAOControllerView", flags: ['web'] },
  { name: "foam/comics/DAOCreateController" },
  { name: "foam/comics/DAOCreateControllerView", flags: ['web'] },
  { name: "foam/comics/DAOUpdateController" },
  { name: "foam/comics/DAOUpdateControllerView", flags: ['web'] },
  { name: "foam/comics/BrowserView", flags: ['web'] },
  { name: "foam/comics/InlineBrowserView", flags: ['web'] },
  { name: "foam/comics/RelationshipView", flags: ['web'] },
  { name: "foam/u2/view/RecipricalSearch", flags: ['web'] },
  { name: "lib/node/box", flags: ['node'] },
  { name: "foam/net/HTTPMethod" },
  { name: "lib/net" },
  { name: "foam/net/auth/TokenBearerCredential" },
  { name: "foam/net/auth/AuthAwareHTTPRequest" },
  { name: "foam/net/auth/TokenBearerHTTPRequest" },
  { name: "foam/net/auth/AuthAgent" },
  { name: "foam/doc/DocBrowser", flags: ['debug'] },
  { name: "com/google/net/node/Google2LOAuthAgent", flags: ['node', 'gcloud'] },
  { name: "com/google/cloud/datastore/types", flags: ['gcloud'] },
  { name: "com/google/cloud/datastore/mlang", flags: ['gcloud'] },
  { name: "com/google/cloud/datastore/DatastoreDAO", flags: ['gcloud'] },
  { name: "com/google/cloud/datastore/BatchMutationDatastoreDAO", flags: ['gcloud'] },
  { name: "foam/net/node/Handler", flags: ['node'] },
  { name: "foam/net/node/FileHandler", flags: ['node'] },
  { name: "foam/net/node/StaticFileHandler", flags: ['node'] },
  { name: "foam/net/node/RestDAOHandler", flags: ['node'] },
  { name: "foam/net/node/Server", flags: ['node'] },
  { name: "foam/classloader/ClassLoader", flags: ['debug'] },
  { name: "foam/classloader/OrDAO", flags: ['debug'] },
  { name: "foam/classloader/WebModelFileDAO", flags: ['web', 'debug'] },
  { name: "foam/classloader/NodeModelFileDAO", flags: ['node', 'debug'] },
  { name: "foam/classloader/NodeJsModelExecutor", flags: ['node', 'debug'] },
  { name: "foam/parsers/html" },
  { name: "foam/parsers/HTMLLexer" }
]);
<commit_msg>Add ValidationDAO to files.js<commit_after>/**
 * @license
 * Copyright 2016 Google Inc. 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.
 */

/**
 * List of all FOAM files available to be loaded in a JSONP
 * format, so it can used from both nodejs scripts, and web
 * pages via script tags easily.
 */

FOAM_FILES([
  { name: "foam/core/lib" },
  { name: "foam/core/stdlib" },
  { name: "foam/core/events" },
  { name: "foam/core/Context" },
  { name: "foam/core/Boot" },
  { name: "foam/core/FObject" },
  { name: "foam/core/Model" },
  { name: "foam/core/Property" },
  { name: "foam/core/Method" },
  { name: "foam/core/Boolean" },
  { name: "foam/core/AxiomArray" },
  { name: "foam/core/EndBoot" },
  { name: "foam/core/FObjectArray" },
  { name: "foam/core/Constant" },
  { name: "foam/core/Validation" },
  { name: "foam/pattern/Faceted" },
  { name: "foam/core/types" },
  { name: "foam/core/Topic" },
  { name: "foam/core/InnerClass" },
  { name: "foam/core/InnerEnum" },
  { name: "foam/core/Implements" },
  { name: "foam/core/ImportsExports" },
  { name: "foam/core/Listener" },
  { name: "foam/core/IDSupport" },
  { name: "foam/core/Requires" },
  { name: "foam/core/Slot" },
  { name: "foam/core/Proxy" },
  { name: "foam/core/Promised" },
  { name: "foam/core/Interface" },
  { name: "foam/core/ContextMethod" },
  { name: "foam/core/Window" },
  { name: "foam/core/ContextMultipleInheritence" },
  { name: "foam/classloader/ClassLoader" },
  { name: "foam/core/Argument" },
  { name: "foam/core/MultiMethod" },
  { name: "foam/core/debug", flags: ['debug'] },
  { name: "foam/pattern/Singleton" },
  { name: "foam/pattern/Multiton" },
  { name: "foam/core/Enum" },
  { name: "foam/core/JSON" },
  { name: "foam/parse/parse" },
  { name: "foam/parse/json" },
  { name: "foam/parsers/FON" },
  { name: "foam/core/templates" },
  { name: "foam/i18n/Messages" },
  { name: "foam/core/Action" },
  { name: "foam/core/Reaction" },
  { name: "foam/core/Serializable" },
  { name: "foam/java/Argument", flags: ['java'] },
  { name: "foam/java/Class", flags: ['java'] },
  { name: "foam/java/ClassInfo", flags: ['java'] },
  { name: "foam/java/Code", flags: ['java'] },
  { name: "foam/java/CodeProperty", flags: ['java'] },
  { name: "foam/java/Field", flags: ['java'] },
  { name: "foam/java/Interface", flags: ['java'] },
  { name: "foam/java/InterfaceMethod", flags: ['java'] },
  { name: "foam/java/Method", flags: ['java'] },
  { name: "foam/java/Enum", flags: ['java'] },
  { name: "foam/java/MultiPartGetter", flags: ['java'] },
  { name: "foam/java/MultiPartSetter", flags: ['java'] },
  { name: "foam/java/Outputter", flags: ['java'] },
  { name: "foam/java/PropertyInfo", flags: ['java'] },
  { name: "foam/java/PropertyRefinement", flags: ['java'] },
  { name: "foam/java/Skeleton", flags: ['java'] },
  { name: "foam/java/JavaImport", flags: ['java'] },
  { name: "foam/java/refinements", flags: ['java'] },
  { name: "foam/util/Timer" },
  { name: "foam/memento/MementoMgr" },
  { name: "lib/input", flags: ['web'] },
  { name: "foam/u2/AttrSlot" },
  { name: "foam/u2/ViewSpec" },
  { name: "foam/u2/Element" },
//  { name: "foam/u2/AttrSlot", flags: ['web'] },
//  { name: "foam/u2/Element", flags: ['web'] },
  { name: "foam/u2/ProgressView", flags: ['web'] },
  { name: "foam/dao/Sink" },
  { name: "foam/dao/SinkJava", flags: ['java'] },
  { name: "foam/dao/DAO" },
  { name: "foam/dao/DAOJava", flags: ['java'] },
  { name: "foam/dao/daoUtils" },
  { name: "foam/dao/DAODecorator" },
  { name: "foam/dao/AbstractDAO" },
  { name: "foam/dao/DAOProperty" },
  { name: "foam/mlang/mlang" },
  { name: "foam/mlang/mlangJava", flags: ['java'] },
  { name: "foam/mlang/LabeledValue" },
  { name: "foam/dao/index/Plan" },
  { name: "foam/dao/index/Index" },
  { name: "foam/dao/index/ProxyIndex" },
  { name: "foam/dao/index/AltIndex" },
  { name: "foam/dao/index/ValueIndex" },
  { name: "foam/dao/index/AATree" },
  { name: "foam/dao/index/TreeIndex" },
  { name: "foam/dao/index/AutoIndex" },
  { name: "foam/dao/MDAO" },
  { name: "foam/dao/ArrayDAO" },
  { name: "foam/dao/TimestampDAO" },
  { name: "foam/dao/GUIDDAO" },
  { name: "foam/dao/ReadOnlyDAO" },
  { name: "foam/dao/JournaledDAO" },
  { name: "foam/dao/Relationship" },
  { name: "foam/dao/RelationshipDAO" },
  { name: "foam/dao/ManyToManyRelationshipDAO" },
  { name: "foam/dao/LazyCacheDAO" },
  { name: "foam/dao/CachingDAO" },
  { name: "foam/dao/DeDupDAO" },
  { name: "foam/dao/LRUDAOManager" },
  { name: "foam/dao/SequenceNumberDAO" },
  { name: "foam/dao/ContextualizingDAO" },
  { name: "foam/dao/SyncDAO" },
  { name: "foam/dao/EasyDAO" },
  { name: "foam/dao/NoSelectAllDAO" },
  { name: "foam/dao/NullDAO" },
  { name: "foam/dao/TimingDAO" },
  { name: "foam/dao/LoggingDAO" },
  { name: "foam/dao/IDBDAO", flags: ['web'] },
  { name: "foam/dao/RestDAO" },
  { name: "foam/dao/EnabledAwareDAO" },
  { name: "foam/dao/LastModifiedAwareDAO" },
  { name: "foam/dao/ValidationDAO" },
  { name: "foam/dao/SQL", flags: ['sql'] },
  { name: "foam/parse/QueryParser" },
  { name: "foam/physics/Physical" },
  { name: "foam/physics/Collider" },
  { name: "foam/physics/PhysicsEngine" },
  { name: "foam/blob/Blob" },
  { name: "lib/node/json_dao", flags: ['node'] },
  { name: "lib/utf8" },
  { name: "lib/web/net" }, // No flags: ['web']: base classes for lib/node/net.
  { name: "lib/messageport", flags: ['web'] },
  { name: "lib/node/net", flags: ['node'] },
  { name: "lib/firebase" },
  { name: "lib/fcm" },
  { name: "lib/Stub" },
  { name: "lib/box" },
  { name: "lib/boxJava", flags: ['java'] },
  { name: "foam/core/async" },
  { name: "foam/u2/ViewFactory", flags: ['web'] },
  { name: "foam/u2/daos", flags: ['web'] },
  { name: "foam/u2/TableView", flags: ['web'] },
  { name: "foam/u2/TableSelection", flags: ['web'] },
  { name: "foam/u2/Scroller", flags: ['web'] },
  { name: "foam/u2/ActionView", flags: ['web'] },
  { name: "foam/u2/DetailPropertyView", flags: ['web'] },
  { name: "foam/u2/DetailView", flags: ['web'] },
  { name: "foam/u2/tag/Image", flags: ['web'] },
  { name: "foam/u2/tag/Input", flags: ['web'] },
  { name: "foam/u2/tag/TextArea", flags: ['web'] },
  { name: "foam/u2/TextField", flags: ['web'] },
  { name: "foam/u2/IntView", flags: ['web'] },
  { name: "foam/u2/FloatView", flags: ['web'] },
  { name: "foam/u2/CheckBox", flags: ['web'] },
  { name: "foam/u2/CitationView", flags: ['web'] },
  { name: "foam/u2/PopupView", flags: ['web'] },
  { name: "foam/u2/DateView", flags: ['web'] },
  { name: "foam/u2/DateTimeView", flags: ['web'] },
  { name: "foam/u2/RangeView", flags: ['web'] },
  { name: "foam/u2/ReadWriteView", flags: ['web'] },
  { name: "foam/u2/HTMLElement", flags: ['web'] },
  { name: "foam/u2/tag/Select", flags: ['web'] },
  { name: "foam/u2/Tabs", flags: ['web'] },
  { name: "foam/u2/view/ChoiceView", flags: ['web'] },
  { name: "foam/u2/view/RadioView", flags: ['web'] },
  { name: "foam/u2/view/TextField", flags: ['web'] },
  { name: "foam/u2/view/TreeView", flags: ['web'] },
  { name: "foam/u2/view/DualView", flags: ['web'] },
  { name: "foam/u2/view/ColorPicker", flags: ['web'] },
  { name: "foam/u2/view/TableView", flags: ['web'] },
  { name: "foam/u2/view/ScrollTableView", flags: ['web'] },
  { name: "foam/u2/view/BlobView", flags: ['web'] },
  { name: "foam/u2/view/StringArrayView", flags: ['web'] },
  { name: "foam/u2/view/ImageView", flags: ['web'] },
  { name: "foam/u2/EnumView", flags: ['web'] },
  { name: "foam/u2/ClassView", flags: ['web'] },
  { name: "foam/u2/view/ReferenceView", flags: ['web'] },
  { name: "foam/u2/tag/Card", flags: ['web'] },
  { name: "foam/u2/dialog/Popup", flags: ['web'] },
  { name: "foam/u2/Autocompleter", flags: ['web'] },
  { name: "foam/u2/search/FilterController", flags: ['web'] },
  { name: "foam/u2/search/GroupCompleter", flags: ['web'] },
  { name: "foam/u2/search/GroupAutocompleteSearchView", flags: ['web'] },
  { name: "foam/u2/search/GroupBySearchView", flags: ['web'] },
  { name: "foam/u2/search/SearchManager", flags: ['web'] },
  { name: "foam/u2/search/TextSearchView", flags: ['web'] },
  { name: "foam/u2/stack/Stack", flags: ['web'] },
  { name: "foam/u2/stack/StackView", flags: ['web'] },
  { name: "foam/u2/FoamTagLoader", flags: ['loader'] },
  { name: "foam/graphics/CView", flags: ['web'] },
  { name: "foam/graphics/ScrollCView", flags: ['web'] },
  { name: "foam/physics/PhysicalCircle", flags: ['web'] },
  { name: "foam/comics/DAOController" },
  { name: "foam/comics/DAOControllerView", flags: ['web'] },
  { name: "foam/comics/InlineDAOControllerView", flags: ['web'] },
  { name: "foam/comics/DAOCreateController" },
  { name: "foam/comics/DAOCreateControllerView", flags: ['web'] },
  { name: "foam/comics/DAOUpdateController" },
  { name: "foam/comics/DAOUpdateControllerView", flags: ['web'] },
  { name: "foam/comics/BrowserView", flags: ['web'] },
  { name: "foam/comics/InlineBrowserView", flags: ['web'] },
  { name: "foam/comics/RelationshipView", flags: ['web'] },
  { name: "foam/u2/view/RecipricalSearch", flags: ['web'] },
  { name: "lib/node/box", flags: ['node'] },
  { name: "foam/net/HTTPMethod" },
  { name: "lib/net" },
  { name: "foam/net/auth/TokenBearerCredential" },
  { name: "foam/net/auth/AuthAwareHTTPRequest" },
  { name: "foam/net/auth/TokenBearerHTTPRequest" },
  { name: "foam/net/auth/AuthAgent" },
  { name: "foam/doc/DocBrowser", flags: ['debug'] },
  { name: "com/google/net/node/Google2LOAuthAgent", flags: ['node', 'gcloud'] },
  { name: "com/google/cloud/datastore/types", flags: ['gcloud'] },
  { name: "com/google/cloud/datastore/mlang", flags: ['gcloud'] },
  { name: "com/google/cloud/datastore/DatastoreDAO", flags: ['gcloud'] },
  { name: "com/google/cloud/datastore/BatchMutationDatastoreDAO", flags: ['gcloud'] },
  { name: "foam/net/node/Handler", flags: ['node'] },
  { name: "foam/net/node/FileHandler", flags: ['node'] },
  { name: "foam/net/node/StaticFileHandler", flags: ['node'] },
  { name: "foam/net/node/RestDAOHandler", flags: ['node'] },
  { name: "foam/net/node/Server", flags: ['node'] },
  { name: "foam/classloader/ClassLoader", flags: ['debug'] },
  { name: "foam/classloader/OrDAO", flags: ['debug'] },
  { name: "foam/classloader/WebModelFileDAO", flags: ['web', 'debug'] },
  { name: "foam/classloader/NodeModelFileDAO", flags: ['node', 'debug'] },
  { name: "foam/classloader/NodeJsModelExecutor", flags: ['node', 'debug'] },
  { name: "foam/parsers/html" },
  { name: "foam/parsers/HTMLLexer" }
]);
<|endoftext|>


<commit_before>define(["../lib/trackball-controls/TrackballControls"], function (TrackballControls) {
    "use strict";

    var Frame = function (elem, graph) {
        var self = this;

        if (typeof elem === 'string') {
            elem = document.getElementById(elem);
        }

        this.graph = graph;

        var width = elem.scrollWidth;
        var height = elem.scrollHeight;
        var aspectRatio = width/height;

        this._initScene();
        this._initCamera(aspectRatio);
        this._initRenderer(width, height, elem);
        this._initControls(elem);
        this._initNodes(graph.getNodes());
        this._initEdges(graph.getEdges());

        window.addEventListener('resize', function () {
            self.camera.aspect = window.innerWidth / window.innerHeight;
            self.camera.updateProjectionMatrix();

            self.renderer.setSize(window.innerWidth, window.innerHeight);
            self.forceRerender();
        }, false);

        this._normalize();
        this._animate();
    };

    Frame.prototype._initScene = function () {
        this.scene = new THREE.Scene();
    };

    Frame.prototype._initCamera = function (aspect) {
        var viewAngle = 45;
        var near = 0.1;
        var far = 10000;

        var camera = new THREE.PerspectiveCamera(viewAngle, aspect, near, far);
        camera.position.z = 15;

        this.camera = camera;
    };

    Frame.prototype._initRenderer = function (width, height, elem) {
        var renderer = new THREE.WebGLRenderer({
            antialias: this.graph._antialias,
            alpha: true,
        });
        renderer.setClearColor(this.graph._bgColor, this.graph._bgOpacity);
        renderer.setSize(width, height);
        elem.appendChild(renderer.domElement);

        this.renderer = renderer;
    };

    Frame.prototype.forceRerender = function () {
        this.renderer.render(this.scene, this.camera);
    };

    Frame.prototype._initControls = function (elem) {
        var self = this;
        var controls = new TrackballControls(this.camera, elem);

        controls.addEventListener('change', function () {
            self.forceRerender();
        });

        this.controls = controls;
    };

    Frame.prototype._initNodes = function (nodes) {
        var self = this;

        var material = new THREE.ParticleSystemMaterial({
            size: this.graph._nodeSize,
            vertexColors: true,
            sizeAttenuation: this.graph._sizeAttenuation,
        });

        if (this.graph._nodeImage !== undefined) {
            var texture = THREE.ImageUtils.loadTexture(
                this.graph._nodeImage, undefined, function () {
                    // Force a rerender after node image has finished loading
                    self.forceRerender();
                });
            material.map = texture;
        }

        this.particles = new THREE.Geometry();
        for (var i = 0; i < nodes.length; i++) {
            var node = nodes[i];
            var vertex = node._pos.clone();
            var color = node._color.clone();

            this.particles.vertices.push(vertex);
            this.particles.colors.push(color);
        }

        this.particleSystem = new THREE.ParticleSystem(this.particles, material);

        if (this.graph._nodeImageTransparent === true) {
            material.transparent = true;
            this.particleSystem.sortParticles = true;
        }

        this.scene.add(this.particleSystem);
    };

    Frame.prototype._initEdges = function (edges) {
        var material = new THREE.LineBasicMaterial({
            vertexColors: true,
            linewidth: this.graph._edgeWidth,
        });
        this.edges = new THREE.Geometry();
        for (var i = 0; i < edges.length; i++) {
            var nodes = edges[i].getNodes();
            this.edges.vertices.push(nodes[0]._pos.clone());
            this.edges.colors.push(edges[i]._color.clone());
            this.edges.vertices.push(nodes[1]._pos.clone());
            this.edges.colors.push(edges[i]._color.clone());
        }
        this.line = new THREE.Line(this.edges, material, THREE.LinePieces);
        this.scene.add(this.line);
    };

    Frame.prototype._normalize = function () {
        // Calculate bounding sphere
        this.particles.computeBoundingSphere();
        var sphere = this.particles.boundingSphere;
        var center = [-sphere.center.x, -sphere.center.y, -sphere.center.z];

        // Create/apply translation transformation matrix
        var translation = new THREE.Matrix4();
        translation.makeTranslation.apply(translation, center);
        this.particles.applyMatrix(translation);
        this.edges.applyMatrix(translation);

        // Determine scale to normalize coordinates
        var scale = 5 / sphere.radius;

        // Scale coordinates
        this.particleSystem.scale.set(scale, scale, scale);
        this.line.scale.set(scale, scale, scale);
    };

    Frame.prototype._animate = function () {
        var self = this;

        (function animate() {
            window.requestAnimationFrame(animate);
            self.controls.update();
        }());
    };

    return Frame;
});
<commit_msg>Stop normalizing data before render<commit_after>define(["../lib/trackball-controls/TrackballControls"], function (TrackballControls) {
    "use strict";

    var Frame = function (elem, graph) {
        var self = this;

        if (typeof elem === 'string') {
            elem = document.getElementById(elem);
        }

        this.graph = graph;

        var width = elem.scrollWidth;
        var height = elem.scrollHeight;
        var aspectRatio = width/height;

        this._initScene();
        this._initCamera(aspectRatio);
        this._initRenderer(width, height, elem);
        this._initControls(elem);
        this._initNodes(graph.getNodes());
        this._initEdges(graph.getEdges());

        window.addEventListener('resize', function () {
            self.camera.aspect = window.innerWidth / window.innerHeight;
            self.camera.updateProjectionMatrix();

            self.renderer.setSize(window.innerWidth, window.innerHeight);
            self.forceRerender();
        }, false);

        this.positionCamera();
        this._animate();
    };

    Frame.prototype._initScene = function () {
        this.scene = new THREE.Scene();
    };

    Frame.prototype._initCamera = function (aspect) {
        var viewAngle = 45;
        var near = 0.1;
        var far = 99999999999999;

        var camera = new THREE.PerspectiveCamera(viewAngle, aspect, near, far);

        this.camera = camera;
    };

    Frame.prototype._initRenderer = function (width, height, elem) {
        var renderer = new THREE.WebGLRenderer({
            antialias: this.graph._antialias,
            alpha: true,
        });
        renderer.setClearColor(this.graph._bgColor, this.graph._bgOpacity);
        renderer.setSize(width, height);
        elem.appendChild(renderer.domElement);

        this.renderer = renderer;
    };

    Frame.prototype.forceRerender = function () {
        this.renderer.render(this.scene, this.camera);
    };

    Frame.prototype._initControls = function (elem) {
        var self = this;
        var controls = new TrackballControls(this.camera, elem);

        controls.addEventListener('change', function () {
            self.forceRerender();
        });

        this.controls = controls;
    };

    Frame.prototype.positionCamera = function () {
        // Calculate optimal camera position
        this.particles.computeBoundingSphere();
        var sphere = this.particles.boundingSphere;

        // TODO: allow the user to specify a custom FOV
        var fov = 45;

        var optimalDistance = sphere.radius / Math.tan(fov / 2);

        this.camera.position = sphere.center.clone();
        this.camera.position.x += optimalDistance;

        this.controls.target = sphere.center.clone();
    };

    Frame.prototype._initNodes = function (nodes) {
        var self = this;

        var material = new THREE.ParticleSystemMaterial({
            size: this.graph._nodeSize,
            vertexColors: true,
            sizeAttenuation: this.graph._sizeAttenuation,
        });

        if (this.graph._nodeImage !== undefined) {
            var texture = THREE.ImageUtils.loadTexture(
                this.graph._nodeImage, undefined, function () {
                    // Force a rerender after node image has finished loading
                    self.forceRerender();
                });
            material.map = texture;
        }

        this.particles = new THREE.Geometry();
        for (var i = 0; i < nodes.length; i++) {
            var node = nodes[i];
            var vertex = node._pos.clone();
            var color = node._color.clone();

            this.particles.vertices.push(vertex);
            this.particles.colors.push(color);
        }

        this.particleSystem = new THREE.ParticleSystem(this.particles, material);

        if (this.graph._nodeImageTransparent === true) {
            material.transparent = true;
            this.particleSystem.sortParticles = true;
        }

        this.scene.add(this.particleSystem);
    };

    Frame.prototype._initEdges = function (edges) {
        var material = new THREE.LineBasicMaterial({
            vertexColors: true,
            linewidth: this.graph._edgeWidth,
        });
        this.edges = new THREE.Geometry();
        for (var i = 0; i < edges.length; i++) {
            var nodes = edges[i].getNodes();
            this.edges.vertices.push(nodes[0]._pos.clone());
            this.edges.colors.push(edges[i]._color.clone());
            this.edges.vertices.push(nodes[1]._pos.clone());
            this.edges.colors.push(edges[i]._color.clone());
        }
        this.line = new THREE.Line(this.edges, material, THREE.LinePieces);
        this.scene.add(this.line);
    };

    Frame.prototype._animate = function () {
        var self = this;

        (function animate() {
            window.requestAnimationFrame(animate);
            self.controls.update();
        }());
    };

    return Frame;
});
<|endoftext|>


<commit_before>/* global window, define, module */
(function(global, factory) {
  var Gauge = factory(global);
  if(typeof define === "function" && define.amd) {
    // AMD support
    define(function() {return Gauge;});
  }else if(typeof module === "object" && module.exports) {
    // CommonJS support
    module.exports = Gauge;
  }else {
    // We are probably running in the browser
    global.Gauge = Gauge;
  }
})(typeof window === "undefined" ? this : window, function(global, undefined) {

  var document = global.document,
    slice = Array.prototype.slice,
    requestAnimationFrame = (global.requestAnimationFrame ||
        global.mozRequestAnimationFrame ||
        global.webkitRequestAnimationFrame ||
        global.msRequestAnimationFrame ||
        function(cb) {
          return setTimeout(cb, 1000 / 60);
        });

  // EXPERIMENTAL!!
  /**
   * Simplistic animation function for animating the gauge. That's all!
   * Options are:
   * {
   *  duration: 1,    // In seconds
   *  start: 0,       // The start value
   *  end: 100,       // The end value
   *  step: function, // REQUIRED! The step function that will be passed the value and does something
   *  easing: function // The easing function. Default is easeInOutCubic
   * }
   */
  function Animation(options) {
    var duration = options.duration,
        currentIteration = 1,
        iterations = 60 * duration,
        start = options.start || 0,
        end = options.end,
        change = end - start,
        step = options.step,
        easing = options.easing || function easeInOutCubic(pos) {
          // https://github.com/danro/easing-js/blob/master/easing.js
          if ((pos/=0.5) < 1) return 0.5*Math.pow(pos,3);
          return 0.5 * (Math.pow((pos-2),3) + 2);
        };

    function animate() {
      var progress = currentIteration / iterations,
          value = change * easing(progress) + start;
      // console.log(progress + ", " + value);
      step(value, currentIteration);
      currentIteration += 1;

      if(progress < 1) {
        requestAnimationFrame(animate);
      }
    }
    // start!
    requestAnimationFrame(animate);
  }

  var Gauge = (function() {
    var SVG_NS = "http://www.w3.org/2000/svg";

    var GaugeDefaults = {
      centerX: 50,
      centerY: 50
    };

    var defaultOptions = {
      dialRadius: 40,
      dialStartAngle: 135,
      dialEndAngle: 45,
      value: 0,
      max: 100,
      min: 0,
      valueDialClass: "value",
      valueClass: "value-text",
      dialClass: "dial",
      gaugeClass: "gauge",
      showValue: true,
      gaugeColor: null,
      label: function(val) {return Math.round(val);}
    };

    function shallowCopy(/* source, ...targets*/) {
      var target = arguments[0], sources = slice.call(arguments, 1);
      sources.forEach(function(s) {
        for(k in s) {
          if(s.hasOwnProperty(k)) {
            target[k] = s[k];
          }
        }
      });
      return target;
    }

    /**
     * A utility function to create SVG dom tree
     * @param {String} name The SVG element name
     * @param {Object} attrs The attributes as they appear in DOM e.g. stroke-width and not strokeWidth
     * @param {Array} children An array of children (can be created by this same function)
     * @return The SVG element
     */
    function svg(name, attrs, children) {
      var elem = document.createElementNS(SVG_NS, name);
      for(var attrName in attrs) {
        elem.setAttribute(attrName, attrs[attrName]);
      }

      if(children) {
        children.forEach(function(c) {
          elem.appendChild(c);
        });
      }
      return elem;
    }

    /**
     * Translates percentage value to angle. e.g. If gauge span angle is 180deg, then 50%
     * will be 90deg
     */
    function getAngle(percentage, gaugeSpanAngle) {
      return percentage * gaugeSpanAngle / 100;
    }

    function normalize(value, min, limit) {
      var val = Number(value);
      if(val > limit) return limit;
      if(val < min) return min;
      return val;
    }

    function getValueInPercentage(value, min, max) {
      const newMax = max - min, newVal = value - min;
      return 100 * newVal / newMax;
      // var absMin = Math.abs(min);
      // return 100 * (absMin + value) / (max + absMin);
    }

    /**
     * Gets cartesian co-ordinates for a specified radius and angle (in degrees)
     * @param cx {Number} The center x co-oriinate
     * @param cy {Number} The center y co-ordinate
     * @param radius {Number} The radius of the circle
     * @param angle {Number} The angle in degrees
     * @return An object with x,y co-ordinates
     */
    function getCartesian(cx, cy, radius, angle) {
      var rad = angle * Math.PI / 180;
      return {
        x: Math.round((cx + radius * Math.cos(rad)) * 1000) / 1000,
        y: Math.round((cy + radius * Math.sin(rad)) * 1000) / 1000
      };
    }

    // Returns start and end points for dial
    // i.e. starts at 135deg ends at 45deg with large arc flag
    // REMEMBER!! angle=0 starts on X axis and then increases clockwise
    function getDialCoords(radius, startAngle, endAngle) {
      var cx = GaugeDefaults.centerX,
          cy = GaugeDefaults.centerY;
      return {
        end: getCartesian(cx, cy, radius, endAngle),
      	start: getCartesian(cx, cy, radius, startAngle)
      };
    }

    /**
     * Creates a Gauge object. This should be called without the 'new' operator. Various options
     * can be passed for the gauge:
     * {
     *    dialStartAngle: The angle to start the dial. MUST be greater than dialEndAngle. Default 135deg
     *    dialEndAngle: The angle to end the dial. Default 45deg
     *    radius: The gauge's radius. Default 400
     *    max: The maximum value of the gauge. Default 100
     *    value: The starting value of the gauge. Default 0
     *    label: The function on how to render the center label (Should return a value)
     * }
     * @param {Element} elem The DOM into which to render the gauge
     * @param {Object} opts The gauge options
     * @return a Gauge object
     */
    return function Gauge(elem, opts) {
      opts = shallowCopy({}, defaultOptions, opts);
      var gaugeContainer = elem,
          limit = opts.max,
          min = opts.min,
          value = normalize(opts.value, min, limit),
          radius = opts.dialRadius,
          displayValue = opts.showValue,
          startAngle = opts.dialStartAngle,
          endAngle = opts.dialEndAngle,
          valueDialClass = opts.valueDialClass,
          valueTextClass = opts.valueClass,
          valueLabelClass = opts.valueLabelClass,
          dialClass = opts.dialClass,
          gaugeClass = opts.gaugeClass,
          gaugeColor = opts.color,
          gaugeValueElem,
          gaugeValuePath,
          label = opts.label,
          instance;

      if(startAngle < endAngle) {
        console.log("WARN! startAngle < endAngle, Swapping");
        var tmp = startAngle;
        startAngle = endAngle;
        endAngle = tmp;
      }

      function pathString(radius, startAngle, endAngle, largeArc) {
        var coords = getDialCoords(radius, startAngle, endAngle),
            start = coords.start,
            end = coords.end,
            largeArcFlag = typeof(largeArc) === "undefined" ? 1 : largeArc;

        return [
          "M", start.x, start.y,
          "A", radius, radius, 0, largeArcFlag, 1, end.x, end.y
        ].join(" ");
      }

      function initializeGauge(elem) {
        gaugeValueElem = svg("text", {
          x: 50,
          y: 50,
          fill: "#999",
          "class": valueTextClass,
          "font-size": "100%",
          "font-family": "sans-serif",
          "font-weight": "normal",
          "text-anchor": "middle"
        });

        gaugeValuePath = svg("path", {
          "class": valueDialClass,
          fill: "none",
          stroke: "#666",
          "stroke-width": 2.5,
          d: pathString(radius, startAngle, startAngle) // value of 0
        });

        var angle = getAngle(100, 360 - Math.abs(startAngle - endAngle));
        var flag = angle <= 180 ? 0 : 1;
        var gaugeElement = svg("svg", {"viewBox": "0 0 100 100", "class": gaugeClass},
          [
            svg("path", {
              "class": dialClass,
              fill: "none",
              stroke: "#eee",
              "stroke-width": 2,
              d: pathString(radius, startAngle, endAngle, flag)
            }),
            gaugeValueElem,
            gaugeValuePath
          ]
        );
        elem.appendChild(gaugeElement);
      }

      function updateGauge(theValue, frame) {
        var val = getValueInPercentage(theValue, min, limit),
            // angle = getAngle(val, 360 - Math.abs(endAngle - startAngle)),
            angle = getAngle(val, 360 - Math.abs(startAngle - endAngle)),
            // this is because we are using arc greater than 180deg
            flag = angle <= 180 ? 0 : 1;
        if(displayValue) {
          gaugeValueElem.textContent = label.call(opts, theValue);
        }
        gaugeValuePath.setAttribute("d", pathString(radius, startAngle, angle + startAngle, flag));
      }

      function setGaugeColor(value, duration) {
        var c = gaugeColor(value),
            dur = duration * 1000,
            pathTransition = "stroke " + dur + "ms ease";
            // textTransition = "fill " + dur + "ms ease";

        gaugeValuePath.style = [
          "stroke: " + c,
          "-webkit-transition: " + pathTransition,
          "-moz-transition: " + pathTransition,
          "transition: " + pathTransition,
        ].join(";");
        /*
        gaugeValueElem.style = [
          "fill: " + c,
          "-webkit-transition: " + textTransition,
          "-moz-transition: " + textTransition,
          "transition: " + textTransition,
        ].join(";");
        */
      }

      instance = {
        setMaxValue: function(max) {
          limit = max;
        },
        setValue: function(val) {
          value = normalize(val, min, limit);
          if(gaugeColor) {
            setGaugeColor(value, 0)
          }
          updateGauge(value);
        },
        setValueAnimated: function(val, duration) {
        	var oldVal = value;
          value = normalize(val, min, limit);
          if(oldVal === value) {
            return;
          }

          if(gaugeColor) {
            setGaugeColor(value, duration);
          }
          Animation({
            start: oldVal || 0,
            end: value,
            duration: duration || 1,
            step: function(val, frame) {
              updateGauge(val, frame);
            }
          });
        },
        getValue: function() {
          return value;
        }
      };

      initializeGauge(gaugeContainer);
      instance.setValue(value);
      return instance;
    };
  })();

  return Gauge;
});
<commit_msg>Fix text not always on center depends on browsers<commit_after>/* global window, define, module */
(function(global, factory) {
  var Gauge = factory(global);
  if(typeof define === "function" && define.amd) {
    // AMD support
    define(function() {return Gauge;});
  }else if(typeof module === "object" && module.exports) {
    // CommonJS support
    module.exports = Gauge;
  }else {
    // We are probably running in the browser
    global.Gauge = Gauge;
  }
})(typeof window === "undefined" ? this : window, function(global, undefined) {

  var document = global.document,
    slice = Array.prototype.slice,
    requestAnimationFrame = (global.requestAnimationFrame ||
        global.mozRequestAnimationFrame ||
        global.webkitRequestAnimationFrame ||
        global.msRequestAnimationFrame ||
        function(cb) {
          return setTimeout(cb, 1000 / 60);
        });

  // EXPERIMENTAL!!
  /**
   * Simplistic animation function for animating the gauge. That's all!
   * Options are:
   * {
   *  duration: 1,    // In seconds
   *  start: 0,       // The start value
   *  end: 100,       // The end value
   *  step: function, // REQUIRED! The step function that will be passed the value and does something
   *  easing: function // The easing function. Default is easeInOutCubic
   * }
   */
  function Animation(options) {
    var duration = options.duration,
        currentIteration = 1,
        iterations = 60 * duration,
        start = options.start || 0,
        end = options.end,
        change = end - start,
        step = options.step,
        easing = options.easing || function easeInOutCubic(pos) {
          // https://github.com/danro/easing-js/blob/master/easing.js
          if ((pos/=0.5) < 1) return 0.5*Math.pow(pos,3);
          return 0.5 * (Math.pow((pos-2),3) + 2);
        };

    function animate() {
      var progress = currentIteration / iterations,
          value = change * easing(progress) + start;
      // console.log(progress + ", " + value);
      step(value, currentIteration);
      currentIteration += 1;

      if(progress < 1) {
        requestAnimationFrame(animate);
      }
    }
    // start!
    requestAnimationFrame(animate);
  }

  var Gauge = (function() {
    var SVG_NS = "http://www.w3.org/2000/svg";

    var GaugeDefaults = {
      centerX: 50,
      centerY: 50
    };

    var defaultOptions = {
      dialRadius: 40,
      dialStartAngle: 135,
      dialEndAngle: 45,
      value: 0,
      max: 100,
      min: 0,
      valueDialClass: "value",
      valueClass: "value-text",
      dialClass: "dial",
      gaugeClass: "gauge",
      showValue: true,
      gaugeColor: null,
      label: function(val) {return Math.round(val);}
    };

    function shallowCopy(/* source, ...targets*/) {
      var target = arguments[0], sources = slice.call(arguments, 1);
      sources.forEach(function(s) {
        for(k in s) {
          if(s.hasOwnProperty(k)) {
            target[k] = s[k];
          }
        }
      });
      return target;
    }

    /**
     * A utility function to create SVG dom tree
     * @param {String} name The SVG element name
     * @param {Object} attrs The attributes as they appear in DOM e.g. stroke-width and not strokeWidth
     * @param {Array} children An array of children (can be created by this same function)
     * @return The SVG element
     */
    function svg(name, attrs, children) {
      var elem = document.createElementNS(SVG_NS, name);
      for(var attrName in attrs) {
        elem.setAttribute(attrName, attrs[attrName]);
      }

      if(children) {
        children.forEach(function(c) {
          elem.appendChild(c);
        });
      }
      return elem;
    }

    /**
     * Translates percentage value to angle. e.g. If gauge span angle is 180deg, then 50%
     * will be 90deg
     */
    function getAngle(percentage, gaugeSpanAngle) {
      return percentage * gaugeSpanAngle / 100;
    }

    function normalize(value, min, limit) {
      var val = Number(value);
      if(val > limit) return limit;
      if(val < min) return min;
      return val;
    }

    function getValueInPercentage(value, min, max) {
      const newMax = max - min, newVal = value - min;
      return 100 * newVal / newMax;
      // var absMin = Math.abs(min);
      // return 100 * (absMin + value) / (max + absMin);
    }

    /**
     * Gets cartesian co-ordinates for a specified radius and angle (in degrees)
     * @param cx {Number} The center x co-oriinate
     * @param cy {Number} The center y co-ordinate
     * @param radius {Number} The radius of the circle
     * @param angle {Number} The angle in degrees
     * @return An object with x,y co-ordinates
     */
    function getCartesian(cx, cy, radius, angle) {
      var rad = angle * Math.PI / 180;
      return {
        x: Math.round((cx + radius * Math.cos(rad)) * 1000) / 1000,
        y: Math.round((cy + radius * Math.sin(rad)) * 1000) / 1000
      };
    }

    // Returns start and end points for dial
    // i.e. starts at 135deg ends at 45deg with large arc flag
    // REMEMBER!! angle=0 starts on X axis and then increases clockwise
    function getDialCoords(radius, startAngle, endAngle) {
      var cx = GaugeDefaults.centerX,
          cy = GaugeDefaults.centerY;
      return {
        end: getCartesian(cx, cy, radius, endAngle),
      	start: getCartesian(cx, cy, radius, startAngle)
      };
    }

    /**
     * Creates a Gauge object. This should be called without the 'new' operator. Various options
     * can be passed for the gauge:
     * {
     *    dialStartAngle: The angle to start the dial. MUST be greater than dialEndAngle. Default 135deg
     *    dialEndAngle: The angle to end the dial. Default 45deg
     *    radius: The gauge's radius. Default 400
     *    max: The maximum value of the gauge. Default 100
     *    value: The starting value of the gauge. Default 0
     *    label: The function on how to render the center label (Should return a value)
     * }
     * @param {Element} elem The DOM into which to render the gauge
     * @param {Object} opts The gauge options
     * @return a Gauge object
     */
    return function Gauge(elem, opts) {
      opts = shallowCopy({}, defaultOptions, opts);
      var gaugeContainer = elem,
          limit = opts.max,
          min = opts.min,
          value = normalize(opts.value, min, limit),
          radius = opts.dialRadius,
          displayValue = opts.showValue,
          startAngle = opts.dialStartAngle,
          endAngle = opts.dialEndAngle,
          valueDialClass = opts.valueDialClass,
          valueTextClass = opts.valueClass,
          valueLabelClass = opts.valueLabelClass,
          dialClass = opts.dialClass,
          gaugeClass = opts.gaugeClass,
          gaugeColor = opts.color,
          gaugeValueElem,
          gaugeValuePath,
          label = opts.label,
          instance;

      if(startAngle < endAngle) {
        console.log("WARN! startAngle < endAngle, Swapping");
        var tmp = startAngle;
        startAngle = endAngle;
        endAngle = tmp;
      }

      function pathString(radius, startAngle, endAngle, largeArc) {
        var coords = getDialCoords(radius, startAngle, endAngle),
            start = coords.start,
            end = coords.end,
            largeArcFlag = typeof(largeArc) === "undefined" ? 1 : largeArc;

        return [
          "M", start.x, start.y,
          "A", radius, radius, 0, largeArcFlag, 1, end.x, end.y
        ].join(" ");
      }

      function initializeGauge(elem) {
        gaugeValueElem = svg("text", {
          x: 50,
          y: 50,
          fill: "#999",
          "class": valueTextClass,
          "font-size": "100%",
          "font-family": "sans-serif",
          "font-weight": "normal",
          "text-anchor": "middle",
          "alignment-baseline": "middle"
        });

        gaugeValuePath = svg("path", {
          "class": valueDialClass,
          fill: "none",
          stroke: "#666",
          "stroke-width": 2.5,
          d: pathString(radius, startAngle, startAngle) // value of 0
        });

        var angle = getAngle(100, 360 - Math.abs(startAngle - endAngle));
        var flag = angle <= 180 ? 0 : 1;
        var gaugeElement = svg("svg", {"viewBox": "0 0 100 100", "class": gaugeClass},
          [
            svg("path", {
              "class": dialClass,
              fill: "none",
              stroke: "#eee",
              "stroke-width": 2,
              d: pathString(radius, startAngle, endAngle, flag)
            }),
            gaugeValueElem,
            gaugeValuePath
          ]
        );
        elem.appendChild(gaugeElement);
      }

      function updateGauge(theValue, frame) {
        var val = getValueInPercentage(theValue, min, limit),
            // angle = getAngle(val, 360 - Math.abs(endAngle - startAngle)),
            angle = getAngle(val, 360 - Math.abs(startAngle - endAngle)),
            // this is because we are using arc greater than 180deg
            flag = angle <= 180 ? 0 : 1;
        if(displayValue) {
          gaugeValueElem.textContent = label.call(opts, theValue);
        }
        gaugeValuePath.setAttribute("d", pathString(radius, startAngle, angle + startAngle, flag));
      }

      function setGaugeColor(value, duration) {
        var c = gaugeColor(value),
            dur = duration * 1000,
            pathTransition = "stroke " + dur + "ms ease";
            // textTransition = "fill " + dur + "ms ease";

        gaugeValuePath.style = [
          "stroke: " + c,
          "-webkit-transition: " + pathTransition,
          "-moz-transition: " + pathTransition,
          "transition: " + pathTransition,
        ].join(";");
        /*
        gaugeValueElem.style = [
          "fill: " + c,
          "-webkit-transition: " + textTransition,
          "-moz-transition: " + textTransition,
          "transition: " + textTransition,
        ].join(";");
        */
      }

      instance = {
        setMaxValue: function(max) {
          limit = max;
        },
        setValue: function(val) {
          value = normalize(val, min, limit);
          if(gaugeColor) {
            setGaugeColor(value, 0)
          }
          updateGauge(value);
        },
        setValueAnimated: function(val, duration) {
        	var oldVal = value;
          value = normalize(val, min, limit);
          if(oldVal === value) {
            return;
          }

          if(gaugeColor) {
            setGaugeColor(value, duration);
          }
          Animation({
            start: oldVal || 0,
            end: value,
            duration: duration || 1,
            step: function(val, frame) {
              updateGauge(val, frame);
            }
          });
        },
        getValue: function() {
          return value;
        }
      };

      initializeGauge(gaugeContainer);
      instance.setValue(value);
      return instance;
    };
  })();

  return Gauge;
});
<|endoftext|>


<commit_before>module.exports = {
    name: 'always-semicolon',

    syntax: ['css', 'less', 'sass', 'scss'],

    accepts: { boolean: [true] },

    /**
     * Processes tree node.
     * @param {node} node
     */
    process: function(node) {
        if (node.type !== 'block') return;

        node = node.content;
        for (var i = node.length; i--;) {
            var currentNode = node[i];
            var currentNodeType = currentNode.type;
            var nodeWithoutSemicolon;

            // Skip nodes that already have `;` at the end:
            if (currentNodeType === 'declDelim') break;

            // Add semicolon only after declarations and includes.
            // If current node is include, insert semicolon right into it.
            // If it's declaration, look for value node:
            if (currentNodeType === 'include') {
                nodeWithoutSemicolon = currentNode;
            } else if (currentNodeType === 'declaration') {
                for (var k = currentNode.content.length; k--;) {
                    if (currentNode.content[k].type === 'value') {
                        nodeWithoutSemicolon = currentNode.content[k];
                        break;
                    }
                }
            } else {
                continue;
            }

            var space = [];
            var isBlock = false;

            // Check if there are spaces and comments at the end of the node:
            for (var j = nodeWithoutSemicolon.content.length; j--;) {
                var lastNode = nodeWithoutSemicolon.content[j].type;
                // If the node's last child is block, do not add semicolon:
                // TODO: Add syntax check and run the code only for scss
                if (lastNode === 'block') {
                    isBlock = true;
                    break;
                } else if (['s', 'commentML', 'commentSL'].indexOf(lastNode) === -1) break;

                space.unshift(nodeWithoutSemicolon.content[j]);
            }

            if (isBlock) break;

            // Temporarily remove last spaces and comments and insert `;`
            // before them:
            nodeWithoutSemicolon.content.splice(nodeWithoutSemicolon.content.length - space.length);
            var declDelim = { type: 'declDelim', content: null };
            var args = [i + 1, 0, declDelim].concat(space);
            node.splice.apply(node, args);
            break;
        }
    },

    /**
     * Detects the value of an option at the tree node.
     *
     * @param {String} nodeType
     * @param {node} node
     */
    detect: function(nodeType, node) {
        if (nodeType === 'block') {
            for (var i = node.length; i--;) {
                var nodeItem = node[i];
                var type = nodeItem[0];
                if (type === 'declDelim') return true;

                if (type === 'declaration') return false;
            }
        }
    }
};
<commit_msg>Gonzales 3.0: Update `always-semicolon` option<commit_after>var gonzales = require('gonzales-pe');

module.exports = {
    name: 'always-semicolon',

    syntax: ['css', 'less', 'sass', 'scss'],

    accepts: { boolean: [true] },

    /**
     * Processes tree node.
     * @param {node} node
     */
    process: function(node) {
        if (node.type !== 'block') return;

        node = node.content;
        for (var i = node.length; i--;) {
            var currentNode = node[i];
            var currentNodeType = currentNode.type;
            var nodeWithoutSemicolon;

            // Skip nodes that already have `;` at the end:
            if (currentNodeType === 'declDelim') break;

            // Add semicolon only after declarations and includes.
            // If current node is include, insert semicolon right into it.
            // If it's declaration, look for value node:
            if (currentNodeType === 'include') {
                nodeWithoutSemicolon = currentNode;
            } else if (currentNodeType === 'declaration') {
                for (var k = currentNode.content.length; k--;) {
                    if (currentNode.content[k].type === 'value') {
                        nodeWithoutSemicolon = currentNode.content[k];
                        break;
                    }
                }
            } else {
                continue;
            }

            var space = [];
            var isBlock = false;

            // Check if there are spaces and comments at the end of the node:
            for (var j = nodeWithoutSemicolon.content.length; j--;) {
                var lastNode = nodeWithoutSemicolon.content[j].type;
                // If the node's last child is block, do not add semicolon:
                // TODO: Add syntax check and run the code only for scss
                if (lastNode === 'block') {
                    isBlock = true;
                    break;
                } else if (['s', 'commentML', 'commentSL'].indexOf(lastNode) === -1) break;

                space.unshift(nodeWithoutSemicolon.content[j]);
            }

            if (isBlock) break;

            // Temporarily remove last spaces and comments and insert `;`
            // before them:
            nodeWithoutSemicolon.content.splice(nodeWithoutSemicolon.content.length - space.length);
            var declDelim = gonzales.createNode({ type: 'declDelim', content: ';' });
            var args = [i + 1, 0, declDelim].concat(space);
            node.splice.apply(node, args);
            break;
        }
    },

    /**
     * Detects the value of an option at the tree node.
     *
     * @param {node} node
     */
    detect: function(node) {
        if (node.type === 'block') {
            for (var i = node.content.length; i--;) {
                var nodeItem = node.content[i];
                var type = nodeItem.type;
                if (type === 'declDelim') return true;

                if (type === 'declaration') return false;
            }
        }
    }
};
<|endoftext|>


<commit_before>// TODO: rename to OK packet
// https://dev.mysql.com/doc/internals/en/packet-OK_Packet.html

var Buffer = require('safe-buffer').Buffer;

var Packet = require('./packet.js');
var ClientConstants = require('../constants/client.js');
var ServerSatusFlags = require('../constants/server_status.js');

var SessionChangeTypeToName = ['systemVariables', 'schema', 'status', 'gtids'];

function ResultSetHeader (packet, connection)
{
  var bigNumberStrings = connection.config.bigNumberStrings;
  var encoding = connection.serverEncoding;

  var flags = connection._handshakePacket.capabilityFlags;

  var isSet = function (flag) {
    return flags & ClientConstants[flag];
  };

  if (packet.buffer[packet.offset] !== 0) {
    this.fieldCount = packet.readLengthCodedNumber();
    if (this.fieldCount === null) {
      this.infileName = packet.readString(undefined, encoding);
    }
    return;
  }

  this.fieldCount = packet.readInt8(); // skip OK byte
  this.affectedRows = packet.readLengthCodedNumber(bigNumberStrings);
  this.insertId = packet.readLengthCodedNumberSigned(bigNumberStrings);
  this.info = '';

  if (isSet('PROTOCOL_41')) {
    this.serverStatus = packet.readInt16();
    this.warningStatus = packet.readInt16();
  } else if (isSet('TRANSACTIONS')) {
    this.serverStatus = packet.readInt16();
  }

  var stateChanges = null;
  if (isSet('SESSION_TRACK') && packet.offset < packet.end) {
    this.info = packet.readLengthCodedString(encoding);
    if (this.serverStatus && ServerSatusFlags.SERVER_SESSION_STATE_CHANGED) {

      // session change info record - see
      // https://dev.mysql.com/doc/internals/en/packet-OK_Packet.html#cs-sect-packet-ok-sessioninfo

      var len = packet.offset < packet.end ? packet.readLengthCodedNumber() : 0;
      var end = packet.offset + len;
      var type, len, key, stateEnd;

      if (len > 0) {
        stateChanges = {
          systemVariables: {},
          schema: null,
          // gtids: {},
          trackStateChange: null
        };
      }

      while (packet.offset < end) {
        type = packet.readInt8();
        len = packet.readLengthCodedNumber();
        stateEnd = packet.offset + len;
        key = packet.readLengthCodedString(encoding);
        if (type === 0) {
          var val = packet.readLengthCodedString(encoding);
          stateChanges.systemVariables[key] = val;
        } else if (type === 1) {
          // TODO double check it's supposed to be the only value, not a list.
          stateChanges.schema = key;
        } else if (type === 2) {
          stateChanges.trackStateChange = packet.readLengthCodedString(encoding);
        } else {
          // GTIDs (type == 3) or unknown type - just skip for now
        }
        packet.offset = stateEnd;
      }
    }
  } else {
    this.info = packet.readString(undefined, encoding);
  }

  if (stateChanges) {
    this.stateChanges = stateChanges;
  }

  var m = this.info.match(/\schanged:\s*(\d+)/i);
  if (m !== null) {
    this.changedRows = parseInt(m[1], 10);
  }
}

// TODO: should be consistent instance member, but it's just easier here to have just function
ResultSetHeader.toPacket = function (fieldCount, insertId, sequenceId) {
  var length = 4 + Packet.lengthCodedNumberLength(fieldCount);
  if (typeof (insertId) != 'undefined') {
    length += Packet.lengthCodedNumberLength(insertId);
  }
  var buffer = Buffer.allocUnsafe(length);
  var packet = new Packet(0, buffer, 0, length);
  packet.offset = 4;
  packet.writeLengthCodedNumber(fieldCount);
  if (typeof (insertId) != 'undefined') {
    packet.writeLengthCodedNumber(insertId);
  }
  return packet;
};

module.exports = ResultSetHeader;
<commit_msg>when we see in trackSeessionInfo data character_set_client varable is updated, update clients charsetNumber accordingly. Closes #389<commit_after>// TODO: rename to OK packet
// https://dev.mysql.com/doc/internals/en/packet-OK_Packet.html

var Buffer = require('safe-buffer').Buffer;

var Packet = require('./packet.js');
var ClientConstants = require('../constants/client.js');
var ServerSatusFlags = require('../constants/server_status.js');

var EncodingToCharset = require('../constants/encoding_charset.js');

var SessionChangeTypeToName = ['systemVariables', 'schema', 'status', 'gtids'];

function ResultSetHeader (packet, connection)
{
  var bigNumberStrings = connection.config.bigNumberStrings;
  var encoding = connection.serverEncoding;

  var flags = connection._handshakePacket.capabilityFlags;

  var isSet = function (flag) {
    return flags & ClientConstants[flag];
  };

  if (packet.buffer[packet.offset] !== 0) {
    this.fieldCount = packet.readLengthCodedNumber();
    if (this.fieldCount === null) {
      this.infileName = packet.readString(undefined, encoding);
    }
    return;
  }

  this.fieldCount = packet.readInt8(); // skip OK byte
  this.affectedRows = packet.readLengthCodedNumber(bigNumberStrings);
  this.insertId = packet.readLengthCodedNumberSigned(bigNumberStrings);
  this.info = '';

  if (isSet('PROTOCOL_41')) {
    this.serverStatus = packet.readInt16();
    this.warningStatus = packet.readInt16();
  } else if (isSet('TRANSACTIONS')) {
    this.serverStatus = packet.readInt16();
  }

  var stateChanges = null;
  if (isSet('SESSION_TRACK') && packet.offset < packet.end) {
    this.info = packet.readLengthCodedString(encoding);
    if (this.serverStatus && ServerSatusFlags.SERVER_SESSION_STATE_CHANGED) {

      // session change info record - see
      // https://dev.mysql.com/doc/internals/en/packet-OK_Packet.html#cs-sect-packet-ok-sessioninfo

      var len = packet.offset < packet.end ? packet.readLengthCodedNumber() : 0;
      var end = packet.offset + len;
      var type, len, key, stateEnd;

      if (len > 0) {
        stateChanges = {
          systemVariables: {},
          schema: null,
          // gtids: {},
          trackStateChange: null
        };
      }

      while (packet.offset < end) {
        type = packet.readInt8();
        len = packet.readLengthCodedNumber();
        stateEnd = packet.offset + len;
        key = packet.readLengthCodedString(encoding);
        if (type === 0) {
          var val = packet.readLengthCodedString(encoding);
          stateChanges.systemVariables[key] = val;
          if (key == 'character_set_client') {
            var charsetNumber = EncodingToCharset[val];
            connection.config.charsetNumber = charsetNumber;
          }
        } else if (type === 1) {
          // TODO double check it's supposed to be the only value, not a list.
          stateChanges.schema = key;
        } else if (type === 2) {
          stateChanges.trackStateChange = packet.readLengthCodedString(encoding);
        } else {
          // GTIDs (type == 3) or unknown type - just skip for now
        }
        packet.offset = stateEnd;
      }
    }
  } else {
    this.info = packet.readString(undefined, encoding);
  }

  if (stateChanges) {
    this.stateChanges = stateChanges;
  }

  var m = this.info.match(/\schanged:\s*(\d+)/i);
  if (m !== null) {
    this.changedRows = parseInt(m[1], 10);
  }
}

// TODO: should be consistent instance member, but it's just easier here to have just function
ResultSetHeader.toPacket = function (fieldCount, insertId, sequenceId) {
  var length = 4 + Packet.lengthCodedNumberLength(fieldCount);
  if (typeof (insertId) != 'undefined') {
    length += Packet.lengthCodedNumberLength(insertId);
  }
  var buffer = Buffer.allocUnsafe(length);
  var packet = new Packet(0, buffer, 0, length);
  packet.offset = 4;
  packet.writeLengthCodedNumber(fieldCount);
  if (typeof (insertId) != 'undefined') {
    packet.writeLengthCodedNumber(insertId);
  }
  return packet;
};

module.exports = ResultSetHeader;
<|endoftext|>


<commit_before>import { useEffect, useRef } from 'react'

// based on https://overreacted.io/making-setinterval-declarative-with-react-hooks/
export const useInterval = (callback, delay) => {
  const savedCallback = useRef()

  // Remember the latest callback.
  useEffect(() => {
    savedCallback.current = callback
  }, [callback])

  // Set up the interval.
  useEffect(() => {
    const tick = () => {
      savedCallback.current()
    }
    if (delay !== null) {
      let id = setInterval(tick, delay)
      return () => clearInterval(id)
    }
  }, [delay])
}
<commit_msg>Delete hooks.js<commit_after><|endoftext|>