quick_script 0.11.11 → 0.12.0
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
    
    
| @@ -15,6 +15,14 @@ | |
| 15 15 | 
             
            			shouldDisplay = ko.utils.unwrapObservable(valueAccessor())
         | 
| 16 16 | 
             
            			if shouldDisplay then $(element).slideDown('slow') else $(element).slideUp()
         | 
| 17 17 |  | 
| 18 | 
            +
            	ko.bindingHandlers.dim =
         | 
| 19 | 
            +
            		init : (element, valueAccessor) ->
         | 
| 20 | 
            +
            			shouldDim = ko.utils.unwrapObservable(valueAccessor())
         | 
| 21 | 
            +
            			if shouldDim then $(element).css({opacity : 0.3}) else $(element).css({opacity: 1.0})
         | 
| 22 | 
            +
            		update : (element, valueAccessor) ->
         | 
| 23 | 
            +
            			shouldDim = ko.utils.unwrapObservable(valueAccessor())
         | 
| 24 | 
            +
            			if shouldDim then $(element).animate({opacity : 0.3}) else $(element).animate({opacity: 1.0})
         | 
| 25 | 
            +
             | 
| 18 26 | 
             
            	# buttonStatus - [is_loading, ready_str, loading_str, icon_classes]
         | 
| 19 27 | 
             
            	ko.bindingHandlers.buttonStatus =
         | 
| 20 28 | 
             
            		update : (element, valueAccessor) ->
         | 
| @@ -34,27 +42,22 @@ | |
| 34 42 | 
             
            	ko.bindingHandlers.listStatus =
         | 
| 35 43 | 
             
            		init : (element, valueAccessor) ->
         | 
| 36 44 | 
             
            			opts = ko.utils.unwrapObservable(valueAccessor())
         | 
| 37 | 
            -
            			 | 
| 38 | 
            -
             | 
| 39 | 
            -
            				 | 
| 40 | 
            -
             | 
| 41 | 
            -
             | 
| 42 | 
            -
            					 | 
| 43 | 
            -
             | 
| 44 | 
            -
            					$(element).show()
         | 
| 45 | 
            -
            					$(element).html(opts[1])
         | 
| 46 | 
            -
            		update : (element, valueAccessor) ->
         | 
| 47 | 
            -
            			opts = ko.utils.unwrapObservable(valueAccessor())
         | 
| 48 | 
            -
            			opts[0].is_loading.subscribe ->
         | 
| 49 | 
            -
            				if opts[0].is_loading()
         | 
| 50 | 
            -
            					$(element).html(opts[2])
         | 
| 51 | 
            -
            					$(element).show()
         | 
| 45 | 
            +
            			opts = {list : opts[0], empty_str : opts[1], loading_str : opts[2]} if opts instanceof Array
         | 
| 46 | 
            +
            			fn = ->
         | 
| 47 | 
            +
            				if opts.list.is_loading()
         | 
| 48 | 
            +
            					if opts.loading_img?
         | 
| 49 | 
            +
            						$(element).html("<img src='#{opts.loading_img}'/>")
         | 
| 50 | 
            +
            					else
         | 
| 51 | 
            +
            						$(element).html(opts.loading_str)
         | 
| 52 | 
            +
            					$(element).show('fast')
         | 
| 52 53 | 
             
            				else
         | 
| 53 | 
            -
            					if opts | 
| 54 | 
            -
            						$(element).hide()
         | 
| 54 | 
            +
            					if opts.list.hasItems()
         | 
| 55 | 
            +
            						$(element).hide('fast')
         | 
| 55 56 | 
             
            					else
         | 
| 56 57 | 
             
            						$(element).show()
         | 
| 57 | 
            -
            						$(element).html(opts | 
| 58 | 
            +
            						$(element).html(opts.empty_str)
         | 
| 59 | 
            +
            			#fn()
         | 
| 60 | 
            +
            			opts.list.is_loading.subscribe(fn)
         | 
| 58 61 |  | 
| 59 62 | 
             
            	ko.bindingHandlers.viewOptions =
         | 
| 60 63 | 
             
            		update : (element, valueAccessor) ->
         | 
| @@ -410,12 +413,14 @@ jQuery.fn.extend | |
| 410 413 | 
             
                this.css("top", (($(window).height() - this.outerHeight()) / 2) + $(window).scrollTop() + "px")
         | 
| 411 414 | 
             
                this.css("left", (($(window).width() - this.outerWidth()) / 2) + $(window).scrollLeft() + "px")
         | 
| 412 415 | 
             
                return this
         | 
| 413 | 
            -
            	koBind : (viewModel) ->
         | 
| 416 | 
            +
            	koBind : (viewModel, tmpl) ->
         | 
| 414 417 | 
             
            		this.each ->
         | 
| 415 | 
            -
            			 | 
| 418 | 
            +
            			$(this).koClean()
         | 
| 419 | 
            +
            			$(this).attr('data-bind', "template : '#{tmpl}'") if tmpl?
         | 
| 416 420 | 
             
            			ko.applyBindings(viewModel, this)
         | 
| 417 421 | 
             
            	koClean : ->
         | 
| 418 422 | 
             
            		this.each ->
         | 
| 423 | 
            +
            			$(this).removeAttr('data-bind')
         | 
| 419 424 | 
             
            			ko.cleanNode(this)
         | 
| 420 425 |  | 
| 421 426 | 
             
            jQuery.ajax_qs = (opts)->
         | 
    
        metadata
    CHANGED
    
    | @@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version | |
| 4 4 | 
             
              prerelease: false
         | 
| 5 5 | 
             
              segments: 
         | 
| 6 6 | 
             
              - 0
         | 
| 7 | 
            -
              -  | 
| 8 | 
            -
              -  | 
| 9 | 
            -
              version: 0. | 
| 7 | 
            +
              - 12
         | 
| 8 | 
            +
              - 0
         | 
| 9 | 
            +
              version: 0.12.0
         | 
| 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-11- | 
| 17 | 
            +
            date: 2012-11-15 00:00:00 -05:00
         | 
| 18 18 | 
             
            default_executable: 
         | 
| 19 19 | 
             
            dependencies: []
         | 
| 20 20 |  |