mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-23 00:46:16 -04:00
Create a customizable timeslider toolbar
This commit is contained in:
parent
867e40533a
commit
6054cda473
9 changed files with 50 additions and 31 deletions
|
@ -46,7 +46,14 @@ exports.expressCreateServer = function (hook_name, args, cb) {
|
|||
//serve timeslider.html under /p/$padname/timeslider
|
||||
args.app.get('/p/:pad/timeslider', function(req, res, next)
|
||||
{
|
||||
res.send(eejs.require("ep_etherpad-lite/templates/timeslider.html", {req: req}));
|
||||
hooks.callAll("padInitToolbar", {
|
||||
toolbar: toolbar
|
||||
});
|
||||
|
||||
res.send(eejs.require("ep_etherpad-lite/templates/timeslider.html", {
|
||||
req: req,
|
||||
toolbar: toolbar
|
||||
}));
|
||||
});
|
||||
|
||||
//serve favicon.ico from all path levels except as a pad name
|
||||
|
|
|
@ -93,6 +93,9 @@ exports.toolbar = {
|
|||
["importexport", "timeslider", "savedrevision"],
|
||||
["settings", "embed"],
|
||||
["showusers"]
|
||||
],
|
||||
timeslider: [
|
||||
["timeslider_export", "timeslider_returnToPad"]
|
||||
]
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ defaultButtonAttributes = function (name, overrides) {
|
|||
return {
|
||||
command: name,
|
||||
localizationId: "pad.toolbar." + name + ".title",
|
||||
class: "buttonicon-" + name
|
||||
class: "buttonicon buttonicon-" + name
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -99,8 +99,8 @@ _.extend(Button.prototype, {
|
|||
"data-key": this.attributes.command,
|
||||
};
|
||||
return tag("li", liAttributes,
|
||||
tag("a", { "class": this.grouping, "data-l10n-id": this.attributes.localizationId },
|
||||
tag("span", { "class": "buttonicon " + this.attributes.class })
|
||||
tag("a", { "class": this.grouping },
|
||||
tag("span", { "class": " "+ this.attributes.class, "data-l10n-id": this.attributes.localizationId })
|
||||
)
|
||||
);
|
||||
}
|
||||
|
@ -162,20 +162,20 @@ module.exports = {
|
|||
orderedlist: {
|
||||
command: "insertorderedlist",
|
||||
localizationId: "pad.toolbar.ol.title",
|
||||
class: "buttonicon-insertorderedlist"
|
||||
class: "buttonicon buttonicon-insertorderedlist"
|
||||
},
|
||||
|
||||
unorderedlist: {
|
||||
command: "insertunorderedlist",
|
||||
localizationId: "pad.toolbar.ul.title",
|
||||
class: "buttonicon-insertunorderedlist"
|
||||
class: "buttonicon buttonicon-insertunorderedlist"
|
||||
},
|
||||
|
||||
indent: defaultButtonAttributes("indent"),
|
||||
outdent: {
|
||||
command: "outdent",
|
||||
localizationId: "pad.toolbar.unindent.title",
|
||||
class: "buttonicon-outdent"
|
||||
class: "buttonicon buttonicon-outdent"
|
||||
},
|
||||
|
||||
undo: defaultButtonAttributes("undo"),
|
||||
|
@ -184,25 +184,37 @@ module.exports = {
|
|||
clearauthorship: {
|
||||
command: "clearauthorship",
|
||||
localizationId: "pad.toolbar.clearAuthorship.title",
|
||||
class: "buttonicon-clearauthorship"
|
||||
class: "buttonicon buttonicon-clearauthorship"
|
||||
},
|
||||
|
||||
importexport: {
|
||||
command: "import_export",
|
||||
localizationId: "pad.toolbar.import_export.title",
|
||||
class: "buttonicon-import_export"
|
||||
class: "buttonicon buttonicon-import_export"
|
||||
},
|
||||
|
||||
timeslider: {
|
||||
command: "showTimeSlider",
|
||||
localizationId: "pad.toolbar.timeslider.title",
|
||||
class: "buttonicon-history"
|
||||
class: "buttonicon buttonicon-history"
|
||||
},
|
||||
|
||||
savedrevision: defaultButtonAttributes("savedRevision"),
|
||||
settings: defaultButtonAttributes("settings"),
|
||||
embed: defaultButtonAttributes("embed"),
|
||||
showusers: defaultButtonAttributes("showusers")
|
||||
showusers: defaultButtonAttributes("showusers"),
|
||||
|
||||
timeslider_export: {
|
||||
command: "import_export",
|
||||
localizationId: "timeslider.toolbar.exportlink.title",
|
||||
class: "buttonicon buttonicon-import_export"
|
||||
},
|
||||
|
||||
timeslider_returnToPad: {
|
||||
command: "timeslider_returnToPad",
|
||||
localizationId: "timeslider.toolbar.returnbutton",
|
||||
class: "buttontext"
|
||||
}
|
||||
},
|
||||
|
||||
registerButton: function (buttonName, buttonInfo) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue