Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Commits on Aug 20, 2015
  1. @Shadowfiend

    Merge pull request #1710 from lift/msf_issue_1681

    Shadowfiend authored
    Eliminate the need for Document during JSON Serialization
    
    This branch is focused on hitting two birds with one stone:
     - Removing the use of the deprecated scala.text.Document intermediary
       format for JSON.
     - Providing more flexible JSON rendering settings that permit options like
       having spaces between field names and values in JSON objects.
    
    We already put in a good bit of work to implement compactRender in the
    JsonAST, and with some trivial changes it was possible to implement a
    prettyRender that uses the same pipeline with different options. My hypothesis
    is that by eliminating the need for an intermediary format we'll see similar
    performance gains during pretty rendering that we did for compact rendering
    using compactRender.
Commits on Aug 10, 2015
  1. @Shadowfiend

    Merge pull request #1711 from lift/high-wire

    Shadowfiend authored
    High Wire: Fix appendJs when invoked from inside a toJsCmd def
    
    appendJs should append JavaScript to be sent down with the
    current request. However, if appendJs is called in a toJsCmd
    method, and that method is defined as a def, not a val, then
    toJsCmd will be called after the jsToAppend is read. This
    means that this appended JS won't be sent down.
    
    One place where this manifests is when a JsCmd's toJsCmd
    method sends down a rendered snippet that contains a Wiring
    component (because Wiring uses appendJs). In this case, the
    appendJs that Wiring does is evaluated during the toJsCmd
    invocation, which means the JsCmd that is sent down misses it.
    
    When we send down JS in bulk for an AJAX or comet response,
    we wrap it in a JsCommands, which is a collector of JsCmd.
    We then call its toResponse to get a JavaScriptResponse.
    
    Before, we passed the jsToAppend to JsCommands, and then
    let JsCommands run toJsCmd on everyone while constructing
    the response. In this PR, let the toResponse method call toJsCmd
    on all the commands that are explicitly being sent down, and then
    we read jsToAppend and concatenate that on the end of the other
    commands inside toResponse. In the process, we remove external
    invocations of jsToAppend.
    
    So as to avoid accidental duplicate send-downs of jsToAppend, we
    give jsToAppend a clearAfterReading boolean that, when set to
    true (it defaults to false), will clear the list of JsCmds that need
    to be appended. JsCommands and the jsToAppend reading in
    CometActor, which sends down additional JS as a partial update,
    both set it to true. Amongst other things, this ensures the two won't
    both try to send down the same JS.
Commits on Aug 8, 2015
  1. @Shadowfiend

    Update JsCommands API docs.

    Shadowfiend authored
    This lets us be explicit that calling it clears S.jsToAppend.
Commits on Aug 6, 2015
  1. @farmdawgnation
Commits on Jul 25, 2015
  1. @farmdawgnation
  2. @farmdawgnation
  3. @farmdawgnation
Commits on Jul 24, 2015
  1. @farmdawgnation

    Enable MatchWithoutCurrentValue even without a * in the path.

    farmdawgnation authored
    It looks like we hit a completely different pipeline for computing the
    currentValue if the menu doesn't have a * in the path anywhere. This
    adds a MatchWithoutCurrentValue check to that pipeline, and ensures that
    if your location definition looks like:
    
      / "product" >> MatchWithoutCurrentValue
    
    That things will behave as you expect.
  2. @farmdawgnation
Commits on Jul 13, 2015
  1. @Shadowfiend

    Centralize most jsToAppend handling in JsCommands.

    Shadowfiend authored
    Places that return JS via a JsCommands toResponse call now add
    jsToAppend after evaluating all JS commands passed to the JsCommands
    class. What this allows is for JsCmd classes that implement toJsCmd as
    a def that in turn appends JS via S.appendJs, to still send down the
    appended JS.
    
    Before, because the toJsCmd calls were done after jsToAppend was
    evaluated, that JS would be lost or sent down in a future AJAX response.
    
    Additionally, JsCommands and LiftMerge now clear the jsToAppend after
    reading it, to ensure that if two JsCommands are used, you won’t get
    duplicate appended JS.
  2. @Shadowfiend

    Add clearAfterRead parameter to jsToAppend.

    Shadowfiend authored
    This will change the way you have to invoke jsToAppend to require
    parens, but allows for jsToAppend to clear the appendable JS after
    having assembled it to be returned. This ensures Lift’s internals won’t
    double-evaluate jsToAppend in weird ways.
    
    It may be worth making this private[http] and exposing a public version
    that takes no parameters and sets clearAfterReading to false, we’ll see.
Commits on Jul 9, 2015
  1. @Shadowfiend

    Merge pull request #1709 from lift/scope-callback

    Shadowfiend authored
    Add LiftSession.onFunctionOwnersRemoved.
    
    These functions are invoked with the set of function owners that had
    all of their remaining associated functions evicted from a session in a
    given run. A function owner is typically a page’s RenderVersion, though
    there are cases (e.g., comets) where this is not necessarily the case.
    
    As a sample usage:
    
    object pageIdWatchers extends java.util.concurrent.ConcurrentHashMap[String,List[()=>Unit]] {
        def addCleanupFunc(func: () => Unit): Unit = {
            put(S.renderVersion, List(func) ::: pageIdWatchers.getOrDefault(S.renderVersion, Nil))
        }
    }
    
    In Boot:
    
    LiftSession.onFunctionOwnersRemoved ::= { removedOwners =>
        for {
            owner <- removedOwners
            watcher <- Option(pageIdWatchers.get(owner))} {
            watcher.foreach(_())
            pageIdWatchers.remove(owner)
        }
    }
    
    In a snippet:
    
    def cleanupPage(): Unit = {
        println(s"Running cleanupPage for ${S.renderVersion}.")
    }
    println(s"Adding cleanupFunc for ${S.renderVersion}")
    pageIdWatchers.addCleanupFunc(cleanupPage)
Commits on Jul 6, 2015
  1. @Shadowfiend

    Merge pull request #1701 from lift/ajk_datalift-fixedattrs

    Shadowfiend authored
    Add LiftRules.attributeForRemovedEventAttributes
    
    This PR adds a LiftRule, LiftRules.attributeForRemovedEventAttributes.
    When we remove a JavaScript event from an element for separate
    application via the page's JS file, if this rule is set, the attribute it specified
    is populated with the names of the attributes that were removed from the
    element. If no attributes were removed, no attribute is added to the element.
    
    The default for the LiftRule is to be None, meaning this information is never
    added to the output.
Commits on Jul 3, 2015
  1. @Shadowfiend

    Add LiftSession.onFunctionOwnersRemoved.

    Shadowfiend authored
    These functions are invoked with the set of function owners that had
    all of their remaining associated functions evicted from a session in a
    given run. A function owner is typically a page’s RenderVersion, though
    there are cases (e.g., comets) where this is not necessarily the case.
  2. @Shadowfiend

    Switch to single LiftRule for removed attribute inclusion.

    Shadowfiend authored
    We now have one LiftRules.attributeForRemovedEventAttributes, which can be None
    to indicate no attribute should be emitted. The default is currently None.
Commits on Jun 24, 2015
  1. @andreak

    Renamed LiftRules.includeFixedEventAttributesAsDataAttributes_? and a…

    andreak authored
    …dded configurable attribute-name for "data-lift-removed-attributes", set in LiftRules.removedEventAttributesAttributeName
Commits on Jun 22, 2015
  1. @andreak
Commits on May 23, 2015
  1. @farmdawgnation
Commits on May 13, 2015
  1. @Shadowfiend

    Merge pull request #1702 from lift/dcb_issue_1677

    Shadowfiend authored
    Dcb issue 1677, send pre-creation CometActor messages in the order received
    
    Fixes an issue where CometActor messages sent with session.sendCometActorMessage
    to actors that are not yet initialized would be sent to it in the wrong order once the actor
    *was* eventually initialized. Specifically, they were sent backwards. They are now sent in
    the correct order.
Commits on Apr 27, 2015
  1. @dcbriccetti
  2. @dcbriccetti

    Change LiftSession to accumulate pre-creation CometActor messages in …

    dcbriccetti authored
    …the order received, rather than reverse order.
Commits on Apr 26, 2015
  1. @dcbriccetti
  2. @dcbriccetti

    Move TestComet inside LiftSessionSpec.scala and create it with the ne…

    dcbriccetti authored
    …wer form of findOrCreateComet.
Commits on Apr 25, 2015
  1. @dcbriccetti

    Create test for Issue 1677, “Lift stores messages in LiftSession.come…

    dcbriccetti authored
    …tSetup List in wrong order”
  2. @andreak

    Add data-lift-fixedeventattribute-<event-name> for each replaced even…

    andreak authored
    …t-attribute, with settings in LiftRules: LiftRules.includeFixedEventAttributesAsDataAttributes_? (default false)
Commits on Apr 20, 2015
  1. @Shadowfiend

    Merge pull request #1694 from lift/null-anti-null

    Shadowfiend authored
    Null-Anti-Null: Don't assume postPageFunctions are Some.
    
    When generating post-page JavaScript, we were assuming that because our first
    access of the post-page functions was non-empty, all of them would be. This led
    to occasional .get-related NullPointerExceptions. We now allow for later calls
    to the post-page functions to be None, and simply assume we have no more
    functions to fetch once we get a None for them.
Commits on Apr 19, 2015
  1. @Shadowfiend

    Merge pull request #1692 from lift/midair-collision

    Shadowfiend authored
    Midair Collision: Fix issue where binding an `href` and an `onclick` together could fail.
    
    This only manifested when the onclick came before the href on an
    a element, and probably also manifested if you bound an onsubmit
    on a form that had an action attribute. The cause was just that I had
    forgotten to properly pass on already-seen event attributes when
    processing the href attributes, so we lost them.
Commits on Apr 16, 2015
  1. @dpp
  2. @dpp
  3. @dpp
Commits on Apr 15, 2015
  1. @dcbriccetti

    Fix spelling error

    dcbriccetti authored
Commits on Mar 21, 2015
  1. @Shadowfiend

    Don't assume postPageFunctions are Some.

    Shadowfiend authored
    When generating post-page JavaScript, we were assuming that because our first
    access of the post-page functions was non-empty, all of them would be. This led
    to occasional .get-related NullPointerExceptions. We now allow for later calls
    to the post-page functions to be None, and simply assume we have no more
    functions to fetch once we get a None for them.
  2. @Shadowfiend

    Centralize call to fix remaining attributes.

    Shadowfiend authored
    We were calling fixAttrs with attrs.next in five places, which meant it was a
    bit error prone. We now do it up front so the call can be changed in one place.
  3. @Shadowfiend

    Fix an issue where we could lose event attributes.

    Shadowfiend authored
    This particularly manifested when the attribute whose href we wanted to fix
    (e.g., the `href` attribute on an `a` element or the `action` attribute on a
    `form` element) also had an event handler (e.g. `onclick`). The code that fixed
    the href failed to pass on the event handlers that had been seen so far to the
    attribute-fixing chain, so they got lost before they could be applied.
Commits on Mar 15, 2015
  1. @Shadowfiend @fmpwizard

    Provide a secure XML parser in SecurityHelpers, use it throughout.

    Shadowfiend authored fmpwizard committed
    The secure XML parser does not allow entity references to refer to external
    entities; allowing this exposes an application to XXE (XML External Entity)
    attacks, where the external reference can be to a local file with sensitive
    data, whose contents will then appear in the resulting parse error messages.
    External entities are ignored and will not appear in the parsed or reserialized
    XML.
    
    All of Lift's built-in XML parsing now uses Helpers.secureXML instead of
    directly using scala.xml.XML, including in tests.
    
    More at https://www.owasp.org/index.php/XML_External_Entity_(XXE)_Processing .
    
    Signed-off-by: Diego Medina <diego@fmpwizard.com>
Something went wrong with that request. Please try again.