Skip to content

Instantly share code, notes, and snippets.

@elliots
Forked from jmanoto/options.js
Last active December 27, 2015 15:29
Show Gist options
  • Save elliots/7348333 to your computer and use it in GitHub Desktop.
Save elliots/7348333 to your computer and use it in GitHub Desktop.
Shell command widget
return {
"name": "Shell Command",
"deviceMap": [{ "deviceType": "shell" }]
}
background: black;
.shell-widget {
padding: 30px 10px 10px;
.icon {
font-size: 160px;
color: #63de00;
display: block;
text-align: center;
line-height: 0.5em;
margin: 10px;
text-shadow: 0 0 10px #63de00;
}
button {
width: 90%;
display: block;
margin: 0 auto;
border: 0;
background: #63de00;
}
.result {
color: #63de00;
padding-top: 15px;
text-shadow: 0 0 10px #63de00;
}
}
<div class="shell-widget">
<span class="icon">&#59214;</span>
<button class="button green-gradient">Execute</button>
<div class="result">Result <span class="cursor">&gt;</span> <span class="out"></span></div>
</div>
scope.onData = function(data) {
element.find(".result .out").html(data.DA);
};
element.find('button').click(function() {
element.find(".result .out").empty();
scope.ActuateAll(1);
});
var state = true;
setInterval(function() {
element.find('.cursor').css('visibility', state = !state?'visible': 'hidden');
}, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment