UNPKG

@hal313/settings-manager-chrome-extension-adapter

Version:

A backing repository for settings-manager, falling on chrome.storage.local (or sync) as an implementation.

93 lines (81 loc) 4.11 kB
<!doctype html> <html lang="en"> <head> <!-- Required meta tags --> <meta charset="utf-8"> <!-- Set the viewport for mobile --> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <!-- Bootstrap CSS --> <link rel="stylesheet" href="//stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"> <!-- Custom CSS --> <style> .loader { height: 20px; } </style> <title>SettingsManager Chrome Extension Adapter ES5 Example</title> </head> <body> <div class="jumbotron"> <h1 class="display-4">SettingsManager Chrome Extension Adapter ES5 Example</h1> <p class="lead">Example ES5 use of the <a href="https://github.com/hal313/settings-manager-chrome-extension-adapter">SettingsManagerChromeExtensionAdapter</a> library</p> </div> <div class="container"> <div> <div>Load the SettingsManagerChromeExtensionAdapter library using <code class="prettyprint lang-js">script</code> tags:</div> <pre><code class="prettyprint lang-html"> &lt;!-- // Load the SettingsManager code --&gt; &lt;script src="../../scripts/SettingsManager.js"&gt;&lt;/script&gt; &lt;!-- // Load the SettingsManager Chrome Extension Adapter code --&gt; &lt;script src="../../scripts/SettingsManagerChromeExtensionAdapter.js"&gt;&lt;/script&gt; &lt;!-- // Load the test code --&gt; &lt;script src="./es5-test.js" type="module"&gt;&lt;/script&gt; </code></pre> </div> <div> <pre id="js-results-section"></pre> </div> <div> <p> <button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#js-code-container" aria-expanded="false" aria-controls="code-container"> Show Code </button> </p> <div class="collapse" id="js-code-container"> <div class="card card-body"> <div id="js-code" class="lang-js"></div> </div> </div> </div> </div> <!-- // Load jQuery --> <script src="//code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script> <!-- // Load Bootstrap --> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script> <!-- // Load some code to make the code samples pretty --> <script src="//cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js"></script> <!-- // Load the Chrome extension API shim --> <script src="../chrome-extension-api.js"></script> <!-- // Load the SettingsManager code --> <script src="../../scripts/SettingsManager.js"></script> <!-- // Load the SettingsManager Chrome Extension Adapter code --> <script src="../../scripts/SettingsManagerChromeExtensionAdapter.js"></script> <!-- // Load the test code --> <script src="./es5-test.js" type="module"></script> <script> // Load and populate the code when the page loads $(() => { fetch('./es5-test.js') .then(function(response) { return response.text(); }) .then(function(code) { // Populate the code $('#js-code').html(`<pre><code class="prettyprint lang-js">${code}</code></pre>`); // Format the code PR.prettyPrint(); }); }); </script> </body> </html>