Update ripple-lib dependency in templates:

- Use variable in more places
- Move lodash dep to a variable with integrity check
- Update examples in some places that refer to 1.8.0
This commit is contained in:
mDuo13
2021-03-03 15:23:36 -08:00
parent 2541b59e58
commit 45e9ddd3a8
9 changed files with 28 additions and 25 deletions

View File

@@ -1,8 +1,8 @@
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/lodash@4.17.20/lodash.min.js"></script>
<script src="https://unpkg.com/ripple-lib@1.8.0/build/ripple-latest-min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min.js" integrity="sha512-WFN04846sdKMIP5LKNphMaWzU7YpMyCU245etK3g/2ARYbPK9Ub18eG+ljU96qKRCWh+quCY7yefSmlkQw1ANQ==" crossorigin="anonymous"></script>
<script type="application/javascript" src="assets/js/ripple-lib-1.9.1.min.js"></script>
<script>
console.log(ripple);
var api = new ripple.RippleAPI({server:'wss://s1.ripple.com/'});

View File

@@ -258,14 +258,14 @@ _unpkg_
```html
<script src="https://unpkg.com/lodash@4.17.20/lodash.min.js"></script>
<script src="https://unpkg.com/ripple-lib@1.8.0/build/ripple-latest-min.js"></script>
<script src="https://unpkg.com/ripple-lib@1.9.1/build/ripple-latest-min.js"></script>
```
_jsDelivr_
```html
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.20/lodash.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/ripple-lib@1.8.0/build/ripple-latest-min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/ripple-lib@1.9.1/build/ripple-latest-min.js"></script>
```
<!-- MULTICODE_BLOCK_END -->

View File

@@ -6,8 +6,9 @@ The following example gets the latest [ledger version](ledgers.html) and a list
**Tip:** If you can, open your browser's Developer Tools by pressing **F12**. The "Console" tab provides a native JavaScript console and can give insight into what code is running on any webpage.
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.15/lodash.js"></script>
<script src="https://unpkg.com/ripple-lib@1.8.0/build/ripple-latest-min.js"></script>
<!-- ripple-lib & prerequisites -->
{{currentpage.lodash_tag}}
{{currentpage.ripple_lib_tag}}
<!-- JS_EDITOR_START step2 -->
@@ -94,8 +95,8 @@ Try editing the code above to do something different:
This page has the necessary prerequisites already loaded, but you can access the XRP Ledger from **any webpage** if you load [Lodash](https://lodash.com/) and [RippleAPI for JavaScript (ripple-lib)](rippleapi-reference.html) in that page's HTML. For example:
```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.15/lodash.js"></script>
<script src="https://unpkg.com/ripple-lib@1.8.0/build/ripple-latest-min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min.js"></script>
<script src="https://unpkg.com/ripple-lib@1.9.1/build/ripple-latest-min.js"></script>
```
<!-- SPELLING_IGNORE: lodash -->

View File

@@ -15,9 +15,9 @@ _(Requires the [TicketBatch amendment][] :not_enabled:)_
## Prerequisites
<!-- Interactive example use ripple-lib and its prerequisites -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.11/lodash.js"></script>
<script type="application/javascript" src="{{target.ripple_lib_url}}"></script>
<!-- ripple-lib & prerequisites -->
{{currentpage.lodash_tag}}
{{currentpage.ripple_lib_tag}}
<!-- Helper for interactive tutorial breadcrumbs -->
<script type="application/javascript" src="assets/js/interactive-tutorial.js"></script>
<!-- Source for this specific tutorial's interactive bits: -->

View File

@@ -14,9 +14,9 @@ filters:
## 前提条件
<!-- Interactive example use ripple-lib and its prerequisites -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.11/lodash.js"></script>
<script type="application/javascript" src="{{target.ripple_lib_url}}"></script>
<!-- ripple-lib & prerequisites -->
{{currentpage.lodash_tag}}
{{currentpage.ripple_lib_tag}}
<!-- Helper for interactive tutorial breadcrumbs -->
<script type="application/javascript" src="assets/js/interactive-tutorial.js"></script>

View File

@@ -14,9 +14,9 @@ This tutorial explains how to send a simple XRP Payment using RippleAPI for Java
## Prerequisites
<!-- Interactive example use ripple-lib and its prerequisites -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.11/lodash.js"></script>
<script type="application/javascript" src="{{target.ripple_lib_url}}"></script>
<!-- ripple-lib & prerequisites -->
{{currentpage.lodash_tag}}
{{currentpage.ripple_lib_tag}}
<!-- Helper for interactive tutorial breadcrumbs -->
<script type="application/javascript" src="assets/js/interactive-tutorial.js"></script>

View File

@@ -66,7 +66,9 @@ default_keys: &defaults
# Override them with --vars to change which fork/branch to edit.
github_forkurl: https://github.com/ripple/xrpl-dev-portal
github_branch: master
ripple_lib_url: assets/js/ripple-lib-1.9.1.min.js
# Script tags used in a variety of tools & examples.
lodash_tag: '<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min.js" integrity="sha512-WFN04846sdKMIP5LKNphMaWzU7YpMyCU245etK3g/2ARYbPK9Ub18eG+ljU96qKRCWh+quCY7yefSmlkQw1ANQ==" crossorigin="anonymous"></script>'
ripple_lib_tag: '<script type="application/javascript" src="assets/js/ripple-lib-1.9.1.min.js"></script>'
targets:
# First member is the default that gets built when target not specified

View File

@@ -156,10 +156,10 @@
{% endblock %}
{% block endbody %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.11/lodash.js"></script>
<script type="application/javascript" src="assets/js/ripple-lib-1.8.0-min.js"></script>
{{currentpage.lodash_tag}}
{{currentpage.ripple_lib_tag}}
<script type="application/javascript" src="assets/vendor/bootstrap-growl.jquery.js"></script>
<script type='application/javascript' src='assets/js/tx-sender.js'></script>
<script type="application/javascript" src="assets/js/tx-sender.js"></script>
<script type="application/javascript">
gtag('config', 'UA-157720658-3', {'content_group1': 'API Tools'});

View File

@@ -25,10 +25,10 @@
{% endblock %}
{% block endbody %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.11/lodash.js"></script>
<script type="application/javascript" src="assets/js/ripple-lib-1.8.0-min.js"></script>
<script type='text/javascript' src='assets/vendor/iarna-toml-parse.js'></script>
<script type='text/javascript' src='assets/js/xrp-ledger-toml-checker.js'></script>
{{currentpage.lodash_tag}}
{{currentpage.ripple_lib_tag}}
<script type="application/javascript" src="assets/vendor/iarna-toml-parse.js"></script>
<script type="application/javascript" src="assets/js/xrp-ledger-toml-checker.js"></script>
<script type="application/javascript">
gtag('config', 'UA-157720658-3', {'content_group1': 'API Tools'});