Compare commits
5 Commits
v1.1.0
...
developmen
| Author | SHA1 | Date | |
|---|---|---|---|
| ad5cc7b50a | |||
| 43ca3485d7 | |||
| fc289bb915 | |||
| c19eec4913 | |||
| d95160cfe1 |
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
node_modules/
|
||||
59
eslint.config.mjs
Normal file
59
eslint.config.mjs
Normal file
@@ -0,0 +1,59 @@
|
||||
import globals from 'globals';
|
||||
import pluginJs from '@eslint/js';
|
||||
|
||||
/*
|
||||
module.exports = {
|
||||
// in globals block
|
||||
'extends': 'eslint:recommended',
|
||||
'parserOptions': {
|
||||
'ecmaVersion': 6
|
||||
},
|
||||
// rules copied
|
||||
};
|
||||
*/
|
||||
|
||||
/** @type {import('eslint').Linter.Config[]} */
|
||||
export default [
|
||||
{languageOptions: {
|
||||
globals: {
|
||||
...globals.browser,
|
||||
...globals.jquery
|
||||
}
|
||||
}},
|
||||
pluginJs.configs.recommended,
|
||||
{
|
||||
'rules': {
|
||||
'indent': [
|
||||
'error',
|
||||
'tab',
|
||||
{
|
||||
'SwitchCase': 1
|
||||
}
|
||||
],
|
||||
'linebreak-style': [
|
||||
'error',
|
||||
'unix'
|
||||
],
|
||||
// 'quotes': [
|
||||
// 'error',
|
||||
// 'single'
|
||||
// ],
|
||||
'semi': [
|
||||
'error',
|
||||
'always'
|
||||
],
|
||||
'no-console': 'off',
|
||||
'no-unused-vars': [
|
||||
'error', {
|
||||
'vars': 'all',
|
||||
'args': 'after-used',
|
||||
'ignoreRestSiblings': false
|
||||
}
|
||||
],
|
||||
// Requires eslint >= v8.14.0
|
||||
'no-constant-binary-expression': 'error'
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
// __END__
|
||||
1572
package-lock.json
generated
Normal file
1572
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
18
package.json
Normal file
18
package.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "ajax-file-upload",
|
||||
"version": "1.0.0",
|
||||
"main": "",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "Clemens Schwaighofer",
|
||||
"license": "",
|
||||
"description": "Ajax File Upload",
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.20.0",
|
||||
"@types/jquery": "^3.5.32",
|
||||
"esbuild": "^0.25.0",
|
||||
"eslint": "^9.20.1",
|
||||
"globals": "^15.15.0"
|
||||
}
|
||||
}
|
||||
@@ -1226,7 +1226,7 @@ function afusOnReadyStateChangeHandler(target_file, file_pos, target_router, evt
|
||||
// must set dynamic
|
||||
console.log('[AJAX Uploader ORSC: %s/%s] Running: %s, Uploader response: %s -> %o', target_file, file_pos, afusRunningGet(target_file), responseData.status, responseData);
|
||||
// the return msg is normally on base level, but it can be in content too
|
||||
msg = [];
|
||||
let msg = [];
|
||||
if (afusKeyInObject('msg', responseData.content)) {
|
||||
msg = responseData.content.msg;
|
||||
} else if (afusKeyInObject('msg', responseData)) {
|
||||
|
||||
1376
test/edit.jq.js
1376
test/edit.jq.js
File diff suppressed because it is too large
Load Diff
@@ -1 +0,0 @@
|
||||
edit.jq.js
|
||||
@@ -4,7 +4,7 @@
|
||||
<title>AJAX File upload TEST</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<script src="jquery.min.js" type="text/javascript"></script>
|
||||
<script defer src="edit.js" type="text/javascript"></script>
|
||||
<script defer src="utils.min.js" type="text/javascript"></script>
|
||||
<script defer src="other.js" type="text/javascript"></script>
|
||||
<script defer src="../src/ajaxFileUploadSimple.js" type="text/javascript"></script>
|
||||
<link rel=stylesheet type="text/css" href="other.css">
|
||||
@@ -98,6 +98,7 @@
|
||||
<div class="title">Previous uploaded</div>
|
||||
<div id="file-info"></div>
|
||||
<div id="file-list"></div>
|
||||
<div id="file-list-reference-id"></div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="reference-id" id="reference-id" value="">
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<title>AJAX File multiple upload TEST</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<script src="jquery.min.js" type="text/javascript"></script>
|
||||
<script defer src="edit.js" type="text/javascript"></script>
|
||||
<script defer src="utils.min.js" type="text/javascript"></script>
|
||||
<!-- <script defer src="other.js" type="text/javascript"></script> -->
|
||||
<!-- <script defer src="../src/ajaxFileUploadSimple.js" type="text/javascript"></script> -->
|
||||
<!-- <link rel=stylesheet type="text/css" href="other.css"> -->
|
||||
|
||||
@@ -97,7 +97,8 @@ function ajaxWrapper(call_id, queryString = {}, control = {}, url = 'backend.php
|
||||
* uuid4 creator
|
||||
* @returns {String} uuid4
|
||||
*/
|
||||
function uuidv4() {
|
||||
function uuidv4() // eslint-disable-line no-unused-vars
|
||||
{
|
||||
return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, c =>
|
||||
(+c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> +c / 4).toString(16)
|
||||
);
|
||||
@@ -290,7 +291,7 @@ function fileUploadErrorFunction(target_file, file_pos, target_router, control_d
|
||||
}
|
||||
|
||||
// ** init here **/file-list
|
||||
$(document).ready(function () {
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// run and fill uploaded
|
||||
var call_id = 'fileList';
|
||||
var queryString = {
|
||||
@@ -300,9 +301,10 @@ $(document).ready(function () {
|
||||
console.log('Data: %o', data);
|
||||
try {
|
||||
if (data.status == 'error') {
|
||||
//
|
||||
console.log('ERROR during data read');
|
||||
} else {
|
||||
$('#reference-id').val(data.content.reference_id);
|
||||
$('#file-list-reference-id').html(data.content.reference_id);
|
||||
// list files
|
||||
if (data.status == 'warn') {
|
||||
$('#file-info')
|
||||
|
||||
3
test/utils.min.js
vendored
Normal file
3
test/utils.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
7
test/utils.min.js.map
Normal file
7
test/utils.min.js.map
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user