Merge pull request #102 from kossebau/webodf-sync-07.11.13
Sync with webodf 379ba3bfff4a7d736109f48c8ab72ea649a77918
This commit is contained in:
commit
0a35852e67
4
js/3rdparty/webodf/dojo-amalgamation.js
vendored
4
js/3rdparty/webodf/dojo-amalgamation.js
vendored
@ -661,7 +661,7 @@ a;this._set("title",a)},postCreate:function(){this.inherited(arguments);this.con
|
|||||||
"-"+c];j.replace(this.domNode,a,this._currentOrientClass||"");this._currentOrientClass=a},focus:function(){this._getFocusItems(this.containerNode);g.focus(this._firstFocusItem)},onOpen:function(a){this.orient(this.domNode,a.aroundCorner,a.corner);var b=a.aroundNodePos;if("M"==a.corner.charAt(0)&&"M"==a.aroundCorner.charAt(0))this.connectorNode.style.top=b.y+(b.h-this.connectorNode.offsetHeight>>1)-a.y+"px",this.connectorNode.style.left="";else if("M"==a.corner.charAt(1)&&"M"==a.aroundCorner.charAt(1))this.connectorNode.style.left=
|
"-"+c];j.replace(this.domNode,a,this._currentOrientClass||"");this._currentOrientClass=a},focus:function(){this._getFocusItems(this.containerNode);g.focus(this._firstFocusItem)},onOpen:function(a){this.orient(this.domNode,a.aroundCorner,a.corner);var b=a.aroundNodePos;if("M"==a.corner.charAt(0)&&"M"==a.aroundCorner.charAt(0))this.connectorNode.style.top=b.y+(b.h-this.connectorNode.offsetHeight>>1)-a.y+"px",this.connectorNode.style.left="";else if("M"==a.corner.charAt(1)&&"M"==a.aroundCorner.charAt(1))this.connectorNode.style.left=
|
||||||
b.x+(b.w-this.connectorNode.offsetWidth>>1)-a.x+"px";this._onShow()},onClose:function(){this.onHide()},_onKey:function(a){var b=a.target;a.charOrCode===l.TAB&&this._getFocusItems(this.containerNode);var c=this._firstFocusItem==this._lastFocusItem;a.charOrCode==l.ESCAPE?(this.defer("onCancel"),i.stop(a)):b==this._firstFocusItem&&a.shiftKey&&a.charOrCode===l.TAB?(c||g.focus(this._lastFocusItem),i.stop(a)):b==this._lastFocusItem&&a.charOrCode===l.TAB&&!a.shiftKey?(c||g.focus(this._firstFocusItem),i.stop(a)):
|
b.x+(b.w-this.connectorNode.offsetWidth>>1)-a.x+"px";this._onShow()},onClose:function(){this.onHide()},_onKey:function(a){var b=a.target;a.charOrCode===l.TAB&&this._getFocusItems(this.containerNode);var c=this._firstFocusItem==this._lastFocusItem;a.charOrCode==l.ESCAPE?(this.defer("onCancel"),i.stop(a)):b==this._firstFocusItem&&a.shiftKey&&a.charOrCode===l.TAB?(c||g.focus(this._lastFocusItem),i.stop(a)):b==this._lastFocusItem&&a.charOrCode===l.TAB&&!a.shiftKey?(c||g.focus(this._firstFocusItem),i.stop(a)):
|
||||||
a.charOrCode===l.TAB&&a.stopPropagation()}})})},"url:dijit/templates/TooltipDialog.html":'<div role="presentation" tabIndex="-1">\n\t<div class="dijitTooltipContainer" role="presentation">\n\t\t<div class ="dijitTooltipContents dijitTooltipFocusNode" data-dojo-attach-point="containerNode" role="dialog"></div>\n\t</div>\n\t<div class="dijitTooltipConnector" role="presentation" data-dojo-attach-point="connectorNode"></div>\n</div>\n',"*now":function(e){e(['dojo/i18n!*preload*dojo/nls/dojo*["ar","ca","cs","da","de","el","en-gb","en-us","es-es","fi-fi","fr-fr","he-il","hu","it-it","ja-jp","ko-kr","nl-nl","nb","pl","pt-br","pt-pt","ru","sk","sl","sv","th","tr","zh-tw","zh-cn","ROOT"]'])}}});
|
a.charOrCode===l.TAB&&a.stopPropagation()}})})},"url:dijit/templates/TooltipDialog.html":'<div role="presentation" tabIndex="-1">\n\t<div class="dijitTooltipContainer" role="presentation">\n\t\t<div class ="dijitTooltipContents dijitTooltipFocusNode" data-dojo-attach-point="containerNode" role="dialog"></div>\n\t</div>\n\t<div class="dijitTooltipConnector" role="presentation" data-dojo-attach-point="connectorNode"></div>\n</div>\n',"*now":function(e){e(['dojo/i18n!*preload*dojo/nls/dojo*["ar","ca","cs","da","de","el","en-gb","en-us","es-es","fi-fi","fr-fr","he-il","hu","it-it","ja-jp","ko-kr","nl-nl","nb","pl","pt-br","pt-pt","ru","sk","sl","sv","th","tr","zh-tw","zh-cn","ROOT"]'])}}});
|
||||||
// START OF nls/dojobundle.js
|
// START OF dojobundle.js
|
||||||
/* START OF NLS BUNDLE ENTRY [dojo-deps/dist/dijit/_editor/nls/FontChoice.js] */
|
/* START OF NLS BUNDLE ENTRY [dojo-deps/dist/dijit/_editor/nls/FontChoice.js] */
|
||||||
//>>built
|
//>>built
|
||||||
define("dijit/_editor/nls/FontChoice",{root:{fontSize:"Size",fontName:"Font",formatBlock:"Format",serif:"serif","sans-serif":"sans-serif",monospace:"monospace",cursive:"cursive",fantasy:"fantasy",noFormat:"None",p:"Paragraph",h1:"Heading",h2:"Subheading",h3:"Sub-subheading",pre:"Pre-formatted",1:"xx-small",2:"x-small",3:"small",4:"medium",5:"large",6:"x-large",7:"xx-large"},zh:!0,"zh-tw":!0,tr:!0,th:!0,sv:!0,sl:!0,sk:!0,ru:!0,ro:!0,pt:!0,"pt-pt":!0,pl:!0,nl:!0,nb:!0,ko:!0,kk:!0,ja:!0,it:!0,hu:!0,
|
define("dijit/_editor/nls/FontChoice",{root:{fontSize:"Size",fontName:"Font",formatBlock:"Format",serif:"serif","sans-serif":"sans-serif",monospace:"monospace",cursive:"cursive",fantasy:"fantasy",noFormat:"None",p:"Paragraph",h1:"Heading",h2:"Subheading",h3:"Sub-subheading",pre:"Pre-formatted",1:"xx-small",2:"x-small",3:"small",4:"medium",5:"large",6:"x-large",7:"xx-large"},zh:!0,"zh-tw":!0,tr:!0,th:!0,sv:!0,sl:!0,sk:!0,ru:!0,ro:!0,pt:!0,"pt-pt":!0,pl:!0,nl:!0,nb:!0,ko:!0,kk:!0,ja:!0,it:!0,hu:!0,
|
||||||
@ -1706,6 +1706,6 @@ define("dojox/widget/nls/ru/FilePicker",{name:"\u0418\u043c\u044f",path:"\u041f\
|
|||||||
define("dojox/widget/nls/ru/Wizard",{next:"\u0414\u0430\u043b\u0435\u0435",previous:"\u041d\u0430\u0437\u0430\u0434",done:"\u0413\u043e\u0442\u043e\u0432\u043e"});
|
define("dojox/widget/nls/ru/Wizard",{next:"\u0414\u0430\u043b\u0435\u0435",previous:"\u041d\u0430\u0437\u0430\u0434",done:"\u0413\u043e\u0442\u043e\u0432\u043e"});
|
||||||
/* END OF NLS BUNDLE ENTRY [dojo-deps/dist/dojox/widget/nls/ru/Wizard.js] */
|
/* END OF NLS BUNDLE ENTRY [dojo-deps/dist/dojox/widget/nls/ru/Wizard.js] */
|
||||||
|
|
||||||
// END OF nls/dojobundle.js
|
// END OF dojobundle.js
|
||||||
|
|
||||||
(function(){var e=this.require;e({cache:{}});!e.async&&e(["dojo"]);e.boot&&e.apply(null,e.boot)})();
|
(function(){var e=this.require;e({cache:{}});!e.async&&e(["dojo"]);e.boot&&e.apply(null,e.boot)})();
|
62
js/3rdparty/webodf/editor/Editor.js
vendored
62
js/3rdparty/webodf/editor/Editor.js
vendored
@ -10,6 +10,9 @@
|
|||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this code. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
* As additional permission under GNU AGPL version 3 section 7, you
|
* As additional permission under GNU AGPL version 3 section 7, you
|
||||||
* may distribute non-source (e.g., minimized or compacted) forms of
|
* may distribute non-source (e.g., minimized or compacted) forms of
|
||||||
* that code without the copy of the GNU GPL normally required by
|
* that code without the copy of the GNU GPL normally required by
|
||||||
@ -30,21 +33,19 @@
|
|||||||
* This license applies to this entire compilation.
|
* This license applies to this entire compilation.
|
||||||
* @licend
|
* @licend
|
||||||
* @source: http://www.webodf.org/
|
* @source: http://www.webodf.org/
|
||||||
* @source: http://gitorious.org/webodf/webodf/
|
* @source: https://github.com/kogmbh/WebODF/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global runtime, define, document, odf, ops, window, gui, alert, saveAs, Blob */
|
/*global runtime, define, document, odf, ops, window, gui, alert, saveAs, Blob */
|
||||||
|
|
||||||
define("webodf/editor/Editor", [
|
define("webodf/editor/Editor", [
|
||||||
"dojo/i18n!webodf/editor/nls/myResources",
|
|
||||||
"webodf/editor/EditorSession",
|
"webodf/editor/EditorSession",
|
||||||
"webodf/editor/MemberListView",
|
"webodf/editor/MemberListView",
|
||||||
"dijit/layout/BorderContainer",
|
"dijit/layout/BorderContainer",
|
||||||
"dijit/layout/ContentPane",
|
"dijit/layout/ContentPane",
|
||||||
"webodf/editor/Tools"],
|
"webodf/editor/Tools"],
|
||||||
|
|
||||||
function (myResources,
|
function (EditorSession,
|
||||||
EditorSession,
|
|
||||||
MemberListView,
|
MemberListView,
|
||||||
BorderContainer,
|
BorderContainer,
|
||||||
ContentPane,
|
ContentPane,
|
||||||
@ -55,11 +56,11 @@ define("webodf/editor/Editor", [
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
* @param {{unstableFeaturesEnabled:boolean=,
|
* @param {{unstableFeaturesEnabled:boolean,
|
||||||
* loadCallback:function()=,
|
* loadCallback:function(),
|
||||||
* saveCallback:function()=,
|
* saveCallback:function(),
|
||||||
* closeCallback:function()=,
|
* closeCallback:function()}}
|
||||||
* @param {!ops.Server=} server
|
* param {!ops.Server=} server
|
||||||
* @param {!ServerFactory=} serverFactory
|
* @param {!ServerFactory=} serverFactory
|
||||||
*/
|
*/
|
||||||
function Editor(args, server, serverFactory) {
|
function Editor(args, server, serverFactory) {
|
||||||
@ -273,8 +274,6 @@ define("webodf/editor/Editor", [
|
|||||||
if (err) {
|
if (err) {
|
||||||
callback(err);
|
callback(err);
|
||||||
} else {
|
} else {
|
||||||
document.translator = null;
|
|
||||||
document.translateContent = null;
|
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -285,9 +284,7 @@ define("webodf/editor/Editor", [
|
|||||||
};
|
};
|
||||||
|
|
||||||
function setFocusToOdfCanvas() {
|
function setFocusToOdfCanvas() {
|
||||||
if (odfCanvas) {
|
editorSession.sessionController.getEventManager().focus();
|
||||||
odfCanvas.getElement().focus();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// init
|
// init
|
||||||
@ -298,29 +295,15 @@ define("webodf/editor/Editor", [
|
|||||||
memberListElement = document.getElementById('memberList'),
|
memberListElement = document.getElementById('memberList'),
|
||||||
collabEditing = Boolean(server),
|
collabEditing = Boolean(server),
|
||||||
directStylingEnabled = (! collabEditing) || args.unstableFeaturesEnabled,
|
directStylingEnabled = (! collabEditing) || args.unstableFeaturesEnabled,
|
||||||
|
imageInsertingEnabled = (! collabEditing) || args.unstableFeaturesEnabled,
|
||||||
// annotations not yet properly supported for OT
|
// annotations not yet properly supported for OT
|
||||||
annotationsEnabled = (! collabEditing) || args.unstableFeaturesEnabled,
|
annotationsEnabled = (! collabEditing) || args.unstableFeaturesEnabled,
|
||||||
// undo manager is not yet integrated with collaboration
|
// undo manager is not yet integrated with collaboration
|
||||||
undoRedoEnabled = (! collabEditing),
|
undoRedoEnabled = (! collabEditing),
|
||||||
closeCallback;
|
closeCallback;
|
||||||
|
|
||||||
if (collabEditing) {
|
// Extend runtime with a convenient translation function
|
||||||
runtime.assert(memberListElement, 'missing "memberList" div in HTML');
|
runtime.translateContent = function (node) {
|
||||||
}
|
|
||||||
|
|
||||||
runtime.assert(canvasElement, 'missing "canvas" div in HTML');
|
|
||||||
|
|
||||||
// setup translations
|
|
||||||
// TODO: move from document instance into webodf namespace
|
|
||||||
function translator(key, context) {
|
|
||||||
if (undefined === myResources[key]) {
|
|
||||||
return "translation missing: " + key;
|
|
||||||
}
|
|
||||||
return myResources[key];
|
|
||||||
}
|
|
||||||
document.translator = translator;
|
|
||||||
|
|
||||||
function translateContent(node) {
|
|
||||||
var i,
|
var i,
|
||||||
element,
|
element,
|
||||||
tag,
|
tag,
|
||||||
@ -334,11 +317,16 @@ define("webodf/editor/Editor", [
|
|||||||
if (tag === "label"
|
if (tag === "label"
|
||||||
|| tag === "span"
|
|| tag === "span"
|
||||||
|| /h\d/i.test(tag)) {
|
|| /h\d/i.test(tag)) {
|
||||||
element.textContent = document.translator(placeholder);
|
element.textContent = runtime.tr(placeholder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (collabEditing) {
|
||||||
|
runtime.assert(memberListElement, 'missing "memberList" div in HTML');
|
||||||
}
|
}
|
||||||
document.translateContent = translateContent;
|
|
||||||
|
runtime.assert(canvasElement, 'missing "canvas" div in HTML');
|
||||||
|
|
||||||
// App Widgets
|
// App Widgets
|
||||||
mainContainer = new BorderContainer({}, 'mainContainer');
|
mainContainer = new BorderContainer({}, 'mainContainer');
|
||||||
@ -351,7 +339,7 @@ define("webodf/editor/Editor", [
|
|||||||
if (collabEditing) {
|
if (collabEditing) {
|
||||||
memberListPane = new ContentPane({
|
memberListPane = new ContentPane({
|
||||||
region: 'right',
|
region: 'right',
|
||||||
title: translator("members")
|
title: runtime.tr("Members")
|
||||||
}, 'members');
|
}, 'members');
|
||||||
mainContainer.addChild(memberListPane);
|
mainContainer.addChild(memberListPane);
|
||||||
memberListView = new MemberListView(memberListElement);
|
memberListView = new MemberListView(memberListElement);
|
||||||
@ -362,7 +350,7 @@ define("webodf/editor/Editor", [
|
|||||||
if (window.inviteButtonProxy) {
|
if (window.inviteButtonProxy) {
|
||||||
inviteButton = document.getElementById('inviteButton');
|
inviteButton = document.getElementById('inviteButton');
|
||||||
runtime.assert(inviteButton, 'missing "inviteButton" div in HTML');
|
runtime.assert(inviteButton, 'missing "inviteButton" div in HTML');
|
||||||
inviteButton.innerText = translator("inviteMembers");
|
inviteButton.innerText = runtime.tr("Invite Members");
|
||||||
inviteButton.style.display = "block";
|
inviteButton.style.display = "block";
|
||||||
inviteButton.onclick = window.inviteButtonProxy.clicked;
|
inviteButton.onclick = window.inviteButtonProxy.clicked;
|
||||||
}
|
}
|
||||||
@ -373,6 +361,7 @@ define("webodf/editor/Editor", [
|
|||||||
saveOdtFile: saveOdtFile,
|
saveOdtFile: saveOdtFile,
|
||||||
close: close,
|
close: close,
|
||||||
directStylingEnabled: directStylingEnabled,
|
directStylingEnabled: directStylingEnabled,
|
||||||
|
imageInsertingEnabled: imageInsertingEnabled,
|
||||||
annotationsEnabled: annotationsEnabled,
|
annotationsEnabled: annotationsEnabled,
|
||||||
undoRedoEnabled: undoRedoEnabled
|
undoRedoEnabled: undoRedoEnabled
|
||||||
});
|
});
|
||||||
@ -391,7 +380,8 @@ define("webodf/editor/Editor", [
|
|||||||
session = new ops.Session(odfCanvas);
|
session = new ops.Session(odfCanvas);
|
||||||
editorSession = new EditorSession(session, pendingMemberId, {
|
editorSession = new EditorSession(session, pendingMemberId, {
|
||||||
viewOptions: viewOptions,
|
viewOptions: viewOptions,
|
||||||
directStylingEnabled: directStylingEnabled
|
directStylingEnabled: directStylingEnabled,
|
||||||
|
imageInsertingEnabled: imageInsertingEnabled
|
||||||
});
|
});
|
||||||
if (undoRedoEnabled) {
|
if (undoRedoEnabled) {
|
||||||
editorSession.sessionController.setUndoManager(new gui.TrivialUndoManager());
|
editorSession.sessionController.setUndoManager(new gui.TrivialUndoManager());
|
||||||
|
87
js/3rdparty/webodf/editor/EditorSession.js
vendored
87
js/3rdparty/webodf/editor/EditorSession.js
vendored
@ -10,6 +10,9 @@
|
|||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this code. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
* As additional permission under GNU AGPL version 3 section 7, you
|
* As additional permission under GNU AGPL version 3 section 7, you
|
||||||
* may distribute non-source (e.g., minimized or compacted) forms of
|
* may distribute non-source (e.g., minimized or compacted) forms of
|
||||||
* that code without the copy of the GNU GPL normally required by
|
* that code without the copy of the GNU GPL normally required by
|
||||||
@ -30,7 +33,7 @@
|
|||||||
* This license applies to this entire compilation.
|
* This license applies to this entire compilation.
|
||||||
* @licend
|
* @licend
|
||||||
* @source: http://www.webodf.org/
|
* @source: http://www.webodf.org/
|
||||||
* @source: http://gitorious.org/webodf/webodf/
|
* @source: https://github.com/kogmbh/WebODF/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global define, runtime, core, gui, ops, document */
|
/*global define, runtime, core, gui, ops, document */
|
||||||
@ -54,7 +57,9 @@ define("webodf/editor/EditorSession", [
|
|||||||
runtime.loadClass("gui.SessionController");
|
runtime.loadClass("gui.SessionController");
|
||||||
runtime.loadClass("gui.SessionView");
|
runtime.loadClass("gui.SessionView");
|
||||||
runtime.loadClass("gui.TrivialUndoManager");
|
runtime.loadClass("gui.TrivialUndoManager");
|
||||||
|
runtime.loadClass("gui.SelectionViewManager");
|
||||||
runtime.loadClass("core.EventNotifier");
|
runtime.loadClass("core.EventNotifier");
|
||||||
|
runtime.loadClass("gui.ShadowCursor");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiate a new editor session attached to an existing operation session
|
* Instantiate a new editor session attached to an existing operation session
|
||||||
@ -69,6 +74,7 @@ define("webodf/editor/EditorSession", [
|
|||||||
currentCommonStyleName = null,
|
currentCommonStyleName = null,
|
||||||
currentStyleName = null,
|
currentStyleName = null,
|
||||||
caretManager,
|
caretManager,
|
||||||
|
selectionViewManager,
|
||||||
odtDocument = session.getOdtDocument(),
|
odtDocument = session.getOdtDocument(),
|
||||||
textns = odf.Namespaces.textns,
|
textns = odf.Namespaces.textns,
|
||||||
fontStyles = document.createElement('style'),
|
fontStyles = document.createElement('style'),
|
||||||
@ -82,16 +88,11 @@ define("webodf/editor/EditorSession", [
|
|||||||
EditorSession.signalCommonStyleCreated,
|
EditorSession.signalCommonStyleCreated,
|
||||||
EditorSession.signalCommonStyleDeleted,
|
EditorSession.signalCommonStyleDeleted,
|
||||||
EditorSession.signalParagraphStyleModified,
|
EditorSession.signalParagraphStyleModified,
|
||||||
EditorSession.signalUndoStackChanged]);
|
EditorSession.signalUndoStackChanged]),
|
||||||
|
shadowCursor = new gui.ShadowCursor(odtDocument);
|
||||||
|
|
||||||
|
/**
|
||||||
this.sessionController = new gui.SessionController(session, localMemberId, {directStylingEnabled: config.directStylingEnabled});
|
* @return {Array.<!string>}
|
||||||
caretManager = new gui.CaretManager(self.sessionController);
|
|
||||||
this.sessionView = new gui.SessionView(config.viewOptions, session, caretManager);
|
|
||||||
this.availableFonts = [];
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @return {Array.{!string}}
|
|
||||||
*/
|
*/
|
||||||
function getAvailableFonts() {
|
function getAvailableFonts() {
|
||||||
var availableFonts, regex, matches;
|
var availableFonts, regex, matches;
|
||||||
@ -109,7 +110,6 @@ define("webodf/editor/EditorSession", [
|
|||||||
|
|
||||||
return availableFonts;
|
return availableFonts;
|
||||||
}
|
}
|
||||||
this.availableFonts = getAvailableFonts();
|
|
||||||
|
|
||||||
function checkParagraphStyleName() {
|
function checkParagraphStyleName() {
|
||||||
var newStyleName,
|
var newStyleName,
|
||||||
@ -299,28 +299,6 @@ define("webodf/editor/EditorSession", [
|
|||||||
return currentCommonStyleName;
|
return currentCommonStyleName;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Adds an annotation to the document based on the current selection
|
|
||||||
* @return {undefined}
|
|
||||||
*/
|
|
||||||
this.addAnnotation = function () {
|
|
||||||
var op = new ops.OpAddAnnotation(),
|
|
||||||
selection = self.getCursorSelection(),
|
|
||||||
length = selection.length,
|
|
||||||
position = selection.position;
|
|
||||||
|
|
||||||
position = length >= 0 ? position : position + length;
|
|
||||||
length = Math.abs(length);
|
|
||||||
|
|
||||||
op.init({
|
|
||||||
memberid: localMemberId,
|
|
||||||
position: position,
|
|
||||||
length: length,
|
|
||||||
name: localMemberId + Date.now()
|
|
||||||
});
|
|
||||||
session.enqueue(op);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.setCurrentParagraphStyle = function (value) {
|
this.setCurrentParagraphStyle = function (value) {
|
||||||
var op;
|
var op;
|
||||||
if (currentCommonStyleName !== value) {
|
if (currentCommonStyleName !== value) {
|
||||||
@ -330,7 +308,7 @@ define("webodf/editor/EditorSession", [
|
|||||||
position: self.getCursorPosition(),
|
position: self.getCursorPosition(),
|
||||||
styleName: value
|
styleName: value
|
||||||
});
|
});
|
||||||
session.enqueue(op);
|
session.enqueue([op]);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -345,7 +323,7 @@ define("webodf/editor/EditorSession", [
|
|||||||
tableColumnStyleName: tableColumnStyleName,
|
tableColumnStyleName: tableColumnStyleName,
|
||||||
tableCellStyleMatrix: tableCellStyleMatrix
|
tableCellStyleMatrix: tableCellStyleMatrix
|
||||||
});
|
});
|
||||||
session.enqueue(op);
|
session.enqueue([op]);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -409,7 +387,7 @@ define("webodf/editor/EditorSession", [
|
|||||||
setProperties: setProperties,
|
setProperties: setProperties,
|
||||||
removedProperties: (!removedProperties) ? {} : removedProperties
|
removedProperties: (!removedProperties) ? {} : removedProperties
|
||||||
});
|
});
|
||||||
session.enqueue(op);
|
session.enqueue([op]);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -447,7 +425,7 @@ define("webodf/editor/EditorSession", [
|
|||||||
styleFamily: 'paragraph',
|
styleFamily: 'paragraph',
|
||||||
setProperties: setProperties
|
setProperties: setProperties
|
||||||
});
|
});
|
||||||
session.enqueue(op);
|
session.enqueue([op]);
|
||||||
|
|
||||||
return newStyleName;
|
return newStyleName;
|
||||||
};
|
};
|
||||||
@ -460,7 +438,7 @@ define("webodf/editor/EditorSession", [
|
|||||||
styleName: styleName,
|
styleName: styleName,
|
||||||
styleFamily: 'paragraph'
|
styleFamily: 'paragraph'
|
||||||
});
|
});
|
||||||
session.enqueue(op);
|
session.enqueue([op]);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -469,7 +447,7 @@ define("webodf/editor/EditorSession", [
|
|||||||
* first font name for any given family is kept.
|
* first font name for any given family is kept.
|
||||||
* The elements of the array are objects containing the font's name and
|
* The elements of the array are objects containing the font's name and
|
||||||
* the family.
|
* the family.
|
||||||
* @return {Array.{Object}}
|
* @return {Array.<!Object>}
|
||||||
*/
|
*/
|
||||||
this.getDeclaredFonts = function () {
|
this.getDeclaredFonts = function () {
|
||||||
var fontMap = formatting.getFontMap(),
|
var fontMap = formatting.getFontMap(),
|
||||||
@ -523,6 +501,17 @@ define("webodf/editor/EditorSession", [
|
|||||||
undoManager.moveForward(1);
|
undoManager.moveForward(1);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {!string} mimetype
|
||||||
|
* @param {!string} content base64 encoded string
|
||||||
|
* @param {!number} width
|
||||||
|
* @param {!number} height
|
||||||
|
*/
|
||||||
|
this.insertImage = function (mimetype, content, width, height) {
|
||||||
|
self.sessionController.getTextManipulator().removeCurrentSelection();
|
||||||
|
self.sessionController.getImageManager().insertImage(mimetype, content, width, height);
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* @param {!function(!Object=)} callback, passing an error object in case of error
|
* @param {!function(!Object=)} callback, passing an error object in case of error
|
||||||
* @return {undefined}
|
* @return {undefined}
|
||||||
@ -573,12 +562,18 @@ define("webodf/editor/EditorSession", [
|
|||||||
if (err) {
|
if (err) {
|
||||||
callback(err);
|
callback(err);
|
||||||
} else {
|
} else {
|
||||||
self.sessionController.destroy(function(err) {
|
selectionViewManager.destroy(function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
callback(err);
|
callback(err);
|
||||||
} else {
|
} else {
|
||||||
delete self.sessionController;
|
self.sessionController.destroy(function(err) {
|
||||||
callback();
|
if (err) {
|
||||||
|
callback(err);
|
||||||
|
} else {
|
||||||
|
delete self.sessionController;
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -596,6 +591,14 @@ define("webodf/editor/EditorSession", [
|
|||||||
fontStyles.appendChild(document.createTextNode(fontsCSS));
|
fontStyles.appendChild(document.createTextNode(fontsCSS));
|
||||||
head.appendChild(fontStyles);
|
head.appendChild(fontStyles);
|
||||||
|
|
||||||
|
self.sessionController = new gui.SessionController(session, localMemberId, shadowCursor, {
|
||||||
|
directStylingEnabled: config.directStylingEnabled
|
||||||
|
});
|
||||||
|
caretManager = new gui.CaretManager(self.sessionController);
|
||||||
|
selectionViewManager = new gui.SelectionViewManager();
|
||||||
|
self.sessionView = new gui.SessionView(config.viewOptions, localMemberId, session, caretManager, selectionViewManager);
|
||||||
|
self.availableFonts = getAvailableFonts();
|
||||||
|
selectionViewManager.registerCursor(shadowCursor, true);
|
||||||
// Custom signals, that make sense in the Editor context. We do not want to expose webodf's ops signals to random bits of the editor UI.
|
// Custom signals, that make sense in the Editor context. We do not want to expose webodf's ops signals to random bits of the editor UI.
|
||||||
odtDocument.subscribe(ops.OdtDocument.signalCursorAdded, onCursorAdded);
|
odtDocument.subscribe(ops.OdtDocument.signalCursorAdded, onCursorAdded);
|
||||||
odtDocument.subscribe(ops.OdtDocument.signalCursorRemoved, onCursorRemoved);
|
odtDocument.subscribe(ops.OdtDocument.signalCursorRemoved, onCursorRemoved);
|
||||||
|
5
js/3rdparty/webodf/editor/MemberListView.js
vendored
5
js/3rdparty/webodf/editor/MemberListView.js
vendored
@ -10,6 +10,9 @@
|
|||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this code. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
* As additional permission under GNU AGPL version 3 section 7, you
|
* As additional permission under GNU AGPL version 3 section 7, you
|
||||||
* may distribute non-source (e.g., minimized or compacted) forms of
|
* may distribute non-source (e.g., minimized or compacted) forms of
|
||||||
* that code without the copy of the GNU GPL normally required by
|
* that code without the copy of the GNU GPL normally required by
|
||||||
@ -30,7 +33,7 @@
|
|||||||
* This license applies to this entire compilation.
|
* This license applies to this entire compilation.
|
||||||
* @licend
|
* @licend
|
||||||
* @source: http://www.webodf.org/
|
* @source: http://www.webodf.org/
|
||||||
* @source: http://gitorious.org/webodf/webodf/
|
* @source: https://github.com/kogmbh/WebODF/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global define,runtime */
|
/*global define,runtime */
|
||||||
|
83
js/3rdparty/webodf/editor/Tools.js
vendored
83
js/3rdparty/webodf/editor/Tools.js
vendored
@ -9,6 +9,9 @@
|
|||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this code. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
* As additional permission under GNU AGPL version 3 section 7, you
|
* As additional permission under GNU AGPL version 3 section 7, you
|
||||||
* may distribute non-source (e.g., minimized or compacted) forms of
|
* may distribute non-source (e.g., minimized or compacted) forms of
|
||||||
* that code without the copy of the GNU GPL normally required by
|
* that code without the copy of the GNU GPL normally required by
|
||||||
@ -29,10 +32,10 @@
|
|||||||
* This license applies to this entire compilation.
|
* This license applies to this entire compilation.
|
||||||
* @licend
|
* @licend
|
||||||
* @source: http://www.webodf.org/
|
* @source: http://www.webodf.org/
|
||||||
* @source: http://gitorious.org/webodf/webodf/
|
* @source: https://github.com/kogmbh/WebODF/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global define,document,require */
|
/*global define,document,require,ops */
|
||||||
|
|
||||||
define("webodf/editor/Tools", [
|
define("webodf/editor/Tools", [
|
||||||
"dojo/ready",
|
"dojo/ready",
|
||||||
@ -45,29 +48,48 @@ define("webodf/editor/Tools", [
|
|||||||
"webodf/editor/widgets/simpleStyles",
|
"webodf/editor/widgets/simpleStyles",
|
||||||
"webodf/editor/widgets/undoRedoMenu",
|
"webodf/editor/widgets/undoRedoMenu",
|
||||||
"webodf/editor/widgets/toolbarWidgets/currentStyle",
|
"webodf/editor/widgets/toolbarWidgets/currentStyle",
|
||||||
|
"webodf/editor/widgets/annotation",
|
||||||
"webodf/editor/widgets/paragraphStylesDialog",
|
"webodf/editor/widgets/paragraphStylesDialog",
|
||||||
"webodf/editor/widgets/zoomSlider"],
|
"webodf/editor/widgets/imageInserter",
|
||||||
function (ready, MenuItem, DropDownMenu, Button, DropDownButton, Toolbar, ParagraphAlignment, SimpleStyles, UndoRedoMenu, CurrentStyle, ParagraphStylesDialog, ZoomSlider) {
|
"webodf/editor/widgets/zoomSlider",
|
||||||
|
"webodf/editor/EditorSession"],
|
||||||
|
function (ready, MenuItem, DropDownMenu, Button, DropDownButton, Toolbar, ParagraphAlignment, SimpleStyles, UndoRedoMenu, CurrentStyle, AnnotationControl, ParagraphStylesDialog, ImageInserter, ZoomSlider, EditorSession) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
return function Tools(args) {
|
return function Tools(args) {
|
||||||
var translator = document.translator,
|
var tr = runtime.tr,
|
||||||
onToolDone = args.onToolDone,
|
onToolDone = args.onToolDone,
|
||||||
loadOdtFile = args.loadOdtFile,
|
loadOdtFile = args.loadOdtFile,
|
||||||
saveOdtFile = args.saveOdtFile,
|
saveOdtFile = args.saveOdtFile,
|
||||||
close = args.close,
|
close = args.close,
|
||||||
toolbar,
|
toolbar,
|
||||||
loadButton, saveButton, annotateButton, closeButton,
|
loadButton, saveButton, closeButton,
|
||||||
formatDropDownMenu, formatMenuButton,
|
formatDropDownMenu, formatMenuButton,
|
||||||
paragraphStylesMenuItem, paragraphStylesDialog, simpleStyles, currentStyle,
|
paragraphStylesMenuItem, paragraphStylesDialog, simpleStyles, currentStyle,
|
||||||
zoomSlider,
|
zoomSlider,
|
||||||
undoRedoMenu,
|
undoRedoMenu,
|
||||||
editorSession,
|
editorSession,
|
||||||
paragraphAlignment,
|
paragraphAlignment,
|
||||||
|
imageInserter,
|
||||||
|
annotationControl,
|
||||||
sessionSubscribers = [];
|
sessionSubscribers = [];
|
||||||
|
|
||||||
|
function handleCursorMoved(cursor) {
|
||||||
|
var disabled = cursor.getSelectionType() === ops.OdtCursor.RegionSelection;
|
||||||
|
if (formatMenuButton) {
|
||||||
|
formatMenuButton.setAttribute('disabled', disabled);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function setEditorSession(session) {
|
function setEditorSession(session) {
|
||||||
|
if (editorSession) {
|
||||||
|
editorSession.unsubscribe(EditorSession.signalCursorMoved, handleCursorMoved);
|
||||||
|
}
|
||||||
editorSession = session;
|
editorSession = session;
|
||||||
|
if (editorSession) {
|
||||||
|
editorSession.subscribe(EditorSession.signalCursorMoved, handleCursorMoved);
|
||||||
|
}
|
||||||
|
|
||||||
sessionSubscribers.forEach(function (subscriber) {
|
sessionSubscribers.forEach(function (subscriber) {
|
||||||
subscriber.setEditorSession(editorSession);
|
subscriber.setEditorSession(editorSession);
|
||||||
});
|
});
|
||||||
@ -80,8 +102,18 @@ define("webodf/editor/Tools", [
|
|||||||
* @return {undefined}
|
* @return {undefined}
|
||||||
*/
|
*/
|
||||||
this.destroy = function (callback) {
|
this.destroy = function (callback) {
|
||||||
// TODO: investigate what else needs to be done
|
// TODO:
|
||||||
toolbar.destroyRecursive(true);
|
// 1. We don't want to use `document`
|
||||||
|
// 2. We would like to avoid deleting all widgets
|
||||||
|
// under document.body because this might interfere with
|
||||||
|
// other apps that use the editor not-in-an-iframe,
|
||||||
|
// but dojo always puts its dialogs below the body,
|
||||||
|
// so this works for now. Perhaps will be obsoleted
|
||||||
|
// once we move to a better widget toolkit
|
||||||
|
var widgets = dijit.findWidgets(document.body);
|
||||||
|
dojo.forEach(widgets, function(w) {
|
||||||
|
w.destroyRecursive(false);
|
||||||
|
});
|
||||||
callback();
|
callback();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -100,18 +132,12 @@ define("webodf/editor/Tools", [
|
|||||||
|
|
||||||
// Add annotation
|
// Add annotation
|
||||||
if (args.annotationsEnabled) {
|
if (args.annotationsEnabled) {
|
||||||
annotateButton = new Button({
|
annotationControl = new AnnotationControl(function (widget) {
|
||||||
label: translator('annotate'),
|
widget.placeAt(toolbar);
|
||||||
showLabel: false,
|
widget.startup();
|
||||||
iconClass: 'dijitIconBookmark',
|
|
||||||
onClick: function () {
|
|
||||||
if (editorSession) {
|
|
||||||
editorSession.addAnnotation();
|
|
||||||
onToolDone();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
annotateButton.placeAt(toolbar);
|
sessionSubscribers.push(annotationControl);
|
||||||
|
annotationControl.onToolDone = onToolDone;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Simple Style Selector [B, I, U, S]
|
// Simple Style Selector [B, I, U, S]
|
||||||
@ -154,7 +180,7 @@ define("webodf/editor/Tools", [
|
|||||||
// Load
|
// Load
|
||||||
if (loadOdtFile) {
|
if (loadOdtFile) {
|
||||||
loadButton = new Button({
|
loadButton = new Button({
|
||||||
label: translator('open'),
|
label: tr('Open'),
|
||||||
showLabel: false,
|
showLabel: false,
|
||||||
iconClass: 'dijitIcon dijitIconFolderOpen',
|
iconClass: 'dijitIcon dijitIconFolderOpen',
|
||||||
style: {
|
style: {
|
||||||
@ -170,7 +196,7 @@ define("webodf/editor/Tools", [
|
|||||||
// Save
|
// Save
|
||||||
if (saveOdtFile) {
|
if (saveOdtFile) {
|
||||||
saveButton = new Button({
|
saveButton = new Button({
|
||||||
label: translator('save'),
|
label: tr('Save'),
|
||||||
showLabel: false,
|
showLabel: false,
|
||||||
iconClass: 'dijitEditorIcon dijitEditorIconSave',
|
iconClass: 'dijitEditorIcon dijitEditorIconSave',
|
||||||
style: {
|
style: {
|
||||||
@ -187,7 +213,7 @@ define("webodf/editor/Tools", [
|
|||||||
// Format menu
|
// Format menu
|
||||||
formatDropDownMenu = new DropDownMenu({});
|
formatDropDownMenu = new DropDownMenu({});
|
||||||
paragraphStylesMenuItem = new MenuItem({
|
paragraphStylesMenuItem = new MenuItem({
|
||||||
label: translator("paragraph_DDD")
|
label: tr("Paragraph...")
|
||||||
});
|
});
|
||||||
formatDropDownMenu.addChild(paragraphStylesMenuItem);
|
formatDropDownMenu.addChild(paragraphStylesMenuItem);
|
||||||
|
|
||||||
@ -204,7 +230,7 @@ define("webodf/editor/Tools", [
|
|||||||
|
|
||||||
formatMenuButton = new DropDownButton({
|
formatMenuButton = new DropDownButton({
|
||||||
dropDown: formatDropDownMenu,
|
dropDown: formatDropDownMenu,
|
||||||
label: translator('format'),
|
label: tr('Format'),
|
||||||
iconClass: "dijitIconEditTask",
|
iconClass: "dijitIconEditTask",
|
||||||
style: {
|
style: {
|
||||||
float: 'left'
|
float: 'left'
|
||||||
@ -212,9 +238,18 @@ define("webodf/editor/Tools", [
|
|||||||
});
|
});
|
||||||
formatMenuButton.placeAt(toolbar);
|
formatMenuButton.placeAt(toolbar);
|
||||||
|
|
||||||
|
if (args.imageInsertingEnabled) {
|
||||||
|
imageInserter = new ImageInserter(function (widget) {
|
||||||
|
widget.placeAt(toolbar);
|
||||||
|
widget.startup();
|
||||||
|
});
|
||||||
|
sessionSubscribers.push(imageInserter);
|
||||||
|
imageInserter.onToolDone = onToolDone;
|
||||||
|
}
|
||||||
|
|
||||||
if (close) {
|
if (close) {
|
||||||
closeButton = new Button({
|
closeButton = new Button({
|
||||||
label: translator('close'),
|
label: tr('Close'),
|
||||||
showLabel: false,
|
showLabel: false,
|
||||||
iconClass: 'dijitEditorIcon dijitEditorIconCancel',
|
iconClass: 'dijitEditorIcon dijitEditorIconCancel',
|
||||||
style: {
|
style: {
|
||||||
|
@ -10,6 +10,9 @@
|
|||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this code. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
* As additional permission under GNU AGPL version 3 section 7, you
|
* As additional permission under GNU AGPL version 3 section 7, you
|
||||||
* may distribute non-source (e.g., minimized or compacted) forms of
|
* may distribute non-source (e.g., minimized or compacted) forms of
|
||||||
* that code without the copy of the GNU GPL normally required by
|
* that code without the copy of the GNU GPL normally required by
|
||||||
@ -30,7 +33,7 @@
|
|||||||
* This license applies to this entire compilation.
|
* This license applies to this entire compilation.
|
||||||
* @licend
|
* @licend
|
||||||
* @source: http://www.webodf.org/
|
* @source: http://www.webodf.org/
|
||||||
* @source: http://gitorious.org/webodf/webodf/
|
* @source: https://github.com/kogmbh/WebODF/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define({
|
define({
|
||||||
|
8
js/3rdparty/webodf/editor/nls/myResources.js
vendored
8
js/3rdparty/webodf/editor/nls/myResources.js
vendored
@ -9,6 +9,9 @@
|
|||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this code. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
* As additional permission under GNU AGPL version 3 section 7, you
|
* As additional permission under GNU AGPL version 3 section 7, you
|
||||||
* may distribute non-source (e.g., minimized or compacted) forms of
|
* may distribute non-source (e.g., minimized or compacted) forms of
|
||||||
* that code without the copy of the GNU GPL normally required by
|
* that code without the copy of the GNU GPL normally required by
|
||||||
@ -29,7 +32,7 @@
|
|||||||
* This license applies to this entire compilation.
|
* This license applies to this entire compilation.
|
||||||
* @licend
|
* @licend
|
||||||
* @source: http://www.webodf.org/
|
* @source: http://www.webodf.org/
|
||||||
* @source: http://gitorious.org/webodf/webodf/
|
* @source: https://github.com/kogmbh/WebODF/
|
||||||
*/
|
*/
|
||||||
define({
|
define({
|
||||||
root: {
|
root: {
|
||||||
@ -91,7 +94,8 @@ define({
|
|||||||
color: "Color",
|
color: "Color",
|
||||||
text: "Text",
|
text: "Text",
|
||||||
background: "Background",
|
background: "Background",
|
||||||
defaultStyle: "Default Style"
|
defaultStyle: "Default Style",
|
||||||
|
insertImage: "Insert Image"
|
||||||
},
|
},
|
||||||
|
|
||||||
de: true,
|
de: true,
|
||||||
|
@ -9,6 +9,9 @@
|
|||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this code. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
* As additional permission under GNU AGPL version 3 section 7, you
|
* As additional permission under GNU AGPL version 3 section 7, you
|
||||||
* may distribute non-source (e.g., minimized or compacted) forms of
|
* may distribute non-source (e.g., minimized or compacted) forms of
|
||||||
* that code without the copy of the GNU GPL normally required by
|
* that code without the copy of the GNU GPL normally required by
|
||||||
@ -29,7 +32,7 @@
|
|||||||
* This license applies to this entire compilation.
|
* This license applies to this entire compilation.
|
||||||
* @licend
|
* @licend
|
||||||
* @source: http://www.webodf.org/
|
* @source: http://www.webodf.org/
|
||||||
* @source: http://gitorious.org/webodf/webodf/
|
* @source: https://github.com/kogmbh/WebODF/
|
||||||
*/
|
*/
|
||||||
define({
|
define({
|
||||||
file: 'досье',
|
file: 'досье',
|
||||||
|
@ -10,6 +10,9 @@
|
|||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this code. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
* As additional permission under GNU AGPL version 3 section 7, you
|
* As additional permission under GNU AGPL version 3 section 7, you
|
||||||
* may distribute non-source (e.g., minimized or compacted) forms of
|
* may distribute non-source (e.g., minimized or compacted) forms of
|
||||||
* that code without the copy of the GNU GPL normally required by
|
* that code without the copy of the GNU GPL normally required by
|
||||||
@ -30,7 +33,7 @@
|
|||||||
* This license applies to this entire compilation.
|
* This license applies to this entire compilation.
|
||||||
* @licend
|
* @licend
|
||||||
* @source: http://www.webodf.org/
|
* @source: http://www.webodf.org/
|
||||||
* @source: http://gitorious.org/webodf/webodf/
|
* @source: https://github.com/kogmbh/WebODF/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global ops, SessionList*/
|
/*global ops, SessionList*/
|
||||||
@ -38,7 +41,7 @@
|
|||||||
/**
|
/**
|
||||||
* @interface
|
* @interface
|
||||||
*/
|
*/
|
||||||
ServerFactory = function Server() {"use strict"; };
|
function ServerFactory() {"use strict"; };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {!ops.Server}
|
* @return {!ops.Server}
|
||||||
|
@ -3,34 +3,24 @@
|
|||||||
* Copyright (C) 2013 KO GmbH <copyright@kogmbh.com>
|
* Copyright (C) 2013 KO GmbH <copyright@kogmbh.com>
|
||||||
*
|
*
|
||||||
* @licstart
|
* @licstart
|
||||||
* The JavaScript code in this page is free software: you can redistribute it
|
* This file is part of WebODF.
|
||||||
* and/or modify it under the terms of the GNU Affero General Public License
|
|
||||||
* (GNU AGPL) as published by the Free Software Foundation, either version 3 of
|
|
||||||
* the License, or (at your option) any later version. The code is distributed
|
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
|
||||||
*
|
*
|
||||||
* As additional permission under GNU AGPL version 3 section 7, you
|
* WebODF is free software: you can redistribute it and/or modify it
|
||||||
* may distribute non-source (e.g., minimized or compacted) forms of
|
* under the terms of the GNU Affero General Public License (GNU AGPL)
|
||||||
* that code without the copy of the GNU GPL normally required by
|
* as published by the Free Software Foundation, either version 3 of
|
||||||
* section 4, provided you include this license notice and a URL
|
* the License, or (at your option) any later version.
|
||||||
* through which recipients can access the Corresponding Source.
|
|
||||||
*
|
*
|
||||||
* As a special exception to the AGPL, any HTML file which merely makes function
|
* WebODF is distributed in the hope that it will be useful, but
|
||||||
* calls to this code, and for that purpose includes it by reference shall be
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* deemed a separate work for copyright law purposes. In addition, the copyright
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* holders of this code give you permission to combine this code with free
|
* GNU Affero General Public License for more details.
|
||||||
* software libraries that are released under the GNU LGPL. You may copy and
|
|
||||||
* distribute such a system following the terms of the GNU AGPL for this code
|
|
||||||
* and the LGPL for the libraries. If you modify this code, you may extend this
|
|
||||||
* exception to your version of the code, but you are not obligated to do so.
|
|
||||||
* If you do not wish to do so, delete this exception statement from your
|
|
||||||
* version.
|
|
||||||
*
|
*
|
||||||
* This license applies to this entire compilation.
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with WebODF. If not, see <http://www.gnu.org/licenses/>.
|
||||||
* @licend
|
* @licend
|
||||||
|
*
|
||||||
* @source: http://www.webodf.org/
|
* @source: http://www.webodf.org/
|
||||||
* @source: http://gitorious.org/webodf/webodf/
|
* @source: https://github.com/kogmbh/WebODF/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global define, require, OC*/
|
/*global define, require, OC*/
|
||||||
|
@ -3,34 +3,24 @@
|
|||||||
* Copyright (C) 2013 KO GmbH <copyright@kogmbh.com>
|
* Copyright (C) 2013 KO GmbH <copyright@kogmbh.com>
|
||||||
*
|
*
|
||||||
* @licstart
|
* @licstart
|
||||||
* The JavaScript code in this page is free software: you can redistribute it
|
* This file is part of WebODF.
|
||||||
* and/or modify it under the terms of the GNU Affero General Public License
|
|
||||||
* (GNU AGPL) as published by the Free Software Foundation, either version 3 of
|
|
||||||
* the License, or (at your option) any later version. The code is distributed
|
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
|
||||||
*
|
*
|
||||||
* As additional permission under GNU AGPL version 3 section 7, you
|
* WebODF is free software: you can redistribute it and/or modify it
|
||||||
* may distribute non-source (e.g., minimized or compacted) forms of
|
* under the terms of the GNU Affero General Public License (GNU AGPL)
|
||||||
* that code without the copy of the GNU GPL normally required by
|
* as published by the Free Software Foundation, either version 3 of
|
||||||
* section 4, provided you include this license notice and a URL
|
* the License, or (at your option) any later version.
|
||||||
* through which recipients can access the Corresponding Source.
|
|
||||||
*
|
*
|
||||||
* As a special exception to the AGPL, any HTML file which merely makes function
|
* WebODF is distributed in the hope that it will be useful, but
|
||||||
* calls to this code, and for that purpose includes it by reference shall be
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* deemed a separate work for copyright law purposes. In addition, the copyright
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* holders of this code give you permission to combine this code with free
|
* GNU Affero General Public License for more details.
|
||||||
* software libraries that are released under the GNU LGPL. You may copy and
|
|
||||||
* distribute such a system following the terms of the GNU AGPL for this code
|
|
||||||
* and the LGPL for the libraries. If you modify this code, you may extend this
|
|
||||||
* exception to your version of the code, but you are not obligated to do so.
|
|
||||||
* If you do not wish to do so, delete this exception statement from your
|
|
||||||
* version.
|
|
||||||
*
|
*
|
||||||
* This license applies to this entire compilation.
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with WebODF. If not, see <http://www.gnu.org/licenses/>.
|
||||||
* @licend
|
* @licend
|
||||||
|
*
|
||||||
* @source: http://www.webodf.org/
|
* @source: http://www.webodf.org/
|
||||||
* @source: http://gitorious.org/webodf/webodf/
|
* @source: https://github.com/kogmbh/WebODF/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global runtime, ops*/
|
/*global runtime, ops*/
|
||||||
|
@ -3,34 +3,24 @@
|
|||||||
* Copyright (C) 2013 KO GmbH <copyright@kogmbh.com>
|
* Copyright (C) 2013 KO GmbH <copyright@kogmbh.com>
|
||||||
*
|
*
|
||||||
* @licstart
|
* @licstart
|
||||||
* The JavaScript code in this page is free software: you can redistribute it
|
* This file is part of WebODF.
|
||||||
* and/or modify it under the terms of the GNU Affero General Public License
|
|
||||||
* (GNU AGPL) as published by the Free Software Foundation, either version 3 of
|
|
||||||
* the License, or (at your option) any later version. The code is distributed
|
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
|
||||||
*
|
*
|
||||||
* As additional permission under GNU AGPL version 3 section 7, you
|
* WebODF is free software: you can redistribute it and/or modify it
|
||||||
* may distribute non-source (e.g., minimized or compacted) forms of
|
* under the terms of the GNU Affero General Public License (GNU AGPL)
|
||||||
* that code without the copy of the GNU GPL normally required by
|
* as published by the Free Software Foundation, either version 3 of
|
||||||
* section 4, provided you include this license notice and a URL
|
* the License, or (at your option) any later version.
|
||||||
* through which recipients can access the Corresponding Source.
|
|
||||||
*
|
*
|
||||||
* As a special exception to the AGPL, any HTML file which merely makes function
|
* WebODF is distributed in the hope that it will be useful, but
|
||||||
* calls to this code, and for that purpose includes it by reference shall be
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* deemed a separate work for copyright law purposes. In addition, the copyright
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* holders of this code give you permission to combine this code with free
|
* GNU Affero General Public License for more details.
|
||||||
* software libraries that are released under the GNU LGPL. You may copy and
|
|
||||||
* distribute such a system following the terms of the GNU AGPL for this code
|
|
||||||
* and the LGPL for the libraries. If you modify this code, you may extend this
|
|
||||||
* exception to your version of the code, but you are not obligated to do so.
|
|
||||||
* If you do not wish to do so, delete this exception statement from your
|
|
||||||
* version.
|
|
||||||
*
|
*
|
||||||
* This license applies to this entire compilation.
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with WebODF. If not, see <http://www.gnu.org/licenses/>.
|
||||||
* @licend
|
* @licend
|
||||||
|
*
|
||||||
* @source: http://www.webodf.org/
|
* @source: http://www.webodf.org/
|
||||||
* @source: http://gitorious.org/webodf/webodf/
|
* @source: https://github.com/kogmbh/WebODF/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global runtime, ops*/
|
/*global runtime, ops*/
|
||||||
@ -81,8 +71,6 @@ define("webodf/editor/server/pullbox/OperationRouter", [], function () {
|
|||||||
unplayedServerOpspecQueue = [],
|
unplayedServerOpspecQueue = [],
|
||||||
/** @type {!Array.<!Function>} sync request callbacks which should be called after the received ops have been applied server */
|
/** @type {!Array.<!Function>} sync request callbacks which should be called after the received ops have been applied server */
|
||||||
uncalledSyncRequestCallbacksQueue = [],
|
uncalledSyncRequestCallbacksQueue = [],
|
||||||
/** @type {!Array.<!function(!boolean):undefined>} ops created since the last sync call to the server */
|
|
||||||
hasLocalUnsyncedOpsStateSubscribers = [],
|
|
||||||
/**@type{!boolean}*/
|
/**@type{!boolean}*/
|
||||||
hasLocalUnsyncedOps = false,
|
hasLocalUnsyncedOps = false,
|
||||||
/**@type{!boolean} tells if any local ops have been modifying ops */
|
/**@type{!boolean} tells if any local ops have been modifying ops */
|
||||||
@ -92,10 +80,11 @@ define("webodf/editor/server/pullbox/OperationRouter", [], function () {
|
|||||||
/**@const*/syncOpsDelay = 3000,
|
/**@const*/syncOpsDelay = 3000,
|
||||||
/**@const*/idleDelay = 5000;
|
/**@const*/idleDelay = 5000;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return {undefined}
|
||||||
|
*/
|
||||||
function updateHasLocalUnsyncedOpsState() {
|
function updateHasLocalUnsyncedOpsState() {
|
||||||
var i,
|
var hasLocalUnsyncedOpsNow = (unsyncedClientOpspecQueue.length > 0);
|
||||||
hasLocalUnsyncedOpsNow = (unsyncedClientOpspecQueue.length > 0);
|
|
||||||
|
|
||||||
// no change?
|
// no change?
|
||||||
if (hasLocalUnsyncedOps === hasLocalUnsyncedOpsNow) {
|
if (hasLocalUnsyncedOps === hasLocalUnsyncedOpsNow) {
|
||||||
@ -103,45 +92,6 @@ define("webodf/editor/server/pullbox/OperationRouter", [], function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
hasLocalUnsyncedOps = hasLocalUnsyncedOpsNow;
|
hasLocalUnsyncedOps = hasLocalUnsyncedOpsNow;
|
||||||
for (i=0; i<hasLocalUnsyncedOpsStateSubscribers.length; i+=1) {
|
|
||||||
hasLocalUnsyncedOpsStateSubscribers[i](hasLocalUnsyncedOps);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {!Array.<!Object>} opspecs
|
|
||||||
* @return {!Array.<!Object>}
|
|
||||||
*/
|
|
||||||
function compressOpSpecs(opspecs) {
|
|
||||||
var i, j, op,
|
|
||||||
result = [];
|
|
||||||
|
|
||||||
i = 0;
|
|
||||||
while (i < opspecs.length) {
|
|
||||||
// use factory to create an instance, and playback!
|
|
||||||
op = operationFactory.create(opspecs[i]);
|
|
||||||
// is known op and can do merge?
|
|
||||||
if (op !== null && op.merge) {
|
|
||||||
// go over the following and try to merge them
|
|
||||||
for (j = i+1; j < opspecs.length; j += 1) {
|
|
||||||
if (!op.merge(opspecs[j])) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
runtime.log("Merged: "+opspecs[i].optype+" with "+opspecs[j].optype);
|
|
||||||
}
|
|
||||||
// add the resulting op to the results
|
|
||||||
result.push(op.spec());
|
|
||||||
// and continue with the one which could not be merged, or behind end
|
|
||||||
i = j;
|
|
||||||
} else {
|
|
||||||
// just pass on
|
|
||||||
result.push(opspecs[i]);
|
|
||||||
i += 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
runtime.log("Merged: from "+opspecs.length+" to "+result.length+" specs");
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -307,12 +257,12 @@ runtime.log("OperationRouter: sending sync_ops call");
|
|||||||
if (response.ops.length > 0) {
|
if (response.ops.length > 0) {
|
||||||
// no new locally in the meantime?
|
// no new locally in the meantime?
|
||||||
if (unsyncedClientOpspecQueue.length === 0) {
|
if (unsyncedClientOpspecQueue.length === 0) {
|
||||||
receiveOpSpecsFromNetwork(compressOpSpecs(response.ops), syncRequestCallbacksArray);
|
receiveOpSpecsFromNetwork(response.ops, syncRequestCallbacksArray);
|
||||||
} else {
|
} else {
|
||||||
// transform server ops against new local ones and apply,
|
// transform server ops against new local ones and apply,
|
||||||
// transform and send new local ops to server
|
// transform and send new local ops to server
|
||||||
runtime.log("meh, have new ops locally meanwhile, have to do transformations.");
|
runtime.log("meh, have new ops locally meanwhile, have to do transformations.");
|
||||||
hasUnresolvableConflict = !handleOpsSyncConflict(compressOpSpecs(response.ops));
|
hasUnresolvableConflict = !handleOpsSyncConflict(response.ops);
|
||||||
syncRequestCallbacksQueue = syncRequestCallbacksArray.concat(syncRequestCallbacksQueue);
|
syncRequestCallbacksQueue = syncRequestCallbacksArray.concat(syncRequestCallbacksQueue);
|
||||||
}
|
}
|
||||||
// and note server state
|
// and note server state
|
||||||
@ -333,7 +283,7 @@ runtime.log("OperationRouter: sending sync_ops call");
|
|||||||
// transform server ops against new local ones and apply,
|
// transform server ops against new local ones and apply,
|
||||||
// transform and request new send new local ops to server
|
// transform and request new send new local ops to server
|
||||||
runtime.log("meh, server has new ops meanwhile, have to do transformations.");
|
runtime.log("meh, server has new ops meanwhile, have to do transformations.");
|
||||||
hasUnresolvableConflict = !handleOpsSyncConflict(compressOpSpecs(response.ops));
|
hasUnresolvableConflict = !handleOpsSyncConflict(response.ops);
|
||||||
// and note server state
|
// and note server state
|
||||||
lastServerSeq = response.head_seq;
|
lastServerSeq = response.head_seq;
|
||||||
// try again instantly
|
// try again instantly
|
||||||
@ -441,13 +391,10 @@ runtime.log("OperationRouter: instant opsSync requested");
|
|||||||
/**
|
/**
|
||||||
* Brings the locally created operations into the game.
|
* Brings the locally created operations into the game.
|
||||||
*
|
*
|
||||||
* @param {!ops.Operation} op
|
* @param {!Array.<!ops.Operation>} operations
|
||||||
* @return {undefined}
|
* @return {undefined}
|
||||||
*/
|
*/
|
||||||
this.push = function (op) {
|
this.push = function (operations) {
|
||||||
var timedOp,
|
|
||||||
opspec = op.spec();
|
|
||||||
|
|
||||||
if (hasUnresolvableConflict) {
|
if (hasUnresolvableConflict) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -459,17 +406,22 @@ runtime.log("OperationRouter: instant opsSync requested");
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// note if any local ops modified TODO: find less fragile way, perhaps have the operationFactory check it?
|
operations.forEach(function(op) {
|
||||||
hasPushedModificationOps = hasPushedModificationOps || !/^(AddCursor|MoveCursor|RemoveCursor)$/.test(opspec.optype);
|
var timedOp,
|
||||||
|
opspec = op.spec();
|
||||||
|
|
||||||
// apply locally
|
// note if any local ops modified TODO: find less fragile way, perhaps have the operationFactory check it?
|
||||||
opspec.timestamp = (new Date()).getTime();
|
hasPushedModificationOps = hasPushedModificationOps || !/^(AddCursor|MoveCursor|RemoveCursor)$/.test(opspec.optype);
|
||||||
timedOp = operationFactory.create(opspec);
|
|
||||||
|
|
||||||
playbackFunction(timedOp);
|
// apply locally
|
||||||
|
opspec.timestamp = (new Date()).getTime();
|
||||||
|
timedOp = operationFactory.create(opspec);
|
||||||
|
|
||||||
// send to server
|
playbackFunction(timedOp);
|
||||||
unsyncedClientOpspecQueue.push(opspec);
|
|
||||||
|
// send to server
|
||||||
|
unsyncedClientOpspecQueue.push(opspec);
|
||||||
|
});
|
||||||
|
|
||||||
triggerPushingOps();
|
triggerPushingOps();
|
||||||
|
|
||||||
@ -502,40 +454,5 @@ runtime.log("OperationRouter: instant opsSync requested");
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.getHasLocalUnsyncedOpsAndUpdates = function (subscriber) {
|
|
||||||
var i;
|
|
||||||
|
|
||||||
// detect double subscription
|
|
||||||
for (i=0; i<hasLocalUnsyncedOpsStateSubscribers.length; i+=1) {
|
|
||||||
if (subscribers[i] === subscriber) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (i < hasLocalUnsyncedOpsStateSubscribers.length) {
|
|
||||||
// already subscribed
|
|
||||||
runtime.log("double subscription request in PullBoxMemberModel::getHasLocalUnsyncedOpsAndUpdates");
|
|
||||||
} else {
|
|
||||||
// subscribe
|
|
||||||
hasLocalUnsyncedOpsStateSubscribers.push(subscriber);
|
|
||||||
}
|
|
||||||
|
|
||||||
subscriber(hasLocalUnsyncedOps);
|
|
||||||
};
|
|
||||||
|
|
||||||
/*jslint emptyblock: true, unparam: true*/
|
|
||||||
this.unsubscribeHasLocalUnsyncedOpsUpdates = function (subscriber) {
|
|
||||||
var i;
|
|
||||||
|
|
||||||
for (i=0; i<hasLocalUnsyncedOpsStateSubscribers.length; i+=1) {
|
|
||||||
if (hasLocalUnsyncedOpsStateSubscribers[i] === subscriber) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
runtime.assert((i < hasLocalUnsyncedOpsStateSubscribers.length),
|
|
||||||
"tried to unsubscribe when not subscribed in PullBoxMemberModel::getHasLocalUnsyncedOpsAndUpdates");
|
|
||||||
|
|
||||||
hasLocalUnsyncedOpsStateSubscribers.splice(i,1);
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
@ -3,34 +3,24 @@
|
|||||||
* Copyright (C) 2013 KO GmbH <copyright@kogmbh.com>
|
* Copyright (C) 2013 KO GmbH <copyright@kogmbh.com>
|
||||||
*
|
*
|
||||||
* @licstart
|
* @licstart
|
||||||
* The JavaScript code in this page is free software: you can redistribute it
|
* This file is part of WebODF.
|
||||||
* and/or modify it under the terms of the GNU Affero General Public License
|
|
||||||
* (GNU AGPL) as published by the Free Software Foundation, either version 3 of
|
|
||||||
* the License, or (at your option) any later version. The code is distributed
|
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
|
||||||
*
|
*
|
||||||
* As additional permission under GNU AGPL version 3 section 7, you
|
* WebODF is free software: you can redistribute it and/or modify it
|
||||||
* may distribute non-source (e.g., minimized or compacted) forms of
|
* under the terms of the GNU Affero General Public License (GNU AGPL)
|
||||||
* that code without the copy of the GNU GPL normally required by
|
* as published by the Free Software Foundation, either version 3 of
|
||||||
* section 4, provided you include this license notice and a URL
|
* the License, or (at your option) any later version.
|
||||||
* through which recipients can access the Corresponding Source.
|
|
||||||
*
|
*
|
||||||
* As a special exception to the AGPL, any HTML file which merely makes function
|
* WebODF is distributed in the hope that it will be useful, but
|
||||||
* calls to this code, and for that purpose includes it by reference shall be
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* deemed a separate work for copyright law purposes. In addition, the copyright
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* holders of this code give you permission to combine this code with free
|
* GNU Affero General Public License for more details.
|
||||||
* software libraries that are released under the GNU LGPL. You may copy and
|
|
||||||
* distribute such a system following the terms of the GNU AGPL for this code
|
|
||||||
* and the LGPL for the libraries. If you modify this code, you may extend this
|
|
||||||
* exception to your version of the code, but you are not obligated to do so.
|
|
||||||
* If you do not wish to do so, delete this exception statement from your
|
|
||||||
* version.
|
|
||||||
*
|
*
|
||||||
* This license applies to this entire compilation.
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with WebODF. If not, see <http://www.gnu.org/licenses/>.
|
||||||
* @licend
|
* @licend
|
||||||
|
*
|
||||||
* @source: http://www.webodf.org/
|
* @source: http://www.webodf.org/
|
||||||
* @source: http://gitorious.org/webodf/webodf/
|
* @source: https://github.com/kogmbh/WebODF/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global XMLHttpRequest, runtime, core, ops*/
|
/*global XMLHttpRequest, runtime, core, ops*/
|
||||||
|
@ -3,34 +3,24 @@
|
|||||||
* Copyright (C) 2013 KO GmbH <copyright@kogmbh.com>
|
* Copyright (C) 2013 KO GmbH <copyright@kogmbh.com>
|
||||||
*
|
*
|
||||||
* @licstart
|
* @licstart
|
||||||
* The JavaScript code in this page is free software: you can redistribute it
|
* This file is part of WebODF.
|
||||||
* and/or modify it under the terms of the GNU Affero General Public License
|
|
||||||
* (GNU AGPL) as published by the Free Software Foundation, either version 3 of
|
|
||||||
* the License, or (at your option) any later version. The code is distributed
|
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
|
||||||
*
|
*
|
||||||
* As additional permission under GNU AGPL version 3 section 7, you
|
* WebODF is free software: you can redistribute it and/or modify it
|
||||||
* may distribute non-source (e.g., minimized or compacted) forms of
|
* under the terms of the GNU Affero General Public License (GNU AGPL)
|
||||||
* that code without the copy of the GNU GPL normally required by
|
* as published by the Free Software Foundation, either version 3 of
|
||||||
* section 4, provided you include this license notice and a URL
|
* the License, or (at your option) any later version.
|
||||||
* through which recipients can access the Corresponding Source.
|
|
||||||
*
|
*
|
||||||
* As a special exception to the AGPL, any HTML file which merely makes function
|
* WebODF is distributed in the hope that it will be useful, but
|
||||||
* calls to this code, and for that purpose includes it by reference shall be
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* deemed a separate work for copyright law purposes. In addition, the copyright
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* holders of this code give you permission to combine this code with free
|
* GNU Affero General Public License for more details.
|
||||||
* software libraries that are released under the GNU LGPL. You may copy and
|
|
||||||
* distribute such a system following the terms of the GNU AGPL for this code
|
|
||||||
* and the LGPL for the libraries. If you modify this code, you may extend this
|
|
||||||
* exception to your version of the code, but you are not obligated to do so.
|
|
||||||
* If you do not wish to do so, delete this exception statement from your
|
|
||||||
* version.
|
|
||||||
*
|
*
|
||||||
* This license applies to this entire compilation.
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with WebODF. If not, see <http://www.gnu.org/licenses/>.
|
||||||
* @licend
|
* @licend
|
||||||
|
*
|
||||||
* @source: http://www.webodf.org/
|
* @source: http://www.webodf.org/
|
||||||
* @source: http://gitorious.org/webodf/webodf/
|
* @source: https://github.com/kogmbh/WebODF/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global define, document, require, runtime, ops */
|
/*global define, document, require, runtime, ops */
|
||||||
|
@ -3,34 +3,24 @@
|
|||||||
* Copyright (C) 2013 KO GmbH <copyright@kogmbh.com>
|
* Copyright (C) 2013 KO GmbH <copyright@kogmbh.com>
|
||||||
*
|
*
|
||||||
* @licstart
|
* @licstart
|
||||||
* The JavaScript code in this page is free software: you can redistribute it
|
* This file is part of WebODF.
|
||||||
* and/or modify it under the terms of the GNU Affero General Public License
|
|
||||||
* (GNU AGPL) as published by the Free Software Foundation, either version 3 of
|
|
||||||
* the License, or (at your option) any later version. The code is distributed
|
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
|
||||||
*
|
*
|
||||||
* As additional permission under GNU AGPL version 3 section 7, you
|
* WebODF is free software: you can redistribute it and/or modify it
|
||||||
* may distribute non-source (e.g., minimized or compacted) forms of
|
* under the terms of the GNU Affero General Public License (GNU AGPL)
|
||||||
* that code without the copy of the GNU GPL normally required by
|
* as published by the Free Software Foundation, either version 3 of
|
||||||
* section 4, provided you include this license notice and a URL
|
* the License, or (at your option) any later version.
|
||||||
* through which recipients can access the Corresponding Source.
|
|
||||||
*
|
*
|
||||||
* As a special exception to the AGPL, any HTML file which merely makes function
|
* WebODF is distributed in the hope that it will be useful, but
|
||||||
* calls to this code, and for that purpose includes it by reference shall be
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* deemed a separate work for copyright law purposes. In addition, the copyright
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* holders of this code give you permission to combine this code with free
|
* GNU Affero General Public License for more details.
|
||||||
* software libraries that are released under the GNU LGPL. You may copy and
|
|
||||||
* distribute such a system following the terms of the GNU AGPL for this code
|
|
||||||
* and the LGPL for the libraries. If you modify this code, you may extend this
|
|
||||||
* exception to your version of the code, but you are not obligated to do so.
|
|
||||||
* If you do not wish to do so, delete this exception statement from your
|
|
||||||
* version.
|
|
||||||
*
|
*
|
||||||
* This license applies to this entire compilation.
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with WebODF. If not, see <http://www.gnu.org/licenses/>.
|
||||||
* @licend
|
* @licend
|
||||||
|
*
|
||||||
* @source: http://www.webodf.org/
|
* @source: http://www.webodf.org/
|
||||||
* @source: http://gitorious.org/webodf/webodf/
|
* @source: https://github.com/kogmbh/WebODF/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global define, ops, runtime */
|
/*global define, ops, runtime */
|
||||||
|
103
js/3rdparty/webodf/editor/widgets/annotation.js
vendored
Normal file
103
js/3rdparty/webodf/editor/widgets/annotation.js
vendored
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
/**
|
||||||
|
* @license
|
||||||
|
* Copyright (C) 2013 KO GmbH <copyright@kogmbh.com>
|
||||||
|
*
|
||||||
|
* @licstart
|
||||||
|
* The JavaScript code in this page is free software: you can redistribute it
|
||||||
|
* and/or modify it under the terms of the GNU Affero General Public License
|
||||||
|
* (GNU AGPL) as published by the Free Software Foundation, either version 3 of
|
||||||
|
* the License, or (at your option) any later version. The code is distributed
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this code. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* As additional permission under GNU AGPL version 3 section 7, you
|
||||||
|
* may distribute non-source (e.g., minimized or compacted) forms of
|
||||||
|
* that code without the copy of the GNU GPL normally required by
|
||||||
|
* section 4, provided you include this license notice and a URL
|
||||||
|
* through which recipients can access the Corresponding Source.
|
||||||
|
*
|
||||||
|
* As a special exception to the AGPL, any HTML file which merely makes function
|
||||||
|
* calls to this code, and for that purpose includes it by reference shall be
|
||||||
|
* deemed a separate work for copyright law purposes. In addition, the copyright
|
||||||
|
* holders of this code give you permission to combine this code with free
|
||||||
|
* software libraries that are released under the GNU LGPL. You may copy and
|
||||||
|
* distribute such a system following the terms of the GNU AGPL for this code
|
||||||
|
* and the LGPL for the libraries. If you modify this code, you may extend this
|
||||||
|
* exception to your version of the code, but you are not obligated to do so.
|
||||||
|
* If you do not wish to do so, delete this exception statement from your
|
||||||
|
* version.
|
||||||
|
*
|
||||||
|
* This license applies to this entire compilation.
|
||||||
|
* @licend
|
||||||
|
* @source: http://www.webodf.org/
|
||||||
|
* @source: https://github.com/kogmbh/WebODF/
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*global define, require */
|
||||||
|
|
||||||
|
define("webodf/editor/widgets/annotation", [
|
||||||
|
"dijit/form/Button"],
|
||||||
|
|
||||||
|
function (Button) {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var AnnotationControl = function (callback) {
|
||||||
|
var self = this,
|
||||||
|
widget = {},
|
||||||
|
addAnnotationButton,
|
||||||
|
annotationManager;
|
||||||
|
|
||||||
|
|
||||||
|
addAnnotationButton = new Button({
|
||||||
|
label: runtime.tr('Annotate'),
|
||||||
|
disabled: true,
|
||||||
|
showLabel: false,
|
||||||
|
iconClass: 'dijitIconBookmark',
|
||||||
|
onClick: function () {
|
||||||
|
if (annotationManager) {
|
||||||
|
annotationManager.addAnnotation();
|
||||||
|
self.onToolDone();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
widget.children = [addAnnotationButton];
|
||||||
|
widget.startup = function () {
|
||||||
|
widget.children.forEach(function (element) {
|
||||||
|
element.startup();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
widget.placeAt = function (container) {
|
||||||
|
widget.children.forEach(function (element) {
|
||||||
|
element.placeAt(container);
|
||||||
|
});
|
||||||
|
return widget;
|
||||||
|
};
|
||||||
|
|
||||||
|
function onAnnotatableChanged(isAnnotatable) {
|
||||||
|
addAnnotationButton.setAttribute('disabled', !isAnnotatable);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setEditorSession = function (session) {
|
||||||
|
if (annotationManager) {
|
||||||
|
annotationManager.unsubscribe(gui.AnnotationManager.annotatableChanged, onAnnotatableChanged);
|
||||||
|
}
|
||||||
|
annotationManager = session && session.sessionController.getAnnotationManager();
|
||||||
|
if (annotationManager) {
|
||||||
|
annotationManager.subscribe(gui.AnnotationManager.annotatableChanged, onAnnotatableChanged);
|
||||||
|
}
|
||||||
|
onAnnotatableChanged(annotationManager && annotationManager.isAnnotatable());
|
||||||
|
};
|
||||||
|
|
||||||
|
this.onToolDone = function () {};
|
||||||
|
|
||||||
|
callback(widget);
|
||||||
|
};
|
||||||
|
|
||||||
|
return AnnotationControl;
|
||||||
|
}
|
||||||
|
);
|
@ -4,22 +4,22 @@
|
|||||||
<body>
|
<body>
|
||||||
<div data-dojo-type="dijit/form/Form" id="alignmentPaneForm" data-dojo-id="alignmentPaneForm">
|
<div data-dojo-type="dijit/form/Form" id="alignmentPaneForm" data-dojo-id="alignmentPaneForm">
|
||||||
|
|
||||||
<h3 text-i18n="options">Options</h3>
|
<h3 text-i18n="Options">Options</h3>
|
||||||
|
|
||||||
<input type="radio" data-dojo-type="dijit/form/RadioButton" name="textAlign" id="radioLeft" checked value="left"/>
|
<input type="radio" data-dojo-type="dijit/form/RadioButton" name="textAlign" id="radioLeft" checked value="left"/>
|
||||||
<label text-i18n="left" for="radioLeft">Left</label> <br/>
|
<label text-i18n="Left" for="radioLeft"></label> <br/>
|
||||||
<input type="radio" data-dojo-type="dijit/form/RadioButton" name="textAlign" id="radioCenter" value="center"/>
|
<input type="radio" data-dojo-type="dijit/form/RadioButton" name="textAlign" id="radioCenter" value="center"/>
|
||||||
<label text-i18n="center" for="radioCenter">Center</label> <br/>
|
<label text-i18n="Center" for="radioCenter"></label> <br/>
|
||||||
<input type="radio" data-dojo-type="dijit/form/RadioButton" name="textAlign" id="radioRight" value="right"/>
|
<input type="radio" data-dojo-type="dijit/form/RadioButton" name="textAlign" id="radioRight" value="right"/>
|
||||||
<label text-i18n="right" for="radioRight">Right</label> <br/>
|
<label text-i18n="Right" for="radioRight"></label> <br/>
|
||||||
<input type="radio" data-dojo-type="dijit/form/RadioButton" name="textAlign" id="radioJustified" value="justify"/>
|
<input type="radio" data-dojo-type="dijit/form/RadioButton" name="textAlign" id="radioJustified" value="justify"/>
|
||||||
<label text-i18n="justified" for="radioJustified">Justified</label> <br/>
|
<label text-i18n="Justified" for="radioJustified"></label> <br/>
|
||||||
|
|
||||||
<h3><span text-i18n="spacing">Spacing</span> <small>(mm)</small></h3>
|
<h3><span text-i18n="Spacing"></span> <small>(mm)</small></h3>
|
||||||
|
|
||||||
<div style = "margin-top: 10px;">
|
<div style = "margin-top: 10px;">
|
||||||
<div style = "float: right; margin-right: 200px;">
|
<div style = "float: right; margin-right: 200px;">
|
||||||
<label text-i18n="top" for="topMargin">Top</label>
|
<label text-i18n="Top" for="topMargin"></label>
|
||||||
<input data-dojo-type="dijit/form/NumberSpinner" id="topMargin"
|
<input data-dojo-type="dijit/form/NumberSpinner" id="topMargin"
|
||||||
value="0"
|
value="0"
|
||||||
data-dojo-props="smallDelta:1, constraints:{min:0,max:100}"
|
data-dojo-props="smallDelta:1, constraints:{min:0,max:100}"
|
||||||
@ -28,7 +28,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<br><br>
|
<br><br>
|
||||||
<div style = "float: left;">
|
<div style = "float: left;">
|
||||||
<label text-i18n="left" for="leftMargin">Left</label>
|
<label text-i18n="Left" for="leftMargin"></label>
|
||||||
<input data-dojo-type="dijit/form/NumberSpinner" id="leftMargin"
|
<input data-dojo-type="dijit/form/NumberSpinner" id="leftMargin"
|
||||||
value="0"
|
value="0"
|
||||||
data-dojo-props="smallDelta:1, constraints:{min:0,max:100}"
|
data-dojo-props="smallDelta:1, constraints:{min:0,max:100}"
|
||||||
@ -36,7 +36,7 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div style = "float: right; margin-right: 50px;">
|
<div style = "float: right; margin-right: 50px;">
|
||||||
<label text-i18n="right" for="rightMargin">Right</label>
|
<label text-i18n="Right" for="rightMargin"></label>
|
||||||
<input data-dojo-type="dijit/form/NumberSpinner" id="rightMargin"
|
<input data-dojo-type="dijit/form/NumberSpinner" id="rightMargin"
|
||||||
value="0"
|
value="0"
|
||||||
data-dojo-props="smallDelta:1, constraints:{min:0,max:100}"
|
data-dojo-props="smallDelta:1, constraints:{min:0,max:100}"
|
||||||
@ -45,7 +45,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<br/><br>
|
<br/><br>
|
||||||
<div style = "float: right; margin-right: 200px;">
|
<div style = "float: right; margin-right: 200px;">
|
||||||
<label text-i18n="bottom" for="bottomMargin">Bottom</label>
|
<label text-i18n="Bottom" for="bottomMargin"></label>
|
||||||
<input data-dojo-type="dijit/form/NumberSpinner" id="bottomMargin"
|
<input data-dojo-type="dijit/form/NumberSpinner" id="bottomMargin"
|
||||||
value="0"
|
value="0"
|
||||||
data-dojo-props="smallDelta:1, constraints:{min:0,max:100}"
|
data-dojo-props="smallDelta:1, constraints:{min:0,max:100}"
|
||||||
|
@ -10,6 +10,9 @@
|
|||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this code. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
* As additional permission under GNU AGPL version 3 section 7, you
|
* As additional permission under GNU AGPL version 3 section 7, you
|
||||||
* may distribute non-source (e.g., minimized or compacted) forms of
|
* may distribute non-source (e.g., minimized or compacted) forms of
|
||||||
* that code without the copy of the GNU GPL normally required by
|
* that code without the copy of the GNU GPL normally required by
|
||||||
@ -30,10 +33,10 @@
|
|||||||
* This license applies to this entire compilation.
|
* This license applies to this entire compilation.
|
||||||
* @licend
|
* @licend
|
||||||
* @source: http://www.webodf.org/
|
* @source: http://www.webodf.org/
|
||||||
* @source: http://gitorious.org/webodf/webodf/
|
* @source: https://github.com/kogmbh/WebODF/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global runtime,core,define,require,document,dijit */
|
/*global runtime,core,define,require,dijit */
|
||||||
|
|
||||||
runtime.loadClass("core.CSSUnits");
|
runtime.loadClass("core.CSSUnits");
|
||||||
|
|
||||||
@ -103,13 +106,13 @@ define("webodf/editor/widgets/dialogWidgets/alignmentPane", [], function () {
|
|||||||
runtime.assert(editorBase, "webodf/editor path not defined in dojoConfig");
|
runtime.assert(editorBase, "webodf/editor path not defined in dojoConfig");
|
||||||
ready(function () {
|
ready(function () {
|
||||||
contentPane = new ContentPane({
|
contentPane = new ContentPane({
|
||||||
title: document.translator("alignment"),
|
title: runtime.tr("Alignment"),
|
||||||
href: editorBase+"/widgets/dialogWidgets/alignmentPane.html",
|
href: editorBase+"/widgets/dialogWidgets/alignmentPane.html",
|
||||||
preload: true
|
preload: true
|
||||||
});
|
});
|
||||||
contentPane.onLoad = function () {
|
contentPane.onLoad = function () {
|
||||||
form = dijit.byId('alignmentPaneForm');
|
form = dijit.byId('alignmentPaneForm');
|
||||||
document.translateContent(form.domNode);
|
runtime.translateContent(form.domNode);
|
||||||
};
|
};
|
||||||
return cb();
|
return cb();
|
||||||
});
|
});
|
||||||
|
@ -4,23 +4,23 @@
|
|||||||
<body>
|
<body>
|
||||||
<div data-dojo-type="dijit/form/Form" id="fontEffectsPaneForm" data-dojo-id="fontEffectsPaneForm">
|
<div data-dojo-type="dijit/form/Form" id="fontEffectsPaneForm" data-dojo-id="fontEffectsPaneForm">
|
||||||
|
|
||||||
<h3 text-i18n="style">Style</h3>
|
<h3 text-i18n="Style"></h3>
|
||||||
|
|
||||||
<input data-dojo-type="dijit/form/CheckBox" name="textStyle" id="radioBold" value="bold"/>
|
<input data-dojo-type="dijit/form/CheckBox" name="textStyle" id="radioBold" value="bold"/>
|
||||||
<label text-i18n="bold" for="radioBold">Bold</label> <br/>
|
<label text-i18n="Bold" for="radioBold"></label> <br/>
|
||||||
<input data-dojo-type="dijit/form/CheckBox" name="textStyle" id="radioItalic" value="italic"/>
|
<input data-dojo-type="dijit/form/CheckBox" name="textStyle" id="radioItalic" value="italic"/>
|
||||||
<label text-i18n="italic" for="radioItalic">Italic</label> <br/>
|
<label text-i18n="Italic" for="radioItalic"></label> <br/>
|
||||||
<input data-dojo-type="dijit/form/CheckBox" name="textStyle" id="radioUnderline" value="underline"/>
|
<input data-dojo-type="dijit/form/CheckBox" name="textStyle" id="radioUnderline" value="underline"/>
|
||||||
<label text-i18n="underline" for="radioUnderline">Underline</label> <br/>
|
<label text-i18n="Underline" for="radioUnderline"></label> <br/>
|
||||||
|
|
||||||
<h3 text-i18n="font">Font</h3>
|
<h3 text-i18n="Font"></h3>
|
||||||
<br>
|
<br>
|
||||||
<div id = 'fontPicker' class="labeledSelect" style = "float: left;">
|
<div id = 'fontPicker' class="labeledSelect" style = "float: left;">
|
||||||
<label text-i18n="family" for="fontName">Family:</label>
|
<label text-i18n="Family" for="fontName"></label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style = "float: left; margin-left: 30px;">
|
<div style = "float: left; margin-left: 30px;">
|
||||||
<label for="fontSize"><span text-i18n="size">Size</span> (pt) </label>
|
<label for="fontSize"><span text-i18n="Size"></span> (pt) </label>
|
||||||
<input data-dojo-type="dijit/form/NumberSpinner" id="fontSize"
|
<input data-dojo-type="dijit/form/NumberSpinner" id="fontSize"
|
||||||
value="12"
|
value="12"
|
||||||
data-dojo-props="smallDelta:1, constraints:{min:6,max:96}"
|
data-dojo-props="smallDelta:1, constraints:{min:6,max:96}"
|
||||||
@ -29,13 +29,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<br /><br />
|
<br /><br />
|
||||||
|
|
||||||
<h3 text-i18n="color">Color</h3>
|
<h3 text-i18n="Color"></h3>
|
||||||
<br>
|
<br>
|
||||||
<input data-dojo-type="dijit/form/TextBox" name = "color" id = "textColorTB" style="display: none;"/>
|
<input data-dojo-type="dijit/form/TextBox" name = "color" id = "textColorTB" style="display: none;"/>
|
||||||
<div data-dojo-type="dijit/form/DropDownButton">
|
<div data-dojo-type="dijit/form/DropDownButton">
|
||||||
<span><span text-i18n="text" id = "textColor">
|
<span><span text-i18n="Text" id = "textColor"></span></span>
|
||||||
Text
|
|
||||||
</span></span>
|
|
||||||
<div data-dojo-type="dijit/TooltipDialog">
|
<div data-dojo-type="dijit/TooltipDialog">
|
||||||
<div data-dojo-type="dojox.widget.ColorPicker" id="textColorPicker"></div>
|
<div data-dojo-type="dojox.widget.ColorPicker" id="textColorPicker"></div>
|
||||||
</div>
|
</div>
|
||||||
@ -43,9 +41,7 @@
|
|||||||
|
|
||||||
<input data-dojo-type="dijit/form/TextBox" name = "backgroundColor" id = "backgroundColorTB" style="display: none;"/>
|
<input data-dojo-type="dijit/form/TextBox" name = "backgroundColor" id = "backgroundColorTB" style="display: none;"/>
|
||||||
<div data-dojo-type="dijit/form/DropDownButton">
|
<div data-dojo-type="dijit/form/DropDownButton">
|
||||||
<span><span text-i18n="background" id = "backgroundColor">
|
<span><span text-i18n="Background" id = "backgroundColor"></span></span>
|
||||||
Background
|
|
||||||
</span></span>
|
|
||||||
<div data-dojo-type="dijit/TooltipDialog">
|
<div data-dojo-type="dijit/TooltipDialog">
|
||||||
<div data-dojo-type="dojox.widget.ColorPicker" id="backgroundColorPicker"></div>
|
<div data-dojo-type="dojox.widget.ColorPicker" id="backgroundColorPicker"></div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -10,6 +10,9 @@
|
|||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this code. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
* As additional permission under GNU AGPL version 3 section 7, you
|
* As additional permission under GNU AGPL version 3 section 7, you
|
||||||
* may distribute non-source (e.g., minimized or compacted) forms of
|
* may distribute non-source (e.g., minimized or compacted) forms of
|
||||||
* that code without the copy of the GNU GPL normally required by
|
* that code without the copy of the GNU GPL normally required by
|
||||||
@ -30,7 +33,7 @@
|
|||||||
* This license applies to this entire compilation.
|
* This license applies to this entire compilation.
|
||||||
* @licend
|
* @licend
|
||||||
* @source: http://www.webodf.org/
|
* @source: http://www.webodf.org/
|
||||||
* @source: http://gitorious.org/webodf/webodf/
|
* @source: https://github.com/kogmbh/WebODF/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global runtime,define,require,document,dijit */
|
/*global runtime,define,require,document,dijit */
|
||||||
@ -123,13 +126,12 @@ define("webodf/editor/widgets/dialogWidgets/fontEffectsPane", [], function () {
|
|||||||
"dojox/widget/ColorPicker",
|
"dojox/widget/ColorPicker",
|
||||||
"webodf/editor/widgets/fontPicker"
|
"webodf/editor/widgets/fontPicker"
|
||||||
], function (dojo, ready, domConstruct, ContentPane, ColorPicker, FontPicker) {
|
], function (dojo, ready, domConstruct, ContentPane, ColorPicker, FontPicker) {
|
||||||
var translator = document.translator,
|
var editorBase = dojo.config && dojo.config.paths &&
|
||||||
editorBase = dojo.config && dojo.config.paths &&
|
|
||||||
dojo.config.paths['webodf/editor'];
|
dojo.config.paths['webodf/editor'];
|
||||||
runtime.assert(editorBase, "webodf/editor path not defined in dojoConfig");
|
runtime.assert(editorBase, "webodf/editor path not defined in dojoConfig");
|
||||||
ready(function () {
|
ready(function () {
|
||||||
contentPane = new ContentPane({
|
contentPane = new ContentPane({
|
||||||
title: translator("fontEffects"),
|
title: runtime.tr("Font Effects"),
|
||||||
href: editorBase+"/widgets/dialogWidgets/fontEffectsPane.html",
|
href: editorBase+"/widgets/dialogWidgets/fontEffectsPane.html",
|
||||||
preload: true
|
preload: true
|
||||||
});
|
});
|
||||||
@ -139,7 +141,7 @@ define("webodf/editor/widgets/dialogWidgets/fontEffectsPane", [], function () {
|
|||||||
backgroundColorTB = dijit.byId('backgroundColorTB');
|
backgroundColorTB = dijit.byId('backgroundColorTB');
|
||||||
|
|
||||||
form = dijit.byId('fontEffectsPaneForm');
|
form = dijit.byId('fontEffectsPaneForm');
|
||||||
document.translateContent(form.domNode);
|
runtime.translateContent(form.domNode);
|
||||||
|
|
||||||
preview = document.getElementById('previewText');
|
preview = document.getElementById('previewText');
|
||||||
textColorPicker = dijit.byId('textColorPicker');
|
textColorPicker = dijit.byId('textColorPicker');
|
||||||
|
@ -9,6 +9,9 @@
|
|||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this code. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
* As additional permission under GNU AGPL version 3 section 7, you
|
* As additional permission under GNU AGPL version 3 section 7, you
|
||||||
* may distribute non-source (e.g., minimized or compacted) forms of
|
* may distribute non-source (e.g., minimized or compacted) forms of
|
||||||
* that code without the copy of the GNU GPL normally required by
|
* that code without the copy of the GNU GPL normally required by
|
||||||
@ -29,7 +32,7 @@
|
|||||||
* This license applies to this entire compilation.
|
* This license applies to this entire compilation.
|
||||||
* @licend
|
* @licend
|
||||||
* @source: http://www.webodf.org/
|
* @source: http://www.webodf.org/
|
||||||
* @source: http://gitorious.org/webodf/webodf/
|
* @source: https://github.com/kogmbh/WebODF/
|
||||||
*/
|
*/
|
||||||
/*global define,require,document */
|
/*global define,require,document */
|
||||||
define("webodf/editor/widgets/fontPicker", [
|
define("webodf/editor/widgets/fontPicker", [
|
||||||
|
166
js/3rdparty/webodf/editor/widgets/imageInserter.js
vendored
Normal file
166
js/3rdparty/webodf/editor/widgets/imageInserter.js
vendored
Normal file
@ -0,0 +1,166 @@
|
|||||||
|
/**
|
||||||
|
* @license
|
||||||
|
* Copyright (C) 2012-2013 KO GmbH <copyright@kogmbh.com>
|
||||||
|
*
|
||||||
|
* @licstart
|
||||||
|
* The JavaScript code in this page is free software: you can redistribute it
|
||||||
|
* and/or modify it under the terms of the GNU Affero General Public License
|
||||||
|
* (GNU AGPL) as published by the Free Software Foundation, either version 3 of
|
||||||
|
* the License, or (at your option) any later version. The code is distributed
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this code. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* As additional permission under GNU AGPL version 3 section 7, you
|
||||||
|
* may distribute non-source (e.g., minimized or compacted) forms of
|
||||||
|
* that code without the copy of the GNU GPL normally required by
|
||||||
|
* section 4, provided you include this license notice and a URL
|
||||||
|
* through which recipients can access the Corresponding Source.
|
||||||
|
*
|
||||||
|
* As a special exception to the AGPL, any HTML file which merely makes function
|
||||||
|
* calls to this code, and for that purpose includes it by reference shall be
|
||||||
|
* deemed a separate work for copyright law purposes. In addition, the copyright
|
||||||
|
* holders of this code give you permission to combine this code with free
|
||||||
|
* software libraries that are released under the GNU LGPL. You may copy and
|
||||||
|
* distribute such a system following the terms of the GNU AGPL for this code
|
||||||
|
* and the LGPL for the libraries. If you modify this code, you may extend this
|
||||||
|
* exception to your version of the code, but you are not obligated to do so.
|
||||||
|
* If you do not wish to do so, delete this exception statement from your
|
||||||
|
* version.
|
||||||
|
*
|
||||||
|
* This license applies to this entire compilation.
|
||||||
|
* @licend
|
||||||
|
* @source: http://www.webodf.org/
|
||||||
|
* @source: https://github.com/kogmbh/WebODF/
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*global define,require,document,Image,FileReader,window,runtime,ops */
|
||||||
|
|
||||||
|
define("webodf/editor/widgets/imageInserter", [
|
||||||
|
"dijit/form/Button",
|
||||||
|
"webodf/editor/EditorSession"],
|
||||||
|
|
||||||
|
function (Button, EditorSession) {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var ImageInserter = function (callback) {
|
||||||
|
var self = this,
|
||||||
|
widget = {},
|
||||||
|
insertImageButton,
|
||||||
|
editorSession,
|
||||||
|
fileLoader;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {!string} content as datauri
|
||||||
|
* @param {!string} mimetype
|
||||||
|
* @return {undefined}
|
||||||
|
*/
|
||||||
|
function insertImageOnceLoaded(mimetype, content) {
|
||||||
|
var hiddenImage = new Image();
|
||||||
|
|
||||||
|
hiddenImage.style.position = "absolute";
|
||||||
|
hiddenImage.style.left = "-99999px";
|
||||||
|
document.body.appendChild(hiddenImage);
|
||||||
|
hiddenImage.onload = function () {
|
||||||
|
// remove the data:image/jpg;base64, bit
|
||||||
|
content = content.substring(content.indexOf(",") + 1);
|
||||||
|
if (editorSession) {
|
||||||
|
editorSession.insertImage(mimetype, content, hiddenImage.width, hiddenImage.height);
|
||||||
|
}
|
||||||
|
// clean up
|
||||||
|
document.body.removeChild(hiddenImage);
|
||||||
|
self.onToolDone();
|
||||||
|
};
|
||||||
|
hiddenImage.src = content;
|
||||||
|
}
|
||||||
|
|
||||||
|
function fileSelectHandler(evt) {
|
||||||
|
var file, files, reader;
|
||||||
|
files = (evt.target && evt.target.files) || (evt.dataTransfer && evt.dataTransfer.files);
|
||||||
|
if (files && files.length === 1) {
|
||||||
|
file = files[0];
|
||||||
|
reader = new FileReader();
|
||||||
|
reader.onloadend = function () {
|
||||||
|
if (reader.readyState === 2) {
|
||||||
|
insertImageOnceLoaded(file.type, reader.result);
|
||||||
|
} else {
|
||||||
|
runtime.log("Image could not be loaded");
|
||||||
|
self.onToolDone();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
reader.readAsDataURL(file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function createFileLoader() {
|
||||||
|
var form = document.createElement("form"),
|
||||||
|
input = document.createElement("input");
|
||||||
|
form.appendChild(input);
|
||||||
|
form.id = "imageForm";
|
||||||
|
form.style.display = "none";
|
||||||
|
input.id = "imageLoader";
|
||||||
|
input.setAttribute("type", "file");
|
||||||
|
input.setAttribute("accept", "image/*");
|
||||||
|
input.addEventListener("change", fileSelectHandler, false);
|
||||||
|
document.body.appendChild(form);
|
||||||
|
return {input: input, form: form};
|
||||||
|
}
|
||||||
|
|
||||||
|
insertImageButton = new Button({
|
||||||
|
label: runtime.tr("Insert Image"),
|
||||||
|
disabled: true,
|
||||||
|
showLabel: false,
|
||||||
|
iconClass: "dijitEditorIcon dijitEditorIconInsertImage",
|
||||||
|
onClick: function () {
|
||||||
|
if (!fileLoader) {
|
||||||
|
fileLoader = createFileLoader();
|
||||||
|
}
|
||||||
|
fileLoader.form.reset();
|
||||||
|
fileLoader.input.click();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
widget.children = [insertImageButton];
|
||||||
|
widget.startup = function () {
|
||||||
|
widget.children.forEach(function (element) {
|
||||||
|
element.startup();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
widget.placeAt = function (container) {
|
||||||
|
widget.children.forEach(function (element) {
|
||||||
|
element.placeAt(container);
|
||||||
|
});
|
||||||
|
return widget;
|
||||||
|
};
|
||||||
|
|
||||||
|
function handleCursorMoved(cursor) {
|
||||||
|
var disabled = cursor.getSelectionType() === ops.OdtCursor.RegionSelection;
|
||||||
|
// LO/AOO pops up the picture/frame option dialog if image is selected when pressing the button
|
||||||
|
// Since we only support inline images, disable the button for now.
|
||||||
|
insertImageButton.setAttribute('disabled', disabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setEditorSession = function (session) {
|
||||||
|
if (editorSession) {
|
||||||
|
editorSession.unsubscribe(EditorSession.signalCursorMoved, handleCursorMoved);
|
||||||
|
}
|
||||||
|
editorSession = session;
|
||||||
|
if (editorSession) {
|
||||||
|
editorSession.subscribe(EditorSession.signalCursorMoved, handleCursorMoved);
|
||||||
|
}
|
||||||
|
widget.children.forEach(function (element) {
|
||||||
|
element.setAttribute("disabled", !session);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
this.onToolDone = function () {};
|
||||||
|
|
||||||
|
callback(widget);
|
||||||
|
};
|
||||||
|
|
||||||
|
return ImageInserter;
|
||||||
|
});
|
@ -10,6 +10,9 @@
|
|||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this code. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
* As additional permission under GNU AGPL version 3 section 7, you
|
* As additional permission under GNU AGPL version 3 section 7, you
|
||||||
* may distribute non-source (e.g., minimized or compacted) forms of
|
* may distribute non-source (e.g., minimized or compacted) forms of
|
||||||
* that code without the copy of the GNU GPL normally required by
|
* that code without the copy of the GNU GPL normally required by
|
||||||
@ -30,20 +33,22 @@
|
|||||||
* This license applies to this entire compilation.
|
* This license applies to this entire compilation.
|
||||||
* @licend
|
* @licend
|
||||||
* @source: http://www.webodf.org/
|
* @source: http://www.webodf.org/
|
||||||
* @source: http://gitorious.org/webodf/webodf/
|
* @source: https://github.com/kogmbh/WebODF/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global define,require,document */
|
/*global define,require,ops,gui */
|
||||||
|
|
||||||
define("webodf/editor/widgets/paragraphAlignment", [
|
define("webodf/editor/widgets/paragraphAlignment", [
|
||||||
"dijit/form/ToggleButton",
|
"dijit/form/ToggleButton",
|
||||||
"dijit/form/Button"],
|
"dijit/form/Button",
|
||||||
|
"webodf/editor/EditorSession"],
|
||||||
|
|
||||||
function (ToggleButton, Button) {
|
function (ToggleButton, Button, EditorSession) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var ParagraphAlignment = function (callback) {
|
var ParagraphAlignment = function (callback) {
|
||||||
var self = this,
|
var self = this,
|
||||||
|
editorSession,
|
||||||
widget = {},
|
widget = {},
|
||||||
directParagraphStyler,
|
directParagraphStyler,
|
||||||
justifyLeft,
|
justifyLeft,
|
||||||
@ -54,7 +59,7 @@ define("webodf/editor/widgets/paragraphAlignment", [
|
|||||||
outdent;
|
outdent;
|
||||||
|
|
||||||
justifyLeft = new ToggleButton({
|
justifyLeft = new ToggleButton({
|
||||||
label: document.translator('justifyLeft'),
|
label: runtime.tr('Align Left'),
|
||||||
disabled: true,
|
disabled: true,
|
||||||
showLabel: false,
|
showLabel: false,
|
||||||
checked: false,
|
checked: false,
|
||||||
@ -66,7 +71,7 @@ define("webodf/editor/widgets/paragraphAlignment", [
|
|||||||
});
|
});
|
||||||
|
|
||||||
justifyCenter = new ToggleButton({
|
justifyCenter = new ToggleButton({
|
||||||
label: document.translator('justifyCenter'),
|
label: runtime.tr('Center'),
|
||||||
disabled: true,
|
disabled: true,
|
||||||
showLabel: false,
|
showLabel: false,
|
||||||
checked: false,
|
checked: false,
|
||||||
@ -78,7 +83,7 @@ define("webodf/editor/widgets/paragraphAlignment", [
|
|||||||
});
|
});
|
||||||
|
|
||||||
justifyRight = new ToggleButton({
|
justifyRight = new ToggleButton({
|
||||||
label: document.translator('justifyRight'),
|
label: runtime.tr('Align Right'),
|
||||||
disabled: true,
|
disabled: true,
|
||||||
showLabel: false,
|
showLabel: false,
|
||||||
checked: false,
|
checked: false,
|
||||||
@ -90,7 +95,7 @@ define("webodf/editor/widgets/paragraphAlignment", [
|
|||||||
});
|
});
|
||||||
|
|
||||||
justifyFull = new ToggleButton({
|
justifyFull = new ToggleButton({
|
||||||
label: document.translator('justifyFull'),
|
label: runtime.tr('Justify'),
|
||||||
disabled: true,
|
disabled: true,
|
||||||
showLabel: false,
|
showLabel: false,
|
||||||
checked: false,
|
checked: false,
|
||||||
@ -102,7 +107,7 @@ define("webodf/editor/widgets/paragraphAlignment", [
|
|||||||
});
|
});
|
||||||
|
|
||||||
outdent = new Button({
|
outdent = new Button({
|
||||||
label: document.translator('outdent'),
|
label: runtime.tr('Decrease Indent'),
|
||||||
disabled: true,
|
disabled: true,
|
||||||
showLabel: false,
|
showLabel: false,
|
||||||
iconClass: "dijitEditorIcon dijitEditorIconOutdent",
|
iconClass: "dijitEditorIcon dijitEditorIconOutdent",
|
||||||
@ -113,7 +118,7 @@ define("webodf/editor/widgets/paragraphAlignment", [
|
|||||||
});
|
});
|
||||||
|
|
||||||
indent = new Button({
|
indent = new Button({
|
||||||
label: document.translator('indent'),
|
label: runtime.tr('Increase Indent'),
|
||||||
disabled: true,
|
disabled: true,
|
||||||
showLabel: false,
|
showLabel: false,
|
||||||
iconClass: "dijitEditorIcon dijitEditorIconIndent",
|
iconClass: "dijitEditorIcon dijitEditorIconIndent",
|
||||||
@ -161,7 +166,14 @@ define("webodf/editor/widgets/paragraphAlignment", [
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setEditorSession = function(session) {
|
function handleCursorMoved(cursor) {
|
||||||
|
var disabled = cursor.getSelectionType() === ops.OdtCursor.RegionSelection;
|
||||||
|
widget.children.forEach(function (element) {
|
||||||
|
element.setAttribute('disabled', disabled);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setEditorSession = function (session) {
|
||||||
if (directParagraphStyler) {
|
if (directParagraphStyler) {
|
||||||
directParagraphStyler.unsubscribe(gui.DirectParagraphStyler.paragraphStylingChanged, updateStyleButtons);
|
directParagraphStyler.unsubscribe(gui.DirectParagraphStyler.paragraphStylingChanged, updateStyleButtons);
|
||||||
}
|
}
|
||||||
@ -178,6 +190,14 @@ define("webodf/editor/widgets/paragraphAlignment", [
|
|||||||
isAlignedRight: directParagraphStyler ? directParagraphStyler.isAlignedRight() : false,
|
isAlignedRight: directParagraphStyler ? directParagraphStyler.isAlignedRight() : false,
|
||||||
isAlignedJustified: directParagraphStyler ? directParagraphStyler.isAlignedJustified() : false
|
isAlignedJustified: directParagraphStyler ? directParagraphStyler.isAlignedJustified() : false
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (editorSession) {
|
||||||
|
editorSession.unsubscribe(EditorSession.signalCursorMoved, handleCursorMoved);
|
||||||
|
}
|
||||||
|
editorSession = session;
|
||||||
|
if (editorSession) {
|
||||||
|
editorSession.subscribe(EditorSession.signalCursorMoved, handleCursorMoved);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.onToolDone = function () {};
|
this.onToolDone = function () {};
|
||||||
|
@ -10,6 +10,9 @@
|
|||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this code. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
* As additional permission under GNU AGPL version 3 section 7, you
|
* As additional permission under GNU AGPL version 3 section 7, you
|
||||||
* may distribute non-source (e.g., minimized or compacted) forms of
|
* may distribute non-source (e.g., minimized or compacted) forms of
|
||||||
* that code without the copy of the GNU GPL normally required by
|
* that code without the copy of the GNU GPL normally required by
|
||||||
@ -30,7 +33,7 @@
|
|||||||
* This license applies to this entire compilation.
|
* This license applies to this entire compilation.
|
||||||
* @licend
|
* @licend
|
||||||
* @source: http://www.webodf.org/
|
* @source: http://www.webodf.org/
|
||||||
* @source: http://gitorious.org/webodf/webodf/
|
* @source: https://github.com/kogmbh/WebODF/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global define,require */
|
/*global define,require */
|
||||||
@ -38,7 +41,7 @@
|
|||||||
define("webodf/editor/widgets/paragraphStyles",
|
define("webodf/editor/widgets/paragraphStyles",
|
||||||
["webodf/editor/EditorSession"],
|
["webodf/editor/EditorSession"],
|
||||||
|
|
||||||
function (EditorSession) {
|
function (EditorSession) {
|
||||||
"use strict";
|
"use strict";
|
||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
@ -47,7 +50,6 @@ define("webodf/editor/widgets/paragraphStyles",
|
|||||||
var self = this,
|
var self = this,
|
||||||
editorSession,
|
editorSession,
|
||||||
select,
|
select,
|
||||||
translator = document.translator,
|
|
||||||
defaultStyleUIId = ":default";
|
defaultStyleUIId = ":default";
|
||||||
|
|
||||||
this.widget = function () {
|
this.widget = function () {
|
||||||
@ -90,7 +92,7 @@ define("webodf/editor/widgets/paragraphStyles",
|
|||||||
|
|
||||||
// Populate the Default Style always
|
// Populate the Default Style always
|
||||||
selectionList = [{
|
selectionList = [{
|
||||||
label: translator("defaultStyle"),
|
label: runtime.tr("Default Style"),
|
||||||
value: defaultStyleUIId
|
value: defaultStyleUIId
|
||||||
}];
|
}];
|
||||||
availableStyles = editorSession ? editorSession.getAvailableParagraphStyles() : [];
|
availableStyles = editorSession ? editorSession.getAvailableParagraphStyles() : [];
|
||||||
@ -166,15 +168,24 @@ define("webodf/editor/widgets/paragraphStyles",
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleCursorMoved(cursor) {
|
||||||
|
var disabled = cursor.getSelectionType() === ops.OdtCursor.RegionSelection;
|
||||||
|
if (select) {
|
||||||
|
select.setAttribute('disabled', disabled);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.setEditorSession = function(session) {
|
this.setEditorSession = function(session) {
|
||||||
if (editorSession) {
|
if (editorSession) {
|
||||||
editorSession.unsubscribe(EditorSession.signalCommonStyleCreated, addStyle);
|
editorSession.unsubscribe(EditorSession.signalCommonStyleCreated, addStyle);
|
||||||
editorSession.unsubscribe(EditorSession.signalCommonStyleDeleted, removeStyle);
|
editorSession.unsubscribe(EditorSession.signalCommonStyleDeleted, removeStyle);
|
||||||
|
editorSession.unsubscribe(EditorSession.signalCursorMoved, handleCursorMoved);
|
||||||
}
|
}
|
||||||
editorSession = session;
|
editorSession = session;
|
||||||
if (editorSession) {
|
if (editorSession) {
|
||||||
editorSession.subscribe(EditorSession.signalCommonStyleCreated, addStyle);
|
editorSession.subscribe(EditorSession.signalCommonStyleCreated, addStyle);
|
||||||
editorSession.subscribe(EditorSession.signalCommonStyleDeleted, removeStyle);
|
editorSession.subscribe(EditorSession.signalCommonStyleDeleted, removeStyle);
|
||||||
|
editorSession.subscribe(EditorSession.signalCursorMoved, handleCursorMoved);
|
||||||
populateStyles();
|
populateStyles();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -10,6 +10,9 @@
|
|||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this code. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
* As additional permission under GNU AGPL version 3 section 7, you
|
* As additional permission under GNU AGPL version 3 section 7, you
|
||||||
* may distribute non-source (e.g., minimized or compacted) forms of
|
* may distribute non-source (e.g., minimized or compacted) forms of
|
||||||
* that code without the copy of the GNU GPL normally required by
|
* that code without the copy of the GNU GPL normally required by
|
||||||
@ -30,10 +33,10 @@
|
|||||||
* This license applies to this entire compilation.
|
* This license applies to this entire compilation.
|
||||||
* @licend
|
* @licend
|
||||||
* @source: http://www.webodf.org/
|
* @source: http://www.webodf.org/
|
||||||
* @source: http://gitorious.org/webodf/webodf/
|
* @source: https://github.com/kogmbh/WebODF/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global define,require,document,dojo,dijit */
|
/*global define,require,dojo,dijit */
|
||||||
|
|
||||||
define("webodf/editor/widgets/paragraphStylesDialog", [], function () {
|
define("webodf/editor/widgets/paragraphStylesDialog", [], function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
@ -54,7 +57,7 @@ define("webodf/editor/widgets/paragraphStylesDialog", [], function () {
|
|||||||
"dijit/form/DropDownButton",
|
"dijit/form/DropDownButton",
|
||||||
"dijit/form/RadioButton"], function (Dialog, TooltipDialog, popup, TabContainer, ContentPane, Button, DropDownButton, RadioButton) {
|
"dijit/form/RadioButton"], function (Dialog, TooltipDialog, popup, TabContainer, ContentPane, Button, DropDownButton, RadioButton) {
|
||||||
var i,
|
var i,
|
||||||
translator = document.translator,
|
tr = runtime.tr,
|
||||||
tabContainer,
|
tabContainer,
|
||||||
flowPane,
|
flowPane,
|
||||||
numberingPane,
|
numberingPane,
|
||||||
@ -179,17 +182,17 @@ define("webodf/editor/widgets/paragraphStylesDialog", [], function () {
|
|||||||
}
|
}
|
||||||
// Dialog
|
// Dialog
|
||||||
dialog = new Dialog({
|
dialog = new Dialog({
|
||||||
title: translator("paragraphStyles")
|
title: tr("Paragraph Styles")
|
||||||
});
|
});
|
||||||
|
|
||||||
cloneTooltip = new TooltipDialog({
|
cloneTooltip = new TooltipDialog({
|
||||||
content:
|
content:
|
||||||
'<h2 style="margin: 0;">'+translator("cloneThisStyle")+'</h2><br/>' +
|
'<h2 style="margin: 0;">'+tr("Clone this Style")+'</h2><br/>' +
|
||||||
'<label for="name">'+translator("newName_C")+'</label> <input data-dojo-type="dijit/form/TextBox" id="name" name="name"><br/><br/>',
|
'<label for="name">'+tr("New Name:")+'</label> <input data-dojo-type="dijit/form/TextBox" id="name" name="name"><br/><br/>',
|
||||||
style: "width: 300px;"
|
style: "width: 300px;"
|
||||||
});
|
});
|
||||||
cloneButton = new Button({
|
cloneButton = new Button({
|
||||||
label: translator("create"),
|
label: tr("Create"),
|
||||||
onClick: function () {
|
onClick: function () {
|
||||||
cloneStyle(stylePicker.value(), cloneTooltip.get('value').name);
|
cloneStyle(stylePicker.value(), cloneTooltip.get('value').name);
|
||||||
cloneTooltip.reset();
|
cloneTooltip.reset();
|
||||||
@ -198,7 +201,7 @@ define("webodf/editor/widgets/paragraphStylesDialog", [], function () {
|
|||||||
});
|
});
|
||||||
cloneTooltip.addChild(cloneButton);
|
cloneTooltip.addChild(cloneButton);
|
||||||
cloneDropDown = new DropDownButton({
|
cloneDropDown = new DropDownButton({
|
||||||
label: translator("clone"),
|
label: tr("Clone"),
|
||||||
showLabel: false,
|
showLabel: false,
|
||||||
iconClass: 'dijitEditorIcon dijitEditorIconCopy',
|
iconClass: 'dijitEditorIcon dijitEditorIconCopy',
|
||||||
dropDown: cloneTooltip,
|
dropDown: cloneTooltip,
|
||||||
@ -207,7 +210,7 @@ define("webodf/editor/widgets/paragraphStylesDialog", [], function () {
|
|||||||
dialog.addChild(cloneDropDown, 1);
|
dialog.addChild(cloneDropDown, 1);
|
||||||
|
|
||||||
deleteButton = new Button({
|
deleteButton = new Button({
|
||||||
label: translator("delete"),
|
label: tr("Delete"),
|
||||||
showLabel: false,
|
showLabel: false,
|
||||||
iconClass: 'dijitEditorIcon dijitEditorIconDelete',
|
iconClass: 'dijitEditorIcon dijitEditorIconDelete',
|
||||||
style: "float: right; margin-bottom: 5px;",
|
style: "float: right; margin-bottom: 5px;",
|
||||||
@ -227,11 +230,11 @@ define("webodf/editor/widgets/paragraphStylesDialog", [], function () {
|
|||||||
"class": "dijitDialogPaneActionBar"
|
"class": "dijitDialogPaneActionBar"
|
||||||
});
|
});
|
||||||
okButton = new dijit.form.Button({
|
okButton = new dijit.form.Button({
|
||||||
label: translator("ok"),
|
label: tr("OK"),
|
||||||
onClick: accept
|
onClick: accept
|
||||||
}).placeAt(actionBar);
|
}).placeAt(actionBar);
|
||||||
cancelButton = new dijit.form.Button({
|
cancelButton = new dijit.form.Button({
|
||||||
label: translator("cancel"),
|
label: tr("Cancel"),
|
||||||
onClick: cancel
|
onClick: cancel
|
||||||
}).placeAt(actionBar);
|
}).placeAt(actionBar);
|
||||||
dialog.domNode.appendChild(actionBar);
|
dialog.domNode.appendChild(actionBar);
|
||||||
|
@ -10,6 +10,9 @@
|
|||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this code. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
* As additional permission under GNU AGPL version 3 section 7, you
|
* As additional permission under GNU AGPL version 3 section 7, you
|
||||||
* may distribute non-source (e.g., minimized or compacted) forms of
|
* may distribute non-source (e.g., minimized or compacted) forms of
|
||||||
* that code without the copy of the GNU GPL normally required by
|
* that code without the copy of the GNU GPL normally required by
|
||||||
@ -30,21 +33,23 @@
|
|||||||
* This license applies to this entire compilation.
|
* This license applies to this entire compilation.
|
||||||
* @licend
|
* @licend
|
||||||
* @source: http://www.webodf.org/
|
* @source: http://www.webodf.org/
|
||||||
* @source: http://gitorious.org/webodf/webodf/
|
* @source: https://github.com/kogmbh/WebODF/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global define,require,document */
|
/*global define,require,gui,ops */
|
||||||
|
|
||||||
define("webodf/editor/widgets/simpleStyles", [
|
define("webodf/editor/widgets/simpleStyles", [
|
||||||
"webodf/editor/widgets/fontPicker",
|
"webodf/editor/widgets/fontPicker",
|
||||||
"dijit/form/ToggleButton",
|
"dijit/form/ToggleButton",
|
||||||
"dijit/form/NumberSpinner"],
|
"dijit/form/NumberSpinner",
|
||||||
|
"webodf/editor/EditorSession"],
|
||||||
|
|
||||||
function (FontPicker, ToggleButton, NumberSpinner) {
|
function (FontPicker, ToggleButton, NumberSpinner, EditorSession) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var SimpleStyles = function(callback) {
|
var SimpleStyles = function(callback) {
|
||||||
var self = this,
|
var self = this,
|
||||||
|
editorSession,
|
||||||
widget = {},
|
widget = {},
|
||||||
directTextStyler,
|
directTextStyler,
|
||||||
boldButton,
|
boldButton,
|
||||||
@ -56,7 +61,7 @@ define("webodf/editor/widgets/simpleStyles", [
|
|||||||
fontPickerWidget;
|
fontPickerWidget;
|
||||||
|
|
||||||
boldButton = new ToggleButton({
|
boldButton = new ToggleButton({
|
||||||
label: document.translator('bold'),
|
label: runtime.tr('Bold'),
|
||||||
disabled: true,
|
disabled: true,
|
||||||
showLabel: false,
|
showLabel: false,
|
||||||
checked: false,
|
checked: false,
|
||||||
@ -68,7 +73,7 @@ define("webodf/editor/widgets/simpleStyles", [
|
|||||||
});
|
});
|
||||||
|
|
||||||
italicButton = new ToggleButton({
|
italicButton = new ToggleButton({
|
||||||
label: document.translator('italic'),
|
label: runtime.tr('Italic'),
|
||||||
disabled: true,
|
disabled: true,
|
||||||
showLabel: false,
|
showLabel: false,
|
||||||
checked: false,
|
checked: false,
|
||||||
@ -80,7 +85,7 @@ define("webodf/editor/widgets/simpleStyles", [
|
|||||||
});
|
});
|
||||||
|
|
||||||
underlineButton = new ToggleButton({
|
underlineButton = new ToggleButton({
|
||||||
label: document.translator('underline'),
|
label: runtime.tr('Underline'),
|
||||||
disabled: true,
|
disabled: true,
|
||||||
showLabel: false,
|
showLabel: false,
|
||||||
checked: false,
|
checked: false,
|
||||||
@ -92,7 +97,7 @@ define("webodf/editor/widgets/simpleStyles", [
|
|||||||
});
|
});
|
||||||
|
|
||||||
strikethroughButton = new ToggleButton({
|
strikethroughButton = new ToggleButton({
|
||||||
label: document.translator('strikethrough'),
|
label: runtime.tr('Strikethrough'),
|
||||||
disabled: true,
|
disabled: true,
|
||||||
showLabel: false,
|
showLabel: false,
|
||||||
checked: false,
|
checked: false,
|
||||||
@ -104,7 +109,7 @@ define("webodf/editor/widgets/simpleStyles", [
|
|||||||
});
|
});
|
||||||
|
|
||||||
fontSizeSpinner = new NumberSpinner({
|
fontSizeSpinner = new NumberSpinner({
|
||||||
label: document.translator('size'),
|
label: runtime.tr('Size'),
|
||||||
disabled: true,
|
disabled: true,
|
||||||
showLabel: false,
|
showLabel: false,
|
||||||
value: 12,
|
value: 12,
|
||||||
@ -170,6 +175,13 @@ define("webodf/editor/widgets/simpleStyles", [
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleCursorMoved(cursor) {
|
||||||
|
var disabled = cursor.getSelectionType() === ops.OdtCursor.RegionSelection;
|
||||||
|
widget.children.forEach(function (element) {
|
||||||
|
element.setAttribute('disabled', disabled);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
this.setEditorSession = function(session) {
|
this.setEditorSession = function(session) {
|
||||||
if (directTextStyler) {
|
if (directTextStyler) {
|
||||||
directTextStyler.unsubscribe(gui.DirectTextStyler.textStylingChanged, updateStyleButtons);
|
directTextStyler.unsubscribe(gui.DirectTextStyler.textStylingChanged, updateStyleButtons);
|
||||||
@ -190,6 +202,14 @@ define("webodf/editor/widgets/simpleStyles", [
|
|||||||
fontSize: directTextStyler ? directTextStyler.fontSize() : undefined,
|
fontSize: directTextStyler ? directTextStyler.fontSize() : undefined,
|
||||||
fontName: directTextStyler ? directTextStyler.fontName() : undefined
|
fontName: directTextStyler ? directTextStyler.fontName() : undefined
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (editorSession) {
|
||||||
|
editorSession.unsubscribe(EditorSession.signalCursorMoved, handleCursorMoved);
|
||||||
|
}
|
||||||
|
editorSession = session;
|
||||||
|
if (editorSession) {
|
||||||
|
editorSession.subscribe(EditorSession.signalCursorMoved, handleCursorMoved);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.onToolDone = function () {};
|
this.onToolDone = function () {};
|
||||||
|
@ -10,6 +10,9 @@
|
|||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this code. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
* As additional permission under GNU AGPL version 3 section 7, you
|
* As additional permission under GNU AGPL version 3 section 7, you
|
||||||
* may distribute non-source (e.g., minimized or compacted) forms of
|
* may distribute non-source (e.g., minimized or compacted) forms of
|
||||||
* that code without the copy of the GNU GPL normally required by
|
* that code without the copy of the GNU GPL normally required by
|
||||||
@ -30,7 +33,7 @@
|
|||||||
* This license applies to this entire compilation.
|
* This license applies to this entire compilation.
|
||||||
* @licend
|
* @licend
|
||||||
* @source: http://www.webodf.org/
|
* @source: http://www.webodf.org/
|
||||||
* @source: http://gitorious.org/webodf/webodf/
|
* @source: https://github.com/kogmbh/WebODF/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global define, require */
|
/*global define, require */
|
||||||
|
@ -10,6 +10,9 @@
|
|||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this code. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
* As additional permission under GNU AGPL version 3 section 7, you
|
* As additional permission under GNU AGPL version 3 section 7, you
|
||||||
* may distribute non-source (e.g., minimized or compacted) forms of
|
* may distribute non-source (e.g., minimized or compacted) forms of
|
||||||
* that code without the copy of the GNU GPL normally required by
|
* that code without the copy of the GNU GPL normally required by
|
||||||
@ -30,10 +33,10 @@
|
|||||||
* This license applies to this entire compilation.
|
* This license applies to this entire compilation.
|
||||||
* @licend
|
* @licend
|
||||||
* @source: http://www.webodf.org/
|
* @source: http://www.webodf.org/
|
||||||
* @source: http://gitorious.org/webodf/webodf/
|
* @source: https://github.com/kogmbh/WebODF/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global define,require,document */
|
/*global define,require*/
|
||||||
|
|
||||||
define("webodf/editor/widgets/undoRedoMenu",
|
define("webodf/editor/widgets/undoRedoMenu",
|
||||||
["webodf/editor/EditorSession"],
|
["webodf/editor/EditorSession"],
|
||||||
@ -51,7 +54,7 @@ define("webodf/editor/widgets/undoRedoMenu",
|
|||||||
var widget = {};
|
var widget = {};
|
||||||
|
|
||||||
undoButton = new Button({
|
undoButton = new Button({
|
||||||
label: document.translator('undo'),
|
label: runtime.tr('Undo'),
|
||||||
showLabel: false,
|
showLabel: false,
|
||||||
disabled: true, // TODO: get current session state
|
disabled: true, // TODO: get current session state
|
||||||
iconClass: "dijitEditorIcon dijitEditorIconUndo",
|
iconClass: "dijitEditorIcon dijitEditorIconUndo",
|
||||||
@ -63,7 +66,7 @@ define("webodf/editor/widgets/undoRedoMenu",
|
|||||||
});
|
});
|
||||||
|
|
||||||
redoButton = new Button({
|
redoButton = new Button({
|
||||||
label: document.translator('redo'),
|
label: runtime.tr('Redo'),
|
||||||
showLabel: false,
|
showLabel: false,
|
||||||
disabled: true, // TODO: get current session state
|
disabled: true, // TODO: get current session state
|
||||||
iconClass: "dijitEditorIcon dijitEditorIconRedo",
|
iconClass: "dijitEditorIcon dijitEditorIconRedo",
|
||||||
|
@ -10,6 +10,9 @@
|
|||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this code. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
* As additional permission under GNU AGPL version 3 section 7, you
|
* As additional permission under GNU AGPL version 3 section 7, you
|
||||||
* may distribute non-source (e.g., minimized or compacted) forms of
|
* may distribute non-source (e.g., minimized or compacted) forms of
|
||||||
* that code without the copy of the GNU GPL normally required by
|
* that code without the copy of the GNU GPL normally required by
|
||||||
@ -30,10 +33,10 @@
|
|||||||
* This license applies to this entire compilation.
|
* This license applies to this entire compilation.
|
||||||
* @licend
|
* @licend
|
||||||
* @source: http://www.webodf.org/
|
* @source: http://www.webodf.org/
|
||||||
* @source: http://gitorious.org/webodf/webodf/
|
* @source: https://github.com/kogmbh/WebODF/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global define,require,document */
|
/*global define,require*/
|
||||||
|
|
||||||
define("webodf/editor/widgets/zoomSlider", [], function () {
|
define("webodf/editor/widgets/zoomSlider", [], function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
5301
js/3rdparty/webodf/webodf-debug.js
vendored
5301
js/3rdparty/webodf/webodf-debug.js
vendored
File diff suppressed because one or more lines are too long
2315
js/3rdparty/webodf/webodf.js
vendored
2315
js/3rdparty/webodf/webodf.js
vendored
File diff suppressed because one or more lines are too long
@ -167,7 +167,9 @@ var documentsMain = {
|
|||||||
var serverFactory = new ServerFactory();
|
var serverFactory = new ServerFactory();
|
||||||
documentsMain.esId = response.es_id;
|
documentsMain.esId = response.es_id;
|
||||||
documentsMain.memberId = response.member_id;
|
documentsMain.memberId = response.member_id;
|
||||||
|
|
||||||
|
// TODO: set webodf translation system, by passing a proper function translate(!string):!string in "runtime.setTranslator(translate);"
|
||||||
|
|
||||||
documentsMain.webodfServerInstance = serverFactory.createServer();
|
documentsMain.webodfServerInstance = serverFactory.createServer();
|
||||||
documentsMain.webodfServerInstance.setToken(oc_requesttoken);
|
documentsMain.webodfServerInstance.setToken(oc_requesttoken);
|
||||||
documentsMain.webodfEditorInstance = new Editor({unstableFeaturesEnabled: documentsMain.useUnstable}, documentsMain.webodfServerInstance, serverFactory);
|
documentsMain.webodfEditorInstance = new Editor({unstableFeaturesEnabled: documentsMain.useUnstable}, documentsMain.webodfServerInstance, serverFactory);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user