File tree 12 files changed +54
-45
lines changed
src/main/scala/io/udash/demos/jquery/views
12 files changed +54
-45
lines changed Original file line number Diff line number Diff line change 1
1
language : scala
2
+ dist : trusty
2
3
4
+ jdk : oraclejdk8
3
5
scala :
4
6
- 2.11.8
7
+ - 2.12.1
8
+
9
+ before_script :
10
+ - " export DISPLAY=:99.0"
11
+ - " sh -e /etc/init.d/xvfb start"
12
+ - sleep 3 # give xvfb some time to start
13
+ # Instal google-chrome
14
+ - export CHROME_BIN=/usr/bin/google-chrome
15
+ - sudo apt-get update
16
+ - sudo apt-get install -y libappindicator1 fonts-liberation
17
+ - wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
18
+ - sudo dpkg -i google-chrome*.deb
19
+ # Install Selenium chromedriver
20
+ - wget http://chromedriver.storage.googleapis.com/2.25/chromedriver_linux64.zip
21
+ - unzip chromedriver_linux64.zip -d selenium-bin
22
+ - export PATH=$PWD/selenium-bin:$PATH
5
23
6
24
script :
7
- - sbt ++$TRAVIS_SCALA_VERSION test
8
- - cd example && sbt ++$TRAVIS_SCALA_VERSION compile
25
+ - sbt ++$TRAVIS_SCALA_VERSION "set (jsEnv in Test := new org.scalajs.jsenv.selenium.SeleniumJSEnv(org.scalajs.jsenv.selenium.Chrome))" test
26
+ - sbt ++$TRAVIS_SCALA_VERSION publishLocal
27
+ # - cd example && sbt ++$TRAVIS_SCALA_VERSION compile
Original file line number Diff line number Diff line change
1
+
1
2
name := " udash-jquery"
2
3
3
- version := " 1.0.0 "
4
+ version := " 1.0.1 "
4
5
organization := " io.udash"
5
- scalaVersion := " 2.11.8"
6
+ scalaVersion := " 2.12.1"
7
+ crossScalaVersions := Seq (" 2.11.8" , " 2.12.1" )
6
8
scalacOptions in ThisBuild ++= Seq (
7
9
" -feature" ,
8
10
" -deprecation" ,
@@ -15,14 +17,16 @@ scalacOptions in ThisBuild ++= Seq(
15
17
" -Xlint:_,-missing-interpolator,-adapted-args"
16
18
)
17
19
20
+ jsEnv in Test := new org.scalajs.jsenv.selenium.SeleniumJSEnv (org.scalajs.jsenv.selenium.Firefox )
21
+
18
22
libraryDependencies ++= Seq (
19
- " org.scala-js" %%% " scalajs-dom" % " 0.9.0 " ,
20
- " org.scalatest" %%% " scalatest" % " 3.0.0-M15 " % Test ,
21
- " com.lihaoyi" %%% " scalatags" % " 0.5.4 " % Test
23
+ " org.scala-js" %%% " scalajs-dom" % " 0.9.1 " ,
24
+ " org.scalatest" %%% " scalatest" % " 3.0.1 " % Test ,
25
+ " com.lihaoyi" %%% " scalatags" % " 0.6.2 " % Test
22
26
)
23
27
24
28
jsDependencies +=
25
- " org.webjars" % " jquery" % " 2.2.3 " / " 2.2.3 /jquery.js" minified " 2.2.3 /jquery.min.js"
29
+ " org.webjars" % " jquery" % " 2.2.4 " / " 2.2.4 /jquery.js" minified " 2.2.4 /jquery.min.js"
26
30
27
31
requiresDOM in Test := true
28
32
persistLauncher in Test := false
Original file line number Diff line number Diff line change 1
1
name := " jquery-demo"
2
2
3
- version in ThisBuild := " 1.0.0 -SNAPSHOT"
3
+ version in ThisBuild := " 1.0.1 -SNAPSHOT"
4
4
scalaVersion in ThisBuild := " 2.11.8"
5
5
organization in ThisBuild := " io.udash"
6
6
crossPaths in ThisBuild := false
@@ -16,12 +16,6 @@ scalacOptions in ThisBuild ++= Seq(
16
16
" -Xlint:_,-missing-interpolator,-adapted-args"
17
17
)
18
18
19
- // TODO: remove it after scala-js-jquery 1.0 release
20
- externalResolvers in ThisBuild := Seq (
21
- DefaultMavenRepository ,
22
- Resolver .file(" local" , file(System .getProperty(" user.home" ) + " /.ivy2/local" ))(Resolver .ivyStylePatterns)
23
- )
24
-
25
19
val generatedDir = file(" generated" )
26
20
val `jquery-demo` = project.in(file(" ." )).enablePlugins(ScalaJSPlugin )
27
21
.settings(
Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
2
2
import sbt ._
3
3
4
4
object Dependencies extends Build {
5
- val udashCoreVersion = " 0.1.1 "
6
- val udashJQueryVersion = " 1.0.0 "
5
+ val udashCoreVersion = " 0.4.0 "
6
+ val udashJQueryVersion = " 1.0.1 "
7
7
8
8
val deps = Def .setting(Seq [ModuleID ](
9
9
" io.udash" %%% " udash-core-frontend" % udashCoreVersion,
Original file line number Diff line number Diff line change 1
- sbt.version = 0.13.11
1
+ sbt.version = 0.13.13
Original file line number Diff line number Diff line change 1
1
logLevel := Level .Warn
2
- addSbtPlugin(" org.scala-js" % " sbt-scalajs" % " 0.6.8 " )
2
+ addSbtPlugin(" org.scala-js" % " sbt-scalajs" % " 0.6.13 " )
Original file line number Diff line number Diff line change @@ -6,14 +6,9 @@ import org.scalajs.dom.Element
6
6
7
7
object ErrorViewPresenter extends DefaultViewPresenterFactory [IndexState .type ](() => new ErrorView )
8
8
9
- class ErrorView extends View {
9
+ class ErrorView extends FinalView {
10
10
import scalatags .JsDom .all ._
11
11
12
- private val content = h3(
13
- " URL not found!"
14
- ).render
15
-
16
- override def getTemplate : Element = content
17
-
18
- override def renderChild (view : View ): Unit = {}
12
+ override def getTemplate : Modifier =
13
+ h3(" URL not found!" )
19
14
}
Original file line number Diff line number Diff line change @@ -3,13 +3,13 @@ package io.udash.demos.jquery.views
3
3
import io .udash ._
4
4
import org .scalajs .dom .{Element , Event }
5
5
6
- abstract class FunctionView extends View {
6
+ abstract class FunctionView extends FinalView {
7
7
import scalatags .JsDom .all ._
8
8
9
9
protected val content : Element
10
10
protected val script : () => Any
11
11
12
- override def getTemplate : Element = {
12
+ override def getTemplate : Modifier =
13
13
div(
14
14
content,
15
15
button(
@@ -18,8 +18,5 @@ abstract class FunctionView extends View {
18
18
false
19
19
})
20
20
)(" Run script" )
21
- ).render
22
- }
23
-
24
- override def renderChild (view : View ): Unit = {}
21
+ )
25
22
}
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import org.scalajs.dom.Element
6
6
7
7
object IndexViewPresenter extends DefaultViewPresenterFactory [IndexState .type ](() => new IndexView )
8
8
9
- class IndexView extends View {
9
+ class IndexView extends FinalView {
10
10
import Context ._
11
11
12
12
import scalatags .JsDom .all ._
@@ -29,9 +29,7 @@ class IndexView extends View {
29
29
li(a(href := OnOneOffState .url)(" .on() & .one() & .off()" )),
30
30
li(a(href := OffsetPositionState .url)(" .offset() & .position()" ))
31
31
)
32
- ).render
32
+ )
33
33
34
- override def getTemplate : Element = content
35
-
36
- override def renderChild (view : View ): Unit = {}
34
+ override def getTemplate : Modifier = content
37
35
}
Original file line number Diff line number Diff line change @@ -16,14 +16,14 @@ class RootView extends View {
16
16
private val content = div(
17
17
a(href := IndexState .url)(h1(" jquery-demo" )),
18
18
child
19
- ).render
19
+ )
20
20
21
- override def getTemplate : Element = content
21
+ override def getTemplate : Modifier = content
22
22
23
23
override def renderChild (view : View ): Unit = {
24
24
import io .udash .wrappers .jquery ._
25
- val newChild = view.getTemplate
26
- jQ(child).replaceWith(newChild )
27
- child = newChild
25
+
26
+ jQ(child).children().remove( )
27
+ view.getTemplate.applyTo( child)
28
28
}
29
29
}
Original file line number Diff line number Diff line change 1
- sbt.version = 0.13.11
1
+ sbt.version = 0.13.13
Original file line number Diff line number Diff line change 1
1
logLevel := Level .Warn
2
2
3
- addSbtPlugin(" org.scala-js" % " sbt-scalajs" % " 0.6.9" )
3
+ addSbtPlugin(" org.scala-js" % " sbt-scalajs" % " 0.6.13" )
4
+
5
+ libraryDependencies += " org.scala-js" %% " scalajs-env-selenium" % " 0.1.3"
You can’t perform that action at this time.
0 commit comments