mirror of
https://github.com/webodf/WebODF.git
synced 2026-12-01 16:56:05 +01:00
55 lines
1.6 KiB
JavaScript
55 lines
1.6 KiB
JavaScript
widgets.SimpleStyles = (function () {
|
|
|
|
function makeWidget(documentObject, callback) {
|
|
require(["dijit/form/ToggleButton"], function (ToggleButton) {
|
|
var i,
|
|
widget = {};
|
|
|
|
widget.children = [
|
|
(new ToggleButton({
|
|
showLabel: false,
|
|
checked: false,
|
|
iconClass: "dijitEditorIcon dijitEditorIconBold"
|
|
})),
|
|
(new ToggleButton({
|
|
showLabel: false,
|
|
checked: false,
|
|
iconClass: "dijitEditorIcon dijitEditorIconItalic"
|
|
})),
|
|
(new ToggleButton({
|
|
showLabel: false,
|
|
checked: false,
|
|
iconClass: "dijitEditorIcon dijitEditorIconUnderline"
|
|
})),
|
|
(new ToggleButton({
|
|
showLabel: false,
|
|
checked: false,
|
|
iconClass: "dijitEditorIcon dijitEditorIconStrikethrough"
|
|
}))
|
|
];
|
|
|
|
widget.startup = function () {
|
|
widget.children.forEach(function (element) {
|
|
element.startup();
|
|
});
|
|
};
|
|
|
|
widget.placeAt = function (container) {
|
|
widget.children.forEach(function (element) {
|
|
element.placeAt(container);
|
|
});
|
|
return widget;
|
|
};
|
|
|
|
return callback(widget);
|
|
});
|
|
}
|
|
|
|
widgets.SimpleStyles = function SimpleStyles(documentObject, callback) {
|
|
makeWidget(documentObject, function (widget) {
|
|
return callback(widget);
|
|
});
|
|
};
|
|
|
|
return widgets.SimpleStyles;
|
|
}()); |