File tree 6 files changed +32
-7
lines changed
main/scala/io/udash/wrappers/jquery
test/scala/io/udash/wrappers/jquery_test
6 files changed +32
-7
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ Static types for the jQuery API for [Scala.js](http://www.scala-js.org/) program
10
10
Add the following dependency to your SBT build:
11
11
12
12
``` scala
13
- libraryDependencies += " io.udash" %%% " udash-jquery" % " 3.0.4 "
13
+ libraryDependencies += " io.udash" %%% " udash-jquery" % " 3.2.0 "
14
14
```
15
15
16
16
then import the jQuery package:
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ val commonJSSettings = Seq(
33
33
val githubDir = " https://raw.githubusercontent.com/UdashFramework/scala-js-jquery"
34
34
s " -P:scalajs:mapSourceURI: $localDir-> $githubDir/v ${version.value}/ "
35
35
},
36
+ webpack / version := " 5.75.0" , // TODO: can be removed when sbt-scalajs-bundler > 0.21.1
36
37
)
37
38
38
39
val deploymentConfiguration = Seq (
@@ -80,11 +81,11 @@ lazy val root = project.in(file("."))
80
81
deploymentConfiguration,
81
82
82
83
libraryDependencies ++= Seq (
83
- " org.scala-js" %%% " scalajs-dom" % " 2.0 .0" ,
84
+ " org.scala-js" %%% " scalajs-dom" % " 2.7 .0" ,
84
85
" org.scalatest" %%% " scalatest" % " 3.2.9" % Test ,
85
86
" com.lihaoyi" %%% " scalatags" % " 0.10.0" % Test
86
87
),
87
88
88
- Compile / npmDependencies += " jquery" -> " 3.4.1 " ,
89
- jsDependencies += " org.webjars" % " jquery" % " 3.4.1 " / " 3.4.1 /jquery.js" minified s " 3.4.1 /jquery.min.js " ,
89
+ Compile / npmDependencies += " jquery" -> " 3.6.4 " ,
90
+ jsDependencies += " org.webjars" % " jquery" % " 3.6.4 " / " 3.6.4 /jquery.js" minified s " 3.6.4 /jquery.min.js " ,
90
91
)
Original file line number Diff line number Diff line change 1
1
# suppress inspection "UnusedProperty"
2
- sbt.version =1.5.5
2
+ sbt.version =1.9.2
Original file line number Diff line number Diff line change 1
1
logLevel := Level .Warn
2
2
3
- addSbtPlugin(" org.scala-js" % " sbt-scalajs" % " 1.7.0 " )
4
- addSbtPlugin(" ch.epfl.scala" % " sbt-scalajs-bundler" % " 0.20.0 " )
3
+ addSbtPlugin(" org.scala-js" % " sbt-scalajs" % " 1.13.2 " )
4
+ addSbtPlugin(" ch.epfl.scala" % " sbt-scalajs-bundler" % " 0.21.1 " )
5
5
addSbtPlugin(" org.scala-js" % " sbt-jsdependencies" % " 1.0.2" )
6
6
7
7
// Deployment configuration
Original file line number Diff line number Diff line change @@ -164,6 +164,10 @@ trait JQuery extends js.Object {
164
164
@ JSName (" eq" )
165
165
def at (index : Int ): JQuery = js.native
166
166
167
+ /** Reduce the set of matched elements to the even ones in the set, numbered from zero. <br/>
168
+ * See: <a href="http://api.jquery.com/even/">jQuery Docs</a> */
169
+ def even (): JQuery = js.native
170
+
167
171
/** Display the matched elements by fading them to opaque. <br/>
168
172
* See: <a href="http://api.jquery.com/fadeIn/">jQuery Docs</a> */
169
173
def fadeIn (duration : Int = js.native, easing : EasingFunction = js.native): JQuery = js.native
@@ -381,6 +385,10 @@ trait JQuery extends js.Object {
381
385
* See: <a href="http://api.jquery.com/not/">jQuery Docs</a> */
382
386
def not (el : Element * ): JQuery = js.native
383
387
388
+ /** Reduce the set of matched elements to the odd ones in the set, numbered from zero. <br/>
389
+ * See: <a href="http://api.jquery.com/odd/">jQuery Docs</a> */
390
+ def odd (): JQuery = js.native
391
+
384
392
/** Remove an event handler. <br/>
385
393
* See: <a href="http://api.jquery.com/off/">jQuery Docs</a> */
386
394
def off (): JQuery = js.native
Original file line number Diff line number Diff line change @@ -166,5 +166,21 @@ class TraversingTest extends AnyWordSpec with Matchers {
166
166
root.children(" a" ).first().length should be(0 )
167
167
root.children(" a" ).last().length should be(0 )
168
168
}
169
+
170
+ " even/odd matching element" in {
171
+ val dom = div(
172
+ span(" 0" ),
173
+ span(" 1" ),
174
+ span(" 2" ),
175
+ span(" 3" ),
176
+ span(" 4" ),
177
+ span(" 5" ),
178
+ ).render
179
+
180
+ val root = jQ(dom)
181
+ root.children(" span" ).even().text() shouldBe " 024"
182
+ root.children(" span" ).odd().text() shouldBe " 135"
183
+ }
184
+
169
185
}
170
186
}
You can’t perform that action at this time.
0 commit comments