From 9ce7bd0299293201de620063f8f05e8dca25c08e Mon Sep 17 00:00:00 2001 From: Mauricio Villegas Date: Wed, 28 Oct 2020 17:18:41 +0100 Subject: [PATCH] web-app: - Data is truly sent as json to saveFile.php. --- README.md | 4 ++-- js/web-app.js | 4 ++-- package.json | 2 +- web-app/common.inc.php | 4 ++-- web-app/index.php | 4 ++-- web-app/saveFile.php | 4 +++- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 7cb766e..51d5ad7 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ nw-page-editor - Simple app for visual editing of Page XML files. -Version: 2020.10.09 +Version: 2020.10.28 # Description @@ -180,7 +180,7 @@ docker-cli -- mauvilsa/nw-page-editor-web:$TAG htpasswd -b data/.htpasswd user2@ docker-cli -- mauvilsa/nw-page-editor-web:$TAG htpasswd --help ``` -5. Start a container exposing the web server port 80 to a port of your preferece +5. Start a container exposing the web server port 80 to a port of your preference (e.g. 8080) and set the data directory as a volume. ```bash diff --git a/js/web-app.js b/js/web-app.js index dd7d5fd..a199ce1 100644 --- a/js/web-app.js +++ b/js/web-app.js @@ -1,7 +1,7 @@ /** * App functionality for the web edition of nw-page-editor. * - * @version $Version: 2020.04.07$ + * @version $Version: 2020.10.28$ * @author Mauricio Villegas * @copyright Copyright(c) 2015-present, Mauricio Villegas * @license MIT License @@ -169,7 +169,7 @@ $(window).on('load', function () { xml: pageXml }; - $.ajax({ url: 'saveFile.php', method: 'POST', data: data, dataType: 'json', timeout: 8000 }) + $.ajax({ url: 'saveFile.php', method: 'POST', data: JSON.stringify(data), dataType: 'json', timeout: 8000, contentType: 'application/json;charset=UTF-8' }) .fail( function () { savingFile = false; $('#spinner').removeClass('spinner-active'); diff --git a/package.json b/package.json index d5330d9..3b1afd5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nw-page-editor", - "version": "2020.10.09", + "version": "2020.10.28", "description": "Simple app for visual editing of Page XML files", "main": "./html/index.html#1", "author": "Mauricio Villegas ", diff --git a/web-app/common.inc.php b/web-app/common.inc.php index 69af6eb..75ab595 100644 --- a/web-app/common.inc.php +++ b/web-app/common.inc.php @@ -2,13 +2,13 @@ /** * Common code to be executed by other php scripts. * - * @version $Version: 2020.10.09$ + * @version $Version: 2020.10.28$ * @author Mauricio Villegas * @copyright Copyright(c) 2017-present, Mauricio Villegas * @license MIT License */ -$version = str_replace('Version: ','',"Version: 2020.10.09"); +$version = str_replace('Version: ','',"Version: 2020.10.28"); $v = '?v='.$version; /// User authentication /// diff --git a/web-app/index.php b/web-app/index.php index 6f44045..1d76df9 100644 --- a/web-app/index.php +++ b/web-app/index.php @@ -2,7 +2,7 @@