[Engine-devel] UI Plugin API improvements
Itamar Heim
iheim at redhat.com
Sat Mar 30 22:30:49 UTC 2013
On 03/30/2013 03:12 PM, René Koch wrote:
> Hi Vojtech,
>
> Thanks a lot for the information.
> Are these changes already available in latest nightly repository or do I have to fetch them from git?
>
> As UI API gets more and more features I was wondering if I can get the UI plugin API version with a JavaScript call like api.getVersion().
> I think it could sometimes be useful for UI plugin development to get the version of UI API to be able to use the right API call - at the moment only oVirt 3.2 is available which supports UI plugins, but in future there will be more oVirt version and hopefully RHEV will also support UI plugins (at least as tech preview).
> What do you think?
interesting point. maybe less of an issue if the ui plugin is
distributed in rpm form, and can validate minimal version.
but if a single codebase for the uiplugin is to support multiple
versions for deployment, it may want to make some features available
only if engine version is X or >X.
so just wondering:
- do you see uiplugins distributed as rpms or some other way?
- do you see uiplugin codebase trying to accomodate multiple versions,
or branch/version similar to supported engine, and one needs latest
engine for latest uiplugin, etc.
Thanks,
Itamar
>
>
> Thanks,
> René
>
>
>
> -----Original message-----
>> From:Vojtech Szocs <vszocs at redhat.com>
>> Sent: Thursday 28th March 2013 16:25
>> To: engine-devel <engine-devel at ovirt.org>
>> Cc: Keith Robertson <kroberts at redhat.com>; Spenser Shumaker <sshumake at redhat.com>; Christopher Morrissey <christopher.morrissey at netapp.com>; René Koch <r.koch at ovido.at>
>> Subject: UI Plugin API improvements
>>
>> Hi guys,
>>
>> I've just merged some UI Plugin patches that improve existing API functions, as well as add some new API functions. Please read on to learn what's new.
>>
>>
>> Modal dialog API
>> ================
>>
>> Function improved: showDialog
>>
>> New signature:
>> showDialog(title, dialogToken, contentUrl, width, height [, options])
>>
>> Example usage:
>> showDialog('My Dialog', 'my-dialog', 'http://www.foobar.com/', '800px', '600px', {
>> // Default value = empty array (no buttons)
>> buttons: [
>> {
>> label: 'Do stuff',
>> onClick: function() {
>> alert('Bump!');
>> }
>> }
>> ],
>>
>> // Default value = false
>> resizeEnabled: true,
>>
>> // Default value = true
>> closeIconVisible: true,
>>
>> // Default value = true
>> closeOnEscKey: true
>> });
>>
>> Notable changes:
>> * modal dialogs now look & feel the same as standard WebAdmin dialogs
>> * width & height are strings containing CSS units
>> * the reason why buttons default to empty array is to give plugin authors the choice to provide custom buttons (or similar input elements) via dialog content (iframe), and use HTML5 window.postMessage to call the plugin (coming soon!)
>>
>> --
>>
>> New function: setDialogContentUrl
>>
>> New signature:
>> setDialogContentUrl(dialogToken, contentUrl)
>>
>> Example usage:
>> setDialogContentUrl('my-dialog', 'http://www.example.com/')
>>
>> --
>>
>> New function: closeDialog
>>
>> New signature:
>> closeDialog(dialogToken)
>>
>> Example usage:
>> closeDialog('my-dialog')
>>
>>
>> Tab API
>> =======
>>
>> Functions improved: addMainTab & addSubTab
>>
>> New signatures:
>> addMainTab(label, historyToken, contentUrl [, options])
>> addSubTab(entityTypeName, label, historyToken, contentUrl [, options])
>>
>> Example usage:
>>
>> // Tab is left-aligned by default
>> addMainTab('Foo Tab', 'foo-tab', 'http://www.foo.com/');
>>
>> // Tab is right-aligned via options object
>> addSubTab('VirtualMachine', 'Bar Tab', 'bar-tab', 'http://www.bar.com/', {
>> alignRight: true
>> });
>>
>> --
>>
>> Regards,
>> Vojtech
>>
> _______________________________________________
> Engine-devel mailing list
> Engine-devel at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/engine-devel
>
More information about the Devel
mailing list