quick_script 0.9.5 → 0.9.6
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.
data/lib/quick_script/version.rb
CHANGED
@@ -22,9 +22,22 @@
|
|
22
22
|
$(element).html(opts[2])
|
23
23
|
$(element).attr('disabled', 'true')
|
24
24
|
else
|
25
|
-
|
25
|
+
if opts[3]?
|
26
|
+
txt = "<i class='#{opts[3]}'></i> #{opts[1]}"
|
27
|
+
else
|
28
|
+
txt = opts[1]
|
29
|
+
$(element).html(txt)
|
26
30
|
$(element).removeAttr('disabled')
|
27
31
|
|
32
|
+
ko.bindingHandlers.viewOptions =
|
33
|
+
update : (element, valueAccessor) ->
|
34
|
+
$(element).empty()
|
35
|
+
opts = ko.utils.unwrapObservable(valueAccessor())
|
36
|
+
for view in opts[0]
|
37
|
+
$(element).append("<option value='#{opts[2](view)}'>#{opts[1](view)}</option>")
|
38
|
+
if opts[3]?
|
39
|
+
$(element).prepend("<option>#{opts[3]}</option>")
|
40
|
+
|
28
41
|
ko.bindingHandlers.handleEnter =
|
29
42
|
init : (element, valueAccessor, bindingsAccessor, viewModel) ->
|
30
43
|
$(element).keypress (ev)->
|
@@ -375,12 +388,14 @@ jQuery.ajax_qs = (opts)->
|
|
375
388
|
opts.success(resp)
|
376
389
|
else
|
377
390
|
opts.error(req.status) if opts.error?
|
391
|
+
opts.loading(false) if opts.loading?
|
378
392
|
req.upload.addEventListener('error', opts.error) if opts.error?
|
379
393
|
if opts.progress?
|
380
394
|
req.upload.addEventListener 'progress', (ev)->
|
381
395
|
opts.progress(ev, Math.floor( ev.loaded / ev.total * 100 ))
|
382
396
|
req.open opts.type, opts.url, true
|
383
397
|
req.setRequestHeader 'X-CSRF-Token', jQuery.CSRF_TOKEN
|
398
|
+
opts.loading(true) if opts.loading?
|
384
399
|
req.send(data)
|
385
400
|
return req
|
386
401
|
|
@@ -894,8 +909,11 @@ class @ModelAdapter
|
|
894
909
|
opts.url = @save_url
|
895
910
|
@send opts
|
896
911
|
send : (opts)->
|
912
|
+
def_err_fn = ->
|
913
|
+
opts.success({meta : 500, data : ['An error occurred.']})
|
897
914
|
opts.type = 'POST' if !opts.type?
|
898
915
|
opts.url = @host + opts.url
|
916
|
+
opts.error = def_err_fn unless opts.error?
|
899
917
|
$.ajax_qs opts
|
900
918
|
delete : (opts)->
|
901
919
|
$.ajax
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 9
|
8
|
-
-
|
9
|
-
version: 0.9.
|
8
|
+
- 6
|
9
|
+
version: 0.9.6
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Alan Graham
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2012-10-
|
17
|
+
date: 2012-10-03 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|