tell-them 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/tell-them.sass +2 -1
- data/lib/tell-them/tell-them.rb +21 -4
- data/lib/tell-them/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 679acfc9d82e7f1b84cfcb32ac4295071eaf59f9
|
4
|
+
data.tar.gz: ade7409a005ffe812d99510b47f8dc82ff9a8f92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b30931910b234438dd180adca8bf8d543dc62a2953982308d273bbb0d794a4c702cce546f2b409d1e6bf2dea082124ae39a4fc5a15e274859b426ddd8135f14
|
7
|
+
data.tar.gz: 5b7aebdfb26e32b54bc41a097fb015f6b42ab859f91a51379906247bedc854ed8c70dcf24f3856475e36685dee437a901df4705d47f72aa158664da6716158b7
|
@@ -63,6 +63,7 @@ $pad: 2%
|
|
63
63
|
width: 50%
|
64
64
|
height: 50%
|
65
65
|
border: 1px solid black
|
66
|
+
margin: 0 0
|
66
67
|
padding: 0 0
|
67
68
|
background-color: white
|
68
69
|
cursor: pointer
|
@@ -97,7 +98,7 @@ $pad: 2%
|
|
97
98
|
border-radius: 1em
|
98
99
|
padding: $pad
|
99
100
|
background-color: white
|
100
|
-
.list-
|
101
|
+
.list-header
|
101
102
|
font-weight: bold
|
102
103
|
&:hover, &.pinned
|
103
104
|
cursor: default
|
data/lib/tell-them/tell-them.rb
CHANGED
@@ -1,4 +1,11 @@
|
|
1
1
|
module TellThem
|
2
|
+
|
3
|
+
MAX_URL_DISPLAY_LENGTH = 60
|
4
|
+
|
5
|
+
def self.reset
|
6
|
+
TellThemStore.instance
|
7
|
+
end
|
8
|
+
|
2
9
|
def self.add(data)
|
3
10
|
TellThemStore.instance.add(data)
|
4
11
|
end
|
@@ -30,14 +37,14 @@ module TellThem
|
|
30
37
|
box += ' </div>'
|
31
38
|
box += ' <button class="pin">Pin</button>'
|
32
39
|
box += ' </div>'
|
33
|
-
box += ' <dl class="
|
40
|
+
box += ' <dl class="list">'
|
34
41
|
data.each do |k,v|
|
35
|
-
box += " <dt>#{k}</dt>"
|
42
|
+
box += " <dt class=\"list-header\">#{k}</dt>"
|
36
43
|
begin
|
37
44
|
URI::parse(v)
|
38
|
-
box += " <dd><a href=\"#{v}\">#{v}</a></dd>"
|
45
|
+
box += " <dd class=\"list-value\"><a href=\"#{v}\">#{shorten(v)}</a></dd>"
|
39
46
|
rescue URI::InvalidURIError
|
40
|
-
box += " <dd>#{v}</dd>"
|
47
|
+
box += " <dd class=\"list-header\">#{v}</dd>"
|
41
48
|
end
|
42
49
|
end
|
43
50
|
box += ' </dl>'
|
@@ -46,10 +53,20 @@ module TellThem
|
|
46
53
|
box
|
47
54
|
end
|
48
55
|
|
56
|
+
def shorten(value)
|
57
|
+
if value.length > MAX_URL_DISPLAY_LENGTH
|
58
|
+
value[0..MAX_URL_DISPLAY_LENGTH] + "..."
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
49
62
|
class TellThemStore
|
50
63
|
include Singleton
|
51
64
|
|
52
65
|
def initialize
|
66
|
+
reset
|
67
|
+
end
|
68
|
+
|
69
|
+
def reset
|
53
70
|
@data_store = {}
|
54
71
|
end
|
55
72
|
|
data/lib/tell-them/version.rb
CHANGED