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/12/16 02:17:33 UTC
[36/50] git commit: Change inline script block to external JavaScript
library
Change inline script block to external JavaScript library
Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/cf79e248
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/cf79e248
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/cf79e248
Branch: refs/heads/master
Commit: cf79e2485b5e6a9e298cf526fe9f4264eda46608
Parents: 9cbc924
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Wed Dec 5 09:00:19 2012 -0800
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Wed Dec 5 09:00:19 2012 -0800
----------------------------------------------------------------------
.../src/test/app1/ExpressionInJsFunction.tml | 13 +------------
.../integration/app1/CoreBehaviorsTests.java | 2 ++
.../app1/pages/ExpressionInJsFunction.java | 6 +++---
.../META-INF/assets/ExpressionInJsFunction.js | 7 +++++++
4 files changed, 13 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/cf79e248/tapestry-core/src/test/app1/ExpressionInJsFunction.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/app1/ExpressionInJsFunction.tml b/tapestry-core/src/test/app1/ExpressionInJsFunction.tml
index 233b218..f3b2415 100644
--- a/tapestry-core/src/test/app1/ExpressionInJsFunction.tml
+++ b/tapestry-core/src/test/app1/ExpressionInJsFunction.tml
@@ -1,15 +1,4 @@
-<html t:type="border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd" xmlns:p="tapestry:parameter">
-
-<script>
- function test_func() {
- $('target').setValue(${'"test1"'});
- };
-
- function test_func_with_map() {
- $('target').setValue('${{'key':'test2'}}');
- };
-
-</script>
+<html t:type="border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter">
<h1>Expansions within a JS function</h1>
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/cf79e248/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java
index cc076fa..7d4bcea 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java
@@ -141,6 +141,8 @@ public class CoreBehaviorsTests extends TapestryCoreTestCase
{
openLinks("Expressions in JS Functions Demo");
+ waitForPageLoaded();
+
click("button1");
waitForCondition("selenium.getValue('target') == 'test1'", PAGE_LOAD_TIMEOUT);
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/cf79e248/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ExpressionInJsFunction.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ExpressionInJsFunction.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ExpressionInJsFunction.java
index 8f76087..92996c3 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ExpressionInJsFunction.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ExpressionInJsFunction.java
@@ -1,4 +1,4 @@
-// Copyright 2011 The Apache Software Foundation
+// Copyright 2011, 2012 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.
@@ -13,12 +13,12 @@
// limitations under the License.
package org.apache.tapestry5.integration.app1.pages;
-import java.util.Iterator;
-import java.util.Map;
+import org.apache.tapestry5.annotations.Import;
/**
* Demonstrates the use of expressions within a javascript function. See TAP5-1620
*/
+@Import(stack = "core", library = "ExpressionInJsFunction.js")
public class ExpressionInJsFunction
{
}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/cf79e248/tapestry-core/src/test/resources/META-INF/assets/ExpressionInJsFunction.js
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/resources/META-INF/assets/ExpressionInJsFunction.js b/tapestry-core/src/test/resources/META-INF/assets/ExpressionInJsFunction.js
new file mode 100644
index 0000000..da27472
--- /dev/null
+++ b/tapestry-core/src/test/resources/META-INF/assets/ExpressionInJsFunction.js
@@ -0,0 +1,7 @@
+function test_func() {
+ $('target').setValue("test1");
+}
+
+function test_func_with_map() {
+ $('target').setValue("{key=test2}");
+}