@@ -203,18 +203,3 @@ var docHTML = `
{{ end }}
{{ end }}
`
-
-var scannerCSS = `
-.word-cloud {
- width: 60em;
-}
-
-.doc-page-single {
- border: 1px solid grey;
- display: block;
-}
-
-.doc-page-row {
- border: 1px solid grey;
-}
-`
diff --git a/app/scanningcabinet/ui/fileembed.go b/app/scanningcabinet/ui/fileembed.go
new file mode 100644
index 000000000..1452b867d
--- /dev/null
+++ b/app/scanningcabinet/ui/fileembed.go
@@ -0,0 +1,30 @@
+/*
+Copyright 2017 The Camlistore Authors
+
+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.
+*/
+
+/*
+TODO(steve.armstrong): Until app/scanningcabinet/handler.go handleUiFile()
+properly manages Content-Type, be sure to update it whenever adding a new
+file type to the pattern below.
+
+#fileembed pattern .+\.(js|css)$
+*/
+package ui // import "camlistore.org/app/scanningcabinet/ui"
+
+import (
+ "camlistore.org/pkg/fileembed"
+)
+
+var Files = &fileembed.Files{}
diff --git a/app/scanningcabinet/ui/scanner.css b/app/scanningcabinet/ui/scanner.css
new file mode 100644
index 000000000..85b05203f
--- /dev/null
+++ b/app/scanningcabinet/ui/scanner.css
@@ -0,0 +1,28 @@
+/*
+Copyright 2017 The Camlistore Authors
+
+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.
+*/
+
+.word-cloud {
+ width: 60em;
+}
+
+.doc-page-single {
+ border: 1px solid grey;
+ display: block;
+}
+
+.doc-page-row {
+ border: 1px solid grey;
+}
diff --git a/config/dev-server-config.json b/config/dev-server-config.json
index 4e0b99986..17e6b2120 100644
--- a/config/dev-server-config.json
+++ b/config/dev-server-config.json
@@ -39,7 +39,10 @@
"handlerArgs": {
"prefix": "/scancab/",
"serverListen": "localhost:3179",
- "program": "scanningcabinet"
+ "program": "scanningcabinet",
+ "appConfig": {
+ "sourceRoot": ["_env", "${CAMLI_DEV_CAMLI_ROOT}/app/scanningcabinet/ui", ""]
+ }
}
},
diff --git a/make.go b/make.go
index a838bc0c9..a83610484 100644
--- a/make.go
+++ b/make.go
@@ -821,7 +821,7 @@ func genEmbeds() error {
if runtime.GOOS == "windows" {
cmdName += ".exe"
}
- for _, embeds := range []string{"server/camlistored/ui", "pkg/server", "vendor/embed/react", "vendor/embed/less", "vendor/embed/glitch", "vendor/embed/fontawesome", "app/publisher"} {
+ for _, embeds := range []string{"server/camlistored/ui", "pkg/server", "vendor/embed/react", "vendor/embed/less", "vendor/embed/glitch", "vendor/embed/fontawesome", "app/publisher", "app/scanningcabinet/ui"} {
embeds := buildSrcPath(embeds)
args := []string{"--output-files-stderr", embeds}
cmd := exec.Command(cmdName, args...)