diff --git a/web/app/controllers/Application.scala b/web/app/controllers/Application.scala index dbff3fa47832c96343da12872e4b5460af15a600..ccec9b1ad876a0d24ed00a45e7ccc2f9ebc31147 100644 --- a/web/app/controllers/Application.scala +++ b/web/app/controllers/Application.scala @@ -15,7 +15,10 @@ object Application extends Controller { val examples = VerificationExamples.allExamples def index = Action { implicit request => - Ok(views.html.index(examples, VerificationExamples.default)) + val prefix = Play.current.configuration.getString("app.prefix").getOrElse("") + val wsURL = Play.current.configuration.getString("app.wsURL").getOrElse(routes.Application.openConsole().webSocketURL()) + + Ok(views.html.index(examples, VerificationExamples.default, prefix, wsURL)) } def getExample(id: Int) = Action { diff --git a/web/app/models/LeonConsole.scala b/web/app/models/LeonConsole.scala index eac20b8c5af077994d337200ed66eb5b7c0318af..ad26ea4f0c4b9db903565d2e98d5e4b31ace797f 100644 --- a/web/app/models/LeonConsole.scala +++ b/web/app/models/LeonConsole.scala @@ -20,9 +20,6 @@ import leon.{LeonContext, Settings, Reporter} import leon.plugin.{TemporaryInputPhase, ExtractionPhase} import leon.verification.AnalysisPhase -import scala.tools.util.PathResolver - - object LeonConsole { def open: Promise[(Iteratee[JsValue,_],Enumerator[JsValue])] = { import ConsoleProtocol._ diff --git a/web/app/views/index.scala.html b/web/app/views/index.scala.html index 09e192c5e9ca3f183f9001ffbeb5c271d6803dc6..66848e7e198fc22ed92ea7b8d177e621b018532e 100644 --- a/web/app/views/index.scala.html +++ b/web/app/views/index.scala.html @@ -1,6 +1,6 @@ -@(exs: List[examples.Example], default: examples.Example)(implicit request: RequestHeader) +@(exs: List[examples.Example], default: examples.Example, prefix: String, websocketURL: String)(implicit request: RequestHeader) -@main("Leon Online") { +@main("Leon Online", prefix) { <div id="allcontent"> <div id="title" class="contentbox"></div> @@ -30,7 +30,7 @@ <script> $(document).ready(function() { var WS = window['MozWebSocket'] ? MozWebSocket : WebSocket - var leonSocket = new WS("@leon.web.controllers.routes.Application.openConsole().webSocketURL()") + var leonSocket = new WS("@websocketURL") var sendMessage = function() { } diff --git a/web/app/views/main.scala.html b/web/app/views/main.scala.html index dd6092d062a4938cf7f339ba2938da1373eb55e4..5700f9bbfed714867bfcb3eca2a42e21cd530988 100644 --- a/web/app/views/main.scala.html +++ b/web/app/views/main.scala.html @@ -1,15 +1,15 @@ -@(title: String)(content: Html) +@(title: String, prefix: 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> + <link href="@prefix@routes.Assets.at("images/lambda-ico.png")" type="image/png" rel="icon"> + <link rel="stylesheet" media="screen" href="@prefix@routes.Assets.at("stylesheets/leon.css")"> + <script src="@prefix@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> + <script src="@prefix@routes.Assets.at("javascripts/leon.js")" type="text/javascript"></script> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body> diff --git a/web/conf/application.conf b/web/conf/application.conf index 15ffcdf264a6e7b9d218fea869511394004f9f7c..4b8aada8edc68c8a00c7a1f832886a748e2aa2b4 100644 --- a/web/conf/application.conf +++ b/web/conf/application.conf @@ -45,3 +45,8 @@ logger.play=INFO # Logger provided to your application: logger.application=DEBUG +# This specifies the prefix under which the web page lies, used almost exclusively for the laraserver setup +# app.prefix=/leon + +# Defines a specific URL to the websocket service +# app.wsURL="ws://laraserver.epfl.ch:9000/openConsole" diff --git a/web/public/stylesheets/leon.css b/web/public/stylesheets/leon.css index c60ac99045f25878587d85706faf7a3ad7ac0e32..ba33626931c1fddd6ac13b84d951abf9db16aaaa 100644 --- a/web/public/stylesheets/leon.css +++ b/web/public/stylesheets/leon.css @@ -6,7 +6,7 @@ body { font-family: Arial, Helvetica, Sans-serif; margin: 0px; padding: 0px; - background-image: url('/assets/images/lionbkg.png'); + background-image: url('../images/lionbkg.png'); background-color: #FFFFFF; background-repeat: no-repeat; background-position: 25px 15px; @@ -52,7 +52,7 @@ div#title { width: 700px; min-height: 80px; max-height: 80px; - background-image: url('/assets/images/leonlogo.png'); + background-image: url('../images/leonlogo.png'); background-repeat: no-repeat; background-position: right bottom; }