Add templates to pad2
This commit is contained in:
@@ -539,6 +539,15 @@ define([
|
||||
var $hist = common.createButton('history', true, {histConfig: histConfig});
|
||||
$drawer.append($hist);
|
||||
|
||||
//if (!Cryptpad.isTemplate(window.location.href)) {
|
||||
var templateObj = {
|
||||
rt: info.realtime,
|
||||
getTitle: function () { return metadataMgr.getMetadata().title; }
|
||||
};
|
||||
var $templateButton = common.createButton('template', true, templateObj);
|
||||
$rightside.append($templateButton);
|
||||
//}
|
||||
|
||||
/* add an export button */
|
||||
var $export = Cryptpad.createButton('export', true, {}, exportFile);
|
||||
$drawer.append($export);
|
||||
@@ -641,7 +650,7 @@ define([
|
||||
}*/
|
||||
|
||||
/* add a history button */
|
||||
var histConfig = {
|
||||
/*var histConfig = {
|
||||
onLocal: realtimeOptions.onLocal,
|
||||
onRemote: realtimeOptions.onRemote,
|
||||
setHistory: setHistory,
|
||||
@@ -650,7 +659,7 @@ define([
|
||||
};
|
||||
var $hist = Cryptpad.createButton('history', true, {histConfig: histConfig});
|
||||
$drawer.append($hist);
|
||||
|
||||
*/
|
||||
/* save as template */
|
||||
if (!Cryptpad.isTemplate(window.location.href)) {
|
||||
var templateObj = {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
define([
|
||||
'/api/config',
|
||||
'jquery',
|
||||
'/common/requireconfig.js'
|
||||
], function (ApiConfig, $, RequireConfig) {
|
||||
'/common/requireconfig.js',
|
||||
'/common/cryptget.js'
|
||||
], function (ApiConfig, $, RequireConfig, Cryptget) {
|
||||
$(function () {
|
||||
var req = {
|
||||
cfg: RequireConfig,
|
||||
@@ -136,6 +137,11 @@ define([
|
||||
Cryptpad.moveToTrash(cb);
|
||||
});
|
||||
|
||||
|
||||
sframeChan.on('Q_SAVE_AS_TEMPLATE', function (data, cb) {
|
||||
Cryptpad.saveAsTemplate(Cryptget.put, data, cb);
|
||||
});
|
||||
|
||||
sframeChan.on('Q_GET_FULL_HISTORY', function (data, cb) {
|
||||
var network = Cryptpad.getNetwork();
|
||||
var hkn = network.historyKeeper;
|
||||
|
||||
Reference in New Issue
Block a user