You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2012/10/19 02:53:36 UTC
[2/8] git commit: Continue simplifying the dependencies involved in
page initialization Tweak the client-side console output listing loaded
libraries
Continue simplifying the dependencies involved in page initialization
Tweak the client-side console output listing loaded libraries
Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/764a6498
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/764a6498
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/764a6498
Branch: refs/heads/5.4-js-rewrite
Commit: 764a649807639fbef8823553348b2ffaabc6b8a1
Parents: 294e358
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Thu Oct 18 15:59:43 2012 -0700
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Thu Oct 18 15:59:43 2012 -0700
----------------------------------------------------------------------
.../META-INF/modules/core/pageinit.coffee | 36 +++++++--------
1 files changed, 16 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/764a6498/tapestry-core/src/main/coffeescript/META-INF/modules/core/pageinit.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/core/pageinit.coffee b/tapestry-core/src/main/coffeescript/META-INF/modules/core/pageinit.coffee
index e84e81f..fcacb9e 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/core/pageinit.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/core/pageinit.coffee
@@ -142,17 +142,16 @@ define ["_", "core/console", "core/spi", "core/events"],
loadLibrariesAndInitialize: (coreLibraries, libraries, immediateInits, otherInits) ->
exports.loadLibraries coreLibraries, ->
require ["core/compat/t5-forceload"], ->
- console.debug "Core libraries loaded."
+ console.debug "#{coreLibraries.length} core libraries loaded"
exports.loadLibraries libraries, ->
- console.debug "Additional libraries loaded." if libraries?.length > 0
+ console.debug "#{libraries?.length or 0} additional libraries loaded"
exports.initialize immediateInits
spi.domReady -> exports.initialize otherInits
evalJavaScript: (js) ->
- require ["core/compat/tapestry"], ->
- console.debug "Evaluating: #{js}"
- eval js
+ console.debug "Evaluating: #{js}"
+ eval js
# Passed the response from an Ajax request, when the request is successful.
# This is used for any request that attaches partial-page-render data to the main JSON object
@@ -180,25 +179,22 @@ define ["_", "core/console", "core/spi", "core/events"],
addStylesheets partial?.stylesheets
- # Temporary ugliness: ensuring Tapestry is available since we, for the moment,
- # make use of some of it.
- require ["core/compat/tapestry"], ->
- # Make sure all libraries are loaded
- exports.loadLibraries partial?.libraries, ->
+ # Make sure all libraries are loaded
+ exports.loadLibraries partial?.libraries, ->
- # After libraries are loaded, update each zone:
- _(partial?.content).each ([id, content]) ->
- console.debug "Updating content for zone #{id}"
+ # After libraries are loaded, update each zone:
+ _(partial?.content).each ([id, content]) ->
+ console.debug "Updating content for zone #{id}"
- zone = spi.wrap id
+ zone = spi.wrap id
- if zone
- zone.trigger events.zone.update, content
+ if zone
+ zone.trigger events.zone.update, content
- # Invoke the callback, if present. The callback may do its own content updates.
- callback and callback(response)
+ # Invoke the callback, if present. The callback may do its own content updates.
+ callback and callback(response)
- # Lastly, perform initializations from the partial page render response.
- exports.initialize partial?.inits
+ # Lastly, perform initializations from the partial page render response.
+ exports.initialize partial?.inits
return