How to use the solid-ui.ns.ldp function in solid-ui

To help you get started, we’ve selected a few solid-ui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github solid / solid-panes / src / internal / internalPane.ts View on Github external
)
        })
      })
    }

    const isDocument = subject.uri && !subject.uri.includes('#')
    if (isDocument) {
      const controls = div.appendChild(dom.createElement('table'))
      controls.style.width = '100%'
      controls.style.margin = '1em'
      const controlRow = controls.appendChild(dom.createElement('tr'))

      const deleteCell = controlRow.appendChild(dom.createElement('td'))
      const isFolder =
        (subject.uri && subject.uri.endsWith('/')) ||
        store.holds(subject, ns.rdf('type'), ns.ldp('Container'))
      const noun = isFolder ? 'folder' : 'file'
      if (!isProtectedUri(subject)) {
        console.log(subject)
        var deleteButton = widgets.deleteButtonWithCheck(
          dom,
          deleteCell,
          noun,
          function () {
            if (
              !confirm(
                `Are you sure you want to delete ${subject}? This cannot be undone.`
              )
            ) {
              return
            }
            // @@ TODO Remove casing of store.fetcher
github solid / solid-panes / src / internal / internalPane.source.ts View on Github external
)
        })
      })
    }

    const isDocument = subject.uri && !subject.uri.includes('#')
    if (isDocument) {
      const controls = div.appendChild(dom.createElement('table'))
      controls.style.width = '100%'
      controls.style.margin = '1em'
      const controlRow = controls.appendChild(dom.createElement('tr'))

      const deleteCell = controlRow.appendChild(dom.createElement('td'))
      const isFolder =
        (subject.uri && subject.uri.endsWith('/')) ||
        store.holds(subject, ns.rdf('type'), ns.ldp('Container'))
      const noun = isFolder ? 'folder' : 'file'
      if (!isProtectedUri(subject)) {
        console.log(subject)
        var deleteButton = widgets.deleteButtonWithCheck(
          dom,
          deleteCell,
          noun,
          function () {
            if (
              !confirm(
                `Are you sure you want to delete ${subject}? This cannot be undone.`
              )
            ) {
              return
            }
            // @@ TODO Remove casing of store.fetcher
github solid / solid-panes / src / internal / internalPane.source.ts View on Github external
const promises = kb.each(folder, ns.ldp('contains')).map(file => {
            if (kb.holds(file, ns.rdf('type'), ns.ldp('BasicContainer'))) {
              return deleteRecursive(kb, file as NamedNode)
            } else {
              console.log('deleteRecursive leaf file: ' + file)
              return fetcher.webOperation('DELETE', (file as NamedNode).uri)
            }
          })
          Promise.all(promises).then(
github solid / solid-panes / src / internal / internalPane.ts View on Github external
fetcher.load(folder).then(function () {
          const promises = kb.each(folder, ns.ldp('contains')).map(file => {
            if (kb.holds(file, ns.rdf('type'), ns.ldp('BasicContainer'))) {
              return deleteRecursive(kb, file as NamedNode)
            } else {
              console.log('deleteRecursive leaf file: ' + file)
              return fetcher.webOperation('DELETE', (file as NamedNode).uri)
            }
          })
          Promise.all(promises).then(
            () => {
              console.log('deleteRecursive empty folder: ' + folder)
              fetcher
                .webOperation('DELETE', folder.uri)
                .then(() => {
                  console.log('Deleted Ok: ' + folder)
                  resolve()
                })
github solid / solid-panes / src / internal / internalPane.ts View on Github external
const promises = kb.each(folder, ns.ldp('contains')).map(file => {
            if (kb.holds(file, ns.rdf('type'), ns.ldp('BasicContainer'))) {
              return deleteRecursive(kb, file as NamedNode)
            } else {
              console.log('deleteRecursive leaf file: ' + file)
              return fetcher.webOperation('DELETE', (file as NamedNode).uri)
            }
          })
          Promise.all(promises).then(
github solid / solid-panes / src / internal / internalPane.source.ts View on Github external
fetcher.load(folder).then(function () {
          const promises = kb.each(folder, ns.ldp('contains')).map(file => {
            if (kb.holds(file, ns.rdf('type'), ns.ldp('BasicContainer'))) {
              return deleteRecursive(kb, file as NamedNode)
            } else {
              console.log('deleteRecursive leaf file: ' + file)
              return fetcher.webOperation('DELETE', (file as NamedNode).uri)
            }
          })
          Promise.all(promises).then(
            () => {
              console.log('deleteRecursive empty folder: ' + folder)
              fetcher
                .webOperation('DELETE', folder.uri)
                .then(() => {
                  console.log('Deleted Ok: ' + folder)
                  resolve()
                })