Author: hlship
Date: Tue Dec 30 10:17:01 2008
New Revision: 730206
URL: http://svn.apache.org/viewvc?rev=730206&view=rev
Log:
TAP5-407: DocumentLinker should not use the deprecated practice of HTML
commenting out the <script> block
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/DocumentLinkerImpl.java
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/add_script.txt
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/add_script_in_development_mode.txt
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/add_script_links.txt
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/add_script_links_at_top.txt
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/duplicate_script_links_ignored.txt
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/empty_document_with_scripts_at_bottom.txt
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/empty_document_with_scripts_at_top.txt
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/no_body_element.txt
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/script_written_raw.txt
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/DocumentLinkerImpl.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/DocumentLinkerImpl.java?rev=730206&r1=730205&r2=730206&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/DocumentLinkerImpl.java
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/DocumentLinkerImpl.java
Tue Dec 30 10:17:01 2008
@@ -132,9 +132,7 @@
if (blockNeeded)
{
- Element e = body.element("script", "type", "text/javascript");
- e.raw("\n<!--\n");
-
+ Element e = body.element("script");
if (developmentMode)
e.raw("Tapestry.DEBUG_ENABLED = true;\n");
@@ -143,8 +141,6 @@
e.raw(scriptBlock.toString());
e.raw("});\n");
-
- e.raw("// -->\n");
}
}
@@ -159,8 +155,7 @@
{
for (String scriptURL : scripts)
container.element("script",
- "src", scriptURL,
- "type", "text/javascript");
+ "src", scriptURL);
}
/**
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/add_script.txt
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/add_script.txt?rev=730206&r1=730205&r2=730206&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/add_script.txt
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/add_script.txt
Tue Dec 30 10:17:01 2008
@@ -1,8 +1,5 @@
-<html><body><p>Ready to be updated with scripts.</p><script
type="text/javascript">
-<!--
-Tapestry.onDOMLoaded(function() {
+<html><body><p>Ready to be updated with
scripts.</p><script>Tapestry.onDOMLoaded(function() {
doSomething();
doSomethingElse();
});
-// -->
</script></body></html>
\ No newline at end of file
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/add_script_in_development_mode.txt
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/add_script_in_development_mode.txt?rev=730206&r1=730205&r2=730206&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/add_script_in_development_mode.txt
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/add_script_in_development_mode.txt
Tue Dec 30 10:17:01 2008
@@ -1,7 +1,4 @@
-<html><body><p>Ready to be updated with scripts.</p><script src="foo.js"
type="text/javascript"></script><script type="text/javascript">
-<!--
-Tapestry.DEBUG_ENABLED = true;
+<html><body><p>Ready to be updated with scripts.</p><script
src="foo.js"></script><script>Tapestry.DEBUG_ENABLED = true;
Tapestry.onDOMLoaded(function() {
});
-// -->
</script></body></html>
\ No newline at end of file
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/add_script_links.txt
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/add_script_links.txt?rev=730206&r1=730205&r2=730206&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/add_script_links.txt
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/add_script_links.txt
Tue Dec 30 10:17:01 2008
@@ -1,8 +1,5 @@
<?xml version="1.0"?>
-<html><body><p>Ready to be updated with scripts.</p><script src="foo.js"
type="text/javascript"/><script src="bar/baz.js"
type="text/javascript"/><script type="text/javascript">
-<!--
-Tapestry.onDOMLoaded(function() {
+<html><body><p>Ready to be updated with scripts.</p><script
src="foo.js"/><script src="bar/baz.js"/><script>Tapestry.onDOMLoaded(function()
{
pageInitialization();
});
-// -->
</script></body></html>
\ No newline at end of file
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/add_script_links_at_top.txt
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/add_script_links_at_top.txt?rev=730206&r1=730205&r2=730206&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/add_script_links_at_top.txt
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/add_script_links_at_top.txt
Tue Dec 30 10:17:01 2008
@@ -1,8 +1,5 @@
<?xml version="1.0"?>
-<html><head><script src="foo.js" type="text/javascript"/><script
src="bar/baz.js" type="text/javascript"/></head><body><p>Ready to be updated
with scripts at top.</p><script type="text/javascript">
-<!--
-Tapestry.onDOMLoaded(function() {
+<html><head><script src="foo.js"/><script
src="bar/baz.js"/></head><body><p>Ready to be updated with scripts at
top.</p><script>Tapestry.onDOMLoaded(function() {
pageInitialization();
});
-// -->
</script></body></html>
\ No newline at end of file
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/duplicate_script_links_ignored.txt
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/duplicate_script_links_ignored.txt?rev=730206&r1=730205&r2=730206&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/duplicate_script_links_ignored.txt
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/duplicate_script_links_ignored.txt
Tue Dec 30 10:17:01 2008
@@ -1 +1 @@
-<html><body><p>Ready to be updated with scripts.</p><script src="foo.js"
type="text/javascript"></script><script src="bar/baz.js"
type="text/javascript"></script><script src="biff.js"
type="text/javascript"></script></body></html>
\ No newline at end of file
+<html><body><p>Ready to be updated with scripts.</p><script
src="foo.js"></script><script src="bar/baz.js"></script><script
src="biff.js"></script></body></html>
\ No newline at end of file
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/empty_document_with_scripts_at_bottom.txt
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/empty_document_with_scripts_at_bottom.txt?rev=730206&r1=730205&r2=730206&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/empty_document_with_scripts_at_bottom.txt
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/empty_document_with_scripts_at_bottom.txt
Tue Dec 30 10:17:01 2008
@@ -1,8 +1,5 @@
<?xml version="1.0"?>
-<html><head><link href="style.css" media="print" rel="stylesheet"
type="text/css"/></head><body><script src="foo.js"
type="text/javascript"/><script src="bar/baz.js"
type="text/javascript"/><script type="text/javascript">
-<!--
-Tapestry.onDOMLoaded(function() {
+<html><head><link href="style.css" media="print" rel="stylesheet"
type="text/css"/></head><body><script src="foo.js"/><script
src="bar/baz.js"/><script>Tapestry.onDOMLoaded(function() {
pageInitialization();
});
-// -->
</script></body></html>
\ No newline at end of file
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/empty_document_with_scripts_at_top.txt
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/empty_document_with_scripts_at_top.txt?rev=730206&r1=730205&r2=730206&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/empty_document_with_scripts_at_top.txt
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/empty_document_with_scripts_at_top.txt
Tue Dec 30 10:17:01 2008
@@ -1,8 +1,5 @@
<?xml version="1.0"?>
-<html><head><link href="style.css" media="print" rel="stylesheet"
type="text/css"/><script src="foo.js" type="text/javascript"/><script
src="bar/baz.js" type="text/javascript"/></head><body><script
type="text/javascript">
-<!--
-Tapestry.onDOMLoaded(function() {
+<html><head><link href="style.css" media="print" rel="stylesheet"
type="text/css"/><script src="foo.js"/><script
src="bar/baz.js"/></head><body><script>Tapestry.onDOMLoaded(function() {
pageInitialization();
});
-// -->
</script></body></html>
\ No newline at end of file
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/no_body_element.txt
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/no_body_element.txt?rev=730206&r1=730205&r2=730206&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/no_body_element.txt
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/no_body_element.txt
Tue Dec 30 10:17:01 2008
@@ -1,2 +1,2 @@
<?xml version="1.0"?>
-<html><notbody><p>Ready to be updated with scripts.</p></notbody><body><script
src="foo.js" type="text/javascript"/></body></html>
\ No newline at end of file
+<html><notbody><p>Ready to be updated with scripts.</p></notbody><body><script
src="foo.js"/></body></html>
\ No newline at end of file
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/script_written_raw.txt
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/script_written_raw.txt?rev=730206&r1=730205&r2=730206&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/script_written_raw.txt
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/script_written_raw.txt
Tue Dec 30 10:17:01 2008
@@ -1,7 +1,4 @@
-<html><body><p>Ready to be updated with scripts.</p><script
type="text/javascript">
-<!--
-Tapestry.onDOMLoaded(function() {
+<html><body><p>Ready to be updated with
scripts.</p><script>Tapestry.onDOMLoaded(function() {
for (var i = 0; i < 5; i++) { doIt(i); }
});
-// -->
</script></body></html>
\ No newline at end of file