refactoring delete API, added external JSON-LD context
This commit is contained in:
10
js/comment.jsonld
Normal file
10
js/comment.jsonld
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"@context": {
|
||||
"status": "http://schema.org/Integer",
|
||||
"id": "http://schema.org/name",
|
||||
"url: {
|
||||
"@id": "http://schema.org/url",
|
||||
"@type": "@id"
|
||||
}
|
||||
}
|
||||
}
|
||||
11
js/paste.jsonld
Normal file
11
js/paste.jsonld
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"@context": {
|
||||
"status": http://schema.org/Integer",
|
||||
"id": "http://schema.org/name",
|
||||
"deletetoken": "http://schema.org/Text",
|
||||
"url: {
|
||||
"@id": "http://schema.org/url",
|
||||
"@type": "@id"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -671,9 +671,11 @@ $(function() {
|
||||
}
|
||||
if (comments[0].meta.burnafterreading)
|
||||
{
|
||||
// unfortunately many web servers don't support DELETE (and PUT) out of the box
|
||||
$.ajax({
|
||||
// type: 'DELETE', // unfortunately many web servers will not support DELETE and PUT by default
|
||||
url: this.scriptLocation() + '?pasteid=' + this.pasteID() + '&deletetoken=burnafterreading',
|
||||
type: 'POST',
|
||||
url: this.scriptLocation() + '?' + this.pasteID(),
|
||||
data: {deletetoken: 'burnafterreading'},
|
||||
dataType: 'json',
|
||||
headers: this.headers
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user