-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
this commit is to follow the new js model Changes to be committed: modified: .gitignore renamed: demo/addToast.js -> apiExamples/showToast.js modified: demo/api.html new file: demo/api.js modified: demo/apiExamples.md modified: demo/index.html new file: demo/index.js modified: docs/api.md modified: package.json modified: rollup.config.mjs new file: scripts/prepExampleFiles.js
- Loading branch information
1 parent
22236d7
commit 89e1d00
Showing
11 changed files
with
87 additions
and
13 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
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { showToast } from '../apiExamples/showToast'; | ||
|
||
export function initToastApiExamples(initCount) { | ||
initCount = initCount || 0; | ||
|
||
try { | ||
showToast(); | ||
} catch { | ||
if (initCount <= 20) { | ||
// setTimeout handles issue where content is sometimes loaded after the functions get called | ||
setTimeout(() => { | ||
initToastApiExamples(initCount + 1); | ||
}, 100); | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { showToast } from '../apiExamples/showToast'; | ||
|
||
export function initToastIndexExamples(initCount) { | ||
initCount = initCount || 0; | ||
|
||
try { | ||
showToast(); | ||
} catch { | ||
if (initCount <= 20) { | ||
// setTimeout handles issue where content is sometimes loaded after the functions get called | ||
setTimeout(() => { | ||
initToastIndexExamples(initCount + 1); | ||
}, 100); | ||
} | ||
} | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
let fs = require('fs'); | ||
|
||
function removeExport(path, type) { | ||
fs.readFile(path, type, function(err, data) { | ||
const exportPos = data.indexOf('export') | ||
const exampleScript = data.substring(0, exportPos); | ||
const writer = fs.createWriteStream(path); | ||
|
||
writer.write(exampleScript); | ||
}); | ||
} | ||
|
||
removeExport('./demo/index.min.js', 'utf8'); | ||
removeExport('./demo/api.min.js', 'utf8'); |