1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-06 10:06:19 +00:00
TiddlyWiki5/core/modules/savers/manualdownload.js

57 lines
1.1 KiB
JavaScript
Raw Normal View History

/*\
title: $:/core/modules/savers/manualdownload.js
type: application/javascript
module-type: saver
Handles saving changes via HTML5's download APIs
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
2013-03-07 17:18:04 +00:00
// 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)
});
2014-08-27 08:59:01 +00:00
// 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);
};
})();