diff options
| author | 2024-06-06 03:58:19 +0900 | |
|---|---|---|
| committer | 2024-06-05 20:58:19 +0200 | |
| commit | 99b1d551e61adb5cbd014677f151f443b0c6c35f (patch) | |
| tree | 852e0cad4c9ad908c1c969a88e290cb05ec5df85 /docs | |
| parent | 4f60a42e6437196b5a67693e0666150bb7d51ae9 (diff) | |
Add core extensions: UserCSS, UserJS (#6267)
* Copy CustomCSS and CustomJS
Original: FreshRSS/Extensions@9f21984
* Rename CustomCSS -> UserCSS
* Rename CustomJS -> UserJS
* Change metadata
The name is used for the directory where the configuration
is stored and should not contain spaces.
Since the name was changed, I reset the version number and
changed to semantic versioning.
* Change data directory
Changed the location of the configuration file to
the user data directory, because it is not `static`.
That way, the user's configurations are gathered
in the user directory, which makes it easier to backup them.
* Edit documentations
Remove procedures to install the extension
because it is no longer necessary.
* Fix wrong variables in the configuration page
Remove permission error indication because the storage location
is now in the user data directory managed by the application.
* Remove the `xExtension-` prefix for core extensions
* Set version to 1.0.0 for UserCSS, UserJS
* Refactoring
* Remove unused variables
* Remove version 0.0.1 in Changelog
Version 0.0.1 will not be merged, so only version 1.0.0 will remain.
* public getFileUrl
* Revert more protected
* Use entrypoint for extension user path instead of name
* Add space to extension name
* Add `#[\Override]`
* Add explains of User CSS and User JS to docs
* Remove README of User CSS and User JS
* Add migration code for extension user path
---------
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/en/developers/03_Backend/05_Extensions.md | 9 | ||||
| -rw-r--r-- | docs/en/users/05_Configuration.md | 40 | ||||
| -rw-r--r-- | docs/fr/developers/03_Backend/05_Extensions.md | 7 | ||||
| -rw-r--r-- | docs/i18n/freshrss.fr.po | 14 | ||||
| -rw-r--r-- | docs/i18n/templates/freshrss.pot | 14 |
5 files changed, 72 insertions, 12 deletions
diff --git a/docs/en/developers/03_Backend/05_Extensions.md b/docs/en/developers/03_Backend/05_Extensions.md index 164a309ed..f83d8eef7 100644 --- a/docs/en/developers/03_Backend/05_Extensions.md +++ b/docs/en/developers/03_Backend/05_Extensions.md @@ -56,8 +56,11 @@ If you want to write a `HelloWorld` extension, the directory name should be `xEx In the file `freshrss/extensions/xExtension-HelloWorld/extension.php` you need the structure: ```php -class HelloWorldExtension extends Minz_Extension { - public function init() { +final class HelloWorldExtension extends Minz_Extension { + #[\Override] + public function init(): void { + parent::init(); + // your code here } } @@ -136,6 +139,8 @@ final class HelloWorldExtension extends Minz_Extension { #[\Override] public function init(): void { + parent::init(); + $this->registerHook('entry_before_display', [$this, 'renderEntry']); $this->registerHook('check_url_before_add', [self::class, 'checkUrl']); } diff --git a/docs/en/users/05_Configuration.md b/docs/en/users/05_Configuration.md index 529e3b63f..33ef99aee 100644 --- a/docs/en/users/05_Configuration.md +++ b/docs/en/users/05_Configuration.md @@ -177,6 +177,45 @@ You can change your email address or password here. The authentication token is Extensions can be managed from this menu. Note that while extensions can be removed from the web interface, they cannot be added from it. +Some extensions have configurations and these can be changed in the manage page, which opens with the button near the name of the extension. + +## User CSS + +It gives ability to create user-specific CSS rules to apply in addition of the actual theme. + +### Example: Getting rid of Top Menu Items + +The Top Menu within the mobile view might look a little bit cluttered, depending on the theme. The following CSS rules allow to hide unnecessary top menu buttons or input boxes. + +```css +@media (max-width: 840px) +{ + /* Hides "Actions" Menu in Mobile View */ + #nav_menu_actions { + display: none; + } + + /* Hides "Views" Menu in Mobile View */ + #nav_menu_views { + display: none; + } + + /* Hides "Search" Input Box in Mobile View */ + .nav_menu .item.search { + display: none; + } + + /* Hides the Dropdown Menu Button next to the "Mark all read" Button in Mobile View */ + #mark-read-menu .dropdown { + display: none; + } +} +``` + +## User JS + +It gives ability to create user-specific JS. + # Users > **TODO** @@ -199,4 +238,3 @@ Require user marie ``` More information can be found in the [Apache documentation](http://httpd.apache.org/docs/trunk/howto/auth.html#gettingitworking). - diff --git a/docs/fr/developers/03_Backend/05_Extensions.md b/docs/fr/developers/03_Backend/05_Extensions.md index 335eb5e6e..61d0589ef 100644 --- a/docs/fr/developers/03_Backend/05_Extensions.md +++ b/docs/fr/developers/03_Backend/05_Extensions.md @@ -81,8 +81,11 @@ class name `HelloWorldExtension`. In the file `freshrss/extensions/xExtension-HelloWorld/extension.php` you need the structure: ```html -class HelloWorldExtension extends Minz_Extension { +final class HelloWorldExtension extends Minz_Extension { + #[\Override] public function init() { + parent::init(); + // your code here } } @@ -192,6 +195,8 @@ final class HelloWorldExtension extends Minz_Extension { #[\Override] public function init(): void { + parent::init(); + $this->registerHook('entry_before_display', [$this, 'renderEntry']); $this->registerHook('check_url_before_add', [self::class, 'checkUrl']); } diff --git a/docs/i18n/freshrss.fr.po b/docs/i18n/freshrss.fr.po index af44074c4..fc78802ff 100644 --- a/docs/i18n/freshrss.fr.po +++ b/docs/i18n/freshrss.fr.po @@ -1756,8 +1756,11 @@ msgstr "" #: en/./developers/03_Backend/05_Extensions.md:58 #, no-wrap msgid "" -"class HelloWorldExtension extends Minz_Extension {\n" -"\tpublic function init() {\n" +"final class HelloWorldExtension extends Minz_Extension {\n" +"\t#[\Override]\n" +"\tpublic function init(): void {\n" +"\t\tparent::init();\n" +"\n" "\t\t// your code here\n" "\t}\n" "}\n" @@ -2003,9 +2006,12 @@ msgstr "" #: en/./developers/03_Backend/05_Extensions.md:134 #, no-wrap msgid "" -"class HelloWorldExtension extends Minz_Extension\n" +"final class HelloWorldExtension extends Minz_Extension\n" "{\n" -"\tpublic function init() {\n" +"\t#[\Override]\n" +"\tpublic function init(): void {\n" +"\t\tparent::init();\n" +"\n" "\t\t$this->registerHook('entry_before_display', array($this, 'renderEntry'));\n" "\t}\n" "\tpublic function renderEntry($entry) {\n" diff --git a/docs/i18n/templates/freshrss.pot b/docs/i18n/templates/freshrss.pot index 3cc0ca681..9cfdd6905 100644 --- a/docs/i18n/templates/freshrss.pot +++ b/docs/i18n/templates/freshrss.pot @@ -1630,8 +1630,11 @@ msgstr "" #: en/./developers/03_Backend/05_Extensions.md:58 #, no-wrap msgid "" -"class HelloWorldExtension extends Minz_Extension {\n" -"\tpublic function init() {\n" +"final class HelloWorldExtension extends Minz_Extension {\n" +"\t#[\Override]\n" +"\tpublic function init(): void {\n" +"\t\tparent::init();\n" +"\n" "\t\t// your code here\n" "\t}\n" "}\n" @@ -1911,9 +1914,12 @@ msgstr "" #: en/./developers/03_Backend/05_Extensions.md:134 #, no-wrap msgid "" -"class HelloWorldExtension extends Minz_Extension\n" +"final class HelloWorldExtension extends Minz_Extension\n" "{\n" -"\tpublic function init() {\n" +"\t#[\Override]\n" +"\tpublic function init(): void {\n" +"\t\tparent::init();\n" +"\n" "\t\t$this->registerHook('entry_before_display', array($this, " "'renderEntry'));\n" "\t}\n" |
