Revision: 0a79064b2e5d
Branch:   default
Author:   Pekka Klärck
Date:     Wed Apr 16 18:29:42 2014 UTC
Log:      Log: Enhanced selecting message text

Update issue 1689
Changed text to an icon and cleaned up the implementation a little. I made the icon myself because couldn't find anything ready-made that would have worked too well.

I still have few enhancements in mind:

1) Add some visual notification when the icon, or actually the whole column where the icon is situated, is hovered. This tells user that at that point clicking selects the text. My current thinking is to implement this by having a second icon that has, for example, a yellow background.

2) Enhance the icon slightly. I like the basic idea but I'd like to somehow make the icon a bit sharper.

3) Toggle selection. Clicking the icon again could unselect the text. This is nice to have.
http://code.google.com/p/robotframework/source/detail?r=0a79064b2e5d

Modified:
 /src/robot/htmldata/rebot/log.css
 /src/robot/htmldata/rebot/log.html
 /src/robot/htmldata/rebot/log.js

=======================================
--- /src/robot/htmldata/rebot/log.css   Wed Apr 16 10:42:06 2014 UTC
+++ /src/robot/htmldata/rebot/log.css   Wed Apr 16 18:29:42 2014 UTC
@@ -75,6 +75,9 @@
     font-family: monospace;
     font-size: 1.1em;
 }
+.message-row {
+    height: 17px;
+}
 .time {
     width: 8em;
 }
@@ -87,22 +90,12 @@
     text-align: center;
 }
 .select-text {
-    width: 7em;
-    white-space: nowrap;
-    text-align: right;
-    padding-right: 0.5em;
+    width: 2em;
+    background-position: top right;
+    background-repeat: no-repeat;
 }
-.select-text > a {
-    font-size: 0.8em;
-    color: #808080 !important;
-    font-family: Helvetica, sans-serif;
-    border-radius: 8px;
-    padding: 0.3em 1em 0.1em 1em;
-}
-.select-text > a:hover {
-    text-decoration: none;
-    background-color: #BBBBFF;
-    color: black !important;
+.message-row:hover .select-text {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAUVBMVEWtw9urwdmpv9elu9Oht8/k6/OTqcHS3uuHnbWtwtro6Oj1+Pvu8veovtakutKiuNCgts7G1uaYrsaUqsL////t8vf5+/zb5e/T09PR3ev7/P0xxh/0AAAAZklEQVQYlWWQWQ6AIAwFKyAquKCCIvc/qAECrTKfky6vBa++eFDBUYIC5ZhBmIuGnwhPBgi7jmaVla23aY6oLNmQpudKxoyF47ZNzRx+c0TOQ3bJleYZEhozdzaDd01oyu3VNP95AZQgDMntcf1bAAAAAElFTkSuQmCC);
 }
 /* Message tables - these MUST NOT be combined together because otherwise
    dynamically altering them based on visible log level is not possible. */
=======================================
--- /src/robot/htmldata/rebot/log.html  Wed Apr 16 10:42:06 2014 UTC
+++ /src/robot/htmldata/rebot/log.html  Wed Apr 16 18:29:42 2014 UTC
@@ -177,7 +177,7 @@
 </script>

 <script type="text/x-jquery-tmpl" id="errorTemplate">
-  <tr id="${id}">
+  <tr id="${id}" class="message-row">
     <td class="error-time">
       {{if link}}
<a onclick="makeElementVisible('${link}')" href="#${link}" title="Link to details">${date} ${time}</a>
@@ -187,7 +187,8 @@
     </td>
     <td class="${level.toLowerCase()} level">${level}</td>
     <td class="message">{{html text}}</td>
- <td class="select-text"><a href="javascript:selectText($('#${id} .message')[0])">Select Text</a></td>
+    <td class="select-text" onclick="javascript:selectMessage('${id}')"
+        title="Select message text"></td>
   </tr>
 </script>

@@ -341,11 +342,12 @@

 <script type="text/x-jquery-tmpl" id="messageTemplate">
   <table id="${id}" class="messages ${level.toLowerCase()}-message">
-    <tr>
+    <tr class="message-row">
       <td class="time">${time}</td>
       <td class="${level.toLowerCase()} level">${level}</td>
       <td class="message">{{html text}}</td>
- <td class="select-text"><a href="javascript:selectText($('#${id} .message')[0])">Select Text</a></td>
+      <td class="select-text" onclick="javascript:selectMessage('${id}')"
+          title="Select message text"></td>
     </tr>
   </table>
 </script>
=======================================
--- /src/robot/htmldata/rebot/log.js    Wed Apr 16 10:42:06 2014 UTC
+++ /src/robot/htmldata/rebot/log.js    Wed Apr 16 18:29:42 2014 UTC
@@ -159,6 +159,11 @@
         return null;
     }
 }
+
+function selectMessage(parentId) {
+    var element = $('#' + parentId).find('.message')[0];
+    selectText(element);
+}

 function selectText(element) {
     // Based on http://stackoverflow.com/questions/985272

--

--- You received this message because you are subscribed to the Google Groups "robotframework-commit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to