Commit a20cfa02 by Masaru Abe

ダウンロード対応

parent a500c463
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
<script type="text/javascript" src="./common/js/avweb.js?__UPDATEID__"></script> <script type="text/javascript" src="./common/js/avweb.js?__UPDATEID__"></script>
<script type="text/javascript" src="./common/js/i18n.js?__UPDATEID__"></script> <script type="text/javascript" src="./common/js/i18n.js?__UPDATEID__"></script>
<script type="text/javascript" src="./common/js/common.js?__UPDATEID__"></script> <script type="text/javascript" src="./common/js/common.js?__UPDATEID__"></script>
<script type="text/javascript" src="./common/js/uuid.js?__UPDATEID__"></script>
<script type="text/javascript" src="./common/js/screenLock.js?__UPDATEID__" ></script> <script type="text/javascript" src="./common/js/screenLock.js?__UPDATEID__" ></script>
<script type="text/javascript" src="./js/header.js?__UPDATEID__" ></script> <script type="text/javascript" src="./js/header.js?__UPDATEID__" ></script>
<script type="text/javascript" src="./js/Limit_Access_Content.js?__UPDATEID__"></script> <script type="text/javascript" src="./js/Limit_Access_Content.js?__UPDATEID__"></script>
......
...@@ -179,8 +179,17 @@ a.delete:hover:not(:target) { ...@@ -179,8 +179,17 @@ a.delete:hover:not(:target) {
position: relative; position: relative;
left: -18px; left: -18px;
} }
.cnt_section .text ul.pic li a.read_open {
margin-top: 30px;
}
.cnt_section .text ul.pic li a.read_download {
margin-top: 60px;
}
.cnt_section .text ul.pic li a.read { .cnt_section .text ul.pic li a.read {
margin-top: 42px; /*margin-top: 42px;*/
-moz-border-radius: 6px; -moz-border-radius: 6px;
-webkit-border-radius: 6px; -webkit-border-radius: 6px;
border-radius: 6px; border-radius: 6px;
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
<script type="text/javascript" src="./common/js/i18n.js?__UPDATEID__"></script> <script type="text/javascript" src="./common/js/i18n.js?__UPDATEID__"></script>
<script type="text/javascript" src="./common/js/avweb.js?__UPDATEID__"></script> <script type="text/javascript" src="./common/js/avweb.js?__UPDATEID__"></script>
<script type="text/javascript" src="./common/js/common.js?__UPDATEID__"></script> <script type="text/javascript" src="./common/js/common.js?__UPDATEID__"></script>
<script type="text/javascript" src="./common/js/uuid.js?__UPDATEID__"></script>
<script type="text/javascript" src="./js/Limit_Access_Content.js?__UPDATEID__"></script> <script type="text/javascript" src="./js/Limit_Access_Content.js?__UPDATEID__"></script>
<script type="text/javascript" src="./js/history.js?__UPDATEID__"></script> <script type="text/javascript" src="./js/history.js?__UPDATEID__"></script>
<script type="text/javascript" src="./js/header.js?__UPDATEID__"></script> <script type="text/javascript" src="./js/header.js?__UPDATEID__"></script>
......
...@@ -5,6 +5,7 @@ var BOOKMARK = {}; ...@@ -5,6 +5,7 @@ var BOOKMARK = {};
BOOKMARK.contentTypes = {}; BOOKMARK.contentTypes = {};
BOOKMARK.contentName = {}; BOOKMARK.contentName = {};
BOOKMARK.download = {};
BOOKMARK.pathImgContentNone = './img/page-none.png'; BOOKMARK.pathImgContentNone = './img/page-none.png';
//Contains non-exist content //Contains non-exist content
...@@ -630,7 +631,15 @@ BOOKMARK.insertRow = function(contentid, pageThumbnail, pageTitle, pageText, pag ...@@ -630,7 +631,15 @@ BOOKMARK.insertRow = function(contentid, pageThumbnail, pageTitle, pageText, pag
newRow += '<li class="pageno"><label id="Label2" class="lang" lang="txtPage">' + I18N.i18nText('txtPage') + '</label><label id="Label3">' + pageNo + '</label></li>'; newRow += '<li class="pageno"><label id="Label2" class="lang" lang="txtPage">' + I18N.i18nText('txtPage') + '</label><label id="Label3">' + pageNo + '</label></li>';
newRow += "<li><a class='read lang' name='dspRead' value='{\"contentid\":\"" + contentid + "\", \"pageNo\":\"" + pageNo + "\", \"contentType\":\"" + contentType + "\" }' lang='txtRead'>" + I18N.i18nText('txtRead') + "</a></li>"; newRow +='<li>';
newRow += "<a class='read read_open lang' name='dspRead' value='{\"contentid\":\"" + contentid + "\", \"pageNo\":\"" + pageNo + "\", \"contentType\":\"" + contentType + "\" }' lang='txtRead'>" + I18N.i18nText('txtRead') + "</a>";
console.log("BOOKMARK.download[contentid]:" + BOOKMARK.download[contentid]);
if( BOOKMARK.download[contentid] == '1' ){
newRow += "<a class='read read_download' name='dspDownload' value=''>ダウンロード</a>";
}
newRow +='</li>';
newRow +='</ul>'; newRow +='</ul>';
newRow +='</div>'; newRow +='</div>';
newRow +='</div>'; newRow +='</div>';
...@@ -868,7 +877,8 @@ BOOKMARK.IsExistContent = function(strContentId) { ...@@ -868,7 +877,8 @@ BOOKMARK.IsExistContent = function(strContentId) {
var params = { var params = {
sid: ClientData.userInfo_sid(), sid: ClientData.userInfo_sid(),
getType: '1', getType: '1',
contentId: strContentId contentId: strContentId,
authCode: ClientData.authCode()
}; };
AVWEB.avwCmsApiSync(ClientData.userInfo_accountPath(), "webGetContent", 'GET', params, AVWEB.avwCmsApiSync(ClientData.userInfo_accountPath(), "webGetContent", 'GET', params,
function (data) { function (data) {
...@@ -878,9 +888,12 @@ BOOKMARK.IsExistContent = function(strContentId) { ...@@ -878,9 +888,12 @@ BOOKMARK.IsExistContent = function(strContentId) {
result["isExisted"] = isExisted; result["isExisted"] = isExisted;
result["contentType"] = contentType; result["contentType"] = contentType;
console.log("API BOOKMARK.download:" + strContentId + ":" + data.download);
// save content type // save content type
BOOKMARK.contentTypes[strContentId] = contentType; BOOKMARK.contentTypes[strContentId] = contentType;
BOOKMARK.contentName[strContentId] = data.contentData.contentName; BOOKMARK.contentName[strContentId] = data.contentData.contentName;
BOOKMARK.download[strContentId] = data.download;
// save alert message level // save alert message level
LIMIT_ACCESS_CONTENT.messageLevel[strContentId] = { alertMessageLevel: data.contentData.alertMessageLevel, alertMessage: data.contentData.alertMessage }; LIMIT_ACCESS_CONTENT.messageLevel[strContentId] = { alertMessageLevel: data.contentData.alertMessageLevel, alertMessage: data.contentData.alertMessage };
......
...@@ -83,6 +83,11 @@ $(document).ready(function(){ ...@@ -83,6 +83,11 @@ $(document).ready(function(){
$('.button-share').live('touchend', HISTORY.showContentShareDlgFunction); $('.button-share').live('touchend', HISTORY.showContentShareDlgFunction);
$('.button-share').live('touchmove', function () { HISTORY.home_isMove = true; }); $('.button-share').live('touchmove', function () { HISTORY.home_isMove = true; });
//ダイハツ対応
$('.button-download').live('click', HISTORY.downloadFunction);
$('.button-download').live('touchend', HISTORY.downloadFunction);
$('.button-download').live('touchmove', function () {});
$(window).resize(function () { $(window).resize(function () {
if ($("#contentDetail").css("display") != "none") { if ($("#contentDetail").css("display") != "none") {
// Refresh panel of detail to center. // Refresh panel of detail to center.
...@@ -167,7 +172,7 @@ HISTORY.renderContent = function(id, text, division, type, order, from, to, cate ...@@ -167,7 +172,7 @@ HISTORY.renderContent = function(id, text, division, type, order, from, to, cate
+ ' <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">{share}{download}<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>'
...@@ -178,6 +183,15 @@ HISTORY.renderContent = function(id, text, division, type, order, from, to, cate ...@@ -178,6 +183,15 @@ HISTORY.renderContent = function(id, text, division, type, order, from, to, cate
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);
//ダイハツ対応
console.log("post.download:" + post.download);
var downloadHtml = "";
if( post.download == '1' ){
downloadHtml ='<li><a class="read button-download" contentid="' + post.contentId + '" >ダウンロード</a></li>';
}
htmlTemp = htmlTemp.replace(/\{download\}/g, downloadHtml);
$('#content-grid').append(htmlTemp); $('#content-grid').append(htmlTemp);
} }
} }
...@@ -219,7 +233,7 @@ HISTORY.renderContent = function(id, text, division, type, order, from, to, cate ...@@ -219,7 +233,7 @@ HISTORY.renderContent = function(id, text, division, type, order, from, to, cate
$('#lblVdate' + post.contentId).html(viewdate); $('#lblVdate' + post.contentId).html(viewdate);
HISTORY.addReadContentToArray(post.contentId, post.resourceVersion, post.metaVersion, post.contentThumbnail, post.contentTitle, HISTORY.returnContentTitleKana(post.contentId), post.contentDeliveryDate,post.contentType, post.readerShare ); HISTORY.addReadContentToArray(post.contentId, post.resourceVersion, post.metaVersion, post.contentThumbnail, post.contentTitle, HISTORY.returnContentTitleKana(post.contentId), post.contentDeliveryDate,post.contentType, post.readerShare, post.download );
//HISTORY.showContentThumbnail(); //HISTORY.showContentThumbnail();
} }
...@@ -1121,7 +1135,7 @@ HISTORY.sortByViewDateDesc = function(){ ...@@ -1121,7 +1135,7 @@ HISTORY.sortByViewDateDesc = function(){
HISTORY.renderContentAfterSort(resultArr); HISTORY.renderContentAfterSort(resultArr);
}; };
HISTORY.addReadContentToArray = function(strContentId, strResourceVersion, strMetaVersion, strThumbnail, strTitle, strTitleKana, strDelivDate,contentType, readerShare){ HISTORY.addReadContentToArray = function(strContentId, strResourceVersion, strMetaVersion, strThumbnail, strTitle, strTitleKana, strDelivDate,contentType, readerShare, download){
if (HISTORY.contentViewData.length > 0) { if (HISTORY.contentViewData.length > 0) {
var flag; var flag;
for(var j = 0; j < HISTORY.contentViewData.length; j++){ for(var j = 0; j < HISTORY.contentViewData.length; j++){
...@@ -1135,11 +1149,11 @@ HISTORY.addReadContentToArray = function(strContentId, strResourceVersion, strMe ...@@ -1135,11 +1149,11 @@ HISTORY.addReadContentToArray = function(strContentId, strResourceVersion, strMe
} }
if(!flag){ if(!flag){
HISTORY.contentViewData.push({contentid: strContentId, originviewdate: HISTORY.formatDate(HISTORY.returnOriginalViewDate(strContentId)), contenttitle: strTitle, contenttitlekana: strTitleKana, deliverydate: strDelivDate, resourceversion: strResourceVersion, metaversion: strMetaVersion, thumbnail: COMMON.formatStringBase64(strThumbnail),contenttype:contentType, readerShare:readerShare }); HISTORY.contentViewData.push({contentid: strContentId, originviewdate: HISTORY.formatDate(HISTORY.returnOriginalViewDate(strContentId)), contenttitle: strTitle, contenttitlekana: strTitleKana, deliverydate: strDelivDate, resourceversion: strResourceVersion, metaversion: strMetaVersion, thumbnail: COMMON.formatStringBase64(strThumbnail),contenttype:contentType, readerShare:readerShare, download:download });
} }
}else{ }else{
HISTORY.contentViewData.push({contentid: strContentId, originviewdate: HISTORY.formatDate(HISTORY.returnOriginalViewDate(strContentId)), contenttitle: strTitle, contenttitlekana: strTitleKana, deliverydate: strDelivDate, resourceversion: strResourceVersion, metaversion: strMetaVersion, thumbnail: COMMON.formatStringBase64(strThumbnail),contenttype:contentType, readerShare:readerShare }); HISTORY.contentViewData.push({contentid: strContentId, originviewdate: HISTORY.formatDate(HISTORY.returnOriginalViewDate(strContentId)), contenttitle: strTitle, contenttitlekana: strTitleKana, deliverydate: strDelivDate, resourceversion: strResourceVersion, metaversion: strMetaVersion, thumbnail: COMMON.formatStringBase64(strThumbnail),contenttype:contentType, readerShare:readerShare, download:download });
} }
}; };
...@@ -1369,7 +1383,7 @@ HISTORY.renderContentAfterSort = function(contentSortArr){ ...@@ -1369,7 +1383,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">{share}{download}<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>'
...@@ -1381,6 +1395,15 @@ HISTORY.renderContentAfterSort = function(contentSortArr){ ...@@ -1381,6 +1395,15 @@ 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);
//ダイハツ対応
console.log("post.download2:" + post.download);
var downloadHtml = "";
if( post.download == '1' ){
downloadHtml ='<li><a class="read button-download" contentid="' + post.contentId + '" >ダウンロード</a></li>';
}
htmlTemp = htmlTemp.replace(/\{download\}/g, downloadHtml);
$('#content-grid').append(htmlTemp); $('#content-grid').append(htmlTemp);
} }
...@@ -1534,4 +1557,16 @@ HISTORY.cssInit = function(){ ...@@ -1534,4 +1557,16 @@ HISTORY.cssInit = function(){
}); });
}; };
HISTORY.downloadFunction = function(e) {
if (e) {
e.preventDefault();
}
var contentId = $(this).attr('contentid');
//Download content
HEADER.downloadResourceById(contentId);
};
...@@ -140,6 +140,43 @@ $(document).ready(function () { ...@@ -140,6 +140,43 @@ $(document).ready(function () {
$('#dlgSubMenu').hover(HOME.subMenuHoverFunction, HOME.subMenuHoverOffFunction); $('#dlgSubMenu').hover(HOME.subMenuHoverFunction, HOME.subMenuHoverOffFunction);
// グループ認証関連
$('#dlgAuthCode').hide();
$('#login-username').click(HOME.showDlgAuthCode);
$('#dlgAuthCode-ok').click(HOME.authCodeOkFunction);
$('#dlgAuthCode-cancel').click(HOME.authCodeCancelFunction);
if( ClientData.authCode() != "" ){
//グループ名表示
$('#authGroupBox').show();
$('#authGroupName').html(ClientData.authGroupName());
$('#authGroupButton').click(HOME.authCodeClear);
} else {
$('#authGroupBox').hide();
}
//Button details on dialog click event
$('#dialog-download').click(HOME.downloadSubmenuFunction);
$('.button-download').live('click', HOME.downloadSubmenuFunction);
$('.button-download').live('touchend', HOME.downloadSubmenuFunction);
$('.button-download').live('touchmove', function () { HOME.home_isMove = true; });
/*
$(document).on({
'click touchend': function(ev){
console.log("click touchend button-download");
HOME.downloadSubmenuFunction(ev);
},
'touchstart touchmove': function(){
HOME.home_isMove = true;
//これを入れないと次にダイアログを開くと表示位置が大きくズレる
return false;
}
}, '.button-download' );
*/
if (COMMON.isTouchDevice() == true) { if (COMMON.isTouchDevice() == true) {
var avwUserEnvObj = new UserEnvironment(); var avwUserEnvObj = new UserEnvironment();
if (avwUserEnvObj.os == 'ipad') { if (avwUserEnvObj.os == 'ipad') {
...@@ -230,23 +267,6 @@ $(document).ready(function () { ...@@ -230,23 +267,6 @@ $(document).ready(function () {
}); });
/* グループ認証関連 */
$('#dlgAuthCode').hide();
$('#login-username').click(HOME.showDlgAuthCode);
$('#dlgAuthCode-ok').click(HOME.authCodeOkFunction);
$('#dlgAuthCode-cancel').click(HOME.authCodeCancelFunction);
if( ClientData.authCode() != "" ){
//グループ名表示
$('#authGroupBox').show();
$('#authGroupName').html(ClientData.authGroupName());
$('#authGroupButton').click(HOME.authCodeClear);
} else {
$('#authGroupBox').hide();
}
//Button details on dialog click event
$('#dialog-download').click(HOME.downloadSubmenuFunction);
}); });
...@@ -703,10 +723,9 @@ HOME.openSubMenuDialogFunction = function(e) { ...@@ -703,10 +723,9 @@ 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 download = $(this).attr('download'); var download = $(this).attr('download');
alert("download:" + download);
if (!HOME.isShowBookShelf) { if (!HOME.isShowBookShelf) {
// Get image of selected image // Get image of selected image
var base64String = HOME.returnThumbnail(contentid); var base64String = HOME.returnThumbnail(contentid);
...@@ -1761,13 +1780,13 @@ HOME.renderContent = function(id, text, division, type, order, from, to, cateid, ...@@ -1761,13 +1780,13 @@ HOME.renderContent = function(id, text, division, type, order, from, to, cateid,
+ ' </a>' + ' </a>'
+ ' <div class="info">' + ' <div class="info">'
+ ' <ul class="date">' + ' <ul class="date">'
+ ' <li><span class="lang" lang="txtPubDt"> </span> : ' + outputDate + '</li>' + ' <li><span class="lang" lang="txtPubDt"> </span>' + outputDate + '</li>'
+ ' <li><span class="lang" lang="txtViewDt"> </span>:<span id="lblVdate' + post.contentId + '"> </span></li>' + ' <li><span class="lang" lang="txtViewDt"> </span>:<span id="lblVdate' + post.contentId + '"> </span></li>'
+ ' </ul>' + ' </ul>'
+ ' <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">{share}{download}<li><a class="read lang button-details" contentid="' + post.contentId + '" lang="txtRead">読む</a></li></ul></li>'
+ ' </ul>' + ' </ul>'
+ ' </div>' + ' </div>'
+ ' </div>' + ' </div>'
...@@ -1780,6 +1799,13 @@ HOME.renderContent = function(id, text, division, type, order, from, to, cateid, ...@@ -1780,6 +1799,13 @@ HOME.renderContent = function(id, text, division, type, order, from, to, cateid,
} }
gridHtml = gridHtml.replace(/\{share\}/g, shareHtml); gridHtml = gridHtml.replace(/\{share\}/g, shareHtml);
//ダイハツ対応
var downloadHtml = "";
if( post.download == '1' ){
downloadHtml ='<li><a class="read button-download" contentid="' + post.contentId + '" >ダウンロード</a></li>';
}
gridHtml = gridHtml.replace(/\{download\}/g, downloadHtml);
$('#content-grid').append(gridHtml); $('#content-grid').append(gridHtml);
HOME.getNextRecordNumForList(); HOME.getNextRecordNumForList();
......
...@@ -469,7 +469,7 @@ SETTINGS.restoreMarkingData = function() ...@@ -469,7 +469,7 @@ SETTINGS.restoreMarkingData = function()
} }
); );
return result; return result;
} };
// Cancel for restore // Cancel for restore
......
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