-
-
Save elliots/6265672 to your computer and use it in GitHub Desktop.
NinjaBlocks notification device widget
This file contains 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 characters
return { | |
"name": "Notification", | |
"deviceMap": [{ "deviceType": "notification" }] | |
} |
This file contains 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 characters
padding: 40px 10px 10px; | |
.notification-widget { | |
text-align: right; | |
button { | |
} | |
input { | |
width: 92%; | |
display: block; | |
margin: 0 auto 5px; | |
} | |
select { | |
float: left; | |
} | |
} |
This file contains 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 characters
<div class="notification-widget"> | |
<form> | |
<input class="input" type="text" name="message" placeholder="Message"/> | |
<input class="input" type="text" name="title" placeholder="Title"/> | |
<input class="input" type="text" name="subtitle" placeholder="Subtitle"/> | |
<input class="input" type="text" name="url" placeholder="URL"/> | |
<select name="type"> | |
<option>info</option> | |
<option>pass</option> | |
<option>fail</option> | |
</select> | |
<button class="button orange-gradient compact">Notify</button> | |
</form> | |
</div> |
This file contains 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 characters
$.fn.serializeObject = function() | |
{ | |
var o = {}; | |
var a = this.serializeArray(); | |
$.each(a, function() { | |
if (o[this.name] !== undefined) { | |
if (!o[this.name].push) { | |
o[this.name] = [o[this.name]]; | |
} | |
o[this.name].push(this.value || ''); | |
} else { | |
o[this.name] = this.value || ''; | |
} | |
}); | |
return o; | |
}; | |
element.find('button').click(function() { | |
scope.ActuateAll(element.find('form').serializeObject()); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment