]> git.wh0rd.org - tt-rss.git/commitdiff
rework floatingtitle
authorAndrew Dolgov <fox@fakecake.org>
Wed, 10 Jul 2013 18:11:24 +0000 (22:11 +0400)
committerAndrew Dolgov <fox@fakecake.org>
Wed, 10 Jul 2013 18:11:24 +0000 (22:11 +0400)
css/cdm.css
images/page_white_go.png [new file with mode: 0644]
js/viewfeed.js

index 7e85cbfff6364b0033e23f735491e2f5eab8df17..2d0797db369773fabc9ffc8d3387507ede95d3a2 100644 (file)
@@ -230,39 +230,71 @@ div.cdmHeader span.author {
 div#floatingTitle {
        position : absolute;
        z-index : 5;
-       top : 30px;
-       right : 20px;
-       border : 1px solid #ccc;
-       background : white;
-       border-radius : 3px;
-       box-shadow : 0px 0px 3px 0px rgba(0,0,0,0.1);
+       top : 26px;
+       right : 0px;
+       left : 0px;
+       border-color : #ccc;
+       border-width : 0px 0px 1px 0px;
+       border-style : solid;
+       background : #fcfcfc;
        color : #555;
-       font-size : 10px;
-       padding : 3px;
+       box-shadow : 0px 1px 1px 0px rgba(0,0,0,0.1);
 }
 
 div#floatingTitle > * {
        display : table-cell;
        white-space : nowrap;
        vertical-align : middle;
+       padding : 9px 5px;
 }
 
-div#floatingTitle span.titleWrap {
-       max-width : 200px;
-       overflow : hidden;
-       text-overflow : ellipsis;
+div#floatingTitle img {
+       margin-right : 4px;
+       margin-left : 4px;
 }
 
-div#floatingTitle img {
-       padding-right : 3px;
+div#floatingTitle span.author {
+       color : #555;
+       font-size : 11px;
+       font-weight : normal;
+}
+
+div#floatingTitle a.title {
+       font-size : 14px;
+       color : #999;
+       font-weight : bold;
+}
+div#floatingTitle img.anchor {
+       margin-right : 1px;
+       margin-left : 0px;
+}
+
+div#floatingTitle div.hlFeed {
+       padding-right : 10px;
+       color : #555;
+       font-weight : normal;
+       font-style : italic;
+       font-size : 11px;
+       white-space : nowrap;
+}
+
+div#floatingTitle span.updated {
+       padding-right : 10px;
+       white-space : nowrap;
+       color : #555;
+       font-size : 11px;
+}
+
+div#floatingTitle div.hlFeed a {
+       color : #555;
+}
+
+div#floatingTitle span.titleWrap {
+       width : 100%;
 }
 
-div#floatingTitle .dijit, 
-div#floatingTitle span.updated, 
-div#floatingTitle div.scoreWrap,
-div#floatingTitle div.hlFeed, 
-div#floatingTitle span.author, 
-div#floatingTitle img.tinyFeedIcon {
+div#floatingTitle .dijit,
+div#floatingTitle img.hlScorePic { 
        display : none;
 }
 
diff --git a/images/page_white_go.png b/images/page_white_go.png
new file mode 100644 (file)
index 0000000..7e62a92
Binary files /dev/null and b/images/page_white_go.png differ
index 0cdb094252b6bd62cf20055fdf9e1b47d8f56e67..ec7706547d47893d6e3568397acbb6c0ba2c5a44 100644 (file)
@@ -2215,27 +2215,54 @@ function openSelectedAttachment(elem) {
        }
 }
 
+function scrollToRowId(id) {
+       try {
+               var row = $(id);
+
+               if (row)
+                       $("headlines-frame").scrollTop = row.offsetTop;
+
+       } catch (e) {
+               exception_error("scrollToRowId", e);
+       }
+}
+
 function updateFloatingTitle() {
        try {
                var hf = $("headlines-frame");
                var child = $("RROW-" + _active_article_id);
 
-               if (child && child.offsetTop + child.offsetHeight > hf.scrollTop) {
+               var elems;
 
-                       var header = child.getElementsByClassName("cdmHeader")[0];
+               if (getInitParam("cdm_auto_catchup"))
+                       elems = [$$("RROW-" + _active_article_id)];
+               else
+                       elems = $$("#headlines-frame > div[id*=RROW]");
 
-                       if (child.id != $("floatingTitle").getAttribute("rowid")) {
-                               $("floatingTitle").setAttribute("rowid", child.id);
-                               $("floatingTitle").innerHTML = header.innerHTML;
+               for (var i = 0; i < elems.length; i++) {
 
-                               PluginHost.run(PluginHost.HOOK_FLOATING_TITLE, child);
-                       }
+                       var child = elems[i];
 
-                       if (child.offsetTop < hf.scrollTop - header.offsetHeight - 100 &&
-                                       child.offsetTop + child.offsetHeight - hf.scrollTop > 100)
-                               Element.show("floatingTitle");
-                       else
-                               Element.hide("floatingTitle");
+                       if (child && child.offsetTop + child.offsetHeight > hf.scrollTop) {
+
+                               var header = child.getElementsByClassName("cdmHeader")[0];
+
+                               if (child.id != $("floatingTitle").getAttribute("rowid")) {
+                                       $("floatingTitle").setAttribute("rowid", child.id);
+                                       $("floatingTitle").innerHTML = header.innerHTML;
+                                       $("floatingTitle").firstChild.innerHTML = "<img class='anchor markedPic' src='images/page_white_go.png' onclick=\"scrollToRowId('"+child.id+"')\">" + $("floatingTitle").firstChild.innerHTML;
+
+                                       PluginHost.run(PluginHost.HOOK_FLOATING_TITLE, child);
+                               }
+
+                               if (child.offsetTop < hf.scrollTop - header.offsetHeight)
+                                       Element.show("floatingTitle");
+                               else
+                                       Element.hide("floatingTitle");
+
+                               return;
+
+                       }
                }
 
        } catch (e) {