bookmark - Alpha R2 Astahost Credits Reporting Extension

Alpha R2 Astahost Credits Reporting Extension

 
 Discussion by miCRoSCoPiC^eaRthLinG with 22 Replies.
 Last Update: December 14, 2005, 10:56 am (View Latest)
Page 1 of 2 pages.
bookmark - Alpha R2 Astahost Credits Reporting Extension  
    
free web hosting
 
Hi guys,
[tab][/tab]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 :) - 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:
[Attachment: #308]
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:
extension5nl.jpg

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:
rightclick8vi.jpg


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

[note=miCRoSCoPiC^eaRthLinG]
As of now the following details has to be entered to make it work:
Username: micro
Password: mpass
[/note]

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 :huh: Oh yeah - that's what I'm waiting for anxiously :P Have fun ...

Regards,
m^e

Wed Dec 7, 2005    Reply    New Discussion   


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?

Wed Dec 7, 2005    Reply    New Discussion   

Works like a charm for me :huh:

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. :)

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 :P

Regards
Dhanesh.

Wed Dec 7, 2005    Reply    New Discussion   

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.

Wed Dec 7, 2005    Reply    New Discussion   


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?

Wed Dec 7, 2005    Reply    New Discussion   

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 :huh: 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

Wed Dec 7, 2005    Reply    New Discussion   

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

Thu Dec 8, 2005    Reply    New Discussion   

QUOTE (miCRoSCoPiC)

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:
rightclick8vi.jpg
Once you select the configure option you'll get a dialog box like this:
configure3ip.th.jpg
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 :huh:

Regards
Dhanesh.

Thu Dec 8, 2005    Reply    New Discussion   

QUOTE (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



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 :huh: 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

Thu Dec 8, 2005    Reply    New Discussion   

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.

Thu Dec 8, 2005    Reply    New Discussion   

I just dont get it. I reinstalled my whole system today - wiped everything out and started with a fresh copy of XP. And to specifically test this problem, I downloaded the already published extension from this thread myself and installed it. THE RIGHT-CLICK MENU APPEARS JUST FINE FOR ME !!!! Now how the heck am I supposed to spot this bug :huh: It's like when the doctor is close by the disease runs away... Urggghhhhhhhh !!

Thu Dec 8, 2005    Reply    New Discussion   

when I right click on the extenstion it works for me...I get the pop up menu with the following options: Configure Credit Systems..., visit Astahost Forums, and About. Left clicking gives me a quick refresh.

Fri Dec 9, 2005    Reply    New Discussion   

QUOTE (Logan Deathbringer)

when I right click on the extenstion it works for me...I get the pop up menu with the following options:  Configure Credit Systems..., visit Astahost Forums, and About.  Left clicking gives me a quick refresh.




THANK GOD man.. finally it works for someone.. all this while the rest of them led me to believe I was hallucinating about the right-click menu... lol.. I was very confuzzled - why it wouldn't come up for others, when it did for me EVERYTIME. But yeah.. relief.. EUREKA !!! IT WORKS !!! :huh:

Fri Dec 9, 2005    Reply    New Discussion   

You better check, what computer specs users have here, maybe you and logan have the same configuration, so you can see the right-click-menu, as for me, I can't see it :huh:

Fri Dec 9, 2005    Reply    New Discussion   

QUOTE (finaldesign)

You better check, what computer specs users have here, maybe you and logan have the same configuration, so you can see the right-click-menu, as for me, I can't see it :huh:



m^e .. just a thought .. do u have a beta build of FF ? or a Developer release sumthing like it ? cause we normally download from the link givin at the FF site. There could also be some programs installed on your PC and Logans PC which effect the working of ur extension, as in they could be inter-related with its working, like PHP or apache ?

I think if you re-installed the system and installed NO other program other than FF and then tried out .. maybe that would help, if it works that time then i guess we have some problem in configurations.

Regards
Dhanesh.

Fri Dec 9, 2005    Reply    New Discussion   

Quickly Post to Alpha R2 Astahost Credits Reporting Extension  w/o signup Share Info about Alpha R2 Astahost Credits Reporting Extension  using Facebook, Twitter etc. email your friend about Alpha R2 Astahost Credits Reporting Extension Print
Reply / Comment Ask a Question? Share / Bookmark E-Mail a Friend Print


Alpha Release Astahost Credits Reporting Extension for Firefox, of course  Alpha Release Astahost Credits Reporting Extension for Firefox, of course (9) (1) Ajax Shoutbox For IPB - Beta 2 Release   Ajax Shoutbox For IPB - Beta 2 Release