9bd0ce688d
For plugins, imported with HTML imports, and providing CSS modules, use provided styles to control metadata sections in gr-change-view. Related Polymer API: https://www.polymer-project.org/1.0/docs/devguide/styling#custom-style Includes sample integration test. Sample code for using proposed API, in plugin.js: Gerrit.install(function(plugin) { plugin.registerStyleModule('change-metadata', 'my-plugin-style'); }); Please note that `my-plugin-style` has to be unique, so plugin name should be included. Sample code for using proposed API, in myplugin.html: <dom-module id="my-plugin-style"> <template> <style> :root { --change-metadata-assignee: { display: none; } --change-metadata-label-status: { display: none; } --change-metadata-strategy: { display: none; } --change-metadata-topic: { display: none; } } </style> </template> </dom-module> Feature: Issue 5402 Change-Id: Iba2645f28d5b411df2d0310a05aa0cbec4cca26a
26 lines
1.2 KiB
Plaintext
26 lines
1.2 KiB
Plaintext
= Gerrit Code Review - PolyGerrit Plugin Development
|
|
|
|
CAUTION: Work in progress. Hard hat area. +
|
|
This document will be populated with details along with implementation. +
|
|
link:https://groups.google.com/d/topic/repo-discuss/vb8WJ4m0hK0/discussion[Join the discussion.]
|
|
|
|
[[loading]]
|
|
== Plugin loading and initialization
|
|
|
|
link:https://gerrit-review.googlesource.com/Documentation/js-api.html#_entry_point[Entry point] for the plugin and the loading method is based on link:http://w3c.github.io/webcomponents/spec/imports/[HTML Imports] spec.
|
|
|
|
* Plugin provides index.html, similar to link:https://gerrit-review.googlesource.com/Documentation/dev-plugins.html#deployment[.js Web UI plugins]
|
|
* index.html contains a `dom-module` tag with a script that uses `Gerrit.install()`.
|
|
* PolyGerrit imports index.html along with all required resources defined in it (fonts, styles, etc)
|
|
* For standalone plugins, the entry point file is a `pluginname.html` file located in `gerrit-site/plugins` folder, where pluginname is an alphanumeric plugin name.
|
|
|
|
Here's a sample `myplugin.html`:
|
|
|
|
``` html
|
|
<dom-module id="my-plugin">
|
|
<script>
|
|
Gerrit.install(function() { console.log('Ready.'); });
|
|
</script>
|
|
</dom-module>
|
|
```
|