quick_script 0.3.4 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module QuickScript
2
- VERSION = "0.3.4"
2
+ VERSION = "0.4.0"
3
3
  end
@@ -27,12 +27,12 @@ String.prototype.truncate = (val)->
27
27
  class @SelectOpts
28
28
  constructor : ->
29
29
  @options = []
30
- add : (val, str)->
31
- @options.push {val : val, str : str}
30
+ add : (val, str)=>
31
+ @options.push {val : val.toString(), str : str}
32
32
  return this
33
- find : (val)->
33
+ find : (val)=>
34
34
  for obj in @options
35
- return obj.str if obj.val == val
35
+ return obj.str if obj.val == val.toString()
36
36
  return ""
37
37
 
38
38
  ## PAGETIMER
@@ -134,6 +134,7 @@ Overlay.add = (vm, tmp, options, cls) ->
134
134
  Overlay.remove(id)
135
135
  $('#overlay-' + id).koBind(vm)
136
136
  Overlay.instance.zindex = Overlay.instance.zindex + 10
137
+
137
138
  Overlay.dialog = (msg, opts) ->
138
139
  vm =
139
140
  name : 'dialog'
@@ -142,6 +143,7 @@ Overlay.dialog = (msg, opts) ->
142
143
  no : opts.no
143
144
  cancel : Overlay.remove('dialog')
144
145
  Overlay.add(vm, 'view-dialog', { width : 300 })
146
+
145
147
  Overlay.notify = (msg, cls, tm) ->
146
148
  cls = cls || ''
147
149
  tm = tm || 3000
@@ -153,9 +155,23 @@ Overlay.notify = (msg, cls, tm) ->
153
155
  Overlay.instance.notifyTimeout = setTimeout ->
154
156
  $('#notify').fadeOut('slow')
155
157
  , tm
158
+
156
159
  Overlay.clearNotifications = ->
157
160
  clearTimeout(Overlay.instance.notifyTimeout)
158
161
  $('#notify').remove()
162
+
163
+ Overlay.confirm = (msg, opts) ->
164
+ vm =
165
+ yes : ->
166
+ opts.yes() if opts.yes?
167
+ Overlay.remove('confirm')
168
+ no : ->
169
+ opts.no() if opts.no?
170
+ Overlay.remove('confirm')
171
+ $('body').prepend("<div class='backdrop' id='backdrop-confirm' style='z-index:500'></div><div id='overlay-confirm' class='confirm' style='display: none;'><div class='msg'>" + msg + "</div><div class='opts'><button class='button green' data-bind='click : yes'>yes</button><button class='button red' data-bind='click : no'>no</button></div></div>")
172
+ $('#overlay-confirm').koBind(vm)
173
+ $('#overlay-confirm').slideDown 'fast'
174
+
159
175
  Overlay.remove = (id) ->
160
176
  $('#overlay-' + id).koClean()
161
177
  $('#overlay-' + id).remove()
@@ -77,6 +77,27 @@
77
77
  font-weight: bold
78
78
  opacity: 0.9
79
79
 
80
+ .confirm
81
+ +padded
82
+ +p-fix
83
+ +img-shadow
84
+ +t-4
85
+ +t-center
86
+ +t-shadow
87
+ +clear-border(0.1)
88
+ +bfg-grad($white, #000, 20)
89
+ +border-radius
90
+ width: 700px
91
+ top: -5px
92
+ left: 50%
93
+ margin-left: -360px
94
+ z-index: 10000
95
+ opacity: 0.9
96
+ .msg
97
+ float: left
98
+ .opts
99
+ float: right
100
+
80
101
  .loading-overlay
81
102
  +p-abs
82
103
  +border-radius
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: 27
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 3
9
8
  - 4
10
- version: 0.3.4
9
+ - 0
10
+ version: 0.4.0
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-05-15 00:00:00 Z
18
+ date: 2012-05-30 00:00:00 Z
19
19
  dependencies: []
20
20
 
21
21
  description: Framework for single-page web applications