Skip to content

Commit

Permalink
Finally fixed the highlighting. Some more fixes and added items to th…
Browse files Browse the repository at this point in the history
…e side nav.
  • Loading branch information
payammeyer committed Mar 14, 2017
1 parent 6505bb9 commit f880caa
Show file tree
Hide file tree
Showing 11 changed files with 1,069 additions and 159 deletions.
36 changes: 15 additions & 21 deletions lumongo-ui/src/main/java/org/lumongo/ui/client/LumongoUI.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
package org.lumongo.ui.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.Widget;
import gwt.material.design.client.ui.MaterialHeader;
import gwt.material.design.client.ui.html.Div;
import gwt.material.design.client.ui.html.Main;
import org.lumongo.ui.client.bundle.MainResources;
Expand All @@ -22,15 +19,14 @@
*/
public class LumongoUI implements ContentPresenter, EntryPoint {

private SimplePanel simplePanel;
private Widget footer;
private MaterialHeader header;
private Main simplePanel;
private Footer footer;
private Header header;

@Override
public void onModuleLoad() {

MainResources.INSTANCE.mainGSS().ensureInjected();
GWT.log("Injecting highlighter.");
HighlighterInjector.inject();
HighChartsInjector highChartsInjector = new HighChartsInjector() {
@Override
Expand All @@ -39,11 +35,11 @@ public void onload() {
Div div = new Div();

header = new Header();
Main baseView = createBaseView();
simplePanel = createBaseView();
footer = new Footer();

div.add(header);
div.add(baseView);
div.add(simplePanel);
div.add(footer);

PlaceHandler placeHandler = new PlaceHandler(LumongoUI.this);
Expand All @@ -59,27 +55,25 @@ public void onload() {
@Override
public Main createBaseView() {

final Main mainWrapper = new Main();
mainWrapper.setId("main-wrapper");
mainWrapper.setMarginTop(40);
mainWrapper.setMarginBottom(40);
simplePanel = new Main();
simplePanel.setId("main-wrapper");
simplePanel.setMarginTop(40);
simplePanel.setMarginBottom(40);

Highcharts.setExportUrl("");

simplePanel = new SimplePanel();
simplePanel.getElement().setId("contentContainer");

mainWrapper.add(simplePanel);

return mainWrapper;
return simplePanel;
}

@Override
public void setContent(Widget content) {
simplePanel.setWidget(content);
simplePanel.clear();
if (content != null) {
simplePanel.add(content);
}
}

public MaterialHeader getHeader() {
public Header getHeader() {
return header;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Created by Payam Meyer on 3/14/17.
* @author pmeyer
*/
@JsType(namespace = JsPackage.GLOBAL, isNative = true)
@JsType(namespace = JsPackage.GLOBAL, isNative = true, name = "hljs")
public class Highlight {

@JsMethod
Expand All @@ -19,6 +19,6 @@ public class Highlight {
public native void initHighlightingOnLoad();

@JsMethod
public static native void e(Element block);
public static native void highlightBlock(Element block);

}
Loading

0 comments on commit f880caa

Please sign in to comment.