<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 15, 2016 at 11:23 AM, Vojtech Szocs <span dir="ltr"><<a href="mailto:vszocs@redhat.com" target="_blank">vszocs@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi Martin,<br>
<br>
(adding Greg and Alex in case they have any thoughts)<br>
<br>
if you build your UI plugin in a way that requires CSS styles,<br>
JS libraries etc. at runtime (dynamic linking), you can utilize<br>
oVirt branding servlet [a] to serve branding-related resources.<br>
<br>
[a] org.ovirt.engine.core.branding.BrandingServlet<br>
<br>
By default, oVirt Engine ships with single branding package:<br>
<br>
$ ls /etc/ovirt-engine/branding/<br>
00-ovirt.brand<br>
<br>
That `00-ovirt.brand` directory symlinks to:<br>
<br>
/usr/share/ovirt-engine/branding/ovirt.brand<br>
<br>
containing all branding-related resources.<br>
<br>
To fetch them, use the following URL:<br>
<br>
<a href="http://example.com/ovirt-engine/webadmin/theme/" rel="noreferrer" target="_blank">http://example.com/ovirt-engine/webadmin/theme/</a><path_to_file><br>
<br>
where <path_to_file> is relative to `ovirt.brand` directory.<br>
<br>
In your UI plugin, you can use the newly introduced API to<br>
construct this URL more easily [b]:<br>
<br>
var url = api.engineBaseUrl() + 'webadmin/theme/' + pathToFile<br>
<br>
[b] <a href="https://gerrit.ovirt.org/#/c/55694/" rel="noreferrer" target="_blank">https://gerrit.ovirt.org/#/c/55694/</a><br>
<br>
WebAdmin UI itself loads following CSS styles (in this order):<br>
<br>
- web_admin.css<br>
- common.css<br>
- gwt_common.css<br>
- patternfly/css/styles.min.css<br>
- patternfly-ovirt.css<br>
- ovirt-patternfly-compat.css<br>
- ovirt.css<br>
<br>
For starters, you can load PatternFly-specific CSS only.<br>
<br>
As for JS libraries, these are typically provided through<br>
PatternFly RPM, to which `patternfly` directory symlinks.<br>
<br>
For starters, you can use stuff under `patternfly/js` and<br>
`patternfly/components` (these are PF's own dependencies).<br>
<br>
oVirt ships its own version of jQuery (v1.11) + Bootstrap<br>
(v3.3.6) -- please don't use them!! If you're wondering<br>
why we use custom jQuery and Bootstrap, see here:<br>
<br>
<a href="https://gerrit.ovirt.org/#/c/41228/" rel="noreferrer" target="_blank">https://gerrit.ovirt.org/#/c/41228/</a><br>
<a href="https://gerrit.ovirt.org/#/c/55546/" rel="noreferrer" target="_blank">https://gerrit.ovirt.org/#/c/55546/</a><br>
<br>
(@Greg, any plans for upgrading to PF-provided jQuery?)<br></blockquote><div><br></div><div>No plans to switch to the libraries that PatternFly provides -- and I'm not all that sure we should. We got burned by it, so we moved away from it intentionally in [<a href="https://gerrit.ovirt.org/#/c/41228/" rel="noreferrer" target="_blank">https://gerrit.ovirt.org/#/c/41228/</a>]. Probably best to chat about that in another thread.</div><div><br></div><div>Greg</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
Regards,<br>
Vojtech<br>
<div class=""><div class="h5"><br>
<br>
----- Original Message -----<br>
> From: "Martin Sivak" <<a href="mailto:msivak@redhat.com">msivak@redhat.com</a>><br>
> To: "<a href="mailto:engine-devel@ovirt.org">engine-devel@ovirt.org</a>" <<a href="mailto:devel@ovirt.org">devel@ovirt.org</a>><br>
> Cc: "Moran Goldboim" <<a href="mailto:mgoldboi@redhat.com">mgoldboi@redhat.com</a>>, "Vojtech Szocs" <<a href="mailto:vszocs@redhat.com">vszocs@redhat.com</a>>, "Oved Ourfali" <<a href="mailto:oourfali@redhat.com">oourfali@redhat.com</a>><br>
> Sent: Wednesday, April 13, 2016 5:30:49 PM<br>
> Subject: UI plugins - access to engine styles and libraries<br>
><br>
> Hi everybody,<br>
><br>
> there is one piece I always missed when developing my optimizer plugin<br>
> and that is the access to the engine css styles.<br>
><br>
> I feel it might be pretty easy and good for both bandwidth and<br>
> branding to expose them using some "well known" url from the engine.<br>
> All plugins would be then able to (re-)use the same styling<br>
> information and basic javascript libraries (jQuery, angular, whatever<br>
> you decide the core engine will use).<br>
><br>
> So far, each UI plugin has to link to its own version of libraries and<br>
> define (and maintain) custom color theme.<br>
><br>
> Do you think this would be doable for 4.0?<br>
><br>
> Best regards<br>
><br>
> --<br>
> Martin Sivak<br>
> SLA / oVirt<br>
><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Greg Sheremeta, MBA<br>Red Hat, Inc.<br>Sr. Software Engineer<br><a href="mailto:gshereme@redhat.com" target="_blank">gshereme@redhat.com</a><br>919-741-4016<br></div>
</div></div>