public CoffeeScriptCompiler(@Path("classpath:org/apache/tapestry5/webresources/internal/coffee-script.js") Resource mainCompiler, @Path("classpath:org/apache/tapestry5/webresources/internal/invoke-coffeescript.js") Resource shim, OperationTracker tracker) { executorPool = new RhinoExecutorPool(tracker, toList(mainCompiler, shim)); }
public CoffeeScriptCompiler(@Path("classpath:org/apache/tapestry5/webresources/internal/coffee-script.js") Resource mainCompiler, @Path("classpath:org/apache/tapestry5/webresources/internal/invoke-coffeescript.js") Resource shim, OperationTracker tracker) { executorPool = new RhinoExecutorPool(tracker, toList(mainCompiler, shim)); }
public TypeScriptCompiler(final OperationTracker tracker, @Path("classpath:org/apache/tapestry5/webresources/internal/typescript.js") final Resource typescript) { this.executorPool = new RhinoExecutorPool(tracker, Arrays.<Resource> asList(typescript, new ClasspathResource("org/apache/tapestry5/webresources/internal/invoke-typescript.js"))); }
public class TestPageForAsset { @Inject @Path("context:css/test.css") private Asset asset; public String getStylePath() { return asset.toClientURL(); } }
public class MissingAssetDemo { @Inject @Path("does-not-exist.txt") private Asset missing; }
@Contribute(ModuleManager.class) public static void setupFoundationFramework(MappedConfiguration<String, Object> configuration, @Symbol(SymbolConstants.JAVASCRIPT_INFRASTRUCTURE_PROVIDER) String provider, @Path("classpath:org/apache/tapestry5/t5-core-dom-prototype.js") Resource domPrototype, @Path("classpath:org/apache/tapestry5/t5-core-dom-jquery.js") Resource domJQuery) { if (provider.equals("prototype")) { configuration.add("t5/core/dom", new JavaScriptModuleConfiguration(domPrototype)); } if (provider.equals("jquery")) { configuration.add("t5/core/dom", new JavaScriptModuleConfiguration(domJQuery)); } // If someone wants to support a different infrastructure, they should set the provider symbol to some other value // and contribute their own version of the t5/core/dom module. }
@Contribute(ModuleManager.class) public static void setupComponentsShims( MappedConfiguration<String, Object> configuration, @Inject @Path("/META-INF/modules/tjq/datefield.js") Resource datefield, @Inject @Path("${jquery.assets.root}/vendor/jquery.mousewheel.js") Resource jquerymousewheel, @Symbol(JQuerySymbolConstants.ADD_MOUSEWHEEL_EVENT) boolean mouseWheelIncluded) { configuration.add("t5/core/datefield", new JavaScriptModuleConfiguration(datefield)); if (mouseWheelIncluded) configuration.add("vendor/jquerymousewheel", new JavaScriptModuleConfiguration(jquerymousewheel) .dependsOn("jquery")); }
@Contribute(ModuleManager.class) public static void setupBaseModules(MappedConfiguration<String, Object> configuration, @Path("${tapestry.asset.root}/underscore-shim.js") Resource underscoreShim, @Path("${tapestry.asset.root}/jquery-shim.js") Resource jqueryShim, @Path("${tapestry.asset.root}/typeahead.js") Resource typeahead, @Path("${tapestry.asset.root}/moment-2.15.1.js") Resource moment, @Path("${" + SymbolConstants.BOOTSTRAP_ROOT + "}/js/transition.js") Resource transition) { // The underscore shim module allows Underscore to be injected configuration.add("underscore", new JavaScriptModuleConfiguration(underscoreShim)); configuration.add("jquery", new JavaScriptModuleConfiguration(jqueryShim)); configuration.add("bootstrap/transition", new AMDWrapper(transition).require("jquery", "$").asJavaScriptModuleConfiguration()); for (String name : new String[]{"affix", "alert", "button", "carousel", "collapse", "dropdown", "modal", "scrollspy", "tab", "tooltip"}) { Resource lib = transition.forFile(name + ".js"); configuration.add("bootstrap/" + name, new AMDWrapper(lib).require("bootstrap/transition").asJavaScriptModuleConfiguration()); } Resource popover = transition.forFile("popover.js"); configuration.add("bootstrap/popover", new AMDWrapper(popover).require("bootstrap/tooltip").asJavaScriptModuleConfiguration()); configuration.add("t5/core/typeahead", new JavaScriptModuleConfiguration(typeahead).dependsOn("jquery")); configuration.add("moment", new JavaScriptModuleConfiguration(moment)); }
@Path("${jquery.assets.root}/vendor/components/superfish/css/superfish-vertical.css") private Asset verticalAsset; @Path("${jquery.assets.root}/vendor/components/superfish/css/superfish-navbar.css") private Asset navBarAsset; @Path("${jquery.assets.root}/vendor/components/superfish/css/superfish.css") private Asset mainAsset;
@Path("context:images/tapestry_banner.gif") private Asset icon; @Path("tapestry-button.png") private Asset button; @Path("AssetDemo.properties") private Asset properties; @Path("context:css/ie-only.css") private Asset ieOnly; @Path("http://${d3.url}") private Asset httpAsset; @Path("https://${d3.url}") private Asset httpsAsset; @Path("//${d3.url}") private Asset protocolRelativeAsset; @Path("ftp://${d3.url}") private Asset ftpAsset; @Path("tapestry.png") private Asset logo;
@Path("${tapestry.asset.root}/ajax-loader.gif") private Asset spacerImage;