Commit 91216eee by Masaru Abe

リファクタリング

parent 0c50228a
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
//グローバルの名前空間用のオブジェクトを用意する //グローバルの名前空間用のオブジェクトを用意する
var COMMON = {}; var COMMON = {};
COMMON.resourceVersionArr = [];
COMMON.metaVersionArr = [];
COMMON.DEFAULT_IMG_OPTION_MEMO = 'img/list/icon_sticker.png'; COMMON.DEFAULT_IMG_OPTION_MEMO = 'img/list/icon_sticker.png';
COMMON.DEFAULT_IMG_OPTION_MARKING = 'img/list/icon_pen.png'; COMMON.DEFAULT_IMG_OPTION_MARKING = 'img/list/icon_pen.png';
COMMON.DEFAULT_IMG_CONTENT_EDIT = 'img/common/band_updated.png'; COMMON.DEFAULT_IMG_CONTENT_EDIT = 'img/common/band_updated.png';
...@@ -210,6 +213,9 @@ COMMON.Keys = { ...@@ -210,6 +213,9 @@ COMMON.Keys = {
serviceOpt_reader_usable_readinglog_gps: 'reader_usable_readinglog_gps', serviceOpt_reader_usable_readinglog_gps: 'reader_usable_readinglog_gps',
// Session :事業者オプション(serviceOpt)_getits向け詳細ログ使用可:Char(Y:可能, N:不可) // Session :事業者オプション(serviceOpt)_getits向け詳細ログ使用可:Char(Y:可能, N:不可)
serviceOpt_reader_readinglog_object: 'reader_readinglog_object', serviceOpt_reader_readinglog_object: 'reader_readinglog_object',
// Session :事業者オプション(serviceOpt)_コンテンツ共有モード:Interger(0:なし , 1:ABook, 2:getits)
serviceOpt_content_share: 'content_share',
// Session :共通(common)_コンテンツID:Integer // Session :共通(common)_コンテンツID:Integer
common_contentId: 'common_contentId', common_contentId: 'common_contentId',
// Local :共通(common)_コンテンツID:Integer // Local :共通(common)_コンテンツID:Integer
...@@ -1222,6 +1228,16 @@ var ClientData = { ...@@ -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:不可) // Session :事業者オプション(serviceOpt)_カタログエディション:Char(Y:可能, N:不可)
serviceOpt_catalog_edition: function (data) { serviceOpt_catalog_edition: function (data) {
if (arguments.length > 0) { if (arguments.length > 0) {
...@@ -2199,10 +2215,10 @@ COMMON.unlockFunction = function(inputPass) { ...@@ -2199,10 +2215,10 @@ COMMON.unlockFunction = function(inputPass) {
var serviceOptionList = data.serviceOptionList; var serviceOptionList = data.serviceOptionList;
$.each(serviceOptionList, function (i, option) { $.each(serviceOptionList, function (i, option) {
if (option.serviceName == 'web_screen_lock') { if (option.serviceOptionId == 60) {
ClientData.serviceOpt_web_screen_lock(option.value); 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); ClientData.serviceOpt_web_screen_lock_wait(option.value);
} }
}); });
...@@ -2850,3 +2866,130 @@ COMMON.isIE10 = function() { ...@@ -2850,3 +2866,130 @@ COMMON.isIE10 = function() {
} }
return false; 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;
};
...@@ -30,8 +30,8 @@ var contentTypeArr = []; ...@@ -30,8 +30,8 @@ var contentTypeArr = [];
//}; //};
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Create new Array for function No.12. //End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Create new Array for function No.12.
var contentIdArray = []; var contentIdArray = [];
var resourceVersionArr = []; //var resourceVersionArr = [];
var metaVersionArr = []; //var metaVersionArr = [];
var totalPage; var totalPage;
var chkSearchTextEmpty = false; var chkSearchTextEmpty = false;
var noRecordFlg = false; var noRecordFlg = false;
...@@ -207,7 +207,7 @@ function renderContent(id, text, division, type, order, from, to, cateid, grpid) ...@@ -207,7 +207,7 @@ function renderContent(id, text, division, type, order, from, to, cateid, grpid)
var outputDate =""; var outputDate ="";
if(post.contentDeliveryDate!=null&&post.contentDeliveryDate!=undefined&&post.contentDeliveryDate!='undefined') if(post.contentDeliveryDate!=null&&post.contentDeliveryDate!=undefined&&post.contentDeliveryDate!='undefined')
{ {
outputDate=formatDeliveryDate(post.contentDeliveryDate); outputDate=COMMON.formatDeliveryDate(post.contentDeliveryDate);
} }
/* $('#content-grid').append( /* $('#content-grid').append(
...@@ -271,7 +271,7 @@ function renderContent(id, text, division, type, order, from, to, cateid, grpid) ...@@ -271,7 +271,7 @@ function renderContent(id, text, division, type, order, from, to, cateid, grpid)
//assign thumbnail to array //assign thumbnail to array
var formatThumbnail = post.contentThumbnail; var formatThumbnail = post.contentThumbnail;
if((formatThumbnail != null) && (formatThumbnail != 'undefined') && (formatThumbnail != '')){ if((formatThumbnail != null) && (formatThumbnail != 'undefined') && (formatThumbnail != '')){
formatThumbnail = formatStringBase64(formatThumbnail); formatThumbnail = COMMON.formatStringBase64(formatThumbnail);
} }
thumbnailArr.push({ contentId: post.contentId, thumbnail: formatThumbnail}); thumbnailArr.push({ contentId: post.contentId, thumbnail: formatThumbnail});
...@@ -288,10 +288,10 @@ function renderContent(id, text, division, type, order, from, to, cateid, grpid) ...@@ -288,10 +288,10 @@ function renderContent(id, text, division, type, order, from, to, cateid, grpid)
checkUserHasReadContent(post.contentId, post.resourceVersion, post.metaVersion); checkUserHasReadContent(post.contentId, post.resourceVersion, post.metaVersion);
//assign version to array //assign version to array
resourceVersionArr.push({ contentid: post.contentId, resourceversion: post.resourceVersion }); COMMON.resourceVersionArr.push({ contentid: post.contentId, resourceversion: post.resourceVersion });
//assign meta version to array //assign meta version to array
metaVersionArr.push({ contentid: post.contentId, metaversion: post.metaVersion }); COMMON.metaVersionArr.push({ contentid: post.contentId, metaversion: post.metaVersion });
//Check if content has marking or memo //Check if content has marking or memo
checkContentMarkingMemoOption(post.contentId); checkContentMarkingMemoOption(post.contentId);
...@@ -504,10 +504,10 @@ function canvasClickFunction(e){ ...@@ -504,10 +504,10 @@ function canvasClickFunction(e){
ClientData.ReadingContentIds(contentIdArray); ClientData.ReadingContentIds(contentIdArray);
//Set ResouceVersion for content //Set ResouceVersion for content
setResourceVersionData(outputId); COMMON.setResourceVersionData(outputId);
//Set MetaVersion for content //Set MetaVersion for content
setMetaVersionData(outputId); COMMON.setMetaVersionData(outputId);
//Close Submenu //Close Submenu
$('#dlgSubMenu').hide(); $('#dlgSubMenu').hide();
...@@ -516,7 +516,7 @@ function canvasClickFunction(e){ ...@@ -516,7 +516,7 @@ function canvasClickFunction(e){
drawEditImage(outputId); drawEditImage(outputId);
//Open content Detail //Open content Detail
openContentDetail(); DETAIL.openContentDetail();
}; };
//Re-render page from and total record //Re-render page from and total record
...@@ -818,15 +818,6 @@ function returnContentType(contentid){ ...@@ -818,15 +818,6 @@ function returnContentType(contentid){
} }
}; };
//Check content type is pdf content
function isPdfContent(contentType){
if(!(contentType == COMMON.ContentTypeKeys.Type_PDF)){
return false;
}
else{
return true;
}
};
////Get resource Id of content ////Get resource Id of content
//function downloadResourceById(contentId){ //function downloadResourceById(contentId){
// var params = { // var params = {
...@@ -902,7 +893,7 @@ function readSubmenuFunction_callback(contentId) ...@@ -902,7 +893,7 @@ function readSubmenuFunction_callback(contentId)
var month = date.getMonth()+1; var month = date.getMonth()+1;
var day = date.getDate(); var day = date.getDate();
var outputDate = formatNormalDate(day, month, date.getFullYear()); var outputDate = COMMON.formatNormalDate(day, month, date.getFullYear());
ClientData.contentInfo_contentId(contentId); ClientData.contentInfo_contentId(contentId);
ClientData.contentInfo_contentThumbnail(contentThumbnail); ClientData.contentInfo_contentThumbnail(contentThumbnail);
...@@ -945,10 +936,10 @@ function readSubmenuFunction_callback(contentId) ...@@ -945,10 +936,10 @@ function readSubmenuFunction_callback(contentId)
ClientData.ReadingContentIds(newArray); ClientData.ReadingContentIds(newArray);
//Set ResouceVersion for content //Set ResouceVersion for content
setResourceVersionData(contentId); COMMON.setResourceVersionData(contentId);
//Set MetaVersion for content //Set MetaVersion for content
setMetaVersionData(contentId); COMMON.setMetaVersionData(contentId);
//Set data for readingcontentid //Set data for readingcontentid
ClientData.ReadingContentIds(contentIdArray); ClientData.ReadingContentIds(contentIdArray);
...@@ -1054,7 +1045,7 @@ function checkUserHasReadContent(contId, resourceVer, metaVer) { ...@@ -1054,7 +1045,7 @@ function checkUserHasReadContent(contId, resourceVer, metaVer) {
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail. //Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){ if(contentThumbnail == '' || contentThumbnail == null){
if(!isPdfContent(contentType)){ if(!COMMON.isPdfContent(contentType)){
var src = HEADER.getThumbnailForOtherType(contentType); var src = HEADER.getThumbnailForOtherType(contentType);
if( src != '' ){ if( src != '' ){
imgThumb.src = src; imgThumb.src = src;
...@@ -1080,7 +1071,7 @@ function checkUserHasReadContent(contId, resourceVer, metaVer) { ...@@ -1080,7 +1071,7 @@ function checkUserHasReadContent(contId, resourceVer, metaVer) {
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail. //Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){ if(contentThumbnail == '' || contentThumbnail == null){
if(!isPdfContent(contentType)){ if(!COMMON.isPdfContent(contentType)){
var src = HEADER.getThumbnailForOtherType(contentType); var src = HEADER.getThumbnailForOtherType(contentType);
if( src != '' ){ if( src != '' ){
imgThumb.src = src; imgThumb.src = src;
...@@ -1109,7 +1100,7 @@ function checkUserHasReadContent(contId, resourceVer, metaVer) { ...@@ -1109,7 +1100,7 @@ function checkUserHasReadContent(contId, resourceVer, metaVer) {
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail. //Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){ if(contentThumbnail == '' || contentThumbnail == null){
if(!isPdfContent(contentType)){ if(!COMMON.isPdfContent(contentType)){
var src = HEADER.getThumbnailForOtherType(contentType); var src = HEADER.getThumbnailForOtherType(contentType);
if( src != '' ){ if( src != '' ){
imgThumb.src = src; imgThumb.src = src;
...@@ -1147,7 +1138,7 @@ function checkUserHasReadContent(contId, resourceVer, metaVer) { ...@@ -1147,7 +1138,7 @@ function checkUserHasReadContent(contId, resourceVer, metaVer) {
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail. //Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){ if(contentThumbnail == '' || contentThumbnail == null){
if(!isPdfContent(contentType)){ if(!COMMON.isPdfContent(contentType)){
var src = HEADER.getThumbnailForOtherType(contentType); var src = HEADER.getThumbnailForOtherType(contentType);
if( src != '' ){ if( src != '' ){
imgThumb.src = src; imgThumb.src = src;
...@@ -1184,7 +1175,7 @@ function checkUserHasReadContent(contId, resourceVer, metaVer) { ...@@ -1184,7 +1175,7 @@ function checkUserHasReadContent(contId, resourceVer, metaVer) {
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail. //Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){ if(contentThumbnail == '' || contentThumbnail == null){
if(!isPdfContent(contentType)){ if(!COMMON.isPdfContent(contentType)){
var src = HEADER.getThumbnailForOtherType(contentType); var src = HEADER.getThumbnailForOtherType(contentType);
if( src != '' ){ if( src != '' ){
imgThumb.src = src; imgThumb.src = src;
...@@ -1304,95 +1295,6 @@ function renderViewDate(id){ ...@@ -1304,95 +1295,6 @@ function renderViewDate(id){
} }
}; };
//set resource version data
function setResourceVersionData(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 < resourceVersionArr.length; i++){
if(resourceVersionArr[i].contentid == conId){
tempResource = 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
function setMetaVersionData(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 < metaVersionArr.length; i++){
if(metaVersionArr[i].contentid == conId){
tempMeta = 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);
};
//handle display sort direction //handle display sort direction
function handleSortDisp(){ function handleSortDisp(){
// $('#control-sort-title').removeClass('active_tops'); // $('#control-sort-title').removeClass('active_tops');
...@@ -1480,33 +1382,6 @@ function handleSortDisp(){ ...@@ -1480,33 +1382,6 @@ function handleSortDisp(){
} }
}; };
//convert delivery Date
function formatDeliveryDate(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
function formatNormalDate(day, month, year){
var outputDate = year + '/' + ((''+month).length<2 ? '0' : '') + month + '/' + ((''+day).length<2 ? '0' : '') + day;
return outputDate;
};
//format Image string
function formatStringBase64(imgStr){
var outputString = 'data:image/jpeg;base64,'+imgStr;
return outputString;
};
//function Open SubMenu Dialog //function Open SubMenu Dialog
function titleClickFunction(e){ function titleClickFunction(e){
if (e) { if (e) {
...@@ -1558,10 +1433,10 @@ function titleClickFunction(e){ ...@@ -1558,10 +1433,10 @@ function titleClickFunction(e){
ClientData.ReadingContentIds(contentIdArray); ClientData.ReadingContentIds(contentIdArray);
//Set ResouceVersion for content //Set ResouceVersion for content
setResourceVersionData(contentid); COMMON.setResourceVersionData(contentid);
//Set MetaVersion for content //Set MetaVersion for content
setMetaVersionData(contentid); COMMON.setMetaVersionData(contentid);
//Close Submenu //Close Submenu
$('#dlgSubMenu').hide(); $('#dlgSubMenu').hide();
...@@ -1570,7 +1445,7 @@ function titleClickFunction(e){ ...@@ -1570,7 +1445,7 @@ function titleClickFunction(e){
drawEditImage(contentid); drawEditImage(contentid);
//Open content Detail //Open content Detail
openContentDetail(); DETAIL.openContentDetail();
}; };
//Get Number Disp Record For List //Get Number Disp Record For List
......
/// コンテンツ詳細画面 /// コンテンツ詳細画面
var resourceIdDetail=""; //名前空間用のオブジェクトを用意する
var DETAIL = {};
var displayData = { DETAIL.displayData = {
contentID: "", contentID: "",
contentTitle: "", contentTitle: "",
contentDetail: "", contentDetail: "",
...@@ -14,226 +15,188 @@ var displayData = { ...@@ -14,226 +15,188 @@ var displayData = {
// Init function of page // Init function of page
$(document).ready(function () { $(document).ready(function () {
//alert(ClientData.contentInfo_contentId());
//if (!avwCheckLogin(COMMON.ScreenIds.Login)) return;
//openContentDetail();
}); });
// Show content detail // Show content detail
function openContentDetail() { DETAIL.openContentDetail = function() {
if(!isPdfContent(ClientData.contentInfo_contentType())){ if(!COMMON.isPdfContent(ClientData.contentInfo_contentType())){
// $("#book_data").css('border-right','0');
// $("#book_data").css('float','none');
// $("#book_data").css('background-color','white');
// $("#book_data").css('margin-left','auto');
// $("#book_data").css('margin-right', 'auto');
$('#sectionContentDetail').removeClass().addClass('sectiondetailnopdf'); $('#sectionContentDetail').removeClass().addClass('sectiondetailnopdf');
}else }
{ else {
// $("#book_data").css('border-right','2px solid #CCC');
// $("#book_data").css('float','left');
// $("#book_data").css('background-color', '#f7f7f7');
$('#sectionContentDetail').removeClass().addClass('sectiondetail'); $('#sectionContentDetail').removeClass().addClass('sectiondetail');
} }
displayData = { DETAIL.displayData = {
contentID: "", contentID: "",
contentTitle: "", contentTitle: "",
contentDetail: "", contentDetail: "",
contentThumbnail: "", contentThumbnail: "",
deliveryDate: (new Date()), deliveryDate: (new Date()),
pages: [] pages: []
}; };
// Clear childs // Clear childs
$('#book_list').html(''); $('#book_list').html('');
// Clear display info // Clear display info
//$("#imgContentThumbnail").css('padding-top', "60px"); $("#imgContentThumbnail").attr('src', "img/data_loading.gif");
$("#imgContentThumbnail").attr('src', "img/data_loading.gif"); DETAIL.resetLoadingImageSize();
resetLoadingImageSize();
$("#txtContentTitle").text(''); $("#txtContentTitle").text('');
$("#txtPubDt2_Dsp").text(''); $("#txtPubDt2_Dsp").text('');
$("#txtContentDetail").text(''); $("#txtContentDetail").text('');
$("#contentDetailClose").click(contentDetailClose_Click); $("#contentDetailClose").click(DETAIL.contentDetailClose_Click);
//$("#contentdetail_dspBack").click(contentdetail_dspBack_Click); $("#contentdetail_dspRead").click(DETAIL.contentdetail_dspRead_Click);
$("#contentdetail_dspRead").click(contentdetail_dspRead_Click);
COMMON.lockLayout(); COMMON.lockLayout();
$("#contentDetail").css('z-index', 101); $("#contentDetail").css('z-index', 101);
$("#sectionContentDetail").show(); $("#sectionContentDetail").show();
$("#contentDetail").show(); $("#contentDetail").show();
$("#contentDetail").center(); $("#contentDetail").center();
if ($("#contentDetail").height() > $(window).height()){ if ($("#contentDetail").height() > $(window).height()){
$("#contentDetail").css('top', '0'); $("#contentDetail").css('top', '0');
} }
// Get contentid, thumbnail from list screen // Get contentid, thumbnail from list screen
displayData.contentID = ClientData.contentInfo_contentId(); DETAIL.displayData.contentID = ClientData.contentInfo_contentId();
displayData.contentThumbnail = ClientData.contentInfo_contentThumbnail(); DETAIL.displayData.contentThumbnail = ClientData.contentInfo_contentThumbnail();
// Get content detail // Get content detail
avwCmsApi(ClientData.userInfo_accountPath(), "webGetContent", "GET", { contentId: displayData.contentID, sid: ClientData.userInfo_sid(), getType: 1 }, avwCmsApi(ClientData.userInfo_accountPath(), "webGetContent", "GET", { contentId: DETAIL.displayData.contentID, sid: ClientData.userInfo_sid(), getType: 1 },
function (data) { function (data) {
var contentType = ClientData.contentInfo_contentType();
var contentType = ClientData.contentInfo_contentType(); // Get content detail
DETAIL.displayData.contentTitle = data.contentData.contentName;
// Get content detail DETAIL.displayData.contentDetail = data.contentData.contentDetail;
displayData.contentTitle = data.contentData.contentName; DETAIL.displayData.deliveryDate = COMMON.convertToDate(data.contentData.deliveryStartDate);
displayData.contentDetail = data.contentData.contentDetail;
displayData.deliveryDate = COMMON.convertToDate(data.contentData.deliveryStartDate); //Start Function : No.12 -- Editor : Viet Nguyen -- Date : 08/01/2013 -- Summary : Create new function to return content type of content.
//Start Function : No.12 -- Editor : Viet Nguyen -- Date : 08/01/2013 -- Summary : Create new function to return content type of content. if(!COMMON.isPdfContent(contentType)){
DETAIL.showContentNotPDF(DETAIL.displayData.contentTitle,DETAIL.displayData.contentDetail,DETAIL.displayData.contentThumbnail,DETAIL.displayData.deliveryDate);
if(!isPdfContent(contentType)){ }
ShowContentNotPDF(displayData.contentTitle,displayData.contentDetail,displayData.contentThumbnail,displayData.deliveryDate); else{
}else{ // Get pages
// Get pages avwCmsApiSync(ClientData.userInfo_accountPath(), "webContentPage", "GET", { contentId: ClientData.contentInfo_contentId(), sid: ClientData.userInfo_sid(), thumbnailFlg: 1, pageNos: '1,2,3,4,5,6'},
avwCmsApiSync(ClientData.userInfo_accountPath(), "webContentPage", "GET", { contentId: ClientData.contentInfo_contentId(), sid: ClientData.userInfo_sid(), thumbnailFlg: 1, pageNos: '1,2,3,4,5,6'}, function (data) {
function (data) { // Get pages
// Get pages for (var nIndex = 0; nIndex < data.pages.length; nIndex++) {
for (var nIndex = 0; nIndex < data.pages.length; nIndex++) { if (nIndex < 6) {
if (nIndex < 6) { DETAIL.displayData.pages.push({ pageNo: data.pages[nIndex].pageNo, pageText: data.pages[nIndex].pageText, pageThumbnail: ("data:image/jpeg;base64," + data.pages[nIndex].pageThumbnail) });
displayData.pages.push({ pageNo: data.pages[nIndex].pageNo, pageText: data.pages[nIndex].pageText, pageThumbnail: ("data:image/jpeg;base64," + data.pages[nIndex].pageThumbnail) }); }
} }
} // Show to screen
// Show to screen DETAIL.showContent(DETAIL.displayData.contentID, COMMON.truncate(DETAIL.displayData.contentTitle, 20), DETAIL.displayData.contentDetail, ClientData.contentInfo_contentThumbnail(), DETAIL.displayData.deliveryDate, DETAIL.displayData.pages);
ShowContent(displayData.contentID, COMMON.truncate(displayData.contentTitle, 20), displayData.contentDetail, ClientData.contentInfo_contentThumbnail(), displayData.deliveryDate, displayData.pages); },
}, null
null );
); }
}
//End Function : No.12 -- Editor : Viet Nguyen -- Date : 08/01/2013 -- Summary : Create new function to return content type of content.
//End Function : No.12 -- Editor : Viet Nguyen -- Date : 08/01/2013 -- Summary : Create new function to return content type of content.
},
}, null
null );
);
}; };
// Close content detail // Close content detail
function contentDetailClose_Click(e) { DETAIL.contentDetailClose_Click = function(e) {
e.preventDefault(); e.preventDefault();
COMMON.unlockLayout(); COMMON.unlockLayout();
$("#contentDetail").hide(); $("#contentDetail").hide();
$("#sectionContentDetail").hide(); $("#sectionContentDetail").hide();
}; };
/* /*
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
Event groups [start] Event groups [start]
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
*/ */
function contentdetail_dspRead_Click(e) { DETAIL.contentdetail_dspRead_Click = function(e) {
e.preventDefault(); e.preventDefault();
var outputId = ClientData.contentInfo_contentId(); var outputId = ClientData.contentInfo_contentId();
checkLimitContent(outputId,
checkLimitContent(outputId, function () {
function () { DETAIL.contentdetail_dspRead_Click_callback(outputId);
contentdetail_dspRead_Click_callback(outputId); },
}, function(){
function(){ },
}, 1
1 );
);
}; };
function contentdetail_dspRead_Click_callback(outputId) { DETAIL.contentdetail_dspRead_Click_callback = function(outputId) {
var date = new Date();
var month = date.getMonth() + 1;
var day = date.getDate();
var outputDate = formatNormalDate(day, month, date.getFullYear());
var contentIdArray = [];
var checkflag = false;
//Store Content id that user has read
if (ClientData.ReadingContentIds().length > 0) {
contentIdArray = ClientData.ReadingContentIds();
for (var nIndex = 0; nIndex < contentIdArray.length; nIndex++) {
if (contentIdArray[nIndex].contentid == outputId) {
checkflag = true;
if (contentIdArray[nIndex].viewdate == '' || contentIdArray[nIndex].viewdate == null || contentIdArray[nIndex].viewdate == 'undefined') {
contentIdArray[nIndex].viewdate = outputDate;
contentIdArray[nIndex].originviewdate = date;
}
break;
}
else {
checkflag = false;
}
}
if (!checkflag) { var date = new Date();
contentIdArray.push({ contentid: outputId, viewdate: outputDate, originviewdate: date }); var month = date.getMonth() + 1;
} var day = date.getDate();
} var outputDate = COMMON.formatNormalDate(day, month, date.getFullYear());
else { var contentIdArray = [];
contentIdArray.push({ contentid: outputId, viewdate: outputDate, originviewdate: date }); var checkflag = false;
}
//Renew ReadingContentID
var newArray = [];
ClientData.ReadingContentIds(newArray);
//Set data for readingcontentid
ClientData.ReadingContentIds(contentIdArray);
//Set ResouceVersion for content
setResourceVersionData(outputId);
//Set MetaVersion for content
setMetaVersionData(outputId);
// Redirect to screen: contentview //Store Content id that user has read
//$('body,html').animate({ scrollTop: 0 }, 0); if (ClientData.ReadingContentIds().length > 0) {
ClientData.IsRefresh(false); contentIdArray = ClientData.ReadingContentIds();
if (ClientData.contentInfo_contentType() == COMMON.ContentTypeKeys.Type_Others) { for (var nIndex = 0; nIndex < contentIdArray.length; nIndex++) {
// Get content detail if (contentIdArray[nIndex].contentid == outputId) {
HEADER.downloadResourceById(ClientData.contentInfo_contentId()); checkflag = true;
} if (contentIdArray[nIndex].viewdate == '' || contentIdArray[nIndex].viewdate == null || contentIdArray[nIndex].viewdate == 'undefined') {
else if(ClientData.contentInfo_contentType() == COMMON.ContentTypeKeys.Type_Link){ contentIdArray[nIndex].viewdate = outputDate;
// Get content detail contentIdArray[nIndex].originviewdate = date;
HEADER.viewLinkContentById(ClientData.contentInfo_contentId()); }
} break;
else { }
avwScreenMove(COMMON.ScreenIds.ContentView); else {
} checkflag = false;
}
}
if (!checkflag) {
contentIdArray.push({ contentid: outputId, viewdate: outputDate, originviewdate: date });
}
}
else {
contentIdArray.push({ contentid: outputId, viewdate: outputDate, originviewdate: date });
}
//Renew ReadingContentID
var newArray = [];
ClientData.ReadingContentIds(newArray);
//Set data for readingcontentid
ClientData.ReadingContentIds(contentIdArray);
//Set ResouceVersion for content
COMMON.setResourceVersionData(outputId);
//Set MetaVersion for content
COMMON.setMetaVersionData(outputId);
// Redirect to screen: contentview
//$('body,html').animate({ scrollTop: 0 }, 0);
ClientData.IsRefresh(false);
if (ClientData.contentInfo_contentType() == COMMON.ContentTypeKeys.Type_Others) {
// Get content detail
HEADER.downloadResourceById(ClientData.contentInfo_contentId());
}
else if(ClientData.contentInfo_contentType() == COMMON.ContentTypeKeys.Type_Link){
// Get content detail
HEADER.viewLinkContentById(ClientData.contentInfo_contentId());
}
else {
avwScreenMove(COMMON.ScreenIds.ContentView);
}
}; };
//Start Function : No.12 -- Editor : Viet Nguyen -- Date : 08/01/2013 -- Summary : Create new function to return content type of content. //Start Function : No.12 -- Editor : Viet Nguyen -- Date : 08/01/2013 -- Summary : Create new function to return content type of content.
///* get url */ DETAIL.showContentNotPDF = function(contentTitle, contentDetail, contentThumbnail, deliveryDate) {
//function getURL(apiName) {
// var sysSettings = avwSysSetting();
// var url = sysSettings.apiResourceDlUrl;
// url = AVWEB.format(url, ClientData.userInfo_accountPath()) + '/' + apiName;
// return url;
//};
//Check content type is pdf content
function isPdfContent(contentType){
if(!(contentType == COMMON.ContentTypeKeys.Type_PDF)){
return false;
}
else{
return true;
}
};
function ShowContentNotPDF(contentTitle, contentDetail, contentThumbnail, deliveryDate) {
$("#txtPubDt2_Dsp").text(deliveryDate.jpDateString() + " " + deliveryDate.jpShortTimeString()); $("#txtPubDt2_Dsp").text(deliveryDate.jpDateString() + " " + deliveryDate.jpShortTimeString());
$("#txtContentDetail").text(contentDetail); $("#txtContentDetail").text(contentDetail);
$("#txtContentTitle").text(contentTitle); $("#txtContentTitle").text(contentTitle);
...@@ -241,7 +204,7 @@ function ShowContentNotPDF(contentTitle, contentDetail, contentThumbnail, delive ...@@ -241,7 +204,7 @@ function ShowContentNotPDF(contentTitle, contentDetail, contentThumbnail, delive
var tempContentType = ClientData.contentInfo_contentType(); var tempContentType = ClientData.contentInfo_contentType();
if(contentThumbnail == '' || contentThumbnail == null || contentThumbnail == 'undefined'){ if(contentThumbnail == '' || contentThumbnail == null || contentThumbnail == 'undefined'){
if(!isPdfContent(tempContentType)){ if(!COMMON.isPdfContent(tempContentType)){
var src = HEADER.getThumbnailForOtherType(contentType); var src = HEADER.getThumbnailForOtherType(contentType);
if( src != '' ){ if( src != '' ){
contentThumbnail = src; contentThumbnail = src;
...@@ -280,7 +243,7 @@ function ShowContentNotPDF(contentTitle, contentDetail, contentThumbnail, delive ...@@ -280,7 +243,7 @@ function ShowContentNotPDF(contentTitle, contentDetail, contentThumbnail, delive
//End Function : No.12 -- Editor : Viet Nguyen -- Date : 08/01/2013 -- Summary : Create new function to return content type of content. //End Function : No.12 -- Editor : Viet Nguyen -- Date : 08/01/2013 -- Summary : Create new function to return content type of content.
// Show detail content // Show detail content
function ShowContent(contentID, contentTitle, contentDetail, contentThumbnail, deliveryDate, pages) { DETAIL.showContent = function(contentID, contentTitle, contentDetail, contentThumbnail, deliveryDate, pages) {
$("#txtPubDt2_Dsp").text(deliveryDate.jpDateString() + " " + deliveryDate.jpShortTimeString()); $("#txtPubDt2_Dsp").text(deliveryDate.jpDateString() + " " + deliveryDate.jpShortTimeString());
$("#txtContentDetail").text(contentDetail); $("#txtContentDetail").text(contentDetail);
$("#txtContentTitle").text(contentTitle); $("#txtContentTitle").text(contentTitle);
...@@ -315,12 +278,11 @@ function ShowContent(contentID, contentTitle, contentDetail, contentThumbnail, d ...@@ -315,12 +278,11 @@ function ShowContent(contentID, contentTitle, contentDetail, contentThumbnail, d
// Show pages // Show pages
for (var nIndex = 0; nIndex < pages.length; nIndex++) { for (var nIndex = 0; nIndex < pages.length; nIndex++) {
//insertRow(imgSample, pages[nIndex].pageText, pages[nIndex].pageNo); //insertRow(imgSample, pages[nIndex].pageText, pages[nIndex].pageNo);
insertRow(pages[nIndex].pageThumbnail, COMMON.truncate(COMMON.getLines(pages[nIndex].pageText, 3), 45), pages[nIndex].pageNo); //55 DETAIL.insertRow(pages[nIndex].pageThumbnail, COMMON.truncate(COMMON.getLines(pages[nIndex].pageText, 3), 45), pages[nIndex].pageNo); //55
} }
}; };
DETAIL.insertRow = function(pageThumbnail, pageText, pageNo) {
function insertRow(pageThumbnail, pageText, pageNo) {
var newRow = ""; var newRow = "";
newRow += "<ul>"; newRow += "<ul>";
newRow += '<li class="list_img"><img src="' + pageThumbnail + '" alt="" width="90" /></li>'; newRow += '<li class="list_img"><img src="' + pageThumbnail + '" alt="" width="90" /></li>';
...@@ -352,162 +314,24 @@ function insertRow(pageThumbnail, pageText, pageNo) { ...@@ -352,162 +314,24 @@ function insertRow(pageThumbnail, pageText, pageNo) {
imgTemp.src = pageThumbnail; imgTemp.src = pageThumbnail;
}; };
function insertRow1(pageThumbnail, pageText, pageNo) {
var newRow = "";
newRow += "<tr>";
newRow += "<td id='left'>";
newRow += '<img src="' + pageThumbnail;
newRow += '" id="imgPageThumbnail" alt="" width="50" height="50"/>';
newRow += "</td>";
newRow += "<td>";
newRow += '<div><label id="Label1">' + pageText + '</label></div>';
newRow += '<div><label id="Label2" class="lang" lang="txtPage">ページ:</label><label id="Label3">' + pageNo + '</label></div>';
newRow += "</td>";
newRow += "</tr>";
$('#contentdetail_grid tr:last').after(newRow);
//changeLanguage(ClientData.userInfo_language());
I18N.i18nReplaceText();
};
//set resource version data
function setResourceVersionData(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 < resourceVersionArr.length; i++){
if(resourceVersionArr[i].contentid == conId){
tempResource = 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
function setMetaVersionData(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 < metaVersionArr.length; i++){
if(metaVersionArr[i].contentid == conId){
tempMeta = 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);
};
function formatNormalDate(day, month, year) {
var outputDate = year + '/' + (('' + month).length < 2 ? '0' : '') + month + '/' + (('' + day).length < 2 ? '0' : '') + day;
return outputDate;
};
//function contentdetail_dspBack_Click() {
//parent.history.back();
//$(this).parent().parent().parent().parent().parent().parent().parent().hide();
//$(this).parent().parent().parent().parent().parent().parent().parent().dialog('close');
//}
/* /*
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
Event groups [ end ] Event groups [ end ]
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
*/ */
/* /*
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
Setting dialog [start] Setting dialog [start]
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
*/ */
$(function () {
});
/* /*
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
Setting dialog [ end ] Setting dialog [ end ]
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
*/ */
//function truncate(strInput, length){
// if (strInput.length <= length) DETAIL.resetLoadingImageSize = function(){
// {
// return strInput;
// }
// else
// {
// return strInput.substring(0, length) + "...";
// }
//};
function resetLoadingImageSize(){
$("#imgContentThumbnail").attr('height','25px'); $("#imgContentThumbnail").attr('height','25px');
$("#imgContentThumbnail").attr('width','25px'); $("#imgContentThumbnail").attr('width','25px');
}; };
...@@ -32,8 +32,8 @@ var contentTypeArr = []; ...@@ -32,8 +32,8 @@ var contentTypeArr = [];
//}; //};
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Create new Array for function No.12. //End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Create new Array for function No.12.
var contentIdArray = []; var contentIdArray = [];
var resourceVersionArr = []; //var resourceVersionArr = [];
var metaVersionArr = []; //var metaVersionArr = [];
var totalPage; var totalPage;
var contentViewData = []; var contentViewData = [];
var noRecordFlg = false; var noRecordFlg = false;
...@@ -143,7 +143,7 @@ function renderContent(id, text, division, type, order, from, to, cateid, grpid) ...@@ -143,7 +143,7 @@ function renderContent(id, text, division, type, order, from, to, cateid, grpid)
for (var i = 0; i < data.contentList.length; i++) { for (var i = 0; i < data.contentList.length; i++) {
post = data.contentList[i]; post = data.contentList[i];
var outputDate = formatDeliveryDate(post.contentDeliveryDate); var outputDate = COMMON.formatDeliveryDate(post.contentDeliveryDate);
//renderViewDate //renderViewDate
var viewdate = renderViewDate(post.contentId); var viewdate = renderViewDate(post.contentId);
...@@ -221,7 +221,7 @@ function renderContent(id, text, division, type, order, from, to, cateid, grpid) ...@@ -221,7 +221,7 @@ function renderContent(id, text, division, type, order, from, to, cateid, grpid)
//assign thumbnail to array //assign thumbnail to array
var formatThumbnail = post.contentThumbnail; var formatThumbnail = post.contentThumbnail;
if((formatThumbnail != null) && (formatThumbnail != 'undefined') && (formatThumbnail != '')){ if((formatThumbnail != null) && (formatThumbnail != 'undefined') && (formatThumbnail != '')){
formatThumbnail = formatStringBase64(formatThumbnail); formatThumbnail = COMMON.formatStringBase64(formatThumbnail);
} }
thumbnailArr.push({ contentId: post.contentId, thumbnail: formatThumbnail}); thumbnailArr.push({ contentId: post.contentId, thumbnail: formatThumbnail});
...@@ -235,10 +235,10 @@ function renderContent(id, text, division, type, order, from, to, cateid, grpid) ...@@ -235,10 +235,10 @@ function renderContent(id, text, division, type, order, from, to, cateid, grpid)
checkUserHasReadContent(post.contentId, post.resourceVersion, post.metaVersion); checkUserHasReadContent(post.contentId, post.resourceVersion, post.metaVersion);
//assign version to array //assign version to array
resourceVersionArr.push({ contentid: post.contentId, resourceversion: post.resourceVersion }); COMMON.resourceVersionArr.push({ contentid: post.contentId, resourceversion: post.resourceVersion });
//assign meta version to array //assign meta version to array
metaVersionArr.push({ contentid: post.contentId, metaversion: post.metaVersion }); COMMON.metaVersionArr.push({ contentid: post.contentId, metaversion: post.metaVersion });
//Check if content has marking or memo //Check if content has marking or memo
checkContentMarkingMemoOption(post.contentId); checkContentMarkingMemoOption(post.contentId);
...@@ -414,16 +414,16 @@ function canvasClickFunction(e){ ...@@ -414,16 +414,16 @@ function canvasClickFunction(e){
ClientData.ReadingContentIds(contentIdArray); ClientData.ReadingContentIds(contentIdArray);
//Set ResouceVersion for content //Set ResouceVersion for content
setResourceVersionData(outputId); COMMON.setResourceVersionData(outputId);
//Set MetaVersion for content //Set MetaVersion for content
setMetaVersionData(outputId); COMMON.setMetaVersionData(outputId);
//Delete 'new' icon //Delete 'new' icon
drawEditImage(outputId); drawEditImage(outputId);
//Open content Detail //Open content Detail
openContentDetail(); DETAIL.openContentDetail();
}; };
//Re-render page from and total record //Re-render page from and total record
...@@ -714,16 +714,6 @@ function returnContentType(contentid){ ...@@ -714,16 +714,6 @@ function returnContentType(contentid){
} }
}; };
//Check content type is pdf content
function isPdfContent(contentType){
if(!(contentType == COMMON.ContentTypeKeys.Type_PDF)){
return false;
}
else{
return true;
}
};
////Get resource Id of content ////Get resource Id of content
//function downloadResourceById(contentId){ //function downloadResourceById(contentId){
// var params = { // var params = {
...@@ -800,7 +790,7 @@ function readSubmenuFunction_callback(contentId) ...@@ -800,7 +790,7 @@ function readSubmenuFunction_callback(contentId)
var month = date.getMonth()+1; var month = date.getMonth()+1;
var day = date.getDate(); var day = date.getDate();
var outputDate = formatNormalDate(day, month, date.getFullYear()); var outputDate = COMMON.formatNormalDate(day, month, date.getFullYear());
ClientData.contentInfo_contentId(contentId); ClientData.contentInfo_contentId(contentId);
ClientData.contentInfo_contentThumbnail(contentThumbnail); ClientData.contentInfo_contentThumbnail(contentThumbnail);
...@@ -842,10 +832,10 @@ function readSubmenuFunction_callback(contentId) ...@@ -842,10 +832,10 @@ function readSubmenuFunction_callback(contentId)
ClientData.ReadingContentIds(newArray); ClientData.ReadingContentIds(newArray);
//Set ResouceVersion for content //Set ResouceVersion for content
setResourceVersionData(contentId); COMMON.setResourceVersionData(contentId);
//Set MetaVersion for content //Set MetaVersion for content
setMetaVersionData(contentId); COMMON.setMetaVersionData(contentId);
//Set data for readingcontentid //Set data for readingcontentid
ClientData.ReadingContentIds(contentIdArray); ClientData.ReadingContentIds(contentIdArray);
...@@ -951,7 +941,7 @@ function checkUserHasReadContent(contId, resourceVer, metaVer){ ...@@ -951,7 +941,7 @@ function checkUserHasReadContent(contId, resourceVer, metaVer){
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail. //Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){ if(contentThumbnail == '' || contentThumbnail == null){
if(!isPdfContent(contentType)){ if(!COMMON.isPdfContent(contentType)){
var src = HEADER.getThumbnailForOtherType(contentType); var src = HEADER.getThumbnailForOtherType(contentType);
if( src != '' ){ if( src != '' ){
imgThumb.src = src; imgThumb.src = src;
...@@ -975,7 +965,7 @@ function checkUserHasReadContent(contId, resourceVer, metaVer){ ...@@ -975,7 +965,7 @@ function checkUserHasReadContent(contId, resourceVer, metaVer){
}; };
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail. //Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){ if(contentThumbnail == '' || contentThumbnail == null){
if(!isPdfContent(contentType)){ if(!COMMON.isPdfContent(contentType)){
var src = HEADER.getThumbnailForOtherType(contentType); var src = HEADER.getThumbnailForOtherType(contentType);
if( src != '' ){ if( src != '' ){
imgThumb.src = src; imgThumb.src = src;
...@@ -1001,7 +991,7 @@ function checkUserHasReadContent(contId, resourceVer, metaVer){ ...@@ -1001,7 +991,7 @@ function checkUserHasReadContent(contId, resourceVer, metaVer){
}; };
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail. //Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){ if(contentThumbnail == '' || contentThumbnail == null){
if(!isPdfContent(contentType)){ if(!COMMON.isPdfContent(contentType)){
var src = HEADER.getThumbnailForOtherType(contentType); var src = HEADER.getThumbnailForOtherType(contentType);
if( src != '' ){ if( src != '' ){
imgThumb.src = src; imgThumb.src = src;
...@@ -1035,7 +1025,7 @@ function checkUserHasReadContent(contId, resourceVer, metaVer){ ...@@ -1035,7 +1025,7 @@ function checkUserHasReadContent(contId, resourceVer, metaVer){
}; };
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail. //Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){ if(contentThumbnail == '' || contentThumbnail == null){
if(!isPdfContent(contentType)){ if(!COMMON.isPdfContent(contentType)){
var src = HEADER.getThumbnailForOtherType(contentType); var src = HEADER.getThumbnailForOtherType(contentType);
if( src != '' ){ if( src != '' ){
imgThumb.src = src; imgThumb.src = src;
...@@ -1069,7 +1059,7 @@ function checkUserHasReadContent(contId, resourceVer, metaVer){ ...@@ -1069,7 +1059,7 @@ function checkUserHasReadContent(contId, resourceVer, metaVer){
}; };
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail. //Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){ if(contentThumbnail == '' || contentThumbnail == null){
if(!isPdfContent(contentType)){ if(!COMMON.isPdfContent(contentType)){
var src = HEADER.getThumbnailForOtherType(contentType); var src = HEADER.getThumbnailForOtherType(contentType);
if( src != '' ){ if( src != '' ){
imgThumb.src = src; imgThumb.src = src;
...@@ -1253,33 +1243,6 @@ function handleSortDisp(){ ...@@ -1253,33 +1243,6 @@ function handleSortDisp(){
} }
}; };
//convert delivery Date
function formatDeliveryDate(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
function formatNormalDate(day, month, year){
var outputDate = year + '/' + ((''+month).length<2 ? '0' : '') + month + '/' + ((''+day).length<2 ? '0' : '') + day;
return outputDate;
};
//format Image string
function formatStringBase64(imgStr){
var outputString = 'data:image/jpeg;base64,'+imgStr;
return outputString;
};
//function Open SubMenu Dialog //function Open SubMenu Dialog
function titleClickFunction(e){ function titleClickFunction(e){
if (e) { if (e) {
...@@ -1331,16 +1294,16 @@ function titleClickFunction(e){ ...@@ -1331,16 +1294,16 @@ function titleClickFunction(e){
ClientData.ReadingContentIds(contentIdArray); ClientData.ReadingContentIds(contentIdArray);
//Set ResouceVersion for content //Set ResouceVersion for content
setResourceVersionData(contentid); COMMON.setResourceVersionData(contentid);
//Set MetaVersion for content //Set MetaVersion for content
setMetaVersionData(contentid); COMMON.setMetaVersionData(contentid);
//Delete 'new' icon //Delete 'new' icon
drawEditImage(contentid); drawEditImage(contentid);
//Open content Detail //Open content Detail
openContentDetail(); DETAIL.openContentDetail();
}; };
//refresh sort order //refresh sort order
...@@ -1422,11 +1385,11 @@ function addReadContentToArray(strContentId, strResourceVersion, strMetaVersion, ...@@ -1422,11 +1385,11 @@ function addReadContentToArray(strContentId, strResourceVersion, strMetaVersion,
} }
if(!flag){ if(!flag){
contentViewData.push({contentid: strContentId, originviewdate: formatDate(returnOriginalViewDate(strContentId)), contenttitle: strTitle, contenttitlekana: strTitleKana, deliverydate: strDelivDate, resourceversion: strResourceVersion, metaversion: strMetaVersion, thumbnail: formatStringBase64(strThumbnail),contenttype:contentType }); contentViewData.push({contentid: strContentId, originviewdate: formatDate(returnOriginalViewDate(strContentId)), contenttitle: strTitle, contenttitlekana: strTitleKana, deliverydate: strDelivDate, resourceversion: strResourceVersion, metaversion: strMetaVersion, thumbnail: COMMON.formatStringBase64(strThumbnail),contenttype:contentType });
} }
}else{ }else{
contentViewData.push({contentid: strContentId, originviewdate: formatDate(returnOriginalViewDate(strContentId)), contenttitle: strTitle, contenttitlekana: strTitleKana, deliverydate: strDelivDate, resourceversion: strResourceVersion, metaversion: strMetaVersion, thumbnail: formatStringBase64(strThumbnail),contenttype:contentType }); contentViewData.push({contentid: strContentId, originviewdate: formatDate(returnOriginalViewDate(strContentId)), contenttitle: strTitle, contenttitlekana: strTitleKana, deliverydate: strDelivDate, resourceversion: strResourceVersion, metaversion: strMetaVersion, thumbnail: COMMON.formatStringBase64(strThumbnail),contenttype:contentType });
} }
}; };
...@@ -1644,7 +1607,7 @@ function renderContentAfterSort(contentSortArr){ ...@@ -1644,7 +1607,7 @@ function renderContentAfterSort(contentSortArr){
for(var i = 0; i < contentSortArr.length; i++) { for(var i = 0; i < contentSortArr.length; i++) {
post = contentSortArr[i]; post = contentSortArr[i];
var outputDeliveryDate = formatDeliveryDate(post.deliverydate); var outputDeliveryDate = COMMON.formatDeliveryDate(post.deliverydate);
/*htmlTemp += '<section class="sectionhistory">' /*htmlTemp += '<section class="sectionhistory">'
+ ' <div class="cnt_section">' + ' <div class="cnt_section">'
+ ' <a class="img">' + ' <a class="img">'
......
...@@ -20,8 +20,8 @@ HOME.thumbnailArr = []; ...@@ -20,8 +20,8 @@ HOME.thumbnailArr = [];
HOME.contentTypeArr = []; HOME.contentTypeArr = [];
HOME.contentIdArray = []; HOME.contentIdArray = [];
HOME.resourceVersionArr = []; //HOME.resourceVersionArr = [];
HOME.metaVersionArr = []; //HOME.metaVersionArr = [];
HOME.errorPage = []; HOME.errorPage = [];
HOME.errorContent = []; HOME.errorContent = [];
HOME.dataGroup; HOME.dataGroup;
...@@ -460,7 +460,7 @@ HOME.canvasClickFunction_callback = function(outputId) ...@@ -460,7 +460,7 @@ HOME.canvasClickFunction_callback = function(outputId)
var date = new Date(); var date = new Date();
var month = date.getMonth() + 1; var month = date.getMonth() + 1;
var day = date.getDate(); var day = date.getDate();
var outputDate = HOME.formatNormalDate(day, month, date.getFullYear()); var outputDate = COMMON.formatNormalDate(day, month, date.getFullYear());
var checkflag = false; var checkflag = false;
var base64String = HOME.returnThumbnail(outputId); var base64String = HOME.returnThumbnail(outputId);
...@@ -509,10 +509,10 @@ HOME.canvasClickFunction_callback = function(outputId) ...@@ -509,10 +509,10 @@ HOME.canvasClickFunction_callback = function(outputId)
ClientData.ReadingContentIds(HOME.contentIdArray); ClientData.ReadingContentIds(HOME.contentIdArray);
//Set ResouceVersion for content //Set ResouceVersion for content
HOME.setResourceVersionData(outputId); COMMON.setResourceVersionData(outputId);
//Set MetaVersion for content //Set MetaVersion for content
HOME.setMetaVersionData(outputId); COMMON.setMetaVersionData(outputId);
//Close Submenu //Close Submenu
$('#dlgSubMenu').hide(); $('#dlgSubMenu').hide();
...@@ -521,7 +521,7 @@ HOME.canvasClickFunction_callback = function(outputId) ...@@ -521,7 +521,7 @@ HOME.canvasClickFunction_callback = function(outputId)
HOME.drawEditImage(outputId); HOME.drawEditImage(outputId);
//Open content Detail //Open content Detail
openContentDetail(); DETAIL.openContentDetail();
} }
else { else {
...@@ -559,10 +559,10 @@ HOME.canvasClickFunction_callback = function(outputId) ...@@ -559,10 +559,10 @@ HOME.canvasClickFunction_callback = function(outputId)
ClientData.ReadingContentIds(HOME.contentIdArray); ClientData.ReadingContentIds(HOME.contentIdArray);
//Set ResouceVersion for content //Set ResouceVersion for content
HOME.setResourceVersionData(outputId); COMMON.setResourceVersionData(outputId);
//Set MetaVersion for content //Set MetaVersion for content
HOME.setMetaVersionData(outputId); COMMON.setMetaVersionData(outputId);
//$('body,html').animate({ scrollTop: 0 }, 0); //$('body,html').animate({ scrollTop: 0 }, 0);
ClientData.IsRefresh(false); ClientData.IsRefresh(false);
...@@ -620,10 +620,10 @@ HOME.canvasClickFunction_callback = function(outputId) ...@@ -620,10 +620,10 @@ HOME.canvasClickFunction_callback = function(outputId)
ClientData.ReadingContentIds(HOME.contentIdArray); ClientData.ReadingContentIds(HOME.contentIdArray);
//Set ResouceVersion for content //Set ResouceVersion for content
HOME.setResourceVersionData(outputId); COMMON.setResourceVersionData(outputId);
//Set MetaVersion for content //Set MetaVersion for content
HOME.setMetaVersionData(outputId); COMMON.setMetaVersionData(outputId);
//Close Submenu //Close Submenu
$('#dlgSubMenu').hide(); $('#dlgSubMenu').hide();
...@@ -632,7 +632,7 @@ HOME.canvasClickFunction_callback = function(outputId) ...@@ -632,7 +632,7 @@ HOME.canvasClickFunction_callback = function(outputId)
HOME.drawEditImage(outputId); HOME.drawEditImage(outputId);
//Open content Detail //Open content Detail
openContentDetail(); DETAIL.openContentDetail();
} }
else { else {
...@@ -670,10 +670,10 @@ HOME.canvasClickFunction_callback = function(outputId) ...@@ -670,10 +670,10 @@ HOME.canvasClickFunction_callback = function(outputId)
ClientData.ReadingContentIds(HOME.contentIdArray); ClientData.ReadingContentIds(HOME.contentIdArray);
//Set ResouceVersion for content //Set ResouceVersion for content
HOME.setResourceVersionData(outputId); COMMON.setResourceVersionData(outputId);
//Set MetaVersion for content //Set MetaVersion for content
HOME.setMetaVersionData(outputId); COMMON.setMetaVersionData(outputId);
//$('body,html').animate({ scrollTop: 0 }, 0); //$('body,html').animate({ scrollTop: 0 }, 0);
ClientData.IsRefresh(false); ClientData.IsRefresh(false);
...@@ -757,10 +757,10 @@ HOME.openSubMenuDialogFunction = function(e) { ...@@ -757,10 +757,10 @@ HOME.openSubMenuDialogFunction = function(e) {
ClientData.ReadingContentIds(HOME.contentIdArray); ClientData.ReadingContentIds(HOME.contentIdArray);
//Set ResouceVersion for content //Set ResouceVersion for content
HOME.setResourceVersionData(contentid); COMMON.setResourceVersionData(contentid);
//Set MetaVersion for content //Set MetaVersion for content
HOME.setMetaVersionData(contentid); COMMON.setMetaVersionData(contentid);
//Close Submenu //Close Submenu
$('#dlgSubMenu').hide(); $('#dlgSubMenu').hide();
...@@ -768,7 +768,7 @@ HOME.openSubMenuDialogFunction = function(e) { ...@@ -768,7 +768,7 @@ HOME.openSubMenuDialogFunction = function(e) {
//Delete 'new' icon //Delete 'new' icon
HOME.drawEditImage(contentid); HOME.drawEditImage(contentid);
openContentDetail(); DETAIL.openContentDetail();
} }
else if (HOME.isShowBookShelf) { else if (HOME.isShowBookShelf) {
...@@ -838,10 +838,10 @@ HOME.openSubMenuDialogFunction = function(e) { ...@@ -838,10 +838,10 @@ HOME.openSubMenuDialogFunction = function(e) {
ClientData.ReadingContentIds(HOME.contentIdArray); ClientData.ReadingContentIds(HOME.contentIdArray);
//Set ResouceVersion for content //Set ResouceVersion for content
HOME.setResourceVersionData(contentid); COMMON.setResourceVersionData(contentid);
//Set MetaVersion for content //Set MetaVersion for content
HOME.setMetaVersionData(contentid); COMMON.setMetaVersionData(contentid);
//Close Submenu //Close Submenu
$('#dlgSubMenu').hide(); $('#dlgSubMenu').hide();
...@@ -849,7 +849,7 @@ HOME.openSubMenuDialogFunction = function(e) { ...@@ -849,7 +849,7 @@ HOME.openSubMenuDialogFunction = function(e) {
//Delete 'new' icon //Delete 'new' icon
HOME.drawEditImage(contentid); HOME.drawEditImage(contentid);
openContentDetail(); DETAIL.openContentDetail();
} }
else if (HOME.isShowBookShelf) { else if (HOME.isShowBookShelf) {
...@@ -1363,10 +1363,10 @@ HOME.detailsSubmenuFunction = function(e) { ...@@ -1363,10 +1363,10 @@ HOME.detailsSubmenuFunction = function(e) {
ClientData.ReadingContentIds(HOME.contentIdArray); ClientData.ReadingContentIds(HOME.contentIdArray);
//Set ResouceVersion for content //Set ResouceVersion for content
HOME.setResourceVersionData(contentId); COMMON.setResourceVersionData(contentId);
//Set MetaVersion for content //Set MetaVersion for content
HOME.setMetaVersionData(contentId); COMMON.setMetaVersionData(contentId);
// Close popup menu // Close popup menu
$('#dlgSubMenu').hide(); $('#dlgSubMenu').hide();
...@@ -1375,7 +1375,7 @@ HOME.detailsSubmenuFunction = function(e) { ...@@ -1375,7 +1375,7 @@ HOME.detailsSubmenuFunction = function(e) {
HOME.drawEditImage(contentId); HOME.drawEditImage(contentId);
// Show detail // Show detail
openContentDetail(); DETAIL.openContentDetail();
}; };
//Dialog Read Button CLick //Dialog Read Button CLick
...@@ -1415,7 +1415,7 @@ HOME.readSubmenuFunction_callback = function(contentId) ...@@ -1415,7 +1415,7 @@ HOME.readSubmenuFunction_callback = function(contentId)
var month = date.getMonth() + 1; var month = date.getMonth() + 1;
var day = date.getDate(); var day = date.getDate();
var outputDate = HOME.formatNormalDate(day, month, date.getFullYear()); var outputDate = COMMON.formatNormalDate(day, month, date.getFullYear());
ClientData.contentInfo_contentId(contentId); ClientData.contentInfo_contentId(contentId);
ClientData.contentInfo_contentThumbnail(contentThumbnail); ClientData.contentInfo_contentThumbnail(contentThumbnail);
...@@ -1458,10 +1458,10 @@ HOME.readSubmenuFunction_callback = function(contentId) ...@@ -1458,10 +1458,10 @@ HOME.readSubmenuFunction_callback = function(contentId)
ClientData.ReadingContentIds(newArray); ClientData.ReadingContentIds(newArray);
//Set ResouceVersion for content //Set ResouceVersion for content
HOME.setResourceVersionData(contentId); COMMON.setResourceVersionData(contentId);
//Set MetaVersion for content //Set MetaVersion for content
HOME.setMetaVersionData(contentId); COMMON.setMetaVersionData(contentId);
//Set data for readingcontentid //Set data for readingcontentid
ClientData.ReadingContentIds(HOME.contentIdArray); ClientData.ReadingContentIds(HOME.contentIdArray);
...@@ -1778,7 +1778,7 @@ HOME.renderContent = function(id, text, division, type, order, from, to, cateid, ...@@ -1778,7 +1778,7 @@ HOME.renderContent = function(id, text, division, type, order, from, to, cateid,
$.each(data.contentList, function (i, post) { $.each(data.contentList, function (i, post) {
var outputDate = HOME.formatDeliveryDate(post.contentDeliveryDate); var outputDate = COMMON.formatDeliveryDate(post.contentDeliveryDate);
if (HOME.isShowBookShelf == null) { if (HOME.isShowBookShelf == null) {
if (ClientData.sortOpt_viewMode() == COMMON.Consts.ConstDisplayMode_BookShelf) { if (ClientData.sortOpt_viewMode() == COMMON.Consts.ConstDisplayMode_BookShelf) {
...@@ -1904,7 +1904,7 @@ HOME.renderContent = function(id, text, division, type, order, from, to, cateid, ...@@ -1904,7 +1904,7 @@ HOME.renderContent = function(id, text, division, type, order, from, to, cateid,
//assign thumbnail to array //assign thumbnail to array
var formatThumbnail = post.contentThumbnail; var formatThumbnail = post.contentThumbnail;
if((formatThumbnail != null) && (formatThumbnail != 'undefined') && (formatThumbnail != '')){ if((formatThumbnail != null) && (formatThumbnail != 'undefined') && (formatThumbnail != '')){
formatThumbnail = HOME.formatStringBase64(formatThumbnail); formatThumbnail = COMMON.formatStringBase64(formatThumbnail);
} }
HOME.thumbnailArr.push({ contentId: post.contentId, thumbnail: formatThumbnail}); HOME.thumbnailArr.push({ contentId: post.contentId, thumbnail: formatThumbnail});
...@@ -1920,10 +1920,10 @@ HOME.renderContent = function(id, text, division, type, order, from, to, cateid, ...@@ -1920,10 +1920,10 @@ HOME.renderContent = function(id, text, division, type, order, from, to, cateid,
//Check if user has read this content or not. //Check if user has read this content or not.
HOME.checkUserHasReadContent(post.contentId, post.resourceVersion, post.metaVersion); HOME.checkUserHasReadContent(post.contentId, post.resourceVersion, post.metaVersion);
//assign version to array //assign version to array
HOME.resourceVersionArr.push({ contentid: post.contentId, resourceversion: post.resourceVersion }); COMMON.resourceVersionArr.push({ contentid: post.contentId, resourceversion: post.resourceVersion });
//assign meta version to array //assign meta version to array
HOME.metaVersionArr.push({ contentid: post.contentId, metaversion: post.metaVersion }); COMMON.metaVersionArr.push({ contentid: post.contentId, metaversion: post.metaVersion });
//Check if content has marking or memo //Check if content has marking or memo
HOME.checkContentMarkingMemoOption(post.contentId); HOME.checkContentMarkingMemoOption(post.contentId);
...@@ -2043,16 +2043,6 @@ HOME.returnContentType = function(contentid){ ...@@ -2043,16 +2043,6 @@ HOME.returnContentType = function(contentid){
} }
}; };
//Check content type is pdf content
HOME.isPdfContent = function(contentType){
if(!(contentType == COMMON.ContentTypeKeys.Type_PDF)){
return false;
}
else{
return true;
}
};
//function createIframeForDownload(url){ //function createIframeForDownload(url){
//}; //};
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Create new function to return content type of content. //End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Create new function to return content type of content.
...@@ -2137,7 +2127,7 @@ HOME.checkUserHasReadContent = function(contId, resourceVer, metaVer) { ...@@ -2137,7 +2127,7 @@ HOME.checkUserHasReadContent = function(contId, resourceVer, metaVer) {
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail. //Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){ if(contentThumbnail == '' || contentThumbnail == null){
if(!HOME.isPdfContent(contentType)){ if(!COMMON.isPdfContent(contentType)){
var src = HEADER.getThumbnailForOtherType(contentType); var src = HEADER.getThumbnailForOtherType(contentType);
if( src != '' ){ if( src != '' ){
imgThumb.src = src; imgThumb.src = src;
...@@ -2163,7 +2153,7 @@ HOME.checkUserHasReadContent = function(contId, resourceVer, metaVer) { ...@@ -2163,7 +2153,7 @@ HOME.checkUserHasReadContent = function(contId, resourceVer, metaVer) {
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail. //Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){ if(contentThumbnail == '' || contentThumbnail == null){
if(!HOME.isPdfContent(contentType)){ if(!COMMON.isPdfContent(contentType)){
var src = HEADER.getThumbnailForOtherType(contentType); var src = HEADER.getThumbnailForOtherType(contentType);
if( src != '' ){ if( src != '' ){
imgThumb.src = src; imgThumb.src = src;
...@@ -2192,7 +2182,7 @@ HOME.checkUserHasReadContent = function(contId, resourceVer, metaVer) { ...@@ -2192,7 +2182,7 @@ HOME.checkUserHasReadContent = function(contId, resourceVer, metaVer) {
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail. //Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){ if(contentThumbnail == '' || contentThumbnail == null){
if(!HOME.isPdfContent(contentType)){ if(!COMMON.isPdfContent(contentType)){
var src = HEADER.getThumbnailForOtherType(contentType); var src = HEADER.getThumbnailForOtherType(contentType);
if( src != '' ){ if( src != '' ){
imgThumb.src = src; imgThumb.src = src;
...@@ -2230,7 +2220,7 @@ HOME.checkUserHasReadContent = function(contId, resourceVer, metaVer) { ...@@ -2230,7 +2220,7 @@ HOME.checkUserHasReadContent = function(contId, resourceVer, metaVer) {
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail. //Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){ if(contentThumbnail == '' || contentThumbnail == null){
if(!HOME.isPdfContent(contentType)){ if(!COMMON.isPdfContent(contentType)){
var src = HEADER.getThumbnailForOtherType(contentType); var src = HEADER.getThumbnailForOtherType(contentType);
if( src != '' ){ if( src != '' ){
imgThumb.src = src; imgThumb.src = src;
...@@ -2267,7 +2257,7 @@ HOME.checkUserHasReadContent = function(contId, resourceVer, metaVer) { ...@@ -2267,7 +2257,7 @@ HOME.checkUserHasReadContent = function(contId, resourceVer, metaVer) {
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail. //Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){ if(contentThumbnail == '' || contentThumbnail == null){
if(!HOME.isPdfContent(contentType)){ if(!COMMON.isPdfContent(contentType)){
var src = HEADER.getThumbnailForOtherType(contentType); var src = HEADER.getThumbnailForOtherType(contentType);
if( src != '' ){ if( src != '' ){
imgThumb.src = src; imgThumb.src = src;
...@@ -2330,95 +2320,6 @@ HOME.renderViewDate = function(id) { ...@@ -2330,95 +2320,6 @@ HOME.renderViewDate = function(id) {
} }
}; };
//set resource version data
HOME.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 < HOME.resourceVersionArr.length; i++) {
if (HOME.resourceVersionArr[i].contentid == conId) {
tempResource = HOME.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
HOME.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 < HOME.metaVersionArr.length; i++) {
if (HOME.metaVersionArr[i].contentid == conId) {
tempMeta = HOME.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);
};
//handle display sort direction //handle display sort direction
HOME.handleSortDisp = function() { HOME.handleSortDisp = function() {
$('#control-sort-title').removeClass('active_tops'); $('#control-sort-title').removeClass('active_tops');
...@@ -2452,33 +2353,6 @@ HOME.handleSortDisp = function() { ...@@ -2452,33 +2353,6 @@ HOME.handleSortDisp = function() {
} }
}; };
//convert delivery Date
HOME.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
HOME.formatNormalDate = function(day, month, year) {
var outputDate = year + '/' + (('' + month).length < 2 ? '0' : '') + month + '/' + (('' + day).length < 2 ? '0' : '') + day;
return outputDate;
};
//format Image string
HOME.formatStringBase64 = function(imgStr) {
var outputString = 'data:image/jpeg;base64,' + imgStr;
return outputString;
};
//Get Number Disp Record For List //Get Number Disp Record For List
HOME.returnNumberDispRecordForBookShelf = function() { HOME.returnNumberDispRecordForBookShelf = function() {
var toPage = 0; var toPage = 0;
......
...@@ -443,51 +443,49 @@ LOGIN.saveServiceUserOption = function(){ ...@@ -443,51 +443,49 @@ LOGIN.saveServiceUserOption = function(){
$.each(LOGIN.optionList, function (i, option) { $.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); 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); ClientData.serviceOpt_force_pw_change_on_login(option.value);
} }
else if (option.serviceOptionId == 33) {
// 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') {
ClientData.serviceOpt_marking(option.value); ClientData.serviceOpt_marking(option.value);
} }
else if (option.serviceName == 'user_data_backup') { else if (option.serviceOptionId == 28) {
ClientData.serviceOpt_user_data_backup(option.value); 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); 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); 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); ClientData.serviceOpt_catalog_edition(option.value);
} }
else if( option.serviceName == 'hibiyakadan_catalog' ) { else if( option.serviceOptionId == 77) {
ClientData.serviceOpt_hibiyakadan_catalog(option.value); 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); 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); 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); 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); ClientData.serviceOpt_reader_readinglog_object(option.value);
} }
else if( option.serviceName == 'daihatsu' ) { else if( option.serviceOptionId == 87) {
ClientData.serviceOpt_daihatsu(option.value); ClientData.serviceOpt_daihatsu(option.value);
} }
else if( option.serviceOptionId == 78) {
ClientData.serviceOpt_content_share(option.value);
}
}); });
}; };
...@@ -496,19 +494,19 @@ LOGIN.getServiceOptionList = function(){ ...@@ -496,19 +494,19 @@ LOGIN.getServiceOptionList = function(){
$.each(LOGIN.optionList, function(i, option){ $.each(LOGIN.optionList, function(i, option){
if(option.serviceName == 'force_pw_change_periodically'){ if(option.serviceOptionId == 22){
LOGIN.force_pw_change_periodically = option.value; 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; 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; LOGIN.force_login_periodically = option.value;
} }
else if(option.serviceName == 'marking'){ else if(option.serviceOptionId == 33){
LOGIN.marking = option.value; LOGIN.marking = option.value;
} }
else if(option.serviceName == 'user_data_backup'){ else if(option.serviceOptionId == 28){
LOGIN.user_data_backup = option.value; 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