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

Mouse Handler

Post your extension support questions here

Postby SCClockDr on Wed Mar 12, 2008 12:12 pm

Pastebin at will!
Custom Buttons²: V2.0.7.5
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13
User avatar
SCClockDr
Admin
Admin
 
Posts: 824
Joined: Thu Jun 14, 2007 7:28 pm
Location: SC UpState

Postby squeaky on Wed Mar 12, 2008 12:18 pm

Done as a BB-code button. Is that OK?

If you get yourself into a text box the demo will actually paste the highlight images into it.

But the "alert" tells it all really. :)

For a bet what I really need there is a personal custom popup available on middleclick instead of a menu.
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 adrienne on Wed Mar 12, 2008 2:02 pm

squeaky wrote:For a bet what I really need there is a personal custom popup available on middleclick instead of a menu.
Code: Select all
this.showPopup = function(node) {
var popup = document.getElementById("custombuttons-contextpopup");
var x = node.boxObject.x;
var y = node.boxObject.y + node.boxObject.height;
document.popupNode = node;
popup.document.getElementById(node, x, y, "popup", null, null);
}
this.setAttribute("onclick", "this.showPopup(this);");
This works. You can change "document.getElementById" to popup of any extension. Also change "showPopup" to "showPopup1" if code is in button. Problem I have is putting menu items in "var popup". I try changing
Code: Select all
var mP=document.createElement('menupopup');
for (var i=0;i<apps.length;i++){
if (apps[i] =='separator'){
mP.appendChild(document.createElement('menuseparator'));
}
else
{
if (!apps[i] [3]) apps[i] [3]='';
mP.appendChild(nMItem(apps[i] [0],apps[i] [1],apps[i] [2],apps[i] [3],this));
}
}
this.appendChild(mP);
every way I can think of and nothing works. 8-(
adrienne
Registered User
Registered User
 
Posts: 36
Joined: Wed Feb 06, 2008 3:15 pm

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

for the record...

What version of Custom Buttons2 are you using adrienne?
Custom Buttons²: v.2.0.7.7
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.4) Gecko/2008111318 Ubuntu/8.04 (hardy) Firefox/3.0.4
User avatar
nicholas
Admin
Admin
 
Posts: 1152
Joined: Thu Jun 14, 2007 6:30 pm
Location: Atlanta, GA USA

Postby SCClockDr on Wed Mar 12, 2008 2:36 pm

Hi Squeaky

Please look at Current gShowPopup code in the pastebin. This code ensures your popup function will correctly emulate Custom Buttons2 and function in FF3 using the correct code. This should also work in custom buttons version 0.0.2.6 etc.
Custom Buttons²: V2.0.7.5
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13
User avatar
SCClockDr
Admin
Admin
 
Posts: 824
Joined: Thu Jun 14, 2007 7:28 pm
Location: SC UpState

Postby squeaky on Wed Mar 12, 2008 2:43 pm

This line is wrong:-

if (!apps[i] [3]) apps[i] [3]='';

Missing opening brace:-

if (!apps[i] [3]) { apps[i] [3]='';

Then you'll also need an extra one at the end by the looks of it.

I often lose track of braces, so when there's a problem I start with a closed fist, rwead through, and open one finger every time I open a brace and close one every time I close a brace. I should have no fingers open by the end :)

Try this:-
Code: Select all
var mP=document.createElement('menupopup');

for (var i=0;i<apps.length;i++){

if (apps[i] =='separator'){
mP.appendChild(document.createElement('menuseparator'));
   }
   else
   {
if (!apps[i] [3]) {
  apps[i] [3]='';
mP.appendChild(nMItem(apps[i] [0],apps[i] [1],apps[i] [2],apps[i] [3],this));
    }
  }
}
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

Previous

Return to Support

Who is online

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