-
Notifications
You must be signed in to change notification settings - Fork 403
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds bourbon, basic style and fixes to widgets
Signed-off-by: Akash Manohar J <[email protected]>
- Loading branch information
Showing
19 changed files
with
768 additions
and
51 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,32 @@ | ||
class Kandan.Widgets | ||
@widgets: {} | ||
|
||
@register: (widget_name, callback)-> | ||
@widgets[widget_name] = callback | ||
@register: (widget_namespace)-> | ||
@widgets[widget_namespace] = "widget_#{Object.size(@widgets)}" | ||
|
||
@all: ()-> | ||
@widgets | ||
|
||
@widget_names: ()-> | ||
widget_names = [] | ||
for widget_name of @all() | ||
widget_names.push(widget_name) if @all().hasOwnProperty(widget_name) | ||
widget_names | ||
|
||
@init_all: ()-> | ||
@init(widget_name) for widget_name in @widget_names() | ||
$.each @widgets, (widget_namespace, el_name)=> | ||
@init(widget_namespace) | ||
|
||
@template: _.template ''' | ||
<div class="widget" id="widget_<%= element_id %>"> | ||
<div class="title"><%= title %></div> | ||
<div class="content" id="<%= element_id %>"></div> | ||
</div> | ||
''' | ||
|
||
@init: (widget_namespace)-> | ||
widget = eval(widget_namespace) | ||
$(".sidebar .widgets").append(@template({ | ||
element_id: @widgets[widget_namespace], | ||
title: widget.widget_title | ||
})) | ||
@render(widget_namespace) | ||
|
||
@init: (widget_name)-> | ||
# TODO use the widget_name property on the plugin module to get the title | ||
$(".sidebar").append("<h3>#{widget_name}</h3><div class='#{widget_name}'></div>") | ||
@render(widget_name) | ||
|
||
@render: (widget_name)-> | ||
$widget_el = $(".sidebar .#{widget_name}") | ||
eval(@widgets[widget_name]).render($widget_el) if $widget_el != [] | ||
@render: (widget_namespace)-> | ||
$widget_el = $("##{@widgets[widget_namespace]}") | ||
eval(widget_namespace).render($widget_el) if $widget_el != [] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Object.size = (obj)-> | ||
size = 0 | ||
for key of obj | ||
size++ if (obj.hasOwnProperty(key)) | ||
return size; |
Binary file added
BIN
+17.8 KB
...ts/stylesheets/.sass-cache/17f0e82b2579360f0fd2da22dc8536465246e07f/application.css.scssc
Binary file not shown.
Binary file added
BIN
+4.23 KB
...assets/stylesheets/.sass-cache/17f0e82b2579360f0fd2da22dc8536465246e07f/application.scssc
Binary file not shown.
Binary file added
BIN
+34.7 KB
app/assets/stylesheets/.sass-cache/4430bcd5702170ba130be06cca10fb0a768ae0cf/normalize.scssc
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Empty file.
Oops, something went wrong.