myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r1569262 - in /myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main: java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/
Date Tue, 18 Feb 2014 10:43:37 GMT
Author: lofwyr
Date: Tue Feb 18 10:43:36 2014
New Revision: 1569262

URL: http://svn.apache.org/r1569262
Log:
TOBAGO-1366: Remove Tobago-Debug-Window, use console instead

Modified:
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PageRenderer.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-logging.js
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PageRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PageRenderer.java?rev=1569262&r1=1569261&r2=1569262&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PageRenderer.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PageRenderer.java
Tue Feb 18 10:43:36 2014
@@ -59,18 +59,15 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import javax.faces.application.Application;
-import javax.faces.application.FacesMessage;
 import javax.faces.application.ViewHandler;
 import javax.faces.component.UIComponent;
 import javax.faces.context.ExternalContext;
 import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
 import javax.portlet.MimeResponse;
 import javax.portlet.ResourceURL;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -80,7 +77,6 @@ public class PageRenderer extends PageRe
 
   private static final Logger LOG = LoggerFactory.getLogger(PageRenderer.class);
 
-  private static final String CLIENT_DEBUG_SEVERITY = "clientDebugSeverity";
   private static final String LAST_FOCUS_ID = "lastFocusId";
 
   @Override
@@ -89,13 +85,6 @@ public class PageRenderer extends PageRe
     final String clientId = component.getClientId(facesContext);
     final ExternalContext externalContext = facesContext.getExternalContext();
 
-    // severity
-    final String severity
-        = externalContext.getRequestParameterMap().get(clientId + ComponentUtils.SUB_SEPARATOR
+ "clientSeverity");
-    if (severity != null) {
-      externalContext.getRequestMap().put(CLIENT_DEBUG_SEVERITY, severity);
-    }
-
     // last focus
     final String lastFocusId =
         externalContext.getRequestParameterMap().get(clientId + ComponentUtils.SUB_SEPARATOR
+ LAST_FOCUS_ID);
@@ -176,28 +165,7 @@ public class PageRenderer extends PageRe
     ResponseUtils.ensureContentTypeHeader(facesContext, contentType);
     final String clientId = page.getClientId(facesContext);
     final ClientProperties client = VariableResolverUtils.resolveClientProperties(facesContext);
-    final ProjectStage projectStage = tobagoConfig.getProjectStage();
-    final boolean developmentMode = projectStage == ProjectStage.Development;
-    final boolean debugMode = client.isDebugMode() || developmentMode;
-    final boolean productionMode = !debugMode && projectStage == ProjectStage.Production;
-    int clientLogSeverity = 2;
-    if (debugMode) {
-      final String severity = (String) externalContext.getRequestMap().get(CLIENT_DEBUG_SEVERITY);
-      if (LOG.isDebugEnabled()) {
-        LOG.debug("get " + CLIENT_DEBUG_SEVERITY + " = " + severity);
-      }
-      if (severity != null) {
-        try {
-          int index = severity.indexOf(';');
-          if (index == -1) {
-            index = severity.length();
-          }
-          clientLogSeverity = Integer.parseInt(severity.substring(0, index));
-        } catch (final NumberFormatException e) {
-          // ignore; use default
-        }
-      }
-    }
+    final boolean productionMode = tobagoConfig.getProjectStage() == ProjectStage.Production;
     final boolean preventFrameAttacks = tobagoConfig.isPreventFrameAttacks();
 
     if (!FacesContextUtils.isAjax(facesContext)) {
@@ -298,7 +266,7 @@ public class PageRenderer extends PageRe
       for (final String scriptBlock : FacesContextUtils.getScriptBlocks(facesContext)) {
 
         if (LOG.isDebugEnabled()) {
-          LOG.debug("write scriptblock " + ++debugCounter + " :\n" + scriptBlock);
+          LOG.debug("write script block " + ++debugCounter + " :\n" + scriptBlock);
         }
         writer.write(scriptBlock);
         writer.write('\n');
@@ -389,15 +357,6 @@ public class PageRenderer extends PageRe
       Secret.encode(facesContext, writer);
     }
 
-    if (debugMode) {
-      writer.startElement(HtmlElements.INPUT, null);
-      writer.writeAttribute(HtmlAttributes.VALUE, clientLogSeverity);
-      writer.writeAttribute(HtmlAttributes.ID, clientId + ComponentUtils.SUB_SEPARATOR +
"clientSeverity", false);
-      writer.writeAttribute(HtmlAttributes.NAME, clientId + ComponentUtils.SUB_SEPARATOR
+ "clientSeverity", false);
-      writer.writeAttribute(HtmlAttributes.TYPE, HtmlInputTypes.HIDDEN, false);
-      writer.endElement(HtmlElements.INPUT);
-    }
-
     if (component.getFacet("backButtonDetector") != null) {
       final UIComponent hidden = component.getFacet("backButtonDetector");
       RenderUtils.encode(facesContext, hidden);
@@ -497,8 +456,6 @@ public class PageRenderer extends PageRe
     }
 
     final String clientId = page.getClientId(facesContext);
-    final boolean debugMode = VariableResolverUtils.resolveClientProperties(facesContext).isDebugMode();
-
 
     // avoid submit page in ie if the form contains only one input and you press the enter
key in the input
     if (VariableResolverUtils.resolveClientProperties(facesContext).getUserAgent().isMsie())
{
@@ -569,22 +526,6 @@ public class PageRenderer extends PageRe
     writer.writeAttribute(HtmlAttributes.SRC, overlayBackgroundImage, false);
     writer.endElement(HtmlElements.IMG);
 
-    // debugging...
-    if (debugMode) {
-      final List<String> logMessages = new ArrayList<String>();
-      String id = null;
-      for (final Iterator<String> ids = facesContext.getClientIdsWithMessages(); ids.hasNext();
id = ids.next()) {
-        for (final FacesMessage message : facesContext.getMessageList(id)) {
-          logMessages.add(errorMessageForDebugging(id, message));
-        }
-      }
-      if (!logMessages.isEmpty()) {
-        logMessages.add(0, "LOG.show();");
-      }
-
-      HtmlRendererUtils.writeScriptLoader(facesContext, null, logMessages.toArray(new String[logMessages.size()]));
-    }
-
     writer.startElement(HtmlElements.NOSCRIPT, null);
     writer.startElement(HtmlElements.DIV, null);
     writer.writeClassAttribute(Classes.create(page, "noscript"));
@@ -663,6 +604,7 @@ public class PageRenderer extends PageRe
     }
   }
 
+  /* TODO: this may be written in to a HTML5 data-attribute and be logged to the console
   private void errorMessageForDebugging(final String id, final FacesMessage message, final
ResponseWriter writer)
       throws IOException {
     writer.startElement(HtmlElements.DIV, null);
@@ -695,6 +637,7 @@ public class PageRenderer extends PageRe
   private String escape(final String s) {
     return StringUtils.replace(StringUtils.replace(s, "\\", "\\\\"), "\"", "\\\"");
   }
+*/
 
   private String getMethod(final UIPage page) {
     final String method = (String) page.getAttributes().get(Attributes.METHOD);

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-logging.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-logging.js?rev=1569262&r1=1569261&r2=1569262&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-logging.js
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-logging.js
Tue Feb 18 10:43:36 2014
@@ -15,25 +15,40 @@
  * limitations under the License.
  */
 
+/**
+ * Logging helper class.
+ * All calls with level higher than LOG.level (with default LOG.INFO) are logged into the
console object (if any).
+ * To set the level you may put this tag into the tc:page
+ *       <tc:dataAttribute name="tobago-log-level" value="DEBUG"/>
+ * This methods are only used in development mode, not in production mode.
+ */
 var LOG = {
-  IdBase: "TbgLog",
-  messages: new Array(),
-  appenders: new Array(),
-  maximumSeverity: 0,
-  SEVERITY_ID_POSTFIX: "clientSeverity",
+
   DEBUG: 1,
   INFO:  2,
   WARN:  3,
   ERROR: 4,
-  NONE: 100,
-  HISTORY_SIZE: 500,
 
-  show: function() {
-    for (var i = 0 ; i < this.appenders.length; i++) {
-      var appender = this.appenders[i];
-      if (appender.show) {
-        appender.show();
-      }
+  hasConsole: typeof console == "undefined",
+  level: this.INFO,
+  maximumSeverity: 0,
+
+  init: function(elements) {
+    var page = Tobago.Utils.selectWidthJQuery(elements, "[data-tobago-log-level]");
+    var levelString = page.data("tobago-log-level");
+    switch (levelString) {
+      case "DEBUG":
+        this.level = this.DEBUG;
+        break;
+      case "INFO":
+        this.level = this.INFO;
+        break;
+      case "WARN":
+        this.level = this.WARN;
+        break;
+      case "ERROR":
+        this.level = this.ERROR;
+        break;
     }
   },
 
@@ -41,386 +56,84 @@ var LOG = {
     return this.maximumSeverity;
   },
 
-  getMessages: function(severity) {
-    var result = "";
-    for (var i = 0; i < this.messages.length; i++) {
-      var message = this.messages[i];
-      if (message.type >= severity) {
-        result = result.concat(this.getSeverityName(message.type));
-        result = result.concat(": ");
-        result = result.concat(message.message);
-        result = result.concat("\n");
-      }
+  adjustMaximumSeverity: function (currentSeverity) {
+    if (currentSeverity >= this.maximumSeverity) {
+      this.maximumSeverity = currentSeverity;
     }
-    return result;
   },
 
-  getSeverityName: function(severity) {
-    if (LOG.ERROR == severity) {
-      return "Error: ";
-    } else if (LOG.WARN == severity) {
-      return "Warn:  ";
-    } else if (LOG.INFO == severity) {
-      return "Info:  ";
-    } else if (LOG.DEBUG == severity) {
-      return "Debug: ";
+  debug: function(text) {
+    this.adjustMaximumSeverity(this.DEBUG);
+    if (this.hasConsole && this.DEBUG >= this.level) {
+      console.log(text);
     }
-    return "";
   },
 
-
-  addAppender: function(appender) {
-    this.appenders.push(appender);
+  info  : function(text) {
+    this.adjustMaximumSeverity(this.INFO);
+    if (this.hasConsole && this.INFO >= this.level) {
+      console.info(text);
+    }
   },
 
-  addMessage: function(msg) {
-    if (this.maximumSeverity < msg.type) {
-      this.maximumSeverity = msg.type;
-    }
-    this.messages.push(msg);
-    while (this.messages.length > this.HISTORY_SIZE) {
-      this.messages.shift();
+  warn: function(text) {
+    this.adjustMaximumSeverity(this.WARN);
+    if (this.hasConsole && this.WARN >= this.level) {
+      console.warn(text);
     }
-    for (var i = 0 ; i < this.appenders.length; i++) {
-      var appender = this.appenders[i];
-      if (appender.append
-          && typeof(msg.type) == "number"
-          && appender.logFor(msg.type)) {
-        appender.append(msg);
-      }
+  },
+
+  error: function(text) {
+    this.adjustMaximumSeverity(this.ERROR);
+    if (this.hasConsole && this.ERROR >= this.level) {
+      console.error(text);
     }
   },
 
-  debug: function(text) {
-    this.addMessage(new LOG.LogMessage(LOG.DEBUG, text));
+  /** @deprecated */
+  show: function() {
+    this.warn("Menthod LOG.show() is deprecated!");
   },
 
-  info  : function(text) {
-    this.addMessage(new LOG.LogMessage(LOG.INFO, text));
+  /** @deprecated */
+  getMessages: function(severity) {
+    this.warn("Menthod LOG.getMessages() is deprecated!");
   },
 
-  warn: function(text) {
-    this.addMessage(new LOG.LogMessage(LOG.WARN, text));
+  /** @deprecated */
+  getSeverityName: function(severity) {
+    this.warn("Menthod LOG.getSeverityName() is deprecated!");
   },
 
-  error: function(text) {
-    this.show();
-    this.addMessage(new LOG.LogMessage(LOG.ERROR, text));
+  /** @deprecated */
+  addAppender: function(appender) {
+    this.warn("Menthod LOG.addAppender() is deprecated!");
   },
 
+  /** @deprecated */
+  addMessage: function(msg) {
+    this.warn("Menthod LOG.addMessage() is deprecated!");
+  },
+
+  /** @deprecated */
   bindOnWindow: function() {
-    window.onerror = function(msg, url, line) {
-      var message = "Error: \"" + msg + "\" ON " + (url || window.location) + " line: "+
line +"";
-      LOG.error(message);
-      return false;
-    }
+    this.warn("Menthod LOG.bindOnWindow() is deprecated!");
   },
 
+  /** @deprecated */
   listScriptFiles: function() {
-    var children = document.getElementsByTagName('head')[0].childNodes;
-    for (var i = 0; i < children.length; i++) {
-      var child = children[i];
-      if (child.tagName.toUpperCase() == "SCRIPT"){
-        this.debug("script.src=" + child.src);
-      }
-    }
+    this.warn("Menthod LOG.listScriptFiles() is deprecated!");
   },
 
+  /** @deprecated */
   listThemeConfig : function() {
-    for (var name in Tobago.Config) {
-      if (typeof Tobago.Config[name] == 'object' && name != "fallbackNames") {
-        for (var key in Tobago.Config[name]) {
-          LOG.debug(name + "." + key + " = " + Tobago.Config[name][key]);
-        }
-      }
-    }
+    this.warn("Menthod LOG.listThemeConfig() is deprecated!");
   },
 
+  /** @deprecated */
   debugAjaxComponents: function() {
-     for (var name in Tobago.ajaxComponents) {
-       var component = Tobago.ajaxComponents[name];
-       if (typeof component == 'string') {
-         LOG.debug("AjaxComponentId = " + name + " ContainerId = " + component);
-       } else if ((typeof component == 'object') && component.tagName) {
-         LOG.debug("AjaxComponentId = " + name + " ContainerType = " + component.tagName);
-       } else if ((typeof component == 'object') && (typeof component.reloadWithAction
== "function")) {
-         LOG.debug("AjaxComponentId = " + name + " TobagoAjaxReloadable object");
-       } else {
-         LOG.debug("AjaxComponentId = " + name + " Unknown object");
-       }
-    }
+    this.warn("Menthod LOG.debugAjaxComponents() is deprecated!");
   }
 };
 
-LOG.bindOnWindow();
-
-
-LOG.LogArea = function(options) {
-  this.initialize(options);
-};
-
-LOG.LogArea.prototype.initialize = function() {
-    var options = Tobago.extend({
-      // logging
-      hide: false,
-      severity: LOG.DEBUG
-    }, arguments[0] || {});
-
-    this.options = options;
-
-    if (Tobago.element(LOG.IdBase)) {
-      return;
-    }
-
-    this.element = document.createElement("DIV");
-//    this.element.id = LOG.IdBase + "Element"
-    this.setUpLogDiv(this.element, "30px", "2px", "400px", "500px", "1px solid red", "#aaaaaa");
-    this.element.style.paddingTop = "25px";
-    this.element.style.overflow = "hidden";
-    this.element.style.zIndex = "9010";
-    this.element.className = "tobagoLogArea";
-
-    this.dragHandleTop = document.createElement("DIV");
-    this.setUpHandleDiv(this.dragHandleTop, "0px", "0px", null, null, "100%", "25px", "2px
outset gray", null, "move");
-    this.element.appendChild(this.dragHandleTop);
-
-    var tmpElement = document.createElement("SPAN");
-    tmpElement.style.paddingLeft = "20px";
-    tmpElement.innerHTML = "LoggingArea";
-    this.dragHandleTop.appendChild(tmpElement);
-
-    this.severitySelector = document.createElement("SELECT");
-    var option = document.createElement("OPTION");
-    option.value = LOG.DEBUG;
-    option.innerHTML = "Debug";
-    this.severitySelector.appendChild(option);
-    option = document.createElement("OPTION");
-    option.value = LOG.INFO;
-    option.innerHTML = "Info";
-    this.severitySelector.appendChild(option);
-    option = document.createElement("OPTION");
-    option.value = LOG.WARN;
-    option.innerHTML = "Warn";
-    this.severitySelector.appendChild(option);
-    option = document.createElement("OPTION");
-    option.value = LOG.ERROR;
-    option.innerHTML = "Error";
-    this.severitySelector.appendChild(option);
-    option = document.createElement("OPTION");
-    option.value = LOG.NONE;
-    option.innerHTML = "None";
-    this.severitySelector.appendChild(option);
-    var sev = Tobago.element(Tobago.page.id + Tobago.SUB_COMPONENT_SEP + LOG.SEVERITY_ID_POSTFIX);
-    if (sev) {
-      this.severitySelector.value = sev.value;
-    } else {
-      this.severitySelector.value = LOG.INFO;
-    }
-    this.severitySelector.style.position = "absolute";
-    this.severitySelector.style.right = "66px";
-    this.dragHandleTop.appendChild(this.severitySelector);
-
-    this.clearButton = this.createButtonElement();
-    this.clearButton.style.right = "44px";
-    this.clearButton.innerHTML = "C";
-    this.clearButton.title = "Clear log area";
-    this.dragHandleTop.appendChild(this.clearButton);
-
-    this.oldButton = this.createButtonElement();
-    this.oldButton.style.right = "22px";
-    this.oldButton.innerHTML = "O";
-    this.oldButton.title = "Get all Messages";
-    this.dragHandleTop.appendChild(this.oldButton);
-
-    this.hideButton = this.createButtonElement();
-    this.hideButton.style.right = "0px";
-    this.hideButton.innerHTML = "X";
-    this.hideButton.title = "Hide log area";
-    this.dragHandleTop.appendChild(this.hideButton);
-
-    this.dragHandleLeft = document.createElement("DIV");
-    this.setUpHandleDiv(this.dragHandleLeft, "0px", "0px", null, null, "1px", "100%", "2px
outset gray", null, "move");
-    this.element.appendChild(this.dragHandleLeft);
-
-    this.dragHandleBottom = document.createElement("DIV");
-    this.setUpHandleDiv(this.dragHandleBottom, null, "0px", "0px", null, "100%", "2px", "2px
outset gray", null, "move");
-    this.element.appendChild(this.dragHandleBottom);
-
-    this.dragHandleRight = document.createElement("DIV");
-    this.setUpHandleDiv(this.dragHandleRight, null, null, "0px", "0px", "1px", "100%", "2px
outset gray", null, "move");
-    this.element.appendChild(this.dragHandleRight);
-
-//    this.resizeHandleNW = document.createElement("DIV");
-//    this.setUpHandleDiv(this.resizeHandleNW, "0px", "0px", null, null, "5px", "5px", null,
"#000000", "nw-resize");
-//    this.element.appendChild(this.resizeHandleNW);
-//
-//    this.resizeHandleNE = document.createElement("DIV");
-//    this.setUpHandleDiv(this.resizeHandleNE, "0px", null, null, "0px", "5px", "5px", null,
"#000000", "ne-resize");
-//    this.element.appendChild(this.resizeHandleNE);
-//
-//    this.resizeHandleSE = document.createElement("DIV");
-//    this.setUpHandleDiv(this.resizeHandleSE, null, null, "0px", "0px", "5px", "5px", null,
"#000000", "se-resize");
-//    this.element.appendChild(this.resizeHandleSE);
-//
-//    this.resizeHandleSW = document.createElement("DIV");
-//    this.setUpHandleDiv(this.resizeHandleSW, null, "0px", "0px", null, "5px", "5px", null,
"#000000", "sw-resize");
-//    this.element.appendChild(this.resizeHandleSW);
-
-    this.scrollElement = document.createElement("DIV");
-    this.scrollElement.style.overflow = "auto";
-    this.scrollElement.style.width = "100%";
-    this.scrollElement.style.height = "100%";
-    this.scrollElement.style.background = "#ffffff";
-    this.element.appendChild(this.scrollElement);
-
-    this.logList = document.createElement("OL");
-    this.logList.style.fontFamily = "Arial, sans-serif";
-    this.logList.style.fontSize = "10pt";
-    this.logList.id = "Log";
-    this.scrollElement.appendChild(this.logList);
-
-    this.handle       = options.handle ? Tobago.element(options.handle) : this.element;
-
-    this.dragging     = false;
-
-    Tobago.addBindEventListener(this.severitySelector, "change", this, "changeSeverity");
-    Tobago.addBindEventListener(this.severitySelector, "click", Tobago, "stopEventPropagation");
-    Tobago.addBindEventListener(this.severitySelector, "mousedown", Tobago, "stopEventPropagation");
-    Tobago.addBindEventListener(this.clearButton, "click", this, "clearList");
-    Tobago.addBindEventListener(this.clearButton, "mousedown", Tobago, "stopEventPropagation");
-    Tobago.addBindEventListener(this.oldButton, "click", this, "getOld");
-    Tobago.addBindEventListener(this.oldButton, "mousedown", Tobago, "stopEventPropagation");
-    Tobago.addBindEventListener(this.hideButton, "click", this, "doHide");
-    Tobago.addBindEventListener(this.hideButton, "mousedown", Tobago, "stopEventPropagation");
-
-    this.body = document.getElementsByTagName("body")[0];
-    this.body.tbgLogArea = this;
-
-    if (this.options.hide) {
-//      this.element.style.display = 'none';
-      this.doHide();
-    } else {
-      this.show();
-    }
-    this.body.appendChild(this.element);
-    LOG.addAppender(this);
-
-    /* Select the logging area with jQuery. TODO: The selector is fragile! */
-    jQuery("body > .tobagoLogArea").draggable({handle: "div:first"});
-};
-
-LOG.LogArea.prototype.show = function() {
-    this.element.style.display = '';
-    this.hide = "show";
-    this.setupHidden();
-};
-
-LOG.LogArea.prototype.doHide = function() {
-    this.element.style.display = 'none';
-    this.hide = "hide";
-    this.setupHidden();
-};
-
-LOG.LogArea.prototype.setUpLogDiv = function(element, top, right, width, height, border,
background) {
-    element.style.position = "absolute";
-    element.style.MozBoxSizing = "border-box";
-    if (right != null) element.style.right = right;
-    if (top != null) element.style.top = top;
-    if (height != null) element.style.height = height;
-    if (width != null) element.style.width = width;
-    if (border != null) element.style.border = border;
-    if (background != null) element.style.background = background;
-};
-
-LOG.LogArea.prototype.setUpHandleDiv = function(element, top, left, bottom, right, width,
height, border, background, cursor) {
-    this.setUpLogDiv(element, top, right, width, height, border, background);
-    if (left != null) element.style.left = left;
-    if (bottom != null) element.style.bottom = bottom;
-    if (cursor != null) element.style.cursor = cursor;
-};
-
-LOG.LogArea.prototype.createButtonElement = function() {
-    var button = document.createElement("BUTTON");
-    button.style.width = "20px";
-    button.style.height = "20px";
-    button.style.position = "absolute";
-    button.style.top = "0px";
-    button.style.paddingLeft = "0px";
-    button.style.paddingRight = "0px";
-    return button;
-};
-
-LOG.LogArea.prototype.changeSeverity = function() {
-    this.setupHidden();
-};
-
-LOG.LogArea.prototype.setupHidden = function() {
-    var hidden = Tobago.element(Tobago.page.id + Tobago.SUB_COMPONENT_SEP + "clientSeverity");
-    if (hidden) {
-      hidden.value = this.severitySelector.value + ";" + this.hide;
-    }
-};
-
-LOG.LogArea.prototype.clearList = function() {
-    this.logList.innerHTML = "";
-};
-
-LOG.LogArea.prototype.getOld = function() {
-    for (var i = 0 ; i < LOG.messages.length; i++) {
-      this.append(LOG.messages[i]);
-    }
-};
-
-LOG.LogArea.prototype.stopEvent = function(event) {
-    Tobago.stopEventPropagation(event);
-};
-
-LOG.LogArea.prototype.scrollToBottom = function() {
-    this.scrollElement.scrollTop = this.scrollElement.scrollHeight;
-};
-
-LOG.LogArea.prototype.append = function(message) {
-    if (typeof(message.type) == "number" && !this.logFor(message.type)) {
-      return;
-    }
-
-    var listElement = document.createElement("li");
-
-    var logMessage;
-    if (typeof(message) == "string") {
-      logMessage = document.createTextNode(message);
-    } else if (typeof(message.type) == "number") {
-      var prefix = LOG.getSeverityName(message.type);
-      logMessage = document.createTextNode(prefix + message.message);
-    }
-    listElement.appendChild(logMessage);
-    this.logList.appendChild(listElement);
-
-    this.scrollToBottom();
-};
-
-LOG.LogArea.prototype.logFor = function(severity) {
-    if (this.severitySelector.value) {
-        //noinspection PointlessArithmeticExpressionJS
-      return (severity >= (this.severitySelector.value - 0));
-    }
-    //noinspection PointlessArithmeticExpressionJS
-  return (severity >= (this.options.severity -0));
-};
-
-LOG.LogMessage = function(type, message) {
-    this.type = type;
-    this.message = message;
-    this.time = new Date();
-};
-
-LOG.LogMessage.prototype.displayOn = function(type) {
-  return this.type <= type;
-};
-
-LOG.init = function() {
-  new LOG.LogArea({hide:true});
-};
-
-Tobago.registerListener(LOG.init, Tobago.Phase.DOCUMENT_READY);
-
+jQuery(document).ready(Tobago.LOG.init);

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js?rev=1569262&r1=1569261&r2=1569262&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
Tue Feb 18 10:43:36 2014
@@ -287,8 +287,6 @@ var Tobago = {
     this.initMarker = true;
 
 
-//    new LOG.LogArea({hide: false});
-//    LOG.show();
     TbgTimer.startOnload = new Date(); // @DEV_ONLY
     var page = jQuery(".tobago-page");
     this.page = page.get(0);



Mime
View raw message