mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-21 12:15:50 +00:00
WS tool: better placeholder code
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
var commandlist = $("#command_list")
|
const commandlist = $("#command_list")
|
||||||
const request_body = $(".request-body.io")
|
const request_body = $(".request-body.io")
|
||||||
const response_body = $(".response-body.io")
|
const response_body = $(".response-body.io")
|
||||||
|
const request_button = $('.request_button')
|
||||||
|
|
||||||
const GET = "GET"
|
const GET = "GET"
|
||||||
const POST = "POST"
|
const POST = "POST"
|
||||||
@@ -104,9 +105,7 @@ function select_request(request) {
|
|||||||
$(".api-method-description-wrapper .api-readmore").hide()
|
$(".api-method-description-wrapper .api-readmore").hide()
|
||||||
}
|
}
|
||||||
|
|
||||||
$(".selected_command").attr('href', DOC_BASE+command.link).text(command.name)
|
$(".selected_command").attr('href', command.link).text(command.name)
|
||||||
|
|
||||||
change_path(command);
|
|
||||||
|
|
||||||
if (command.hasOwnProperty("body")) {
|
if (command.hasOwnProperty("body")) {
|
||||||
cm_request.setValue(JSON.stringify(command.body, null, 2));
|
cm_request.setValue(JSON.stringify(command.body, null, 2));
|
||||||
@@ -119,9 +118,22 @@ function select_request(request) {
|
|||||||
reset_response_area();
|
reset_response_area();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function reset_response_area() {
|
||||||
|
cm_response.setValue("");
|
||||||
|
}
|
||||||
|
|
||||||
|
function send_request() {
|
||||||
|
// TODO: send
|
||||||
|
}
|
||||||
|
|
||||||
|
function connect_to_server(host, port) {
|
||||||
|
// TODO: ws connection stuff
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: more stuff
|
// TODO: more stuff
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
//wait for the Requests to be populated by another file
|
//wait for the Requests to be populated by another file
|
||||||
generate_table_of_contents();
|
generate_table_of_contents();
|
||||||
@@ -135,7 +147,7 @@ $(document).ready(function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (urlParams["base_url"]) {
|
if (urlParams["base_url"]) {
|
||||||
change_base_url(urlParams["base_url"]);
|
//TODO: change_base_url(urlParams["base_url"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
request_button.click(send_request);
|
request_button.click(send_request);
|
||||||
|
|||||||
Reference in New Issue
Block a user