mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-12-03 18:15:49 +00:00
WebSocket Tool: NFT methods & related support
- Add example syntax for the 3 NFT methods. - Add the ability to specify the network without the rest of a permalink. NFT method "try it!" links can use this to have the tool use the NFT-Devnet by default. - Add the ability to mark methods as not enabled on the production network.
This commit is contained in:
@@ -51,7 +51,11 @@ function generate_table_of_contents() {
|
||||
if (req.slug === null) {
|
||||
commandlist.append("<li class='separator'>"+req.name+"</li>");
|
||||
} else {
|
||||
commandlist.append("<li class='method'><a href='#"+req.slug+"'>"+req.name+"</a></li>");
|
||||
let status_label = ""
|
||||
if (req.status == "not_enabled") {
|
||||
status_label = '<span class="status not_enabled" title="This feature is not currently enabled on the production XRP Ledger."><i class="fa fa-flask"></i></span> '
|
||||
}
|
||||
commandlist.append("<li class='method'><a href='#"+req.slug+"'>"+status_label+req.name+"</a></li>");
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -284,7 +288,7 @@ const update_curl = function(event) {
|
||||
$("#curl-box-1").text(curl_syntax)
|
||||
}
|
||||
|
||||
function load_from_permalink(params) {
|
||||
function server_from_params(params) {
|
||||
const server = params.get("server")
|
||||
if (server) {
|
||||
const server_checkbox = $("input[value='"+server+"']")
|
||||
@@ -293,7 +297,9 @@ function load_from_permalink(params) {
|
||||
// relies on connect_socket() being run shortly thereafter
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function req_from_params(params) {
|
||||
let req_body = params.get("req")
|
||||
let cmd_name = ""
|
||||
if (req_body) {
|
||||
@@ -336,10 +342,14 @@ $(document).ready(function() {
|
||||
// default instead.
|
||||
select_request()
|
||||
}
|
||||
} else if (search_params.has("server") || search_params.has("req")) {
|
||||
load_from_permalink(search_params)
|
||||
} else if (search_params.has("req")) {
|
||||
req_from_params(search_params)
|
||||
} else {
|
||||
select_request();
|
||||
select_request()
|
||||
}
|
||||
|
||||
if (search_params.has("server")) {
|
||||
server_from_params(search_params)
|
||||
}
|
||||
|
||||
connect_socket()
|
||||
|
||||
Reference in New Issue
Block a user