Skip to content

Commit

Permalink
Adjust css slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Conway-Jones committed Nov 30, 2020
1 parent 429b7df commit ab6a11d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
11 changes: 6 additions & 5 deletions node-red-node-ui-iframe/locales/en-US/ui_iframe.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script type="text/x-red" data-help-name="ui_iframe">
<script type="text/html" data-help-name="ui_iframe">
<p>Node-RED widget node for embedding a Web page</p>

<h3>Inputs</h3>
Expand All @@ -10,7 +10,7 @@ <h3>Inputs</h3>
<dt>url<span class="property-type">object</span></dt>
<dd>URL of target Web page</dd>
</dl>

<h3>Outputs</h3>
<dl class="message-properties">
<dt>payload<span class="property-type">object</span></dt>
Expand All @@ -19,7 +19,8 @@ <h3>Outputs</h3>

<h3>Details</h3>
<p>UI widget for embedding a Web page using IFrame.</p>
<p>URL setting item or <code>url</code> property of an input message specifies the URL of embedded web page on Node-RED dashboard</p>
<p>Origin setting item specifies origin of message for sending
message. Default value of the origin is '<code>*</code>' (no limitation).</p>
<p>URL setting item or <code>url</code> property of an input message specifies
the URL of embedded web page on Node-RED dashboard</p>
<p>Origin setting item specifies CORS origin of message for sending
message. Default value of the origin is '<code>*</code>' (no limitation).</p>
</script>
4 changes: 2 additions & 2 deletions node-red-node-ui-iframe/locales/ja/ui_iframe.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script type="text/x-red" data-help-name="ui_iframe">
<script type="text/html" data-help-name="ui_iframe">
<p>Webページ埋め込みを行うNode-RED widgetノード</p>

<h3>入力</h3>
Expand All @@ -10,7 +10,7 @@ <h3>入力</h3>
<dt>url<span class="property-type">オブジェクト</span></dt>
<dd>埋め込み対象ページのURL。</dd>
</dl>

<h3>出力</h3>
<dl class="message-properties">
<dt>payload<span class="property-type">オブジェクト</span></dt>
Expand Down
2 changes: 1 addition & 1 deletion node-red-node-ui-iframe/ui_iframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
limitations under the License.
-->

<script type="text/x-red" data-template-name="ui_iframe">
<script type="text/html" data-template-name="ui_iframe">
<div class="form-row" id="template-row-group">
<label for="node-input-group"><i class="fa fa-table"></i> <span data-i18n="ui_iframe.label.group"></span></label>
<input type="text" id="node-input-group">
Expand Down
13 changes: 8 additions & 5 deletions node-red-node-ui-iframe/ui_iframe.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@ module.exports = function(RED) {
var allow = "autoplay";
var origin = config.origin ? config.origin : "*";
var html = String.raw`
<div style="width:98%; height:98%; display:inline-block; margin:0,auto;">
<iframe id="${id}" src="${url}" allow="${allow}" style="width:100%; height:100%;">
Failed to load Web page
<style>
.nr-dashboard-ui_iframe { padding:0 !important; }
</style>
<div style="width:100%; height:100%; display:inline-block;">
<iframe id="${id}" src="${url}" allow="${allow}" style="width:100%; height:100%; overflow:hidden; border:0">
Failed to load Web page
</iframe>
</div>
<script>
Expand Down Expand Up @@ -53,13 +56,13 @@ module.exports = function(RED) {
</script>
`;
return html;
};
}

var ui = undefined;
function IFrameNode(config) {
try {
var node = this;
if(ui === undefined) {
if (ui === undefined) {
ui = RED.require("node-red-dashboard")(RED);
}
RED.nodes.createNode(this, config);
Expand Down

0 comments on commit ab6a11d

Please sign in to comment.