Enable comments

You can enable comments for the current page by clicking on the Enable Comments button (only the website owner can see this button). This ensures that the website owner becomes the owner of the AppendableData used to hold the comments.

Contents

Enable comments

Create an appendable data

When you click on the Enable Comments button, the plugin creates an appendable data for the current page. By default, the filter of the appendable data will be a blacklist (as opposed to a whitelist). Everyone except the keys listed in the filter will be allowed to append data.

Create appendable data

POST /appendable-data
controller.js
window.safeAppendableData.create(this._authToken, this._getLocation(), false)

The name of the appendable data is based on the URL of the current page.

controller.js
_getLocation () {
  if (this._isDevMode() && this._data.user.dns) {
    return `comments-dev-${this._data.user.dns}/${window.location.pathname}`
  }
  return `${this._hostName}/${window.location.pathname}`
}

Example

blog.testing//post.html

The actual name of the appendable data is the hash of _getLocation().

Save the appendable data

The plugin saves the appendable data to the SAFE Network.

Save appendable data

PUT /appendable-data/:handleId
controller.js
window.safeAppendableData.put(this._authToken, handleId)

After the appendable data has been successfully saved, the plugin refreshes the UI.

Comment box

results matching ""

    No results matching ""