How can I creating an autocomplete textbox with the "Search" magnifying Glass - firefox

If I create a textbox in a Firefox with a type of "autocomplete" I am able to get autocomplete working properly. However, the textbox is a intended to be used as search textbox (with autocomplete). Thus, in addition to autocomplete I also want the standard UI used when the textbox has a type of "search." In particular, Firefox shows a magnifying glass that turns into an "X" when the user types into it.
Is there a clean (or, failing that, not so clean) way of accomplishing this?

Firefox Searchbar ,the one on right top usually, has type="autocomplete" and has the searchbutton
First: browser.xul of firefox has a toolbaritem which searchbar nested in it.
<toolbaritem id="search-container" title="&searchItem.title;"
align="center" class="chromeclass-toolbar-additional"
flex="100" persist="width" removable="true">
<searchbar id="searchbar" flex="1"/>
</toolbaritem>
searchbar has the following css property in browser.css.
searchbar {
-moz-binding: url("chrome://browser/content/search/search.xml#searchbar");
}
That url in css property brings us to search.xml which has the textbox and the searchbutton is added to textbox in a hbox as far as i can understand.
<xul:textbox class="searchbar-textbox"
anonid="searchbar-textbox"
type="autocomplete"
flex="1"
autocompletepopup="PopupAutoComplete"
autocompletesearch="search-autocomplete"
autocompletesearchparam="searchbar-history"
timeout="250"
maxrows="10"
completeselectedindex="true"
showcommentcolumn="true"
tabscrolling="true"
xbl:inherits="disabled,disableautocomplete,searchengine,src,newlines">
<xul:box>
<xul:button class="searchbar-engine-button"
type="menu"
anonid="searchbar-engine-button">
<xul:image class="searchbar-engine-image" xbl:inherits="src"/>
<xul:image class="searchbar-dropmarker-image"/>
<xul:menupopup class="searchbar-popup"
anonid="searchbar-popup">
<xul:menuseparator/>
<xul:menuitem class="open-engine-manager"
anonid="open-engine-manager"
label="&cmd_engineManager.label;"
oncommand="openManager(event);"/>
</xul:menupopup>
</xul:button>
</xul:box>
<xul:hbox class="search-go-container">
<xul:image class="search-go-button"
anonid="search-go-button"
onclick="handleSearchCommand(event);"
tooltiptext="&searchEndCap.label;" />
</xul:hbox>
</xul:textbox>
Well this is not an total answer, but gives a head start for you or others who may contribute I guess. For further detail you can dig omni.jar in mozilla firefox directory.

Related

How to change the Back Button Text on Xamarin.Forms

I have been trying to change the text of the back button in Xamarin.Forms without luck.
I tried already this code with no luck:
NavigationPage.SetBackButtonTitle(this, "");
I'm using a MasterDetailPage.
I tried to add the code into the constructor of the XAML cs file.
Libraries used: PRISM 6.2.0, Xamarin Forms 2.3.1.114
Any suggestion or idea?
Thanks in advance
Due to the topic:
One of the things that is a little bit unintuitive about this API is that you are setting the title for the back button that shows up when this page is the one that you are going back to. For example, you are trying to set the title to "Home". That means you should be calling this method on the Page that represents the "home" page, not the page that is visible when the back button that says "Home" is showing.
So, if you are navigating from Page1 to Page2, you should set NavigationPage.SetBackButtonTitle(this, "") in constructor of Page1 and on Page2 you will see the empty title of back button.
You have to set the Backbutton title of your previous page as string.Empty. By default it's the title of the previous page on the navigation stack that is shown as the back button text.
Also Android does not support this property.
You can also do it from the Code Behind of the current xaml page
public TodoPage()
{
InitializeComponent();
NavigationPage.SetBackButtonTitle(this, "Back");
}
NB: It has to be done on the previous page you want to set.
e.g. Page A has to have the code if you want Page B to show "Back" title.
Belated answer but maybe someone will find this useful in the future… Anyhow, if you wish to get rid of the back button title from XAML, you can either add NavigationPage.BackButtonTitle="" for any ContentPage that should have the title removed or you can define new ContentPage style in your App.xaml file like this:
<Style x:Key="ContentPageStyle" TargetType="ContentPage">
<Setter Property="BackgroundColor" Value="White" /><!-- just an example of other things that can be in here -->
<Setter Property="NavigationPage.BackButtonTitle" Value="" />
</Style>
I was, however, unable to turn this into an implicit global style that would get applied automatically without the need to specify Style="{StaticResource ContentPageStyle}" for each ContentPage – I'm not sure why that one doesn't work.
You can set the attribute NavigationPage.BackButtonTitle on ContentPage
For example:
<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:T3R"
mc:Ignorable="d"
Title="Title of Page"
NavigationPage.BackButtonTitle="Cancel"
x:Class="T3R.MainPage">
Remember the following:
I understand this only works on iOS
For any given page, the back button title is set by the page that presents it. This way, the button label can vary with respect to the page that precedes it on the navigation stack (of which there can be many).
You can set your back button text in XAML as follows (before ContentPage.Content):
<NavigationPage.TitleView>
<Label Text="{Binding PageTitle}" HorizontalOptions="Center"/>
</NavigationPage.TitleView>

How to display clickable hyperlink

We achieve this behaviour in android using a TextView with the property autoLink set to web.
<TextView android:autoLink="web" ... />
How to do that in NS?
If you would like to have clickable links, you can use HtmlView instead of TextView. The thing is that instead of click, you will have to use long press.

add hyperlink to kendo ui k-button?

I'm using kendo ui menu widgets from the web package of kendo ui. There is a problem in hyperlink the k-button is not working with an hyperlink inside.
<button class="k-button">
<a href="http://localhost:5724/map.html">
<font color = 'black'>See All Centers
</a></font>
</button>
the button does not even responding an error: it is behaving as if there is no hyperlink attached with button.
An anchor can directly be formatted as a button by simply adding class="k-button"
You should define it as:
<font color = 'black'>See All Center</fonts>
BTW: The tags in your HTML example are not correctly balanced. Also consider using style attribute instead of fonts.

How to add Logo, button image and button menu to Firefox toolbar

I'm using XUL to write my firefox toolbar. I use that xul code to do simple label button:
<?xml version="1.0"?>
<overlay id="Sample"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"><script type="application/x-javascript" src="chrome://sample/content/sample.js" />
<toolbox id="toolbox">
<toolbar id="Sample" toolbarname="Sample" >
<label value="Lable Button "/>
</toolbar>
</toolbox>
</overlay>
My question is how to add logo image, image button and button menu...also how to add submenu. Please somebody submit a quick sample of code, so I will understand better.
What you have there isn't a button - it is a static label.
To add a logo use image tag (see example in the documentation).
To add an image button use toolbarbutton tag (see example in the documentation).
To add a submenu use toolbarbutton tag with type="menu" and put a menupopup tag inside (again, there is an example in the documentation).
Note: You can use src attribute to specify the image source for an image element and image attribute to specify the image source for a toolbarbutton element. However, it is preferable to set the images in CSS, you can use list-style-image property for that:
#myToolbarButton
{
list-style-image: url(chrome://myextension/skin/toolbar.png);
}

firefox sidebar menu or list of elements. resources/help

I am struggling to find any resources on firefox extensions which construct a sidebar and put elements into them. plus tyhe other functionalities within a sidebar. I have made a emptysidebar. Now i need to display a dynamic array(which is formed using a JS function).
I have absolutely no idea how to go about it. Can someone please help!
this is the code of the sidebar page. I need a xul element like the menuitem where i can display a list of items. How do i get that in a sidebar?
<page id="sbEmptySidebar" title="emptysidebar"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
> <vbox flex="1">
<label id ="l1">
</vbox> </page>
You should used a list box, it would be the best way to display an array of elements in the sidebar. You can check here for more details on the XUL element:
https://developer.mozilla.org/en/XUL_Tutorial/List_Controls
In order to add elements dynamically from JavaScript you can use the appendItem() function on the listbox object, check here for more details and examples:
https://developer.mozilla.org/en/XUL_Tutorial/Manipulating_Lists

Resources