quick_script 0.0.47 → 0.0.50

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,6 +2,30 @@
2
2
 
3
3
  .p-rel
4
4
  +p-rel
5
+ .p-abs
6
+ +p-abs
7
+ .bold
8
+ +bold
9
+ .t-4
10
+ +t-4
11
+ .t-3
12
+ +t-3
13
+ .t-2
14
+ +t-2
15
+ .t-1
16
+ +t-1
17
+ .t-upper
18
+ +t-upper
19
+ .t-center
20
+ +t-center
21
+ .padded
22
+ +padded
23
+ .left
24
+ +left
25
+ .right
26
+ +right
27
+ .inline, .inl
28
+ +inline
5
29
 
6
30
  .img-shadow-dark
7
31
  +img-shadow-dark
@@ -52,7 +76,8 @@ hr
52
76
  position: fixed
53
77
  width: 100%
54
78
  height: 100%
55
- background-color: rgba(0,0,0,.4)
79
+ background: -webkit-radial-gradient(50% 50%, ellipse closest-corner, rgba(0, 0, 0, 0.3) 1%, rgba(0, 0, 0, 0.725) 100%)
80
+ background: -moz-radial-gradient(50% 50%, ellipse closest-corner, rgba(0, 0, 0, 0.3) 1%, rgba(0, 0, 0, 0.725) 100%)
56
81
  top: 0px
57
82
  left: 0px
58
83
  z-index: 10
@@ -107,7 +132,8 @@ hr
107
132
  +p-abs
108
133
  +border-radius
109
134
  +img-shadow
110
- background-color: rgba(0,0,0,.4)
135
+ background: -webkit-radial-gradient(50% 50%, ellipse closest-corner, rgba(0, 0, 0, 0.3) 1%, rgba(0, 0, 0, 0.725) 100%)
136
+ background: -moz-radial-gradient(50% 50%, ellipse closest-corner, rgba(0, 0, 0, 0.3) 1%, rgba(0, 0, 0, 0.725) 100%)
111
137
  z-index: 10
112
138
  top: 0px
113
139
  bottom: 0px
@@ -1,5 +1,5 @@
1
- @import blueprint
2
1
  @import compass
2
+ @import blueprint
3
3
 
4
4
  $blue: #06C
5
5
  $white: #FFF
@@ -12,24 +12,16 @@ $dark-gray: rgba(0,0,0,.75)
12
12
  font-weight: bold
13
13
  =t-4
14
14
  font-size: 30px
15
- .t-4
16
- +t-4
17
15
  =t-3
18
16
  font-size: 20px
19
- .t-3
20
- +t-3
21
17
  =t-2
22
18
  font-size: 18px
23
19
  =t-1
24
20
  font-size: 14px
25
- .t-1
26
- +t-1
27
21
  =t-0
28
22
  font-size: 12px
29
23
  =t-upper
30
24
  text-transform: uppercase
31
- .t-upper
32
- +t-upper
33
25
  =t-center
34
26
  text-align: center
35
27
  =f-ga
@@ -53,6 +45,10 @@ $dark-gray: rgba(0,0,0,.75)
53
45
  position: absolute
54
46
  =p-fix
55
47
  position: fixed
48
+ =left
49
+ float: left
50
+ =right
51
+ float: right
56
52
  =t-shadow
57
53
  text-shadow: 0px 1px 1px #AAA
58
54
  =t-shadow-dark
@@ -1,4 +1,4 @@
1
- /* QS_VERSION=0.0.47;
1
+ /* QS_VERSION=0.0.50;
2
2
  *= require ./basics
3
3
  *= require ./buttons
4
4
  */
@@ -104,48 +104,48 @@ class @Overlay
104
104
  constructor : ->
105
105
  @zindex = 100
106
106
  @notifyTimer = null
107
- closeDialog : =>
107
+ Overlay.instance = new Overlay()
108
+ Overlay.closeDialog = ->
108
109
  @remove('dialog')
109
- add : (vm, tmp, options, cls) =>
110
+ Overlay.add = (vm, tmp, options, cls) ->
110
111
  id = vm.name
111
112
  template = tmp
112
113
  cls = cls || ''
113
114
  options = {} if !options?
114
- options['z-index'] = @zindex + 10
115
- $('body').prepend("<div class='backdrop' id='backdrop-#{id}' style='z-index: #{(@zindex + 9)}'></div><div id='overlay-" + id + "' class='overlay'><div class='content' data-bind=\"template: '" + template + "'\"></div></div>")
115
+ options['z-index'] = Overlay.instance.zindex + 10
116
+ $('body').prepend("<div class='backdrop' id='backdrop-#{id}' style='z-index: #{(Overlay.instance.zindex + 9)}'></div><div id='overlay-" + id + "' class='overlay'><div class='content' data-bind=\"template: '" + template + "'\"></div></div>")
116
117
  $('#overlay-' + id).css(options)
117
118
  $('#overlay-' + id).addClass(cls)
118
119
  $('#overlay-' + id).css({'margin-left' : -1 * $('#overlay-' + id).width() / 2})
119
120
  $('.overlay .content').css({'max-height' : ($(window).height() - 100)})
120
121
  $('#backdrop-' + id).click =>
121
122
  console.log('backdrop clicked.')
122
- @remove(id)
123
+ Overlay.remove(id)
123
124
  $('#overlay-' + id).koBind(vm)
124
- @zindex = @zindex + 10
125
- dialog : (msg, opts) ->
126
- self = this
125
+ Overlay.instance.zindex = Overlay.instance.zindex + 10
126
+ Overlay.dialog = (msg, opts) ->
127
127
  vm =
128
128
  name : 'dialog'
129
129
  message : ko.observable(msg)
130
130
  yes : opts.yes
131
131
  no : opts.no
132
- cancel : self.remove('dialog')
133
- @add(vm, 'view-dialog', { width : 300 })
134
- notify : (msg, cls, tm) ->
132
+ cancel : Overlay.remove('dialog')
133
+ Overlay.add(vm, 'view-dialog', { width : 300 })
134
+ Overlay.notify = (msg, cls, tm) ->
135
135
  cls = cls || ''
136
136
  tm = tm || 3000
137
- @clearNotifications()
137
+ Overlay.clearNotifications()
138
138
  $('body').prepend("<div id='notify' class='notify' style='display: none;'>" + msg + "</div>")
139
139
  if (cls)
140
140
  $('#notify').addClass(cls)
141
141
  $('#notify').slideDown 'slow', ->
142
- @notifyTimeout = setTimeout ->
142
+ Overlay.instance.notifyTimeout = setTimeout ->
143
143
  $('#notify').fadeOut('slow')
144
144
  , tm
145
- clearNotifications : ->
146
- clearTimeout(@notifyTimeout)
145
+ Overlay.clearNotifications = ->
146
+ clearTimeout(Overlay.instance.notifyTimeout)
147
147
  $('#notify').remove()
148
- remove : (id) ->
148
+ Overlay.remove = (id) ->
149
149
  $('#overlay-' + id).koClean()
150
150
  $('#overlay-' + id).remove()
151
151
  $('#backdrop-' + id).remove()
@@ -99,6 +99,23 @@
99
99
  model.selectFile = ->
100
100
  $(element).click()
101
101
 
102
+ ko.bindingHandlers.tabs =
103
+ init : (element, valueAccessor, bindingsAccessor, viewModel) ->
104
+ $(element).addClass('ui-tabs ui-widget ui-widget-content ui-corner-all')
105
+ $(element).children('ul').first().addClass('ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all')
106
+ $(element).children('ul').first().children('li').addClass('ui-state-default ui-corner-top')
107
+ $(element).children('div').addClass('ui-tabs-panel ui-widget-content ui-corner-bottom')
108
+ $(element).children('ul').first().find('li a').each (idx, el)->
109
+ tab_id = $(el).parent()[0].id
110
+ $(el).click ->
111
+ valueAccessor()(tab_id)
112
+ update : (element, valueAccessor, bindingsAccessor, viewModel) ->
113
+ sel_tab = ko.utils.unwrapObservable(valueAccessor())
114
+ $(element).children('ul').first().children('li').removeClass('ui-tabs-selected ui-state-active')
115
+ $(element).children('ul').first().children("li##{sel_tab}").addClass('ui-tabs-selected ui-state-active')
116
+ $(element).children('div').addClass('ui-tabs-hide')
117
+ $(element).children("div##{sel_tab}").removeClass('ui-tabs-hide')
118
+
102
119
  ko.bindingHandlers.calendar =
103
120
  init : (element, valueAccessor, bindingsAccessor, viewModel) ->
104
121
  $(element).fullCalendar('destroy')
@@ -571,9 +588,9 @@ class @View
571
588
  getViewName : (view) ->
572
589
  view.templateID
573
590
  showAsOverlay : (tmp, opts, cls)=>
574
- overlay.add(this, tmp, opts, cls)
591
+ Overlay.add(this, tmp, opts, cls)
575
592
  hideOverlay : =>
576
- overlay.remove(@name)
593
+ Overlay.remove(@name)
577
594
 
578
595
  class @ModelAdapter
579
596
  constructor : (opts)->
@@ -678,7 +695,6 @@ class @AppView extends @View
678
695
 
679
696
  @initApp = ->
680
697
  appViewModel = @appViewModel
681
- overlay = @overlay
682
698
 
683
699
  appViewModel.setUser(@CURRENT_USER)
684
700
 
@@ -1,4 +1,4 @@
1
- // QS_VERSION = 0.0.47;
1
+ // QS_VERSION = 0.0.50;
2
2
  //= require ./jquery.min
3
3
  //= require ./jquery-ui.min
4
4
  //= require ./jquery.iframe-transport
@@ -22,7 +22,6 @@ module QuickScript
22
22
  initKO();
23
23
  CURRENT_USER = (#{jsify current_user});
24
24
  appViewModel = new #{app_model}();
25
- overlay = new Overlay();
26
25
  initApp();
27
26
  console.log('Initialized...');
28
27
  });".html_safe
@@ -1,3 +1,3 @@
1
1
  module QuickScript
2
- VERSION = "0.0.47"
2
+ VERSION = "0.0.50"
3
3
  end
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: 65
4
+ hash: 123
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 47
10
- version: 0.0.47
9
+ - 50
10
+ version: 0.0.50
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-03-20 00:00:00 Z
18
+ date: 2012-03-24 00:00:00 Z
19
19
  dependencies: []
20
20
 
21
21
  description: Framework for single-page web applications