Commit c48a078a by Masaru Abe

ダウンロード対応

parent a20cfa02
......@@ -162,7 +162,7 @@
margin-right: auto;
margin-left: auto;
padding-top: 124px;
width: 180px;
width: 200px;
}
.sectiondetailnopdf #book_data .book_img {
height: 145px;
......
......@@ -10,7 +10,8 @@
<li class="explain" id="txtContentDetail">スマートデバイス向け<br />統合ソリューション</li>
</ul>
<p class="read_btn"><a class="read lang" href="javascript:void(0);" id="contentdetail_dspRead" lang="txtRead">読む</a></p>
<p class="read_btn"><a class="read lang" href="javascript:void(0);" id="contentdetail_dspShare" lang="txtShare" style="display:none;" >共有</a></p>
<p class="read_btn"><a class="read" href="javascript:void(0);" id="contentdetail_dspDownload" style="display:none;" >ダウンロード</a></p>
<p class="read_btn" style="display:none;" ><a class="read lang" href="javascript:void(0);" id="contentdetail_dspShare" lang="txtShare" style="display:none;" >共有</a></p>
</div>
<div id="book_list"></div>
</section>
......
......@@ -59,7 +59,11 @@ $(document).ready(function () {
$("a[name='dspRead']").unbind('click');
$("a[name='dspRead']").click(BOOKMARK.dspRead_Click);
//ダイハツ対応
$("a[name='dspDownload']").unbind('click');
$("a[name='dspDownload']").click(BOOKMARK.downloadFunction);
BOOKMARK.HideSorting();
// Default sort is タイトル名, default is asc
......@@ -347,6 +351,9 @@ BOOKMARK.ShowBookmark = function() {
}
$("a[name='dspRead']").unbind('click');
$("a[name='dspRead']").click(BOOKMARK.dspRead_Click);
//ダイハツ対応
$("a[name='dspDownload']").unbind('click');
$("a[name='dspDownload']").click(BOOKMARK.downloadFunction);
}
};
// Hide all sorting symbol
......@@ -636,7 +643,7 @@ BOOKMARK.insertRow = function(contentid, pageThumbnail, pageTitle, pageText, pag
console.log("BOOKMARK.download[contentid]:" + BOOKMARK.download[contentid]);
if( BOOKMARK.download[contentid] == '1' ){
newRow += "<a class='read read_download' name='dspDownload' value=''>ダウンロード</a>";
newRow += "<a class='read read_download' name='dspDownload' contentid='" + contentid + "'>ダウンロード</a>";
}
newRow +='</li>';
......@@ -954,3 +961,15 @@ BOOKMARK.cssInit = function(){
});
};
BOOKMARK.downloadFunction = function(e) {
if (e) {
e.preventDefault();
}
var contentId = $(this).attr('contentid');
//Download content
HEADER.downloadResourceById(contentId);
};
......@@ -50,10 +50,9 @@ $(document).ready(function(){
CONTENTSEARCH.renderGridView();
//Go To Details Page
$('canvas').live('click', CONTENTSEARCH.canvasClickFunction);
//$('canvas').live('touchstart', CONTENTSEARCH.canvasClickFunction);
$('canvas').live('touchend', CONTENTSEARCH.canvasClickFunction);
$('canvas').live('touchmove', function () { CONTENTSEARCH.home_isMove = true; });
$('#main-ws canvas').live('click', CONTENTSEARCH.canvasClickFunction);
$('#main-ws canvas').live('touchend', CONTENTSEARCH.canvasClickFunction);
$('#main-ws canvas').live('touchmove', function () { CONTENTSEARCH.home_isMove = true; });
//Open dialog
$('.dialog').live('click', CONTENTSEARCH.titleClickFunction);
......@@ -84,6 +83,11 @@ $(document).ready(function(){
$('.button-share').live('touchend', CONTENTSEARCH.showContentShareDlgFunction);
$('.button-share').live('touchmove', function () { CONTENTSEARCH.home_isMove = true; });
//ダイハツ
$('.button-download').live('click', CONTENTSEARCH.downloadSubmenuFunction);
$('.button-download').live('touchend', CONTENTSEARCH.downloadSubmenuFunction);
$('.button-download').live('touchmove', function () { CONTENTSEARCH.home_isMove = true; });
$('#main-search').click(CONTENTSEARCH.searchEventButtonFunction);
$('#txtSearch').keydown(CONTENTSEARCH.mainSearchKeyDownFunction);
......@@ -188,6 +192,9 @@ CONTENTSEARCH.initialScreen = function(){
///Render Content
CONTENTSEARCH.renderContent = function(id, text, division, type, order, from, to, cateid, grpid){
console.log("CONTENTSEARCH.renderContent");
var params = {
sid: id,
searchText: text,
......@@ -197,7 +204,8 @@ CONTENTSEARCH.renderContent = function(id, text, division, type, order, from, to
recordFrom: from,
recordTo: to,
genreId: cateid,
groupId: grpid
groupId: grpid,
authCode: ClientData.authCode()
};
CONTENTSEARCH.abapi('webContentList', params, 'POST', function (data) {
......@@ -229,7 +237,7 @@ CONTENTSEARCH.renderContent = function(id, text, division, type, order, from, to
+ ' <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_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>'
+ ' </div>'
+ ' </div>'
......@@ -242,6 +250,14 @@ CONTENTSEARCH.renderContent = function(id, text, division, type, order, from, to
}
htmlTemp = htmlTemp.replace(/\{share\}/g, shareHtml);
//ダイハツ対応
console.log("downloadHtml:" + 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);
CONTENTSEARCH.getNextRecordNumForList();
......@@ -1426,3 +1442,21 @@ CONTENTSEARCH.cssInit = function(){
});
};
//ダウンロードButton CLick
CONTENTSEARCH.downloadSubmenuFunction = function(e) {
if (e) {
e.preventDefault();
}
if (CONTENTSEARCH.home_isMove == true) {
CONTENTSEARCH.home_isMove = false;
return;
}
var contentId = $(this).attr('contentid');
//Download content
HEADER.downloadResourceById(contentId);
};
......@@ -1092,6 +1092,9 @@ CONTENTVIEW.changePage = function(page_index) {
/* add event draw on canvas */
CONTENTVIEW.drawOnCanvas = function() {
console.log("CONTENTVIEW.drawOnCanvas start");
CONTENTVIEW_GENERAL.tool = new CONTENTVIEW.tool_drawing();
if (COMMON.isTouchDevice() == true) {
CONTENTVIEW_PAINT.initializeCanvas(document.getElementById('draw_canvas'));
......
......@@ -1082,9 +1082,10 @@ console.log("222");
} else {
console.log("333");
CONTENTVIEW_GENERAL.contentID = ClientData.contentInfo_contentId();
console.log("333:" + CONTENTVIEW_GENERAL.contentID);
}
};
......
......@@ -34,6 +34,7 @@ DETAIL.openContentDetail = function() {
contentDetail: "",
contentShare: "",
contentThumbnail: "",
contentDownload: "0",
deliveryDate: (new Date()),
pages: []
};
......@@ -57,6 +58,8 @@ DETAIL.openContentDetail = function() {
$("#contentdetail_dspShare").hide();
//}
$("#contentdetail_dspDownload").hide();
COMMON.lockLayout();
$("#contentDetail").css('z-index', 101);
$("#sectionContentDetail").show();
......@@ -70,8 +73,15 @@ DETAIL.openContentDetail = function() {
DETAIL.displayData.contentID = ClientData.contentInfo_contentId();
DETAIL.displayData.contentThumbnail = ClientData.contentInfo_contentThumbnail();
var params = {
sid: ClientData.userInfo_sid(),
getType: '1',
contentId: DETAIL.displayData.contentID,
authCode: ClientData.authCode()
};
// Get content detail
AVWEB.avwCmsApi(ClientData.userInfo_accountPath(), "webGetContent", "GET", { contentId: DETAIL.displayData.contentID, sid: ClientData.userInfo_sid(), getType: 1 },
AVWEB.avwCmsApi(ClientData.userInfo_accountPath(), "webGetContent", "GET", params,
function (data) {
var contentType = ClientData.contentInfo_contentType();
// Get content detail
......@@ -84,6 +94,7 @@ DETAIL.openContentDetail = function() {
}
}
DETAIL.displayData.deliveryDate = COMMON.convertToDate(data.contentData.deliveryStartDate);
DETAIL.displayData.contentDownload = data.download;
//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)){
......@@ -238,6 +249,11 @@ DETAIL.showContentNotPDF = function(displayData) {
$("#contentdetail_dspShare").show();
$("#contentdetail_dspShare").click(SHARE.openContentShare);
}
//ダウンロード
if( displayData.contentDownload == '1' ){
$("#contentdetail_dspDownload").show();
$("#contentdetail_dspDownload").click(DETAIL.downloadFunction);
}
var tempContentType = ClientData.contentInfo_contentType();
......@@ -293,6 +309,11 @@ DETAIL.showContent = function(displayData) {
$("#contentdetail_dspShare").show();
$("#contentdetail_dspShare").click(SHARE.openContentShare);
}
//ダウンロード
if( displayData.contentDownload == '1' ){
$("#contentdetail_dspDownload").show();
$("#contentdetail_dspDownload").click(DETAIL.downloadFunction);
}
$("#imgContentThumbnail").attr("src", displayData.contentThumbnail);
var imgTemp = new Image();
......@@ -381,3 +402,15 @@ DETAIL.resetLoadingImageSize = function(){
$("#imgContentThumbnail").attr('height','25px');
$("#imgContentThumbnail").attr('width','25px');
};
DETAIL.downloadFunction = function(e) {
if (e) {
e.preventDefault();
}
var contentId = ClientData.contentInfo_contentId();
//Download content
HEADER.downloadResourceById(contentId);
};
......@@ -1074,7 +1074,8 @@ HEADER.downloadResourceById = function(contentId){
var params = {
sid: ClientData.userInfo_sid(),
contentId: contentId,
getType: '2'
getType: '2',
authCode: ClientData.authCode()
};
AVWEB.avwCmsApiSync(ClientData.userInfo_accountPath(), "webGetContent", "get", params,
function (data) {
......@@ -1119,7 +1120,8 @@ HEADER.viewLinkContentById = function(contentId){
var params = {
sid: ClientData.userInfo_sid(),
contentId: contentId,
getType: '2'
getType: '2',
authCode: ClientData.authCode()
};
AVWEB.avwCmsApiSync(ClientData.userInfo_accountPath(), "webGetContent", "get", params,
function (data) {
......
......@@ -49,10 +49,9 @@ $(document).ready(function(){
HISTORY.renderGridView();
//Go To Details Page
$('canvas').live('click', HISTORY.canvasClickFunction);
//$('canvas').live('touchstart', HISTORY.canvasClickFunction);
$('canvas').live('touchend', HISTORY.canvasClickFunction);
$('canvas').live('touchmove', function () { HISTORY.home_isMove = true; });
$('#main-ws canvas').live('click', HISTORY.canvasClickFunction);
$('#main-ws canvas').live('touchend', HISTORY.canvasClickFunction);
$('#main-ws canvas').live('touchmove', function () { HISTORY.home_isMove = true; });
//Open dialog
......@@ -1206,6 +1205,11 @@ HISTORY.getContentNameKana = function(strContentId) {
Check content whether existed or not
*/
HISTORY.IsExistContent = function(strContentId) {
if( strContentId == null || strContentId == "" ){
return false;
}
var isExisted = true;
var params = {
sid: ClientData.userInfo_sid(),
......
......@@ -92,10 +92,9 @@ $(document).ready(function () {
$('#control-list-type').click(HOME.changeDispListFunction);
//Go To Details Page
$('canvas').live('click', HOME.canvasClickFunction);
//$('canvas').live('touchstart', HOME.canvasClickFunction);
$('canvas').live('touchend', HOME.canvasClickFunction);
$('canvas').live('touchmove', function () { HOME.home_isMove = true; });
$('#main-ws canvas').live('click', HOME.canvasClickFunction);
$('#main-ws canvas').live('touchend', HOME.canvasClickFunction);
$('#main-ws canvas').live('touchmove', function () { HOME.home_isMove = true; });
//Open dialog
$('.dialog').live('click', HOME.openSubMenuDialogFunction);
......@@ -158,7 +157,7 @@ $(document).ready(function () {
//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; });
......@@ -575,6 +574,9 @@ HOME.canvasClickFunction = function(e) {
HOME.canvasClickFunction_callback = function(outputId)
{
console.log("HOME.canvasClickFunction_callback:" + outputId);
var date = new Date();
var month = date.getMonth() + 1;
var day = date.getDate();
......@@ -2330,7 +2332,8 @@ HOME.IsExistContent = function(strContentId) {
var params = {
sid: ClientData.userInfo_sid(),
getType: '1',
contentId: strContentId
contentId: strContentId,
authCode: ClientData.authCode()
};
AVWEB.avwCmsApiSync(ClientData.userInfo_accountPath(), "webGetContent", 'GET', params,
function (data) {
......
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