fighting pathes for amd/dojo loading
This commit is contained in:
parent
ec37d6be71
commit
578e08c9b4
27
js/office.js
27
js/office.js
@ -1,16 +1,31 @@
|
||||
/*globals $,OC,fileDownloadPath,t,document,odf,webodfEditor,alert,require */
|
||||
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() {
|
||||
"use strict"; alert("ready A");
|
||||
require(["dojo/ready"], function(ready) {
|
||||
ready(function(){alert("ready B!");});
|
||||
OC.addScript('office', 'webodf_bootstrap', function() {
|
||||
require({}, ["dojo/ready"], function(ready) {
|
||||
ready(function(){
|
||||
dojo.config = officeMain.dojoConfig;
|
||||
alert("dojo loaded");
|
||||
require({}, ["webodf/editor/Editor"], function(Editor) {
|
||||
alert("Editor loaded: "+Editor);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
onView: function(dir, file) {
|
||||
"use strict";
|
||||
(function no_op() {return {no_op:function(){}};}()).no_op(function() {
|
||||
OC.addScript('office', 'webodf').done(function() {
|
||||
OC.addScript('office', 'webodf_bootstrap').done(function() {
|
||||
OC.addScript('office', 'boot_editor').done(function() {
|
||||
var doclocation = fileDownloadPath(dir, file);
|
||||
|
||||
@ -53,8 +68,6 @@ var officeMain = {
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
onClose: function() {
|
||||
// Fade out odf-toolbar
|
||||
|
Loading…
x
Reference in New Issue
Block a user