Giter Club home page Giter Club logo

jquery-facade's People

Contributors

cquiroz avatar frne avatar jducoeur avatar munkel avatar romaniakovlev avatar tflucke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

jquery-facade's Issues

after method fails to insert element

Here is the code:

$("ul li").after((elem: dom.Element, idx: Int) => ("index: " + idx: ElementDesc))

If I break down the call as:

    val tf: js.ThisFunction1[dom.Element, Int, ElementDesc] = (e: dom.Element, i: Int) => {
      println("adding index...")
      ("index: " + i): ElementDesc
    }
    val ulli = $("ul li")
    println(ulli)
    println(tf)
    ulli.after(tf)

Then I can see "adding index..." printed in the console, but the elements were not added.

Implement .load

jQuery lets you write $('#agenda').load(url), it would be nice to be able to do that in scalajs

Scala 3 Support

Hi,

First of all I'd like to say thank you for a great and useful library.
Scala 3 seems to be quite mature and it would be very nice to have scala 3 support in this library.
I see that there's already a pull request to implement scala 3 support.
I know you probably have very little time and much more important things to do, so I'd like to know if there are any plans to merge it in the future?

ScalaJS 1.0.0-M3

Hi there

Could you publish an artifact for ScalaJS 1.0.0-M3 or are you awaiting the stable release?

Cheers!
Raphael

How to send data in a triggered event

How would I send data from a triggered event to the event listener.

for example

$(dom.document).trigger("my-event", ???data-goes-here???)

$(dom.document).on("my-event", (e: JQueryEventObject)=>{
  
})

scala-js-dom 0.9

Hi

Could this facade be built against scala-js-dom 0.9.0. I get some warnings that jquery-facade is still working against version 0.8.0

How to get data with ajax request

I'm having trouble getting data with an ajax request.

I have the code

val myPromise = $.ajax(url)

myPromise.done((data: Any, textStatus: String, jqXHr: JQueryXHR) => {
  println(data)
})

in the console log I get [object Object]

if I try to match data I get

Uncaught TypeError: Cannot read property 'getName__T' of null

I checked the textStatus and it returns success. I've also checked the request in the chrome dev tools and it is returning a json string. How do I use that json string after I've recieved it?

"org.querki" %%% "jquery-facade" % "2.0" can't be found

I have this in my build.sbt:

lazy val client = project .settings( libraryDependencies ++= Seq( "org.querki" %%% "jquery-facade" % "2.0" ) ).dependsOn(shared)

When I start sbt, I get this:

(client / update) sbt.librarymanagement.ResolveException: Error downloading org.querki:jquery-facade_2.13:2.0 Not found Not found not found: /Users/lance/.ivy2/local/org.querki/jquery-facade_2.13/2.0/ivys/ivy.xml not found: https://repo1.maven.org/maven2/org/querki/jquery-facade_2.13/2.0/jquery-facade_2.13-2.0.pom (client / ssExtractDependencies) sbt.librarymanagement.ResolveException: Error downloading org.querki:jquery-facade_2.13:2.0 Not found Not found not found: /Users/lance/.ivy2/local/org.querki/jquery-facade_2.13/2.0/ivys/ivy.xml not found: https://repo1.maven.org/maven2/org/querki/jquery-facade_2.13/2.0/jquery-facade_2.13-2.0.pom Total time: 1 s, completed 23 Oct 2020, 20:18:32

Cannot use a custom jQuery instance

object JQueryStatic maps to a global jQuery object.

I use jQuery.noConflict() to scope a specific version of jQuery. So I don't think I can use JQueryStatic as is.

Maybe splitting it into a trait and an object could help:

trait JQueryStatic { ... }

object JQueryStatic extends JQueryStatic

With the regular org.scalajs.jquery.JQueryStatic from scala-js/scala-js-jquery, which is a trait, I can do just that:

val $ = g.MY.jQuery.asInstanceOf[org.scalajs.jquery.JQueryStatic]

See also how a default scala-js/scala-js-jquery scopes a default org.scalajs.jquery.JQueryStatic here.

Update to scalajs-dom v2.0.0

Would it be possible to publish jquery-facade for scalajs-dom v2.0.0? As stated in the release notes, the 2.x series is not binary-compatible with the 1.x series. So, for projects that use v2.0.0 and jquery-facade, the latter needs to be built against v2.0.0.

It seems, simply updating the dependency suffices:

  libraryDependencies ++= Seq(
    "org.querki" %%% "querki-jsext" % "0.10",
-   "org.scala-js" %%% "scalajs-dom" % "0.9.8"
+   "org.scala-js" %%% "scalajs-dom" % "2.0.0"
  )

Ambiguous reference for obj and selector

When I try to get an element using $("#id") it gives me following error message.
ambiguous reference to overloaded definition,
both method apply in object JQueryStatic of type (obj: scala.scalajs.js.Object)org.querki.jquery.JQuery
and method apply in object JQueryStatic of type (selector: org.querki.jquery.ElementDesc)org.querki.jquery.JQuery
match argument types (String)

Simplify signatures with optional params

@sjrd has pointed out that Scala.js default parameters are a good option for messy optionals. We should try that out, and see how it works.

The really interesting situation is when you want to omit some of the optionals in the middle; @sjrd favors using named parameters at the call site for those situations. That's plausible, but I don't know whether I want to require it or not. In some places, switching to purely that would be a breaking change, so I don't think I favor removing the spelled-out versions. But we might add "master signatures" using defaults, and favor that approach going forward.

"find", "each" method throw type mismatch error.

I am trying to iterate over options using val x = $(selectState).find("option").each((y: Element) => y). However Compilation throw following error.

type mismatch;
 found   : org.scalajs.dom.Element => org.scalajs.dom.Element
    (which expands to)  org.scalajs.dom.raw.Element => org.scalajs.dom.raw.Element
 required: scala.scalajs.js.|[scala.scalajs.js.ThisFunction0[org.scalajs.dom.Element,Any],scala.scalajs.js.ThisFunction1[org.scalajs.dom.Element,Int,Any]]
    (which expands to)  scala.scalajs.js.|[scala.scalajs.js.ThisFunction0[org.scalajs.dom.raw.Element,Any],scala.scalajs.js.ThisFunction1[org.scalajs.dom.raw.Element,Int,Any]]

I was referring to stack overflow question. Is it changed in recent library?

jquery 2.2.1

Hi Justin,
did to you plan to move to jquery 2.2.1 ? I tried it, it works except for the cross compilation with scala 2.10.
Mathieu

Consider to use CI

Since scala-js-jquery is no longer maintained, I would like to contribute to jquery-facade so it can survice on a long-term basis.

jquery-facade supports many Scala versions.
It would be benefical if project introduces CI (Travis or CircleCI, e.g.) to perform cross-building on each PR to ensure change does not break build, from contributor perspective.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.