Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
HyunsDev committed May 19, 2021
1 parent db2b0b1 commit 6a98836
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions block/notion-tools-block-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,22 @@ function apply_theme() {
}

if (window.location != window.parent.location) {
$.ajax({
url: 'https://api2.notion-tools.com/v1/embed',
data: {
in: document.location.href,
out: document.referrer
},
type: "POST",
dataType: "json"
}).done(json => {
console.log("Server connection successful")
}).fail((xhr, status, errorThrown) => {
console.log(`Server connect fail ${status} ${errorThrown}`)
} )
out_url = document.referrer
} else {
out_url = document.location.href
}

$.ajax({
url: 'https://api2.notion-tools.com/v1/embed',
data: {
in: document.location.href,
out: out_url
},
type: "POST",
dataType: "json"
}).done(json => {
console.log("Server connection successful")
}).fail((xhr, status, errorThrown) => {
console.log(`Server connect fail ${status} ${errorThrown}`)
} )

0 comments on commit 6a98836

Please sign in to comment.