|
| 1 | +<!doctype html> |
| 2 | +<html> |
| 3 | + <head> |
| 4 | + <title>Browser Native node-wot tryout</title> |
| 5 | + <!-- Foundation CSS framework --> |
| 6 | + <link rel="stylesheet" href="https://cdn.jsdelivr.net/foundation/5.5.3/css/foundation.min.css" /> |
| 7 | + <!-- Font Awesome icons --> |
| 8 | + <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.0.3/css/font-awesome.css" /> |
| 9 | + <link rel="stylesheet" href="styles.css" /> |
| 10 | + |
| 11 | + <!-- defer to not block rendering --> |
| 12 | + <script src="https://cdn.jsdelivr.net/npm/@json-editor/json-editor@latest/dist/jsoneditor.min.js"></script> |
| 13 | + <!-- local vs cdn dependency --> |
| 14 | + <!-- <script src="../../packages/browser-bundle/dist/wot-bundle.min.js" defer></script> --> |
| 15 | + <script |
| 16 | + src="https://cdn.jsdelivr.net/npm/@node-wot/browser-bundle@latest/dist/wot-bundle.min.js" |
| 17 | + defer |
| 18 | + ></script> |
| 19 | + <script src="index.js" defer></script> |
| 20 | + |
| 21 | + <script> |
| 22 | + // Set the default CSS theme and icon library globally |
| 23 | + // JSONEditor.defaults.theme = 'foundation5'; |
| 24 | + JSONEditor.defaults.iconlib = "fontawesome4"; |
| 25 | + </script> |
| 26 | + </head> |
| 27 | + <body> |
| 28 | + <div id="topbar" class="row"> |
| 29 | + <div class="medium-12 columns"> |
| 30 | + <h1>Browsified node-wot</h1> |
| 31 | + |
| 32 | + <!-- Tabs for TD selection --> |
| 33 | + <ul class="tabs" data-tab id="td-tabs"> |
| 34 | + <li class="tab-title active"> |
| 35 | + <a href="#tab-testthing" id="tab-link-testthing">Test Thing</a> |
| 36 | + </li> |
| 37 | + <li class="tab-title"> |
| 38 | + <a href="#tab-smartcoffee" id="tab-link-smartcoffee">Smart Coffee Machine</a> |
| 39 | + </li> |
| 40 | + <li class="tab-title"> |
| 41 | + <a href="#tab-counter" id="tab-link-counter">Counter</a> |
| 42 | + </li> |
| 43 | + <li class="tab-title"> |
| 44 | + <a href="#tab-custom" id="tab-link-custom">Custom</a> |
| 45 | + </li> |
| 46 | + </ul> |
| 47 | + <div class="tabs-content"> |
| 48 | + <div class="content active" id="tab-testthing"> |
| 49 | + <p>Consumed TD at <a href="" target="_blank" class="td-url"></a></p> |
| 50 | + <p> |
| 51 | + <strong>TD Description:</strong> |
| 52 | + <span class="td-description">Loading...</span> |
| 53 | + </p> |
| 54 | + </div> |
| 55 | + <div class="content" id="tab-smartcoffee"> |
| 56 | + <p> |
| 57 | + Consumed TD at |
| 58 | + <a href="" target="_blank" class="td-url"></a> |
| 59 | + </p> |
| 60 | + <p> |
| 61 | + <strong>TD Description:</strong> |
| 62 | + <span class="td-description">Loading...</span> |
| 63 | + </p> |
| 64 | + </div> |
| 65 | + <div class="content" id="tab-counter"> |
| 66 | + <p>Consumed TD at <a href="" target="_blank" class="td-url"></a></p> |
| 67 | + <p> |
| 68 | + <strong>TD Description:</strong> |
| 69 | + <span class="td-description">Loading...</span> |
| 70 | + </p> |
| 71 | + </div> |
| 72 | + <div class="content" id="tab-custom"> |
| 73 | + <div class="row"> |
| 74 | + <div class="medium-12 columns"> |
| 75 | + <input |
| 76 | + id="td_addr" |
| 77 | + type="url" |
| 78 | + placeholder="Paste the TD URL to start consuming it" |
| 79 | + style="width: 100%" |
| 80 | + onkeydown="if(event.key==='Enter') document.getElementById('fetch').click()" |
| 81 | + /> |
| 82 | + </div> |
| 83 | + </div> |
| 84 | + <div class="row"> |
| 85 | + <div class="medium-12 columns" style="margin-top: 10px"> |
| 86 | + <button id="fetch" type="button" class="button">Consume</button> |
| 87 | + </div> |
| 88 | + </div> |
| 89 | + <div id="custom-td-info" style="margin-top: 10px"> |
| 90 | + <p>Consumed TD at <a href="" target="_blank" class="td-url"></a></p> |
| 91 | + <p> |
| 92 | + <strong>TD Description:</strong> |
| 93 | + <span class="td-description">Enter a TD URL above to consume it.</span> |
| 94 | + </p> |
| 95 | + </div> |
| 96 | + </div> |
| 97 | + </div> |
| 98 | + |
| 99 | + <!-- Error message container --> |
| 100 | + <div id="error-container" class="row" style="display: none; margin-top: 10px"> |
| 101 | + <div class="medium-12 columns"> |
| 102 | + <div class="alert-box alert" id="error-message"> |
| 103 | + <span id="error-text"></span> |
| 104 | + <a href="#" class="close" id="close-error">×</a> |
| 105 | + </div> |
| 106 | + </div> |
| 107 | + </div> |
| 108 | + </div> |
| 109 | + </div> |
| 110 | + <div id="interactions" class="row" style="display: none"> |
| 111 | + <div class="medium-4 columns"> |
| 112 | + <figure> |
| 113 | + <figcaption><h4>Properties</h4></figcaption> |
| 114 | + <ul id="properties" class="side-nav"></ul> |
| 115 | + </figure> |
| 116 | + </div> |
| 117 | + <div class="medium-4 columns"> |
| 118 | + <figure> |
| 119 | + <figcaption><h4>Actions</h4></figcaption> |
| 120 | + <ul id="actions" class="side-nav"></ul> |
| 121 | + </figure> |
| 122 | + </div> |
| 123 | + <div class="medium-4 columns"> |
| 124 | + <figure> |
| 125 | + <figcaption><h4>Events</h4></figcaption> |
| 126 | + <ul id="events" class="side-nav"></ul> |
| 127 | + </figure> |
| 128 | + </div> |
| 129 | + </div> |
| 130 | + |
| 131 | + <div class="row"> |
| 132 | + <div class="medium-6 columns small-offset-3"> |
| 133 | + <div id="editor_holder"></div> |
| 134 | + </div> |
| 135 | + </div> |
| 136 | + </body> |
| 137 | +</html> |
0 commit comments