mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
social sharing buttons
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -376,7 +376,7 @@
|
|||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<targetGroups>app</targetGroups>
|
<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>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ public class UserSettings extends AbstractModel {
|
|||||||
|
|
||||||
private boolean showRead;
|
private boolean showRead;
|
||||||
|
|
||||||
|
private boolean socialButtons;
|
||||||
|
|
||||||
@Lob
|
@Lob
|
||||||
@Column(length = Integer.MAX_VALUE)
|
@Column(length = Integer.MAX_VALUE)
|
||||||
private String customCss;
|
private String customCss;
|
||||||
@@ -80,4 +82,12 @@ public class UserSettings extends AbstractModel {
|
|||||||
this.showRead = showRead;
|
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)
|
@ApiProperty(value = "user wants category and feeds with no unread entries shown", required = true)
|
||||||
private boolean showRead;
|
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")
|
@ApiProperty(value = "user's custom css for the website")
|
||||||
private String customCss;
|
private String customCss;
|
||||||
|
|
||||||
@@ -59,4 +62,12 @@ public class Settings implements Serializable {
|
|||||||
this.showRead = showRead;
|
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.setReadingMode(settings.getReadingMode().name());
|
||||||
s.setReadingOrder(settings.getReadingOrder().name());
|
s.setReadingOrder(settings.getReadingOrder().name());
|
||||||
s.setShowRead(settings.isShowRead());
|
s.setShowRead(settings.isShowRead());
|
||||||
|
s.setSocialButtons(settings.isSocialButtons());
|
||||||
s.setCustomCss(settings.getCustomCss());
|
s.setCustomCss(settings.getCustomCss());
|
||||||
} else {
|
} else {
|
||||||
s.setReadingMode(ReadingMode.unread.name());
|
s.setReadingMode(ReadingMode.unread.name());
|
||||||
s.setReadingOrder(ReadingOrder.desc.name());
|
s.setReadingOrder(ReadingOrder.desc.name());
|
||||||
s.setShowRead(true);
|
s.setShowRead(true);
|
||||||
|
s.setSocialButtons(true);
|
||||||
}
|
}
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -237,6 +237,19 @@
|
|||||||
border-top: 1px solid #ebebeb;
|
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 {
|
#feed-accordion .entry-buttons label {
|
||||||
margin-bottom: 0px;
|
margin-bottom: 0px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
|||||||
@@ -1,5 +1,16 @@
|
|||||||
var module = angular.module('commafeed.directives', []);
|
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() {
|
module.directive('favicon', function() {
|
||||||
return {
|
return {
|
||||||
restrict : 'E',
|
restrict : 'E',
|
||||||
|
|||||||
@@ -7,9 +7,13 @@ module.filter('entryDate', function() {
|
|||||||
var formatted;
|
var formatted;
|
||||||
if (d.date() === now.date() && Math.abs(d.diff(now)) < 86400000) {
|
if (d.date() === now.date() && Math.abs(d.diff(now)) < 86400000) {
|
||||||
formatted = d.fromNow();
|
formatted = d.fromNow();
|
||||||
} else {
|
} else {
|
||||||
formatted = d.format('YYYY-MM-DD HH:mm');
|
formatted = d.format('YYYY-MM-DD HH:mm');
|
||||||
}
|
}
|
||||||
return formatted;
|
return formatted;
|
||||||
};
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
module.filter('escape', function() {
|
||||||
|
return encodeURIComponent;
|
||||||
});
|
});
|
||||||
@@ -34,10 +34,25 @@
|
|||||||
<source src="{{entry.enclosureUrl}}" type="{{entry.enclosureType}}" />
|
<source src="{{entry.enclosureUrl}}" type="{{entry.enclosureType}}" />
|
||||||
</audio>
|
</audio>
|
||||||
<div class="entry-buttons form-horizontal">
|
<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>
|
<input type="checkbox" ng-checked="!entry.read" ng-click="mark(entry, !entry.read)"></input>
|
||||||
Keep unread
|
Keep unread
|
||||||
</label>
|
</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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -26,6 +26,13 @@
|
|||||||
Show feeds and categories with no unread entries
|
Show feeds and categories with no unread entries
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
<div class="tab-pane" id="custom-css">
|
<div class="tab-pane" id="custom-css">
|
||||||
|
|||||||
Reference in New Issue
Block a user