[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[linterna-magica-commit] [115] Improved visibility for the web logger.
From: |
Ivaylo Valkov |
Subject: |
[linterna-magica-commit] [115] Improved visibility for the web logger. |
Date: |
Thu, 07 Jul 2011 08:46:37 +0000 |
Revision: 115
http://svn.sv.gnu.org/viewvc/?view=rev&root=linterna-magica&revision=115
Author: valkov
Date: 2011-07-07 08:46:36 +0000 (Thu, 07 Jul 2011)
Log Message:
-----------
Improved visibility for the web logger. Colored backgrounds for rows and left
inedent according to log level.
Modified Paths:
--------------
trunk/data/style/template.css
trunk/src/lm_log.js
Modified: trunk/data/style/template.css
===================================================================
--- trunk/data/style/template.css 2011-07-06 08:43:31 UTC (rev 114)
+++ trunk/data/style/template.css 2011-07-07 08:46:36 UTC (rev 115)
@@ -501,6 +501,7 @@
.linterna-magica-web-log-messages {
height: 215px !important;
+ width: 420px !important;
overflow: auto !important;
padding: 5px 15px !important;
line-height: 1.35em;
@@ -532,6 +533,23 @@
margin: 1em 0 !important;
}
+/* New lines are replaced with span in the web log. */
+/* This shows them in new line in the web log */
+.linterna-magica-log-to-web-message span {
+ display: block;
+}
+
+/* Mesage rows */
+.linterna-magica-log-to-web-message {
+ /* Indent/margin-left and background-color are */
+ /* calculated in lm_log.js:LinternaMagica.prototype.log */
+ border-bottom: 1px solid rgb(152,152,152) !important;
+ border-left: 1px solid rgb(152,152,152) !important;
+ padding-left: 3px !important;
+ padding-bottom: 3px !important;
+}
+
+
.linterna-magica-remote-clip-buttons {
position: relative !important;
z-index: 99999 !important;
Modified: trunk/src/lm_log.js
===================================================================
--- trunk/src/lm_log.js 2011-07-06 08:43:31 UTC (rev 114)
+++ trunk/src/lm_log.js 2011-07-07 08:46:36 UTC (rev 115)
@@ -78,9 +78,30 @@
var row = document.createElement('p');
row.setAttribute("class",
"linterna-magica-log-to-web-message");
- var t = document.createTextNode(log_string);
+ var lines = log_string.split(/\n/);
+ var t = document.createTextNode(lines[0]);
row.appendChild(t);
+
+ for (var i=1,l=lines.length; i<l; i++)
+ {
+ var span = document.createElement("span");
+ var t = document.createTextNode(lines[i]);
+ span.appendChild(t);
+ row.appendChild(span);
+ }
+
+ row.style.setProperty("margin-left",
+ parseInt(3.5*level)+"px", "important");
+
+ // The start color is #888888 rgb (136,136, 136).
+ // Every next log level is two shades ( -32) darker
+ var bg_color = parseInt(136 - 32*level);
+
+ row.style.setProperty("background-color",
+ "rgb("+bg_color+","+bg_color+","+
+ bg_color+")", "important");
+
this.logger.appendChild(row);
}
else
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [linterna-magica-commit] [115] Improved visibility for the web logger.,
Ivaylo Valkov <=