Commit 91216eee by Masaru Abe

リファクタリング

parent 0c50228a
......@@ -8,6 +8,9 @@
//グローバルの名前空間用のオブジェクトを用意する
var COMMON = {};
COMMON.resourceVersionArr = [];
COMMON.metaVersionArr = [];
COMMON.DEFAULT_IMG_OPTION_MEMO = 'img/list/icon_sticker.png';
COMMON.DEFAULT_IMG_OPTION_MARKING = 'img/list/icon_pen.png';
COMMON.DEFAULT_IMG_CONTENT_EDIT = 'img/common/band_updated.png';
......@@ -210,6 +213,9 @@ COMMON.Keys = {
serviceOpt_reader_usable_readinglog_gps: 'reader_usable_readinglog_gps',
// Session :事業者オプション(serviceOpt)_getits向け詳細ログ使用可:Char(Y:可能, N:不可)
serviceOpt_reader_readinglog_object: 'reader_readinglog_object',
// Session :事業者オプション(serviceOpt)_コンテンツ共有モード:Interger(0:なし , 1:ABook, 2:getits)
serviceOpt_content_share: 'content_share',
// Session :共通(common)_コンテンツID:Integer
common_contentId: 'common_contentId',
// Local :共通(common)_コンテンツID:Integer
......@@ -1222,6 +1228,16 @@ var ClientData = {
}
},
// Session :事業者オプション(serviceOpt)_コンテンツ共有モード:Interger(0:なし , 1:ABook, 2:getits)
serviceOpt_content_share: function (data) {
if (arguments.length > 0) {
SessionStorageUtils.set(COMMON.Keys.serviceOpt_content_share, data);
} else {
return SessionStorageUtils.get(COMMON.Keys.serviceOpt_content_share);
}
},
// Session :事業者オプション(serviceOpt)_カタログエディション:Char(Y:可能, N:不可)
serviceOpt_catalog_edition: function (data) {
if (arguments.length > 0) {
......@@ -2199,10 +2215,10 @@ COMMON.unlockFunction = function(inputPass) {
var serviceOptionList = data.serviceOptionList;
$.each(serviceOptionList, function (i, option) {
if (option.serviceName == 'web_screen_lock') {
if (option.serviceOptionId == 60) {
ClientData.serviceOpt_web_screen_lock(option.value);
}
else if (option.serviceName == 'web_screen_lock_wait') {
else if (option.serviceOptionId == 61) {
ClientData.serviceOpt_web_screen_lock_wait(option.value);
}
});
......@@ -2850,3 +2866,130 @@ COMMON.isIE10 = function() {
}
return false;
};
//Check content type is pdf content
COMMON.isPdfContent = function(contentType){
if(!(contentType == COMMON.ContentTypeKeys.Type_PDF)){
return false;
}
else{
return true;
}
};
//set resource version data
COMMON.setResourceVersionData = function(conId) {
var tempResourceArr;
var tempResource;
//check if insert new or edit
var flag = false;
if (ClientData.ResourceVersion().length <= 0 || ClientData.ResourceVersion() == null || ClientData.ResourceVersion() == 'undefined') {
tempResourceArr = [];
}
else {
tempResourceArr = ClientData.ResourceVersion();
}
for (var i = 0; i < COMMON.resourceVersionArr.length; i++) {
if (COMMON.resourceVersionArr[i].contentid == conId) {
tempResource = COMMON.resourceVersionArr[i].resourceversion;
break;
}
}
if (tempResourceArr.length > 0) {
for (var j = 0; j < tempResourceArr.length; j++) {
if (tempResourceArr[j].contentid == conId) {
tempResourceArr[j].resourceversion = tempResource;
flag = true;
break;
}
else {
flag = false;
}
}
if (!flag) {
tempResourceArr.push({ contentid: conId, resourceversion: tempResource });
}
} else {
tempResourceArr.push({ contentid: conId, resourceversion: tempResource });
}
ClientData.ResourceVersion(tempResourceArr);
};
//set meta Version Data
COMMON.setMetaVersionData = function(conId) {
var tempMetaArr;
var tempMeta;
//check if insert new or edit
var flag = false;
if (ClientData.MetaVersion().length <= 0 || ClientData.MetaVersion() == null || ClientData.MetaVersion() == 'undefined') {
tempMetaArr = [];
}
else {
tempMetaArr = ClientData.MetaVersion();
}
for (var i = 0; i < COMMON.metaVersionArr.length; i++) {
if (COMMON.metaVersionArr[i].contentid == conId) {
tempMeta = COMMON.metaVersionArr[i].metaversion;
break;
}
}
if (tempMetaArr.length > 0) {
for (var j = 0; j < tempMetaArr.length; j++) {
if (tempMetaArr[j].contentid == conId) {
tempMetaArr[j].metaversion = tempMeta;
flag = true;
break;
}
else {
flag = false;
}
}
if (!flag) {
tempMetaArr.push({ contentid: conId, metaversion: tempMeta });
}
} else {
tempMetaArr.push({ contentid: conId, metaversion: tempMeta });
}
ClientData.MetaVersion(tempMetaArr);
};
//convert delivery Date
COMMON.formatDeliveryDate = function(date) {
var day = date.date;
var month = eval(date.month) + 1;
var year = eval(date.year) + 1900;
var outputDate = year + '/' + (('' + month).length < 2 ? '0' : '') + month + '/' + (('' + day).length < 2 ? '0' : '') + day;
return outputDate;
};
//convert view Date
COMMON.formatNormalDate = function(day, month, year) {
var outputDate = year + '/' + (('' + month).length < 2 ? '0' : '') + month + '/' + (('' + day).length < 2 ? '0' : '') + day;
return outputDate;
};
//format Image string
COMMON.formatStringBase64 = function(imgStr) {
var outputString = 'data:image/jpeg;base64,' + imgStr;
return outputString;
};
......@@ -443,51 +443,49 @@ LOGIN.saveServiceUserOption = function(){
$.each(LOGIN.optionList, function (i, option) {
if (option.serviceName == 'force_pw_change_periodically') {
if (option.serviceOptionId == 22) {
ClientData.serviceOpt_force_pw_change_periodically(option.value);
}
else if (option.serviceName == 'force_pw_change_on_login') {
else if (option.serviceOptionId == 21) {
ClientData.serviceOpt_force_pw_change_on_login(option.value);
}
// No.8: do not use serviceOpt_force_login_periodically
// else if (option.serviceName == 'force_login_periodically') {
// ClientData.serviceOpt_force_login_periodically(option.value);
// }
else if (option.serviceName == 'marking') {
else if (option.serviceOptionId == 33) {
ClientData.serviceOpt_marking(option.value);
}
else if (option.serviceName == 'user_data_backup') {
else if (option.serviceOptionId == 28) {
ClientData.serviceOpt_user_data_backup(option.value);
}
else if (option.serviceName == 'web_screen_lock') {
else if (option.serviceOptionId == 60) {
ClientData.serviceOpt_web_screen_lock(option.value);
}
else if (option.serviceName == 'web_screen_lock_wait') {
else if (option.serviceOptionId == 61) {
ClientData.serviceOpt_web_screen_lock_wait(option.value);
}
else if( option.serviceName == 'catalog_edition' ) {
else if( option.serviceOptionId == 70) {
ClientData.serviceOpt_catalog_edition(option.value);
}
else if( option.serviceName == 'hibiyakadan_catalog' ) {
else if( option.serviceOptionId == 77) {
ClientData.serviceOpt_hibiyakadan_catalog(option.value);
}
else if( option.serviceName == 'usable_readinglog_gps' ) {
else if( option.serviceOptionId == 71) {
ClientData.serviceOpt_usable_readinglog_gps(option.value);
}
else if( option.serviceName == 'usable_readinglog_object' ) {
else if( option.serviceOptionId == 72) {
ClientData.serviceOpt_usable_readinglog_object(option.value);
}
else if( option.serviceName == 'reader_usable_readinglog_gps' ) {
else if( option.serviceOptionId == 83) {
ClientData.serviceOpt_reader_usable_readinglog_gps(option.value);
}
else if( option.serviceName == 'reader_readinglog_object' ) {
else if( option.serviceOptionId == 84) {
ClientData.serviceOpt_reader_readinglog_object(option.value);
}
else if( option.serviceName == 'daihatsu' ) {
else if( option.serviceOptionId == 87) {
ClientData.serviceOpt_daihatsu(option.value);
}
else if( option.serviceOptionId == 78) {
ClientData.serviceOpt_content_share(option.value);
}
});
};
......@@ -496,19 +494,19 @@ LOGIN.getServiceOptionList = function(){
$.each(LOGIN.optionList, function(i, option){
if(option.serviceName == 'force_pw_change_periodically'){
if(option.serviceOptionId == 22){
LOGIN.force_pw_change_periodically = option.value;
}
else if(option.serviceName == 'force_pw_change_on_login'){
else if(option.serviceOptionId == 21){
LOGIN.force_pw_change_on_login = option.value;
}
else if(option.serviceName == 'force_login_periodically'){
else if(option.serviceOptionId == 23){
LOGIN.force_login_periodically = option.value;
}
else if(option.serviceName == 'marking'){
else if(option.serviceOptionId == 33){
LOGIN.marking = option.value;
}
else if(option.serviceName == 'user_data_backup'){
else if(option.serviceOptionId == 28){
LOGIN.user_data_backup = option.value;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment