Commit Graph

301 Commits

Author SHA1 Message Date
Alexis Degrugillier
1ce94136e0 Update navigation on empty feeds (#2687)
When using feed navigation, the previous behavior was to cycle through all
available feeds regardless of their content. To match the behaviour of the
first feed and last feed navigation shortcuts, the navigation now skips
empty feeds. Now it's consistent through out the application.
When using feed navigation with only empty feeds, the new behavior is to
cycle through all available feeds.

See #2385
2019-12-04 08:29:20 +01:00
Alexis Degrugillier
cc0db9af4f Feature/new archiving (#2335)
* Change archiving config page layout

I've changed some wording and moved actions into a
maintenance section.

* Update purge action

Now we have more control on the purge action. The configuration allows
us to choose what to keep and what to discard in a more precise way.
At the moment, the configuration applies for all feeds.

* Add purge configuration on feed level

Now the extend purge configuration is available on feed level.
It is stored as attributes and will be used in the purge action.

* Update purge action

Now the purge action uses the feed configuration if it exists and
defaults on user configuration if not.

* Add empty option in period list

* Fix configuration warnings

* Add archiving configuration on categories

See #2369

* Add user info back

* Add explanations in UI

* Fixes for SQLite + error + misc.

* Fix invalid feed reference

* Short array syntax

Only for new code, so far

* Fix prefix error

* Query performance, default values

Work in progress

* Fix default values and confirm before leaving

Form cancel and confirm changes before leaving were broken.
And start taking advantage of the short echo syntax `<?= ?>` as we have
moved to PHP 5.4+

* More work

* Tuning SQL

* Fix MariaDB + performance issue

* SQL performance

* Fix SQLite bug

* Fix some attributes JSON encoding bugs

Especially for SQLite export/import

* More uniform, fix bugs

More uniform between global, category, feed settings

* Drop special cases for old articles during refresh

Instead will use lastSeen date with the new archiving logic.
This was generating problems anyway
https://github.com/FreshRSS/FreshRSS/issues/2154

* Draft drop index keep_history

Not needed anymore

* MySQL typo

Now properly tested with MySQL, PostgreSQL, SQLite

* More work for legacy values

Important to avoid overriding user's preference and risking deleting
data erroneously

* Fix PHP 7.3 / 7.4 warnings

@aledeg "Trying to use values of type null, bool, int, float or resource
as an array (such as $null["key"]) will now generate a notice. "
https://php.net/migration74.incompatible

* Reintroduce min articles and take care of legacy parameters

* A few changes forgotten

* Draft of migration + DROP of feed.keep_history

* Fix several errors

And give up using const for SQL to allow multiple database types (and we
cannot redefine a const)

* Add keep_min to categories + factorise archiving logic

* Legacy fix

* Fix bug yield from

* Minor: Use JSON_UNESCAPED_SLASHE for attributes

And make more uniform

* Fix sign and missing variable

* Fine tune the logic
2019-10-23 00:52:15 +02:00
Alexandre Alapetite
21936c1373 Comply with LibreJS (#2576)
https://www.gnu.org/software/librejs/
https://addons.mozilla.org/firefox/addon/librejs/
Did not touch jquery.min.js because it is a third party script, which is regularly updated, and the add-on does not seem to block it enough to break our statitics page, which remains usable.
2019-10-20 22:10:24 +02:00
Alexandre Alapetite
ec5f7ad554 Workaround for Firefox favicon glitch (#2543)
Observed in Firefox 69: the favicon is sometimes refreshed with an old
favicon that does not have the number of unread items on it. Seems to
depend on load speed.
2019-10-01 18:12:48 +02:00
rocka
1f3672fcc1 Optimize dynamic favicon for HiDPI screens (#2539)
This PR leveraging `window.devicePixelRatio` to generate high resolution favicons for HiDPI screens.
2019-09-28 12:10:51 +02:00
Alexandre Alapetite
125a83efc9 IE11 / Edge keyboard compatibility (#2507)
https://github.com/FreshRSS/FreshRSS/pull/2506#issuecomment-523544684
2019-08-22 20:13:40 +02:00
ArthurHoaro
3f8804f54f Prevent window opener vulnerability with space shortcut (#2506)
* Prevent window opener vulnerability with space shortcut

This change fixes a vulnerability introduced by `window.open()` on untrusted sources. It reproduces the effect of `rel="noreferrer"` with JS.

Cross browser solution from: https://stackoverflow.com/a/40593743

## Reproduction

> tested with Firefox 68

  1. Add this RSS feed
  2. Open the 2nd link "À propos de la faille de sécurité liée à target="_blank" **using the space key shortcut**.
  3. Click on the first of three links "http://bookmarks.ecyseo.net"

Current behaviour: the FreshRSS tab changes.
Expected behaviour: no effect on FreshRSS

* Test for popup blockers
2019-08-21 21:14:22 +02:00
Alexandre Alapetite
879312dbc2 jQuery 3.4.1 (#2424)
Only used for statistics graphs
2019-06-22 00:08:52 +02:00
Alexis Degrugillier
d5ea3e96ef Add theme to print page
Before, the printed page didn't have any usable CSS.
Now, it uses the css files available in the application. It means that
custom CSS can be add to target printed page.

See #2149
2019-04-16 18:50:32 +02:00
Alexandre Alapetite
aef3f8d71b Alow mix of auto read options (#2354)
Fix
https://github.com/FreshRSS/FreshRSS/pull/2349#issuecomment-480540126
2019-04-07 00:29:37 +02:00
Alexandre Alapetite
1b7cf6b035 Fix menu warning (#2353)
confirm is only for labels, not for feeds
2019-04-06 17:05:53 +02:00
Alexandre Alapetite
43e3a2d69d Fix autoremove again (#2352)
Fix https://github.com/FreshRSS/FreshRSS/pull/2349
2019-04-06 16:45:21 +02:00
Alexandre Alapetite
0a067dbcd4 Fix hide articles + batch option (#2349)
https://github.com/FreshRSS/FreshRSS/issues/2332
https://github.com/FreshRSS/FreshRSS/issues/2345
Re-introduces the instant-remove article.
Batch mark-as-read only used for fast actions like scroll and keyboard
shortcut for next/previous articles.
2019-04-06 15:51:39 +02:00
Alexandre Alapetite
09a5b4493d Better handling of bad request and fast unload (#2346)
* Better handling of bad request and fast unload

Warnings for bad requests, confirmation before leaving a page with
pending mark-as-read requests (not the others for now)

* Fix callbacks
2019-04-06 09:24:22 +02:00
Alexandre Alapetite
e1bb23ee44 Fix scroll functions in Edge (#2337)
Use more standard / robust document.scrollingElement
2019-04-04 00:02:23 +02:00
Alexandre Alapetite
2efab9893c Fix shortcut problem when showing articles unfolded (#2336)
Fix https://github.com/FreshRSS/FreshRSS/issues/2328
2019-04-03 23:10:33 +02:00
Alexandre Alapetite
452419bf83 Fix auto_remove_article (#2334)
* Fix auto_remove_article

https://github.com/FreshRSS/FreshRSS/issues/2323

* Second attempt

* Third attempt
2019-04-03 23:08:46 +02:00
Alexandre Alapetite
8599dc29a1 Fix control click (#2330)
https://github.com/FreshRSS/FreshRSS/issues/2310
2019-04-02 22:46:56 +02:00
Frans de Jonge
c2a339f2f8 [CI] Lint JS scripts with jshint (#2315) 2019-04-01 23:47:36 +02:00
Alexandre Alapetite
e5c8d52aa1 Fix ASC load more (#2318)
https://github.com/FreshRSS/FreshRSS/issues/2314
2019-04-01 23:43:20 +02:00
Alexandre Alapetite
09362f15ee Minor code simplification
https://github.com/FreshRSS/FreshRSS/pull/2300
2019-03-27 00:08:59 +01:00
Alexandre Alapetite
580123fdb0 Wait for mark-as-read queue before click (#2300) 2019-03-25 08:46:31 +01:00
Alexandre Alapetite
ebd8c31c02 Rework CSRF interaction with sessions (#2290)
* Rework CSRF interaction with sessions

Fix https://github.com/FreshRSS/FreshRSS/issues/2288
Improve security in some edge cases
Maybe relevant for
https://github.com/FreshRSS/FreshRSS/issues/2125#issuecomment-474992671

* Forgotten mime type
2019-03-22 19:05:38 +01:00
Alexandre Alapetite
54a86990e6 Improved auto load more articles
Fixed bug + ealier trigger of load more (half of the window height
instead of 0)
2019-03-09 19:15:46 +01:00
Alexandre Alapetite
b869c2944a JavaScript fixes + new navigation loop behaviour (#2255)
* Fixed user configuration 404
https://github.com/FreshRSS/FreshRSS/pull/2234#issuecomment-466561555
* Fixed "SPACE" shortcut bug
https://github.com/FreshRSS/FreshRSS/pull/2234#issuecomment-466626412
* Use next feed / previous feed when reaching last / first article
instead of looping
* Jump to next / previous category when reaching last / first feed
instead of looping
2019-02-23 14:39:20 +01:00
Alexandre Alapetite
2374374ba9 Less jQuery (#2234)
* Less jQuery

Follow-up of https://github.com/FreshRSS/FreshRSS/pull/2199

* Even less jQuery + global view unread title fix

* Even less jQuery

* Yet even less jQuery

* Even less jQuery

* Reduce some events

* Even less jQuery

* jQuery gone from main view

+Fixed English i18n

* Fix feed folded view

* Remove Firefox 64 workaround

Remove workaround for Gecko bug 1514498 in Firefox 64, fixed in Firefox
65

* Split to extra.js

Avoid loading unneeded JavaScript code for the main view.
+ several adjustements

* Improve CSS transition fold category

* Rewrite shortcuts

Remove library. Much faster, shorter, one listener instead of many.
Control of the shortcut context.
Fix https://github.com/FreshRSS/FreshRSS/issues/2215

* Remove debug

* Minor syntax

* Filter out unwanted shortcut modifiers

* Menu overflow fix

* Typo

* Fix unfolding in mobile view

* Remove jQuery from category.js

* Remove jQuery from Global view
2019-02-13 15:06:28 +01:00
Alexandre Alapetite
ef6df8aeca Merge branch 'dev' into dev-1.14.0 2019-01-26 21:08:27 +01:00
Alexandre Alapetite
da4a80b88a Add a JavaScript event when opening an article (#2222)
* Add a JavaScript event when opening an article
https://framagit.org/nicofrand/xextension-threepanesview/issues/4

```javascript
document.body.addEventListener('freshrss:openArticle', function (e) {
		console.log('freshrss:openArticle');
		console.log(e.target);
	});
```
2019-01-24 19:43:28 +01:00
Alexandre Alapetite
6bc49e137e Manual merge /dev 2019-01-15 20:58:53 +01:00
Alexandre Alapetite
9214eeecff Comment about Gecko scrollbar bug in Firefox 64
https://bugzilla.mozilla.org/show_bug.cgi?id=1514498
2019-01-15 18:51:13 +01:00
Alexandre Alapetite
a26eff8a20 Merge branch 'FreshRSS/dev' into FreshRSS/dev-1.14.0 2019-01-06 12:19:26 +01:00
Alexandre Alapetite
20223b8b01 Automatic API test (#2207)
* Automatic API test

Easier for end-user, smarter, and the guess testing of greader
authorization token was not reliable.

* Travis + minor
2019-01-05 12:33:18 +01:00
Alexandre Alapetite
f9555db678 IE11 fixes 2018-12-27 03:49:20 +01:00
Alexandre Alapetite
caa893e14b Optimise onscroll routines
Much lighter rework: auto-mark-as-read, auto-remove-articles,
auto-load-more.
In particular, use a single onscroll event handler with a throtte.
Continue removing jQuery when possible.
2018-12-27 03:34:56 +01:00
Alexandre Alapetite
8f03b370cc Send item queue as POST
Which also simplifies the request
2018-12-25 16:10:20 +01:00
Alexandre Alapetite
6fa09318ce Semove superfluous window. object 2018-12-25 16:09:48 +01:00
Alexandre Alapetite
cd9a9a9309 First version of batch scroll as read
Mark-as-read requests are queued and sent max once per second
2018-12-25 15:34:25 +01:00
Alexandre Alapetite
eefeb23419 jQuery ES6 partial refactoring
Prefix jQuery variables with $
Start avoiding jQuery in easy cases
Use let/const
2018-12-25 05:11:38 +01:00
Alexandre Alapetite
4888f919f1 Prepare for batch mark as read 2018-12-25 01:30:28 +01:00
Alexandre Alapetite
e0e96d6a13 Remove simple-scrollbar fallback (#2182)
https://github.com/FreshRSS/FreshRSS/pull/2181#issuecomment-447636787
2018-12-16 15:04:46 +01:00
Alexandre Alapetite
483c698f9a JavaScript-free scrollbar (#2181)
* JavaScript-free scrollbar

Make scrollbar work without JavaScript
https://github.com/FreshRSS/FreshRSS/pull/2117#discussion_r240804225
Also implies a better support of resize scenarios.
Seems to fix at the same time the occasional glitches
https://github.com/FreshRSS/FreshRSS/pull/2117#issuecomment-447556038

* Firefox 64-66 workaround

Workaround for Gecko bug in Firefox 64-66. Avoid showing the scrollbar
all the time, at the cost of a slight reflow (therefore targetting only
Gecko).

* Improvement of Firefox workaround

* Minor comment

* Unneeded check

* Even better

* Partial Edge fix

* More margin for tree bottom
2018-12-16 12:49:23 +01:00
Patrick Crandol
983aa587ee Add aside_feed to reader view (#2180)
* Add Nav menu to reader mode

At this point, it appears to be non-functional in reader mode.

* Add aside_feed toggle to reader view

* make init_column_categories work in reader view

* Make sidebar links redirect to proper view

* CSS to support toggleable sidebar in reader view

* remove unneeded !important
2018-12-15 10:56:38 +01:00
Patrick Crandol
478d3e6611 Decouple scrolling of feeds and articles (#2117)
* Remove Sticky Kit

Remove sticky-kit, as functionality is unsuitable for separate scrolling.

* Remove sticky-kit load in main.js

Further removing the sticky-kit kruft

* Finish removal of references to Sticky-kit

* CSS Changes to template for Independent Scrolling

* Addition of JS and supporting CSS and html

* More CSS fixes to establish expected behavior

Should be able to scroll navbar without it being in sticky mode now.

* Fix typo in main.js

sortcut.js -> shortcut.js

* Fix unexpected tree scrolling behavior

* Change name of generic JS function

* Improve sticky-aside

* CSS changes in themes to accommodate  independent Scroll

In themes where .aside's width is not the standard 300px, .tree's width must be specified to be equal to .aside

* Remove Sticky-Kit from README files

* Updates to Sticky-Aside

* Update Template to fix screwup

* Make Recalculating height actually work

* Let sidebar fill height if nav buttons aren't visible

* Make accommodating for nav buttons actually work

* update Swage theme for Independent Scroll feature

* Integrate sticky_aside into main.js

* Add Simple Scrollbar

* Patch scrollbar color for themes with dark colored asides

* Increase Visibility of scrollbar on Dark Themes

* Improve async loading, events, and performance

* CSS typo

* Fix double scrollbar on mobile

* Fix regression causing sticky to not be removed

* No $ for non-jQuery variables

* Fix strange condition + option for nice scrollbar

* Initial attempt to use css sticky

* Add stickyfill

* make the correct element sticky

* re-add incorrectly removed sidebar code

* Continue fixing mistaken deletions

* decrease frequency of recalc

* use minified version of simple-scrollbar.

* Load stickyfill instead of injecting

* put recalc back where it belongs

* re-remove script injector

* remove padding

bottom padding was causing the last item in the feed to be hidden under the nav buttons

* Manual merge of css_scrollbar

Add auto-detection of -webkit-scrollbar-thumb, otherwise fall back to
simple-scrollbar.js

* Fix Regression

Sticky recalc is still needed when using css scrollbars

* Replace method of closing dropdowns

Changed from an overlay href to a javascript solution, for better compatibility

* Remove Treepadding

Treepadding was causing dropdown menus at the bottom of the tree to be obscured.

* Undo unnecessary move of dropdown-target

* Move Dropdown Handler to a sensibleish place

* Fix light Scrollbar color not picking up on Firefox

* Minor syntax

* Minor Clarification of CSS/ patch BlueLagoon

* Change logic for native WebKit scrollbar detection

Fix
https://github.com/FreshRSS/FreshRSS/pull/2117#issuecomment-444251419
Tested with Firefox 63, Firefox 65, Chrome 71, IE11, Edge 42

* Fixes for other views

E.g. reader view

* Cleaner way of generating hash for dropdowns

* Make dropdown-toggle an actual toggle

* Prepare for CSS Scrollbars Module Level 1

* Fix regression causing my labels dropdown not to appear

* remove unneeded dropdown-close css rule

* Re-apply some lost changes

3c509989e8

* Add standard scrollbar compatibility

E.g. Firefox 64+

* Make All dropdowns click-to-close

* Remove BlueLagoon template

* Try to fix Firefox

https://github.com/FreshRSS/FreshRSS/pull/2117#discussion_r239539984

* Add CSS rules necessary for consistent function of scrollbar in Firefox

* Use inheritance to determine width

* Use overlay scrollbar where possible

* Test Reduced Listener

* Fix Firefox 62

And show subtle scrollbar even when not hovering

* Add margin at bottom

To allow opening the menus
https://github.com/FreshRSS/FreshRSS/pull/2117#issuecomment-444571218

* Minor - tab correction

* Spaces -> tabs

* Remove unneeded inheritance

* Fix indenting

* Revert bad merge

* Messy WIP to make dropdowns work

* Style Cleanup

* Break it down

* Lets try a move-it move-it

* Update p/scripts/main.js

Co-Authored-By: pattems <patrick@crandol.com>

* Update p/themes/BlueLagoon/BlueLagoon.css

Co-Authored-By: pattems <patrick@crandol.com>

*  separate ALL THE THINGS

* erroneous commas

* and to or

* removing double condition that doesn't do what I want

* More breaking down

* fix var

* Fix variable name again

* Remove magic number

https://github.com/FreshRSS/FreshRSS/pull/2117#discussion_r240052598

* Suuuuper inelegant solution for dropdowns

* lets try that again

* Inelegant Fix For Dropdowns

Now with 100% more working dropdowns

* Make sidebar dropdowns work correctly?

* Fix reversion

* Make JS scrollbar always visible

* Remove unneeded CSS

Added early in this pull request, didn't get pulled out when it was obsolete

* Fix CSS removal I missed

* CSS comment update/consistency for dark themes

* Clean Up Duplicate code

* Make dropdowns properly hide

Downside: Can no longer click on header/nav buttons to close

* Strip unneeded if statement

* jshint -W018

https://github.com/FreshRSS/FreshRSS/pull/2117#discussion_r240392851

* Half-reversion to old dropdown

* make overlay href scale to sidebar width

* remove init of nonexistent method

* remove trailing tabs

* move #close href where it belongs in index.phtml

* Revert all changes to index.phtml

* remove whitespace

accidentally added in last commit

* Move var's in init_column categories

* Finish putting old style dropdowns back

* Make CSS changes to use support statements

* Cleanup Whitespace

* re-add missing class

* spaces -> tabs in main.js

* tabs -> spaces css

* Minor whitespace

* Cleanup per @Alkarex

* Second attempt to add bottom margin

https://github.com/FreshRSS/FreshRSS/pull/2117#discussion_r240820901

* Fix error in IE11

* Simple-scrollbar color match for dark themes
2018-12-12 12:04:31 +01:00
Alexandre Alapetite
5c8eb1e864 Fix print for unfolded articles (#2148)
Fix https://github.com/FreshRSS/FreshRSS/issues/2130
`.current` might not exist in views for which all articles are already
expanded
2018-11-26 08:32:04 +01:00
Frans de Jonge
e20c7ef1b0 [fix] Finishing touches for next/previous without focus (#2140)
* [fix] Finishing touches for next/previous without focus

Cf. #1767.

* Avoid single quote

Alternative: use `’`

* Minor whitespace

* Minor whitespace

* be explicit about skipping

* add todos

* overshot by one
2018-11-18 19:31:36 +01:00
Matt DeMoss
f3a88614ef Add shortcuts for focusing next and previous without opening articles. (#1767)
* add skipping option to toggleContent to use later for 'i' and 'o' hotkeys

* in English config j,k are now 'open' and not 'skip', i,o are called 'focus .. without opening'
2018-11-18 14:08:27 +01:00
Patrick Crandol
38e3f792a4 reallow items kept unread to be interactive (#2085)
Remove .keep_unread from classes that do nothing.
2018-10-30 14:15:50 -04:00
Alexandre Alapetite
cae30f010a Fix manual refresh commit (#2081)
Commit was performed too early, potentially before the last feeds were
done refreshing
2018-10-26 22:18:11 +02:00
Alexandre Alapetite
fe1f6223f9 init confirm also for configuration pages (#2048)
There are some actions that require confirmation also in the
configuration pages, such as delete user.
2018-10-14 13:59:26 +02:00
Alexandre Alapetite
1cc891be35 Remove some preload / prefetch (#2040)
* Remove next prefetch

This approach was only efficient in the specific case when no change was
made (no mark-as-read, favourites, tags), and useless in the other
situations.
Removed to reduce server load.

* Remove next prefetch from JavaScript too

* Remove some preload / prefetch

While useful for the first request, those preload / prefetch hints are
slightly negative for the following requets, especially server-side,
e.g. generating one log entry in Apache, and a bit more network traffic.

* Revert mistake

* Remove comment

https://github.com/FreshRSS/FreshRSS/pull/2040#discussion_r223214915
2018-10-14 00:35:43 +02:00