You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2014/12/29 23:37:28 UTC

[1/2] tapestry-5 git commit: Remove "t-" prefix from CSS style "t-ajax-insertion-point"

Repository: tapestry-5
Updated Branches:
  refs/heads/master e71688962 -> ffeaabc04


Remove "t-" prefix from CSS style "t-ajax-insertion-point"


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

Branch: refs/heads/master
Commit: 9769b0db2f44afc41923f67f087dc50383743504
Parents: e716889
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Mon Dec 29 14:06:41 2014 -0800
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Mon Dec 29 14:06:41 2014 -0800

----------------------------------------------------------------------
 .../src/main/coffeescript/META-INF/modules/t5/core/pageinit.coffee | 2 +-
 .../org/apache/tapestry5/services/javascript/StylesheetLink.java   | 2 +-
 .../apache/tapestry5/services/javascript/StylesheetOptions.java    | 2 +-
 .../tapestry5/internal/services/DocumentLinkerImplTest.groovy      | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/9769b0db/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/pageinit.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/pageinit.coffee b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/pageinit.coffee
index 18e95ff..149d9ea 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/pageinit.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/pageinit.coffee
@@ -54,7 +54,7 @@ define ["underscore", "./console", "./dom", "./events"],
 
       insertionPoint = _.find(document.styleSheets, (ss) ->
         parent = ss.ownerNode || ss.owningElement
-        parent.rel is "stylesheet t-ajax-insertion-point")
+        parent.rel is "stylesheet ajax-insertion-point")
 
       # Most browsers support document.head, but older IE doesn't:
       head = document.head or document.getElementsByTagName("head")[0]

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/9769b0db/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/StylesheetLink.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/StylesheetLink.java b/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/StylesheetLink.java
index d45ba1f..ae98fbb 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/StylesheetLink.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/StylesheetLink.java
@@ -100,7 +100,7 @@ public final class StylesheetLink
             container.raw(String.format("\n<!--[if %s]>\n", options.condition));
         }
 
-        String rel = options.ajaxInsertionPoint ? "stylesheet t-ajax-insertion-point" : "stylesheet";
+        String rel = options.ajaxInsertionPoint ? "stylesheet ajax-insertion-point" : "stylesheet";
 
         container.element("link",
                 "href", getURL(),

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/9769b0db/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/StylesheetOptions.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/StylesheetOptions.java b/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/StylesheetOptions.java
index f03140f..ae1edd0 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/StylesheetOptions.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/StylesheetOptions.java
@@ -42,7 +42,7 @@ public final class StylesheetOptions
     /**
      * If true, then this stylesheet is the insertion point for Ajax operations; any added CSS links will be inserted before this link. Only at most
      * one CSS link should be the insertion point.     Only used for full page renders (not partial page renders). When this is true, the {@code <link>} element's
-     * ref attribute is wrtten out as "stylesheet t-ajax-insertion-point".
+     * ref attribute is wrtten out as "stylesheet ajax-insertion-point".
      */
     public boolean ajaxInsertionPoint;
 

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/9769b0db/tapestry-core/src/test/groovy/org/apache/tapestry5/internal/services/DocumentLinkerImplTest.groovy
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/groovy/org/apache/tapestry5/internal/services/DocumentLinkerImplTest.groovy b/tapestry-core/src/test/groovy/org/apache/tapestry5/internal/services/DocumentLinkerImplTest.groovy
index b1a335f..11c1b4e 100644
--- a/tapestry-core/src/test/groovy/org/apache/tapestry5/internal/services/DocumentLinkerImplTest.groovy
+++ b/tapestry-core/src/test/groovy/org/apache/tapestry5/internal/services/DocumentLinkerImplTest.groovy
@@ -303,7 +303,7 @@ class DocumentLinkerImplTest extends InternalBaseTestCase {
         linker.updateDocument(document)
 
         check document, '''
-<html><head><link type="text/css" rel="stylesheet" href="whatever.css"/><link type="text/css" rel="stylesheet t-ajax-insertion-point" href="insertion-point.css"/></head><body data-page-initialized="true"></body></html>
+<html><head><link type="text/css" rel="stylesheet" href="whatever.css"/><link type="text/css" rel="stylesheet ajax-insertion-point" href="insertion-point.css"/></head><body data-page-initialized="true"></body></html>
 '''
     }
 


[2/2] tapestry-5 git commit: Some further changes to address IE8 compatibility

Posted by hl...@apache.org.
Some further changes to address IE8 compatibility


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

Branch: refs/heads/master
Commit: ffeaabc0413a5c8e9fa4a17e7fe8058d2903d240
Parents: 9769b0d
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Mon Dec 29 14:12:52 2014 -0800
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Mon Dec 29 14:12:52 2014 -0800

----------------------------------------------------------------------
 .../META-INF/modules/t5/core/console.coffee     | 37 ++++++++++----------
 1 file changed, 19 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/ffeaabc0/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/console.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/console.coffee b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/console.coffee
index ab7ccc2..b0785ca 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/console.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/console.coffee
@@ -1,5 +1,3 @@
-# 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.
 # You may obtain a copy of the License at
@@ -18,7 +16,14 @@
 define ["./dom", "underscore", "./bootstrap"],
   (dom, _, { glyph }) ->
 
-    nativeConsole = {}
+    nativeConsole = null
+
+    try
+      # FireFox will throw an exception if you even access the console object and it does
+      # not exist. Wow!
+      nativeConsole = window.console or {}
+    catch e
+
     floatingConsole = null
     messages = null
 
@@ -53,13 +58,6 @@ define ["./dom", "underscore", "./bootstrap"],
         </button>
       """
 
-
-    try
-      # FireFox will throw an exception if you even access the console object and it does
-      # not exist. Wow!
-      nativeConsole = console
-    catch e
-
     # _internal_: displays the message inside the floating console, creating the floating
     # console as needed.
     display = (className, message) ->
@@ -153,17 +151,17 @@ define ["./dom", "underscore", "./bootstrap"],
 
           return unless forceFloating
 
-        if _.isFunction consolefn
+        if window.console and (_.isFunction consolefn)
           # Use the available native console, calling it like an instance method
-          consolefn.call console, message
+          consolefn.call window.console, message
           return
 
-        # On IE8, the console object appears empty unless debugging tools are enabled.
-        return unless consolefn
-
         # And IE just has to be different. The properties of console are callable, like functions,
         # but aren't proper functions that work with `call()` either.
-        consolefn message
+        # On IE8, the console object is undefined unless debugging tools are enabled.
+        # In that case, nativeConsole will be an empty object.
+        if consolefn
+          consolefn message
 
         return
 
@@ -176,13 +174,16 @@ define ["./dom", "underscore", "./bootstrap"],
       # in production mode).
       debugEnabled: (document.documentElement.getAttribute "data-debug-enabled")?
 
+    noop = ->
+
     # When debugging is not enabled, then the debug function becomes a no-op.
     exports.debug =
       if exports.debugEnabled
         # If native console available, go for it.  IE doesn't have debug, so we use log instead.
-        level "debug", (nativeConsole.debug or nativeConsole.log)
+        # Add a special noop case for IE8, since IE8 is just crazy.
+        level "debug", (nativeConsole.debug or nativeConsole.log or noop)
       else
-        ->
+        noop
 
     # This is also an aid to debugging; it allows arbitrary scripts to present on the console; when using Geb
     # and/or Selenium, it is very useful to present debugging data right on the page.


[2/2] tapestry-5 git commit: Some further changes to address IE8 compatibility

Posted by hl...@apache.org.
Some further changes to address IE8 compatibility


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

Branch: refs/heads/master
Commit: ffeaabc0413a5c8e9fa4a17e7fe8058d2903d240
Parents: 9769b0d
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Mon Dec 29 14:12:52 2014 -0800
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Mon Dec 29 14:12:52 2014 -0800

----------------------------------------------------------------------
 .../META-INF/modules/t5/core/console.coffee     | 37 ++++++++++----------
 1 file changed, 19 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/ffeaabc0/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/console.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/console.coffee b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/console.coffee
index ab7ccc2..b0785ca 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/console.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/console.coffee
@@ -1,5 +1,3 @@
-# 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.
 # You may obtain a copy of the License at
@@ -18,7 +16,14 @@
 define ["./dom", "underscore", "./bootstrap"],
   (dom, _, { glyph }) ->
 
-    nativeConsole = {}
+    nativeConsole = null
+
+    try
+      # FireFox will throw an exception if you even access the console object and it does
+      # not exist. Wow!
+      nativeConsole = window.console or {}
+    catch e
+
     floatingConsole = null
     messages = null
 
@@ -53,13 +58,6 @@ define ["./dom", "underscore", "./bootstrap"],
         </button>
       """
 
-
-    try
-      # FireFox will throw an exception if you even access the console object and it does
-      # not exist. Wow!
-      nativeConsole = console
-    catch e
-
     # _internal_: displays the message inside the floating console, creating the floating
     # console as needed.
     display = (className, message) ->
@@ -153,17 +151,17 @@ define ["./dom", "underscore", "./bootstrap"],
 
           return unless forceFloating
 
-        if _.isFunction consolefn
+        if window.console and (_.isFunction consolefn)
           # Use the available native console, calling it like an instance method
-          consolefn.call console, message
+          consolefn.call window.console, message
           return
 
-        # On IE8, the console object appears empty unless debugging tools are enabled.
-        return unless consolefn
-
         # And IE just has to be different. The properties of console are callable, like functions,
         # but aren't proper functions that work with `call()` either.
-        consolefn message
+        # On IE8, the console object is undefined unless debugging tools are enabled.
+        # In that case, nativeConsole will be an empty object.
+        if consolefn
+          consolefn message
 
         return
 
@@ -176,13 +174,16 @@ define ["./dom", "underscore", "./bootstrap"],
       # in production mode).
       debugEnabled: (document.documentElement.getAttribute "data-debug-enabled")?
 
+    noop = ->
+
     # When debugging is not enabled, then the debug function becomes a no-op.
     exports.debug =
       if exports.debugEnabled
         # If native console available, go for it.  IE doesn't have debug, so we use log instead.
-        level "debug", (nativeConsole.debug or nativeConsole.log)
+        # Add a special noop case for IE8, since IE8 is just crazy.
+        level "debug", (nativeConsole.debug or nativeConsole.log or noop)
       else
-        ->
+        noop
 
     # This is also an aid to debugging; it allows arbitrary scripts to present on the console; when using Geb
     # and/or Selenium, it is very useful to present debugging data right on the page.