|
|
@ -1,16 +1,31 @@
|
|
|
|
/*globals $,OC,fileDownloadPath,t,document,odf,webodfEditor,alert,require */
|
|
|
|
/*globals $,OC,fileDownloadPath,t,document,odf,webodfEditor,alert,require */
|
|
|
|
var officeMain = {
|
|
|
|
var officeMain = {
|
|
|
|
|
|
|
|
dojoConfig: {
|
|
|
|
|
|
|
|
locale: "C",
|
|
|
|
|
|
|
|
paths: {
|
|
|
|
|
|
|
|
"webodf/editor": "/owncloud/apps/office/js/editor",
|
|
|
|
|
|
|
|
"dijit": "/owncloud/apps/office/js/editor/dijit",
|
|
|
|
|
|
|
|
"dojox": "/owncloud/apps/office/js/editor/dojox",
|
|
|
|
|
|
|
|
"dojo": "/owncloud/apps/office/js/editor/dojo",
|
|
|
|
|
|
|
|
"resources": "/owncloud/apps/office/js/editor/resources"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
onStartup: function() {
|
|
|
|
onStartup: function() {
|
|
|
|
"use strict"; alert("ready A");
|
|
|
|
OC.addScript('office', 'webodf_bootstrap', function() {
|
|
|
|
require(["dojo/ready"], function(ready) {
|
|
|
|
require({}, ["dojo/ready"], function(ready) {
|
|
|
|
ready(function(){alert("ready B!");});
|
|
|
|
ready(function(){
|
|
|
|
|
|
|
|
dojo.config = officeMain.dojoConfig;
|
|
|
|
|
|
|
|
alert("dojo loaded");
|
|
|
|
|
|
|
|
require({}, ["webodf/editor/Editor"], function(Editor) {
|
|
|
|
|
|
|
|
alert("Editor loaded: "+Editor);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onView: function(dir, file) {
|
|
|
|
onView: function(dir, file) {
|
|
|
|
"use strict";
|
|
|
|
"use strict";
|
|
|
|
(function no_op() {return {no_op:function(){}};}()).no_op(function() {
|
|
|
|
|
|
|
|
OC.addScript('office', 'webodf').done(function() {
|
|
|
|
OC.addScript('office', 'webodf').done(function() {
|
|
|
|
OC.addScript('office', 'webodf_bootstrap').done(function() {
|
|
|
|
|
|
|
|
OC.addScript('office', 'boot_editor').done(function() {
|
|
|
|
OC.addScript('office', 'boot_editor').done(function() {
|
|
|
|
var doclocation = fileDownloadPath(dir, file);
|
|
|
|
var doclocation = fileDownloadPath(dir, file);
|
|
|
|
|
|
|
|
|
|
|
@ -53,8 +68,6 @@ var officeMain = {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onClose: function() {
|
|
|
|
onClose: function() {
|
|
|
|
// Fade out odf-toolbar
|
|
|
|
// Fade out odf-toolbar
|
|
|
|