Demonstrate how the console's DURATION can be modified

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

Branch: refs/heads/5.4-js-rewrite
Commit: ec0e3167cc17bae273526a83ff6162ce85f60a65
Parents: db60af7
Author: Howard M. Lewis Ship <[email protected]>
Authored: Thu Jun 28 17:51:47 2012 -0700
Committer: Howard M. Lewis Ship <[email protected]>
Committed: Thu Jun 28 17:51:47 2012 -0700

----------------------------------------------------------------------
 .../tapestry5/corelib/modulejs/console.coffee      |    2 ++
 .../tapestry5/integration/app1/modulejs/alert.js   |    3 +++
 2 files changed, 5 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/ec0e3167/tapestry-core/src/main/coffeescript/org/apache/tapestry5/corelib/modulejs/console.coffee
----------------------------------------------------------------------
diff --git 
a/tapestry-core/src/main/coffeescript/org/apache/tapestry5/corelib/modulejs/console.coffee
 
b/tapestry-core/src/main/coffeescript/org/apache/tapestry5/corelib/modulejs/console.coffee
index fae394d..a845620 100644
--- 
a/tapestry-core/src/main/coffeescript/org/apache/tapestry5/corelib/modulejs/console.coffee
+++ 
b/tapestry-core/src/main/coffeescript/org/apache/tapestry5/corelib/modulejs/console.coffee
@@ -16,6 +16,8 @@ define ->
   nativeConsole = {}
   floatingConsole = null
 
+  # module exports are mutable; someone else could
+  # require this module to change the default DURATION
   exports =
     DURATION : 10 # seconds
 

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/ec0e3167/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/modulejs/alert.js
----------------------------------------------------------------------
diff --git 
a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/modulejs/alert.js
 
b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/modulejs/alert.js
index 487fabc..9885d65 100644
--- 
a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/modulejs/alert.js
+++ 
b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/modulejs/alert.js
@@ -1,4 +1,7 @@
 define(["core/console"], function (cc) {
+
+    cc.DURATION = 30
+
     return {
         alert: function (message) {
             cc.info("app/alert (module): " + message);

Reply via email to