openskip-skip_embedded 0.9.2 → 0.9.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/ChangeLog +4 -0
- data/Rakefile +4 -2
- data/bin/skip-gen +2 -2
- data/generators/skip_embedded/skip_embedded_generator.rb +2 -3
- data/generators/skip_embedded_stylesheets/skip_embedded_stylesheets_generator.rb +21 -0
- data/generators/skip_embedded_stylesheets/templates/public/stylesheets/sass/skip_base.sass +86 -0
- data/generators/skip_embedded_stylesheets/templates/public/stylesheets/sass/skip_embedded.sass +65 -0
- data/generators/skip_embedded_stylesheets/templates/public/stylesheets/sass/skip_footer.sass +19 -0
- data/generators/skip_embedded_stylesheets/templates/public/stylesheets/sass/skip_header.sass +47 -0
- data/generators/skip_embedded_stylesheets/templates/public/stylesheets/skip_base.css +55 -0
- data/generators/skip_embedded_stylesheets/templates/public/stylesheets/skip_embedded.css +156 -0
- data/generators/skip_embedded_stylesheets/templates/public/stylesheets/skip_footer.css +19 -0
- data/generators/skip_embedded_stylesheets/templates/public/stylesheets/skip_header.css +45 -0
- data/generators/{skip_embedded → skip_embedded_stylesheets}/templates/public/stylesheets/sprites/sprites.css +0 -0
- data/generators/{skip_embedded → skip_embedded_stylesheets}/templates/public/stylesheets/sprites/sprites.png +0 -0
- data/lib/skip_embedded/rp_service/client.rb +117 -0
- data/lib/skip_embedded/rp_service/http_connection.rb +85 -0
- data/lib/skip_embedded/rp_service/oauth_proxy.rb +45 -0
- data/lib/skip_embedded/rp_service/util.rb +17 -0
- data/lib/skip_embedded.rb +1 -1
- metadata +45 -7
- data/generators/skip_embedded/templates/public/stylesheets/skip_embedded.css +0 -159
data/ChangeLog
CHANGED
data/Rakefile
CHANGED
@@ -26,7 +26,7 @@ Rake::RDocTask.new(:rdoc) do |rdoc|
|
|
26
26
|
end
|
27
27
|
|
28
28
|
NAME = ENV["GEMNAME"] || "skip_embedded"
|
29
|
-
|
29
|
+
AUTHORS = ["MAEDA Naoki", "MOROHASHI Kyosuke"]
|
30
30
|
EMAIL = "k-morohashi@esm.co.jp"
|
31
31
|
DESCRIPTION = "Utilities to collabolate SKIP, opensource buisiness SNS."
|
32
32
|
HOMEPATH = "http://github.com/openskip/skip_embedded/tree/master"
|
@@ -52,7 +52,7 @@ spec = Gem::Specification.new do |s|
|
|
52
52
|
s.rdoc_options += RDOC_OPTS + ['--exclude', '^(examples|extras)/']
|
53
53
|
s.summary = DESCRIPTION
|
54
54
|
s.description = DESCRIPTION
|
55
|
-
s.
|
55
|
+
s.authors = AUTHORS
|
56
56
|
s.email = EMAIL
|
57
57
|
s.homepage = HOMEPATH
|
58
58
|
s.executables = BIN_FILES
|
@@ -61,6 +61,8 @@ spec = Gem::Specification.new do |s|
|
|
61
61
|
s.test_files = Dir["spec/**/*_spec.rb"]
|
62
62
|
|
63
63
|
s.add_dependency "moro-repim", ">=0.1.4"
|
64
|
+
s.add_dependency "json"
|
65
|
+
s.add_dependency "oauth"
|
64
66
|
|
65
67
|
s.files = %w(README.rdoc ChangeLog Rakefile) +
|
66
68
|
Dir.glob("{bin,doc,test,lib,templates,generators,extras,website,script}/**/*") +
|
data/bin/skip-gen
CHANGED
@@ -6,8 +6,8 @@ require 'rubygems'
|
|
6
6
|
def check_dependency
|
7
7
|
missing = [
|
8
8
|
['rails', '2.1.2'],
|
9
|
-
['rspec', '1.2.
|
10
|
-
['rspec-rails', '1.2.
|
9
|
+
['rspec', '1.2.6'],
|
10
|
+
['rspec-rails', '1.2.6'],
|
11
11
|
['moro-repim', '>=0.1.5'],
|
12
12
|
['moro-open_id_authentication', '>=1.0.0'],
|
13
13
|
].inject([]) do |miss, (name, version)|
|
@@ -11,14 +11,13 @@ class SkipEmbeddedGenerator < Rails::Generator::Base
|
|
11
11
|
public/javascripts/dropdown_navigation.js
|
12
12
|
public/javascripts/labeled_text_field.js
|
13
13
|
public/javascripts/skip_fckeditor_config.js
|
14
|
-
public/stylesheets/skip_embedded.css
|
15
|
-
public/stylesheets/sprites/sprites.css
|
16
|
-
public/stylesheets/sprites/sprites.png
|
17
14
|
]
|
18
15
|
|
19
16
|
assets.map{|asset| File.dirname(asset) }.uniq.each{|asset| m.directory(asset) }
|
20
17
|
assets.each{|asset| m.file asset, asset }
|
21
18
|
|
19
|
+
m.dependency('skip_embedded_stylesheets', [])
|
20
|
+
|
22
21
|
insert_application_helper(m)
|
23
22
|
insert_application_controller(m)
|
24
23
|
insert_sessions_controller(m)
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class SkipEmbeddedStylesheetsGenerator < Rails::Generator::Base
|
2
|
+
def manifest
|
3
|
+
record do |m|
|
4
|
+
assets = %w[
|
5
|
+
public/stylesheets/skip_base.css
|
6
|
+
public/stylesheets/skip_embedded.css
|
7
|
+
public/stylesheets/skip_footer.css
|
8
|
+
public/stylesheets/skip_header.css
|
9
|
+
public/stylesheets/sass/skip_base.sass
|
10
|
+
public/stylesheets/sass/skip_embedded.sass
|
11
|
+
public/stylesheets/sass/skip_footer.sass
|
12
|
+
public/stylesheets/sass/skip_header.sass
|
13
|
+
public/stylesheets/sprites/sprites.css
|
14
|
+
public/stylesheets/sprites/sprites.png
|
15
|
+
]
|
16
|
+
|
17
|
+
assets.map{|asset| File.dirname(asset) }.uniq.each{|asset| m.directory(asset) }
|
18
|
+
assets.each{|asset| m.file asset, asset }
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
// グローバル変数定義
|
2
|
+
// ------------------------------------------------------------
|
3
|
+
!base_color ||= #555
|
4
|
+
!base_background_color ||= #fff
|
5
|
+
!base_font_size ||= 12px
|
6
|
+
!small_font_size ||= 10px
|
7
|
+
!base_border ||= 1px solid #ccc
|
8
|
+
!base_dashed_border ||= 1px dashed #ccc
|
9
|
+
!base_dotted_border ||= 1px dotted #ccc
|
10
|
+
|
11
|
+
// Mix-in
|
12
|
+
// ------------------------------------------------------------
|
13
|
+
=base_text
|
14
|
+
:font
|
15
|
+
:size = !base_font_size
|
16
|
+
:family Verdana, Arial, sans-serif
|
17
|
+
:weight normal
|
18
|
+
:color = !base_color
|
19
|
+
=form_text
|
20
|
+
:font
|
21
|
+
:size = !base_font_size
|
22
|
+
:family Verdana, Arial, sans-serif
|
23
|
+
:color = #000
|
24
|
+
=link_text
|
25
|
+
:text-decoration none
|
26
|
+
:color #0080dd
|
27
|
+
=link_hover_text
|
28
|
+
:color blue
|
29
|
+
:text-decoration underline
|
30
|
+
=clearfix
|
31
|
+
display: inline-block
|
32
|
+
&:after
|
33
|
+
content: "."
|
34
|
+
display: block
|
35
|
+
height: 0
|
36
|
+
clear: both
|
37
|
+
visibility: hidden
|
38
|
+
* html &
|
39
|
+
height: 1px
|
40
|
+
|
41
|
+
// 基本スタイル
|
42
|
+
// ------------------------------------------------------------
|
43
|
+
*
|
44
|
+
:margin 0
|
45
|
+
:padding 0
|
46
|
+
|
47
|
+
body
|
48
|
+
+base_text
|
49
|
+
:position absolute
|
50
|
+
:left 0
|
51
|
+
:margin 0
|
52
|
+
:text-align left
|
53
|
+
:background-color = !base_background_color
|
54
|
+
:width 100%
|
55
|
+
|
56
|
+
img
|
57
|
+
:vertical-align middle
|
58
|
+
:border 0
|
59
|
+
|
60
|
+
a
|
61
|
+
+link_text
|
62
|
+
&:hover
|
63
|
+
+link_hover_text
|
64
|
+
|
65
|
+
form
|
66
|
+
:padding 0px
|
67
|
+
:margin 0px
|
68
|
+
input
|
69
|
+
+form_text
|
70
|
+
:margin 0px
|
71
|
+
:padding 2px
|
72
|
+
select
|
73
|
+
+form_text
|
74
|
+
:margin 0 2px 0 0
|
75
|
+
:padding 0
|
76
|
+
:letter-spacing 2px
|
77
|
+
:z-index 0
|
78
|
+
textarea
|
79
|
+
+form_text
|
80
|
+
:margin 0px
|
81
|
+
:padding 2px
|
82
|
+
|
83
|
+
table
|
84
|
+
:font-size = !base_font_size
|
85
|
+
:table-layout fixed
|
86
|
+
:border-collapse collapse
|
data/generators/skip_embedded_stylesheets/templates/public/stylesheets/sass/skip_embedded.sass
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
// ============================================================
|
2
|
+
// 1. 共通
|
3
|
+
// ============================================================
|
4
|
+
// 基本部分
|
5
|
+
// ------------------------------------------------------------
|
6
|
+
@import skip_base.sass
|
7
|
+
// ヘッダ
|
8
|
+
// ------------------------------------------------------------
|
9
|
+
@import skip_header.sass
|
10
|
+
// フッタ
|
11
|
+
// ------------------------------------------------------------
|
12
|
+
@import skip_footer.sass
|
13
|
+
|
14
|
+
#flash_message
|
15
|
+
:position absolute
|
16
|
+
:top 3px
|
17
|
+
:left 15%
|
18
|
+
:right 15%
|
19
|
+
:width 70%
|
20
|
+
:z-index 2
|
21
|
+
div
|
22
|
+
:width 100%
|
23
|
+
:margin 0
|
24
|
+
:text-align center
|
25
|
+
:font-size 12px
|
26
|
+
:border-width 2px
|
27
|
+
:border-style solid
|
28
|
+
h3
|
29
|
+
:margin 10px
|
30
|
+
:width 100%
|
31
|
+
|
32
|
+
span
|
33
|
+
:position static
|
34
|
+
:font-size 10px
|
35
|
+
:margin-left 20px
|
36
|
+
:right 15px
|
37
|
+
:top 15px
|
38
|
+
&.warn
|
39
|
+
:border-color orange
|
40
|
+
:background-color yellow
|
41
|
+
&.notice
|
42
|
+
:border-color limegreen
|
43
|
+
:background-color palegreen
|
44
|
+
&.error
|
45
|
+
:border-color red
|
46
|
+
:background-color pink
|
47
|
+
|
48
|
+
input
|
49
|
+
&.input_submit
|
50
|
+
:padding 0
|
51
|
+
:font-size 11px
|
52
|
+
&.input_text
|
53
|
+
:padding 0
|
54
|
+
|
55
|
+
.labeled-field
|
56
|
+
:border 1px solid silver
|
57
|
+
:color rgb(153, 153, 153)
|
58
|
+
:font-size 13px
|
59
|
+
|
60
|
+
&.focus
|
61
|
+
:color #000000
|
62
|
+
|
63
|
+
iframe#ie-select-fix
|
64
|
+
:border 0
|
65
|
+
:position absolute
|
@@ -0,0 +1,19 @@
|
|
1
|
+
div#footer
|
2
|
+
:color #A9A9A9
|
3
|
+
:overflow hidden
|
4
|
+
:text-align center
|
5
|
+
:position relative
|
6
|
+
:height 50px
|
7
|
+
.info
|
8
|
+
:width 800px
|
9
|
+
:margin auto
|
10
|
+
:padding 5px 200px 0 0
|
11
|
+
.first
|
12
|
+
:border-bottom 1px dashed #ccc
|
13
|
+
:padding-bottom 4px
|
14
|
+
.second
|
15
|
+
:padding-top 5px
|
16
|
+
.powered_by
|
17
|
+
:position absolute
|
18
|
+
:top 0px
|
19
|
+
:right 0px
|
@@ -0,0 +1,47 @@
|
|
1
|
+
div#header
|
2
|
+
:position relative
|
3
|
+
:height 70px
|
4
|
+
// IEでpositionがstatic以外の場合にz-indexが正しく適用されないバグ対応
|
5
|
+
:z-index 1
|
6
|
+
div#global_top
|
7
|
+
:border-bottom 1px dashed #ccc
|
8
|
+
:height 20px
|
9
|
+
:margin 4px 5px
|
10
|
+
div#application_link
|
11
|
+
:float left
|
12
|
+
:position relative
|
13
|
+
div#other_links
|
14
|
+
:border 1px solid #ccc
|
15
|
+
:position absolute
|
16
|
+
:left 64px
|
17
|
+
:top 16px
|
18
|
+
:width 160px
|
19
|
+
:z-index 1001
|
20
|
+
:background-color #fff
|
21
|
+
a
|
22
|
+
:display block
|
23
|
+
&:hover
|
24
|
+
:color #fff
|
25
|
+
:background-color #0080dd
|
26
|
+
div#menu
|
27
|
+
:position absolute
|
28
|
+
:top 0
|
29
|
+
:right 0
|
30
|
+
:border none
|
31
|
+
:font-size 12px
|
32
|
+
:text-align right
|
33
|
+
div#logo
|
34
|
+
:float left
|
35
|
+
:vertical-align top
|
36
|
+
:margin 1px 0 0 10px
|
37
|
+
img
|
38
|
+
:height 45px
|
39
|
+
div.banner
|
40
|
+
:height 40px
|
41
|
+
:width 450px
|
42
|
+
:margin 5px 0 0 160px
|
43
|
+
div#search
|
44
|
+
:position absolute
|
45
|
+
:bottom 10px
|
46
|
+
:right 0px
|
47
|
+
|
@@ -0,0 +1,55 @@
|
|
1
|
+
* {
|
2
|
+
margin: 0;
|
3
|
+
padding: 0; }
|
4
|
+
|
5
|
+
body {
|
6
|
+
font-size: 12px;
|
7
|
+
font-family: Verdana, Arial, sans-serif;
|
8
|
+
font-weight: normal;
|
9
|
+
color: #555555;
|
10
|
+
position: absolute;
|
11
|
+
left: 0;
|
12
|
+
margin: 0;
|
13
|
+
text-align: left;
|
14
|
+
background-color: #ffffff;
|
15
|
+
width: 100%; }
|
16
|
+
|
17
|
+
img {
|
18
|
+
vertical-align: middle;
|
19
|
+
border: 0; }
|
20
|
+
|
21
|
+
a {
|
22
|
+
text-decoration: none;
|
23
|
+
color: #0080dd; }
|
24
|
+
a:hover {
|
25
|
+
color: blue;
|
26
|
+
text-decoration: underline; }
|
27
|
+
|
28
|
+
form {
|
29
|
+
padding: 0px;
|
30
|
+
margin: 0px; }
|
31
|
+
form input {
|
32
|
+
font-size: 12px;
|
33
|
+
font-family: Verdana, Arial, sans-serif;
|
34
|
+
color: #000000;
|
35
|
+
margin: 0px;
|
36
|
+
padding: 2px; }
|
37
|
+
form select {
|
38
|
+
font-size: 12px;
|
39
|
+
font-family: Verdana, Arial, sans-serif;
|
40
|
+
color: #000000;
|
41
|
+
margin: 0 2px 0 0;
|
42
|
+
padding: 0;
|
43
|
+
letter-spacing: 2px;
|
44
|
+
z-index: 0; }
|
45
|
+
form textarea {
|
46
|
+
font-size: 12px;
|
47
|
+
font-family: Verdana, Arial, sans-serif;
|
48
|
+
color: #000000;
|
49
|
+
margin: 0px;
|
50
|
+
padding: 2px; }
|
51
|
+
|
52
|
+
table {
|
53
|
+
font-size: 12px;
|
54
|
+
table-layout: fixed;
|
55
|
+
border-collapse: collapse; }
|
@@ -0,0 +1,156 @@
|
|
1
|
+
* {
|
2
|
+
margin: 0;
|
3
|
+
padding: 0; }
|
4
|
+
|
5
|
+
body {
|
6
|
+
font-size: 12px;
|
7
|
+
font-family: Verdana, Arial, sans-serif;
|
8
|
+
font-weight: normal;
|
9
|
+
color: #555555;
|
10
|
+
position: absolute;
|
11
|
+
left: 0;
|
12
|
+
margin: 0;
|
13
|
+
text-align: left;
|
14
|
+
background-color: #ffffff;
|
15
|
+
width: 100%; }
|
16
|
+
|
17
|
+
img {
|
18
|
+
vertical-align: middle;
|
19
|
+
border: 0; }
|
20
|
+
|
21
|
+
a {
|
22
|
+
text-decoration: none;
|
23
|
+
color: #0080dd; }
|
24
|
+
a:hover {
|
25
|
+
color: blue;
|
26
|
+
text-decoration: underline; }
|
27
|
+
|
28
|
+
form {
|
29
|
+
padding: 0px;
|
30
|
+
margin: 0px; }
|
31
|
+
form input {
|
32
|
+
font-size: 12px;
|
33
|
+
font-family: Verdana, Arial, sans-serif;
|
34
|
+
color: #000000;
|
35
|
+
margin: 0px;
|
36
|
+
padding: 2px; }
|
37
|
+
form select {
|
38
|
+
font-size: 12px;
|
39
|
+
font-family: Verdana, Arial, sans-serif;
|
40
|
+
color: #000000;
|
41
|
+
margin: 0 2px 0 0;
|
42
|
+
padding: 0;
|
43
|
+
letter-spacing: 2px;
|
44
|
+
z-index: 0; }
|
45
|
+
form textarea {
|
46
|
+
font-size: 12px;
|
47
|
+
font-family: Verdana, Arial, sans-serif;
|
48
|
+
color: #000000;
|
49
|
+
margin: 0px;
|
50
|
+
padding: 2px; }
|
51
|
+
|
52
|
+
table {
|
53
|
+
font-size: 12px;
|
54
|
+
table-layout: fixed;
|
55
|
+
border-collapse: collapse; }
|
56
|
+
|
57
|
+
div#header {
|
58
|
+
position: relative;
|
59
|
+
height: 70px; }
|
60
|
+
div#header div#global_top {
|
61
|
+
border-bottom: 1px dashed #ccc;
|
62
|
+
height: 20px;
|
63
|
+
margin: 4px 5px; }
|
64
|
+
div#header div#global_top div#application_link {
|
65
|
+
float: left; }
|
66
|
+
div#header div#global_top div#menu {
|
67
|
+
position: absolute;
|
68
|
+
top: 0;
|
69
|
+
right: 0;
|
70
|
+
border: none;
|
71
|
+
font-size: 12px;
|
72
|
+
text-align: right; }
|
73
|
+
div#header div#logo {
|
74
|
+
float: left;
|
75
|
+
vertical-align: top;
|
76
|
+
margin: 1px 0 0 10px; }
|
77
|
+
div#header div#logo img {
|
78
|
+
height: 45px; }
|
79
|
+
div#header div.banner {
|
80
|
+
height: 45px;
|
81
|
+
width: 450px;
|
82
|
+
margin: 1px 0 0 160px; }
|
83
|
+
div#header div#search {
|
84
|
+
position: absolute;
|
85
|
+
bottom: 0px;
|
86
|
+
right: 0px; }
|
87
|
+
|
88
|
+
div#footer {
|
89
|
+
color: #A9A9A9;
|
90
|
+
overflow: hidden;
|
91
|
+
text-align: center;
|
92
|
+
position: relative;
|
93
|
+
height: 50px; }
|
94
|
+
div#footer .info {
|
95
|
+
width: 800px;
|
96
|
+
margin: auto;
|
97
|
+
padding: 5px 200px 0 0; }
|
98
|
+
div#footer .info .first {
|
99
|
+
border-bottom: 1px dashed #ccc;
|
100
|
+
padding-bottom: 4px; }
|
101
|
+
div#footer .info .second {
|
102
|
+
padding-top: 5px; }
|
103
|
+
div#footer .powered_by {
|
104
|
+
position: absolute;
|
105
|
+
top: 0px;
|
106
|
+
right: 0px; }
|
107
|
+
|
108
|
+
#flash_message {
|
109
|
+
position: absolute;
|
110
|
+
top: 3px;
|
111
|
+
left: 15%;
|
112
|
+
right: 15%;
|
113
|
+
width: 70%;
|
114
|
+
z-index: 2; }
|
115
|
+
#flash_message div {
|
116
|
+
width: 100%;
|
117
|
+
margin: 0;
|
118
|
+
text-align: center;
|
119
|
+
font-size: 12px;
|
120
|
+
border-width: 2px;
|
121
|
+
border-style: solid; }
|
122
|
+
#flash_message div h3 {
|
123
|
+
margin: 10px;
|
124
|
+
width: 100%; }
|
125
|
+
#flash_message div h3 span {
|
126
|
+
position: static;
|
127
|
+
font-size: 10px;
|
128
|
+
margin-left: 20px;
|
129
|
+
right: 15px;
|
130
|
+
top: 15px; }
|
131
|
+
#flash_message div.warn {
|
132
|
+
border-color: orange;
|
133
|
+
background-color: yellow; }
|
134
|
+
#flash_message div.notice {
|
135
|
+
border-color: limegreen;
|
136
|
+
background-color: palegreen; }
|
137
|
+
#flash_message div.error {
|
138
|
+
border-color: red;
|
139
|
+
background-color: pink; }
|
140
|
+
|
141
|
+
input.input_submit {
|
142
|
+
padding: 0;
|
143
|
+
font-size: 11px; }
|
144
|
+
input.input_text {
|
145
|
+
padding: 0; }
|
146
|
+
|
147
|
+
.labeled-field {
|
148
|
+
border: 1px solid silver;
|
149
|
+
color: rgb(153, 153, 153);
|
150
|
+
font-size: 13px; }
|
151
|
+
.labeled-field.focus {
|
152
|
+
color: #000000; }
|
153
|
+
|
154
|
+
iframe#ie-select-fix {
|
155
|
+
border: 0;
|
156
|
+
position: absolute; }
|
@@ -0,0 +1,19 @@
|
|
1
|
+
div#footer {
|
2
|
+
color: #A9A9A9;
|
3
|
+
overflow: hidden;
|
4
|
+
text-align: center;
|
5
|
+
position: relative;
|
6
|
+
height: 50px; }
|
7
|
+
div#footer .info {
|
8
|
+
width: 800px;
|
9
|
+
margin: auto;
|
10
|
+
padding: 5px 200px 0 0; }
|
11
|
+
div#footer .info .first {
|
12
|
+
border-bottom: 1px dashed #ccc;
|
13
|
+
padding-bottom: 4px; }
|
14
|
+
div#footer .info .second {
|
15
|
+
padding-top: 5px; }
|
16
|
+
div#footer .powered_by {
|
17
|
+
position: absolute;
|
18
|
+
top: 0px;
|
19
|
+
right: 0px; }
|
@@ -0,0 +1,45 @@
|
|
1
|
+
div#header {
|
2
|
+
position: relative;
|
3
|
+
height: 70px;
|
4
|
+
z-index: 1; }
|
5
|
+
div#header div#global_top {
|
6
|
+
border-bottom: 1px dashed #ccc;
|
7
|
+
height: 20px;
|
8
|
+
margin: 4px 5px; }
|
9
|
+
div#header div#global_top div#application_link {
|
10
|
+
float: left;
|
11
|
+
position: relative; }
|
12
|
+
div#header div#global_top div#other_links {
|
13
|
+
border: 1px solid #ccc;
|
14
|
+
position: absolute;
|
15
|
+
left: 64px;
|
16
|
+
top: 16px;
|
17
|
+
width: 160px;
|
18
|
+
z-index: 1001;
|
19
|
+
background-color: #fff; }
|
20
|
+
div#header div#global_top div#other_links a {
|
21
|
+
display: block; }
|
22
|
+
div#header div#global_top div#other_links a:hover {
|
23
|
+
color: #fff;
|
24
|
+
background-color: #0080dd; }
|
25
|
+
div#header div#global_top div#menu {
|
26
|
+
position: absolute;
|
27
|
+
top: 0;
|
28
|
+
right: 0;
|
29
|
+
border: none;
|
30
|
+
font-size: 12px;
|
31
|
+
text-align: right; }
|
32
|
+
div#header div#logo {
|
33
|
+
float: left;
|
34
|
+
vertical-align: top;
|
35
|
+
margin: 1px 0 0 10px; }
|
36
|
+
div#header div#logo img {
|
37
|
+
height: 45px; }
|
38
|
+
div#header div.banner {
|
39
|
+
height: 40px;
|
40
|
+
width: 450px;
|
41
|
+
margin: 5px 0 0 160px; }
|
42
|
+
div#header div#search {
|
43
|
+
position: absolute;
|
44
|
+
bottom: 10px;
|
45
|
+
right: 0px; }
|
File without changes
|
File without changes
|
@@ -0,0 +1,117 @@
|
|
1
|
+
require 'json'
|
2
|
+
require 'skip_embedded/rp_service/oauth_proxy'
|
3
|
+
require 'skip_embedded/rp_service/http_connection'
|
4
|
+
require 'skip_embedded/rp_service/util'
|
5
|
+
|
6
|
+
module SkipEmbedded
|
7
|
+
module RpService
|
8
|
+
class Client
|
9
|
+
attr_accessor :connection
|
10
|
+
attr_accessor :backend
|
11
|
+
|
12
|
+
@@connection_class = SkipEmbedded::RpService::HttpConnection
|
13
|
+
|
14
|
+
def self.connection_class=(klass)
|
15
|
+
@@connection_class = klass
|
16
|
+
end
|
17
|
+
def self.connection_class
|
18
|
+
@@connection_class
|
19
|
+
end
|
20
|
+
|
21
|
+
class Mapper
|
22
|
+
def initialize(site)
|
23
|
+
@site = site.is_a?(URI) ? site : URI(site)
|
24
|
+
end
|
25
|
+
|
26
|
+
def register_endpoint
|
27
|
+
@site + "skip"
|
28
|
+
end
|
29
|
+
|
30
|
+
def users_endpoint
|
31
|
+
@site + "skip/user"
|
32
|
+
end
|
33
|
+
|
34
|
+
def users_sync_endpoint
|
35
|
+
@site + "skip/user/sync"
|
36
|
+
end
|
37
|
+
|
38
|
+
def groups_endpoint
|
39
|
+
@site + "skip/groups"
|
40
|
+
end
|
41
|
+
|
42
|
+
def groups_sync_endpoint
|
43
|
+
@site + "skip/groups/sync"
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
attr_reader :name, :url, :mapper, :key, :secret
|
48
|
+
def self.register!(name, service, params, conn = nil)
|
49
|
+
mapper = Mapper.new(service)
|
50
|
+
conn ||= connection_class.new
|
51
|
+
response = conn.post_via_webservice_util(mapper.register_endpoint.to_s, "skip"=>params)["skip"]
|
52
|
+
|
53
|
+
returning(new(name, service, response)){|c| c.connection = conn }
|
54
|
+
end
|
55
|
+
|
56
|
+
def initialize(name, url, params)
|
57
|
+
params = params.with_indifferent_access
|
58
|
+
@key = params[:consumer_key] || params[:key]
|
59
|
+
@secret = params[:consumer_secret] || params[:secret]
|
60
|
+
raise ArgumentError.new("key and secret required in #{params.inspect}") unless @key && @secret
|
61
|
+
|
62
|
+
@name = name
|
63
|
+
@url = url
|
64
|
+
@mapper = Mapper.new(url)
|
65
|
+
end
|
66
|
+
|
67
|
+
def groups_url
|
68
|
+
@mapper.groups_endpoint.to_s
|
69
|
+
end
|
70
|
+
|
71
|
+
def group_url(gid)
|
72
|
+
"#{@mapper.groups_endpoint}/#{gid}"
|
73
|
+
end
|
74
|
+
|
75
|
+
def user_url
|
76
|
+
@mapper.users_endpoint.to_s
|
77
|
+
end
|
78
|
+
|
79
|
+
def user_sync_url
|
80
|
+
@mapper.users_sync_endpoint.to_s
|
81
|
+
end
|
82
|
+
|
83
|
+
def group_sync_url
|
84
|
+
@mapper.groups_sync_endpoint.to_s
|
85
|
+
end
|
86
|
+
|
87
|
+
def oauth(token, secret)
|
88
|
+
OauthProxy.new(self, token, secret)
|
89
|
+
end
|
90
|
+
|
91
|
+
def add_user(*values)
|
92
|
+
data = Util.user_data(*values)
|
93
|
+
|
94
|
+
response = connection.post_via_webservice_util(user_url, "user" => data)["user"]
|
95
|
+
backend.add_access_token(values.first, response["access_token"], response["access_secret"])
|
96
|
+
end
|
97
|
+
|
98
|
+
def sync_users(users)
|
99
|
+
data = users.map{|values| Util.user_data(*values) }
|
100
|
+
|
101
|
+
response = connection.post_via_webservice_util(user_sync_url, "users"=> data)["users"]
|
102
|
+
response.each do |created|
|
103
|
+
backend.add_access_token(created["identity_url"], created["access_token"], created["access_secret"])
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
def sync_groups(groups)
|
108
|
+
data = groups.map{|args| Util.group_data(*args) }
|
109
|
+
|
110
|
+
response = connection.post_via_webservice_util(group_sync_url, "groups" => data)
|
111
|
+
response["groups"].each do |created|
|
112
|
+
backend.update_group(created["gid"], created)
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
@@ -0,0 +1,85 @@
|
|
1
|
+
require 'skip_embedded/initial_settings'
|
2
|
+
require 'skip_embedded/web_service_util'
|
3
|
+
require 'json'
|
4
|
+
require 'net/http'
|
5
|
+
require 'net/https'
|
6
|
+
|
7
|
+
module SkipEmbedded
|
8
|
+
module RpService
|
9
|
+
class HttpConnection
|
10
|
+
class Error < RuntimeError
|
11
|
+
attr_reader :response
|
12
|
+
def initialize(message, response)
|
13
|
+
super(message)
|
14
|
+
@response = response
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def initialize(ca_file = nil)
|
19
|
+
@ca_file = ca_file
|
20
|
+
end
|
21
|
+
|
22
|
+
def post_via_webservice_util(url, data, parse_json = true)
|
23
|
+
url = url.is_a?(URI) ? url : URI(url)
|
24
|
+
req = Net::HTTP::Post.new(url.path)
|
25
|
+
req["X-SECRET-KEY"] = ::SkipEmbedded::InitialSettings['skip_collaboration']['secret_key']
|
26
|
+
req["Content-Type"] = "application/json"
|
27
|
+
req.body = data.to_json
|
28
|
+
request_http(url, req, parse_json)
|
29
|
+
end
|
30
|
+
|
31
|
+
def get_resource_via_oauth(url, token, headers = {})
|
32
|
+
request_api_via_oauth(:get, url, nil, token, headers, false)
|
33
|
+
end
|
34
|
+
def post_via_oauth(url, data, token)
|
35
|
+
request_api_via_oauth(:post, url, data, token)
|
36
|
+
end
|
37
|
+
def put_via_oauth(url, data, token)
|
38
|
+
request_api_via_oauth(:put, url, data, token)
|
39
|
+
end
|
40
|
+
def delete_via_oauth(url, token)
|
41
|
+
request_api_via_oauth(:delete, url, nil, token)
|
42
|
+
end
|
43
|
+
|
44
|
+
private
|
45
|
+
def request_api_via_oauth(method, url, data, token, headers = {}, parse_json=true)
|
46
|
+
url = url.is_a?(URI) ? url : URI(url)
|
47
|
+
req = (case method
|
48
|
+
when :post then Net::HTTP::Post
|
49
|
+
when :put then Net::HTTP::Put
|
50
|
+
when :delete then Net::HTTP::Delete
|
51
|
+
else Net::HTTP::Get
|
52
|
+
end).new(url.path)
|
53
|
+
req["Content-Type"] = "application/json"
|
54
|
+
headers.each{|k,v| req[k] = v }
|
55
|
+
|
56
|
+
req.body = data.to_json if data && !req.is_a?(Net::HTTP::Get)
|
57
|
+
token.sign!(req)
|
58
|
+
|
59
|
+
request_http(url, req, parse_json)
|
60
|
+
end
|
61
|
+
|
62
|
+
def request_http(url, req, parse_json)
|
63
|
+
setup_https(url).start do |conn|
|
64
|
+
res = conn.request(req)
|
65
|
+
raise Error.new("request failed", res) if !res.is_a?(Net::HTTPOK)
|
66
|
+
parse_json ? JSON.parse(res.body) : res.body
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
def setup_https(uri)
|
71
|
+
returning Net::HTTP.new(uri.host, uri.port) do |http|
|
72
|
+
if uri.scheme == "https"
|
73
|
+
if @ca_file
|
74
|
+
http.ca_file = @ca_file
|
75
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
76
|
+
http.verify_depth = 5
|
77
|
+
else
|
78
|
+
http.verify_mode = OpenSSL::SSL::NONE
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require 'oauth'
|
2
|
+
require 'skip_embedded/rp_service/util'
|
3
|
+
|
4
|
+
module SkipEmbedded
|
5
|
+
module RpService
|
6
|
+
class OauthProxy
|
7
|
+
def initialize(service, token, secret)
|
8
|
+
@service = service
|
9
|
+
consumer = OAuth::Consumer.new(@service.key, @service.secret, :site => @service.url)
|
10
|
+
@access_token = OAuth::AccessToken.new(consumer , token, secret)
|
11
|
+
end
|
12
|
+
|
13
|
+
def get_resource(path, headers = {})
|
14
|
+
url = URI.join(@service.url, path)
|
15
|
+
@service.connection.get_resource_via_oauth(url, @access_token, headers)
|
16
|
+
end
|
17
|
+
|
18
|
+
def update_user(params)
|
19
|
+
res = @service.connection.put_via_oauth(@service.user_url, {"user" => params}, @access_token)["user"]
|
20
|
+
@service.backend.update_user(res["identity_url"], res)
|
21
|
+
end
|
22
|
+
|
23
|
+
def destroy_user
|
24
|
+
@service.connection.delete_via_oauth(@service.user_url, @access_token)
|
25
|
+
end
|
26
|
+
|
27
|
+
def add_group(*args)
|
28
|
+
req = {"group" => Util.group_data(*args)}
|
29
|
+
res = @service.connection.post_via_oauth(@service.groups_url, req, @access_token)["group"]
|
30
|
+
@service.backend.update_group(res["gid"], res)
|
31
|
+
end
|
32
|
+
|
33
|
+
def update_group(gid, params)
|
34
|
+
req = {"group" => params.except(:gid)}
|
35
|
+
res = @service.connection.put_via_oauth(@service.group_url(gid), req, @access_token)["group"]
|
36
|
+
@service.backend.update_group(res["gid"], res)
|
37
|
+
end
|
38
|
+
|
39
|
+
def destroy_group(gid)
|
40
|
+
@service.connection.delete_via_oauth(@service.group_url(gid), @access_token)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module SkipEmbedded
|
2
|
+
module RpService
|
3
|
+
module Util
|
4
|
+
def user_data(identity_url, name, display_name, admin = false)
|
5
|
+
{:identity_url => identity_url, :name => name,
|
6
|
+
:display_name => display_name, :admin => admin}.reject{|k,v| v.nil? }
|
7
|
+
end
|
8
|
+
|
9
|
+
def group_data(gid, name, display_name, members)
|
10
|
+
{:gid => gid, :name => name, :display_name => display_name,
|
11
|
+
:members => members}.reject{|k,v| v.nil? }
|
12
|
+
end
|
13
|
+
module_function :user_data, :group_data
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
data/lib/skip_embedded.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openskip-skip_embedded
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
+
- MAEDA Naoki
|
7
8
|
- MOROHASHI Kyosuke
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
12
|
|
12
|
-
date: 2009-
|
13
|
+
date: 2009-05-22 00:00:00 -07:00
|
13
14
|
default_executable: skip-gen
|
14
15
|
dependencies:
|
15
16
|
- !ruby/object:Gem::Dependency
|
@@ -22,6 +23,26 @@ dependencies:
|
|
22
23
|
- !ruby/object:Gem::Version
|
23
24
|
version: 0.1.4
|
24
25
|
version:
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: json
|
28
|
+
type: :runtime
|
29
|
+
version_requirement:
|
30
|
+
version_requirements: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: "0"
|
35
|
+
version:
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: oauth
|
38
|
+
type: :runtime
|
39
|
+
version_requirement:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: "0"
|
45
|
+
version:
|
25
46
|
description: Utilities to collabolate SKIP, opensource buisiness SNS.
|
26
47
|
email: k-morohashi@esm.co.jp
|
27
48
|
executables:
|
@@ -51,6 +72,11 @@ files:
|
|
51
72
|
- lib/skip_embedded/open_id_sso
|
52
73
|
- lib/skip_embedded/open_id_sso/authentication.rb
|
53
74
|
- lib/skip_embedded/open_id_sso/session_management.rb
|
75
|
+
- lib/skip_embedded/rp_service
|
76
|
+
- lib/skip_embedded/rp_service/client.rb
|
77
|
+
- lib/skip_embedded/rp_service/http_connection.rb
|
78
|
+
- lib/skip_embedded/rp_service/oauth_proxy.rb
|
79
|
+
- lib/skip_embedded/rp_service/util.rb
|
54
80
|
- lib/skip_embedded/web_service_util
|
55
81
|
- lib/skip_embedded/web_service_util/client.rb
|
56
82
|
- lib/skip_embedded/web_service_util/server.rb
|
@@ -77,11 +103,23 @@ files:
|
|
77
103
|
- generators/skip_embedded/templates/public/javascripts/dropdown_navigation.js
|
78
104
|
- generators/skip_embedded/templates/public/javascripts/labeled_text_field.js
|
79
105
|
- generators/skip_embedded/templates/public/javascripts/skip_fckeditor_config.js
|
80
|
-
- generators/
|
81
|
-
- generators/
|
82
|
-
- generators/
|
83
|
-
- generators/
|
84
|
-
- generators/
|
106
|
+
- generators/skip_embedded_stylesheets
|
107
|
+
- generators/skip_embedded_stylesheets/skip_embedded_stylesheets_generator.rb
|
108
|
+
- generators/skip_embedded_stylesheets/templates
|
109
|
+
- generators/skip_embedded_stylesheets/templates/public
|
110
|
+
- generators/skip_embedded_stylesheets/templates/public/stylesheets
|
111
|
+
- generators/skip_embedded_stylesheets/templates/public/stylesheets/sass
|
112
|
+
- generators/skip_embedded_stylesheets/templates/public/stylesheets/sass/skip_base.sass
|
113
|
+
- generators/skip_embedded_stylesheets/templates/public/stylesheets/sass/skip_embedded.sass
|
114
|
+
- generators/skip_embedded_stylesheets/templates/public/stylesheets/sass/skip_footer.sass
|
115
|
+
- generators/skip_embedded_stylesheets/templates/public/stylesheets/sass/skip_header.sass
|
116
|
+
- generators/skip_embedded_stylesheets/templates/public/stylesheets/skip_base.css
|
117
|
+
- generators/skip_embedded_stylesheets/templates/public/stylesheets/skip_embedded.css
|
118
|
+
- generators/skip_embedded_stylesheets/templates/public/stylesheets/skip_footer.css
|
119
|
+
- generators/skip_embedded_stylesheets/templates/public/stylesheets/skip_header.css
|
120
|
+
- generators/skip_embedded_stylesheets/templates/public/stylesheets/sprites
|
121
|
+
- generators/skip_embedded_stylesheets/templates/public/stylesheets/sprites/sprites.css
|
122
|
+
- generators/skip_embedded_stylesheets/templates/public/stylesheets/sprites/sprites.png
|
85
123
|
- script/skip-gen.sh
|
86
124
|
- spec/skip_embedded/fulltext_search_cache/builder_base_spec.rb
|
87
125
|
- spec/skip_embedded/fulltext_search_cache/mediator_spec.rb
|
@@ -1,159 +0,0 @@
|
|
1
|
-
#flash_message {
|
2
|
-
position: absolute;
|
3
|
-
top: 3px;
|
4
|
-
left: 15%;
|
5
|
-
right: 15%;
|
6
|
-
width: 70%;
|
7
|
-
z-index: 2; }
|
8
|
-
#flash_message div {
|
9
|
-
width: 100%;
|
10
|
-
margin: 0;
|
11
|
-
text-align: center;
|
12
|
-
font-size: 12px;
|
13
|
-
border-width: 2px;
|
14
|
-
border-style: solid; }
|
15
|
-
#flash_message div h3 {
|
16
|
-
margin: 10px;
|
17
|
-
width: 100%; }
|
18
|
-
#flash_message div h3 span {
|
19
|
-
position: static;
|
20
|
-
font-size: 10px;
|
21
|
-
margin-left: 20px;
|
22
|
-
right: 15px;
|
23
|
-
top: 15px; }
|
24
|
-
#flash_message div.warn {
|
25
|
-
border-color: orange;
|
26
|
-
background-color: yellow; }
|
27
|
-
#flash_message div.notice {
|
28
|
-
border-color: limegreen;
|
29
|
-
background-color: palegreen; }
|
30
|
-
#flash_message div.error {
|
31
|
-
border-color: red;
|
32
|
-
background-color: pink; }
|
33
|
-
|
34
|
-
div#header {
|
35
|
-
height: 55px;
|
36
|
-
}
|
37
|
-
|
38
|
-
div#header div#search {
|
39
|
-
position: absolute;
|
40
|
-
top: 25px;
|
41
|
-
right: 5px;
|
42
|
-
}
|
43
|
-
|
44
|
-
div#header div#search form {
|
45
|
-
margin:0;
|
46
|
-
padding:0;
|
47
|
-
}
|
48
|
-
|
49
|
-
div#header div#serach input {
|
50
|
-
font-family:Verdana,Arial,Sans-serif;
|
51
|
-
font-size:12px;
|
52
|
-
margin:0;
|
53
|
-
padding:2px;
|
54
|
-
}
|
55
|
-
|
56
|
-
input.input_submit{
|
57
|
-
padding: 0;
|
58
|
-
font-size:11px;
|
59
|
-
}
|
60
|
-
|
61
|
-
input.input_text{
|
62
|
-
padding: 0;
|
63
|
-
}
|
64
|
-
|
65
|
-
div#header div#menu {
|
66
|
-
background-color:#D0E0F0;
|
67
|
-
border:medium none;
|
68
|
-
font-size:12px;
|
69
|
-
padding:1px 5px;
|
70
|
-
position:absolute;
|
71
|
-
right:0;
|
72
|
-
text-align:right;
|
73
|
-
top:0;
|
74
|
-
}
|
75
|
-
|
76
|
-
div#header div#menu .item {
|
77
|
-
float:left;
|
78
|
-
font-weight:bold;
|
79
|
-
padding:3px 10px 1px;
|
80
|
-
}
|
81
|
-
|
82
|
-
div#header div#menu .item a {
|
83
|
-
color:blue;
|
84
|
-
text-decoration:none;
|
85
|
-
}
|
86
|
-
|
87
|
-
.labeled-field {
|
88
|
-
border: 1px solid silver;
|
89
|
-
color: rgb(153, 153, 153);
|
90
|
-
font-size: 13px; }
|
91
|
-
|
92
|
-
.labeled-field.focus {
|
93
|
-
color: #000000; }
|
94
|
-
|
95
|
-
iframe#ie-select-fix {
|
96
|
-
border : 0;
|
97
|
-
position : absolute;
|
98
|
-
}
|
99
|
-
|
100
|
-
body {
|
101
|
-
font-size: 12px;
|
102
|
-
font-family: Verdana, Arial, sans-serif;
|
103
|
-
color: #555555;
|
104
|
-
position: absolute;
|
105
|
-
left: 0;
|
106
|
-
margin: 0;
|
107
|
-
text-align: left;
|
108
|
-
background-color: #ffffff;
|
109
|
-
width: 100%; }
|
110
|
-
|
111
|
-
div#main div#tab_body{
|
112
|
-
background-color:#FFFFFF;
|
113
|
-
margin-right:10px;
|
114
|
-
padding:10px;
|
115
|
-
position:relative;
|
116
|
-
border : 1px dashed silver;
|
117
|
-
}
|
118
|
-
|
119
|
-
img {
|
120
|
-
vertical-align: middle;
|
121
|
-
border: 0; }
|
122
|
-
|
123
|
-
a {
|
124
|
-
text-decoration: none;
|
125
|
-
color: #0080dd; }
|
126
|
-
a:hover {
|
127
|
-
color: blue;
|
128
|
-
text-decoration: underline; }
|
129
|
-
|
130
|
-
|
131
|
-
div#footer {
|
132
|
-
color: #A9A9A9;
|
133
|
-
overflow: hidden;
|
134
|
-
text-align: center;
|
135
|
-
position: relative;
|
136
|
-
height: 50px;
|
137
|
-
}
|
138
|
-
div#footer .info {
|
139
|
-
width: 50em;
|
140
|
-
margin: auto;
|
141
|
-
padding: 5px 200px 0 0;
|
142
|
-
}
|
143
|
-
div#footer .info .first {
|
144
|
-
border-bottom:1px dashed silver;
|
145
|
-
padding-bottom:4px;
|
146
|
-
}
|
147
|
-
div#footer .info .second {
|
148
|
-
padding-top: 5px;
|
149
|
-
}
|
150
|
-
div#footer .powered_by {
|
151
|
-
position: absolute; top: 0px; right: 0px;
|
152
|
-
}
|
153
|
-
|
154
|
-
div#main {
|
155
|
-
position: relative;
|
156
|
-
padding: 10px 10px 10px 15px;
|
157
|
-
_width: 100%;
|
158
|
-
background : url("http://user.openskip.org/stylesheets/skins/silver/back.png");
|
159
|
-
}
|