micro_vkontakte 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,4 @@
1
+ v0.0.9 updated omniauth
1
2
  v0.0.8 updated omniauth
2
3
  v0.0.7 updated omniauth
3
4
  v0.0.6 added omniauth
data/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new('micro_vkontakte', '0.0.8') do |p|
5
+ Echoe.new('micro_vkontakte', '0.0.9') do |p|
6
6
  p.description = "Vkontakte api tools."
7
7
  p.url = "http://github.com/gvalmon/micro_vkontakte"
8
8
  p.author = "Iskander Haziev"
@@ -3,34 +3,17 @@ module OmniAuth
3
3
  module Strategies
4
4
  class Vkontakte
5
5
  class ViewHelper
6
- module PageHelper
7
- def vkontakte_login_page
8
- vkontakte_header +
9
- vkontakte_login_button +
10
- vkontakte_footer
11
- end
12
-
13
- def vkontakte_header
14
- <<-HEADER
15
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
16
- <html xmlns="http://www.w3.org/1999/xhtml">
17
- <head>
18
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
19
- <title>Вход во ВКонтакте</title>
20
- </head>
21
- <body>
22
- HEADER
23
- end
24
-
6
+ module PageHelper
25
7
  def vkontakte_login_button
26
8
  <<-BUTTON
9
+ <img id="vk_login" src="/images/auth/vk.png" onclick="vkLogin.doLogin();" />
27
10
  <div id="vk_api_transport"></div>
28
11
  <script type="text/javascript">
29
12
  window.vkAsyncInit = function() {
30
13
  VK.init({
31
14
  apiId: '#{OmniAuth.config.vkontakte_app_id}',
32
15
  nameTransportPath: "/xd_receiver.html"
33
- });
16
+ });
34
17
  };
35
18
  vkLogin = {
36
19
  doLogin: function() {
@@ -91,6 +74,7 @@ HEADER
91
74
  var code;
92
75
  code = 'return {';
93
76
  code += 'me: API.getProfiles({uids: API.getVariable({key: 1280}), fields: "nickname,sex,photo"})[0]';
77
+ code += ',sid:"' + sid + '",secret:"' + secret+'"';
94
78
  code += '};';
95
79
  VK.Api.call('execute', {
96
80
  'code': code
@@ -100,6 +84,8 @@ HEADER
100
84
  putUserProfile: function (data) {
101
85
  if (data.response) {
102
86
  r = data.response;
87
+ //r.me['sid'] = r.sid;
88
+ //r.me['secret'] = r.secret;
103
89
  vkLogin.redirectWithPost('#{OmniAuth.config.path_prefix}/vkontakte/callback', r.me);
104
90
  }
105
91
  }
@@ -113,15 +99,8 @@ HEADER
113
99
  document.getElementById("vk_api_transport").appendChild(el);
114
100
  }());
115
101
  </script>
116
- <img id="vk_login" src="/images/auth/vk.png" onclick="vkLogin.doLogin();" />
117
102
  BUTTON
118
103
  end
119
-
120
- def vkontakte_footer
121
- <<-FOOTER
122
- </body></html>
123
- FOOTER
124
- end
125
104
  end
126
105
  end
127
106
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{micro_vkontakte}
5
- s.version = "0.0.8"
5
+ s.version = "0.0.9"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Iskander Haziev"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: micro_vkontakte
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 8
10
- version: 0.0.8
9
+ - 9
10
+ version: 0.0.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Iskander Haziev