social_stream-linkser 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/javascripts/linkser.js.erb +36 -17
- data/app/assets/javascripts/social_stream-linkser.js +4 -0
- data/app/assets/stylesheets/linkser.css.scss +3 -2
- data/app/views/links/_link.html.erb +1 -1
- data/app/views/links/_link_preview.html.erb +7 -14
- data/app/views/links/show.html.erb +1 -7
- data/lib/social_stream/linkser/version.rb +1 -1
- data/social_stream-linkser.gemspec +1 -1
- metadata +16 -16
@@ -1,25 +1,30 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
SocialStream.Linkser.
|
4
|
-
|
1
|
+
//= require social_stream.wall
|
2
|
+
|
3
|
+
SocialStream.Linkser.Wall = (function(SS, $) {
|
4
|
+
var regexp = /^(http|ftp|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&;:\/~+#-]*[\w@?^=%&;\/~+#-])?$/
|
5
|
+
|
5
6
|
var urlDetect = function() {
|
6
7
|
this.currentValue = $("#input_activities").val();
|
8
|
+
|
7
9
|
if(this.lastValue == null)
|
8
10
|
this.lastValue = "";
|
9
11
|
|
10
|
-
var regexp = /^(http|ftp|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&;:\/~+#-]*[\w@?^=%&;\/~+#-])?$/
|
11
12
|
if(regexp.test($("#input_activities").val())) {
|
12
13
|
$("#link_url").val($("#input_activities").val());
|
13
14
|
$("#link_loaded").val(false);
|
14
15
|
$("#new_post").attr("action", "/links");
|
16
|
+
|
15
17
|
if(this.currentValue != this.lastValue) {
|
16
18
|
$("#link_preview").html($('<img>').attr('src', '<%= asset_path('loading.gif') %>').addClass('loading'));
|
19
|
+
|
17
20
|
this.lastValue = this.currentValue;
|
18
21
|
var url = this.currentValue;
|
19
22
|
var urlDetect = this;
|
23
|
+
|
20
24
|
$.ajax({
|
21
25
|
type : "GET",
|
22
26
|
url : "/linkser_parse?url=" + url,
|
27
|
+
dataType: 'html',
|
23
28
|
success : function(html) {
|
24
29
|
if($("#input_activities").val() == url) {//Only show if input value is still the same
|
25
30
|
$("#link_preview").html(html);
|
@@ -33,6 +38,7 @@ SocialStream.Linkser.initiate = function() {
|
|
33
38
|
}
|
34
39
|
});
|
35
40
|
}
|
41
|
+
|
36
42
|
$("#link_preview").show();
|
37
43
|
} else {
|
38
44
|
$("#new_post").attr("action", "/posts");
|
@@ -41,23 +47,36 @@ SocialStream.Linkser.initiate = function() {
|
|
41
47
|
$("#link_url").val("");
|
42
48
|
}
|
43
49
|
}
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
$("#new_post").
|
49
|
-
|
50
|
+
|
51
|
+
var init = function(){
|
52
|
+
$.preloadImages("<%= asset_path('loading.gif') %>");
|
53
|
+
|
54
|
+
if($("#new_post").length) {
|
55
|
+
$("#input_activities").change(urlDetect).keyup(urlDetect);
|
56
|
+
|
57
|
+
$("#new_post").append($('<input>').attr('type', 'hidden').attr('name', 'link[owner_id]').attr('id', 'link_owner_id').val($("#post_owner_id").val()));
|
58
|
+
$("#new_post").append($('<input>').attr('type', 'hidden').attr('name', 'link[url]').attr('id', 'link_url'));
|
59
|
+
$("#new_post").append($('<input>').attr('type', 'hidden').attr('name', 'link[loaded]').attr('id', 'link_loaded').val(false));
|
60
|
+
$("#new_post").append($('<div>').attr('id', 'link_preview').css('display', 'none'));
|
61
|
+
}
|
50
62
|
}
|
51
|
-
}
|
52
63
|
|
53
|
-
|
64
|
+
var openCallback = function(id,url,w,h){
|
54
65
|
var height='353';
|
66
|
+
|
55
67
|
if(w>0 && h>0) {
|
56
68
|
height=470*h/w;
|
57
69
|
}
|
70
|
+
|
58
71
|
$("#" + id).html($('<iframe>').attr('src',url).attr('width','470').attr('height',height));
|
59
|
-
}
|
72
|
+
}
|
73
|
+
|
74
|
+
SocialStream.Wall.addInitCallback(init);
|
75
|
+
|
76
|
+
return {
|
77
|
+
openCallback: openCallback
|
78
|
+
}
|
79
|
+
|
80
|
+
})(SocialStream, jQuery);
|
81
|
+
|
60
82
|
|
61
|
-
$(function(){
|
62
|
-
SocialStream.Linkser.initiate();
|
63
|
-
});
|
@@ -47,7 +47,7 @@
|
|
47
47
|
}
|
48
48
|
.link .info{
|
49
49
|
float: left;
|
50
|
-
width:
|
50
|
+
width: 350px;
|
51
51
|
text-align: left;
|
52
52
|
}
|
53
53
|
.activity_objects .link .info{
|
@@ -61,7 +61,8 @@
|
|
61
61
|
text-decoration: underline;
|
62
62
|
margin-bottom: 5px;
|
63
63
|
}
|
64
|
-
.link .info .description{
|
64
|
+
.link .info .description textarea {
|
65
|
+
height: 60px;
|
65
66
|
}
|
66
67
|
.link iframe{
|
67
68
|
border: 0;
|
@@ -7,7 +7,7 @@
|
|
7
7
|
<%= javascript_tag do %>
|
8
8
|
$("#link_<%= link.id.to_s %> img").each(function(){
|
9
9
|
$(this).click(function(){
|
10
|
-
SocialStream.Linkser.openCallback("link_<%= link.id.to_s %>", "<%= link.callback_url %>", "<%= link.width %>", "<%= link.height %>");
|
10
|
+
SocialStream.Linkser.Wall.openCallback("link_<%= link.id.to_s %>", "<%= link.callback_url %>", "<%= link.width %>", "<%= link.height %>");
|
11
11
|
});
|
12
12
|
});
|
13
13
|
|
@@ -6,21 +6,14 @@
|
|
6
6
|
</div>
|
7
7
|
<% end %>
|
8
8
|
<div class="info">
|
9
|
-
|
10
|
-
|
11
|
-
<%= link.title %>
|
12
|
-
<%= hidden_field_tag "link[title]", link.title %>
|
13
|
-
</div>
|
14
|
-
<% end %>
|
15
|
-
<div class="url">
|
16
|
-
<%= auto_link(link.url) %>
|
9
|
+
<div class="title">
|
10
|
+
<%= text_field_tag "link[title]", link.title %>
|
17
11
|
</div>
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
<% end %>
|
12
|
+
|
13
|
+
<div class="description">
|
14
|
+
<%= text_area_tag "link[description]", link.description %>
|
15
|
+
</div>
|
16
|
+
|
24
17
|
<% if link.callback_url %>
|
25
18
|
<%= hidden_field_tag "link[callback_url]", link.callback_url %>
|
26
19
|
<% end %>
|
@@ -1,10 +1,4 @@
|
|
1
|
-
<% content_for :javascript do %>
|
2
|
-
var message_hash = window.location.hash.match(/^.*activity_(\d+).*$/);
|
3
|
-
if (message_hash && message_hash > 0){
|
4
|
-
$.scrollTo('#activity_' + message_hash[1] ,1500,{axis:'y'});
|
5
|
-
}
|
6
|
-
<% end %>
|
7
|
-
|
8
1
|
<%= render :partial => 'objects/show',
|
9
2
|
:locals => { :object => @link } %>
|
10
3
|
|
4
|
+
<%= render @link.post_activity %>
|
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.files = `git ls-files`.split("\n")
|
13
13
|
|
14
14
|
# Gem dependencies
|
15
|
-
s.add_runtime_dependency('social_stream-base', '~> 0.17.
|
15
|
+
s.add_runtime_dependency('social_stream-base', '~> 0.17.1')
|
16
16
|
s.add_runtime_dependency('linkser', '~> 0.0.10')
|
17
17
|
# Development Gem dependencies
|
18
18
|
s.add_development_dependency('sqlite3-ruby')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: social_stream-linkser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -14,18 +14,18 @@ date: 2012-03-07 00:00:00.000000000Z
|
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: social_stream-base
|
17
|
-
requirement: &
|
17
|
+
requirement: &76541690 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.17.
|
22
|
+
version: 0.17.1
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *76541690
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: linkser
|
28
|
-
requirement: &
|
28
|
+
requirement: &76541250 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: 0.0.10
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *76541250
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: sqlite3-ruby
|
39
|
-
requirement: &
|
39
|
+
requirement: &76540900 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ! '>='
|
@@ -44,10 +44,10 @@ dependencies:
|
|
44
44
|
version: '0'
|
45
45
|
type: :development
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *76540900
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: rspec-rails
|
50
|
-
requirement: &
|
50
|
+
requirement: &76540230 !ruby/object:Gem::Requirement
|
51
51
|
none: false
|
52
52
|
requirements:
|
53
53
|
- - ~>
|
@@ -55,10 +55,10 @@ dependencies:
|
|
55
55
|
version: 2.6.0
|
56
56
|
type: :development
|
57
57
|
prerelease: false
|
58
|
-
version_requirements: *
|
58
|
+
version_requirements: *76540230
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
60
|
name: factory_girl
|
61
|
-
requirement: &
|
61
|
+
requirement: &76539430 !ruby/object:Gem::Requirement
|
62
62
|
none: false
|
63
63
|
requirements:
|
64
64
|
- - ~>
|
@@ -66,10 +66,10 @@ dependencies:
|
|
66
66
|
version: 1.3.2
|
67
67
|
type: :development
|
68
68
|
prerelease: false
|
69
|
-
version_requirements: *
|
69
|
+
version_requirements: *76539430
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: forgery
|
72
|
-
requirement: &
|
72
|
+
requirement: &76538560 !ruby/object:Gem::Requirement
|
73
73
|
none: false
|
74
74
|
requirements:
|
75
75
|
- - ~>
|
@@ -77,10 +77,10 @@ dependencies:
|
|
77
77
|
version: 0.3.6
|
78
78
|
type: :development
|
79
79
|
prerelease: false
|
80
|
-
version_requirements: *
|
80
|
+
version_requirements: *76538560
|
81
81
|
- !ruby/object:Gem::Dependency
|
82
82
|
name: capybara
|
83
|
-
requirement: &
|
83
|
+
requirement: &76536370 !ruby/object:Gem::Requirement
|
84
84
|
none: false
|
85
85
|
requirements:
|
86
86
|
- - ~>
|
@@ -88,7 +88,7 @@ dependencies:
|
|
88
88
|
version: 0.3.9
|
89
89
|
type: :development
|
90
90
|
prerelease: false
|
91
|
-
version_requirements: *
|
91
|
+
version_requirements: *76536370
|
92
92
|
description: Social Stream Linkser provides Linkser support in Social Stream, the
|
93
93
|
core for building social network websites.
|
94
94
|
email: ecasanovac@gmail.com
|