-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
28 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,8 +55,9 @@ Add the below code to your head section in HTML document. | |
```html | ||
<head> | ||
... | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/css/editor.css" rel="stylesheet"> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/index.umd.js"></script> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/css/editor.css" rel="stylesheet"> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/index.umd.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/index.umd.js"></script> | ||
``` | ||
|
||
Create the editor by: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,8 +37,23 @@ <h1>📦 Vanilla JavaScript Example</h1> | |
</p> | ||
<p>This example uses vanilla JavaScript!</p> | ||
|
||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/css/editor.css" rel="stylesheet" /> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/index.umd.js"></script> | ||
<script> | ||
const isLocalhost = ['localhost', '127.0.0.1'].includes(location.hostname); | ||
const cssUrl = isLocalhost | ||
? '../../../editor/css/editor.css' | ||
: 'https://cdn.jsdelivr.net/npm/[email protected]/css/editor.css'; | ||
const coreUrl = isLocalhost | ||
? '../../../core/dist/index.umd.js' | ||
: 'https://cdn.jsdelivr.net/npm/[email protected]/dist/index.umd.js'; | ||
const editorUrl = isLocalhost | ||
? '../../../editor/dist/index.umd.js' | ||
: 'https://cdn.jsdelivr.net/npm/[email protected]/dist/index.umd.js'; | ||
|
||
document.write('<link href="' + cssUrl + '" rel="stylesheet" \/>'); | ||
document.write('<script src="' + coreUrl + '"><\/script>'); | ||
document.write('<script src="' + editorUrl + '"><\/script>'); | ||
</script> | ||
|
||
<script> | ||
const placeholder = document.getElementById('placeholder'); | ||
const saveButton = document.getElementById('saveButton'); | ||
|