Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gate
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openmole
gate
Commits
a7af82c1
Commit
a7af82c1
authored
Aug 13, 2014
by
Mathieu leclaire
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get ride off Scalate !
parent
3e763aa1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
67 deletions
+17
-67
ScalaTraJSTagsWireRxBuild.scala
project/ScalaTraJSTagsWireRxBuild.scala
+2
-2
MyScalatraServlet.scala
server/src/main/scala/fr/iscpif/app/MyScalatraServlet.scala
+15
-4
ServertestStack.scala
server/src/main/scala/fr/iscpif/app/ServertestStack.scala
+0
-39
default.jade
server/src/main/webapp/default.jade
+0
-8
scaladget-index.html
server/src/main/webapp/scaladget-index.html
+0
-14
No files found.
project/ScalaTraJSTagsWireRxBuild.scala
View file @
a7af82c1
...
...
@@ -35,7 +35,7 @@ object ScalaTraJSTagsWireRxBuild extends Build {
"org.scala-lang.modules.scalajs"
%%%
"scalajs-dom"
%
"0.6"
,
"org.scala-lang.modules.scalajs"
%%%
"scalajs-jquery"
%
"0.6"
),
jsCall
:=
"Client().run();"
,
//
jsCall := "Client().run();",
outputPath
:=
"server/src/main/webapp/"
)
).
dependsOn
(
shared
)
...
...
@@ -52,9 +52,9 @@ object ScalaTraJSTagsWireRxBuild extends Build {
libraryDependencies
++=
Seq
(
"com.lihaoyi"
%%
"autowire"
%
"0.1.2"
,
"com.lihaoyi"
%%%
"upickle"
%
"0.2.1"
,
"com.scalatags"
%%%
"scalatags"
%
"0.4.0"
,
"org.scala-lang.modules.scalajs"
%%%
"scalajs-dom"
%
"0.6"
,
"org.scalatra"
%%
"scalatra"
%
ScalatraVersion
,
"org.scalatra"
%%
"scalatra-scalate"
%
ScalatraVersion
,
"org.scalatra"
%%
"scalatra-specs2"
%
ScalatraVersion
%
"test"
,
"ch.qos.logback"
%
"logback-classic"
%
"1.0.12"
%
"runtime"
,
"org.eclipse.jetty"
%
"jetty-webapp"
%
"8.1.8.v20121106"
%
"container"
,
...
...
server/src/main/scala/fr/iscpif/app/MyScalatraServlet.scala
View file @
a7af82c1
...
...
@@ -10,26 +10,37 @@ import shared._
import
upickle._
import
scala.concurrent.duration._
import
scala.concurrent.Await
import
scalatags.Text.all._
import
scalatags.Text.
{
all
=>
tags
}
object
Server
extends
Api
{
def
hello
(
a
:
Int
)
=
a
*
3
def
caseClass
=
MyCaseClass
(
"Hello !"
)
}
class
MyScalatraServlet
extends
S
ervertestStack
{
class
MyScalatraServlet
extends
S
calatraServlet
{
val
basePath
=
"shared"
get
(
"/"
)
{
contentType
=
"text/html"
jade
(
"/default.jade"
)
tags
.
html
(
tags
.
head
(
tags
.
meta
(
tags
.
httpEquiv
:=
"Content-Type"
,
tags
.
content
:=
"text/html; charset=UTF-8"
),
tags
.
script
(
tags
.
`type`
:=
"text/javascript"
,
tags
.
src
:=
"js/client-fastopt.js"
),
tags
.
script
(
tags
.
`type`
:=
"text/javascript"
,
tags
.
src
:=
"js/client-opt.js"
)
),
tags
.
body
(
tags
.
onload
:=
"Client().run();"
)
)
}
post
(
s
"/$basePath/*"
)
{
Await
.
result
(
autowire
.
Macros
.
route
[
Web
](
Server
)(
autowire
.
Request
(
Seq
(
basePath
)
++
multiParams
(
"splat"
).
head
.
split
(
"/"
),
upickle
.
read
[
Map
[
String
,
String
]](
request
.
body
))
),
Duration
.
Inf
)
),
Duration
.
Inf
)
}
}
}
\ No newline at end of file
server/src/main/scala/fr/iscpif/app/ServertestStack.scala
deleted
100644 → 0
View file @
3e763aa1
package
fr.iscpif.app
import
org.scalatra._
import
scalate.ScalateSupport
import
org.fusesource.scalate.
{
TemplateEngine
,
Binding
}
import
org.fusesource.scalate.layout.DefaultLayoutStrategy
import
javax.servlet.http.HttpServletRequest
import
collection.mutable
trait
ServertestStack
extends
ScalatraServlet
with
ScalateSupport
{
/* wire up the precompiled templates */
override
protected
def
defaultTemplatePath
:
List
[
String
]
=
List
(
"/WEB-INF/templates/views"
)
override
protected
def
createTemplateEngine
(
config
:
ConfigT
)
=
{
val
engine
=
super
.
createTemplateEngine
(
config
)
engine
.
layoutStrategy
=
new
DefaultLayoutStrategy
(
engine
,
TemplateEngine
.
templateTypes
.
map
(
"/WEB-INF/templates/layouts/default."
+
_
)
:
_
*
)
engine
.
packagePrefix
=
"templates"
engine
}
/* end wiring up the precompiled templates */
override
protected
def
templateAttributes
(
implicit
request
:
HttpServletRequest
)
:
mutable.Map
[
String
,
Any
]
=
{
super
.
templateAttributes
++
mutable
.
Map
.
empty
// Add extra attributes here, they need bindings in the build file
}
notFound
{
// remove content type in case it was set through an action
contentType
=
null
// Try to render a ScalateTemplate if no route matched
findTemplate
(
requestPath
)
map
{
path
=>
contentType
=
"text/html"
layoutTemplate
(
path
)
}
orElse
serveStaticResource
()
getOrElse
resourceNotFound
()
}
}
server/src/main/webapp/default.jade
deleted
100644 → 0
View file @
3e763aa1
html
head
meta(charset="utf-8")
script(type="text/javascript" src="js/client-fastopt.js")
script(type="text/javascript" src="js/client-opt.js")
body
script="Client().run();"
\ No newline at end of file
server/src/main/webapp/scaladget-index.html
deleted
100644 → 0
View file @
3e763aa1
<html>
<head>
<meta
charset=
"utf-8"
>
<link
rel=
"stylesheet"
href=
"css/bootstrap.min.css"
/>
<script
type=
"text/javascript"
src=
"js/d3.v3.min.js"
></script>
<script
type=
"text/javascript"
src=
"js/jquery-2.1.1.min.js"
></script>
<script
type=
"text/javascript"
src=
"js/bootstrap.min.js"
></script>
<script
type=
"text/javascript"
src=
"js/ui-opt.js"
></script>
<script
type=
"text/javascript"
src=
"js/ui-fastopt.js"
></script>
</head>
<body>
<script>
Plot
().
run
();
</script>
</body>
</html>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment