Options popup do not appear for the extension - thunderbird

i am building a thunderbird extension and enabled the options popup by adding following to the install.rdf
<em:optionsURL>chrome://content/options.xul</em:optionsURL>
this enables the button but on clicking it nothing happens. the options.xul looks like as below
<?xml version="1.0"?>
<prefwindow id="EmailToOSN-prefs"
title="StockWatcher 2 Options"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefpane id="sw2-stock-pane" label="Stock Settings">
<preferences>
<preference id="pref_symbol" name="extensions.stockwatcher2.symbol" type="string"/>
</preferences>
<hbox align="center">
<label control="symbol" value="Stock to watch: "/>
<textbox preference="pref_symbol" id="symbol" maxlength="4"/>
</hbox>
</prefpane>
</prefwindow>

Assuming that you have a folder content where you have placed your code files
(including options.xul)
First you have to declare this "content" folder in your
chrome.manifest file by adding this line:
content extension_name content/
Second in your install.rdf file you must write this:
<em:optionsURL>chrome://extension_name/content/options.xul</em:optionsURL>
Third add this line in your options.xul file inside the prefwindow tab:
<script type="application/x-javascript" src="chrome://extension_name/content/options.js" />
where options.js will be your javascript code you will use for
this options window
Hope I helped...

Related

Is it possible to import a file from Preference Fragment?

I created a Preference Fragment for Settings in Android Studio and I want to have a Import Button, when I click it, to open Folder and Pick a File...
Then, the picked file will be copied and saved inside Phone Storage...
This is the Preference Fragment (root_preferences.xml) code:
<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory app:title="General">`
<SwitchPreference
app:key="switch1"
app:defaultValue="true"
app:summaryOff="Çdo herë që eksportohet lista, dërgohet në PC dhe nuk ruhet lokalisht në Files/Downloads"
app:summaryOn="Çdo herë që eksportohet lista, ruhet lokalisht në Files/Downloads dhe dërgohet në PC"
app:title="Ruaj RFID-të e skenuara!" />
<!-- This is the IMPORT Button -->
<Preference
app:key="import_preferences"
app:summary="Import Product Excel Here!"
app:title="Import">
<intent
android:action="android.intent.action.PICK"
/>
</Preference>
</PreferenceCategory>
<PreferenceCategory app:title="About">
<Preference
app:summary="1.0.0"
app:title="Version" />
<Preference
app:icon="#mipmap/ic_launcher_foreground"
app:key="contact_preferences"
app:title="More about us!">
<intent
android:action="android.intent.action.VIEW"
android:data="https://solvit-ks.com/" />
</Preference>
</PreferenceCategory>
\</PreferenceScreen\> \`
I tried creating an Intent Action inside .xml file, but can't return the path of the choosen file.
I'm expecting, when I click the Preference Button, it opens Folder and when I pick a file, it returns the path of the chosen file. And, then when I return the Settings in the MainActivity, then Ill duplicate the file and save it somewhere else I need the file :)
So... I want to know if it's possible first... Then any help how to make it would be very appreciated :) Thank you

UploadCollection instantUpload="false" when Embedded in List

I am using sap.m.UploadCollection to manage files selected by the user and upload to the server. I want the user to select all the required files then press a 'Save' button to upload all the files at one time. Thus I have set instantUpload to false. This UploadCollection is a part of the items in a sap.m.List. When the user selects a file from the file system an upload is automatically performed (not desired). If I use the same UploadCollection definition outside of the List it does not upload immediately. I need to get it working properly inside the list.
Code Snippet:
<List
items="{ path: 'submittal>/submission', templateShareable: true }">
<layoutData>
<layout:GridData span="XL12 L12 M12 S12"/>
</layoutData>
<items>
<CustomListItem>
<Panel headerText="Round # {submittal>roundId}" expandable="true" expanded="true">
<forms:SimpleForm layout="ResponsiveGridLayout" editable="true">
<UploadCollection
noDataText="No documents on file"
items="{path : 'submittal>documents', templateShareable : false}"
mode="SingleSelectMaster"
uploadEnabled="true"
uploadButtonInvisible="false"
uploadUrl="OptionController?optionId=JS002&action=submittalUpload"
instantUpload="false"
multiple="true"
beforeUploadStarts="submittalBeforeUpload"
uploadComplete="submittalUploadComplete"
selectionChange="documentSelected">
<layoutData>
<layout:GridData span="XL6 L8 M10 S12" linebreakXL="true" linebreakL="true" linebreakM="true" linebreakS="true" />
</layoutData>
<items>
<UploadCollectionItem
documentId="{submittal>id}"
fileName="{submittal>name}"
mimeType="{submittal>typeName}"
selected="{submittal>selected}"
visibleEdit="false"
enableDelete="true"
deletePress="documentDelete">
<attributes>
<ObjectAttribute title="File size" text="{ path: 'submittal>size', formatter: '.formatFileSize' }" />
</attributes>
</UploadCollectionItem>
</items>
</UploadCollection>
</forms:SimpleForm>
</Panel>
</CustomListItem>
</items>
</List>
UI5 Version: 1.78.1
Any help would be appreciated.
Thank you
It is not recommended to use UploadCollection directly inside List, Table, etc. but there is a simple workaround.
Just put a sap.m.Button into sap.m.List instead of using directly sap.m.UploadCollection. Then define fragment with a sap.m.Dialog that has sap.m.UploadCollection inside. In a button press event callback you just bind a row context into a dialog so you'll be able to show correct uploaded files (if there are any).
You can also design a button in your list in a way that you use attachment icon as an icon property and a number (counter) in a text property indicating how many files have been already uploaded.
It would be confusing for an end user to see list items and then another items (files) from UploadCollection inside one or more list items..

Qlikview REST connector pagination namespaced XML

We have a XML file that is on somewebsite and looks in a way like this (confidential parts stripped)
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<feed xml:base="https://somewebsite.com/crm/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
<title type="text">Accounts</title>
<id></id>
<updated>2016-02-04T08:36:56Z</updated>
<link rel="self" title="Accounts" href="Accounts" />
<entry>
<title type="text"></title>
<updated>2016-02-04T08:36:56Z</updated>
<author>
<name />
</author>
<content type="application/xml">
<m:properties>
<d:Type>A</d:Type>
<d:UniqueTaxpayerReference m:null="true" />
<d:VATLiability m:null="true" />
<d:VATNumber m:null="true" />
<d:Website m:null="true" />
</m:properties>
</content>
</entry>
<link rel="next" href="https://somewebsite.com/Accounts?$skiptoken=guid'ee6bc390-a8ac-4bbd-8a4d-0a1f04ab9bd3'" />
</feed>
We use the new Rest connector to get the data out of this XML file.
The XML has pagination and every 60 entries you can load the next 60 with the link at the bottom of this xml file.
The problem i have is when, in the REST connector, we want to enable pagination with these setting:
Pagination Type: Next URL
Next URL field path:
/*[name()="feed"]/*[name()="link"][contains(#rel,"next")]/#href
It doesn't seem to work...
side note: the XML file has namespaces so i need to target the elements this way instead of /feed/link/...
I'm using Xpath syntax to target the link href, but maybe this is not the way to go? Or maybe the REST connector isn't using Xpath syntax?
Really hope someone can help me!
Actually it turns out that this seems to be due to a "bug" in the "Qlik REST Connector 1.0" so the pagination doesn't work.
But there is a fix for it:
1) Make sure that the Qlik REST Connector 1.0 connect dialog box has the NextUrl set to:
feed/link/attr:href
2) When the SQL has been generated after using the SELECT-button and going through the wizard you have to modify the sub-SELECT that reads like this:
.....
(SELECT
"attr:rel" AS "rel",
"attr:title" AS "title",
"attr:href" AS href,
"__FK_link"
FROM "link" FK "__FK_link"),
.....
On line 05 you will have to remove the text AS href.
So it should look like this:
.....
(SELECT
"attr:rel" AS "rel",
"attr:title" AS "title",
"attr:href",
"__FK_link"
FROM "link" FK "__FK_link"),
....
3) Find the LOAD statement that loads from this sub-select with a RESIDENT [MasterREST further down in the load script and make sure that the reference to href is changed to [attr:href] - or else you will get an error message while loading.
Should look like this after the change:
[link]:
LOAD [rel],
[title],
[attr:href],
[__FK_link] AS [__KEY_feed]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_link]);
This worked for me:
/*[name()='feed']/*[name()='link'][#rel='next']/#href
Yours should also work actually, maybe whatever you are using does not agree with double quotes instead of single quotes.

How to define a trigger keyword in OpenSearchDescription xml file?

I am trying to get an open search definition to work on subdomains.
I have added the correct line in the <head> of the html.
Example:
<link rel="search" type="application/opensearchdescription+xml" title="Example" href="http://www.example.org/opensearch.xml" />
In opensearch.xml:
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<ShortName>Example</ShortName>
<LongName>Example Search</LongName>
<Description>Example Description</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width="16" height="16" type="image/x-icon">http://www.example.org/favicon.ico</Image>
<Url type="text/html" method="get" template="http://www.example.org/search/{searchTerms}" />
</OpenSearchDescription>
The search is correctly added to the omnibox settings in Google Chrome, when I visit http://www.example.org. The trigger keyword becomes "example.org".
However, when I visit http://subdomain.example.org, which has the same line in the <head>, the search is added with trigger keyword "subdomain.example.org" instead of "example.org".
Is there a way around this?
I have not found any information on how to set the trigger keyword in the documentation at http://www.opensearch.org/Specifications/OpenSearch/1.1 .

Overriding a label in Zend Fom config XML

Hi I am using an xml file of the following structure:
<?xml version="1.0"?>
<configdata>
<page>
<form action="" method="post">
<elements>
<page_title type="text" name="page_title" >
<options label="Page Title" required="true" />
</page_title>
<page_content type="textarea" name="page_content">
<options label="Page Content" />
</page_content>
</elements>
</form>
</page>
I have two forms which take exactly the same data, but I need to change the labels on the form. I would rather not just cut and paste the code contained within <page></page> and adjust the labels. Is there a way I can 'extend' page and set the labels that way?
you should be able to do it right from the controller (i know it works with normal Zend_form objects)
$form = new Your_Form_Here();
$form->Elementname->setLabel('new label');
That's all there is to it. You may have to make some adjustments because you're using a config file but it should'nt be to hard.