{"title":"$:/plugins/tiddlywiki/tahoelafs","name":"TahoeLAFS","description":"Tahoe-LAFS saver","list":"readme","version":"5.1.22","plugin-type":"plugin","dependents":"","type":"application/json","tiddlers":{"$:/plugins/tiddlywiki/tahoelafs/readme":{"title":"$:/plugins/tiddlywiki/tahoelafs/readme","text":"This plugin provides a ''saver'' module for saving changes under the [[Tahoe Least Authority File System|https://tahoe-lafs.org/]].\n\nAt this point it is largely for experimentation by @zooko.\n\n[[Source code|https://github.com/Jermolene/TiddlyWiki5/blob/master/plugins/tiddlywiki/tahoelafs]]\n"},"$:/plugins/tiddlywiki/tahoelafs/saver.js":{"title":"$:/plugins/tiddlywiki/tahoelafs/saver.js","text":"/*\\\ntitle: $:/plugins/tiddlywiki/tahoelafs/saver.js\ntype: application/javascript\nmodule-type: saver\n\nA bare bones saver for Tahoe-LAFS. It just PUTs the new HTML file back to the server at the same URL.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nSelect the appropriate saver module and set it up\n*/\nvar TahoeSaver = function(wiki) {\n\tthis.wiki = wiki;\n};\n\nTahoeSaver.prototype.save = function(text) {\n\t// Do the HTTP post\n\tvar http = new XMLHttpRequest();\n\thttp.open(\"PUT\",document.location.toString(),true);\n\thttp.onreadystatechange = function() {\n\t\tif(http.readyState == 4 && http.status == 200) {\n\t\t\twindow.alert(\"Saved to Tahoe-LAFS: \" + http.responseText);\n\t\t}\n\t};\n\thttp.send(text);\n\treturn true;\n};\n\n/*\nInformation about this saver\n*/\nTahoeSaver.prototype.info = {\n\tname: \"tahoelafs\",\n\tpriority: 1000\n};\n\n/*\nStatic method that returns true if this saver is capable of working\n*/\nexports.canSave = function(wiki) {\n\treturn true;\n};\n\n/*\nCreate an instance of this saver\n*/\nexports.create = function(wiki) {\n\treturn new TahoeSaver(wiki);\n};\n\n})();\n","type":"application/javascript","module-type":"saver"}}}