Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
website
提交
b4d5de48
W
website
项目概览
openeuler
/
website
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
W
website
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b4d5de48
编写于
1月 16, 2020
作者:
F
freesky-edward
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
support to load the cla information after signed
上级
b2bf159a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
56 addition
and
21 deletion
+56
-21
themes/project/static/js/cla.js
themes/project/static/js/cla.js
+56
-21
未找到文件。
themes/project/static/js/cla.js
浏览文件 @
b4d5de48
$
(
function
()
{
getCode
();
initClaPage
();
initCurrentDate
();
})
...
...
@@ -27,28 +26,23 @@ function initCurrentDate() {
}
function
getCode
()
{
if
(
getLanguage
()
==
"
zh
"
)
{
$
(
"
#client
"
).
val
(
"
6c298174d665b993c8a4dd56b0976654d3ef6f59af6c88f59b5b0c99f635c893
"
);
}
else
{
$
(
"
#client
"
).
val
(
"
88913556129bdae86458ec266f174b0cc5833198641e0e219891e7eb463bd3bf
"
)
}
code
=
getQueryString
(
"
code
"
)
if
(
!
code
||
code
==
""
)
{
oauthLogin
();
}
else
{
$
(
'
#oauth-code
'
).
val
(
code
);
}
}
function
getQueryString
(
name
)
{
var
reg
=
new
RegExp
(
"
(^|&)
"
+
name
+
"
=([^&]*)(&|$)
"
,
"
i
"
);
var
r
=
window
.
location
.
search
.
substr
(
1
).
match
(
reg
);
if
(
r
!=
null
)
return
unescape
(
r
[
2
]);
return
null
;
}
function
readCookie
(
name
)
{
var
namePrefix
=
name
+
"
=
"
;
var
cookies
=
document
.
cookie
.
split
(
'
;
'
);
for
(
var
i
=
0
;
i
<
cookies
.
length
;
i
++
)
{
var
c
=
cookies
[
i
];
while
(
c
.
charAt
(
0
)
==
'
'
)
c
=
c
.
substring
(
1
,
c
.
length
);
if
(
c
.
indexOf
(
namePrefix
)
==
0
)
return
c
.
substring
(
namePrefix
.
length
,
c
.
length
);
}
return
null
;
}
function
getLanguage
()
{
var
url
=
window
.
location
.
href
;
if
(
url
.
indexOf
(
"
/en/
"
)
>=
0
)
{
...
...
@@ -61,12 +55,10 @@ function getLanguage() {
}
function
oauthLogin
()
{
code
=
$
(
'
#oauth-code
'
).
val
();
if
(
!
code
||
code
==
""
)
{
let
config
=
{
providerID
:
"
openeuler_bot
"
,
client_id
:
$
(
"
#client
"
).
val
(),
redirect_uri
:
window
.
location
.
origin
+
"
/
"
+
getLanguage
()
+
"
/cla.html
"
,
redirect_uri
:
window
.
location
.
origin
+
"
/
cla
"
,
response_type
:
"
code
"
,
authorization
:
"
https://gitee.com/oauth/authorize
"
,
scopes
:
{
request
:
[
"
user_info
"
,
"
emails
"
]}
...
...
@@ -87,11 +79,18 @@ function oauthLogin() {
.
catch
((
err
)
=>
{
console
.
error
(
"
Error from fetcher
"
,
err
)
})
}
}
// init cla page
function
initClaPage
()
{
$
(
"
#client
"
).
val
(
"
d00e9b289d8cf8f98e2fc68a9c240304f6413007d82d30701cd1da7e937db75c
"
);
cla
=
readCookie
(
"
cla-info
"
)
if
(
!
cla
||
cla
==
""
)
{
oauthLogin
();
}
if
(
$
(
'
#cla-type-table
'
).
length
)
{
// default show individual
$
(
'
#individual-table
'
).
show
();
...
...
@@ -113,6 +112,42 @@ function initClaPage() {
});
}
type
=
readCookie
(
"
type
"
)
if
(
type
&&
type
==
"
0
"
)
{
$
(
'
#individual-email
'
).
val
(
readCookie
(
"
email
"
));
$
(
'
#individual-address
'
).
val
(
readCookie
(
"
address
"
));
$
(
'
#individual-name
'
).
val
(
readCookie
(
"
name
"
));
$
(
'
#individual-telephone
'
).
val
(
readCookie
(
"
telephone
"
));
$
(
'
#individual-fax
'
).
val
(
readCookie
(
"
fax
"
));
$
(
'
#individual-date
'
).
val
(
readCookie
(
"
date
"
));
$
(
'
#individual-table
'
).
show
();
$
(
'
#legalentity-table
'
).
hide
();
$
(
"
#sign-cla-button
"
).
attr
(
'
disabled
'
,
true
)
$
(
"
#reset-cla-button
"
).
attr
(
'
disabled
'
,
true
)
}
else
if
(
type
&&
type
==
"
1
"
)
{
$
(
'
#legalentity-name
'
).
val
(
readCookie
(
"
name
"
));
$
(
'
#legalentity-title
'
).
val
(
readCookie
(
"
title
"
));
$
(
'
#legalentity-corporation
'
).
val
(
readCookie
(
"
corporation
"
));
$
(
'
#legalentity-address
'
).
val
(
readCookie
(
"
address
"
));
$
(
'
#legalentity-date
'
).
val
(
readCookie
(
"
date
"
));
$
(
'
#legalentity-email
'
).
val
(
readCookie
(
"
email
"
));
$
(
'
#legalentity-telephone
'
).
val
(
readCookie
(
"
telephone
"
));
$
(
'
#legalentity-fax
'
).
val
(
readCookie
(
"
fax
"
));
$
(
'
#individual-table
'
).
hide
();
$
(
'
#legalentity-table
'
).
show
();
$
(
"
#sign-cla-button
"
).
attr
(
'
disabled
'
,
true
)
$
(
"
#reset-cla-button
"
).
attr
(
'
disabled
'
,
true
)
}
$
(
'
#individual-email
'
).
val
(
readCookie
(
"
email
"
));
$
(
"
#individual-email
"
).
attr
(
'
disabled
'
,
true
)
if
(
$
(
'
#sign-cla-button
'
).
length
)
{
$
(
"
#sign-cla-button
"
).
bind
(
'
click
'
,
function
()
{
v
=
parseInt
(
$
(
'
input[name="cla-type-radio"]:checked
'
).
val
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录