add option to disable custom context menu (#1128)

This commit is contained in:
Athou
2023-08-04 08:53:34 +02:00
parent cb779ec494
commit 466846d268
36 changed files with 156 additions and 3 deletions

View File

@@ -67,6 +67,7 @@ public class UserSettings extends AbstractModel {
private boolean alwaysScrollToEntry;
private boolean markAllAsReadConfirmation;
private boolean customContextMenu;
private boolean email;
private boolean gmail;

View File

@@ -41,6 +41,9 @@ public class Settings implements Serializable {
@ApiModelProperty(value = "ask for confirmation when marking all entries as read", required = true)
private boolean markAllAsReadConfirmation;
@ApiModelProperty(value = "show commafeed's own context menu on right click", required = true)
private boolean customContextMenu;
@ApiModelProperty(value = "sharing settings", required = true)
private SharingSettings sharingSettings = new SharingSettings();

View File

@@ -105,6 +105,7 @@ public class UserREST {
s.setScrollSpeed(settings.getScrollSpeed());
s.setAlwaysScrollToEntry(settings.isAlwaysScrollToEntry());
s.setMarkAllAsReadConfirmation(settings.isMarkAllAsReadConfirmation());
s.setCustomContextMenu(settings.isCustomContextMenu());
} else {
s.setReadingMode(ReadingMode.unread.name());
s.setReadingOrder(ReadingOrder.desc.name());
@@ -124,6 +125,7 @@ public class UserREST {
s.setScrollSpeed(400);
s.setAlwaysScrollToEntry(false);
s.setMarkAllAsReadConfirmation(true);
s.setCustomContextMenu(true);
}
return Response.ok(s).build();
}
@@ -151,6 +153,7 @@ public class UserREST {
s.setScrollSpeed(settings.getScrollSpeed());
s.setAlwaysScrollToEntry(settings.isAlwaysScrollToEntry());
s.setMarkAllAsReadConfirmation(settings.isMarkAllAsReadConfirmation());
s.setCustomContextMenu(settings.isCustomContextMenu());
s.setEmail(settings.getSharingSettings().isEmail());
s.setGmail(settings.getSharingSettings().isGmail());

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">
<changeSet id="mark-all-as-read-confirmation" author="athou">
<addColumn tableName="USERSETTINGS">
@@ -11,4 +11,12 @@
</addColumn>
</changeSet>
<changeSet id="custom-context-menu" author="athou">
<addColumn tableName="USERSETTINGS">
<column name="customContextMenu" type="BOOLEAN" defaultValueBoolean="true">
<constraints nullable="false" />
</column>
</addColumn>
</changeSet>
</databaseChangeLog>