This repository has been archived by the owner on Feb 16, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
/
static_config.js.erb
79 lines (72 loc) · 3.13 KB
/
static_config.js.erb
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
moment.relativeTime = {
future: "in %s",
past: "%s",
s: "%ds",
m: "1m",
mm: "%dm",
h: "1h",
hh: "%dh",
d: "1d",
dd: "%dd",
M: "1mo",
MM: "%dmo",
y: "ay",
yy: "%dy"
}
if (!window.TentStatus)
window.TentStatus = {}
TentStatus.config = {
POST_TYPES: {
META: "https://tent.io/types/meta/v0#",
SUBSCRIBER: 'https://tent.io/types/relationship/v0#subscriber',
SUBSCRIBING: 'https://tent.io/types/relationship/v0#subscribing',
RELATIONSHIP: 'https://tent.io/types/relationship/v0',
STATUS: 'https://tent.io/types/status/v0#',
STATUS_REPLY: 'https://tent.io/types/status/v0#reply',
WILDCARD_STATUS: 'https://tent.io/types/status/v0',
REPOST: 'https://tent.io/types/repost/v0',
STATUS_REPOST: 'https://tent.io/types/repost/v0#https://tent.io/types/status/v0',
REPLIES_CURSOR: 'https://tent.io/types/cursor/v0#https://tent.io/rels/status-replies',
REPOSTS_CURSOR: 'https://tent.io/types/cursor/v0#https://tent.io/rels/status-reposts',
FEED_CURSOR: 'https://tent.io/types/cursor/v0#https://tent.io/rels/status-feed',
SUBSCRIPTION: 'https://tent.io/types/subscription/v0#',
STATUS_SUBSCRIPTION: 'https://tent.io/types/subscription/v0#https://tent.io/types/status/v0',
REPOST_SUBSCRIPTION: 'https://tent.io/types/subscription/v0#https://tent.io/types/repost/v0',
WILDCARD_SUBSCRIPTION: 'https://tent.io/types/subscription/v0#all'
},
PER_PAGE: 20,
CONVERSATION_PER_PAGE: 10,
FETCH_INTERVAL: 3000,
MAX_FETCH_LATENCY: 30000,
URL_TRIM_LENGTH: 30,
MAX_STATUS_LENGTH: 256,
BASE_TITLE: <%= Yajl::Encoder.encode(TentStatus.settings[:name]) %>,
DEFAULT_AVATAR_URL: <%= Yajl::Encoder.encode(TentStatus.settings[:default_avatar_url]) %>,
PLACEHOLDER_AVATAR_URL: <%= Yajl::Encoder.encode(TentStatus.settings[:default_avatar_url]) %>,
JSON_CONFIG_URL: <%= Yajl::Encoder.encode(TentStatus.settings[:json_config_url]) %>,
SIGNOUT_URL: <%= Yajl::Encoder.encode(TentStatus.settings[:signout_url]) %>,
SIGNOUT_REDIRECT_URL: <%= Yajl::Encoder.encode(TentStatus.settings[:signout_redirect_url]) %>,
PATH_PREFIX: <%= Yajl::Encoder.encode(TentStatus.settings[:path_prefix]) %>,
services: {
avatar_proxy_host: <%= Yajl::Encoder.encode(TentStatus.settings[:avatar_proxy_host]) %>,
entity_search_api_root: <%= Yajl::Encoder.encode(TentStatus.settings[:entity_search_api_root]) %>,
entity_search_api_key: <%= Yajl::Encoder.encode(TentStatus.settings[:entity_search_api_root]) %>,
search_api_root: <%= Yajl::Encoder.encode(TentStatus.settings[:search_api_root]) %>,
search_api_key: <%= Yajl::Encoder.encode(TentStatus.settings[:search_api_key]) %>
}
}
TentStatus.config.repost_types = [
TentStatus.config.POST_TYPES.STATUS_REPOST,
]
TentStatus.config.feed_types = [
TentStatus.config.POST_TYPES.STATUS
].concat(TentStatus.config.repost_types)
TentStatus.config.subscription_feed_types = [
TentStatus.config.POST_TYPES.STATUS_SUBSCRIPTION,
TentStatus.config.POST_TYPES.REPOST_SUBSCRIPTION,
TentStatus.config.POST_TYPES.WILDCARD_SUBSCRIPTION
]
TentStatus.config.subscription_types = [
TentStatus.config.POST_TYPES.WILDCARD_STATUS,
TentStatus.config.POST_TYPES.STATUS_REPOST
]