Skip to content

Commit

Permalink
Adding Aloha-Editor plugin forked in github
Browse files Browse the repository at this point in the history
  • Loading branch information
sinelaw committed Sep 8, 2011
1 parent 47c4c95 commit 8e4ce35
Show file tree
Hide file tree
Showing 472 changed files with 11,801 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
url = https://github.com/mapstraction/mxn.git
[submodule "submodules/Aloha-Editor"]
path = submodules/Aloha-Editor
url = git://github.com/alohaeditor/Aloha-Editor.git
url = git@github.com:popsimple/Aloha-Editor.git
[submodule "submodules/Dolomite"]
path = submodules/Dolomite
url = git@github.com:sinelaw/Dolomite.git
4 changes: 4 additions & 0 deletions scripts/update_aloha.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
cd submodules/Aloha-Editor/build
ant all
cp -r out/aloha-nightly/aloha ../../../website/war/
18 changes: 8 additions & 10 deletions shared/src/com/project/shared/client/net/DynamicSourceLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,8 @@ private DynamicSourceLoader(String source, SimpleEvent.Handler<Void> handler)
this.handler = handler;
String normalizedSource = source.toLowerCase().trim();
Element elem = null;
if (normalizedSource.endsWith(".js"))
{
ScriptElement scriptElem = Document.get().createScriptElement();
scriptElem.setSrc(source);
// scriptElem.setLang("javascript"); // lang is deprecated?
scriptElem.setType("text/javascript");
elem = scriptElem;
}
else if (normalizedSource.endsWith(".css"))
// TODO: replace the endsWith heuristic with a parameter that tells what type of element to create or a function that creates the proper element
if (normalizedSource.endsWith(".css"))
{
LinkElement linkElem = Document.get().createLinkElement();
linkElem.setHref(source);
Expand All @@ -42,7 +35,12 @@ else if (normalizedSource.endsWith(".css"))
elem = linkElem;
}
else {
throw new UnsupportedOperationException("Don't know how to load non-js/css source: '" + source + "'");
// If it isn't css, assume it's javascript (sometimes javascript urls don't end with .js because they are queries that dynamically generate js)
ScriptElement scriptElem = Document.get().createScriptElement();
scriptElem.setSrc(source);
// scriptElem.setLang("javascript"); // lang is deprecated?
scriptElem.setType("text/javascript");
elem = scriptElem;
}
this.registerLoadedHandler(elem);
Document.get().getElementsByTagName("head").getItem(0).appendChild(elem);
Expand Down
2 changes: 1 addition & 1 deletion website/gae.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ Password: g734FGQ@Ssdjf
Apps - Users & Groups
---------------------
no-reply: LevnNV13

contact: hardugi1
15 changes: 10 additions & 5 deletions website/src/com/project/website/canvas/client/Canvas.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.project.shared.utils.loggers.Logger;
import com.project.website.canvas.client.canvastools.base.BuiltinTools;
import com.project.website.canvas.client.canvastools.map.MapToolStaticUtils;
import com.project.website.canvas.client.canvastools.textedit.AlohaEditor;
import com.project.website.canvas.client.resources.CanvasResources;
import com.project.website.shared.client.widgets.authentication.resources.AuthenticationResources;

Expand All @@ -24,23 +25,27 @@ public void onModuleLoad() {
Logger.addLogger(GwtLogger.INSTANCE);
Logger.addLogger(FirebugLogger.INSTANCE);

// start loading the maps, aloha apis immediately, in case it will be needed later.
MapToolStaticUtils.loadApi();
AlohaEditor.loadApi();

// Make sure we have all resources loaded
CanvasResources.INSTANCE.main().ensureInjected();
AuthenticationResources.INSTANCE.main().ensureInjected();

// Register the built-in canvas tools
BuiltinTools.init();
RootPanel.get("root").add(this.canvasContainer);


// start loading the maps api immediately, in case it will be needed later.
MapToolStaticUtils.loadApi();

RootPanel.get("root").add(this.canvasContainer);

History.addValueChangeHandler(new ValueChangeHandler<String>() {
@Override
public void onValueChange(ValueChangeEvent<String> event) {
canvasContainer.getWorksheet().load(event.getValue());
}
});

// Go get'em!
History.fireCurrentHistoryState();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.project.website.canvas.client.canvastools.textedit;

import com.project.shared.client.net.DynamicSourceLoader;

public class AlohaEditor
{

private static final String ALOHA_SCRIPT_URL = "aloha/aloha.js";

public static void loadApi()
{
DynamicSourceLoader.getLoadAsyncFunc(ALOHA_SCRIPT_URL).run(null);
}
}
2 changes: 2 additions & 0 deletions website/war/aloha/VERSION.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
nightly
2011-09-08 11:44:39
192 changes: 192 additions & 0 deletions website/war/aloha/aloha-nodeps.js

Large diffs are not rendered by default.

334 changes: 334 additions & 0 deletions website/war/aloha/aloha.js

Large diffs are not rendered by default.

Loading

0 comments on commit 8e4ce35

Please sign in to comment.