Commit 3853437e by Masaru Abe

パフォーマンス対応

スクリーンロックでログアウト対応
ブラウザ閉じるで閲覧ログ送信対応
parent 46d4e2b7
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
* Copyright (C) Agentec Co, Ltd. All rights reserved. * Copyright (C) Agentec Co, Ltd. All rights reserved.
*/ */
//名前空間用のオブジェクトを用意する
var AVWEB = {};
/* /*
* User Environment Check Class * User Environment Check Class
*/ */
...@@ -625,6 +628,12 @@ function avwGrabContentPageImage(accountPath, params, success, error) { ...@@ -625,6 +628,12 @@ function avwGrabContentPageImage(accountPath, params, success, error) {
*/ */
src = 'data:image/png;base64,' + xmlHttp.responseText; src = 'data:image/png;base64,' + xmlHttp.responseText;
//フィアルシステムが有効であればキャッシュ
if( CONTENTVIEW_FILESYSTEM.fs != null ){
var fileName = "page_" + params.pageNo + ".dat";
CONTENTVIEW_FILESYSTEM.saveFile(params.contentId, fileName, src);
}
if (success) { if (success) {
success(src); success(src);
} }
...@@ -791,7 +800,7 @@ function showSystemError( textId ) { ...@@ -791,7 +800,7 @@ function showSystemError( textId ) {
text: errMes, text: errMes,
close: function() { close: function() {
//ログアウト時と同じ後始末処理をしてログイン画面に戻す //ログアウト時と同じ後始末処理をしてログイン画面に戻す
if( !webLogoutEvent() ){ if( !COMMON.webLogoutEvent() ){
//ログアウト出来なかった //ログアウト出来なかった
SessionStorageUtils.clear(); SessionStorageUtils.clear();
avwUserSetting().remove(Keys.userInfo_sid); avwUserSetting().remove(Keys.userInfo_sid);
...@@ -834,6 +843,13 @@ function avwClearError() { ...@@ -834,6 +843,13 @@ function avwClearError() {
/* ブラウザunload時に警告メッセージの出力設定を行う関数 */ /* ブラウザunload時に警告メッセージの出力設定を行う関数 */
function avwSetLogoutNortice() { function avwSetLogoutNortice() {
window.onbeforeunload = function(event) { window.onbeforeunload = function(event) {
//DHカスタム
if( ClientData.serviceOpt_daihatsu() == 'Y'){
if(contentID != null ){
SetEndLog(contentID);
RegisterLog();
}
} else {
// メッセージ表示 // メッセージ表示
// FFでは、https://bugzilla.mozilla.org/show_bug.cgi?id=588292 によりメッセージが出力されない // FFでは、https://bugzilla.mozilla.org/show_bug.cgi?id=588292 によりメッセージが出力されない
var message = i18nText('sysInfoWithoutLogout'); var message = i18nText('sysInfoWithoutLogout');
...@@ -842,6 +858,7 @@ function avwSetLogoutNortice() { ...@@ -842,6 +858,7 @@ function avwSetLogoutNortice() {
e.returnValue = message; e.returnValue = message;
} }
return message; return message;
}
}; };
}; };
/* 警告メッセージを出力しないでページ遷移を行う関数 */ /* 警告メッセージを出力しないでページ遷移を行う関数 */
...@@ -867,3 +884,4 @@ function getApiUrl(accountPath) { ...@@ -867,3 +884,4 @@ function getApiUrl(accountPath) {
return apiUrl; return apiUrl;
}; };
/// <reference path="avweb.js" />
/// <reference path="screenLock.js" /> //名前空間用のオブジェクトを用意する
/// <reference path="common.js" /> var COMMON = {};
/// <reference path="i18n.js" />
/// <reference path="jquery-1.8.1.min.js" />
/// <reference path="jquery-ui-1.8.23.custom.min.js" />
/// <reference path="jquery.toastmessage.js" />
/// <reference path="pageViewer.js" />
/// <reference path="uuid.js" />
// ============================================================================================= // =============================================================================================
// Constants [start] // Constants [start]
...@@ -2922,3 +2916,35 @@ function isIE10() { ...@@ -2922,3 +2916,35 @@ function isIE10() {
*/ */
return false; return false;
}; };
//Web Logout Event
COMMON.webLogoutEvent = function(){
var isExisted = false;
var params = {
sid: ClientData.userInfo_sid()
};
avwCmsApiSync(ClientData.userInfo_accountPath(), "webLogout", "GET", params,
function (data) {
isExisted = true;
SessionStorageUtils.clear();
avwUserSetting().remove(Keys.userInfo_sid);
// Move to login screen
//window.location = ScreenIds.Login;
avwScreenMove(ScreenIds.Login);
},
function (xmlHttpRequest, txtStatus, errorThrown) {
if (xmlHttpRequest.status == 403) {
isExisted = false;
}
else {
// Show system error
isExisted = true;
}
});
return isExisted;
};
...@@ -156,6 +156,26 @@ removeLockState(); ...@@ -156,6 +156,26 @@ removeLockState();
/* show lock screen */ /* show lock screen */
function showLockScreen() { function showLockScreen() {
//DHカスタム
if( ClientData.serviceOpt_daihatsu() == 'Y'){
if( "contentID" in window ){
if( contentID != null ){
SetEndLog(contentID);
RegisterLog();
}
}
//ログアウトさせる
//ログアウト時と同じ後始末処理をしてログイン画面に戻す
if( !COMMON.webLogoutEvent() ){
//ログアウト出来なかった
SessionStorageUtils.clear();
avwUserSetting().remove(Keys.userInfo_sid);
avwScreenMove(ScreenIds.Login);
}
}
// show message overlay // show message overlay
var tags = '<div id="' + elmId + '" class="screenLock">' + var tags = '<div id="' + elmId + '" class="screenLock">' +
'<div style="display:table; width:100%; height:100%;">' + '<div style="display:table; width:100%; height:100%;">' +
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
<script type="text/javascript" src="./js/contentview_3d.js?#UPDATEID#"></script> <script type="text/javascript" src="./js/contentview_3d.js?#UPDATEID#"></script>
<script type="text/javascript" src="./js/contentview_ContentTypeNone.js?#UPDATEID#"></script> <script type="text/javascript" src="./js/contentview_ContentTypeNone.js?#UPDATEID#"></script>
<script type="text/javascript" src="./js/contentview_ImagePreview.js?#UPDATEID#"></script> <script type="text/javascript" src="./js/contentview_ImagePreview.js?#UPDATEID#"></script>
<script type="text/javascript" src="./js/contentview_FileSystem.js?__UPDATEID__"></script>
<script type="text/javascript" src="./common/js/zoomDetector.js?#UPDATEID#" ></script> <script type="text/javascript" src="./common/js/zoomDetector.js?#UPDATEID#" ></script>
<link rel="stylesheet" type="text/css" href="css/reset.css?#UPDATEID#" /> <link rel="stylesheet" type="text/css" href="css/reset.css?#UPDATEID#" />
......
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,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/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/uuid.js?#UPDATEID#"></script>
<script type="text/javascript" src="./js/contentview_FileSystem.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/home.js?#UPDATEID#"></script> <script type="text/javascript" src="./js/home.js?#UPDATEID#"></script>
<script type="text/javascript" src="./js/header.js?#UPDATEID#"></script> <script type="text/javascript" src="./js/header.js?#UPDATEID#"></script>
......
//名前空間用のオブジェクトを用意する
/// <reference path="../common/js/jquery-ui-1.8.23.custom.min.js" /> var CONTENTVIEW = {};
/// <reference path="../common/js/common.js" />
/// <reference path="contentview_VarDef.js" />
/// <reference path="contentview_CallApi.js" />
/// <reference path="contentview_GetData.js" />
/// <reference path="contentview_InitObjects.js" />
/// <reference path="contentview_Events.js" />
/* change size */ /* change size */
function sizingScreen() { function sizingScreen() {
...@@ -1088,18 +1075,66 @@ function changePage(page_index) { ...@@ -1088,18 +1075,66 @@ function changePage(page_index) {
clearCanvas(document.getElementById("offscreen")); clearCanvas(document.getElementById("offscreen"));
if(contentType == ContentTypeKeys.Type_PDF){ if(contentType == ContentTypeKeys.Type_PDF){
avwGrabContentPageImage(ClientData.userInfo_accountPath(),
//ファイルシステムが有効であればキャッシュ確認
if( CONTENTVIEW_FILESYSTEM.fs == null ){
avwGrabContentPageImage(
ClientData.userInfo_accountPath(),
{ contentId: contentID, sid: ClientData.userInfo_sid(), pageNo: page_index + 1 }, { contentId: contentID, sid: ClientData.userInfo_sid(), pageNo: page_index + 1 },
function (data) { function (data) {
pageImages = data; pageImages = data;
/* get page Objects */
getPageObjectsByPageIndex(pageObjectsData, page_index);
getContent().setPageImages(totalPage, pageImages)
.setPageObjects(pageObjects);
var tran = new Transition();
tran.flipToPage(page_index);
},
function (xmlHttpRequest, txtStatus, errorThrown) {
showErrorScreen();
});
} else {
// ファイル取得
var pageNoTmp = page_index + 1;
var fileName = contentID + "/page_" + pageNoTmp + ".dat";
CONTENTVIEW_FILESYSTEM.fs.root.getFile('/abook/' + fileName, { create: false },
function(fileEntry){
fileEntry.file(
function(file){
var reader = new FileReader();
reader.onloadend = function(e) {
console.log("read FileSystem");
pageImages = e.target.result;
/* get page Objects */ /* get page Objects */
getPageObjectsByPageIndex(pageObjectsData, page_index); getPageObjectsByPageIndex(pageObjectsData, page_index);
getContent().setPageImages(totalPage, pageImages) getContent().setPageImages(totalPage, pageImages)
.setPageObjects(pageObjects); .setPageObjects(pageObjects);
var tran = new Transition();
tran.flipToPage(page_index);
//$('#divImageLoading').css('display', 'none'); };
reader.readAsText(file);
}
);
},
function(err){ // 失敗時のコールバック関数
console.log("NotRead FileSystem");
avwGrabContentPageImage(
ClientData.userInfo_accountPath(),
{ contentId: contentID, sid: ClientData.userInfo_sid(), pageNo: page_index + 1 },
function (data) {
pageImages = data;
/* get page Objects */
getPageObjectsByPageIndex(pageObjectsData, page_index);
getContent().setPageImages(totalPage, pageImages)
.setPageObjects(pageObjects);
var tran = new Transition(); var tran = new Transition();
tran.flipToPage(page_index); tran.flipToPage(page_index);
...@@ -1108,6 +1143,11 @@ function changePage(page_index) { ...@@ -1108,6 +1143,11 @@ function changePage(page_index) {
function (xmlHttpRequest, txtStatus, errorThrown) { function (xmlHttpRequest, txtStatus, errorThrown) {
showErrorScreen(); showErrorScreen();
}); });
}
);
}
} }
//START : TRB00032 - Editor : Long - Date: 09/10/2013 - Summary : type none process //START : TRB00032 - Editor : Long - Date: 09/10/2013 - Summary : type none process
else if(contentType == ContentTypeKeys.Type_NoFile){ else if(contentType == ContentTypeKeys.Type_NoFile){
...@@ -2020,11 +2060,15 @@ function changePageWithoutSlide(pageMove) { ...@@ -2020,11 +2060,15 @@ function changePageWithoutSlide(pageMove) {
clearCanvas(document.getElementById("offscreen")); clearCanvas(document.getElementById("offscreen"));
if(contentType == ContentTypeKeys.Type_PDF){ if(contentType == ContentTypeKeys.Type_PDF){
avwGrabContentPageImage(ClientData.userInfo_accountPath(),
//ファイルシステムが有効であればキャッシュ確認
if( CONTENTVIEW_FILESYSTEM.fs == null ){
avwGrabContentPageImage(
ClientData.userInfo_accountPath(),
{ contentId: contentID, sid: ClientData.userInfo_sid(), pageNo: pageMove + 1 }, { contentId: contentID, sid: ClientData.userInfo_sid(), pageNo: pageMove + 1 },
function (data) { function (data) {
pageImages = data; pageImages = data;
/* get page Objects */ /* get page Objects */
getPageObjectsByPageIndex(pageObjectsData, pageMove); getPageObjectsByPageIndex(pageObjectsData, pageMove);
getContent().setPageImages(totalPage, pageImages).setPageObjects(pageObjects); getContent().setPageImages(totalPage, pageImages).setPageObjects(pageObjects);
...@@ -2032,34 +2076,121 @@ function changePageWithoutSlide(pageMove) { ...@@ -2032,34 +2076,121 @@ function changePageWithoutSlide(pageMove) {
$('#divImageLoading').css('display', 'none'); $('#divImageLoading').css('display', 'none');
isFirstLoad = true; isFirstLoad = true;
// screenFit();
getContent().toPage(pageMove); getContent().toPage(pageMove);
//START : TRB00028 - Editor: Long - Date: 09/10/2013 - Summary : Fix For Page BGM
createPageBGM(); createPageBGM();
//END : TRB00028 - Editor: Long - Date: 09/10/2013 - Summary : Fix For Page BGM
//Start FUnciton: No.4 - Editor : Long - Date : 08/12/2013 - Summary : Handle jump from bookmark page
if(pageMove > 0){ if(pageMove > 0){
//START TRB00056 - Editor: Long - Date: 09/19/2013 - Summary :
prevContent.pageIndex = getPageIndex(); prevContent.pageIndex = getPageIndex();
//END TRB00056 - Editor: Long - Date: 09/19/2013 - Summary :
getPrevPageObjectsByPageIndex(pageObjectsData, pageMove - 1); getPrevPageObjectsByPageIndex(pageObjectsData, pageMove - 1);
renderPrevPage(); renderPrevPage();
} }
if(pageMove < totalPage - 1){
nextContent.pageIndex = getPageIndex();
getNextPageObjectsByPageIndex(pageObjectsData, pageMove + 1);
renderNextPage();
}
handleSliderBar();
if (dataPageTitle[pageMove]) {
if (dataPageTitle[pageMove] != '') {
document.title = contentName + '_' + dataPageTitle[pageMove] + ' | ' + i18nText('sysAppTitle');
} else {
document.title = contentName + ' | ' + i18nText('sysAppTitle');
}
} else {
document.title = contentName + ' | ' + i18nText('sysAppTitle');
}
},
function (xmlHttpRequest, txtStatus, errorThrown) {
showErrorScreen();
}
);
} else {
// ファイル取得
var pageNoTmp = pageMove + 1;
var fileName = contentID + "/page_" + pageNoTmp + ".dat";
CONTENTVIEW_FILESYSTEM.fs.root.getFile('/abook/' + fileName, { create: false },
function(fileEntry){
fileEntry.file(
function(file){
var reader = new FileReader();
reader.onloadend = function(e) {
console.log("read FileSystem");
pageImages = e.target.result;
/* get page Objects */
getPageObjectsByPageIndex(pageObjectsData, pageMove);
getContent().setPageImages(totalPage, pageImages).setPageObjects(pageObjects);
$('#divImageLoading').css('display', 'none');
isFirstLoad = true;
getContent().toPage(pageMove);
createPageBGM();
if(pageMove > 0){
prevContent.pageIndex = getPageIndex();
getPrevPageObjectsByPageIndex(pageObjectsData, pageMove - 1);
renderPrevPage();
}
if(pageMove < totalPage - 1){ if(pageMove < totalPage - 1){
//START TRB00056
nextContent.pageIndex = getPageIndex(); nextContent.pageIndex = getPageIndex();
//END TRB00056
getNextPageObjectsByPageIndex(pageObjectsData, pageMove + 1); getNextPageObjectsByPageIndex(pageObjectsData, pageMove + 1);
renderNextPage(); renderNextPage();
} }
//End Function : No.4 - Editor : Long - Date: 08/12/2013 - Summary : Handle jump form bookmark page handleSliderBar();
if (dataPageTitle[pageMove]) {
if (dataPageTitle[pageMove] != '') {
document.title = contentName + '_' + dataPageTitle[pageMove] + ' | ' + i18nText('sysAppTitle');
} else {
document.title = contentName + ' | ' + i18nText('sysAppTitle');
}
} else {
document.title = contentName + ' | ' + i18nText('sysAppTitle');
}
};
reader.readAsText(file);
}
);
},
function(err){ // 失敗時のコールバック関数
console.log("NotRead FileSystem");
avwGrabContentPageImage(
ClientData.userInfo_accountPath(),
{ contentId: contentID, sid: ClientData.userInfo_sid(), pageNo: pageMove + 1 },
function (data) {
pageImages = data;
/* get page Objects */
getPageObjectsByPageIndex(pageObjectsData, pageMove);
getContent().setPageImages(totalPage, pageImages).setPageObjects(pageObjects);
$('#divImageLoading').css('display', 'none');
isFirstLoad = true;
getContent().toPage(pageMove);
createPageBGM();
if(pageMove > 0){
prevContent.pageIndex = getPageIndex();
getPrevPageObjectsByPageIndex(pageObjectsData, pageMove - 1);
renderPrevPage();
}
if(pageMove < totalPage - 1){
nextContent.pageIndex = getPageIndex();
getNextPageObjectsByPageIndex(pageObjectsData, pageMove + 1);
renderNextPage();
}
/* handle slider bar */
handleSliderBar(); handleSliderBar();
if (dataPageTitle[pageMove]) { if (dataPageTitle[pageMove]) {
...@@ -2075,7 +2206,15 @@ function changePageWithoutSlide(pageMove) { ...@@ -2075,7 +2206,15 @@ function changePageWithoutSlide(pageMove) {
}, },
function (xmlHttpRequest, txtStatus, errorThrown) { function (xmlHttpRequest, txtStatus, errorThrown) {
showErrorScreen(); showErrorScreen();
}); }
);
}
);
}
} }
//START : TRB00032 - Editor : Long - Date: 09/10/2013 - Summary : type none process //START : TRB00032 - Editor : Long - Date: 09/10/2013 - Summary : type none process
else if(contentType == ContentTypeKeys.Type_NoFile){ else if(contentType == ContentTypeKeys.Type_NoFile){
...@@ -2667,6 +2806,12 @@ function setViewportForTouchDevice(maximumScale){ ...@@ -2667,6 +2806,12 @@ function setViewportForTouchDevice(maximumScale){
$("document").ready(function () { $("document").ready(function () {
CONTENTVIEW_FILESYSTEM.initFS(CONTENTVIEW.ready);
});
CONTENTVIEW.ready = function(){
/* check login */ /* check login */
if (!avwCheckLogin(ScreenIds.Login)) return; if (!avwCheckLogin(ScreenIds.Login)) return;
// Set event to prevent leave // Set event to prevent leave
...@@ -2680,6 +2825,35 @@ $("document").ready(function () { ...@@ -2680,6 +2825,35 @@ $("document").ready(function () {
{ contentId: contentID, sid: ClientData.userInfo_sid(), getType: 1 }, { contentId: contentID, sid: ClientData.userInfo_sid(), getType: 1 },
function (data) { function (data) {
//console.log("json.txt:" + window.JSON.stringify(data) );
CONTENTVIEW_FILESYSTEM.checkUpdate(contentID, data, CONTENTVIEW.webGetContentApi_funcOk);
},
function (xmlHttpRequest, txtStatus, errorThrown) {
//ページジャンプ設定をクリア
ClientData.JumpQueue([]);
ClientData.IsJumpBack(false);
if (xmlHttpRequest.status == 404) {
showAlertScreen(i18nText('msgContentNotExist'), ScreenIds.Home);
}
else if(xmlHttpRequest.status == 403) {
//認証エラー
showAlertScreen(i18nText('sysErrorCallApi02'), ScreenIds.Home);
}
else {
// Show system error
showSystemError();
}
}
);
};
CONTENTVIEW.webGetContentApi_funcOk = function(data){
console.log("CONTENTVIEW.webGetContentApi_funcOk:" + data.contentData.contentType);
contentType = data.contentData.contentType; contentType = data.contentData.contentType;
if (avwUserEnvObj.os == 'ipad') { if (avwUserEnvObj.os == 'ipad') {
...@@ -2716,32 +2890,14 @@ $("document").ready(function () { ...@@ -2716,32 +2890,14 @@ $("document").ready(function () {
//END TRB00059 - EDITOR: Long - Date : 09/19/2013 - Summary : Add title for media and html type //END TRB00059 - EDITOR: Long - Date : 09/19/2013 - Summary : Add title for media and html type
} }
else{ else{
initPage();
}
}
},
function (xmlHttpRequest, txtStatus, errorThrown) {
//ページジャンプ設定をクリア console.log("CONTENTVIEW.webGetContentApi_funcOk:initPage");
ClientData.JumpQueue([]);
ClientData.IsJumpBack(false);
if (xmlHttpRequest.status == 404) { initPage();
showAlertScreen(i18nText('msgContentNotExist'), ScreenIds.Home);
}
else if(xmlHttpRequest.status == 403) {
//認証エラー
showAlertScreen(i18nText('sysErrorCallApi02'), ScreenIds.Home);
}
else {
// Show system error
showSystemError();
} }
} }
);
//END TRB00048 - EDITOR : Long - Date : 09/18/2013 - Summary : Fix Jumpcontent };
//End Function : No.12
});
/* ========================================================================================================== */ /* ========================================================================================================== */
......
...@@ -12,7 +12,12 @@ function abapi(name, param, method, callback) { ...@@ -12,7 +12,12 @@ function abapi(name, param, method, callback) {
//START TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content //START TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
/* get Json stored content info */ /* get Json stored content info */
function getJsonContentInfo() { function getJsonContentInfo() {
avwGrabContentPageImage(ClientData.userInfo_accountPath(),
//ファイルシステムが有効であればキャッシュ確認
if( CONTENTVIEW_FILESYSTEM.fs == null ){
//通常
avwGrabContentPageImage(
ClientData.userInfo_accountPath(),
{ contentId: contentID, sid: ClientData.userInfo_sid(), pageNo: 1 }, { contentId: contentID, sid: ClientData.userInfo_sid(), pageNo: 1 },
function (data) { function (data) {
pageImages = data; pageImages = data;
...@@ -22,14 +27,59 @@ function getJsonContentInfo() { ...@@ -22,14 +27,59 @@ function getJsonContentInfo() {
getJsonDataType4(); getJsonDataType4();
getJsonDataType5(); getJsonDataType5();
getDataJsonFile(); getDataJsonFile();
//webGetPageImageContentSize();
webGetContentPageSize(); webGetContentPageSize();
}, },
function (xmlHttpRequest, txtStatus, errorThrown) { function (xmlHttpRequest, txtStatus, errorThrown) {
showErrorScreen(); showErrorScreen();
}
);
} else {
// 1ページ目のファイル取得
var fileName = contentID + "/page_1.dat";
CONTENTVIEW_FILESYSTEM.fs.root.getFile('/abook/' + fileName, { create: false },
function(fileEntry){
fileEntry.file(function(file){
var reader = new FileReader();
reader.onloadend = function(e) {
console.log("read FileSystem");
pageImages = e.target.result;
webGetContentData();
getSearchDataFromJson();
getJsonDataPageTitle();
getJsonDataType4();
getJsonDataType5();
getDataJsonFile();
webGetContentPageSize();
};
//reader.readAsBinaryString(fileEntry);
reader.readAsText(file);
//reader.readAsArrayBuffer(fileEntry);
}); });
}; },
function(err){
// 失敗時のコールバック関数
console.log("NotRead FileSystem");
avwGrabContentPageImage(
ClientData.userInfo_accountPath(),
{ contentId: contentID, sid: ClientData.userInfo_sid(), pageNo: 1 },
function (data) {
pageImages = data;
webGetContentData();
getSearchDataFromJson();
getJsonDataPageTitle();
getJsonDataType4();
getJsonDataType5();
getDataJsonFile();
webGetContentPageSize();
},
function (xmlHttpRequest, txtStatus, errorThrown) {
CONTENTVIEW.showErrorScreen();
}
);
}
);
}
}
//END TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content //END TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
function webGetPageImageContentSize() { function webGetPageImageContentSize() {
......
...@@ -373,22 +373,76 @@ function firstPage_click() { ...@@ -373,22 +373,76 @@ function firstPage_click() {
clearCanvas(document.getElementById("offscreen")); clearCanvas(document.getElementById("offscreen"));
if(contentType == ContentTypeKeys.Type_PDF){ if(contentType == ContentTypeKeys.Type_PDF){
avwGrabContentPageImage(ClientData.userInfo_accountPath(),
//ファイルシステムが有効であればキャッシュ確認
if( CONTENTVIEW_FILESYSTEM.fs == null ){
avwGrabContentPageImage(
ClientData.userInfo_accountPath(),
{ contentId: contentID, sid: ClientData.userInfo_sid(), pageNo: 1 }, { contentId: contentID, sid: ClientData.userInfo_sid(), pageNo: 1 },
function (data) { function (data) {
pageImages = data; pageImages = data;
/* get page Objects */
getPageObjectsByPageIndex(pageObjectsData, 0);
getContent().setPageImages(totalPage, pageImages).setPageObjects(pageObjects);
$('#divImageLoading').css('display', 'none');
//userScale = 1;
//changeScale(userScale);
checkDisableButtonZoom();
var tran = new Transition();
tran.flipToPage(0);
},
function (xmlHttpRequest, txtStatus, errorThrown) {
showErrorScreen();
}
);
} else {
// ファイル取得
var fileName = contentID + "/page_1.dat";
CONTENTVIEW_FILESYSTEM.fs.root.getFile('/abook/' + fileName, { create: false },
function(fileEntry){
fileEntry.file(
function(file){
var reader = new FileReader();
reader.onloadend = function(e) {
console.log("read FileSystem");
pageImages = e.target.result;
/* get page Objects */ /* get page Objects */
getPageObjectsByPageIndex(pageObjectsData, 0); getPageObjectsByPageIndex(pageObjectsData, 0);
getContent().setPageImages(totalPage, pageImages).setPageObjects(pageObjects); getContent().setPageImages(totalPage, pageImages).setPageObjects(pageObjects);
$('#divImageLoading').css('display', 'none'); $('#divImageLoading').css('display', 'none');
//START TRB00097
//userScale = 1; //userScale = 1;
//changeScale(userScale);
checkDisableButtonZoom();
var tran = new Transition();
tran.flipToPage(0);
};
reader.readAsText(file);
}
);
},
function(err){ // 失敗時のコールバック関数
console.log("NotRead FileSystem");
avwGrabContentPageImage(
ClientData.userInfo_accountPath(),
{ contentId: contentID, sid: ClientData.userInfo_sid(), pageNo: 1 },
function (data) {
pageImages = data;
/* get page Objects */
getPageObjectsByPageIndex(pageObjectsData, 0);
getContent().setPageImages(totalPage, pageImages).setPageObjects(pageObjects);
$('#divImageLoading').css('display', 'none');
//userScale = 1;
//changeScale(userScale); //changeScale(userScale);
//END TRB00097
checkDisableButtonZoom(); checkDisableButtonZoom();
var tran = new Transition(); var tran = new Transition();
tran.flipToPage(0); tran.flipToPage(0);
...@@ -396,10 +450,13 @@ function firstPage_click() { ...@@ -396,10 +450,13 @@ function firstPage_click() {
}, },
function (xmlHttpRequest, txtStatus, errorThrown) { function (xmlHttpRequest, txtStatus, errorThrown) {
showErrorScreen(); showErrorScreen();
}); }
);
}
);
} }
//START : TRB00032 - Editor : Long - Date: 09/10/2013 - Summary : type none process //START : TRB00032 - Editor : Long - Date: 09/10/2013 - Summary : type none process
else if(contentType == ContentTypeKeys.Type_NoFile){ } else if(contentType == ContentTypeKeys.Type_NoFile){
getPageObjectsByPageIndex(pageObjectsData, 0); getPageObjectsByPageIndex(pageObjectsData, 0);
getContent().setPageImages(totalPage, pageImages).setPageObjects(pageObjects); getContent().setPageImages(totalPage, pageImages).setPageObjects(pageObjects);
...@@ -446,11 +503,65 @@ function lastPage_click() { ...@@ -446,11 +503,65 @@ function lastPage_click() {
//pageImages = getURLPageImage("webContentPageImage") + "?contentId=" + contentID + "&sid=" + ClientData.userInfo_sid() + "&pageNo=" + (totalPage - 1); //pageImages = getURLPageImage("webContentPageImage") + "?contentId=" + contentID + "&sid=" + ClientData.userInfo_sid() + "&pageNo=" + (totalPage - 1);
if(contentType == ContentTypeKeys.Type_PDF){ if(contentType == ContentTypeKeys.Type_PDF){
avwGrabContentPageImage(ClientData.userInfo_accountPath(),
//ファイルシステムが有効であればキャッシュ確認
if( CONTENTVIEW_FILESYSTEM.fs == null ){
avwGrabContentPageImage(
ClientData.userInfo_accountPath(),
{ contentId: contentID, sid: ClientData.userInfo_sid(), pageNo: totalPage }, { contentId: contentID, sid: ClientData.userInfo_sid(), pageNo: totalPage },
function (data) { function (data) {
pageImages = data; pageImages = data;
/* get page Objects */
getPageObjectsByPageIndex(pageObjectsData, totalPage - 1);
getContent().setPageImages(totalPage, pageImages).setPageObjects(pageObjects);
$('#divImageLoading').css('display', 'none');
checkDisableButtonZoom();
var tran = new Transition();
tran.flipToPage(totalPage - 1);
},
function (xmlHttpRequest, txtStatus, errorThrown) {
showErrorScreen();
}
);
} else {
// ファイル取得
var fileName = contentID + "/page_" + totalPage + ".dat";
CONTENTVIEW_FILESYSTEM.fs.root.getFile('/abook/' + fileName, { create: false },
function(fileEntry){
fileEntry.file(
function(file){
var reader = new FileReader();
reader.onloadend = function(e) {
console.log("read FileSystem");
pageImages = e.target.result;
/* get page Objects */
getPageObjectsByPageIndex(pageObjectsData, totalPage - 1);
getContent().setPageImages(totalPage, pageImages).setPageObjects(pageObjects);
$('#divImageLoading').css('display', 'none');
checkDisableButtonZoom();
var tran = new Transition();
tran.flipToPage(totalPage - 1);
};
reader.readAsText(file);
}
);
},
function(err){ // 失敗時のコールバック関数
console.log("NotRead FileSystem");
avwGrabContentPageImage(
ClientData.userInfo_accountPath(),
{ contentId: contentID, sid: ClientData.userInfo_sid(), pageNo: totalPage },
function (data) {
pageImages = data;
/* get page Objects */ /* get page Objects */
getPageObjectsByPageIndex(pageObjectsData, totalPage - 1); getPageObjectsByPageIndex(pageObjectsData, totalPage - 1);
getContent().setPageImages(totalPage, pageImages).setPageObjects(pageObjects); getContent().setPageImages(totalPage, pageImages).setPageObjects(pageObjects);
...@@ -464,7 +575,14 @@ function lastPage_click() { ...@@ -464,7 +575,14 @@ function lastPage_click() {
}, },
function (xmlHttpRequest, txtStatus, errorThrown) { function (xmlHttpRequest, txtStatus, errorThrown) {
showErrorScreen(); showErrorScreen();
}); }
);
}
);
}
} }
//START : TRB00032 - Editor : Long - Date: 09/10/2013 - Summary : type none process //START : TRB00032 - Editor : Long - Date: 09/10/2013 - Summary : type none process
else if(contentType == ContentTypeKeys.Type_NoFile){ else if(contentType == ContentTypeKeys.Type_NoFile){
......
...@@ -9,24 +9,24 @@ ...@@ -9,24 +9,24 @@
//START TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content //START TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
/* get Json stored content info */ /* get Json stored content info */
function getJsonContentInfo() { //function getJsonContentInfo() {
avwGrabContentPageImage(ClientData.userInfo_accountPath(), // avwGrabContentPageImage(ClientData.userInfo_accountPath(),
{ contentId: contentID, sid: ClientData.userInfo_sid(), pageNo: 1 }, // { contentId: contentID, sid: ClientData.userInfo_sid(), pageNo: 1 },
function (data) { // function (data) {
pageImages = data; // pageImages = data;
webGetContentData(); // webGetContentData();
getSearchDataFromJson(); // getSearchDataFromJson();
getJsonDataPageTitle(); // getJsonDataPageTitle();
getJsonDataType4(); // getJsonDataType4();
getJsonDataType5(); // getJsonDataType5();
getDataJsonFile(); // getDataJsonFile();
//webGetPageImageContentSize(); // //webGetPageImageContentSize();
webGetContentPageSize(); // webGetContentPageSize();
}, // },
function (xmlHttpRequest, txtStatus, errorThrown) { // function (xmlHttpRequest, txtStatus, errorThrown) {
showErrorScreen(); // showErrorScreen();
}); // });
}; //};
//END TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content //END TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
...@@ -1238,19 +1238,65 @@ function renderNextPage(){ ...@@ -1238,19 +1238,65 @@ function renderNextPage(){
//Get next page background image //Get next page background image
if(contentType == ContentTypeKeys.Type_PDF){ if(contentType == ContentTypeKeys.Type_PDF){
avwGrabContentPageImage(ClientData.userInfo_accountPath(),
//ファイルシステムが有効であればキャッシュ確認
if( CONTENTVIEW_FILESYSTEM.fs == null ){
avwGrabContentPageImage(
ClientData.userInfo_accountPath(),
{ contentId: contentID, sid: ClientData.userInfo_sid(), pageNo: pageNo }, { contentId: contentID, sid: ClientData.userInfo_sid(), pageNo: pageNo },
function (data) { function (data) {
nextPageImage = data; nextPageImage = data;
nextContent.setPageImages(totalPage, nextPageImage)
.setPageObjects(nextPageObjects)
.nextPage();
},
function (xmlHttpRequest, txtStatus, errorThrown) {
showErrorScreen();
}
);
} else {
// ファイル取得
var fileName = contentID + "/page_" + pageNo + ".dat";
CONTENTVIEW_FILESYSTEM.fs.root.getFile('/abook/' + fileName, { create: false },
function(fileEntry){
fileEntry.file(
function(file){
var reader = new FileReader();
reader.onloadend = function(e) {
console.log("read FileSystem");
nextPageImage = e.target.result;
nextContent.setPageImages(totalPage, nextPageImage) nextContent.setPageImages(totalPage, nextPageImage)
.setPageObjects(nextPageObjects) .setPageObjects(nextPageObjects)
.nextPage(); .nextPage();
};
reader.readAsText(file);
}
);
},
function(err){ // 失敗時のコールバック関数
console.log("NotRead FileSystem");
avwGrabContentPageImage(
ClientData.userInfo_accountPath(),
{ contentId: contentID, sid: ClientData.userInfo_sid(), pageNo: pageNo },
function (data) {
nextPageImage = data;
nextContent.setPageImages(totalPage, nextPageImage)
.setPageObjects(nextPageObjects)
.nextPage();
}, },
function (xmlHttpRequest, txtStatus, errorThrown) { function (xmlHttpRequest, txtStatus, errorThrown) {
showErrorScreen(); showErrorScreen();
}); }
);
}
);
}
} }
//Start Function : No.12 - Editor : Long - Date : 08/28/2013 - Summary : Render next page content image the same with the current one //Start Function : No.12 - Editor : Long - Date : 08/28/2013 - Summary : Render next page content image the same with the current one
else if(contentType == ContentTypeKeys.Type_NoFile){ else if(contentType == ContentTypeKeys.Type_NoFile){
...@@ -1271,19 +1317,62 @@ function renderPrevPage(){ ...@@ -1271,19 +1317,62 @@ function renderPrevPage(){
//Get prev page background image //Get prev page background image
if(contentType == ContentTypeKeys.Type_PDF){ if(contentType == ContentTypeKeys.Type_PDF){
//ファイルシステムが有効であればキャッシュ確認
if( CONTENTVIEW_FILESYSTEM.fs == null ){
avwGrabContentPageImage(ClientData.userInfo_accountPath(), avwGrabContentPageImage(ClientData.userInfo_accountPath(),
{ contentId: contentID, sid: ClientData.userInfo_sid(), pageNo: pageNo }, { contentId: contentID, sid: ClientData.userInfo_sid(), pageNo: pageNo },
function (data) { function (data) {
prevPageImage = data; prevPageImage = data;
prevContent.setPageImages(totalPage, prevPageImage)
.setPageObjects(prevPageObjects)
.previousPage();
},
function (xmlHttpRequest, txtStatus, errorThrown) {
showErrorScreen();
});
} else {
// ファイル取得
var fileName = contentID + "/page_" + pageNo + ".dat";
CONTENTVIEW_FILESYSTEM.fs.root.getFile('/abook/' + fileName, { create: false },
function(fileEntry){
fileEntry.file(
function(file){
var reader = new FileReader();
reader.onloadend = function(e) {
console.log("read FileSystem");
prevPageImage = e.target.result;
prevContent.setPageImages(totalPage, prevPageImage) prevContent.setPageImages(totalPage, prevPageImage)
.setPageObjects(prevPageObjects) .setPageObjects(prevPageObjects)
.previousPage(); .previousPage();
};
reader.readAsText(file);
}
);
},
function(err){ // 失敗時のコールバック関数
console.log("NotRead FileSystem");
avwGrabContentPageImage(ClientData.userInfo_accountPath(),
{ contentId: contentID, sid: ClientData.userInfo_sid(), pageNo: pageNo },
function (data) {
prevPageImage = data;
prevContent.setPageImages(totalPage, prevPageImage)
.setPageObjects(prevPageObjects)
.previousPage();
}, },
function (xmlHttpRequest, txtStatus, errorThrown) { function (xmlHttpRequest, txtStatus, errorThrown) {
showErrorScreen(); showErrorScreen();
}); });
}
);
}
} }
//Start Function : No.12 - Editor : Long - Date : 08/28/2013 - Summary : Render next page content image the same with the current one //Start Function : No.12 - Editor : Long - Date : 08/28/2013 - Summary : Render next page content image the same with the current one
else if(contentType == ContentTypeKeys.Type_NoFile){ else if(contentType == ContentTypeKeys.Type_NoFile){
......
/// <reference path="../common/js/jquery-ui-1.8.23.custom.min.js" /> //名前空間用のオブジェクトを用意する
var CONTENTVIEW_INITOBJECTS = {};
/// <reference path="../common/js/common.js" />
/// <reference path="contentview_VarDef.js" />
/// <reference path="contentview_CallApi.js" />
/// <reference path="contentview_GetData.js" />
//CONTENTVIEW_INITOBJECTS.initPage = function
/* init Image memo */ /* init Image memo */
function initImageMemo() { function initImageMemo() {
...@@ -132,6 +126,8 @@ function initPage() { ...@@ -132,6 +126,8 @@ function initPage() {
//abe //abe
//alert("initPage"); //alert("initPage");
console.log("initPage");
//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
setLoadingSize(); setLoadingSize();
//END : TRB00034 - DATE : 09/11/2013 - Editor : Long - Summary : Fix for center loading image //END : TRB00034 - DATE : 09/11/2013 - Editor : Long - Summary : Fix for center loading image
...@@ -168,7 +164,6 @@ function initPage() { ...@@ -168,7 +164,6 @@ function initPage() {
} }
else{ else{
getJsonContentInfo(); getJsonContentInfo();
//Start Function: No.4 - Editor : Long - Date: 08/20/2013 //Start Function: No.4 - Editor : Long - Date: 08/20/2013
getPageTransitionConfig(); getPageTransitionConfig();
//End Function : No.4 - Editor : Long - Date : 08/20/2013 //End Function : No.4 - Editor : Long - Date : 08/20/2013
...@@ -283,6 +278,7 @@ function initPage() { ...@@ -283,6 +278,7 @@ function initPage() {
/*Init Page */ /*Init Page */
nAjaxLoad++; nAjaxLoad++;
console.log("nAjaxLoad:" + nAjaxLoad);
if (nAjaxLoad == 8) { if (nAjaxLoad == 8) {
/* handle from bookmark page */ /* handle from bookmark page */
......
...@@ -403,18 +403,18 @@ function logoutFunction() { ...@@ -403,18 +403,18 @@ function logoutFunction() {
else if (ClientData.userOpt_logoutMode() == 1) { // Logout without backup else if (ClientData.userOpt_logoutMode() == 1) { // Logout without backup
// Do nothing // Do nothing
//Logout //Logout
webLogoutEvent(); COMMON.webLogoutEvent();
} }
} }
} }
} }
// In case: user_data_backup != "Y" -> No backup, logout // In case: user_data_backup != "Y" -> No backup, logout
else { else {
webLogoutEvent(); COMMON.webLogoutEvent();
} }
} }
else{ else{
webLogoutEvent(); COMMON.webLogoutEvent();
} }
}; };
...@@ -423,6 +423,7 @@ function historyClickFunction(){ ...@@ -423,6 +423,7 @@ function historyClickFunction(){
avwScreenMove(ScreenIds.History); avwScreenMove(ScreenIds.History);
}; };
/*
//Web Logout Event //Web Logout Event
function webLogoutEvent(){ function webLogoutEvent(){
...@@ -453,6 +454,7 @@ function webLogoutEvent(){ ...@@ -453,6 +454,7 @@ function webLogoutEvent(){
return isExisted; return isExisted;
}; };
*/
//Logout Without Backup function //Logout Without Backup function
function confirmWithoutBackupFunction(e) { function confirmWithoutBackupFunction(e) {
...@@ -468,7 +470,7 @@ function confirmWithoutBackupFunction(e) { ...@@ -468,7 +470,7 @@ function confirmWithoutBackupFunction(e) {
ClientData.userOpt_logoutMode(1); // In next time, if choose: [do not show dialog], will not backup and logout ClientData.userOpt_logoutMode(1); // In next time, if choose: [do not show dialog], will not backup and logout
//window.location = ScreenIds.Login; //window.location = ScreenIds.Login;
webLogoutEvent(); COMMON.webLogoutEvent();
}; };
//Logout With Backup function //Logout With Backup function
...@@ -673,7 +675,7 @@ function DoBackup(isBackupMarking, isBackupMemo, isBackupBookmark,isLogout,funcC ...@@ -673,7 +675,7 @@ function DoBackup(isBackupMarking, isBackupMemo, isBackupBookmark,isLogout,funcC
else else
{ {
if (isLogout) { if (isLogout) {
webLogoutEvent(); COMMON.webLogoutEvent();
} }
} }
}; };
......
/// <reference path="../common/js/avweb.js" />
/// <reference path="../common/js/screenLock.js" /> //名前空間用のオブジェクトを用意する
/// <reference path="../common/js/common.js" /> var HOME = {};
/// <reference path="../common/js/i18n.js" />
/// <reference path="../common/js/jquery-1.8.1.min.js" />
/// <reference path="../common/js/jquery-ui-1.8.23.custom.min.js" />
/// <reference path="../common/js/jquery.toastmessage.js" />
/// <reference path="../common/js/pageViewer.js" />
/// <reference path="header.js" />
//Start Declare Variables //Start Declare Variables
//----Constant-----------// //----Constant-----------//
...@@ -53,11 +47,18 @@ var home_isMove = false; ...@@ -53,11 +47,18 @@ var home_isMove = false;
var isShowBookShelf = null; var isShowBookShelf = null;
var showNextRecordClickNumber = 1; var showNextRecordClickNumber = 1;
//名前空間用のオブジェクトを用意する $(document).ready(function () {
var home = {};
HOME.ready();
});
//========================================================== //==========================================================
$(document).ready(function () { //$(document).ready(function () {
HOME.ready = function(){
console.log("HOME.ready!");
if (!avwCheckLogin(ScreenIds.Login)) { if (!avwCheckLogin(ScreenIds.Login)) {
return; return;
...@@ -231,8 +232,8 @@ $(document).ready(function () { ...@@ -231,8 +232,8 @@ $(document).ready(function () {
if (/msie 9.0/.test(ua) && /windows nt 6.1/.test(ua) && !/tablet/.test(ua)) { if (/msie 9.0/.test(ua) && /windows nt 6.1/.test(ua) && !/tablet/.test(ua)) {
$('.tab_bg_color').css({ "overflow-x": "scroll" }); $('.tab_bg_color').css({ "overflow-x": "scroll" });
} }
};
}); //});
//日比谷カスタム ここから //日比谷カスタム ここから
function dspHibiyaClickFunction(){ function dspHibiyaClickFunction(){
...@@ -1216,8 +1217,7 @@ function getDataJsonFileGroup() { ...@@ -1216,8 +1217,7 @@ function getDataJsonFileGroup() {
for (var nIndex = 0; nIndex < tree2.ExpandNodes.length; nIndex++) { for (var nIndex = 0; nIndex < tree2.ExpandNodes.length; nIndex++) {
if ($("#" + tree2.ExpandNodes[nIndex]).parent()) { if ($("#" + tree2.ExpandNodes[nIndex]).parent()) {
console.log("tree2.ExpandNodes"); //console.log("tree2.ExpandNodes");
var objParent = $("#" + tree2.ExpandNodes[nIndex]).parent(); var objParent = $("#" + tree2.ExpandNodes[nIndex]).parent();
var objChild = objParent.children()[0]; var objChild = objParent.children()[0];
if (objChild) { if (objChild) {
...@@ -2290,12 +2290,17 @@ function checkUserHasReadContent(contId, resourceVer, metaVer) { ...@@ -2290,12 +2290,17 @@ function checkUserHasReadContent(contId, resourceVer, metaVer) {
var resizeImg = resizeResourceThumbnail(imgThumb, c.width, c.height); var resizeImg = resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, (c.width / 2) - (resizeImg[0] / 2) + 4, c.height - resizeImg[1] + 4, resizeImg[0], resizeImg[1]); ctx.drawImage(imgThumb, (c.width / 2) - (resizeImg[0] / 2) + 4, c.height - resizeImg[1] + 4, resizeImg[0], resizeImg[1]);
imgIconNew.onload = function () { imgIconNew.onload = function () {
console.log("imgIconNew.onload..1");
ctx.drawImage(imgIconNew, c.width / 2 - resizeImg[0] / 2, c.height - resizeImg[1]); ctx.drawImage(imgIconNew, c.width / 2 - resizeImg[0] / 2, c.height - resizeImg[1]);
$("#loadingIcon" + contId).fadeOut('slow', function () { $("#loadingIcon" + contId).fadeOut('slow', function () {
$('#content-thumbnail' + contId).fadeIn('slow'); $('#content-thumbnail' + contId).fadeIn('slow');
}); });
}; };
imgIconNew.src = DEFAULT_IMG_CONTENT_NEW; imgIconNew.src = DEFAULT_IMG_CONTENT_NEW;
}; };
//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.
...@@ -2379,6 +2384,7 @@ function checkUserHasReadContent(contId, resourceVer, metaVer) { ...@@ -2379,6 +2384,7 @@ function checkUserHasReadContent(contId, resourceVer, metaVer) {
}); });
}; };
imgIconNew.src = DEFAULT_IMG_CONTENT_NEW; imgIconNew.src = DEFAULT_IMG_CONTENT_NEW;
}; };
//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.
......
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