/**
* SPDXVersion: SPDX-1.1
* Creator: Person: Nuno Brito (nuno.brito@triplecheck.de)
* Creator: Organization: TripleCheck (http://triplecheck.de)
* Created: 2014-01-16T00:00:00Z
* LicenseName: NOASSERTION
* FileName: frontPage.java
* FileType: SOURCE
* FileCopyrightText: <text> Copyright (c) 2014 Nuno Brito, TripleCheck </text>
* FileComment: <text> Defines the front page when the program starts </text>
*/
package basic;
import definitions.Messages;
import definitions.is;
import main.core;
import script.Plugin;
import script.log;
import utils.html;
/**
*
* @author Nuno Brito, 21st of December 2013 in Darsmtadt, Germany
*/
public class frontPage extends Plugin{
@Override
public void startup(){
// add our node to the tree right after the "Tools" node is added
log.hooks.addAction(Messages.CallFrontScreen, thisFile, "doScreen");
}
/**
* Do the front screen that is displayed to users on startup
*/
void doScreen() {
String timeLine = www.twitter.getTimeLine("@triplechecked");
// did we got anything from the web?
if(timeLine == null){
// nothing, just return without further action
return;
}
String navigation = ""
//+ html.br
+ html.h2("Actions")
+ html.link("Create a new SPDX", "/spdx/create.java?x=main")
+ html.br
+ html.br
+ "View SPDX archive"
+ html.br
+ html.br
+ "";
String result = ""
+ html.div()
+ navigation
+ html.h2("Share your open source news "
+ html.link("@triplechecked", "http://twitter.com/triplechecked")
+ "!")
+ timeLine
+ html._div
;
core.studio.editorPane(is.contentHTML, false, 0, result);
}
}