You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2014/03/31 15:36:06 UTC

svn commit: r1583326 - /myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-console.js

Author: lofwyr
Date: Mon Mar 31 13:36:05 2014
New Revision: 1583326

URL: http://svn.apache.org/r1583326
Log:
TOBAGO-1373: Better JavaScript logging: using browser console and fill browser gaps.

Modified:
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-console.js

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-console.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-console.js?rev=1583326&r1=1583325&r2=1583326&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-console.js (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-console.js Mon Mar 31 13:36:05 2014
@@ -70,6 +70,7 @@ if (!console.log) {
   console.log = function (message, other) {
     var console = jQuery(".tobago-console");
     console.show();
+    var body = console.children(":last");
     var parameters = Array.prototype.slice.call(arguments).join(", ");
     parameters.substr(0, parameters.length - 2);
 
@@ -78,7 +79,7 @@ if (!console.log) {
     parameters = parameters.replace(/</g, "&lt;");
     parameters = parameters.replace(/>/g, "&gt;");
     parameters = parameters.replace(/"/g, "&quot;");
-    jQuery("<p>").appendTo(console).html("<pre>" + parameters + "</pre>");
+    jQuery("<p>").appendTo(body).html("<pre>" + parameters + "</pre>");
   };
 
   jQuery(document).ready(function () {
@@ -88,8 +89,8 @@ if (!console.log) {
       border: "5px solid red",
       padding: "10px",
       position: "absolute",
-      right: "0",
-      bottom: "0",
+      left: "200px",
+      top: "200px",
       backgroundColor: "#ffffff",
       filter: "alpha(opacity=70)",
       opacity: 0.7
@@ -100,6 +101,10 @@ if (!console.log) {
       border: "1px solid red",
       marginBottom: "5px"
     });
+    var body = jQuery("<div>").appendTo(console);
+    body.css({
+      overflow: "auto"
+    });
     header.css("background-color", "red");
     var title = jQuery("<span>simple console replacement</span>").appendTo(header);
     var close = jQuery("<button>").appendTo(header);
@@ -112,7 +117,7 @@ if (!console.log) {
     clear.attr("type", "button");
     clear.append("Clear");
     clear.click(function () {
-      console.children("p").detach();
+      body.children("p").detach();
     });
   });
 }