tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject [2/2] git commit: Expose Underscore.js as module "underscore", not "_" Use @ instead of this. in CoffeeScript files
Date Mon, 03 Jun 2013 23:32:39 GMT
Expose Underscore.js as module "underscore", not "_"
Use @ instead of this. in CoffeeScript files


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/fe478d68
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/fe478d68
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/fe478d68

Branch: refs/heads/master
Commit: fe478d686b41f39d6d354403ef9ea6ea003765dd
Parents: e110ce4
Author: Howard M. Lewis Ship <hlship@apache.org>
Authored: Mon Jun 3 16:32:30 2013 -0700
Committer: Howard M. Lewis Ship <hlship@apache.org>
Committed: Mon Jun 3 16:32:30 2013 -0700

----------------------------------------------------------------------
 .../modules/t5/beanvalidator/validation.coffee     |    4 +-
 .../META-INF/modules/t5/core/ajax.coffee           |    2 +-
 .../META-INF/modules/t5/core/ajaxformloop.coffee   |   10 +++---
 .../META-INF/modules/t5/core/alert.coffee          |    2 +-
 .../META-INF/modules/t5/core/builder.coffee        |    2 +-
 .../META-INF/modules/t5/core/console.coffee        |    2 +-
 .../META-INF/modules/t5/core/datefield.coffee      |    2 +-
 .../modules/t5/core/exception-display.coffee       |    2 +-
 .../META-INF/modules/t5/core/exceptionframe.coffee |    2 +-
 .../META-INF/modules/t5/core/fields.coffee         |   22 ++++++------
 .../META-INF/modules/t5/core/form-fragment.coffee  |    6 ++--
 .../META-INF/modules/t5/core/forms.coffee          |   18 +++++-----
 .../META-INF/modules/t5/core/grid.coffee           |    4 +-
 .../META-INF/modules/t5/core/messages.coffee       |    2 +-
 .../META-INF/modules/t5/core/pageinit.coffee       |    2 +-
 .../META-INF/modules/t5/core/palette.coffee        |    2 +-
 .../META-INF/modules/t5/core/select.coffee         |    4 +-
 .../META-INF/modules/t5/core/tree.coffee           |   14 ++++----
 .../META-INF/modules/t5/core/utils.coffee          |    2 +-
 .../META-INF/modules/t5/core/validation.coffee     |   28 +++++++-------
 .../META-INF/modules/t5/core/zone.coffee           |   18 +++++-----
 .../org/apache/tapestry5/t5-core-dom-jquery.coffee |    2 +-
 .../apache/tapestry5/t5-core-dom-prototype.coffee  |    2 +-
 .../apache/tapestry5/modules/JavaScriptModule.java |    2 +-
 .../integration/app1/pages/test-dom.coffee         |    2 +-
 .../integration/app1/pages/test-messages.coffee    |    2 +-
 26 files changed, 80 insertions(+), 80 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/fe478d68/tapestry-beanvalidator/src/main/coffeescript/META-INF/modules/t5/beanvalidator/validation.coffee
----------------------------------------------------------------------
diff --git a/tapestry-beanvalidator/src/main/coffeescript/META-INF/modules/t5/beanvalidator/validation.coffee
b/tapestry-beanvalidator/src/main/coffeescript/META-INF/modules/t5/beanvalidator/validation.coffee
index 7f7efa1..cb3219c 100644
--- a/tapestry-beanvalidator/src/main/coffeescript/META-INF/modules/t5/beanvalidator/validation.coffee
+++ b/tapestry-beanvalidator/src/main/coffeescript/META-INF/modules/t5/beanvalidator/validation.coffee
@@ -15,7 +15,7 @@
 # ## t5/beanvalidator/validation
 #
 # Supports extra validations related to the beanvalidator module.
-define ["_", "t5/core/dom", "t5/core/events", "t5/core/utils", "t5/core/validation"],
+define ["underscore", "t5/core/dom", "t5/core/events", "t5/core/utils", "t5/core/validation"],
   (_, dom, events, utils) ->
 
     rangeValue = (element, attribute, defaultValue) ->
@@ -53,7 +53,7 @@ define ["_", "t5/core/dom", "t5/core/events", "t5/core/utils", "t5/core/validati
     dom.onDocument events.field.optional, "[data-optionality=prohibited]", (event, memo)
->
 
       unless utils.isBlank memo.value
-        memo.error = (this.attribute "data-prohibited-message") or "PROHIBITED"
+        memo.error = (@attribute "data-prohibited-message") or "PROHIBITED"
         return false
 
       return true

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/fe478d68/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/ajax.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/ajax.coffee b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/ajax.coffee
index 12238a0..87ef023 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/ajax.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/ajax.coffee
@@ -20,7 +20,7 @@
 # It wraps (or provides) `success`, `exception`, and `failure` handlers, extended to handle
a partial page render
 # response (for success), or properly log a server-side failure or client-side exception,
including using the
 # `t5/core/exceptionframe` module to display a server-side processing exception.
-define ["./pageinit", "./dom", "./exceptionframe", "./console", "_"],
+define ["./pageinit", "./dom", "./exceptionframe", "./console", "underscore"],
   (pageinit, dom, exceptionframe, console, _) ->
     (url, options) ->
       newOptions = _.extend {}, options,

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/fe478d68/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/ajaxformloop.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/ajaxformloop.coffee
b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/ajaxformloop.coffee
index 830521a..dd54831 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/ajaxformloop.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/ajaxformloop.coffee
@@ -25,7 +25,7 @@ define ["./dom", "./events", "./console", "./ajax", "./builder"],
 
     dom.onDocument "click", "#{AFL_SELECTOR} [data-afl-behavior=remove]", ->
 
-      afl = this.findParent AFL_SELECTOR
+      afl = @findParent AFL_SELECTOR
 
       unless afl
         console.error "Enclosing element for AjaxFormLoop remove row link not found."
@@ -35,12 +35,12 @@ define ["./dom", "./events", "./console", "./ajax", "./builder"],
 
       ajax url,
         parameters:
-          "t:rowvalue": this.attribute "data-afl-row-value"
+          "t:rowvalue": @attribute "data-afl-row-value"
         success: =>
           # The server has removed the row from persistent storage, lets
           # do the same on the UI.
 
-          fragment = this.findParent "[data-container-type='#{FRAGMENT_TYPE}']"
+          fragment = @findParent "[data-container-type='#{FRAGMENT_TYPE}']"
 
           # TODO: Fire some before & after events, to allow for animation.
 
@@ -52,9 +52,9 @@ define ["./dom", "./events", "./console", "./ajax", "./builder"],
 
     dom.onDocument "click", "#{AFL_SELECTOR} [data-afl-behavior=insert-before] [data-afl-trigger=add]",
->
 
-      afl = this.findParent AFL_SELECTOR
+      afl = @findParent AFL_SELECTOR
 
-      insertionPoint = this.findParent "[data-afl-behavior=insert-before]"
+      insertionPoint = @findParent "[data-afl-behavior=insert-before]"
 
       url = afl.attribute "data-inject-row-url"
 

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/fe478d68/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/alert.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/alert.coffee b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/alert.coffee
index 9918442..e4aebe4 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/alert.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/alert.coffee
@@ -16,7 +16,7 @@
 #
 # Support for the core/Alerts components.
 #
-define ["./dom", "./console", "./messages", "./builder", "./ajax", "_"],
+define ["./dom", "./console", "./messages", "./builder", "./ajax", "underscore"],
   (dom, console, messages, builder, ajax, _) ->
 
     severityToClass =

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/fe478d68/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/builder.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/builder.coffee b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/builder.coffee
index b50df36..2f4b735 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/builder.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/builder.coffee
@@ -49,7 +49,7 @@
 # and
 #
 #     { on: { click: -> ... }}
-define ["_", "./dom", "./utils"], (_, dom, utils) ->
+define ["underscore", "./dom", "./utils"], (_, dom, utils) ->
   # _internal_: creates a single DOM element and CSS class attribute
   createElement = (elementDescription) ->
     # TODO: Support #id for setting the id of an element, maybe others, such as ?name for
the name of an input element.

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/fe478d68/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/console.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/console.coffee b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/console.coffee
index d35478a..17724ca 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/console.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/console.coffee
@@ -15,7 +15,7 @@
 # ## t5/core/console
 #
 # A wrapper around the native console, when it exists.
-define ["./dom", "./builder", "_"], (dom, builder, _) ->
+define ["./dom", "./builder", "underscore"], (dom, builder, _) ->
   nativeConsole = {}
   floatingConsole = null
 

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/fe478d68/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/datefield.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/datefield.coffee
b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/datefield.coffee
index 44678d5..4353fae 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/datefield.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/datefield.coffee
@@ -16,7 +16,7 @@
 #
 # Provides support for the `core/DateField` component.
 define ["./dom", "./events", "./messages", "./builder", "./ajax",
-  "_", "./fields"],
+  "underscore", "./fields"],
   (dom, events, messages, builder, ajax, _) ->
 
 

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/fe478d68/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/exception-display.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/exception-display.coffee
b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/exception-display.coffee
index 01ba0a3..2c031f6 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/exception-display.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/exception-display.coffee
@@ -20,7 +20,7 @@ define ["./dom"],
   (dom) ->
 
     dom.onDocument "click", "[data-behavior=stack-trace-filter-toggle]", ->
-      checked = this.element.checked
+      checked = @element.checked
 
       for traceList in dom.body().find "ul.t-stack-trace"
         traceList[if checked then "addClass" else "removeClass"] "t-filtered"

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/fe478d68/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/exceptionframe.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/exceptionframe.coffee
b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/exceptionframe.coffee
index 1993935..f667b15 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/exceptionframe.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/exceptionframe.coffee
@@ -16,7 +16,7 @@
 #
 # Manages a special element used to present a HTML exception report from an Ajax request
(where a non-markup response
 # was expected, including a partial page render response).
-define ["./dom", "./builder", "_"],
+define ["./dom", "./builder", "underscore"],
   (dom, builder, _) ->
     container = null
     iframe = null

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/fe478d68/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/fields.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/fields.coffee b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/fields.coffee
index 3892649..9856914 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/fields.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/fields.coffee
@@ -16,7 +16,7 @@
 #
 # Module for logic relating to form input fields (input, select, textarea); specifically
 # presenting validation errors and perfoming input validation when necessary.
-define ["_", "./events", "./dom", "./builder", "./utils", "./forms"],
+define ["underscore", "./events", "./dom", "./builder", "./utils", "./forms"],
   (_, events, dom, builder, utils) ->
 
     ensureFieldId = (field) ->
@@ -102,15 +102,15 @@ define ["_", "./events", "./dom", "./builder", "./utils", "./forms"],
       # are generally configured so that they do not submit a value to the server
       # when not visible ... this is what the core/FormFragment component is responsible
       # for.
-      return unless this.deepVisible()
+      return unless @deepVisible()
 
       failure = false
 
       fieldValue =
-        if (this.attribute "data-value-mode") is "options"
+        if (@attribute "data-value-mode") is "options"
           collectOptionValues this
         else
-          this.value()
+          @value()
 
       memo = value: fieldValue
 
@@ -121,15 +121,15 @@ define ["_", "./events", "./dom", "./builder", "./utils", "./forms"],
 
           if _.isString memo.error
 
-            this.trigger events.field.showValidationError, { message: memo.error }
+            @trigger events.field.showValidationError, { message: memo.error }
 
-      this.trigger events.field.optional, memo
+      @trigger events.field.optional, memo
 
       postEventTrigger()
 
       unless failure or (utils.isBlank memo.value)
 
-        this.trigger events.field.translate, memo
+        @trigger events.field.translate, memo
 
         postEventTrigger()
 
@@ -137,14 +137,14 @@ define ["_", "./events", "./dom", "./builder", "./utils", "./forms"],
             if _.isUndefined memo.translated
               memo.translated = memo.value
 
-            this.trigger events.field.validate, memo
+            @trigger events.field.validate, memo
 
             postEventTrigger()
 
       if failure
         formMemo.error = true
       else
-        this.trigger events.field.clearValidationError
+        @trigger events.field.clearValidationError
 
       return
 
@@ -154,7 +154,7 @@ define ["_", "./events", "./dom", "./builder", "./utils", "./forms"],
       if block
         block.hide().update("")
 
-      group = this.findParent ".control-group"
+      group = @findParent ".control-group"
 
       group and group.removeClass "error"
 
@@ -168,7 +168,7 @@ define ["_", "./events", "./dom", "./builder", "./utils", "./forms"],
 
       block.show().update(memo.message)
 
-      group = this.findParent ".control-group"
+      group = @findParent ".control-group"
 
       group and group.addClass "error"
 

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/fe478d68/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/form-fragment.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/form-fragment.coffee
b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/form-fragment.coffee
index aae2623..de21428 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/form-fragment.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/form-fragment.coffee
@@ -15,7 +15,7 @@
 
 # ## t5/core/form-fragment
 #
-define ["_", "./dom", "./events", "./forms"],
+define ["underscore", "./dom", "./events", "./forms"],
   (_, dom, events) ->
 
     SELECTOR = "[data-component-type='core/FormFragment']"
@@ -25,7 +25,7 @@ define ["_", "./dom", "./events", "./forms"],
     # to enabled/disable their hidden field.
     dom.onDocument events.form.prepareForSubmit, "form", (event) ->
 
-      fragments = this.find SELECTOR
+      fragments = @find SELECTOR
 
       _.each fragments, (frag) ->
 
@@ -45,7 +45,7 @@ define ["_", "./dom", "./events", "./forms"],
 
         this[if makeVisible then "show" else "hide"]()
 
-        this.trigger events.element[if makeVisible then "didShow" else "didHide"]
+        @trigger events.element[if makeVisible then "didShow" else "didHide"]
 
         return false
 

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/fe478d68/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/forms.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/forms.coffee b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/forms.coffee
index 8c55aaa..7c32fc2 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/forms.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/forms.coffee
@@ -16,7 +16,7 @@
 #
 # Defines handlers for HTML forms and HTML field elements, specifically to control input
validation.
 
-define ["./events", "./dom", "./builder", "_"],
+define ["./events", "./dom", "./builder", "underscore"],
   (events, dom, builder, _) ->
 
     # Meta-data name that indicates the next submission should skip validation (typically,
because
@@ -99,20 +99,20 @@ define ["./events", "./dom", "./builder", "_"],
 
     defaultValidateAndSubmit = ->
 
-      if ((this.attribute "data-validate") is "submit") and
-         (not this.meta SKIP_VALIDATION)
+      if ((@attribute "data-validate") is "submit") and
+         (not @meta SKIP_VALIDATION)
 
-        this.meta SKIP_VALIDATION, null
+        @meta SKIP_VALIDATION, null
 
         memo = error: false
 
-        for field in this.find "[data-validation]"
+        for field in @find "[data-validation]"
           field.trigger events.field.inputValidation, memo
 
         # Only do form validation if all individual field validation
         # was successful.
         unless memo.error
-          this.trigger events.form.validate, memo
+          @trigger events.form.validate, memo
 
         if memo.error
           clearSubmittingHidden this
@@ -123,7 +123,7 @@ define ["./events", "./dom", "./builder", "_"],
       # FormFragment, or similar, to make their hidden field enabled or disabled to match
       # their UI's visible/hidden status. This is assumed to work or throw an exception;
there
       # is no memo.
-      this.trigger events.form.prepareForSubmit
+      @trigger events.form.prepareForSubmit
 
       # Otherwise, the event is good, there are no validation problems, let the normal processing
commence.
       # Possibly, the document event handler provided by the t5/core/zone module will intercept
form submission if this
@@ -136,13 +136,13 @@ define ["./events", "./dom", "./builder", "_"],
     # was responsible for the eventual submit; this is very important to Ajax updates, otherwise
the
     # information about which control triggered the submit gets lost.
     dom.onDocument "click", "input[type=submit], input[type=image]", ->
-      setSubmittingHidden (dom this.element.form), this
+      setSubmittingHidden (dom @element.form), this
       return
 
     # Support for link submits. `data-submit-mode` will be non-null, possibly "cancel".
     # Update the hidden field, but also cancel the default behavior for the click.
     dom.onDocument "click", "a[data-submit-mode]", ->
-      form = this.findParent "form"
+      form = @findParent "form"
 
       unless form
         console.error "Submitting link element not contained inside a form element."

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/fe478d68/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/grid.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/grid.coffee b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/grid.coffee
index d4ac2de..9a4c845 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/grid.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/grid.coffee
@@ -25,13 +25,13 @@ define ["./dom", "./events", "./console"],
 
     dom.onDocument "[data-inplace-grid-links] a", ->
 
-      zone = this.findParent "[data-container-type=zone]"
+      zone = @findParent "[data-container-type=zone]"
 
       unless zone
         console.error "Unable to find containing zone for live update of grid."
         return false
 
-      zone.trigger events.zone.refresh, url: this.attribute "href"
+      zone.trigger events.zone.refresh, url: @attribute "href"
 
       return false
 

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/fe478d68/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/messages.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/messages.coffee
b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/messages.coffee
index b01e3fc..75d170b 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/messages.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/messages.coffee
@@ -33,7 +33,7 @@ do ->
   # In the unexpected case that the data-locale attribute is missing, assume English
   locale = (document.documentElement.getAttribute "data-locale") or "en"
 
-  define ["./messages/#{locale}", "_", "./console"],
+  define ["./messages/#{locale}", "underscore", "./console"],
     (messages, _, console) ->
 
       # Returns the application message catalog message for the given key. Returns

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/fe478d68/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/pageinit.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/pageinit.coffee
b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/pageinit.coffee
index 0f40c24..677458d 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/pageinit.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/pageinit.coffee
@@ -20,7 +20,7 @@
 # The module name may also indicate the function exported by the module, as a suffix following
a colon:
 # e.g., "my/module:myfunc".
 # Any additional values in the initializer are passed to the function. The context of the
function (this) is null.
-define ["_", "./console", "./dom", "./events"],
+define ["underscore", "./console", "./dom", "./events"],
   (_, console, dom, events) ->
     pathPrefix = null
 

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/fe478d68/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/palette.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/palette.coffee b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/palette.coffee
index fbf0722..b03163e 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/palette.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/palette.coffee
@@ -15,7 +15,7 @@
 # ## t5/core/palette
 #
 # Support for the `core/Palette` component.
-define ["./dom", "_"],
+define ["./dom", "underscore"],
   (dom, _) ->
     class PaletteController
 

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/fe478d68/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/select.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/select.coffee b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/select.coffee
index fcbfd09..d35b5e1 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/select.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/select.coffee
@@ -25,6 +25,6 @@ define ["./events", "./dom", "./zone"],
           containingZone = zone.findZone this
 
           containingZone and containingZone.trigger events.zone.refresh,
-            url: this.attribute "data-update-url"
+            url: @attribute "data-update-url"
             parameters:
-              "t:selectvalue": this.value()
+              "t:selectvalue": @value()

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/fe478d68/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/tree.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/tree.coffee b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/tree.coffee
index 2f58f9e..b2df37b 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/tree.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/tree.coffee
@@ -75,13 +75,13 @@ define ["./dom", "./ajax", "./zone"],
 
       # First case is dynamically loaded due to user action; second case
       # is rendered with overall page due to server-side expansion model.
-      loaded = (this.meta LOADED) or (this.hasClass EXPANDED)
+      loaded = (@meta LOADED) or (@hasClass EXPANDED)
 
-      if (not loaded) and (not this.hasClass "t-empty-node")
+      if (not loaded) and (not @hasClass "t-empty-node")
         loadChildren this
         return false
 
-      unless this.hasClass "t-leaf-node"
+      unless @hasClass "t-leaf-node"
         toggle this
         return false
 
@@ -89,15 +89,15 @@ define ["./dom", "./ajax", "./zone"],
 
     toggleSelection = ->
 
-      selected = this.hasClass SELECTED
+      selected = @hasClass SELECTED
 
-      node = this.findParent("li").findFirst("[#{NODE_ID}]")
+      node = @findParent("li").findFirst("[#{NODE_ID}]")
 
       if selected
-        this.removeClass SELECTED
+        @removeClass SELECTED
         send node, "deselect"
       else
-        this.addClass SELECTED
+        @addClass SELECTED
         send node, "select"
 
       return false

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/fe478d68/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/utils.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/utils.coffee b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/utils.coffee
index 5f4ab26..ee2ccd4 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/utils.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/utils.coffee
@@ -15,7 +15,7 @@
 ## t5/core/utils
 #
 # A few handy functions.
-define ["_"], (_) ->
+define ["underscore"], (_) ->
 
   trim = (input) ->
     if String.prototype.trim

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/fe478d68/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/validation.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/validation.coffee
b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/validation.coffee
index 6cf633d..21fd596 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/validation.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/validation.coffee
@@ -16,7 +16,7 @@
 #
 # Support for Tapestry's built-in set of translators and validators.
 #
-define ["_", "./dom", "./events", "./utils", "./messages", "./fields"],
+define ["underscore", "./dom", "./events", "./utils", "./messages", "./fields"],
   (_, dom, events, utils, messages) ->
 
     REGEXP_META = "t5:regular-expression"
@@ -99,7 +99,7 @@ define ["_", "./dom", "./events", "./utils", "./messages", "./fields"],
     dom.onDocument events.field.optional, "[data-optionality=required]", (event, memo) ->
 
       if utils.isBlank memo.value
-        memo.error =  (this.attribute "data-required-message") or "REQUIRED"
+        memo.error =  (@attribute "data-required-message") or "REQUIRED"
 
     dom.onDocument events.field.translate, "[data-translation=numeric]", (event, memo) ->
       translate this, memo, false
@@ -108,43 +108,43 @@ define ["_", "./dom", "./events", "./utils", "./messages", "./fields"],
       translate this, memo, true
 
     dom.onDocument events.field.validate, "[data-validate-min-length]", (event, memo) ->
-      min = parseInt this.attribute "data-validate-min-length"
+      min = parseInt @attribute "data-validate-min-length"
 
       if memo.translated.length < min
-        memo.error = (this.attribute "data-min-length-message") or "TOO SHORT"
+        memo.error = (@attribute "data-min-length-message") or "TOO SHORT"
         return false
 
     dom.onDocument events.field.validate, "[data-validate-max-length]", (event, memo) ->
-      max = parseInt this.attribute "data-validate-max-length"
+      max = parseInt @attribute "data-validate-max-length"
 
       if memo.translated.length > max
-        memo.error = (this.attribute "data-max-length-message") or "TOO LONG"
+        memo.error = (@attribute "data-max-length-message") or "TOO LONG"
         return false
 
     dom.onDocument events.field.validate, "[data-validate-max]", (event, memo) ->
-      max = parseInt this.attribute "data-validate-max"
+      max = parseInt @attribute "data-validate-max"
 
       if memo.translated > max
-        memo.error = (this.attribute "data-max-message") or "TOO LARGE"
+        memo.error = (@attribute "data-max-message") or "TOO LARGE"
         return false
 
     dom.onDocument events.field.validate, "[data-validate-min]", (event, memo) ->
-      min = parseInt this.attribute "data-validate-min"
+      min = parseInt @attribute "data-validate-min"
 
       if memo.translated < min
-        memo.error = (this.attribute "data-min-message") or "TOO SMALL"
+        memo.error = (@attribute "data-min-message") or "TOO SMALL"
         return false
 
     dom.onDocument events.field.validate, "[data-validate-regexp]", (event, memo) ->
 
       # Cache the compiled regular expression.
-      re = this.meta REGEXP_META
+      re = @meta REGEXP_META
       unless re
-        re = new RegExp(this.attribute "data-validate-regexp")
-        this.meta REGEXP_META, re
+        re = new RegExp(@attribute "data-validate-regexp")
+        @meta REGEXP_META, re
 
       unless re.test memo.translated
-        memo.error = (this.attribute "data-regexp-message") or "INVALID"
+        memo.error = (@attribute "data-regexp-message") or "INVALID"
         return false
 
     # Export the number parser, just to be nice (and to support some testing).

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/fe478d68/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/zone.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/zone.coffee b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/zone.coffee
index 088ad6e..32db8f5 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/zone.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/zone.coffee
@@ -22,7 +22,7 @@
 #
 # Most often, a zone is any element with attribute `data-container-type=zone` and corresponds
 # to a core/Zone server-side component.
-define ["./dom", "./events", "./ajax", "./console", "./forms",  "_"],
+define ["./dom", "./events", "./ajax", "./console", "./forms",  "underscore"],
 
   (dom, events, ajax, console, forms, _) ->
 
@@ -54,7 +54,7 @@ define ["./dom", "./events", "./ajax", "./console", "./forms",  "_"],
       zone = findZone this
 
       if zone
-        zone.trigger events.zone.refresh,  url: this.attribute "href"
+        zone.trigger events.zone.refresh,  url: @attribute "href"
 
       return false
 
@@ -66,14 +66,14 @@ define ["./dom", "./events", "./ajax", "./console", "./forms",  "_"],
         formParameters = forms.gatherParameters this
 
         zone.trigger events.zone.refresh,
-          url: (this.attribute "action")
+          url: (@attribute "action")
           parameters: formParameters
 
       return false
 
     dom.onDocument events.zone.update, (event) ->
 
-      this.trigger events.zone.willUpdate
+      @trigger events.zone.willUpdate
 
       content = event.memo.content
 
@@ -84,21 +84,21 @@ define ["./dom", "./events", "./ajax", "./console", "./forms",  "_"],
       # Note that currently, the willUpdate and didUpdate events are triggered even when
the zone is not actually
       # updated. That may be a bug.
       unless content is undefined
-        this.update content
+        @update content
 
-      this.trigger events.zone.didUpdate
+      @trigger events.zone.didUpdate
 
     dom.onDocument events.zone.refresh, (event) ->
 
       # A Zone inside a form will render some additional parameters to coordinate updates
with the Form on the server.
-      attr = this.attribute "data-zone-parameters"
+      attr = @attribute "data-zone-parameters"
 
       parameters = attr and JSON.parse attr
 
       ajax event.memo.url,
-        parameters: _.extend { "t:zoneid": this.element.id }, parameters, event.memo.parameters
+        parameters: _.extend { "t:zoneid": @element.id }, parameters, event.memo.parameters
         success: (response) =>
-          this.trigger events.zone.update, content: response.json?.content
+          @trigger events.zone.update, content: response.json?.content
 
     # Locates a zone element by its unique id attribute, and (deferred, to a later event
loop cycle),
     # performs a standard refresh of the zone. This is primarily used by the core/ProgressiveDisplay
component.

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/fe478d68/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-jquery.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-jquery.coffee
b/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-jquery.coffee
index 5b39305..8c6506f 100644
--- a/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-jquery.coffee
+++ b/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-jquery.coffee
@@ -31,7 +31,7 @@
 # the abstract layer and gain the valuable benefit of not caring about the infrastructure
framework.
 #
 # Changes to this library should be coordinated with the Prototype version.
-define ["_", "./utils", "jquery"], (_, utils, $) ->
+define ["underscore", "./utils", "jquery"], (_, utils, $) ->
 
 
   # Converts content (provided to `ElementWrapper.update()` or `append()`) into an appropriate
type. This

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/fe478d68/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-prototype.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-prototype.coffee
b/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-prototype.coffee
index a1cdc86..42fd8ee 100644
--- a/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-prototype.coffee
+++ b/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-prototype.coffee
@@ -31,7 +31,7 @@
 # the abstract layer and gain the valuable benefit of not caring about the infrastructure
framework.
 #
 # Changes to this library should be coordinated with the jQuery version.
-define ["_", "./utils", "prototype"], (_, utils) ->
+define ["underscore", "./utils", "prototype"], (_, utils) ->
 
   # Save a local reference to Prototype.$ ... see notes about some challenges using Prototype,
jQuery,
   # and RequireJS together, here: https://github.com/jrburke/requirejs/issues/534

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/fe478d68/tapestry-core/src/main/java/org/apache/tapestry5/modules/JavaScriptModule.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/modules/JavaScriptModule.java
b/tapestry-core/src/main/java/org/apache/tapestry5/modules/JavaScriptModule.java
index fd92ecf..526b98f 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/modules/JavaScriptModule.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/modules/JavaScriptModule.java
@@ -236,7 +236,7 @@ public class JavaScriptModule
                                         @Path("${" + SymbolConstants.BOOTSTRAP_ROOT + "}/js/bootstrap.js")
                                         Resource bootstrap)
     {
-        configuration.add("_", new JavaScriptModuleConfiguration(underscore).exports("_"));
+        configuration.add("underscore", new JavaScriptModuleConfiguration(underscore).exports("_"));
         // Hacking around https://github.com/jrburke/requirejs/issues/534
         configuration.add("jquery-library", new JavaScriptModuleConfiguration(jQuery));
         configuration.add("jquery", new JavaScriptModuleConfiguration(jqueryShim));

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/fe478d68/tapestry-core/src/test/coffeescript/org/apache/tapestry5/integration/app1/pages/test-dom.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/coffeescript/org/apache/tapestry5/integration/app1/pages/test-dom.coffee
b/tapestry-core/src/test/coffeescript/org/apache/tapestry5/integration/app1/pages/test-dom.coffee
index 66bb2b0..1bbd4ab 100644
--- a/tapestry-core/src/test/coffeescript/org/apache/tapestry5/integration/app1/pages/test-dom.coffee
+++ b/tapestry-core/src/test/coffeescript/org/apache/tapestry5/integration/app1/pages/test-dom.coffee
@@ -51,7 +51,7 @@ require ["t5/core/dom"], (dom) ->
 
     container.on "x:click", "a.btn-primary", ->
 
-      strictEqual this.element, primary.element, "this should be the wrapper for element
that was matched"
+      strictEqual @element, primary.element, "this should be the wrapper for element that
was matched"
 
       return false
 

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/fe478d68/tapestry-core/src/test/coffeescript/org/apache/tapestry5/integration/app1/pages/test-messages.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/coffeescript/org/apache/tapestry5/integration/app1/pages/test-messages.coffee
b/tapestry-core/src/test/coffeescript/org/apache/tapestry5/integration/app1/pages/test-messages.coffee
index 2f62d1b..213f541 100644
--- a/tapestry-core/src/test/coffeescript/org/apache/tapestry5/integration/app1/pages/test-messages.coffee
+++ b/tapestry-core/src/test/coffeescript/org/apache/tapestry5/integration/app1/pages/test-messages.coffee
@@ -1,4 +1,4 @@
-require ["t5/core/messages", "_"], (messages, _) ->
+require ["t5/core/messages", "underscore"], (messages, _) ->
 
   module "t5/core/messages"
 


Mime
View raw message