[richfaces-svn-commits] JBoss Rich Faces SVN: r18653 - in trunk/ui/core/ui/src/main: resources/META-INF/resources/org.richfaces and 1 other directories.
richfaces-svn-commits at lists.jboss.org
richfaces-svn-commits at lists.jboss.org
Mon Aug 16 07:51:51 EDT 2010
Author: nbelaevski
Date: 2010-08-16 07:51:50 -0400 (Mon, 16 Aug 2010)
New Revision: 18653
Added:
trunk/ui/core/ui/src/main/java/org/richfaces/renderkit/LogRendererBase.java
Modified:
trunk/ui/core/ui/src/main/resources/META-INF/resources/org.richfaces/log.ecss
trunk/ui/core/ui/src/main/resources/META-INF/resources/org.richfaces/log.js
trunk/ui/core/ui/src/main/templates/org/ajax4jsf/renderkit/html/log.template.xml
Log:
https://jira.jboss.org/browse/RF-7816
Added: trunk/ui/core/ui/src/main/java/org/richfaces/renderkit/LogRendererBase.java
===================================================================
--- trunk/ui/core/ui/src/main/java/org/richfaces/renderkit/LogRendererBase.java (rev 0)
+++ trunk/ui/core/ui/src/main/java/org/richfaces/renderkit/LogRendererBase.java 2010-08-16 11:51:50 UTC (rev 18653)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.renderkit;
+
+import org.ajax4jsf.renderkit.RendererBase;
+import org.richfaces.component.LogMode;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class LogRendererBase extends RendererBase {
+
+ protected boolean isInline(Object attributeValue) {
+ LogMode mode = (LogMode) attributeValue;
+ if (mode == null) {
+ mode = LogMode.DEFAULT;
+ }
+
+ return mode == LogMode.inline;
+ }
+
+}
Modified: trunk/ui/core/ui/src/main/resources/META-INF/resources/org.richfaces/log.ecss
===================================================================
--- trunk/ui/core/ui/src/main/resources/META-INF/resources/org.richfaces/log.ecss 2010-08-16 11:16:23 UTC (rev 18652)
+++ trunk/ui/core/ui/src/main/resources/META-INF/resources/org.richfaces/log.ecss 2010-08-16 11:51:50 UTC (rev 18653)
@@ -1,14 +1,21 @@
.rf-log {
color: '#{richSkin.generalTextColor}';
- height: 300px;
- overflow: auto;
- width: 100%;
}
.rf-log-popup {
overflow: visible;
}
+.rf-log-popup-cnt {
+ display: none;
+}
+
+.rf-log-inline {
+ height: 300px;
+ overflow: auto;
+ width: 100%;
+}
+
.rf-log-contents {
font-family: monospace;
}
Modified: trunk/ui/core/ui/src/main/resources/META-INF/resources/org.richfaces/log.js
===================================================================
--- trunk/ui/core/ui/src/main/resources/META-INF/resources/org.richfaces/log.js 2010-08-16 11:16:23 UTC (rev 18652)
+++ trunk/ui/core/ui/src/main/resources/META-INF/resources/org.richfaces/log.js 2010-08-16 11:51:50 UTC (rev 18653)
@@ -169,9 +169,13 @@
},
init: function(options) {
+ this.$super.constructor.call(this, 'richfaces.log');
+ this.__initialLogImpl = richfaces.log;
+ richfaces.log = this;
+
this.level = options.level;
this.hotkey = options.hotkey;
- this.mode = options.mode;
+ this.mode = (options.mode || 'inline');
if (this.mode == 'popup') {
this.__boundHotkeyHandler = jquery.proxy(this.__hotkeyHandler, this);
@@ -182,6 +186,9 @@
},
destroy: function() {
+ richfaces.log = this.__initialLogImpl;
+ this.__initialLogImpl = null;
+
//TODO test this method
if (this.__popupWindow) {
this.__popupWindow.close();
Modified: trunk/ui/core/ui/src/main/templates/org/ajax4jsf/renderkit/html/log.template.xml
===================================================================
--- trunk/ui/core/ui/src/main/templates/org/ajax4jsf/renderkit/html/log.template.xml 2010-08-16 11:16:23 UTC (rev 18652)
+++ trunk/ui/core/ui/src/main/templates/org/ajax4jsf/renderkit/html/log.template.xml 2010-08-16 11:51:50 UTC (rev 18653)
@@ -6,15 +6,15 @@
<cc:interface>
<cdk:class>org.richfaces.renderkit.html.AjaxLogRenderer</cdk:class>
- <cdk:superclass>org.ajax4jsf.renderkit.RendererBase</cdk:superclass>
+ <cdk:superclass>org.richfaces.renderkit.LogRendererBase</cdk:superclass>
<cdk:component-family>org.richfaces.AjaxLog</cdk:component-family>
<cdk:renderer-type>org.richfaces.AjaxLogRenderer</cdk:renderer-type>
</cc:interface>
<cc:implementation>
- <div id="richfaces.log" class="rf-log #{component.attributes['styleClass']}">
+ <div id="richfaces.log" class="rf-log #{isInline(component.attributes['mode']) ? 'rf-log-inline' : 'rf-log-popup rf-log-popup-cnt'} #{component.attributes['styleClass']}">
<script type="text/javascript">
- RichFaces.log = new RichFaces.HtmlLog({
+ new RichFaces.HtmlLog({
level: "#{component.attributes['level']}",
hotkey: "#{component.attributes['hotkey']}",
mode: "#{component.attributes['mode']}"
More information about the richfaces-svn-commits
mailing list