From 138a7f0a8ae4f7eebd1369976f667afa8015a225 Mon Sep 17 00:00:00 2001
From: starzu
Date: Thu, 28 Jan 2016 08:58:43 +0100
Subject: [PATCH 01/44] Deployment configuration
---
build.sbt | 35 +++++++++++++++++++++++++++++++++++
project/plugins.sbt | 4 ++++
2 files changed, 39 insertions(+)
diff --git a/build.sbt b/build.sbt
index 36e1b7f..cae2d61 100644
--- a/build.sbt
+++ b/build.sbt
@@ -30,3 +30,38 @@ scalaJSUseRhino in Test := false
lazy val root = project.in(file("."))
.enablePlugins(ScalaJSPlugin)
+
+// Deployment configuration
+publishMavenStyle := true
+publishArtifact in Test := false
+pomIncludeRepository := { _ => false }
+
+publishTo := {
+ val nexus = "https://oss.sonatype.org/"
+ if (isSnapshot.value)
+ Some("snapshots" at nexus + "content/repositories/snapshots")
+ else
+ Some("releases" at nexus + "service/local/staging/deploy/maven2")
+}
+
+pomExtra := {
+ https://github.com/UdashFramework/scala-js-jquery
+
+
+ Apache v.2 License
+ http://www.apache.org/licenses/LICENSE-2.0.txt
+ repo
+
+
+
+ git@github.com:UdashFramework/scala-js-jquery.git
+ scm:git@github.com:UdashFramework/scala-js-jquery.git
+
+
+
+ avsystem
+ AVSystem
+ http://www.avsystem.com/
+
+
+}
diff --git a/project/plugins.sbt b/project/plugins.sbt
index e513ea5..afe60eb 100755
--- a/project/plugins.sbt
+++ b/project/plugins.sbt
@@ -1,3 +1,7 @@
logLevel := Level.Warn
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.9")
+
+// Deployment configuration
+addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0")
+addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "1.1")
\ No newline at end of file
From 57c8e2f017808ee0e17ab920568d6e6b26cc8b4b Mon Sep 17 00:00:00 2001
From: Mateusz Starzec
Date: Tue, 22 Jan 2019 14:28:05 +0100
Subject: [PATCH 02/44] v3.0.1
---
build.sbt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/build.sbt b/build.sbt
index ead37eb..b76070c 100644
--- a/build.sbt
+++ b/build.sbt
@@ -3,7 +3,7 @@ import org.openqa.selenium.chrome.ChromeOptions
name := "udash-jquery"
inThisBuild(Seq(
- version := "3.0.0",
+ version := "3.0.1",
organization := "io.udash",
))
From 4968d5f983f143323eac1458cc450b764d2694d5 Mon Sep 17 00:00:00 2001
From: ddworak
Date: Tue, 15 Oct 2019 06:57:25 +0200
Subject: [PATCH 03/44] Update deployment plugins
---
project/plugins.sbt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/project/plugins.sbt b/project/plugins.sbt
index c32bd8f..2b1dd16 100755
--- a/project/plugins.sbt
+++ b/project/plugins.sbt
@@ -6,5 +6,5 @@ addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.29")
addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.15.0-0.6")
// Deployment configuration
-addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.2")
-addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.3")
\ No newline at end of file
+addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.0-M2")
+addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.4")
\ No newline at end of file
From 016f3d79ae27375e05238eb0065206f04e7ccb14 Mon Sep 17 00:00:00 2001
From: ddworak
Date: Wed, 18 Mar 2020 14:50:46 +0100
Subject: [PATCH 04/44] Dependency upgrades
---
build.sbt | 43 ++-----------------
project/build.properties | 2 +-
project/plugins.sbt | 8 ++--
.../jquery_test/DomManipulationTest.scala | 6 ++-
.../jquery_test/EventsHandlingTest.scala | 9 ++--
.../jquery_test/MiscellaneousTest.scala | 10 +++--
.../wrappers/jquery_test/SelectorsTest.scala | 6 ++-
.../wrappers/jquery_test/TraversingTest.scala | 7 +--
8 files changed, 33 insertions(+), 58 deletions(-)
diff --git a/build.sbt b/build.sbt
index 8902567..4ca74b7 100644
--- a/build.sbt
+++ b/build.sbt
@@ -3,7 +3,7 @@
name := "udash-jquery"
inThisBuild(Seq(
- version := "3.0.2",
+ version := "3.0.3",
organization := "io.udash",
))
@@ -50,46 +50,11 @@ lazy val root = project.in(file("."))
commonJSSettings,
libraryDependencies ++= Seq(
- "org.scala-js" %%% "scalajs-dom" % "0.9.7",
- "org.scalatest" %%% "scalatest" % "3.0.8" % Test,
- "com.lihaoyi" %%% "scalatags" % "0.7.0" % Test
+ "org.scala-js" %%% "scalajs-dom" % "0.9.8",
+ "org.scalatest" %%% "scalatest" % "3.1.1" % Test,
+ "com.lihaoyi" %%% "scalatags" % "0.8.6" % Test
),
Compile / npmDependencies += "jquery" -> "3.3.1",
Test / requireJsDomEnv := true
)
-
-// Deployment configuration
-publishMavenStyle := true
-publishArtifact in Test := false
-pomIncludeRepository := { _ => false }
-
-publishTo := {
- val nexus = "https://oss.sonatype.org/"
- if (isSnapshot.value)
- Some("snapshots" at nexus + "content/repositories/snapshots")
- else
- Some("releases" at nexus + "service/local/staging/deploy/maven2")
-}
-
-pomExtra := {
- https://github.com/UdashFramework/scala-js-jquery
-
-
- Apache v.2 License
- http://www.apache.org/licenses/LICENSE-2.0.txt
- repo
-
-
-
- git@github.com:UdashFramework/scala-js-jquery.git
- scm:git@github.com:UdashFramework/scala-js-jquery.git
-
-
-
- avsystem
- AVSystem
- http://www.avsystem.com/
-
-
-}
diff --git a/project/build.properties b/project/build.properties
index ebcc8ac..c9c5a37 100755
--- a/project/build.properties
+++ b/project/build.properties
@@ -1,2 +1,2 @@
# suppress inspection "UnusedProperty"
-sbt.version=1.3.2
\ No newline at end of file
+sbt.version=1.3.8
\ No newline at end of file
diff --git a/project/plugins.sbt b/project/plugins.sbt
index 2b1dd16..ea0423d 100755
--- a/project/plugins.sbt
+++ b/project/plugins.sbt
@@ -2,9 +2,9 @@ logLevel := Level.Warn
libraryDependencies += "org.scala-js" %% "scalajs-env-selenium" % "0.3.0"
-addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.29")
-addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.15.0-0.6")
+addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.32")
+addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler-sjs06" % "0.17.0")
// Deployment configuration
-addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.0-M2")
-addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.4")
\ No newline at end of file
+addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.0")
+addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.8.1")
\ No newline at end of file
diff --git a/src/test/scala/io/udash/wrappers/jquery_test/DomManipulationTest.scala b/src/test/scala/io/udash/wrappers/jquery_test/DomManipulationTest.scala
index ede038d..d16b4cc 100644
--- a/src/test/scala/io/udash/wrappers/jquery_test/DomManipulationTest.scala
+++ b/src/test/scala/io/udash/wrappers/jquery_test/DomManipulationTest.scala
@@ -1,8 +1,10 @@
package io.udash.wrappers.jquery_test
-import org.scalatest.{Matchers, WordSpec}
+import org.scalatest.matchers.should.Matchers
+import org.scalatest.wordspec.AnyWordSpec
+
+class DomManipulationTest extends AnyWordSpec with Matchers {
-class DomManipulationTest extends WordSpec with Matchers {
import io.udash.wrappers.jquery._
import scalatags.JsDom.all._
diff --git a/src/test/scala/io/udash/wrappers/jquery_test/EventsHandlingTest.scala b/src/test/scala/io/udash/wrappers/jquery_test/EventsHandlingTest.scala
index 42fea1c..710fa0a 100644
--- a/src/test/scala/io/udash/wrappers/jquery_test/EventsHandlingTest.scala
+++ b/src/test/scala/io/udash/wrappers/jquery_test/EventsHandlingTest.scala
@@ -1,10 +1,13 @@
+package io.udash.wrappers.jquery_test
+
import org.scalajs.dom.Element
import org.scalajs.dom.html.Input
-import org.scalatest.{Matchers, WordSpec}
+import org.scalatest.matchers.should.Matchers
+import org.scalatest.wordspec.AnyWordSpec
-class EventsHandlingTest extends WordSpec with Matchers {
- import io.udash.wrappers.jquery._
+class EventsHandlingTest extends AnyWordSpec with Matchers {
+ import io.udash.wrappers.jquery._
import scalatags.JsDom.all._
class C(i: Int)
diff --git a/src/test/scala/io/udash/wrappers/jquery_test/MiscellaneousTest.scala b/src/test/scala/io/udash/wrappers/jquery_test/MiscellaneousTest.scala
index 95b3953..4d32382 100644
--- a/src/test/scala/io/udash/wrappers/jquery_test/MiscellaneousTest.scala
+++ b/src/test/scala/io/udash/wrappers/jquery_test/MiscellaneousTest.scala
@@ -1,10 +1,11 @@
package io.udash.wrappers.jquery_test
-import org.scalatest.{Matchers, WordSpec}
+import org.scalatest.matchers.should.Matchers
+import org.scalatest.wordspec.AnyWordSpec
-class MiscellaneousTest extends WordSpec with Matchers {
- import io.udash.wrappers.jquery._
+class MiscellaneousTest extends AnyWordSpec with Matchers {
+ import io.udash.wrappers.jquery._
import scalatags.JsDom.all._
class C(i: Int)
@@ -45,7 +46,8 @@ class MiscellaneousTest extends WordSpec with Matchers {
}
"serialize objects to URL query string" in {
- import scala.scalajs.js, js.JSConverters._
+ import scala.scalajs.js
+ import js.JSConverters._
jQ.param(js.Dynamic.literal("a" -> Seq(1, 2, 3).toJSArray, "b" -> "c")) should be("a%5B%5D=1&a%5B%5D=2&a%5B%5D=3&b=c")
}
}
diff --git a/src/test/scala/io/udash/wrappers/jquery_test/SelectorsTest.scala b/src/test/scala/io/udash/wrappers/jquery_test/SelectorsTest.scala
index 6654210..61ea636 100644
--- a/src/test/scala/io/udash/wrappers/jquery_test/SelectorsTest.scala
+++ b/src/test/scala/io/udash/wrappers/jquery_test/SelectorsTest.scala
@@ -1,8 +1,10 @@
package io.udash.wrappers.jquery_test
-import org.scalatest.{Matchers, WordSpec}
+import org.scalatest.matchers.should.Matchers
+import org.scalatest.wordspec.AnyWordSpec
+
+class SelectorsTest extends AnyWordSpec with Matchers {
-class SelectorsTest extends WordSpec with Matchers {
import io.udash.wrappers.jquery._
import scalatags.JsDom.all._
diff --git a/src/test/scala/io/udash/wrappers/jquery_test/TraversingTest.scala b/src/test/scala/io/udash/wrappers/jquery_test/TraversingTest.scala
index 1400684..82116cf 100644
--- a/src/test/scala/io/udash/wrappers/jquery_test/TraversingTest.scala
+++ b/src/test/scala/io/udash/wrappers/jquery_test/TraversingTest.scala
@@ -1,10 +1,11 @@
package io.udash.wrappers.jquery_test
-import org.scalatest.{Matchers, WordSpec}
+import org.scalatest.matchers.should.Matchers
+import org.scalatest.wordspec.AnyWordSpec
-class TraversingTest extends WordSpec with Matchers {
- import io.udash.wrappers.jquery._
+class TraversingTest extends AnyWordSpec with Matchers {
+ import io.udash.wrappers.jquery._
import scalatags.JsDom.all._
"jQuery" should {
From 1c7a60e8c8932b1c218741ed930f5509bdd7b4a9 Mon Sep 17 00:00:00 2001
From: ddworak
Date: Wed, 18 Mar 2020 15:36:22 +0100
Subject: [PATCH 05/44] Bundler-only demo
---
example/build.sbt | 44 ++-----------------
.../global-demo/src/main/assets/index.html | 13 ------
example/project/Dependencies.scala | 7 +--
example/project/build.properties | 2 +-
example/project/plugins.sbt | 4 +-
.../src/main/assets/index.html | 0
6 files changed, 8 insertions(+), 62 deletions(-)
delete mode 100644 example/global-demo/src/main/assets/index.html
rename example/{bundler-demo => }/src/main/assets/index.html (100%)
diff --git a/example/build.sbt b/example/build.sbt
index 04eeabb..8f85222 100644
--- a/example/build.sbt
+++ b/example/build.sbt
@@ -1,13 +1,13 @@
name := "jquery-demo"
inThisBuild(Seq(
- version := "3.0.1",
+ version := "3.0.2",
organization := "io.udash",
))
val commonSettings = Seq(
scalaVersion := "2.12.10",
- crossScalaVersions := Seq("2.12.10"), //todo 2.13
+ crossScalaVersions := Seq("2.12.10"), //todo 2.13 & SJS 1.0 with Udash 0.9
scalacOptions ++= Seq(
"-feature",
"-deprecation",
@@ -33,46 +33,10 @@ val root = project.in(file("."))
.enablePlugins(ScalaJSPlugin)
.settings(commonSettings)
-val `jquery-global-demo` = project.in(file("global-demo"))
- .enablePlugins(ScalaJSPlugin)
- .settings(
- commonSettings,
-
- jsDependencies ++= Dependencies.jsDeps.value,
-
- sourceDirsSettings(_.getParentFile),
-
- /* move these files out of target/. */
- Compile / fullOptJS / crossTarget := generatedGlobalDir,
- Compile / fastOptJS / crossTarget := generatedGlobalDir,
- Compile / packageJSDependencies / crossTarget := generatedGlobalDir,
- Compile / packageMinifiedJSDependencies / crossTarget := generatedGlobalDir,
-
- Compile / fastOptJS := (Compile / fastOptJS).dependsOn(copyAssets).value,
- Compile / fullOptJS := (Compile / fullOptJS).dependsOn(copyAssets).value,
-
- scalaJSUseMainModuleInitializer := true,
-
- copyAssets := {
- IO.copyFile(
- sourceDirectory.value / "main/assets/index.html",
- generatedGlobalDir / "index.html"
- )
- },
-
- Compile / fastOptJS / artifactPath :=
- (Compile / fastOptJS / crossTarget).value / "scripts" / "frontend-impl.js",
- Compile / fullOptJS / artifactPath :=
- (Compile / fullOptJS / crossTarget).value / "scripts" / "frontend-impl.js",
- Compile / packageJSDependencies / artifactPath :=
- (Compile / packageJSDependencies / crossTarget).value / "scripts" / "frontend-deps.js",
- Compile / packageMinifiedJSDependencies / artifactPath :=
- (Compile / packageMinifiedJSDependencies / crossTarget).value / "scripts" / "frontend-deps.js"
- )
-
val generatedBundlerDir = file("generated/bundler")
val compileStatics = taskKey[Unit]("Compiles all static files.")
-val `jquery-bundler-demo` = project.in(file("bundler-demo"))
+
+val example = project.in(file("."))
.enablePlugins(ScalaJSBundlerPlugin)
.settings(
commonSettings,
diff --git a/example/global-demo/src/main/assets/index.html b/example/global-demo/src/main/assets/index.html
deleted file mode 100644
index b746eab..0000000
--- a/example/global-demo/src/main/assets/index.html
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
- jquery-demo - global scope
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/example/project/Dependencies.scala b/example/project/Dependencies.scala
index caa9172..32852d9 100644
--- a/example/project/Dependencies.scala
+++ b/example/project/Dependencies.scala
@@ -1,17 +1,12 @@
-import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport._
import sbt._
object Dependencies {
- val udashCoreVersion = "0.8.1"
+ val udashCoreVersion = "0.8.3"
val udashJQueryVersion = "3.0.2"
val deps = Def.setting(Seq[ModuleID](
"io.udash" %%% "udash-core" % udashCoreVersion,
"io.udash" %%% "udash-jquery" % udashJQueryVersion
))
-
- val jsDeps = Def.setting(Seq[org.scalajs.sbtplugin.JSModuleID](
- "org.webjars" % "jquery" % "3.3.1" / "3.3.1/jquery.js" minified "3.3.1/jquery.min.js"
- ))
}
\ No newline at end of file
diff --git a/example/project/build.properties b/example/project/build.properties
index ebcc8ac..c9c5a37 100644
--- a/example/project/build.properties
+++ b/example/project/build.properties
@@ -1,2 +1,2 @@
# suppress inspection "UnusedProperty"
-sbt.version=1.3.2
\ No newline at end of file
+sbt.version=1.3.8
\ No newline at end of file
diff --git a/example/project/plugins.sbt b/example/project/plugins.sbt
index cafe39a..c0848e6 100644
--- a/example/project/plugins.sbt
+++ b/example/project/plugins.sbt
@@ -1,4 +1,4 @@
logLevel := Level.Warn
-addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.29")
-addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.15.0-0.6")
\ No newline at end of file
+addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.32")
+addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler-sjs06" % "0.17.0")
\ No newline at end of file
diff --git a/example/bundler-demo/src/main/assets/index.html b/example/src/main/assets/index.html
similarity index 100%
rename from example/bundler-demo/src/main/assets/index.html
rename to example/src/main/assets/index.html
From b71ad988dd574d1f05c8b9604b5f25448a2fb3d8 Mon Sep 17 00:00:00 2001
From: ddworak
Date: Wed, 18 Mar 2020 15:40:02 +0100
Subject: [PATCH 06/44] SJS 1.0.1
---
build.sbt | 4 +---
project/plugins.sbt | 4 ++--
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/build.sbt b/build.sbt
index 4ca74b7..b330dc3 100644
--- a/build.sbt
+++ b/build.sbt
@@ -9,7 +9,7 @@ inThisBuild(Seq(
val commonSettings = Seq(
scalaVersion := "2.13.1",
- crossScalaVersions := Seq("2.12.10", "2.13.1"),
+ crossScalaVersions := Seq("2.12.11", "2.13.1"),
scalacOptions ++= Seq(
"-feature",
"-deprecation",
@@ -29,7 +29,6 @@ val commonSettings = Seq(
)
val commonJSSettings = Seq(
- Compile / emitSourceMaps := true,
Test / parallelExecution := false,
Test / scalaJSStage := FastOptStage,
// ScalaJSBundlerPlugin does not work with scalajs-env-selenium:
@@ -40,7 +39,6 @@ val commonJSSettings = Seq(
val githubDir = "https://raw.githubusercontent.com/UdashFramework/scala-js-jquery"
s"-P:scalajs:mapSourceURI:$localDir->$githubDir/v${version.value}/"
},
- scalacOptions += "-P:scalajs:sjsDefinedByDefault",
)
lazy val root = project.in(file("."))
diff --git a/project/plugins.sbt b/project/plugins.sbt
index ea0423d..ab16f2f 100755
--- a/project/plugins.sbt
+++ b/project/plugins.sbt
@@ -2,8 +2,8 @@ logLevel := Level.Warn
libraryDependencies += "org.scala-js" %% "scalajs-env-selenium" % "0.3.0"
-addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.32")
-addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler-sjs06" % "0.17.0")
+addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.0.1")
+addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.17.0")
// Deployment configuration
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.0")
From 70fabcf43a2335c14e6f5769f176cae67abb3635 Mon Sep 17 00:00:00 2001
From: ddworak
Date: Thu, 19 Mar 2020 07:13:01 +0100
Subject: [PATCH 07/44] CI cleanup
---
.travis.yml | 2 +-
example/build.sbt | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 56f862c..c1c2b6a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -23,4 +23,4 @@ before_script:
script:
- sbt +test +publishLocal
- - cd example && sbt compile jquery-global-demo/fullOptJS jquery-bundler-demo/compileStatics
\ No newline at end of file
+ - cd example && sbt compileStatics
\ No newline at end of file
diff --git a/example/build.sbt b/example/build.sbt
index 8f85222..422bf9d 100644
--- a/example/build.sbt
+++ b/example/build.sbt
@@ -33,7 +33,7 @@ val root = project.in(file("."))
.enablePlugins(ScalaJSPlugin)
.settings(commonSettings)
-val generatedBundlerDir = file("generated/bundler")
+val generatedBundlerDir = file("generated")
val compileStatics = taskKey[Unit]("Compiles all static files.")
val example = project.in(file("."))
From 949cb211a638a082f6ddfeb9f8e99d7a38dacaec Mon Sep 17 00:00:00 2001
From: ddworak
Date: Thu, 19 Mar 2020 08:17:23 +0100
Subject: [PATCH 08/44] Travis setup for releasing
---
.travis.yml | 49 ++++++++++++++++++++++++++++++++-----------------
travis.gpg.enc | Bin 0 -> 3712 bytes
2 files changed, 32 insertions(+), 17 deletions(-)
create mode 100644 travis.gpg.enc
diff --git a/.travis.yml b/.travis.yml
index c1c2b6a..86def1f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,26 +1,41 @@
-language: scala
dist: trusty
-
+language: scala
jdk: openjdk11
-
scala:
- 2.13.1
+stages:
+ - test
+ - name: release
+ if: tag =~ ^v
+
before_script:
- - "export DISPLAY=:99.0"
- - "sh -e /etc/init.d/xvfb start"
- - sleep 3 # give xvfb some time to start
- # Instal google-chrome
- - export CHROME_BIN=/usr/bin/google-chrome
- - sudo apt-get update
- - sudo apt-get install -y libappindicator1 fonts-liberation
- - wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
- - sudo dpkg -i google-chrome*.deb
- # Install Selenium chromedriver
- - wget http://chromedriver.storage.googleapis.com/2.38/chromedriver_linux64.zip
- - unzip chromedriver_linux64.zip -d selenium-bin
- - export PATH=$PWD/selenium-bin:$PATH
+ - wget https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux64.tar.gz
+ - mkdir geckodriver
+ - tar -xzf geckodriver-v0.24.0-linux64.tar.gz -C geckodriver
+ - export PATH=$PWD/geckodriver:$PATH
script:
- sbt +test +publishLocal
- - cd example && sbt compileStatics
\ No newline at end of file
+ - cd example && sbt compileStatics
+
+jobs:
+ include:
+ - stage: release
+ script:
+ - openssl aes-256-cbc -K $encrypted_f00a6d0a0202_key -iv $encrypted_f00a6d0a0202_iv -in travis/travis.gpg.enc -out travis/travis.gpg -d
+ - gpg --import travis/travis.gpg
+ - test $TRAVIS_PULL_REQUEST = "false" && sbt +publishSigned sonatypeBundleRelease
+
+before_cache:
+ # Cleanup the cached directories to avoid unnecessary cache updates
+ - rm -fv $HOME/.ivy2/.sbt.ivy.lock
+ - find $HOME/.ivy2/cache -name "ivydata-*.properties" -print -delete
+ - find $HOME/.sbt -name "*.lock" -print -delete
+
+cache:
+ directories:
+ - $HOME/.ivy2/cache
+ - $HOME/.m2
+ - $HOME/.cache
+ - $HOME/.sbt
\ No newline at end of file
diff --git a/travis.gpg.enc b/travis.gpg.enc
new file mode 100644
index 0000000000000000000000000000000000000000..399e4773eceb781b839288110f4eb79b00f9e135
GIT binary patch
literal 3712
zcmV-`4uA2*H7koBJ8%!iZTWF$!{Z-QD*oRFDW;sl!QySp%&UtFSA@?)Ezh1<@e
zau_=SuvL!Tpo3ELmII4Skngn(thtLkE10yq{iZL40@L~09np95yr5&jcTVrKD)X?Y
znm1{n@xL*E`PILmVck}3W>@|MDj@^jf}mWr%F4P~U7VGCHRmI`idtw5J;$7yMp&AO
zavvK2s?cc4f>NLgrFY?~KuMF|p+(OyvDq%^W*~{JTLk{p*mm6xqw^L9hKo}`PKc@0
z;AUAm{+EI@tpCfJH<0rFh`+-=UC}mJ6D!XH_b{#wcA?MAyC(*|pkyaj&oqBdKJts3JBd~|LY
zZZK>1#9%&WoE$Wo0qA5`$r>}EPv3}h-+Gp|*<}s%<`PZ(w97t8_>G^-90o!?w$|wP
zCSlq2LIfA@l&41CpWAc5b=JO=ghqUnq3!swPRh88^gf;vE#oN$JZ3KXZ
zNHpfpMlC;E*=;zM+i)6bxor0lzUBW9$+`Qpq&_i3yypiKVaT5ISY(Q?>E*VE51(;F
zjmE!)REd@<8!-(VLGfy}+z`#6$5)ano{e2?0UjDLuE>0&;()S%TL
zZYo4aw5JAt*R{&A(Ub?T@4}25qn*5)bw2frbfnt^r}oxjj$9Im@;IQ2fv~(Yc1I{}
zMZrPD`g=+}{7Xdo!s(=kU;L>t{p00{2Se7ifba3O1z%prX>K0nHl<9pw;H(g&b9TH
zcA-5o`2mVT>9e!HDj|Vh>R<5DHx{m_6
zGkoa2wop$_O1omwPhS6}!c8l7iO4o!MgkbdvMu?x%T;KqIgLfOMGb52t@r&;;}Rv^
zWT))87nG!F8N5J9;qE^2mmXKF5jjWU$cZ;$FfZs(VMq-|C)LXSbC3zReacAfk`GZh
zmTMZq`ZGvvr5`=MXvwj~-0~p**IW>JB`0cFTH$jvd;!V5wKU^PZS08i(TO=Qn@39&
zRl0$pVuG&G3@ZH0awpKaLbKut>}lyXrbkScE#LWf;Nt6VN|SP0SEa>1LVr*Y`Vuv!
z7XtKS@HY&pRas*3bG*e4{+c4}M|y+%36v4{AK;MF{bP8G**HF96L=gRH?|{q#=QVT
z72^G(`XBprjiIpeStxIaPDR;?#gB8lDLa?q++pv=q4quk15|C#f^TT;PdOZ
zF42&DE5IAaGd4%`Z38S)JC>A?1X{!0rw7_UpeCysKr#53NJC*f|KOtul-yUqP7;c7
zCLaAow$MfDU!&!0hhPla
zc-N({E}Fy+SCx9!2XyVqc&R1%fjI8Vz{&P!u!n4g^=phbw%o6SIbgo8NIh7QH%=kj?IfPMAu?G3XL1Rzj
zFC4ZCv^fFY7JZ&kf_G`Uow$-Jb7^oY-cy8U+W5EhgI0C5sO>1%9vS_ER%ayC%k~?9
zb>s1ccf9i>G$SnzS}UnM==BH)fk!<)Fo$PzuXL5JR
zHE54^B+S7ZljvVLQ;ILWemRf9k~O2c)AG?u#o!GLtY42OVJ-HUjHM|+_T9iSa!-pc
zlIJ&QqadZASpI>UThjcM)_2ObgYP*<82*{YT4`|g({a@lr^Vw}zQy55?63Pxoc~rK
z;r&^J%D`+dzgR%9MVU9Ae6r_%Ud+nI+`+#~#n6mHF%Bo+>5fd~njY;4H(FJzHM%qx
zHEjHr>>n7>${W0-Df>mzKdEuuN{U!f_4I-1T)?oDe<7u00*UMFX93u32aOWBcx~36
zyeQ7S3m=RVv>+@jU8e?kNrinG`zqbj{31w?@LTd*)vXv9uZEvwfL`gr{1j8*8UR}b
zz4wQWp>11}VRNe<<7knD4$nv=M(MAUIG_gVX1B1hPhOaxRjml;i1W_Zb~A2qc5e*j
zJSyn0ktIbs4W0w4<18QdCSbgZY$rfjwQ;U<5M7w7%trfcd(xbj9atipn%W*cGeStv
zhvi?IQj(7J
z^b1;k_M*vFg=x-528fO(Tsm@W5hAbAtBNyQrWv#X6E~-R5AcFds20Cu_6?6^z66$>
zR_>K+$AIMF!s{6mZ6Th88=2xL!4G7sdjxgegRik2qStjg#Q#{w7os;eyx%(wBWO*G
zeSf|Sa4SrV=DY|^MHLwe`r0_(?^7j1FRn?Iat661Yke!%UQ%3szH1YZWZk1zP#ny;B<#2>fpTqfTMsz!-B~iRHR_b
ziRh3yVt(#UH@~`A=|GzuP}$ZF02ULInaEhRbos`W**%oxW{8!pyKJBn9?v(N(Du=6
zRqV2tUtwsXqrZZd_*;xX#-8RL{;oMmJ1~k}I}4n-LIH@#Dm!-D!5Y{<>w7wjksc4V
z{DTB-GP3TqU7n;-E|}vuWm-Uk*^QeUHnuLe
z)Vf4y$Q^I*Fhd>vH0`VLhlq>{65S;(=G+Afs5q5|XMCF9e;s5O?;~?tC@55S=tx+<
z+nE0*r^8)P%GG}%H3Hf%o;Uf4Cd<~4t*Hf%b@Qn29=Hh
zr}sv?`Zha8$kzBdtF>0eYl)iJu%eWB<%z#^LqDQE-7!(*5DbQ9L#9{g(3`3mWsM`D
zmL6Xl1;`l;6t}s0fF{BbI7&h~awIIz?{kCiV|k`2-{~KoMv9lMVvJ|quHdDre(-kd
z(*ECRT?<^KyR_z?jJk-*0=DFGOD}=SLB}!XD
z!*z$WIhhzQBcE1G`qFs!y7TiOxYTgb8A;F>>p95%d`)l;>${2pDr4gG_9(Yt^8>PZ
zkpr$G0cCT~=Qk0{n15)@@Wczb^S>0%mFdtcq8FsOas8}zXc9f9+M(gytG1G$pd4tf
z%g}j@3})aX(2l*iZSc#5)+6Jr1U{!xj5`HZ&={WRV;Yh#pwG`6j~rSXRB8$8{Wkz0
zu{#wTje{bcAN+v*n(NEpq)@|<^2suf>@U|<=%sDFM;04N6aM$EVGnh<6^*yJMS879
zW=_n%=LKjryk2g2)CHGN?Ava7qb7<6>w=
e*PLdv@dpma`3t##6ry)fh1I!P_X>&~CqX&^>Q6HO
literal 0
HcmV?d00001
From 08e13154aa86336105245e7a4b5d3dcdca5d507e Mon Sep 17 00:00:00 2001
From: ddworak
Date: Thu, 19 Mar 2020 08:19:03 +0100
Subject: [PATCH 09/44] Default to snapshot version in dev
---
build.sbt | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/build.sbt b/build.sbt
index b330dc3..f69a332 100644
--- a/build.sbt
+++ b/build.sbt
@@ -3,8 +3,9 @@
name := "udash-jquery"
inThisBuild(Seq(
- version := "3.0.3",
+ version := sys.env.get("TRAVIS_TAG").filter(_.startsWith("v")).map(_.drop(1)).getOrElse("3.0.0-SNAPSHOT"),
organization := "io.udash",
+ cancelable := true,
))
val commonSettings = Seq(
From 6e10c20ebadce3b5fbcaa3fd17339612b4525255 Mon Sep 17 00:00:00 2001
From: ddworak
Date: Thu, 19 Mar 2020 08:20:34 +0100
Subject: [PATCH 10/44] Travis fix
---
.travis.yml | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 86def1f..1534178 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -9,18 +9,17 @@ stages:
- name: release
if: tag =~ ^v
-before_script:
- - wget https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux64.tar.gz
- - mkdir geckodriver
- - tar -xzf geckodriver-v0.24.0-linux64.tar.gz -C geckodriver
- - export PATH=$PWD/geckodriver:$PATH
-
-script:
- - sbt +test +publishLocal
- - cd example && sbt compileStatics
-
jobs:
include:
+ - stage: test
+ before_script:
+ - wget https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux64.tar.gz
+ - mkdir geckodriver
+ - tar -xzf geckodriver-v0.24.0-linux64.tar.gz -C geckodriver
+ - export PATH=$PWD/geckodriver:$PATH
+ script:
+ - sbt +test +publishLocal
+ - cd example && sbt compileStatics
- stage: release
script:
- openssl aes-256-cbc -K $encrypted_f00a6d0a0202_key -iv $encrypted_f00a6d0a0202_iv -in travis/travis.gpg.enc -out travis/travis.gpg -d
From a236e022f005c50cdbbe4d9429ffd4dd46e544fa Mon Sep 17 00:00:00 2001
From: ddworak
Date: Thu, 19 Mar 2020 09:15:53 +0100
Subject: [PATCH 11/44] Complete autopublish setup
---
.travis.yml | 24 ++++++++++++------------
build.sbt | 38 +++++++++++++++++++++++++++++++++++---
project/plugins.sbt | 4 +---
3 files changed, 48 insertions(+), 18 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 1534178..5bb28bf 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -7,34 +7,34 @@ scala:
stages:
- test
- name: release
- if: tag =~ ^v
+ - if: tag =~ ^v
jobs:
include:
- stage: test
- before_script:
- - wget https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux64.tar.gz
- - mkdir geckodriver
- - tar -xzf geckodriver-v0.24.0-linux64.tar.gz -C geckodriver
- - export PATH=$PWD/geckodriver:$PATH
script:
- sbt +test +publishLocal
- cd example && sbt compileStatics
- stage: release
script:
- - openssl aes-256-cbc -K $encrypted_f00a6d0a0202_key -iv $encrypted_f00a6d0a0202_iv -in travis/travis.gpg.enc -out travis/travis.gpg -d
+ - openssl aes-256-cbc -K $encrypted_f00a6d0a0202_key -iv $encrypted_f00a6d0a0202_iv
+ -in travis/travis.gpg.enc -out travis/travis.gpg -d
- gpg --import travis/travis.gpg
- test $TRAVIS_PULL_REQUEST = "false" && sbt +publishSigned sonatypeBundleRelease
before_cache:
- # Cleanup the cached directories to avoid unnecessary cache updates
- rm -fv $HOME/.ivy2/.sbt.ivy.lock
- find $HOME/.ivy2/cache -name "ivydata-*.properties" -print -delete
- find $HOME/.sbt -name "*.lock" -print -delete
cache:
directories:
- - $HOME/.ivy2/cache
- - $HOME/.m2
- - $HOME/.cache
- - $HOME/.sbt
\ No newline at end of file
+ - "$HOME/.ivy2/cache"
+ - "$HOME/.m2"
+ - "$HOME/.cache"
+ - "$HOME/.sbt"
+
+env:
+ global:
+ - secure: rG9cHG3au9EUYQSJKHAsMxws3IW/tSxG1Y/xbuW2Ri1JVr6L6c9ig8gYj4Hju5KkVvxXejb1/8bYCoZEP1vZpNeSkNordHECp0l+i9mI5ZFo5RN3vMCq4/0xWEQTdZ7c3BjN+pn4veDJ+W8cHFXgivC9tsX7FEbksz4bFVIm1knvz5r7HN4ntgQUeLwY/J9EpKSr/TYZsnEcf8aH9q6tvTLqcfYAR6ggs68Kc2qJ5sII0rj3vP2NANjTLuvdkPSe3i/9KCDRDr9KIoVsam4LfFDG8YXSNWBP3OQU86DF19V0brt6WGGX6G5V2dyjlHyyUy0GBFJOlPmfkEL8ylOprGy1OPw40ZPRbtzpbztFlVmgJoO3UcKIWlyB8umz0M9A+E3Of3P9mTnskAe366VPSq8R/G3kxc7ictZDQH7hgf2nKqlFQNXCJkBqynWRlC0HQ31izrACqNmmYdwQspUnAFVOEFSmfXu8sPVyOSQhHT4IG+xgG4KCKdC8Cv4buOFDzj4z0DRnfJwR71KvxA9KGhUtMZXXqfdZANThHMV1bsi3S3UPQKqRg62aja4+I7lzbwrPRbkDPsl0eTdULF39jIMnbfjC2TqeCgfG+tpel0DBMBOuuESvTVFVX38HSgK1QNhSAAu1nrVIFtZQbKDZLOm7hCgfOJO6v65R3PgIFFI=
+ - secure: wjX1uXAYdNxpUr1nz9cQ96cgJI3wUqJ7hIQlHwtg1gLJJtgdf6STSTbAm1IKMb0Ouytc2muC1H8jhBbv94tyZh2/NI7IDk7OY2wcLobH2Jh/wnDEAAcATIhqR/oFtSdqr0umr1HDevUPIBU/ZFViCPribnCQ/Rxn8jttguGd3Ho1k1dxzJ9pEiET66nU8CnW0j8g1Nkg540xFPff0Q+1C7+3akU03KwLnh8C0KR1oGhT354IhocLtFKWPuD9GTXAiA6qcOZ0cmUlv8jwHhWyJ6dmVkOlv873nGPrFaWEDPepNkGaAz2TYjkeFS0YS8q1zbd7YM0opnQd8TJCnFddyzc09+1d5RMAJVWdKOKVjrbDwvKaNWfEHW6GXJ83xm8cbo3dCREfL7UTKjejkQTRgmj2BdrZVRB9xs+XKZpZi0ECVbIrwik9tyYoiuSHe96yNN3Ma56Q4x094ZTvsccjy7pET4FCpNwrFu0aD+HFPerWB/xlr9ILz7sWy99r4eafS+O2eidoQnPIHAHZ+z/k9ExQedKUzTxO/skgrf1FvswrY7cpfnNApOhCSKm8C5NfMB5BC7M7OsYqDIhIwfs/Q3J9gw18F4fa9czpnduVzkpQUGdZ2vtS+oxDGICB7uaxkRq7HudHHElhz4w9qEOIMpTJjICPa38Hr/fKGxpuhKE=
\ No newline at end of file
diff --git a/build.sbt b/build.sbt
index f69a332..ed68634 100644
--- a/build.sbt
+++ b/build.sbt
@@ -27,14 +27,46 @@ val commonSettings = Seq(
"-Ycache-plugin-class-loader:last-modified",
"-Ycache-macro-class-loader:last-modified",
),
+ autoAPIMappings := true,
+ publishMavenStyle := true,
+ publishArtifact in Test := false,
+ pomIncludeRepository := { _ => false },
+
+ publishTo := sonatypePublishToBundle.value,
+
+ credentials in Global += Credentials(
+ "Sonatype Nexus Repository Manager",
+ "oss.sonatype.org",
+ sys.env.getOrElse("SONATYPE_USERNAME", ""),
+ sys.env.getOrElse("SONATYPE_PASSWORD", "")
+ ),
+
+ pomExtra := {
+ https://github.com/UdashFramework/scala-js-jquery
+
+
+ Apache v.2 License
+ http://www.apache.org/licenses/LICENSE-2.0.txt
+ repo
+
+
+
+ git@github.com:UdashFramework/scala-js-jquery.git
+ scm:git@github.com:UdashFramework/scala-js-jquery.git
+
+
+
+ avsystem
+ AVSystem
+ http://www.avsystem.com/
+
+
+ }
)
val commonJSSettings = Seq(
Test / parallelExecution := false,
Test / scalaJSStage := FastOptStage,
- // ScalaJSBundlerPlugin does not work with scalajs-env-selenium:
- // https://github.com/scalacenter/scalajs-bundler/issues/89
- // Test / jsEnv := new SeleniumJSEnv(browserCapabilities),
scalacOptions += {
val localDir = (ThisBuild / baseDirectory).value.toURI.toString
val githubDir = "https://raw.githubusercontent.com/UdashFramework/scala-js-jquery"
diff --git a/project/plugins.sbt b/project/plugins.sbt
index ab16f2f..418498b 100755
--- a/project/plugins.sbt
+++ b/project/plugins.sbt
@@ -1,10 +1,8 @@
logLevel := Level.Warn
-libraryDependencies += "org.scala-js" %% "scalajs-env-selenium" % "0.3.0"
-
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.0.1")
addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.17.0")
// Deployment configuration
-addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.0")
+addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.1")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.8.1")
\ No newline at end of file
From f5328c14488d8f1719f84ab60c88a31b005ef916 Mon Sep 17 00:00:00 2001
From: ddworak
Date: Thu, 19 Mar 2020 09:22:28 +0100
Subject: [PATCH 12/44] Move key file
---
travis.gpg.enc => travis/travis.gpg.enc | Bin
1 file changed, 0 insertions(+), 0 deletions(-)
rename travis.gpg.enc => travis/travis.gpg.enc (100%)
diff --git a/travis.gpg.enc b/travis/travis.gpg.enc
similarity index 100%
rename from travis.gpg.enc
rename to travis/travis.gpg.enc
From 4acb8d5453b66e66951321f62156189eac8d5f66 Mon Sep 17 00:00:00 2001
From: ddworak
Date: Thu, 19 Mar 2020 09:23:03 +0100
Subject: [PATCH 13/44] Attempt to cleanup stages
---
.travis.yml | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 5bb28bf..e2322af 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -4,11 +4,6 @@ jdk: openjdk11
scala:
- 2.13.1
-stages:
- - test
- - name: release
- - if: tag =~ ^v
-
jobs:
include:
- stage: test
@@ -16,6 +11,7 @@ jobs:
- sbt +test +publishLocal
- cd example && sbt compileStatics
- stage: release
+ if: tag =~ ^v
script:
- openssl aes-256-cbc -K $encrypted_f00a6d0a0202_key -iv $encrypted_f00a6d0a0202_iv
-in travis/travis.gpg.enc -out travis/travis.gpg -d
From efbabe0b7a9b91923e3de9a3a8dbe75443b7816a Mon Sep 17 00:00:00 2001
From: Dawid Dworak
Date: Thu, 19 Mar 2020 13:44:08 +0100
Subject: [PATCH 14/44] Update README.md
---
README.md | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 77158a1..fd89164 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,7 @@
-# scala-js-jquery [](https://travis-ci.org/UdashFramework/scala-js-jquery) [](https://gitter.im/UdashFramework/scala-js-jquery?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [
](http://www.avsystem.com/)
+udash-jquery [
](http://www.avsystem.com/)
+[](https://travis-ci.org/UdashFramework/scala-js-jquery)
+[](https://maven-badges.herokuapp.com/maven-central/io.udash/udash-jquery_sjs1_2.12)
+[](https://gitter.im/UdashFramework/scala-js-jquery?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Static types for the jQuery API for [Scala.js](http://www.scala-js.org/) programs.
From 8a6a55f6fe107677f9e9d9e1cedc393f363648ce Mon Sep 17 00:00:00 2001
From: Dawid Dworak
Date: Thu, 19 Mar 2020 13:48:00 +0100
Subject: [PATCH 15/44] Update README.md
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index fd89164..71b1d97 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
-udash-jquery [
](http://www.avsystem.com/)
+# udash-jquery [
](http://www.avsystem.com/)
[](https://travis-ci.org/UdashFramework/scala-js-jquery)
-[](https://maven-badges.herokuapp.com/maven-central/io.udash/udash-jquery_sjs1_2.12)
+[](https://maven-badges.herokuapp.com/maven-central/io.udash/udash-jquery_sjs1_2.12)
[](https://gitter.im/UdashFramework/scala-js-jquery?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Static types for the jQuery API for [Scala.js](http://www.scala-js.org/) programs.
From 7c48457a6b35bb5777c176cf9510116ef1ed8b3d Mon Sep 17 00:00:00 2001
From: Dawid Dworak
Date: Thu, 19 Mar 2020 13:50:17 +0100
Subject: [PATCH 16/44] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 71b1d97..8e775a1 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# udash-jquery [
](http://www.avsystem.com/)
[](https://travis-ci.org/UdashFramework/scala-js-jquery)
-[](https://maven-badges.herokuapp.com/maven-central/io.udash/udash-jquery_sjs1_2.12)
+[](https://maven-badges.herokuapp.com/maven-central/io.udash/udash-jquery_sjs1_2.12)
[](https://gitter.im/UdashFramework/scala-js-jquery?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Static types for the jQuery API for [Scala.js](http://www.scala-js.org/) programs.
From e3794013fbefc1a05db30151558b6d3c2993bc49 Mon Sep 17 00:00:00 2001
From: ddworak
Date: Thu, 26 Mar 2020 11:41:36 +0100
Subject: [PATCH 17/44] Publish both npm and js deps in jar
---
build.sbt | 5 ++---
example/project/Dependencies.scala | 2 +-
project/plugins.sbt | 1 +
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/build.sbt b/build.sbt
index ed68634..1addc24 100644
--- a/build.sbt
+++ b/build.sbt
@@ -1,5 +1,3 @@
-
-
name := "udash-jquery"
inThisBuild(Seq(
@@ -75,7 +73,7 @@ val commonJSSettings = Seq(
)
lazy val root = project.in(file("."))
- .enablePlugins(ScalaJSBundlerPlugin)
+ .enablePlugins(ScalaJSBundlerPlugin, JSDependenciesPlugin)
.settings(
commonSettings,
commonJSSettings,
@@ -87,5 +85,6 @@ lazy val root = project.in(file("."))
),
Compile / npmDependencies += "jquery" -> "3.3.1",
+ jsDependencies += "org.webjars" % "jquery" % "3.3.1" / "3.3.1/jquery.js",
Test / requireJsDomEnv := true
)
diff --git a/example/project/Dependencies.scala b/example/project/Dependencies.scala
index 32852d9..8885338 100644
--- a/example/project/Dependencies.scala
+++ b/example/project/Dependencies.scala
@@ -3,7 +3,7 @@ import sbt._
object Dependencies {
val udashCoreVersion = "0.8.3"
- val udashJQueryVersion = "3.0.2"
+ val udashJQueryVersion = "3.0.0-SNAPSHOT"
val deps = Def.setting(Seq[ModuleID](
"io.udash" %%% "udash-core" % udashCoreVersion,
diff --git a/project/plugins.sbt b/project/plugins.sbt
index 418498b..84c42cf 100755
--- a/project/plugins.sbt
+++ b/project/plugins.sbt
@@ -2,6 +2,7 @@ logLevel := Level.Warn
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.0.1")
addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.17.0")
+addSbtPlugin("org.scala-js" % "sbt-jsdependencies" % "1.0.0")
// Deployment configuration
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.1")
From 69208bc978779717fd54e9874a71cf28dc9bb745 Mon Sep 17 00:00:00 2001
From: ddworak
Date: Thu, 26 Mar 2020 15:59:54 +0100
Subject: [PATCH 18/44] Restore global dep demo
---
example/build.sbt | 53 ++++++++++++++++++++++++++----
example/project/Dependencies.scala | 7 +++-
2 files changed, 53 insertions(+), 7 deletions(-)
diff --git a/example/build.sbt b/example/build.sbt
index 422bf9d..103332f 100644
--- a/example/build.sbt
+++ b/example/build.sbt
@@ -28,15 +28,56 @@ val commonSettings = Seq(
)
val generatedGlobalDir = file("generated/global")
+val compileStatics = taskKey[Unit]("Compiles all static files.")
val copyAssets = taskKey[Unit]("Copies all assets to the target directory.")
-val root = project.in(file("."))
+
+lazy val root: Project = project.in(file("."))
+ .aggregate(`jquery-bundler-demo`, `jquery-global-demo`)
+ .settings(
+ crossScalaVersions := Nil,
+ )
+
+lazy val `jquery-global-demo` = project.in(file("global-demo"))
.enablePlugins(ScalaJSPlugin)
- .settings(commonSettings)
+ .settings(
+ commonSettings,
-val generatedBundlerDir = file("generated")
-val compileStatics = taskKey[Unit]("Compiles all static files.")
+ jsDependencies ++= Dependencies.jsDeps.value,
+
+ sourceDirsSettings(_.getParentFile),
+
+ /* move these files out of target/. */
+ Compile / fullOptJS / crossTarget := generatedGlobalDir,
+ Compile / fastOptJS / crossTarget := generatedGlobalDir,
+ Compile / packageJSDependencies / crossTarget := generatedGlobalDir,
+ Compile / packageMinifiedJSDependencies / crossTarget := generatedGlobalDir,
+
+ Compile / fastOptJS := (Compile / fastOptJS).dependsOn(copyAssets).value,
+ Compile / fullOptJS := (Compile / fullOptJS).dependsOn(copyAssets).value,
+
+ scalaJSUseMainModuleInitializer := true,
+
+ copyAssets := {
+ IO.copyFile(
+ root.base / "src/main/assets/index.html",
+ generatedGlobalDir / "index.html"
+ )
+ },
+
+ compileStatics := (Compile / fastOptJS).value,
+
+ Compile / fastOptJS / artifactPath :=
+ (Compile / fastOptJS / crossTarget).value / "scripts" / "frontend-impl.js",
+ Compile / fullOptJS / artifactPath :=
+ (Compile / fullOptJS / crossTarget).value / "scripts" / "frontend-impl.js",
+ Compile / packageJSDependencies / artifactPath :=
+ (Compile / packageJSDependencies / crossTarget).value / "scripts" / "frontend-deps.js",
+ Compile / packageMinifiedJSDependencies / artifactPath :=
+ (Compile / packageMinifiedJSDependencies / crossTarget).value / "scripts" / "frontend-deps.js"
+ )
-val example = project.in(file("."))
+val generatedBundlerDir = file("generated/bundler")
+lazy val `jquery-bundler-demo` = project.in(file("bundler-demo"))
.enablePlugins(ScalaJSBundlerPlugin)
.settings(
commonSettings,
@@ -47,7 +88,7 @@ val example = project.in(file("."))
copyAssets := {
IO.copyFile(
- sourceDirectory.value / "main/assets/index.html",
+ root.base / "src/main/assets/index.html",
generatedBundlerDir / "index.html"
)
},
diff --git a/example/project/Dependencies.scala b/example/project/Dependencies.scala
index 8885338..92576f0 100644
--- a/example/project/Dependencies.scala
+++ b/example/project/Dependencies.scala
@@ -1,12 +1,17 @@
+import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport._
import sbt._
object Dependencies {
val udashCoreVersion = "0.8.3"
- val udashJQueryVersion = "3.0.0-SNAPSHOT"
+ val udashJQueryVersion = "3.0.2"
val deps = Def.setting(Seq[ModuleID](
"io.udash" %%% "udash-core" % udashCoreVersion,
"io.udash" %%% "udash-jquery" % udashJQueryVersion
))
+
+ val jsDeps = Def.setting(Seq[org.scalajs.sbtplugin.JSModuleID](
+ "org.webjars" % "jquery" % "3.3.1" / "3.3.1/jquery.js" minified "3.3.1/jquery.min.js"
+ ))
}
\ No newline at end of file
From f913939db0a7e114fa797182604f2cbbd26fb2b5 Mon Sep 17 00:00:00 2001
From: ddworak
Date: Thu, 26 Mar 2020 16:03:32 +0100
Subject: [PATCH 19/44] Restore separate index files
---
example/build.sbt | 6 +++---
.../{ => bundler-demo}/src/main/assets/index.html | 0
example/global-demo/src/main/assets/index.html | 13 +++++++++++++
3 files changed, 16 insertions(+), 3 deletions(-)
rename example/{ => bundler-demo}/src/main/assets/index.html (100%)
create mode 100644 example/global-demo/src/main/assets/index.html
diff --git a/example/build.sbt b/example/build.sbt
index 103332f..97e63f2 100644
--- a/example/build.sbt
+++ b/example/build.sbt
@@ -31,7 +31,7 @@ val generatedGlobalDir = file("generated/global")
val compileStatics = taskKey[Unit]("Compiles all static files.")
val copyAssets = taskKey[Unit]("Copies all assets to the target directory.")
-lazy val root: Project = project.in(file("."))
+lazy val root = project.in(file("."))
.aggregate(`jquery-bundler-demo`, `jquery-global-demo`)
.settings(
crossScalaVersions := Nil,
@@ -59,7 +59,7 @@ lazy val `jquery-global-demo` = project.in(file("global-demo"))
copyAssets := {
IO.copyFile(
- root.base / "src/main/assets/index.html",
+ sourceDirectory.value / "main/assets/index.html",
generatedGlobalDir / "index.html"
)
},
@@ -88,7 +88,7 @@ lazy val `jquery-bundler-demo` = project.in(file("bundler-demo"))
copyAssets := {
IO.copyFile(
- root.base / "src/main/assets/index.html",
+ sourceDirectory.value / "main/assets/index.html",
generatedBundlerDir / "index.html"
)
},
diff --git a/example/src/main/assets/index.html b/example/bundler-demo/src/main/assets/index.html
similarity index 100%
rename from example/src/main/assets/index.html
rename to example/bundler-demo/src/main/assets/index.html
diff --git a/example/global-demo/src/main/assets/index.html b/example/global-demo/src/main/assets/index.html
new file mode 100644
index 0000000..9276c28
--- /dev/null
+++ b/example/global-demo/src/main/assets/index.html
@@ -0,0 +1,13 @@
+
+
+
+
+ jquery-demo - ScalaJSBundlerPlugin demo
+
+
+
+
+
+
+
+
\ No newline at end of file
From 32bad57ae3f1de9edd83ab5ed61f1b8b2386b740 Mon Sep 17 00:00:00 2001
From: ddworak
Date: Thu, 26 Mar 2020 16:08:22 +0100
Subject: [PATCH 20/44] Root project deps
---
example/build.sbt | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/example/build.sbt b/example/build.sbt
index 97e63f2..49478f2 100644
--- a/example/build.sbt
+++ b/example/build.sbt
@@ -32,10 +32,8 @@ val compileStatics = taskKey[Unit]("Compiles all static files.")
val copyAssets = taskKey[Unit]("Copies all assets to the target directory.")
lazy val root = project.in(file("."))
- .aggregate(`jquery-bundler-demo`, `jquery-global-demo`)
- .settings(
- crossScalaVersions := Nil,
- )
+ .enablePlugins(ScalaJSPlugin)
+ .settings(commonSettings)
lazy val `jquery-global-demo` = project.in(file("global-demo"))
.enablePlugins(ScalaJSPlugin)
From 6a737892db6aaff4ebc16a4e84c744fbd5670641 Mon Sep 17 00:00:00 2001
From: ddworak
Date: Sun, 29 Mar 2020 13:52:51 +0200
Subject: [PATCH 21/44] Udash-less views
---
.../global-demo/src/main/assets/index.html | 4 +-
example/project/Dependencies.scala | 6 +--
.../demos/jquery/{init.scala => Init.scala} | 12 +----
.../demos/jquery/RoutingRegistryDef.scala | 29 ------------
.../jquery/StatesToViewPresenterDef.scala | 27 -----------
.../scala/io/udash/demos/jquery/states.scala | 32 -------------
.../udash/demos/jquery/views/ErrorView.scala | 13 ------
.../demos/jquery/views/FunctionView.scala | 15 ++++---
.../udash/demos/jquery/views/IndexView.scala | 45 +++++++++----------
.../udash/demos/jquery/views/RootView.scala | 16 -------
.../jquery/views/functions/AddBackView.scala | 20 ++++-----
.../jquery/views/functions/AddView.scala | 14 +++---
...{AfterView.scala => AfterBeforeView.scala} | 13 +++---
.../jquery/views/functions/AnimateView.scala | 16 +++----
.../views/functions/AppendPrependView.scala | 13 +++---
.../jquery/views/functions/AttrView.scala | 23 +++++-----
.../views/functions/CallbacksView.scala | 17 +++----
.../jquery/views/functions/ChildrenView.scala | 13 +++---
.../jquery/views/functions/DataView.scala | 13 +++---
.../jquery/views/functions/DeferredView.scala | 13 +++---
.../jquery/views/functions/EachView.scala | 13 +++---
.../jquery/views/functions/HideShowView.scala | 13 +++---
.../views/functions/OffsetPositionView.scala | 13 +++---
.../jquery/views/functions/OnOneOffView.scala | 15 +++----
24 files changed, 117 insertions(+), 291 deletions(-)
rename example/src/main/scala/io/udash/demos/jquery/{init.scala => Init.scala} (52%)
delete mode 100644 example/src/main/scala/io/udash/demos/jquery/RoutingRegistryDef.scala
delete mode 100644 example/src/main/scala/io/udash/demos/jquery/StatesToViewPresenterDef.scala
delete mode 100644 example/src/main/scala/io/udash/demos/jquery/states.scala
delete mode 100644 example/src/main/scala/io/udash/demos/jquery/views/ErrorView.scala
delete mode 100644 example/src/main/scala/io/udash/demos/jquery/views/RootView.scala
rename example/src/main/scala/io/udash/demos/jquery/views/functions/{AfterView.scala => AfterBeforeView.scala} (61%)
diff --git a/example/global-demo/src/main/assets/index.html b/example/global-demo/src/main/assets/index.html
index 9276c28..90d7641 100644
--- a/example/global-demo/src/main/assets/index.html
+++ b/example/global-demo/src/main/assets/index.html
@@ -2,12 +2,12 @@
- jquery-demo - ScalaJSBundlerPlugin demo
+ jquery-demo - global scope
-
+
\ No newline at end of file
diff --git a/example/project/Dependencies.scala b/example/project/Dependencies.scala
index 92576f0..7be9655 100644
--- a/example/project/Dependencies.scala
+++ b/example/project/Dependencies.scala
@@ -1,13 +1,13 @@
-import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport._
+import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
import sbt._
object Dependencies {
- val udashCoreVersion = "0.8.3"
+ val scalatagsVersion = "0.8.6"
val udashJQueryVersion = "3.0.2"
val deps = Def.setting(Seq[ModuleID](
- "io.udash" %%% "udash-core" % udashCoreVersion,
+ "com.lihaoyi" %%% "scalatags" % scalatagsVersion,
"io.udash" %%% "udash-jquery" % udashJQueryVersion
))
diff --git a/example/src/main/scala/io/udash/demos/jquery/init.scala b/example/src/main/scala/io/udash/demos/jquery/Init.scala
similarity index 52%
rename from example/src/main/scala/io/udash/demos/jquery/init.scala
rename to example/src/main/scala/io/udash/demos/jquery/Init.scala
index 549798b..0836569 100644
--- a/example/src/main/scala/io/udash/demos/jquery/init.scala
+++ b/example/src/main/scala/io/udash/demos/jquery/Init.scala
@@ -1,22 +1,12 @@
package io.udash.demos.jquery
-import io.udash._
import io.udash.wrappers.jquery._
import org.scalajs.dom
import org.scalajs.dom.Element
import scala.scalajs.js.annotation.JSExport
-object Context {
- implicit val executionContext = scalajs.concurrent.JSExecutionContext.Implicits.queue
- private val routingRegistry = new RoutingRegistryDef
- private val viewPresenterRegistry = new StatesToViewPresenterDef
-
- implicit val applicationInstance = new Application[RoutingState](routingRegistry, viewPresenterRegistry)
-}
-
object Init {
- import Context._
@JSExport
def main(args: Array[String]): Unit = {
@@ -25,7 +15,7 @@ object Init {
if (appRoot.isEmpty) {
dom.console.error("Application root element not found! Check you index.html file!")
} else {
- applicationInstance.run(appRoot.get)
+ //applicationInstance.run(appRoot.get)
}
})
}
diff --git a/example/src/main/scala/io/udash/demos/jquery/RoutingRegistryDef.scala b/example/src/main/scala/io/udash/demos/jquery/RoutingRegistryDef.scala
deleted file mode 100644
index f43d899..0000000
--- a/example/src/main/scala/io/udash/demos/jquery/RoutingRegistryDef.scala
+++ /dev/null
@@ -1,29 +0,0 @@
-package io.udash.demos.jquery
-
-import io.udash._
-
-class RoutingRegistryDef extends RoutingRegistry[RoutingState] {
- def matchUrl(url: Url): RoutingState =
- url2State.applyOrElse(url.value.stripSuffix("/"), (x: String) => ErrorState)
-
- def matchState(state: RoutingState): Url =
- Url(state2Url.apply(state))
-
- private val (url2State, state2Url) = bidirectional {
- case "" => IndexState
- case "/add" => AddState
- case "/addBack" => AddBackState
- case "/after" => AfterBeforeState
- case "/animate" => AnimateState
- case "/append" => AppendPrependState
- case "/attr" => AttrState
- case "/callbacks" => CallbacksState
- case "/children" => ChildrenState
- case "/data" => DataState
- case "/deferred" => DeferredState
- case "/each" => EachState
- case "/hide" => HideShowState
- case "/offset" => OffsetPositionState
- case "/on" => OnOneOffState
- }
-}
\ No newline at end of file
diff --git a/example/src/main/scala/io/udash/demos/jquery/StatesToViewPresenterDef.scala b/example/src/main/scala/io/udash/demos/jquery/StatesToViewPresenterDef.scala
deleted file mode 100644
index dee3a6e..0000000
--- a/example/src/main/scala/io/udash/demos/jquery/StatesToViewPresenterDef.scala
+++ /dev/null
@@ -1,27 +0,0 @@
-package io.udash.demos.jquery
-
-import io.udash._
-import io.udash.demos.jquery.views.functions._
-import io.udash.demos.jquery.views.{ErrorViewPresenter, IndexViewPresenter, RootViewPresenter}
-
-class StatesToViewPresenterDef extends ViewFactoryRegistry[RoutingState] {
- def matchStateToResolver(state: RoutingState): ViewFactory[_ <: RoutingState] = state match {
- case RootState => RootViewPresenter
- case IndexState => IndexViewPresenter
- case AddState => AddViewPresenter
- case AddBackState => AddBackViewPresenter
- case AfterBeforeState => AfterBeforeViewPresenter
- case AnimateState => AnimateViewPresenter
- case AppendPrependState => AppendPrependViewPresenter
- case AttrState => AttrViewPresenter
- case CallbacksState => CallbacksViewPresenter
- case ChildrenState => ChildrenViewPresenter
- case DataState => DataViewPresenter
- case DeferredState => DeferredViewPresenter
- case EachState => EachViewPresenter
- case HideShowState => HideShowViewPresenter
- case OnOneOffState => OnOneOffViewPresenter
- case OffsetPositionState => OffsetPositionViewPresenter
- case _ => ErrorViewPresenter
- }
-}
\ No newline at end of file
diff --git a/example/src/main/scala/io/udash/demos/jquery/states.scala b/example/src/main/scala/io/udash/demos/jquery/states.scala
deleted file mode 100644
index f4e7452..0000000
--- a/example/src/main/scala/io/udash/demos/jquery/states.scala
+++ /dev/null
@@ -1,32 +0,0 @@
-package io.udash.demos.jquery
-
-import io.udash._
-
-sealed abstract class RoutingState(val parentState: Option[ContainerRoutingState]) extends State {
- type HierarchyRoot = RoutingState
-
- def url(implicit application: Application[RoutingState]): String =
- s"#${application.matchState(this).value}"
-}
-
-sealed abstract class ContainerRoutingState(parentState: Option[ContainerRoutingState]) extends RoutingState(parentState) with ContainerState
-sealed abstract class FinalRoutingState(parentState: ContainerRoutingState) extends RoutingState(Option(parentState)) with FinalState
-
-
-case object RootState extends ContainerRoutingState(None)
-case object ErrorState extends FinalRoutingState(RootState)
-case object IndexState extends FinalRoutingState(RootState)
-case object AddState extends FinalRoutingState(RootState)
-case object AddBackState extends FinalRoutingState(RootState)
-case object AfterBeforeState extends FinalRoutingState(RootState)
-case object AnimateState extends FinalRoutingState(RootState)
-case object AppendPrependState extends FinalRoutingState(RootState)
-case object AttrState extends FinalRoutingState(RootState)
-case object CallbacksState extends FinalRoutingState(RootState)
-case object ChildrenState extends FinalRoutingState(RootState)
-case object DataState extends FinalRoutingState(RootState)
-case object DeferredState extends FinalRoutingState(RootState)
-case object EachState extends FinalRoutingState(RootState)
-case object HideShowState extends FinalRoutingState(RootState)
-case object OffsetPositionState extends FinalRoutingState(RootState)
-case object OnOneOffState extends FinalRoutingState(RootState)
\ No newline at end of file
diff --git a/example/src/main/scala/io/udash/demos/jquery/views/ErrorView.scala b/example/src/main/scala/io/udash/demos/jquery/views/ErrorView.scala
deleted file mode 100644
index a2b8fa7..0000000
--- a/example/src/main/scala/io/udash/demos/jquery/views/ErrorView.scala
+++ /dev/null
@@ -1,13 +0,0 @@
-package io.udash.demos.jquery.views
-
-import io.udash._
-import io.udash.demos.jquery.IndexState
-
-object ErrorViewPresenter extends StaticViewFactory[IndexState.type](() => new ErrorView)
-
-class ErrorView extends FinalView {
- import scalatags.JsDom.all._
-
- override def getTemplate: Modifier =
- h3("URL not found!")
-}
\ No newline at end of file
diff --git a/example/src/main/scala/io/udash/demos/jquery/views/FunctionView.scala b/example/src/main/scala/io/udash/demos/jquery/views/FunctionView.scala
index 5874d47..d26459e 100644
--- a/example/src/main/scala/io/udash/demos/jquery/views/FunctionView.scala
+++ b/example/src/main/scala/io/udash/demos/jquery/views/FunctionView.scala
@@ -1,19 +1,20 @@
package io.udash.demos.jquery.views
-import io.udash._
-import org.scalajs.dom.{Element, Event}
+import org.scalajs.dom.Event
+
+abstract class FunctionView {
-abstract class FunctionView extends FinalView {
import scalatags.JsDom.all._
- protected val content: Element
- protected val script: () => Any
+ protected def content: Modifier
+
+ protected def script: () => Any
- override def getTemplate: Modifier =
+ final def getTemplate: Modifier =
div(
content,
button(
- onclick :+= ((_: Event) => {
+ onclick := ((_: Event) => {
script()
false
})
diff --git a/example/src/main/scala/io/udash/demos/jquery/views/IndexView.scala b/example/src/main/scala/io/udash/demos/jquery/views/IndexView.scala
index cad18f0..4783c0f 100644
--- a/example/src/main/scala/io/udash/demos/jquery/views/IndexView.scala
+++ b/example/src/main/scala/io/udash/demos/jquery/views/IndexView.scala
@@ -1,33 +1,30 @@
package io.udash.demos.jquery.views
-import io.udash._
-import io.udash.demos.jquery._
+import io.udash.demos.jquery.views.functions._
-object IndexViewPresenter extends StaticViewFactory[IndexState.type](() => new IndexView)
+object IndexView {
-class IndexView extends FinalView {
- import Context._
import scalatags.JsDom.all._
- private val content = div(
- "Take a look at following demo pages:",
- ul(
- li(a(href := AddState.url)(".add() & .css()")),
- li(a(href := AddBackState.url)(".addBack() & .addClass()")),
- li(a(href := AfterBeforeState.url)(".after() & .before()")),
- li(a(href := AnimateState.url)(".animate() & .click()")),
- li(a(href := AppendPrependState.url)(".append() & .prepend()")),
- li(a(href := AttrState.url)(".attr()")),
- li(a(href := CallbacksState.url)("Callbacks")),
- li(a(href := ChildrenState.url)(".children()")),
- li(a(href := DataState.url)(".data()")),
- li(a(href := DeferredState.url)("Deferred")),
- li(a(href := EachState.url)(".each()")),
- li(a(href := HideShowState.url)(".hide() & .show()")),
- li(a(href := OnOneOffState.url)(".on() & .one() & .off()")),
- li(a(href := OffsetPositionState.url)(".offset() & .position()"))
- )
+ private val demos = Seq(
+ AddBackView,
+ AddView,
+ AfterBeforeView,
+ AnimateView,
+ AppendPrependView,
+ AttrView,
+ CallbacksView,
+ ChildrenView,
+ DataView,
+ DeferredView,
+ EachView,
+ HideShowView,
+ OffsetPositionView,
+ OnOneOffView,
)
- override def getTemplate: Modifier = content
+ final val content = div(
+ "Take a look at following demo pages:",
+ demos.map(_.getTemplate),
+ )
}
\ No newline at end of file
diff --git a/example/src/main/scala/io/udash/demos/jquery/views/RootView.scala b/example/src/main/scala/io/udash/demos/jquery/views/RootView.scala
deleted file mode 100644
index 3906559..0000000
--- a/example/src/main/scala/io/udash/demos/jquery/views/RootView.scala
+++ /dev/null
@@ -1,16 +0,0 @@
-package io.udash.demos.jquery.views
-
-import io.udash._
-import io.udash.demos.jquery.{Context, IndexState, RootState}
-
-object RootViewPresenter extends StaticViewFactory[RootState.type](() => new RootView)
-
-class RootView extends ContainerView {
- import Context._
- import scalatags.JsDom.all._
-
- override def getTemplate: Modifier = div(
- a(href := IndexState.url)(h1("jquery-demo")),
- childViewContainer
- )
-}
\ No newline at end of file
diff --git a/example/src/main/scala/io/udash/demos/jquery/views/functions/AddBackView.scala b/example/src/main/scala/io/udash/demos/jquery/views/functions/AddBackView.scala
index cdc25ba..620c320 100644
--- a/example/src/main/scala/io/udash/demos/jquery/views/functions/AddBackView.scala
+++ b/example/src/main/scala/io/udash/demos/jquery/views/functions/AddBackView.scala
@@ -1,19 +1,15 @@
package io.udash.demos.jquery.views.functions
-import io.udash._
-import io.udash.demos.jquery.IndexState
import io.udash.demos.jquery.views.FunctionView
import io.udash.wrappers.jquery._
-
import scalatags.JsDom.tags2
-object AddBackViewPresenter extends StaticViewFactory[IndexState.type](() => new AddBackView)
-
/** Based on examples from: jQuery Docs. */
-class AddBackView extends FunctionView {
+object AddBackView extends FunctionView {
+
import scalatags.JsDom.all._
- override protected val content = div(cls := "demo")(
+ override protected def content = div(cls := "demo")(
h3(".addBack() & .addClass()"),
tags2.style(
""".demo p, .demo div {
@@ -48,15 +44,15 @@ class AddBackView extends FunctionView {
p("Second Paragraph")
)
)
- ).render
+ )
- override protected val script = () => {
- jQ( ".demo div.left, .demo div.right" ).find( "div, div > p" ).addClass( "border" )
+ override protected def script = () => {
+ jQ(".demo div.left, .demo div.right").find("div, div > p").addClass("border")
// First Example
- jQ( ".demo div.before-addback" ).find( "p" ).addClass( "background" )
+ jQ(".demo div.before-addback").find("p").addClass("background")
// Second Example
- jQ( ".demo div.after-addback" ).find( "p" ).addBack().addClass( "background" )
+ jQ(".demo div.after-addback").find("p").addBack().addClass("background")
}
}
\ No newline at end of file
diff --git a/example/src/main/scala/io/udash/demos/jquery/views/functions/AddView.scala b/example/src/main/scala/io/udash/demos/jquery/views/functions/AddView.scala
index 9c0b0d8..f97749d 100644
--- a/example/src/main/scala/io/udash/demos/jquery/views/functions/AddView.scala
+++ b/example/src/main/scala/io/udash/demos/jquery/views/functions/AddView.scala
@@ -1,19 +1,15 @@
package io.udash.demos.jquery.views.functions
-import io.udash._
-import io.udash.demos.jquery.IndexState
import io.udash.demos.jquery.views.FunctionView
import io.udash.wrappers.jquery._
-
import scalatags.JsDom.tags2
-object AddViewPresenter extends StaticViewFactory[IndexState.type](() => new AddView)
-
/** Based on examples from: jQuery Docs. */
-class AddView extends FunctionView {
+object AddView extends FunctionView {
+
import scalatags.JsDom.all._
- override protected val content = div(cls := "demo")(
+ override protected def content = div(cls := "demo")(
h3(".add() & .css()"),
tags2.style(
""".demo div {
@@ -38,9 +34,9 @@ class AddView extends FunctionView {
div(),
div(),
p("Added this... (notice no border)")
- ).render
+ )
- override protected val script = () => {
+ override protected def script = () => {
jQ(".demo div").css("border", "2px solid red")
.add(".demo p")
.css("background", "yellow")
diff --git a/example/src/main/scala/io/udash/demos/jquery/views/functions/AfterView.scala b/example/src/main/scala/io/udash/demos/jquery/views/functions/AfterBeforeView.scala
similarity index 61%
rename from example/src/main/scala/io/udash/demos/jquery/views/functions/AfterView.scala
rename to example/src/main/scala/io/udash/demos/jquery/views/functions/AfterBeforeView.scala
index 7e61e09..32acbed 100644
--- a/example/src/main/scala/io/udash/demos/jquery/views/functions/AfterView.scala
+++ b/example/src/main/scala/io/udash/demos/jquery/views/functions/AfterBeforeView.scala
@@ -1,17 +1,14 @@
package io.udash.demos.jquery.views.functions
-import io.udash._
-import io.udash.demos.jquery.IndexState
import io.udash.demos.jquery.views.FunctionView
import io.udash.wrappers.jquery._
-object AfterBeforeViewPresenter extends StaticViewFactory[IndexState.type](() => new AfterBeforeView)
-
/** Based on examples from: jQuery Docs. */
-class AfterBeforeView extends FunctionView {
+object AfterBeforeView extends FunctionView {
+
import scalatags.JsDom.all._
- override protected val content = div(cls := "demo")(
+ override protected def content = div(cls := "demo")(
h3(".after()"),
div(
p(cls := "after")("I would like to say: ")
@@ -20,9 +17,9 @@ class AfterBeforeView extends FunctionView {
div(
p(cls := "before")("is what I said...")
)
- ).render
+ )
- override protected val script = () => {
+ override protected def script = () => {
jQ(".after").after("Hello")
jQ(".before").before("Hello")
}
diff --git a/example/src/main/scala/io/udash/demos/jquery/views/functions/AnimateView.scala b/example/src/main/scala/io/udash/demos/jquery/views/functions/AnimateView.scala
index c1c8693..ec14da8 100644
--- a/example/src/main/scala/io/udash/demos/jquery/views/functions/AnimateView.scala
+++ b/example/src/main/scala/io/udash/demos/jquery/views/functions/AnimateView.scala
@@ -1,20 +1,16 @@
package io.udash.demos.jquery.views.functions
-import io.udash._
-import io.udash.demos.jquery.IndexState
import io.udash.demos.jquery.views.FunctionView
import io.udash.wrappers.jquery._
import org.scalajs.dom.Element
-
import scalatags.JsDom.tags2
-object AnimateViewPresenter extends StaticViewFactory[IndexState.type](() => new AnimateView)
-
/** Based on examples from: jQuery Docs. */
-class AnimateView extends FunctionView {
+object AnimateView extends FunctionView {
+
import scalatags.JsDom.all._
- override protected val content = div(cls := "demo")(
+ override protected def content = div(cls := "demo")(
h3(".animate() & .click()"),
tags2.style(
""".demo div {
@@ -36,11 +32,11 @@ class AnimateView extends FunctionView {
button(id := "go4", disabled := "disabled")("» Reset"),
div(id := "block1")("Block1"),
div(id := "block2")("Block2")
- ).render
+ )
- override protected val script = () => {
+ override protected def script = () => {
jQ("#go1").on(EventName.click, (_: Element, _: JQueryEvent) => {
- jQ( "#block1" )
+ jQ("#block1")
.animate(Map(
"width" -> "90%"
), AnimationOptions(
diff --git a/example/src/main/scala/io/udash/demos/jquery/views/functions/AppendPrependView.scala b/example/src/main/scala/io/udash/demos/jquery/views/functions/AppendPrependView.scala
index 2908b43..90d01e5 100644
--- a/example/src/main/scala/io/udash/demos/jquery/views/functions/AppendPrependView.scala
+++ b/example/src/main/scala/io/udash/demos/jquery/views/functions/AppendPrependView.scala
@@ -1,24 +1,21 @@
package io.udash.demos.jquery.views.functions
-import io.udash._
-import io.udash.demos.jquery.IndexState
import io.udash.demos.jquery.views.FunctionView
import io.udash.wrappers.jquery._
-object AppendPrependViewPresenter extends StaticViewFactory[IndexState.type](() => new AppendPrependView)
-
/** Based on examples from: jQuery Docs. */
-class AppendPrependView extends FunctionView {
+object AppendPrependView extends FunctionView {
+
import scalatags.JsDom.all._
- override protected val content = div(cls := "demo")(
+ override protected def content = div(cls := "demo")(
h3(".append()"),
p(id := "append")("I would like to say: "),
h3(".prepend()"),
p(id := "prepend")("amigo!")
- ).render
+ )
- override protected val script = () => {
+ override protected def script = () => {
jQ("#append").append("hello")
jQ("#prepend").prepend("Hello ")
}
diff --git a/example/src/main/scala/io/udash/demos/jquery/views/functions/AttrView.scala b/example/src/main/scala/io/udash/demos/jquery/views/functions/AttrView.scala
index 7ae29d0..3fc4748 100644
--- a/example/src/main/scala/io/udash/demos/jquery/views/functions/AttrView.scala
+++ b/example/src/main/scala/io/udash/demos/jquery/views/functions/AttrView.scala
@@ -1,45 +1,42 @@
package io.udash.demos.jquery.views.functions
-import io.udash._
-import io.udash.demos.jquery.IndexState
import io.udash.demos.jquery.views.FunctionView
import io.udash.wrappers.jquery._
import org.scalajs.dom.{Element, Event}
-object AttrViewPresenter extends StaticViewFactory[IndexState.type](() => new AttrView)
-
/** Based on examples from: jQuery Docs. */
-class AttrView extends FunctionView {
+object AttrView extends FunctionView {
+
import scalatags.JsDom.all._
- override protected val content = div(cls := "demo")(
+ override protected def content = div(cls := "demo")(
h3(".attr() & .prop()"),
input(id := "check1", tpe := "checkbox", checked := "checked"),
label(`for` := "check1")("Check me"),
p(),
- button(onclick :+= ((_: Event) => {
+ button(onclick := ((_: Event) => {
jQ(".demo input").attr("data-checked", "checked").trigger("change")
false
}))(".attr(\"data-checked\", \"checked\")"),
- button(onclick :+= ((_: Event) => {
+ button(onclick := ((_: Event) => {
jQ(".demo input").attr("data-checked", "").trigger("change")
false
}))(".attr(\"data-checked\", \"\")"),
- button(onclick :+= ((_: Event) => {
+ button(onclick := ((_: Event) => {
jQ(".demo input").attr("data-checked", null).trigger("change")
false
}))(".attr(\"data-checked\", null)"), br(),
- button(onclick :+= ((_: Event) => {
+ button(onclick := ((_: Event) => {
jQ(".demo input").prop("checked", true).trigger("change")
false
}))(".prop(\"checked\", true)"),
- button(onclick :+= ((_: Event) => {
+ button(onclick := ((_: Event) => {
jQ(".demo input").prop("checked", false).trigger("change")
false
}))(".prop(\"checked\", false)")
- ).render
+ )
- override protected val script = () => {
+ override protected def script = () => {
jQ(".demo input").on(EventName.change, (input: Element, _: JQueryEvent) => {
jQ(".demo p").html(
s""".attr('data-checked'): ${jQ(input).attr("data-checked")}
diff --git a/example/src/main/scala/io/udash/demos/jquery/views/functions/CallbacksView.scala b/example/src/main/scala/io/udash/demos/jquery/views/functions/CallbacksView.scala
index e3824bb..639b700 100644
--- a/example/src/main/scala/io/udash/demos/jquery/views/functions/CallbacksView.scala
+++ b/example/src/main/scala/io/udash/demos/jquery/views/functions/CallbacksView.scala
@@ -1,35 +1,32 @@
package io.udash.demos.jquery.views.functions
-import io.udash._
-import io.udash.demos.jquery.IndexState
import io.udash.demos.jquery.views.FunctionView
import io.udash.wrappers.jquery._
import scala.scalajs.js
-object CallbacksViewPresenter extends StaticViewFactory[IndexState.type](() => new CallbacksView)
-
/** Based on examples from: jQuery Docs. */
-class CallbacksView extends FunctionView {
+object CallbacksView extends FunctionView {
+
import scalatags.JsDom.all._
- override protected val content = div(cls := "demo")(
+ override protected def content = div(cls := "demo")(
h3("Callbacks"),
ul(id := "plus"),
ul(id := "minus"),
ul(id := "mul"),
ul(id := "div")
- ).render
+ )
- override protected val script = () => {
+ override protected def script = () => {
val callbacks = jQ.callbacks[js.Function1[(Int, Int), js.Any], (Int, Int)]()
callbacks.add((t: (Int, Int)) => {
val (a, b) = t
- jQ("#plus").append(li(s"$a + $b = ${a+b}").render)
+ jQ("#plus").append(li(s"$a + $b = ${a + b}").render)
})
callbacks.add((t: (Int, Int)) => {
val (a, b) = t
- jQ("#minus").append(li(s"$a - $b = ${a-b}").render)
+ jQ("#minus").append(li(s"$a - $b = ${a - b}").render)
})
callbacks.add((t: (Int, Int)) => {
val (a, b) = t
diff --git a/example/src/main/scala/io/udash/demos/jquery/views/functions/ChildrenView.scala b/example/src/main/scala/io/udash/demos/jquery/views/functions/ChildrenView.scala
index ea4d0f6..a1e492e 100644
--- a/example/src/main/scala/io/udash/demos/jquery/views/functions/ChildrenView.scala
+++ b/example/src/main/scala/io/udash/demos/jquery/views/functions/ChildrenView.scala
@@ -1,17 +1,14 @@
package io.udash.demos.jquery.views.functions
-import io.udash._
-import io.udash.demos.jquery.IndexState
import io.udash.demos.jquery.views.FunctionView
import io.udash.wrappers.jquery._
-object ChildrenViewPresenter extends StaticViewFactory[IndexState.type](() => new ChildrenView)
-
/** Based on examples from: jQuery Docs. */
-class ChildrenView extends FunctionView {
+object ChildrenView extends FunctionView {
+
import scalatags.JsDom.all._
- override protected val content = div(cls := "demo")(
+ override protected def content = div(cls := "demo")(
h3(".children()"),
div(
span("Hello"),
@@ -19,9 +16,9 @@ class ChildrenView extends FunctionView {
div(cls := "selected")("and again"),
p("and one last time.")
)
- ).render
+ )
- override protected val script = () => {
+ override protected def script = () => {
jQ(".demo div").children().css("color", "blue")
jQ(".demo div").children(".selected").css("border-bottom", "3px double red")
jQ(".demo div").children("div.selected").css("border-top", "1px dashed green")
diff --git a/example/src/main/scala/io/udash/demos/jquery/views/functions/DataView.scala b/example/src/main/scala/io/udash/demos/jquery/views/functions/DataView.scala
index f905ec5..3f315f6 100644
--- a/example/src/main/scala/io/udash/demos/jquery/views/functions/DataView.scala
+++ b/example/src/main/scala/io/udash/demos/jquery/views/functions/DataView.scala
@@ -1,17 +1,14 @@
package io.udash.demos.jquery.views.functions
-import io.udash._
-import io.udash.demos.jquery.IndexState
import io.udash.demos.jquery.views.FunctionView
import io.udash.wrappers.jquery._
-object DataViewPresenter extends StaticViewFactory[IndexState.type](() => new DataView)
-
/** Based on examples from: jQuery Docs. */
-class DataView extends FunctionView {
+object DataView extends FunctionView {
+
import scalatags.JsDom.all._
- override protected val content = div(cls := "demo")(
+ override protected def content = div(cls := "demo")(
h3(".data()"),
div(
"The values stored were ",
@@ -19,9 +16,9 @@ class DataView extends FunctionView {
" and ",
span("_")
)
- ).render
+ )
- override protected val script = () => {
+ override protected def script = () => {
jQ(".demo div").data("test", Map("first" -> 16, "last" -> "pizza!"))
val data: Map[String, Any] = jQ(".demo div").data("test").get.asInstanceOf[Map[String, Any]]
jQ(".demo div span:first").text(data.get("first").get.toString)
diff --git a/example/src/main/scala/io/udash/demos/jquery/views/functions/DeferredView.scala b/example/src/main/scala/io/udash/demos/jquery/views/functions/DeferredView.scala
index 82ee717..a4e1cbe 100644
--- a/example/src/main/scala/io/udash/demos/jquery/views/functions/DeferredView.scala
+++ b/example/src/main/scala/io/udash/demos/jquery/views/functions/DeferredView.scala
@@ -1,22 +1,19 @@
package io.udash.demos.jquery.views.functions
-import io.udash._
-import io.udash.demos.jquery.IndexState
import io.udash.demos.jquery.views.FunctionView
import io.udash.wrappers.jquery._
import org.scalajs.dom.Event
import scala.scalajs.js
-object DeferredViewPresenter extends StaticViewFactory[IndexState.type](() => new DeferredView)
-
/** Based on examples from: jQuery Docs. */
-class DeferredView extends FunctionView {
+object DeferredView extends FunctionView {
+
import scalatags.JsDom.all._
var deferred: JQueryDeferred[js.Function1[Int, js.Any], Int] = null
- override protected val content = div(cls := "demo")(
+ override protected def content = div(cls := "demo")(
h3("Deferred"),
div(
div(id := "deferred")("???"),
@@ -42,9 +39,9 @@ class DeferredView extends FunctionView {
})
)("Notify(1)")
)
- ).render
+ )
- override protected val script = () => {
+ override protected def script = () => {
jQ(".demo button").prop("disabled", "")
deferred = jQ.deferred[js.Function1[Int, js.Any], Int]()
jQ("#deferred").text(s"Waiting...")
diff --git a/example/src/main/scala/io/udash/demos/jquery/views/functions/EachView.scala b/example/src/main/scala/io/udash/demos/jquery/views/functions/EachView.scala
index 447267b..dd64fc7 100644
--- a/example/src/main/scala/io/udash/demos/jquery/views/functions/EachView.scala
+++ b/example/src/main/scala/io/udash/demos/jquery/views/functions/EachView.scala
@@ -1,25 +1,22 @@
package io.udash.demos.jquery.views.functions
-import io.udash._
-import io.udash.demos.jquery.IndexState
import io.udash.demos.jquery.views.FunctionView
import io.udash.wrappers.jquery._
import org.scalajs.dom.Element
-object EachViewPresenter extends StaticViewFactory[IndexState.type](() => new EachView)
-
/** Based on examples from: jQuery Docs. */
-class EachView extends FunctionView {
+object EachView extends FunctionView {
+
import scalatags.JsDom.all._
- override protected val content = div(cls := "demo")(
+ override protected def content = div(cls := "demo")(
h3(".each()"),
div("Click button"),
div("to iterate through"),
div("these divs.")
- ).render
+ )
- override protected val script = () => {
+ override protected def script = () => {
jQ(".demo div").each((el: Element, idx: Int) => {
jQ(el).replaceWith(span(s"${el.textContent} ").render)
})
diff --git a/example/src/main/scala/io/udash/demos/jquery/views/functions/HideShowView.scala b/example/src/main/scala/io/udash/demos/jquery/views/functions/HideShowView.scala
index 9ed0a46..4227d2c 100644
--- a/example/src/main/scala/io/udash/demos/jquery/views/functions/HideShowView.scala
+++ b/example/src/main/scala/io/udash/demos/jquery/views/functions/HideShowView.scala
@@ -1,22 +1,19 @@
package io.udash.demos.jquery.views.functions
-import io.udash._
-import io.udash.demos.jquery.IndexState
import io.udash.demos.jquery.views.FunctionView
import io.udash.wrappers.jquery._
-object HideShowViewPresenter extends StaticViewFactory[IndexState.type](() => new HideShowView)
-
/** Based on examples from: jQuery Docs. */
-class HideShowView extends FunctionView {
+object HideShowView extends FunctionView {
+
import scalatags.JsDom.all._
- override protected val content = div(cls := "demo")(
+ override protected def content = div(cls := "demo")(
h3(".hide() & .show()"),
div("Click button to hide me")
- ).render
+ )
- override protected val script = () => {
+ override protected def script = () => {
jQ(".demo div")
.hide(AnimationOptions(
duration = Some(3000),
diff --git a/example/src/main/scala/io/udash/demos/jquery/views/functions/OffsetPositionView.scala b/example/src/main/scala/io/udash/demos/jquery/views/functions/OffsetPositionView.scala
index 9ec5d02..9ad4328 100644
--- a/example/src/main/scala/io/udash/demos/jquery/views/functions/OffsetPositionView.scala
+++ b/example/src/main/scala/io/udash/demos/jquery/views/functions/OffsetPositionView.scala
@@ -1,25 +1,22 @@
package io.udash.demos.jquery.views.functions
-import io.udash._
-import io.udash.demos.jquery.OffsetPositionState
import io.udash.demos.jquery.views.FunctionView
import io.udash.wrappers.jquery._
-object OffsetPositionViewPresenter extends StaticViewFactory[OffsetPositionState.type](() => new OffsetPositionView)
-
/** Based on examples from: jQuery Docs. */
-class OffsetPositionView extends FunctionView {
+object OffsetPositionView extends FunctionView {
+
import scalatags.JsDom.all._
- override protected val content = div(cls := "demo")(
+ override protected def content = div(cls := "demo")(
h3(".offset() & .position()"),
div(style := "padding: 12px; border: 1px red solid;")(
p(style := "margin-left: 10px; border: 1px blue solid;")("Hello world!")
),
p(id := "results")("")
- ).render
+ )
- override protected val script = () => {
+ override protected def script = () => {
val div = jQ(".demo div")
val p = jQ(".demo div p")
jQ("#results").html(
diff --git a/example/src/main/scala/io/udash/demos/jquery/views/functions/OnOneOffView.scala b/example/src/main/scala/io/udash/demos/jquery/views/functions/OnOneOffView.scala
index 08035d0..1c0de22 100644
--- a/example/src/main/scala/io/udash/demos/jquery/views/functions/OnOneOffView.scala
+++ b/example/src/main/scala/io/udash/demos/jquery/views/functions/OnOneOffView.scala
@@ -1,15 +1,12 @@
package io.udash.demos.jquery.views.functions
-import io.udash._
-import io.udash.demos.jquery.IndexState
import io.udash.demos.jquery.views.FunctionView
import io.udash.wrappers.jquery._
import org.scalajs.dom.{Element, Event}
-object OnOneOffViewPresenter extends StaticViewFactory[IndexState.type](() => new OnOneOffView)
-
/** Based on examples from: jQuery Docs. */
-class OnOneOffView extends FunctionView {
+object OnOneOffView extends FunctionView {
+
import scalatags.JsDom.all._
val onCallback = (_: Element, _: JQueryEvent) =>
@@ -17,23 +14,23 @@ class OnOneOffView extends FunctionView {
val oneCallback = (_: Element, _: JQueryEvent) =>
jQ(".demo ul").append(li("This will be added only once").render)
- override protected val content = div(cls := "demo")(
+ override protected def content = div(cls := "demo")(
h3(".on() & .one() & .off()"),
button(id := "click", disabled := "disabled")("Click me"),
ul(),
button(
id := "off",
disabled := "disabled",
- onclick :+= ((_: Event) => {
+ onclick := ((_: Event) => {
jQ(".demo #click")
.off(EventName.click, onCallback)
.off(EventName.click, oneCallback)
false
})
)("Off")
- ).render
+ )
- override protected val script = () => {
+ override protected def script = () => {
jQ(".demo #click")
.on(EventName.click, onCallback)
.one(EventName.click, oneCallback)
From 02637545b9994ea261b30ce307a94222178402c7 Mon Sep 17 00:00:00 2001
From: ddworak
Date: Mon, 30 Mar 2020 08:25:54 +0200
Subject: [PATCH 22/44] Append demos
---
example/src/main/scala/io/udash/demos/jquery/Init.scala | 2 ++
.../main/scala/io/udash/demos/jquery/views/IndexView.scala | 4 ++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/example/src/main/scala/io/udash/demos/jquery/Init.scala b/example/src/main/scala/io/udash/demos/jquery/Init.scala
index 0836569..40ed49c 100644
--- a/example/src/main/scala/io/udash/demos/jquery/Init.scala
+++ b/example/src/main/scala/io/udash/demos/jquery/Init.scala
@@ -1,5 +1,6 @@
package io.udash.demos.jquery
+import io.udash.demos.jquery.views.IndexView
import io.udash.wrappers.jquery._
import org.scalajs.dom
import org.scalajs.dom.Element
@@ -15,6 +16,7 @@ object Init {
if (appRoot.isEmpty) {
dom.console.error("Application root element not found! Check you index.html file!")
} else {
+ appRoot.get.appendChild(IndexView.content.render)
//applicationInstance.run(appRoot.get)
}
})
diff --git a/example/src/main/scala/io/udash/demos/jquery/views/IndexView.scala b/example/src/main/scala/io/udash/demos/jquery/views/IndexView.scala
index 4783c0f..672b852 100644
--- a/example/src/main/scala/io/udash/demos/jquery/views/IndexView.scala
+++ b/example/src/main/scala/io/udash/demos/jquery/views/IndexView.scala
@@ -24,7 +24,7 @@ object IndexView {
)
final val content = div(
- "Take a look at following demo pages:",
- demos.map(_.getTemplate),
+ "Take a look at following demos:",
+ demos.map(demo => div(demo.getTemplate)),
)
}
\ No newline at end of file
From 64ddf4b652d5a588601d81addc19693ebe847c94 Mon Sep 17 00:00:00 2001
From: ddworak
Date: Mon, 30 Mar 2020 10:34:05 +0200
Subject: [PATCH 23/44] Fixes for single view scripts
---
.../demos/jquery/views/FunctionView.scala | 9 ++++---
.../udash/demos/jquery/views/IndexView.scala | 2 +-
.../jquery/views/functions/AddBackView.scala | 26 ++++++-------------
.../jquery/views/functions/AddView.scala | 12 ++++-----
.../views/functions/AfterBeforeView.scala | 8 +++---
.../jquery/views/functions/AnimateView.scala | 26 +++++++++----------
.../views/functions/AppendPrependView.scala | 8 +++---
.../jquery/views/functions/AttrView.scala | 19 +++++++-------
.../views/functions/CallbacksView.scala | 12 ++++-----
.../jquery/views/functions/ChildrenView.scala | 10 +++----
.../jquery/views/functions/DataView.scala | 12 ++++-----
.../jquery/views/functions/DeferredView.scala | 14 +++++-----
.../jquery/views/functions/EachView.scala | 6 ++---
.../jquery/views/functions/HideShowView.scala | 6 ++---
.../views/functions/OffsetPositionView.scala | 10 +++----
.../jquery/views/functions/OnOneOffView.scala | 15 ++++++-----
16 files changed, 94 insertions(+), 101 deletions(-)
diff --git a/example/src/main/scala/io/udash/demos/jquery/views/FunctionView.scala b/example/src/main/scala/io/udash/demos/jquery/views/FunctionView.scala
index d26459e..e3c7360 100644
--- a/example/src/main/scala/io/udash/demos/jquery/views/FunctionView.scala
+++ b/example/src/main/scala/io/udash/demos/jquery/views/FunctionView.scala
@@ -1,23 +1,24 @@
package io.udash.demos.jquery.views
-import org.scalajs.dom.Event
+import org.scalajs.dom.{Element, Event}
abstract class FunctionView {
import scalatags.JsDom.all._
- protected def content: Modifier
+ protected val content: Element
protected def script: () => Any
final def getTemplate: Modifier =
div(
content,
- button(
+ h3(button(
+ marginTop := 10.px,
onclick := ((_: Event) => {
script()
false
})
- )("Run script")
+ )("Run script"))
)
}
\ No newline at end of file
diff --git a/example/src/main/scala/io/udash/demos/jquery/views/IndexView.scala b/example/src/main/scala/io/udash/demos/jquery/views/IndexView.scala
index 672b852..0a1e7e2 100644
--- a/example/src/main/scala/io/udash/demos/jquery/views/IndexView.scala
+++ b/example/src/main/scala/io/udash/demos/jquery/views/IndexView.scala
@@ -25,6 +25,6 @@ object IndexView {
final val content = div(
"Take a look at following demos:",
- demos.map(demo => div(demo.getTemplate)),
+ demos.map(demo => Seq(hr, div(demo.getTemplate))),
)
}
\ No newline at end of file
diff --git a/example/src/main/scala/io/udash/demos/jquery/views/functions/AddBackView.scala b/example/src/main/scala/io/udash/demos/jquery/views/functions/AddBackView.scala
index 620c320..3927a6b 100644
--- a/example/src/main/scala/io/udash/demos/jquery/views/functions/AddBackView.scala
+++ b/example/src/main/scala/io/udash/demos/jquery/views/functions/AddBackView.scala
@@ -9,25 +9,15 @@ object AddBackView extends FunctionView {
import scalatags.JsDom.all._
- override protected def content = div(cls := "demo")(
+ override protected val content = div(cls := "addback")(
h3(".addBack() & .addClass()"),
tags2.style(
- """.demo p, .demo div {
- | margin: 5px;
- | padding: 5px;
- |}
- |.border {
+ """
+ |.addback .border {
| border: 2px solid red;
|}
- |.background {
+ |.addback .background {
| background: yellow;
- |}
- |.left, .right {
- | width: 45%;
- | float: left;
- |}
- |.right {
- | margin-left: 3%;
|}""".stripMargin
),
div(cls := "left")(
@@ -44,15 +34,15 @@ object AddBackView extends FunctionView {
p("Second Paragraph")
)
)
- )
+ ).render
override protected def script = () => {
- jQ(".demo div.left, .demo div.right").find("div, div > p").addClass("border")
+ jQ("div.left, div.right", content).find("div, div > p").addClass("border")
// First Example
- jQ(".demo div.before-addback").find("p").addClass("background")
+ jQ("div.before-addback", content).find("p").addClass("background")
// Second Example
- jQ(".demo div.after-addback").find("p").addBack().addClass("background")
+ jQ("div.after-addback", content).find("p").addBack().addClass("background")
}
}
\ No newline at end of file
diff --git a/example/src/main/scala/io/udash/demos/jquery/views/functions/AddView.scala b/example/src/main/scala/io/udash/demos/jquery/views/functions/AddView.scala
index f97749d..45c65f1 100644
--- a/example/src/main/scala/io/udash/demos/jquery/views/functions/AddView.scala
+++ b/example/src/main/scala/io/udash/demos/jquery/views/functions/AddView.scala
@@ -9,16 +9,16 @@ object AddView extends FunctionView {
import scalatags.JsDom.all._
- override protected def content = div(cls := "demo")(
+ override protected val content = div(cls := "addview")(
h3(".add() & .css()"),
tags2.style(
- """.demo div {
+ """.addview div {
| width: 60px;
| height: 60px;
| margin: 10px;
| float: left;
|}
- |.demo p {
+ |.addview p {
| clear: left;
| font-weight: bold;
| font-size: 16px;
@@ -34,11 +34,11 @@ object AddView extends FunctionView {
div(),
div(),
p("Added this... (notice no border)")
- )
+ ).render
override protected def script = () => {
- jQ(".demo div").css("border", "2px solid red")
- .add(".demo p")
+ jQ("div", content).css("border", "2px solid red")
+ .add("p", content)
.css("background", "yellow")
}
}
\ No newline at end of file
diff --git a/example/src/main/scala/io/udash/demos/jquery/views/functions/AfterBeforeView.scala b/example/src/main/scala/io/udash/demos/jquery/views/functions/AfterBeforeView.scala
index 32acbed..3aaf39d 100644
--- a/example/src/main/scala/io/udash/demos/jquery/views/functions/AfterBeforeView.scala
+++ b/example/src/main/scala/io/udash/demos/jquery/views/functions/AfterBeforeView.scala
@@ -8,7 +8,7 @@ object AfterBeforeView extends FunctionView {
import scalatags.JsDom.all._
- override protected def content = div(cls := "demo")(
+ override protected val content = div(
h3(".after()"),
div(
p(cls := "after")("I would like to say: ")
@@ -17,10 +17,10 @@ object AfterBeforeView extends FunctionView {
div(
p(cls := "before")("is what I said...")
)
- )
+ ).render
override protected def script = () => {
- jQ(".after").after("Hello")
- jQ(".before").before("Hello")
+ jQ(".after", content).after("Hello")
+ jQ(".before", content).before("Hello")
}
}
\ No newline at end of file
diff --git a/example/src/main/scala/io/udash/demos/jquery/views/functions/AnimateView.scala b/example/src/main/scala/io/udash/demos/jquery/views/functions/AnimateView.scala
index ec14da8..445631d 100644
--- a/example/src/main/scala/io/udash/demos/jquery/views/functions/AnimateView.scala
+++ b/example/src/main/scala/io/udash/demos/jquery/views/functions/AnimateView.scala
@@ -10,10 +10,10 @@ object AnimateView extends FunctionView {
import scalatags.JsDom.all._
- override protected def content = div(cls := "demo")(
+ override protected val content = div(cls := "animate")(
h3(".animate() & .click()"),
tags2.style(
- """.demo div {
+ """.animate div {
| background-color: #bca;
| width: 200px;
| height: 1.1em;
@@ -22,7 +22,7 @@ object AnimateView extends FunctionView {
| margin: 3px;
| font-size: 14px;
|}
- |.demo button {
+ |.animate button {
| font-size: 14px;
|}""".stripMargin
),
@@ -32,11 +32,11 @@ object AnimateView extends FunctionView {
button(id := "go4", disabled := "disabled")("» Reset"),
div(id := "block1")("Block1"),
div(id := "block2")("Block2")
- )
+ ).render
override protected def script = () => {
- jQ("#go1").on(EventName.click, (_: Element, _: JQueryEvent) => {
- jQ("#block1")
+ jQ("#go1", content).on(EventName.click, (_: Element, _: JQueryEvent) => {
+ jQ("#block1", content)
.animate(Map(
"width" -> "90%"
), AnimationOptions(
@@ -47,27 +47,27 @@ object AnimateView extends FunctionView {
.animate(Map("borderRightWidth" -> "15px"), 1500)
})
- jQ("#go2").on(EventName.click, (_: Element, _: JQueryEvent) => {
- jQ("#block2")
+ jQ("#go2", content).on(EventName.click, (_: Element, _: JQueryEvent) => {
+ jQ("#block2", content)
.animate(Map("width" -> "90%"), 1000)
.animate(Map("fontSize" -> "24px"), 1000)
.animate(Map("borderLeftWidth" -> "15px"), 1000)
})
- jQ("#go3").on(EventName.click, (_: Element, _: JQueryEvent) => {
- jQ("#go1").add("#go2").trigger("click")
+ jQ("#go3", content).on(EventName.click, (_: Element, _: JQueryEvent) => {
+ jQ("#go1", content).add("#go2", content).trigger("click")
})
- jQ("#go4").on(EventName.click, (_: Element, _: JQueryEvent) => {
+ jQ("#go4", content).on(EventName.click, (_: Element, _: JQueryEvent) => {
// TODO: It does not work without explicit Map elements type
import scala.scalajs.js.`|`
- jQ("div").css(Map[String, String | Int | Double | Boolean](
+ jQ("div", content).css(Map[String, String | Int | Double | Boolean](
"width" -> "",
"fontSize" -> "",
"borderWidth" -> ""
))
})
- jQ(".demo button").prop("disabled", "")
+ jQ("button", content).prop("disabled", "")
}
}
\ No newline at end of file
diff --git a/example/src/main/scala/io/udash/demos/jquery/views/functions/AppendPrependView.scala b/example/src/main/scala/io/udash/demos/jquery/views/functions/AppendPrependView.scala
index 90d01e5..b5d2d81 100644
--- a/example/src/main/scala/io/udash/demos/jquery/views/functions/AppendPrependView.scala
+++ b/example/src/main/scala/io/udash/demos/jquery/views/functions/AppendPrependView.scala
@@ -8,15 +8,15 @@ object AppendPrependView extends FunctionView {
import scalatags.JsDom.all._
- override protected def content = div(cls := "demo")(
+ override protected val content = div(
h3(".append()"),
p(id := "append")("I would like to say: "),
h3(".prepend()"),
p(id := "prepend")("amigo!")
- )
+ ).render
override protected def script = () => {
- jQ("#append").append("hello")
- jQ("#prepend").prepend("Hello ")
+ jQ("#append", content).append("hello")
+ jQ("#prepend", content).prepend("Hello ")
}
}
\ No newline at end of file
diff --git a/example/src/main/scala/io/udash/demos/jquery/views/functions/AttrView.scala b/example/src/main/scala/io/udash/demos/jquery/views/functions/AttrView.scala
index 3fc4748..0c6f2be 100644
--- a/example/src/main/scala/io/udash/demos/jquery/views/functions/AttrView.scala
+++ b/example/src/main/scala/io/udash/demos/jquery/views/functions/AttrView.scala
@@ -2,6 +2,7 @@ package io.udash.demos.jquery.views.functions
import io.udash.demos.jquery.views.FunctionView
import io.udash.wrappers.jquery._
+import org.scalajs.dom.html.Div
import org.scalajs.dom.{Element, Event}
/** Based on examples from: jQuery Docs. */
@@ -9,36 +10,36 @@ object AttrView extends FunctionView {
import scalatags.JsDom.all._
- override protected def content = div(cls := "demo")(
+ override protected val content: Div = div(
h3(".attr() & .prop()"),
input(id := "check1", tpe := "checkbox", checked := "checked"),
label(`for` := "check1")("Check me"),
p(),
button(onclick := ((_: Event) => {
- jQ(".demo input").attr("data-checked", "checked").trigger("change")
+ jQ("input", content).attr("data-checked", "checked").trigger("change")
false
}))(".attr(\"data-checked\", \"checked\")"),
button(onclick := ((_: Event) => {
- jQ(".demo input").attr("data-checked", "").trigger("change")
+ jQ("input", content).attr("data-checked", "").trigger("change")
false
}))(".attr(\"data-checked\", \"\")"),
button(onclick := ((_: Event) => {
- jQ(".demo input").attr("data-checked", null).trigger("change")
+ jQ("input", content).attr("data-checked", null).trigger("change")
false
}))(".attr(\"data-checked\", null)"), br(),
button(onclick := ((_: Event) => {
- jQ(".demo input").prop("checked", true).trigger("change")
+ jQ("input", content).prop("checked", true).trigger("change")
false
}))(".prop(\"checked\", true)"),
button(onclick := ((_: Event) => {
- jQ(".demo input").prop("checked", false).trigger("change")
+ jQ("input", content).prop("checked", false).trigger("change")
false
}))(".prop(\"checked\", false)")
- )
+ ).render
override protected def script = () => {
- jQ(".demo input").on(EventName.change, (input: Element, _: JQueryEvent) => {
- jQ(".demo p").html(
+ jQ("input", content).on(EventName.change, (input: Element, _: JQueryEvent) => {
+ jQ("p", content).html(
s""".attr('data-checked'): ${jQ(input).attr("data-checked")}
|.prop('checked'): ${jQ(input).prop("checked")}
|.is(':checked'): ${jQ(input).is(":checked")}""".stripMargin
diff --git a/example/src/main/scala/io/udash/demos/jquery/views/functions/CallbacksView.scala b/example/src/main/scala/io/udash/demos/jquery/views/functions/CallbacksView.scala
index 639b700..a7a8243 100644
--- a/example/src/main/scala/io/udash/demos/jquery/views/functions/CallbacksView.scala
+++ b/example/src/main/scala/io/udash/demos/jquery/views/functions/CallbacksView.scala
@@ -10,31 +10,31 @@ object CallbacksView extends FunctionView {
import scalatags.JsDom.all._
- override protected def content = div(cls := "demo")(
+ override protected val content = div(
h3("Callbacks"),
ul(id := "plus"),
ul(id := "minus"),
ul(id := "mul"),
ul(id := "div")
- )
+ ).render
override protected def script = () => {
val callbacks = jQ.callbacks[js.Function1[(Int, Int), js.Any], (Int, Int)]()
callbacks.add((t: (Int, Int)) => {
val (a, b) = t
- jQ("#plus").append(li(s"$a + $b = ${a + b}").render)
+ jQ("#plus", content).append(li(s"$a + $b = ${a + b}").render)
})
callbacks.add((t: (Int, Int)) => {
val (a, b) = t
- jQ("#minus").append(li(s"$a - $b = ${a - b}").render)
+ jQ("#minus", content).append(li(s"$a - $b = ${a - b}").render)
})
callbacks.add((t: (Int, Int)) => {
val (a, b) = t
- jQ("#mul").append(li(s"$a * $b = ${a*b}").render)
+ jQ("#mul", content).append(li(s"$a * $b = ${a * b}").render)
})
callbacks.add((t: (Int, Int)) => {
val (a, b) = t
- jQ("#div").append(li(s"$a / $b = ${a/b}").render)
+ jQ("#div", content).append(li(s"$a / $b = ${a / b}").render)
})
callbacks.fire((1, 1))
diff --git a/example/src/main/scala/io/udash/demos/jquery/views/functions/ChildrenView.scala b/example/src/main/scala/io/udash/demos/jquery/views/functions/ChildrenView.scala
index a1e492e..7043bc8 100644
--- a/example/src/main/scala/io/udash/demos/jquery/views/functions/ChildrenView.scala
+++ b/example/src/main/scala/io/udash/demos/jquery/views/functions/ChildrenView.scala
@@ -8,7 +8,7 @@ object ChildrenView extends FunctionView {
import scalatags.JsDom.all._
- override protected def content = div(cls := "demo")(
+ override protected val content = div(
h3(".children()"),
div(
span("Hello"),
@@ -16,11 +16,11 @@ object ChildrenView extends FunctionView {
div(cls := "selected")("and again"),
p("and one last time.")
)
- )
+ ).render
override protected def script = () => {
- jQ(".demo div").children().css("color", "blue")
- jQ(".demo div").children(".selected").css("border-bottom", "3px double red")
- jQ(".demo div").children("div.selected").css("border-top", "1px dashed green")
+ jQ("div", content).children().css("color", "blue")
+ jQ("div", content).children(".selected").css("border-bottom", "3px double red")
+ jQ("div", content).children("div.selected").css("border-top", "1px dashed green")
}
}
\ No newline at end of file
diff --git a/example/src/main/scala/io/udash/demos/jquery/views/functions/DataView.scala b/example/src/main/scala/io/udash/demos/jquery/views/functions/DataView.scala
index 3f315f6..ad3f660 100644
--- a/example/src/main/scala/io/udash/demos/jquery/views/functions/DataView.scala
+++ b/example/src/main/scala/io/udash/demos/jquery/views/functions/DataView.scala
@@ -8,7 +8,7 @@ object DataView extends FunctionView {
import scalatags.JsDom.all._
- override protected def content = div(cls := "demo")(
+ override protected val content = div(
h3(".data()"),
div(
"The values stored were ",
@@ -16,12 +16,12 @@ object DataView extends FunctionView {
" and ",
span("_")
)
- )
+ ).render
override protected def script = () => {
- jQ(".demo div").data("test", Map("first" -> 16, "last" -> "pizza!"))
- val data: Map[String, Any] = jQ(".demo div").data("test").get.asInstanceOf[Map[String, Any]]
- jQ(".demo div span:first").text(data.get("first").get.toString)
- jQ(".demo div span:last").text(data.get("last").get.toString)
+ jQ("div", content).data("test", Map("first" -> 16, "last" -> "pizza!"))
+ val data: Map[String, Any] = jQ("div", content).data("test").get.asInstanceOf[Map[String, Any]]
+ jQ("div span:first", content).text(data.get("first").get.toString)
+ jQ("div span:last", content).text(data.get("last").get.toString)
}
}
\ No newline at end of file
diff --git a/example/src/main/scala/io/udash/demos/jquery/views/functions/DeferredView.scala b/example/src/main/scala/io/udash/demos/jquery/views/functions/DeferredView.scala
index a4e1cbe..ae31443 100644
--- a/example/src/main/scala/io/udash/demos/jquery/views/functions/DeferredView.scala
+++ b/example/src/main/scala/io/udash/demos/jquery/views/functions/DeferredView.scala
@@ -13,7 +13,7 @@ object DeferredView extends FunctionView {
var deferred: JQueryDeferred[js.Function1[Int, js.Any], Int] = null
- override protected def content = div(cls := "demo")(
+ override protected val content = div(
h3("Deferred"),
div(
div(id := "deferred")("???"),
@@ -39,14 +39,14 @@ object DeferredView extends FunctionView {
})
)("Notify(1)")
)
- )
+ ).render
override protected def script = () => {
- jQ(".demo button").prop("disabled", "")
+ jQ("button", content).prop("disabled", "")
deferred = jQ.deferred[js.Function1[Int, js.Any], Int]()
- jQ("#deferred").text(s"Waiting...")
- deferred.done((i: Int) => jQ("#deferred").text(s"Done: $i"))
- deferred.fail((i: Int) => jQ("#deferred").text(s"Fail: $i"))
- deferred.progress((i: Int) => jQ("#deferred").text(s"Progress: $i"))
+ jQ("#deferred", content).text(s"Waiting...")
+ deferred.done((i: Int) => jQ("#deferred", content).text(s"Done: $i"))
+ deferred.fail((i: Int) => jQ("#deferred", content).text(s"Fail: $i"))
+ deferred.progress((i: Int) => jQ("#deferred", content).text(s"Progress: $i"))
}
}
\ No newline at end of file
diff --git a/example/src/main/scala/io/udash/demos/jquery/views/functions/EachView.scala b/example/src/main/scala/io/udash/demos/jquery/views/functions/EachView.scala
index dd64fc7..0f5097a 100644
--- a/example/src/main/scala/io/udash/demos/jquery/views/functions/EachView.scala
+++ b/example/src/main/scala/io/udash/demos/jquery/views/functions/EachView.scala
@@ -9,15 +9,15 @@ object EachView extends FunctionView {
import scalatags.JsDom.all._
- override protected def content = div(cls := "demo")(
+ override protected val content = div(
h3(".each()"),
div("Click button"),
div("to iterate through"),
div("these divs.")
- )
+ ).render
override protected def script = () => {
- jQ(".demo div").each((el: Element, idx: Int) => {
+ jQ("div", content).each((el: Element, idx: Int) => {
jQ(el).replaceWith(span(s"${el.textContent} ").render)
})
}
diff --git a/example/src/main/scala/io/udash/demos/jquery/views/functions/HideShowView.scala b/example/src/main/scala/io/udash/demos/jquery/views/functions/HideShowView.scala
index 4227d2c..7a1d137 100644
--- a/example/src/main/scala/io/udash/demos/jquery/views/functions/HideShowView.scala
+++ b/example/src/main/scala/io/udash/demos/jquery/views/functions/HideShowView.scala
@@ -8,13 +8,13 @@ object HideShowView extends FunctionView {
import scalatags.JsDom.all._
- override protected def content = div(cls := "demo")(
+ override protected val content = div(
h3(".hide() & .show()"),
div("Click button to hide me")
- )
+ ).render
override protected def script = () => {
- jQ(".demo div")
+ jQ("div", content)
.hide(AnimationOptions(
duration = Some(3000),
easing = Some(EasingFunction.linear)
diff --git a/example/src/main/scala/io/udash/demos/jquery/views/functions/OffsetPositionView.scala b/example/src/main/scala/io/udash/demos/jquery/views/functions/OffsetPositionView.scala
index 9ad4328..0796b29 100644
--- a/example/src/main/scala/io/udash/demos/jquery/views/functions/OffsetPositionView.scala
+++ b/example/src/main/scala/io/udash/demos/jquery/views/functions/OffsetPositionView.scala
@@ -8,18 +8,18 @@ object OffsetPositionView extends FunctionView {
import scalatags.JsDom.all._
- override protected def content = div(cls := "demo")(
+ override protected val content = div(
h3(".offset() & .position()"),
div(style := "padding: 12px; border: 1px red solid;")(
p(style := "margin-left: 10px; border: 1px blue solid;")("Hello world!")
),
p(id := "results")("")
- )
+ ).render
override protected def script = () => {
- val div = jQ(".demo div")
- val p = jQ(".demo div p")
- jQ("#results").html(
+ val div = jQ("div", content)
+ val p = jQ("div p", content)
+ jQ("#results", content).html(
s"""Div offset: (${div.offset().top}, ${div.offset().left})
|Div position: (${div.position().top}, ${div.position().left})
|Paragraph offset: (${p.offset().top}, ${p.offset().left})
diff --git a/example/src/main/scala/io/udash/demos/jquery/views/functions/OnOneOffView.scala b/example/src/main/scala/io/udash/demos/jquery/views/functions/OnOneOffView.scala
index 1c0de22..368f69f 100644
--- a/example/src/main/scala/io/udash/demos/jquery/views/functions/OnOneOffView.scala
+++ b/example/src/main/scala/io/udash/demos/jquery/views/functions/OnOneOffView.scala
@@ -2,6 +2,7 @@ package io.udash.demos.jquery.views.functions
import io.udash.demos.jquery.views.FunctionView
import io.udash.wrappers.jquery._
+import org.scalajs.dom.html.Div
import org.scalajs.dom.{Element, Event}
/** Based on examples from: jQuery Docs. */
@@ -10,11 +11,11 @@ object OnOneOffView extends FunctionView {
import scalatags.JsDom.all._
val onCallback = (_: Element, _: JQueryEvent) =>
- jQ(".demo ul").append(li("This will be added on every click").render)
+ jQ("ul", content).append(li("This will be added on every click").render)
val oneCallback = (_: Element, _: JQueryEvent) =>
- jQ(".demo ul").append(li("This will be added only once").render)
+ jQ("ul", content).append(li("This will be added only once").render)
- override protected def content = div(cls := "demo")(
+ override protected val content: Div = div(
h3(".on() & .one() & .off()"),
button(id := "click", disabled := "disabled")("Click me"),
ul(),
@@ -22,20 +23,20 @@ object OnOneOffView extends FunctionView {
id := "off",
disabled := "disabled",
onclick := ((_: Event) => {
- jQ(".demo #click")
+ jQ("#click", content)
.off(EventName.click, onCallback)
.off(EventName.click, oneCallback)
false
})
)("Off")
- )
+ ).render
override protected def script = () => {
- jQ(".demo #click")
+ jQ("#click", content)
.on(EventName.click, onCallback)
.one(EventName.click, oneCallback)
- jQ(".demo button")
+ jQ("button", content)
.prop("disabled", "")
}
}
\ No newline at end of file
From 06ca2e3517d76ea94c26d7e198e566c3ba61bae1 Mon Sep 17 00:00:00 2001
From: ddworak
Date: Mon, 30 Mar 2020 10:40:12 +0200
Subject: [PATCH 24/44] Fix global demo
---
example/global-demo/src/main/assets/index.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/example/global-demo/src/main/assets/index.html b/example/global-demo/src/main/assets/index.html
index 90d7641..b746eab 100644
--- a/example/global-demo/src/main/assets/index.html
+++ b/example/global-demo/src/main/assets/index.html
@@ -7,7 +7,7 @@
-
+