Skip to content

Commit a6a1d3e

Browse files
author
Mateusz Starzec
committed
Merge branch 'master' into deploy
# Conflicts: # project/plugins.sbt
2 parents 2156e04 + 64cb3e0 commit a6a1d3e

File tree

10 files changed

+47
-21
lines changed

10 files changed

+47
-21
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ before_script:
2323

2424
script:
2525
- sbt ++$TRAVIS_SCALA_VERSION test
26-
- sbt ++$TRAVIS_SCALA_VERSION +publishLocal
26+
- sbt ++$TRAVIS_SCALA_VERSION publishLocal
2727
- cd example && sbt ++$TRAVIS_SCALA_VERSION compile fullOptJS

README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ Static types for the jQuery API for [Scala.js](http://www.scala-js.org/) program
44

55
## Usage
66

7-
Add the following to your SBT build:
7+
Add the following dependency to your SBT build:
88

99
```scala
10-
libraryDependencies += "io.udash" %%% "udash-jquery" % "1.1.0"
10+
libraryDependencies += "io.udash" %%% "udash-jquery" % "2.0.0"
1111
```
1212

1313
then import the jQuery package:
@@ -16,6 +16,21 @@ then import the jQuery package:
1616
import io.udash.wrappers.jquery._
1717
```
1818

19+
Since version `2.0.0` the wrapper does not force JS dependency on jQuery. You have to
20+
add it manually by:
21+
* explicit link in your `index.html`.
22+
```html
23+
<script src="https://code.jquery.com/jquery-3.3.1.min.js"
24+
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
25+
crossorigin="anonymous"></script>
26+
```
27+
* or a [Scala.js dependency](http://www.scala-js.org/doc/project/dependencies.html).
28+
```scala
29+
jsDependencies +=
30+
"org.webjars" % "jquery" % "3.3.1" / "3.3.1/jquery.js" minified "3.3.1/jquery.min.js"
31+
```
32+
33+
1934
## Examples
2035

2136
```scala

build.sbt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import org.scalajs.jsenv.selenium.SeleniumJSEnv
55
name := "udash-jquery"
66

77
inThisBuild(Seq(
8-
version := "1.2.0",
8+
version := "2.0.0",
99
organization := "io.udash",
1010
scalaVersion := "2.12.6",
1111
crossScalaVersions := Seq("2.11.12", "2.12.6"),
@@ -58,13 +58,13 @@ val commonJSSettings = Seq(
5858
)
5959

6060
libraryDependencies ++= Seq(
61-
"org.scala-js" %%% "scalajs-dom" % "0.9.5",
61+
"org.scala-js" %%% "scalajs-dom" % "0.9.6",
6262
"org.scalatest" %%% "scalatest" % "3.0.5" % Test,
6363
"com.lihaoyi" %%% "scalatags" % "0.6.7" % Test
6464
)
6565

6666
jsDependencies +=
67-
"org.webjars" % "jquery" % "3.3.1" / "3.3.1/jquery.js" minified "3.3.1/jquery.min.js"
67+
"org.webjars" % "jquery" % "3.3.1" % Test / "3.3.1/jquery.js" minified "3.3.1/jquery.min.js"
6868

6969
lazy val root = project.in(file("."))
7070
.enablePlugins(ScalaJSPlugin)

example/build.sbt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
name := "jquery-demo"
22

33
inThisBuild(Seq(
4-
version := "1.2.0",
4+
version := "2.0.0",
55
organization := "io.udash",
66
scalaVersion := "2.12.6",
7+
crossScalaVersions := Seq("2.11.12", "2.12.6"),
78
scalacOptions ++= Seq(
89
"-feature",
910
"-deprecation",
@@ -31,6 +32,7 @@ val copyAssets = taskKey[Unit]("Copies all assets to the target directory.")
3132
val `jquery-demo` = project.in(file(".")).enablePlugins(ScalaJSPlugin)
3233
.settings(
3334
libraryDependencies ++= Dependencies.deps.value,
35+
jsDependencies ++= Dependencies.jsDeps.value,
3436

3537
/* move these files out of target/. */
3638
Compile / fullOptJS / crossTarget := generatedDir,

example/project/Dependencies.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
2+
import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport._
23
import sbt._
34

45
object Dependencies {
56
val udashCoreVersion = "0.6.1"
6-
val udashJQueryVersion = "1.2.0"
7+
val udashJQueryVersion = "2.0.0"
78

89
val deps = Def.setting(Seq[ModuleID](
910
"io.udash" %%% "udash-core-frontend" % udashCoreVersion,
1011
"io.udash" %%% "udash-jquery" % udashJQueryVersion
1112
))
13+
14+
val jsDeps = Def.setting(Seq[org.scalajs.sbtplugin.JSModuleID](
15+
"org.webjars" % "jquery" % "3.3.1" / "3.3.1/jquery.js" minified "3.3.1/jquery.min.js"
16+
))
1217
}

example/project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version = 1.1.4
1+
sbt.version = 1.2.0

example/project/plugins.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
logLevel := Level.Warn
22

3-
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.22")
3+
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.24")

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version = 1.1.4
1+
sbt.version = 1.2.0

project/plugins.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ logLevel := Level.Warn
22

33
libraryDependencies += "org.scala-js" %% "scalajs-env-selenium" % "0.2.0"
44

5-
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.22")
5+
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.24")
66

77
// Deployment configuration
8-
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.1")
8+
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.2")
99
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.3")

src/main/scala/io/udash/wrappers/jquery/JQuery.scala

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -397,18 +397,10 @@ trait JQuery extends js.Object {
397397
* See: <a href="http://api.jquery.com/offsetParent/">jQuery Docs</a> */
398398
def offsetParent(): JQuery = js.native
399399

400-
/** Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin. Returns a number (without "px") representation of the value or null if called on an empty set of elements. <br/>
401-
* See: <a href="http://api.jquery.com/outerHeight/">jQuery Docs</a> */
402-
def outerHeight(includeMargin: Boolean = js.native): Double = js.native
403-
404400
/** Set the CSS outer Height of each element in the set of matched elements. <br/>
405401
* See: <a href="http://api.jquery.com/outerHeight/">jQuery Docs</a> */
406402
def outerHeight(value: Int | Double | String): JQuery = js.native
407403

408-
/** Get the current computed width for the first element in the set of matched elements, including padding and border. <br/>
409-
* See: <a href="http://api.jquery.com/outerWidth/">jQuery Docs</a> */
410-
def outerWidth(includeMargin: Boolean = js.native): Double = js.native
411-
412404
/** Set the CSS outer width of each element in the set of matched elements. <br/>
413405
* See: <a href="http://api.jquery.com/outerWidth/">jQuery Docs</a> */
414406
def outerWidth(value: Int | Double | String): JQuery = js.native
@@ -1142,11 +1134,23 @@ object JQuery {
11421134
registrations.update(el, jqueryRegs)
11431135
}
11441136

1137+
/** Get the current computed height for the first element in the set of matched elements, including padding,
1138+
* border, and optionally margin. Returns a number (without "px") representation of the value or undef
1139+
* if called on an empty set of elements. <br/>
1140+
* See: <a href="http://api.jquery.com/outerHeight/">jQuery Docs</a> */
1141+
def outerHeight(includeMargin: Boolean = false): Option[Double] =
1142+
jquery.asInstanceOf[js.Dynamic].outerHeight(includeMargin).asInstanceOf[UndefOr[Double]].toOption
1143+
11451144
/** Set the CSS outer Height of each element in the set of matched elements. <br/>
11461145
* See: <a href="http://api.jquery.com/outerHeight/">jQuery Docs</a> */
11471146
def outerHeight(function: (Element, Int, Double) => Double): JQuery =
11481147
jquery.asInstanceOf[js.Dynamic].outerHeight(js.ThisFunction.fromFunction3(function)).asInstanceOf[JQuery]
11491148

1149+
/** Get the current computed width for the first element in the set of matched elements, including padding and border. <br/>
1150+
* See: <a href="http://api.jquery.com/outerWidth/">jQuery Docs</a> */
1151+
def outerWidth(includeMargin: Boolean = false): Option[Double] =
1152+
jquery.asInstanceOf[js.Dynamic].outerWidth(includeMargin).asInstanceOf[UndefOr[Double]].toOption
1153+
11501154
/** Set the CSS outer width of each element in the set of matched elements. <br/>
11511155
* See: <a href="http://api.jquery.com/outerWidth/">jQuery Docs</a> */
11521156
def outerWidth(function: (Element, Int, Double) => Double): JQuery =

0 commit comments

Comments
 (0)