Skip to content
Snippets Groups Projects
Commit 6f29a33b authored by Etienne Kneuss's avatar Etienne Kneuss
Browse files

So far so good

parent 7f0884f5
No related branches found
No related tags found
No related merge requests found
Showing
with 1108 additions and 0 deletions
logs
project/project
project/target
target
tmp
.history
dist
/.idea
/*.iml
/out
/.idea_modules
/.classpath
/.project
/RUNNING_PID
package controllers
import play.api._
import play.api.mvc._
import play.api.libs.json._
import play.api.libs.json.Json._
import play.api.libs.json.Writes._
import examples._
object Application extends Controller {
val examples = VerificationExamples.allExamples
def index = Action {
Ok(views.html.index(examples, VerificationExamples.default))
}
def getExample(id: Int) = Action {
examples.lift.apply(id) match {
case Some(ex) =>
Ok(toJson(Map("status" -> "success", "code" -> ex.code)))
case None =>
Ok(toJson(Map("status" -> "error", "errormsg" -> "Unknown example")))
}
}
}
package examples
case class Example(title: String, code: String)
This diff is collapsed.
@(exs: List[examples.Example], default: examples.Example)
@main("Leon Online") {
<div id="allcontent">
<div id="title" class="contentbox"></div>
<div id="contact">
<p>
<i>Leon</i> is developed by the <a alt="LARA Group EPFL" href="http://lara.epfl.ch">LARA</a> group at <a href="http://www.epfl.ch">EPFL</a>. A good starting point is to copy-paste the source from an example in <a alt="Leon Examples" href="http://lara.epfl.ch/~psuter/leonexamples/">this list</a> and to click the <i>Verify&nbsp;!</i> button.
</p>
</div>
<div id="leonmain" class="contentbox">
<form id="leoninput" method="POST" action="">
<div id="codecolumn">
<div id="codebox">@default.code</div>
<input type="submit" id="askbutton" value="Ask Leon !">
<textarea id="consolebox"></textarea>
</div>
<div id="selectcolumn">
<h3>Load an Example:</h3>
<div>We provide you with a list of code-examples, select one from the list below to load it:</div>
<select id="example-loader" name="codeexample" onchange="loadExample();">
<option value="">-- Load Example --</option>
@exs.zipWithIndex.map{ case (ex, i) =>
<option value="@i">@ex.title</option>
}
</select>
</div>
</form>
</div>
</div>
}
@(title: String)(content: Html)
<!DOCTYPE html>
<html>
<head>
<title>@title</title>
<link href="@routes.Assets.at("images/lambda-ico.png")" type="image/png" rel="icon">
<link rel="stylesheet" media="screen" href="@routes.Assets.at("stylesheets/leon.css")">
<script src="@routes.Assets.at("javascripts/jquery-1.8.3.min.js")" type="text/javascript"></script>
<script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
<script src="@routes.Assets.at("javascripts/leon.js")" type="text/javascript"></script>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
@content
</body>
</html>
# This is the main configuration file for the application.
# ~~~~~
# Secret key
# ~~~~~
# The secret key is used to secure cryptographics functions.
# If you deploy your application to several instances be sure to use the same key!
application.secret="_JKq[m=o8OG;]F8xD:bGMs^/?KXXb2Huq^KLM=obhIQvsPIwPNJq@sgLWTRCLr4]"
# The application languages
# ~~~~~
application.langs="en"
# Global object class
# ~~~~~
# Define the Global object class for this application.
# Default to Global in the root package.
# global=Global
# Database configuration
# ~~~~~
# You can declare as many datasources as you want.
# By convention, the default datasource is named `default`
#
# db.default.driver=org.h2.Driver
# db.default.url="jdbc:h2:mem:play"
# db.default.user=sa
# db.default.password=
# Evolutions
# ~~~~~
# You can disable evolutions if needed
# evolutionplugin=disabled
# Logger
# ~~~~~
# You can also configure logback (http://logback.qos.ch/), by providing a logger.xml file in the conf directory .
# Root logger:
logger.root=ERROR
# Logger used by the framework:
logger.play=INFO
# Logger provided to your application:
logger.application=DEBUG
# Routes
# This file defines all application routes (Higher priority routes first)
# ~~~~
# Home page
GET / controllers.Application.index
GET /ajax/getExample/:id controllers.Application.getExample(id: Int)
# Map static resources from the /public folder to the /assets URL path
GET /assets/*file controllers.Assets.at(path="/public", file)
import sbt._
import Keys._
import PlayProject._
object ApplicationBuild extends Build {
val appName = "leononline"
val appVersion = "1.0-SNAPSHOT"
val appDependencies = Seq(
// Add your project dependencies here,
)
val main = PlayProject(appName, appVersion, appDependencies, mainLang = SCALA).settings(
// Add your own project settings here
)
}
sbt.version=0.11.3
\ No newline at end of file
// Comment to get more information during initialization
logLevel := Level.Warn
// The Typesafe repository
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
// Use the Play sbt plugin for Play projects
addSbtPlugin("play" % "sbt-plugin" % "2.0.4")
\ No newline at end of file
web/public/images/lambda-ico.png

587 B

web/public/images/leonlogo.png

5.18 KiB

web/public/images/lionbkg.png

113 KiB

Source diff could not be displayed: it is too large. Options to address this: view the blob.
This diff is collapsed.
var editor = null;
function appendError(title, msg) {
alert(title+": "+msg)
}
function loadExample() {
var value = $("#example-loader").val()
if (value) {
$.ajax({
url: '/ajax/getExample/'+value,
dataType: "json",
success: function(data, textStatus, jqXHR) {
if (data.status == "success") {
editor.setValue(data.code);
editor.selection.clearSelection();
editor.gotoLine(0);
} else {
appendError("Loading example failed :(", data.errormsg)
}
},
error: function(jqXHR, textStatus, errorThrown) {
appendError("Loading example failed :(", errorThrown)
}
});
}
}
$(document).ready(function() {
editor = ace.edit("codebox");
editor.getSession().setMode("ace/mode/scala");
$("#leoninput").submit(function () {
return false;
});
});
This diff is collapsed.
html {
height: 100%;
}
body {
font-family: Arial, Helvetica, Sans-serif;
margin: 0px;
padding: 0px;
background-image: url('/assets/images/lionbkg.png');
background-color: #FFFFFF;
background-repeat: no-repeat;
background-position: 25px 15px;
height: 100%;
}
h2 {
margin-top: 20px;
margin-bottom: 0px;
}
h3 {
margin-top: 0px;
margin-bottom: 0px;
font-weight: normal;
}
p, li {
text-align: justify;
}
a {
color: #1133CC;
}
a:link, a:visited {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
div.contentbox {
position: relative;
left: 320px;
padding: 0px;
margin: 0px;
}
div#title {
height: 80px;
width: 700px;
min-height: 80px;
max-height: 80px;
background-image: url('/assets/images/leonlogo.png');
background-repeat: no-repeat;
background-position: right bottom;
}
div#leonmain {
}
div#console {
background-color: #EEEEEE;
}
div#contact {
position: absolute;
top: 410px;
left: 25px;
width: 290px;
}
div#allcontent {
width: 100%;
height: 100%;
min-height: 100%;
}
div#poweredby {
position: fixed;
left: 0px;
bottom: 0px;
width: 1020px;
height: 50px;
text-align: center;
display: table-cell;
background-color: #FFFFFF;
}
div#beforefooter {
margin-bottom: 50px;
}
.smallnote {
font-size: 10px;
}
div#codecolumn {
float: left;
padding: 0px 10px;
width: 700px;
}
div#selectcolumn {
float: left;
max-width: 320px;
padding: 10px;
}
img {
border-style: none;
border-width: 0px;
margin: 0px;
}
hr {
border: none 0;
border-top: 1px dashed #000;
height: 1px;
margin-top: 0px;
margin-bottom: 10px;
}
ul {
list-style-type: square;
}
li {
margin-bottom: 5px;
}
#askbutton {
margin: 460px 0px 5px 0px;
background-color: transparent;
border: 1px solid #666666;
width: 700px;
}
td.date {
text-align:right;
}
div#codebox {
border-style: none;
background-color: #eee;
border: 1px dashed #333;
width: 700px;
height: 450px;
position: absolute;
}
textarea#consolebox {
font-family: "Lucida Console", monospace;
font-size: 11px;
width: 700px;
height: 250px;
border: none;
background-color: #EEEEEE;
padding: 0px;
margin: 0px;
resize: vertical;
}
.consoletext {
font-family: "Lucida Console", monospace;
font-size: 11px;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment