Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

master -> Lift 30 merge #1512

Merged
merged 113 commits into from
@Shadowfiend
Owner

Let's see if I screwed anything up!

(Answer: guaranteed yes.)

nafg and others added some commits
@nafg nafg Fix spelling mistake in supplimentalKidMenuItems 1c56bf9
@farmdawgnation farmdawgnation Implementation of onEventIf, a version of onEvent guarded by confirm().
H/t for this little innovation actually belongs to @shadowfiend. I'm
just taking credit for bringing it into the latest version of Lift. ;)
f9ce11a
@tuhlmann tuhlmann Issue #1453: LAFuture.collect crashes when futures are resolved out o…
…f order
b6155e7
@dpp dpp Merge pull request #1453 from lift/uhl_issue_1453
LAFuture.collect crashes when futures are resolved out of order
6363f72
@dpp dpp Merge pull request #1450 from lift/msf_issue_1450
Implementation of conditional onEvent helper.
2307df3
@dpp dpp Null testing for headers. Closes #1452 5169861
@dpp dpp Closes #1455. Finer grained sync afc9487
@dpp dpp Fixed a real deadlock 820a15d
@pbrant pbrant Fix typo when constructing secured multi options
s/label/nonce/
ee08fbd
@pbrant pbrant A few CSS parser robustness improvements
  - Allow # character in URLs
  - Scan for url\s*( instead of just url to avoid matching identifiers
    that contain the text url
  - Return Failure instead of Empty when parse fails
538e694
@dpp dpp Merge pull request #1459 from lift/pmb_cssparser
A few CSS parser robustness improvements
adbee44
@dpp dpp Merge pull request #1458 from lift/pmb_multiselectfix
Fix typo when constructing secured multi options
ac00240
@farmdawgnation farmdawgnation Tweak deprecated information for supplimentalKidMenuItems. 497ddba
@farmdawgnation farmdawgnation Merge pull request #1445 from lift/nafg/supplimental
Fix spelling mistake in supplimentalKidMenuItems.
0e0732e
@dpp dpp Replaced many HashMap with ConcurrentHashMap 4090d0e
@dpp dpp Fix an edge case for HTML5 -> ByteStream 0373f17
@dpp dpp Added the Markdown package 18c6fc7
@eltimn eltimn Issue #1400 - Add Joda Time support to MongoRecord af2c94f
@eltimn eltimn Issue #1349 - Add createdAt function to ObjectIdField ec5893a
@eltimn eltimn Issue #1411 - dirty_? flag in Record and Meta as in Mapper 37121fb
@eltimn eltimn Replaced all uses of MongoId with ObjectIdPk in test code. 9849d5b
@eltimn eltimn Issue #1348 - Add lifecycle callbacks to MongoMetaRecord.update c40847c
@eltimn eltimn Minor cleanup re PR feedback 2e17903
@fmpwizard fmpwizard Merge pull request #1463 from lift/tcn_issue_1400
Issue #1400 - Add Joda Time support to MongoRecord
dee1408
@fmpwizard fmpwizard Merge pull request #1464 from lift/tcn_issue_1349
Issues 1349, 1411, and 1348
a2b5952
@eltimn eltimn Updated mongo-java-driver to v2.11.2 8325fab
@farmdawgnation farmdawgnation Add specs for mock actors. 9da1753
@farmdawgnation farmdawgnation Implement MockSpecializedLiftActor and MockLiftActor. 20e6803
@farmdawgnation farmdawgnation Expose the mailbox of a Mock*LiftActor via the messages method. 6a301fb
@japgolly japgolly Made run-mode auto-detection customisable.
This allows users to compliment or override the default logic used to
determine the run-mode (ie. dev/test/staging/etc) in absence of a
"run.mode" system variable.

An example use case would be a user using test framework that Lift
doesn't know about, and it undesirably running in development mode.
0238c4d
@japgolly japgolly Use test run-mode when running tests from ScalaTest or IDEA. b2a751b
@japgolly japgolly Signed contributors.md 75a4a1d
@japgolly japgolly Split PropertyWithModificationCondition.set() into multiple lines and…
… added doco.
fb725ca
@japgolly japgolly Moved Mailer's inner classes from trait to object.
Allows any class extending the Mailer trait to accept the same instances
of From(), To(), Subject(), etc.
de223e6
@japgolly japgolly Fixed MailerSpec after moving Mailer inner classes from trait to object. 068b19e
@japgolly japgolly Removed PropertyWithModificationCondition. 6d70b8d
@japgolly japgolly Added tests for run-mode property modification. aad79b5
@dpp dpp Created observable future creation 72c881b
@dpp dpp Fixed a minor issue ed4331a
@fmpwizard fmpwizard scala 2.9.x doesn't like this tail rec annotation, but it works fine …
…on 2.10.x
82842a6
@hedefalk hedefalk withFilter on JValue to rid warnings on for-comprehensions 0d98bf8
@hedefalk hedefalk fixed timezone spec 3acf0c6
@fmpwizard fmpwizard Merge pull request #1472 from hedefalk/master
withFilter on JValue to rid warnings on for-comprehensions
b401fcb
@nafg nafg Add ValueSnippets LocParam, generalizes Snippet, LocSnippets, Dispatc…
…hLocSnippets
1b65cca
@nafg nafg Simplify Loc.Snippet.apply overload disambiguation 024facf
@nafg nafg More cleanup 89e79ff
@dpp dpp Adds \;name for data-name selector. Adds "1 \[href\]" to only apply c…
…hanges to top-level attributes
9dc5bdb
@farmdawgnation farmdawgnation Use the "^" character to select the head element.
This was previously implemented using "1", but it does the same thing -
allows us to change things on the top level element on whatever NodeSeq
the transform is applied to. So, "^ [href]" would target the href param
of that element, for example.
3dd4523
@fmpwizard fmpwizard Fixed failing test for the css selector (select first match) 30fa7b6
@fmpwizard fmpwizard fixed #1250 - HTTP OPTIONS verb support
Added the Options verb to RestHelper
385ddab
@fmpwizard fmpwizard Addressed Matt's comments 5753875
@fmpwizard fmpwizard To be consistent I changed a few `def` for `val` and removed two println c81db2f
@fmpwizard fmpwizard fixed issue #1456 - Deprecate .is on mapper and fix the one on Record 544cbd1
@fmpwizard fmpwizard Removed about a million warnings after deprecating .is from Record an…
…d Mapper
8ccaa27
@fmpwizard fmpwizard fixed #1291 - SHtml.ajaxSelect doesn't serialize ampersands (&) corre…
…ctly
314f84e
@fmpwizard fmpwizard fixed #1465 - Lift could annotate type of primaryKeyField as a workar…
…ound to Scala regression SI-7612
7636751
@dpp dpp Add support for X-Frame-Options 6e3523e
@fmpwizard fmpwizard fixed #1014 - A new CreatedResponse that takes JSON b51eebe
@dpp dpp Closes #1126. Swallows an inner <a> for Menu.item 0c24719
@fmpwizard fmpwizard Added support for html5 templates in the test framework e15855c
@fmpwizard fmpwizard fixed #1457 - Make LiftRules use the html5 parser by default c746251
@fmpwizard fmpwizard Fixed failing tests related to now using html5 as the default format 3933d8c
@fmpwizard fmpwizard Fixed the ToHeadUsages tests related to using the new html5 parser 511a30e
@fmpwizard fmpwizard We don't want to use eventually here, as it will keep sending an `Add…
…(44)` message to the actor
2837094
@fmpwizard fmpwizard updated readme to use 2.5.1 instead of 2.4 b4e9743
@Shadowfiend Shadowfiend Revert "Use ThreadLocalRandom in StringHelpers.randomString on Java 7."
ThreadLocalRandom turns out not to be a secure RNG, so using it compromises our
XSS and other protections for field names.

This reverts commit f2de993.
edd5fca
@fmpwizard fmpwizard closes #1481 - [Breaking change] - Remove ActorWatcher from Lift 2.6 dd7efd3
@hedefalk hedefalk Fixed path in Menu 4bff9c7
@hedefalk hedefalk removed unnescessary allocations f1b5bcf
@hedefalk hedefalk cleanup 908c37b
@hedefalk hedefalk removed unnescessary structural typing hack 9167ff0
@fmpwizard fmpwizard Fixed #1473 - SqlServerBaseDriver should set brokenLimit_? to true
MicrosoftSQL at least 2008 and greater don't support the LIMIT clause, so now the default driver
we offer will work out of the box with newer sql server versions
d7d1cd0
@fmpwizard fmpwizard Fixed #1157 - BasicTypesHelpers.toBoolean("on") returns false feb1592
@Shadowfiend Shadowfiend Update comments in ListHelpers to refer to Box, not can. 55453e4
@fmpwizard fmpwizard Upgraded to sbt 0.12.4 49dcb89
@karma4u101
Collaborator

Hmmm the removal of StructBuilderItem is giving me build problems in FoBo and it dose seem like I can not replace it with the simpler form loc.buildItem. I will try to find a way around this but any hints on how to do it ?

fmpwizard and others added some commits
@fmpwizard fmpwizard Revert "removed unnescessary structural typing hack"
This reverts commit 9167ff0.
c0be185
@dpp dpp Remove source directive from the scalatest library efcd5b9
@dpp dpp correctly escape end script tags d1ab0ff
@farmdawgnation farmdawgnation Name existing S.ieMode to S.legacyIeCompatibilityMode.
We keep S.ieMode as a deprecated value until 3.0.
8d42eb8
@farmdawgnation farmdawgnation Include user agent calculation functions in S. cc91fee
@farmdawgnation farmdawgnation Add helpers for detecting IE10/11.
I know we were all hoping that by IE10 they'd be up to speed with the
rest of the world, but I still remember some support issues, so I'm
adding a detector for it in the event server side detection is needed
for some people. Ditto for 11. Here's hoping these will be the last
versions of IE that ever need such detection.
de14652
@farmdawgnation farmdawgnation IE < 6 still counts as IE.
Though we sincerely hope to never see any of these user agents, we
should return the correct value for isIE if they hit our apps.
3a1254b
@farmdawgnation farmdawgnation Comments should reflect reality: update IE compat comments.
We also consider IE 8 a legacy IE.
20fecab
@farmdawgnation farmdawgnation Simplify Loc.doesMatch_?
As I was reading over this code to look at this issue, we were calling
Link.isDefinedAt to determine whether or not to call Link.appy.
Link.apply calls Link.isDefinedAt to determine whether or not to throw
an exception.

This seemed redundant in this particular case, so I've reduced this
method to a simple boolean expression that should have the same effect.
244af80
@farmdawgnation farmdawgnation Add and implement the MatchWithoutCurrentValue LocParam.
The MatchWithoutCurrentValue LocParam overrides Lift's default behavior
of considering an Empty currentValue a non-match for a Loc. This default
action is desirable in most circumstances, but occasionally we want to
allow client code to define some custom behavior in the event
currentValue comes up Empty.

Using this new LocParam in combination with IfValue would allow them to
do so.
080dfc8
@farmdawgnation farmdawgnation Add specs to prove MatchWithoutCurrentValue works as expected. 5654beb
@farmdawgnation farmdawgnation Add an example of using MatchWithoutCurrentValue with IfValue. d18c6ef
@Shadowfiend Shadowfiend Add centralized handling for parameters not mapped to Lift functions.
We add a LiftRules entry, handleUnmappedParameter, that is a FactoryMaker that
vends a function to handle any parmaeter not mapped to a Lift function. By
default, the function checks if the parameter name starts with F, and logs a
warning if so. This is to do a quick, high-speed check as to whether or not the
parameter looks like a Lift function binding.
6407aa4
@Shadowfiend Shadowfiend Strip a no-longer-relevant warning about synchronization. 518b137
@Shadowfiend Shadowfiend Fix some indentation fail. 61a5019
@Tmr Tmr Small fix in ListenerManager trait's comments 5a275ca
Mikhail Strebkov Fixed parsing json double values in scientific notation with e+ 754fd5b
@farmdawgnation farmdawgnation Update License section of readme to reflect committer policy. 91f79b2
@fmpwizard fmpwizard Merge pull request #1487 from lift/msf_issue_1487
Need a way to customize fail behavior in menus/param menus
74a951f
@fmpwizard fmpwizard added a target jvm of java 1.6, as I'm building with java 1.7 d1413ea
@xuwei-k xuwei-k override JObject#hashCode c7a0239
@xuwei-k xuwei-k JObject equals hashCode test 8f753cf
@xuwei-k xuwei-k Update contributors 7359309
@fmpwizard fmpwizard Merge pull request #1499 from xuwei-k/jobject-hashcode
override JObject#hashCode
626b977
websterc Improve performance of decomposing case classes to Json a2c2939
@fmpwizard fmpwizard To build the project for java6, you have to have java6, you cannot si…
…mply

use the source: ... option
a89ce26
@fmpwizard fmpwizard the latest pgp plugin does not sign jars with publish, now you have t…
…o use

publish-signed
bdffe18
@fmpwizard fmpwizard Merge pull request #1500 from chriswebster/perfFix
Improve performance of decomposing case classes to Json
23cfba4
@dylemma

I just encountered an issue with this code, where IE11 wasn't detected as IE at all. The user-agent string came in as Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko which didn't match the IE regex. This StackOverflow post suggested a solution.

Collaborator

.... Of course it did. Freaking Microsoft. Do you mind posting this to the mailing list?

farmdawgnation and others added some commits
@farmdawgnation farmdawgnation Add spec to ReqSpec for correctly identifying IE versions. 8172183
@farmdawgnation farmdawgnation Update defaultIeCalcFunction to correctly detect IE 11. 758d872
@pbrant pbrant Fix compile in Scala 2.10.1+
Scala 2.10.1 includes a type checking bug fix that causes compilation to
fail.  Add casts to work around this (effectively restoring the previous
behavior).
8d5c917
@Shadowfiend Shadowfiend Merge pull request #1503 from lift/msf_issue_1503
IE11 Detection is Busted

As documented in this mailing list thread our IE 11 detection is broken. We
fix that by special casing the matching for that one.
0898f2d
@kevg kevg Update README.md to clarify pull request guidelines b3ea46e
@fmpwizard fmpwizard Merge pull request #1511 from infofinity/master
Update README.md to clarify pull request guidelines
b3ad354
@Shadowfiend Shadowfiend Explicitly note list discussions in PR requirements. 71b80c0
@Shadowfiend Shadowfiend Align readme PR verbiage with contributing.md. d4b3bdb
@Shadowfiend Shadowfiend Merge pull request #1509 from lift/pmb_liftscreenfix
Fix compile in Scala 2.10.1+

Scala 2.10.1 included a type checking bug fix that caused compilation to
fail for AFilter pattern matches. Add casts to work around this (effectively
restoring the previous behavior of scalac, but explicitly).
fd38c7a
...st/scala/net/liftweb/markdown/InlineParsersTest.scala
((5 lines not shown))
val allInlineTests = italicTests ++ boldTests ++ entityTest ++
codeTests ++ linkTests ++ fastLinkTests ++ imageTests ++ brTests ++
+=======
+ val allInlineTests = italicTests ++ boldTests ++ codeTests ++ linkTests ++ fastLinkTests ++ imageTests ++ brTests ++
+>>>>>>> origin/master
@Shadowfiend Owner

Aaand that's what I get for not doing a test-compile before opening the PR -.-

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
...kit/src/main/scala/net/liftweb/http/LiftSession.scala
@@ -748,6 +748,9 @@ class LiftSession(private[http] val _contextPath: String, val uniqueId: String,
override private[liftweb] def magicSessionVar_? = true
}
+ @deprecated("Use legacyIeCompatibilityMode for legacy IE detection instead. This will be removed in Lift 3.0.", "2.6")
+ val ieMode = legacyIeCompatibilityMode
+
@fmpwizard Owner

Matt had a pull request that just went to lift 3.0 that removed this line (so it is deprecated on 2.6, but it is not any more on 3.0)
I happen to remember this one, but I wonder which other changes we'll bring to 3.0 in the same way... still looking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
web/webkit/src/main/scala/net/liftweb/http/S.scala
@@ -587,6 +587,9 @@ trait S extends HasParams with Loggable with UserAgentCalculator {
*/
def legacyIeCompatibilityMode: Boolean = session.map(_.legacyIeCompatibilityMode.is) openOr false // LiftRules.calcIEMode()
+ @deprecated("Use legacyIeCompatibilityMode for legacy IE detection instead, or use S.isIE* for general IE detection. This will be removed in Lift 3.0.", "2.6")
@fmpwizard Owner

I think this is related to my other comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@Shadowfiend Shadowfiend Merge remote-tracking branch 'origin/master' into lift_30_merge
Conflicts:
	core/actor/src/main/scala/net/liftweb/actor/LAFuture.scala
	core/markdown/src/main/scala/net/liftweb/markdown/InlineParsers.scala
	core/markdown/src/main/scala/net/liftweb/markdown/Transformer.scala
	core/markdown/src/test/scala/net/liftweb/markdown/InlineParsersTest.scala
	persistence/jpa/src/main/scala/net/liftweb/jpa/RequestVarEM.scala
	persistence/mapper/src/main/scala/net/liftweb/mapper/MappedForeignKey.scala
	project/Dependencies.scala
	web/webkit/src/main/scala/net/liftweb/http/CometActor.scala
	web/webkit/src/main/scala/net/liftweb/http/LiftSession.scala
	web/webkit/src/main/scala/net/liftweb/http/Req.scala
	web/webkit/src/main/scala/net/liftweb/http/S.scala
	web/webkit/src/main/scala/net/liftweb/sitemap/Loc.scala
0c63c45
@Shadowfiend
Owner

Ok, I've gotten general feedback both here and offline that this looks good. Let's roll the dice.

@Shadowfiend Shadowfiend merged commit 21c3800 into from
@Shadowfiend Shadowfiend deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 12, 2013
  1. @nafg
Commits on May 14, 2013
  1. @farmdawgnation

    Implementation of onEventIf, a version of onEvent guarded by confirm().

    farmdawgnation authored
    H/t for this little innovation actually belongs to @shadowfiend. I'm
    just taking credit for bringing it into the latest version of Lift. ;)
Commits on May 25, 2013
  1. @tuhlmann
Commits on May 27, 2013
  1. @dpp

    Merge pull request #1453 from lift/uhl_issue_1453

    dpp authored
    LAFuture.collect crashes when futures are resolved out of order
Commits on May 30, 2013
  1. @dpp

    Merge pull request #1450 from lift/msf_issue_1450

    dpp authored
    Implementation of conditional onEvent helper.
  2. @dpp
  3. @dpp

    Closes #1455. Finer grained sync

    dpp authored
Commits on Jun 2, 2013
  1. @dpp

    Fixed a real deadlock

    dpp authored
Commits on Jun 4, 2013
  1. @pbrant

    Fix typo when constructing secured multi options

    pbrant authored
    s/label/nonce/
  2. @pbrant

    A few CSS parser robustness improvements

    pbrant authored
      - Allow # character in URLs
      - Scan for url\s*( instead of just url to avoid matching identifiers
        that contain the text url
      - Return Failure instead of Empty when parse fails
  3. @dpp

    Merge pull request #1459 from lift/pmb_cssparser

    dpp authored
    A few CSS parser robustness improvements
  4. @dpp

    Merge pull request #1458 from lift/pmb_multiselectfix

    dpp authored
    Fix typo when constructing secured multi options
Commits on Jun 5, 2013
  1. @farmdawgnation
  2. @farmdawgnation

    Merge pull request #1445 from lift/nafg/supplimental

    farmdawgnation authored
    Fix spelling mistake in supplimentalKidMenuItems.
Commits on Jun 7, 2013
  1. @dpp
Commits on Jun 11, 2013
  1. @dpp @fmpwizard

    Fix an edge case for HTML5 -> ByteStream

    dpp authored fmpwizard committed
Commits on Jun 14, 2013
  1. @dpp @fmpwizard

    Added the Markdown package

    dpp authored fmpwizard committed
Commits on Jun 19, 2013
  1. @eltimn
  2. @eltimn
  3. @eltimn
  4. @eltimn
  5. @eltimn
Commits on Jun 20, 2013
  1. @eltimn

    Minor cleanup re PR feedback

    eltimn authored
Commits on Jun 21, 2013
  1. @fmpwizard

    Merge pull request #1463 from lift/tcn_issue_1400

    fmpwizard authored
    Issue #1400 - Add Joda Time support to MongoRecord
  2. @fmpwizard

    Merge pull request #1464 from lift/tcn_issue_1349

    fmpwizard authored
    Issues 1349, 1411, and 1348
Commits on Jun 25, 2013
  1. @eltimn
Commits on Jun 29, 2013
  1. @farmdawgnation
  2. @farmdawgnation
Commits on Jul 1, 2013
  1. @farmdawgnation
Commits on Jul 6, 2013
  1. @japgolly @fmpwizard

    Made run-mode auto-detection customisable.

    japgolly authored fmpwizard committed
    This allows users to compliment or override the default logic used to
    determine the run-mode (ie. dev/test/staging/etc) in absence of a
    "run.mode" system variable.
    
    An example use case would be a user using test framework that Lift
    doesn't know about, and it undesirably running in development mode.
  2. @japgolly @fmpwizard
  3. @japgolly @fmpwizard

    Signed contributors.md

    japgolly authored fmpwizard committed
  4. @japgolly @fmpwizard

    Split PropertyWithModificationCondition.set() into multiple lines and…

    japgolly authored fmpwizard committed
    … added doco.
  5. @japgolly @fmpwizard

    Moved Mailer's inner classes from trait to object.

    japgolly authored fmpwizard committed
    Allows any class extending the Mailer trait to accept the same instances
    of From(), To(), Subject(), etc.
  6. @japgolly @fmpwizard
  7. @japgolly @fmpwizard

    Removed PropertyWithModificationCondition.

    japgolly authored fmpwizard committed
  8. @japgolly @fmpwizard

    Added tests for run-mode property modification.

    japgolly authored fmpwizard committed
Commits on Jul 13, 2013
  1. @dpp @fmpwizard

    Created observable future creation

    dpp authored fmpwizard committed
  2. @dpp @fmpwizard

    Fixed a minor issue

    dpp authored fmpwizard committed
  3. @fmpwizard
Commits on Jul 15, 2013
  1. @hedefalk
Commits on Jul 17, 2013
  1. @hedefalk

    fixed timezone spec

    hedefalk authored
  2. @fmpwizard

    Merge pull request #1472 from hedefalk/master

    fmpwizard authored
    withFilter on JValue to rid warnings on for-comprehensions
Commits on Jul 27, 2013
  1. @nafg @tuhlmann

    Add ValueSnippets LocParam, generalizes Snippet, LocSnippets, Dispatc…

    nafg authored tuhlmann committed
    …hLocSnippets
  2. @nafg @tuhlmann

    Simplify Loc.Snippet.apply overload disambiguation

    nafg authored tuhlmann committed
  3. @nafg @tuhlmann

    More cleanup

    nafg authored tuhlmann committed
Commits on Jul 28, 2013
  1. @dpp @fmpwizard

    Adds \;name for data-name selector. Adds "1 \[href\]" to only apply c…

    dpp authored fmpwizard committed
    …hanges to top-level attributes
  2. @farmdawgnation @fmpwizard

    Use the "^" character to select the head element.

    farmdawgnation authored fmpwizard committed
    This was previously implemented using "1", but it does the same thing -
    allows us to change things on the top level element on whatever NodeSeq
    the transform is applied to. So, "^ [href]" would target the href param
    of that element, for example.
  3. @fmpwizard
Commits on Jul 31, 2013
  1. @fmpwizard

    fixed #1250 - HTTP OPTIONS verb support

    fmpwizard authored
    Added the Options verb to RestHelper
  2. @fmpwizard

    Addressed Matt's comments

    fmpwizard authored
  3. @fmpwizard
  4. @fmpwizard
  5. @fmpwizard
Commits on Aug 2, 2013
  1. @fmpwizard
  2. @fmpwizard

    fixed #1465 - Lift could annotate type of primaryKeyField as a workar…

    fmpwizard authored
    …ound to Scala regression SI-7612
  3. @dpp @fmpwizard

    Add support for X-Frame-Options

    dpp authored fmpwizard committed
Commits on Aug 8, 2013
  1. @fmpwizard
  2. @dpp @fmpwizard

    Closes #1126. Swallows an inner <a> for Menu.item

    dpp authored fmpwizard committed
  3. @fmpwizard
  4. @fmpwizard
  5. @fmpwizard
  6. @fmpwizard
  7. @fmpwizard
  8. @fmpwizard
Commits on Aug 12, 2013
  1. @Shadowfiend

    Revert "Use ThreadLocalRandom in StringHelpers.randomString on Java 7."

    Shadowfiend authored
    ThreadLocalRandom turns out not to be a secure RNG, so using it compromises our
    XSS and other protections for field names.
    
    This reverts commit f2de993.
Commits on Aug 14, 2013
  1. @fmpwizard
  2. @hedefalk @fmpwizard

    Fixed path in Menu

    hedefalk authored fmpwizard committed
  3. @hedefalk @fmpwizard

    removed unnescessary allocations

    hedefalk authored fmpwizard committed
  4. @hedefalk @fmpwizard

    cleanup

    hedefalk authored fmpwizard committed
  5. @hedefalk @fmpwizard

    removed unnescessary structural typing hack

    hedefalk authored fmpwizard committed
  6. @fmpwizard

    Fixed #1473 - SqlServerBaseDriver should set brokenLimit_? to true

    fmpwizard authored
    MicrosoftSQL at least 2008 and greater don't support the LIMIT clause, so now the default driver
    we offer will work out of the box with newer sql server versions
  7. @fmpwizard
  8. @Shadowfiend @fmpwizard
  9. @fmpwizard

    Upgraded to sbt 0.12.4

    fmpwizard authored
Commits on Aug 24, 2013
  1. @fmpwizard

    Revert "removed unnescessary structural typing hack"

    fmpwizard authored
    This reverts commit 9167ff0.
  2. @dpp @fmpwizard

    Remove source directive from the scalatest library

    dpp authored fmpwizard committed
Commits on Aug 26, 2013
  1. @dpp @fmpwizard

    correctly escape end script tags

    dpp authored fmpwizard committed
Commits on Sep 2, 2013
  1. @farmdawgnation

    Name existing S.ieMode to S.legacyIeCompatibilityMode.

    farmdawgnation authored
    We keep S.ieMode as a deprecated value until 3.0.
  2. @farmdawgnation
  3. @farmdawgnation

    Add helpers for detecting IE10/11.

    farmdawgnation authored
    I know we were all hoping that by IE10 they'd be up to speed with the
    rest of the world, but I still remember some support issues, so I'm
    adding a detector for it in the event server side detection is needed
    for some people. Ditto for 11. Here's hoping these will be the last
    versions of IE that ever need such detection.
  4. @farmdawgnation

    IE < 6 still counts as IE.

    farmdawgnation authored
    Though we sincerely hope to never see any of these user agents, we
    should return the correct value for isIE if they hit our apps.
  5. @farmdawgnation

    Comments should reflect reality: update IE compat comments.

    farmdawgnation authored
    We also consider IE 8 a legacy IE.
Commits on Sep 14, 2013
  1. @farmdawgnation

    Simplify Loc.doesMatch_?

    farmdawgnation authored
    As I was reading over this code to look at this issue, we were calling
    Link.isDefinedAt to determine whether or not to call Link.appy.
    Link.apply calls Link.isDefinedAt to determine whether or not to throw
    an exception.
    
    This seemed redundant in this particular case, so I've reduced this
    method to a simple boolean expression that should have the same effect.
  2. @farmdawgnation

    Add and implement the MatchWithoutCurrentValue LocParam.

    farmdawgnation authored
    The MatchWithoutCurrentValue LocParam overrides Lift's default behavior
    of considering an Empty currentValue a non-match for a Loc. This default
    action is desirable in most circumstances, but occasionally we want to
    allow client code to define some custom behavior in the event
    currentValue comes up Empty.
    
    Using this new LocParam in combination with IfValue would allow them to
    do so.
  3. @farmdawgnation
  4. @farmdawgnation
  5. @Shadowfiend @fmpwizard

    Add centralized handling for parameters not mapped to Lift functions.

    Shadowfiend authored fmpwizard committed
    We add a LiftRules entry, handleUnmappedParameter, that is a FactoryMaker that
    vends a function to handle any parmaeter not mapped to a Lift function. By
    default, the function checks if the parameter name starts with F, and logs a
    warning if so. This is to do a quick, high-speed check as to whether or not the
    parameter looks like a Lift function binding.
  6. @Shadowfiend @fmpwizard
  7. @Shadowfiend @fmpwizard

    Fix some indentation fail.

    Shadowfiend authored fmpwizard committed
Commits on Sep 15, 2013
  1. @Tmr @fmpwizard

    Small fix in ListenerManager trait's comments

    Tmr authored fmpwizard committed
  2. @fmpwizard

    Fixed parsing json double values in scientific notation with e+

    Mikhail Strebkov authored fmpwizard committed
  3. @farmdawgnation @fmpwizard
Commits on Oct 2, 2013
  1. @fmpwizard

    Merge pull request #1487 from lift/msf_issue_1487

    fmpwizard authored
    Need a way to customize fail behavior in menus/param menus
Commits on Oct 5, 2013
  1. @fmpwizard
Commits on Oct 15, 2013
  1. @xuwei-k

    override JObject#hashCode

    xuwei-k authored
  2. @xuwei-k

    JObject equals hashCode test

    xuwei-k authored
Commits on Oct 16, 2013
  1. @xuwei-k

    Update contributors

    xuwei-k authored
Commits on Oct 24, 2013
  1. @fmpwizard

    Merge pull request #1499 from xuwei-k/jobject-hashcode

    fmpwizard authored
    override JObject#hashCode
Commits on Nov 3, 2013
Commits on Nov 7, 2013
  1. @fmpwizard

    To build the project for java6, you have to have java6, you cannot si…

    fmpwizard authored
    …mply
    
    use the source: ... option
Commits on Nov 8, 2013
  1. @fmpwizard
Commits on Nov 9, 2013
  1. @fmpwizard

    Merge pull request #1500 from chriswebster/perfFix

    fmpwizard authored
    Improve performance of decomposing case classes to Json
Commits on Dec 14, 2013
  1. @farmdawgnation
  2. @farmdawgnation
Commits on Dec 20, 2013
  1. @pbrant

    Fix compile in Scala 2.10.1+

    pbrant authored
    Scala 2.10.1 includes a type checking bug fix that causes compilation to
    fail.  Add casts to work around this (effectively restoring the previous
    behavior).
Commits on Dec 22, 2013
  1. @Shadowfiend

    Merge pull request #1503 from lift/msf_issue_1503

    Shadowfiend authored
    IE11 Detection is Busted
    
    As documented in this mailing list thread our IE 11 detection is broken. We
    fix that by special casing the matching for that one.
Commits on Jan 6, 2014
  1. @kevg
  2. @fmpwizard

    Merge pull request #1511 from infofinity/master

    fmpwizard authored
    Update README.md to clarify pull request guidelines
  3. @Shadowfiend
  4. @Shadowfiend
Commits on Jan 16, 2014
  1. @Shadowfiend

    Merge pull request #1509 from lift/pmb_liftscreenfix

    Shadowfiend authored
    Fix compile in Scala 2.10.1+
    
    Scala 2.10.1 included a type checking bug fix that caused compilation to
    fail for AFilter pattern matches. Add casts to work around this (effectively
    restoring the previous behavior of scalac, but explicitly).
Commits on Jan 19, 2014
  1. @Shadowfiend

    Merge remote-tracking branch 'origin/master' into lift_30_merge

    Shadowfiend authored
    Conflicts:
    	core/actor/src/main/scala/net/liftweb/actor/LAFuture.scala
    	core/markdown/src/main/scala/net/liftweb/markdown/InlineParsers.scala
    	core/markdown/src/main/scala/net/liftweb/markdown/Transformer.scala
    	core/markdown/src/test/scala/net/liftweb/markdown/InlineParsersTest.scala
    	persistence/jpa/src/main/scala/net/liftweb/jpa/RequestVarEM.scala
    	persistence/mapper/src/main/scala/net/liftweb/mapper/MappedForeignKey.scala
    	project/Dependencies.scala
    	web/webkit/src/main/scala/net/liftweb/http/CometActor.scala
    	web/webkit/src/main/scala/net/liftweb/http/LiftSession.scala
    	web/webkit/src/main/scala/net/liftweb/http/Req.scala
    	web/webkit/src/main/scala/net/liftweb/http/S.scala
    	web/webkit/src/main/scala/net/liftweb/sitemap/Loc.scala
This page is out of date. Refresh to see the latest.
View
3  CONTRIBUTING.md
@@ -18,6 +18,9 @@ The policy on issues is:
We will accept pull requests into the Lift codebase if the pull requests meet
the following criteria:
+* The request handles an issue that has been discussed on the Lift mailing list
+ and whose solution has been requested (and in general adheres to the spirit of
+ the issue guidelines above).
* The request represents one or more of the following:
* Documentation including ScalaDoc comments in code
* Example code
View
22 README.md
@@ -16,12 +16,16 @@ Because Lift applications are written in [Scala](http://www.scala-lang.org), an
We will accept pull requests into the [Lift codebase](https://github.com/lift)
if the pull requests meet the following criteria:
-* One or more of the following:
- * Documentation including ScalaDoc comments in code
- * Example code
- * Small changes, enhancements, or bug fixes to Lift's code
-* Each pull request must include a signature at the bottom of the
- `/contributors.md` file.
+* The request handles an issue that has been discussed on the [Lift mailing list](http://groups.google.com/forum/#!forum/liftweb)
+ and whose solution has been requested (and in general adheres to the spirit of
+ the issue guidelines outlined in [CONTRIBUTING.md](https://github.com/lift/framework/blob/master/CONTRIBUTING.md)).
+* The request represents one or more of the following:
+ * Documentation including ScalaDoc comments in code
+ * Example code
+ * Small changes, enhancements, or bug fixes to Lift’s code
+* The request includes a signature at the bottom of the `/contributors.md` file.
+
+For more details, see [CONTRIBUTING.md](https://github.com/lift/framework/blob/master/CONTRIBUTING.md).
## Getting Started
@@ -59,10 +63,10 @@ Or, you can add Lift to your `pom.xml` like so:
<dependency>
<groupId>net.liftweb</groupId>
<artifactId>lift-mapper_${scala.version}</artifactId>
- <version>2.4</version>
+ <version>2.5.1</version>
</dependency>
-Where `${scala.version}` is `2.8.0`, `2.8.1`, `2.9.1` etc.
+Where `${scala.version}` is `2.9.1` etc. For scala 2.10.x, which is binary compatible, you just use `2.10`, and that will work for `2.10.0` ,`2.10.1` ,`2.10.2`
You can [learn more on the wiki](http://www.assembla.com/wiki/show/liftweb/Using_Maven).
@@ -128,7 +132,7 @@ The Lift wiki is hosted on Assembla and can be found at [http://www.assembla.com
### ScalaDocs
-The ScalaDocs for each release of Lift, in additional to the actual JARs, are available on ScalaTools. You can access the source code–based documentation for releases via the site's homepage or by navigating directly to the URL for the specific release. For instance, the Lift 2.4 release can be accessed at [http://scala-tools.org/mvnsites/liftweb-2.4/](http://scala-tools.org/mvnsites/liftweb-2.4/).
+The ScalaDocs for each release of Lift, in additional to the actual JARs, are available on the Liftweb.net site. You can access the source code–based documentation for releases via the site's homepage or by navigating directly to the URL for the specific release. For instance, the Lift 2.5 release can be accessed at [http://liftweb.net/api/25/api/](http://liftweb.net/api/25/api/).
### Cookbook
View
4 core/markdown/src/main/scala/net/liftweb/markdown/InlineParsers.scala
@@ -120,8 +120,6 @@ trait InlineParsers extends BaseParsers {
}
}
-
-
/**
* all markdown inline element parsers or'ed together
*/
@@ -434,4 +432,4 @@ trait InlineParsers extends BaseParsers {
false
}
-}
+}
View
2  core/markdown/src/main/scala/net/liftweb/markdown/Transformer.scala
@@ -59,7 +59,7 @@ class SingleThreadedTransformer extends Transformer
* val input:String = ...
* val xhtml:String = new ActuariusTransformer()(input)
*
- * Note that this markdown parser isn't inherantly thread-safe, as Scala Parser Combinators isn't, so this
+ * Note that this markdown parser isn't inherently thread-safe, as Scala Parser Combinators aren't, so this
* class instantiates a SingleThreadedTransformer for each thread.
* You'll need to write your own pooled implementation if this isn't efficient for your usage.
*/
View
27 core/markdown/src/test/scala/net/liftweb/markdown/InlineParsersTest.scala
@@ -65,19 +65,18 @@ class InlineParsersTest extends FlatSpec with ShouldMatchers with InlineParsers{
("``code ` code``", "<code>code ` code</code>")
)
- val entityTest = List("Hello &nbsp; World" -> "Hello &nbsp; World",
- "Hello & World" -> "Hello &amp; World",
- ("test &egrave; text" ->"test &egrave; text"),
- "test &egrave; text" ->"test &egrave; text",
- "test&egrave; text" -> "test&egrave; text",
- "test &egrave;" -> "test &egrave;",
- "test &omega;" -> "test &omega;",
- "test &unknown;" -> "test &amp;unknown;",
- "AT&T" -> "AT&amp;T",
- "<ATT" -> "&lt;ATT",
- "test&nbsp;hello" -> "test&nbsp;hello",
- "test &nbsp; hello&nbsp;;" -> "test &nbsp; hello&nbsp;;")
-
+ val entityTest = List("Hello &nbsp; World" -> "Hello &nbsp; World",
+ "Hello & World" -> "Hello &amp; World",
+ ("test &egrave; text" ->"test &egrave; text"),
+ "test &egrave; text" ->"test &egrave; text",
+ "test&egrave; text" -> "test&egrave; text",
+ "test &egrave;" -> "test &egrave;",
+ "test &omega;" -> "test &omega;",
+ "test &unknown;" -> "test &amp;unknown;",
+ "AT&T" -> "AT&amp;T",
+ "<ATT" -> "&lt;ATT",
+ "test&nbsp;hello" -> "test&nbsp;hello",
+ "test &nbsp; hello&nbsp;;" -> "test &nbsp; hello&nbsp;;")
val linkTests = List(
("""[link text](http://example.com "link title")""",
@@ -173,7 +172,7 @@ class InlineParsersTest extends FlatSpec with ShouldMatchers with InlineParsers{
val allInlineTests = italicTests ++ boldTests ++ entityTest ++
codeTests ++ linkTests ++ fastLinkTests ++ imageTests ++ brTests ++
- xmlStartTagTests ++ xmlEndTagTests ++ xmlInlineTests ++ dummyTests
+ xmlStartTagTests ++ xmlEndTagTests ++ xmlInlineTests ++ dummyTests
it should "create italic text" in {
runSucceedingParsingTests(emAsterisk(new InlineContext())|emUnderscore(new InlineContext()) , italicTests)
View
15 core/util/src/main/scala/net/liftweb/util/CSSHelpers.scala
@@ -76,9 +76,11 @@ case class CSSParser(prefix: String) extends Parsers {
case 'u' if (seqDone == 0) => seqDone = 1;
case 'r' if (seqDone == 1) => seqDone = 2;
case 'l' if (seqDone == 2) => seqDone = 3;
+ case ' ' | '\t' | '\n' | '\r' if (seqDone == 3 || seqDone == 4) => seqDone = 4
+ case '(' if (seqDone == 3 || seqDone == 4) => seqDone = 5
case _ => seqDone = 0
}
- seqDone == 3;
+ seqDone == 5;
}
Success(content toString, rest);
@@ -94,15 +96,16 @@ case class CSSParser(prefix: String) extends Parsers {
c == ';' || c == '.' ||
c == '+' || c == '-' ||
c == '=' || c == ':' ||
- c == ' ' || c == '_').+ ^^ {case l => l.mkString("")}
+ c == ' ' || c == '_' ||
+ c == '#').+ ^^ {case l => l.mkString("")}
// the URL might be wrapped in simple quotes
lazy val seq1 = elem('\'') ~> path <~ elem('\'')
// the URL might be wrapped in double quotes
lazy val seq2 = elem('\"') ~> path <~ elem('\"')
// do the parsing per CSS spec http://www.w3.org/TR/REC-CSS2/syndata.html#uri section 4.3.4
- lazy val expr = (spaces ~ elem('(') ~ spaces) ~> ( seq1 | seq2 | path ) <~ (spaces <~ elem(')')) ^^ {case s => {
- "('" + (s.trim.startsWith("/") match {
+ lazy val expr = spaces ~> ( seq1 | seq2 | path ) <~ (spaces <~ elem(')')) ^^ {case s => {
+ "'" + (s.trim.startsWith("/") match {
case true => prefix + s.trim
case _ => s.trim
}) + "')"
@@ -114,9 +117,9 @@ case class CSSParser(prefix: String) extends Parsers {
def fixCSS(in: String): Box[String] = phrase(in) match {
case Success(v, r) => (r atEnd) match {
case true => Full(v)
- case _ => Empty // return Empty if the reader is not at end as it implies that parsing ended due to a parser error
+ case _ => common.Failure("Parser did not consume all input. Parser error?") // return Failure if the reader is not at end as it implies that parsing ended due to a parser error
}
- case _ => Empty
+ case x => common.Failure("Parse failed with result %s".format(x))
}
}
View
2  persistence/mapper/src/main/scala/net/liftweb/mapper/MappedForeignKey.scala
@@ -226,7 +226,7 @@ extends MappedLong[T](theOwner) with MappedForeignKey[Long,T,O] with BaseForeign
def foreignMeta = _foreignMeta
- def box: Box[Long] = if (defined_?) Full(is) else Empty
+ def box: Box[Long] = if (defined_?) Full(get) else Empty
type KeyType = Long
type KeyedForeignType = O
View
13 web/webkit/src/main/scala/net/liftweb/http/CometActor.scala
@@ -19,27 +19,17 @@ package http
import net.liftweb.common._
import net.liftweb.actor._
-import scala.collection.mutable.{ListBuffer}
import net.liftweb.util.Helpers._
import net.liftweb.util._
import net.liftweb.json._
import scala.xml.{NodeSeq, Text, Elem, Node, Group, Null, PrefixedAttribute, UnprefixedAttribute}
-import scala.collection.immutable.TreeMap
-import scala.collection.mutable.{HashSet, ListBuffer}
+import scala.collection.mutable.ListBuffer
import net.liftweb.http.js._
import JsCmds._
import JE._
-import java.util.concurrent.atomic.AtomicLong
import java.util.Locale
-/**
- * This is used as an indicator message for linked actors.
- *
- * @see ActorWatcher
- */
-case object RelinkToActorWatcher
-
trait DeltaTrait {
def toJs: JsCmd
}
@@ -881,7 +871,6 @@ trait CometActor extends LiftActor with LiftCometActor with BindHelpers {
case PerformSetupComet2(initialReq) => {
- // this ! RelinkToActorWatcher
localSetup()
captureInitialReq(initialReq)
performReRender(true)
View
4 web/webkit/src/main/scala/net/liftweb/http/LiftRules.scala
@@ -1597,8 +1597,8 @@ class LiftRules() extends Factory with FormVendor with LazyLoggable {
css.map(str => CSSHelpers.fixCSS(new BufferedReader(
new StringReader(str)), prefix openOr (S.contextPath)) match {
case (Full(c), _) => CSSResponse(c)
- case (_, input) => {
- logger.info("Fixing " + cssPath + " failed");
+ case (x, input) => {
+ logger.info("Fixing " + cssPath + " failed with result %s".format(x));
CSSResponse(input)
}
})
View
12 web/webkit/src/main/scala/net/liftweb/http/LiftScreen.scala
@@ -360,7 +360,7 @@ trait AbstractScreen extends Factory {
case AVal(v: (T => List[FieldError])) => v
},
stuff.toList.collect {
- case AFilter(v) => v
+ case AFilter(v) => v.asInstanceOf[T => T]
},
stuff)
}
@@ -484,7 +484,7 @@ trait AbstractScreen extends Factory {
}.toList
override def setFilter = stuff.collect {
- case AFilter(f) => f
+ case AFilter(f) => f.asInstanceOf[ValueType => ValueType]
}.toList
override def is = underlying.get
@@ -586,7 +586,7 @@ trait AbstractScreen extends Factory {
}.toList
override def setFilter = stuff.collect {
- case AFilter(f) => f
+ case AFilter(f) => f.asInstanceOf[ValueType => ValueType]
}.toList
override def is = underlying.openOrThrowException("Legacy code").get
@@ -617,7 +617,7 @@ trait AbstractScreen extends Factory {
case AVal(v: (T => List[FieldError])) => List(v)
case _ => Nil
}, stuff.toList.flatMap {
- case AFilter(v) => List(v)
+ case AFilter(v) => List(v.asInstanceOf[T => T])
case _ => Nil
}, stuff).make
@@ -755,7 +755,7 @@ trait AbstractScreen extends Factory {
override lazy val formElemAttrs: Seq[SHtml.ElemAttr] = grabParams(stuff)
override val setFilter = stuff.flatMap {
- case AFilter(f) => List(f)
+ case AFilter(f) => List(f.asInstanceOf[ValueType => ValueType])
case _ => Nil
}.toList
override val validations = stuff.flatMap {
@@ -792,7 +792,7 @@ trait AbstractScreen extends Factory {
override lazy val formElemAttrs: Seq[SHtml.ElemAttr] = grabParams(stuff)
override val setFilter = stuff.flatMap {
- case AFilter(f) => List(f)
+ case AFilter(f) => List(f.asInstanceOf[ValueType => ValueType])
case _ => Nil
}.toList
override val validations = stuff.flatMap {
View
139 web/webkit/src/main/scala/net/liftweb/http/LiftSession.scala
@@ -1,5 +1,5 @@
/*
- * Copyright 2007-2012 WorldWide Conferencing, LLC
+ * Copyright 2007-2013 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -608,18 +608,18 @@ class LiftSession(private[http] val _contextPath: String, val uniqueId: String,
def ? = this.box openOr false
}
- private var nmessageCallback: ConcurrentHashMap[String, S.AFuncHolder] = new ConcurrentHashMap()
+ private val nmessageCallback: ConcurrentHashMap[String, S.AFuncHolder] = new ConcurrentHashMap
- @volatile private[http] var notices: Seq[(NoticeType.Value, NodeSeq, Box[String])] = Nil
+ @volatile private[http] var notices: Seq[(NoticeType.Value, NodeSeq, Box[String])] = Nil
- private val nasyncComponents: ConcurrentHashMap[(Box[String], Box[String]), LiftCometActor] = new ConcurrentHashMap()
+ private val nasyncComponents = new ConcurrentHashMap[(Box[String], Box[String]), LiftCometActor]
- private val nasyncById: ConcurrentHashMap[String, LiftCometActor] = new ConcurrentHashMap()
-
- private val nmyVariables: ConcurrentHashMap[String, Any] = new ConcurrentHashMap()
+ private val nasyncById = new ConcurrentHashMap[String, LiftCometActor]
private val asyncSync = new Object
+ private val nmyVariables = new ConcurrentHashMap[String, Any]
+
@volatile private var onSessionEnd: List[LiftSession => Unit] = Nil
@@ -632,7 +632,7 @@ class LiftSession(private[http] val _contextPath: String, val uniqueId: String,
* A mapping between pages denoted by RenderVersion and
* functions to execute at the end of the page rendering
*/
- private var postPageFunctions: Map[String, PostPageFunctions] = Map()
+ @volatile private var postPageFunctions: Map[String, PostPageFunctions] = Map()
/**
* A list of AJAX requests that may or may not be pending for this
@@ -760,7 +760,7 @@ class LiftSession(private[http] val _contextPath: String, val uniqueId: String,
* well, you can look them up.
*/
def findFunc(funcName: String): Option[S.AFuncHolder] =
- Box !! nmessageCallback.get(funcName)
+ Option(nmessageCallback.get(funcName))
/**
* Executes the user's functions based on the query parameters
@@ -777,19 +777,19 @@ class LiftSession(private[http] val _contextPath: String, val uniqueId: String,
if (callback.isEmpty)
LiftRules.handleUnmappedParameter.vend(state, parameterName)
-
- callback.map(funcHolder => RunnerHolder(parameterName, funcHolder, funcHolder.owner))
- }
- .sortWith {
- case (RunnerHolder(_, _, Full(a)), RunnerHolder(_, _, Full(b))) if a < b => true
- case (RunnerHolder(_, _, Full(a)), RunnerHolder(_, _, Full(b))) if a > b => false
- case (RunnerHolder(an, _, Full(a)), RunnerHolder(bn, _, Full(b))) if a == b => an < bn
- case (RunnerHolder(_, _, Full(_)), _) => false
- case (_, RunnerHolder(_, _, Full(_))) => true
- case (RunnerHolder(a, _, _), RunnerHolder(b, _, _)) => a < b
- case _ => false
- }
+
+ callback.map(funcHolder => RunnerHolder(parameterName, funcHolder, funcHolder.owner)).toList
+ }
+ .sortWith {
+ case (RunnerHolder(_, _, Full(a)), RunnerHolder(_, _, Full(b))) if a < b => true
+ case (RunnerHolder(_, _, Full(a)), RunnerHolder(_, _, Full(b))) if a > b => false
+ case (RunnerHolder(an, _, Full(a)), RunnerHolder(bn, _, Full(b))) if a == b => an < bn
+ case (RunnerHolder(_, _, Full(_)), _) => false
+ case (_, RunnerHolder(_, _, Full(_))) => true
+ case (RunnerHolder(a, _, _), RunnerHolder(b, _, _)) => a < b
+ case _ => false
}
+ }
def buildFunc(i: RunnerHolder): () => Any = i.func match {
case bfh if bfh.supportsFileParams_? =>
@@ -804,7 +804,7 @@ class LiftSession(private[http] val _contextPath: String, val uniqueId: String,
val f = toRun.filter(_.owner == w)
w match {
// if it's going to a CometActor, batch up the commands
- case Full(id) if nasyncById.contains(id) => (Box !! nasyncById.get(id)).toList.flatMap(a =>
+ case Full(id) if nasyncById.containsKey(id) => Option(nasyncById.get(id)).toList.flatMap(a =>
a.!?(ActionMessageSet(f.map(i => buildFunc(i)), state)) match {
case li: List[_] => li
case other => Nil
@@ -819,15 +819,17 @@ class LiftSession(private[http] val _contextPath: String, val uniqueId: String,
/**
* Updates the internal functions mapping
*/
- def updateFunctionMap(funcs: Map[String, S.AFuncHolder], uniqueId: String, when: Long): Unit =
+ def updateFunctionMap(funcs: Map[String, S.AFuncHolder], uniqueId: String, when: Long): Unit = {
funcs.foreach {
case (name, func) =>
nmessageCallback.put(name,
if (func.owner == Full(uniqueId)) func else func.duplicate(uniqueId))
}
+ }
- def removeFunction(name: String) =
+ def removeFunction(name: String) = {
nmessageCallback.remove(name)
+ }
/**
* Set your session-specific progress listener for mime uploads
@@ -845,7 +847,7 @@ class LiftSession(private[http] val _contextPath: String, val uniqueId: String,
notices = Nil
nasyncComponents.clear
nasyncById.clear
- nmyVariables.clear()
+ nmyVariables.clear
onSessionEnd = Nil
postPageFunctions = Map()
highLevelSessionDispatcher = HashMap.empty
@@ -869,11 +871,8 @@ class LiftSession(private[http] val _contextPath: String, val uniqueId: String,
def doCometActorCleanup(): Unit = {
import scala.collection.JavaConversions._
- val acl = asyncSync.synchronized {
- this.nasyncComponents.values.toList
- }
- acl.foreach(_ ! ShutdownIfPastLifespan)
+ this.nasyncComponents.values.foreach(_ ! ShutdownIfPastLifespan)
}
/**
@@ -948,11 +947,10 @@ class LiftSession(private[http] val _contextPath: String, val uniqueId: String,
}
}
+
import scala.collection.JavaConversions._
- nmessageCallback.entrySet().foreach {
- case s =>
- val k = s.getKey
- val f = s.getValue
+ nmessageCallback.foreach {
+ case (k, f) =>
if (!f.sessionLife &&
f.owner.isDefined &&
(now - f.lastSeen) > LiftRules.unusedFunctionsLifeTime) {
@@ -1084,14 +1082,15 @@ class LiftSession(private[http] val _contextPath: String, val uniqueId: String,
}
}
- import scala.collection.JavaConversions._
- (0 /: nmessageCallback.entrySet())((l, v) => l + (v.getValue.owner match {
- case Full(owner) if (owner == ownerName) =>
- v.getValue.lastSeen = time
- 1
- case Empty => v.getValue.lastSeen = time
- 1
- case _ => 0
+ import scala.collection.JavaConversions._
+ (0 /: nmessageCallback)((l, v) => l + (v._2.owner match {
+ case Full(owner) if (owner == ownerName) =>
+ v._2.lastSeen = time
+ 1
+ case Empty =>
+ v._2.lastSeen = time
+ 1
+ case _ => 0
}))
}
@@ -1099,9 +1098,9 @@ class LiftSession(private[http] val _contextPath: String, val uniqueId: String,
* Returns true if there are functions bound for this owner
*/
private[http] def hasFuncsForOwner(owner: String): Boolean = {
- import scala.collection.JavaConversions._
+ import scala.collection.JavaConversions._
- !nmessageCallback.values().find(_.owner == owner).isEmpty
+ !nmessageCallback.find(_._2.owner == owner).isEmpty
}
@@ -1120,10 +1119,9 @@ class LiftSession(private[http] val _contextPath: String, val uniqueId: String,
SessionMaster.sendMsg(RemoveSession(this.uniqueId))
- asyncSync.synchronized{
- nasyncComponents.values().foreach {
- case comp => done ::= (() => tryo(comp ! ShutDown))
- }
+ import scala.collection.JavaConversions._
+ nasyncComponents.foreach {
+ case (_, comp) => done ::= (() => tryo(comp ! ShutDown))
}
cleanUpSession()
LiftSession.onShutdownSession.foreach(f => done ::= (() => f(this)))
@@ -1179,7 +1177,8 @@ class LiftSession(private[http] val _contextPath: String, val uniqueId: String,
val xml = merge(rawXml, request)
// snapshot for ajax calls
- nmessageCallback.put(S.renderVersion, S.PageStateHolder(Full(S.renderVersion), this))
+ nmessageCallback.put(S.renderVersion,
+ S.PageStateHolder(Full(S.renderVersion), this))
// But we need to update the function map because there
// may be addition functions created during the JsToAppend processing
@@ -2460,28 +2459,29 @@ class LiftSession(private[http] val _contextPath: String, val uniqueId: String,
/**
* Finds all Comet actors by type
*/
- def findComet(theType: String): List[LiftCometActor] = asyncSync.synchronized {
+ def findComet(theType: String): List[LiftCometActor] = {
import scala.collection.JavaConversions._
testStatefulFeature {
- nasyncComponents.entrySet().toList.flatMap {v => (v.getKey, v.getValue) match {
+ import scala.collection.JavaConversions._
+ nasyncComponents.flatMap {
case ((Full(name), _), value) if name == theType => Full(value)
case _ => Empty
- }}.toList
+ }.toList
}
}
/**
* Find the comet actor by type and name
*/
- def findComet(theType: String, name: Box[String]): Box[LiftCometActor] =
+ def findComet(theType: String, name: Box[String]): Box[LiftCometActor] = {
asyncSync.synchronized {
- testStatefulFeature {
- Box !! nasyncComponents.get(Full(theType) -> name)
+ testStatefulFeature {
+ Box !! nasyncComponents.get(Full(theType) -> name)
+ }
}
}
-
/**
* This method will send a message to a CometActor, whether or not
* the CometActor is instantiated. If the CometActor already exists
@@ -2550,13 +2550,13 @@ class LiftSession(private[http] val _contextPath: String, val uniqueId: String,
/**
* Finds a Comet actor by ID
*/
- def getAsyncComponent(id: String): Box[LiftCometActor] = asyncSync.synchronized(
- testStatefulFeature(Box !! nasyncById.get(id)))
+ def getAsyncComponent(id: String): Box[LiftCometActor] =
+ testStatefulFeature(Box.legacyNullTest(nasyncById.get(id)))
/**
* Adds a new Comet actor to this session
*/
- private[http] def addCometActor(act: LiftCometActor): Unit = asyncSync.synchronized {
+ private[http] def addCometActor(act: LiftCometActor): Unit = {
testStatefulFeature {
nasyncById.put(act.uniqueId, act)
}
@@ -2570,10 +2570,9 @@ class LiftSession(private[http] val _contextPath: String, val uniqueId: String,
testStatefulFeature {
val what = (theType -> name)
- asyncSync.synchronized {
- nasyncById.put(act.uniqueId,act)
- nasyncComponents.put(what, act)
- }
+ nasyncById.put(act.uniqueId, act)
+ nasyncComponents.put(what, act)
+
act.callInitCometActor(this, theType, name, defaultXml, attributes)
act ! PerformSetupComet2(if (act.sendInitialReq_?)
S.request.map(_.snapshot)
@@ -2584,19 +2583,20 @@ class LiftSession(private[http] val _contextPath: String, val uniqueId: String,
/**
* Remove a Comet actor
*/
- private[http] def removeCometActor(act: LiftCometActor): Unit = asyncSync.synchronized {
+ private[http] def removeCometActor(act: LiftCometActor): Unit = {
testStatefulFeature {
nasyncById.remove(act.uniqueId)
- nmessageCallback.remove(act.jsonCall.funcId)
nasyncComponents.remove(act.theType -> act.name)
val toCmp = Full(act.uniqueId)
import scala.collection.JavaConversions._
- nmessageCallback.foreach {v => v match {
+ nmessageCallback.remove(act.jsonCall.funcId)
+ nmessageCallback.foreach {
case (k, f) =>
if (f.owner == toCmp) nmessageCallback.remove(k)
- }}
+ }
+
LiftSession.this.synchronized {
accessPostPageFuncs {
postPageFunctions -= act.uniqueId
@@ -2605,9 +2605,10 @@ class LiftSession(private[http] val _contextPath: String, val uniqueId: String,
import scala.collection.JavaConversions._
val id = Full(act.uniqueId)
- nmessageCallback.keys().foreach {
- k =>
- val f = nmessageCallback.get(k)
+
+ nmessageCallback.foreach {
+ case (k, f) =>
+
if (f.owner == id) {
nmessageCallback.remove(k)
}
View
10 web/webkit/src/main/scala/net/liftweb/http/Req.scala
@@ -33,7 +33,7 @@ object UserAgentCalculator extends Factory {
/**
* The default regular expression for IE
*/
- val iePattern = """MSIE ([0-9]+)""".r
+ val iePattern = """(MSIE ([0-9]+)|Trident/7.*rv:([0-9]+))""".r
/**
* You can change the mechanism by which the user agent for IE
@@ -47,9 +47,11 @@ object UserAgentCalculator extends Factory {
*/
def defaultIeCalcFunction(userAgent: Box[String]): Box[Double] =
for {
- ua <- userAgent
- m = iePattern.pattern.matcher(ua)
- ver <- if (m.find) Helpers.asDouble(m.group(1)) else Empty
+ userAgent <- userAgent
+ ieMatch = iePattern.pattern.matcher(userAgent)
+ findResult = ieMatch.find if findResult
+ ieVersionString <- Box.legacyNullTest(ieMatch.group(2)) or Box.legacyNullTest(ieMatch.group(3))
+ ver <- Helpers.asDouble(ieVersionString)
} yield ver
/**
View
5 web/webkit/src/main/scala/net/liftweb/http/SHtml.scala
@@ -2099,10 +2099,10 @@ trait SHtml {
SelectableOptionWithNonce(selectableOption.value, randomString(20), selectableOption.label, selectableOption.attrs: _*)
}
- val sm: Map[String, T] = Map(secure.map(v => (v.label, v.value)): _*)
+ val sm: Map[String, T] = Map(secure.map(v => (v.nonce, v.value)): _*)
val defaultNonce: Seq[String] = default.flatMap { defaultOption =>
- secure.find(_.value == defaultOption).map(_.label)
+ secure.find(_.value == defaultOption).map(_.nonce)
}
val nonces: List[SelectableOption[String]] = secure.map { selectableOptionWithNonce =>
@@ -2111,6 +2111,7 @@ trait SHtml {
def process(info: List[String]): Unit = onSubmit(info.flatMap(sm.get))
+
(nonces, defaultNonce, LFuncHolder(process))
}
View
42 web/webkit/src/main/scala/net/liftweb/sitemap/Loc.scala
@@ -383,23 +383,24 @@ trait Loc[T] {
}
def doesMatch_?(req: Req): Boolean = {
- (if (link.isDefinedAt(req)) {
- link(req) match {
- case Full(x) if testAllParams(allParams, req) => x
- case Full(x) => false
- case x => x.openOr(false)
- }
- } else false) && currentValue.isDefined
- // the loc only matches if we've got a current value
+ link.isDefinedAt(req) &&
+ testAllParams(allParams, req) &&
+ (
+ currentValue.isDefined ||
+ params.contains(Loc.MatchWithoutCurrentValue)
+ )
}
def breadCrumbs: List[Loc[_]] = _menu.breadCrumbs ::: List(this)
def buildKidMenuItems(kids: Seq[Menu]): List[MenuItem] = {
- kids.toList.flatMap(_.loc.buildItem(Nil, false, false)) ::: supplimentalKidMenuItems
+ kids.toList.flatMap(_.loc.buildItem(Nil, false, false)) ::: supplementalKidMenuItems
}
- def supplimentalKidMenuItems: List[MenuItem] =
+ @deprecated("Use supplementalKidMenuItems with an 'e'. This misspelled variant will be removed in Lift 3.0.", "2.6")
+ final def supplimentalKidMenuItems = supplementalKidMenuItems
+
+ def supplementalKidMenuItems: List[MenuItem] =
for {
p <- childValues
l <- link.createLink(p).map(appendQueryParams(p))
@@ -734,6 +735,27 @@ object Loc {
case object Hidden extends AnyLocParam
/**
+ * If this parameter is included, the Loc will continue to execute even if
+ * currentValue is not defined.
+ *
+ * By default, Lift will determine that a Loc does not match a given request
+ * if its currentValue comes up Empty, and as a result will return an HTTP 404.
+ * For situations where this is not the desired, "Not Found" behavior, you can
+ * add the MatchWithoutCurrentValue LocParam to a Loc, then use the IfValue
+ * LocParam to define what should happen when the currentValue is Empty.
+ *
+ * For example, given some class Thing, you could do the following to trigger
+ * a redirect when a Thing with a particular ID isn't found.
+ *
+ * {{{
+ * Menu.param[Thing]("Thing", "Thing", Thing.find(_), _.id) >>
+ * MatchWithoutCurrentValue >>
+ * IfValue(_.isDefined, () => RedirectResponse("/page/to/redirect/to"))
+ * }}}
+ */
+ case object MatchWithoutCurrentValue extends AnyLocParam
+
+ /**
* If this is a submenu, use the parent Loc's params
*/
case class UseParentParams() extends AnyLocParam
View
2  web/webkit/src/main/scala/net/liftweb/sitemap/Menu.scala
@@ -619,7 +619,7 @@ case class Menu(loc: Loc[_], private val convertableKids: ConvertableToMenu*) ex
}
def makeMenuItem(path: List[Loc[_]]): Box[MenuItem] =
- loc.buildItem(kids.toList.flatMap(_.makeMenuItem(path)) ::: loc.supplimentalKidMenuItems, _lastInPath(path), _inPath(path))
+ loc.buildItem(kids.toList.flatMap(_.makeMenuItem(path)) ::: loc.supplementalKidMenuItems, _lastInPath(path), _inPath(path))
/**
* Make a menu item only of the current loc is in the given group
View
21 web/webkit/src/test/scala/net/liftweb/http/ReqSpec.scala
@@ -36,6 +36,15 @@ object ReqSpec extends Specification {
List("Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B367 Safari/531.21.10",
"Mozilla/5.0 (iPad; U; CPU OS 4_2_1 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5")
+ private val ieUserAgents =
+ "Mozilla/5.0 (Windows; U; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)" ::
+ "Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)" ::
+ "Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; GTB7.4; InfoPath.2; SV1; .NET CLR 3.3.69573; WOW64; en-US)" ::
+ "Mozilla/5.0 (Windows; U; MSIE 9.0; WIndows NT 9.0; en-US))" ::
+ "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)" ::
+ "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko" ::
+ Nil
+
"Req" should {
"recognize safari 5" in {
val uac = new UserAgentCalculator {
@@ -67,6 +76,18 @@ object ReqSpec extends Specification {
}
}
}
+
+ "Correctly recognize IE versions 6-11" in {
+ val ieVersions = ieUserAgents.flatMap { ieUserAgent =>
+ val userAgentCalculator = new UserAgentCalculator {
+ def userAgent = Full(ieUserAgent)
+ }
+
+ userAgentCalculator.ieVersion
+ }
+
+ ieVersions must_== List(6, 7, 8, 9, 10, 11)
+ }
}
}
View
32 web/webkit/src/test/scala/net/liftweb/sitemap/LocSpec.scala
@@ -18,6 +18,10 @@ package net.liftweb
package sitemap
import common._
+import mockweb._
+ import MockWeb._
+import mocks._
+
import org.specs2.mutable.Specification
@@ -40,6 +44,34 @@ object LocSpec extends Specification {
val loc = (Menu.param[Param]("Test", "Test", s => Full(Param(s)), p => p.s) / "foo" / "bar" / *).toLoc
loc.calcHref(Param("myparam")) mustEqual "/foo/bar/myparam"
}
+
+ "should not match a Req matching its Link when currentValue is Empty" in {
+ val testMenu = Menu.param[Param]("Test", "Test", s => Empty, p => "bacon") / "foo" / "bar" / *
+ val testSiteMap = SiteMap(testMenu)
+
+ val testLoc = testMenu.toLoc
+ val mockReq = new MockHttpServletRequest("http://test/foo/bar/123")
+
+ testS(mockReq) {
+ testReq(mockReq) { req =>
+ testLoc.doesMatch_?(req) mustEqual false
+ }
+ }
+ }
+
+ "should match a Req matching its Link when currentValue is Empty and MatchWithoutCurrentValue is a param" in {
+ val testMenu = Menu.param[Param]("Test", "Test", s => Empty, p => "bacon") / "foo" / "bar" / * >> Loc.MatchWithoutCurrentValue
+ val testSiteMap = SiteMap(testMenu)
+
+ val testLoc = testMenu.toLoc
+ val mockReq = new MockHttpServletRequest("http://test/foo/bar/123")
+
+ testS(mockReq) {
+ testReq(mockReq) { req =>
+ testLoc.doesMatch_?(req) mustEqual true
+ }
+ }
+ }
}
}
Something went wrong with that request. Please try again.