How to add icon on Customize Toolbar? - firefox

I am trying to add a button on the Customize Tool Window on Firefox 4
My folders look like this:
addon
|- content
|- om
|- xul
|- browser.xul
|- browser.css
|- skin
|- default
|- icon.png
My chrome.manifest file:
content orkutmanager content/om/
content orkutmanager content/om/ contentaccessible=yes
skin orkutmanager default skin/default/
locale orkutmanager en-US locale/en-US/
overlay chrome://global/content/browser.xul chrome://orkutmanager/content/xul/browser.xul
My browser.xul file:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="chrome://orkutmanager/content/xul/browser.css"?>
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<toolbarpalette id="BrowserToolbarPalette">
<toolbarbutton id="orkutmanager-button" label="OM"
class="toolbarbutton-1 chromeclass-toolbar-additional"
tooltiptext="Orkut Manager"/>
</toolbarpalette>
</overlay>
Accessing chrome://orkutmanager/content/xul/browser.xul gets me to a blank page, which means the file was found. (Should something be rendered?).
Accessing chrome://global/content/browser.xul gets me to an error page:
Firefox can't find the file at jar:file:///C:/Program Files (x86)/Mozilla Firefox 4.0 Beta 7/omni.jar!/chrome/toolkit/content/global/browser.xul
Isn't this file supposed to exist? Did it move? How can I add an icon on the Customize Toolbar window?

Apparently I should post this as an answer for accepting:
http://forums.mozillazine.org/viewtopic.php?f=38&t=934345
seems to demonstrate roughly the problem you are looking at. However, you commented that this was not correct entirely, but that it did lead to you finding the problem which was the inclusion of the filename in a different place.
For others fighting the same problem, ensure that all the new paths are up to date.
Thanks.

Instead of chrome://global/content/browser.xul it is chrome://browser/content/browser.xul.
I found a page, here, where it is explains very well how to achieve this.
In another documentation page, I found:
The CSS file with your toolbar styles
needs to be included in the overlay
file, as you would expect, but also in
the chrome.manifest file. This is very
important because the toolbar
customization dialog won't work
correctly without this. The way to
include the file in the manifest is to
add this line:
style chrome://global/content/customizeToolbar.xul chrome://xulschoolhello/skin/toolbar.css
The documentation is very messy, I was looking at one about Firefox 1.5 when I copied the url. :S

Related

In Jekyll, how does include_relative work with respect to layout files?

I have a file called default.html in my layouts folder. In default.html, I want to add a relative include to test.html, which is also in my layouts folder.
I add {% include_relative test.html }% in my default.html file to include test.html. However, when I do this, I get an error that says
"Liquid Exception: Included file './test.html' not found in
projects/[projectnmae]/layouts/default.html"
I do have my layouts folder in a different location, as specified in my configuration file. Any ideas if include_relative works in a special way here that I'm not grasping?
You can't use the include_relative tag with any files inside your layouts folder. You can only use include_relative on a page or post.
Layouts code is executed in the context of page/post rendering and the include_relative is calculated relative to this page or post, not from the layout itself.
Tracking this error in debugger shows that include_relative tries to load /home/user/www/test/_posts/test.html and not /home/user/www/test/_layouts/test.html

Liferay 6.1: Custom theme not inheriting from "Classic" theme

I've created a new theme using the Liferay Eclipse IDE and have modified build.xml to change the theme.parent to classic. Here is my complete build.xml file:
<?xml version="1.0"?>
<!DOCTYPE project>
<project name="deep-blue-theme" basedir="." default="deploy">
<import file="../build-common-theme.xml" />
<property name="theme.parent" value="classic" />
</project>
I'm not seeing any change in the theme. I still see the _styled layout being displayed. Is there anything else I need to do?
No, changing the value of the "theme.parent" property in build.xml to "classic" should be enough.
But note that classic theme doesn't contain files such as custom.css which you could easily replace "to override default styles in one central location for easier upgrade and maintenance". If you want to save all styles in the classic theme, I see two possibilities:
First approach
Copy custom.css from classic theme to "docroot/_diffs/css" folder in your project.
Then add your styles to the end of that file.
Second approach
Create custom_deep_blue.css file in your project. Here you will add your styles.
Copy main.css from classic theme to "docroot/_diffs/css" folder.
Add the following #import to the end of the main.css file:
#import url(custom_deep_blue.css);

FF extension XUL image display

If I want to show an image in my sidebar. How can I do that? I tried to do the following to no avail:
According to this: https://developer.mozilla.org/en/XUL_Tutorial/Adding_Labels_and_Images
If I add this code into my ff-sidebar.xul file:
XUL:
<image id="image1"/>
Style Sheet:
#image1 {
list-style-image: url("chrome://findfile/skin/banner.jpg");
}
The Image should be displayed. Did I pick the wrong file?
best, US
That's an example if your extension is registered in chrome with findfile:
These images come from within the chrome directory, in the skin for the findfile package.Because images vary by theme, you would usually place images in the skin directory.
And in introduction to the tutorial it says:
This tutorial will demonstrate
creating a simple find file user
interface, much like that provided by
the Macintosh's Sherlock or the find
file dialog in Windows.
So that example is in the context of the tutorial.
You need to provide it an image in your skins folder and in css use:
list-style-image: url("chrome://yourext/skin/yourfilename.jpg");

Can't deploy extension (firefox)

I am closely following the tutorial here as I attempt to create a Firefox extension. I have the following tree for my extension:
backtosearch
+-chrome
+-content
backtosearch.xul
+-chrome.manifest
+-install.rdf
I have created a testing profile for FF called "Extension Testing" and have added a file to the profile extensions folder "backtosearch#my.name" containing absolute path to the extension folder. I have reloaded the browser chrome using the extension development extension and restarted the browser - but I see no new button.
I have simplified the tutorial (as I only require one button), and my .xul contains only that. My chrome.manifest file contains:
content backtosearch chrome/content/
overlay chrome://browser/content/browser.xul chrome://backtosearch/content/backtosearch.xul
The extension is not showing under view -> toolbars or tools -> addons
Thanks for any help
install.rdf
<?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<!-- Required Items -->
<em:id>backtosearch#dylan.lloyd</em:id>
<em:name>Back To Search</em:name>
<em:version>1.0</em:version>
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>1.5</em:minVersion>
<em:maxVersion>3.5.*</em:maxVersion>
</Description>
</em:targetApplication>
<!-- Optional Items -->
<em:creator>Dylan Lloyd</em:creator>
<em:description>Adds options to return to your last search immediately.</em:description>
<em:homepageURL>http://www.getyourkeywords.com/</em:homepageURL>
</Description>
</RDF>
backtosearch#dylan.lloyd
C:\Users\Dylan\Desktop\backtosearch\
Hey I found out in moziila own documentation the mistake on this hello world.
You can read on:
https://github.com/oschrenk/firefox-extension
I had written
<RDF xmlns="http://www.w3.org/1999/02/22-RDF-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-RDF#">
<Description about="urn:mozilla:install-manifest">
as the root element, but it needs to be all lowercase
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
Just update the install.rdf =)
From your description it's not clear what the problem is. The most likely cause, as sdwilsh noted is that the Extension didn't get registered. If this is the case, the extension will not appear in Tools -> Addons.
You can try to set extensions.logging.enable pref to true to help debugging. Maybe try installing a helloworld extension first?
Possible causes:
You didn't use the correct name for the "link" file (must match the extension ID).
The "link" file contents is invalid (the path format is OS-native). In your case the path should end with "backtosearch"
Incorrect install.rdf. You can check it at least to be valid XML by opening it in Firefox (possibly renaming to .xml first) -- if the yellow screen opens, its invalid.
Installed in the wrong profile or didn't really restart Firefox.
If the extension is registered, try opening chrome://backtosearch/content/backtosearch.xul in Firefox (by copying that to the Location bar) -- if any errors appear, you should fix them. If the file loads successfully (may be empty), there's a problem with your overlay's contents, which is hard to debug without seeing it. Perhaps start with an overlay that's known to work?
Try running it through Mozilla's Add-On Validation page. It might just tell you what the error is. If it is a javascript error, it will tell you for sure.
Now, I had the same problem - when I loaded my addon, my toolbar didn't appear, and even though the addon showed in "Tools > Addons", when I clicked on the "options" button, everything froze.
Turned out, there were several errors.
The optionsurl in my install.rdf had "cchrome" instead of "chrome".
In my main .js file, I forgot a ";" at the end of a line with a var
assignment.
In my xul file, I did not leave a space: label="string"tooltip="string" between the two property assignments.
I had a hanging </toolbarbutton> from where I copied one line to the next. This is what really caused the problem. In the code file, the line was very long, and I never saw that part!
The combination was total failure, even though it passed fine in the Mozilla Validator.
The Validator, in my opinion should have caught the cchrome thing. It would have caught the javascript error.
Anyway, I tell you that in case such might be YOUR problem.

How can I display my logo on my DokuWiki's title?

I have a DokuWiki and I'd like to place a logo on the title bar at the top of the page? How can I do this? Note that I am not referring to the title bar at the top of the browser, but rather the title bar on the website itself.
I tried inserting the DokuWiki syntax: {{public:logo.jpg?100x100}}, but this simply rendered as plain text and not an image.
Is it possible to put an image in the page title?
Easy: Rename your logo as "logo.png" and place it into :wiki namespace. It will show automatically.
This solution works on template "dokuwiki" (default one on dokuwiki old stable version "Adora Belle" and in current one "Weatherwax"):
Deeper:
We can look at tpl_header.php file, lines 21&23:
// get logo either out of the template images folder or data/media folder
[...]
$logo = tpl_getMediaFile(array(':wiki:logo.png', 'images/logo.png'), false, $logoSize);
Ok: tpl_getMediaFile() function will look for a file logo.png in media namespace called wiki.
So I go to dokuwiki File Manager and I upload my logo.png file on wiki namespace. I refresh page and I smile.
Hope That Helps
In modern versions of DokuWiki you don't have to make your own template. Simply upload a file called logo.png to the wiki or root namespace in the DokuWiki Media Manager.
This is the line of template code that gets the logo:
https://github.com/splitbrain/dokuwiki/blob/master/lib/tpl/dokuwiki/tpl_header.php#L23
You can tell that it is first checking logo.png in the wiki namespace with :wiki:logo.png and then logo.png in the root namespace with :logo.png.
If it doesn't find either, it falls back on images/logo.png, which is the default logo.
(for latest versions of Dokuwiki)
You should create your own template, and do whatever hack you need to do.
It is located in lib/tpl/
Just copy the default directory with your own name (this will be available in the admin area later), something like "company", and edit:
<div class="pagename">
<img src="<?php echo DOKU_TPL; ?>images/logo.png" align="absmiddle"/>
[[<?php tpl_link(wl($ID,'do=backlink'),tpl_pagetitle($ID,true),'title="'.$lang['btn_backlink'].'"')?>]]
</div>
You can build the HTML as you like... but the example above works just fine (the image is located in the lib/tpl/company/images/)
You can then change the template of your Wiki by updating the configuration at:
Admin > configuration manager > template
There's no config option for this, you'd have to hack it in \dokuwiki-2009-02-14\lib\tpl\index.php I'm afraid.

Resources