mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-04-29 06:03:18 +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
41 lines
929 B
JavaScript
41 lines
929 B
JavaScript
/*\
|
|
title: $:/core/modules/commands/makelibrary.js
|
|
type: application/javascript
|
|
module-type: command
|
|
|
|
Command to pack all of the plugins in the library into a plugin tiddler of type "library"
|
|
|
|
\*/
|
|
|
|
"use strict";
|
|
|
|
exports.info = {
|
|
name: "makelibrary",
|
|
synchronous: true
|
|
};
|
|
|
|
var UPGRADE_LIBRARY_TITLE = "$:/UpgradeLibrary";
|
|
|
|
var Command = function(params,commander,callback) {
|
|
this.params = params;
|
|
this.commander = commander;
|
|
this.callback = callback;
|
|
};
|
|
|
|
Command.prototype.execute = function() {
|
|
var wiki = this.commander.wiki,
|
|
upgradeLibraryTitle = this.params[0] || UPGRADE_LIBRARY_TITLE,
|
|
tiddlers = $tw.utils.getAllPlugins();
|
|
// Save the upgrade library tiddler
|
|
var pluginFields = {
|
|
title: upgradeLibraryTitle,
|
|
type: "application/json",
|
|
"plugin-type": "library",
|
|
"text": JSON.stringify({tiddlers: tiddlers})
|
|
};
|
|
wiki.addTiddler(new $tw.Tiddler(pluginFields));
|
|
return null;
|
|
};
|
|
|
|
exports.Command = Command;
|