MozillaZine


[Ext] userChrome.js

Announce and Discuss the Latest Theme and Extension Releases.
dougeeebear

User avatar
 
Posts: 548
Joined: September 15th, 2005, 4:17 pm

Post Posted May 30th, 2006, 11:25 am

JNewbry wrote:Oh yeah... I've got a version of CEP SE for dev testing.... Feeling Brave?

Absolutely!

KidReefer

User avatar
 
Posts: 141
Joined: May 7th, 2006, 6:10 am
Location: Earth...mainly

Post Posted May 30th, 2006, 11:31 am

zeniko wrote:
KidReefer wrote:Can statusbar icons be relocated to a toolbar?

Probably yes, but you might have to do quite some non-trivial hacking to achieve this. In the general case it's much easier to ask the author responsible for the status bar icon to offer an optional toolbar button as well.

KidReefer wrote:Whats the best way(s) to learn to write my own scripts?

That'd be reading through the scripts posted in this thread and trying to figure out what they're doing. If you don't know what a certain function does, try searching for it at the MDC or over at XULPlanet (see the extension development entry in the Knowledge Base for further links). If you think you understand what's going on, try modifying the scripts - and if they still do what you expect, you're about ready to write your own...


Many, Many thanks. Good reference with the links, Just what I was lookin for.

DMCrimson
 
Posts: 1025
Joined: February 13th, 2004, 6:11 am

Post Posted May 30th, 2006, 2:45 pm

Zoolcar9 wrote:<code>id="edit_userChrome_xul"</code>


almost...
Code: Select all
menuitem[id="userChrome_xul"] {
list-style-image: url("chrome://local_install/skin/classic/local_install/edit16x16.png") !important;
}


worked with
/* This script will add "Edit userChrome.js"
and "Edit userChrome.xul" menuitems in
MR Tech Local Install's Edit Config Button Menu
Version date: 20060528 */

KidReefer

User avatar
 
Posts: 141
Joined: May 7th, 2006, 6:10 am
Location: Earth...mainly

Post Posted May 31st, 2006, 6:30 am

DMCrimson wrote:
Zoolcar9 wrote:<code>id="edit_userChrome_xul"</code>


almost...
Code: Select all
menuitem[id="userChrome_xul"] {
list-style-image: url("chrome://local_install/skin/classic/local_install/edit16x16.png") !important;
}


worked with
/* This script will add "Edit userChrome.js"
and "Edit userChrome.xul" menuitems in
MR Tech Local Install's Edit Config Button Menu
Version date: 20060528 */

I cant seem to get it to work. Do I use stylish?

DMCrimson
 
Posts: 1025
Joined: February 13th, 2004, 6:11 am

Post Posted May 31st, 2006, 7:29 am

nope, it seemed to work, but didn't after all. neither does the id="edit_userChrome_xul" work.

DMCrimson
 
Posts: 1025
Joined: February 13th, 2004, 6:11 am

Post Posted May 31st, 2006, 8:16 am

Solved it by editing the very code-snippet Zoolcar9 posted to add them entries to MTLI's menus:
find similar lines and paste this in there:
Code: Select all
menuitem.setAttribute("image="chrome://local_install/skin/classic/local_install/edit16x16.png" );


(edit the chrome-url to refer to image you want to use, I decided to keep it unified:) )

JNewbry

User avatar
 
Posts: 321
Joined: April 9th, 2005, 3:56 am
Location: Dallas,TX

Post Posted May 31st, 2006, 8:34 am

You might find this to be easier:
Code: Select all
menuitem[label="Edit userChrome.xul"] {
list-style-image: url("chrome://local_install/skin/edit16x16.png") !important;
}
<a href="http://webdesigns.ms11.net/chromeditp.html" target="_blank">ChromEdit Plus</a> | <a href="http://webdesigns.ms11.net/winstripethemes.html" target="_blank">Firefox Themes</a>

DMCrimson
 
Posts: 1025
Joined: February 13th, 2004, 6:11 am

Post Posted May 31st, 2006, 9:32 am

JNewbry: that works better:) I restarted and the entry vanished, no icon, no menu item at all! strange...

XerBlade

User avatar
 
Posts: 865
Joined: October 4th, 2005, 10:45 pm
Location: Nashville, TN, US

Post Posted June 1st, 2006, 8:58 pm

DMCrimson: I didn't test or anything, but, on first glance, I see you have an open quote with no closing quote in that line....
And, in JS, that sort of thing usually makes a big difference. Just thought I'd mention it.

But anyway, besides that, the implementation does not look remotely correct at a glance. The function setAttribute takes an argument as the attribute to be set, followed by a comma (standard JS separator between things to be sent to a function), followed by the value to be set to that attribute. A line using the assignment operator shouldn't even make sense there.
User Agent
Extensions
AMD64/2.41GHz RAM/1.0GB ATI/256MB-GDDR3/128-bit/8xAGP Cable6.0M/384kbps

KidReefer

User avatar
 
Posts: 141
Joined: May 7th, 2006, 6:10 am
Location: Earth...mainly

Post Posted June 2nd, 2006, 1:18 am

Why is it that the icon shows in the menu for edit userChrome.js with no tweak
But not for userChrome.xul?? I cant get any of the tweaks (or any of my variations) to work. Looked in MrTechLI's jar file, didnt seem to find anything?????

KidReefer

User avatar
 
Posts: 141
Joined: May 7th, 2006, 6:10 am
Location: Earth...mainly

Post Posted June 2nd, 2006, 1:56 am

Why is it that the icon shows in the menu for edit userChrome.js with no tweak
But not for userChrome.xul?? I cant get any of the tweaks (or any of my variations) to work. Looked in MrTechLI's jar file, didnt seem to find anything?????

DMCrimson
 
Posts: 1025
Joined: February 13th, 2004, 6:11 am

Post Posted June 2nd, 2006, 3:38 am

XerBlade: noticed that too, luckily webdev logs errors fro userChrome.* too :D

KidReefer: JNewbry's one should work?

KidReefer

User avatar
 
Posts: 141
Joined: May 7th, 2006, 6:10 am
Location: Earth...mainly

Post Posted June 2nd, 2006, 4:19 am

DMCrimson: Sweet! Thank You \:D/ I dont know how I was messing that up.(I think something got left over from previous examples)

Sorry about the double post. I sometime open double tabs when I click links, like this one ("http://comments.deviantart.com/emoticons"):-k
I cant find a reason for this???? Also http://software.hixie.ch/utilities/cgi/data/data tells me I probably have a bug since it doesnt redirect to Image. It just displays link to image. Again
I cant find a reason for this. :er: Peace

Diorser

User avatar
 
Posts: 1009
Joined: June 22nd, 2005, 6:57 am

Post Posted June 2nd, 2006, 7:57 am

"Manage Bookmarks" open in a tab

The code to open bookmarks in a tab is:
Code: Select all
tabBmkMan = getBrowser().addTab('chrome://browser/content/bookmarks/bookmarksManager.xul');
getBrowser().selectedTab = tabBmkMan;
tabBmkMan.label = 'Bookmarks Manager';

However, how to link this code to the "Manage Bookmarks" bookmark menu action ?
Thanks

old zeniko
 
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post Posted June 2nd, 2006, 8:06 am

Something like
Code: Select all
document.getElementsByAttribute("key", "manBookmarkKb")[0].setAttribute("oncommand", '(getBrowser().selectedTab = getBrowser().addTab("chrome://browser/content/bookmarks/bookmarksManager.xul")).label = "Bookmarks Manager";');

Return to Extension/Theme Releases


Who is online

Users browsing this forum: No registered users and 3 guests