-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathiframely.tpl
More file actions
127 lines (112 loc) · 4.3 KB
/
iframely.tpl
File metadata and controls
127 lines (112 loc) · 4.3 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
<form role="form" class="iframely-settings">
<div class="row">
<div class="col-sm-2 col-xs-12 settings-header">API Settings</div>
<div class="col-sm-10 col-xs-12">
<div class="alert alert-info">
<p>
Use Iframely as a cloud or self-hosted <a href="https://github.com/itteco/iframely" target="_blank">open-source</a> API.
</p>
<p>
Get cloud <a href="https://iframely.com" target="_blank">API key here</a>.
</p>
</div>
<div class="form-group">
<label for="endpoint">Endpoint address:</label>
<input type="text" id="endpoint" name="endpoint" title="End Point" class="form-control input-lg" placeholder="http:// endpoint" />
</div>
<div class="form-group">
<label for="endpoint">API key:</label>
<input type="text" id="apikey" name="apikey" title="API Key" class="form-control input-lg" placeholder="Your API Key" />
</div>
<div class="form-group">
<label for="endpoint">Cache Time-To-Live, days:</label>
<input type="text" id="cacheMaxAgeDays" name="cacheMaxAgeDays" title="Cache Time-To-Live, days" class="form-control input-lg" placeholder="Number of days to keep Iframely API data in memory cache, default 1 day" />
</div>
</div>
</div>
<div class="row">
<div class="col-sm-2 col-xs-12 settings-header">Disable parsing on negative votes</div>
<div class="col-sm-10 col-xs-12">
<div class="form-group">
<p>
Iframely uses +/- vote to check when to parse URL to show previews.
</p>
<label for="doNoteParseIfVotesLessThen">
Ignore URLs when +/- vote gets below this value (-10 by default):
</label>
<input type="text" id="doNoteParseIfVotesLessThen" name="doNoteParseIfVotesLessThen" class="form-control" placeholder="-10" />
</div>
</div>
</div>
<div class="row">
<div class="col-sm-2 col-xs-12 settings-header">Or ignore some domains</div>
<div class="col-sm-10 col-xs-12">
<p>
Iframely won't even try to parse URLs from these domains (e.g. your own domain makes sense here).
</p>
<div class="form-group">
<label for="blacklist">Domains to skip:</label>
<input type="text" id="blacklist" name="blacklist" class="form-control" placeholder="www.domain.com" />
</div>
</div>
</div>
<div class="row">
<div class="col-sm-2 col-xs-12 settings-header">Whitelist domains for IFramely service</div>
<div class="col-sm-10 col-xs-12">
<p>
If set, Iframely will use the Iframely service with these domains.
</p>
<div class="form-group">
<label for="whitelist">Domains for API Service:</label>
<input type="text" id="whitelist" name="whitelist" class="form-control" placeholder="www.domain.com" />
</div>
</div>
</div>
<div class="row">
<div class="col-sm-2 col-xs-12 settings-header">Image Proxy</div>
<div class="col-sm-10 col-xs-12">
<div class="form-group">
<p>
Optional (but recommended) <a href="https://github.com/atmos/camo" target="_blank">Camo</a> server settings to proxy images under SSL and avoid hot-linking.
</p>
<label for="endpoint">Camo Proxy Host:</label>
<input type="text" id="camoProxyHost" name="camoProxyHost" class="form-control input-lg" placeholder="http://" />
</div>
<div class="form-group">
<label for="endpoint">Camo Hash Key:</label>
<input type="text" id="camoProxyKey" name="camoProxyKey" class="form-control input-lg" placeholder="" />
</div>
</div>
</div>
</form>
<button id="save" class="floating-button mdl-button mdl-js-button mdl-button--fab mdl-js-ripple-effect mdl-button--colored">
<i class="material-icons">save</i>
</button>
<script>
require(['settings'], function(Settings) {
Settings.load('iframely', $('.iframely-settings'), function() {
function tagifyInput(selector) {
var input = $(selector).tagsinput({
confirmKeys: [13, 44],
trimValue: true
});
$(input[0]['$input']).addClass('form-control').parent().css('display', 'block');
}
tagifyInput('#blacklist');
tagifyInput('#whitelist');
});
$('#save').on('click', function() {
Settings.save('iframely', $('.iframely-settings'), function() {
app.alert({
type: 'success',
alert_id: 'iframely-saved',
title: 'Settings Saved',
message: 'Please reload your NodeBB to apply these settings',
clickfn: function() {
socket.emit('admin.reload');
}
});
});
});
});
</script>