How do I get a usemap working within a firefox XUL document - firefox

In my XUL I have the following code fragments:
<map name="KeypadMap">
<area href="javascript:pad('A')" coords="1,1,31,31" shape="rect"/>
</map>
...
<hbox flex="1">
<image src="./keypad.png" width="32" height="32" useMap="#KeypadMap"/>
</hbox>
The image displays just fine, however, when I mouse over, the cursor does not change to a hand, and clicking does not call the pad function.
Similar code works fine in straight HTML, so there must be some trick to get it working via a Firefox XUL file.

You'll have to use a namespace to embed HTML inside of XUL. Check this guide.

Related

Header image on SAPUI5 application

I am just trying to add the image on index.html. I have create a folder of images under webcontent and add the image in images folder. I am calling it in the following way:
<HBox >
<Image
src="{./images/abc1.jpg}"
width="100%"
height="100%"/>
</HBox>
But it is showing nothing on browser. Please advice.
You use curly brackets when you are trying to bind data from a model.
Since you are not using a model to bind data. You can remove it and try.
Code for the same is as mentioned here:-
<HBox>
<Image src="./images/abc1.jpg" width="100%" height="100%"/>
</HBox>

Removing underline from hyperlink in Windows Store app

I'm creating a universal Windows Runtime App for Windows Phone 8.1 and Windows 8.1 using Xaml and C#.
I have inline hyperlinks setup as so -
<TextBlock Width="400" TextWrapping="Wrap">
<Span FontSize="20">
This is an example of how Hyperlink can be used in a paragraph of text. It might be helpful for you look to
<Hyperlink NavigateUri="http://www.bing.com">bing</Hyperlink>
for more answers in the future.
</Span>
</TextBlock>
This will display the text with a underline indicating the clickable hyperlink. However I want to indicate hyperlinks by color not underline as I can have multiple of them in a TextBlock.
I want to remove the underline from the inline Hyperlinks - TextDecorations property no longer exists in WP 8.1 and Windows 8.1 Store apps.
Note* I'm using Hyperlink element not HyperlinkButton as I need to have the links inline with text.
I would write a comment, but my reputation is not enough to do that.
I tried the same code on a blank both win 8.1 and win phone 8.1 project. However, the hyperlink is displayed with color by default, not with an underline as opposed to your project. My code is like below
<TextBlock Width="400" TextWrapping="Wrap">
<Span FontSize="20">
This is an example of how Hyperlink can be used in a paragraph of text. It might be helpful for you look to
<Hyperlink NavigateUri="http://www.bing.com" Foreground="#FF0007FF">bing</Hyperlink>
for more answers in the future.
</Span>
</TextBlock>
Could you try the Foreground property? Maybe it helps you.
In the final version of Windows 8.1 the Hyperlink-element doesn't have an underline. Maybe the confusion was caused by the focus border around the hyperlink? So the XAML:
<TextBlock Width="400" TextWrapping="Wrap" VerticalAlignment="Center">
<Span FontSize="20">
This is an example of how Hyperlink can be used in a paragraph of text. It might be helpful for you look to
<Hyperlink NavigateUri="http://www.bing.com">bing</Hyperlink>
for more answers in the future.
</Span>
</TextBlock>
Shows as:
One thing that can trick the viewer is that if the page doesn't have any other focusable items, the Hyperlink gets the focus and a border is drawn around it. This may look like it has underline:
If you want to get rid of that, add Button with Opacity 0 to the top of the page.
If you want to style the Hyperlink, you can overwrite it using the following keys:
<SolidColorBrush x:Key="HyperlinkDisabledThemeBrush" Color="#66000000" />
<SolidColorBrush x:Key="HyperlinkForegroundThemeBrush" Color="#FF4F1ACB" />
<SolidColorBrush x:Key="HyperlinkPointerOverForegroundThemeBrush" Color="#CC4F1ACB" />
<SolidColorBrush x:Key="HyperlinkPressedForegroundThemeBrush" Color="#994F1ACB" />
So if you have the following App.xaml.cs:
<Application.Resources>
<ResourceDictionary>
<SolidColorBrush x:Key="HyperlinkForegroundThemeBrush" Color="Green" />
</ResourceDictionary>
</Application.Resources>
You will get a green Hyperlink:
If you want the link to have underline, you can use the Underline-element. The XAML:
<TextBlock Width="400" TextWrapping="Wrap" VerticalAlignment="Center">
<Span FontSize="20">
This is an example of how Hyperlink can be used in a paragraph of text. It might be helpful for you look to
<Hyperlink NavigateUri="http://www.bing.com"><Underline>bing</Underline></Hyperlink>
for more answers in the future.
</Span>
</TextBlock>
And the result:
In my app I'm using
<Hyperlink TextDecorations="None" ...></Hyperlink>
to get rid of the underline.

WIX equivalent of a C# textbox?

I'm staring at this page wondering which control is a textbox.
Seems like it should be obvious, but I don't see it.
http://wix.sourceforge.net/manual-wix2/wix_xsd_control.htm
Also, is there a built-in "Browse" button to select a file from disk?
Or do you have to code all that yourself?
Thanks,
Neal
I finally found the textbox (second one below). It was a matter of setting the Type="Edit".
When I was looking at the web page mentioned, I was first looking only at "children" thinking that I would see a textbox there.
<Control Id="Description2" Type="Text" X="135" Y="140" Width="220" Height="20" Transparent="yes"
NoPrefix="yes" Text="Full path to settingsFile:" />
<Control Id="UserSettingsFileName" Type="Edit"
X="140" Y="150" Width="160" Height="80" Property="SettingsFilename"
Text="C:\Path\SettingsFileGenerator.xml">
The initial value of the edit/box was not set to the text I specified. Any ideas on that? Do I have to set the property value outside of the control?
But if there is an reasonably easy-to-use "browse"/file-picker, I'd like to know about that too.
The wix sources contain a BrowseDlg.wxs file. This file defines the dialog which is used in WixUI_InstallDir to allow the user to enter or browse for the install path, which is exactly the type of functionality you need.
It looks like you just have to use the Type "PathEdit". You also have to give the property where you want the result to be stored, in this case _BrowseProperty:
<Control Id="PathEdit" Type="PathEdit"
X="25"
Y="202"
Width="320"
Height="18"
Property="_BrowseProperty"
Indirect="yes" />

How to make Firefox extension auto install in nav bar?

I'm working on a Firefox extension. I'd like to make it auto-install in the far right position on the nav bar when a user installs it. As it stands, a user has to go to View > Toolbars > Customize... and drag the extension to the nav bar once it's installed. I'd like to eliminate this step.
The extension is here: http://madan.org/tickertool
The XUL for my extension looks basically like this and it overlays browser.xul:
<overlay id="my-ext-overlay" ... >
<toolbarpalette id="BrowserToolbarPalette">
<toolbaritem id="my-ext-container" ... >
<toolbarbutton id="my-ext-customize-image" ... />
<textbox id="my-ext-textbox" ... />
<hbox id="my-ext-buttons">
<image id="my-ext-button1" ... />
<image id="my-ext-button2" ... />
<image id="my-ext-button3" ... />
</hbox>
</toolbaritem>
</toolbarpalette>
</overlay>
I've seen code here ( https://developer.mozilla.org/en/Code_snippets/Toolbar ) that supposedly does what I'm looking for, but this code is if your extension is just a single button and I can't get it to work for me. The answer to my question is likely some modification of this code, but I haven't figured it out.
I think I got it. It's basically spelled out in the link I mentioned in the original post. I'm not sure why I thought there was more to it than that.

replace image with a video embeded

Hi I'm trying to modify a web page so that it loads faster.
Since I have some videos embeded (blip.tv but can change it to youtube if it helps) I was wondering if you could load an image where the video should be and on click replace the image with the video and start playing (without reloading the whole page).
I think I've seen this before, but can't find it anywhere anymore!
right now the code to embed I use is:
<object data="http://blip.tv/play/gYMo_vAmAA" type="application/x-shockwave-flash" height="500" width="600"><param name="src" value="http://blip.tv/play/gYMo_vAmAA"><param name="allowfullscreen" value="true"></object>
Thanks
Quick and dirty: you could just set the embed code as a global variable somewhere:
<script type="text/javascript">
var embedCode = '<object data="http://blip.tv/play/gYMo_vAmAA" type="application/x-shockwave-flash" height="500" width="600"><param name="src" value="http://blip.tv/play/gYMo_vAmAA"><param name="allowfullscreen" value="true"></object>'
</script>
Then put the image in a container div and replace the container's innerHTML onclick:
<div id="videocontainer">
<img src="yourimage.jpg" onclick="document.getElementById('videocontainer').innerHTML = embedCode;" height="500" width="600" />
</div>
There's a Google code project called SWFObject, which is perfect for what you need. It's a cross-browser javascript library for loading flash - and you could use it to replace your image with the flash video when someone clicks on the image, for example.

Resources