Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Commit

Permalink
Remove all application tooling from the shell window
Browse files Browse the repository at this point in the history
  • Loading branch information
pfrazee committed Aug 5, 2019
1 parent 991d891 commit 3e63dde
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 90 deletions.
15 changes: 1 addition & 14 deletions app/background-process/ui/view-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ const STATE_VARS = [
'donateLinkHref',
'isLiveReloading',
'previewMode',
'uncommittedChanges',
'applicationState'
'uncommittedChanges'
]

// globals
Expand Down Expand Up @@ -163,7 +162,6 @@ class View {
this.availableAlternative = '' // tracks if there's alternative protocol available for the site
this.wasDatTimeout = false // did the last navigation result in a timed-out dat?
this.uncommittedChanges = false // does the preview have uncommitted changes?
this.applicationState = '' // if an application, is 'installable' or 'needs-update'

// wire up events
this.webContents.on('did-start-loading', this.onDidStartLoading.bind(this))
Expand Down Expand Up @@ -618,7 +616,6 @@ class View {
this.numFollowers = 0
this.donateLinkHref = null
this.uncommittedChanges = false
this.applicationState = ''

if (!this.url.startsWith('dat://')) {
this.datInfo = null
Expand All @@ -641,16 +638,6 @@ class View {
let siteFollowers = await beakerCore.crawler.follows.list({filters: {topics: this.datInfo.url, authors: followAuthors}})
this.numFollowers = siteFollowers.length
if (!noEmit) this.emitUpdateState()

if (this.datInfo.type && this.datInfo.type.includes('application')) {
let userId = (await beakerCore.users.get(userSession.url)).id
let appState = await beakerCore.applications.getApplicationState({userId, url: this.url})
if (!appState.installed) {
this.applicationState = 'installable'
}
// TODO check for 'needs-update'
if (!noEmit) this.emitUpdateState()
}
}

async getPageMetadata () {
Expand Down
1 change: 0 additions & 1 deletion app/new-shell-window/navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ class ShellWindowNavbar extends LitElement {
?is-live-reloading=${_get(this, 'activeTab.isLiveReloading')}
?preview-mode=${_get(this, 'activeTab.previewMode')}
uncommitted-changes=${_get(this, 'activeTab.uncommittedChanges', 0)}
application-state=${_get(this, 'activeTab.applicationState', '')}
?is-bookmarked=${_get(this, 'activeTab.isBookmarked', false)}
></shell-window-navbar-location>
<shell-window-navbar-inpage-find
Expand Down
75 changes: 0 additions & 75 deletions app/new-shell-window/navbar/location.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class NavbarLocation extends LitElement {
isLiveReloading: {type: Boolean, attribute: 'is-live-reloading'},
previewMode: {type: Boolean, attribute: 'preview-mode'},
uncommittedChanges: {type: Number, attribute: 'uncommitted-changes'},
applicationState: {type: String, attribute: 'application-state'},
isSiteToolsMenuOpen: {type: Boolean},
isPreviewModeToolsMenuOpen: {type: Boolean},
isDonateMenuOpen: {type: Boolean},
Expand All @@ -55,7 +54,6 @@ class NavbarLocation extends LitElement {
this.availableAlternative = ''
this.previewMode = false
this.uncommittedChanges = 0
this.applicationState = ''
this.isSiteToolsMenuOpen = false
this.isPreviewModeToolsMenuOpen = false
this.isDonateMenuOpen = false
Expand Down Expand Up @@ -115,7 +113,6 @@ class NavbarLocation extends LitElement {
<button class="text" @click=${this.onClickComments}>
<span class="far fa-fw fa-comment-alt"></span> ${this.numComments}
</button>
${this.renderApplicationBtn()}
${this.renderSiteToolsBtn()}
${this.renderAvailableAlternativeBtn()}
${this.renderDonateBtn()}
Expand Down Expand Up @@ -290,32 +287,6 @@ class NavbarLocation extends LitElement {
`
}

renderApplicationBtn () {
if (this.applicationState === 'needs-update') {
const cls = classMap({
'application-btn': true,
update: true
})
return html`
<button class="${cls}">
<i class="fas fa-arrow-alt-circle-up"></i> Update required
</button>
`
}
if (this.applicationState === 'installable') {
const cls = classMap({
'application-btn': true,
install: true
})
return html`
<button class="${cls}" @click=${this.onClickInstall}>
<i class="fas fa-download"></i> Install this application
</button>
`
}
return ''
}

// events
// =

Expand Down Expand Up @@ -494,11 +465,6 @@ class NavbarLocation extends LitElement {
})
}

async onClickInstall () {
if (await bg.applications.requestInstall(this.url)) {
bg.views.loadURL(this.activeTabIndex, this.url) // refresh page
}
}
}
NavbarLocation.styles = [buttonResetCSS, css`
:host {
Expand Down Expand Up @@ -615,47 +581,6 @@ button.live-reload .fa {
-webkit-text-stroke: 1px #daba47;
}
button.application-btn {
width: auto;
padding: 0 5px;
font-size: 11px;
line-height: 12px;
margin: 2px;
border-radius: 2px;
}
button.application-btn.install {
border: 1px solid #2864dc;
background: #5289f7;
color: #fff;
box-shadow: 0 1px 1px rgba(0,0,0,.1);
}
button.application-btn.install:hover {
background: rgb(64, 119, 230);
}
button.application-btn.update {
border: 1px solid rgb(11, 150, 11);
background: rgb(12, 185, 12);
color: #fff;
box-shadow: 0 1px 1px rgba(0,0,0,.1);
}
button.application-btn.update:hover {
background: rgb(24, 171, 24);
}
button.application-btn .fa-download {
font-size: 12px;
margin: 0 2px;
}
button.application-btn .fa-arrow-alt-circle-up {
font-size: 10px;
margin: 0 1px;
}
.input-container {
position: relative;
flex: 1;
Expand Down

0 comments on commit 3e63dde

Please sign in to comment.