mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-06-04 23:54:06 +00:00

* remove blks first try * dprint.json seems to be OK, some forgotten functions * add some more space-after-keyword settings * server remove blks * add **/files to dprint exclude * dprint.js fixes a typo * add boot.js and bootprefix.js to dprint exclude * dprint change dprint.json * add dprint fmt as script * remove jslint comments * fix whitespace * fix whitespace * remove function-wrapper from geospatial plugin * fix whitespace * add function wrapper to dyannotate-startup * remove dpring.json
52 lines
1.0 KiB
JavaScript
52 lines
1.0 KiB
JavaScript
/*\
|
|
title: $:/core/modules/savers/manualdownload.js
|
|
type: application/javascript
|
|
module-type: saver
|
|
|
|
Handles saving changes via HTML5's download APIs
|
|
|
|
\*/
|
|
|
|
"use strict";
|
|
|
|
// Title of the tiddler containing the download message
|
|
var downloadInstructionsTitle = "$:/language/Modals/Download";
|
|
|
|
/*
|
|
Select the appropriate saver module and set it up
|
|
*/
|
|
var ManualDownloadSaver = function(wiki) {
|
|
};
|
|
|
|
ManualDownloadSaver.prototype.save = function(text,method,callback) {
|
|
$tw.modal.display(downloadInstructionsTitle,{
|
|
downloadLink: "data:text/html," + encodeURIComponent(text)
|
|
});
|
|
// Callback that we succeeded
|
|
callback(null);
|
|
return true;
|
|
};
|
|
|
|
/*
|
|
Information about this saver
|
|
*/
|
|
ManualDownloadSaver.prototype.info = {
|
|
name: "manualdownload",
|
|
priority: 0,
|
|
capabilities: ["save", "download"]
|
|
};
|
|
|
|
/*
|
|
Static method that returns true if this saver is capable of working
|
|
*/
|
|
exports.canSave = function(wiki) {
|
|
return true;
|
|
};
|
|
|
|
/*
|
|
Create an instance of this saver
|
|
*/
|
|
exports.create = function(wiki) {
|
|
return new ManualDownloadSaver(wiki);
|
|
};
|