pinkman 0.9.9.9.7 → 0.9.9.9.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a2364e643b526d4dd6a357191a9fc6caf3d88e20855c557f3c3e294fde100e7e
4
- data.tar.gz: f70aec87b9660e27f029e62e8c4ee8228de45dcb1664b467970088dba540c001
3
+ metadata.gz: 49cfcfa42bf47e4d1d37463921194548b5baa855aab534f4b8b894df7e9629af
4
+ data.tar.gz: 759225692ad976cf718d1b6a681ebb83fac3ddece90bd7407780e9bb14e276ef
5
5
  SHA512:
6
- metadata.gz: 920d271b5f322dfefd455efb7404b0c8286c59878533d77f5adb5294423665d51170ba12e89228b96fc0888a3452f02004530e0691fd529fa33b0e2a68c00c34
7
- data.tar.gz: 55a07bfc217de58fa1653d99380360945790d81c787a9937410bf1dbaa45f22bc7e39c8e05fdc68b98f0bd6f0ecb6dc42cf9f28fc99af639b1bc113b3dd8abc7
6
+ metadata.gz: 3bf4c7db04d4cd6b9eff756bb1b6dd5c6b8c09aa83eeccd87be5e0d4c9a7d7bc0963d18f9229a417c2a94621cd658bfa8beb42dfe7fd40237b575f3ab56bce26
7
+ data.tar.gz: 846b934cfde288844793534d8dd261ea3a43e02cab1b256f8ad858f73988eda5328da99310d12a3332fe5a30db6469fca4a5e3b90999c4baf0b38cba9b956466
@@ -282,9 +282,29 @@ class window.PinkmanCollection extends window.PinkmanCommon
282
282
  return @collection[(@collection.length - n - 1)..]
283
283
 
284
284
  # Desc: return trues if has at least one member. If a criteria is specificied, returns true if at least one member satisfies it.
285
- any: (criteria='') ->
286
- if criteria? and (typeof criteria == 'function' or typeof criteria == 'object')
287
- @select(criteria).count() > 0
285
+ any: (criteria) ->
286
+ if criteria?
287
+ # id version
288
+ if $p.isNumber(criteria)
289
+ return(@find(criteria)?)
290
+
291
+ # function version
292
+ else if $p.isFunction(criteria)
293
+ # console.log 'select: function'
294
+ value = false
295
+ @each (object) ->
296
+ value = true if criteria(object)
297
+ return(value)
298
+
299
+ # object version
300
+ else if $p.isObject(criteria)
301
+ # console.log 'select: object'
302
+ masterValue = false
303
+ @each (object) ->
304
+ value = true
305
+ (value = false if object[k] != v) for k,v of criteria
306
+ masterValue = true if value
307
+ return(masterValue)
288
308
  else
289
309
  @count() > 0
290
310
 
@@ -41,6 +41,9 @@ class window.Pinkman
41
41
 
42
42
 
43
43
  # --- tools and facilities
44
+
45
+ @top: ->
46
+ window.scrollTo(0,0)
44
47
 
45
48
  @ctrl_c: (text) ->
46
49
  textArea = document.createElement('textarea')
@@ -32,7 +32,9 @@ Pinkman.template_engines =
32
32
  throw 'Pinkman: markup not found.'
33
33
 
34
34
  template: (options) ->
35
- if Pinkman.templates.include(template: options.template, engine: options.engine)
35
+ # console.log options.template
36
+ # console.log options.engine
37
+ if Pinkman.templates.any(template: options.template, engine: options.engine)
36
38
  template = Pinkman.templates.get(template: options.template, engine: options.engine)
37
39
  else
38
40
  template = new Pinkman.object(template: options.template, engine: options.engine)
@@ -1,3 +1,3 @@
1
1
  module Pinkman
2
- VERSION = "0.9.9.9.7"
2
+ VERSION = "0.9.9.9.8"
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.9.9.7
4
+ version: 0.9.9.9.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Agilso Oliveira
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-04-04 00:00:00.000000000 Z
11
+ date: 2018-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler