Nov 22, 2009
Pages: 1, 2, 3

Alpha R2 Astahost Credits Reporting Extension

free web hosting

Read Latest Entries..: (Post #22) by ruben on Dec 14 2005, 10:56 AM.
Works fine for me on Mac. Sad thing I don't use Firefox that much. I'll try making it into a widget though. The right-clicking thing works for me (even though I have to ctrl-click to simulate right-click.It's cool, thanks a lot. When will the personalized version come out?
Read the FIRST post of this Topic. - Express your Opinion! Contribute Knowledge :-).

Open Discussion & Free Web Hosting > Computers & Tech > Programming > Scripting > JavaScript

Alpha R2 Astahost Credits Reporting Extension

miCRoSCoPiC^eaRthLinG
Hi guys,
    Am back with a bunch of bugfixes and a pre-packed extension this time. All those crazy error have been taken care of (of course to be surpassed by another batch of reports from you all tongue.gif - that's life). Anyway, this time I've ensured that you don't have to undergo any complicated setup process. The extension is packed in the usual .xpi format - so you just drag and drop it into your extension window and restart firefox.

Requirements:
1. Firefox 1.5 and above - this WONT WORK with any versions below 1.5 because extension packaging format is quite different.

2. The Astahost Credits Reporting Extension attached below:
Click to view attachment
You need to download this file first.


Step 1: Installation:
It's a two step process - start up Firefox and open the Tools > Extensions window. Next you just drag this extension from Windows Explorer and drop it onto the Extensions window. You might receive a warning saying UNSIGNED Extension. Simply ignore it and press INSTALL.

Once the installation is finished, you've to CLOSE AND RESTART Firefox - otherwise the extension won't show up in your status bar. A screenshot is given below:
user posted image

When you restart Firefox you might get a warning that says: Authentication details not entered. Cannot fetch credit information. Not to worry. Simply proceed to step 2.



Step 2: Configuration
You need to set an username and password (which will eventually be your own forum username+password). Without setting these, the extension won't be able to fetch credts. To enter these details, you can Right-Click on the extension in the statusbar and choose Configure Credits Extension from the menu. See snapshot below:
user posted image


Once you select the configure option you'll get a dialog box like this:
user posted image
This is where you enter your forum username and password.

Notice from miCRoSCoPiC^eaRthLinG:

As of now the following details has to be entered to make it work:
Username: micro
Password: mpass


You can try out other combinations too - but you'll get respective error messages in each case (invalid username and/or password).



Step 3: Testing
Left-Click on the extension as many times as you want - it should report you with a random credits count everytime you click and the icon should change color along with the various credit counts.



SO what are you waiting for ? DOWNLOAD IT NOW - and flood me in with bug reports again sad.gif Oh yeah - that's what I'm waiting for anxiously tongue.gif Have fun ...

Regards,
m^e

 

 

 


Comment/Reply (w/o sign-up)

techocian
What would you recommend really as a person who as experience in this type of coding because I've never exactly messed around with these stuff but I'd like to try it out. Probably later when Viz gives the all-clear sign eh?

Comment/Reply (w/o sign-up)

dhanesh
Works like a charm for me smile.gif

For a few newbz like me who can/cannot figure out how to start ..
1) Download
2) Install ( As m^e mentioned in the first post )
3) AFTER you restart, you will get an error saying "Failed to load authentication details. quiet possibly username/password hasent been set" , not to worry, go to Tools > Extensions > and right click on the Hosting Credits Extension > Options ... and enter user: micro , Pass: mpass > HIT OK > close the extensions window.
4) At the bottom right, u'll see asta icon with the Credits: XX days .. Left click to refresh. If you dont see the Credits, just try restarting the browser again. smile.gif

Btw, just a thought, cant there be like a 30 Mins option ? 1 hr seems long .. thats just my view .. how about the rest.

All said and done, it works just fine with me, A real helpful tool for all asta members .. Keep those "works of art" comming .. Good Job m8 smile.gif

Regards
Dhanesh.

 

 

 


Comment/Reply (w/o sign-up)

miCRoSCoPiC^eaRthLinG
Question here - why are you going through such a wanderous route (Tools > Extensions > and right click on the Hosting Credits Extension > Options) to get to the configuration menu ?

It should be available even when you right-click on the extension in the status bar. It should pop-up a menu with three items:
1. Configure Credits Extension
2. Visit Astahost
3. About

Let me know if you guys can't see this menu - coz wherever I tried it earlier on (3 different computers) - it always worked for me.

Comment/Reply (w/o sign-up)

vizskywalker
right click menu = no go, the password works, and all, with seemingly random refreshes of credits (I'm assumiong it's supposed to do that) but right clicking does nothing.

~Viz

P.S. Is there anyway to see the code to the extension?

Comment/Reply (w/o sign-up)

vizskywalker
O looked at the code in credits.js and found the following function: creditsClicked(event). THis function had a handler for if the credits were clicked with left mouse button, but no right mouse button handler.
CODE
// Function to handle mouse-click on Statusbar Item
function creditsClicked(event) {

// Left button click
if ( event.button == 0 ) {
 
 // Refresh the stats
 refreshCredits();

 return true;
 
}

} // end function

Also, in options.js there did not seem to be any code for a menu, nor was there in credits.js

So either, a) you don't have them in this version, or cool.gif something went terribly wrong. And you probably know this, but the number for the event.button to handle right click is 2 (cause 1 is mouse wheel).

~Viz

Comment/Reply (w/o sign-up)

Logan Deathbringer
ok think it is a great extention but I can't get it to work...I enter my username and password then refresh it and I get an Invalid username error...I'll try again

Comment/Reply (w/o sign-up)

dhanesh
QUOTE(miCRoSCoPiC^eaRthLinG @ Dec 7 2005, 11:51 PM)
Step 2: Configuration
You need to set an username and password (which will eventually be your own forum username+password). Without setting these, the extension won't be able to fetch credts. To enter these details, you can Right-Click on the extension in the statusbar and choose Configure Credits Extension from the menu. See snapshot below:
user posted image
Once you select the configure option you'll get a dialog box like this:
user posted image
This is where you enter your forum username and password.

As of now the following details has to be entered to make it work:
Username: micro
Password: mpass

You can try out other combinations too - but you'll get respective error messages in each case (invalid username and/or password).
*



Heya logan .. m^e has stated that this plugin is ONLY for testing as of now .. the username and passwords feature of individual posters would be added to the final release smile.gif

Regards
Dhanesh.

Comment/Reply (w/o sign-up)

miCRoSCoPiC^eaRthLinG


QUOTE(vizskywalker @ Dec 8 2005, 05:05 AM)
O looked at the code in credits.js and found the following function: creditsClicked(event).  THis function had a handler for if the credits were clicked with left mouse button, but no right mouse button handler.
CODE
// Function to handle mouse-click on Statusbar Item
function creditsClicked(event) {

// Left button click
if ( event.button == 0 ) {
 
 // Refresh the stats
 refreshCredits();

 return true;
 
}

} // end function



That's not where the menu's specified. Infact XUL provides you with a very efficient mechanism of linking pop-up menu's with right-click. You do not need to define the right-click event. What you see here is for the left-click, since if calls a DISTINCT funtion - so the button has to be checked for and the required routine called.

But first - a short word about the structure of extensions. Firefox extensions are typically built by using a combination of XUL and Javascript files. XUL files are the ones which define and give shape to your extension - or in other words, are responsible for the VISUAL MANIFESTATION (UI) of your extension - and also links the appropriate Javascript routines with these VISUAL ELEMENTS.

The actual Javascript routines are usually placed in another file with a matching filename - as in this case, credits.xul and credits.js. They carry out whatever-is-to-be-done when a UI element receives a particular EVENT - such as a Key-Click or Mouse-Click.

As for the right-click menu, think of it as the same kind that you get in almost all applications in Windows - it's commonly known as the CONTEXT MENU. Take a look into the credits.xul file. Around line 12, you'll find a section like the following:
CODE

<popupset>

 <popup id="configMenu" position="after_start">
 
  <menuitem label="&crs.config;" accesskey="&crs.config.accesskey;" oncommand="creditsOptions();" />
  <menuitem label="&crs.visit;" accesskey="&crs.visit.accesskey;" oncommand="visitHostingForum();" />
  <menuseparator/>
  <menuitem label="&crs.about;" accesskey="&crs.about.accesskey;" oncommand="aboutDialog();" />
 
 </popup>
 
</popupset>


This is what defines a popup menu with the name/id configMenu, and associates three menuitems with it - each of which call a particular function upon being clicked. Notice how the popupset - which stands for a pop-up control encloses the menu items individually define by the menuitem tags. Also notice each item is linked with a corresponding routine using the oncommand attribute. These routines, as I mentioned earlier, can be found in the credits.js file.

Next look a little down - same file around line 25.
CODE

<statusbar id="status-bar">

 <statusbarpanel id="hostingCreditsStatus" style="width: 150px;" context="configMenu" onclick="return creditsClicked(event);">
 
  <hbox>
 
   <image id="creditsIcon" src="chrome://creditsreporter/skin/alert_blue.gif" />
   <!-- <label id="creditsTitle" value="&crs.credits;" style="width: 65px;" align="left" /> -->
   <label id="creditsLabel" value="0" align="left" />
 
  </hbox>
 
 </statusbarpanel>
 
</statusbar>


The first element defined is the statusbar - which tells FF to add whatever is enclosed in between into the statusbar. The immediately next tag defines a statusbarpanel - a panel, which encases further controls - itself being a distinct segment in the statusbar.

This is where we define the context menu - which by default comes up using the right-click. See how this statusbarpanel defines an attribute called context - which directly points to the pop-up element. This is a very clever trick I must say .. instead of trying to define a context menu using javascript and what not, you simply define a separate pop-up and link that to the context of some other element.... This entirely eliminates the need to write separate event handlers for the right-click.


QUOTE
Also, in options.js there did not seem to be any code for a menu, nor was there in credits.js

So either, a) you don't have them in this version, or cool.gif something went terribly wrong.  And you probably know this, but the number for the event.button to handle right click is 2 (cause 1 is mouse wheel).

~Viz
*



Check out your files and see if you can spot the abovementioned portions. I've checked and rec-checked many times over and it ALWAYS comes up for me.. the code is also there in the files I'd uploaded..

So let me know - this is a very baffling problem.. might be I'll have to head for the mozdev forums.


Regards,
m^e

Comment/Reply (w/o sign-up)

dhanesh
Ok, I went through the posts again but i dont know if this is a bug , but
Left-Click = Refresh : WORKING
Right-Click = NOT WORKING .. It doesnt show any menu
Is this correct ?

Regards
Dhanesh.

Comment/Reply (w/o sign-up)

Latest Entries

ruben
Works fine for me on Mac. Sad thing I don't use Firefox that much. I'll try making it into a widget though. The right-clicking thing works for me (even though I have to ctrl-click to simulate right-click.
It's cool, thanks a lot. When will the personalized version come out?

Comment/Reply (w/o sign-up)

Logan Deathbringer
Ok just to let you know what I'm running here:

Firefox 1.5
WinXP SP2 (completely updated)
Intel P4 2.0 Ghz
786 megs PC 2700 RAM
ATI Radeon 9200

Comment/Reply (w/o sign-up)

miCRoSCoPiC^eaRthLinG
That explains - this extension isn't supposed to be used with any version below Firefox 1.5 - that is clearly stated in my first post in this thread.

The fact is that the way extensions were packaged has changed a lot starting from Firefox 1.5 - and even this extension is no exception. The mismatch in packaging as well as the new concept of chrome registry - all together makes extensions designed for this version not compatible with the older ones. I don't know how you managed to install it in the first place - coz it should have given you an warning about version mismatch and aborted the installation.

Anyway, if you upgrade to the new firefox, it surely will work for you smile.gif

Comment/Reply (w/o sign-up)

PureHeart
QUOTE(miCRoSCoPiC^eaRthLinG @ Dec 11 2005, 01:12 AM)
Hey how come - are you receiving any sort of error messages ?? What version of FF are u using ? Is it one of the nightly builds ? Cant you give me sort more details please .. will help me figure out the bugs.
*



There's no error message here. I'm using FireFox version 1.0.7 (offical, not a nightly build). And here's the screenshoot.

user posted image

Comment/Reply (w/o sign-up)

miCRoSCoPiC^eaRthLinG
QUOTE(PureHeart @ Dec 10 2005, 10:23 PM)
It doesn't work for me, the FF stop responding when I click Option. Nothing is shown at the status bar.
*




Hey how come - are you receiving any sort of error messages ?? What version of FF are u using ? Is it one of the nightly builds ? Cant you give me sort more details please .. will help me figure out the bugs.

Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Pages: 1, 2, 3

See Also,

*SIMILAR VIDEOS*
Searching Video's for alpha, r2, astahost, credits, reporting, extension
advertisement



Alpha R2 Astahost Credits Reporting Extension

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com