+5
-1
decent/modules_basic/avatar-edit.js
+5
-1
decent/modules_basic/avatar-edit.js
···
48
48
exports.needs = {
49
49
message_confirm: 'first',
50
50
blob_url: 'first',
51
+
blobs_url: 'first',
51
52
sbot_links: 'first',
52
53
avatar_name: 'first'
53
54
}
···
111
112
img.src = data
112
113
var _data = dataurl.parse(data)
113
114
var xhr = new XMLHttpRequest()
114
-
xhr.open('POST', '/blobs/add', true)
115
+
var blobsUrl = api.blobs_url()
116
+
var addUrl = blobsUrl.replace(/\/blobs\/get\/?$/, '/blobs/add')
117
+
if (addUrl === blobsUrl) addUrl = '/blobs/add'
118
+
xhr.open('POST', addUrl, true)
115
119
xhr.responseType = 'text'
116
120
xhr.onload = function () {
117
121
if (xhr.status < 200 || xhr.status >= 300) {
+11
-10
decent/modules_basic/avatar-profile.js
+11
-10
decent/modules_basic/avatar-profile.js
···
71
71
72
72
73
73
return h('div.column.profile',
74
-
api.avatar_edit(id),
75
-
api.avatar_action(id),
76
-
h('div.profile__relationships.column',
77
-
h('strong', 'follows'),
78
-
follows_el,
79
-
h('strong', 'friends'),
80
-
friends_el,
81
-
h('strong', 'followers'),
82
-
followers_el
74
+
h('div.message.message-card',
75
+
api.avatar_edit(id),
76
+
api.avatar_action(id),
77
+
h('div.profile__relationships.column',
78
+
h('strong', 'follows'),
79
+
follows_el,
80
+
h('strong', 'friends'),
81
+
friends_el,
82
+
h('strong', 'followers'),
83
+
followers_el
84
+
)
83
85
)
84
86
)
85
87
}
86
88
87
89
}
88
-
-2
decent/modules_basic/feed.js
-2
decent/modules_basic/feed.js
+2
-2
decent/modules_basic/private.js
+2
-2
decent/modules_basic/private.js
···
46
46
47
47
return {
48
48
builtin_tabs: function () {
49
-
return ['/private']
49
+
return ['private']
50
50
},
51
51
52
52
screen_view: function (path) {
53
-
if(path !== '/private') return
53
+
if(path !== 'private') return
54
54
55
55
var div = h('div.column.scroller',
56
56
{style: {'overflow':'auto'}})
+2
-2
decent/modules_basic/public.js
+2
-2
decent/modules_basic/public.js
···
47
47
48
48
return {
49
49
builtin_tabs: function () {
50
-
return ['/public']
50
+
return ['public']
51
51
},
52
52
53
53
screen_view: function (path, sbot) {
54
-
if(path === '/public') {
54
+
if(path === 'public') {
55
55
56
56
var content = h('div.column.scroller__content')
57
57
var div = h('div.column.scroller',
+1
-1
decent/modules_basic/setup.js
+1
-1
decent/modules_basic/setup.js
+16
-13
decent/modules_core/app.js
+16
-13
decent/modules_core/app.js
···
22
22
23
23
function getRoute () {
24
24
var raw = window.location.hash.substring(1).trim()
25
-
if (!raw || raw === 'tabs') return '/public'
26
-
if (raw[0] === '/' || raw[0] === '@' || raw[0] === '%' || raw[0] === '#')
27
-
return raw
28
-
return '/' + raw
25
+
if (!raw || raw === 'tabs') return 'public'
26
+
if (raw[0] === '@' || raw[0] === '%' || raw[0] === '#') return raw
27
+
if (raw[0] === '/') return raw.slice(1)
28
+
return raw
29
29
}
30
30
31
31
function renderRoute (route, container) {
···
44
44
setTitle(route, view)
45
45
}
46
46
47
+
var selfId = require('../keys').id
47
48
var navItems = [
48
-
{route: '/public', label: 'Public', icon: 'public'},
49
-
{route: '/private', label: 'Private', icon: 'lock'},
50
-
{route: '/notifications', label: 'Notifications', icon: 'notifications'},
51
-
{route: '/key', label: 'Key', icon: 'key'}
49
+
{route: 'public', label: 'Public', icon: 'public'},
50
+
{route: selfId, label: 'Profile', icon: 'person'},
51
+
{route: 'private', label: 'Private', icon: 'lock'},
52
+
{route: 'notifications', label: 'Notifications', icon: 'notifications'},
53
+
{route: 'key', label: 'Key', icon: 'key'}
52
54
]
53
55
54
56
var nav = h('ul.nav.pull-left', navItems.map(function (item) {
···
63
65
var header = h('div.navbar',
64
66
h('div.navbar-inner',
65
67
h('div.container-fluid',
68
+
h('a.brand', {href: '#public'}, 'Decent'),
66
69
nav,
67
70
h('div.pull-right', api.menu())
68
71
)
···
86
89
var base = 'Decent SSB'
87
90
var suffix = (view && view.title) || null
88
91
if (!suffix) {
89
-
if (route === '/public') suffix = 'Public'
90
-
else if (route === '/private') suffix = 'Private'
91
-
else if (route === '/notifications') suffix = 'Notifications'
92
-
else if (route === '/key') suffix = 'Key'
93
-
else if (route.indexOf('/channel/') === 0) suffix = 'Channel ' + route.slice(9)
92
+
if (route === 'public') suffix = 'Public'
93
+
else if (route === 'private') suffix = 'Private'
94
+
else if (route === 'notifications') suffix = 'Notifications'
95
+
else if (route === 'key') suffix = 'Key'
96
+
else if (route.indexOf('channel/') === 0) suffix = 'Channel ' + route.slice(8)
94
97
else if (route[0] === '@') suffix = 'Profile'
95
98
else if (route[0] === '%') suffix = 'Thread'
96
99
else if (route[0] === '#') suffix = 'Message'
+9
-2
decent/modules_core/file-input.js
+9
-2
decent/modules_core/file-input.js
···
7
7
var fileInputId = 0
8
8
9
9
module.exports = {
10
-
needs: {},
10
+
needs: {blobs_url: 'first'},
11
11
gives: 'file_input',
12
12
create: function (api) {
13
13
14
+
function blobsAddUrl () {
15
+
var url = api.blobs_url && api.blobs_url()
16
+
if (!url) return '/blobs/add'
17
+
var addUrl = url.replace(/\/blobs\/get\/?$/, '/blobs/add')
18
+
return addUrl === url ? '/blobs/add' : addUrl
19
+
}
20
+
14
21
function uploadViaHttp (file, cb) {
15
22
var xhr = new XMLHttpRequest()
16
-
xhr.open('POST', '/blobs/add', true)
23
+
xhr.open('POST', blobsAddUrl(), true)
17
24
xhr.responseType = 'text'
18
25
xhr.onload = function () {
19
26
if (xhr.status >= 200 && xhr.status < 300)
+2
-2
decent/modules_extra/git-ssb.js
+2
-2
decent/modules_extra/git-ssb.js
···
21
21
exports.create = function (api) {
22
22
return {
23
23
menu_items: function () {
24
-
return h('a', {href: '#/git-ssb'}, '/git-ssb')
24
+
return h('a', {href: '#git-ssb'}, 'Git SSB')
25
25
},
26
26
27
27
screen_view: function (path, sbot) {
28
-
if(path === '/git-ssb') {
28
+
if(path === 'git-ssb') {
29
29
30
30
var content = h('div.column.scroller__content')
31
31
var div = h('div.column.scroller',
+4
-4
decent/modules_extra/key.js
+4
-4
decent/modules_extra/key.js
···
18
18
exports.create = function (api) {
19
19
return {
20
20
menu_items: function () {
21
-
return h('a', {href: '#/key'}, '/key')
21
+
return h('a', {href: '#key'}, 'Key')
22
22
},
23
23
screen_view: function (path, sbot) {
24
-
if(path === '/key') {
24
+
if(path === 'key') {
25
25
if(process.title === 'browser') {
26
26
var storedSecret = null
27
27
try { storedSecret = localStorage['browser/.ssb/secret'] } catch (_) {}
···
39
39
{style: {'overflow':'auto'}},
40
40
h('div.scroller__wrapper',
41
41
h('div.column.scroller__content',
42
-
h('div.message',
42
+
h('div.message.message-card',
43
43
h('p', {innerHTML: 'Your secret key is: <pre><code>' + (storedSecret || '') + '</code></pre>'}),
44
44
h('form',
45
45
importKey,
···
55
55
)
56
56
return div
57
57
} else {
58
-
return h('p', 'Your key is saved at .ssb/secret')
58
+
return h('div.message.message-card', 'Your key is saved at .ssb/secret')
59
59
}
60
60
}
61
61
}
+3
-4
decent/modules_extra/network.js
+3
-4
decent/modules_extra/network.js
···
106
106
107
107
return {
108
108
menu_items: function () {
109
-
return h('a', {href: '#/network'}, '/network')
109
+
return h('a', {href: '#network'}, 'Network')
110
110
},
111
111
112
112
builtin_tabs: function () {
113
-
return ['/network']
113
+
return ['network']
114
114
},
115
115
116
116
screen_view: function (path) {
117
117
118
-
if(path !== '/network') return
118
+
if(path !== 'network') return
119
119
120
120
var ol = h('ul.network')
121
121
···
173
173
}
174
174
}
175
175
176
-
+2
-2
decent/modules_extra/notifications.js
+2
-2
decent/modules_extra/notifications.js
···
117
117
118
118
return {
119
119
builtin_tabs: function () {
120
-
return ['/notifications']
120
+
return ['notifications']
121
121
},
122
122
123
123
screen_view: function (path) {
124
-
if(path === '/notifications') {
124
+
if(path === 'notifications') {
125
125
var ids = {}
126
126
var oldest
127
127
+3
-3
decent/modules_extra/query.js
+3
-3
decent/modules_extra/query.js
···
16
16
17
17
return {
18
18
menu_items: function () {
19
-
return h('a', {href:'#/query'}, '/query')
19
+
return h('a', {href:'#query'}, 'Query')
20
20
},
21
21
22
22
builtin_tabs: function () {
23
-
return ['/query']
23
+
return ['query']
24
24
},
25
25
26
26
screen_view: function (path) {
27
-
if(path != '/query') return
27
+
if(path != 'query') return
28
28
var output, status, editor, stream, query
29
29
30
30
function parse () {
+4
-4
decent/modules_extra/versions.js
+4
-4
decent/modules_extra/versions.js
···
10
10
11
11
return {
12
12
menu_items: function () {
13
-
return h('a', {href: '#/versions'}, '/versions')
13
+
return h('a', {href: '#versions'}, 'Versions')
14
14
},
15
15
16
16
builtin_tabs: function () {
17
-
return ['/versions']
17
+
return ['versions']
18
18
},
19
19
20
20
screen_view: function (path) {
21
-
if(path !== '/versions') return
21
+
if(path !== 'versions') return
22
22
23
23
if('undefined' === typeof WebBoot)
24
24
return h('h1', 'must run with web-boot enabled enviroment')
···
30
30
content.appendChild(
31
31
h('div.row',
32
32
h('a', {
33
-
href: '#/run:'+e.value,
33
+
href: '#run:'+e.value,
34
34
onclick: function () {
35
35
WebBoot.run(e.value, function () {
36
36
console.log('rebooting to:', e.value)
+9
-1
decent/style.css
+9
-1
decent/style.css
···
81
81
max-width: 680px;
82
82
margin-left: auto;
83
83
margin-right: auto;
84
-
padding: 0 20px 20px;
84
+
padding: 0 0 20px;
85
85
}
86
86
87
87
.message img {
···
261
261
margin-bottom: 0;
262
262
}
263
263
264
+
.navbar .brand {
265
+
padding-left: 0;
266
+
margin-left: 0;
267
+
padding-right: 10px;
268
+
}
269
+
264
270
.navbar .container-fluid {
265
271
display: flex;
266
272
align-items: center;
267
273
gap: 8px;
274
+
padding-left: 0;
275
+
padding-right: 0;
268
276
}
269
277
270
278
.navbar .nav.pull-left {