How to insert image in status bar? - firefox

I want to create an image in my statusbar, but why it can't appear?
And, how to add menu in status bar when I click right the mouse?
This is my script:
<?xml version="1.0"?>
<!--
# Fungsi dari file ini adalah mengatur tampilan dan perilaku addon.
# Membuat menu "search hadits" pada saat user klik kanan pada halaman browser atau
# pada saat user klik kanan pada kata di halaman browser.
-->
<overlay id="inline_trans"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<!--
# Membuat Menu Klik kanan pada halaman firefox.
# Memanggil fungsi pada haditsSearch.js untuk mulai melakukan pencarian hadits.
-->
<popup id="contentAreaContextMenu">
<menuitem class="inlinetrans" id="inlineContext" oncommand= "hadits_mean.startFind(null);"
label="Cari Terjemahan"/>
</popup>
<!-- ======================================================== -->
<!--
<window id="main-window">
<popupset id="mainPopupSet"></popupset>
<vbox id="hadits_holder" />
</window>
-->
<!--
<spacer flex="1"/>
<progressmeter mode="determined" value="82"/>
-->
<statusbar id="status-bar">
<statusbarpanel id="status-bar-inlinetrans"
src="chrome://inlinetrans/skin/imagesOn_kecil.png"
label="indonesia inline translator"
context="indonesia inline translator menu"
onclick="alert('okeh cuy')"
tooltiptext="inlinetrans versi 1.0"
/>
</statusbar>
</overlay>

You need an <image>. Something like:
<statusbar id="status-bar">
<statusbarpanel id="status-bar-inlinetrans">
<image src="chrome://inlinetrans/skin/imagesOn_kecil.png" />
</statusbarpanel>
</statusbar>
The other attributes can probably go on either the image or the statusbarpanel.

Related

zk can't access method in included .zul

When I try the below code (as is suggested here by Ryan Wu for question):
<?page title="Auto Generated index.zul"?>
<window title="Hello World 2!!" border="none" width="600px">
<include id="inc" src="/zk/wind.zul" mode="instant" />
<button label="do it" onClick="inc$wind.doModal()" />
</window>
After pressing the button I am getting this error:
inc$wind.doModal();'' : Attempt to resolve method: doModal() on undefined variable or class name
The file wind.zul looks as
<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
<window id="wind" title="new page title" border="normal" visible="false" width="300px">
New Content Here!
</window>
</zk>
Can someone let me know what is wrong? Thanks...
According to http://books.zkoss.org/wiki/ZK%20Developer%27s%20Reference/UI%20Composing/ID%20Space
I need:
1. use 'Path'
2. add some ID for main window (f.i. id="w0")
and write in index.zul something similar ( file wind.zul not changed)
<?page title="Auto Generated index.zul"?>
<window id="w0" title="Hello World 2!!" border="none" width="600px">
<include id="inc" src="/zk/wind.zul" mode="instant" />
<button label="do it" onClick='Path.getComponent("/w0/inc/wind").doModal()' />
</window>
Thanks for me own :))

XUL Overlay for Preferences

I'm trying to make a XUL overlay for Preferences for my extension. I have the following code as part of my overlay, but it is still not appearing under Firefox->Preferences:
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<overlay id="tabularity-browser-overlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefwindow id="BrowserPreferences">
<prefpane id="tabularityPane" label="tabularityPane;"
onpaneload="populateSchedulesList()"
image="chrome://tabulationtwo/content/images/tab.png">
<preferences>
<preference id="perSession"
name="extensions.tabulation.defaultHomepage"
type="bool"/>
</preferences>
<radiogroup>
<radio preference="perSession" id="session" label="Open tabs once per session" accesskey="S" selected="true"/>
<radio preference="perSession" id="instance" label="Open tabs every tab instance" accesskey="I"/>
</radiogroup>
</prefpane>
</prefwindow>
Can anyone help me diagnose the problem or point me in the right direction? Thanks in advance.
Just posting this solution to show the image:
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<overlay id="tabularity-browser-overlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefwindow id="BrowserPreferences">
<prefpane id="tabularityPane" label="tabularityPane;"
onpaneload="populateSchedulesList()"
image="chrome://tabulationtwo/content/images/tab.png">
<preferences>
<preference id="perSession"
name="extensions.tabulation.defaultHomepage"
type="bool"/>
</preferences>
<radiogroup>
<radio preference="perSession" id="session" label="Open tabs once per session" accesskey="S" selected="true"/>
<radio preference="perSession" id="instance" label="Open tabs every tab instance" accesskey="I"/>
</radiogroup>
</prefpane>
</prefwindow>
</overlay>
If you would like to know, how to handle please refer this link :
Menu bar overlay in Firefox
http://hublog.hubmed.org/archives/001606.html
Image:

ff addon execute menu item

I want to modify an existing addon for simplicity. I have this code:
<popup id="contentAreaContextMenu">
<menu id="llOpenLocalLink" label="&llOpenLocalLink.label;" insertbefore="context-sep-open" >
<menupopup>
<menuitem id="llOpenInThisTab" label="&llOpenInThisTab.label;" oncommand="LocalLink.openLinkInThisTab(event)"/>
<menuitem id="llOpenInNewTab" label="&llOpenInNewTab.label;" oncommand="LocalLink.openLinkInNewTab(event)"/>
<menuitem id="llOpenInNewWindow" label="&llOpenInNewWindow.label;" oncommand="LocalLink.openLinkInNewWindow(event)"/>
</menupopup>
</menu>
</popup>
And I only want a single menu entry which is executed if clicked. I tried this but it is not executed:
<popup id="contentAreaContextMenu">
<menu id="llOpenLocalLink" label="&llOpenLocalLink.label;" insertbefore="context- sep-open" oncommand="LocalLink.openLinkInNewTab(event)">
</menu>
</popup>
Ok. I found the answer:
<popup id="contentAreaContextMenu">
<menuitem id="llOpenLocalLink" label="&llOpenLocalLink.label;" insertbefore="context-sep-open" oncommand="LocalLink.openLinkInNewTab(event)"/>
</popup>

firefox extension image display in sidebar

I want to display an array of images in my sidebar. The images should be clickable. This is what I got so far in my ff-sidebar.xul file but nothing is shown:
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type"text/css" ?>
<!DOCTYPE page SYSTEM "chrome://pos/locale/overlay.dtd">
<page id="posSidebar" title="&posSidebar.label;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script src="ff-sidebar.js"/>
<script src="ff-sidebar.css"/>
<vbox flex="1">
<label value="&posSidebar.label;" />
<image id="image1"/>
</vbox>
</page>
and the code of the css file:
#image1
{
list-style-image: url("chrome://myextension/skin/images/1.png" width='135' height='130');
}
Why are you trying to load in your CSS file as a script? also the script declarations should be like this:
<script type="application/x-javascript" src="chrome://rehostimage/content/password_manager.js" />
As for the images showing up, have you tried
<image src="chrome://myextension/skin/images/1.png" />
?

Getting XUL:Scale to show what numeric value is selected

I'm working with XUL, and below is abasic slider/scale implementation:
<scale value="1" min="1" max="10" increment="1"/>
However I want a numbox next to it which displays the value selected in the slider, and maybe I didn't look hard enough in the XUL tutorial, but I couldn't find a feasible answer.
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="yourwindow"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<scale value="1" min="1" max="10" increment="1" id="a"/>
<textbox readonly="true" observes="a"/>
</window>

Resources