Minor fixes.

This commit is contained in:
Paulo Veiga
2011-08-08 09:20:32 -03:00
parent ff8cf207ca
commit e9ed01c87d
11 changed files with 189 additions and 376 deletions

View File

@@ -1,32 +1,45 @@
mindplot.collaboration = {};
mindplot.collaboration.CollaborationManager = new Class({
initialize:function(){
initialize:function() {
this.collaborativeModelReady = false;
this.collaborativeModelReady = null;
this.wiseReady = false;
},
isCollaborationFrameworkAvailable:function(){
return $defined(goog.collab.CollaborativeApp);
isCollaborationFrameworkAvailable:function() {
return (typeof goog != "undefined") && (typeof goog.collab != "undefined");
},
setCollaborativeFramework:function(framework){
setCollaborativeFramework:function(framework) {
this._collaborativeFramework = framework;
this.collaborativeModelReady = true;
if(this.wiseReady){
if (this.wiseReady) {
buildCollaborativeMindmapDesigner();
}
},
setWiseReady:function(ready){
this.wiseReady=ready;
setWiseReady:function(ready) {
this.wiseReady = ready;
},
isCollaborativeFrameworkReady:function(){
isCollaborativeFrameworkReady:function() {
return this.collaborativeModelReady;
},
buildWiseModel: function(){
buildWiseModel: function() {
return this._collaborativeFramework.buildWiseModel();
},
getCollaborativeFramework:function(){
getCollaborativeFramework:function() {
return this._collaborativeFramework;
}
});
$wise_collaborationManager = new mindplot.collaboration.CollaborationManager();
mindplot.collaboration.CollaborationManager.getInstance = function() {
if (!$defined(mindplot.collaboration.CollaborationManager.__collaborationManager)) {
mindplot.collaboration.CollaborationManager.__collaborationManager = new mindplot.collaboration.CollaborationManager();
}
return mindplot.collaboration.CollaborationManager.__collaborationManager;
}
mindplot.collaboration.CollaborationManager.getInstance();

View File

@@ -1,68 +1,66 @@
mindplot.collaboration.frameworks.brix.BrixFramework = new Class({
Extends: mindplot.collaboration.frameworks.AbstractCollaborativeFramework,
initialize: function(model, app){
initialize: function(model, app) {
this._app = app;
var collaborativeModelFactory = new mindplot.collaboration.frameworks.brix.BrixCollaborativeModelFactory(this);
var cModel = null;
var root = this.getBrixModel().getRoot();
if(!root.isEmpty()){
if (!root.isEmpty()) {
cModel = collaborativeModelFactory.buildCollaborativeModelFor(root.get("mindmap"));
}
this.parent(cModel, collaborativeModelFactory);
},
addMindmap:function(model){
addMindmap:function(model) {
var root = this.getBrixModel().getRoot();
root.put("mindmap",model);
root.put("mindmap", model);
},
getBrixModel:function(){
getBrixModel:function() {
return this._app.getModel();
},
buildWiseModel: function(){
return this.parent();
buildWiseModel: function() {
return this.parent();
}
});
instanciated=false;
mindplot.collaboration.frameworks.brix.BrixFramework.instanciate=function(){
if($defined(isGoogleBrix) && !instanciated){
instanciated=true;
instanciated = false;
mindplot.collaboration.frameworks.brix.BrixFramework.instanciate = function() {
if ((typeof isGoogleBrix != "undefined") && !instanciated) {
instanciated = true;
var app = new goog.collab.CollaborativeApp();
mindplot.collaboration.frameworks.brix.BrixFramework.buildMenu(app);
app.start();
app.addListener('modelLoad', function(model){
app.addListener('modelLoad', function(model) {
var framework = new mindplot.collaboration.frameworks.brix.BrixFramework(model, app);
$wise_collaborationManager.setCollaborativeFramework(framework);
mindplot.collaboration.CollaborationManager.getInstance().setCollaborativeFramework(framework);
}.bind(this));
}
};
mindplot.collaboration.frameworks.brix.BrixFramework.buildMenu=function(app){
mindplot.collaboration.frameworks.brix.BrixFramework.buildMenu = function(app) {
var menuBar = new goog.collab.ui.MenuBar();
// Configure toolbar menu ...
var fileMenu = menuBar.addSubMenu("File");
fileMenu.addItem("Save", function() {
});
fileMenu.addItem("Export", function() {
});
// Configure toolbar menu ...
var fileMenu = menuBar.addSubMenu("File");
fileMenu.addItem("Save", function() {
});
fileMenu.addItem("Export", function() {
});
var editMenu = menuBar.addSubMenu("Edit");
editMenu.addItem("Undo", function() {
});
editMenu.addItem("Redo", function() {
});
var editMenu = menuBar.addSubMenu("Edit");
editMenu.addItem("Undo", function() {
});
editMenu.addItem("Redo", function() {
});
var formatMenu = menuBar.addSubMenu("Format");
formatMenu.addItem("Bold", function() {
});
var formatMenu = menuBar.addSubMenu("Format");
formatMenu.addItem("Bold", function() {
});
var helpMenu = menuBar.addSubMenu("Help");
helpMenu.addItem("Shortcuts", function() {
});
var helpMenu = menuBar.addSubMenu("Help");
helpMenu.addItem("Shortcuts", function() {
});
app.setMenuBar(menuBar);
app.setMenuBar(menuBar);
};
mindplot.collaboration.frameworks.brix.BrixFramework.instanciate();