diff --git a/css/style.css b/css/style.css index 2700ec30..6b892962 100644 --- a/css/style.css +++ b/css/style.css @@ -130,7 +130,7 @@ } #header .padded{ - margin-right:40px; + margin-right:12px; } #document-title { @@ -170,6 +170,8 @@ #mainContainer{ position: absolute; + width:100%; + height:100%; z-index: 500; background-color: #ddd !important; } @@ -246,36 +248,42 @@ } #members { + left: auto !important; + right:0px; + top: 4px !important; padding-top: 47px !important; background-color: #ddd !important; + z-index: 540; } -.memberListButton { +.webodfeditor-memberListButton { background-color: transparent !important; box-shadow: none !important; border: none !important; } -.memberListButton span { +.webodfeditor-memberListButton span { display: block; - border-radius: 3px; - display: block; - margin: auto; + border-radius: 3px; + display: block; + margin: auto; } -.memberListButton img{ +.webodfeditor-memberListButton img{ border: 0 none !important; } -.memberListButton input{ +.webodfeditor-memberListButton input{ width:46px; } -#memberList .memberListLabel { +#memberList .webodfeditor-memberListLabel { color: #555 !important; border-radius: 3px !important; padding: 0 !important; + margin-bottom: 10px; font-size: 10px !important; + text-align:center; } #ocToolbar, #ocToolbarInside{ @@ -289,7 +297,7 @@ min-height: 29px !important; border-bottom: none !important; border-radius: 2px; - margin: 7px 30px 0 0 !important; + margin: 6px 30px 0 0 !important; padding: 0 !important; box-shadow: none !important; background: #F5F5F5 !important; @@ -313,11 +321,11 @@ #toolbar > .dijitComboBox .dijitInputInner{ vertical-align: middle; -line-height: 1.45em; +line-height: 1.7em; } #container { - top: 44px !important; + top: 39px !important; } #canvas > div { diff --git a/index.php b/index.php index b62231ca..322b12e0 100644 --- a/index.php +++ b/index.php @@ -29,8 +29,7 @@ namespace OCA\Documents; \OCP\App::setActiveNavigationEntry( 'documents_index' ); \OCP\Util::addStyle( 'documents', 'style' ); -\OCP\Util::addStyle( 'documents', '3rdparty/webodf/dojo-app'); -\OCP\Util::addStyle( 'documents', '3rdparty/webodf/editor'); +\OCP\Util::addStyle( 'documents', '3rdparty/webodf/dojo-app' ); \OCP\Util::addScript('documents', 'documents'); diff --git a/js/3rdparty/webodf/editor/Editor.js b/js/3rdparty/webodf/editor/Editor.js index ce2d1b92..77820f22 100644 --- a/js/3rdparty/webodf/editor/Editor.js +++ b/js/3rdparty/webodf/editor/Editor.js @@ -442,6 +442,21 @@ define("webodf/editor/Editor", [ function setFocusToOdfCanvas() { editorSession.sessionController.getEventManager().focus(); } + + + /** + * Returns true if either all features are wanted and this one is not explicitely disabled + * or if not all features are wanted by default and it is explicitely enabled + * @param {?boolean|undefined} isFeatureEnabled explicit flag which enables a feature + * @param {!boolean=} isUnstable set to true if the feature is not stable (in collab mode) + * @return {!boolean} + */ + function isEnabled(isFeatureEnabled, isUnstable) { + if (isUnstable && ! args.unstableFeaturesEnabled) { + return false; + } + return args.allFeaturesEnabled ? (isFeatureEnabled !== false) : isFeatureEnabled; + } // init function init() { @@ -451,13 +466,16 @@ define("webodf/editor/Editor", [ container = document.getElementById('container'), memberListElement = document.getElementById('memberList'), collabEditing = Boolean(server), - directParagraphStylingEnabled = (! collabEditing) || args.unstableFeaturesEnabled, - imageInsertingEnabled = (! collabEditing) || args.unstableFeaturesEnabled, - hyperlinkEditingEnabled = (! collabEditing) || args.unstableFeaturesEnabled, - // annotations not yet properly supported for OT - annotationsEnabled = (! collabEditing) || args.unstableFeaturesEnabled, - // undo manager is not yet integrated with collaboration - undoRedoEnabled = (! collabEditing), + directTextStylingEnabled = isEnabled(args.directTextStylingEnabled), + directParagraphStylingEnabled = isEnabled(args.directParagraphStylingEnabled), + paragraphStyleSelectingEnabled = isEnabled(args.paragraphStyleSelectingEnabled), + paragraphStyleEditingEnabled = isEnabled(args.paragraphStyleEditingEnabled), + imageEditingEnabled = isEnabled(args.imageEditingEnabled, true), + hyperlinkEditingEnabled = isEnabled(args.hyperlinkEditingEnabled, true), + reviewModeEnabled = isEnabled(args.reviewModeEnabled, true), + annotationsEnabled = reviewModeEnabled || isEnabled(args.annotationsEnabled), + undoRedoEnabled = false, // no proper mechanism yet for collab + zoomingEnabled = isEnabled(args.zoomingEnabled), closeCallback; // Extend runtime with a convenient translation function @@ -513,16 +531,19 @@ define("webodf/editor/Editor", [ inviteButton.onclick = window.inviteButtonProxy.clicked; } - tools = new Tools({ + tools = new Tools('toolbar', { onToolDone: setFocusToOdfCanvas, - loadOdtFile: loadOdtFile, saveOdtFile: saveOdtFile, close: close, + directTextStylingEnabled: directTextStylingEnabled, directParagraphStylingEnabled: directParagraphStylingEnabled, - imageInsertingEnabled: imageInsertingEnabled, + paragraphStyleSelectingEnabled: paragraphStyleSelectingEnabled, + paragraphStyleEditingEnabled: paragraphStyleEditingEnabled, + imageInsertingEnabled: imageEditingEnabled, hyperlinkEditingEnabled: hyperlinkEditingEnabled, annotationsEnabled: annotationsEnabled, - undoRedoEnabled: undoRedoEnabled + undoRedoEnabled: undoRedoEnabled, + zoomingEnabled: zoomingEnabled }); odfCanvas = new odf.OdfCanvas(canvasElement); @@ -536,12 +557,23 @@ define("webodf/editor/Editor", [ }; // create session around loaded document + var viewOptions = { + editInfoMarkersInitiallyVisible: true, + caretAvatarsInitiallyVisible: false, + caretBlinksOnRangeSelect: true + }; session = new ops.Session(odfCanvas); editorSession = new EditorSession(session, pendingMemberId, { viewOptions: viewOptions, + directTextStylingEnabled: directTextStylingEnabled, directParagraphStylingEnabled: directParagraphStylingEnabled, - imageInsertingEnabled: imageInsertingEnabled, - hyperlinkEditingEnabled: hyperlinkEditingEnabled + paragraphStyleSelectingEnabled: paragraphStyleSelectingEnabled, + paragraphStyleEditingEnabled: paragraphStyleEditingEnabled, + imageEditingEnabled: imageEditingEnabled, + hyperlinkEditingEnabled: hyperlinkEditingEnabled, + annotationsEnabled: annotationsEnabled, + zoomingEnabled: zoomingEnabled, + reviewModeEnabled: reviewModeEnabled }); if (undoRedoEnabled) { editorSession.sessionController.setUndoManager(new gui.TrivialUndoManager()); diff --git a/js/ServerFactory.js b/js/ServerFactory.js index 2846b456..8f5c98d2 100644 --- a/js/ServerFactory.js +++ b/js/ServerFactory.js @@ -26,9 +26,9 @@ /*global define, require, OC*/ define("owncloud/ServerFactory", [ - "webodf/editor/server/pullbox/Server", - "webodf/editor/server/pullbox/OperationRouter", - "webodf/editor/server/pullbox/SessionList"], + "webodf/editor/backend/pullbox/Server", + "webodf/editor/backend/pullbox/OperationRouter", + "webodf/editor/backend/pullbox/SessionList"], function (PullBoxServer, PullBoxOperationRouter, PullBoxSessionList) { "use strict"; diff --git a/js/documents.js b/js/documents.js index bd6b6357..2eabb8d7 100644 --- a/js/documents.js +++ b/js/documents.js @@ -158,17 +158,17 @@ var documentsMain = { UI : { /* Editor wrapper HTML */ - container : '