Last active
September 28, 2024 14:51
-
-
Save hussfelt/a6fe71ebd7cce327df29 to your computer and use it in GitHub Desktop.
Revisions
-
hussfelt revised this gist
May 27, 2015 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -7,11 +7,11 @@ IFrame plugin for dashing ## Installation Create the folder `iframe` in the `/widgets/` directory. Put the files `iframe.coffee`, `iframe.html` and `iframe.scss` in that folder. This can also be done by using the gist: https://gist.github.com/hussfelt/a6fe71ebd7cce327df29 dashing install a6fe71ebd7cce327df29 ## Dashboard configuration -
hussfelt created this gist
May 27, 2015 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,46 @@ # dashing-iframe IFrame plugin for dashing ## Description [Dashing](http://shopify.github.com/dashing) widget to display an iframe with specified src ## Installation Put the files `iframe.coffee`, `iframe.html` and `iframe.scss` in the `/widgets` directory This can also be done by using the gist: https://gist.github.com/hussfelt/? dashing install ? ## Dashboard configuration Put the following in your dashboard.erb file to show the iframe: ```html <li data-row="1" data-col="1" data-sizex="1" data-sizey="1"> <div data-id="iframeId1" data-view="Iframe"></div> </li> ``` ## Updating the src ### Curl ```bash curl -d '{ "auth_token": "YOUR_AUTH_TOKEN", "src": "http://example.com/" }' http://0.0.0.0:3030/widgets/iframeId1 ``` ### Inline ```html <li data-row="1" data-col="1" data-sizex="1" data-sizey="1"> <div data-id="iframeId1" data-view="Iframe" data-src="http://example.com/"></div> </li> ``` # License Distributed under the MIT license This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ class Dashing.Iframe extends Dashing.Widget ready: -> $(@node).find(".iframe").attr('src', @get('src')) onData: (data) -> $(@node).find(".iframe").attr('src', data.src) This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ <iframe class="iframe" data-bind-src="src" scrolling="no"></iframe> This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ // ---------------------------------------------------------------------------- // Sass declarations // ---------------------------------------------------------------------------- $background-color: #FFF; $title-color: #333; $moreinfo-color: #333; $iframe-background: darken($background-color, 25%); // ---------------------------------------------------------------------------- // Widget-iframe styles // ---------------------------------------------------------------------------- .widget-iframe { background-color: $background-color; padding: 0 !important; margin: 0 !important; iframe { width: 100%; height: 100%; border: 0; padding: 0; margin: 0; overflow: hidden; } }