summaryrefslogtreecommitdiff
path: root/templates/widget
diff options
context:
space:
mode:
Diffstat (limited to 'templates/widget')
-rw-r--r--templates/widget/%name%/%name%.coffee.tt9
-rw-r--r--templates/widget/%name%/%name%.html1
-rw-r--r--templates/widget/%name%/%name%.scss.tt3
3 files changed, 13 insertions, 0 deletions
diff --git a/templates/widget/%name%/%name%.coffee.tt b/templates/widget/%name%/%name%.coffee.tt
new file mode 100644
index 0000000..bc752e1
--- /dev/null
+++ b/templates/widget/%name%/%name%.coffee.tt
@@ -0,0 +1,9 @@
+class Dashing.<%= Thor::Util.camel_case(name) %> extends Dashing.Widget
+
+ ready: ->
+ # This is fired when the widget is done being rendered
+
+ onData: (data) ->
+ # Handle incoming data
+ # You can access the html node of this widget with `@node`
+ # Example: $(@node).fadeOut().fadeIn() will make the node flash each time data comes in. \ No newline at end of file
diff --git a/templates/widget/%name%/%name%.html b/templates/widget/%name%/%name%.html
new file mode 100644
index 0000000..789f2e3
--- /dev/null
+++ b/templates/widget/%name%/%name%.html
@@ -0,0 +1 @@
+<div data-bind="value"></div> \ No newline at end of file
diff --git a/templates/widget/%name%/%name%.scss.tt b/templates/widget/%name%/%name%.scss.tt
new file mode 100644
index 0000000..660a554
--- /dev/null
+++ b/templates/widget/%name%/%name%.scss.tt
@@ -0,0 +1,3 @@
+.widget-<%= Dashing::CLI.hyphenate(name) %> {
+
+} \ No newline at end of file