import java.util.logging.Level;
import java.util.logging.Logger;
+ import net.pterodactylus.sone.core.Options;
import net.pterodactylus.sone.freenet.wot.Identity;
import net.pterodactylus.sone.template.SoneAccessor;
+ import net.pterodactylus.util.filter.Filter;
import net.pterodactylus.util.logging.Logging;
+import net.pterodactylus.util.validation.Validation;
import freenet.keys.FreenetURI;
/**
/** The IDs of all liked replies. */
private final Set<String> likedReplyIds = Collections.synchronizedSet(new HashSet<String>());
+ /** The albums of this Sone. */
+ private final List<Album> albums = Collections.synchronizedList(new ArrayList<Album>());
+
+ /** Sone-specific options. */
+ private final Options options = new Options();
+
/**
* Creates a new Sone.
*
}
/**
+ * Returns the albums of this Sone.
+ *
+ * @return The albums of this Sone
+ */
+ public List<Album> getAlbums() {
+ return Collections.unmodifiableList(albums);
+ }
+
+ /**
+ * Adds an album to this Sone.
+ *
+ * @param album
+ * The album to add
+ */
+ public synchronized void addAlbum(Album album) {
+ Validation.begin().isNotNull("Album", album).check().isEqual("Album Owner", album.getSone(), this).check();
+ albums.add(album);
+ }
+
+ /**
+ * Sets the albums of this Sone.
+ *
+ * @param albums
+ * The albums of this Sone
+ */
+ public synchronized void setAlbums(Collection<? extends Album> albums) {
+ Validation.begin().isNotNull("Albums", albums).check();
+ this.albums.clear();
+ for (Album album : albums) {
+ addAlbum(album);
+ }
+ }
+
+ /**
+ * Removes an album from this Sone.
+ *
+ * @param album
+ * The album to remove
+ */
+ public synchronized void removeAlbum(Album album) {
+ Validation.begin().isNotNull("Album", album).check().isEqual("Album Owner", album.getSone(), this).check();
+ albums.remove(album);
+ }
+
++ /**
+ * Returns Sone-specific options.
+ *
+ * @return The options of this Sone
+ */
+ public Options getOptions() {
+ return options;
+ }
+
//
// FINGERPRINTABLE METHODS
//
import net.pterodactylus.sone.freenet.wot.Trust;
import net.pterodactylus.sone.main.SonePlugin;
import net.pterodactylus.sone.notify.ListNotification;
+import net.pterodactylus.sone.template.AlbumAccessor;
import net.pterodactylus.sone.template.CollectionAccessor;
import net.pterodactylus.sone.template.CssClassNameFilter;
- import net.pterodactylus.sone.template.GetPagePlugin;
+ import net.pterodactylus.sone.template.HttpRequestAccessor;
import net.pterodactylus.sone.template.IdentityAccessor;
+import net.pterodactylus.sone.template.ImageLinkFilter;
import net.pterodactylus.sone.template.JavascriptFilter;
import net.pterodactylus.sone.template.NotificationManagerAccessor;
import net.pterodactylus.sone.template.ParserFilter;
templateContextFactory.addFilter("unknown", new UnknownDateFilter(getL10n(), "View.Sone.Text.UnknownDate"));
templateContextFactory.addFilter("format", new FormatFilter());
templateContextFactory.addFilter("sort", new CollectionSortFilter());
+ templateContextFactory.addFilter("image-link", new ImageLinkFilter(templateContextFactory));
+ templateContextFactory.addFilter("replyGroup", new ReplyGroupFilter());
templateContextFactory.addProvider(Provider.TEMPLATE_CONTEXT_PROVIDER);
templateContextFactory.addProvider(new ClassPathTemplateProvider());
templateContextFactory.addTemplateObject("formPassword", formPassword);
View.Trust.Tooltip.Distrust=Assign negative trust to this person
View.Trust.Tooltip.Untrust=Remove your trust assignment for this person
+View.CreateAlbum.Title=Create Album
+View.CreateAlbum.Label.Name=Name:
+View.CreateAlbum.Label.Description=Description:
+
+View.UploadImage.Title=Upload Image
+View.UploadImage.Label.Title=Title:
+View.UploadImage.Label.Description=Description:
+View.UploadImage.Button.UploadImage=Upload Image
+
+ View.Time.InTheFuture=in the future
+ View.Time.AFewSecondsAgo=a few seconds ago
+ View.Time.HalfAMinuteAgo=about half a minute ago
+ View.Time.AMinuteAgo=about a minute ago
+ View.Time.XMinutesAgo=${min} minutes ago
+ View.Time.HalfAnHourAgo=half an hour ago
+ View.Time.AnHourAgo=about an hour ago
+ View.Time.XHoursAgo=${hour} hours ago
+ View.Time.ADayAgo=about a day ago
+ View.Time.XDaysAgo=${day} days ago
+ View.Time.AWeekAgo=about a week ago
+ View.Time.XWeeksAgo=${week} week ago
+ View.Time.AMonthAgo=about a month ago
+ View.Time.XMonthsAgo=${month} months ago
+ View.Time.AYearAgo=about a year ago
+ View.Time.XYearsAgo=${year} years ago
+
WebInterface.DefaultText.StatusUpdate=What’s on your mind?
WebInterface.DefaultText.Message=Write a Message…
WebInterface.DefaultText.Reply=Write a Reply…
WebInterface.DefaultText.BirthYear=Year
WebInterface.DefaultText.FieldName=Field name
WebInterface.DefaultText.Option.InsertionDelay=Time to wait after a Sone is modified before insert (in seconds)
-WebInterface.DefaultText.Search=What are you looking for?
+WebInterface.DefaultText.Search=What are you looking for?
+WebInterface.DefaultText.CreateAlbum.Name=Album title
+WebInterface.DefaultText.CreateAlbum.Description=Album description
+WebInterface.DefaultText.EditAlbum.Title=Album title
+WebInterface.DefaultText.EditAlbum.Description=Album description
+WebInterface.DefaultText.UploadImage.Title=Image title
+WebInterface.DefaultText.UploadImage.Description=Image description
+WebInterface.DefaultText.EditImage.Title=Image title
+WebInterface.DefaultText.EditImage.Description=Image description
+ WebInterface.DefaultText.Option.PostsPerPage=Number of posts to show on a page
+ WebInterface.DefaultText.Option.PositiveTrust=The positive trust to assign
+ WebInterface.DefaultText.Option.NegativeTrust=The negative trust to assign
+ WebInterface.DefaultText.Option.TrustComment=The comment to set in the web of trust
WebInterface.Confirmation.DeletePostButton=Yes, delete!
WebInterface.Confirmation.DeleteReplyButton=Yes, delete!
WebInterface.SelectBox.Choose=Choose…
position: relative;
}
+#sone .backlinks {
+ font-size: 80%;
+}
+
+#sone .backlinks .backlink {
+ display: inline;
+}
+
+#sone .album {
+}
+
+#sone .image {
+ width: 200px;
+ height: 150px;
+ display: table-cell;
+ vertical-align: middle;
+ text-align: center;
+ padding: 0.5ex;
+}
+
+#sone .image img, #sone .single-image img {
+ padding: 1ex;
+ border: solid 1px #000;
+ background-color: #fff;
+}
+
+#sone .backlinks .separator {
+ display: inline;
+}
+
+ #sone #search {
+ text-align: right;
+ }
+
+ #sone #search input[type=text] {
+ width: 35em;
+ }
+
+ #sone #sone-results + #sone #post-results {
+ clear: both;
+ padding-top: 1em;
+ }
+
#sone #tail {
margin-top: 1em;
border-top: solid 1px #ccc;