Skip to content

Commit 4c094c6

Browse files
author
deiu
committed
Renamed defaultApp to fileBrowser and skin to dataBrowser
1 parent 532cdaa commit 4c094c6

5 files changed

Lines changed: 19 additions & 18 deletions

File tree

bin/ldnode.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,14 @@ var argv = require('nomnom')
9393
full: 'error-pages',
9494
help: 'Folder from which to look for custom error pages files (files must be named <error-code>.html -- eg. 500.html)'
9595
})
96-
.option('defaultApp', {
97-
full: 'default-app',
96+
.option('fileBrowser', {
97+
full: 'file-browser',
9898
help: 'URI to use as a default app for resources (default: https://linkeddata.github.io/warp/#/list/)'
9999
})
100-
.option('skin', {
101-
full: 'skin',
100+
.option('dataBrowser', {
101+
full: 'data-browser',
102102
flag: true,
103-
help: 'Enable viewing RDF resources using a skin application (like mashlib)'
103+
help: 'Enable viewing RDF resources using a default data browser application (e.g. mashlib)'
104104
})
105105
.option('createAdmin', {
106106
full: 'create-admin',

lib/handlers/get.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,17 @@ function handler (req, res, next) {
7272
return next()
7373
}
7474

75-
// Handle defaultApp
75+
// Handle fileBrowser and dataBrowser
7676
if (requestedType.indexOf('text/html') === 0) {
77-
if (container && ldp.defaultApp) {
77+
if (container && ldp.fileBrowser) {
7878
var address = req.protocol + '/' + req.get('host') + req.originalUrl
79-
return res.redirect(303, ldp.defaultApp + address)
79+
return res.redirect(303, ldp.fileBrowser + address)
8080
}
8181

82-
if (RDFs.indexOf(contentType) >= 0 && ldp.skin) {
82+
if (RDFs.indexOf(contentType) >= 0 && ldp.dataBrowser) {
8383
res.set('Content-Type', 'text/html')
84-
var skin = _path.join(__dirname, '../../static/skin.html')
85-
res.sendFile(skin)
84+
var dataBrowser = _path.join(__dirname, '../../static/databrowser.html')
85+
res.sendFile(dataBrowser)
8686
return
8787
} else {
8888
res.setHeader('Content-Type', contentType)

lib/ldp.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ function LDP (argv) {
5252
}
5353
}
5454

55-
if (this.defaultApp !== false) {
56-
this.defaultApp = argv.defaultApp || 'https://linkeddata.github.io/warp/#/list/'
55+
if (this.fileBrowser !== false) {
56+
this.fileBrowser = argv.fileBrowser || 'https://linkeddata.github.io/warp/#/list/'
5757
}
5858

59-
if (this.skin !== false) {
60-
this.skin = true
59+
if (this.dataBrowser !== false) {
60+
this.dataBrowser = true
6161
}
6262

6363
debug.settings('Suffix Acl: ' + this.suffixAcl)
@@ -66,7 +66,8 @@ function LDP (argv) {
6666
debug.settings('WebID support: ' + !!this.webid)
6767
debug.settings('Live-updates: ' + !!this.live)
6868
debug.settings('Identity Provider: ' + !!this.idp)
69-
debug.settings('Default App: ' + this.defaultApp)
69+
debug.settings('Default file broswer app: ' + this.fileBrowser)
70+
debug.settings('Default data broswer app: ' + this.dataBrowser)
7071

7172
return this
7273
}

test/http.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,13 +219,13 @@ describe('HTTP APIs', function () {
219219
})
220220
.expect(200, done) // Can't check for 303 because of internal redirects
221221
})
222-
it('should NOT load skin (mashlib) if resource is not RDF', function (done) {
222+
it('should NOT load data browser (mashlib) if resource is not RDF', function (done) {
223223
server.get('/sampleContainer/solid.png')
224224
.set('Accept', 'text/html')
225225
.expect('content-type', /image\/png/)
226226
.expect(200, done)
227227
})
228-
it('should redirect to defaultApp if container was requested as text/html', function (done) {
228+
it('should redirect to file browser if container was requested as text/html', function (done) {
229229
server.get('/sampleContainer/')
230230
.set('Accept', 'text/html')
231231
.expect('content-type', /text\/html/)

0 commit comments

Comments
 (0)