Skip to content

Commit

Permalink
Iframe example should load assets from a consistent place
Browse files Browse the repository at this point in the history
We were mixing up local assets with CDN assets and that was causing issues.
This loads everything from local, but adds some better comments to show
how to load them from CDN instead.
  • Loading branch information
bhousel committed Aug 30, 2024
1 parent ab956b5 commit b930a2f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions dist/examples/iframe/child.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
-->
<meta charset='utf-8'>
<title>Rapid</title>
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/@rapideditor/rapid@2/dist/rapid.css'>
<link rel='stylesheet' href='../../rapid.css'> <!-- local development -->
<!-- <link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/@rapideditor/rapid@2/dist/rapid.css'> --> <!-- CDN -->
<link rel='icon' type='image/svg' href='https://cdn.jsdelivr.net/npm/@rapideditor/rapid@2/dist/img/rapid_favicon.svg'>

<meta name='viewport' content='width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no'/>
Expand Down Expand Up @@ -50,10 +51,9 @@
newScript.onload = checkScript;
newScript.onerror = checkScript;

// at some point, replace this with the cdn link
newScript.src = '../../rapid.js';
// newScript.src = 'https://cdn.jsdelivr.net/npm/@rapideditor/rapid@2/dist/rapid.js'; // debug
// newScript.src = 'https://cdn.jsdelivr.net/npm/@rapideditor/rapid@2/dist/rapid.min.js'; // production
newScript.src = '../../rapid.js'; // local development
// newScript.src = 'https://cdn.jsdelivr.net/npm/@rapideditor/rapid@2/dist/rapid.js'; // CDN debug
// newScript.src = 'https://cdn.jsdelivr.net/npm/@rapideditor/rapid@2/dist/rapid.min.js'; // CDN production

document.getElementsByTagName('head')[0].appendChild(newScript);

Expand All @@ -65,7 +65,8 @@
} else {
const context = new Rapid.Context();
context.containerNode = container;
context.assetPath = 'https://cdn.jsdelivr.net/npm/@rapideditor/rapid@2/dist/';
context.assetPath = '../../'; // local development
// context.assetPath = 'https://cdn.jsdelivr.net/npm/@rapideditor/rapid@2/dist/'; // CDN
context.buildID = '';
context.buildSHA = '';
context.buildDate = '';
Expand Down

0 comments on commit b930a2f

Please sign in to comment.