git ssb

3+

ev / decent



Commit 2b01b5c2818fda8e431f9a8f21b7e85ad6202fbc

make it possible to change appname in client

Ev Bogue committed on 1/25/2018, 5:39:47 PM
Parent: 9ebf933b72487a71c384b6a76c68ba99c92926ee

Files changed

client/modules/key.jschanged
config/inject.jschanged
client/modules/key.jsView
@@ -14,8 +14,9 @@
1414 screen_view: function (path, sbot) {
1515 if(path === 'Key') {
1616 if(process.title === 'browser') {
1717 console.log(config.path)
18 + var appName = h('input.import', {placeholder: localStorage.appname, name:'textarea', style: 'width: 50%'})
1819 var importKey = h('textarea.import', {placeholder: 'Import your Decent public/private key', name: 'textarea', style: 'width: 97%; height: 100px;'})
1920 var importRemote = h('textarea.import', {placeholder: 'Import a new Decent websocket remote', name: 'textarea', style: 'width: 97%;'})
2021 var content = h('div.column.scroller__content')
2122 var div = h('div.column.scroller',
@@ -64,9 +65,20 @@
6465 alert('Your websocket remote has been updated')
6566 }
6667 location.hash = ""
6768 location.reload()
68- }}, 'Import remote')
69 + }}, 'Import remote'),
70 + h('hr'),
71 + appName,
72 + h('button.btn.btn-success', {onclick: function (e){
73 + if(appName.value) {
74 + localStorage.appname = appName.value
75 + e.preventDefault()
76 + alert('Your appname is set to '+ localStorage.appname)
77 + }
78 + location.hash = ""
79 + location.reload()
80 + }}, 'Change appname'),
6981 )
7082 )
7183 )
7284 )
config/inject.jsView
@@ -10,9 +10,9 @@
1010 module.exports = function (name, override) {
1111 //name = name || 'ssb'
1212 //name = name || 'testnet'
1313 if(name == null)
14- name = 'decent' || localStorage.appname
14 + name = localStorage.appname || 'decent'
1515
1616 console.log('Using the ' + name + ' config')
1717
1818 var network

Built with git-ssb-web