Compare commits
7 commits
master
...
TitleWrap-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b5c9e353c5 | ||
|
|
18e2d339a7 | ||
|
|
9d1334d2b0 | ||
|
|
9fec6fc4a9 | ||
|
|
dd611858a3 | ||
|
|
60c866204b | ||
|
|
dd9f9c6401 |
134 changed files with 5055 additions and 5891 deletions
|
|
@ -19,9 +19,6 @@ indent_style = tab
|
||||||
indent_size = 4
|
indent_size = 4
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
|
|
||||||
[*.neon]
|
|
||||||
indent_style = tab
|
|
||||||
|
|
||||||
[*.xml]
|
[*.xml]
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
|
|
||||||
|
|
|
||||||
7
.eslintignore
Normal file
7
.eslintignore
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
.git/
|
||||||
|
*.min.js
|
||||||
|
node_modules/
|
||||||
|
symbolic/
|
||||||
|
third-party/
|
||||||
|
tmp/
|
||||||
|
vendor/
|
||||||
29
.eslintrc.json
Normal file
29
.eslintrc.json
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
{
|
||||||
|
"env": {
|
||||||
|
"browser": true
|
||||||
|
},
|
||||||
|
"extends": [
|
||||||
|
"eslint:recommended",
|
||||||
|
"standard"
|
||||||
|
],
|
||||||
|
"rules": {
|
||||||
|
"camelcase": "off",
|
||||||
|
"comma-dangle": ["warn", {
|
||||||
|
"arrays": "always-multiline",
|
||||||
|
"objects": "always-multiline"
|
||||||
|
}],
|
||||||
|
"eqeqeq": "off",
|
||||||
|
"indent": ["warn", "tab", { "SwitchCase": 1 }],
|
||||||
|
"linebreak-style": ["error", "unix"],
|
||||||
|
"max-len": ["warn", 165],
|
||||||
|
"no-tabs": "off",
|
||||||
|
"semi": ["warn", "always"],
|
||||||
|
"space-before-function-paren": ["warn", {
|
||||||
|
"anonymous": "always",
|
||||||
|
"named": "never",
|
||||||
|
"asyncArrow": "always"
|
||||||
|
}],
|
||||||
|
"yoda": "off"
|
||||||
|
},
|
||||||
|
"root": true
|
||||||
|
}
|
||||||
25
.github/dependabot.yml
vendored
25
.github/dependabot.yml
vendored
|
|
@ -1,25 +0,0 @@
|
||||||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
|
||||||
|
|
||||||
version: 2
|
|
||||||
updates:
|
|
||||||
- package-ecosystem: "github-actions"
|
|
||||||
directory: "/"
|
|
||||||
schedule:
|
|
||||||
interval: "monthly"
|
|
||||||
- package-ecosystem: "npm"
|
|
||||||
directory: "/"
|
|
||||||
schedule:
|
|
||||||
interval: "monthly"
|
|
||||||
groups:
|
|
||||||
eslint:
|
|
||||||
patterns:
|
|
||||||
- "*eslint*"
|
|
||||||
- "globals"
|
|
||||||
- "neostandard"
|
|
||||||
stylelint:
|
|
||||||
patterns:
|
|
||||||
- "*stylelint*"
|
|
||||||
- package-ecosystem: "composer"
|
|
||||||
directory: "/"
|
|
||||||
schedule:
|
|
||||||
interval: "monthly"
|
|
||||||
13
.github/workflows/tests.yml
vendored
13
.github/workflows/tests.yml
vendored
|
|
@ -10,7 +10,7 @@ jobs:
|
||||||
|
|
||||||
tests:
|
tests:
|
||||||
# https://github.com/actions/virtual-environments
|
# https://github.com/actions/virtual-environments
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-22.04
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: ./Extensions
|
working-directory: ./Extensions
|
||||||
|
|
@ -31,7 +31,7 @@ jobs:
|
||||||
|
|
||||||
- name: Use Composer cache
|
- name: Use Composer cache
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: Extensions/vendor
|
path: Extensions/vendor
|
||||||
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
|
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
|
||||||
|
|
@ -54,13 +54,16 @@ jobs:
|
||||||
- name: PHPStan
|
- name: PHPStan
|
||||||
run: composer run-script phpstan
|
run: composer run-script phpstan
|
||||||
|
|
||||||
|
- name: PHPStan Next Level
|
||||||
|
run: composer run-script phpstan-next
|
||||||
|
|
||||||
# NPM tests
|
# NPM tests
|
||||||
|
|
||||||
- name: Uses Node.js
|
- name: Uses Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
# https://nodejs.org/en/about/releases/
|
# https://nodejs.org/en/about/releases/
|
||||||
node-version: '22'
|
node-version: '18'
|
||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
cache-dependency-path: 'Extensions/package-lock.json'
|
cache-dependency-path: 'Extensions/package-lock.json'
|
||||||
|
|
||||||
|
|
@ -82,7 +85,7 @@ jobs:
|
||||||
|
|
||||||
- name: Use shell cache
|
- name: Use shell cache
|
||||||
id: shell-cache
|
id: shell-cache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: Extensions/bin
|
path: Extensions/bin
|
||||||
key: ${{ runner.os }}-typos@v1.16.21
|
key: ${{ runner.os }}-typos@v1.16.21
|
||||||
|
|
|
||||||
|
|
@ -6,12 +6,11 @@
|
||||||
"line-length": false,
|
"line-length": false,
|
||||||
"no-hard-tabs": false,
|
"no-hard-tabs": false,
|
||||||
"no-inline-html": {
|
"no-inline-html": {
|
||||||
"allowed_elements": ["br", "img", "kbd"]
|
"allowed_elements": ["br", "kbd"]
|
||||||
},
|
},
|
||||||
"no-multiple-blanks": {
|
"no-multiple-blanks": {
|
||||||
"maximum": 2
|
"maximum": 2
|
||||||
},
|
},
|
||||||
"no-trailing-spaces": true,
|
|
||||||
"ul-indent": false,
|
"ul-indent": false,
|
||||||
"ul-style": {
|
"ul-style": {
|
||||||
"style": "consistent"
|
"style": "consistent"
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"stylelint-order",
|
"stylelint-order",
|
||||||
"stylelint-scss",
|
"stylelint-scss",
|
||||||
"@stylistic/stylelint-plugin"
|
"stylelint-stylistic"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
"at-rule-empty-line-before": [
|
"at-rule-empty-line-before": [
|
||||||
|
|
@ -11,27 +11,27 @@
|
||||||
"ignoreAtRules": [ "after-comment", "else" ]
|
"ignoreAtRules": [ "after-comment", "else" ]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"@stylistic/at-rule-name-space-after": [
|
"stylistic/at-rule-name-space-after": [
|
||||||
"always", {
|
"always", {
|
||||||
"ignoreAtRules": [ "after-comment" ]
|
"ignoreAtRules": [ "after-comment" ]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"@stylistic/block-closing-brace-newline-after": [
|
"stylistic/block-closing-brace-newline-after": [
|
||||||
"always", {
|
"always", {
|
||||||
"ignoreAtRules": [ "if", "else" ]
|
"ignoreAtRules": [ "if", "else" ]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"@stylistic/block-closing-brace-newline-before": "always-multi-line",
|
"stylistic/block-closing-brace-newline-before": "always-multi-line",
|
||||||
"@stylistic/block-opening-brace-newline-after": "always-multi-line",
|
"stylistic/block-opening-brace-newline-after": "always-multi-line",
|
||||||
"@stylistic/block-opening-brace-space-before": "always",
|
"stylistic/block-opening-brace-space-before": "always",
|
||||||
"@stylistic/color-hex-case": "lower",
|
"stylistic/color-hex-case": "lower",
|
||||||
"color-hex-length": "short",
|
"color-hex-length": "short",
|
||||||
"color-no-invalid-hex": true,
|
"color-no-invalid-hex": true,
|
||||||
"@stylistic/declaration-colon-space-after": "always",
|
"stylistic/declaration-colon-space-after": "always",
|
||||||
"@stylistic/declaration-colon-space-before": "never",
|
"stylistic/declaration-colon-space-before": "never",
|
||||||
"@stylistic/indentation": "tab",
|
"stylistic/indentation": "tab",
|
||||||
"no-descending-specificity": null,
|
"no-descending-specificity": null,
|
||||||
"@stylistic/no-eol-whitespace": true,
|
"stylistic/no-eol-whitespace": true,
|
||||||
"property-no-vendor-prefix": true,
|
"property-no-vendor-prefix": true,
|
||||||
"rule-empty-line-before": [
|
"rule-empty-line-before": [
|
||||||
"always", {
|
"always", {
|
||||||
|
|
|
||||||
43
README.md
43
README.md
|
|
@ -17,10 +17,6 @@ make test-all
|
||||||
composer run-script phpstan-third-party
|
composer run-script phpstan-third-party
|
||||||
```
|
```
|
||||||
|
|
||||||
## Core extensions
|
|
||||||
|
|
||||||
*Custom CSS* and *Custom JS* are now a part of [core extensions shipped with FreshRSS](https://github.com/FreshRSS/FreshRSS/tree/edge/lib/core-extensions).
|
|
||||||
|
|
||||||
## Third-party extensions
|
## Third-party extensions
|
||||||
|
|
||||||
There are some FreshRSS extensions out there, developed by community members:
|
There are some FreshRSS extensions out there, developed by community members:
|
||||||
|
|
@ -49,9 +45,9 @@ There are some FreshRSS extensions out there, developed by community members:
|
||||||
* [Reddit Image](https://github.com/aledeg/FreshRSS-extensions/tree/master/xExtension-RedditImage): Replace link to Reddit topic with resource link
|
* [Reddit Image](https://github.com/aledeg/FreshRSS-extensions/tree/master/xExtension-RedditImage): Replace link to Reddit topic with resource link
|
||||||
|
|
||||||
|
|
||||||
### By [@Lapineige](https://github.com/lapineige), [@hkcomori](https://github.com/hkcomori)
|
### By [@Lapineige](https://github.com/lapineige)
|
||||||
|
|
||||||
* [Reading Time](https://github.com/FreshRSS/Extensions/tree/master/xExtension-ReadingTime): Add a reading time estimation next to each article.
|
* [Reading Time](https://framagit.org/Lapineige/FreshRSS_Extension-ReadingTime): Add a reading time estimation next to each article.
|
||||||
|
|
||||||
|
|
||||||
### By [@Korbak](https://github.com/Korbak)
|
### By [@Korbak](https://github.com/Korbak)
|
||||||
|
|
@ -60,13 +56,11 @@ There are some FreshRSS extensions out there, developed by community members:
|
||||||
|
|
||||||
### By [@CN-Tools](https://github.com/cn-tools)
|
### By [@CN-Tools](https://github.com/cn-tools)
|
||||||
|
|
||||||
* [Black List](https://github.com/cn-tools/cntools_FreshRssExtensions/tree/master/xExtension-BlackList): Blacklist to block feeds for users
|
|
||||||
* [Copy 2 Clipboard](https://github.com/cn-tools/cntools_FreshRssExtensions/tree/master/xExtension-Copy2Clipboard): Add a button in the navigation bar to copy the destination links of all visible entries into clipboard
|
* [Copy 2 Clipboard](https://github.com/cn-tools/cntools_FreshRssExtensions/tree/master/xExtension-Copy2Clipboard): Add a button in the navigation bar to copy the destination links of all visible entries into clipboard
|
||||||
* [Feed Title Builder](https://github.com/cn-tools/cntools_FreshRssExtensions/tree/master/xExtension-FeedTitleBuilder): Build your own feed title based on url, the original feed title and the date the feed was added
|
* [Feed Title Builder](https://github.com/cn-tools/cntools_FreshRssExtensions/tree/master/xExtension-FeedTitleBuilder): Build your own feed title based on url, the original feed title and the date the feed was added
|
||||||
* [FilterTitle](https://github.com/cn-tools/cntools_FreshRssExtensions/tree/master/xExtension-FilterTitle): Filter out feed entries by keywords parsed by the feed entry title
|
* [FilterTitle](https://github.com/cn-tools/cntools_FreshRssExtensions/tree/master/xExtension-FilterTitle): Filter out feed entries by keywords parsed by the feed entry title
|
||||||
* [RemoveEmojis](https://github.com/cn-tools/cntools_FreshRssExtensions/tree/master/xExtension-RemoveEmojis): Remove emojis in the title of newly added feed entries
|
* [RemoveEmojis](https://github.com/cn-tools/cntools_FreshRssExtensions/tree/master/xExtension-RemoveEmojis): Remove emojis in the title of newly added feed entries.
|
||||||
* [SendToMyJD2](https://github.com/cn-tools/cntools_FreshRssExtensions/tree/master/xExtension-SendToMyJD2): Send links to a jDownloader2 instance with the myJDownloader2 API
|
* [YouTube Channel 2 RSSFeed](https://github.com/cn-tools/cntools_FreshRssExtensions/tree/master/xExtension-YouTubeChannel2RssFeed): You can add a YouTube Channel URL and will get it as RSSFeed
|
||||||
* [YouTube Channel 2 RSSFeed](https://github.com/cn-tools/cntools_FreshRssExtensions/tree/master/xExtension-YouTubeChannel2RssFeed): You can add a YouTube Channel URL and will get it as RSSFeed. Additional you can detect YouTube shorts.
|
|
||||||
|
|
||||||
### By [@DevonHess](https://github.com/DevonHess)
|
### By [@DevonHess](https://github.com/DevonHess)
|
||||||
|
|
||||||
|
|
@ -88,15 +82,6 @@ There are some FreshRSS extensions out there, developed by community members:
|
||||||
|
|
||||||
* [Pocket Button](https://github.com/christian-putzke/freshrss-pocket-button): Add articles to Pocket with one simple button click or a keyboard shortcut.
|
* [Pocket Button](https://github.com/christian-putzke/freshrss-pocket-button): Add articles to Pocket with one simple button click or a keyboard shortcut.
|
||||||
|
|
||||||
### By [@huffstler](https://github.com/huffstler)
|
|
||||||
|
|
||||||
* [Star To Pocket](https://github.com/huffstler/xExtension-StarToPocket): Like the extension above, but sends articles to Pocket when they are starred. Also works with FreshRSS client applications!
|
|
||||||
|
|
||||||
### By [@Joedmin](https://github.com/Joedmin/)
|
|
||||||
|
|
||||||
* [Readeck Button](https://github.com/Joedmin/xExtension-readeck-button): Add articles to a selected Readeck instance with one simple button click or a keyboard shortcut.
|
|
||||||
* [Wallabag Button](https://github.com/Joedmin/xExtension-wallabag-button): Add articles to a selected Wallabag instance with one simple button click or a keyboard shortcut.
|
|
||||||
|
|
||||||
### By [@printfuck](https://github.com/printfuck/)
|
### By [@printfuck](https://github.com/printfuck/)
|
||||||
|
|
||||||
* [Readable](https://github.com/printfuck/xExtension-Readable): Fetch article content for selected feeds with [Readability](https://github.com/mozilla/readability) or [Mercury](https://github.com/postlight/mercury-parser)
|
* [Readable](https://github.com/printfuck/xExtension-Readable): Fetch article content for selected feeds with [Readability](https://github.com/mozilla/readability) or [Mercury](https://github.com/postlight/mercury-parser)
|
||||||
|
|
@ -149,23 +134,3 @@ There are some FreshRSS extensions out there, developed by community members:
|
||||||
### By [@kalvn](https://github.com/kalvn)
|
### By [@kalvn](https://github.com/kalvn)
|
||||||
|
|
||||||
* [Mark Previous as Read](https://github.com/kalvn/freshrss-mark-previous-as-read): Adds a button in the footer of each entry. Clicking this button will mark all previous entries belonging to the current feed, as read.
|
* [Mark Previous as Read](https://github.com/kalvn/freshrss-mark-previous-as-read): Adds a button in the footer of each entry. Clicking this button will mark all previous entries belonging to the current feed, as read.
|
||||||
|
|
||||||
### By [@lukasMega](https://github.com/lukasMega)
|
|
||||||
|
|
||||||
* [Word Highlighter](https://github.com/lukasMega/Extensions-FreshRSS-): Gives you ability to highlight user-defined words (using [mark.js](https://github.com/julkue/mark.js))
|
|
||||||
|
|
||||||
### By [@LiangWei88](https://github.com/LiangWei88)
|
|
||||||
|
|
||||||
* [ArticleSummary](https://github.com/LiangWei88/xExtension-ArticleSummary): A powerful article summarization plugin for FreshRSS that allows users to generate summaries using a language model API conforming to the OpenAI API specification.
|
|
||||||
|
|
||||||
### By [@Niehztog](https://github.com/Niehztog)
|
|
||||||
|
|
||||||
* [Article Full Text](https://github.com/Niehztog/freshrss-af-readability): Fetches full article contents and adds them to feed items by using [Fivefilters Readability.php library](https://github.com/fivefilters/readability.php) (no docker containers required).
|
|
||||||
|
|
||||||
### By [@tryallthethings](https://github.com/tryallthethings)
|
|
||||||
|
|
||||||
* [FreshVibes](https://github.com/tryallthethings/freshvibes): A fully customizable iGoogle / Netvibes-like dashboard view
|
|
||||||
|
|
||||||
### By [@pe1uca](https://github.com/pe1uca)
|
|
||||||
|
|
||||||
* [Rate limiter](https://github.com/pe1uca/xExtension-RateLimiter/): Prevents FreshRSS from making too many requests to the same site in a defined amount of time.
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
"WebSub"
|
"WebSub"
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=8.1",
|
"php": ">=7.4",
|
||||||
"ext-ctype": "*",
|
"ext-ctype": "*",
|
||||||
"ext-curl": "*",
|
"ext-curl": "*",
|
||||||
"ext-dom": "*",
|
"ext-dom": "*",
|
||||||
|
|
@ -45,26 +45,28 @@
|
||||||
"ext-pdo_pgsql": "*"
|
"ext-pdo_pgsql": "*"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"php": ">=8.1",
|
"php": ">=7.4",
|
||||||
"ext-phar": "*",
|
"ext-phar": "*",
|
||||||
"ext-tokenizer": "*",
|
"ext-tokenizer": "*",
|
||||||
"ext-xmlwriter": "*",
|
"ext-xmlwriter": "*",
|
||||||
"phpstan/phpstan": "^2",
|
"phpstan/phpstan": "^1.10",
|
||||||
"phpstan/phpstan-strict-rules": "^2",
|
"phpstan/phpstan-strict-rules": "^1.5",
|
||||||
"squizlabs/php_codesniffer": "^3"
|
"squizlabs/php_codesniffer": "^3.9"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"php-lint": "find . -type d -name 'vendor' -prune -o -name '*.php' -print0 | xargs -0 -n1 -P4 php -l 1>/dev/null",
|
"php-lint": "find . -type d -name 'vendor' -prune -o -name '*.php' -print0 | xargs -0 -n1 -P4 php -l 1>/dev/null",
|
||||||
"phtml-lint": "find . -type d -name 'vendor' -prune -o -name '*.phtml' -print0 | xargs -0 -n1 -P4 php -l 1>/dev/null",
|
"phtml-lint": "find . -type d -name 'vendor' -prune -o -name '*.phtml' -print0 | xargs -0 -n1 -P4 php -l 1>/dev/null",
|
||||||
"phpcs": "phpcs . -s",
|
"phpcs": "phpcs . -s",
|
||||||
"phpcbf": "phpcbf . -p -s",
|
"phpcbf": "phpcbf . -p -s",
|
||||||
"phpstan": "phpstan analyse .",
|
"phpstan": "phpstan analyse --memory-limit 512M .",
|
||||||
"phpstan-third-party": "phpstan analyse -c phpstan-third-party.neon .",
|
"phpstan-next": "phpstan analyse --memory-limit 512M -c phpstan-next.neon .",
|
||||||
|
"phpstan-third-party": "phpstan analyse --memory-limit 512M -c phpstan-third-party.neon .",
|
||||||
"test": [
|
"test": [
|
||||||
"@php-lint",
|
"@php-lint",
|
||||||
"@phtml-lint",
|
"@phtml-lint",
|
||||||
"@phpcs",
|
"@phpcs",
|
||||||
"@phpstan"
|
"@phpstan",
|
||||||
|
"@phpstan-next"
|
||||||
],
|
],
|
||||||
"fix": [
|
"fix": [
|
||||||
"@phpcbf"
|
"@phpcbf"
|
||||||
|
|
|
||||||
59
composer.lock
generated
59
composer.lock
generated
|
|
@ -4,25 +4,25 @@
|
||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "02054632764558c26a4fbecc0e408c09",
|
"content-hash": "bf0d2d1a05ed08841ca6bd3e7ec96b74",
|
||||||
"packages": [],
|
"packages": [],
|
||||||
"packages-dev": [
|
"packages-dev": [
|
||||||
{
|
{
|
||||||
"name": "phpstan/phpstan",
|
"name": "phpstan/phpstan",
|
||||||
"version": "2.1.17",
|
"version": "1.10.66",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/phpstan/phpstan.git",
|
"url": "https://github.com/phpstan/phpstan.git",
|
||||||
"reference": "89b5ef665716fa2a52ecd2633f21007a6a349053"
|
"reference": "94779c987e4ebd620025d9e5fdd23323903950bd"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/89b5ef665716fa2a52ecd2633f21007a6a349053",
|
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/94779c987e4ebd620025d9e5fdd23323903950bd",
|
||||||
"reference": "89b5ef665716fa2a52ecd2633f21007a6a349053",
|
"reference": "94779c987e4ebd620025d9e5fdd23323903950bd",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^7.4|^8.0"
|
"php": "^7.2|^8.0"
|
||||||
},
|
},
|
||||||
"conflict": {
|
"conflict": {
|
||||||
"phpstan/phpstan-shim": "*"
|
"phpstan/phpstan-shim": "*"
|
||||||
|
|
@ -61,33 +61,38 @@
|
||||||
{
|
{
|
||||||
"url": "https://github.com/phpstan",
|
"url": "https://github.com/phpstan",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan",
|
||||||
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2025-05-21T20:55:28+00:00"
|
"time": "2024-03-28T16:17:31+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpstan/phpstan-strict-rules",
|
"name": "phpstan/phpstan-strict-rules",
|
||||||
"version": "2.0.4",
|
"version": "1.5.3",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/phpstan/phpstan-strict-rules.git",
|
"url": "https://github.com/phpstan/phpstan-strict-rules.git",
|
||||||
"reference": "3e139cbe67fafa3588e1dbe27ca50f31fdb6236a"
|
"reference": "568210bd301f94a0d4b1e5a0808c374c1b9cf11b"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/3e139cbe67fafa3588e1dbe27ca50f31fdb6236a",
|
"url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/568210bd301f94a0d4b1e5a0808c374c1b9cf11b",
|
||||||
"reference": "3e139cbe67fafa3588e1dbe27ca50f31fdb6236a",
|
"reference": "568210bd301f94a0d4b1e5a0808c374c1b9cf11b",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^7.4 || ^8.0",
|
"php": "^7.2 || ^8.0",
|
||||||
"phpstan/phpstan": "^2.0.4"
|
"phpstan/phpstan": "^1.10.60"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
|
"nikic/php-parser": "^4.13.0",
|
||||||
"php-parallel-lint/php-parallel-lint": "^1.2",
|
"php-parallel-lint/php-parallel-lint": "^1.2",
|
||||||
"phpstan/phpstan-deprecation-rules": "^2.0",
|
"phpstan/phpstan-deprecation-rules": "^1.1",
|
||||||
"phpstan/phpstan-phpunit": "^2.0",
|
"phpstan/phpstan-phpunit": "^1.0",
|
||||||
"phpunit/phpunit": "^9.6"
|
"phpunit/phpunit": "^9.5"
|
||||||
},
|
},
|
||||||
"type": "phpstan-extension",
|
"type": "phpstan-extension",
|
||||||
"extra": {
|
"extra": {
|
||||||
|
|
@ -109,22 +114,22 @@
|
||||||
"description": "Extra strict and opinionated rules for PHPStan",
|
"description": "Extra strict and opinionated rules for PHPStan",
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/phpstan/phpstan-strict-rules/issues",
|
"issues": "https://github.com/phpstan/phpstan-strict-rules/issues",
|
||||||
"source": "https://github.com/phpstan/phpstan-strict-rules/tree/2.0.4"
|
"source": "https://github.com/phpstan/phpstan-strict-rules/tree/1.5.3"
|
||||||
},
|
},
|
||||||
"time": "2025-03-18T11:42:40+00:00"
|
"time": "2024-04-06T07:43:25+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "squizlabs/php_codesniffer",
|
"name": "squizlabs/php_codesniffer",
|
||||||
"version": "3.13.2",
|
"version": "3.9.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git",
|
"url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git",
|
||||||
"reference": "5b5e3821314f947dd040c70f7992a64eac89025c"
|
"reference": "267a4405fff1d9c847134db3a3c92f1ab7f77909"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/5b5e3821314f947dd040c70f7992a64eac89025c",
|
"url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/267a4405fff1d9c847134db3a3c92f1ab7f77909",
|
||||||
"reference": "5b5e3821314f947dd040c70f7992a64eac89025c",
|
"reference": "267a4405fff1d9c847134db3a3c92f1ab7f77909",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
|
@ -189,13 +194,9 @@
|
||||||
{
|
{
|
||||||
"url": "https://opencollective.com/php_codesniffer",
|
"url": "https://opencollective.com/php_codesniffer",
|
||||||
"type": "open_collective"
|
"type": "open_collective"
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://thanks.dev/u/gh/phpcsstandards",
|
|
||||||
"type": "thanks_dev"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2025-06-17T22:17:01+00:00"
|
"time": "2024-03-31T21:03:09+00:00"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"aliases": [],
|
"aliases": [],
|
||||||
|
|
@ -204,7 +205,7 @@
|
||||||
"prefer-stable": false,
|
"prefer-stable": false,
|
||||||
"prefer-lowest": false,
|
"prefer-lowest": false,
|
||||||
"platform": {
|
"platform": {
|
||||||
"php": ">=8.1",
|
"php": ">=7.4",
|
||||||
"ext-ctype": "*",
|
"ext-ctype": "*",
|
||||||
"ext-curl": "*",
|
"ext-curl": "*",
|
||||||
"ext-dom": "*",
|
"ext-dom": "*",
|
||||||
|
|
@ -227,7 +228,7 @@
|
||||||
"ext-zlib": "*"
|
"ext-zlib": "*"
|
||||||
},
|
},
|
||||||
"platform-dev": {
|
"platform-dev": {
|
||||||
"php": ">=8.1",
|
"php": ">=7.4",
|
||||||
"ext-phar": "*",
|
"ext-phar": "*",
|
||||||
"ext-tokenizer": "*",
|
"ext-tokenizer": "*",
|
||||||
"ext-xmlwriter": "*"
|
"ext-xmlwriter": "*"
|
||||||
|
|
|
||||||
|
|
@ -1,55 +0,0 @@
|
||||||
import globals from "globals";
|
|
||||||
import js from "@eslint/js";
|
|
||||||
import neostandard, { resolveIgnoresFromGitignore } from 'neostandard';
|
|
||||||
import stylistic from '@stylistic/eslint-plugin';
|
|
||||||
|
|
||||||
export default [
|
|
||||||
{
|
|
||||||
files: ["**/*.js"],
|
|
||||||
languageOptions: {
|
|
||||||
globals: {
|
|
||||||
...globals.browser,
|
|
||||||
},
|
|
||||||
sourceType: "script",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ignores: [
|
|
||||||
...resolveIgnoresFromGitignore(),
|
|
||||||
"**/*.min.js",
|
|
||||||
"extensions/",
|
|
||||||
"p/scripts/vendor/",
|
|
||||||
],
|
|
||||||
},
|
|
||||||
js.configs.recommended,
|
|
||||||
// stylistic.configs['recommended-flat'],
|
|
||||||
...neostandard(),
|
|
||||||
{
|
|
||||||
plugins: {
|
|
||||||
"@stylistic": stylistic,
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
"camelcase": "off",
|
|
||||||
"eqeqeq": "off",
|
|
||||||
"no-empty": ["error", { "allowEmptyCatch": true }],
|
|
||||||
"no-unused-vars": ["error", {
|
|
||||||
"args": "none",
|
|
||||||
"caughtErrors": "none",
|
|
||||||
}],
|
|
||||||
"object-shorthand": "off",
|
|
||||||
"yoda": "off",
|
|
||||||
"@stylistic/indent": ["warn", "tab", { "SwitchCase": 1 }],
|
|
||||||
"@stylistic/linebreak-style": ["error", "unix"],
|
|
||||||
"@stylistic/max-len": ["warn", 165],
|
|
||||||
"@stylistic/no-tabs": "off",
|
|
||||||
"@stylistic/quotes": ["off", "single", { "avoidEscape": true }],
|
|
||||||
"@stylistic/quote-props": ["warn", "consistent"],
|
|
||||||
"@stylistic/semi": ["warn", "always"],
|
|
||||||
"@stylistic/space-before-function-paren": ["warn", {
|
|
||||||
"anonymous": "always",
|
|
||||||
"asyncArrow": "always",
|
|
||||||
"named": "never",
|
|
||||||
}],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
];
|
|
||||||
189
extensions.json
189
extensions.json
|
|
@ -1,17 +1,6 @@
|
||||||
{
|
{
|
||||||
"version": 0.1,
|
"version": 0.1,
|
||||||
"extensions": [
|
"extensions": [
|
||||||
{
|
|
||||||
"name": "Af_Readability",
|
|
||||||
"author": "niehztog",
|
|
||||||
"description": "Try to inline article content using Readability",
|
|
||||||
"version": "0.1",
|
|
||||||
"entrypoint": "Af_Readability",
|
|
||||||
"type": "user",
|
|
||||||
"url": "https://github.com/Niehztog/freshrss-af-readability",
|
|
||||||
"method": "git",
|
|
||||||
"directory": "."
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "Always togglable menu",
|
"name": "Always togglable menu",
|
||||||
"author": "nicofrand",
|
"author": "nicofrand",
|
||||||
|
|
@ -23,17 +12,6 @@
|
||||||
"method": "git",
|
"method": "git",
|
||||||
"directory": "."
|
"directory": "."
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "ArticleSummary",
|
|
||||||
"author": "Liang",
|
|
||||||
"description": "A powerful article summarization plugin for FreshRSS that allows users to generate summaries using a language model API conforming to the OpenAI API specification.",
|
|
||||||
"version": "0.1.2",
|
|
||||||
"entrypoint": "ArticleSummary",
|
|
||||||
"type": "user",
|
|
||||||
"url": "https://github.com/LiangWei88/xExtension-ArticleSummary",
|
|
||||||
"method": "git",
|
|
||||||
"directory": "."
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "Auto Refresh",
|
"name": "Auto Refresh",
|
||||||
"author": "Essa AlAwadi",
|
"author": "Essa AlAwadi",
|
||||||
|
|
@ -49,7 +27,7 @@
|
||||||
"name": "AutoTTL",
|
"name": "AutoTTL",
|
||||||
"author": "Magnus Kokk",
|
"author": "Magnus Kokk",
|
||||||
"description": "A FreshRSS extension for automatic feed refresh TTL based on the average frequency of entries.",
|
"description": "A FreshRSS extension for automatic feed refresh TTL based on the average frequency of entries.",
|
||||||
"version": "0.5.8",
|
"version": "0.5.5",
|
||||||
"entrypoint": "AutoTTL",
|
"entrypoint": "AutoTTL",
|
||||||
"type": "user",
|
"type": "user",
|
||||||
"url": "https://github.com/mgnsk/FreshRSS-AutoTTL",
|
"url": "https://github.com/mgnsk/FreshRSS-AutoTTL",
|
||||||
|
|
@ -82,7 +60,7 @@
|
||||||
"name": "Colorful List",
|
"name": "Colorful List",
|
||||||
"author": "Claud Xiao",
|
"author": "Claud Xiao",
|
||||||
"description": "Colorful Entry Title based on RSS source",
|
"description": "Colorful Entry Title based on RSS source",
|
||||||
"version": "0.3.2",
|
"version": "0.3.1",
|
||||||
"entrypoint": "ColorfulList",
|
"entrypoint": "ColorfulList",
|
||||||
"type": "user",
|
"type": "user",
|
||||||
"url": "https://github.com/FreshRSS/Extensions",
|
"url": "https://github.com/FreshRSS/Extensions",
|
||||||
|
|
@ -93,7 +71,7 @@
|
||||||
"name": "Comics in feed",
|
"name": "Comics in feed",
|
||||||
"author": "José Moreira",
|
"author": "José Moreira",
|
||||||
"description": "Embed the images from comics feeds directly.",
|
"description": "Embed the images from comics feeds directly.",
|
||||||
"version": "1.5.1",
|
"version": "1.5.0",
|
||||||
"entrypoint": "ComicsInFeed",
|
"entrypoint": "ComicsInFeed",
|
||||||
"type": "system",
|
"type": "system",
|
||||||
"url": "https://github.com/giventofly/freshrss-comicsinfeed",
|
"url": "https://github.com/giventofly/freshrss-comicsinfeed",
|
||||||
|
|
@ -111,6 +89,28 @@
|
||||||
"method": "git",
|
"method": "git",
|
||||||
"directory": "xExtension-Copy2Clipboard"
|
"directory": "xExtension-Copy2Clipboard"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "Custom CSS",
|
||||||
|
"author": "Marien Fressinaud",
|
||||||
|
"description": "Give possibility to overwrite the CSS with a user-specific rules.",
|
||||||
|
"version": "0.5.1",
|
||||||
|
"entrypoint": "CustomCSS",
|
||||||
|
"type": "user",
|
||||||
|
"url": "https://github.com/FreshRSS/Extensions",
|
||||||
|
"method": "git",
|
||||||
|
"directory": "xExtension-CustomCSS"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Custom JS",
|
||||||
|
"author": "Frans de Jonge",
|
||||||
|
"description": "Apply custom JS.",
|
||||||
|
"version": "0.5.1",
|
||||||
|
"entrypoint": "CustomJS",
|
||||||
|
"type": "user",
|
||||||
|
"url": "https://github.com/FreshRSS/Extensions",
|
||||||
|
"method": "git",
|
||||||
|
"directory": "xExtension-CustomJS"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "Date Format",
|
"name": "Date Format",
|
||||||
"author": "Alexis Degrugillier",
|
"author": "Alexis Degrugillier",
|
||||||
|
|
@ -148,7 +148,7 @@
|
||||||
"name": "FilterTitle",
|
"name": "FilterTitle",
|
||||||
"author": "CNTools | Clemens Neubauer",
|
"author": "CNTools | Clemens Neubauer",
|
||||||
"description": "Filter feed entries by filter keywords in title",
|
"description": "Filter feed entries by filter keywords in title",
|
||||||
"version": "0.1.0",
|
"version": "0.0.3",
|
||||||
"entrypoint": "FilterTitle",
|
"entrypoint": "FilterTitle",
|
||||||
"type": "system",
|
"type": "system",
|
||||||
"url": "https://github.com/cn-tools/cntools_FreshRssExtensions",
|
"url": "https://github.com/cn-tools/cntools_FreshRssExtensions",
|
||||||
|
|
@ -166,22 +166,11 @@
|
||||||
"method": "git",
|
"method": "git",
|
||||||
"directory": "xExtension-FixedNavMenu"
|
"directory": "xExtension-FixedNavMenu"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "Fresh Vibes View",
|
|
||||||
"author": "Try all the things",
|
|
||||||
"description": "Provides a Netvibes-like dashboard view with draggable feed containers.",
|
|
||||||
"version": "1.8.6",
|
|
||||||
"entrypoint": "FreshVibesView",
|
|
||||||
"type": "user",
|
|
||||||
"url": "https://github.com/tryallthethings/freshvibes",
|
|
||||||
"method": "git",
|
|
||||||
"directory": "."
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "FreshRss FlareSolverr",
|
"name": "FreshRss FlareSolverr",
|
||||||
"author": "James Ravenscroft",
|
"author": "James Ravenscroft",
|
||||||
"description": "Use a Flaresolverr instance to bypass cloudflare security checks",
|
"description": "Use a Flaresolverr instance to bypass cloudflare security checks",
|
||||||
"version": "0.3",
|
"version": "0.1",
|
||||||
"entrypoint": "FlareSolverr",
|
"entrypoint": "FlareSolverr",
|
||||||
"type": "system",
|
"type": "system",
|
||||||
"url": "https://github.com/ravenscroftj/freshrss-flaresolverr-extension",
|
"url": "https://github.com/ravenscroftj/freshrss-flaresolverr-extension",
|
||||||
|
|
@ -203,7 +192,7 @@
|
||||||
"name": "Image Cache",
|
"name": "Image Cache",
|
||||||
"author": "Victrid",
|
"author": "Victrid",
|
||||||
"description": "Cache feed images on your own facility or Cloudflare cache.",
|
"description": "Cache feed images on your own facility or Cloudflare cache.",
|
||||||
"version": "0.4.1",
|
"version": "0.3",
|
||||||
"entrypoint": "ImageCache",
|
"entrypoint": "ImageCache",
|
||||||
"type": "user",
|
"type": "user",
|
||||||
"url": "https://github.com/Victrid/freshrss-image-cache-plugin",
|
"url": "https://github.com/Victrid/freshrss-image-cache-plugin",
|
||||||
|
|
@ -214,7 +203,7 @@
|
||||||
"name": "Image Proxy",
|
"name": "Image Proxy",
|
||||||
"author": "Frans de Jonge",
|
"author": "Frans de Jonge",
|
||||||
"description": "No insecure content warnings or disappearing images.",
|
"description": "No insecure content warnings or disappearing images.",
|
||||||
"version": "1.0",
|
"version": "0.7.2",
|
||||||
"entrypoint": "ImageProxy",
|
"entrypoint": "ImageProxy",
|
||||||
"type": "user",
|
"type": "user",
|
||||||
"url": "https://github.com/FreshRSS/Extensions",
|
"url": "https://github.com/FreshRSS/Extensions",
|
||||||
|
|
@ -247,7 +236,7 @@
|
||||||
"name": "Kagi Summarizer",
|
"name": "Kagi Summarizer",
|
||||||
"author": "Rudis Muiznieks",
|
"author": "Rudis Muiznieks",
|
||||||
"description": "Add buttons to summarize articles with the Kagi Universal Summarizer.",
|
"description": "Add buttons to summarize articles with the Kagi Universal Summarizer.",
|
||||||
"version": "0.4",
|
"version": "0.2",
|
||||||
"entrypoint": "KagiSummarizer",
|
"entrypoint": "KagiSummarizer",
|
||||||
"type": "user",
|
"type": "user",
|
||||||
"url": "https://code.sitosis.com/rudism/freshrss-kagi-summarizer",
|
"url": "https://code.sitosis.com/rudism/freshrss-kagi-summarizer",
|
||||||
|
|
@ -279,8 +268,8 @@
|
||||||
{
|
{
|
||||||
"name": "Mark Previous as Read",
|
"name": "Mark Previous as Read",
|
||||||
"author": "kalvn",
|
"author": "kalvn",
|
||||||
"description": "This extension adds a button in the footer of each entry. Clicking this button will mark all previous entries as read.",
|
"description": "This extension adds a button in the footer of each entry. Clicking this button will mark all previous entries belonging to the current feed, as read. The goal is, when going through a very long list of entries without reading them all, to be able to stop and continue later.",
|
||||||
"version": "1.1.1",
|
"version": "1.0.1",
|
||||||
"entrypoint": "MarkPreviousAsRead",
|
"entrypoint": "MarkPreviousAsRead",
|
||||||
"type": "user",
|
"type": "user",
|
||||||
"url": "https://github.com/kalvn/freshrss-mark-previous-as-read",
|
"url": "https://github.com/kalvn/freshrss-mark-previous-as-read",
|
||||||
|
|
@ -302,7 +291,7 @@
|
||||||
"name": "News Assistant",
|
"name": "News Assistant",
|
||||||
"author": "Mervyn Zhan",
|
"author": "Mervyn Zhan",
|
||||||
"description": "Using the ai api of `OpenAI`, `Anthropic`, `Groq` by [Portkey-AI/gateway](https://github.com/Portkey-AI/gateway/) to summary the news.",
|
"description": "Using the ai api of `OpenAI`, `Anthropic`, `Groq` by [Portkey-AI/gateway](https://github.com/Portkey-AI/gateway/) to summary the news.",
|
||||||
"version": "0.12.0",
|
"version": "0.11.0",
|
||||||
"entrypoint": "NewsAssistant",
|
"entrypoint": "NewsAssistant",
|
||||||
"type": "system",
|
"type": "system",
|
||||||
"url": "https://github.com/reply2future/xExtension-NewsAssistant",
|
"url": "https://github.com/reply2future/xExtension-NewsAssistant",
|
||||||
|
|
@ -313,7 +302,7 @@
|
||||||
"name": "Pocket Button",
|
"name": "Pocket Button",
|
||||||
"author": "Christian Putzke",
|
"author": "Christian Putzke",
|
||||||
"description": "Add articles to Pocket with one simple button click or a keyboard shortcut.",
|
"description": "Add articles to Pocket with one simple button click or a keyboard shortcut.",
|
||||||
"version": "0.6",
|
"version": "0.4",
|
||||||
"entrypoint": "PocketButton",
|
"entrypoint": "PocketButton",
|
||||||
"type": "user",
|
"type": "user",
|
||||||
"url": "https://github.com/christian-putzke/freshrss-pocket-button",
|
"url": "https://github.com/christian-putzke/freshrss-pocket-button",
|
||||||
|
|
@ -324,7 +313,7 @@
|
||||||
"name": "Quick Collapse",
|
"name": "Quick Collapse",
|
||||||
"author": "romibi and Marien Fressinaud",
|
"author": "romibi and Marien Fressinaud",
|
||||||
"description": "Quickly change from folded to unfolded articles",
|
"description": "Quickly change from folded to unfolded articles",
|
||||||
"version": "1.0.2",
|
"version": "0.2.1",
|
||||||
"entrypoint": "QuickCollapse",
|
"entrypoint": "QuickCollapse",
|
||||||
"type": "user",
|
"type": "user",
|
||||||
"url": "https://github.com/FreshRSS/Extensions",
|
"url": "https://github.com/FreshRSS/Extensions",
|
||||||
|
|
@ -342,22 +331,11 @@
|
||||||
"method": "git",
|
"method": "git",
|
||||||
"directory": "xExtension-RssBridge"
|
"directory": "xExtension-RssBridge"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "RateLimitFeeds",
|
|
||||||
"author": "pe1uca",
|
|
||||||
"description": "Rate limit feed updates per site.",
|
|
||||||
"version": "3.2.0",
|
|
||||||
"entrypoint": "RateLimiter",
|
|
||||||
"type": "system",
|
|
||||||
"url": "https://github.com/pe1uca/xExtension-RateLimiter",
|
|
||||||
"method": "git",
|
|
||||||
"directory": "."
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "Readable",
|
"name": "Readable",
|
||||||
"author": "printfuck",
|
"author": "printfuck",
|
||||||
"description": "Fetch article content for selected feeds with readability or mercury",
|
"description": "Fetch article content for selected feeds with readability or mercury",
|
||||||
"version": "0.4",
|
"version": "0.2",
|
||||||
"entrypoint": "Readable",
|
"entrypoint": "Readable",
|
||||||
"type": "user",
|
"type": "user",
|
||||||
"url": "https://github.com/printfuck/xExtension-Readable",
|
"url": "https://github.com/printfuck/xExtension-Readable",
|
||||||
|
|
@ -365,21 +343,21 @@
|
||||||
"directory": "."
|
"directory": "."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Readeck Button",
|
"name": "Reading Time",
|
||||||
"author": "Joedmin",
|
"author": "Lapineige",
|
||||||
"description": "Add articles to Readeck with one simple button click or a keyboard shortcut.",
|
"description": "Add a reading time estimation next to each article title",
|
||||||
"version": "0.11",
|
"version": "1.5",
|
||||||
"entrypoint": "ReadeckButton",
|
"entrypoint": "ReadingTime",
|
||||||
"type": "user",
|
"type": "user",
|
||||||
"url": "https://github.com/Joedmin/xExtension-readeck-button",
|
"url": "https://framagit.org/Lapineige/FreshRSS_Extension-ReadingTime/",
|
||||||
"method": "git",
|
"method": "git",
|
||||||
"directory": "."
|
"directory": "."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "ReadingTime",
|
"name": "ReadingTime",
|
||||||
"author": "Lapineige, hkcomori",
|
"author": "Lapineige",
|
||||||
"description": "Add a reading time estimation next to each article",
|
"description": "Add a reading time estimation next to each article",
|
||||||
"version": "1.6.1",
|
"version": "1.5.1",
|
||||||
"entrypoint": "ReadingTime",
|
"entrypoint": "ReadingTime",
|
||||||
"type": "user",
|
"type": "user",
|
||||||
"url": "https://github.com/FreshRSS/Extensions",
|
"url": "https://github.com/FreshRSS/Extensions",
|
||||||
|
|
@ -408,22 +386,11 @@
|
||||||
"method": "git",
|
"method": "git",
|
||||||
"directory": "xExtension-RemoveEmojis"
|
"directory": "xExtension-RemoveEmojis"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "SendToMyJD2",
|
|
||||||
"author": "CNTools | Clemens Neubauer",
|
|
||||||
"description": "Send links to a jDownloader2 instance with the myJDownloader2 API",
|
|
||||||
"version": "0.0.1-alpha",
|
|
||||||
"entrypoint": "SendToMyJD2",
|
|
||||||
"type": "user",
|
|
||||||
"url": "https://github.com/cn-tools/cntools_FreshRssExtensions",
|
|
||||||
"method": "git",
|
|
||||||
"directory": "xExtension-SendToMyJD2"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "Share By Email",
|
"name": "Share By Email",
|
||||||
"author": "Marien Fressinaud",
|
"author": "Marien Fressinaud",
|
||||||
"description": "Improve the sharing by email system.",
|
"description": "Improve the sharing by email system.",
|
||||||
"version": "0.3.3",
|
"version": "0.2.2",
|
||||||
"entrypoint": "ShareByEmail",
|
"entrypoint": "ShareByEmail",
|
||||||
"type": "user",
|
"type": "user",
|
||||||
"url": "https://github.com/FreshRSS/Extensions",
|
"url": "https://github.com/FreshRSS/Extensions",
|
||||||
|
|
@ -432,9 +399,9 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "ShowFeedID",
|
"name": "ShowFeedID",
|
||||||
"author": "math-GH, Inverle",
|
"author": "math-GH",
|
||||||
"description": "Show the ID of feed and category",
|
"description": "Show the feed ID",
|
||||||
"version": "0.4.2",
|
"version": "0.2.1",
|
||||||
"entrypoint": "ShowFeedID",
|
"entrypoint": "ShowFeedID",
|
||||||
"type": "user",
|
"type": "user",
|
||||||
"url": "https://github.com/FreshRSS/Extensions",
|
"url": "https://github.com/FreshRSS/Extensions",
|
||||||
|
|
@ -452,22 +419,11 @@
|
||||||
"method": "git",
|
"method": "git",
|
||||||
"directory": "xExtension-SmartMobileMenu"
|
"directory": "xExtension-SmartMobileMenu"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "StarToPocket",
|
|
||||||
"author": "Pat Hough",
|
|
||||||
"description": "An extension that sends an article to Pocket when you Star (Favorite) it.",
|
|
||||||
"version": "1",
|
|
||||||
"entrypoint": "StarToPocket",
|
|
||||||
"type": "user",
|
|
||||||
"url": "https://github.com/huffstler/xExtension-StarToPocket",
|
|
||||||
"method": "git",
|
|
||||||
"directory": "."
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "Sticky Feeds",
|
"name": "Sticky Feeds",
|
||||||
"author": "Marien Fressinaud",
|
"author": "Marien Fressinaud",
|
||||||
"description": "Set the feed aside in the main stream following the window scroll.",
|
"description": "Set the feed aside in the main stream following the window scroll.",
|
||||||
"version": "0.2.2",
|
"version": "0.2.1",
|
||||||
"entrypoint": "StickyFeeds",
|
"entrypoint": "StickyFeeds",
|
||||||
"type": "user",
|
"type": "user",
|
||||||
"url": "https://github.com/FreshRSS/Extensions",
|
"url": "https://github.com/FreshRSS/Extensions",
|
||||||
|
|
@ -489,18 +445,29 @@
|
||||||
"name": "ThreePanesView",
|
"name": "ThreePanesView",
|
||||||
"author": "nicofrand",
|
"author": "nicofrand",
|
||||||
"description": "Adds a third vertical pane along the articles list, to display the articles content.",
|
"description": "Adds a third vertical pane along the articles list, to display the articles content.",
|
||||||
"version": "1.15",
|
"version": "1.14",
|
||||||
"entrypoint": "ThreePanesView",
|
"entrypoint": "ThreePanesView",
|
||||||
"type": "user",
|
"type": "user",
|
||||||
"url": "https://framagit.org/nicofrand/xextension-threepanesview",
|
"url": "https://framagit.org/nicofrand/xextension-threepanesview",
|
||||||
"method": "git",
|
"method": "git",
|
||||||
"directory": "."
|
"directory": "."
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "TinyTinyRSS API",
|
||||||
|
"author": "Marien Fressinaud",
|
||||||
|
"description": "Provides an API compliant with TinyTinyRSS applications.",
|
||||||
|
"version": "0.1",
|
||||||
|
"entrypoint": "TTRSS_API",
|
||||||
|
"type": "system",
|
||||||
|
"url": "https://github.com/FreshRSS/Extensions",
|
||||||
|
"method": "git",
|
||||||
|
"directory": "xExtension-TTRSS_API"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "Title-Wrap",
|
"name": "Title-Wrap",
|
||||||
"author": "₣rans de Jonge, Joris Kinable",
|
"author": "₣rans de Jonge, Joris Kinable",
|
||||||
"description": "Applies a line-wrap to long article titles, as opposed to truncating the title when it overflows its display area.",
|
"description": "Applies a line-wrap to long article titles, as opposed to truncating the title when it overflows its display area.",
|
||||||
"version": "0.3.1",
|
"version": "0.2.2",
|
||||||
"entrypoint": "TitleWrap",
|
"entrypoint": "TitleWrap",
|
||||||
"type": "user",
|
"type": "user",
|
||||||
"url": "https://github.com/FreshRSS/Extensions",
|
"url": "https://github.com/FreshRSS/Extensions",
|
||||||
|
|
@ -520,8 +487,8 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "TranslateTitlesCN",
|
"name": "TranslateTitlesCN",
|
||||||
"version": "0.3.1",
|
"version": "0.2",
|
||||||
"description": "Translate article titles of the specified feed into Chinese.",
|
"description": "Translate article titles of the specified feed into Chinese, using DeepLX or Google Translate.",
|
||||||
"author": "jacob2826",
|
"author": "jacob2826",
|
||||||
"website": "https://github.com/jacob2826/FreshRSS-TranslateTitlesCN",
|
"website": "https://github.com/jacob2826/FreshRSS-TranslateTitlesCN",
|
||||||
"entrypoint": "TranslateTitles",
|
"entrypoint": "TranslateTitles",
|
||||||
|
|
@ -541,17 +508,6 @@
|
||||||
"method": "git",
|
"method": "git",
|
||||||
"directory": "."
|
"directory": "."
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "Wallabag Button",
|
|
||||||
"author": "Joedmin",
|
|
||||||
"description": "Add articles to Wallabag with one simple button click or a keyboard shortcut.",
|
|
||||||
"version": "0.5",
|
|
||||||
"entrypoint": "WallabagButton",
|
|
||||||
"type": "user",
|
|
||||||
"url": "https://github.com/Joedmin/xExtension-wallabag-button",
|
|
||||||
"method": "git",
|
|
||||||
"directory": "."
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "White List",
|
"name": "White List",
|
||||||
"author": "Alexis Degrugillier",
|
"author": "Alexis Degrugillier",
|
||||||
|
|
@ -563,22 +519,11 @@
|
||||||
"method": "git",
|
"method": "git",
|
||||||
"directory": "."
|
"directory": "."
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "Word highlighter",
|
|
||||||
"author": "Lukas Melega",
|
|
||||||
"description": "Highlight specific words",
|
|
||||||
"version": "0.0.3",
|
|
||||||
"entrypoint": "WordHighlighter",
|
|
||||||
"type": "user",
|
|
||||||
"url": "https://github.com/FreshRSS/Extensions",
|
|
||||||
"method": "git",
|
|
||||||
"directory": "xExtension-WordHighlighter"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "YouTube Video Feed",
|
"name": "YouTube Video Feed",
|
||||||
"author": "Kevin Papst",
|
"author": "Kevin Papst",
|
||||||
"description": "Embed YouTube feeds inside article content.",
|
"description": "Embed YouTube feeds inside article content.",
|
||||||
"version": "0.13",
|
"version": "0.11",
|
||||||
"entrypoint": "YouTube",
|
"entrypoint": "YouTube",
|
||||||
"type": "user",
|
"type": "user",
|
||||||
"url": "https://github.com/FreshRSS/Extensions",
|
"url": "https://github.com/FreshRSS/Extensions",
|
||||||
|
|
@ -588,8 +533,8 @@
|
||||||
{
|
{
|
||||||
"name": "YouTubeChannel2RssFeed",
|
"name": "YouTubeChannel2RssFeed",
|
||||||
"author": "CNTools | Clemens Neubauer",
|
"author": "CNTools | Clemens Neubauer",
|
||||||
"description": "Transfer YouTube URL into RSS Feed URL.",
|
"description": "Transfer YouTube Channel URL into RSS Feed URL.",
|
||||||
"version": "0.6.1",
|
"version": "0.5",
|
||||||
"entrypoint": "YouTubeChannel2RssFeed",
|
"entrypoint": "YouTubeChannel2RssFeed",
|
||||||
"type": "user",
|
"type": "user",
|
||||||
"url": "https://github.com/cn-tools/cntools_FreshRssExtensions",
|
"url": "https://github.com/cn-tools/cntools_FreshRssExtensions",
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ try {
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($repositories as $repository) {
|
foreach ($repositories as $repository) {
|
||||||
if (!is_array($repository) || !is_string($url = ($repository['url'] ?? null))) {
|
if (null === $url = ($repository['url'] ?? null)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (TYPE_GIT === ($repository['type'] ?? null)) {
|
if (TYPE_GIT === ($repository['type'] ?? null)) {
|
||||||
|
|
@ -54,7 +54,7 @@ foreach ($gitRepositories as $key => $gitRepository) {
|
||||||
}
|
}
|
||||||
$directory = basename(dirname($metadataFile));
|
$directory = basename(dirname($metadataFile));
|
||||||
$metadata['url'] = $gitRepository;
|
$metadata['url'] = $gitRepository;
|
||||||
$metadata['version'] = is_scalar($metadata['version'] ?? null) ? strval($metadata['version']) : '';
|
$metadata['version'] = strval($metadata['version']);
|
||||||
$metadata['method'] = TYPE_GIT;
|
$metadata['method'] = TYPE_GIT;
|
||||||
$metadata['directory'] = ($directory === sha1($gitRepository)) ? '.' : $directory;
|
$metadata['directory'] = ($directory === sha1($gitRepository)) ? '.' : $directory;
|
||||||
$extensions[] = $metadata;
|
$extensions[] = $metadata;
|
||||||
|
|
|
||||||
5385
package-lock.json
generated
5385
package-lock.json
generated
File diff suppressed because it is too large
Load diff
30
package.json
30
package.json
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "freshrss-extensions",
|
"name": "freshrss-extensions",
|
||||||
"type": "module",
|
|
||||||
"description": "Extensions for FreshRSS",
|
"description": "Extensions for FreshRSS",
|
||||||
"homepage": "https://freshrss.org/",
|
"homepage": "https://freshrss.org/",
|
||||||
"readmeFilename": "README.md",
|
"readmeFilename": "README.md",
|
||||||
|
|
@ -17,11 +16,11 @@
|
||||||
},
|
},
|
||||||
"license": "see each extension",
|
"license": "see each extension",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=12"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"eslint": "eslint .",
|
"eslint": "eslint --ext .js .",
|
||||||
"eslint_fix": "eslint --fix .",
|
"eslint_fix": "eslint --fix --ext .js .",
|
||||||
"markdownlint": "markdownlint '**/*.md'",
|
"markdownlint": "markdownlint '**/*.md'",
|
||||||
"markdownlint_fix": "markdownlint --fix '**/*.md'",
|
"markdownlint_fix": "markdownlint --fix '**/*.md'",
|
||||||
"rtlcss": "npm run symbolic && rtlcss -d symbolic/ && find -L symbolic/ -type f -name '*.rtl.rtl.css' -delete",
|
"rtlcss": "npm run symbolic && rtlcss -d symbolic/ && find -L symbolic/ -type f -name '*.rtl.rtl.css' -delete",
|
||||||
|
|
@ -32,17 +31,18 @@
|
||||||
"fix": "npm run rtlcss && npm run stylelint_fix && npm run eslint_fix && npm run markdownlint_fix"
|
"fix": "npm run rtlcss && npm run stylelint_fix && npm run eslint_fix && npm run markdownlint_fix"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "^9.30.1",
|
"eslint": "^8.54.0",
|
||||||
"@eslint/js": "^9.8.0",
|
"eslint-config-standard": "^17.1.0",
|
||||||
"globals": "^16.3.0",
|
"eslint-plugin-import": "^2.29.0",
|
||||||
"markdownlint-cli": "^0.45.0",
|
"eslint-plugin-n": "^16.3.1",
|
||||||
"neostandard": "^0.12.1",
|
"eslint-plugin-promise": "^6.1.1",
|
||||||
"rtlcss": "^4.3.0",
|
"markdownlint-cli": "^0.37.0",
|
||||||
"sass": "^1.89.2",
|
"rtlcss": "^4.1.1",
|
||||||
"stylelint": "^16.21.0",
|
"sass": "^1.69.5",
|
||||||
"stylelint-config-recommended-scss": "^15.0.1",
|
"stylelint": "^15.11.0",
|
||||||
"stylelint-order": "^7.0.0",
|
"stylelint-config-recommended-scss": "^13.1.0",
|
||||||
"@stylistic/stylelint-plugin": "^3.1.3"
|
"stylelint-order": "^6.0.3",
|
||||||
|
"stylelint-stylistic": "^0.4.3"
|
||||||
},
|
},
|
||||||
"rtlcssConfig": {}
|
"rtlcssConfig": {}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
160
phpcs.xml
160
phpcs.xml
|
|
@ -1,113 +1,119 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ruleset name="FreshRSS">
|
<ruleset name="FreshRSS Ruleset">
|
||||||
<arg name="extensions" value="php,phtml"/>
|
<description>Created with the PHP Coding Standard Generator. https://edorian.github.com/php-coding-standard-generator/</description>
|
||||||
|
<arg name="extensions" value="php,phtml,css,js"/>
|
||||||
<arg name="tab-width" value="4"/>
|
<arg name="tab-width" value="4"/>
|
||||||
<exclude-pattern>./.git/</exclude-pattern>
|
<exclude-pattern>./lib/SimplePie/</exclude-pattern>
|
||||||
|
<exclude-pattern>./lib/PHPMailer/</exclude-pattern>
|
||||||
|
<exclude-pattern>./lib/http-conditional.php</exclude-pattern>
|
||||||
|
<exclude-pattern>./lib/lib_phpQuery.php</exclude-pattern>
|
||||||
|
<exclude-pattern>./node_modules/</exclude-pattern>
|
||||||
<exclude-pattern>./data/config.php</exclude-pattern>
|
<exclude-pattern>./data/config.php</exclude-pattern>
|
||||||
<exclude-pattern>./data/update.php</exclude-pattern>
|
|
||||||
<exclude-pattern>./data/users/*/config.php</exclude-pattern>
|
<exclude-pattern>./data/users/*/config.php</exclude-pattern>
|
||||||
<exclude-pattern>./extensions/</exclude-pattern>
|
<exclude-pattern>./extensions/</exclude-pattern>
|
||||||
<exclude-pattern>./lib/http-conditional.php</exclude-pattern>
|
|
||||||
<exclude-pattern>./lib/marienfressinaud/</exclude-pattern>
|
|
||||||
<exclude-pattern>./lib/phpgt/</exclude-pattern>
|
|
||||||
<exclude-pattern>./lib/phpmailer/</exclude-pattern>
|
|
||||||
<exclude-pattern>./lib/simplepie/</exclude-pattern>
|
|
||||||
<exclude-pattern>./node_modules/</exclude-pattern>
|
|
||||||
<exclude-pattern>./p/scripts/vendor/</exclude-pattern>
|
<exclude-pattern>./p/scripts/vendor/</exclude-pattern>
|
||||||
<exclude-pattern>./vendor/</exclude-pattern>
|
<exclude-pattern>./vendor/</exclude-pattern>
|
||||||
<!-- Additional exclusions for Extensions: -->
|
<exclude-pattern>*.min.js$</exclude-pattern>
|
||||||
<exclude-pattern>./symbolic/</exclude-pattern>
|
<!-- Duplicate class names are not allowed -->
|
||||||
<exclude-pattern>./third-party/</exclude-pattern>
|
|
||||||
<exclude-pattern>./tmp/</exclude-pattern>
|
|
||||||
<rule ref="PSR12">
|
|
||||||
<exclude name="Generic.ControlStructures.InlineControlStructure.NotAllowed"/>
|
|
||||||
<exclude name="Generic.Formatting.DisallowMultipleStatements.SameLine"/>
|
|
||||||
<exclude name="Generic.WhiteSpace.DisallowTabIndent.NonIndentTabsUsed"/>
|
|
||||||
<exclude name="Generic.WhiteSpace.DisallowTabIndent.TabsUsed"/>
|
|
||||||
<exclude name="Generic.WhiteSpace.DisallowTabIndent.TabsUsedHeredocCloser"/>
|
|
||||||
<exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace"/>
|
|
||||||
<exclude name="PSR1.Classes.ClassDeclaration.MultipleClasses"/>
|
|
||||||
<exclude name="PSR1.Files.SideEffects.FoundWithSymbols"/>
|
|
||||||
<exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps"/>
|
|
||||||
<exclude name="PSR12.Classes.OpeningBraceSpace.Found"/><!-- Consider using PSR12 defaults instead -->
|
|
||||||
<exclude name="PSR12.ControlStructures.ControlStructureSpacing.CloseParenthesisLine"/>
|
|
||||||
<exclude name="PSR12.ControlStructures.ControlStructureSpacing.FirstExpressionLine"/><!-- Consider using PSR12 defaults instead -->
|
|
||||||
<exclude name="PSR12.Files.FileHeader.IncorrectOrder"/><!-- Consider using PSR12 defaults instead -->
|
|
||||||
<exclude name="PSR12.Files.FileHeader.SpacingAfterBlock"/><!-- Consider using PSR12 defaults instead -->
|
|
||||||
<exclude name="PSR12.Traits.UseDeclaration.MultipleImport"/>
|
|
||||||
<exclude name="PSR2.Classes.ClassDeclaration.CloseBraceAfterBody"/><!-- Consider using PSR12 defaults instead -->
|
|
||||||
<exclude name="PSR2.Classes.ClassDeclaration.OpenBraceNewLine"/><!-- Consider using PSR12 defaults instead -->
|
|
||||||
<exclude name="PSR2.ControlStructures.SwitchDeclaration.BodyOnNextLineCASE"/>
|
|
||||||
<exclude name="PSR2.ControlStructures.SwitchDeclaration.BreakNotNewLine"/>
|
|
||||||
<exclude name="PSR2.Functions.FunctionCallSignature.ContentAfterOpenBracket"/>
|
|
||||||
<exclude name="PSR2.Methods.FunctionCallSignature.CloseBracketLine"/>
|
|
||||||
<exclude name="PSR2.Methods.FunctionCallSignature.ContentAfterOpenBracket"/>
|
|
||||||
<exclude name="PSR2.Methods.FunctionCallSignature.Indent"/>
|
|
||||||
<exclude name="PSR2.Methods.FunctionCallSignature.MultipleArguments"/>
|
|
||||||
<exclude name="PSR2.Methods.MethodDeclaration.Underscore"/>
|
|
||||||
<exclude name="Squiz.Classes.ValidClassName.NotCamelCaps"/>
|
|
||||||
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine"/>
|
|
||||||
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.CloseBracketLine"/>
|
|
||||||
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.ContentAfterBrace"/>
|
|
||||||
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.FirstParamSpacing"/>
|
|
||||||
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.Indent"/>
|
|
||||||
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.OneParamPerLine"/>
|
|
||||||
<exclude name="Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore"/>
|
|
||||||
</rule>
|
|
||||||
<rule ref="Generic.Classes.DuplicateClassName"/>
|
<rule ref="Generic.Classes.DuplicateClassName"/>
|
||||||
|
<!-- Statements must not be empty -->
|
||||||
<rule ref="Generic.CodeAnalysis.EmptyStatement"/>
|
<rule ref="Generic.CodeAnalysis.EmptyStatement"/>
|
||||||
|
<!-- Unconditional if-statements are not allowed -->
|
||||||
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
|
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
|
||||||
|
<!-- Do not use final statements inside final classes -->
|
||||||
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
|
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
|
||||||
|
<!-- Do not override methods to call their parent -->
|
||||||
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
|
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
|
||||||
|
<!-- Maximum line length -->
|
||||||
<rule ref="Generic.Files.LineLength">
|
<rule ref="Generic.Files.LineLength">
|
||||||
|
<!-- For language strings maximum line lengths make little sense. -->
|
||||||
|
<exclude-pattern>./app/i18n/</exclude-pattern>
|
||||||
|
<!-- Don’t enforce line length on the HTML; the point is to improve legibility, not reduce it -->
|
||||||
|
<exclude-pattern>*.phtml$</exclude-pattern>
|
||||||
<properties>
|
<properties>
|
||||||
<property name="lineLimit" value="165"/>
|
<property name="lineLimit" value="165"/>
|
||||||
<property name="absoluteLineLimit" value="190"/>
|
<property name="absoluteLineLimit" value="190"/>
|
||||||
</properties>
|
</properties>
|
||||||
<exclude-pattern>/app/i18n/*\.php$</exclude-pattern>
|
|
||||||
<exclude-pattern>*\.phtml$</exclude-pattern>
|
|
||||||
</rule>
|
</rule>
|
||||||
<rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie"/><!-- Consider using PSR12 defaults instead -->
|
<!-- When calling a function: -->
|
||||||
<rule ref="Generic.PHP.DeprecatedFunctions"/>
|
<!-- Do not add a space before the opening parenthesis -->
|
||||||
|
<!-- Do not add a space after the opening parenthesis -->
|
||||||
|
<!-- Do not add a space before the closing parenthesis -->
|
||||||
|
<!-- Do not add a space before a comma -->
|
||||||
|
<!-- Add a space after a comma -->
|
||||||
|
<rule ref="Generic.Functions.FunctionCallArgumentSpacing"/>
|
||||||
|
<rule ref="Generic.PHP.DisallowShortOpenTag">
|
||||||
|
<exclude name="Generic.PHP.DisallowShortOpenTag.EchoFound"/>
|
||||||
|
</rule>
|
||||||
|
<rule ref="Generic.PHP.DeprecatedFunctions" />
|
||||||
|
<!-- Use UPPERCARE for constants -->
|
||||||
|
<rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
|
||||||
|
<!-- Use lowercase for 'true', 'false' and 'null' -->
|
||||||
|
<rule ref="Generic.PHP.LowerCaseConstant"/>
|
||||||
|
<!-- Use a single string instead of concatenating -->
|
||||||
<rule ref="Generic.Strings.UnnecessaryStringConcat">
|
<rule ref="Generic.Strings.UnnecessaryStringConcat">
|
||||||
<properties>
|
<properties>
|
||||||
|
<!-- Allow string concatenating across multiple lines -->
|
||||||
<property name="allowMultiline" value="true"/>
|
<property name="allowMultiline" value="true"/>
|
||||||
</properties>
|
</properties>
|
||||||
</rule>
|
</rule>
|
||||||
|
<!-- Use tabs for indentation -->
|
||||||
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/>
|
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/>
|
||||||
<rule ref="Generic.WhiteSpace.ScopeIndent.Incorrect">
|
<!-- Parameters with default values must appear last in functions -->
|
||||||
<exclude-pattern>*\.phtml$</exclude-pattern>
|
<rule ref="PEAR.Functions.ValidDefaultValue"/>
|
||||||
<exclude-pattern>/app/install.php</exclude-pattern>
|
<!-- Use 'elseif' instead of 'else if' -->
|
||||||
</rule>
|
<rule ref="PSR2.ControlStructures.ElseIfDeclaration"/>
|
||||||
<rule ref="Generic.WhiteSpace.ScopeIndent.IncorrectExact">
|
<!-- Do not add spaces after opening or before closing bracket -->
|
||||||
<exclude-pattern>*\.phtml$</exclude-pattern>
|
<rule ref="PSR2.ControlStructures.ControlStructureSpacing"/>
|
||||||
<exclude-pattern>/app/install.php</exclude-pattern>
|
<!-- Add a new line at the end of a file -->
|
||||||
</rule>
|
<rule ref="PSR2.Files.EndFileNewline"/>
|
||||||
<rule ref="Internal.NoCodeFound">
|
<!-- Use Unix newlines -->
|
||||||
<exclude-pattern>*\.phtml$</exclude-pattern>
|
<rule ref="Generic.Files.LineEndings">
|
||||||
</rule>
|
|
||||||
<!-- <rule ref="Squiz.Commenting.ClassComment.Missing"/> --><!-- Consider adding -->
|
|
||||||
|
|
||||||
<rule ref="Squiz.ControlStructures.ControlSignature">
|
|
||||||
<include-pattern>*\.phtml$</include-pattern>
|
|
||||||
<properties>
|
<properties>
|
||||||
<property name="requiredSpacesBeforeColon" value="0" />
|
<property name="eolChar" value="\n" />
|
||||||
</properties>
|
</properties>
|
||||||
</rule>
|
</rule>
|
||||||
|
<!-- Add space after closing parenthesis -->
|
||||||
|
<!-- Add body into new line -->
|
||||||
|
<!-- Close body in new line -->
|
||||||
<rule ref="Squiz.ControlStructures.ControlSignature">
|
<rule ref="Squiz.ControlStructures.ControlSignature">
|
||||||
<include-pattern>*\.php$</include-pattern>
|
<!-- No space after keyword (before opening parenthesis) -->
|
||||||
|
<exclude name="Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword"/>
|
||||||
</rule>
|
</rule>
|
||||||
|
<!-- When declaring a function: -->
|
||||||
<rule ref="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace">
|
<!-- Do not add a space before a comma -->
|
||||||
<exclude-pattern>*\.phtml$</exclude-pattern>
|
<!-- Add a space after a comma -->
|
||||||
|
<!-- Add a space before and after an equal sign -->
|
||||||
|
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing">
|
||||||
|
<properties>
|
||||||
|
<property name="equalsSpacing" value="1"/>
|
||||||
|
</properties>
|
||||||
</rule>
|
</rule>
|
||||||
|
<!-- Do not add spaces when casting -->
|
||||||
|
<rule ref="Squiz.WhiteSpace.CastSpacing"/>
|
||||||
|
<!-- Operators must have a space around them -->
|
||||||
<rule ref="Squiz.WhiteSpace.OperatorSpacing">
|
<rule ref="Squiz.WhiteSpace.OperatorSpacing">
|
||||||
<properties>
|
<properties>
|
||||||
<property name="ignoreNewlines" value="true"/>
|
<property name="ignoreNewlines" value="true" />
|
||||||
</properties>
|
</properties>
|
||||||
</rule>
|
</rule>
|
||||||
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace.Indent">
|
<!-- Do not add a whitespace before a semicolon -->
|
||||||
<exclude-pattern>*\.phtml$</exclude-pattern>
|
|
||||||
</rule>
|
|
||||||
<rule ref="Squiz.WhiteSpace.SemicolonSpacing"/>
|
<rule ref="Squiz.WhiteSpace.SemicolonSpacing"/>
|
||||||
|
<!-- Do not add whitespace at start or end of a file or end of a line -->
|
||||||
|
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"/>
|
||||||
|
<!-- Expected space after closing parenthesis -->
|
||||||
|
<rule ref="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis">
|
||||||
|
<exclude-pattern>.phtml$</exclude-pattern>
|
||||||
|
</rule>
|
||||||
|
<!-- Opening brace on same line as function declaration -->
|
||||||
|
<rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie" />
|
||||||
|
<!-- Newline required after opening brace -->
|
||||||
|
<rule ref="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace">
|
||||||
|
<exclude-pattern>.phtml$</exclude-pattern>
|
||||||
|
<exclude-pattern>.js$</exclude-pattern>
|
||||||
|
</rule>
|
||||||
|
<!-- No PHP code was found in this file -->
|
||||||
|
<rule ref="Internal.NoCodeFound">
|
||||||
|
<exclude-pattern>.phtml$</exclude-pattern>
|
||||||
|
</rule>
|
||||||
</ruleset>
|
</ruleset>
|
||||||
|
|
|
||||||
10
phpstan-next.neon
Normal file
10
phpstan-next.neon
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
includes:
|
||||||
|
- phpstan.neon
|
||||||
|
|
||||||
|
parameters:
|
||||||
|
level: 9
|
||||||
|
excludePaths:
|
||||||
|
analyse:
|
||||||
|
- xExtension-ImageProxy/configure.phtml
|
||||||
|
- xExtension-ImageProxy/extension.php
|
||||||
|
- xExtension-TTRSS_API/ttrss.php
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
parameters:
|
parameters:
|
||||||
phpVersion:
|
level: 0
|
||||||
min: 80100 # PHP 8.1
|
treatPhpDocTypesAsCertain: false
|
||||||
max: 80499 # PHP 8.4
|
|
||||||
level: 0 # https://phpstan.org/user-guide/rule-levels
|
|
||||||
fileExtensions:
|
fileExtensions:
|
||||||
- php
|
- php
|
||||||
- phtml
|
- phtml
|
||||||
|
|
@ -12,16 +10,15 @@ parameters:
|
||||||
excludePaths:
|
excludePaths:
|
||||||
analyse:
|
analyse:
|
||||||
- ../FreshRSS
|
- ../FreshRSS
|
||||||
- third-party/*/vendor/*?
|
- third-party/*/vendor/*
|
||||||
analyseAndScan:
|
analyseAndScan:
|
||||||
- .git/*?
|
- .git/
|
||||||
- node_modules/*?
|
- node_modules/
|
||||||
- symbolic/*?
|
- symbolic/
|
||||||
- third-party/*/tests/*?
|
- third-party/*/tests/*
|
||||||
- tmp/*?
|
- tmp/
|
||||||
- vendor/
|
- vendor/
|
||||||
- xExtension-*
|
- xExtension-*
|
||||||
dynamicConstantNames:
|
dynamicConstantNames:
|
||||||
- TYPE_GIT
|
- TYPE_GIT
|
||||||
reportMaybesInPropertyPhpDocTypes: false
|
reportMaybesInPropertyPhpDocTypes: false
|
||||||
treatPhpDocTypesAsCertain: false
|
|
||||||
|
|
|
||||||
|
|
@ -1,43 +0,0 @@
|
||||||
parameters:
|
|
||||||
phpVersion:
|
|
||||||
min: 80100 # PHP 8.1
|
|
||||||
max: 80499 # PHP 8.4
|
|
||||||
level: 10 # https://phpstan.org/user-guide/rule-levels
|
|
||||||
fileExtensions:
|
|
||||||
- php
|
|
||||||
- phtml
|
|
||||||
paths:
|
|
||||||
- ../FreshRSS
|
|
||||||
- .
|
|
||||||
excludePaths:
|
|
||||||
analyse:
|
|
||||||
- ../FreshRSS
|
|
||||||
analyseAndScan:
|
|
||||||
- .git/*?
|
|
||||||
- node_modules/*?
|
|
||||||
- symbolic/*?
|
|
||||||
- third-party/*?
|
|
||||||
- tmp/*?
|
|
||||||
- vendor/
|
|
||||||
dynamicConstantNames:
|
|
||||||
- TYPE_GIT
|
|
||||||
checkBenevolentUnionTypes: true
|
|
||||||
checkMissingOverrideMethodAttribute: true
|
|
||||||
checkTooWideReturnTypesInProtectedAndPublicMethods: true
|
|
||||||
reportAnyTypeWideningInVarTag: true
|
|
||||||
treatPhpDocTypesAsCertain: false
|
|
||||||
strictRules:
|
|
||||||
disallowedEmpty: false
|
|
||||||
disallowedLooseComparison: false
|
|
||||||
disallowedShortTernary: false
|
|
||||||
exceptions:
|
|
||||||
check:
|
|
||||||
missingCheckedExceptionInThrows: true
|
|
||||||
tooWideThrowType: true
|
|
||||||
implicitThrows: false
|
|
||||||
checkedExceptionClasses:
|
|
||||||
- 'Minz_Exception'
|
|
||||||
ignoreErrors:
|
|
||||||
- '#Only booleans are allowed in (a negated boolean|a ternary operator condition|an elseif condition|an if condition|&&|\|\|), (bool|false|int(<[0-9, max]+>)?|true|null|\|)+ given.*#'
|
|
||||||
includes:
|
|
||||||
- vendor/phpstan/phpstan-strict-rules/rules.neon
|
|
||||||
41
phpstan.neon
Normal file
41
phpstan.neon
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
parameters:
|
||||||
|
# TODO: Increase rule-level https://phpstan.org/user-guide/rule-levels
|
||||||
|
level: 1
|
||||||
|
phpVersion: 80399 # TODO: Remove line when moving composer.json to PHP 8+
|
||||||
|
treatPhpDocTypesAsCertain: false
|
||||||
|
fileExtensions:
|
||||||
|
- php
|
||||||
|
- phtml
|
||||||
|
paths:
|
||||||
|
- ../FreshRSS
|
||||||
|
- .
|
||||||
|
excludePaths:
|
||||||
|
analyse:
|
||||||
|
- ../FreshRSS
|
||||||
|
- vendor/
|
||||||
|
analyseAndScan:
|
||||||
|
- .git/
|
||||||
|
- node_modules/
|
||||||
|
- symbolic/
|
||||||
|
- third-party/
|
||||||
|
- tmp/
|
||||||
|
dynamicConstantNames:
|
||||||
|
- TYPE_GIT
|
||||||
|
checkMissingOverrideMethodAttribute: true
|
||||||
|
reportMaybesInPropertyPhpDocTypes: false
|
||||||
|
strictRules:
|
||||||
|
allRules: false
|
||||||
|
booleansInConditions: true
|
||||||
|
closureUsesThis: true
|
||||||
|
disallowedConstructs: false
|
||||||
|
disallowedLooseComparison: false
|
||||||
|
matchingInheritedMethodNames: true
|
||||||
|
noVariableVariables: true
|
||||||
|
numericOperandsInArithmeticOperators: true
|
||||||
|
overwriteVariablesWithLoop: true
|
||||||
|
requireParentConstructorCall: true
|
||||||
|
strictCalls: true
|
||||||
|
switchConditionsMatchingType: true
|
||||||
|
uselessCast: true
|
||||||
|
includes:
|
||||||
|
- vendor/phpstan/phpstan-strict-rules/rules.neon
|
||||||
|
|
@ -19,6 +19,9 @@
|
||||||
}, {
|
}, {
|
||||||
"url": "https://github.com/aledeg/xExtension-WhiteList",
|
"url": "https://github.com/aledeg/xExtension-WhiteList",
|
||||||
"type": "git"
|
"type": "git"
|
||||||
|
}, {
|
||||||
|
"url": "https://framagit.org/Lapineige/FreshRSS_Extension-ReadingTime/",
|
||||||
|
"type": "git"
|
||||||
}, {
|
}, {
|
||||||
"url": "https://framagit.org/nicofrand/xextension-threepanesview",
|
"url": "https://framagit.org/nicofrand/xextension-threepanesview",
|
||||||
"type": "git"
|
"type": "git"
|
||||||
|
|
@ -53,15 +56,6 @@
|
||||||
"url": "https://github.com/christian-putzke/freshrss-pocket-button",
|
"url": "https://github.com/christian-putzke/freshrss-pocket-button",
|
||||||
"type": "git"
|
"type": "git"
|
||||||
}, {
|
}, {
|
||||||
"url": "https://github.com/huffstler/xExtension-StarToPocket",
|
|
||||||
"type": "git"
|
|
||||||
}, {
|
|
||||||
"url": "https://github.com/Joedmin/xExtension-readeck-button",
|
|
||||||
"type": "git"
|
|
||||||
}, {
|
|
||||||
"url": "https://github.com/Joedmin/xExtension-wallabag-button",
|
|
||||||
"type": "git"
|
|
||||||
},{
|
|
||||||
"url": "https://github.com/printfuck/xExtension-Readable",
|
"url": "https://github.com/printfuck/xExtension-Readable",
|
||||||
"type": "git"
|
"type": "git"
|
||||||
}, {
|
}, {
|
||||||
|
|
@ -88,16 +82,4 @@
|
||||||
}, {
|
}, {
|
||||||
"url": "https://github.com/kalvn/freshrss-mark-previous-as-read",
|
"url": "https://github.com/kalvn/freshrss-mark-previous-as-read",
|
||||||
"type": "git"
|
"type": "git"
|
||||||
}, {
|
|
||||||
"url": "https://github.com/LiangWei88/xExtension-ArticleSummary",
|
|
||||||
"type": "git"
|
|
||||||
}, {
|
|
||||||
"url": "https://github.com/Niehztog/freshrss-af-readability",
|
|
||||||
"type": "git"
|
|
||||||
}, {
|
|
||||||
"url": "https://github.com/tryallthethings/freshvibes",
|
|
||||||
"type": "git"
|
|
||||||
}, {
|
|
||||||
"url": "https://github.com/pe1uca/xExtension-RateLimiter",
|
|
||||||
"type": "git"
|
|
||||||
}]
|
}]
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,6 @@ final class ColorfulListExtension extends Minz_Extension
|
||||||
{
|
{
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function init(): void {
|
public function init(): void {
|
||||||
Minz_View::appendScript($this->getFileUrl('script.js'));
|
Minz_View::appendScript($this->getFileUrl('script.js', 'js'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
"name": "Colorful List",
|
"name": "Colorful List",
|
||||||
"author": "Claud Xiao",
|
"author": "Claud Xiao",
|
||||||
"description": "Colorful Entry Title based on RSS source",
|
"description": "Colorful Entry Title based on RSS source",
|
||||||
"version": "0.3.2",
|
"version": "0.3.1",
|
||||||
"entrypoint": "ColorfulList",
|
"entrypoint": "ColorfulList",
|
||||||
"type": "user"
|
"type": "user"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
89
xExtension-CustomCSS/README.md
Normal file
89
xExtension-CustomCSS/README.md
Normal file
|
|
@ -0,0 +1,89 @@
|
||||||
|
# CustomCSS extension
|
||||||
|
|
||||||
|
A FreshRSS extension which give ability to create user-specific CSS rules to apply in addition of the actual theme.
|
||||||
|
|
||||||
|
To use it, upload this directory in your `./extensions` directory and enable it on the extension panel in FreshRSS. You can add CSS rules by clicking on the manage button.
|
||||||
|
|
||||||
|
## Changelog
|
||||||
|
|
||||||
|
- 0.2 added file permission check, added german translation, removed un-editable file static/style.css
|
||||||
|
- 0.1 initial version
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
### Enhancing mobile view
|
||||||
|
|
||||||
|
The following CSS rules let you have a more comfortable mobile view by hiding some icons (read/unread article, mark as favorite and RSS feed's favicon) and by reducing text size. It also displays the name of the subscribed feed, instead of the favicon:
|
||||||
|
|
||||||
|
```css
|
||||||
|
@media (max-width: 840px)
|
||||||
|
{
|
||||||
|
.flux_header .item.website
|
||||||
|
{
|
||||||
|
width:20%;
|
||||||
|
padding:3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flux .website .favicon, .flux_header .item.manage
|
||||||
|
{
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.flux_header .item.website span
|
||||||
|
{
|
||||||
|
display:inline;
|
||||||
|
font-size:0.7rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
The result is shown below:
|
||||||
|
|
||||||
|
Desktop screen resolution:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Mobile screen resolution:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
#### 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Sidebar: Move the unread count to the right side of a feed
|
||||||
|
|
||||||
|
Some people prefer to have the unread count number of a feed on the right side after the feed's name, instead placing it between the favicon and the feeds name, as this is also the common location in other tools (e.g. e-mail inbox folder). Use this CSS code to move the number to the right side.
|
||||||
|
```css
|
||||||
|
.feed .item-title:not([data-unread="0"])::before {
|
||||||
|
display: none
|
||||||
|
}
|
||||||
|
.feed .item-title:not([data-unread="0"])::after {
|
||||||
|
content: " (" attr(data-unread) ")";
|
||||||
|
}
|
||||||
|
```
|
||||||
24
xExtension-CustomCSS/configure.phtml
Normal file
24
xExtension-CustomCSS/configure.phtml
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
<?php
|
||||||
|
declare(strict_types=1);
|
||||||
|
/** @var CustomCSSExtension $this */
|
||||||
|
?>
|
||||||
|
<form action="<?= _url('extension', 'configure', 'e', urlencode($this->getName())); ?>" method="post">
|
||||||
|
<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="group-name" for="css-rules"><?= _t('ext.custom_css.write_css') ?></label>
|
||||||
|
<div class="group-controls">
|
||||||
|
<textarea name="css-rules" id="css-rules"><?= $this->css_rules ?></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group form-actions">
|
||||||
|
<?php if ($this->permission_problem !== '') { ?>
|
||||||
|
<p class="alert alert-error"><?= _t('ext.custom_css.permission_problem', $this->permission_problem) ?></p>
|
||||||
|
<?php } else { ?>
|
||||||
|
<div class="group-controls">
|
||||||
|
<button type="submit" class="btn btn-important"><?= _t('gen.action.submit') ?></button>
|
||||||
|
<button type="reset" class="btn"><?= _t('gen.action.cancel') ?></button>
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
BIN
xExtension-CustomCSS/desktop_resolution.png
Normal file
BIN
xExtension-CustomCSS/desktop_resolution.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 32 KiB |
47
xExtension-CustomCSS/extension.php
Normal file
47
xExtension-CustomCSS/extension.php
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
final class CustomCSSExtension extends Minz_Extension {
|
||||||
|
public string $css_rules;
|
||||||
|
public string $permission_problem = '';
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
|
public function init(): void {
|
||||||
|
$this->registerTranslates();
|
||||||
|
|
||||||
|
$current_user = Minz_Session::paramString('currentUser');
|
||||||
|
$filename = 'style.' . $current_user . '.css';
|
||||||
|
$filepath = join_path($this->getPath(), 'static', $filename);
|
||||||
|
|
||||||
|
if (file_exists($filepath)) {
|
||||||
|
Minz_View::appendStyle($this->getFileUrl($filename, 'css'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
|
public function handleConfigureAction(): void {
|
||||||
|
$this->registerTranslates();
|
||||||
|
|
||||||
|
$current_user = Minz_Session::paramString('currentUser');
|
||||||
|
$filename = 'style.' . $current_user . '.css';
|
||||||
|
$staticPath = join_path($this->getPath(), 'static');
|
||||||
|
$filepath = join_path($staticPath, $filename);
|
||||||
|
|
||||||
|
if (!file_exists($filepath) && !is_writable($staticPath)) {
|
||||||
|
$tmpPath = explode(EXTENSIONS_PATH . '/', $staticPath);
|
||||||
|
$this->permission_problem = $tmpPath[1] . '/';
|
||||||
|
} elseif (file_exists($filepath) && !is_writable($filepath)) {
|
||||||
|
$tmpPath = explode(EXTENSIONS_PATH . '/', $filepath);
|
||||||
|
$this->permission_problem = $tmpPath[1];
|
||||||
|
} elseif (Minz_Request::isPost()) {
|
||||||
|
$css_rules = html_entity_decode(Minz_Request::paramString('css-rules'));
|
||||||
|
file_put_contents($filepath, $css_rules);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->css_rules = '';
|
||||||
|
if (file_exists($filepath)) {
|
||||||
|
$this->css_rules = htmlentities(file_get_contents($filepath) ?: '');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
8
xExtension-CustomCSS/i18n/de/ext.php
Normal file
8
xExtension-CustomCSS/i18n/de/ext.php
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'custom_css' => array(
|
||||||
|
'write_css' => 'Benutzerspezifische CSS Regeln',
|
||||||
|
'permission_problem' => 'Deine CSS Datei ist nicht beschreibbar, bitte ändere die Berechtigungen von %s'
|
||||||
|
),
|
||||||
|
);
|
||||||
8
xExtension-CustomCSS/i18n/en/ext.php
Normal file
8
xExtension-CustomCSS/i18n/en/ext.php
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'custom_css' => array(
|
||||||
|
'write_css' => 'Additional CSS rules',
|
||||||
|
'permission_problem' => 'Your CSS file is not writable, please change the file permissions for %s',
|
||||||
|
),
|
||||||
|
);
|
||||||
8
xExtension-CustomCSS/i18n/fr/ext.php
Normal file
8
xExtension-CustomCSS/i18n/fr/ext.php
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'custom_css' => array(
|
||||||
|
'write_css' => 'Règles CSS supplémentaires',
|
||||||
|
'permission_problem' => 'Votre fichier CSS est en lecture seule ; veuillez adapter les permissions pour %s',
|
||||||
|
),
|
||||||
|
);
|
||||||
8
xExtension-CustomCSS/metadata.json
Normal file
8
xExtension-CustomCSS/metadata.json
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"name": "Custom CSS",
|
||||||
|
"author": "Marien Fressinaud",
|
||||||
|
"description": "Give possibility to overwrite the CSS with a user-specific rules.",
|
||||||
|
"version": "0.5.1",
|
||||||
|
"entrypoint": "CustomCSS",
|
||||||
|
"type": "user"
|
||||||
|
}
|
||||||
BIN
xExtension-CustomCSS/mobile_resolution.png
Normal file
BIN
xExtension-CustomCSS/mobile_resolution.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
1
xExtension-CustomCSS/static/.gitignore
vendored
Normal file
1
xExtension-CustomCSS/static/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
style.*.css
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
GNU GENERAL PUBLIC LICENSE
|
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||||
Version 3, 29 June 2007
|
Version 3, 19 November 2007
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
|
@ -7,17 +7,15 @@
|
||||||
|
|
||||||
Preamble
|
Preamble
|
||||||
|
|
||||||
The GNU General Public License is a free, copyleft license for
|
The GNU Affero General Public License is a free, copyleft license for
|
||||||
software and other kinds of works.
|
software and other kinds of works, specifically designed to ensure
|
||||||
|
cooperation with the community in the case of network server software.
|
||||||
|
|
||||||
The licenses for most software and other practical works are designed
|
The licenses for most software and other practical works are designed
|
||||||
to take away your freedom to share and change the works. By contrast,
|
to take away your freedom to share and change the works. By contrast,
|
||||||
the GNU General Public License is intended to guarantee your freedom to
|
our General Public Licenses are intended to guarantee your freedom to
|
||||||
share and change all versions of a program--to make sure it remains free
|
share and change all versions of a program--to make sure it remains free
|
||||||
software for all its users. We, the Free Software Foundation, use the
|
software for all its users.
|
||||||
GNU General Public License for most of our software; it applies also to
|
|
||||||
any other work released this way by its authors. You can apply it to
|
|
||||||
your programs, too.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
When we speak of free software, we are referring to freedom, not
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
|
@ -26,44 +24,34 @@ them if you wish), that you receive source code or can get it if you
|
||||||
want it, that you can change the software or use pieces of it in new
|
want it, that you can change the software or use pieces of it in new
|
||||||
free programs, and that you know you can do these things.
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
To protect your rights, we need to prevent others from denying you
|
Developers that use our General Public Licenses protect your rights
|
||||||
these rights or asking you to surrender the rights. Therefore, you have
|
with two steps: (1) assert copyright on the software, and (2) offer
|
||||||
certain responsibilities if you distribute copies of the software, or if
|
you this License which gives you legal permission to copy, distribute
|
||||||
you modify it: responsibilities to respect the freedom of others.
|
and/or modify the software.
|
||||||
|
|
||||||
For example, if you distribute copies of such a program, whether
|
A secondary benefit of defending all users' freedom is that
|
||||||
gratis or for a fee, you must pass on to the recipients the same
|
improvements made in alternate versions of the program, if they
|
||||||
freedoms that you received. You must make sure that they, too, receive
|
receive widespread use, become available for other developers to
|
||||||
or can get the source code. And you must show them these terms so they
|
incorporate. Many developers of free software are heartened and
|
||||||
know their rights.
|
encouraged by the resulting cooperation. However, in the case of
|
||||||
|
software used on network servers, this result may fail to come about.
|
||||||
|
The GNU General Public License permits making a modified version and
|
||||||
|
letting the public access it on a server without ever releasing its
|
||||||
|
source code to the public.
|
||||||
|
|
||||||
Developers that use the GNU GPL protect your rights with two steps:
|
The GNU Affero General Public License is designed specifically to
|
||||||
(1) assert copyright on the software, and (2) offer you this License
|
ensure that, in such cases, the modified source code becomes available
|
||||||
giving you legal permission to copy, distribute and/or modify it.
|
to the community. It requires the operator of a network server to
|
||||||
|
provide the source code of the modified version running there to the
|
||||||
|
users of that server. Therefore, public use of a modified version, on
|
||||||
|
a publicly accessible server, gives the public access to the source
|
||||||
|
code of the modified version.
|
||||||
|
|
||||||
For the developers' and authors' protection, the GPL clearly explains
|
An older license, called the Affero General Public License and
|
||||||
that there is no warranty for this free software. For both users' and
|
published by Affero, was designed to accomplish similar goals. This is
|
||||||
authors' sake, the GPL requires that modified versions be marked as
|
a different license, not a version of the Affero GPL, but Affero has
|
||||||
changed, so that their problems will not be attributed erroneously to
|
released a new version of the Affero GPL which permits relicensing under
|
||||||
authors of previous versions.
|
this license.
|
||||||
|
|
||||||
Some devices are designed to deny users access to install or run
|
|
||||||
modified versions of the software inside them, although the manufacturer
|
|
||||||
can do so. This is fundamentally incompatible with the aim of
|
|
||||||
protecting users' freedom to change the software. The systematic
|
|
||||||
pattern of such abuse occurs in the area of products for individuals to
|
|
||||||
use, which is precisely where it is most unacceptable. Therefore, we
|
|
||||||
have designed this version of the GPL to prohibit the practice for those
|
|
||||||
products. If such problems arise substantially in other domains, we
|
|
||||||
stand ready to extend this provision to those domains in future versions
|
|
||||||
of the GPL, as needed to protect the freedom of users.
|
|
||||||
|
|
||||||
Finally, every program is threatened constantly by software patents.
|
|
||||||
States should not allow patents to restrict development and use of
|
|
||||||
software on general-purpose computers, but in those that do, we wish to
|
|
||||||
avoid the special danger that patents applied to a free program could
|
|
||||||
make it effectively proprietary. To prevent this, the GPL assures that
|
|
||||||
patents cannot be used to render the program non-free.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
The precise terms and conditions for copying, distribution and
|
||||||
modification follow.
|
modification follow.
|
||||||
|
|
@ -72,7 +60,7 @@ modification follow.
|
||||||
|
|
||||||
0. Definitions.
|
0. Definitions.
|
||||||
|
|
||||||
"This License" refers to version 3 of the GNU General Public License.
|
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||||
|
|
||||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
works, such as semiconductor masks.
|
works, such as semiconductor masks.
|
||||||
|
|
@ -549,35 +537,45 @@ to collect a royalty for further conveying from those to whom you convey
|
||||||
the Program, the only way you could satisfy both those terms and this
|
the Program, the only way you could satisfy both those terms and this
|
||||||
License would be to refrain entirely from conveying the Program.
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
13. Use with the GNU Affero General Public License.
|
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, if you modify the
|
||||||
|
Program, your modified version must prominently offer all users
|
||||||
|
interacting with it remotely through a computer network (if your version
|
||||||
|
supports such interaction) an opportunity to receive the Corresponding
|
||||||
|
Source of your version by providing access to the Corresponding Source
|
||||||
|
from a network server at no charge, through some standard or customary
|
||||||
|
means of facilitating copying of software. This Corresponding Source
|
||||||
|
shall include the Corresponding Source for any work covered by version 3
|
||||||
|
of the GNU General Public License that is incorporated pursuant to the
|
||||||
|
following paragraph.
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, you have
|
Notwithstanding any other provision of this License, you have
|
||||||
permission to link or combine any covered work with a work licensed
|
permission to link or combine any covered work with a work licensed
|
||||||
under version 3 of the GNU Affero General Public License into a single
|
under version 3 of the GNU General Public License into a single
|
||||||
combined work, and to convey the resulting work. The terms of this
|
combined work, and to convey the resulting work. The terms of this
|
||||||
License will continue to apply to the part which is the covered work,
|
License will continue to apply to the part which is the covered work,
|
||||||
but the special requirements of the GNU Affero General Public License,
|
but the work with which it is combined will remain governed by version
|
||||||
section 13, concerning interaction through a network will apply to the
|
3 of the GNU General Public License.
|
||||||
combination as such.
|
|
||||||
|
|
||||||
14. Revised Versions of this License.
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
The Free Software Foundation may publish revised and/or new versions of
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
the GNU General Public License from time to time. Such new versions will
|
the GNU Affero General Public License from time to time. Such new versions
|
||||||
be similar in spirit to the present version, but may differ in detail to
|
will be similar in spirit to the present version, but may differ in detail to
|
||||||
address new problems or concerns.
|
address new problems or concerns.
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the
|
Each version is given a distinguishing version number. If the
|
||||||
Program specifies that a certain numbered version of the GNU General
|
Program specifies that a certain numbered version of the GNU Affero General
|
||||||
Public License "or any later version" applies to it, you have the
|
Public License "or any later version" applies to it, you have the
|
||||||
option of following the terms and conditions either of that numbered
|
option of following the terms and conditions either of that numbered
|
||||||
version or of any later version published by the Free Software
|
version or of any later version published by the Free Software
|
||||||
Foundation. If the Program does not specify a version number of the
|
Foundation. If the Program does not specify a version number of the
|
||||||
GNU General Public License, you may choose any version ever published
|
GNU Affero General Public License, you may choose any version ever published
|
||||||
by the Free Software Foundation.
|
by the Free Software Foundation.
|
||||||
|
|
||||||
If the Program specifies that a proxy can decide which future
|
If the Program specifies that a proxy can decide which future
|
||||||
versions of the GNU General Public License can be used, that proxy's
|
versions of the GNU Affero General Public License can be used, that proxy's
|
||||||
public statement of acceptance of a version permanently authorizes you
|
public statement of acceptance of a version permanently authorizes you
|
||||||
to choose that version for the Program.
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
|
@ -635,40 +633,30 @@ the "copyright" line and a pointer to where the full notice is found.
|
||||||
Copyright (C) <year> <name of author>
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU Affero General Public License as published
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU Affero General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
If the program does terminal interaction, make it output a short
|
If your software can interact with users remotely through a computer
|
||||||
notice like this when it starts in an interactive mode:
|
network, you should also make sure that it provides a way for users to
|
||||||
|
get its source. For example, if your program is a web application, its
|
||||||
<program> Copyright (C) <year> <name of author>
|
interface could display a "Source" link that leads users to an archive
|
||||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
of the code. There are many ways you could offer source, and different
|
||||||
This is free software, and you are welcome to redistribute it
|
solutions will be better for different programs; see section 13 for the
|
||||||
under certain conditions; type `show c' for details.
|
specific requirements.
|
||||||
|
|
||||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
|
||||||
parts of the General Public License. Of course, your program's commands
|
|
||||||
might be different; for a GUI interface, you would use an "about box".
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or school,
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
For more information on this, and how to apply and follow the GNU GPL, see
|
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||||
<http://www.gnu.org/licenses/>.
|
<http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
The GNU General Public License does not permit incorporating your program
|
|
||||||
into proprietary programs. If your program is a subroutine library, you
|
|
||||||
may consider it more useful to permit linking proprietary applications with
|
|
||||||
the library. If this is what you want to do, use the GNU Lesser General
|
|
||||||
Public License instead of this License. But first, please read
|
|
||||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
|
||||||
10
xExtension-CustomJS/README.md
Normal file
10
xExtension-CustomJS/README.md
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
# CustomJS extension
|
||||||
|
|
||||||
|
A FreshRSS extension which give ability to create user-specific JS.
|
||||||
|
|
||||||
|
To use it, upload this directory in your `./extensions` directory and enable it on the extension panel in FreshRSS. You can add JS by clicking on the manage button.
|
||||||
|
|
||||||
|
## Changelog
|
||||||
|
|
||||||
|
- 0.2 added file permission check and german translation
|
||||||
|
- 0.1 initial version
|
||||||
24
xExtension-CustomJS/configure.phtml
Normal file
24
xExtension-CustomJS/configure.phtml
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
<?php
|
||||||
|
declare(strict_types=1);
|
||||||
|
/** @var CustomJSExtension $this */
|
||||||
|
?>
|
||||||
|
<form action="<?= _url('extension', 'configure', 'e', urlencode($this->getName())) ?>" method="post">
|
||||||
|
<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="group-name" for="js-rules"><?= _t('ext.custom_js.write_js') ?></label>
|
||||||
|
<div class="group-controls">
|
||||||
|
<textarea name="js-rules" id="js-rules"><?= $this->js_rules ?></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group form-actions">
|
||||||
|
<?php if ($this->permission_problem !== '') { ?>
|
||||||
|
<p class="alert alert-error"><?= _t('ext.custom_js.permission_problem', $this->permission_problem) ?></p>
|
||||||
|
<?php } else { ?>
|
||||||
|
<div class="group-controls">
|
||||||
|
<button type="submit" class="btn btn-important"><?= _t('gen.action.submit') ?></button>
|
||||||
|
<button type="reset" class="btn"><?= _t('gen.action.cancel') ?></button>
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
47
xExtension-CustomJS/extension.php
Normal file
47
xExtension-CustomJS/extension.php
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
final class CustomJSExtension extends Minz_Extension {
|
||||||
|
public string $js_rules;
|
||||||
|
public string $permission_problem = '';
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
|
public function init(): void {
|
||||||
|
$this->registerTranslates();
|
||||||
|
|
||||||
|
$current_user = Minz_Session::paramString('currentUser');
|
||||||
|
$filename = 'script.' . $current_user . '.js';
|
||||||
|
$filepath = join_path($this->getPath(), 'static', $filename);
|
||||||
|
|
||||||
|
if (file_exists($filepath)) {
|
||||||
|
Minz_View::appendScript($this->getFileUrl($filename, 'js'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
|
public function handleConfigureAction(): void {
|
||||||
|
$this->registerTranslates();
|
||||||
|
|
||||||
|
$current_user = Minz_Session::paramString('currentUser');
|
||||||
|
$filename = 'script.' . $current_user . '.js';
|
||||||
|
$staticPath = join_path($this->getPath(), 'static');
|
||||||
|
$filepath = join_path($staticPath, $filename);
|
||||||
|
|
||||||
|
if (!file_exists($filepath) && !is_writable($staticPath)) {
|
||||||
|
$tmpPath = explode(EXTENSIONS_PATH . '/', $staticPath);
|
||||||
|
$this->permission_problem = $tmpPath[1] . '/';
|
||||||
|
} elseif (file_exists($filepath) && !is_writable($filepath)) {
|
||||||
|
$tmpPath = explode(EXTENSIONS_PATH . '/', $filepath);
|
||||||
|
$this->permission_problem = $tmpPath[1];
|
||||||
|
} elseif (Minz_Request::isPost()) {
|
||||||
|
$js_rules = html_entity_decode(Minz_Request::paramString('js-rules'));
|
||||||
|
file_put_contents($filepath, $js_rules);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->js_rules = '';
|
||||||
|
if (file_exists($filepath)) {
|
||||||
|
$this->js_rules = htmlentities(file_get_contents($filepath) ?: '');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
8
xExtension-CustomJS/i18n/de/ext.php
Normal file
8
xExtension-CustomJS/i18n/de/ext.php
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'custom_js' => array(
|
||||||
|
'write_js' => 'Benutzerspezifische Javascript Regeln',
|
||||||
|
'permission_problem' => 'Deine JS Datei ist nicht beschreibbar, bitte ändere die Berechtigungen von %s'
|
||||||
|
),
|
||||||
|
);
|
||||||
8
xExtension-CustomJS/i18n/en/ext.php
Normal file
8
xExtension-CustomJS/i18n/en/ext.php
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'custom_js' => array(
|
||||||
|
'write_js' => 'Additional JS',
|
||||||
|
'permission_problem' => 'Your JS file is not writable, please change the file permissions for %s',
|
||||||
|
),
|
||||||
|
);
|
||||||
8
xExtension-CustomJS/i18n/fr/ext.php
Normal file
8
xExtension-CustomJS/i18n/fr/ext.php
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'custom_js' => array(
|
||||||
|
'write_js' => 'JS supplémentaires',
|
||||||
|
'permission_problem' => 'Votre fichier JS est en lecture seule ; veuillez adapter les permissions pour %s',
|
||||||
|
),
|
||||||
|
);
|
||||||
8
xExtension-CustomJS/metadata.json
Normal file
8
xExtension-CustomJS/metadata.json
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"name": "Custom JS",
|
||||||
|
"author": "Frans de Jonge",
|
||||||
|
"description": "Apply custom JS.",
|
||||||
|
"version": "0.5.1",
|
||||||
|
"entrypoint": "CustomJS",
|
||||||
|
"type": "user"
|
||||||
|
}
|
||||||
1
xExtension-CustomJS/static/.gitignore
vendored
Normal file
1
xExtension-CustomJS/static/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
script.*.js
|
||||||
662
xExtension-HighlightWords/LICENSE
Normal file
662
xExtension-HighlightWords/LICENSE
Normal file
|
|
@ -0,0 +1,662 @@
|
||||||
|
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 19 November 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The GNU Affero General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works, specifically designed to ensure
|
||||||
|
cooperation with the community in the case of network server software.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
our General Public Licenses are intended to guarantee your freedom to
|
||||||
|
share and change all versions of a program--to make sure it remains free
|
||||||
|
software for all its users.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
Developers that use our General Public Licenses protect your rights
|
||||||
|
with two steps: (1) assert copyright on the software, and (2) offer
|
||||||
|
you this License which gives you legal permission to copy, distribute
|
||||||
|
and/or modify the software.
|
||||||
|
|
||||||
|
A secondary benefit of defending all users' freedom is that
|
||||||
|
improvements made in alternate versions of the program, if they
|
||||||
|
receive widespread use, become available for other developers to
|
||||||
|
incorporate. Many developers of free software are heartened and
|
||||||
|
encouraged by the resulting cooperation. However, in the case of
|
||||||
|
software used on network servers, this result may fail to come about.
|
||||||
|
The GNU General Public License permits making a modified version and
|
||||||
|
letting the public access it on a server without ever releasing its
|
||||||
|
source code to the public.
|
||||||
|
|
||||||
|
The GNU Affero General Public License is designed specifically to
|
||||||
|
ensure that, in such cases, the modified source code becomes available
|
||||||
|
to the community. It requires the operator of a network server to
|
||||||
|
provide the source code of the modified version running there to the
|
||||||
|
users of that server. Therefore, public use of a modified version, on
|
||||||
|
a publicly accessible server, gives the public access to the source
|
||||||
|
code of the modified version.
|
||||||
|
|
||||||
|
An older license, called the Affero General Public License and
|
||||||
|
published by Affero, was designed to accomplish similar goals. This is
|
||||||
|
a different license, not a version of the Affero GPL, but Affero has
|
||||||
|
released a new version of the Affero GPL which permits relicensing under
|
||||||
|
this license.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
0. Definitions.
|
||||||
|
|
||||||
|
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||||
|
|
||||||
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
|
"recipients" may be individuals or organizations.
|
||||||
|
|
||||||
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
|
A "covered work" means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To "propagate" a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To "convey" a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
|
to the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
1. Source Code.
|
||||||
|
|
||||||
|
The "source code" for a work means the preferred form of the work
|
||||||
|
for making modifications to it. "Object code" means any non-source
|
||||||
|
form of a work.
|
||||||
|
|
||||||
|
A "Standard Interface" means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The "System Libraries" of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The "Corresponding Source" for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users
|
||||||
|
can regenerate automatically from other parts of the Corresponding
|
||||||
|
Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that
|
||||||
|
same work.
|
||||||
|
|
||||||
|
2. Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
|
the Program, the only way you could satisfy both those terms and this
|
||||||
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, if you modify the
|
||||||
|
Program, your modified version must prominently offer all users
|
||||||
|
interacting with it remotely through a computer network (if your version
|
||||||
|
supports such interaction) an opportunity to receive the Corresponding
|
||||||
|
Source of your version by providing access to the Corresponding Source
|
||||||
|
from a network server at no charge, through some standard or customary
|
||||||
|
means of facilitating copying of software. This Corresponding Source
|
||||||
|
shall include the Corresponding Source for any work covered by version 3
|
||||||
|
of the GNU General Public License that is incorporated pursuant to the
|
||||||
|
following paragraph.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the work with which it is combined will remain governed by version
|
||||||
|
3 of the GNU General Public License.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU Affero General Public License from time to time. Such new versions
|
||||||
|
will be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Program specifies that a certain numbered version of the GNU Affero General
|
||||||
|
Public License "or any later version" applies to it, you have the
|
||||||
|
option of following the terms and conditions either of that numbered
|
||||||
|
version or of any later version published by the Free Software
|
||||||
|
Foundation. If the Program does not specify a version number of the
|
||||||
|
GNU Affero General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future
|
||||||
|
versions of the GNU Affero General Public License can be used, that proxy's
|
||||||
|
public statement of acceptance of a version permanently authorizes you
|
||||||
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
15. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||||
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||||
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||||
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||||
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||||
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
state the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If your software can interact with users remotely through a computer
|
||||||
|
network, you should also make sure that it provides a way for users to
|
||||||
|
get its source. For example, if your program is a web application, its
|
||||||
|
interface could display a "Source" link that leads users to an archive
|
||||||
|
of the code. There are many ways you could offer source, and different
|
||||||
|
solutions will be better for different programs; see section 13 for the
|
||||||
|
specific requirements.
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||||
|
<http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
7
xExtension-HighlightWords/README.md
Normal file
7
xExtension-HighlightWords/README.md
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
# extension
|
||||||
|
|
||||||
|
A FreshRSS extension ...
|
||||||
|
|
||||||
|
## Changelog
|
||||||
|
|
||||||
|
|
||||||
38
xExtension-HighlightWords/configure.phtml
Normal file
38
xExtension-HighlightWords/configure.phtml
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
<?php
|
||||||
|
declare(strict_types=1);
|
||||||
|
/** @var CustomJSExtension $this */
|
||||||
|
?>
|
||||||
|
<form action="<?= _url('extension', 'configure', 'e', urlencode($this->getName())) ?>" method="post">
|
||||||
|
<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="group-name" for="words_primary"><?= _t('ext.highlightwords.words_primary') ?></label>
|
||||||
|
<div class="group-controls">
|
||||||
|
<textarea name="words_primary" id="words_primary"><?= $this->words_primary ?></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="group-name" for="words_secondary"><?= _t('ext.highlightwords.words_secondary') ?></label>
|
||||||
|
<div class="group-controls">
|
||||||
|
<textarea name="words_secondary" id="words_secondary"><?= $this->words_secondary ?></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="group-name" for="enableInArticle"></label>
|
||||||
|
<div class="group-controls">
|
||||||
|
<label><input id="enableInArticle" name="enableInArticle" type="checkbox" <?= $this->enableInArticle === 'true' ? 'checked' : '' ?> /><?= _t('ext.highlightwords.enableInArticle') ?></label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group form-actions">
|
||||||
|
<?php if ($this->permission_problem !== '') { ?>
|
||||||
|
<p class="alert alert-error"><?= _t('ext.highlightwords.permission_problem', $this->permission_problem) ?></p>
|
||||||
|
<?php } else { ?>
|
||||||
|
<div class="group-controls">
|
||||||
|
<button type="submit" class="btn btn-important"><?= _t('gen.action.submit') ?></button>
|
||||||
|
<button type="reset" class="btn"><?= _t('gen.action.cancel') ?></button>
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
65
xExtension-HighlightWords/extension.php
Normal file
65
xExtension-HighlightWords/extension.php
Normal file
|
|
@ -0,0 +1,65 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
final class HighlightWordsExtension extends Minz_Extension {
|
||||||
|
public string $words_primary;
|
||||||
|
public string $words_secondary;
|
||||||
|
public string $permission_problem = '';
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
|
public function init(): void {
|
||||||
|
$this->registerTranslates();
|
||||||
|
|
||||||
|
$current_user = Minz_Session::paramString('currentUser');
|
||||||
|
$filename = 'words.' . $current_user . '.js';
|
||||||
|
$filepath = join_path($this->getPath(), 'static', $filename);
|
||||||
|
|
||||||
|
if (file_exists($filepath)) {
|
||||||
|
Minz_View::appendScript($this->getFileUrl($filename, 'js'));
|
||||||
|
}
|
||||||
|
|
||||||
|
Minz_View::appendScript($this->getFileUrl('mark.es6.min.js','js'));
|
||||||
|
Minz_View::appendScript($this->getFileUrl('highlightWords.js', 'js'));
|
||||||
|
Minz_View::appendStyle($this->getFileUrl('highlightWords.css', 'css'));
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
|
public function handleConfigureAction(): void {
|
||||||
|
$this->registerTranslates();
|
||||||
|
|
||||||
|
$current_user = Minz_Session::paramString('currentUser');
|
||||||
|
$filename = 'words.' . $current_user . '.js';
|
||||||
|
$staticPath = join_path($this->getPath(), 'static');
|
||||||
|
$filepath = join_path($staticPath, $filename);
|
||||||
|
|
||||||
|
if (!file_exists($filepath) && !is_writable($staticPath)) {
|
||||||
|
$tmpPath = explode(EXTENSIONS_PATH . '/', $staticPath);
|
||||||
|
$this->permission_problem = $tmpPath[1] . '/';
|
||||||
|
} elseif (file_exists($filepath) && !is_writable($filepath)) {
|
||||||
|
$tmpPath = explode(EXTENSIONS_PATH . '/', $filepath);
|
||||||
|
$this->permission_problem = $tmpPath[1];
|
||||||
|
} elseif (Minz_Request::isPost()) {
|
||||||
|
$words_primary = html_entity_decode(Minz_Request::paramString('words_primary'));
|
||||||
|
$words_secondary = html_entity_decode(Minz_Request::paramString('words_secondary'));
|
||||||
|
$enableInArticle = Minz_Request::paramString('enableInArticle')?'true':'false';
|
||||||
|
|
||||||
|
file_put_contents($filepath, 'const HIGHLIGHT_WORDS_PRIMARY = ['.$words_primary.'];const HIGHLIGHT_WORDS_SECONDARY = ['.$words_secondary.'];/*enableInArticle ['. $enableInArticle .']*/const enableInArticle = ' . $enableInArticle.';');
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->words_primary = '';
|
||||||
|
$this->words_secondary = '';
|
||||||
|
|
||||||
|
if (file_exists($filepath)) {
|
||||||
|
|
||||||
|
$filecontent = file_get_contents($filepath);
|
||||||
|
preg_match_all("/\[([^\]]*)\]/", $filecontent, $match);
|
||||||
|
$this->words_primary = htmlentities($filecontent ? $match[1][0] : '');
|
||||||
|
$this->words_secondary = htmlentities($filecontent ? $match[1][1]: '');
|
||||||
|
|
||||||
|
$this->enableInArticle = $match[1][2];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
10
xExtension-HighlightWords/i18n/en/ext.php
Normal file
10
xExtension-HighlightWords/i18n/en/ext.php
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'highlightwords' => array(
|
||||||
|
'words_primary' => 'Words Primary',
|
||||||
|
'words_secondary' => 'Words Secondary',
|
||||||
|
'permission_problem' => 'permission problem text',
|
||||||
|
'enableInArticle' => 'Mark findings in article´s body text',
|
||||||
|
),
|
||||||
|
);
|
||||||
8
xExtension-HighlightWords/metadata.json
Normal file
8
xExtension-HighlightWords/metadata.json
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"name": "Highlight Words",
|
||||||
|
"author": "LukasMega",
|
||||||
|
"description": "Highlight your favorite words in the feed articles.",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"entrypoint": "HighlightWords",
|
||||||
|
"type": "user"
|
||||||
|
}
|
||||||
1
xExtension-HighlightWords/static/.gitignore
vendored
Normal file
1
xExtension-HighlightWords/static/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
script.*.js
|
||||||
9
xExtension-HighlightWords/static/highlightWords.css
Normal file
9
xExtension-HighlightWords/static/highlightWords.css
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
#stream mark {
|
||||||
|
padding:2px; padding-right:0; border-radius:4px;
|
||||||
|
}
|
||||||
|
#stream mark.mark-secondary {
|
||||||
|
background-color: rgba(255, 255, 0, .3) !important;
|
||||||
|
}
|
||||||
|
html[class*=darkMode] #stream mark.mark-secondary {
|
||||||
|
background-color: rgba(255, 255, 0, .5) !important;
|
||||||
|
}
|
||||||
81
xExtension-HighlightWords/static/highlightWords.js
Normal file
81
xExtension-HighlightWords/static/highlightWords.js
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -1,9 +1,3 @@
|
||||||
/**
|
|
||||||
* mark.js (Library for highlighting words)
|
|
||||||
* https://github.com/julkue/mark.js/blob/master/dist/mark.es6.min.js
|
|
||||||
*/
|
|
||||||
/* eslint-disable */
|
|
||||||
|
|
||||||
/*!***************************************************
|
/*!***************************************************
|
||||||
* mark.js v9.0.0
|
* mark.js v9.0.0
|
||||||
* https://markjs.io/
|
* https://markjs.io/
|
||||||
2
xExtension-HighlightWords/static/words.admin.js
Normal file
2
xExtension-HighlightWords/static/words.admin.js
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
const HIGHLIGHT_WORDS_PRIMARY = ["crew",
|
||||||
|
"SpaceX"];const HIGHLIGHT_WORDS_SECONDARY = ["dragon"];/*enableInArticle [true]*/const enableInArticle = true;
|
||||||
|
|
@ -4,11 +4,6 @@ This FreshRSS extension allows you to get rid of insecure content warnings or di
|
||||||
|
|
||||||
To use it, upload this entire directory to the FreshRSS `./extensions` directory on your server and enable it on the extension panel in FreshRSS.
|
To use it, upload this entire directory to the FreshRSS `./extensions` directory on your server and enable it on the extension panel in FreshRSS.
|
||||||
|
|
||||||
## Changelog
|
|
||||||
|
|
||||||
* 1.0 Breaking changes due to significant code upgrade: settings must be saved again
|
|
||||||
* 0.7.3 Turkish language support added
|
|
||||||
|
|
||||||
## Configuration settings
|
## Configuration settings
|
||||||
|
|
||||||
* `proxy_url` (default: `https://images.example.com/?url=`): the URL that is prependended to the original image URL
|
* `proxy_url` (default: `https://images.example.com/?url=`): the URL that is prependended to the original image URL
|
||||||
|
|
|
||||||
|
|
@ -7,30 +7,26 @@
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="group-name" for="image_proxy_url"><?= _t('ext.imageproxy.proxy_url') ?></label>
|
<label class="group-name" for="image_proxy_url"><?= _t('ext.imageproxy.proxy_url') ?></label>
|
||||||
<div class="group-controls">
|
<div class="group-controls">
|
||||||
<input type="url" name="image_proxy_url" id="image_proxy_url"
|
<input type="url" name="image_proxy_url" id="image_proxy_url" value="<?= FreshRSS_Context::userConf()->image_proxy_url ?>">
|
||||||
value="<?= htmlspecialchars(FreshRSS_Context::userConf()->attributeString('image_proxy_url') ?? '', ENT_COMPAT, 'UTF-8') ?>">
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="group-name" for="image_proxy_scheme_http"><?= _t('ext.imageproxy.scheme_http') ?></label>
|
<label class="group-name" for="image_proxy_scheme_http"><?= _t('ext.imageproxy.scheme_http') ?></label>
|
||||||
<div class="group-controls">
|
<div class="group-controls">
|
||||||
<input type="checkbox" name="image_proxy_scheme_http" id="image_proxy_scheme_http" value="1"
|
<input type="checkbox" name="image_proxy_scheme_http" id="image_proxy_scheme_http" value="1" <?= FreshRSS_Context::userConf()->image_proxy_scheme_http ? 'checked' : '' ?>>
|
||||||
<?= FreshRSS_Context::userConf()->attributeBool('image_proxy_scheme_http') ? 'checked' : '' ?>>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="group-name" for="image_proxy_scheme_https"><?= _t('ext.imageproxy.scheme_https'); ?></label>
|
<label class="group-name" for="image_proxy_scheme_https"><?= _t('ext.imageproxy.scheme_https'); ?></label>
|
||||||
<div class="group-controls">
|
<div class="group-controls">
|
||||||
<input type="checkbox" name="image_proxy_scheme_https" id="image_proxy_scheme_https" value="1"
|
<input type="checkbox" name="image_proxy_scheme_https" id="image_proxy_scheme_https" value="1" <?= FreshRSS_Context::userConf()->image_proxy_scheme_https ? 'checked' : '' ?>>
|
||||||
<?= FreshRSS_Context::userConf()->attributeBool('image_proxy_scheme_https') ? 'checked' : '' ?>>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="group-name" for="image_proxy_scheme_default"><?= _t('ext.imageproxy.scheme_default'); ?></label>
|
<label class="group-name" for="image_proxy_scheme_default"><?= _t('ext.imageproxy.scheme_default'); ?></label>
|
||||||
<div class="group-controls">
|
<div class="group-controls">
|
||||||
<select name="image_proxy_scheme_default" id="image_proxy_scheme_default">
|
<select name="image_proxy_scheme_default" id="image_proxy_scheme_default">
|
||||||
<option value="<?= htmlspecialchars(FreshRSS_Context::userConf()->attributeString('image_proxy_scheme_default') ?? '', ENT_COMPAT, 'UTF-8') ?>" selected="selected"><?=
|
<option value="<?= htmlentities(FreshRSS_Context::userConf()->image_proxy_scheme_default ?? '') ?>" selected="selected"><?= htmlentities(FreshRSS_Context::userConf()->image_proxy_scheme_default ?? '') ?></option>
|
||||||
htmlspecialchars(FreshRSS_Context::userConf()->attributeString('image_proxy_scheme_default') ?? '', ENT_COMPAT, 'UTF-8') ?></option>
|
|
||||||
<option value="-">-</option>
|
<option value="-">-</option>
|
||||||
<option value="auto">auto</option>
|
<option value="auto">auto</option>
|
||||||
<option value="http">http</option>
|
<option value="http">http</option>
|
||||||
|
|
@ -41,15 +37,13 @@
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="group-name" for="image_proxy_scheme_include"><?= _t('ext.imageproxy.scheme_include'); ?></label>
|
<label class="group-name" for="image_proxy_scheme_include"><?= _t('ext.imageproxy.scheme_include'); ?></label>
|
||||||
<div class="group-controls">
|
<div class="group-controls">
|
||||||
<input type="checkbox" name="image_proxy_scheme_include" id="image_proxy_scheme_include" value="1"
|
<input type="checkbox" name="image_proxy_scheme_include" id="image_proxy_scheme_include" value="1" <?= FreshRSS_Context::userConf()->image_proxy_scheme_include ? 'checked' : '' ?>>
|
||||||
<?= FreshRSS_Context::userConf()->attributeBool('image_proxy_scheme_include') ? 'checked' : '' ?>>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="group-name" for="image_proxy_url_encode"><?= _t('ext.imageproxy.url_encode'); ?></label>
|
<label class="group-name" for="image_proxy_url_encode"><?= _t('ext.imageproxy.url_encode'); ?></label>
|
||||||
<div class="group-controls">
|
<div class="group-controls">
|
||||||
<input type="checkbox" name="image_proxy_url_encode" id="image_proxy_url_encode" value="1"
|
<input type="checkbox" name="image_proxy_url_encode" id="image_proxy_url_encode" value="1" <?= FreshRSS_Context::userConf()->image_proxy_url_encode ? 'checked' : '' ?>>
|
||||||
<?= FreshRSS_Context::userConf()->attributeBool('image_proxy_url_encode') ? 'checked' : '' ?>>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,15 +5,12 @@ declare(strict_types=1);
|
||||||
final class ImageProxyExtension extends Minz_Extension {
|
final class ImageProxyExtension extends Minz_Extension {
|
||||||
// Defaults
|
// Defaults
|
||||||
private const PROXY_URL = 'https://wsrv.nl/?url=';
|
private const PROXY_URL = 'https://wsrv.nl/?url=';
|
||||||
private const SCHEME_HTTP = true;
|
private const SCHEME_HTTP = '1';
|
||||||
private const SCHEME_HTTPS = false;
|
private const SCHEME_HTTPS = '';
|
||||||
private const SCHEME_DEFAULT = 'auto';
|
private const SCHEME_DEFAULT = 'auto';
|
||||||
private const SCHEME_INCLUDE = false;
|
private const SCHEME_INCLUDE = '';
|
||||||
private const URL_ENCODE = true;
|
private const URL_ENCODE = '1';
|
||||||
|
|
||||||
/**
|
|
||||||
* @throws FreshRSS_Context_Exception
|
|
||||||
*/
|
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function init(): void {
|
public function init(): void {
|
||||||
if (!FreshRSS_Context::hasSystemConf()) {
|
if (!FreshRSS_Context::hasSystemConf()) {
|
||||||
|
|
@ -22,28 +19,33 @@ final class ImageProxyExtension extends Minz_Extension {
|
||||||
$this->registerHook('entry_before_display', [self::class, 'setImageProxyHook']);
|
$this->registerHook('entry_before_display', [self::class, 'setImageProxyHook']);
|
||||||
// Defaults
|
// Defaults
|
||||||
$save = false;
|
$save = false;
|
||||||
if (FreshRSS_Context::userConf()->attributeString('image_proxy_url') == null) {
|
if (is_null(FreshRSS_Context::userConf()->image_proxy_url)) {
|
||||||
FreshRSS_Context::userConf()->_attribute('image_proxy_url', self::PROXY_URL);
|
FreshRSS_Context::userConf()->image_proxy_url = self::PROXY_URL;
|
||||||
$save = true;
|
$save = true;
|
||||||
}
|
}
|
||||||
if (FreshRSS_Context::userConf()->attributeBool('image_proxy_scheme_http') === null) {
|
if (is_null(FreshRSS_Context::userConf()->image_proxy_scheme_http)) {
|
||||||
FreshRSS_Context::userConf()->_attribute('image_proxy_scheme_http', self::SCHEME_HTTP);
|
FreshRSS_Context::userConf()->image_proxy_scheme_http = self::SCHEME_HTTP;
|
||||||
$save = true;
|
$save = true;
|
||||||
}
|
}
|
||||||
if (FreshRSS_Context::userConf()->attributeBool('image_proxy_scheme_https') === null) {
|
if (is_null(FreshRSS_Context::userConf()->image_proxy_scheme_https)) {
|
||||||
FreshRSS_Context::userConf()->_attribute('image_proxy_scheme_https', self::SCHEME_HTTPS);
|
FreshRSS_Context::userConf()->image_proxy_scheme_https = self::SCHEME_HTTPS;
|
||||||
|
// Legacy
|
||||||
|
if (!is_null(FreshRSS_Context::userConf()->image_proxy_force)) {
|
||||||
|
FreshRSS_Context::userConf()->image_proxy_scheme_https = FreshRSS_Context::userConf()->image_proxy_force;
|
||||||
|
FreshRSS_Context::userConf()->image_proxy_force = null; // Minz -> unset
|
||||||
|
}
|
||||||
$save = true;
|
$save = true;
|
||||||
}
|
}
|
||||||
if (FreshRSS_Context::userConf()->attributeString('image_proxy_scheme_default') === null) {
|
if (is_null(FreshRSS_Context::userConf()->image_proxy_scheme_default)) {
|
||||||
FreshRSS_Context::userConf()->_attribute('image_proxy_scheme_default', self::SCHEME_DEFAULT);
|
FreshRSS_Context::userConf()->image_proxy_scheme_default = self::SCHEME_DEFAULT;
|
||||||
$save = true;
|
$save = true;
|
||||||
}
|
}
|
||||||
if (FreshRSS_Context::userConf()->attributeBool('image_proxy_scheme_include') === null) {
|
if (is_null(FreshRSS_Context::userConf()->image_proxy_scheme_include)) {
|
||||||
FreshRSS_Context::userConf()->_attribute('image_proxy_scheme_include', self::SCHEME_INCLUDE);
|
FreshRSS_Context::userConf()->image_proxy_scheme_include = self::SCHEME_INCLUDE;
|
||||||
$save = true;
|
$save = true;
|
||||||
}
|
}
|
||||||
if (FreshRSS_Context::userConf()->attributeBool('image_proxy_url_encode') === null) {
|
if (is_null(FreshRSS_Context::userConf()->image_proxy_url_encode)) {
|
||||||
FreshRSS_Context::userConf()->_attribute('image_proxy_url_encode', self::URL_ENCODE);
|
FreshRSS_Context::userConf()->image_proxy_url_encode = self::URL_ENCODE;
|
||||||
$save = true;
|
$save = true;
|
||||||
}
|
}
|
||||||
if ($save) {
|
if ($save) {
|
||||||
|
|
@ -51,108 +53,83 @@ final class ImageProxyExtension extends Minz_Extension {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @throws FreshRSS_Context_Exception
|
|
||||||
*/
|
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function handleConfigureAction(): void {
|
public function handleConfigureAction(): void {
|
||||||
$this->registerTranslates();
|
$this->registerTranslates();
|
||||||
|
|
||||||
if (Minz_Request::isPost()) {
|
if (Minz_Request::isPost()) {
|
||||||
FreshRSS_Context::userConf()->_attribute('image_proxy_url', Minz_Request::paramString('image_proxy_url', plaintext: true) ?: self::PROXY_URL);
|
FreshRSS_Context::userConf()->image_proxy_url = Minz_Request::paramString('image_proxy_url', true) ?: self::PROXY_URL;
|
||||||
FreshRSS_Context::userConf()->_attribute('image_proxy_scheme_http', Minz_Request::paramBoolean('image_proxy_scheme_http'));
|
FreshRSS_Context::userConf()->image_proxy_scheme_http = Minz_Request::paramString('image_proxy_scheme_http');
|
||||||
FreshRSS_Context::userConf()->_attribute('image_proxy_scheme_https', Minz_Request::paramBoolean('image_proxy_scheme_https'));
|
FreshRSS_Context::userConf()->image_proxy_scheme_https = Minz_Request::paramString('image_proxy_scheme_https');
|
||||||
FreshRSS_Context::userConf()->_attribute('image_proxy_scheme_default', Minz_Request::paramString('image_proxy_scheme_default', plaintext: true) ?: self::SCHEME_DEFAULT);
|
FreshRSS_Context::userConf()->image_proxy_scheme_default = Minz_Request::paramString('image_proxy_scheme_default') ?: self::SCHEME_DEFAULT;
|
||||||
FreshRSS_Context::userConf()->_attribute('image_proxy_scheme_include', Minz_Request::paramBoolean('image_proxy_scheme_include'));
|
FreshRSS_Context::userConf()->image_proxy_scheme_include = Minz_Request::paramString('image_proxy_scheme_include');
|
||||||
FreshRSS_Context::userConf()->_attribute('image_proxy_url_encode', Minz_Request::paramBoolean('image_proxy_url_encode'));
|
FreshRSS_Context::userConf()->image_proxy_url_encode = Minz_Request::paramString('image_proxy_url_encode');
|
||||||
FreshRSS_Context::userConf()->save();
|
FreshRSS_Context::userConf()->save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @throws FreshRSS_Context_Exception
|
|
||||||
*/
|
|
||||||
public static function getProxyImageUri(string $url): string {
|
public static function getProxyImageUri(string $url): string {
|
||||||
$parsed_url = parse_url($url);
|
$parsed_url = parse_url($url);
|
||||||
$scheme = $parsed_url['scheme'] ?? '';
|
$scheme = isset($parsed_url['scheme']) ? $parsed_url['scheme'] : null;
|
||||||
if ($scheme === 'http') {
|
if ($scheme === 'http') {
|
||||||
if (!FreshRSS_Context::userConf()->attributeBool('image_proxy_scheme_http')) {
|
if (!FreshRSS_Context::userConf()->image_proxy_scheme_http) {
|
||||||
return $url;
|
return $url;
|
||||||
}
|
}
|
||||||
if (!FreshRSS_Context::userConf()->attributeBool('image_proxy_scheme_include')) {
|
if (!FreshRSS_Context::userConf()->image_proxy_scheme_include) {
|
||||||
$url = substr($url, 7); // http://
|
$url = substr($url, 7); // http://
|
||||||
}
|
}
|
||||||
} elseif ($scheme === 'https') {
|
} elseif ($scheme === 'https') {
|
||||||
if (!FreshRSS_Context::userConf()->attributeBool('image_proxy_scheme_https')) {
|
if (!FreshRSS_Context::userConf()->image_proxy_scheme_https) {
|
||||||
return $url;
|
return $url;
|
||||||
}
|
}
|
||||||
if (!FreshRSS_Context::userConf()->attributeBool('image_proxy_scheme_include')) {
|
if (!FreshRSS_Context::userConf()->image_proxy_scheme_include) {
|
||||||
$url = substr($url, 8); // https://
|
$url = substr($url, 8); // https://
|
||||||
}
|
}
|
||||||
} elseif ($scheme === '') {
|
} elseif (empty($scheme)) {
|
||||||
if (FreshRSS_Context::userConf()->attributeString('image_proxy_scheme_default') === 'auto') {
|
if (FreshRSS_Context::userConf()->image_proxy_scheme_default === 'auto') {
|
||||||
if (FreshRSS_Context::userConf()->attributeBool('image_proxy_scheme_include')) {
|
if (FreshRSS_Context::userConf()->image_proxy_scheme_include) {
|
||||||
$url = ((is_string($_SERVER['HTTPS'] ?? null) && strtolower($_SERVER['HTTPS']) !== 'off') ? 'https:' : 'http:') . $url;
|
$url = ((!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off') ? 'https:' : 'http:') . $url;
|
||||||
}
|
}
|
||||||
} elseif (str_starts_with(FreshRSS_Context::userConf()->attributeString('image_proxy_scheme_default') ?? '', 'http')) {
|
} elseif (substr(FreshRSS_Context::userConf()->image_proxy_scheme_default, 0, 4) === 'http') {
|
||||||
if (FreshRSS_Context::userConf()->attributeBool('image_proxy_scheme_include')) {
|
if (FreshRSS_Context::userConf()->image_proxy_scheme_include) {
|
||||||
$url = FreshRSS_Context::userConf()->attributeString('image_proxy_scheme_default') . ':' . $url;
|
$url = FreshRSS_Context::userConf()->image_proxy_scheme_default . ':' . $url;
|
||||||
}
|
}
|
||||||
} else { // do not proxy unschemed ("//path/...") URLs
|
} else { // do not proxy unschemed ("//path/...") URLs
|
||||||
return $url;
|
return $url;
|
||||||
}
|
}
|
||||||
} else { // unknown/unsupported (non-http) scheme
|
} else { // unknown/unsupported (non-http) scheme
|
||||||
return $url;
|
return $url;
|
||||||
}
|
}
|
||||||
if (FreshRSS_Context::userConf()->attributeBool('image_proxy_url_encode')) {
|
if (FreshRSS_Context::userConf()->image_proxy_url_encode) {
|
||||||
$url = rawurlencode($url);
|
$url = rawurlencode($url);
|
||||||
}
|
}
|
||||||
return FreshRSS_Context::userConf()->attributeString('image_proxy_url') . $url;
|
return FreshRSS_Context::userConf()->image_proxy_url . $url;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array<string> $matches
|
* @param array<string> $matches
|
||||||
* @throws FreshRSS_Context_Exception
|
|
||||||
*/
|
*/
|
||||||
public static function getSrcSetUris(array $matches): string {
|
public static function getSrcSetUris(array $matches): string {
|
||||||
return str_replace($matches[1], self::getProxyImageUri($matches[1]), $matches[0]);
|
return str_replace($matches[1], self::getProxyImageUri($matches[1]), $matches[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @throws FreshRSS_Context_Exception
|
|
||||||
*/
|
|
||||||
public static function swapUris(string $content): string {
|
public static function swapUris(string $content): string {
|
||||||
if ($content === '') {
|
if (empty($content)) {
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
$doc = new DOMDocument();
|
$doc = new DOMDocument();
|
||||||
libxml_use_internal_errors(true); // prevent tag soup errors from showing
|
libxml_use_internal_errors(true); // prevent tag soup errors from showing
|
||||||
$content = mb_convert_encoding($content, 'HTML-ENTITIES', 'UTF-8');
|
$doc->loadHTML(mb_convert_encoding($content, 'HTML-ENTITIES', 'UTF-8'));
|
||||||
if (!is_string($content)) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
$doc->loadHTML($content);
|
|
||||||
$imgs = $doc->getElementsByTagName('img');
|
$imgs = $doc->getElementsByTagName('img');
|
||||||
foreach ($imgs as $img) {
|
foreach ($imgs as $img) {
|
||||||
if (!($img instanceof DOMElement)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if ($img->hasAttribute('src')) {
|
if ($img->hasAttribute('src')) {
|
||||||
$src = $img->getAttribute('src');
|
$newSrc = self::getProxyImageUri($img->getAttribute('src'));
|
||||||
$newSrc = self::getProxyImageUri($src);
|
|
||||||
/*
|
|
||||||
Due to the URL change, FreshRSS is not aware of already rendered enclosures.
|
|
||||||
Adding data-xextension-imageproxy-original-src / srcset ensures that original URLs are present in the content for the renderer check FreshRSS_Entry->containsLink.
|
|
||||||
*/
|
|
||||||
$img->setAttribute('data-xextension-imageproxy-original-src', $src);
|
|
||||||
$img->setAttribute('src', $newSrc);
|
$img->setAttribute('src', $newSrc);
|
||||||
}
|
}
|
||||||
if ($img->hasAttribute('srcset')) {
|
if ($img->hasAttribute('srcset')) {
|
||||||
$srcSet = $img->getAttribute('srcset');
|
$newSrcSet = preg_replace_callback('/(?:([^\s,]+)(\s*(?:\s+\d+[wx])(?:,\s*)?))/', fn (array $matches) => self::getSrcSetUris($matches), $img->getAttribute('srcset'));
|
||||||
$newSrcSet = preg_replace_callback('/(?:([^\s,]+)(\s*(?:\s+\d+[wx])(?:,\s*)?))/', fn (array $matches) => self::getSrcSetUris($matches), $srcSet);
|
|
||||||
if ($newSrcSet != null) {
|
if ($newSrcSet != null) {
|
||||||
$img->setAttribute('data-xextension-imageproxy-original-srcset', $srcSet);
|
|
||||||
$img->setAttribute('srcset', $newSrcSet);
|
$img->setAttribute('srcset', $newSrcSet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -161,18 +138,12 @@ final class ImageProxyExtension extends Minz_Extension {
|
||||||
$body = $doc->getElementsByTagName('body')->item(0);
|
$body = $doc->getElementsByTagName('body')->item(0);
|
||||||
|
|
||||||
$output = $doc->saveHTML($body);
|
$output = $doc->saveHTML($body);
|
||||||
if ($output === false) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$output = preg_replace('/^<body>|<\/body>$/', '', $output) ?? '';
|
$output = preg_replace('/^<body>|<\/body>$/', '', $output);
|
||||||
|
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @throws FreshRSS_Context_Exception
|
|
||||||
*/
|
|
||||||
public static function setImageProxyHook(FreshRSS_Entry $entry): FreshRSS_Entry {
|
public static function setImageProxyHook(FreshRSS_Entry $entry): FreshRSS_Entry {
|
||||||
$entry->_content(
|
$entry->_content(
|
||||||
self::swapUris($entry->content())
|
self::swapUris($entry->content())
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ return array(
|
||||||
'proxy_url' => 'Proxy-URL',
|
'proxy_url' => 'Proxy-URL',
|
||||||
'scheme_http' => 'HTTP-Proxy',
|
'scheme_http' => 'HTTP-Proxy',
|
||||||
'scheme_https' => 'HTTPS-Proxy',
|
'scheme_https' => 'HTTPS-Proxy',
|
||||||
'scheme_default' => 'Proxy protokoll-relative URL',
|
'scheme_default' => 'Proxy unspezifiziert',
|
||||||
'scheme_include' => 'http*:// in die URL einfügen',
|
'scheme_include' => 'http*:// in die URL einfügen',
|
||||||
'url_encode' => 'URL-Prozentkodierung'
|
'url_encode' => 'URL-Prozentkodierung'
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ return array(
|
||||||
'proxy_url' => 'Proxy URL',
|
'proxy_url' => 'Proxy URL',
|
||||||
'scheme_http' => 'Proxy HTTP',
|
'scheme_http' => 'Proxy HTTP',
|
||||||
'scheme_https' => 'Proxy HTTPS',
|
'scheme_https' => 'Proxy HTTPS',
|
||||||
'scheme_default' => 'Proxy protocol-relative URL',
|
'scheme_default' => 'Proxy unspecified',
|
||||||
'scheme_include' => 'Include http*:// in URL',
|
'scheme_include' => 'Include http*:// in URL',
|
||||||
'url_encode' => 'Encode the URL'
|
'url_encode' => 'Encode the URL'
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ return array(
|
||||||
'proxy_url' => 'URL du proxy',
|
'proxy_url' => 'URL du proxy',
|
||||||
'scheme_http' => 'Proxy HTTP',
|
'scheme_http' => 'Proxy HTTP',
|
||||||
'scheme_https' => 'Proxy HTTPS',
|
'scheme_https' => 'Proxy HTTPS',
|
||||||
'scheme_default' => 'Proxy URLs sans protocole',
|
'scheme_default' => 'Proxy indéterminé',
|
||||||
'scheme_include' => 'Inclure http*:// dans l\'URL',
|
'scheme_include' => 'Inclure http*:// dans l\'URL',
|
||||||
'url_encode' => 'Encoder l\'URL'
|
'url_encode' => 'Encoder l\'URL'
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
return array(
|
|
||||||
'imageproxy' => array(
|
|
||||||
'proxy_url' => 'Proxy-url',
|
|
||||||
'scheme_http' => 'Http proxyen',
|
|
||||||
'scheme_https' => 'Https proxyen',
|
|
||||||
'scheme_default' => 'Protocol-relatieve url’s proxyen',
|
|
||||||
'scheme_include' => 'http*:// in url opnemen',
|
|
||||||
'url_encode' => 'Url encoderen'
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
return array(
|
|
||||||
'imageproxy' => array(
|
|
||||||
'proxy_url' => 'Vekil Bağlantısı',
|
|
||||||
'scheme_http' => 'HTTP Vekil Sunucusu',
|
|
||||||
'scheme_https' => 'HTTPS Vekil Sunucusu',
|
|
||||||
'scheme_default' => 'Belirtilmemiş Vekil URL Şeması',
|
|
||||||
'scheme_include' => 'Bağlantıya http*:// ekle',
|
|
||||||
'url_encode' => 'Bağlantıyı kodla',
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
"name": "Image Proxy",
|
"name": "Image Proxy",
|
||||||
"author": "Frans de Jonge",
|
"author": "Frans de Jonge",
|
||||||
"description": "No insecure content warnings or disappearing images.",
|
"description": "No insecure content warnings or disappearing images.",
|
||||||
"version": "1.0",
|
"version": "0.7.2",
|
||||||
"entrypoint": "ImageProxy",
|
"entrypoint": "ImageProxy",
|
||||||
"type": "user"
|
"type": "user"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
<?php
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
final class FreshExtension_quickCollapse_Controller extends Minz_ActionController {
|
||||||
|
|
||||||
|
/** @var QuickCollapse\View */
|
||||||
|
protected $view;
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
parent::__construct(QuickCollapse\View::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function jsVarsAction(): void {
|
||||||
|
$extension = Minz_ExtensionManager::findExtension('Quick Collapse');
|
||||||
|
if ($extension !== null) {
|
||||||
|
$this->view->icon_url_in = $extension->getFileUrl('in.svg', 'svg');
|
||||||
|
$this->view->icon_url_out = $extension->getFileUrl('out.svg', 'svg');
|
||||||
|
}
|
||||||
|
$this->view->i18n_toggle_collapse = _t('gen.js.toggle_collapse');
|
||||||
|
$this->view->_layout(null);
|
||||||
|
$this->view->_path('quickCollapse/vars.js');
|
||||||
|
header('Content-Type: application/javascript');
|
||||||
|
}
|
||||||
|
}
|
||||||
12
xExtension-QuickCollapse/Models/View.php
Normal file
12
xExtension-QuickCollapse/Models/View.php
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace QuickCollapse;
|
||||||
|
|
||||||
|
final class View extends \Minz_View {
|
||||||
|
|
||||||
|
public string $icon_url_in = '';
|
||||||
|
public string $icon_url_out = '';
|
||||||
|
public string $i18n_toggle_collapse = '';
|
||||||
|
}
|
||||||
|
|
@ -6,6 +6,4 @@ To install this extension, you must upload this directory in your `./extensions`
|
||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
- 1.0 Refactored using the js_vars extension hook
|
|
||||||
- 0.2.2 Turkish language support added
|
|
||||||
- 0.1 initial version
|
- 0.1 initial version
|
||||||
|
|
|
||||||
|
|
@ -6,24 +6,11 @@ final class QuickCollapseExtension extends Minz_Extension {
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function init(): void {
|
public function init(): void {
|
||||||
$this->registerTranslates();
|
$this->registerTranslates();
|
||||||
$this->registerHook('js_vars', [$this, 'jsVars']);
|
$this->registerViews();
|
||||||
|
$this->registerController('quickCollapse');
|
||||||
|
|
||||||
Minz_View::appendStyle($this->getFileUrl('style.css'));
|
Minz_View::appendStyle($this->getFileUrl('style.css', 'css'));
|
||||||
Minz_View::appendScript($this->getFileUrl('script.js'), cond: false, defer: true, async: false);
|
Minz_View::appendScript(_url('quickCollapse', 'jsVars') ?: '', false, true, false);
|
||||||
}
|
Minz_View::appendScript($this->getFileUrl('script.js', 'js'), false, true, false);
|
||||||
|
|
||||||
/**
|
|
||||||
* @param array<string,mixed> $vars
|
|
||||||
* @return array<string,mixed>
|
|
||||||
*/
|
|
||||||
public function jsVars(array $vars): array {
|
|
||||||
$vars['quick_collapse'] = [
|
|
||||||
'icon_url_in' => $this->getFileUrl('in.svg'),
|
|
||||||
'icon_url_out' => $this->getFileUrl('out.svg'),
|
|
||||||
'i18n' => [
|
|
||||||
'toggle_collapse' => _t('gen.js.toggle_collapse'),
|
|
||||||
]
|
|
||||||
];
|
|
||||||
return $vars;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
return [
|
|
||||||
'js' => [
|
|
||||||
'toggle_collapse' => 'Daraltmayı değiştir',
|
|
||||||
],
|
|
||||||
];
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
"name": "Quick Collapse",
|
"name": "Quick Collapse",
|
||||||
"author": "romibi and Marien Fressinaud",
|
"author": "romibi and Marien Fressinaud",
|
||||||
"description": "Quickly change from folded to unfolded articles",
|
"description": "Quickly change from folded to unfolded articles",
|
||||||
"version": "1.0.2",
|
"version": "0.2.1",
|
||||||
"entrypoint": "QuickCollapse",
|
"entrypoint": "QuickCollapse",
|
||||||
"type": "user"
|
"type": "user"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* globals context */
|
/* globals context, quick_collapse_vars */
|
||||||
|
|
||||||
(function () {
|
(function () {
|
||||||
function toggleCollapse() {
|
function toggleCollapse() {
|
||||||
|
|
@ -26,15 +26,15 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function syncWithContext() {
|
function syncWithContext() {
|
||||||
if (!window.context) {
|
if (!window.context || !window.quick_collapse_vars) {
|
||||||
// The variables might not be available yet, so we need to wait for them.
|
// The variables might not be available yet, so we need to wait for them.
|
||||||
return setTimeout(syncWithContext, 10);
|
return setTimeout(syncWithContext, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
const toggleElem = document.getElementById('toggle-collapse');
|
const toggleElem = document.getElementById('toggle-collapse');
|
||||||
toggleElem.title = context.extensions.quick_collapse.i18n.toggle_collapse;
|
toggleElem.title = quick_collapse_vars.i18n.toggle_collapse;
|
||||||
toggleElem.innerHTML = `<img class="icon uncollapse" src="${context.extensions.quick_collapse.icon_url_out}" alt="↕" />`;
|
toggleElem.innerHTML = `<img class="icon uncollapse" src="${quick_collapse_vars.icon_url_out}" alt="↕" />`;
|
||||||
toggleElem.innerHTML += `<img class="icon collapse" src="${context.extensions.quick_collapse.icon_url_in}" alt="✖" />`;
|
toggleElem.innerHTML += `<img class="icon collapse" src="${quick_collapse_vars.icon_url_in}" alt="✖" />`;
|
||||||
|
|
||||||
if (context.hide_posts) {
|
if (context.hide_posts) {
|
||||||
toggleElem.classList.add('collapsed');
|
toggleElem.classList.add('collapsed');
|
||||||
|
|
|
||||||
10
xExtension-QuickCollapse/views/quickCollapse/vars.js
Normal file
10
xExtension-QuickCollapse/views/quickCollapse/vars.js
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
/* exported quick_collapse_vars */
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-unused-vars, no-var
|
||||||
|
var quick_collapse_vars = {
|
||||||
|
icon_url_in: '<?= $this->icon_url_in ?>',
|
||||||
|
icon_url_out: '<?= $this->icon_url_out ?>',
|
||||||
|
i18n: {
|
||||||
|
toggle_collapse: '<?= $this->i18n_toggle_collapse ?>',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2016 Lapineige, hkcomori
|
Copyright (c) 2016 Lapineige
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
Extension pour FreshRSS (<https://github.com/FreshRSS>)
|
Extension pour FreshRSS (<https://github.com/FreshRSS>)
|
||||||
|
|
||||||
> **v1.6**
|
> **v1.3**
|
||||||
|
|
||||||
|
Source: <https://framagit.org/Lapineige/FreshRSS_Extension-ReadingTime>
|
||||||
|
|
||||||
Ajoute une estimation du temps de lecture à côté de chaque article.
|
Ajoute une estimation du temps de lecture à côté de chaque article.
|
||||||
Fonctionne sur les affichages de bureau et mobile.
|
Fonctionne sur les affichages de bureau et mobile.
|
||||||
|
|
@ -9,13 +11,15 @@ S'installe comme toute les extensions, soit via l'outil intégré dans l'interfa
|
||||||
Aucune module externe. Une fois activée dans les préférences, l'extension doit fonctionner après avoir recharger la page.
|
Aucune module externe. Une fois activée dans les préférences, l'extension doit fonctionner après avoir recharger la page.
|
||||||
|
|
||||||
Un indicateur du temps de lecture doit s'afficher dans le nom du flux de chaque article.
|
Un indicateur du temps de lecture doit s'afficher dans le nom du flux de chaque article.
|
||||||
Vous pouvez définir la vitesse de lecture et la méthode de mesure du temps de lecture.
|
Pour le moment la vitesse de lecture est réglée manuellement à 300 mots/min. À changer si besoin ici: <https://framagit.org/Lapineige/FreshRSS_Extension-ReadingTime/blob/master/static/readingtime.js#L26>
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Extension for FressRSS (<https://github.com/FreshRSS>)
|
Extension for FressRSS (<https://github.com/FreshRSS>)
|
||||||
|
|
||||||
> **v1.6**
|
> **v1.3**
|
||||||
|
|
||||||
|
Source: <https://framagit.org/Lapineige/FreshRSS_Extension-ReadingTime>
|
||||||
|
|
||||||
Add a reading time estimation next to each article.
|
Add a reading time estimation next to each article.
|
||||||
Works on both desktop and mobile displays.
|
Works on both desktop and mobile displays.
|
||||||
|
|
@ -23,4 +27,6 @@ Works on both desktop and mobile displays.
|
||||||
Install it the same way as any other extension, with the integrated tool in the interface (parameters icon -> extensions) or manually by copying this repository directly in the `extensions` folder of your FreshRSS install.
|
Install it the same way as any other extension, with the integrated tool in the interface (parameters icon -> extensions) or manually by copying this repository directly in the `extensions` folder of your FreshRSS install.
|
||||||
No external module. Once activated in the preferences, this extension should be working after reloading the page.
|
No external module. Once activated in the preferences, this extension should be working after reloading the page.
|
||||||
|
|
||||||
You can set reading speed and source metrics to estimate reading time.
|
A reading time
|
||||||
|
For the moment the reading speed is manually set to 300 words/min. If necessary, change it there: <https://framagit.org/Lapineige/FreshRSS_Extension-ReadingTime/blob/master/static/readingtime.js#L26>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
<?php
|
|
||||||
declare(strict_types=1);
|
|
||||||
/** @var ReadingTimeExtension $this */
|
|
||||||
?>
|
|
||||||
<form action="<?= _url('extension', 'configure', 'e', urlencode($this->getName())) ?>" method="post">
|
|
||||||
<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="group-name" for="reading_time_speed"><?= _t('ext.reading_time.speed.label') ?></label>
|
|
||||||
<div class="group-controls">
|
|
||||||
<input type="number" id="reading_time_speed" name="reading_time_speed" value="<?= $this->getSpeed() ?>" min="1">
|
|
||||||
<p class="help"><?= _i('help') ?> <?= _t('ext.reading_time.speed.help') ?></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<label class="group-name" for="reading_time_speed"><?= _t('ext.reading_time.metrics.label') ?></label>
|
|
||||||
<div class="group-controls">
|
|
||||||
<select name="reading_time_metrics" id="reading_time_metrics" data-leave-validation="<?= $this->getMetrics() ?>">
|
|
||||||
<option value="words"<?= $this->getMetrics() === 'words' ? ' selected="selected"' : '' ?>><?= _t('ext.reading_time.metrics.words') ?></option>
|
|
||||||
<option value="letters"<?= $this->getMetrics() === 'letters' ? ' selected="selected"' : '' ?>><?= _t('ext.reading_time.metrics.letters') ?></option>
|
|
||||||
</select>
|
|
||||||
<p class="help"><?= _i('help') ?> <?= _t('ext.reading_time.metrics.help') ?></p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group form-actions">
|
|
||||||
<div class="group-controls">
|
|
||||||
<button type="submit" class="btn btn-important"><?= _t('gen.action.submit') ?></button>
|
|
||||||
<button type="reset" class="btn"><?= _t('gen.action.cancel') ?></button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
|
|
@ -3,94 +3,8 @@
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
final class ReadingTimeExtension extends Minz_Extension {
|
final class ReadingTimeExtension extends Minz_Extension {
|
||||||
private int $speed = 300;
|
|
||||||
private string $metrics = 'words';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @throws FreshRSS_Context_Exception
|
|
||||||
*/
|
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function init(): void {
|
public function init(): void {
|
||||||
$this->registerTranslates();
|
Minz_View::appendScript($this->getFileUrl('readingtime.js', 'js'));
|
||||||
if (!FreshRSS_Context::hasUserConf()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// Defaults
|
|
||||||
$speed = FreshRSS_Context::userConf()->attributeInt('reading_time_speed');
|
|
||||||
if ($speed === null) {
|
|
||||||
FreshRSS_Context::userConf()->_attribute('reading_time_speed', $this->speed);
|
|
||||||
} else {
|
|
||||||
$this->speed = $speed;
|
|
||||||
}
|
|
||||||
$metrics = FreshRSS_Context::userConf()->attributeString('reading_time_metrics');
|
|
||||||
if ($metrics === null) {
|
|
||||||
FreshRSS_Context::userConf()->_attribute('reading_time_metrics', $this->metrics);
|
|
||||||
} else {
|
|
||||||
$this->metrics = $metrics;
|
|
||||||
}
|
|
||||||
if (in_array(null, [$speed, $metrics], true)) {
|
|
||||||
FreshRSS_Context::userConf()->save();
|
|
||||||
}
|
|
||||||
$this->registerHook('js_vars', [$this, 'getParams']);
|
|
||||||
Minz_View::appendScript($this->getFileUrl('readingtime.js'));
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getSpeed(): int {
|
|
||||||
return $this->speed;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getMetrics(): string {
|
|
||||||
return $this->metrics;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called from js_vars hook
|
|
||||||
*
|
|
||||||
* Pass dynamic parameters to readingtime.js via `window.context.extensions`.
|
|
||||||
* Chain with other js_vars hooks via $vars.
|
|
||||||
*
|
|
||||||
* @param array<mixed> $vars is the result of hooks chained in the previous step.
|
|
||||||
* @return array<mixed> is passed to the hook chained to the next step.
|
|
||||||
*/
|
|
||||||
public function getParams(array $vars): array {
|
|
||||||
$vars['reading_time_speed'] = $this->speed;
|
|
||||||
$vars['reading_time_metrics'] = $this->metrics;
|
|
||||||
return $vars;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @throws FreshRSS_Context_Exception
|
|
||||||
* @throws Minz_ConfigurationParamException
|
|
||||||
*/
|
|
||||||
#[\Override]
|
|
||||||
public function handleConfigureAction(): void {
|
|
||||||
$this->registerTranslates();
|
|
||||||
|
|
||||||
if (Minz_Request::isPost()) {
|
|
||||||
$speed = $this->validateSpeed(Minz_Request::paramInt('reading_time_speed'));
|
|
||||||
FreshRSS_Context::userConf()->_attribute('reading_time_speed', $speed);
|
|
||||||
$metrics = $this->validateMetrics(Minz_Request::paramString('reading_time_metrics'));
|
|
||||||
FreshRSS_Context::userConf()->_attribute('reading_time_metrics', $metrics);
|
|
||||||
FreshRSS_Context::userConf()->save();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @throws Minz_ConfigurationParamException */
|
|
||||||
private function validateSpeed(int $speed): int {
|
|
||||||
if ($speed <= 0) {
|
|
||||||
throw new Minz_ConfigurationParamException('Reading speed must be greater than 0');
|
|
||||||
}
|
|
||||||
return $speed;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @throws Minz_ConfigurationParamException */
|
|
||||||
private function validateMetrics(string $metrics): string {
|
|
||||||
switch ($metrics) {
|
|
||||||
case 'words':
|
|
||||||
case 'letters':
|
|
||||||
return $metrics;
|
|
||||||
default:
|
|
||||||
throw new Minz_ConfigurationParamException('Unsupported source metrics');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
return array(
|
|
||||||
'reading_time' => array(
|
|
||||||
'speed' => array(
|
|
||||||
'label' => 'Reading speed',
|
|
||||||
'help' => 'Conversion factor to reading time from metrics',
|
|
||||||
),
|
|
||||||
'metrics' => array(
|
|
||||||
'label' => 'Source metrics',
|
|
||||||
'help' => 'Source of reading time calculation',
|
|
||||||
'words' => 'Number of words',
|
|
||||||
'letters' => 'Number of letters',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
return array(
|
|
||||||
'reading_time' => array(
|
|
||||||
'speed' => array(
|
|
||||||
'label' => 'Vitesse de lecture',
|
|
||||||
'help' => 'Paramètre de calcul, dépendant de la méthode',
|
|
||||||
),
|
|
||||||
'metrics' => array(
|
|
||||||
'label' => 'Méthodes',
|
|
||||||
'help' => 'Méthode de calcul du temps de lecture',
|
|
||||||
'words' => 'Nombre de mots',
|
|
||||||
'letters' => 'Nombre de lettres',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
return array(
|
|
||||||
'reading_time' => array(
|
|
||||||
'speed' => array(
|
|
||||||
'label' => '読書速度',
|
|
||||||
'help' => '基準値を読書時間に変換する係数',
|
|
||||||
),
|
|
||||||
'metrics' => array(
|
|
||||||
'label' => '基準値',
|
|
||||||
'help' => '読書時間を推定する基準値',
|
|
||||||
'words' => '単語数',
|
|
||||||
'letters' => '文字数',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
{
|
{
|
||||||
"name": "ReadingTime",
|
"name": "ReadingTime",
|
||||||
"author": "Lapineige, hkcomori",
|
"author": "Lapineige",
|
||||||
"description": "Add a reading time estimation next to each article",
|
"description": "Add a reading time estimation next to each article",
|
||||||
"version": "1.6.1",
|
"version": "1.5.1",
|
||||||
"entrypoint": "ReadingTime",
|
"entrypoint": "ReadingTime",
|
||||||
"type": "user"
|
"type": "user"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,15 +5,12 @@
|
||||||
flux_list: null,
|
flux_list: null,
|
||||||
flux: null,
|
flux: null,
|
||||||
textContent: null,
|
textContent: null,
|
||||||
count: null,
|
words_count: null,
|
||||||
read_time: null,
|
read_time: null,
|
||||||
reading_time: null,
|
reading_time: null,
|
||||||
|
|
||||||
init: function () {
|
init: function () {
|
||||||
const flux_list = document.querySelectorAll('[id^="flux_"]');
|
const flux_list = document.querySelectorAll('[id^="flux_"]');
|
||||||
const speed = window.context.extensions.reading_time_speed;
|
|
||||||
const metrics = window.context.extensions.reading_time_metrics;
|
|
||||||
const language = window.context.i18n.language;
|
|
||||||
|
|
||||||
for (let i = 0; i < flux_list.length; i++) {
|
for (let i = 0; i < flux_list.length; i++) {
|
||||||
if ('readingTime' in flux_list[i].dataset) {
|
if ('readingTime' in flux_list[i].dataset) {
|
||||||
|
|
@ -22,12 +19,9 @@
|
||||||
|
|
||||||
reading_time.flux = flux_list[i];
|
reading_time.flux = flux_list[i];
|
||||||
|
|
||||||
if (metrics == 'letters') {
|
reading_time.words_count = reading_time.flux_words_count(flux_list[i]); // count the words
|
||||||
reading_time.count = reading_time.flux_letters_count(flux_list[i], language);
|
// change this number (in words) to your preferred reading speed:
|
||||||
} else { // words
|
reading_time.reading_time = reading_time.calc_read_time(reading_time.words_count, 300);
|
||||||
reading_time.count = reading_time.flux_words_count(flux_list[i]);
|
|
||||||
}
|
|
||||||
reading_time.reading_time = reading_time.calc_read_time(reading_time.count, speed);
|
|
||||||
|
|
||||||
flux_list[i].dataset.readingTime = reading_time.reading_time;
|
flux_list[i].dataset.readingTime = reading_time.reading_time;
|
||||||
|
|
||||||
|
|
@ -56,20 +50,8 @@
|
||||||
return reading_time.textContent.split(' ').length;
|
return reading_time.textContent.split(' ').length;
|
||||||
},
|
},
|
||||||
|
|
||||||
flux_letters_count: function flux_letters_count(flux, language) {
|
calc_read_time: function calc_read_time(wd_count, speed) {
|
||||||
const segmenter = new Intl.Segmenter(language, { granularity: 'grapheme' });
|
reading_time.read_time = Math.round(wd_count / speed);
|
||||||
|
|
||||||
// get textContent, from the article itself (not the header, not the bottom line):
|
|
||||||
reading_time.textContent = flux.querySelector('.flux_content .content').textContent;
|
|
||||||
|
|
||||||
// clean the text by removing excessive whitespace
|
|
||||||
reading_time.textContent = reading_time.textContent.replace(/\s/gi, ''); // exclude white-space
|
|
||||||
|
|
||||||
return [...segmenter.segment(reading_time.textContent)].length;
|
|
||||||
},
|
|
||||||
|
|
||||||
calc_read_time: function calc_read_time(count, speed) {
|
|
||||||
reading_time.read_time = Math.round(count / speed);
|
|
||||||
|
|
||||||
if (reading_time.read_time === 0) {
|
if (reading_time.read_time === 0) {
|
||||||
reading_time.read_time = '<1';
|
reading_time.read_time = '<1';
|
||||||
|
|
@ -84,15 +66,11 @@
|
||||||
document.body.addEventListener('freshrss:load-more', function (e) {
|
document.body.addEventListener('freshrss:load-more', function (e) {
|
||||||
reading_time.init();
|
reading_time.init();
|
||||||
});
|
});
|
||||||
|
|
||||||
if (window.console) {
|
|
||||||
console.log('ReadingTime init done.');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof window.context !== 'undefined' && typeof window.context.extensions !== 'undefined') {
|
if (document.readyState && document.readyState !== 'loading') {
|
||||||
add_load_more_listener();
|
add_load_more_listener();
|
||||||
} else {
|
} else if (document.addEventListener) {
|
||||||
document.addEventListener('freshrss:globalContextLoaded', add_load_more_listener, false);
|
document.addEventListener('DOMContentLoaded', add_load_more_listener, false);
|
||||||
}
|
}
|
||||||
}());
|
}());
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,7 @@ declare(strict_types=1);
|
||||||
final class FreshExtension_shareByEmail_Controller extends Minz_ActionController {
|
final class FreshExtension_shareByEmail_Controller extends Minz_ActionController {
|
||||||
public ?Minz_Extension $extension;
|
public ?Minz_Extension $extension;
|
||||||
|
|
||||||
/**
|
/** @var ShareByEmail\mailers\View */
|
||||||
* @var ShareByEmail\mailers\View
|
|
||||||
* @phpstan-ignore property.phpDocType
|
|
||||||
*/
|
|
||||||
protected $view;
|
protected $view;
|
||||||
|
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
|
|
@ -20,12 +17,6 @@ final class FreshExtension_shareByEmail_Controller extends Minz_ActionController
|
||||||
$this->extension = Minz_ExtensionManager::findExtension('Share By Email');
|
$this->extension = Minz_ExtensionManager::findExtension('Share By Email');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @throws FreshRSS_Context_Exception
|
|
||||||
* @throws Minz_ConfigurationException
|
|
||||||
* @throws Minz_ConfigurationNamespaceException
|
|
||||||
* @throws Minz_PDOConnectionException
|
|
||||||
*/
|
|
||||||
public function shareAction(): void {
|
public function shareAction(): void {
|
||||||
if (!FreshRSS_Auth::hasAccess()) {
|
if (!FreshRSS_Auth::hasAccess()) {
|
||||||
Minz_Error::error(403);
|
Minz_Error::error(403);
|
||||||
|
|
@ -54,7 +45,7 @@ final class FreshExtension_shareByEmail_Controller extends Minz_ActionController
|
||||||
|
|
||||||
Minz_View::prependTitle(_t('shareByEmail.share.title') . ' · ');
|
Minz_View::prependTitle(_t('shareByEmail.share.title') . ' · ');
|
||||||
if ($this->extension !== null) {
|
if ($this->extension !== null) {
|
||||||
Minz_View::appendStyle($this->extension->getFileUrl('shareByEmail.css'));
|
Minz_View::appendStyle($this->extension->getFileUrl('shareByEmail.css', 'css'));
|
||||||
}
|
}
|
||||||
$this->view->_layout('simple');
|
$this->view->_layout('simple');
|
||||||
$this->view->to = '';
|
$this->view->to = '';
|
||||||
|
|
|
||||||
|
|
@ -2,19 +2,10 @@
|
||||||
|
|
||||||
This FreshRSS extension allows to share articles by email, in a more powerful way than the simple `mailto` solution.
|
This FreshRSS extension allows to share articles by email, in a more powerful way than the simple `mailto` solution.
|
||||||
|
|
||||||
## How to install
|
|
||||||
|
|
||||||
To install this extension, you must upload this directory in your `./extensions` directory and enable it on the extension panel in FreshRSS.
|
To install this extension, you must upload this directory in your `./extensions` directory and enable it on the extension panel in FreshRSS.
|
||||||
|
|
||||||
## How to configure
|
You’ll have to configure the mailing system in FreshRSS. [See the documentation](https://freshrss.github.io/FreshRSS/en/admins/05_Configuring_email_validation.html#configure-the-smtp-server)
|
||||||
|
|
||||||
After the installation the `Email` sharing service will added to the list of available sharing services. You need to add the `Email` sharing service to your individual sharing service list before it is available in the sharing menu.
|
|
||||||
|
|
||||||
You will have to configure the mailing system in FreshRSS. [See the documentation](https://freshrss.github.io/FreshRSS/en/admins/05_Configuring_email_validation.html#configure-the-smtp-server)
|
|
||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
- 0.3.2 With the new feature, Turkish language deficiencies have been corrected.
|
|
||||||
- 0.3.0 detail information about the mail system shown in the extension config
|
|
||||||
- 0.2.3 Turkish language support added
|
|
||||||
- 0.1 initial version
|
- 0.1 initial version
|
||||||
|
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
<?php
|
|
||||||
declare(strict_types=1);
|
|
||||||
?>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="group-name" for="words_list">
|
|
||||||
<?= _t('shareByEmail.share.manage.mailer') ?>
|
|
||||||
</label>
|
|
||||||
<div class="group-controls">
|
|
||||||
<?= match (FreshRSS_Context::systemConf()->mailer) {
|
|
||||||
'mail' => _t('shareByEmail.share.manage.mail'),
|
|
||||||
'smtp' => _t('shareByEmail.share.manage.smtp', FreshRSS_Context::systemConf()->smtp['from']),
|
|
||||||
default => _t('shareByEmail.share.manage.error')
|
|
||||||
} ?>
|
|
||||||
<p class="help"><?= _i('help') ?> <?= _t('shareByEmail.share.manage.help') ?></a></p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
@ -4,9 +4,6 @@ declare(strict_types=1);
|
||||||
|
|
||||||
final class ShareByEmailExtension extends Minz_Extension {
|
final class ShareByEmailExtension extends Minz_Extension {
|
||||||
|
|
||||||
/**
|
|
||||||
* @throws Minz_ConfigurationException
|
|
||||||
*/
|
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function init(): void {
|
public function init(): void {
|
||||||
$this->registerTranslates();
|
$this->registerTranslates();
|
||||||
|
|
|
||||||
|
|
@ -18,12 +18,5 @@ return [
|
||||||
],
|
],
|
||||||
'intro' => 'Diesen Artikel per Mail versenden: “<strong>%s</strong>”',
|
'intro' => 'Diesen Artikel per Mail versenden: “<strong>%s</strong>”',
|
||||||
'title' => 'Einen Artikel per Mail teilen.',
|
'title' => 'Einen Artikel per Mail teilen.',
|
||||||
'manage' => [
|
|
||||||
'mailer' => 'E-Mail-Versand',
|
|
||||||
'mail' => 'via PHP <code>mail()</code>',
|
|
||||||
'smtp' => 'via SMTP (versendet von %s)',
|
|
||||||
'error' => 'Fehler',
|
|
||||||
'help' => 'Versand zwischen PHP <code>mail()</code> und SMTP in <kbd>config.php</kbd> wechseln: siehe <a href="https://freshrss.github.io/FreshRSS/en/admins/05_Configuring_email_validation.html#configure-the-smtp-server" target="_blank">Dokumentation</a>',
|
|
||||||
]
|
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -18,12 +18,5 @@ return [
|
||||||
],
|
],
|
||||||
'intro' => 'You are about to share this article by email: “<strong>%s</strong>”',
|
'intro' => 'You are about to share this article by email: “<strong>%s</strong>”',
|
||||||
'title' => 'Share an article by email',
|
'title' => 'Share an article by email',
|
||||||
'manage' => [
|
|
||||||
'mailer' => 'Mailing system',
|
|
||||||
'mail' => 'PHP <code>mail()</code>',
|
|
||||||
'smtp' => 'SMTP (send from %s)',
|
|
||||||
'error' => 'Error',
|
|
||||||
'help' => 'Switch PHP <code>mail()</code>/SMTP connection in <kbd>config.php</kbd>: see <a href="https://freshrss.github.io/FreshRSS/en/admins/05_Configuring_email_validation.html#configure-the-smtp-server" target="_blank">documentation</a>'
|
|
||||||
],
|
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -18,12 +18,5 @@ return [
|
||||||
],
|
],
|
||||||
'intro' => 'Vous êtes sur le point de partager cet article par courriel : « <strong>%s</strong> »',
|
'intro' => 'Vous êtes sur le point de partager cet article par courriel : « <strong>%s</strong> »',
|
||||||
'title' => 'Partager un article par courriel',
|
'title' => 'Partager un article par courriel',
|
||||||
'manage' => [
|
|
||||||
'mailer' => 'Système de messagerie',
|
|
||||||
'mail' => 'PHP <code>mail()</code>',
|
|
||||||
'smtp' => 'SMTP (envoyer en tant que %s)',
|
|
||||||
'error' => 'Erreur',
|
|
||||||
'help' => 'Éditer les paramètres SMTP ou PHP <code>mail()</code> dans <kbd>config.php</kbd> : voir <a href="https://freshrss.github.io/FreshRSS/en/admins/05_Configuring_email_validation.html#configure-the-smtp-server" target="_blank">la documentation</a>',
|
|
||||||
]
|
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
return [
|
|
||||||
'share' => [
|
|
||||||
'feedback' => [
|
|
||||||
'failed' => 'E-posta gönderilemiyor, lütfen yöneticinizle iletişime geçin.',
|
|
||||||
'fields_required' => 'Tüm alanların doldurulması zorunludur.',
|
|
||||||
'sent' => 'E-posta gönderildi.',
|
|
||||||
],
|
|
||||||
'form' => [
|
|
||||||
'cancel' => 'İptal',
|
|
||||||
'content' => 'İçerik',
|
|
||||||
'content_default' => "Merhaba,\n\nBu makaleyi oldukça ilginç bulabilirsiniz!\n\n%s – %s\n\n---\n\nBu e-posta %s tarafından %s ( %s ) aracılığıyla gönderildi",
|
|
||||||
'send' => 'Gönder',
|
|
||||||
'subject' => 'Konu',
|
|
||||||
'subject_default' => 'Bu makaleyi ilginç buldum!',
|
|
||||||
'to' => 'Kime',
|
|
||||||
],
|
|
||||||
'intro' => 'Bu makaleyi e-posta yoluyla paylaşmak üzeresiniz: “<strong>%s</strong>”',
|
|
||||||
'title' => 'Bir makaleyi e-posta ile paylaşın',
|
|
||||||
'manage' => [
|
|
||||||
'mailer' => 'Mail sistemi',
|
|
||||||
'mail' => 'PHP <code>mail()</code>',
|
|
||||||
'smtp' => 'SMTP (%s kaynağından gönder)',
|
|
||||||
'error' => 'Hata',
|
|
||||||
'help' => '<kbd>config.php</kbd> dosyasındaki PHP <code>mail()</code>/SMTP bağlantısını değiştirin: <a href="https://freshrss.github.io/FreshRSS/en/admins/05_Configuring_email_validation.html#configure-the-smtp-server" target="_blank">belgelere</a> bakın',
|
|
||||||
]
|
|
||||||
],
|
|
||||||
];
|
|
||||||
|
|
@ -6,19 +6,13 @@ namespace ShareByEmail\mailers;
|
||||||
|
|
||||||
final class Share extends \Minz_Mailer {
|
final class Share extends \Minz_Mailer {
|
||||||
|
|
||||||
/**
|
/** @var View */
|
||||||
* @var View
|
|
||||||
* @phpstan-ignore property.phpDocType
|
|
||||||
*/
|
|
||||||
protected $view;
|
protected $view;
|
||||||
|
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
parent::__construct(View::class);
|
parent::__construct(View::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @throws \FreshRSS_Context_Exception
|
|
||||||
*/
|
|
||||||
public function send_article(string $to, string $subject, string $content): bool {
|
public function send_article(string $to, string $subject, string $content): bool {
|
||||||
$this->view->_path('share_mailer/article.txt.php');
|
$this->view->_path('share_mailer/article.txt.php');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
{
|
{
|
||||||
"name": "Share By Email",
|
"name": "Share By Email",
|
||||||
"author": "Marien Fressinaud",
|
"author": "Marien Fressinaud",
|
||||||
"description": "Improve the sharing by email system.",
|
"description": "Improve the sharing by email system.",
|
||||||
"version": "0.3.3",
|
"version": "0.2.2",
|
||||||
"entrypoint": "ShareByEmail",
|
"entrypoint": "ShareByEmail",
|
||||||
"type": "user"
|
"type": "user"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,75 +3,75 @@
|
||||||
/** @var ShareByEmail\mailers\View $this */
|
/** @var ShareByEmail\mailers\View $this */
|
||||||
?>
|
?>
|
||||||
<div class="post">
|
<div class="post">
|
||||||
<h1><?= _t('shareByEmail.share.title') ?></h1>
|
<h1><?= _t('shareByEmail.share.title') ?></h1>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<?= _t('shareByEmail.share.intro', isset($this->entry) ? $this->entry->title() : '') ?>
|
<?= _t('shareByEmail.share.intro', isset($this->entry) ? $this->entry->title() : '') ?>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<form class="sbe-form-share" method="POST">
|
<form class="sbe-form-share" method="POST">
|
||||||
<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
|
<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="group-name" for="to">
|
<label class="group-name" for="to">
|
||||||
<?= _t('shareByEmail.share.form.to') ?>
|
<?= _t('shareByEmail.share.form.to') ?>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<div class="group-controls">
|
<div class="group-controls">
|
||||||
<input
|
<input
|
||||||
type="email"
|
type="email"
|
||||||
name="to"
|
name="to"
|
||||||
id="to"
|
id="to"
|
||||||
class="long"
|
class="long"
|
||||||
placeholder="alice@example.net"
|
placeholder="camille@dupuis-morizeau.com"
|
||||||
required="required"
|
required
|
||||||
autofocus="autofocus"
|
autofocus
|
||||||
value="<?= $this->to ?>"
|
value="<?= $this->to ?>"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="group-name" for="subject">
|
<label class="group-name" for="subject">
|
||||||
<?= _t('shareByEmail.share.form.subject') ?>
|
<?= _t('shareByEmail.share.form.subject') ?>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<div class="group-controls">
|
<div class="group-controls">
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
name="subject"
|
name="subject"
|
||||||
id="subject"
|
id="subject"
|
||||||
class="long"
|
class="long"
|
||||||
required="required"
|
required
|
||||||
value="<?= $this->subject ?>"
|
value="<?= $this->subject ?>"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="group-name" for="content">
|
<label class="group-name" for="content">
|
||||||
<?= _t('shareByEmail.share.form.content') ?>
|
<?= _t('shareByEmail.share.form.content') ?>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<div class="group-controls">
|
<div class="group-controls">
|
||||||
<textarea
|
<textarea
|
||||||
name="content"
|
name="content"
|
||||||
id="content"
|
id="content"
|
||||||
required="required"
|
required
|
||||||
><?= $this->content ?></textarea>
|
><?= $this->content ?></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group form-actions">
|
<div class="form-group form-actions">
|
||||||
<div class="group-controls">
|
<div class="group-controls">
|
||||||
<button type="submit" class="btn btn-important">
|
<button type="submit" class="btn btn-important">
|
||||||
<?= _t('shareByEmail.share.form.send') ?>
|
<?= _t('shareByEmail.share.form.send') ?>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<a class="btn" href="<?= _url('index', 'index') ?>">
|
<a class="btn" href="<?= _url('index', 'index') ?>">
|
||||||
<?= _t('shareByEmail.share.form.cancel') ?>
|
<?= _t('shareByEmail.share.form.cancel') ?>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||||
final class StickyFeedsExtension extends Minz_Extension {
|
final class StickyFeedsExtension extends Minz_Extension {
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function init(): void {
|
public function init(): void {
|
||||||
Minz_View::appendStyle($this->getFileUrl('style.css'));
|
Minz_View::appendStyle($this->getFileUrl('style.css', 'css'));
|
||||||
Minz_View::appendScript($this->getFileUrl('script.js'));
|
Minz_View::appendScript($this->getFileUrl('script.js', 'js'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
"name": "Sticky Feeds",
|
"name": "Sticky Feeds",
|
||||||
"author": "Marien Fressinaud",
|
"author": "Marien Fressinaud",
|
||||||
"description": "Set the feed aside in the main stream following the window scroll.",
|
"description": "Set the feed aside in the main stream following the window scroll.",
|
||||||
"version": "0.2.2",
|
"version": "0.2.1",
|
||||||
"entrypoint": "StickyFeeds",
|
"entrypoint": "StickyFeeds",
|
||||||
"type": "user"
|
"type": "user"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
662
xExtension-TTRSS_API/LICENSE
Normal file
662
xExtension-TTRSS_API/LICENSE
Normal file
|
|
@ -0,0 +1,662 @@
|
||||||
|
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 19 November 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The GNU Affero General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works, specifically designed to ensure
|
||||||
|
cooperation with the community in the case of network server software.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
our General Public Licenses are intended to guarantee your freedom to
|
||||||
|
share and change all versions of a program--to make sure it remains free
|
||||||
|
software for all its users.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
Developers that use our General Public Licenses protect your rights
|
||||||
|
with two steps: (1) assert copyright on the software, and (2) offer
|
||||||
|
you this License which gives you legal permission to copy, distribute
|
||||||
|
and/or modify the software.
|
||||||
|
|
||||||
|
A secondary benefit of defending all users' freedom is that
|
||||||
|
improvements made in alternate versions of the program, if they
|
||||||
|
receive widespread use, become available for other developers to
|
||||||
|
incorporate. Many developers of free software are heartened and
|
||||||
|
encouraged by the resulting cooperation. However, in the case of
|
||||||
|
software used on network servers, this result may fail to come about.
|
||||||
|
The GNU General Public License permits making a modified version and
|
||||||
|
letting the public access it on a server without ever releasing its
|
||||||
|
source code to the public.
|
||||||
|
|
||||||
|
The GNU Affero General Public License is designed specifically to
|
||||||
|
ensure that, in such cases, the modified source code becomes available
|
||||||
|
to the community. It requires the operator of a network server to
|
||||||
|
provide the source code of the modified version running there to the
|
||||||
|
users of that server. Therefore, public use of a modified version, on
|
||||||
|
a publicly accessible server, gives the public access to the source
|
||||||
|
code of the modified version.
|
||||||
|
|
||||||
|
An older license, called the Affero General Public License and
|
||||||
|
published by Affero, was designed to accomplish similar goals. This is
|
||||||
|
a different license, not a version of the Affero GPL, but Affero has
|
||||||
|
released a new version of the Affero GPL which permits relicensing under
|
||||||
|
this license.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
0. Definitions.
|
||||||
|
|
||||||
|
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||||
|
|
||||||
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
|
"recipients" may be individuals or organizations.
|
||||||
|
|
||||||
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
|
A "covered work" means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To "propagate" a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To "convey" a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
|
to the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
1. Source Code.
|
||||||
|
|
||||||
|
The "source code" for a work means the preferred form of the work
|
||||||
|
for making modifications to it. "Object code" means any non-source
|
||||||
|
form of a work.
|
||||||
|
|
||||||
|
A "Standard Interface" means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The "System Libraries" of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The "Corresponding Source" for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users
|
||||||
|
can regenerate automatically from other parts of the Corresponding
|
||||||
|
Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that
|
||||||
|
same work.
|
||||||
|
|
||||||
|
2. Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
|
the Program, the only way you could satisfy both those terms and this
|
||||||
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, if you modify the
|
||||||
|
Program, your modified version must prominently offer all users
|
||||||
|
interacting with it remotely through a computer network (if your version
|
||||||
|
supports such interaction) an opportunity to receive the Corresponding
|
||||||
|
Source of your version by providing access to the Corresponding Source
|
||||||
|
from a network server at no charge, through some standard or customary
|
||||||
|
means of facilitating copying of software. This Corresponding Source
|
||||||
|
shall include the Corresponding Source for any work covered by version 3
|
||||||
|
of the GNU General Public License that is incorporated pursuant to the
|
||||||
|
following paragraph.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the work with which it is combined will remain governed by version
|
||||||
|
3 of the GNU General Public License.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU Affero General Public License from time to time. Such new versions
|
||||||
|
will be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Program specifies that a certain numbered version of the GNU Affero General
|
||||||
|
Public License "or any later version" applies to it, you have the
|
||||||
|
option of following the terms and conditions either of that numbered
|
||||||
|
version or of any later version published by the Free Software
|
||||||
|
Foundation. If the Program does not specify a version number of the
|
||||||
|
GNU Affero General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future
|
||||||
|
versions of the GNU Affero General Public License can be used, that proxy's
|
||||||
|
public statement of acceptance of a version permanently authorizes you
|
||||||
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
15. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||||
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||||
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||||
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||||
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||||
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
state the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If your software can interact with users remotely through a computer
|
||||||
|
network, you should also make sure that it provides a way for users to
|
||||||
|
get its source. For example, if your program is a web application, its
|
||||||
|
interface could display a "Source" link that leads users to an archive
|
||||||
|
of the code. There are many ways you could offer source, and different
|
||||||
|
solutions will be better for different programs; see section 13 for the
|
||||||
|
specific requirements.
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||||
|
<http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
11
xExtension-TTRSS_API/README.md
Normal file
11
xExtension-TTRSS_API/README.md
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
# TinyTinyRSS API extension
|
||||||
|
|
||||||
|
This extension provides a TTRSS-compliant API. It means with this extension you can use applications made for TTRSS initially.
|
||||||
|
|
||||||
|
Note the API is NOT FULLY SUPPORTED YET!
|
||||||
|
|
||||||
|
Please be sure to enable API in the configuration and set an API password on your profile.
|
||||||
|
|
||||||
|
URL to use is something like <http://rss.example.com/api/ttrss.php> or <http://example.com/freshrss/p/api/ttrss.php>.
|
||||||
|
|
||||||
|
To use it, upload this directory in your `./extensions` directory and enable it on the extension panel in FreshRSS.
|
||||||
58
xExtension-TTRSS_API/extension.php
Normal file
58
xExtension-TTRSS_API/extension.php
Normal file
|
|
@ -0,0 +1,58 @@
|
||||||
|
<?php
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
final class TTRSS_APIExtension extends Minz_Extension {
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
|
public function init(): void {
|
||||||
|
$this->registerHook('post_update', [$this, 'postUpdateHook']);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
|
public function install() {
|
||||||
|
$filename = 'ttrss.php';
|
||||||
|
$file_source = join_path($this->getPath(), $filename);
|
||||||
|
$path_destination = join_path(PUBLIC_PATH, 'api');
|
||||||
|
$file_destination = join_path($path_destination, $filename);
|
||||||
|
|
||||||
|
if (!is_writable($path_destination)) {
|
||||||
|
return 'server cannot write in ' . $path_destination;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (file_exists($file_destination)) {
|
||||||
|
if (!unlink($file_destination)) {
|
||||||
|
return 'API file seems already existing but cannot be removed';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!file_exists($file_source)) {
|
||||||
|
return 'API file seems not existing in this extension. Try to download it again.';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!copy($file_source, $file_destination)) {
|
||||||
|
return 'the API file has failed during installation.';
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
|
public function uninstall() {
|
||||||
|
$filename = 'ttrss.php';
|
||||||
|
$file_destination = join_path(PUBLIC_PATH, 'api', $filename);
|
||||||
|
|
||||||
|
if (file_exists($file_destination) && !unlink($file_destination)) {
|
||||||
|
return 'API file cannot be removed';
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function postUpdateHook(): void {
|
||||||
|
$res = $this->install();
|
||||||
|
|
||||||
|
if ($res !== true) {
|
||||||
|
Minz_Log::warning('Problem during TTRSS API extension post update: ' . $res);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
8
xExtension-TTRSS_API/metadata.json
Normal file
8
xExtension-TTRSS_API/metadata.json
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"name": "TinyTinyRSS API",
|
||||||
|
"author": "Marien Fressinaud",
|
||||||
|
"description": "Provides an API compliant with TinyTinyRSS applications.",
|
||||||
|
"version": "0.1",
|
||||||
|
"entrypoint": "TTRSS_API",
|
||||||
|
"type": "system"
|
||||||
|
}
|
||||||
537
xExtension-TTRSS_API/ttrss.php
Normal file
537
xExtension-TTRSS_API/ttrss.php
Normal file
|
|
@ -0,0 +1,537 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
require('../../constants.php');
|
||||||
|
require(LIB_PATH . '/lib_rss.php'); // Includes class autoloader
|
||||||
|
|
||||||
|
|
||||||
|
final class MyPDO extends Minz_ModelPdo {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
final class FreshAPI_TTRSS {
|
||||||
|
const API_LEVEL = 11;
|
||||||
|
|
||||||
|
const STATUS_OK = 0;
|
||||||
|
const STATUS_ERR = 1;
|
||||||
|
|
||||||
|
private $seq = 0;
|
||||||
|
private $user = '';
|
||||||
|
private $method = 'index';
|
||||||
|
private $params = array();
|
||||||
|
private $system_conf = null;
|
||||||
|
private $user_conf = null;
|
||||||
|
|
||||||
|
public function __construct($params) {
|
||||||
|
$this->seq = isset($params['seq']) ? $params['seq'] : 0;
|
||||||
|
$this->user = Minz_Session::paramString('currentUser');
|
||||||
|
$this->method = $params['op'];
|
||||||
|
$this->params = $params;
|
||||||
|
$this->system_conf = Minz_Configuration::get('system');
|
||||||
|
if ($this->user != '') {
|
||||||
|
$this->user_conf = get_user_configuration($this->user);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function param($param, $default = false) {
|
||||||
|
if (isset($this->params[$param])) {
|
||||||
|
return $this->params[$param];
|
||||||
|
} else {
|
||||||
|
return $default;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function good($reply) {
|
||||||
|
$this->response($reply, self::STATUS_OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function bad($reply) {
|
||||||
|
$this->response($reply, self::STATUS_ERR);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function response($reply, $status) {
|
||||||
|
header('Content-Type: text/json; charset=utf-8');
|
||||||
|
$result = json_encode(array(
|
||||||
|
'seq' => $this->seq,
|
||||||
|
'status' => $status,
|
||||||
|
'content' => $reply,
|
||||||
|
));
|
||||||
|
|
||||||
|
// Minz_Log::debug($result);
|
||||||
|
print($result);
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function handle() {
|
||||||
|
if (!$this->system_conf->api_enabled) {
|
||||||
|
$this->bad(array(
|
||||||
|
'error' => 'API_DISABLED'
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->user === '' &&
|
||||||
|
!in_array($this->method, ['login', 'isloggedin'], true)) {
|
||||||
|
$this->bad(array(
|
||||||
|
'error' => 'NOT_LOGGED_IN'
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_callable(array($this, $this->method))) {
|
||||||
|
call_user_func(array($this, $this->method));
|
||||||
|
} else {
|
||||||
|
Minz_Log::warning('TTRSS API: ' . $this->method . '() method does not exist');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function auth_user($username, $password) {
|
||||||
|
if (!function_exists('password_verify')) {
|
||||||
|
include_once(LIB_PATH . '/password_compat.php');
|
||||||
|
}
|
||||||
|
|
||||||
|
$user_conf = get_user_configuration($username);
|
||||||
|
if (is_null($user_conf)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($user_conf->apiPasswordHash != '' &&
|
||||||
|
password_verify($password, $user_conf->apiPasswordHash)) {
|
||||||
|
Minz_Session::_param('currentUser', $username);
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getApiLevel() {
|
||||||
|
$this->good(array(
|
||||||
|
'level' => self::API_LEVEL
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getVersion() {
|
||||||
|
$this->good(array(
|
||||||
|
'version' => FRESHRSS_VERSION
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function login() {
|
||||||
|
$username = $this->param('user');
|
||||||
|
$password = $this->param('password');
|
||||||
|
$password_base64 = base64_decode($this->param('password'), true);
|
||||||
|
|
||||||
|
if ($this->auth_user($username, $password) ||
|
||||||
|
$this->auth_user($username, $password_base64)) {
|
||||||
|
$this->good(array(
|
||||||
|
'session_id' => session_id(),
|
||||||
|
'api_level' => self::API_LEVEL,
|
||||||
|
));
|
||||||
|
} else {
|
||||||
|
Minz_Log::warning('TTRSS API: invalid user login: ' . $username);
|
||||||
|
$this->bad(array(
|
||||||
|
'error' => 'LOGIN_ERROR'
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function logout() {
|
||||||
|
Minz_Session::_param('currentUser');
|
||||||
|
$this->good(array(
|
||||||
|
'status' => 'OK'
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function isLoggedIn() {
|
||||||
|
$this->good(array(
|
||||||
|
'status' => $this->user !== ''
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getCategories() {
|
||||||
|
$unread_only = $this->param('unread_only', false);
|
||||||
|
$include_empty = $this->param('include_empty', true);
|
||||||
|
// $enable_nested = $this->param('enable_nested', true); // not supported
|
||||||
|
|
||||||
|
$pdo = new MyPDO();
|
||||||
|
$sql = <<<SQL
|
||||||
|
SELECT DISTINCT c.id, c.name, COUNT(f.id) AS nb_feeds,
|
||||||
|
(SELECT COUNT(e.id) FROM entry e WHERE e.id_feed = f.id AND e.is_read=0) AS unread
|
||||||
|
FROM `_category` c
|
||||||
|
LEFT JOIN `_feed` f ON c.id = f.category
|
||||||
|
GROUP BY c.id, c.name
|
||||||
|
SQL;
|
||||||
|
$stm = $pdo->prepare($sql);
|
||||||
|
$stm->execute();
|
||||||
|
$res = $stm->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
|
$caterogies = array();
|
||||||
|
foreach ($res as $cat) {
|
||||||
|
if ($unread_only && $cat['unread'] <= 0 ||
|
||||||
|
!$include_empty && $cat['nb_feeds'] <= 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$caterogies[] = array(
|
||||||
|
'id' => $cat['id'],
|
||||||
|
'title' => $cat['name'],
|
||||||
|
'unread' => $cat['unread'],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->good($caterogies);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getFeeds() {
|
||||||
|
$cat_id = $this->param('cat_id');
|
||||||
|
$unread_only = $this->param('unread_only', false);
|
||||||
|
$limit = (int)$this->param('limit', -1);
|
||||||
|
$offset = (int)$this->param('offset', -1);
|
||||||
|
// $include_nested = $this->param('include_nested', false) === true; // not supported
|
||||||
|
|
||||||
|
$sql_values = array();
|
||||||
|
|
||||||
|
$sql_where = '';
|
||||||
|
if ($cat_id >= 0) {
|
||||||
|
// special ids are not supported (yet?)
|
||||||
|
$sql_where = ' WHERE f.category = ?';
|
||||||
|
$sql_values[] = $cat_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql_limit = '';
|
||||||
|
if ($limit >= 0 && $offset >= 0) {
|
||||||
|
$sql_limit = ' LIMIT ? OFFSET ?';
|
||||||
|
$sql_values[] = $limit;
|
||||||
|
$sql_values[] = $offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
$pdo = new MyPDO();
|
||||||
|
$sql = 'SELECT f.id, f.name, f.url, f.category, f.cache_nbUnreads AS unread, f.lastUpdate'
|
||||||
|
. ' FROM `%_feed` f'
|
||||||
|
. $sql_where
|
||||||
|
. $sql_limit;
|
||||||
|
$stm = $pdo->prepare($sql);
|
||||||
|
$stm->execute($sql_values);
|
||||||
|
$res = $stm->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
|
$feeds = array();
|
||||||
|
foreach ($res as $feed) {
|
||||||
|
if ($unread_only && $feed['unread'] <= 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$feeds[] = array(
|
||||||
|
'id' => $feed['id'],
|
||||||
|
'title' => $feed['name'],
|
||||||
|
'feed_url' => $feed['url'],
|
||||||
|
'unread' => $feed['unread'],
|
||||||
|
'has_icon' => true,
|
||||||
|
'cat_id' => $feed['category'],
|
||||||
|
'last_updated' => $feed['lastUpdate']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->good($feeds);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getHeadlines() {
|
||||||
|
$feed_id = $this->param('feed_id');
|
||||||
|
if ($feed_id === false) {
|
||||||
|
$this->bad(array(
|
||||||
|
'error' => 'INCORRECT_USAGE'
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
$limit = min(200, (int)$this->param('limit', 200));
|
||||||
|
$offset = (int)$this->param('skip', 0);
|
||||||
|
$is_cat = $this->param('is_cat', true);
|
||||||
|
$show_excerpt = $this->param('show_excerpt', false);
|
||||||
|
$show_content = $this->param('show_content', true);
|
||||||
|
$view_mode = $this->param('view_mode', 'all_articles');
|
||||||
|
$since_id = $this->param('since_id', '');
|
||||||
|
$order_by = $this->param('order_by', 'feed_dates');
|
||||||
|
$search = $this->param('search', '');
|
||||||
|
// $filter = $this->param('filter'); // not supported
|
||||||
|
// $include_attachments = $this->param('include_attachments'); // not supported
|
||||||
|
// $include_nested = $this->param('include_nested'); // not supported
|
||||||
|
// $force_update = $this->param('force_update', false); // not supported
|
||||||
|
// $sanitize = $this->param('sanitize', true); // not supported
|
||||||
|
// $has_sandbox = $this->param('has_sandbox', false); // not supported
|
||||||
|
// $search_mode = $this->param('search_mode', 'all_feeds'); // not supported
|
||||||
|
// $match_on = $this->param('match_on'); // not supported
|
||||||
|
|
||||||
|
// Get the current state
|
||||||
|
$state = 0;
|
||||||
|
switch ($view_mode) {
|
||||||
|
case 'unread':
|
||||||
|
case 'adaptive':
|
||||||
|
$state = FreshRSS_Entry::STATE_NOT_READ;
|
||||||
|
break;
|
||||||
|
case 'marked':
|
||||||
|
$state = FreshRSS_Entry::STATE_FAVORITE;
|
||||||
|
break;
|
||||||
|
case 'updated': // not supported
|
||||||
|
case 'all_articles':
|
||||||
|
default:
|
||||||
|
$state = FreshRSS_Entry::STATE_ALL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the current type
|
||||||
|
$id = '';
|
||||||
|
$type = 'A';
|
||||||
|
switch ($feed_id) {
|
||||||
|
case 0: // archived (not supported)
|
||||||
|
case -1: // starred
|
||||||
|
$type = 's';
|
||||||
|
break;
|
||||||
|
case -2: // published (not supported)
|
||||||
|
case -3: // fresh (not supported)
|
||||||
|
case -4: // all articles
|
||||||
|
// nothing to do
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// if ($is_cat) {
|
||||||
|
// $type = 'c';
|
||||||
|
// } else {
|
||||||
|
// $type = 'f';
|
||||||
|
// }
|
||||||
|
$type = 'f';
|
||||||
|
$id = $feed_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the order
|
||||||
|
$order = 'DESC';
|
||||||
|
if ($order_by === 'date_reverse') {
|
||||||
|
$order = 'ASC';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fix the limit: since we don't have any mechanism of offset in
|
||||||
|
// listWhere, it will be done in PHP. Limit has to be increased by
|
||||||
|
// the value of offset.
|
||||||
|
$limit += $offset;
|
||||||
|
|
||||||
|
$entryDAO = FreshRSS_Factory::createEntryDao();
|
||||||
|
$entries = $entryDAO->listWhere($type, $id, $state, $order, $limit, $since_id, $search, $since_id);
|
||||||
|
|
||||||
|
$headlines = array();
|
||||||
|
$nb_items = 0;
|
||||||
|
foreach ($entries as $item) {
|
||||||
|
if ($nb_items < $offset) {
|
||||||
|
$nb_items++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$feed = $item->feed(true);
|
||||||
|
$line = array(
|
||||||
|
'id' => $item->id(),
|
||||||
|
'unread' => !$item->isRead(),
|
||||||
|
'marked' => $item->isFavorite(),
|
||||||
|
'published' => true,
|
||||||
|
'updated' => $item->date(true),
|
||||||
|
'is_updated' => false,
|
||||||
|
'title' => $item->title(),
|
||||||
|
'link' => $item->link(),
|
||||||
|
'tags' => $item->tags(),
|
||||||
|
'author' => $item->authors(true),
|
||||||
|
'feed_id' => $feed->id(),
|
||||||
|
'feed_title' => $feed->name(),
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($show_excerpt) {
|
||||||
|
// @todo add a facultative max char in content method to get
|
||||||
|
// an excerpt.
|
||||||
|
$line['excerpt'] = $item->content();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($show_content) {
|
||||||
|
$line['content'] = $item->content();
|
||||||
|
}
|
||||||
|
|
||||||
|
$headlines[] = $line;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->good($headlines);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function updateArticle() {
|
||||||
|
$article_ids = $this->param('article_ids', '');
|
||||||
|
$mode = $this->param('mode'); // 0 set to false, 1 set to true,
|
||||||
|
// 2 toggle but not supported.
|
||||||
|
$field = $this->param('field');
|
||||||
|
// $data = $this->param('data'); // not supported
|
||||||
|
|
||||||
|
$article_ids = explode(',', $article_ids);
|
||||||
|
$entryDAO = FreshRSS_Factory::createEntryDao();
|
||||||
|
$number_article_updated = 0;
|
||||||
|
switch ($field) {
|
||||||
|
case 0: // starred
|
||||||
|
$number_article_updated = $entryDAO->markFavorite($article_ids, $mode);
|
||||||
|
break;
|
||||||
|
case 2: // unread
|
||||||
|
$number_article_updated = $entryDAO->markRead($article_ids, !$mode);
|
||||||
|
break;
|
||||||
|
case 1: // published (not supported)
|
||||||
|
case 3: // article note (not supported)
|
||||||
|
default:
|
||||||
|
// nothing to do
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->good(array(
|
||||||
|
'status' => 'OK',
|
||||||
|
'updated' => $number_article_updated,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function catchupFeed() {
|
||||||
|
$id = $this->param('feed_id');
|
||||||
|
$is_cat = $this->param('is_cat', true);
|
||||||
|
|
||||||
|
$entryDAO = FreshRSS_Factory::createEntryDao();
|
||||||
|
switch ($id) {
|
||||||
|
case -1: // starred
|
||||||
|
$entryDAO->markReadEntries(0, true);
|
||||||
|
break;
|
||||||
|
case -4: // all articles
|
||||||
|
$entryDAO->markReadEntries();
|
||||||
|
break;
|
||||||
|
case 0: // archived (not supported)
|
||||||
|
case -2: // published (not supported)
|
||||||
|
case -3: // fresh (not supported)
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// if ($is_cat) {
|
||||||
|
// $entryDAO->markReadCat($id);
|
||||||
|
// } else {
|
||||||
|
// $entryDAO->markReadFeed($id);
|
||||||
|
// }
|
||||||
|
$entryDAO->markReadFeed($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->good(array(
|
||||||
|
'status' => 'OK'
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getCounters() {
|
||||||
|
$categoryDAO = new FreshRSS_CategoryDAO();
|
||||||
|
$counters = array();
|
||||||
|
$total_unreads = 0;
|
||||||
|
|
||||||
|
// Get feed unread counters
|
||||||
|
$categories = $categoryDAO->listCategories(true, true);
|
||||||
|
foreach ($categories as $cat) {
|
||||||
|
foreach ($cat->feeds() as $feed) {
|
||||||
|
$counters[] = array(
|
||||||
|
'id' => $feed->id(),
|
||||||
|
'counter' => $feed->nbNotRead(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$total_unreads += $cat->nbNotRead();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get global unread counter
|
||||||
|
$counters[] = array(
|
||||||
|
'id' => 'global-unread',
|
||||||
|
'counter' => $total_unreads,
|
||||||
|
);
|
||||||
|
|
||||||
|
// Get favorite unread counter
|
||||||
|
$entryDAO = FreshRSS_Factory::createEntryDao();
|
||||||
|
$fav_counters = $entryDAO->countUnreadReadFavorites();
|
||||||
|
$counters[] = array(
|
||||||
|
'id' => -1,
|
||||||
|
'counter' => $fav_counters['unread'],
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->good($counters);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getFeedTree() {
|
||||||
|
$include_empty = $this->param('include_empty', true);
|
||||||
|
$tree = array(
|
||||||
|
'identifier' => 'id',
|
||||||
|
'label' => 'name',
|
||||||
|
'items' => array(),
|
||||||
|
);
|
||||||
|
|
||||||
|
$categoryDAO = new FreshRSS_CategoryDAO();
|
||||||
|
$categories = $categoryDAO->listCategories(true, true);
|
||||||
|
foreach ($categories as $cat) {
|
||||||
|
$tree_cat = array(
|
||||||
|
'id' => 'CAT:' . $cat->id(),
|
||||||
|
'name' => $cat->name(),
|
||||||
|
'unread' => $cat->nbNotRead(),
|
||||||
|
'type' => 'category',
|
||||||
|
'bare_id' => $cat->id(),
|
||||||
|
'items' => array(),
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach ($cat->feeds() as $feed) {
|
||||||
|
$tree_cat['items'][] = array(
|
||||||
|
'id' => 'FEED:' . $feed->id(),
|
||||||
|
'name' => $feed->name(),
|
||||||
|
'unread' => $feed->nbNotRead(),
|
||||||
|
'type' => 'feed',
|
||||||
|
'error' => $feed->inError(),
|
||||||
|
'updated' => $feed->lastUpdate(),
|
||||||
|
'bare_id' => $feed->id(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (count($tree_cat['items']) > 0 || $include_empty) {
|
||||||
|
$tree['items'][] = $tree_cat;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->good(array(
|
||||||
|
'categories' => $tree
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getUnread() {
|
||||||
|
Minz_Log::warning('TTRSS API: getUnread() not implemented');
|
||||||
|
}
|
||||||
|
public function getArticle() {
|
||||||
|
Minz_Log::warning('TTRSS API: getArticle() not implemented');
|
||||||
|
}
|
||||||
|
public function getConfig() {
|
||||||
|
Minz_Log::warning('TTRSS API: getConfig() not implemented');
|
||||||
|
}
|
||||||
|
public function updateFeed() {
|
||||||
|
Minz_Log::warning('TTRSS API: updateFeed() not implemented');
|
||||||
|
}
|
||||||
|
public function getPref() {
|
||||||
|
Minz_Log::warning('TTRSS API: getPref() not implemented');
|
||||||
|
}
|
||||||
|
public function getLabels() {
|
||||||
|
Minz_Log::warning('TTRSS API: getLabels() not implemented');
|
||||||
|
}
|
||||||
|
public function setArticleLabel() {
|
||||||
|
Minz_Log::warning('TTRSS API: setArticleLabel() not implemented');
|
||||||
|
}
|
||||||
|
public function shareToPublish() {
|
||||||
|
Minz_Log::warning('TTRSS API: shareToPublish() not implemented');
|
||||||
|
}
|
||||||
|
public function subscribeToFeed() {
|
||||||
|
Minz_Log::warning('TTRSS API: subscribeToFeed() not implemented');
|
||||||
|
}
|
||||||
|
public function unsubscribeFeed() {
|
||||||
|
Minz_Log::warning('TTRSS API: unsubscribeFeed() not implemented');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Minz_Configuration::register('system',
|
||||||
|
DATA_PATH . '/config.php',
|
||||||
|
DATA_PATH . '/config.default.php');
|
||||||
|
|
||||||
|
$input = file_get_contents("php://input");
|
||||||
|
// Minz_Log::debug($input);
|
||||||
|
$input = json_decode($input, true);
|
||||||
|
|
||||||
|
if (isset($input["sid"])) {
|
||||||
|
session_id($input["sid"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
Minz_Session::init('FreshRSS');
|
||||||
|
|
||||||
|
$api = new FreshAPI_TTRSS($input);
|
||||||
|
$api->handle();
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
FreshRSS extension which changes how article titles are being displayed. Instead of truncating a title when it overflows the display area,
|
FreshRSS extension which changes how article titles are being displayed. Instead of truncating a title when it overflows the display area,
|
||||||
this extension applies a line-wrap to long article titles.
|
this extension applies a line-wrap to long article titles.
|
||||||
|
|
||||||
To use it, upload this directory in your `./extensions` directory and enable it on the extension panel in FreshRSS. If you need more control, use the *User CSS* extension instead to specify your own CSS rules.
|
To use it, upload this directory in your `./extensions` directory and enable it on the extension panel in FreshRSS. If you need more control, use the xExtension-CustomCSS instead to specify your own css rules.
|
||||||
|
|
||||||
The CSS code (since 0.3 legacy) used to wrap long titles was originally [proposed](https://github.com/FreshRSS/FreshRSS/issues/2344) by ₣rans de Jonge.
|
The CSS code (since 0.3 legacy) used to wrap long titles was originally [proposed](https://github.com/FreshRSS/FreshRSS/issues/2344) by ₣rans de Jonge.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,10 @@ final class TitleWrapExtension extends Minz_Extension {
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function init(): void {
|
public function init(): void {
|
||||||
if (version_compare(FRESHRSS_VERSION, "1.23.1") > 0) {
|
if (version_compare(FRESHRSS_VERSION, "1.23.1") > 0) {
|
||||||
Minz_View::appendStyle($this->getFileUrl('title_wrap.css'));
|
Minz_View::appendStyle($this->getFileUrl('title_wrap.css', 'css'));
|
||||||
} else {
|
} else {
|
||||||
// legacy <1.24.0 (= 1.23.2-dev)
|
// legacy <1.24.0 (= 1.23.2-dev)
|
||||||
Minz_View::appendStyle($this->getFileUrl('title_wrap_legacy.css'));
|
Minz_View::appendStyle($this->getFileUrl('title_wrap_legacy.css', 'css'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue