@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1/**
2 * @requires javelin-behavior
3 * javelin-dom
4 * javelin-uri
5 * phabricator-notification
6 * @provides javelin-behavior-setup-check-https
7 */
8
9JX.behavior('setup-check-https', function(config) {
10
11 var server_https = config.server_https;
12
13 var client_uri = new JX.URI(window.location.href);
14 var client_protocol = client_uri.getProtocol();
15 var client_https = (client_protocol === 'https');
16
17 if (server_https === client_https) {
18 return;
19 }
20
21 var doc_link = JX.$N(
22 'a',
23 {
24 href: config.doc_href,
25 target: '_blank'
26 },
27 config.doc_name);
28
29 var content = [
30 config.message,
31 ' ',
32 doc_link,
33 ];
34
35 new JX.Notification()
36 .alterClassName('jx-notification-alert', true)
37 .setContent(content)
38 .setDuration(0)
39 .show();
40});