pinkman 1.5.0 → 1.5.5
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
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f5ae7dc5426b1991dfceff32ae73e6c5eb09b12e
|
4
|
+
data.tar.gz: c9e54763e2944487ba19c95d5a09a364eaed822c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31df578621909b49388c30cedca3a45562e66a77eeec0040f854504e1fe1995e2e76336576f49c36451888bbd78883e38261abfa0d67bb42488b35703aff2ba6
|
7
|
+
data.tar.gz: ff4493e22c00d4318bf9d4ed4f980d2292af75ed19c9cf5eee326a42c11e17be286b78f8a3ac67405fc98f3e3c1e7d286fbf69e59ec4baf278d828088724f2e5
|
data/.gitignore
CHANGED
@@ -23,7 +23,7 @@ class window.PinkmanObject extends window.PinkmanCommon
|
|
23
23
|
for instance in @instances
|
24
24
|
i = i + 1
|
25
25
|
if instance.id? and instance.id == obj.id
|
26
|
-
if obj.isPink then instance.assign(obj.
|
26
|
+
if obj.isPink then instance.assign(obj.json()) else instance.assign(obj)
|
27
27
|
each(instance) if $p.isFunction(each) and obj.pinkey != instance.pinkey
|
28
28
|
callback() if (length == i) and $p.isFunction(callback)
|
29
29
|
else
|
@@ -187,7 +187,7 @@ class window.PinkmanObject extends window.PinkmanCommon
|
|
187
187
|
update: (callback='') ->
|
188
188
|
if @id?
|
189
189
|
Pinkman.ajax.patch
|
190
|
-
url: @api(
|
190
|
+
url: @api(@id)
|
191
191
|
data: @_data()
|
192
192
|
complete: (response) =>
|
193
193
|
@default_response_handling(response,callback)
|
@@ -202,7 +202,7 @@ class window.PinkmanObject extends window.PinkmanCommon
|
|
202
202
|
params = new Object
|
203
203
|
params.scope = Pinkman.scope(this)
|
204
204
|
Pinkman.ajax.get
|
205
|
-
url: Pinkman.json2url(@api(
|
205
|
+
url: Pinkman.json2url(@api(@id),params)
|
206
206
|
complete: (response) =>
|
207
207
|
@assign(response)
|
208
208
|
if @error? or @errors?
|
@@ -220,15 +220,39 @@ class window.PinkmanObject extends window.PinkmanCommon
|
|
220
220
|
return false
|
221
221
|
|
222
222
|
save: (callback='') ->
|
223
|
-
|
223
|
+
@handleBeforeSave()
|
224
|
+
callback = @handleAfterSaveCallback(callback)
|
225
|
+
if @id? and @id!='' then @update(callback) else @create(callback)
|
226
|
+
|
227
|
+
handleBeforeSave: ->
|
228
|
+
if $p.isArray(@beforeSave)
|
229
|
+
for f in @beforeSave
|
230
|
+
f(this) if $p.isFunction(f)
|
231
|
+
else if $p.isFunction(@beforeSave)
|
232
|
+
@beforeSave(this)
|
233
|
+
|
234
|
+
handleAfterSaveCallback: (callback) ->
|
235
|
+
if $p.isArray(@afterSave)
|
236
|
+
(obj) =>
|
237
|
+
i = 0
|
238
|
+
for f in @afterSave
|
239
|
+
f(obj) if $p.isFunction(f)
|
240
|
+
i = i + 1
|
241
|
+
callback(obj) if i == @afterSave.length and $p.isFunction(callback)
|
242
|
+
else if $p.isFunction(@afterSave)
|
243
|
+
(obj) =>
|
244
|
+
@afterSave(obj)
|
245
|
+
callback(obj) if $p.isFunction()
|
246
|
+
else
|
247
|
+
callback
|
224
248
|
|
225
249
|
# delete and remove from collections
|
226
250
|
destroy: (callback='') ->
|
227
251
|
if @id?
|
228
252
|
@removeFromAllCollections()
|
229
253
|
Pinkman.ajax.delete
|
230
|
-
url: @api(
|
231
|
-
data:
|
254
|
+
url: @api(@id)
|
255
|
+
data: @_data()
|
232
256
|
complete: (response) =>
|
233
257
|
@assign(response)
|
234
258
|
delete @errors unless response.errors?
|
@@ -242,8 +266,8 @@ class window.PinkmanObject extends window.PinkmanCommon
|
|
242
266
|
delete: (callback='') ->
|
243
267
|
if @id?
|
244
268
|
Pinkman.ajax.delete
|
245
|
-
url: @api(
|
246
|
-
data:
|
269
|
+
url: @api(@id)
|
270
|
+
data: @_data()
|
247
271
|
complete: (response) =>
|
248
272
|
@assign(response)
|
249
273
|
delete @errors unless response.errors?
|
@@ -280,12 +280,11 @@ class window.Pinkman
|
|
280
280
|
contentType: false
|
281
281
|
ajax.done (response) =>
|
282
282
|
if response? and response.errors?
|
283
|
-
options.error(
|
284
|
-
return false
|
283
|
+
options.error(response) if $p.isFunction(options.error)
|
285
284
|
else
|
286
|
-
options.success(response) if
|
287
|
-
options.complete(response) if
|
288
|
-
|
285
|
+
options.success(response) if $p.isFunction(options.success)
|
286
|
+
options.complete(response) if $p.isFunction(options.complete)
|
287
|
+
return response
|
289
288
|
else
|
290
289
|
return false
|
291
290
|
|
@@ -235,16 +235,19 @@ class window.PinkmanRouter
|
|
235
235
|
|
236
236
|
@analytics:
|
237
237
|
create: (id) ->
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
238
|
+
try
|
239
|
+
ga('create', id, 'auto');
|
240
|
+
ga('send', 'pageview');
|
241
|
+
true
|
242
|
+
catch
|
243
|
+
console.log('ga blocked')
|
244
|
+
false
|
245
|
+
|
242
246
|
|
243
247
|
send: (route,path) ->
|
244
248
|
unless @created? and @created
|
245
249
|
# console.log this
|
246
|
-
@create(Pinkman.router._config.analytics)
|
247
|
-
@created = true
|
250
|
+
@created = @create(Pinkman.router._config.analytics)
|
248
251
|
else
|
249
252
|
host = new RegExp(window.location.origin)
|
250
253
|
path = if host.test(path) then path.replace(host,'') else path
|
data/lib/pinkman/version.rb
CHANGED
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: 1.5.
|
4
|
+
version: 1.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Agilso Oliveira
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -322,7 +322,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
322
322
|
- !ruby/object:Gem::Version
|
323
323
|
version: '0'
|
324
324
|
requirements: []
|
325
|
-
|
325
|
+
rubyforge_project:
|
326
|
+
rubygems_version: 2.6.14.4
|
326
327
|
signing_key:
|
327
328
|
specification_version: 4
|
328
329
|
summary: Small Rails-js framework.
|