pinkman 0.9.3.7 → 0.9.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4776976b67e1c7879b2b8d51fe34ad58c153bf2d
4
- data.tar.gz: b03e22a6384a89439da1202dccc136311e329ab7
3
+ metadata.gz: 51416ffae341b3d93834cc600d0d225ec819de18
4
+ data.tar.gz: f5fc0f065898c5f0a7490848871aba72275a545b
5
5
  SHA512:
6
- metadata.gz: 3ebbf417cbc561dddb3514be70e008de4d8eb2029a5aeb216eed1dfc43f301ce4f17a92c0ae191e27643f490ad990f854c340ec203b43bd7da66b8f5bf74be31
7
- data.tar.gz: 97422fba084dd7c8b6c20d633d11f776c22da3074541c3f136b4a65a901146a8f7fbfbb188b75b1d60a5cf6b6f664feeda92924f1f315871b946b9b817e6e97f
6
+ metadata.gz: b7bb64b6305ea9d1f2879713216c6cd89220f4d861c62ce2ee9d116f21262289ccd87261d780e25b6a1ad3eb395726024781ce5658b106f1dc97ae070eeddf9b
7
+ data.tar.gz: 12ab107a03bd43f1f97b17108452b7cd740880b5862a72019f6f1ca9173442a98aff944a23223241fa11bc090e633333181e915c7c8f86b3a24a75148ebdee5f
@@ -6,4 +6,5 @@
6
6
  //= require pinkman_base/collection
7
7
  //= require pinkman_base/render
8
8
  //= require pinkman_base/controller
9
- //= require pinkman_base/css
9
+ //= require pinkman_base/css
10
+ // = require pinkman_base/cable
@@ -0,0 +1 @@
1
+ Pinkman.cable = ActionCable.createConsumer() if ActionCable?
@@ -93,6 +93,10 @@ class window.PinkmanCommon
93
93
  $('#'+target).append(content)
94
94
  options.callback(object,content) if options.callback? and typeof options.callback == 'function'
95
95
  Pinkman.render(newOptions)
96
+ else if options? and Pinkman.isString(options)
97
+ @append
98
+ template: options + '-template'
99
+ target: options
96
100
 
97
101
  watch: () ->
98
102
  @_watching = yes
@@ -120,6 +124,5 @@ class window.PinkmanCommon
120
124
  anyErrorsOn: (args...) ->
121
125
  @hasErrorOn(args...)
122
126
 
123
-
124
127
  _data: ->
125
- { pink_obj: @json(), scope: Pinkman.scope(this) }
128
+ { pink_obj: @json(), scope: Pinkman.scope(this) }
@@ -73,6 +73,18 @@ class window.PinkmanController extends window.PinkmanObject
73
73
  endBottom: () ->
74
74
  Pinkman._bottomTriggered = false
75
75
 
76
+
77
+ subscribe: (channel,opt) ->
78
+ throw 'ActionCable not found.' unless Pinkman.cable?
79
+ throw 'Channel not specificied.' unless channel? and channel != ''
80
+ try
81
+ callback = if typeof opt == 'function' then opt else opt['callback']
82
+ catch
83
+ throw 'Callback not found.'
84
+ params = if (typeof opt == 'object' and opt['params']?) then opts['params'] else new Object
85
+ params.channel = channel
86
+ Pinkman.cable.subscriptions.create params, received: callback
87
+
76
88
  scrolling: (callback) ->
77
89
  if $("##{@id}").length
78
90
  $(window).scroll ->
@@ -86,6 +86,11 @@ module Pinkman
86
86
  hash
87
87
  end
88
88
  end
89
+
90
+ def to_h
91
+ JSON.parse(to_json)
92
+ end
93
+
89
94
  end
90
95
  end
91
96
  end
@@ -1,3 +1,3 @@
1
1
  module Pinkman
2
- VERSION = "0.9.3.7"
2
+ VERSION = "0.9.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pinkman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3.7
4
+ version: 0.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Agilso Oliveira
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-07-11 00:00:00.000000000 Z
11
+ date: 2017-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -182,6 +182,7 @@ files:
182
182
  - app/assets/javascripts/pinkman/engines/handlebars.js
183
183
  - app/assets/javascripts/pinkman/engines/hogan.js
184
184
  - app/assets/javascripts/pinkman/engines/markup.js
185
+ - app/assets/javascripts/pinkman_base/cable.coffee
185
186
  - app/assets/javascripts/pinkman_base/collection.coffee
186
187
  - app/assets/javascripts/pinkman_base/common.coffee
187
188
  - app/assets/javascripts/pinkman_base/controller.coffee