tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject git commit: Only contribute the Scriptaculous libraries to the core stack if the JavaScript infrastructure is "prototype"
Date Thu, 03 Jan 2013 21:31:19 GMT
Updated Branches:
  refs/heads/master a12ef646b -> 49add0950


Only contribute the Scriptaculous libraries to the core stack if the JavaScript infrastructure
is "prototype"


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

Branch: refs/heads/master
Commit: 49add0950035726496affd291f7bd7fdfe6ec7b8
Parents: a12ef64
Author: Howard M. Lewis Ship <hlship@apache.org>
Authored: Thu Jan 3 13:31:15 2013 -0800
Committer: Howard M. Lewis Ship <hlship@apache.org>
Committed: Thu Jan 3 13:31:15 2013 -0800

----------------------------------------------------------------------
 .../tapestry5/services/compatibility/Trait.java    |    6 ++-
 .../services/javascript/JavaScriptModule.java      |   24 +++++++-------
 2 files changed, 16 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/49add095/tapestry-core/src/main/java/org/apache/tapestry5/services/compatibility/Trait.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/services/compatibility/Trait.java
b/tapestry-core/src/main/java/org/apache/tapestry5/services/compatibility/Trait.java
index 1d8b56b..00023fb 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/services/compatibility/Trait.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/services/compatibility/Trait.java
@@ -1,4 +1,4 @@
-// Copyright 2012 The Apache Software Foundation
+// Copyright 2012, 2013 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -23,7 +23,9 @@ public enum Trait
     /**
      * Indicates that the Scriptaculous JavaScript libraries should be included.  Tapestry
5.3 includes options for performing
      * some kinds of animations when certain elements were updated or removed; that is no
longer present in Tapestry 5.4
-     * and Scriptaculous is not used.
+     * and Scriptaculous is not used. This trait is only used if the
+     * {@linkplain org.apache.tapestry5.SymbolConstants#JAVASCRIPT_INFRASTRUCTURE_PROVIDER
JavaScript infrastructure provider}
+     * is set to "prototype".
      */
     SCRIPTACULOUS,
 

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/49add095/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/JavaScriptModule.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/JavaScriptModule.java
b/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/JavaScriptModule.java
index e93e9f4..5fb1fbe 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/JavaScriptModule.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/JavaScriptModule.java
@@ -28,7 +28,6 @@ import org.apache.tapestry5.ioc.OrderedConfiguration;
 import org.apache.tapestry5.ioc.Resource;
 import org.apache.tapestry5.ioc.ServiceBinder;
 import org.apache.tapestry5.ioc.annotations.Contribute;
-import org.apache.tapestry5.ioc.annotations.Inject;
 import org.apache.tapestry5.ioc.annotations.Symbol;
 import org.apache.tapestry5.ioc.services.FactoryDefaults;
 import org.apache.tapestry5.ioc.services.SymbolProvider;
@@ -79,13 +78,14 @@ public class JavaScriptModule
 
     @Contribute(JavaScriptStack.class)
     @Core
-    public static void setupCoreJavaScriptStack(OrderedConfiguration<StackExtension>
configuration, Compatibility compatibility)
+    public static void setupCoreJavaScriptStack(OrderedConfiguration<StackExtension>
configuration, Compatibility compatibility, @Symbol(SymbolConstants.JAVASCRIPT_INFRASTRUCTURE_PROVIDER)
String provider)
     {
         final String ROOT = "${tapestry.asset.root}";
 
-        if (compatibility.enabled(Trait.SCRIPTACULOUS))
+        if (provider.equals("prototype") && compatibility.enabled(Trait.SCRIPTACULOUS))
         {
-            add(configuration, StackExtensionType.LIBRARY, "${tapestry.scriptaculous}/scriptaculous.js",
+            add(configuration, StackExtensionType.LIBRARY,
+                    "${tapestry.scriptaculous}/scriptaculous.js",
                     "${tapestry.scriptaculous}/effects.js");
         }
 
@@ -219,19 +219,19 @@ public class JavaScriptModule
 
     @Contribute(ModuleManager.class)
     public static void setupBaseModules(MappedConfiguration<String, Object> configuration,
-                                        @Inject @Path("${tapestry.asset.root}/underscore_1_4_2.js")
+                                        @Path("${tapestry.asset.root}/underscore_1_4_2.js")
                                         Resource underscore,
 
-                                        @Inject @Path("${tapestry.asset.root}/jquery-shim.js")
+                                        @Path("${tapestry.asset.root}/jquery-shim.js")
                                         Resource jqueryShim,
 
-                                        @Inject @Path("${tapestry.scriptaculous}/prototype.js")
+                                        @Path("${tapestry.scriptaculous}/prototype.js")
                                         Resource prototype,
 
-                                        @Inject @Path("${tapestry.asset.root}/jquery-1.8.3.js")
+                                        @Path("${tapestry.asset.root}/jquery-1.8.3.js")
                                         Resource jQuery,
 
-                                        @Inject @Path("${" + SymbolConstants.BOOTSTRAP_ROOT
+ "}/js/bootstrap.js")
+                                        @Path("${" + SymbolConstants.BOOTSTRAP_ROOT + "}/js/bootstrap.js")
                                         Resource bootstrap)
     {
         configuration.add("_", new JavaScriptModuleConfiguration(underscore).exports("_"));
@@ -251,11 +251,11 @@ public class JavaScriptModule
 
     @Contribute(ModuleManager.class)
     public static void setupFoundationFramework(MappedConfiguration<String, Object>
configuration,
-                                                @Inject @Symbol(SymbolConstants.JAVASCRIPT_INFRASTRUCTURE_PROVIDER)
+                                                @Symbol(SymbolConstants.JAVASCRIPT_INFRASTRUCTURE_PROVIDER)
                                                 String provider,
-                                                @Inject @Path("classpath:org/apache/tapestry5/t5-core-dom-prototype.js")
+                                                @Path("classpath:org/apache/tapestry5/t5-core-dom-prototype.js")
                                                 Resource domPrototype,
-                                                @Inject @Path("classpath:org/apache/tapestry5/t5-core-dom-jquery.js")
+                                                @Path("classpath:org/apache/tapestry5/t5-core-dom-jquery.js")
                                                 Resource domJQuery)
     {
         if (provider.equals("prototype"))


Mime
View raw message