widgets.js -> Tools.js
This commit is contained in:
parent
3ada1fcc1d
commit
0288fd685e
@ -41,14 +41,14 @@ define("webodf/editor/Editor", [
|
|||||||
"webodf/editor/MemberListView",
|
"webodf/editor/MemberListView",
|
||||||
"dijit/layout/BorderContainer",
|
"dijit/layout/BorderContainer",
|
||||||
"dijit/layout/ContentPane",
|
"dijit/layout/ContentPane",
|
||||||
"webodf/editor/widgets"],
|
"webodf/editor/Tools"],
|
||||||
|
|
||||||
function (myResources,
|
function (myResources,
|
||||||
EditorSession,
|
EditorSession,
|
||||||
MemberListView,
|
MemberListView,
|
||||||
BorderContainer,
|
BorderContainer,
|
||||||
ContentPane,
|
ContentPane,
|
||||||
ToolBarTools) {
|
Tools) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
runtime.loadClass('odf.OdfCanvas');
|
runtime.loadClass('odf.OdfCanvas');
|
||||||
@ -70,7 +70,7 @@ define("webodf/editor/Editor", [
|
|||||||
editorSession,
|
editorSession,
|
||||||
mainContainer,
|
mainContainer,
|
||||||
memberListView,
|
memberListView,
|
||||||
toolbarTools,
|
tools,
|
||||||
loadOdtFile = args.loadCallback,
|
loadOdtFile = args.loadCallback,
|
||||||
saveOdtFile = args.saveCallback,
|
saveOdtFile = args.saveCallback,
|
||||||
close = args.closeCallback,
|
close = args.closeCallback,
|
||||||
@ -233,7 +233,7 @@ define("webodf/editor/Editor", [
|
|||||||
this.startEditing = function () {
|
this.startEditing = function () {
|
||||||
runtime.assert(editorSession, "editorSession should exist here.");
|
runtime.assert(editorSession, "editorSession should exist here.");
|
||||||
|
|
||||||
toolbarTools.setEditorSession(editorSession);
|
tools.setEditorSession(editorSession);
|
||||||
editorSession.sessionController.startEditing();
|
editorSession.sessionController.startEditing();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -245,7 +245,7 @@ define("webodf/editor/Editor", [
|
|||||||
this.endEditing = function () {
|
this.endEditing = function () {
|
||||||
runtime.assert(editorSession, "editorSession should exist here.");
|
runtime.assert(editorSession, "editorSession should exist here.");
|
||||||
|
|
||||||
toolbarTools.setEditorSession(undefined);
|
tools.setEditorSession(undefined);
|
||||||
editorSession.sessionController.endEditing();
|
editorSession.sessionController.endEditing();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -266,7 +266,7 @@ define("webodf/editor/Editor", [
|
|||||||
if (err) {
|
if (err) {
|
||||||
callback(err);
|
callback(err);
|
||||||
} else {
|
} else {
|
||||||
toolbarTools.destroy(function(err) {
|
tools.destroy(function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
callback(err);
|
callback(err);
|
||||||
} else {
|
} else {
|
||||||
@ -362,7 +362,7 @@ define("webodf/editor/Editor", [
|
|||||||
inviteButton.onclick = window.inviteButtonProxy.clicked;
|
inviteButton.onclick = window.inviteButtonProxy.clicked;
|
||||||
}
|
}
|
||||||
|
|
||||||
toolbarTools = new ToolBarTools({
|
tools = new Tools({
|
||||||
loadOdtFile: loadOdtFile,
|
loadOdtFile: loadOdtFile,
|
||||||
saveOdtFile: saveOdtFile,
|
saveOdtFile: saveOdtFile,
|
||||||
close: close,
|
close: close,
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
/*global define,document,require */
|
/*global define,document,require */
|
||||||
|
|
||||||
define("webodf/editor/widgets", [
|
define("webodf/editor/Tools", [
|
||||||
"dojo/ready",
|
"dojo/ready",
|
||||||
"dijit/MenuItem",
|
"dijit/MenuItem",
|
||||||
"dijit/DropDownMenu",
|
"dijit/DropDownMenu",
|
||||||
@ -49,7 +49,7 @@ define("webodf/editor/widgets", [
|
|||||||
function (ready, MenuItem, DropDownMenu, Button, DropDownButton, Toolbar, SimpleStyles, UndoRedoMenu, CurrentStyle, ParagraphStylesDialog, ZoomSlider) {
|
function (ready, MenuItem, DropDownMenu, Button, DropDownButton, Toolbar, SimpleStyles, UndoRedoMenu, CurrentStyle, ParagraphStylesDialog, ZoomSlider) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
return function ToolBarTools(args) {
|
return function Tools(args) {
|
||||||
var translator = document.translator,
|
var translator = document.translator,
|
||||||
loadOdtFile = args.loadOdtFile,
|
loadOdtFile = args.loadOdtFile,
|
||||||
saveOdtFile = args.saveOdtFile,
|
saveOdtFile = args.saveOdtFile,
|
||||||
@ -104,8 +104,8 @@ define("webodf/editor/widgets", [
|
|||||||
undoRedoMenu.setEditorSession(editorSession);
|
undoRedoMenu.setEditorSession(editorSession);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Simple Style Selector [B, I, U, S]
|
||||||
if (args.directStylingEnabled) {
|
if (args.directStylingEnabled) {
|
||||||
// Simple Style Selector [B, I, U, S]
|
|
||||||
simpleStyles = new SimpleStyles(function (widget) {
|
simpleStyles = new SimpleStyles(function (widget) {
|
||||||
widget.placeAt(toolbar);
|
widget.placeAt(toolbar);
|
||||||
widget.startup();
|
widget.startup();
|
Loading…
x
Reference in New Issue
Block a user