You currently have Javascript disabled, to use some of the features (such as the login) you must enable it for this site
Tooltip dependent on version of FF | Custom Buttons²

Tooltip dependent on version of FF

Post & Get codes templates and info here

Postby nicholas on Wed Mar 26, 2008 2:50 pm

Code: Select all
// START ALTER TOOLTIP TEXT, DEPENDENT ON CONDITIONS
  this.hover = function() {
    var build=window.navigator.userAgent;
    if (build.match("Firefox/2.0.")) var br = "|";
    if (!build.match("Firefox/2.0.")) var br = "\n";

    var sizemode = document.documentElement.getAttribute('sizemode');
    if (sizemode == 'maximized') var mr = "Restore Down ";
    if (sizemode != 'maximized') var mr = "Maximize ";

    var mtt = custombuttons.isPref('extensions.minimizetotray.always');
    if (mtt == true) var middleFunction = "Minimize to Tray ";
    if (!mtt == true) var middleFunction = mr;

    this.tooltipText = "L = Minimize " +br+ " M = " + middleFunction +br+ " R = Close";
  }
// END ALTER TOOLTIP TEXT, DEPENDENT ON CONDITIONS


this.setAttribute('onmouseover', 'this.hover();' );
User avatar
nicholas
Admin
Admin
 
Posts: 1315
Joined: Thu Jun 14, 2007 6:30 pm
Location: Los Angeles, CA

Postby squeaky on Wed Mar 26, 2008 3:05 pm

:?: Why "br"

"cr" would be more intuitive wouldn't it? As in Carriage Return.

Yes no?
Regards and stuff,
Richard.

CustomButtons2:- ver 2.0.7.5; Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14
User avatar
squeaky
Moderator
Moderator
 
Posts: 445
Joined: Sat Mar 01, 2008 8:48 am
Location: Sunny Suffolk

Postby nicholas on Wed Mar 26, 2008 10:03 pm

it's just the internal code so I didn't think it really mattered. I mean, br is what is used in html, but if you want cr then go for it!

:)
User avatar
nicholas
Admin
Admin
 
Posts: 1315
Joined: Thu Jun 14, 2007 6:30 pm
Location: Los Angeles, CA

Postby squeaky on Wed Mar 26, 2008 10:57 pm

nicholas wrote:it's just the internal code so I didn't think it really mattered. I mean, br is what is used in html, but if you want cr then go for it!

:)


Thank you :)

I thought you might have taken the hint from the thunderbird sig button! ;)
Regards and stuff,
Richard.

CustomButtons2:- ver 2.0.7.5; Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14
User avatar
squeaky
Moderator
Moderator
 
Posts: 445
Joined: Sat Mar 01, 2008 8:48 am
Location: Sunny Suffolk

Postby SCClockDr on Thu Mar 27, 2008 2:04 am

Hi All
Might I suggest a slightly different approach that preserves custombuttons.ButtonBrt & streamlines the code somewhat.

Code: Select all
// START ALTER TOOLTIP TEXT, DEPENDENT ON CONDITIONS
this.hover = function(evt) {
  let cr = "\n";
  var build=window.navigator.userAgent;
  cr = (build.match("Firefox/2.0.") == null)?  cr : "|";

  var sizemode = document.documentElement.getAttribute('sizemode');
  var mr = (sizemode.match("maximized") == null)?  "Maximize " : "Restore Down ";

  var mtt = custombuttons.isPref('extensions.minimizetotray.always');
  var middleFunction = (mtt)? "Minimize to Tray " : mr;

  this.tooltipText = "L = Minimize " +cr+ " M = " + middleFunction +cr+ " R = Close";
  if (custombuttons) custombuttons.ButtonBrt(evt);
};
// END ALTER TOOLTIP TEXT, DEPENDENT ON CONDITIONS

/*-------------------------- Show Focus Block Start --------------------------*/

this.style.opacity = '.65';
this.setAttribute('onmouseover', 'this.hover(event);' );
this.setAttribute("onmouseout", "if (custombuttons) custombuttons.ButtonDim(event);" );

/*--------------------------- Show Focus Block End ---------------------------*/
Regards
George
User avatar
SCClockDr
Admin
Admin
 
Posts: 844
Joined: Thu Jun 14, 2007 7:28 pm
Location: SC UpState


Return to Templates Codes & Tutorials

Who is online

Users browsing this forum: • Registered: 0 and 0 guests