rocky 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,10 @@
1
+ class Middleware.Component.Modal extends Middleware.System.Base
2
+ @create: (selector) ->
3
+ $("body").append("<div class='modal' data-block='#{selector}'></div>")
4
+ Sexmash.Views.System.Modal.bindOne("*[data-block='#{selector}']")
5
+
6
+ constructor: (@container) ->
7
+ super(@container)
8
+
9
+ fill: (content) =>
10
+ @container.append(content)
@@ -0,0 +1,14 @@
1
+ class Middleware.Component.Puppet extends Middleware.System.Base
2
+ constructor: (@container) ->
3
+ super(@container)
4
+ @initPage()
5
+
6
+ initPage: =>
7
+ window.close()
8
+
9
+ if @container.data("trigger") == "redirect"
10
+ window.opener.location = @container.data("url")
11
+ end
12
+
13
+ jQuery ->
14
+ Middleware.Component.Puppet.bindMany("*[data-block=puppet_page]")
@@ -0,0 +1,16 @@
1
+ class Middleware.System.Base
2
+
3
+ @bindMany: (selector) ->
4
+ collection = []
5
+ instance = @
6
+
7
+ $(selector).each ->
8
+ collection.push(new instance($(@)))
9
+
10
+ collection
11
+
12
+ @bindOne: (selector) ->
13
+ new @($(selector))
14
+
15
+ constructor: (@container) ->
16
+ _.extend(@, Backbone.Events)
@@ -0,0 +1,8 @@
1
+ #= require_self
2
+ #= require_tree ./middleware/system
3
+ #= require_tree ./middleware/component
4
+
5
+ window.Middleware = {
6
+ System: {}
7
+ Component: {}
8
+ }