Commit b374e7c7 by Vo Duc Thang

9/27 Release

parent 3f8dd190
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
"dspBkCancel":"Logout", "dspBkCancel":"Logout",
"txtSearchResult":"Result", "txtSearchResult":"Result",
"dspHome":"Home", "dspHome":"Home",
"txtLoginUser":"(Ver.20130926)User:", "txtLoginUser":"(Ver.20130927)User:",
"txtAll":"All", "txtAll":"All",
"txtMkgSize":"Size", "txtMkgSize":"Size",
"txtMkgS":"S", "txtMkgS":"S",
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
"dspBkCancel":"バックアップせずにログアウト", "dspBkCancel":"バックアップせずにログアウト",
"txtSearchResult":"検索結果", "txtSearchResult":"検索結果",
"dspHome":"ホーム", "dspHome":"ホーム",
"txtLoginUser":"(Ver.20130926)ログイン中:", "txtLoginUser":"(Ver.20130927)ログイン中:",
"txtAll":"すべて", "txtAll":"すべて",
"txtMkgSize":"太さ", "txtMkgSize":"太さ",
"txtMkgS":"小", "txtMkgS":"小",
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
"dspBkCancel":"로그아웃", "dspBkCancel":"로그아웃",
"txtSearchResult":"검색 결과", "txtSearchResult":"검색 결과",
"dspHome":"홈", "dspHome":"홈",
"txtLoginUser":"(Ver.20130926)로그인 중:", "txtLoginUser":"(Ver.20130927)로그인 중:",
"txtAll":"전체", "txtAll":"전체",
"txtMkgSize":"두께", "txtMkgSize":"두께",
"txtMkgS":"소", "txtMkgS":"소",
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
<div class="menu_language"> <div class="menu_language">
<div class="clearfix"> <div class="clearfix">
<ul class="floatL"> <ul class="floatL">
<li class="floatR"> <li class="floatR" id="li-login-username" style="display:none;">
<label class="lang" lang="txtLoginUser">こんにちは</label> <label class="lang" lang="txtLoginUser">こんにちは</label>
<label id="login-username"> </label> <label id="login-username"> </label>
</li> </li>
...@@ -208,7 +208,7 @@ ...@@ -208,7 +208,7 @@
<li class="date"><label id="txtPubDt2" lang="dspPubDt2" class="lang">発行日:</label><label id="txtPubDt2_Dsp">____/__/__ __:__</label></li> <li class="date"><label id="txtPubDt2" lang="dspPubDt2" class="lang">発行日:</label><label id="txtPubDt2_Dsp">____/__/__ __:__</label></li>
<li class="explain" id="txtContentDetail">スマートデバイス向け<br />統合ソリューション</li> <li class="explain" id="txtContentDetail">スマートデバイス向け<br />統合ソリューション</li>
</ul> </ul>
<p class="read_btn"><a class="read lang" href="#" id="contentdetail_dspRead" lang="txtRead">読む</a></p> <p class="read_btn"><a class="read lang" id="contentdetail_dspRead" lang="txtRead">読む</a></p>
</div> </div>
<div id="book_list"></div> <div id="book_list"></div>
......
...@@ -818,7 +818,7 @@ aside.MemoIndexBox .indexBoxBody_off{ ...@@ -818,7 +818,7 @@ aside.MemoIndexBox .indexBoxBody_off{
.transition { .transition {
background: url(../../img/viewer/transitionbtn_bg.png) 0 0 no-repeat; /*background: url(../../img/viewer/transitionbtn_bg.png) 0 0 no-repeat;*/
} }
/*ボタン設定*/ /*ボタン設定*/
...@@ -883,8 +883,7 @@ aside.MemoIndexBox .indexBoxBody_off{ ...@@ -883,8 +883,7 @@ aside.MemoIndexBox .indexBoxBody_off{
/*----------------------------*/ /*----------------------------*/
.sizing { .sizing {
/*background: url(../../img/viewer/sizingbtn_bg.png) 0 0 no-repeat;*/
background: url(../../img/viewer/sizingbtn_bg.png) 0 0 no-repeat;
} }
/*ボタン設定*/ /*ボタン設定*/
......
...@@ -68,6 +68,15 @@ ...@@ -68,6 +68,15 @@
<script src="./common/js/screenLock.js" type="text/javascript"></script> <script src="./common/js/screenLock.js" type="text/javascript"></script>
<script src="js/detail.js" type="text/javascript"></script> <script src="js/detail.js" type="text/javascript"></script>
<!--[if IE 9 ]>
<style>
.tab_bg_color
{
overflow-x:scroll;
}
</style>
<![endif]-->
</head> </head>
<body id="bookshelf"> <body id="bookshelf">
......
...@@ -902,40 +902,40 @@ function isPdfContent(contentType){ ...@@ -902,40 +902,40 @@ function isPdfContent(contentType){
return true; return true;
} }
}; };
//Get resource Id of content ////Get resource Id of content
function downloadResourceById(contentId){ //function downloadResourceById(contentId){
var params = { // var params = {
sid: ClientData.userInfo_sid(), // sid: ClientData.userInfo_sid(),
contentId: contentId, // contentId: contentId,
getType: '2', // getType: '2',
}; // };
//
var resourceUrl; // var resourceUrl;
//
abapi('webGetContent', params, 'GET', function (data) { // abapi('webGetContent', params, 'GET', function (data) {
var resourceId; // var resourceId;
//
$.each(data.contentData , function(i, n){ // $.each(data.contentData , function(i, n){
if(typeof n == "object"){ // if(typeof n == "object"){
resourceId = n.resourceId; // resourceId = n.resourceId;
} // }
}); // });
//
//Get resource // //Get resource
resourceUrl = getResourceByIdFromAPI(resourceId); // resourceUrl = getResourceByIdFromAPI(resourceId);
//
window.open(resourceUrl, "_blank"); // window.open(resourceUrl, "_blank");
// redraw content remove new icon
drawEditImage(contentId);
}); // // redraw content remove new icon
}; // drawEditImage(contentId);
//
// });
//};
//Download resource ////Download resource
function getResourceByIdFromAPI(resourceId){ //function getResourceByIdFromAPI(resourceId){
return getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + resourceId + "&isDownload=true"; // return getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + resourceId + "&isDownload=true";
}; //};
/* get url */ /* get url */
function getURL(apiName) { function getURL(apiName) {
...@@ -1034,6 +1034,9 @@ function readSubmenuFunction_callback(contentId) ...@@ -1034,6 +1034,9 @@ function readSubmenuFunction_callback(contentId)
if(contentType == ContentTypeKeys.Type_Others){ if(contentType == ContentTypeKeys.Type_Others){
//Download content //Download content
downloadResourceById(contentId); downloadResourceById(contentId);
// redraw content remove new icon
drawEditImage(contentId);
} }
else{ else{
//Go to Conten view page //Go to Conten view page
......
...@@ -2091,6 +2091,26 @@ function closeDialogResize() { ...@@ -2091,6 +2091,26 @@ function closeDialogResize() {
//Start Function : No.12 //Start Function : No.12
var isZoomingContent = false; var isZoomingContent = false;
//START TRB00075 - Editor: Long - Date - 24/09/2013 - Summary : Fix for prevent moving page when display dialog
function displayOverlayForHtmlAndMediaType(){
var $overlay = $('#overlay');
var $header = $('header');
var $footer = $('footer');
$header.css('position', 'absolute');
$header.css('width', '100%');
$header.css('z-index', '102');
$footer.css('z-index', '102');
$overlay.show();
//START TRB00075 - Editor: Long - Date - 24/09/2013 - Summary : Fix for prevent moving page when display dialog
document.getElementById('overlay').addEventListener('touchstart', function(event){event.preventDefault(); return false;}, false);
document.getElementById('overlay').addEventListener('touchmove', function(event){event.preventDefault(); return false;}, false);
document.getElementById('overlay').addEventListener('touchend', function(event){event.preventDefault(); return false;}, false);
//END TRB00075 - Editor: Long - Date - 24/09/2013 - Summary : Fix for prevent moving page when display dialog
};
//END TRB00075 - Editor: Long - Date - 24/09/2013 - Summary : Fix for prevent moving page when display dialog
//Display overlay dialog for specify content type //Display overlay dialog for specify content type
function displayOverlayForSpecifyContentType(){ function displayOverlayForSpecifyContentType(){
...@@ -2128,6 +2148,16 @@ function displayOverlayForSpecifyContentType(){ ...@@ -2128,6 +2148,16 @@ function displayOverlayForSpecifyContentType(){
} }
//Start : TRB00082 - Editor : Long - Date : 09/25/2013 - Summary : For win 8 rotate handling.
setViewportForWin8();
//End : TRB00082 - Editor : Long - Date : 09/25/2013 - Summary : For win 8 rotate handling.
//Start : TRB00075 - Editor : Long - Date : 09/25/2013 - Summary : prevent moving page
if (avwUserEnvObj.os == "ipad") {
displayOverlayForHtmlAndMediaType();
}
//End : TRB00075 - Editor : Long - Date : 09/25/2013 - Summary : prevent moving page
/* window resize event */ /* window resize event */
$(window).resize(function () { $(window).resize(function () {
//START : TRB00034 - DATE : 09/11/2013 - Editor : Long - Summary : Fix for center loading image //START : TRB00034 - DATE : 09/11/2013 - Editor : Long - Summary : Fix for center loading image
...@@ -2166,6 +2196,11 @@ function displayOverlayForSpecifyContentType(){ ...@@ -2166,6 +2196,11 @@ function displayOverlayForSpecifyContentType(){
/* close dialog popuptext */ /* close dialog popuptext */
closeDialogResize(); closeDialogResize();
//START TRB00091 - Editor : LOng - Date : 09/26/2013 - Summary : Dialog at center when rotate
$("#contentVideoConfirm").center();
$("#contentAudioConfirm").center();
//END TRB00091 - Editor : LOng - Date : 09/26/2013 - Summary : Dialog at center when rotate
}); });
}; };
...@@ -2178,13 +2213,13 @@ function handleForContentTypeVideo(resourceUrl){ ...@@ -2178,13 +2213,13 @@ function handleForContentTypeVideo(resourceUrl){
$container.html(''); $container.html('');
if (ClientData.userOpt_musicMode() == "1") { if (ClientData.userOpt_musicMode() == "1") {
$container.html('<video id="content_video" autoplay="true" loop="true" preload="auto" controls style="position: absolute; width: 100%; height: 90%; bottom: 1% ">' $container.html('<video id="content_video" autoplay="true" loop="true" controls="controls" style="position: absolute; width: 100%; height: 100%;">'
+ ' <source src="' + resourceUrl + '" type="video/mp4"> ' + ' <source src="' + resourceUrl + '" type="video/mp4"> '
+ '</video>' + '</video>'
); );
} }
else { else {
$container.html('<video id="content_video" autoplay="true" controls style="position: absolute; width: 100%; height: 90%; bottom: 1% ">' $container.html('<video id="content_video" autoplay="true" controls="controls" style="position: absolute; width: 100%; height: 100%;">'
+ ' <source src="' + resourceUrl + '" type="video/mp4"> ' + ' <source src="' + resourceUrl + '" type="video/mp4"> '
+ '</video>' + '</video>'
); );
...@@ -2411,8 +2446,10 @@ function fullScreenForNotPdfType(){ ...@@ -2411,8 +2446,10 @@ function fullScreenForNotPdfType(){
var h = $("#wrapper").height(); var h = $("#wrapper").height();
if(contentType == ContentTypeKeys.Type_Video){ if(contentType == ContentTypeKeys.Type_Video){
if(avwUserEnvObj.os == 'ipad'){
$('#content_video').removeAttr('controls'); $('#content_video').removeAttr('controls');
} }
}
var $container = $('#dialog'); var $container = $('#dialog');
...@@ -2440,9 +2477,6 @@ function originalScreenForNotPdfType(){ ...@@ -2440,9 +2477,6 @@ function originalScreenForNotPdfType(){
$('#control_screen_2').hide(); $('#control_screen_2').hide();
$('#header_toolbar').show(); $('#header_toolbar').show();
var $container = $('#dialog'); var $container = $('#dialog');
$container.removeAttr('style'); $container.removeAttr('style');
......
...@@ -50,13 +50,16 @@ function showAnket(url, fullscreen) { ...@@ -50,13 +50,16 @@ function showAnket(url, fullscreen) {
function () { function () {
var opacity = 1; var opacity = 1;
//START TRB00092 - EDITOR: Long - Date: 09/26/2013 - Summary : Fix opacity
if ($(this).index() == 0) { if ($(this).index() == 0) {
opacity = 0.2; opacity = 0.6;
} }
else if($(this).index()==1) else if($(this).index()==1)
{ {
opacity = 0.7; opacity = 0.8;
} }
//END TRB00092 - EDITOR: Long - Date: 09/26/2013 - Summary : Fix opacity
$('#dialog,#dialog iframe,#dialog .anket-commands,#dialog .anket-commands input').css('opacity', opacity); $('#dialog,#dialog iframe,#dialog .anket-commands,#dialog .anket-commands input').css('opacity', opacity);
} }
); );
......
...@@ -481,6 +481,9 @@ function createLockLayout(opt){ ...@@ -481,6 +481,9 @@ function createLockLayout(opt){
} }
}; };
//START TRB00049 - Editor: Long - Date: 09/26/2013 - Summary : Add short key alt
var altMode = false;
/* handle keydown */ /* handle keydown */
$(document).keydown(function (e) { $(document).keydown(function (e) {
/* set fag true when click ctrl */ /* set fag true when click ctrl */
...@@ -488,8 +491,12 @@ $(document).keydown(function (e) { ...@@ -488,8 +491,12 @@ $(document).keydown(function (e) {
ctrlMode = true; ctrlMode = true;
} }
if(e.altKey){
altMode = true;
}
/* set hot key */ /* set hot key */
if (ctrlMode == true) { if (ctrlMode == true && altMode == false) {
if (ClientData.IsAddingMarking() == true || isLoadingObject == true) { if (ClientData.IsAddingMarking() == true || isLoadingObject == true) {
/* do nothing*/ /* do nothing*/
} else { } else {
...@@ -559,12 +566,37 @@ $(document).keydown(function (e) { ...@@ -559,12 +566,37 @@ $(document).keydown(function (e) {
} }
} }
} }
if(altMode == true && ctrlMode == false){
if (ClientData.IsAddingMarking() == true || isLoadingObject == true) {
/* do nothing*/
}
else {
switch (e.keyCode) {
/* zoom */
case ShortKeys.ZoomInAlt: /* zoomIn */
if(contentType == ContentTypeKeys.Type_PDF || contentType == ContentTypeKeys.Type_Image
|| contentType == ContentTypeKeys.Type_NoFile){
zoomIn();
}
break;
case ShortKeys.ZoomOutAlt: /* zoomOut */
if(contentType == ContentTypeKeys.Type_PDF || contentType == ContentTypeKeys.Type_Image
|| contentType == ContentTypeKeys.Type_NoFile){
zoomOut();
}
break;
}
}
}
}); });
/* handle keydown */ /* handle keydown */
$(document).keyup(function (e) { $(document).keyup(function (e) {
ctrlMode = false; ctrlMode = false;
altMode = false;
}); });
//END TRB00049 - Editor: Long - Date: 09/26/2013 - Summary : Add short key alt
function onUnlock() { function onUnlock() {
removeObject(); removeObject();
...@@ -932,7 +964,6 @@ function mouseMove_canvasMain(event) { ...@@ -932,7 +964,6 @@ function mouseMove_canvasMain(event) {
_3dAction = _3dActionType.TouchMove_MouseMove; _3dAction = _3dActionType.TouchMove_MouseMove;
hitObj.action(imagePt); hitObj.action(imagePt);
} }
} }
else{ else{
_3dAnimate = false; _3dAnimate = false;
...@@ -1034,9 +1065,8 @@ function mouseDown_CanvasMain(event) { ...@@ -1034,9 +1065,8 @@ function mouseDown_CanvasMain(event) {
_3dAnimate = false; _3dAnimate = false;
if(is3DObject(hitPageObj)){ if(is3DObject(hitPageObj)){
clearTimeout(this.downTimer);
this.downTimer = setTimeout(function() {
//START TRB00090 - Editor: Long - Date : 09/26/2013 - Summary : remove time to detect 3d animate
if(!isPageTransition){ if(!isPageTransition){
_3dAnimate = true; _3dAnimate = true;
_3dAction = _3dActionType.TouchStart_MouseDown; _3dAction = _3dActionType.TouchStart_MouseDown;
...@@ -1048,10 +1078,8 @@ function mouseDown_CanvasMain(event) { ...@@ -1048,10 +1078,8 @@ function mouseDown_CanvasMain(event) {
_3dAnimate = false; _3dAnimate = false;
moveFlag = true; moveFlag = true;
} }
//END TRB00090 - Editor: Long - Date : 09/26/2013 - Summary : remove time to detect 3d animate
}, _3dTimeToDetect);
} }
else{ else{
_3dAnimate = false; _3dAnimate = false;
} }
...@@ -1278,12 +1306,9 @@ function onTouchstart(evt){ ...@@ -1278,12 +1306,9 @@ function onTouchstart(evt){
_3dAnimate = false; _3dAnimate = false;
if (hitPageObj) { if (hitPageObj) {
//START TRB00090 - Editor: Long - Date : 09/26/2013 - Summary : remove time to detect 3d animate
if(is3DObject(hitPageObj)){ if(is3DObject(hitPageObj)){
clearTimeout(this.downTimer);
this.downTimer = setTimeout(function() {
if(isPageTransition){ if(isPageTransition){
_3dAnimate = false; _3dAnimate = false;
} }
else{ else{
...@@ -1292,12 +1317,11 @@ function onTouchstart(evt){ ...@@ -1292,12 +1317,11 @@ function onTouchstart(evt){
hitPageObj.action(imagePt); hitPageObj.action(imagePt);
_3dAnimate = true; _3dAnimate = true;
} }
}, _3dTimeToDetect);
} }
else{ else{
_3dAnimate = false; _3dAnimate = false;
} }
//END TRB00090 - Editor: Long - Date : 09/26/2013 - Summary : remove time to detect 3d animate
} }
//End Function : No.9 - Editor : Long - Date : 08/16/2013 - Summary: //End Function : No.9 - Editor : Long - Date : 08/16/2013 - Summary:
} }
...@@ -1322,7 +1346,6 @@ function onTouchstart(evt){ ...@@ -1322,7 +1346,6 @@ function onTouchstart(evt){
y: touch2.clientY y: touch2.clientY
}); });
px = touch1.clientX+touch2.clientX/2; px = touch1.clientX+touch2.clientX/2;
py = touch1.clientY+touch2.clientY/2; py = touch1.clientY+touch2.clientY/2;
...@@ -1373,8 +1396,7 @@ function onTouchstart(evt){ ...@@ -1373,8 +1396,7 @@ function onTouchstart(evt){
if (hitPageObj) { if (hitPageObj) {
if(is3DObject(hitPageObj)){ if(is3DObject(hitPageObj)){
clearTimeout(this.downTimer); //START TRB00090 - Editor: Long - Date : 09/26/2013 - Summary : remove time to detect 3d animate
this.downTimer = setTimeout(function() {
if(isPageTransition){ if(isPageTransition){
_3dAnimate = false; _3dAnimate = false;
_isClick = true; _isClick = true;
...@@ -1386,10 +1408,7 @@ function onTouchstart(evt){ ...@@ -1386,10 +1408,7 @@ function onTouchstart(evt){
_3dAnimate = true; _3dAnimate = true;
_isClick = false; _isClick = false;
} }
//END TRB00090 - Editor: Long - Date : 09/26/2013 - Summary : remove time to detect 3d animate
}, _3dTimeToDetect);
} }
else{ else{
_3dAnimate = false; _3dAnimate = false;
......
...@@ -315,6 +315,9 @@ function getMediaType1(iValueObj) { ...@@ -315,6 +315,9 @@ function getMediaType1(iValueObj) {
var resourceId = iValueObj.action.resourceId; var resourceId = iValueObj.action.resourceId;
var resourceUrl = ""; var resourceUrl = "";
//START TRB00093 - Editor : Long - Date: 09/26/2013 - Summary : Check undefine before get
if(iValueObj.contentDataSub){
for(var i = 0; i < iValueObj.contentDataSub.length; i++){ for(var i = 0; i < iValueObj.contentDataSub.length; i++){
var tempData = iValueObj.contentDataSub[i]; var tempData = iValueObj.contentDataSub[i];
...@@ -323,6 +326,8 @@ function getMediaType1(iValueObj) { ...@@ -323,6 +326,8 @@ function getMediaType1(iValueObj) {
break; break;
} }
} }
}
//END TRB00093 - Editor : Long - Date: 09/26/2013 - Summary : Check undefine before get
pageObject["imageUrl"] = getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + iValueObj.mediaInfo.resourceId; pageObject["imageUrl"] = getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
pageObject["resourceUrl"] = resourceUrl; pageObject["resourceUrl"] = resourceUrl;
...@@ -662,6 +667,8 @@ function getMediaType9(iValueObj) { ...@@ -662,6 +667,8 @@ function getMediaType9(iValueObj) {
var resourceId = iValueObj.mediaInfo.resourceId; var resourceId = iValueObj.mediaInfo.resourceId;
var resourceUrl = ""; var resourceUrl = "";
//START TRB00093 - Editor : Long - Date: 09/26/2013 - Summary : Check undefine before get
if(iValueObj.contentDataSub){
for(var i = 0; i < iValueObj.contentDataSub.length; i++){ for(var i = 0; i < iValueObj.contentDataSub.length; i++){
var tempData = iValueObj.contentDataSub[i]; var tempData = iValueObj.contentDataSub[i];
...@@ -670,6 +677,8 @@ function getMediaType9(iValueObj) { ...@@ -670,6 +677,8 @@ function getMediaType9(iValueObj) {
break; break;
} }
} }
}
//START TRB00093 - Editor : Long - Date: 09/26/2013 - Summary : Check undefine before get
pageObject["imageUrl"] = 'img/htmltype.png'; pageObject["imageUrl"] = 'img/htmltype.png';
pageObject["resourceUrl"] = resourceUrl; pageObject["resourceUrl"] = resourceUrl;
......
...@@ -143,7 +143,6 @@ function initPage() { ...@@ -143,7 +143,6 @@ function initPage() {
// Lock screen // Lock screen
LockScreen(); LockScreen();
StartTimerUpdateLog(); StartTimerUpdateLog();
/* set start log */ /* set start log */
...@@ -414,6 +413,10 @@ function initPage() { ...@@ -414,6 +413,10 @@ function initPage() {
sizingScreen(); sizingScreen();
} }
} }
//Start : TRB00015 - Editor : Long - Date : 08/28/2013 - Summary : For win 8 rotate handling.
setViewportForWin8();
//End : TRB00015 - Editor : Long - Date : 08/28/2013 - Summary : For win 8 rotate handling.
} }
//START TRB00048 - EDITOR : Long - Date : 09/18/2013 - Summary : //START TRB00048 - EDITOR : Long - Date : 09/18/2013 - Summary :
else if(nAjaxLoad == 4){ else if(nAjaxLoad == 4){
...@@ -550,6 +553,10 @@ function initPage() { ...@@ -550,6 +553,10 @@ function initPage() {
sizingScreen(); sizingScreen();
} }
} }
//Start : TRB00015 - Editor : Long - Date : 08/28/2013 - Summary : For win 8 rotate handling.
setViewportForWin8();
//End : TRB00015 - Editor : Long - Date : 08/28/2013 - Summary : For win 8 rotate handling.
} }
} }
...@@ -587,6 +594,13 @@ function initPageMediaAndHtmlType(){ ...@@ -587,6 +594,13 @@ function initPageMediaAndHtmlType(){
// Lock screen // Lock screen
LockScreen(); LockScreen();
//START TRB00094 - Editor : Long - Date : 09/26/2013 - Summary : Setting log
StartTimerUpdateLog();
/* set start log */
SetStartLog(contentID);
//END TRB00094 - Editor : Long - Date : 09/26/2013 - Summary : Setting log
//enable SpecifyControl //enable SpecifyControl
enableSpecifyControl(); enableSpecifyControl();
......
...@@ -219,18 +219,21 @@ function contentdetail_dspRead_Click_callback(outputId) { ...@@ -219,18 +219,21 @@ function contentdetail_dspRead_Click_callback(outputId) {
if (ClientData.contentInfo_contentType() == ContentTypeKeys.Type_Others) { if (ClientData.contentInfo_contentType() == ContentTypeKeys.Type_Others) {
// Get content detail // Get content detail
avwCmsApi(ClientData.userInfo_accountPath(), "webGetContent", "GET", { contentId: ClientData.contentInfo_contentId(), sid: ClientData.userInfo_sid(), getType: 2 }, // avwCmsApi(ClientData.userInfo_accountPath(), "webGetContent", "GET", { contentId: ClientData.contentInfo_contentId(), sid: ClientData.userInfo_sid(), getType: 2 },
function (data) { // function (data) {
$.each(data.contentData, function (i, n) { // $.each(data.contentData, function (i, n) {
if (typeof n == "object") { // if (typeof n == "object") {
resourceIdDetail = n.resourceId; // resourceIdDetail = n.resourceId;
window.open(getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + resourceIdDetail + "&isDownload=true", "_blank"); // var resourceUrl = getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + resourceIdDetail + "&isDownload=true";
} // window.open(resourceUrl, "_blank");
}); // }
// });
},
null // },
); // null
// );
downloadResourceById(ClientData.contentInfo_contentId());
} }
else { else {
......
...@@ -1042,3 +1042,39 @@ function getIconTypeContent(contentType) { ...@@ -1042,3 +1042,39 @@ function getIconTypeContent(contentType) {
} }
return src; return src;
}; };
// download resouce content id
function downloadResourceById(contentId){
var params = {
sid: ClientData.userInfo_sid(),
contentId: contentId,
getType: '2'
};
/* abapi('webGetContent', params, 'GET', function (data) {
var resourceId=data.contentData.content.resourceId;
//Get resource
resourceUrl = getResourceByIdFromAPI(resourceId);
// open url to download file
window.open(resourceUrl);
}); */
avwCmsApiSync(ClientData.userInfo_accountPath(), "webGetContent", "get", params,
function (data) {
//Get resourceurl
var resourceUrl = getResourceByIdFromAPI(data.contentData.content.resourceId);
// open url to download file
window.open(resourceUrl);
},
function (xhr, b, c) { });
};
//Download resource
function getResourceByIdFromAPI(resourceId){
return getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + resourceId + "&isDownload=true";
};
\ No newline at end of file
...@@ -725,39 +725,39 @@ function isPdfContent(contentType){ ...@@ -725,39 +725,39 @@ function isPdfContent(contentType){
} }
}; };
//Get resource Id of content ////Get resource Id of content
function downloadResourceById(contentId){ //function downloadResourceById(contentId){
var params = { // var params = {
sid: ClientData.userInfo_sid(), // sid: ClientData.userInfo_sid(),
contentId: contentId, // contentId: contentId,
getType: '2', // getType: '2',
}; // };
//
var resourceUrl; // var resourceUrl;
//
abapi('webGetContent', params, 'GET', function (data) { // abapi('webGetContent', params, 'GET', function (data) {
var resourceId; // var resourceId;
//
$.each(data.contentData , function(i, n){ // $.each(data.contentData , function(i, n){
if(typeof n == "object"){ // if(typeof n == "object"){
resourceId = n.resourceId; // resourceId = n.resourceId;
} // }
}); // });
//
//Get resource // //Get resource
resourceUrl = getResourceByIdFromAPI(resourceId); // resourceUrl = getResourceByIdFromAPI(resourceId);
window.open(resourceUrl, "_blank"); // window.open(resourceUrl, "_blank");
// redraw content remove new icon // // redraw content remove new icon
drawEditImage(contentId); // drawEditImage(contentId);
}); // });
}; //};
//Download resource ////Download resource
function getResourceByIdFromAPI(resourceId){ //function getResourceByIdFromAPI(resourceId){
return getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + resourceId + "&isDownload=true"; // return getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + resourceId + "&isDownload=true";
}; //};
/* get url */ /* get url */
function getURL(apiName) { function getURL(apiName) {
...@@ -857,6 +857,9 @@ function readSubmenuFunction_callback(contentId) ...@@ -857,6 +857,9 @@ function readSubmenuFunction_callback(contentId)
if(contentType == ContentTypeKeys.Type_Others){ if(contentType == ContentTypeKeys.Type_Others){
//Download content //Download content
downloadResourceById(contentId); downloadResourceById(contentId);
// redraw content remove new icon
drawEditImage(contentId);
} }
else{ else{
//Go to Conten view page //Go to Conten view page
......
...@@ -478,6 +478,8 @@ function canvasClickFunction_callback(outputId) ...@@ -478,6 +478,8 @@ function canvasClickFunction_callback(outputId)
if(contentType == ContentTypeKeys.Type_Others){ if(contentType == ContentTypeKeys.Type_Others){
//Download content //Download content
downloadResourceById(outputId); downloadResourceById(outputId);
// redraw content remove new icon
drawEditImage(outputId);
} }
else{ else{
//Go to Conten view page //Go to Conten view page
...@@ -584,6 +586,10 @@ function canvasClickFunction_callback(outputId) ...@@ -584,6 +586,10 @@ function canvasClickFunction_callback(outputId)
if(contentType == ContentTypeKeys.Type_Others){ if(contentType == ContentTypeKeys.Type_Others){
//Download content //Download content
downloadResourceById(outputId); downloadResourceById(outputId);
// redraw content remove new icon
drawEditImage(outputId);
} }
else{ else{
//Go to Conten view page //Go to Conten view page
...@@ -1372,6 +1378,10 @@ function readSubmenuFunction_callback(contentId) ...@@ -1372,6 +1378,10 @@ function readSubmenuFunction_callback(contentId)
if(contentType == ContentTypeKeys.Type_Others){ if(contentType == ContentTypeKeys.Type_Others){
//Download content //Download content
downloadResourceById(contentId); downloadResourceById(contentId);
// redraw content remove new icon
drawEditImage(contentId);
} }
else{ else{
//Go to Conten view page //Go to Conten view page
...@@ -2022,40 +2032,37 @@ function isPdfContent(contentType){ ...@@ -2022,40 +2032,37 @@ function isPdfContent(contentType){
}; };
//Get resource Id of content ////Get resource Id of content
function downloadResourceById(contentId){ //function downloadResourceById(contentId){
var params = { // var params = {
sid: ClientData.userInfo_sid(), // sid: ClientData.userInfo_sid(),
contentId: contentId, // contentId: contentId,
getType: '2', // getType: '2',
}; // };
//
var resourceUrl; // var resourceUrl;
//
abapi('webGetContent', params, 'GET', function (data) { // abapi('webGetContent', params, 'GET', function (data) {
var resourceId; // var resourceId;
//
$.each(data.contentData , function(i, n){ // $.each(data.contentData , function(i, n){
if(typeof n == "object"){ // if(typeof n == "object"){
resourceId = n.resourceId; // resourceId = n.resourceId;
} // }
}); // });
//
//Get resource // //Get resource
resourceUrl = getResourceByIdFromAPI(resourceId); // resourceUrl = getResourceByIdFromAPI(resourceId);
window.open(resourceUrl, "_blank");
// redraw content remove new icon // window.open(resourceUrl, "_blank");
drawEditImage(contentId);
}); // });
}; //};
//Download resource ////Download resource
function getResourceByIdFromAPI(resourceId){ //function getResourceByIdFromAPI(resourceId){
return getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + resourceId + "&isDownload=true"; // return getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + resourceId + "&isDownload=true";
}; //};
/* get url */ /* get url */
function getURL(apiName) { function getURL(apiName) {
......
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