quick_script 0.5.4 → 0.5.5
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.
@@ -20,10 +20,12 @@ module QuickScript
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
-
def json_resp(data, meta)
|
23
|
+
def json_resp(data, meta, opts = {})
|
24
24
|
meta = 200 if meta == true
|
25
25
|
meta = 404 if meta == false
|
26
|
-
|
26
|
+
opts[:data] = data
|
27
|
+
opts[:meta] = meta
|
28
|
+
opts.to_json
|
27
29
|
end
|
28
30
|
|
29
31
|
def handle_params
|
data/lib/quick_script/version.rb
CHANGED
@@ -493,6 +493,7 @@ class @Collection
|
|
493
493
|
@page = ko.observable(1)
|
494
494
|
@limit = ko.observable(@opts.limit || 100)
|
495
495
|
@title = ko.observable(@opts.title || 'Collection')
|
496
|
+
@count = ko.observable(0)
|
496
497
|
@extra_params = ko.observable(@opts.extra_params || {})
|
497
498
|
@model = @opts.model || Model
|
498
499
|
@adapter = @opts.adapter || new ModelAdapter()
|
@@ -550,6 +551,7 @@ class @Collection
|
|
550
551
|
success : (resp)=>
|
551
552
|
return if @_reqid != reqid
|
552
553
|
@handleData(resp.data, op)
|
554
|
+
@count(resp.count) if resp.count?
|
553
555
|
callback(resp) if callback?
|
554
556
|
@events.onchange() if @events.onchange?
|
555
557
|
if op == Collection.REPLACE
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quick_script
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 1
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 5
|
10
|
+
version: 0.5.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Alan Graham
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-06-
|
18
|
+
date: 2012-06-13 00:00:00 Z
|
19
19
|
dependencies: []
|
20
20
|
|
21
21
|
description: Framework for single-page web applications
|