Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
check
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abook_web
check
Commits
058280d6
Commit
058280d6
authored
Oct 21, 2014
by
Masaru Abe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
リファクタリング
parent
f7a6fa25
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
54 additions
and
42 deletions
+54
-42
abvw/common/js/common.js
+9
-1
abvw/common/js/i18n.js
+8
-7
abvw/js/Limit_Access_Content.js
+7
-4
abvw/js/bookmark.js
+0
-0
abvw/js/contentsearch.js
+8
-8
abvw/js/detail.js
+1
-1
abvw/js/header.js
+3
-3
abvw/js/history.js
+4
-4
abvw/js/home.js
+7
-7
abvw/js/login.js
+7
-7
abvw/js/settings.js
+0
-0
No files found.
abvw/common/js/common.js
View file @
058280d6
...
...
@@ -2702,6 +2702,9 @@ COMMON.convertToDate = function(input) {
var
strTemp
=
input
;
var
nIndex
;
dateResult
=
new
Date
();
try
{
// Get year
nIndex
=
strTemp
.
indexOf
(
"-"
);
nYear
=
Number
(
strTemp
.
substr
(
0
,
nIndex
));
...
...
@@ -2726,14 +2729,19 @@ COMMON.convertToDate = function(input) {
nIndex
=
strTemp
.
indexOf
(
"."
);
nSecond
=
Number
(
strTemp
.
substr
(
0
,
nIndex
));
dateResult
=
new
Date
();
dateResult
.
setYear
(
nYear
);
dateResult
.
setMonth
(
nMonth
-
1
);
dateResult
.
setDate
(
nDay
);
dateResult
.
setHours
(
nHour
);
dateResult
.
setMinutes
(
nMinute
);
dateResult
.
setSeconds
(
nSecond
);
}
catch
(
e
)
{
//
}
return
dateResult
;
};
/*
...
...
abvw/common/js/i18n.js
View file @
058280d6
...
...
@@ -99,7 +99,7 @@ I18N.loadLanguage = function(lang) {
I18N
.
replaceText
(
jsonLangData
);
// 言語設定、言語データをストレージにキャッシュしておく
storeCurrentLanguage
(
lang
,
jsonLangData
);
I18N
.
storeCurrentLanguage
(
lang
,
jsonLangData
);
},
error
:
function
(
xhr
,
txtStatus
,
errorThrown
)
{
var
error
=
'Could not load a language file '
+
langfile
+
'. please check it.'
;
...
...
@@ -118,7 +118,7 @@ I18N.replaceText = function(jsonLangData) {
var
obj
=
$
(
'.lang:eq('
+
i
+
')'
);
var
langId
=
obj
.
attr
(
'lang'
);
if
(
langId
)
{
var
langText
=
getLangText
(
jsonLangData
,
langId
);
var
langText
=
I18N
.
getLangText
(
jsonLangData
,
langId
);
var
tn
=
obj
.
get
()[
0
].
localName
;
if
(
tn
==
'input'
)
{
if
(
obj
.
attr
(
'type'
)
==
'button'
||
obj
.
attr
(
'type'
)
==
'submit'
)
{
...
...
@@ -153,14 +153,14 @@ I18N.i18nText = function(key) {
var
value
=
storage
.
getItem
(
I18N
.
avwsys_storagekey
);
if
(
value
)
{
var
json
=
JSON
.
parse
(
value
);
return
getLangText
(
json
,
key
);
return
I18N
.
getLangText
(
json
,
key
);
}
}
return
"undefined"
;
};
/* 言語データのキー値から文字列を取得 */
function
getLangText
(
jsonLangData
,
key
)
{
I18N
.
getLangText
=
function
(
jsonLangData
,
key
)
{
if
(
jsonLangData
)
{
var
text
=
jsonLangData
[
key
];
return
text
;
...
...
@@ -169,7 +169,7 @@ function getLangText(jsonLangData, key) {
};
/* 言語データの切り替え */
function
changeLanguage
(
lang
)
{
I18N
.
changeLanguage
=
function
(
lang
)
{
// 言語の切替を行った場合のみ選択言語をストアする
var
storage
=
window
.
localStorage
;
...
...
@@ -182,7 +182,7 @@ function changeLanguage(lang) {
};
/* 設定言語の保存 */
function
storeCurrentLanguage
(
lang
,
langData
)
{
I18N
.
storeCurrentLanguage
=
function
(
lang
,
langData
)
{
var
ss
=
window
.
sessionStorage
;
if
(
ss
)
{
// language data
...
...
@@ -192,7 +192,7 @@ function storeCurrentLanguage(lang, langData) {
}
};
/* 設定言語の取得 */
function
getCurrentLanguage
()
{
I18N
.
getCurrentLanguage
=
function
()
{
var
lang
;
var
storage
=
window
.
sessionStorage
;
if
(
storage
)
{
...
...
@@ -203,3 +203,4 @@ function getCurrentLanguage() {
}
return
lang
;
};
abvw/js/Limit_Access_Content.js
View file @
058280d6
var
messageLevel
=
{};
//名前空間用のオブジェクトを用意する
var
LIMIT_ACCESS_CONTENT
=
{};
function
checkLimitContent
(
contentId
,
funcOk
,
funcCancel
,
isNotUnlockScreen
)
{
LIMIT_ACCESS_CONTENT
.
messageLevel
=
{};
var
levelContent
=
parseInt
(
messageLevel
[
contentId
].
alertMessageLevel
);
LIMIT_ACCESS_CONTENT
.
checkLimitContent
=
function
(
contentId
,
funcOk
,
funcCancel
,
isNotUnlockScreen
)
{
var
levelContent
=
parseInt
(
LIMIT_ACCESS_CONTENT
.
messageLevel
[
contentId
].
alertMessageLevel
);
if
(
levelContent
==
1
)
{
if
(
$
(
'#limit_level1'
).
length
<=
0
)
{
...
...
@@ -31,7 +34,7 @@ function checkLimitContent(contentId, funcOk, funcCancel, isNotUnlockScreen) {
COMMON
.
lockLayout
();
$
(
'#limit_level1 .message'
).
html
(
messageLevel
[
contentId
].
alertMessage
);
$
(
'#limit_level1 .message'
).
html
(
LIMIT_ACCESS_CONTENT
.
messageLevel
[
contentId
].
alertMessage
);
$
(
'#limit_level1'
).
show
().
center
();
$
(
'#limit_level1 .deletebtn .ok'
).
unbind
(
'click'
).
click
(
function
()
{
...
...
abvw/js/bookmark.js
View file @
058280d6
This diff is collapsed.
Click to expand it.
abvw/js/contentsearch.js
View file @
058280d6
...
...
@@ -260,7 +260,7 @@ CONTENTSEARCH.renderContent = function(id, text, division, type, order, from, to
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Assign content type to array to manage.
// save alert message level
messageLevel
[
post
.
contentId
]
=
{
alertMessageLevel
:
post
.
alertMessageLevel
,
alertMessage
:
post
.
alertMessage
};
LIMIT_ACCESS_CONTENT
.
messageLevel
[
post
.
contentId
]
=
{
alertMessageLevel
:
post
.
alertMessageLevel
,
alertMessage
:
post
.
alertMessage
};
//Check if user has read this content or not.
CONTENTSEARCH
.
checkUserHasReadContent
(
post
.
contentId
,
post
.
resourceVersion
,
post
.
metaVersion
);
...
...
@@ -304,7 +304,7 @@ CONTENTSEARCH.renderContent = function(id, text, division, type, order, from, to
//Toggle scroll to top Control
CONTENTSEARCH
.
handleBackToTop
();
//changeLanguage(ClientData.userInfo_language());
//
I18N.
changeLanguage(ClientData.userInfo_language());
I18N
.
i18nReplaceText
();
});
};
...
...
@@ -335,7 +335,7 @@ CONTENTSEARCH.handleBackToTop = function(){
//Handle language
CONTENTSEARCH
.
handleLanguage
=
function
(){
if
(
getCurrentLanguage
()
==
COMMON
.
Consts
.
ConstLanguage_En
||
getCurrentLanguage
()
==
COMMON
.
Consts
.
ConstLanguage_Ko
)
if
(
I18N
.
getCurrentLanguage
()
==
COMMON
.
Consts
.
ConstLanguage_En
||
I18N
.
getCurrentLanguage
()
==
COMMON
.
Consts
.
ConstLanguage_Ko
)
{
$
(
'#control-sort-titlekana'
).
css
(
'display'
,
'none'
);
$
(
'#separate'
).
css
(
'display'
,
'none'
);
...
...
@@ -738,7 +738,7 @@ CONTENTSEARCH.readSubmenuFunction = function(e){
}
var
contentId
=
$
(
this
).
attr
(
'contentid'
);
// check limit of content
checkLimitContent
(
contentId
,
LIMIT_ACCESS_CONTENT
.
checkLimitContent
(
contentId
,
function
()
{
CONTENTSEARCH
.
readSubmenuFunction_callback
(
contentId
);
...
...
@@ -1286,7 +1286,7 @@ CONTENTSEARCH.refreshGrid = function(){
//format text display more record
CONTENTSEARCH
.
formatDisplayMoreRecord
=
function
(){
I18N
.
i18nReplaceText
();
//changeLanguage(ClientData.userInfo_language());
//
I18N.
changeLanguage(ClientData.userInfo_language());
$
(
'#control-nextrecord'
).
html
(
AVWEB
.
format
(
I18N
.
i18nText
(
'dspViewMore'
),
CONTENTSEARCH
.
returnNumberDispRecordForList
()));
};
...
...
@@ -1321,7 +1321,7 @@ CONTENTSEARCH.displayResultNoRecord = function(){
$
(
'#control-nextrecord'
).
css
(
'visibility'
,
'hidden'
);
$
(
'.control_sort_on'
).
hide
();
$
(
'.control_sort_off'
).
show
();
if
(
getCurrentLanguage
()
==
COMMON
.
Consts
.
ConstLanguage_En
||
getCurrentLanguage
()
==
COMMON
.
Consts
.
ConstLanguage_Ko
){
if
(
I18N
.
getCurrentLanguage
()
==
COMMON
.
Consts
.
ConstLanguage_En
||
I18N
.
getCurrentLanguage
()
==
COMMON
.
Consts
.
ConstLanguage_Ko
){
/*$('#control-sort-titlekana').hide();*/
$
(
'#separate'
).
hide
();
$
(
'#control-sort-titlekana'
).
hide
();
...
...
@@ -1331,7 +1331,7 @@ CONTENTSEARCH.displayResultNoRecord = function(){
CONTENTSEARCH
.
enableSort
=
function
(){
$
(
'.control_sort_on'
).
show
();
$
(
'.control_sort_off'
).
hide
();
if
(
getCurrentLanguage
()
==
COMMON
.
Consts
.
ConstLanguage_En
||
getCurrentLanguage
()
==
COMMON
.
Consts
.
ConstLanguage_Ko
){
if
(
I18N
.
getCurrentLanguage
()
==
COMMON
.
Consts
.
ConstLanguage_En
||
I18N
.
getCurrentLanguage
()
==
COMMON
.
Consts
.
ConstLanguage_Ko
){
$
(
'#control-sort-titlekana'
).
hide
();
$
(
'#separate'
).
hide
();
}
...
...
@@ -1373,7 +1373,7 @@ CONTENTSEARCH.showContentShareDlgFunction = function(e) {
var
contentId
=
$
(
this
).
attr
(
'contentid'
);
// check limit of content
checkLimitContent
(
contentId
,
LIMIT_ACCESS_CONTENT
.
checkLimitContent
(
contentId
,
function
()
{
SHARE
.
contentId
=
contentId
;
...
...
abvw/js/detail.js
View file @
058280d6
...
...
@@ -130,7 +130,7 @@ Event groups [start]
DETAIL
.
contentdetail_dspRead_Click
=
function
(
e
)
{
e
.
preventDefault
();
var
outputId
=
ClientData
.
contentInfo_contentId
();
checkLimitContent
(
outputId
,
LIMIT_ACCESS_CONTENT
.
checkLimitContent
(
outputId
,
function
()
{
DETAIL
.
contentdetail_dspRead_Click_callback
(
outputId
);
},
...
...
abvw/js/header.js
View file @
058280d6
...
...
@@ -274,7 +274,7 @@ HEADER.homeClickFunction = function(){
//Change Language Japanese function
HEADER
.
changeLanguageJa
=
function
(){
changeLanguage
(
COMMON
.
Consts
.
ConstLanguage_Ja
);
I18N
.
changeLanguage
(
COMMON
.
Consts
.
ConstLanguage_Ja
);
//ClientData.userInfo_language(COMMON.Consts.ConstLanguage_Ja);
//$('#control-sort-titlekana').css('display','inline-block');
//$('#separate').css('display','inline-block');
...
...
@@ -287,7 +287,7 @@ HEADER.changeLanguageJa = function(){
//Change Language English functions
HEADER
.
changeLanguageEn
=
function
(){
changeLanguage
(
COMMON
.
Consts
.
ConstLanguage_En
);
I18N
.
changeLanguage
(
COMMON
.
Consts
.
ConstLanguage_En
);
//ClientData.userInfo_language(COMMON.Consts.ConstLanguage_En);
//$('#control-sort-titlekana').css('display','none');
//$('#separate').css('display','none');
...
...
@@ -300,7 +300,7 @@ HEADER.changeLanguageEn = function(){
//Change Language English function
HEADER
.
changeLanguageKo
=
function
(){
changeLanguage
(
COMMON
.
Consts
.
ConstLanguage_Ko
);
I18N
.
changeLanguage
(
COMMON
.
Consts
.
ConstLanguage_Ko
);
//ClientData.userInfo_language(COMMON.Consts.ConstLanguage_Ko);
//$('#control-sort-titlekana').css('display','none');
//$('#separate').css('display','none');
...
...
abvw/js/history.js
View file @
058280d6
...
...
@@ -187,7 +187,7 @@ HISTORY.renderContent = function(id, text, division, type, order, from, to, cate
var
viewdate
=
HISTORY
.
renderViewDate
(
post
.
contentId
);
// save alert message level
messageLevel
[
post
.
contentId
]
=
{
alertMessageLevel
:
post
.
alertMessageLevel
,
alertMessage
:
post
.
alertMessage
};
LIMIT_ACCESS_CONTENT
.
messageLevel
[
post
.
contentId
]
=
{
alertMessageLevel
:
post
.
alertMessageLevel
,
alertMessage
:
post
.
alertMessage
};
if
(
viewdate
!=
null
&&
viewdate
!=
'undefined'
&&
viewdate
!=
''
)
{
...
...
@@ -241,7 +241,7 @@ HISTORY.renderContent = function(id, text, division, type, order, from, to, cate
HISTORY
.
handleLanguage
=
function
(){
//if(ClientData.userInfo_language() == COMMON.Consts.ConstLanguage_En || ClientData.userInfo_language() == COMMON.Consts.ConstLanguage_Ko)
if
(
getCurrentLanguage
()
==
COMMON
.
Consts
.
ConstLanguage_En
||
getCurrentLanguage
()
==
COMMON
.
Consts
.
ConstLanguage_Ko
)
if
(
I18N
.
getCurrentLanguage
()
==
COMMON
.
Consts
.
ConstLanguage_En
||
I18N
.
getCurrentLanguage
()
==
COMMON
.
Consts
.
ConstLanguage_Ko
)
{
$
(
'#control-sort-titlekana'
).
css
(
'display'
,
'none'
);
$
(
'#control-sort-titlekana-off'
).
css
(
'display'
,
'none'
);
...
...
@@ -591,7 +591,7 @@ HISTORY.readSubmenuFunction = function(e){
var
contentId
=
$
(
this
).
attr
(
'contentid'
);
// check limit of content
checkLimitContent
(
contentId
,
LIMIT_ACCESS_CONTENT
.
checkLimitContent
(
contentId
,
function
()
{
HISTORY
.
readSubmenuFunction_callback
(
contentId
);
...
...
@@ -1478,7 +1478,7 @@ HISTORY.showContentShareDlgFunction = function(e) {
var
contentId
=
$
(
this
).
attr
(
'contentid'
);
// check limit of content
checkLimitContent
(
contentId
,
LIMIT_ACCESS_CONTENT
.
checkLimitContent
(
contentId
,
function
()
{
SHARE
.
contentId
=
contentId
;
...
...
abvw/js/home.js
View file @
058280d6
...
...
@@ -459,7 +459,7 @@ HOME.canvasClickFunction = function(e) {
var
contentId
=
$
(
this
).
attr
(
'id'
);
var
outputId
=
contentId
.
substring
(
17
);
checkLimitContent
(
outputId
,
LIMIT_ACCESS_CONTENT
.
checkLimitContent
(
outputId
,
function
(){
HOME
.
canvasClickFunction_callback
(
outputId
);
},
...
...
@@ -1213,7 +1213,7 @@ HOME.readSubmenuFunction = function(e) {
var
contentId
=
$
(
this
).
attr
(
'contentid'
);
// check limit of content
checkLimitContent
(
contentId
,
LIMIT_ACCESS_CONTENT
.
checkLimitContent
(
contentId
,
function
()
{
HOME
.
readSubmenuFunction_callback
(
contentId
);
...
...
@@ -1553,7 +1553,7 @@ HOME.sortByReleaseDateFunction = function() {
//Handle language
HOME
.
handleLanguage
=
function
()
{
if
(
getCurrentLanguage
()
==
COMMON
.
Consts
.
ConstLanguage_En
||
getCurrentLanguage
()
==
COMMON
.
Consts
.
ConstLanguage_Ko
)
{
if
(
I18N
.
getCurrentLanguage
()
==
COMMON
.
Consts
.
ConstLanguage_En
||
I18N
.
getCurrentLanguage
()
==
COMMON
.
Consts
.
ConstLanguage_Ko
)
{
$
(
'#control-sort-titlekana'
).
css
(
'display'
,
'none'
);
$
(
'#separate'
).
css
(
'display'
,
'none'
);
$
(
'#titlekana-sorttype'
).
html
(
''
);
...
...
@@ -1675,7 +1675,7 @@ HOME.renderContent = function(id, text, division, type, order, from, to, cateid,
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Assign content type to array to manage.
// save alert message level
messageLevel
[
post
.
contentId
]
=
{
alertMessageLevel
:
post
.
alertMessageLevel
,
alertMessage
:
post
.
alertMessage
};
LIMIT_ACCESS_CONTENT
.
messageLevel
[
post
.
contentId
]
=
{
alertMessageLevel
:
post
.
alertMessageLevel
,
alertMessage
:
post
.
alertMessage
};
//Check if user has read this content or not.
HOME
.
checkUserHasReadContent
(
post
.
contentId
,
post
.
resourceVersion
,
post
.
metaVersion
);
...
...
@@ -1721,7 +1721,7 @@ HOME.renderContent = function(id, text, division, type, order, from, to, cateid,
//Toggle scroll to top Control
HOME
.
handleBackToTop
();
//changeLanguage(ClientData.userInfo_language());
//
I18N.
changeLanguage(ClientData.userInfo_language());
I18N
.
i18nReplaceText
();
});
};
...
...
@@ -2157,7 +2157,7 @@ HOME.refreshGrid = function() {
//format text display more record
HOME
.
formatDisplayMoreRecord
=
function
()
{
//changeLanguage(ClientData.userInfo_language());
//
I18N.
changeLanguage(ClientData.userInfo_language());
I18N
.
i18nReplaceText
();
if
(
HOME
.
isShowBookShelf
)
{
...
...
@@ -2560,7 +2560,7 @@ HOME.showContentShareDlgFunction = function(e) {
var
contentId
=
$
(
this
).
attr
(
'contentid'
);
// check limit of content
checkLimitContent
(
contentId
,
LIMIT_ACCESS_CONTENT
.
checkLimitContent
(
contentId
,
function
()
{
SHARE
.
contentId
=
contentId
;
...
...
abvw/js/login.js
View file @
058280d6
...
...
@@ -40,7 +40,7 @@ LOGIN.initialScreen = function() {
//check Save Login Info
LOGIN
.
saveLoginInfo
=
function
()
{
var
lang
=
getCurrentLanguage
();
var
lang
=
I18N
.
getCurrentLanguage
();
//clear session of old user
//SessionStorageUtils.clear();
...
...
@@ -49,7 +49,7 @@ LOGIN.saveLoginInfo = function() {
//AVWEB.avwCreateUserSession();
// load language
changeLanguage
(
lang
);
I18N
.
changeLanguage
(
lang
);
// Set flag コンテンツデータチェックフラグ = true to sync local with server
ClientData
.
common_contentDataChkFlg
(
true
);
...
...
@@ -377,7 +377,7 @@ LOGIN.changePasswordProcess = function(){
//Change Language Japanese
LOGIN
.
changeLanguageJa
=
function
(){
changeLanguage
(
COMMON
.
Consts
.
ConstLanguage_Ja
);
I18N
.
changeLanguage
(
COMMON
.
Consts
.
ConstLanguage_Ja
);
document
.
title
=
I18N
.
i18nText
(
'dspLogin'
)
+
' | '
+
I18N
.
i18nText
(
'sysAppTitle'
);
//ClientData.userInfo_language(COMMON.Consts.ConstLanguage_Ja);
if
(
LOGIN
.
login_errorMessage
!=
""
){
...
...
@@ -387,7 +387,7 @@ LOGIN.changeLanguageJa = function(){
//Change Language Korean
LOGIN
.
changeLanguageKo
=
function
(){
changeLanguage
(
COMMON
.
Consts
.
ConstLanguage_Ko
);
I18N
.
changeLanguage
(
COMMON
.
Consts
.
ConstLanguage_Ko
);
document
.
title
=
I18N
.
i18nText
(
'dspLogin'
)
+
' | '
+
I18N
.
i18nText
(
'sysAppTitle'
);
//ClientData.userInfo_language(COMMON.Consts.ConstLanguage_Ko);
if
(
LOGIN
.
login_errorMessage
!=
""
){
...
...
@@ -397,7 +397,7 @@ LOGIN.changeLanguageKo = function(){
//Change Language English
LOGIN
.
changeLanguageEn
=
function
(){
changeLanguage
(
COMMON
.
Consts
.
ConstLanguage_En
);
I18N
.
changeLanguage
(
COMMON
.
Consts
.
ConstLanguage_En
);
document
.
title
=
I18N
.
i18nText
(
'dspLogin'
)
+
' | '
+
I18N
.
i18nText
(
'sysAppTitle'
);
//ClientData.userInfo_language(COMMON.Consts.ConstLanguage_En);
if
(
LOGIN
.
login_errorMessage
!=
""
){
...
...
@@ -851,10 +851,10 @@ LOGIN.showContentViewByOpenUrl = function(strContentId) {
//Go to Conten view page
//アラート表示組み込めるか
messageLevel
[
data
.
contentData
.
contentId
]
=
{
alertMessageLevel
:
data
.
contentData
.
alertMessageLevel
,
alertMessage
:
data
.
contentData
.
alertMessage
};
LIMIT_ACCESS_CONTENT
.
messageLevel
[
data
.
contentData
.
contentId
]
=
{
alertMessageLevel
:
data
.
contentData
.
alertMessageLevel
,
alertMessage
:
data
.
contentData
.
alertMessage
};
// check limit of content
checkLimitContent
(
LIMIT_ACCESS_CONTENT
.
checkLimitContent
(
data
.
contentData
.
contentId
,
function
()
{
...
...
abvw/js/settings.js
View file @
058280d6
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment