1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-02-02 04:09:09 +00:00

Rename upload manager to multipart form manager

This commit is contained in:
Jeremy Ruston 2024-02-28 18:36:19 +00:00
parent 5fe41fc896
commit 1a28ec7ea4
2 changed files with 8 additions and 8 deletions

View File

@ -26,14 +26,14 @@ exports.startup = function() {
databasePath: path.resolve($tw.boot.wikiPath,"store/database.sqlite"), databasePath: path.resolve($tw.boot.wikiPath,"store/database.sqlite"),
engine: $tw.wiki.getTiddlerText("$:/config/MultiWikiServer/Engine","better") // better || wasm engine: $tw.wiki.getTiddlerText("$:/config/MultiWikiServer/Engine","better") // better || wasm
}), }),
UploadManager = require("$:/plugins/tiddlywiki/multiwikiserver/upload-manager.js").UploadManager, MultipartFormManager = require("$:/plugins/tiddlywiki/multiwikiserver/multipart-form-manager.js").MultipartFormManager,
uploadManager = new UploadManager({ multipartFormManager = new MultipartFormManager({
inboxPath: path.resolve($tw.boot.wikiPath,"store/inbox"), inboxPath: path.resolve($tw.boot.wikiPath,"store/inbox"),
store: store store: store
}); });
$tw.mws = { $tw.mws = {
store: store, store: store,
uploadManager: uploadManager multipartFormManager: multipartFormManager
}; };
// Performance timing // Performance timing
console.time("mws-initial-load"); console.time("mws-initial-load");

View File

@ -1,5 +1,5 @@
/*\ /*\
title: $:/plugins/tiddlywiki/multiwikiserver/upload-manager.js title: $:/plugins/tiddlywiki/multiwikiserver/multipart-form-manager.js
type: application/javascript type: application/javascript
module-type: library module-type: library
@ -18,7 +18,7 @@ Create an instance of the upload manager. Options include:
inboxPath - path to the inbox folder inboxPath - path to the inbox folder
store - sqlTiddlerStore to use for saving tiddlers store - sqlTiddlerStore to use for saving tiddlers
*/ */
function UploadManager(options) { function MultipartFormManager(options) {
const path = require("path"); const path = require("path");
options = options || {}; options = options || {};
this.inboxPath = path.resolve(options.inboxPath,); this.inboxPath = path.resolve(options.inboxPath,);
@ -49,7 +49,7 @@ formData is:
] ]
} }
*/ */
UploadManager.prototype.processNewStream = function(options) { MultipartFormManager.prototype.processNewStream = function(options) {
let fileStream = null; let fileStream = null;
let fieldValue = ""; let fieldValue = "";
state.streamMultipartData({ state.streamMultipartData({
@ -87,9 +87,9 @@ UploadManager.prototype.processNewStream = function(options) {
}); });
} }
UploadManager.prototype.close = function() { MultipartFormManager.prototype.close = function() {
}; };
exports.UploadManager = UploadManager; exports.MultipartFormManager = MultipartFormManager;
})(); })();