forked from Archives/Athou_commafeed
individual settings for share buttons, and added tumblr (#582)
This commit is contained in:
@@ -59,7 +59,6 @@ public class UserSettings extends AbstractModel {
|
||||
|
||||
private boolean showRead;
|
||||
private boolean scrollMarks;
|
||||
private boolean socialButtons;
|
||||
|
||||
@Column(length = 32)
|
||||
private String theme;
|
||||
@@ -70,5 +69,16 @@ public class UserSettings extends AbstractModel {
|
||||
|
||||
@Column(name = "scroll_speed")
|
||||
private int scrollSpeed;
|
||||
|
||||
private boolean email;
|
||||
private boolean gmail;
|
||||
private boolean facebook;
|
||||
private boolean twitter;
|
||||
private boolean googleplus;
|
||||
private boolean tumblr;
|
||||
private boolean pocket;
|
||||
private boolean instapaper;
|
||||
private boolean buffer;
|
||||
private boolean readability;
|
||||
|
||||
}
|
||||
|
||||
@@ -27,9 +27,6 @@ public class Settings implements Serializable {
|
||||
@ApiProperty(value = "user wants category and feeds with no unread entries shown", required = true)
|
||||
private boolean showRead;
|
||||
|
||||
@ApiProperty(value = "user wants social buttons (facebook, twitter, ...) shown", required = true)
|
||||
private boolean socialButtons;
|
||||
|
||||
@ApiProperty(value = "In expanded view, scroll through entries mark them as read", required = true)
|
||||
private boolean scrollMarks;
|
||||
|
||||
@@ -41,5 +38,16 @@ public class Settings implements Serializable {
|
||||
|
||||
@ApiProperty(value = "user's preferred scroll speed when navigating between entries")
|
||||
private int scrollSpeed;
|
||||
|
||||
private boolean email;
|
||||
private boolean gmail;
|
||||
private boolean facebook;
|
||||
private boolean twitter;
|
||||
private boolean googleplus;
|
||||
private boolean tumblr;
|
||||
private boolean pocket;
|
||||
private boolean instapaper;
|
||||
private boolean buffer;
|
||||
private boolean readability;
|
||||
|
||||
}
|
||||
|
||||
@@ -74,7 +74,18 @@ public class UserREST extends AbstractREST {
|
||||
s.setReadingOrder(settings.getReadingOrder().name());
|
||||
s.setViewMode(settings.getViewMode().name());
|
||||
s.setShowRead(settings.isShowRead());
|
||||
s.setSocialButtons(settings.isSocialButtons());
|
||||
|
||||
s.setEmail(settings.isEmail());
|
||||
s.setGmail(settings.isGmail());
|
||||
s.setFacebook(settings.isFacebook());
|
||||
s.setTwitter(settings.isTwitter());
|
||||
s.setGoogleplus(settings.isGoogleplus());
|
||||
s.setTumblr(settings.isTumblr());
|
||||
s.setPocket(settings.isPocket());
|
||||
s.setInstapaper(settings.isInstapaper());
|
||||
s.setBuffer(settings.isBuffer());
|
||||
s.setReadability(settings.isReadability());
|
||||
|
||||
s.setScrollMarks(settings.isScrollMarks());
|
||||
s.setTheme(settings.getTheme());
|
||||
s.setCustomCss(settings.getCustomCss());
|
||||
@@ -86,7 +97,18 @@ public class UserREST extends AbstractREST {
|
||||
s.setViewMode(ViewMode.title.name());
|
||||
s.setShowRead(true);
|
||||
s.setTheme("default");
|
||||
s.setSocialButtons(true);
|
||||
|
||||
s.setEmail(true);
|
||||
s.setGmail(true);
|
||||
s.setFacebook(true);
|
||||
s.setTwitter(true);
|
||||
s.setGoogleplus(true);
|
||||
s.setTumblr(true);
|
||||
s.setPocket(true);
|
||||
s.setInstapaper(true);
|
||||
s.setBuffer(true);
|
||||
s.setReadability(true);
|
||||
|
||||
s.setScrollMarks(true);
|
||||
s.setLanguage("en");
|
||||
s.setScrollSpeed(400);
|
||||
@@ -116,9 +138,20 @@ public class UserREST extends AbstractREST {
|
||||
s.setScrollMarks(settings.isScrollMarks());
|
||||
s.setTheme(settings.getTheme());
|
||||
s.setCustomCss(settings.getCustomCss());
|
||||
s.setSocialButtons(settings.isSocialButtons());
|
||||
s.setLanguage(settings.getLanguage());
|
||||
s.setScrollSpeed(settings.getScrollSpeed());
|
||||
|
||||
s.setEmail(settings.isEmail());
|
||||
s.setGmail(settings.isGmail());
|
||||
s.setFacebook(settings.isFacebook());
|
||||
s.setTwitter(settings.isTwitter());
|
||||
s.setGoogleplus(settings.isGoogleplus());
|
||||
s.setTumblr(settings.isTumblr());
|
||||
s.setPocket(settings.isPocket());
|
||||
s.setInstapaper(settings.isInstapaper());
|
||||
s.setBuffer(settings.isBuffer());
|
||||
s.setReadability(settings.isReadability());
|
||||
|
||||
userSettingsDAO.saveOrUpdate(s);
|
||||
return Response.ok().build();
|
||||
|
||||
|
||||
53
src/main/resources/changelogs/db.changelog-1.5.xml
Normal file
53
src/main/resources/changelogs/db.changelog-1.5.xml
Normal file
@@ -0,0 +1,53 @@
|
||||
<?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">
|
||||
|
||||
<changeSet id="add-detailed-social-options" author="athou">
|
||||
<addColumn tableName="USERSETTINGS">
|
||||
<column name="email" type="BIT"></column>
|
||||
</addColumn>
|
||||
<addColumn tableName="USERSETTINGS">
|
||||
<column name="gmail" type="BIT"></column>
|
||||
</addColumn>
|
||||
<addColumn tableName="USERSETTINGS">
|
||||
<column name="facebook" type="BIT"></column>
|
||||
</addColumn>
|
||||
<addColumn tableName="USERSETTINGS">
|
||||
<column name="twitter" type="BIT"></column>
|
||||
</addColumn>
|
||||
<addColumn tableName="USERSETTINGS">
|
||||
<column name="googleplus" type="BIT"></column>
|
||||
</addColumn>
|
||||
<addColumn tableName="USERSETTINGS">
|
||||
<column name="tumblr" type="BIT"></column>
|
||||
</addColumn>
|
||||
<addColumn tableName="USERSETTINGS">
|
||||
<column name="pocket" type="BIT"></column>
|
||||
</addColumn>
|
||||
<addColumn tableName="USERSETTINGS">
|
||||
<column name="instapaper" type="BIT"></column>
|
||||
</addColumn>
|
||||
<addColumn tableName="USERSETTINGS">
|
||||
<column name="buffer" type="BIT"></column>
|
||||
</addColumn>
|
||||
<addColumn tableName="USERSETTINGS">
|
||||
<column name="readability" type="BIT"></column>
|
||||
</addColumn>
|
||||
|
||||
<dropColumn tableName="USERSETTINGS" columnName="socialButtons" />
|
||||
|
||||
<update tableName="USERSETTINGS">
|
||||
<column name="email" valueBoolean="true"></column>
|
||||
<column name="gmail" valueBoolean="true"></column>
|
||||
<column name="facebook" valueBoolean="true"></column>
|
||||
<column name="twitter" valueBoolean="true"></column>
|
||||
<column name="googleplus" valueBoolean="true"></column>
|
||||
<column name="tumblr" valueBoolean="true"></column>
|
||||
<column name="pocket" valueBoolean="true"></column>
|
||||
<column name="instapaper" valueBoolean="true"></column>
|
||||
<column name="buffer" valueBoolean="true"></column>
|
||||
<column name="readability" valueBoolean="true"></column>
|
||||
</update>
|
||||
</changeSet>
|
||||
|
||||
</databaseChangeLog>
|
||||
@@ -8,5 +8,6 @@
|
||||
<include file="changelogs/db.changelog-1.2.xml" />
|
||||
<include file="changelogs/db.changelog-1.3.xml" />
|
||||
<include file="changelogs/db.changelog-1.4.xml" />
|
||||
<include file="changelogs/db.changelog-1.5.xml" />
|
||||
|
||||
</databaseChangeLog>
|
||||
@@ -81,33 +81,36 @@
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<span class="share-buttons" ng-if="settingsService.settings.socialButtons">
|
||||
<a href="mailto:?subject={{entry.title|escape}}&body={{entry.url|escape}}" title="E-mail" popup>
|
||||
<span class="share-buttons">
|
||||
<a href="mailto:?subject={{entry.title|escape}}&body={{entry.url|escape}}" title="E-mail" popup ng-if="settingsService.settings.email">
|
||||
<i class="icon-envelope"></i>
|
||||
</a>
|
||||
<a href="https://mail.google.com/mail/?view=cm&fs=1&tf=1&source=mailto&su={{entry.title|escape}}&body={{entry.url|escape}}"
|
||||
title="Gmail" popup>
|
||||
title="Gmail" popup ng-if="settingsService.settings.gmail">
|
||||
<i class="icon-gmail"></i>
|
||||
</a>
|
||||
<a href="http://www.facebook.com/sharer.php?u=={{entry.url|escape}}" title="Facebook" popup>
|
||||
<a href="http://www.facebook.com/sharer.php?u=={{entry.url|escape}}" title="Facebook" popup ng-if="settingsService.settings.facebook">
|
||||
<i class="icon-facebook"></i>
|
||||
</a>
|
||||
<a href="http://twitter.com/share?text={{entry.title|escape}}&url={{entry.url|escape}}" title="Twitter" popup>
|
||||
<a href="http://twitter.com/share?text={{entry.title|escape}}&url={{entry.url|escape}}" title="Twitter" popup ng-if="settingsService.settings.twitter">
|
||||
<i class="icon-twitter"></i>
|
||||
</a>
|
||||
<a href="https://plus.google.com/share?url={{entry.url|escape}}" title="Google+" popup>
|
||||
<a href="https://plus.google.com/share?url={{entry.url|escape}}" title="Google+" popup ng-if="settingsService.settings.googleplus">
|
||||
<i class="icon-google-plus"></i>
|
||||
</a>
|
||||
<a href="https://getpocket.com/save?url={{entry.url|escape}}&title={{entry.title|escape}}" title="Pocket" popup>
|
||||
<a href="http://www.tumblr.com/share/link?url={{entry.url|escape}}&name={{entry.title|escape}}" title="Tumblr" popup ng-if="settingsService.settings.tumblr">
|
||||
<i class="icon-tumblr"></i>
|
||||
</a>
|
||||
<a href="https://getpocket.com/save?url={{entry.url|escape}}&title={{entry.title|escape}}" title="Pocket" popup ng-if="settingsService.settings.pocket">
|
||||
<i class="icon-pocket"></i>
|
||||
</a>
|
||||
<a href="https://www.instapaper.com/hello2?url={{entry.url|escape}}&title={{entry.title|escape}}" title="Instapaper" popup>
|
||||
<a href="https://www.instapaper.com/hello2?url={{entry.url|escape}}&title={{entry.title|escape}}" title="Instapaper" popup ng-if="settingsService.settings.instapaper">
|
||||
<i class="icon-instapaper"></i>
|
||||
</a>
|
||||
<a href="https://bufferapp.com/add?url={{entry.url|escape}}&text={{entry.title|escape}}" title="Buffer" popup>
|
||||
<a href="https://bufferapp.com/add?url={{entry.url|escape}}&text={{entry.title|escape}}" title="Buffer" popup ng-if="settingsService.settings.buffer">
|
||||
<i class="icon-buffer"></i>
|
||||
</a>
|
||||
<a href="http://www.readability.com/save?url={{entry.url|escape}}" title="Readability" popup>
|
||||
<a href="http://www.readability.com/save?url={{entry.url|escape}}" title="Readability" popup ng-if="settingsService.settings.readability">
|
||||
<i class="icon-couch"></i>
|
||||
</a>
|
||||
</span>
|
||||
|
||||
@@ -34,18 +34,85 @@
|
||||
${settings.general.show_unread}
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" name="socialButtons" ng-model="settings.socialButtons" />
|
||||
${settings.general.social_buttons}
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" name="scrollMarks" ng-model="settings.scrollMarks" />
|
||||
${settings.general.scroll_marks}
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<h4>${settings.general.social_buttons}</h4>
|
||||
<div>
|
||||
<label>
|
||||
<input type="checkbox" name="email" ng-model="settings.email" />
|
||||
<i class="icon-envelope"></i>
|
||||
E-Mail
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<input type="checkbox" name="gmail" ng-model="settings.gmail" />
|
||||
<i class="icon-gmail"></i>
|
||||
GMail
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<input type="checkbox" name="facebook" ng-model="settings.facebook" />
|
||||
<i class="icon-facebook"></i>
|
||||
Facebook
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<input type="checkbox" name="twitter" ng-model="settings.twitter" />
|
||||
<i class="icon-twitter"></i>
|
||||
Twitter
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<input type="checkbox" name="googleplus" ng-model="settings.googleplus" />
|
||||
<i class="icon-google-plus"></i>
|
||||
Google+
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<input type="checkbox" name="tumblr" ng-model="settings.tumblr" />
|
||||
<i class="icon-tumblr"></i>
|
||||
Tumblr
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<input type="checkbox" name="pocket" ng-model="settings.pocket" />
|
||||
<i class="icon-pocket"></i>
|
||||
Pocket
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<input type="checkbox" name="instapaper" ng-model="settings.instapaper" />
|
||||
<i class="icon-instapaper"></i>
|
||||
Instapaper
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<input type="checkbox" name="buffer" ng-model="settings.buffer" />
|
||||
<i class="icon-buffer"></i>
|
||||
Buffer
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<input type="checkbox" name="readability" ng-model="settings.readability" />
|
||||
<i class="icon-couch"></i>
|
||||
Readability
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane" ng-class="{active: tab == 'css'}">
|
||||
|
||||
Reference in New Issue
Block a user