Adding configuration options to a basic JIRA gadget - jira

This line in the Atlassian documentation leads me to believe that simply including a UserPref element should be sufficient to automatically generate the UI for updating the configuration of a gadget:
The container handles generation of the configuration UI, saves the settings and provides an API to access the settings in JavaScript.
But it doesn't seem to actually work when I create a test gadget with the following - I don't see any options when I click the "Edit" link on the gadget:
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs
title="Test"
author="Test Test"
author_email="test#example.com"
directory_title="JIRA Tests"
>
<Require feature="setprefs" />
</ModulePrefs>
<UserPref name="show_summ" display_name="Show Summaries?" datatype="bool" default_value="true"/>
<Content type="html">
<![CDATA[
<div id="main">Test Stuff</div>
]]>
</Content>
</Module>
Is there more to do to make that happen? I've seen a few examples that hard-code configuration options, but the above documentation suggest that you don't have to.
Is that something that's only available if you're packaging it as a plugin, or if you include some other js resource? So far I've been doing a bare plugin so I don't have access to stuff like #requireResource, but I'm fine with hard-coding some script elements if that's what's necessary (for now).
Sincerely stumped.

Unfortunatly that neer worked for me eighter. I think it broke in JIRA 6..
Solution: take the javascript approach and you will be just fine. it is also way more powerful.

it works for me, just add this script
<![CDATA[
<script type="text/javascript">
window.onload = function(){
var edit = window.parent.document.getElementById(window.frameElement.id + '-edit');
edit.classList.remove('hidden');
edit.style.display = 'none';
}
</script>
]]>

Related

ViewportSize in .runsettings?

I'm using NUnit and would like to start the browser in a custom size ViewportSize, I know that it is possible through overriding the ContextOptions() method, however I was wondering if this were to be possible by .runsettings also.
I've tried to add it below by going with the browser options documentation, but to be frank i can't really find a clear list on what is and isn't allowed within the .runsettings in regards to playwright or environment variables for playwright. Could anyone shed more light on this?
Code below is from the playwright documentation page.
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<!-- NUnit adapter -->
<NUnit>
<NumberOfTestWorkers>24</NumberOfTestWorkers>
</NUnit>
<!-- General run configuration -->
<RunConfiguration>
<EnvironmentVariables>
<!-- For debugging selectors, it's recommend
to set the following environment variable -->
<DEBUG>pw:api</DEBUG>
</EnvironmentVariables>
</RunConfiguration>
<!-- Playwright -->
<Playwright>
<BrowserName>chromium</BrowserName>
<ExpectTimeout>5000</ExpectTimeout>
<LaunchOptions>
<Headless>false</Headless>
<Channel>chrome</Channel>
<!-- I tried it here -->
<ViewportSize>
<Width>2048</Width>
<Height>1080</Height>
</ViewportSize>
</LaunchOptions>
</Playwright>
</RunSettings>

Changing dependency of WebSharper.JQueryUI to load jquery-ui.js locally

I'm writing on a WebSharper sitelet that uses the JQueryUI extension. The HTML generated by the WebSharper sitelet looks like this:
<html>
<head>
...
<script src="//code.jquery.com/ui/1.11.1/jquery-ui.js" ...></script>
I'm frequently without internet while developing, so I'd really like to serve jquery-ui.js off the development server instead. That is, I'd much rather have this:
<html>
<head>
...
<script src="/Scripts/jquery-ui.js" ...></script>
The docs say this should be possible by setting an appropriate appSetting in Web.config, but no value I set for the keys listed in the docs seem to have any effect on the output.
I'm using (NuGet versions) WebSharper 3.0.54.140 and WebSharper.JQueryUI 3.0.45.241.
How do I force WebSharper to output a link to a resource local to the server?
Indeed there is an error in the documentation. The key to use is the fully qualified name of the resource type, so for WebSharper.JQueryUI it should be:
<appSettings>
<add key="WebSharper.JQueryUI.Dependencies+JQueryUIJs" value="/Scripts/jquery-ui.js" />
<add key="WebSharper.JQueryUI.Dependencies+JQueryUICss" value="/Content/jquery-ui.css" />
</appSettings>
Edit: just fixed the documentation.

How to get the language specific messages using google closure template

Am trying to implement internationalization support to my project for this people suggested google Closure Templates.but am very new to closure templates.am trying to get the language specific messages using closure template but am not getting in xlf file.If any one knows how to generate language specific messages using closure template, please tell me the steps.that's great help to me.
My .soy file code as bellow.
{namespace poc}
/**
*Testing message translation
*#param pageTitle
*/
{template .translate}
<HTML>
<Head>
<title>{$pageTitle}
</title>
</head>
<div>
{msg desc="Hello"}Hello{/msg}
</div>
</html>
{/template}
and generated .xlf content as bellow
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file original="SoyMsgBundle" datatype="x-soy-msg-bundle" xml:space="preserve" source-language="en" target-language="pt-BR">
<body>
<trans-unit id="2286494898080570401" datatype="html">
<source>Thanks</source>
<target/>
<note priority="1" from="description">Says thanks</note>
</trans-unit>
</body>
</file>
</xliff>
I see you already used the SoyMsgExtractor to create the base xlf. Next you need to make translations of this base xlf to the languages you want to support. A file for each language is created. I used the xliff exitor from Translution. http://sourceforge.net/projects/eviltrans.
Next, using the SoyToJsSrcCompiler a translation soy can be made per language:
java -jar SoyToJsSrcCompiler.jar --shouldGenerateGoogMsgDefs --bidiGlobalDir 1 --messageFilePathFormat Filename_en-us.xliff --outputPathFormat FileName_fr.js *.soy
This will create a Filename._fr.js file that contains the compiled soy file.
Including this file instead of the original soy (or compiled) will create a localized version.
Good luck!
\Rene
i think the easiest way is to make (i.e. generate from whatever source) a separate js file which contains one messages object and reference it through an extern declared function.
it justs works and has no complicated dependencies.

Problem getting JavaDoc to resolve Java 6

I'm having problems getting Ant to relatively refer to Java 6 API in my javaDoc task. Instead of having, say "File", I am getitng the whole package reference first. It is very annoying!
Here is my code. Could anyone advise?
<javadoc sourcepath="${src.dir}"
destdir="${packaging.dir}/docs/javadoc"
packagenames="org.*"
link="http://download.oracle.com/javase/6/docs/api/"
doctitle="my API Documentation"
bottom="my API Documentation - Copyright 2010 to me. All Rights Reserved."
/>
I would also like to add link information for log4j and also hibernate. Is it a simple case of adding more link rows?
Thanks. Ben.
To process multiple external links, use nested link elements of the Ant javadoc task. Something like:
<javadoc sourcepath="${src.dir}"
destdir="${packaging.dir}/docs/javadoc"
packagenames="org.*"
doctitle="my API Docs"
bottom="my API Docs - Copyright 2010 to me. All Rights Reserved.">
<link href="http://download.oracle.com/javase/6/docs/api/" />
<link href="http://logging.apache.org/log4j/1.2/apidocs/" />
<link href="http://docs.jboss.org/hibernate/core/3.5/api/"/>
</javadoc>

firefox extension run on each page

I am new to firefox extension development. I am building an extension which needs to run for each page the user browses. At the moment the extension runs when firefox window starts.
I have pasted code below.
XUL Code:
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="mainWin" title="my extension" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript" src="chrome://myextension/content/myextension.js" />
</window>
and in the myextension.js Javascript file I have an alert(window.location.href);
I want to run this extension and get the url of the page I am browsing each time.
I might be going in a wrong direction. Any help much appreciated.
Simpler: https://developer.mozilla.org/en/Code_snippets/On_page_load
More control: https://developer.mozilla.org/en/Code_snippets/Progress_Listeners
Both linked from https://developer.mozilla.org/en/Code_snippets, also see
https://developer.mozilla.org/en/Extensions and https://developer.mozilla.org/en/Extensions/Firefox.

Resources