Skip to content
This repository was archived by the owner on Dec 23, 2021. It is now read-only.

Commit 923f070

Browse files
committed
add titles
1 parent be9d34a commit 923f070

11 files changed

Lines changed: 25 additions & 38 deletions

File tree

client/js/app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ app.use(require('./models/township'))
1515
app.use(require('./models/profile'))
1616
app.use(require('./models/message'))
1717
app.use(require('./models/preview'))
18+
app.use(require('./plugins/analytics'))
1819

1920
css('tachyons')
2021
css('dat-colors')

client/js/pages/archive/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const archivePage = (state, emit) => {
2222
var err = state.archive.error
2323
if (!module.parent && state.archive.retries < 3) emit('archive:getMetadata', {timeout: 3000})
2424
if (err) {
25+
emit(state.events.DOMTITLECHANGE, 'Error Loading Dat | datBase')
2526
if (err.message === 'Block not downloaded') err.message = 'timed out'
2627
if (!state.archive.entries.length) {
2728
if (state.archive.retries >= 3) err = {message: 'too many retries'}
@@ -39,6 +40,9 @@ const archivePage = (state, emit) => {
3940
var meta = state.archive.metadata
4041
var title = meta && meta.title || meta.shortname || state.archive.key
4142
var description = meta && meta.description
43+
44+
emit(state.events.DOMTITLECHANGE, `${title} | DatBase`)
45+
4246
var styles = css`
4347
:host {
4448
.dat-header {

client/js/pages/auth/edit-profile.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ var prefix = css`
1212
`
1313

1414
module.exports = (state, emit) => {
15+
emit(state.events.DOMTITLECHANGE, 'Edit Profile | datBase')
16+
1517
function onSubmit (e) {
1618
const data = form(e.target)
1719
data.id = state.township.profile.id

client/js/pages/auth/login.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const header = require('./../../components/header')
33
const login = require('./../../components/auth/login')
44

55
module.exports = (state, emit) => {
6+
emit(state.events.DOMTITLECHANGE, 'Login | datBase')
67
return html`
78
<div class="landing">
89
${header(state, emit)}

client/js/pages/auth/profile.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,15 @@ function placeholder () {
3636

3737
module.exports = (state, emit) => {
3838
if (state.error) {
39+
emit(state.events.DOMTITLECHANGE, 'Error | datBase')
3940
return html`
4041
<div>
4142
${header(state, emit)}
4243
${fourohfour()}
4344
</div>
4445
`
4546
}
47+
emit(state.events.DOMTITLECHANGE, `${state.profile.username} | datBase`)
4648

4749
var username = state.profile.username
4850
var email = state.profile.email

client/js/pages/auth/register.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const register = require('./../../components/auth/register')
33
const header = require('./../../components/header')
44

55
module.exports = (state, emit) => {
6+
emit(state.events.DOMTITLECHANGE, 'Register | datBase')
67
return html`
78
<div class="landing">
89
${header(state, emit)}

client/js/pages/auth/reset-password.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ const header = require('./../../components/header')
55
const form = require('get-form-data')
66

77
function body (state, emit) {
8-
// const authenticated = state.township.username
8+
emit(state.events.DOMTITLECHANGE, 'Reset Password | datBase')
9+
// const authenticated = state.township.username
910
var query = {}
1011
if (!module.parent) query = url.parse(window.location.href).query
1112
const {accountKey, resetToken, email} = querystring.parse(query)

client/js/pages/fourohfour.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const wrapper = require('./wrapper')
33
const four = require('../elements/404')
44

55
module.exports = wrapper(function fourohfour (state, emit) {
6+
emit(state.events.DOMTITLECHANGE, '404 - Page Not Found')
67
return html`
78
<div>
89
${four()}

client/js/pages/landing/index.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -118,22 +118,4 @@ module.exports = function (state, emit) {
118118
${footer()}
119119
</div>
120120
`
121-
122-
function search () {
123-
const keydown = (e) => {
124-
if (e.keyCode === 13) {
125-
var link = e.target.value
126-
e.target.value = ''
127-
emit('archive:view', link)
128-
}
129-
}
130-
131-
const searchIcon = datIcon('search', {class: 'bg-white absolute top-1 ml1 left-0 h2 w2 color-green'})
132-
return html`
133-
<div class="relative dat-input db">
134-
${searchIcon}
135-
<input style="overflow:hidden;" class="f3 pv3 pr4 pl3 indent w-100 dat-input__input h3" name="import-dat" type="text" placeholder="preview dat://" onkeydown=${keydown} />
136-
</div>
137-
`
138-
}
139121
}

client/js/pages/publish/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const html = require('choo/html')
22
const wrapper = require('../wrapper')
33

44
const publish = (state, emit) => {
5+
emit(state.events.DOMTITLECHANGE, 'Publish Data | datBase')
56
return html`
67
<div class="">
78
<section class="section bg-splash-02" id="publish">

0 commit comments

Comments
 (0)