Commit f324e790 by Kim Gyeongeun

#32343 コンテンツダウンロード機能追加

parent 7d40f81d
...@@ -233,6 +233,8 @@ COMMON.Keys = { ...@@ -233,6 +233,8 @@ COMMON.Keys = {
serviceOpt_encryption : 'encryption', serviceOpt_encryption : 'encryption',
// Session :HTMLカスタムログ:Char(Y:可能, N:不可) // Session :HTMLカスタムログ:Char(Y:可能, N:不可)
serviceOpt_html_custom_log : 'html_custom_log', serviceOpt_html_custom_log : 'html_custom_log',
// Session :事業者オプション(serviceOpt)_印刷機能使用:Char(Y:可能, N:不可)
serviceOpt_air_print: 'air_print',
// Session :共通(common)_コンテンツID:Integer // Session :共通(common)_コンテンツID:Integer
common_contentId : 'common_contentId', common_contentId : 'common_contentId',
// Local :共通(common)_コンテンツID:Integer // Local :共通(common)_コンテンツID:Integer
...@@ -1306,6 +1308,15 @@ var ClientData = { ...@@ -1306,6 +1308,15 @@ var ClientData = {
return SessionStorageUtils.get(COMMON.Keys.serviceOpt_daihatsu); return SessionStorageUtils.get(COMMON.Keys.serviceOpt_daihatsu);
} }
}, },
// Session :事業者オプション(serviceOpt)_:印刷機能使用(Y:可能, N:不可)
serviceOpt_air_print: function (data) {
if (arguments.length > 0) {
SessionStorageUtils.set(COMMON.Keys.serviceOpt_air_print, data);
} else {
return SessionStorageUtils.get(COMMON.Keys.serviceOpt_air_print);
}
},
// Session :共通(common)_コンテンツID:Integer // Session :共通(common)_コンテンツID:Integer
common_contentId : function(data) { common_contentId : function(data) {
......
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
"txtGr":"Group", "txtGr":"Group",
"txtViewDt":"Accessed Date", "txtViewDt":"Accessed Date",
"txtDetailPage":"Detail", "txtDetailPage":"Detail",
"txtDownload":"Download",
"txtCtnNm":"Content Name", "txtCtnNm":"Content Name",
"txtTag":"Tag", "txtTag":"Tag",
"txtContTxt":"Body Text", "txtContTxt":"Body Text",
......
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
"txtGr":"グループ", "txtGr":"グループ",
"txtViewDt":"閲覧日", "txtViewDt":"閲覧日",
"txtDetailPage":"詳細画面", "txtDetailPage":"詳細画面",
"txtDownload":"ダウンロード",
"txtCtnNm":"コンテンツ名", "txtCtnNm":"コンテンツ名",
"txtTag":"タグ", "txtTag":"タグ",
"txtContTxt":"本文", "txtContTxt":"本文",
......
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
"txtGr":"그룹", "txtGr":"그룹",
"txtViewDt":"열람일", "txtViewDt":"열람일",
"txtDetailPage":"상세화면", "txtDetailPage":"상세화면",
"txtDownload":"다운로드",
"txtCtnNm":"제목", "txtCtnNm":"제목",
"txtTag":"태그", "txtTag":"태그",
"txtContTxt":"본문", "txtContTxt":"본문",
......
...@@ -181,7 +181,8 @@ ...@@ -181,7 +181,8 @@
<section id="dlgSubMenu"> <section id="dlgSubMenu">
<p class="dop_info"> <p class="dop_info">
<a href="#" class="lang" lang="txtRead" id="dialog-read"><!--読む--></a><br /> <a href="#" class="lang" lang="txtRead" id="dialog-read"><!--読む--></a><br />
<a href="#" class="lang" lang="txtDetailPage" id="dialog-detail"><!--詳細画面へ--></a></p> <a href="#" class="lang" lang="txtDetailPage" id="dialog-detail"><!--詳細画面へ--></a><br />
<a href="#" class="lang" style="display: none;" lang="txtDownload" id="downloadContent"><!--コンテンツをダウンロード--></a></p><br />
</section> </section>
<div id="dlgOverlay"> </div> <div id="dlgOverlay"> </div>
</div> </div>
......
...@@ -98,6 +98,11 @@ $(document).ready(function() { ...@@ -98,6 +98,11 @@ $(document).ready(function() {
$('.button-share').live('touchmove', function() { $('.button-share').live('touchmove', function() {
CONTENTSEARCH.home_isMove = true; CONTENTSEARCH.home_isMove = true;
}); });
//PDFファイルダウンロード
$('.button-download').live('click', CONTENTSEARCH.downloadPdfFunction);
$('.button-download').live('touchend', CONTENTSEARCH.downloadPdfFunction);
$('.button-download').live('touchmove', function () { CONTENTSEARCH.home_isMove = true; });
$('#main-search').click(CONTENTSEARCH.searchEventButtonFunction); $('#main-search').click(CONTENTSEARCH.searchEventButtonFunction);
$('#txtSearchWs').keydown(CONTENTSEARCH.mainSearchKeyDownFunction); $('#txtSearchWs').keydown(CONTENTSEARCH.mainSearchKeyDownFunction);
...@@ -248,7 +253,7 @@ CONTENTSEARCH.renderContent = function(id, text, division, type, order, offset, ...@@ -248,7 +253,7 @@ CONTENTSEARCH.renderContent = function(id, text, division, type, order, offset,
+ ' <ul class="pic">' + ' <ul class="pic">'
+ ' <li><img src="' + COMMON.DEFAULT_IMG_OPTION_MEMO + '" id="imgMemo' + post.contentId + '" class="sticker" /></li>' + ' <li><img src="' + COMMON.DEFAULT_IMG_OPTION_MEMO + '" id="imgMemo' + post.contentId + '" class="sticker" /></li>'
+ ' <li><img src="' + COMMON.DEFAULT_IMG_OPTION_MARKING + '" id="imgBookMark' + post.contentId + '" class="pen" /></li>' + ' <li><img src="' + COMMON.DEFAULT_IMG_OPTION_MARKING + '" id="imgBookMark' + post.contentId + '" class="pen" /></li>'
+ ' <li><ul class="iconList">{share}<li><a class="read lang button-details" contentid="' + post.contentId + '" lang="txtRead">読む</a></li></ul></li>' + ' <li><ul class="iconList">{download}{share}<li><a class="read lang button-details" contentid="' + post.contentId + '" lang="txtRead">読む</a></li></ul></li>'
+ ' </ul>' + ' </ul>'
+ ' </div>' + ' </div>'
+ ' </div>' + ' </div>'
...@@ -260,6 +265,12 @@ CONTENTSEARCH.renderContent = function(id, text, division, type, order, offset, ...@@ -260,6 +265,12 @@ CONTENTSEARCH.renderContent = function(id, text, division, type, order, offset,
shareHtml = '<li><a class="read lang button-share" contentid="' + post.contentId + '" lang="txtShare">共有</a></li>'; shareHtml = '<li><a class="read lang button-share" contentid="' + post.contentId + '" lang="txtShare">共有</a></li>';
} }
htmlTemp = htmlTemp.replace(/\{share\}/g, shareHtml); htmlTemp = htmlTemp.replace(/\{share\}/g, shareHtml);
var downloadHtml = "";
if( post.contentType == COMMON.ContentTypeKeys.Type_PDF && ClientData.serviceOpt_air_print() == 'Y' && post.printFlg == '1' ){
downloadHtml ='<li><a class="read lang button-download" contentid="' + post.contentId + '" lang="txtDownload">ダウンロード</a></li>';
}
htmlTemp = htmlTemp.replace(/\{download\}/g, downloadHtml);
$('#content-grid').append(htmlTemp); $('#content-grid').append(htmlTemp);
...@@ -1334,3 +1345,15 @@ CONTENTSEARCH.downloadSubmenuFunction = function(e) { ...@@ -1334,3 +1345,15 @@ CONTENTSEARCH.downloadSubmenuFunction = function(e) {
HEADER.downloadResourceById(contentId); HEADER.downloadResourceById(contentId);
}; };
CONTENTSEARCH.downloadPdfFunction = function(e){
if (e) {
e.preventDefault();
}
var contentId = $(this).attr('contentid');
// Download content
HEADER.downloadResourceById(contentId);
}
...@@ -1310,7 +1310,7 @@ HISTORY.renderContentAfterSort = function(contentSortArr) { ...@@ -1310,7 +1310,7 @@ HISTORY.renderContentAfterSort = function(contentSortArr) {
+ ' <ul class="pic">' + ' <ul class="pic">'
+ ' <li><img src="' + COMMON.DEFAULT_IMG_OPTION_MEMO + '" id="imgMemo' + post.contentid + '" class="sticker" /></li>' + ' <li><img src="' + COMMON.DEFAULT_IMG_OPTION_MEMO + '" id="imgMemo' + post.contentid + '" class="sticker" /></li>'
+ ' <li><img src="' + COMMON.DEFAULT_IMG_OPTION_MARKING + '" id="imgBookMark' + post.contentid + '" class="pen" /></li>' + ' <li><img src="' + COMMON.DEFAULT_IMG_OPTION_MARKING + '" id="imgBookMark' + post.contentid + '" class="pen" /></li>'
+ ' <li><ul class="iconList">{share}<li><a class="read lang button-details" contentid="' + post.contentid + '" lang="txtRead">' + I18N.i18nText("txtRead") + '</a></li></ul></li>' + ' <li><ul class="iconList">{download}{share}<li><a class="read lang button-details" contentid="' + post.contentid + '" lang="txtRead">' + I18N.i18nText("txtRead") + '</a></li></ul></li>'
+ ' </ul>' + ' </ul>'
+ ' </div>' + ' </div>'
+ ' </div>' + ' </div>'
...@@ -1322,6 +1322,11 @@ HISTORY.renderContentAfterSort = function(contentSortArr) { ...@@ -1322,6 +1322,11 @@ HISTORY.renderContentAfterSort = function(contentSortArr) {
shareHtml = '<li><a class="read lang button-share" contentid="' + post.contentid + '" lang="txtShare">' + I18N.i18nText("txtShare") + '</a></li>'; shareHtml = '<li><a class="read lang button-share" contentid="' + post.contentid + '" lang="txtShare">' + I18N.i18nText("txtShare") + '</a></li>';
} }
htmlTemp = htmlTemp.replace(/\{share\}/g, shareHtml); htmlTemp = htmlTemp.replace(/\{share\}/g, shareHtml);
var downloadHtml = "";
if(post.contenttype == COMMON.ContentTypeKeys.Type_PDF && ClientData.serviceOpt_air_print() == 'Y' && post.printFlg == '1'){
downloadHtml ='<li><a class="read lang button-download" contentid="' + post.contentid + '" lang="txtDownload">'+I18N.i18nText("txtDownload")+'</a></li>';
}
htmlTemp = htmlTemp.replace(/\{download\}/g, downloadHtml);
$('#content-grid').append(htmlTemp); $('#content-grid').append(htmlTemp);
var viewdate = HISTORY.renderViewDate(post.contentid, readArr); var viewdate = HISTORY.renderViewDate(post.contentid, readArr);
......
...@@ -127,6 +127,9 @@ $(document).ready(function() { ...@@ -127,6 +127,9 @@ $(document).ready(function() {
// Button Read on dialog click event // Button Read on dialog click event
$('#dialog-read').click(HOME.readSubmenuFunction); $('#dialog-read').click(HOME.readSubmenuFunction);
//Pdfコンテンツをダウンロード
$('#downloadContent').click(HOME.downloadPdfFunction);
// Show Next Record // Show Next Record
$('a#control-nextrecord').click(HOME.showNextRecordFunction); $('a#control-nextrecord').click(HOME.showNextRecordFunction);
...@@ -154,6 +157,11 @@ $(document).ready(function() { ...@@ -154,6 +157,11 @@ $(document).ready(function() {
$('.button-share').live('touchmove', function() { $('.button-share').live('touchmove', function() {
HOME.home_isMove = true; HOME.home_isMove = true;
}); });
//Show Share Dialog
$('.button-download').live('click', HOME.downloadPdfFunction);
$('.button-download').live('touchend', HOME.downloadPdfFunction);
$('.button-download').live('touchmove', function () { HOME.home_isMove = true; });
$('#dlgSubMenu').hover(HOME.subMenuHoverFunction, HOME.subMenuHoverOffFunction); $('#dlgSubMenu').hover(HOME.subMenuHoverFunction, HOME.subMenuHoverOffFunction);
...@@ -263,7 +271,6 @@ $(document).ready(function() { ...@@ -263,7 +271,6 @@ $(document).ready(function() {
// 読み込み完了時の処理 // 読み込み完了時の処理
I18N.i18nReplaceText(); I18N.i18nReplaceText();
}); });
}); });
// 日比谷カスタム ここから // 日比谷カスタム ここから
...@@ -640,6 +647,7 @@ HOME.openSubMenuDialogFunction = function(e) { ...@@ -640,6 +647,7 @@ HOME.openSubMenuDialogFunction = function(e) {
var array = [ e.clientX, e.clientY ]; var array = [ e.clientX, e.clientY ];
var contentid = $(this).attr('contentid'); var contentid = $(this).attr('contentid');
var printFlg = $(this).attr('printFlg');
var checkflag = false; var checkflag = false;
if (!HOME.isShowBookShelf) { if (!HOME.isShowBookShelf) {
...@@ -701,6 +709,13 @@ HOME.openSubMenuDialogFunction = function(e) { ...@@ -701,6 +709,13 @@ HOME.openSubMenuDialogFunction = function(e) {
} else { } else {
$('#dialog-read').attr('contentid', contentid); $('#dialog-read').attr('contentid', contentid);
$('#dialog-detail').attr('contentid', contentid); $('#dialog-detail').attr('contentid', contentid);
var contentType = HOME.returnContentType(contentid);
if(contentType == COMMON.ContentTypeKeys.Type_PDF && ClientData.serviceOpt_air_print() == 'Y' && printFlg == '1'){
$('#downloadContent').show();
$('#downloadContent').attr('contentid', contentid);
}else{
$('#downloadContent').hide();
}
$("#dlgSubMenu").show(); $("#dlgSubMenu").show();
HOME.allowTimerCloseSubMenu = false; HOME.allowTimerCloseSubMenu = false;
$("#dlgSubMenu").position({ $("#dlgSubMenu").position({
...@@ -1554,7 +1569,7 @@ HOME.renderContent = function(id, text, division, type, order, offset, limit, ca ...@@ -1554,7 +1569,7 @@ HOME.renderContent = function(id, text, division, type, order, offset, limit, ca
+ ' </div>' + ' </div>'
+ ' <img id="loadingIcon' + post.contentId + '" src="./img/data_loading.gif" height="25px" width="25px" style="padding: 86px; "/>' + ' <img id="loadingIcon' + post.contentId + '" src="./img/data_loading.gif" height="25px" width="25px" style="padding: 86px; "/>'
+ ' </div>' + ' </div>'
+ ' <a id="title' + post.contentId + '" class="name dialog lang" lang="lblTitle" contentid="' + post.contentId + '">' + ' <a id="title' + post.contentId + '" class="name dialog lang" lang="lblTitle" contentid="' + post.contentId + '" printFlg="' + post.printFlg + '">'
+ ' <img src="' + HEADER.getIconTypeContent(post.contentType) + '" width="20" height="20">' + ' <img src="' + HEADER.getIconTypeContent(post.contentType) + '" width="20" height="20">'
+ ' <div class="content-title" style="float:right;text-indent:0px">' + post.contentTitle + '</div>' + ' <div class="content-title" style="float:right;text-indent:0px">' + post.contentTitle + '</div>'
+ ' </a>' + ' </a>'
...@@ -1585,7 +1600,7 @@ HOME.renderContent = function(id, text, division, type, order, offset, limit, ca ...@@ -1585,7 +1600,7 @@ HOME.renderContent = function(id, text, division, type, order, offset, limit, ca
+ ' <ul class="pic">' + ' <ul class="pic">'
+ ' <li><img src="' + COMMON.DEFAULT_IMG_OPTION_MEMO + '" id="imgMemo' + post.contentId + '" class="sticker" /></li>' + ' <li><img src="' + COMMON.DEFAULT_IMG_OPTION_MEMO + '" id="imgMemo' + post.contentId + '" class="sticker" /></li>'
+ ' <li><img src="' + COMMON.DEFAULT_IMG_OPTION_MARKING + '" id="imgBookMark' + post.contentId + '" class="pen" /></li>' + ' <li><img src="' + COMMON.DEFAULT_IMG_OPTION_MARKING + '" id="imgBookMark' + post.contentId + '" class="pen" /></li>'
+ ' <li><ul class="iconList">{share}<li><a class="read lang button-details" contentid="' + post.contentId + '" lang="txtRead">読む</a></li></ul></li>' + ' <li><ul class="iconList">{download}{share}<li><a class="read lang button-details" contentid="' + post.contentId + '" lang="txtRead">読む</a></li></ul></li>'
+ ' </ul>' + ' </ul>'
+ ' </div>' + ' </div>'
+ ' </div>' + ' </div>'
...@@ -1597,7 +1612,11 @@ HOME.renderContent = function(id, text, division, type, order, offset, limit, ca ...@@ -1597,7 +1612,11 @@ HOME.renderContent = function(id, text, division, type, order, offset, limit, ca
shareHtml = '<li><a class="read lang button-share" contentid="' + post.contentId + '" lang="txtShare">共有</a></li>'; shareHtml = '<li><a class="read lang button-share" contentid="' + post.contentId + '" lang="txtShare">共有</a></li>';
} }
gridHtml = gridHtml.replace(/\{share\}/g, shareHtml); gridHtml = gridHtml.replace(/\{share\}/g, shareHtml);
var downloadHtml = "";
if(post.contentType == COMMON.ContentTypeKeys.Type_PDF && ClientData.serviceOpt_air_print() == 'Y' && post.printFlg == '1'){
downloadHtml ='<li><a class="read lang button-download" contentid="' + post.contentId + '" lang="txtDownload">ダウンロード</a></li>';
}
gridHtml = gridHtml.replace(/\{download\}/g, downloadHtml);
$('#content-grid').append(gridHtml); $('#content-grid').append(gridHtml);
HOME.getNextRecordNumForList(); HOME.getNextRecordNumForList();
...@@ -2621,3 +2640,15 @@ HOME.downloadSubmenuFunction = function(e) { ...@@ -2621,3 +2640,15 @@ HOME.downloadSubmenuFunction = function(e) {
}; };
HOME.downloadPdfFunction = function(e){
if (e) {
e.preventDefault();
}
var contentId = $(this).attr('contentid');
// Download content
HEADER.downloadResourceById(contentId);
}
...@@ -452,6 +452,8 @@ LOGIN.saveServiceUserOption = function() { ...@@ -452,6 +452,8 @@ LOGIN.saveServiceUserOption = function() {
ClientData.serviceOpt_force_pw_change_periodically(option.value); ClientData.serviceOpt_force_pw_change_periodically(option.value);
} else if (option.serviceOptionId == 21) { } 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 == 27) {
ClientData.serviceOpt_air_print(option.value);
} else if (option.serviceOptionId == 33) { } else if (option.serviceOptionId == 33) {
ClientData.serviceOpt_marking(option.value); ClientData.serviceOpt_marking(option.value);
} else if (option.serviceOptionId == 28) { } else if (option.serviceOptionId == 28) {
......
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