vertebra 0.1.1 → 0.1.2
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.
- checksums.yaml +4 -4
- data/app/assets/javascripts/vertebra.coffee +39 -0
- data/lib/vertebra/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4dd9258b8b224cd0513400c8a8ea83fe43362a2d
|
4
|
+
data.tar.gz: d1a97fcd7ff3e7b1a55468f40ee139f574c432c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b79a24e376ece8a56e91ddcff79da0b46f125b0a56d867470ff8218a3b5cdd4972c4b269071de0daab47e459b3644439357f3fe2bad07089e73693527bb05b0
|
7
|
+
data.tar.gz: 81d8ac00f05c7d18c5cf28201da010165c02fb4d5ec8e58a80ccd48b719093bef421249f5ec0272e38b64f8b84748ce503dad655f5cc96b71f3c29aa1a0be50e
|
@@ -12,6 +12,45 @@ delegateEventSplitter = /^(\S+)\s*(.*)$/
|
|
12
12
|
@camelize = (str) ->
|
13
13
|
str.replace(/(^|[-_])(.)/g, (match) -> return match.toUpperCase()).replace(/[-_]/g, '')
|
14
14
|
|
15
|
+
@trim = (str) ->
|
16
|
+
str.replace(/^\s+|\s+$/g, '')
|
17
|
+
|
18
|
+
_now = Date.now || -> new Date().getTime()
|
19
|
+
|
20
|
+
# Throttle function borrowed from underscore.js
|
21
|
+
@throttle = (func, wait, options) ->
|
22
|
+
previous = 0
|
23
|
+
options ?= {}
|
24
|
+
|
25
|
+
later = ->
|
26
|
+
previous = if options.leading == false then 0 else _now()
|
27
|
+
timeout = null
|
28
|
+
result = func.apply(context, args)
|
29
|
+
if !timeout
|
30
|
+
context = args = null
|
31
|
+
return
|
32
|
+
|
33
|
+
->
|
34
|
+
now = _now()
|
35
|
+
previous = now if !previous and options.leading == false
|
36
|
+
remaining = wait - (now - previous)
|
37
|
+
context = this
|
38
|
+
args = arguments
|
39
|
+
|
40
|
+
if remaining <= 0 or remaining > wait
|
41
|
+
if timeout
|
42
|
+
clearTimeout(timeout)
|
43
|
+
timeout = null
|
44
|
+
previous = now
|
45
|
+
result = func.apply(context, args)
|
46
|
+
if !timeout
|
47
|
+
context = args = null
|
48
|
+
else if !timeout and options.trailing != false
|
49
|
+
timeout = setTimeout(later, remaining)
|
50
|
+
|
51
|
+
result
|
52
|
+
|
53
|
+
|
15
54
|
# Minimalist Backbon.View with support for view element, this.$ and delegated
|
16
55
|
# events on initialization.
|
17
56
|
#
|
data/lib/vertebra/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vertebra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vala
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -71,7 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
71
71
|
version: '0'
|
72
72
|
requirements: []
|
73
73
|
rubyforge_project:
|
74
|
-
rubygems_version: 2.
|
74
|
+
rubygems_version: 2.6.8
|
75
75
|
signing_key:
|
76
76
|
specification_version: 4
|
77
77
|
summary: Mico-JS Framework based on the Backbone.View API
|