From 7ab4b31d62f2e465f3270723a5c15c03c1e4fe4c Mon Sep 17 00:00:00 2001 From: Lanius Trolling Date: Tue, 14 Feb 2023 12:14:19 -0500 Subject: [PATCH] Remove excess mesh-viewer code --- .../kotlin/info/mechyrdia/lore/parser_tags.kt | 2 +- .../kotlin/info/mechyrdia/lore/view_tpl.kt | 5 +- .../polymer/lib/elements/array-selector.html | 410 --- .../polymer/lib/elements/custom-style.html | 73 - .../polymer/lib/elements/dom-bind.html | 121 - .../polymer/lib/elements/dom-if.html | 265 -- .../polymer/lib/elements/dom-module.html | 134 - .../polymer/lib/elements/dom-repeat.html | 687 ----- .../polymer/lib/legacy/class.html | 334 --- .../lib/legacy/legacy-element-mixin.html | 917 ------- .../lib/legacy/mutable-data-behavior.html | 150 -- .../polymer/lib/legacy/polymer-fn.html | 48 - .../polymer/lib/legacy/polymer.dom.html | 336 --- .../lib/legacy/templatizer-behavior.html | 136 - .../polymer/lib/mixins/element-mixin.html | 929 ------- .../lib/mixins/gesture-event-listeners.html | 61 - .../polymer/lib/mixins/mutable-data.html | 194 -- .../lib/mixins/property-accessors.html | 576 ---- .../polymer/lib/mixins/property-effects.html | 2384 ----------------- .../polymer/lib/mixins/template-stamp.html | 477 ---- .../polymer/lib/utils/array-splice.html | 321 --- .../polymer/lib/utils/async.html | 203 -- .../polymer/lib/utils/boot.html | 60 - .../polymer/lib/utils/case-map.html | 64 - .../polymer/lib/utils/debounce.html | 94 - .../lib/utils/flattened-nodes-observer.html | 242 -- .../polymer/lib/utils/flush.html | 60 - .../polymer/lib/utils/gestures.html | 853 ------ .../polymer/lib/utils/import-href.html | 107 - .../polymer/lib/utils/mixin.html | 76 - .../polymer/lib/utils/path.html | 274 -- .../polymer/lib/utils/render-status.html | 130 - .../polymer/lib/utils/resolve-url.html | 108 - .../polymer/lib/utils/style-gather.html | 146 - .../polymer/lib/utils/templatize.html | 473 ---- .../polymer/lib/utils/unresolved.html | 31 - .../polymer/polymer-element.html | 33 - .../bower_components/polymer/polymer.html | 25 - .../bower_components/shadycss/apply-shim.html | 10 - .../shadycss/apply-shim.min.js | 29 - .../shadycss/apply-shim.min.js.map | 1 - .../shadycss/custom-style-interface.html | 10 - .../shadycss/custom-style-interface.min.js | 16 - .../custom-style-interface.min.js.map | 1 - .../shadycss/scoping-shim.min.js | 54 - .../shadycss/scoping-shim.min.js.map | 1 - .../webcomponentsjs/webcomponents-lite.js | 194 -- .../webcomponentsjs/webcomponents-lite.js.map | 1 - .../static/gltf-viewer/gltf-viewer.html | 176 -- src/main/resources/static/init.js | 70 + .../js => obj-viewer}/OrbitControls.js | 0 .../js => obj-viewer}/three-examples.js | 0 .../{gltf-viewer/js => obj-viewer}/three.js | 0 53 files changed, 74 insertions(+), 12028 deletions(-) delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/polymer/lib/elements/array-selector.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/polymer/lib/elements/custom-style.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/polymer/lib/elements/dom-bind.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/polymer/lib/elements/dom-if.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/polymer/lib/elements/dom-module.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/polymer/lib/elements/dom-repeat.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/polymer/lib/legacy/class.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/polymer/lib/legacy/legacy-element-mixin.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/polymer/lib/legacy/mutable-data-behavior.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/polymer/lib/legacy/polymer-fn.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/polymer/lib/legacy/polymer.dom.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/polymer/lib/legacy/templatizer-behavior.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/polymer/lib/mixins/element-mixin.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/polymer/lib/mixins/gesture-event-listeners.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/polymer/lib/mixins/mutable-data.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/polymer/lib/mixins/property-accessors.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/polymer/lib/mixins/property-effects.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/polymer/lib/mixins/template-stamp.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/array-splice.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/async.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/boot.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/case-map.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/debounce.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/flattened-nodes-observer.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/flush.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/gestures.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/import-href.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/mixin.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/path.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/render-status.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/resolve-url.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/style-gather.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/templatize.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/unresolved.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/polymer/polymer-element.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/polymer/polymer.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/shadycss/apply-shim.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/shadycss/apply-shim.min.js delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/shadycss/apply-shim.min.js.map delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/shadycss/custom-style-interface.html delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/shadycss/custom-style-interface.min.js delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/shadycss/custom-style-interface.min.js.map delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/shadycss/scoping-shim.min.js delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/shadycss/scoping-shim.min.js.map delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/webcomponentsjs/webcomponents-lite.js delete mode 100644 src/main/resources/static/gltf-viewer/bower_components/webcomponentsjs/webcomponents-lite.js.map delete mode 100644 src/main/resources/static/gltf-viewer/gltf-viewer.html rename src/main/resources/static/{gltf-viewer/js => obj-viewer}/OrbitControls.js (100%) rename src/main/resources/static/{gltf-viewer/js => obj-viewer}/three-examples.js (100%) rename src/main/resources/static/{gltf-viewer/js => obj-viewer}/three.js (100%) diff --git a/src/main/kotlin/info/mechyrdia/lore/parser_tags.kt b/src/main/kotlin/info/mechyrdia/lore/parser_tags.kt index 3fbfdf5..3a1cbc1 100644 --- a/src/main/kotlin/info/mechyrdia/lore/parser_tags.kt +++ b/src/main/kotlin/info/mechyrdia/lore/parser_tags.kt @@ -164,7 +164,7 @@ enum class TextParserFormattingTag(val type: TextParserTagType) { val (width, height) = getSizeParam(tagParam) val sizeAttrs = getImageSizeAttributes(width, height) - "" + "" } ), diff --git a/src/main/kotlin/info/mechyrdia/lore/view_tpl.kt b/src/main/kotlin/info/mechyrdia/lore/view_tpl.kt index c93af0a..7806670 100644 --- a/src/main/kotlin/info/mechyrdia/lore/view_tpl.kt +++ b/src/main/kotlin/info/mechyrdia/lore/view_tpl.kt @@ -17,8 +17,9 @@ fun ApplicationCall.page(pageTitle: String, navBar: List? = null, sideb meta(charset = "utf-8") meta(name = "viewport", content = "width=device-width, initial-scale=1.0") - script(src = "/static/gltf-viewer/bower_components/webcomponentsjs/webcomponents-lite.js") {} - link(rel = "import", href = "/static/gltf-viewer/gltf-viewer.html") + script(src = "/static/obj-viewer/three.js") {} + script(src = "/static/obj-viewer/three-examples.js") {} + script(src = "/static/obj-viewer/OrbitControls.js") {} link(rel = "icon", type = "image/svg+xml", href = "/static/images/icon.svg") diff --git a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/elements/array-selector.html b/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/elements/array-selector.html deleted file mode 100644 index 85603aa..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/elements/array-selector.html +++ /dev/null @@ -1,410 +0,0 @@ - - - - - - - diff --git a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/elements/custom-style.html b/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/elements/custom-style.html deleted file mode 100644 index 8aae908..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/elements/custom-style.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - diff --git a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/elements/dom-bind.html b/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/elements/dom-bind.html deleted file mode 100644 index 436791d..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/elements/dom-bind.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - diff --git a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/elements/dom-if.html b/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/elements/dom-if.html deleted file mode 100644 index 842e5a6..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/elements/dom-if.html +++ /dev/null @@ -1,265 +0,0 @@ - - - - - - - - diff --git a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/elements/dom-module.html b/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/elements/dom-module.html deleted file mode 100644 index 99edb7f..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/elements/dom-module.html +++ /dev/null @@ -1,134 +0,0 @@ - - - - diff --git a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/elements/dom-repeat.html b/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/elements/dom-repeat.html deleted file mode 100644 index 6969014..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/elements/dom-repeat.html +++ /dev/null @@ -1,687 +0,0 @@ - - - - - - - - - diff --git a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/legacy/class.html b/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/legacy/class.html deleted file mode 100644 index a63c6a1..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/legacy/class.html +++ /dev/null @@ -1,334 +0,0 @@ - - - diff --git a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/legacy/legacy-element-mixin.html b/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/legacy/legacy-element-mixin.html deleted file mode 100644 index e831d6c..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/legacy/legacy-element-mixin.html +++ /dev/null @@ -1,917 +0,0 @@ - - - - - - - - - - - - diff --git a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/legacy/mutable-data-behavior.html b/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/legacy/mutable-data-behavior.html deleted file mode 100644 index 7a1d529..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/legacy/mutable-data-behavior.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - diff --git a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/legacy/polymer-fn.html b/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/legacy/polymer-fn.html deleted file mode 100644 index 1a145c9..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/legacy/polymer-fn.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - diff --git a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/legacy/polymer.dom.html b/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/legacy/polymer.dom.html deleted file mode 100644 index ae9ba4b..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/legacy/polymer.dom.html +++ /dev/null @@ -1,336 +0,0 @@ - - - - - diff --git a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/legacy/templatizer-behavior.html b/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/legacy/templatizer-behavior.html deleted file mode 100644 index 4f3a14a..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/legacy/templatizer-behavior.html +++ /dev/null @@ -1,136 +0,0 @@ - - - - - diff --git a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/mixins/element-mixin.html b/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/mixins/element-mixin.html deleted file mode 100644 index 92b728d..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/mixins/element-mixin.html +++ /dev/null @@ -1,929 +0,0 @@ - - - - - - - - - - - diff --git a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/mixins/gesture-event-listeners.html b/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/mixins/gesture-event-listeners.html deleted file mode 100644 index dcf163d..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/mixins/gesture-event-listeners.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - diff --git a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/mixins/mutable-data.html b/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/mixins/mutable-data.html deleted file mode 100644 index 9cb6493..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/mixins/mutable-data.html +++ /dev/null @@ -1,194 +0,0 @@ - - - - - diff --git a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/mixins/property-accessors.html b/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/mixins/property-accessors.html deleted file mode 100644 index a586f31..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/mixins/property-accessors.html +++ /dev/null @@ -1,576 +0,0 @@ - - - - - - - - diff --git a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/mixins/property-effects.html b/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/mixins/property-effects.html deleted file mode 100644 index 5be94f0..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/mixins/property-effects.html +++ /dev/null @@ -1,2384 +0,0 @@ - - - - - - - - - - - - - - diff --git a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/mixins/template-stamp.html b/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/mixins/template-stamp.html deleted file mode 100644 index af17ee3..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/mixins/template-stamp.html +++ /dev/null @@ -1,477 +0,0 @@ - - - - - - diff --git a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/array-splice.html b/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/array-splice.html deleted file mode 100644 index 9008ebf..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/array-splice.html +++ /dev/null @@ -1,321 +0,0 @@ - - - \ No newline at end of file diff --git a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/async.html b/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/async.html deleted file mode 100644 index 19293dd..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/async.html +++ /dev/null @@ -1,203 +0,0 @@ - - - - diff --git a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/boot.html b/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/boot.html deleted file mode 100644 index aefae13..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/boot.html +++ /dev/null @@ -1,60 +0,0 @@ - - diff --git a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/case-map.html b/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/case-map.html deleted file mode 100644 index b1b44cd..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/case-map.html +++ /dev/null @@ -1,64 +0,0 @@ - - - diff --git a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/debounce.html b/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/debounce.html deleted file mode 100644 index dc8f66a..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/debounce.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - diff --git a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/flattened-nodes-observer.html b/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/flattened-nodes-observer.html deleted file mode 100644 index c1f75d0..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/flattened-nodes-observer.html +++ /dev/null @@ -1,242 +0,0 @@ - - - - - diff --git a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/flush.html b/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/flush.html deleted file mode 100644 index 0e3384b..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/flush.html +++ /dev/null @@ -1,60 +0,0 @@ - - - diff --git a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/gestures.html b/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/gestures.html deleted file mode 100644 index 4ee65c3..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/gestures.html +++ /dev/null @@ -1,853 +0,0 @@ - - - - - - diff --git a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/import-href.html b/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/import-href.html deleted file mode 100644 index 77933a4..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/import-href.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - - diff --git a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/mixin.html b/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/mixin.html deleted file mode 100644 index 12a4ebb..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/mixin.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - diff --git a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/path.html b/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/path.html deleted file mode 100644 index 2dfe894..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/path.html +++ /dev/null @@ -1,274 +0,0 @@ - - - - - diff --git a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/render-status.html b/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/render-status.html deleted file mode 100644 index ca7175a..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/render-status.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - diff --git a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/resolve-url.html b/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/resolve-url.html deleted file mode 100644 index 7bffd13..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/resolve-url.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - diff --git a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/style-gather.html b/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/style-gather.html deleted file mode 100644 index e18a347..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/style-gather.html +++ /dev/null @@ -1,146 +0,0 @@ - - - diff --git a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/templatize.html b/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/templatize.html deleted file mode 100644 index 456c015..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/templatize.html +++ /dev/null @@ -1,473 +0,0 @@ - - - - - - - diff --git a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/unresolved.html b/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/unresolved.html deleted file mode 100644 index 6c8752a..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/polymer/lib/utils/unresolved.html +++ /dev/null @@ -1,31 +0,0 @@ - - diff --git a/src/main/resources/static/gltf-viewer/bower_components/polymer/polymer-element.html b/src/main/resources/static/gltf-viewer/bower_components/polymer/polymer-element.html deleted file mode 100644 index 1dac595..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/polymer/polymer-element.html +++ /dev/null @@ -1,33 +0,0 @@ - - - \ No newline at end of file diff --git a/src/main/resources/static/gltf-viewer/bower_components/polymer/polymer.html b/src/main/resources/static/gltf-viewer/bower_components/polymer/polymer.html deleted file mode 100644 index 0331373..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/polymer/polymer.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - diff --git a/src/main/resources/static/gltf-viewer/bower_components/shadycss/apply-shim.html b/src/main/resources/static/gltf-viewer/bower_components/shadycss/apply-shim.html deleted file mode 100644 index d344ec3..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/shadycss/apply-shim.html +++ /dev/null @@ -1,10 +0,0 @@ - - diff --git a/src/main/resources/static/gltf-viewer/bower_components/shadycss/apply-shim.min.js b/src/main/resources/static/gltf-viewer/bower_components/shadycss/apply-shim.min.js deleted file mode 100644 index 7fec2ff..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/shadycss/apply-shim.min.js +++ /dev/null @@ -1,29 +0,0 @@ -(function(){ -/* - -Copyright (c) 2017 The Polymer Project Authors. All rights reserved. -This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt -The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt -The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt -Code distributed by Google as part of the polymer project is also -subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt -*/ -'use strict';var l={};function m(){this.end=this.start=0;this.rules=this.parent=this.previous=null;this.cssText=this.parsedCssText="";this.atRule=!1;this.type=0;this.parsedSelector=this.selector=this.keyframesName=""} -function p(a){a=a.replace(aa,"").replace(ba,"");var b=q,c=a,d=new m;d.start=0;d.end=c.length;for(var e=d,f=0,h=c.length;f *")}; -function pa(a,b){b=b.replace(B,function(b,d,e,f){return qa(a,b,d,e,f)});return O(a,b)}function O(a,b){for(var c;c=C.exec(b);){var d=c[0],e=c[1];c=c.index;var f=b.slice(0,c+d.indexOf("@apply"));b=b.slice(c+d.length);var h=P(a,f),g,k,d=void 0;g=a;var e=e.replace(na,""),n=[];k=g.a.get(e);k||(g.a.set(e,{}),k=g.a.get(e));if(k)for(d in g.c&&(k.i[g.c]=!0),k.h)g=h&&h[d],k=[d,": var(",e,"_-_",d],g&&k.push(",",g),k.push(")"),n.push(k.join(""));d=n.join("; ");b=""+f+d+b;C.lastIndex=c+d.length}return b} -function P(a,b){b=b.split(";");for(var c,d,e={},f=0,h;f}\n */\nconst templateMap = {};\nexport default templateMap;\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n/*\nExtremely simple css parser. Intended to be not more than what we need\nand definitely not necessarily correct =).\n*/\n\n'use strict';\n\n/** @unrestricted */\nclass StyleNode {\n constructor() {\n /** @type {number} */\n this['start'] = 0;\n /** @type {number} */\n this['end'] = 0;\n /** @type {StyleNode} */\n this['previous'] = null;\n /** @type {StyleNode} */\n this['parent'] = null;\n /** @type {Array} */\n this['rules'] = null;\n /** @type {string} */\n this['parsedCssText'] = '';\n /** @type {string} */\n this['cssText'] = '';\n /** @type {boolean} */\n this['atRule'] = false;\n /** @type {number} */\n this['type'] = 0;\n /** @type {string} */\n this['keyframesName'] = '';\n /** @type {string} */\n this['selector'] = '';\n /** @type {string} */\n this['parsedSelector'] = '';\n }\n}\n\nexport {StyleNode}\n\n// given a string of css, return a simple rule tree\n/**\n * @param {string} text\n * @return {StyleNode}\n */\nexport function parse(text) {\n text = clean(text);\n return parseCss(lex(text), text);\n}\n\n// remove stuff we don't care about that may hinder parsing\n/**\n * @param {string} cssText\n * @return {string}\n */\nfunction clean(cssText) {\n return cssText.replace(RX.comments, '').replace(RX.port, '');\n}\n\n// super simple {...} lexer that returns a node tree\n/**\n * @param {string} text\n * @return {StyleNode}\n */\nfunction lex(text) {\n let root = new StyleNode();\n root['start'] = 0;\n root['end'] = text.length\n let n = root;\n for (let i = 0, l = text.length; i < l; i++) {\n if (text[i] === OPEN_BRACE) {\n if (!n['rules']) {\n n['rules'] = [];\n }\n let p = n;\n let previous = p['rules'][p['rules'].length - 1] || null;\n n = new StyleNode();\n n['start'] = i + 1;\n n['parent'] = p;\n n['previous'] = previous;\n p['rules'].push(n);\n } else if (text[i] === CLOSE_BRACE) {\n n['end'] = i + 1;\n n = n['parent'] || root;\n }\n }\n return root;\n}\n\n// add selectors/cssText to node tree\n/**\n * @param {StyleNode} node\n * @param {string} text\n * @return {StyleNode}\n */\nfunction parseCss(node, text) {\n let t = text.substring(node['start'], node['end'] - 1);\n node['parsedCssText'] = node['cssText'] = t.trim();\n if (node['parent']) {\n let ss = node['previous'] ? node['previous']['end'] : node['parent']['start'];\n t = text.substring(ss, node['start'] - 1);\n t = _expandUnicodeEscapes(t);\n t = t.replace(RX.multipleSpaces, ' ');\n // TODO(sorvell): ad hoc; make selector include only after last ;\n // helps with mixin syntax\n t = t.substring(t.lastIndexOf(';') + 1);\n let s = node['parsedSelector'] = node['selector'] = t.trim();\n node['atRule'] = (s.indexOf(AT_START) === 0);\n // note, support a subset of rule types...\n if (node['atRule']) {\n if (s.indexOf(MEDIA_START) === 0) {\n node['type'] = types.MEDIA_RULE;\n } else if (s.match(RX.keyframesRule)) {\n node['type'] = types.KEYFRAMES_RULE;\n node['keyframesName'] =\n node['selector'].split(RX.multipleSpaces).pop();\n }\n } else {\n if (s.indexOf(VAR_START) === 0) {\n node['type'] = types.MIXIN_RULE;\n } else {\n node['type'] = types.STYLE_RULE;\n }\n }\n }\n let r$ = node['rules'];\n if (r$) {\n for (let i = 0, l = r$.length, r;\n (i < l) && (r = r$[i]); i++) {\n parseCss(r, text);\n }\n }\n return node;\n}\n\n/**\n * conversion of sort unicode escapes with spaces like `\\33 ` (and longer) into\n * expanded form that doesn't require trailing space `\\000033`\n * @param {string} s\n * @return {string}\n */\nfunction _expandUnicodeEscapes(s) {\n return s.replace(/\\\\([0-9a-f]{1,6})\\s/gi, function() {\n let code = arguments[1],\n repeat = 6 - code.length;\n while (repeat--) {\n code = '0' + code;\n }\n return '\\\\' + code;\n });\n}\n\n/**\n * stringify parsed css.\n * @param {StyleNode} node\n * @param {boolean=} preserveProperties\n * @param {string=} text\n * @return {string}\n */\nexport function stringify(node, preserveProperties, text = '') {\n // calc rule cssText\n let cssText = '';\n if (node['cssText'] || node['rules']) {\n let r$ = node['rules'];\n if (r$ && !_hasMixinRules(r$)) {\n for (let i = 0, l = r$.length, r;\n (i < l) && (r = r$[i]); i++) {\n cssText = stringify(r, preserveProperties, cssText);\n }\n } else {\n cssText = preserveProperties ? node['cssText'] :\n removeCustomProps(node['cssText']);\n cssText = cssText.trim();\n if (cssText) {\n cssText = ' ' + cssText + '\\n';\n }\n }\n }\n // emit rule if there is cssText\n if (cssText) {\n if (node['selector']) {\n text += node['selector'] + ' ' + OPEN_BRACE + '\\n';\n }\n text += cssText;\n if (node['selector']) {\n text += CLOSE_BRACE + '\\n\\n';\n }\n }\n return text;\n}\n\n/**\n * @param {Array} rules\n * @return {boolean}\n */\nfunction _hasMixinRules(rules) {\n let r = rules[0];\n return Boolean(r) && Boolean(r['selector']) && r['selector'].indexOf(VAR_START) === 0;\n}\n\n/**\n * @param {string} cssText\n * @return {string}\n */\nfunction removeCustomProps(cssText) {\n cssText = removeCustomPropAssignment(cssText);\n return removeCustomPropApply(cssText);\n}\n\n/**\n * @param {string} cssText\n * @return {string}\n */\nexport function removeCustomPropAssignment(cssText) {\n return cssText\n .replace(RX.customProp, '')\n .replace(RX.mixinProp, '');\n}\n\n/**\n * @param {string} cssText\n * @return {string}\n */\nfunction removeCustomPropApply(cssText) {\n return cssText\n .replace(RX.mixinApply, '')\n .replace(RX.varApply, '');\n}\n\n/** @enum {number} */\nexport const types = {\n STYLE_RULE: 1,\n KEYFRAMES_RULE: 7,\n MEDIA_RULE: 4,\n MIXIN_RULE: 1000\n}\n\nconst OPEN_BRACE = '{';\nconst CLOSE_BRACE = '}';\n\n// helper regexp's\nconst RX = {\n comments: /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//gim,\n port: /@import[^;]*;/gim,\n customProp: /(?:^[^;\\-\\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\\n]|$)/gim,\n mixinProp: /(?:^[^;\\-\\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\\n]|$)?/gim,\n mixinApply: /@apply\\s*\\(?[^);]*\\)?\\s*(?:[;\\n]|$)?/gim,\n varApply: /[^;:]*?:[^;]*?var\\([^;]*\\)(?:[;\\n]|$)?/gim,\n keyframesRule: /^@[^\\s]*keyframes/,\n multipleSpaces: /\\s+/g\n}\n\nconst VAR_START = '--';\nconst MEDIA_START = '@media';\nconst AT_START = '@';\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\nimport templateMap from './template-map'\nimport {StyleNode} from './css-parse' // eslint-disable-line no-unused-vars\n\n/*\n * Utilities for handling invalidating apply-shim mixins for a given template.\n *\n * The invalidation strategy involves keeping track of the \"current\" version of a template's mixins, and updating that count when a mixin is invalidated.\n * The template\n */\n\n/** @const {string} */\nconst CURRENT_VERSION = '_applyShimCurrentVersion';\n\n/** @const {string} */\nconst NEXT_VERSION = '_applyShimNextVersion';\n\n/** @const {string} */\nconst VALIDATING_VERSION = '_applyShimValidatingVersion';\n\n/**\n * @const {Promise}\n */\nconst promise = Promise.resolve();\n\n/**\n * @param {string} elementName\n */\nexport function invalidate(elementName){\n let template = templateMap[elementName];\n if (template) {\n invalidateTemplate(template);\n }\n}\n\n/**\n * This function can be called multiple times to mark a template invalid\n * and signal that the style inside must be regenerated.\n *\n * Use `startValidatingTemplate` to begin an asynchronous validation cycle.\n * During that cycle, call `templateIsValidating` to see if the template must\n * be revalidated\n * @param {HTMLTemplateElement} template\n */\nexport function invalidateTemplate(template) {\n // default the current version to 0\n template[CURRENT_VERSION] = template[CURRENT_VERSION] || 0;\n // ensure the \"validating for\" flag exists\n template[VALIDATING_VERSION] = template[VALIDATING_VERSION] || 0;\n // increment the next version\n template[NEXT_VERSION] = (template[NEXT_VERSION] || 0) + 1;\n}\n\n/**\n * @param {string} elementName\n * @return {boolean}\n */\nexport function isValid(elementName) {\n let template = templateMap[elementName];\n if (template) {\n return templateIsValid(template);\n }\n return true;\n}\n\n/**\n * @param {HTMLTemplateElement} template\n * @return {boolean}\n */\nexport function templateIsValid(template) {\n return template[CURRENT_VERSION] === template[NEXT_VERSION];\n}\n\n/**\n * @param {string} elementName\n * @return {boolean}\n */\nexport function isValidating(elementName) {\n let template = templateMap[elementName];\n if (template) {\n return templateIsValidating(template);\n }\n return false;\n}\n\n/**\n * Returns true if the template is currently invalid and `startValidating` has been called since the last invalidation.\n * If false, the template must be validated.\n * @param {HTMLTemplateElement} template\n * @return {boolean}\n */\nexport function templateIsValidating(template) {\n return !templateIsValid(template) && template[VALIDATING_VERSION] === template[NEXT_VERSION];\n}\n\n/**\n * the template is marked as `validating` for one microtask so that all instances\n * found in the tree crawl of `applyStyle` will update themselves,\n * but the template will only be updated once.\n * @param {string} elementName\n*/\nexport function startValidating(elementName) {\n let template = templateMap[elementName];\n startValidatingTemplate(template);\n}\n\n/**\n * Begin an asynchronous invalidation cycle.\n * This should be called after every validation of a template\n *\n * After one microtask, the template will be marked as valid until the next call to `invalidateTemplate`\n * @param {HTMLTemplateElement} template\n */\nexport function startValidatingTemplate(template) {\n // remember that the current \"next version\" is the reason for this validation cycle\n template[VALIDATING_VERSION] = template[NEXT_VERSION];\n // however, there only needs to be one async task to clear the counters\n if (!template._validating) {\n template._validating = true;\n promise.then(function() {\n // sync the current version to let future invalidations cause a refresh cycle\n template[CURRENT_VERSION] = template[NEXT_VERSION];\n template._validating = false;\n });\n }\n}\n\n/**\n * @return {boolean}\n */\nexport function elementsAreInvalid() {\n for (let elementName in templateMap) {\n let template = templateMap[elementName];\n if (!templateIsValid(template)) {\n return true;\n }\n }\n return false;\n}","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nexport const VAR_ASSIGN = /(?:^|[;\\s{]\\s*)(--[\\w-]*?)\\s*:\\s*(?:([^;{]*)|{([^}]*)})(?:(?=[;\\s}])|$)/gi;\nexport const MIXIN_MATCH = /(?:^|\\W+)@apply\\s*\\(?([^);\\n]*)\\)?/gi;\nexport const VAR_CONSUMED = /(--[\\w-]+)\\s*([:,;)]|$)/gi;\nexport const ANIMATION_MATCH = /(animation\\s*:)|(animation-name\\s*:)/;\nexport const MEDIA_MATCH = /@media[^(]*(\\([^)]*\\))/;\nexport const IS_VAR = /^--/;\nexport const BRACKETED = /\\{[^}]*\\}/g;\nexport const HOST_PREFIX = '(?:^|[^.#[:])';\nexport const HOST_SUFFIX = '($|[.:[\\\\s>+~])';","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nexport let nativeShadow = !(window['ShadyDOM'] && window['ShadyDOM']['inUse']);\n// chrome 49 has semi-working css vars, check if box-shadow works\n// safari 9.1 has a recalc bug: https://bugs.webkit.org/show_bug.cgi?id=155782\nexport let nativeCssVariables = (!navigator.userAgent.match('AppleWebKit/601') &&\nwindow.CSS && CSS.supports && CSS.supports('box-shadow', '0 0 0 var(--foo)'));\n\n/**\n * @param {ShadyCSSOptions | ShadyCSSInterface | undefined} settings\n */\nfunction parseSettings(settings) {\n if (settings) {\n nativeCssVariables = nativeCssVariables && !settings['nativeCss'] && !settings['shimcssproperties'];\n nativeShadow = nativeShadow && !settings['nativeShadow'] && !settings['shimshadow'];\n }\n}\n\nif (window.ShadyCSS) {\n parseSettings(window.ShadyCSS);\n} else if (window['WebComponents']) {\n parseSettings(window['WebComponents']['flags']);\n}\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {nativeShadow, nativeCssVariables} from './style-settings'\nimport {parse, stringify, types, StyleNode} from './css-parse' // eslint-disable-line no-unused-vars\nimport {MEDIA_MATCH} from './common-regex';\n\n/**\n * @param {string|StyleNode} rules\n * @param {function(StyleNode)=} callback\n * @return {string}\n */\nexport function toCssText (rules, callback) {\n if (!rules) {\n return '';\n }\n if (typeof rules === 'string') {\n rules = parse(rules);\n }\n if (callback) {\n forEachRule(rules, callback);\n }\n return stringify(rules, nativeCssVariables);\n}\n\n/**\n * @param {HTMLStyleElement} style\n * @return {StyleNode}\n */\nexport function rulesForStyle(style) {\n if (!style['__cssRules'] && style.textContent) {\n style['__cssRules'] = parse(style.textContent);\n }\n return style['__cssRules'] || null;\n}\n\n// Tests if a rule is a keyframes selector, which looks almost exactly\n// like a normal selector but is not (it has nothing to do with scoping\n// for example).\n/**\n * @param {StyleNode} rule\n * @return {boolean}\n */\nexport function isKeyframesSelector(rule) {\n return Boolean(rule['parent']) &&\n rule['parent']['type'] === types.KEYFRAMES_RULE;\n}\n\n/**\n * @param {StyleNode} node\n * @param {Function=} styleRuleCallback\n * @param {Function=} keyframesRuleCallback\n * @param {boolean=} onlyActiveRules\n */\nexport function forEachRule(node, styleRuleCallback, keyframesRuleCallback, onlyActiveRules) {\n if (!node) {\n return;\n }\n let skipRules = false;\n let type = node['type'];\n if (onlyActiveRules) {\n if (type === types.MEDIA_RULE) {\n let matchMedia = node['selector'].match(MEDIA_MATCH);\n if (matchMedia) {\n // if rule is a non matching @media rule, skip subrules\n if (!window.matchMedia(matchMedia[1]).matches) {\n skipRules = true;\n }\n }\n }\n }\n if (type === types.STYLE_RULE) {\n styleRuleCallback(node);\n } else if (keyframesRuleCallback &&\n type === types.KEYFRAMES_RULE) {\n keyframesRuleCallback(node);\n } else if (type === types.MIXIN_RULE) {\n skipRules = true;\n }\n let r$ = node['rules'];\n if (r$ && !skipRules) {\n for (let i=0, l=r$.length, r; (i`\n */\n if (localName) {\n if (localName.indexOf('-') > -1) {\n is = localName;\n } else {\n typeExtension = localName;\n is = (element.getAttribute && element.getAttribute('is')) || '';\n }\n } else {\n is = /** @type {?} */(element).is;\n typeExtension = /** @type {?} */(element).extends;\n }\n return {is, typeExtension};\n}","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n/*\n * The apply shim simulates the behavior of `@apply` proposed at\n * https://tabatkins.github.io/specs/css-apply-rule/.\n * The approach is to convert a property like this:\n *\n * --foo: {color: red; background: blue;}\n *\n * to this:\n *\n * --foo_-_color: red;\n * --foo_-_background: blue;\n *\n * Then where `@apply --foo` is used, that is converted to:\n *\n * color: var(--foo_-_color);\n * background: var(--foo_-_background);\n *\n * This approach generally works but there are some issues and limitations.\n * Consider, for example, that somewhere *between* where `--foo` is set and used,\n * another element sets it to:\n *\n * --foo: { border: 2px solid red; }\n *\n * We must now ensure that the color and background from the previous setting\n * do not apply. This is accomplished by changing the property set to this:\n *\n * --foo_-_border: 2px solid red;\n * --foo_-_color: initial;\n * --foo_-_background: initial;\n *\n * This works but introduces one new issue.\n * Consider this setup at the point where the `@apply` is used:\n *\n * background: orange;\n * `@apply` --foo;\n *\n * In this case the background will be unset (initial) rather than the desired\n * `orange`. We address this by altering the property set to use a fallback\n * value like this:\n *\n * color: var(--foo_-_color);\n * background: var(--foo_-_background, orange);\n * border: var(--foo_-_border);\n *\n * Note that the default is retained in the property set and the `background` is\n * the desired `orange`. This leads us to a limitation.\n *\n * Limitation 1:\n\n * Only properties in the rule where the `@apply`\n * is used are considered as default values.\n * If another rule matches the element and sets `background` with\n * less specificity than the rule in which `@apply` appears,\n * the `background` will not be set.\n *\n * Limitation 2:\n *\n * When using Polymer's `updateStyles` api, new properties may not be set for\n * `@apply` properties.\n\n*/\n\n'use strict';\n\nimport {forEachRule, processVariableAndFallback, rulesForStyle, toCssText} from './style-util'\nimport {MIXIN_MATCH, VAR_ASSIGN} from './common-regex'\nimport {StyleNode} from './css-parse' // eslint-disable-line no-unused-vars\n\nconst APPLY_NAME_CLEAN = /;\\s*/m;\nconst INITIAL_INHERIT = /^\\s*(initial)|(inherit)\\s*$/;\n\n// separator used between mixin-name and mixin-property-name when producing properties\n// NOTE: plain '-' may cause collisions in user styles\nconst MIXIN_VAR_SEP = '_-_';\n\n/**\n * @typedef {!Object}\n */\nlet PropertyEntry; // eslint-disable-line no-unused-vars\n\n/**\n * @typedef {!Object}\n */\nlet DependantsEntry; // eslint-disable-line no-unused-vars\n\n/** @typedef {{\n * properties: PropertyEntry,\n * dependants: DependantsEntry\n * }}\n */\nlet MixinMapEntry; // eslint-disable-line no-unused-vars\n\n// map of mixin to property names\n// --foo: {border: 2px} -> {properties: {(--foo, ['border'])}, dependants: {'element-name': proto}}\nclass MixinMap {\n constructor() {\n /** @type {!Object} */\n this._map = {};\n }\n /**\n * @param {string} name\n * @param {!PropertyEntry} props\n */\n set(name, props) {\n name = name.trim();\n this._map[name] = {\n properties: props,\n dependants: {}\n }\n }\n /**\n * @param {string} name\n * @return {MixinMapEntry}\n */\n get(name) {\n name = name.trim();\n return this._map[name] || null;\n }\n}\n\n/**\n * Callback for when an element is marked invalid\n * @type {?function(string)}\n */\nlet invalidCallback = null;\n\n/** @unrestricted */\nclass ApplyShim {\n constructor() {\n /** @type {?string} */\n this._currentElement = null;\n /** @type {HTMLMetaElement} */\n this._measureElement = null;\n this._map = new MixinMap();\n }\n /**\n * return true if `cssText` contains a mixin definition or consumption\n * @param {string} cssText\n * @return {boolean}\n */\n detectMixin(cssText) {\n const has = MIXIN_MATCH.test(cssText) || VAR_ASSIGN.test(cssText);\n // reset state of the regexes\n MIXIN_MATCH.lastIndex = 0;\n VAR_ASSIGN.lastIndex = 0;\n return has;\n }\n /**\n * @param {!HTMLTemplateElement} template\n * @param {string} elementName\n * @return {StyleNode}\n */\n transformTemplate(template, elementName) {\n const style = /** @type {HTMLStyleElement} */(template.content.querySelector('style'));\n /** @type {StyleNode} */\n let ast = null;\n if (style) {\n ast = this.transformStyle(style, elementName);\n }\n return ast;\n }\n /**\n * @param {!HTMLStyleElement} style\n * @param {string} elementName\n * @return {StyleNode}\n */\n transformStyle(style, elementName = '') {\n let ast = rulesForStyle(style);\n this.transformRules(ast, elementName);\n style.textContent = toCssText(ast);\n return ast;\n }\n /**\n * @param {!HTMLStyleElement} style\n * @return {StyleNode}\n */\n transformCustomStyle(style) {\n let ast = rulesForStyle(style);\n forEachRule(ast, (rule) => {\n if (rule['selector'] === ':root') {\n rule['selector'] = 'html';\n }\n this.transformRule(rule);\n })\n style.textContent = toCssText(ast);\n return ast;\n }\n /**\n * @param {StyleNode} rules\n * @param {string} elementName\n */\n transformRules(rules, elementName) {\n this._currentElement = elementName;\n forEachRule(rules, (r) => {\n this.transformRule(r);\n });\n this._currentElement = null;\n }\n /**\n * @param {!StyleNode} rule\n */\n transformRule(rule) {\n rule['cssText'] = this.transformCssText(rule['parsedCssText']);\n // :root was only used for variable assignment in property shim,\n // but generates invalid selectors with real properties.\n // replace with `:host > *`, which serves the same effect\n if (rule['selector'] === ':root') {\n rule['selector'] = ':host > *';\n }\n }\n /**\n * @param {string} cssText\n * @return {string}\n */\n transformCssText(cssText) {\n // produce variables\n cssText = cssText.replace(VAR_ASSIGN, (matchText, propertyName, valueProperty, valueMixin) =>\n this._produceCssProperties(matchText, propertyName, valueProperty, valueMixin));\n // consume mixins\n return this._consumeCssProperties(cssText);\n }\n /**\n * @param {string} property\n * @return {string}\n */\n _getInitialValueForProperty(property) {\n if (!this._measureElement) {\n this._measureElement = /** @type {HTMLMetaElement} */(document.createElement('meta'));\n this._measureElement.setAttribute('apply-shim-measure', '');\n this._measureElement.style.all = 'initial';\n document.head.appendChild(this._measureElement);\n }\n return window.getComputedStyle(this._measureElement).getPropertyValue(property);\n }\n /**\n * replace mixin consumption with variable consumption\n * @param {string} text\n * @return {string}\n */\n _consumeCssProperties(text) {\n /** @type {Array} */\n let m = null;\n // loop over text until all mixins with defintions have been applied\n while((m = MIXIN_MATCH.exec(text))) {\n let matchText = m[0];\n let mixinName = m[1];\n let idx = m.index;\n // collect properties before apply to be \"defaults\" if mixin might override them\n // match includes a \"prefix\", so find the start and end positions of @apply\n let applyPos = idx + matchText.indexOf('@apply');\n let afterApplyPos = idx + matchText.length;\n // find props defined before this @apply\n let textBeforeApply = text.slice(0, applyPos);\n let textAfterApply = text.slice(afterApplyPos);\n let defaults = this._cssTextToMap(textBeforeApply);\n let replacement = this._atApplyToCssProperties(mixinName, defaults);\n // use regex match position to replace mixin, keep linear processing time\n text = `${textBeforeApply}${replacement}${textAfterApply}`;\n // move regex search to _after_ replacement\n MIXIN_MATCH.lastIndex = idx + replacement.length;\n }\n return text;\n }\n /**\n * produce variable consumption at the site of mixin consumption\n * `@apply` --foo; -> for all props (${propname}: var(--foo_-_${propname}, ${fallback[propname]}}))\n * Example:\n * border: var(--foo_-_border); padding: var(--foo_-_padding, 2px)\n *\n * @param {string} mixinName\n * @param {Object} fallbacks\n * @return {string}\n */\n _atApplyToCssProperties(mixinName, fallbacks) {\n mixinName = mixinName.replace(APPLY_NAME_CLEAN, '');\n let vars = [];\n let mixinEntry = this._map.get(mixinName);\n // if we depend on a mixin before it is created\n // make a sentinel entry in the map to add this element as a dependency for when it is defined.\n if (!mixinEntry) {\n this._map.set(mixinName, {});\n mixinEntry = this._map.get(mixinName);\n }\n if (mixinEntry) {\n if (this._currentElement) {\n mixinEntry.dependants[this._currentElement] = true;\n }\n let p, parts, f;\n for (p in mixinEntry.properties) {\n f = fallbacks && fallbacks[p];\n parts = [p, ': var(', mixinName, MIXIN_VAR_SEP, p];\n if (f) {\n parts.push(',', f);\n }\n parts.push(')');\n vars.push(parts.join(''));\n }\n }\n return vars.join('; ');\n }\n\n /**\n * @param {string} property\n * @param {string} value\n * @return {string}\n */\n _replaceInitialOrInherit(property, value) {\n let match = INITIAL_INHERIT.exec(value);\n if (match) {\n if (match[1]) {\n // initial\n // replace `initial` with the concrete initial value for this property\n value = this._getInitialValueForProperty(property);\n } else {\n // inherit\n // with this purposfully illegal value, the variable will be invalid at\n // compute time (https://www.w3.org/TR/css-variables/#invalid-at-computed-value-time)\n // and for inheriting values, will behave similarly\n // we cannot support the same behavior for non inheriting values like 'border'\n value = 'apply-shim-inherit';\n }\n }\n return value;\n }\n\n /**\n * \"parse\" a mixin definition into a map of properties and values\n * cssTextToMap('border: 2px solid black') -> ('border', '2px solid black')\n * @param {string} text\n * @return {!Object}\n */\n _cssTextToMap(text) {\n let props = text.split(';');\n let property, value;\n let out = {};\n for (let i = 0, p, sp; i < props.length; i++) {\n p = props[i];\n if (p) {\n sp = p.split(':');\n // ignore lines that aren't definitions like @media\n if (sp.length > 1) {\n property = sp[0].trim();\n // some properties may have ':' in the value, like data urls\n value = this._replaceInitialOrInherit(property, sp.slice(1).join(':'));\n out[property] = value;\n }\n }\n }\n return out;\n }\n\n /**\n * @param {MixinMapEntry} mixinEntry\n */\n _invalidateMixinEntry(mixinEntry) {\n if (!invalidCallback) {\n return;\n }\n for (let elementName in mixinEntry.dependants) {\n if (elementName !== this._currentElement) {\n invalidCallback(elementName);\n }\n }\n }\n\n /**\n * @param {string} matchText\n * @param {string} propertyName\n * @param {?string} valueProperty\n * @param {?string} valueMixin\n * @return {string}\n */\n _produceCssProperties(matchText, propertyName, valueProperty, valueMixin) {\n // handle case where property value is a mixin\n if (valueProperty) {\n // form: --mixin2: var(--mixin1), where --mixin1 is in the map\n processVariableAndFallback(valueProperty, (prefix, value) => {\n if (value && this._map.get(value)) {\n valueMixin = `@apply ${value};`\n }\n });\n }\n if (!valueMixin) {\n return matchText;\n }\n let mixinAsProperties = this._consumeCssProperties(valueMixin);\n let prefix = matchText.slice(0, matchText.indexOf('--'));\n let mixinValues = this._cssTextToMap(mixinAsProperties);\n let combinedProps = mixinValues;\n let mixinEntry = this._map.get(propertyName);\n let oldProps = mixinEntry && mixinEntry.properties;\n if (oldProps) {\n // NOTE: since we use mixin, the map of properties is updated here\n // and this is what we want.\n combinedProps = Object.assign(Object.create(oldProps), mixinValues);\n } else {\n this._map.set(propertyName, combinedProps);\n }\n let out = [];\n let p, v;\n // set variables defined by current mixin\n let needToInvalidate = false;\n for (p in combinedProps) {\n v = mixinValues[p];\n // if property not defined by current mixin, set initial\n if (v === undefined) {\n v = 'initial';\n }\n if (oldProps && !(p in oldProps)) {\n needToInvalidate = true;\n }\n out.push(`${propertyName}${MIXIN_VAR_SEP}${p}: ${v}`);\n }\n if (needToInvalidate) {\n this._invalidateMixinEntry(mixinEntry);\n }\n if (mixinEntry) {\n mixinEntry.properties = combinedProps;\n }\n // because the mixinMap is global, the mixin might conflict with\n // a different scope's simple variable definition:\n // Example:\n // some style somewhere:\n // --mixin1:{ ... }\n // --mixin2: var(--mixin1);\n // some other element:\n // --mixin1: 10px solid red;\n // --foo: var(--mixin1);\n // In this case, we leave the original variable definition in place.\n if (valueProperty) {\n prefix = `${matchText};${prefix}`;\n }\n return `${prefix}${out.join('; ')};`;\n }\n}\n\n/* exports */\nApplyShim.prototype['detectMixin'] = ApplyShim.prototype.detectMixin;\nApplyShim.prototype['transformStyle'] = ApplyShim.prototype.transformStyle;\nApplyShim.prototype['transformCustomStyle'] = ApplyShim.prototype.transformCustomStyle;\nApplyShim.prototype['transformRules'] = ApplyShim.prototype.transformRules;\nApplyShim.prototype['transformRule'] = ApplyShim.prototype.transformRule;\nApplyShim.prototype['transformTemplate'] = ApplyShim.prototype.transformTemplate;\nApplyShim.prototype['_separator'] = MIXIN_VAR_SEP;\nObject.defineProperty(ApplyShim.prototype, 'invalidCallback', {\n /** @return {?function(string)} */\n get() {\n return invalidCallback;\n },\n /** @param {?function(string)} cb */\n set(cb) {\n invalidCallback = cb;\n }\n});\n\nexport default ApplyShim;","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\n/** @type {Promise} */\nlet readyPromise = null;\n\n/** @type {?function(?function())} */\nlet whenReady = window['HTMLImports'] && window['HTMLImports']['whenReady'] || null;\n\n/** @type {function()} */\nlet resolveFn;\n\n/**\n * @param {?function()} callback\n */\nexport default function documentWait(callback) {\n requestAnimationFrame(function() {\n if (whenReady) {\n whenReady(callback)\n } else {\n if (!readyPromise) {\n readyPromise = new Promise((resolve) => {resolveFn = resolve});\n if (document.readyState === 'complete') {\n resolveFn();\n } else {\n document.addEventListener('readystatechange', () => {\n if (document.readyState === 'complete') {\n resolveFn();\n }\n });\n }\n }\n readyPromise.then(function(){ callback && callback(); });\n }\n });\n}\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport ApplyShim from '../src/apply-shim'\nimport templateMap from '../src/template-map'\nimport {getIsExtends, toCssText} from '../src/style-util'\nimport * as ApplyShimUtils from '../src/apply-shim-utils'\nimport documentWait from '../src/document-wait'\nimport {getComputedStyleValue, updateNativeProperties} from '../src/common-utils'\nimport {CustomStyleInterfaceInterface} from '../src/custom-style-interface' // eslint-disable-line no-unused-vars\nimport {nativeCssVariables, nativeShadow} from '../src/style-settings'\n\n/** @const {ApplyShim} */\nconst applyShim = new ApplyShim();\n\nclass ApplyShimInterface {\n constructor() {\n /** @type {?CustomStyleInterfaceInterface} */\n this.customStyleInterface = null;\n this.booted = false;\n documentWait(() => {\n this.ensure();\n });\n applyShim['invalidCallback'] = ApplyShimUtils.invalidate;\n }\n ensure() {\n if (this.booted) {\n return;\n }\n this.customStyleInterface = window.ShadyCSS.CustomStyleInterface;\n if (this.customStyleInterface) {\n this.customStyleInterface['transformCallback'] = (style) => {\n applyShim.transformCustomStyle(style);\n };\n this.customStyleInterface['validateCallback'] = () => {\n requestAnimationFrame(() => {\n if (this.customStyleInterface['enqueued']) {\n this.flushCustomStyles();\n }\n });\n }\n }\n this.booted = true;\n }\n /**\n * @param {!HTMLTemplateElement} template\n * @param {string} elementName\n */\n prepareTemplate(template, elementName) {\n this.ensure();\n templateMap[elementName] = template;\n let ast = applyShim.transformTemplate(template, elementName);\n // save original style ast to use for revalidating instances\n template['_styleAst'] = ast;\n }\n flushCustomStyles() {\n this.ensure();\n if (!this.customStyleInterface) {\n return;\n }\n let styles = this.customStyleInterface['processStyles']();\n if (!this.customStyleInterface['enqueued']) {\n return;\n }\n for (let i = 0; i < styles.length; i++ ) {\n let cs = styles[i];\n let style = this.customStyleInterface['getStyleForCustomStyle'](cs);\n if (style) {\n applyShim.transformCustomStyle(style);\n }\n }\n this.customStyleInterface['enqueued'] = false;\n }\n /**\n * @param {HTMLElement} element\n * @param {Object=} properties\n */\n styleSubtree(element, properties) {\n this.ensure();\n if (properties) {\n updateNativeProperties(element, properties);\n }\n if (element.shadowRoot) {\n this.styleElement(element);\n let shadowChildren = element.shadowRoot.children || element.shadowRoot.childNodes;\n for (let i = 0; i < shadowChildren.length; i++) {\n this.styleSubtree(/** @type {HTMLElement} */(shadowChildren[i]));\n }\n } else {\n let children = element.children || element.childNodes;\n for (let i = 0; i < children.length; i++) {\n this.styleSubtree(/** @type {HTMLElement} */(children[i]));\n }\n }\n }\n /**\n * @param {HTMLElement} element\n */\n styleElement(element) {\n this.ensure();\n let {is} = getIsExtends(element);\n let template = templateMap[is];\n if (template && !ApplyShimUtils.templateIsValid(template)) {\n // only revalidate template once\n if (!ApplyShimUtils.templateIsValidating(template)) {\n this.prepareTemplate(template, is);\n ApplyShimUtils.startValidatingTemplate(template);\n }\n // update this element instance\n let root = element.shadowRoot;\n if (root) {\n let style = /** @type {HTMLStyleElement} */(root.querySelector('style'));\n if (style) {\n // reuse the template's style ast, it has all the original css text\n style['__cssRules'] = template['_styleAst'];\n style.textContent = toCssText(template['_styleAst'])\n }\n }\n }\n }\n /**\n * @param {Object=} properties\n */\n styleDocument(properties) {\n this.ensure();\n this.styleSubtree(document.body, properties);\n }\n}\n\nif (!window.ShadyCSS || !window.ShadyCSS.ScopingShim) {\n const applyShimInterface = new ApplyShimInterface();\n let CustomStyleInterface = window.ShadyCSS && window.ShadyCSS.CustomStyleInterface;\n\n window.ShadyCSS = {\n /**\n * @param {!HTMLTemplateElement} template\n * @param {string} elementName\n * @param {string=} elementExtends\n */\n prepareTemplate(template, elementName, elementExtends) { // eslint-disable-line no-unused-vars\n applyShimInterface.flushCustomStyles();\n applyShimInterface.prepareTemplate(template, elementName)\n },\n\n /**\n * @param {!HTMLElement} element\n * @param {Object=} properties\n */\n styleSubtree(element, properties) {\n applyShimInterface.flushCustomStyles();\n applyShimInterface.styleSubtree(element, properties);\n },\n\n /**\n * @param {!HTMLElement} element\n */\n styleElement(element) {\n applyShimInterface.flushCustomStyles();\n applyShimInterface.styleElement(element);\n },\n\n /**\n * @param {Object=} properties\n */\n styleDocument(properties) {\n applyShimInterface.flushCustomStyles();\n applyShimInterface.styleDocument(properties);\n },\n\n /**\n * @param {Element} element\n * @param {string} property\n * @return {string}\n */\n getComputedStyleValue(element, property) {\n return getComputedStyleValue(element, property);\n },\n nativeCss: nativeCssVariables,\n nativeShadow: nativeShadow\n };\n\n if (CustomStyleInterface) {\n window.ShadyCSS.CustomStyleInterface = CustomStyleInterface;\n }\n}\n\nwindow.ShadyCSS.ApplyShim = applyShim;","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\n/**\n * @param {Element} element\n * @param {Object=} properties\n */\nexport function updateNativeProperties(element, properties) {\n // remove previous properties\n for (let p in properties) {\n // NOTE: for bc with shim, don't apply null values.\n if (p === null) {\n element.style.removeProperty(p);\n } else {\n element.style.setProperty(p, properties[p]);\n }\n }\n}\n\n/**\n * @param {Element} element\n * @param {string} property\n * @return {string}\n */\nexport function getComputedStyleValue(element, property) {\n /**\n * @const {string}\n */\n const value = window.getComputedStyle(element).getPropertyValue(property);\n if (!value) {\n return '';\n } else {\n return value.trim();\n }\n}"]} \ No newline at end of file diff --git a/src/main/resources/static/gltf-viewer/bower_components/shadycss/custom-style-interface.html b/src/main/resources/static/gltf-viewer/bower_components/shadycss/custom-style-interface.html deleted file mode 100644 index a3919fa..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/shadycss/custom-style-interface.html +++ /dev/null @@ -1,10 +0,0 @@ - - diff --git a/src/main/resources/static/gltf-viewer/bower_components/shadycss/custom-style-interface.min.js b/src/main/resources/static/gltf-viewer/bower_components/shadycss/custom-style-interface.min.js deleted file mode 100644 index 4347aa9..0000000 --- a/src/main/resources/static/gltf-viewer/bower_components/shadycss/custom-style-interface.min.js +++ /dev/null @@ -1,16 +0,0 @@ -(function(){ -/* - -Copyright (c) 2017 The Polymer Project Authors. All rights reserved. -This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt -The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt -The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt -Code distributed by Google as part of the polymer project is also -subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt -*/ -'use strict';var c=!(window.ShadyDOM&&window.ShadyDOM.inUse),f=!navigator.userAgent.match("AppleWebKit/601")&&window.CSS&&CSS.supports&&CSS.supports("box-shadow","0 0 0 var(--foo)");function g(a){a&&(f=f&&!a.nativeCss&&!a.shimcssproperties,c=c&&!a.nativeShadow&&!a.shimshadow)}window.ShadyCSS?g(window.ShadyCSS):window.WebComponents&&g(window.WebComponents.flags);var h=c,k=f;function l(a,b){for(var d in b)null===d?a.style.removeProperty(d):a.style.setProperty(d,b[d])};var m=null,n=window.HTMLImports&&window.HTMLImports.whenReady||null,r;function t(){var a=u;requestAnimationFrame(function(){n?n(a):(m||(m=new Promise(function(a){r=a}),"complete"===document.readyState?r():document.addEventListener("readystatechange",function(){"complete"===document.readyState&&r()})),m.then(function(){a&&a()}))})};var v=null,u=null;function x(){this.customStyles=[];this.enqueued=!1}function y(a){!a.enqueued&&u&&(a.enqueued=!0,t())}x.prototype.c=function(a){a.__seenByShadyCSS||(a.__seenByShadyCSS=!0,this.customStyles.push(a),y(this))};x.prototype.b=function(a){if(a.__shadyCSSCachedStyle)return a.__shadyCSSCachedStyle;var b;a.getStyle?b=a.getStyle():b=a;return b}; -x.prototype.a=function(){for(var a=this.customStyles,b=0;b} */\nlet readyPromise = null;\n\n/** @type {?function(?function())} */\nlet whenReady = window['HTMLImports'] && window['HTMLImports']['whenReady'] || null;\n\n/** @type {function()} */\nlet resolveFn;\n\n/**\n * @param {?function()} callback\n */\nexport default function documentWait(callback) {\n requestAnimationFrame(function() {\n if (whenReady) {\n whenReady(callback)\n } else {\n if (!readyPromise) {\n readyPromise = new Promise((resolve) => {resolveFn = resolve});\n if (document.readyState === 'complete') {\n resolveFn();\n } else {\n document.addEventListener('readystatechange', () => {\n if (document.readyState === 'complete') {\n resolveFn();\n }\n });\n }\n }\n readyPromise.then(function(){ callback && callback(); });\n }\n });\n}\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport documentWait from './document-wait'\n\n/**\n * @typedef {HTMLStyleElement | {getStyle: function():HTMLStyleElement}}\n */\nexport let CustomStyleProvider;\n\nconst SEEN_MARKER = '__seenByShadyCSS';\nconst CACHED_STYLE = '__shadyCSSCachedStyle';\n\n/** @type {?function(!HTMLStyleElement)} */\nlet transformFn = null;\n\n/** @type {?function()} */\nlet validateFn = null;\n\n/**\nThis interface is provided to add document-level - - - - - diff --git a/src/main/resources/static/init.js b/src/main/resources/static/init.js index 124f980..87c1a44 100644 --- a/src/main/resources/static/init.js +++ b/src/main/resources/static/init.js @@ -3,6 +3,10 @@ return new Promise(resolve => window.setTimeout(resolve, amount)); } + function frame() { + return new Promise(resolve => window.requestAnimationFrame(resolve)); + } + window.addEventListener("load", function () { // Tylan alphabet async function tylanToFont(input, output) { @@ -62,6 +66,72 @@ } }); + window.addEventListener("load", function () { + // Mesh viewing + const canvases = document.getElementsByTagName("canvas"); + for (const canvas of canvases) { + const modelName = canvas.getAttribute("data-model"); + if (modelName == null || modelName === "") continue; + + (async () => { + let threeData = {}; + + threeData.camera = new THREE.PerspectiveCamera(69, 1, 0.01, 1000.0); + + threeData.scene = new THREE.Scene(); + threeData.scene.add(new THREE.AmbientLight("#555555", 1.0)); + + threeData.renderer = new THREE.WebGLRenderer({"canvas": canvas, "antialias": true}); + + threeData.controls = new THREE.OrbitControls(threeData.camera, canvas); + + function render() { + threeData.controls.update(); + threeData.renderer.render(threeData.scene, threeData.camera); + window.requestAnimationFrame(render); + } + + function onResize() { + const dim = canvas.getBoundingClientRect(); + threeData.camera.aspect = dim.width / dim.height; + threeData.camera.updateProjectionMatrix(); + threeData.renderer.setSize(dim.width, dim.height, false); + } + + window.addEventListener('resize', onResize); + await frame(); + onResize(); + + const mtlPath = modelName + ".mtl"; + const mtlLib = await (new THREE.MTLLoader()).setPath("/assets/meshes/").setResourcePath("/assets/meshes/").loadAsync(mtlPath); + mtlLib.preload(); + + const objPath = modelName + ".obj"; + const objMesh = await (new THREE.OBJLoader()).setPath("/assets/meshes/").setResourcePath("/assets/meshes/").setMaterials(mtlLib).loadAsync(objPath); + threeData.scene.add(objMesh); + + const bbox = new THREE.Box3().setFromObject(threeData.scene); + bbox.dimensions = { + x: bbox.max.x - bbox.min.x, + y: bbox.max.y - bbox.min.y, + z: bbox.max.z - bbox.min.z + }; + objMesh.position.sub(new THREE.Vector3(bbox.min.x + bbox.dimensions.x / 2, bbox.min.y + bbox.dimensions.y / 2, bbox.min.z + bbox.dimensions.z / 2)); + + threeData.camera.position.set(bbox.dimensions.x / 2, bbox.dimensions.y / 2, Math.max(bbox.dimensions.x, bbox.dimensions.y, bbox.dimensions.z)); + + threeData.light = new THREE.PointLight("#AAAAAA", 1.0); + threeData.scene.add(threeData.camera); + threeData.camera.add(threeData.light); + threeData.light.position.set(0, 0, 0); + + render(); + })().catch(reason => { + console.error("Error rendering model " + modelName, reason); + }); + } + }); + window.addEventListener("load", function () { // Allow POSTing with s const anchors = document.getElementsByTagName("a"); diff --git a/src/main/resources/static/gltf-viewer/js/OrbitControls.js b/src/main/resources/static/obj-viewer/OrbitControls.js similarity index 100% rename from src/main/resources/static/gltf-viewer/js/OrbitControls.js rename to src/main/resources/static/obj-viewer/OrbitControls.js diff --git a/src/main/resources/static/gltf-viewer/js/three-examples.js b/src/main/resources/static/obj-viewer/three-examples.js similarity index 100% rename from src/main/resources/static/gltf-viewer/js/three-examples.js rename to src/main/resources/static/obj-viewer/three-examples.js diff --git a/src/main/resources/static/gltf-viewer/js/three.js b/src/main/resources/static/obj-viewer/three.js similarity index 100% rename from src/main/resources/static/gltf-viewer/js/three.js rename to src/main/resources/static/obj-viewer/three.js -- 2.25.1