forked from Archives/Athou_commafeed
social sharing buttons
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -376,7 +376,7 @@
|
||||
</goals>
|
||||
<configuration>
|
||||
<targetGroups>app</targetGroups>
|
||||
<options>display-property-grouping,duplicate-properties,adjoining-classes,compatible-vendor-prefixes,vendor-prefix</options>
|
||||
<options>display-property-grouping,duplicate-properties,compatible-vendor-prefixes,vendor-prefix</options>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
|
||||
@@ -36,6 +36,8 @@ public class UserSettings extends AbstractModel {
|
||||
|
||||
private boolean showRead;
|
||||
|
||||
private boolean socialButtons;
|
||||
|
||||
@Lob
|
||||
@Column(length = Integer.MAX_VALUE)
|
||||
private String customCss;
|
||||
@@ -80,4 +82,12 @@ public class UserSettings extends AbstractModel {
|
||||
this.showRead = showRead;
|
||||
}
|
||||
|
||||
public boolean isSocialButtons() {
|
||||
return socialButtons;
|
||||
}
|
||||
|
||||
public void setSocialButtons(boolean socialButtons) {
|
||||
this.socialButtons = socialButtons;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,6 +24,9 @@ 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 = "user's custom css for the website")
|
||||
private String customCss;
|
||||
|
||||
@@ -59,4 +62,12 @@ public class Settings implements Serializable {
|
||||
this.showRead = showRead;
|
||||
}
|
||||
|
||||
public boolean isSocialButtons() {
|
||||
return socialButtons;
|
||||
}
|
||||
|
||||
public void setSocialButtons(boolean socialButtons) {
|
||||
this.socialButtons = socialButtons;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -37,11 +37,13 @@ public class UserREST extends AbstractResourceREST {
|
||||
s.setReadingMode(settings.getReadingMode().name());
|
||||
s.setReadingOrder(settings.getReadingOrder().name());
|
||||
s.setShowRead(settings.isShowRead());
|
||||
s.setSocialButtons(settings.isSocialButtons());
|
||||
s.setCustomCss(settings.getCustomCss());
|
||||
} else {
|
||||
s.setReadingMode(ReadingMode.unread.name());
|
||||
s.setReadingOrder(ReadingOrder.desc.name());
|
||||
s.setShowRead(true);
|
||||
s.setSocialButtons(true);
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
@@ -237,6 +237,19 @@
|
||||
border-top: 1px solid #ebebeb;
|
||||
}
|
||||
|
||||
#feed-accordion .entry-buttons .checkbox.inline {
|
||||
padding-top: 0px;
|
||||
}
|
||||
|
||||
#feed-accordion .share-buttons a {
|
||||
color: #333333;
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
#feed-accordion .share-buttons a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#feed-accordion .entry-buttons label {
|
||||
margin-bottom: 0px;
|
||||
font-size: 12px;
|
||||
|
||||
@@ -1,5 +1,16 @@
|
||||
var module = angular.module('commafeed.directives', []);
|
||||
|
||||
module.directive('popup', function() {
|
||||
return {
|
||||
link : function(scope, elm, attrs) {
|
||||
elm.bind('click', function(event) {
|
||||
window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');
|
||||
event.preventDefault();
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
module.directive('favicon', function() {
|
||||
return {
|
||||
restrict : 'E',
|
||||
|
||||
@@ -7,9 +7,13 @@ module.filter('entryDate', function() {
|
||||
var formatted;
|
||||
if (d.date() === now.date() && Math.abs(d.diff(now)) < 86400000) {
|
||||
formatted = d.fromNow();
|
||||
} else {
|
||||
formatted = d.format('YYYY-MM-DD HH:mm');
|
||||
}
|
||||
return formatted;
|
||||
} else {
|
||||
formatted = d.format('YYYY-MM-DD HH:mm');
|
||||
}
|
||||
return formatted;
|
||||
};
|
||||
});
|
||||
|
||||
module.filter('escape', function() {
|
||||
return encodeURIComponent;
|
||||
});
|
||||
@@ -34,10 +34,25 @@
|
||||
<source src="{{entry.enclosureUrl}}" type="{{entry.enclosureType}}" />
|
||||
</audio>
|
||||
<div class="entry-buttons form-horizontal">
|
||||
<label class="checkbox">
|
||||
<label class="checkbox inline">
|
||||
<input type="checkbox" ng-checked="!entry.read" ng-click="mark(entry, !entry.read)"></input>
|
||||
Keep unread
|
||||
</label>
|
||||
|
||||
<span class="share-buttons" ui-if="settingsService.settings.socialButtons">
|
||||
<a href="mailto:?subject={{entry.title}}&body={{entry.url}}" popup>
|
||||
<i class="icon-envelope"></i>
|
||||
</a>
|
||||
<a href="http://www.facebook.com/sharer.php?u=={{entry.url|escape}}" popup>
|
||||
<i class="icon-facebook"></i>
|
||||
</a>
|
||||
<a href="http://twitter.com/share?text={{entry.title}}&url={{entry.url|escape}}" popup>
|
||||
<i class="icon-twitter"></i>
|
||||
</a>
|
||||
<a href="https://plus.google.com/share?url={{entry.url|escape}}" popup>
|
||||
<i class="icon-google-plus"></i>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -26,6 +26,13 @@
|
||||
Show feeds and categories with no unread entries
|
||||
</label>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="socialButtons"
|
||||
ng-model="settings.socialButtons" />
|
||||
Show social sharing buttons
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane" id="custom-css">
|
||||
|
||||
Reference in New Issue
Block a user