social_stream-presence 0.6.2 → 0.6.3
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/app/assets/images/black_arrow7.png +0 -0
- data/app/assets/images/black_arrow8.png +0 -0
- data/app/assets/images/black_arrow9.png +0 -0
- data/app/assets/javascripts/chat_interface_manager.js.erb +191 -23
- data/app/assets/javascripts/chat_persistence.js +15 -6
- data/app/assets/javascripts/chat_utilities.js +13 -0
- data/app/assets/javascripts/chat_window_manager.js +101 -20
- data/app/assets/javascripts/social_stream-presence.js +2 -0
- data/app/assets/javascripts/xmpp_client_management.js.erb +6 -5
- data/app/assets/stylesheets/chat.css.scss +43 -3
- data/app/assets/stylesheets/social_stream-presence.css +1 -0
- data/app/helpers/xmpp_helper.rb +4 -2
- data/app/views/chat/_contacts.html.erb +55 -42
- data/config/locales/en.yml +4 -1
- data/config/locales/es.yml +3 -1
- data/db/migrate/20110928135031_add_status_column_to_user.rb +1 -1
- data/lib/social_stream/presence/version.rb +1 -1
- data/vendor/assets/javascripts/jquery.flexselect.js +265 -0
- data/vendor/assets/javascripts/jquery.tools.tooltip.js +2 -1
- data/vendor/assets/javascripts/liquidmetal.js +90 -0
- data/vendor/assets/stylesheets/flexselect.css +39 -0
- metadata +8 -2
@@ -8,4 +8,5 @@
|
|
8
8
|
* http://flowplayer.org/tools/
|
9
9
|
*
|
10
10
|
*/
|
11
|
-
(function(a){a.tools=a.tools||{version:"v1.2.5"},a.tools.tooltip={conf:{effect:"toggle",fadeOutSpeed:"fast",predelay:0,delay:30,opacity:1,tip:0,position:["top","center"],offset:[0,0],relative:!1,cancelDefault:!0,events:{def:"mouseenter,mouseleave",input:"focus,blur",widget:"focus mouseenter,blur mouseleave",tooltip:"mouseenter,mouseleave"},layout:"<div/>",tipClass:"tooltip"},addEffect:function(a,c,d){b[a]=[c,d]}};var b={toggle:[function(a){var b=this.getConf(),c=this.getTip(),d=b.opacity;d<1&&c.css({opacity:d}),c.show(),a.call()},function(a){this.getTip().hide(),a.call()}],fade:[function(a){var b=this.getConf();this.getTip().fadeTo(b.fadeInSpeed,b.opacity,a)},function(a){this.getTip().fadeOut(this.getConf().fadeOutSpeed,a)}]};function c(b,c,d){var e=d.relative?b.position().top:b.offset().top,f=d.relative?b.position().left:b.offset().left,g=d.position[0];e-=c.outerHeight()-d.offset[0],f+=b.outerWidth()+d.offset[1],/iPad/i.test(navigator.userAgent)&&(e-=a(window).scrollTop());var h=c.outerHeight()+b.outerHeight();g=="center"&&(e+=h/2),g=="bottom"&&(e+=h),g=d.position[1];var i=c.outerWidth()+b.outerWidth();g=="center"&&(f-=i/2),g=="left"&&(f-=i);return{top:e,left:f}}function d(d,e){var f=this,g=d.add(f),h,i=0,j=0,k=d.attr("title"),l=d.attr("data-tooltip"),m=b[e.effect],n,o=d.is(":input"),p=o&&d.is(":checkbox, :radio, select, :button, :submit"),q=d.attr("type"),r=e.events[q]||e.events[o?p?"widget":"input":"def"];if(!m)throw"Nonexistent effect \""+e.effect+"\"";r=r.split(/,\s*/);if(r.length!=2)throw"Tooltip: bad events configuration for "+q;d.bind(r[0],function(a){clearTimeout(i),e.predelay?j=setTimeout(function(){f.show(a)},e.predelay):f.show(a)}).bind(r[1],function(a){clearTimeout(j),e.delay?i=setTimeout(function(){f.hide(a)},e.delay):f.hide(a)}),
|
11
|
+
(function(a){a.tools=a.tools||{version:"v1.2.5"},a.tools.tooltip={conf:{effect:"toggle",fadeOutSpeed:"fast",predelay:0,delay:30,opacity:1,tip:0,position:["top","center"],offset:[0,0],relative:!1,cancelDefault:!0,events:{def:"mouseenter,mouseleave",input:"focus,blur",widget:"focus mouseenter,blur mouseleave",tooltip:"mouseenter,mouseleave"},layout:"<div/>",tipClass:"tooltip"},addEffect:function(a,c,d){b[a]=[c,d]}};var b={toggle:[function(a){var b=this.getConf(),c=this.getTip(),d=b.opacity;d<1&&c.css({opacity:d}),c.show(),a.call()},function(a){this.getTip().hide(),a.call()}],fade:[function(a){var b=this.getConf();this.getTip().fadeTo(b.fadeInSpeed,b.opacity,a)},function(a){this.getTip().fadeOut(this.getConf().fadeOutSpeed,a)}]};function c(b,c,d){var e=d.relative?b.position().top:b.offset().top,f=d.relative?b.position().left:b.offset().left,g=d.position[0];e-=c.outerHeight()-d.offset[0],f+=b.outerWidth()+d.offset[1],/iPad/i.test(navigator.userAgent)&&(e-=a(window).scrollTop());var h=c.outerHeight()+b.outerHeight();g=="center"&&(e+=h/2),g=="bottom"&&(e+=h),g=d.position[1];var i=c.outerWidth()+b.outerWidth();g=="center"&&(f-=i/2),g=="left"&&(f-=i);return{top:e,left:f}}function d(d,e){var f=this,g=d.add(f),h,i=0,j=0,k=d.attr("title"),l=d.attr("data-tooltip"),m=b[e.effect],n,o=d.is(":input"),p=o&&d.is(":checkbox, :radio, select, :button, :submit"),q=d.attr("type"),r=e.events[q]||e.events[o?p?"widget":"input":"def"];if(!m)throw"Nonexistent effect \""+e.effect+"\"";r=r.split(/,\s*/);if(r.length!=2)throw"Tooltip: bad events configuration for "+q;d.bind(r[0],function(a){clearTimeout(i),e.predelay?j=setTimeout(function(){f.show(a)},e.predelay):f.show(a)}).bind(r[1],function(a){clearTimeout(j),e.delay?i=setTimeout(function(){f.hide(a)},e.delay):f.hide(a)}),
|
12
|
+
k&&e.cancelDefault&&(d.removeAttr("title"),d.data("title",k)),a.extend(f,{show:function(b){if(!h){l?h=a(l):e.tip?h=a(e.tip).eq(0):k?h=a(e.layout).addClass(e.tipClass).appendTo(document.body).hide().append(k):(h=d.next(),h.length||(h=d.parent().next()));if(!h.length)throw"Cannot find tooltip for "+d}if(f.isShown())return f;h.stop(!0,!0);var o=c(d,h,e);e.tip&&h.html(d.data("title")),b=b||a.Event(),b.type="onBeforeShow",g.trigger(b,[o]);if(b.isDefaultPrevented())return f;o=c(d,h,e),h.css({position:"absolute",top:o.top,left:o.left}),n=!0,m[0].call(f,function(){b.type="onShow",n="full",g.trigger(b)});var p=e.events.tooltip.split(/,\s*/);h.data("__set")||(h.bind(p[0],function(){clearTimeout(i),clearTimeout(j)}),p[1]&&!d.is("input:not(:checkbox, :radio), textarea")&&h.bind(p[1],function(a){a.relatedTarget!=d[0]&&d.trigger(r[1].split(" ")[0])}),h.data("__set",!0));return f},hide:function(c){if(!h||!f.isShown())return f;c=c||a.Event(),c.type="onBeforeHide",g.trigger(c);if(!c.isDefaultPrevented()){n=!1,b[e.effect][1].call(f,function(){c.type="onHide",g.trigger(c)});return f}},isShown:function(a){return a?n=="full":n},getConf:function(){return e},getTip:function(){return h},getTrigger:function(){return d}}),a.each("onHide,onBeforeShow,onShow,onBeforeHide".split(","),function(b,c){a.isFunction(e[c])&&a(f).bind(c,e[c]),f[c]=function(b){b&&a(f).bind(c,b);return f}})}a.fn.tooltip=function(b){var c=this.data("tooltip");if(c)return c;b=a.extend(!0,{},a.tools.tooltip.conf,b),typeof b.position=="string"&&(b.position=b.position.split(/,?\s/)),this.each(function(){c=new d(a(this),b),a(this).data("tooltip",c)});return b.api?c:this}})(jQuery);
|
@@ -0,0 +1,90 @@
|
|
1
|
+
/**
|
2
|
+
* LiquidMetal, version: 1.0 (2011-12-17)
|
3
|
+
*
|
4
|
+
* A mimetic poly-alloy of Quicksilver's scoring algorithm, essentially
|
5
|
+
* LiquidMetal.
|
6
|
+
*
|
7
|
+
* For usage and examples, visit:
|
8
|
+
* http://github.com/rmm5t/liquidmetal
|
9
|
+
*
|
10
|
+
* Licensed under the MIT:
|
11
|
+
* http://www.opensource.org/licenses/mit-license.php
|
12
|
+
*
|
13
|
+
* Copyright (c) 2009-2012, Ryan McGeary (ryan -[at]- mcgeary [*dot*] org)
|
14
|
+
*/
|
15
|
+
var LiquidMetal = (function() {
|
16
|
+
var SCORE_NO_MATCH = 0.0;
|
17
|
+
var SCORE_MATCH = 1.0;
|
18
|
+
var SCORE_TRAILING = 0.8;
|
19
|
+
var SCORE_TRAILING_BUT_STARTED = 0.9;
|
20
|
+
var SCORE_BUFFER = 0.85;
|
21
|
+
|
22
|
+
return {
|
23
|
+
score: function(string, abbreviation) {
|
24
|
+
// Short circuits
|
25
|
+
if (abbreviation.length === 0) return SCORE_TRAILING;
|
26
|
+
if (abbreviation.length > string.length) return SCORE_NO_MATCH;
|
27
|
+
|
28
|
+
var scores = this.buildScoreArray(string, abbreviation);
|
29
|
+
|
30
|
+
// complete miss:
|
31
|
+
if ( scores === false ) return 0;
|
32
|
+
|
33
|
+
var sum = 0.0;
|
34
|
+
for (var i = 0; i < scores.length; i++) {
|
35
|
+
sum += scores[i];
|
36
|
+
}
|
37
|
+
|
38
|
+
return (sum / scores.length);
|
39
|
+
},
|
40
|
+
|
41
|
+
buildScoreArray: function(string, abbreviation) {
|
42
|
+
var scores = new Array(string.length);
|
43
|
+
var lower = string.toLowerCase();
|
44
|
+
var chars = abbreviation.toLowerCase();
|
45
|
+
|
46
|
+
var lastIndex = -1;
|
47
|
+
var started = false;
|
48
|
+
for (var i = 0; i < chars.length; i++) {
|
49
|
+
var c = chars[i];
|
50
|
+
var index = lower.indexOf(c, lastIndex+1);
|
51
|
+
|
52
|
+
if (index === -1) return false; // signal no match
|
53
|
+
if (index === 0) started = true;
|
54
|
+
|
55
|
+
if (isNewWord(string, index)) {
|
56
|
+
scores[index-1] = 1;
|
57
|
+
fillArray(scores, SCORE_BUFFER, lastIndex+1, index-1);
|
58
|
+
}
|
59
|
+
else if (isUpperCase(string, index)) {
|
60
|
+
fillArray(scores, SCORE_BUFFER, lastIndex+1, index);
|
61
|
+
}
|
62
|
+
else {
|
63
|
+
fillArray(scores, SCORE_NO_MATCH, lastIndex+1, index);
|
64
|
+
}
|
65
|
+
|
66
|
+
scores[index] = SCORE_MATCH;
|
67
|
+
lastIndex = index;
|
68
|
+
}
|
69
|
+
|
70
|
+
var trailingScore = started ? SCORE_TRAILING_BUT_STARTED : SCORE_TRAILING;
|
71
|
+
fillArray(scores, trailingScore, lastIndex+1, scores.length);
|
72
|
+
return scores;
|
73
|
+
}
|
74
|
+
};
|
75
|
+
|
76
|
+
function isUpperCase(string, index) {
|
77
|
+
var c = string.charAt(index);
|
78
|
+
return ("A" <= c && c <= "Z");
|
79
|
+
}
|
80
|
+
|
81
|
+
function isNewWord(string, index) {
|
82
|
+
var c = string.charAt(index-1);
|
83
|
+
return (c == " " || c == "\t");
|
84
|
+
}
|
85
|
+
|
86
|
+
function fillArray(array, value, from, to) {
|
87
|
+
for (var i = from; i < to; i++) { array[i] = value; }
|
88
|
+
return array;
|
89
|
+
}
|
90
|
+
})();
|
@@ -0,0 +1,39 @@
|
|
1
|
+
.flexselect_dropdown {
|
2
|
+
display: none;
|
3
|
+
position: absolute;
|
4
|
+
z-index: 999999;
|
5
|
+
margin: 0;
|
6
|
+
padding: 0;
|
7
|
+
border: 1px solid WindowFrame;
|
8
|
+
max-height: 200px;
|
9
|
+
overflow-x: hidden;
|
10
|
+
overflow-y: auto;
|
11
|
+
background-color: Window;
|
12
|
+
color: WindowText;
|
13
|
+
text-align: left;
|
14
|
+
box-shadow: 0 6px 12px #ccc;
|
15
|
+
-webkit-box-shadow: 0 6px 12px #ccc;
|
16
|
+
}
|
17
|
+
|
18
|
+
.flexselect_dropdown ul {
|
19
|
+
width: 100%;
|
20
|
+
list-style-position: outside;
|
21
|
+
list-style: none;
|
22
|
+
padding: 0;
|
23
|
+
margin: 0;
|
24
|
+
}
|
25
|
+
|
26
|
+
.flexselect_dropdown li {
|
27
|
+
margin: 0px;
|
28
|
+
padding: 2px 5px;
|
29
|
+
cursor: pointer;
|
30
|
+
display: block;
|
31
|
+
width: 100%;
|
32
|
+
font: Menu;
|
33
|
+
overflow: hidden;
|
34
|
+
}
|
35
|
+
|
36
|
+
.flexselect_selected {
|
37
|
+
background-color: Highlight;
|
38
|
+
color: HighlightText;
|
39
|
+
}
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: social_stream-presence
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.6.
|
5
|
+
version: 0.6.3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Aldo Gordillo
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2012-02-
|
13
|
+
date: 2012-02-10 00:00:00 +01:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -84,6 +84,9 @@ files:
|
|
84
84
|
- app/assets/audio/chat/onMessageAudio.mp3
|
85
85
|
- app/assets/audio/chat/onMessageAudio.wav
|
86
86
|
- app/assets/images/black_arrow3.png
|
87
|
+
- app/assets/images/black_arrow7.png
|
88
|
+
- app/assets/images/black_arrow8.png
|
89
|
+
- app/assets/images/black_arrow9.png
|
87
90
|
- app/assets/images/emoticons/beer.png
|
88
91
|
- app/assets/images/emoticons/clock.png
|
89
92
|
- app/assets/images/emoticons/face-raspberry.png
|
@@ -207,9 +210,12 @@ files:
|
|
207
210
|
- spec/demo/vendor/plugins/.gitkeep
|
208
211
|
- spec/discover.rb
|
209
212
|
- spec/spec_helper.rb
|
213
|
+
- vendor/assets/javascripts/jquery.flexselect.js
|
210
214
|
- vendor/assets/javascripts/jquery.tools.tooltip.js
|
211
215
|
- vendor/assets/javascripts/jquery.ui.chatbox.js
|
216
|
+
- vendor/assets/javascripts/liquidmetal.js
|
212
217
|
- vendor/assets/javascripts/strophe.js
|
218
|
+
- vendor/assets/stylesheets/flexselect.css
|
213
219
|
- vendor/assets/stylesheets/jquery.ui.chatbox.css
|
214
220
|
has_rdoc: true
|
215
221
|
homepage: https://github.com/ging/social_stream-presence
|