This repository was archived by the owner on Sep 15, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathRemoteBlogSettings.swift
More file actions
206 lines (154 loc) · 6.14 KB
/
Copy pathRemoteBlogSettings.swift
File metadata and controls
206 lines (154 loc) · 6.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
import Foundation
/// This class encapsulates all of the *remote* settings available for a Blog entity
///
public class RemoteBlogSettings: NSObject {
// MARK: - General
/// Represents the Blog Name.
///
@objc public var name: String?
/// Stores the Blog's Tagline setting.
///
@objc public var tagline: String?
/// Stores the Blog's Privacy Preferences Settings
///
@objc public var privacy: NSNumber?
/// Stores the Blog's Language ID Setting
///
@objc public var languageID: NSNumber?
/// Stores the Blog's Icon Media ID
///
@objc public var iconMediaID: NSNumber?
/// Stores the Blog's GMT offset
///
@objc public var gmtOffset: NSNumber?
/// Stores the Blog's timezone
///
@objc public var timezoneString: String?
// MARK: - Writing
/// Contains the Default Category ID. Used when creating new posts.
///
@objc public var defaultCategoryID: NSNumber?
/// Contains the Default Post Format. Used when creating new posts.
///
@objc public var defaultPostFormat: String?
/// The blog's date format setting.
///
@objc public var dateFormat: String?
/// The blog's time format setting
///
@objc public var timeFormat: String?
/// The blog's chosen day to start the week setting
///
@objc public var startOfWeek: String?
/// Numbers of posts per page
///
@objc public var postsPerPage: NSNumber?
// MARK: - Discussion
/// Represents whether comments are allowed, or not.
///
@objc public var commentsAllowed: NSNumber?
/// Contains a list of words that would automatically blocklist a comment.
///
@objc public var commentsBlocklistKeys: String?
/// If true, comments will be automatically closed after the number of days, specified by `commentsCloseAutomaticallyAfterDays`.
///
@objc public var commentsCloseAutomatically: NSNumber?
/// Represents the number of days comments will be enabled, granted that the `commentsCloseAutomatically`
/// property is set to true.
///
@objc public var commentsCloseAutomaticallyAfterDays: NSNumber?
/// When enabled, comments from known users will be allowlisted.
///
@objc public var commentsFromKnownUsersAllowlisted: NSNumber?
/// Indicates the maximum number of links allowed per comment. When a new comment exceeds this number,
/// it'll be held in queue for moderation.
///
@objc public var commentsMaximumLinks: NSNumber?
/// Contains a list of words that cause a comment to require moderation.
///
@objc public var commentsModerationKeys: String?
/// If true, comment pagination will be enabled.
///
@objc public var commentsPagingEnabled: NSNumber?
/// Specifies the number of comments per page. This will be used only if the property `commentsPagingEnabled`
/// is set to true.
///
@objc public var commentsPageSize: NSNumber?
/// When enabled, new comments will require Manual Moderation, before showing up.
///
@objc public var commentsRequireManualModeration: NSNumber?
/// If set to true, commenters will be required to enter their name and email.
///
@objc public var commentsRequireNameAndEmail: NSNumber?
/// Specifies whether commenters should be registered or not.
///
@objc public var commentsRequireRegistration: NSNumber?
/// Indicates the sorting order of the comments. Ascending / Descending, based on the date.
///
@objc public var commentsSortOrder: String?
/// Indicates the number of levels allowed per comment.
///
@objc public var commentsThreadingDepth: NSNumber?
/// When enabled, comment threading will be supported.
///
@objc public var commentsThreadingEnabled: NSNumber?
/// If set to true, 3rd party sites will be allowed to post pingbacks.
///
@objc public var pingbackInboundEnabled: NSNumber?
/// When Outbound Pingbacks are enabled, 3rd party sites that get linked will be notified.
///
@objc public var pingbackOutboundEnabled: NSNumber?
// MARK: - Related Posts
/// When set to true, Related Posts will be allowed.
///
@objc public var relatedPostsAllowed: NSNumber?
/// When set to true, Related Posts will be enabled.
///
@objc public var relatedPostsEnabled: NSNumber?
/// Indicates whether related posts should show a headline.
///
@objc public var relatedPostsShowHeadline: NSNumber?
/// Indicates whether related posts should show thumbnails.
///
@objc public var relatedPostsShowThumbnails: NSNumber?
// MARK: - AMP
/// Indicates if AMP is supported on the site
///
@objc public var ampSupported: NSNumber?
/// Indicates if AMP is enabled on the site
///
@objc public var ampEnabled: NSNumber?
// MARK: - Sharing
/// Indicates the style to use for the sharing buttons on a particular blog..
///
@objc public var sharingButtonStyle: String?
/// The title of the sharing label on the user's blog.
///
@objc public var sharingLabel: String?
/// Indicates the twitter username to use when sharing via Twitter
///
@objc public var sharingTwitterName: String?
/// Indicates whether related posts should show thumbnails.
///
@objc public var sharingCommentLikesEnabled: NSNumber?
/// Indicates whether sharing via post likes has been disabled
///
@objc public var sharingDisabledLikes: NSNumber?
/// Indicates whether sharing by reblogging has been disabled
///
@objc public var sharingDisabledReblogs: NSNumber?
// MARK: - Helpers
/// Computed property, meant to help conversion from Remote / String-Based values, into their Integer counterparts
///
@objc public var commentsSortOrderAscending: Bool {
set {
commentsSortOrder = newValue ? RemoteBlogSettings.AscendingStringValue : RemoteBlogSettings.DescendingStringValue
}
get {
return commentsSortOrder == RemoteBlogSettings.AscendingStringValue
}
}
// MARK: - Private
private static let AscendingStringValue = "asc"
private static let DescendingStringValue = "desc"
}