Post Reply 
Status Bar: Append Time
Mar. 01, 2009, 05:03 AM
Post: #1
Status Bar: Append Time
I start running config in "Advanced Mode" and it's nice. But I see that many users are turning off "Title: Append Time, Snip Excess" rule. And I can agree with them. When I save link to a page - I have to remove the timestamp from it manually all the times.

While I found time stamp quite useful - I think the best place for it is in "Status Bar" (that why they call it so, don't they).

So, here it is. I've made some changes in two files, turned off appending stamps in title bar and now I feel happy about it (so far Smile!).

If you want to do it too - in default.cfg file - add this code right before the line "Title: Append Time, Snip Excess":
Code:
Name = "Status Bar: Append Time     0.00.00"
Active = TRUE
URL = "$TYPE(htm)$TST(keyword=*.i_level:[345].*)$SET(jsVarsT=$GET(jsVarsT)_sbTime: "$DTM(H:m:s)", )PrxFail$TST()"
Limit = 1
Match = "$STOP(This switch defaults to active in Advanced Mode and above)"

In html\sidki_h_2009-02-13\proxjs-full.js file at the end of the function "ncFinal" add:
Code:
ncFinal : function (pxSplit) {
    ...
    
    if (prxO.oSet._sbTime) {
      window.defaultStatus += " ~" + prxO.oSet._sbTime;
    }
},

Please let me know if you think that something in this code should be fixed. Thanks.
Add Thank You Quote this message in a reply
Mar. 01, 2009, 10:21 AM
Post: #2
RE: Status Bar: Append Time
Good idea! You're giving people a choice.

Works for me in Firefox 3, but only if i turn off "Page Load Time to Status Bar", due to:
Code:
// Page Load Timer Part IV.  Declare the function.
  inStatus : function () {
    window.defaultStatus = prxO.oAss.asLdStop;
    if (!window.status || status.prox) window.status = window.defaultStatus;
  }
Add Thank You Quote this message in a reply
Mar. 01, 2009, 11:31 AM
Post: #3
RE: Status Bar: Append Time
hmm, an interesting idea indeed, as a config option...
my list of favorites hasn't changed in over four YEARS (aside from a few SSL logins), so the remove timestamp in order to save a link to the page really is of NO consequence to me...
BUT from the same save-a-link perspective, snipping excess IS (why save a shortcut link with a title having 300-some characters in it?)...

so yeah, while i can see the point of moving the timestamp to the status bar (but i'd like to see a way to do that withOUT removing the page load timer), i still see the need to keep that title "snipped"...


"my two cents" Big Teeth
Add Thank You Quote this message in a reply
Mar. 01, 2009, 07:21 PM
Post: #4
RE: Status Bar: Append Time
(Mar. 01, 2009 10:21 AM)sidki3003 Wrote:  Good idea! You're giving people a choice.

Works for me in Firefox 3, but only if i turn off "Page Load Time to Status Bar", due to:
Code:
// Page Load Timer Part IV.  Declare the function.
  inStatus : function () {
    window.defaultStatus = prxO.oAss.asLdStop;
    if (!window.status || status.prox) window.status = window.defaultStatus;
  }
Hmm. It should run completely independent. And it does so in my environment. Look at this picture:

.png  SB-Time_01.png (Size: 31 KB / Downloads: 717)
As you can see the option "Page Load Time to Status Bar" is on.

Here is another picture. Now it's with "Page Load Time to Status Bar" option off:

.png  SB-Time_02.png (Size: 30.75 KB / Downloads: 729)
It's FF v3.0.5 (in case if it matters).
Add Thank You Quote this message in a reply
Mar. 01, 2009, 08:10 PM
Post: #5
RE: Status Bar: Append Time
Right! I added your JS code at the wrong position.

However, it permanently disappears when i click into the page.
Assuming that this doesn't happen because i did something wrong again, i'm almost sure that this can be fixed, by modifying above posted function (part of hpguru's code).

I have no time to look into this right now, maybe you, or someone else.
Add Thank You Quote this message in a reply
Mar. 01, 2009, 08:30 PM
Post: #6
RE: Status Bar: Append Time
(Mar. 01, 2009 08:10 PM)sidki3003 Wrote:  it permanently disappears when i click into the page.
Thank you for bringing my attention to it.

The simplest way to fix it is to add one line assigning "asLdStop":
Code:
ncFinal : function (pxSplit) {
    ...
    
    if (prxO.oSet._sbTime) {
      window.defaultStatus += " ~" + prxO.oSet._sbTime;
      prxO.oAss.asLdStop = window.defaultStatus;
    }
},
Perhaps it's not the best way, but definitely is the simplest, keeping all the rest of code untouched. Smile!
Add Thank You Quote this message in a reply
Mar. 02, 2009, 05:32 PM
Post: #7
RE: Status Bar: Append Time
Works here, sort of. Sorry, if i sound nitpicking, it's because i was thinking about adding these changes as option to the public config:

If i turn off "Page Load Time to Status Bar", switch tabs in Firefox 3, click into page, the time doesn't update.
Add Thank You Quote this message in a reply
Mar. 02, 2009, 11:21 PM
Post: #8
RE: Status Bar: Append Time
(Mar. 02, 2009 05:32 PM)sidki3003 Wrote:  If i turn off "Page Load Time to Status Bar", switch tabs in Firefox 3, click into page, the time doesn't update.
Does initial "Page Load Time to Status Bar" work for you in FF3?
If I switch tabs in FF3 it doesn't change anything in its Status Bar. Sad

It looks like FF3 doesn't handle Status Bar property by itself. You have to set "window.defaultStatus" every time the windows gets focus (and never touch "window.status", BTW). Otherwise it shows an old value Sad
IE, on the other hand, supports it properly by itself. You switch tabs and it displays appropriate data in status bar immediately.

Here is example of page that helps FF3 to show status bar correctly. But it uses onfocus handler:
Code:
<html>
<head>
<title></title>
<script type="text/javascript"><!--
function onF () {
  window.defaultStatus = 'Default Status 01';
}
window.onfocus = onF;
//--></script>
</head>

<body>
</body>
</html>
If I make couple of web pages (having different def. status numbers, of cause) and load them into different tabs of FF3 - I can toggle status bar correctly by switching those tabs.

Do we have an event of changing tabs in our code? It could be an on getting focus event or something? There would be the place to put a line to set "window.defaultStatus" appropriately.

Or may be there is just another simple solution that I do not see at the moment...
Add Thank You Quote this message in a reply
Mar. 03, 2009, 12:44 PM
Post: #9
RE: Status Bar: Append Time
(Mar. 02, 2009 11:21 PM)OZO Wrote:  Does initial "Page Load Time to Status Bar" work for you in FF3?

Yep.


Quote:If I switch tabs in FF3 it doesn't change anything in its Status Bar. Sad

Neither here. Hence, emphasized:
(Mar. 02, 2009 05:32 PM)sidki3003 Wrote:  If i turn off "Page Load Time to Status Bar", switch tabs in Firefox 3, click into page, the time doesn't update.


Quote:It looks like FF3 doesn't handle Status Bar property by itself.

Yeah, old Mozilla bug. No Expression


Quote:Do we have an event of changing tabs in our code? It could be an on getting focus event or something?

The tab listeners in Firefox are "chrome only", thus not accessible via content scripts.


I didn't try with an onfocus listener. Mainly because that event fires more often than i wish it would.
OTOH, using that handler would be more elegant...

What i do is plugging above posted "inStatus" function into the onclick listener (which is already there for the Prox menu).

Anyway, i can look into this (some time later). Smile!
Add Thank You Quote this message in a reply
Mar. 03, 2009, 05:41 PM
Post: #10
RE: Status Bar: Append Time
For this test i picked up your idea to listen to onfocus.

obsolete:
Code:
Page Load Time to Status Bar     7.09.05 (fail) [hp] (d.1 l.3)

new:
Code:
[Patterns]
Name = "Status Bar: Add Page Load Timer     9.03.03 (fail) [hp] (d.1 l.3)"
Active = TRUE
URL = "$TYPE(htm)$TST(keyword=*.i_level:[345].*)$SET(jsVarsB=$TST(jsVarsB=(*$toDo: )\1(0|$SET(3=+)([^,]+)\2) \4)\1\2\316\4)PrxFail$TST()"
Limit = 1
Match = "$STOP(This filter isn't supposed to get that far)"

Name = "Status Bar: Add Time     9.03.01 (fail) [ozo] (o.1 l.4) TEST"
Active = FALSE
URL = "$TYPE(htm)$TST(keyword=*.i_level:[345].*)$SET(jsVarsT=$GET(jsVarsT)_sbTime: "$DTM(H:m:s)", )PrxFail$TST()"
Limit = 1
Match = "$STOP(This filter isn't supposed to get that far)"

Name = "Status Bar: Add Last-Modified or ETag     9.03.03 (fail) [sd] (o.1 l.4) TEST"
Active = FALSE
URL = "$TYPE(htm)(^$TST(keyword=*.(a_title|i_level:[123]).*))($IHDR(Last-Modified:( ) ???, \1(:|)?? GMT)|(^$TST(\1=*))$IHDR(ETag:( ) (^PrxMsg)?*)$SET(1=ETag))$SET(jsVarsT=$GET(jsVarsT)_sbMod: "\1", )PrxFail$TST()"
Limit = 1
Match = "$STOP(This filter isn't supposed to get that far)"


old:
Code:
// Page Load Timer Part IV.  Declare the function.
  inStatus : function () {
    window.defaultStatus = prxO.oAss.asLdStop;
    if (!window.status || status.prox) window.status = window.defaultStatus;
  }

new:
Code:
//  // Page Load Timer Part IV.  Declare the function.
//  inStatus : function () {
//    window.defaultStatus = prxO.oAss.asLdStop;
//    if (!window.status || status.prox) window.status = window.defaultStatus;
//  }

  // Set our own status if needed.
  inStatus : function () {
    window.defaultStatus = prxO.oAss.asStatus;
    if (!window.status || status.prox) window.status = window.defaultStatus;
  }


old:
Code:
// Page Load Timer Part III. - hpguru
    if (prxO.oSet.$toDo & 16) {
      prxO.oAss.asLdStop = "Load Time (sec): " +
        pxSplit + (new prxO.oAss.asDate().getTime() - prxO.oAss.asLdStart) / 1000;
      if (prxO.oiIsOp) PrxRLsetTimeout(prxO.oInt.inStatus, 0);
      else prxO.oInt.inStatus();
    }

new:
Code:
//    // Page Load Timer Part III. - hpguru
//    if (prxO.oSet.$toDo & 16) {
//      prxO.oAss.asLdStop = "Load Time (sec): " +
//        pxSplit + (new prxO.oAss.asDate().getTime() - prxO.oAss.asLdStart) / 1000;
//      if (prxO.oiIsOp) PrxRLsetTimeout(prxO.oInt.inStatus, 0);
//      else prxO.oInt.inStatus();
//    }

// Test start
    // Prepare for our status additions.
    prxO.oAss.asStatus = "";

    // Page Load Timer Part III. - hpguru
    if (prxO.oSet.$toDo & 16)
      prxO.oAss.asStatus += "Load Time (sec): " +
        pxSplit + (new prxO.oAss.asDate().getTime() - prxO.oAss.asLdStart) / 1000;

    // Time to status bar. - OZO
    if (prxO.oSet._sbTime) prxO.oAss.asStatus += " ~" + prxO.oSet._sbTime;

    // Last-Modified or ETag to status bar.
    if (prxO.oSet._sbMod) prxO.oAss.asStatus += " [" + prxO.oSet._sbMod + "]";

    if (prxO.oAss.asStatus) {
      if (prxO.oiIsOp) PrxRLsetTimeout(prxO.oInt.inStatus, 0);
      else prxO.oInt.inStatus();
      prxO.oInt.inEventAdd(window, "focus", prxO.oInt.inStatus, true);
    }
// Test end


old:
Code:
function miShow(e) {
        if (e != 1 && !prxO.oMen.meCheck(e)) return;
        if (prxO.oSet.$toDo & 16) prxO.oInt.inStatus();
        if (prxO.oMen.meImg.style.visibility == "visible") return;
        prxO.oInt.inSetCSS(prxO.oMen.meImg, "left: " +
          ((window.pageXOffset || prxO.oDoc.scrollLeft) +
          prxO.oDoc.clientWidth - prxO.oAss.asWidth - 50) +
          "px; top: " + ((window.pageYOffset || prxO.oDoc.scrollTop) +
          prxO.oDoc.clientHeight - 50) + "px; visibility: visible;");
      }

new:
Code:
function miShow(e) {
        if (e != 1 && !prxO.oMen.meCheck(e)) return;
//        if (prxO.oSet.$toDo & 16) prxO.oInt.inStatus();
        if (prxO.oMen.meImg.style.visibility == "visible") return;
        prxO.oInt.inSetCSS(prxO.oMen.meImg, "left: " +
          ((window.pageXOffset || prxO.oDoc.scrollLeft) +
          prxO.oDoc.clientWidth - prxO.oAss.asWidth - 50) +
          "px; top: " + ((window.pageYOffset || prxO.oDoc.scrollTop) +
          prxO.oDoc.clientHeight - 50) + "px; visibility: visible;");
      }



Tested in:
Fx3 -> WFM
Maxthon (tabbed, IE6) -> WFM
O9 -> Still odd status handling, but not worse than before.
Add Thank You Quote this message in a reply
Mar. 03, 2009, 08:00 PM
Post: #11
RE: Status Bar: Append Time
Now it's much better Smile!
Thanks a lot!
Add Thank You Quote this message in a reply
Mar. 03, 2009, 08:17 PM
Post: #12
RE: Status Bar: Append Time
Great, i think i'll keep it then -- Thank *you* for the idea!
Add Thank You Quote this message in a reply
Mar. 03, 2009, 08:26 PM
Post: #13
RE: Status Bar: Append Time
Glad to contribute my 2ยข Smile!
Add Thank You Quote this message in a reply
Post Reply 


Forum Jump: