Skip to content

Commit

Permalink
code cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
bourgeoa committed Dec 14, 2023
1 parent 880744a commit 3458bb0
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/sourcePane.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,6 @@ module.exports = {
// Set in refresh()
let contentType, allowed, eTag // Note it when we read and use it when we save

// from humanReadablePane see source-pane issue#53
/* const cts = kb.fetcher.getHeader(subject.doc(), 'content-type')
contentType = cts ? cts[0] : null
if (contentType) {
console.log('sourcePane: c-t:' + contentType)
} else {
console.log('sourcePane: unknown content-type?')
} */

const div = dom.createElement('div')
div.setAttribute('class', 'sourcePane')
const table = div.appendChild(dom.createElement('table'))
Expand Down Expand Up @@ -333,13 +324,9 @@ module.exports = {
// get response headers
function getResponseHeaders (response) {
if (response.headers && response.headers.get('content-type')) {
// do not work on CSS see source-pane issue#53
contentType = response.headers.get('content-type').split(';')[0] // Should work but headers may be empty
console.log('alain contentType ' + contentType)
allowed = response.headers.get('allow') // const cts = kb.fetcher.getHeader(subject.doc(), 'content-type')
console.log('alain allow ' + allowed)
eTag = response.headers.get('etag')
console.log('alain etag ' + eTag)
} else {
const reqs = kb.each(
null,
Expand All @@ -362,14 +349,14 @@ module.exports = {
}

function refresh (_event) {
// see https://github.com/linkeddata/rdflib.js/issues/629
// const options = defaultFetchHeaders()

fetcher
.webOperation('GET', subject.uri) // , options)
.then(function (response) {
if (!happy(response, 'GET')) return
const desc = response.responseText
console.log('desc ' + desc)
if (desc === undefined) { // Defensive https://github.com/linkeddata/rdflib.js/issues/506
const msg = 'source pane: No text in response object!!'
statusRow.appendChild(UI.widgets.errorMessageBlock(dom, msg))
Expand Down

0 comments on commit 3458bb0

Please sign in to comment.