From 5176eaba81f4cda6cd5a14108c3516abd8ba0c84 Mon Sep 17 00:00:00 2001 From: Alexander Tkachev Date: Thu, 16 Jun 2016 19:47:02 +0600 Subject: CLOUD: Add wwwroot wwwroot.zip contains ScummVM local webserver's resources, such as template html pages, styles and images. One can make it from wwwroot directory contents by running make_archive.py script. It's added to scummvm.rc, so it's included in the executable (it works with MinGW, but I was unable to do that in VS yet). IndexPageHandler is the one who returns these resources. It uses index.html for "/". I'm replacing "{message}" with translated message, so that's the way I thought the templates should work. --- backends/networking/wwwroot/favicon.ico | Bin 0 -> 94081 bytes backends/networking/wwwroot/index.html | 18 ++++++++++++++++++ backends/networking/wwwroot/logo.png | Bin 0 -> 132967 bytes backends/networking/wwwroot/style.css | 21 +++++++++++++++++++++ 4 files changed, 39 insertions(+) create mode 100644 backends/networking/wwwroot/favicon.ico create mode 100644 backends/networking/wwwroot/index.html create mode 100644 backends/networking/wwwroot/logo.png create mode 100644 backends/networking/wwwroot/style.css (limited to 'backends/networking/wwwroot') diff --git a/backends/networking/wwwroot/favicon.ico b/backends/networking/wwwroot/favicon.ico new file mode 100644 index 0000000000..0283e8432e Binary files /dev/null and b/backends/networking/wwwroot/favicon.ico differ diff --git a/backends/networking/wwwroot/index.html b/backends/networking/wwwroot/index.html new file mode 100644 index 0000000000..2a3d9d382d --- /dev/null +++ b/backends/networking/wwwroot/index.html @@ -0,0 +1,18 @@ + + + + ScummVM + + + + +
+
+
+
+
+

{message}

+
+
+ + \ No newline at end of file diff --git a/backends/networking/wwwroot/logo.png b/backends/networking/wwwroot/logo.png new file mode 100644 index 0000000000..9fdd2d0d1e Binary files /dev/null and b/backends/networking/wwwroot/logo.png differ diff --git a/backends/networking/wwwroot/style.css b/backends/networking/wwwroot/style.css new file mode 100644 index 0000000000..f092b058a8 --- /dev/null +++ b/backends/networking/wwwroot/style.css @@ -0,0 +1,21 @@ +body, .header { background: #FFCC33; } + +.container { + width: 80%; + margin: 0 auto; +} + +.header { + padding: 10pt; + /*margin: 8pt;*/ + margin-bottom: 0; +} + +.content { + padding: 8pt; + background: rgb(251, 241, 206); + font-family: Tahoma; + font-size: 16pt; +} + +.content p { margin: 0 0 6pt 0; } \ No newline at end of file -- cgit v1.2.3 From 81106b04440d76238da0fa0166eb3032b6db591e Mon Sep 17 00:00:00 2001 From: Alexander Tkachev Date: Sat, 18 Jun 2016 15:54:55 +0600 Subject: CLOUD: Update local server's style.css --- backends/networking/wwwroot/style.css | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'backends/networking/wwwroot') diff --git a/backends/networking/wwwroot/style.css b/backends/networking/wwwroot/style.css index f092b058a8..75c8378229 100644 --- a/backends/networking/wwwroot/style.css +++ b/backends/networking/wwwroot/style.css @@ -1,4 +1,8 @@ -body, .header { background: #FFCC33; } +html { + background: rgb(212, 117, 11); + background: linear-gradient(to bottom, rgb(212, 117, 11) 0%, rgb(212, 117, 11) 36%, rgb(239, 196, 24) 100%); + height: 100vh; +} .container { width: 80%; @@ -7,7 +11,6 @@ body, .header { background: #FFCC33; } .header { padding: 10pt; - /*margin: 8pt;*/ margin-bottom: 0; } @@ -18,4 +21,4 @@ body, .header { background: #FFCC33; } font-size: 16pt; } -.content p { margin: 0 0 6pt 0; } \ No newline at end of file +.content p { margin: 0 0 6pt 0; } -- cgit v1.2.3 From c409d29f66057a1a2c0e405e60cc8aa5623bc52f Mon Sep 17 00:00:00 2001 From: Alexander Tkachev Date: Tue, 5 Jul 2016 20:42:57 +0600 Subject: CLOUD: Add "/files" handler Shows the page with controls, but doesn't actually list the directories, create the specified ones or allows to upload files yet. --- backends/networking/wwwroot/files.html | 50 ++++++++++++++++++++++++++ backends/networking/wwwroot/style.css | 64 ++++++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+) create mode 100644 backends/networking/wwwroot/files.html (limited to 'backends/networking/wwwroot') diff --git a/backends/networking/wwwroot/files.html b/backends/networking/wwwroot/files.html new file mode 100644 index 0000000000..8a2788905a --- /dev/null +++ b/backends/networking/wwwroot/files.html @@ -0,0 +1,50 @@ + + + + ScummVM + + + + +
+
+
+
+
+ + + +
{create_directory_button}{upload_files_button}
+ + +
+
+ {content} +
+
+ + + \ No newline at end of file diff --git a/backends/networking/wwwroot/style.css b/backends/networking/wwwroot/style.css index 75c8378229..59d96671db 100644 --- a/backends/networking/wwwroot/style.css +++ b/backends/networking/wwwroot/style.css @@ -22,3 +22,67 @@ html { } .content p { margin: 0 0 6pt 0; } + +.controls { + padding: 8pt; + background: #FFF; + font-family: Tahoma; + font-size: 16pt; +} + +.controls .buttons { + width: 100%; + max-width: 500pt; + margin: -8pt auto; + border: 0; + border-spacing: 0; +} + +.controls .buttons td { + width: 50%; + text-align: center; + margin: 0; + padding: 0; +} + +.controls .buttons a { + display: block; + height: 40pt; + line-height: 38pt; + vertical-align: middle; + color: #000; + text-decoration: none; +} + +.controls .buttons a:hover { + background: #F3F3F3; +} + +.modal { + margin-top: 10pt; + display: none; +} + +.modal p { margin: 0 0 6pt 0; } + +#create_directory input[type="text"], #upload_file input[type="file"] { + width: calc(100% - 2 * 5pt); +} + +.modal input { + border: 1px solid #EEE; + padding: 5pt; + font-size: 12pt; +} + +.modal input[type="submit"] { + display: block; + margin: 6pt auto; + background: #DDD; + border: 0; +} + +.modal input[type="submit"]:hover { + background: #F3F3F3; + cursor: pointer; +} \ No newline at end of file -- cgit v1.2.3 From e47b6c04b30565b1db238c2784e562f3f4472d70 Mon Sep 17 00:00:00 2001 From: Alexander Tkachev Date: Wed, 6 Jul 2016 12:41:33 +0600 Subject: CLOUD: Make "/files" list directories Including both virtual "/root" and "/saves" ones. --- backends/networking/wwwroot/files.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'backends/networking/wwwroot') diff --git a/backends/networking/wwwroot/files.html b/backends/networking/wwwroot/files.html index 8a2788905a..2baf4a02dc 100644 --- a/backends/networking/wwwroot/files.html +++ b/backends/networking/wwwroot/files.html @@ -31,7 +31,9 @@
- {content} + + {content} +
+ + \ No newline at end of file diff --git a/backends/networking/wwwroot/.index.html b/backends/networking/wwwroot/.index.html new file mode 100644 index 0000000000..2a3d9d382d --- /dev/null +++ b/backends/networking/wwwroot/.index.html @@ -0,0 +1,18 @@ + + + + ScummVM + + + + +
+
+
+
+
+

{message}

+
+
+ + \ No newline at end of file diff --git a/backends/networking/wwwroot/files.html b/backends/networking/wwwroot/files.html deleted file mode 100644 index 2baf4a02dc..0000000000 --- a/backends/networking/wwwroot/files.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - ScummVM - - - - -
-
-
-
-
- - - -
{create_directory_button}{upload_files_button}
- - -
-
- - {content} -
-
-
- - - \ No newline at end of file diff --git a/backends/networking/wwwroot/index.html b/backends/networking/wwwroot/index.html deleted file mode 100644 index 2a3d9d382d..0000000000 --- a/backends/networking/wwwroot/index.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - ScummVM - - - - -
-
-
-
-
-

{message}

-
-
- - \ No newline at end of file -- cgit v1.2.3 From ab4361a76b40b56348ec46311121a0552f0c9d6b Mon Sep 17 00:00:00 2001 From: Alexander Tkachev Date: Wed, 6 Jul 2016 18:03:56 +0600 Subject: CLOUD: Make "/create" work One can now create directories through browser. --- backends/networking/wwwroot/.files.html | 2 ++ 1 file changed, 2 insertions(+) (limited to 'backends/networking/wwwroot') diff --git a/backends/networking/wwwroot/.files.html b/backends/networking/wwwroot/.files.html index 2baf4a02dc..de29ac3fa3 100644 --- a/backends/networking/wwwroot/.files.html +++ b/backends/networking/wwwroot/.files.html @@ -18,6 +18,7 @@
+
{loading}
+
{error}
@@ -61,6 +63,8 @@ } function showDirectory(path) { + if (isLoading) return; + showLoading(); ajax.getAndParseJson("./list", {"path": path}, getCallback(path)); } @@ -69,14 +73,42 @@ console.log(jsonResponse); if (jsonResponse.type == "error") { - console.log("error"); + showError(); return; } openDirectory(path, jsonResponse.items); + hideLoading(); }; } + var isLoading = false; + + function showLoading() { + isLoading = true; + var e = document.getElementById("loading_message"); + e.style.display = "block"; + e = document.getElementById("error_message"); + e.style.display = "none"; + } + + function showError() { + isLoading = false; + var e = document.getElementById("loading_message"); + e.style.display = "none"; + e = document.getElementById("error_message"); + e.style.display = "block"; + //TODO: pass the actual message there? + } + + function hideLoading() { + isLoading = false; + var e = document.getElementById("loading_message"); + e.style.display = "none"; + e = document.getElementById("error_message"); + e.style.display = "none"; + } + function openDirectory(path, items) { // update path document.getElementById("create_directory_form").elements["path"].value = path; diff --git a/backends/networking/wwwroot/style.css b/backends/networking/wwwroot/style.css index c1bc14d652..ba31587c4d 100644 --- a/backends/networking/wwwroot/style.css +++ b/backends/networking/wwwroot/style.css @@ -96,3 +96,18 @@ td img { vertical-align: middle; height: 20px; } .directory_name a { color: black; } .directory_name a:hover { color: blue; } + +#loading_message, #error_message { + margin: -8pt; + margin-bottom: 5pt; + padding: 4pt; + text-align: center; +} + +#loading_message { + background: #99FF99; +} + +#error_message { + background: #FF9999; +} -- cgit v1.2.3 From da229dd84c5761f80b16c25edba7bfb738fc835f Mon Sep 17 00:00:00 2001 From: Alexander Tkachev Date: Tue, 19 Jul 2016 13:41:25 +0600 Subject: CLOUD: Add "ajax" parameter for "/create" and "/upload" If it's set, these redirect to "/filesAJAX" instead of "/files". --- backends/networking/wwwroot/.filesAJAX.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'backends/networking/wwwroot') diff --git a/backends/networking/wwwroot/.filesAJAX.html b/backends/networking/wwwroot/.filesAJAX.html index 16a4b5417d..d648466d2c 100644 --- a/backends/networking/wwwroot/.filesAJAX.html +++ b/backends/networking/wwwroot/.filesAJAX.html @@ -19,13 +19,14 @@

{create_directory_desc}

+