Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Danny Froberg
steempress_amn
Commits
7125bf73
Commit
7125bf73
authored
Aug 28, 2018
by
Martin Lees
Browse files
Small js rewrite
parent
3fe0cbe9
Changes
1
Hide whitespace changes
Inline
Side-by-side
public/js/steempress_sp-public.js
View file @
7125bf73
...
...
@@ -26,32 +26,27 @@
}
// Make the actual CORS request.
function
makeCorsRequest
()
{
var
url
=
"
http://localhost:8002
"
;
var
xhr
=
createCORSRequest
(
'
POST
'
,
url
);
var
params
=
"
username=
"
+
username
+
"
&permlink=
"
+
permlink
+
"
&tag=
"
+
tag
;
xhr
.
setRequestHeader
(
"
Content-type
"
,
"
application/x-www-form-urlencoded
"
);
xhr
.
setRequestHeader
(
"
Content-length
"
,
params
.
length
);
if
(
!
xhr
)
{
return
;
}
// Response handlers.
xhr
.
onload
=
function
()
{
var
data
=
JSON
.
parse
(
xhr
.
responseText
);
$
(
"
#steempress_sp_price
"
)[
0
].
innerHTML
=
data
.
payout
;
$
(
"
#steempress_sp_comments
"
)[
0
].
innerHTML
=
data
.
comments
;
};
xhr
.
send
(
params
);
}
makeCorsRequest
();
}
$
(
window
).
load
(
load_steem_capabilities
)
var
url
=
"
http://localhost:8002
"
;
var
xhr
=
createCORSRequest
(
'
POST
'
,
url
);
var
params
=
"
username=
"
+
username
+
"
&permlink=
"
+
permlink
+
"
&tag=
"
+
tag
;
xhr
.
setRequestHeader
(
"
Content-type
"
,
"
application/x-www-form-urlencoded
"
);
xhr
.
setRequestHeader
(
"
Content-length
"
,
params
.
length
);
if
(
!
xhr
)
{
return
;
}
// Response handlers.
xhr
.
onload
=
function
()
{
var
data
=
JSON
.
parse
(
xhr
.
responseText
);
$
(
"
#steempress_sp_price
"
)[
0
].
innerHTML
=
data
.
payout
;
$
(
"
#steempress_sp_comments
"
)[
0
].
innerHTML
=
data
.
comments
;
};
xhr
.
send
(
params
);
}
$
(
window
).
load
(
load_steem_capabilities
)
})(
jQuery
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment