c

org.webjars.play

WebJarsUtil

class WebJarsUtil extends AnyRef

WebJars Util

Config:

webjars.filter-expression can be used to declare a regex for the files that should be looked for when searching within WebJars. By default all files are searched for.

webjars.cdn-url overrides the default CDN url (https://cdn.jsdelivr.net/webjars)

webjars.use-cdn toggles the CDN

Annotations
@Singleton()
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. WebJarsUtil
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new WebJarsUtil(configuration: Configuration, environment: Environment)
    Annotations
    @Inject()

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. lazy val cdnUrl: String
  6. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def css(webJar: String, path: String): String

    A CSS link tag

    A CSS link tag

    webJar

    Name of the WebJar

    path

    A path to an asset in the WebJar

    returns

    A string with the tag or an error / empty string (depending on mode)

  8. def css(path: String): String

    A CSS link tag

    A CSS link tag

    path

    A call that will become a url

    returns

    A string with the tag or an error / empty string (depending on mode)

  9. def css(call: Call): String

    A CSS link tag

    A CSS link tag

    call

    A call that will become a url

    returns

    A string with the tag or an error / empty string (depending on mode)

  10. def css(urlTry: Try[String]): String

    A CSS link tag

    A CSS link tag

    urlTry

    A possible url

    returns

    A string with the tag or an error / empty string (depending on mode)

  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. def fullPath(webjar: String, path: String): Try[String]

    Get the full path to a file in a WebJar without validating that the file actually exists

    Get the full path to a file in a WebJar without validating that the file actually exists

    webjar

    the WebJar artifactId

    path

    the full path to a file in the WebJar

    returns

    the path to the file (sans-the webjars prefix)

    Example:
    1. Calling fullPath("react", "react.js") will return the full path to the file in the WebJar because react.js exists at the root of the WebJar

  15. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  16. def groupId(path: String): Try[String]

    Get the groupId from a path

    Get the groupId from a path

    path

    a string to parse a WebJar name from

    returns

    the artifact groupId based on the classpath

    Example:
    1. groupId("jquery/1.9.0/jquery.js") will return "org.webjars" if the classpath contains the org.webjars jquery jar

  17. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. def localOrCdnUrl(pathTry: Try[String]): Try[String]

    Based on config, either returns a local url or a cdn url for a given asset path

    Based on config, either returns a local url or a cdn url for a given asset path

    pathTry

    Possibly a path to convert to a local url or cdn url

    returns

    Possibly the local or cdn url

  20. def locate(webJar: String, path: String): Try[String]

    Locate a file in a WebJar

    Locate a file in a WebJar

    webJar

    the WebJar artifactId

    path

    the file or partial path to find

    returns

    the path to the file (sans-the webjars prefix)

  21. def locate(file: String): Try[String]

    Locate a file in a WebJar

    Locate a file in a WebJar

    file

    the file or partial path to find

    returns

    the path to the file (sans-the webjars prefix)

    Example:
    1. Passing in jquery.min.js will return jquery/1.8.2/jquery.min.js assuming the jquery WebJar version 1.8.2 is on the classpath

  22. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  23. final def notify(): Unit
    Definition Classes
    AnyRef
  24. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  25. def requireJs(mainUrl: Call): String

    Generates the RequireJS config and main script tags

    Generates the RequireJS config and main script tags

    mainUrl

    The reverse route of the main app

    returns

    The RequireJS config and main script tags

  26. def script(webJar: String, path: String): String

    A script tag

    A script tag

    webJar

    Name of the WebJar

    path

    A path to an asset in the WebJar

    returns

    A string with the tag or an error / empty string (depending on mode)

  27. def script(path: String): String

    A script tag

    A script tag

    path

    A path that becomes a url

    returns

    A string with the tag or an error / empty string (depending on mode)

  28. def script(call: Call): String

    A script tag

    A script tag

    call

    A call that becomes a url

    returns

    A string with the tag or an error / empty string (depending on mode)

  29. def script(urlTry: Try[String], otherParams: Map[String, String] = Map.empty[String, String]): String

    A script tag

    A script tag

    urlTry

    A possible url

    otherParams

    Other params for the script tag

    returns

    A string with the tag or an error / empty string (depending on mode)

  30. def scriptWithParams(webJar: String, path: String, otherParams: Map[String, String]): String

    A script tag

    A script tag

    webJar

    Name of the WebJar

    path

    A path to an asset in the WebJar

    otherParams

    Other params to add to the script tag

    returns

    A string with the tag or an error / empty string (depending on mode)

  31. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  32. def tag(urlTry: Try[String])(f: (String) ⇒ String): String

    Turns a possible url into a tag using a provided function.

    Turns a possible url into a tag using a provided function. Uses the mode of the application to determine if an error should be returned or not.

    urlTry

    A possible url

    f

    A function that will render a successful url

    returns

    The tag to be rendered or when there is an error, an emtpy string in Prod mode and an error comment otherwise

  33. def toString(): String
    Definition Classes
    AnyRef → Any
  34. def url(webJar: String, path: String): Try[String]

    Locates a WebJar from a partial path and returns the reverse route

    Locates a WebJar from a partial path and returns the reverse route

    webJar

    The artifact name of the WebJar

    path

    The partial path of a file in a WebJar

    returns

    The reverse route to the WebJar asset

  35. def url(path: String): Try[String]

    Locates a WebJar from a partial path and returns the reverse route or CDN URL

    Locates a WebJar from a partial path and returns the reverse route or CDN URL

    path

    The partial path of a file in a WebJar

    returns

    The reverse route to the WebJar asset

  36. lazy val useCdn: Boolean
  37. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  40. lazy val webJarFilterExpr: String

Inherited from AnyRef

Inherited from Any

Ungrouped