Skip to content

Commit

Permalink
Release version 2.1.11 (#204)
Browse files Browse the repository at this point in the history
* Fixed typos in readme

* Updated package-lock.json to new npm format

* Updated dependency that had low-severity ReDos regression

* Cleaned up old mercurial leftovers

* Added SQLite web assembly

* Updated README

* Updated doctypes in html files to simply <!doctype html> to avoid warnings

* Fixed livereload issue

* Removing 'undefined' postfix from log when no detail provided

* Fixed raw javascript references

* Updated text to no longer specify Chrome browser requirement

* Improved logging to use actual console log levels

* Augmented log function to include caller info and removed severy prefix.

* Fixed references

* Updated packages, livereload not working

* Fixed livereload

* Updated javascripts to support sqlite3

* Updated tab1.html: Removed jquery-migrate, fixed purge button

* Commented out jquery-migrate in tab2-6

* Removed check for webDb

* Added ref. to sqlite3

* Added favicon

* fixes firefox support

* Fixes empty string bug

* Updated grunt config to add headers

* More header

* Newer doctype

* Replaced defect iframe with a link

* Add min-height

* Fixing handlebars issue

* Updated version

---------

Co-authored-by: dikshamalik2552 <89207778+dikshamalik2552@users.noreply.github.com>
Co-authored-by: wbrunette <wbrunette@gmail.com>
  • Loading branch information
3 people authored May 9, 2024
1 parent d806ccd commit cce3ab7
Show file tree
Hide file tree
Showing 33 changed files with 3,049 additions and 1,282 deletions.
11 changes: 0 additions & 11 deletions .hgignore

This file was deleted.

71 changes: 0 additions & 71 deletions .hgtags

This file was deleted.

57 changes: 39 additions & 18 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@ var SERVER_PORT = 8000;
var lrSnippet = require('connect-livereload')({port: LIVERELOAD_PORT});
var serveStatic = require('serve-static');
var serveIndex = require('serve-index');
var mountFolder = function (connect, dir) {
var mountFolder = function (dir) {
return serveStatic(
require('path').resolve(dir),
{
// We need to specify a file that will be displayed in place of
// index.html. _.html is used because it is unlikely to exist.
index: '_.html'
index: '_.html',
setHeaders: setHeaders
}
);
};
var mountDirectory = function(connect, dir) {
var mountDirectory = function(dir) {
return serveIndex(
require('path').resolve(dir),
{
Expand All @@ -23,6 +24,16 @@ var mountDirectory = function(connect, dir) {
);
};

var setHeaders = function(res, path) {
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
res.setHeader('Cross-Origin-Embedder-Policy', 'credentialless');
res.setHeader('Cross-Origin-Opener-Policy', 'cross-origin');
res.setHeader('Cross-Origin-Resource-Policy', 'cross-origin');
res.setHeader('Content-Security-Policy',`frame-ancestors 'self' http://localhost:${SERVER_PORT} http://localhost:${LIVERELOAD_PORT}`);
res.setHeader('X-Content-Type-Options', '');
}

var postHandler = function(req, res, next) {
if (req.method === 'POST') {
//debugger;
Expand Down Expand Up @@ -205,6 +216,8 @@ module.exports = function (grunt) {
livereload: LIVERELOAD_PORT
},
files: [
'devEnv/*.html',
'devEnv/*.js',
'<%= tables.appDir %>/*.html',
'<%= tables.appDir %>/system/**',
]
Expand All @@ -215,36 +228,44 @@ module.exports = function (grunt) {
}
},
connect: {
server: {
options: {
setHeaders: setHeaders
}
},
options: {
port: SERVER_PORT,
// change this to '0.0.0.0' to access the server from outside
hostname: 'localhost'
},
livereload: {
options: {
middleware: function (connect) {
return [
postHandler,
lrSnippet,
mountFolder(connect, baseDirForServer),
mountDirectory(connect, baseDirForServer)
];
middleware: function(connect, options, middlewares) {
// Add the middleware for setting headers
middlewares.unshift(function(req, res, next) {
setHeaders(res);
next();
});

middlewares.unshift(postHandler);
middlewares.unshift(lrSnippet);
middlewares.unshift(mountFolder(baseDirForServer));
middlewares.unshift(mountDirectory(baseDirForServer));
return middlewares;
}
}
},
test: {
options: {
port: 8001,
middleware: function (connect) {
return [
middleware: [
postHandler,
lrSnippet,
mountFolder(connect, 'test'),
mountFolder(connect, baseDirForServer),
mountDirectory(connect, baseDirForServer)
];
}
}
mountFolder('test'),
mountFolder(baseDirForServer),
mountDirectory(baseDirForServer)
]
}
}
},
open: {
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Much of the boilerplate of app creation can be avoided by employing the Grunt ta
Make sure Java 8 or higher is installed on the computer you plan to use. If it is not, [download and install it](https://java.com/en/download/). If you are using MacOSX, it may require special care and attention.See [MacOSX Java install](https://docs.oracle.com/javase/8/docs/technotes/guides/install/mac_jdk.html) and [MacOSX Java FAQ](https://docs.oracle.com/javase/8/docs/technotes/guides/install/mac_install_faq.html).

### NodeJS
You must use Version 12 or higher. To avoid directory path problems on Windows, we require npm version 6.9 or higher (generally npm will be bundled with NodeJS installer). Follow the [instructions to install NodeJS](https://nodejs.org/en/download/package-manager/).
You must use Version 20 or higher. To avoid directory path problems on Windows, we require npm version 10 or higher (generally npm will be bundled with NodeJS installer). Follow the [instructions to install NodeJS](https://nodejs.org/en/download/package-manager/).

### For Windows
When installing on Windows you can use an automated **NodeJS** installer that uses **Chocolatey**. If you chose not to let the installer use **Chocolatey** to install a bunch of packages after installing **NodeJS**, you will need to ensure the location of the `npm` folder is added to the *PATH* variable of your system. If it is not, subsequent calls to access grunt will fail. For example: `C:\Users\[username]\AppData\Roaming\npm`. For instructions on modifying *PATH*, see the section at the bottom of this page called Add adb to your *PATH* For Windows. Instead of navigating to the location of Android SDK, navigate to the location of the `npm` folder.
Expand Down Expand Up @@ -211,8 +211,6 @@ $ grunt --verbose connect:livereload:keepalive
```
This will start grunt, but disable the file-change detection mechanisms that automatically reload an HTML page when it or any JavaScript file it uses has been modified. Others have reported that uninstalling npm and node, and then re-installing them may correct the issue.

If you get the error "You must use Chrome or Safari Browser (note: this is tested only in chrome browser)" even when using any of these , it’s likely due to the removal of the built-in DB on Chrome. Until mid-2024 (M123), you can resolve this by re-enabling it using chrome://flags/#web-sql-access.

#### Windows Users Tip
You will be opening a **cmd** window and changing your current directory (using the **cd** command) into this directory every time you use this tool. It is therefore useful to create a shortcut that opens a cmd window directly into this directory:
1) Open a file browser and navigate to the unzipped directory containing a number of files and directories, including a **Gruntfile.js**.
Expand Down Expand Up @@ -243,7 +241,7 @@ Once you’re up and running, you can choose an issue to start working on from h

Issues tagged as [good first issue](https://github.com/odk-x/tool-suite-X/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) should be a good place to start.

Pull requests are welcome, though please submit them against the development branch. We prefer verbose descriptions of the change you are submitting. If you are fixing a bug please provide steps to reproduce it or a link to a an issue that provides that information. If you are submitting a new feature please provide a description of the need or a link to a forum discussion about it.
Pull requests are welcome, though please submit them against the development branch. We prefer verbose descriptions of the change you are submitting. If you are fixing a bug, please provide steps to reproduce it or a link to an issue that provides that information. If you are submitting a new feature, please provide a description of the need or a link to a forum discussion about it.

## Links for users
This document is aimed at helping developers and technical contributors. For information on how to get started as a user of ODK-X, see our [online documentation](https://docs.odk-x.org), or to learn more about the Open Data Kit project, visit [https://odk-x.org](https://odk-x.org).
5 changes: 3 additions & 2 deletions app/system/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
Expand All @@ -17,7 +17,8 @@
<script type="text/javascript" src="tables/js/odkTables.js"></script>
<script type="text/javascript" src="survey/js/odkSurvey.js"></script>
<script type="text/javascript" src="survey/js/odkSurveyStateManagement.js"></script>
<noscript>This page requires javascript and a Chrome or WebKit browser</noscript>
<script src="/node_modules/@sqlite.org/sqlite-wasm/sqlite-wasm/jswasm/sqlite3.js"></script>
<noscript>This page requires javascript</noscript>
</head>
<body>
<div id="block-ui"></div>
Expand Down
Loading

0 comments on commit cce3ab7

Please sign in to comment.