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

Commit

Permalink
rename 'seeding' to 'serving'
Browse files Browse the repository at this point in the history
  • Loading branch information
pfrazee committed Sep 22, 2016
1 parent be20706 commit 3fddd89
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
10 changes: 5 additions & 5 deletions app/builtin-pages/com/sites-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ export function render (sites, opts={}) {
let title = site.title||'Untitled'
let mtime = site.mtime ? ucfirst(niceDate(site.mtime)) : '--'
let url = 'view-dat://'+site.key
let seedToggleLabel = site.userSettings.isSeeding
? yo`<div><span class="icon icon-cancel"></span> Stop Seeding</div>`
: yo`<div><span class="icon icon-share"></span> Seed</div>`
let serveToggleLabel = site.userSettings.isServing
? yo`<div><span class="icon icon-cancel"></span> Stop Serving</div>`
: yo`<div><span class="icon icon-share"></span> Serve</div>`
siteEls.push(yo`<div class="ll-row site">
<div class="ll-link">
<img class="favicon" src=${'beaker-favicon:dat://'+site.key} />
Expand All @@ -31,13 +31,13 @@ export function render (sites, opts={}) {
<div class="ll-updated" title=${mtime}>${mtime}</div>
<div class="ll-symbol">${site.isOwner ? yo`<span class="icon icon-pencil" title="You are the site author"></span>` : '' }</div>
<div class="ll-size">${site.size ? prettyBytes(site.size) : '0 B'}</div>
<div class="ll-symbol">${site.userSettings.isSeeding ? yo`<span class="icon icon-share" title="Seeding"></span>` : '' }</div>
<div class="ll-symbol">${site.userSettings.isServing ? yo`<span class="icon icon-share" title="Serving"></span>` : '' }</div>
<div class="ll-status">${site.peers+' '+pluralize(site.peers, 'peer')}</div>
<div class="ll-dropdown">${toggleable(yo`
<div class="dropdown-btn-container">
<a class="toggleable btn"><span class="icon icon-down-open-mini"></span></a>
<div class="dropdown-btn-list">
<div onclick=${opts.onToggleSeedSite(site)}>${seedToggleLabel}</div>
<div onclick=${opts.onToggleServeSite(site)}>${serveToggleLabel}</div>
<div onclick=${opts.onDeleteSite(site)}><span class="icon icon-trash"></span> Delete</div>
</div>
</div>
Expand Down
16 changes: 8 additions & 8 deletions app/builtin-pages/views/sites.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function hide () {
function render () {
// content
var content = (window.datInternalAPI)
? renderSitesList(archives, { renderEmpty, onToggleSeedSite, onDeleteSite, onUndoDeletions })
? renderSitesList(archives, { renderEmpty, onToggleServeSite, onDeleteSite, onUndoDeletions })
: renderNotSupported()

// render view
Expand Down Expand Up @@ -121,15 +121,15 @@ function onUpdatePeers ({ key, peers }) {
}


function onToggleSeedSite (archiveInfo) {
function onToggleServeSite (archiveInfo) {
return e => {
e.preventDefault()
e.stopPropagation()

archiveInfo.userSettings.isSeeding = !archiveInfo.userSettings.isSeeding
archiveInfo.userSettings.isServing = !archiveInfo.userSettings.isServing

// isSaved must reflect isSeeding
if (archiveInfo.userSettings.isSeeding && !archiveInfo.userSettings.isSaved)
// isSaved must reflect isServing
if (archiveInfo.userSettings.isServing && !archiveInfo.userSettings.isSaved)
archiveInfo.userSettings.isSaved = true
datInternalAPI.setArchiveUserSettings(archiveInfo.key, archiveInfo.userSettings)

Expand All @@ -144,9 +144,9 @@ function onDeleteSite (archiveInfo) {

archiveInfo.userSettings.isSaved = !archiveInfo.userSettings.isSaved

// isSeeding must reflect isSaved
if (!archiveInfo.userSettings.isSaved && archiveInfo.userSettings.isSeeding)
archiveInfo.userSettings.isSeeding = false
// isServing must reflect isSaved
if (!archiveInfo.userSettings.isSaved && archiveInfo.userSettings.isServing)
archiveInfo.userSettings.isServing = false

datInternalAPI.setArchiveUserSettings(archiveInfo.key, archiveInfo.userSettings)
render()
Expand Down
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"copyright": "© 2016, Paul Frazee",
"main": "background-process.build.js",
"dependencies": {
"beaker-plugin-dat": "~4.0.0",
"beaker-plugin-dat": "~4.0.1",
"beaker-plugin-ipfs": "~2.0.0",
"browser-es-module-loader": "^0.1.6",
"co": "^4.6.0",
Expand Down

0 comments on commit 3fddd89

Please sign in to comment.