tooltip not working - firefox-addon

I'm using this code in *.xul
<tooltip id="tt">
<label value="additional information"/>
</tooltip>
<statusbar id="status-bar">
<statusbarpanel id="mypanel" tooltip="tt"
label="my panel"
/>
</statusbar>
I don't know why but when I'm over mypanel with mouse. There is no popup window with "additional information"
thank you for help

I'm not sure, but this might be because the <tooltip> element needs to be inside of a <popupset> element. By the way, you shouldn't use the statusbar anymore; use the add-on bar instead: https://developer.mozilla.org/en/The_add-on_bar

Related

NativeScript page-router-outlet always taking up 100% height on iOS when used with RadSideDrawer

When using the RadSideDrawer with a page-router-outlet in NativeScript, it seems that there is no way to not have the page-router-outlet fill 100% of the height on iOS. On Android, it works fine. The reason I'm running into this issue is because I'm trying to add a BottomNavigationBar below my router outlet. The images below show the behavior on both iOS and Android:
Here is my code:
<RadSideDrawer>
<FlexboxLayout tkDrawerContent>
<Button text="Test"></Button>
</FlexboxLayout>
<GridLayout class="main-grid" tkMainContent rows="*, auto">
<StackLayout row="0">
<page-router-outlet></page-router-outlet>
</StackLayout>
<BottomNavigationBar activeColor="white" inactiveColor="gray" backgroundColor="black" row="1">
<BottomNavigationTab title="First"></BottomNavigationTab>
<BottomNavigationTab title="Second"></BottomNavigationTab>
<BottomNavigationTab title="Third"></BottomNavigationTab>
</BottomNavigationBar>
</GridLayout>
</RadSideDrawer>
If I remove the page-router-outlet and put anything in it's place, it will then function correctly on both iOS and Android. Also, if I leave the page-router-outlet and remove the RadSideDrawer, it also functions correctly.
Any suggestions? Thanks!
EDIT:
It seems as if this issue only occurs when there are two page-router-outlets nested as in this sample playground:
https://play.nativescript.org/?template=play-ng&id=Z2a5Z7
Maybe page-router-outlets aren't supposed to be nested then? Right now I have a page-router-outlet in my app.component that lazy loads and switches between a login.component and my main app pages.component. pages.component contains the RadSideDrawer and the other page-router-outlet. I did this so I can lazy load my authorization pages and regular app content pages. Is this wrong?
It seems to be a issue with RadSideDrawer plugin (v8.0.0), the plugin is not open sourced so the best approach would be raising an issue in nativescript-ui-feedback and I see you have done that already - #1362.
I have a workaround that seem to fix the issue on my end.
MainComponent
constructor(page: Page) {
page.once(Page.navigatedToEvent, () => {
page.frame.requestLayout();
});
}
Request for relayout once the page is loaded.
Updated Playground
In my case, I have a modal page full height width over the side drawer, so I created a structure like below. Hope this helps you.
<GridLayout rows="" columns="" [class.dialogOpen]="dialogOpen">
<StackLayout>
<RadSideDrawer tkExampleTitle tkToggleNavButton drawerContentSize="320">
<StackLayout tkDrawerContent>
<app-sidenav></app-sidenav>
// my side drawer data
</StackLayout>
<GridLayout tkMainContent class="app" rows="auto,*,auto">
<GridLayout row="0" columns="*" rows="auto,auto" *ngIf="data.navbar" class="gradient">
// custom header
</GridLayout>
<!-- main content -->
<FlexboxLayout row="1">
<StackLayout #container>
<StackLayout [ngClass]="{'full': data.full }">
<ng-content></ng-content>
</StackLayout>
</StackLayout>
</FlexboxLayout>
<!-- Footer -->
<FlexboxLayout row="2" *ngIf="data.footer" class="app__footer" verticalAlignment="bottom">
// bottom tabs for my app
</FlexboxLayout>
</GridLayout>
</RadSideDrawer>
</StackLayout>
<StackLayout verticalAlignment="center" horizontalAlignment="center" height="100%" class="dialog__wrapper">
<AbsoluteLayout height="100%" backgroundColor="#FFFFFF" verticalAlignment="center" horizontalAlignment="center">
<!-- EDIT POPUP -->
<StackLayout class="dialog__container">
// cusotm dialog data
</StackLayout>
</AbsoluteLayout>
</StackLayout>
</GridLayout>

How I can find MouseClick or GotFocus event in PivotItem.?

Hello How I can find GotFocus event into the PivotItem I had tired with GalaSoft Interaction with Triger and EventName="GotFocus" but it is not fired can anybody help me to find the PivioItem Event.
Thank you.
the pivot item gets focus upon cliking any control placed inside that pivot item.
<controls:PivotItem Header="item1">
<i:Interaction.Triggers>
<i:EventTrigger EventName="GotFocus">
<i:InvokeCommandAction Command="{Binding ShowMessageCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<Grid>
<TextBox Height="100"
Width="200"/>
<Button Height="100"
Width="200" />
</Grid>
</controls:PivotItem>
This code works for me. the pivot item get focus upon clicking the button or the text box.
Hope this helps you.
Yes,
here you are the solution:
<controls:Pivot Title="My Pivot">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction Command="{Binding EuropePivotSelectedCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<controls:PivotItem Header="item1">
</controls:PivotItem>
<controls:PivotItem Header="item2">
</controls:PivotItem>
Regards
Juanlu, ElGuerre

how to handler preference and interface of mozilla firefox addons?

I want to ask some questions:
What steps should I do to make the interface on mozilla firefox and handle all these interfaces.
interfaces that I want to make are:
status bar that consists of labels and pictures and if the status bar on the right click menu will display the active addons (addons menu inactive hidden) and preferences.
current web page on the right click, on the browser will display a context menu "terjemahkan" and there are pictures on the left-hand corner.
when I select the options button on the tools menu >> addons, users can adjust these addons settings with the radio buttons
when the context menu is selected then the browser window will show the desired results
the steps that I have done is:
i was made the status bar but why the picture I want not to appear when I've made as directed. as well as on the context menu, the image can not appear in the upper left corner of the menu like in general.
<?xml version="1.0"?>
<overlay id="inline_trans"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml">
<!--
<script type="application/x-javascript" src="chrome://translator/content/script.js" />
<script type="application/x-javascript" src="chrome://translator/content/interface.js" />
-->
<!-- menu klik kanan pada halaman web -->
<popup id="contentAreaContextMenu">
<menuseparator />
<menuitem id="intransContextMenuPage"
image="chrome://inlinetrans/skin/imagesOn_kecil.png"
label="terjemahkan dengan intrans"
oncommand="inline.script.getText()" />
</popup>
<!-- pilihan menu pada status bar -->
<popupset>
<menupopup id="intransContextMenu">
<menuitem label="intrans nonaktif"
image="chrome://inlinetrans/skin/imagesOff_kecil.png"
hidden="true"/>
<menuitem label="intrans aktif"
image="chrome://inlinetrans/skin/imagesOn_kecil.png"
hidden="false"/>
<menuseparator />
<menuitem label="preferensi"/>
</menupopup>
</popupset>
<!-- ========================================= -->
<!-- statusbar-->
<statusbar id="status-bar">
<statusbarpanel id="status-bar-intrans"
image="chrome://inlinetrans/skin/imagesOn_kecil.png"
label="intrans"
context="intransContextMenu"
tooltiptext="intrans versi 1.0"
/>
</statusbar>
</overlay>
UI options preferences
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE overlay SYSTEM "chrome://inlinetrans/locale/options.dtd">
<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
id="translate-preferences"
title="&options.title;"
buttons="accept, cancel"
style="padding:0px; margin:0px;"
ondialogaccept="options.save()"
onload="options.init();"
onunload="options.deconstruct();">
<!--
<stringbundleset id="stringbundleset">
<stringbundle id="locale-properties" src="chrome://translator/locale/translator.properties"/>
<stringbundle id="properties" src="chrome://translator/content/translator.properties"/>
</stringbundleset>
-->
<!--
<script src="chrome://inlinetrans/content/options.js" />
-->
<description value="&options.desc;"
style="
background: #fff url('chrome://inlinetrans/skin/options.png') no-repeat;
min-width:400px;
min-height:40px;
padding-left:55px;
padding-top:10px;
margin:0px;
border-bottom: 2px solid #757575;
font-size:1.5em;"/>
<vbox style="padding:10px;">
<groupbox>
<caption label="&options.ui;"/>
<label value="&options.results.desc;"/>
<radiogroup id="display.results" style="padding-left:20px;">
<radio id="results.cat" value="category" label="&options.results.cat;"/>
<radio id="results.noncat" value="noncategory" label="&options.results.noncat;"/>
</radiogroup>
</groupbox>
</vbox>
</dialog>
The most confusing thing for me is how I do all the handler interface.
for example:
change the status of addons, from active to inactive
take the value of the selected radio button
I cannot give you an answer to all of your questions, partly because I don't know exactly what you want, but here is a start:
To show an image next to the menu item, you have to give the element the class menuitem-iconic as described in the documentation:
<menuitem id="intransContextMenuPage"
class="menuitem-iconic"
image="chrome://inlinetrans/skin/imagesOn_kecil.png"
label="terjemahkan dengan intrans"
oncommand="inline.script.getText()" />
I'm not sure for the statusbar, by I would follow the description in the documentation:
The following classes may be used to style the element. These classes should be used instead of changing the style of the element directly since they will fit more naturally with the user's selected theme.
statusbarpanel-iconic
Use this class to have an image appear on the statusbarpanel. Specify the image using the src attribute. The image will appear instead of the label.
You can get the value of the selected radio button by getting a reference to the radiogroup,access its property selectedItem which gives you a radio element and read the value property:
var value = document.getElementById('display.results').selectedItem.value;

how to create context menu in statusbar?

I have some problems
1. how do I make my statusbar context menu that consists of 2 choices of menu preferences and addons status
example of context menu i want to make
this is my code :
<popupset>
<menupopup id="intransContextMenu">
<menuitem label="intrans aktif"/>
<menuitem label="preferensi"/>
</menupopup>
</popupset>
<statusbar id="status-bar">
<image src="chrome://inlinetrans/skin/imagesOn_kecil.png" />
<statusbarpanel id="status-bar-intrans"
label="intrans"
context="intransContextMenu"
onclick="alert('okeh cuy')"
tooltiptext="intrans versi 1.0"
/>
</statusbar>
how to add images in the context menu? I have tried but why do I paste a picture that always appears under the label is not on the side of the label as I expected?
example of context menu i want to make
this is my code :
<popup id="contentAreaContextMenu">
<image src="chrome://inlinetrans/skin/imagesOn_kecil.png" />
<menuitem class="inlinetrans" id="inlineContext" oncommand= "hadits_mean.startFind(null);"
label="Cari Terjemahan"/>
</popup>
note :
whether the code used to display the menu by right clicking on the statusbar and allows web pages to be made in one file?
thank you for the answer..
I am not sure if the images are your only problem now? Opening the context menu should work (you are using the context attribute correctly).
Regarding images, have a look at the documentation. For statusbarpanel, you have to set the image attribute:
<statusbar id="status-bar">
<statusbarpanel id="status-bar-intrans"
image="chrome://inlinetrans/skin/imagesOn_kecil.png"
label="intrans"
context="intransContextMenu"
onclick="alert('okeh cuy')"
tooltiptext="intrans versi 1.0"
/>
</statusbar>
You might also want to have a look at the style classes and play with them (to be honest I'm not 100% sure if it is just sufficient to set the image attribute, so if this does not work, try with the style classes).
Similar for the menuitem. You have to set the image attribute and give the element the style class menu-iconic:
<menuitem class="inlinetrans menu-iconic"
id="inlineContext"
oncommand= "hadits_mean.startFind(null);"
label="Cari Terjemahan"
image="chrome://inlinetrans/skin/imagesOn_kecil.png"/>
Note: Afaik the statusbar is going to be removed in Firefox 4 (at least by default it is disabled)!

XUL Textbox inside Popup not working

I am working on creating a Firefox extension. I have added a textbox inside a popup. The popup opens on clicking on a toolbar button. The textbox is appearing but does not let me edit it. I have not given any read only attributes.
Here is the code:
<popupset id="myPopupSet">
<popup id="trial-popup" noautohide="true" position="after_start">
<vbox>
<label value="Enter your name:"/>
<textbox id="identfier_box" value="This is some text."/>
</vbox>
</popup>
</popupset>
<toolbarpalette id="BrowserToolbarPalette">
<toolbarbutton id="mybutton"
class="toolbarbutton-1"
label="Identifier"
popup="trial-popup"
insertbefore="urlbar-container" />
can anyone let me know why there is this problem?
Thanks!
What you really want is a panel and not a popup.
Change <popup> to <panel> and you have what you want.

Resources