Commit 3853437e by Masaru Abe

パフォーマンス対応

スクリーンロックでログアウト対応
ブラウザ閉じるで閲覧ログ送信対応
parent 46d4e2b7
......@@ -4,6 +4,9 @@
* Copyright (C) Agentec Co, Ltd. All rights reserved.
*/
//名前空間用のオブジェクトを用意する
var AVWEB = {};
/*
* User Environment Check Class
*/
......@@ -625,6 +628,12 @@ function avwGrabContentPageImage(accountPath, params, success, error) {
*/
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) {
success(src);
}
......@@ -791,7 +800,7 @@ function showSystemError( textId ) {
text: errMes,
close: function() {
//ログアウト時と同じ後始末処理をしてログイン画面に戻す
if( !webLogoutEvent() ){
if( !COMMON.webLogoutEvent() ){
//ログアウト出来なかった
SessionStorageUtils.clear();
avwUserSetting().remove(Keys.userInfo_sid);
......@@ -834,14 +843,22 @@ function avwClearError() {
/* ブラウザunload時に警告メッセージの出力設定を行う関数 */
function avwSetLogoutNortice() {
window.onbeforeunload = function(event) {
// メッセージ表示
// FFでは、https://bugzilla.mozilla.org/show_bug.cgi?id=588292 によりメッセージが出力されない
var message = i18nText('sysInfoWithoutLogout');
var e = event || window.event;
if(e) {
e.returnValue = message;
}
return message;
//DHカスタム
if( ClientData.serviceOpt_daihatsu() == 'Y'){
if(contentID != null ){
SetEndLog(contentID);
RegisterLog();
}
} else {
// メッセージ表示
// FFでは、https://bugzilla.mozilla.org/show_bug.cgi?id=588292 によりメッセージが出力されない
var message = i18nText('sysInfoWithoutLogout');
var e = event || window.event;
if(e) {
e.returnValue = message;
}
return message;
}
};
};
/* 警告メッセージを出力しないでページ遷移を行う関数 */
......@@ -866,4 +883,5 @@ function getApiUrl(accountPath) {
}
return apiUrl;
};
\ No newline at end of file
};
/// <reference path="avweb.js" />
/// <reference path="screenLock.js" />
/// <reference path="common.js" />
/// <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" />
//名前空間用のオブジェクトを用意する
var COMMON = {};
// =============================================================================================
// Constants [start]
......@@ -2922,3 +2916,35 @@ function isIE10() {
*/
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();
/* show lock screen */
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
var tags = '<div id="' + elmId + '" class="screenLock">' +
'<div style="display:table; width:100%; height:100%;">' +
......@@ -198,7 +218,7 @@ removeLockState();
.keydown(function(event) {
// パスワード入力タイマーを解除
if(pwInputTimer) {
clearTimeout(pwInputTimer);
clearTimeout(pwInputTimer);
}
pwInputTimer = null;
// エンターキーで解除実行
......
......@@ -49,6 +49,7 @@
<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_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>
<link rel="stylesheet" type="text/css" href="css/reset.css?#UPDATEID#" />
......
......@@ -45,6 +45,7 @@
<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/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/home.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" />
/// <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" />
//名前空間用のオブジェクトを用意する
var CONTENTVIEW = {};
/* change size */
function sizingScreen() {
......@@ -1088,26 +1075,79 @@ function changePage(page_index) {
clearCanvas(document.getElementById("offscreen"));
if(contentType == ContentTypeKeys.Type_PDF){
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);
//$('#divImageLoading').css('display', 'none');
var tran = new Transition();
tran.flipToPage(page_index);
},
function (xmlHttpRequest, txtStatus, errorThrown) {
showErrorScreen();
});
//ファイルシステムが有効であればキャッシュ確認
if( CONTENTVIEW_FILESYSTEM.fs == null ){
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();
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 */
getPageObjectsByPageIndex(pageObjectsData, page_index);
getContent().setPageImages(totalPage, pageImages)
.setPageObjects(pageObjects);
var tran = new Transition();
tran.flipToPage(page_index);
};
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();
tran.flipToPage(page_index);
},
function (xmlHttpRequest, txtStatus, errorThrown) {
showErrorScreen();
});
}
);
}
}
//START : TRB00032 - Editor : Long - Date: 09/10/2013 - Summary : type none process
else if(contentType == ContentTypeKeys.Type_NoFile){
......@@ -2020,62 +2060,161 @@ function changePageWithoutSlide(pageMove) {
clearCanvas(document.getElementById("offscreen"));
if(contentType == ContentTypeKeys.Type_PDF){
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;
// screenFit();
getContent().toPage(pageMove);
//START : TRB00028 - Editor: Long - Date: 09/10/2013 - Summary : Fix For Page BGM
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){
//START TRB00056 - Editor: Long - Date: 09/19/2013 - Summary :
prevContent.pageIndex = getPageIndex();
//END TRB00056 - Editor: Long - Date: 09/19/2013 - Summary :
getPrevPageObjectsByPageIndex(pageObjectsData, pageMove - 1);
renderPrevPage();
}
if(pageMove < totalPage - 1){
//START TRB00056
nextContent.pageIndex = getPageIndex();
//END TRB00056
getNextPageObjectsByPageIndex(pageObjectsData, pageMove + 1);
renderNextPage();
}
//End Function : No.4 - Editor : Long - Date: 08/12/2013 - Summary : Handle jump form bookmark page
/* handle slider bar */
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();
});
//ファイルシステムが有効であればキャッシュ確認
if( CONTENTVIEW_FILESYSTEM.fs == null ){
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();
}
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){
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');
}
};
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();
}
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();
}
);
}
);
}
}
//START : TRB00032 - Editor : Long - Date: 09/10/2013 - Summary : type none process
else if(contentType == ContentTypeKeys.Type_NoFile){
......@@ -2665,8 +2804,14 @@ function setViewportForTouchDevice(maximumScale){
};
//End : TRB00022 - Editor : Long - Date : 08/28/2013 - Summary : For ipad rotate handling.
$("document").ready(function () {
$("document").ready(function () {
CONTENTVIEW_FILESYSTEM.initFS(CONTENTVIEW.ready);
});
CONTENTVIEW.ready = function(){
/* check login */
if (!avwCheckLogin(ScreenIds.Login)) return;
// Set event to prevent leave
......@@ -2680,45 +2825,9 @@ $("document").ready(function () {
{ contentId: contentID, sid: ClientData.userInfo_sid(), getType: 1 },
function (data) {
contentType = data.contentData.contentType;
if (avwUserEnvObj.os == 'ipad') {
//Start : TRB00022 - Editor : Long - Date : 08/28/2013 - Summary : For ipad rotate handling.
setViewportForTouchDevice();
//End : TRB00022 - Editor : Long - Date : 08/28/2013 - Summary : For ipad rotate handling.
if (ClientData.IsRefresh() == true) {
//Check if is pdf content
if(isMediaAndHTMLContent()){
initPageMediaAndHtmlType();
//START TRB00059 - EDITOR: Long - Date : 09/19/2013 - Summary : Add title for media and html type
document.title = data.contentData.contentName + ' | ' + i18nText('sysAppTitle');
//END TRB00059 - EDITOR: Long - Date : 09/19/2013 - Summary : Add title for media and html type
}
else{
initPage();
}
} else {
$('body, html').hide();
ClientData.IsRefresh(true);
location.reload();
}
}
else {
//Check if is pdf content
if(isMediaAndHTMLContent()){
initPageMediaAndHtmlType();
//START TRB00059 - EDITOR: Long - Date : 09/19/2013 - Summary : Add title for media and html type
document.title = data.contentData.contentName + ' | ' + i18nText('sysAppTitle');
//END TRB00059 - EDITOR: Long - Date : 09/19/2013 - Summary : Add title for media and html type
}
else{
initPage();
}
}
//console.log("json.txt:" + window.JSON.stringify(data) );
CONTENTVIEW_FILESYSTEM.checkUpdate(contentID, data, CONTENTVIEW.webGetContentApi_funcOk);
},
function (xmlHttpRequest, txtStatus, errorThrown) {
......@@ -2739,9 +2848,56 @@ $("document").ready(function () {
}
}
);
//END TRB00048 - EDITOR : Long - Date : 09/18/2013 - Summary : Fix Jumpcontent
//End Function : No.12
});
};
CONTENTVIEW.webGetContentApi_funcOk = function(data){
console.log("CONTENTVIEW.webGetContentApi_funcOk:" + data.contentData.contentType);
contentType = data.contentData.contentType;
if (avwUserEnvObj.os == 'ipad') {
//Start : TRB00022 - Editor : Long - Date : 08/28/2013 - Summary : For ipad rotate handling.
setViewportForTouchDevice();
//End : TRB00022 - Editor : Long - Date : 08/28/2013 - Summary : For ipad rotate handling.
if (ClientData.IsRefresh() == true) {
//Check if is pdf content
if(isMediaAndHTMLContent()){
initPageMediaAndHtmlType();
//START TRB00059 - EDITOR: Long - Date : 09/19/2013 - Summary : Add title for media and html type
document.title = data.contentData.contentName + ' | ' + i18nText('sysAppTitle');
//END TRB00059 - EDITOR: Long - Date : 09/19/2013 - Summary : Add title for media and html type
}
else{
initPage();
}
} else {
$('body, html').hide();
ClientData.IsRefresh(true);
location.reload();
}
}
else {
//Check if is pdf content
if(isMediaAndHTMLContent()){
initPageMediaAndHtmlType();
//START TRB00059 - EDITOR: Long - Date : 09/19/2013 - Summary : Add title for media and html type
document.title = data.contentData.contentName + ' | ' + i18nText('sysAppTitle');
//END TRB00059 - EDITOR: Long - Date : 09/19/2013 - Summary : Add title for media and html type
}
else{
console.log("CONTENTVIEW.webGetContentApi_funcOk:initPage");
initPage();
}
}
};
/* ========================================================================================================== */
......
......@@ -12,24 +12,74 @@ function abapi(name, param, method, callback) {
//START TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
/* get Json stored content info */
function getJsonContentInfo() {
avwGrabContentPageImage(ClientData.userInfo_accountPath(),
{ contentId: contentID, sid: ClientData.userInfo_sid(), pageNo: 1 },
function (data) {
pageImages = data;
webGetContentData();
getSearchDataFromJson();
getJsonDataPageTitle();
getJsonDataType4();
getJsonDataType5();
getDataJsonFile();
//webGetPageImageContentSize();
webGetContentPageSize();
},
function (xmlHttpRequest, txtStatus, errorThrown) {
showErrorScreen();
});
};
//ファイルシステムが有効であればキャッシュ確認
if( CONTENTVIEW_FILESYSTEM.fs == null ){
//通常
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) {
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
function webGetPageImageContentSize() {
......
......@@ -373,33 +373,90 @@ function firstPage_click() {
clearCanvas(document.getElementById("offscreen"));
if(contentType == ContentTypeKeys.Type_PDF){
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');
//START TRB00097
//userScale = 1;
//changeScale(userScale);
//END TRB00097
checkDisableButtonZoom();
var tran = new Transition();
tran.flipToPage(0);
},
function (xmlHttpRequest, txtStatus, errorThrown) {
showErrorScreen();
});
}
//ファイルシステムが有効であればキャッシュ確認
if( CONTENTVIEW_FILESYSTEM.fs == null ){
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);
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 */
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);
};
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);
checkDisableButtonZoom();
var tran = new Transition();
tran.flipToPage(0);
},
function (xmlHttpRequest, txtStatus, errorThrown) {
showErrorScreen();
}
);
}
);
}
//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);
getContent().setPageImages(totalPage, pageImages).setPageObjects(pageObjects);
......@@ -446,25 +503,86 @@ function lastPage_click() {
//pageImages = getURLPageImage("webContentPageImage") + "?contentId=" + contentID + "&sid=" + ClientData.userInfo_sid() + "&pageNo=" + (totalPage - 1);
if(contentType == ContentTypeKeys.Type_PDF){
avwGrabContentPageImage(ClientData.userInfo_accountPath(),
{ contentId: contentID, sid: ClientData.userInfo_sid(), pageNo: totalPage },
function (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();
});
//ファイルシステムが有効であればキャッシュ確認
if( CONTENTVIEW_FILESYSTEM.fs == null ){
avwGrabContentPageImage(
ClientData.userInfo_accountPath(),
{ contentId: contentID, sid: ClientData.userInfo_sid(), pageNo: totalPage },
function (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 */
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();
}
);
}
);
}
}
//START : TRB00032 - Editor : Long - Date: 09/10/2013 - Summary : type none process
else if(contentType == ContentTypeKeys.Type_NoFile){
......
......@@ -9,24 +9,24 @@
//START TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
/* get Json stored content info */
function getJsonContentInfo() {
avwGrabContentPageImage(ClientData.userInfo_accountPath(),
{ contentId: contentID, sid: ClientData.userInfo_sid(), pageNo: 1 },
function (data) {
pageImages = data;
webGetContentData();
getSearchDataFromJson();
getJsonDataPageTitle();
getJsonDataType4();
getJsonDataType5();
getDataJsonFile();
//webGetPageImageContentSize();
webGetContentPageSize();
},
function (xmlHttpRequest, txtStatus, errorThrown) {
showErrorScreen();
});
};
//function getJsonContentInfo() {
// avwGrabContentPageImage(ClientData.userInfo_accountPath(),
// { contentId: contentID, sid: ClientData.userInfo_sid(), pageNo: 1 },
// function (data) {
// pageImages = data;
// webGetContentData();
// getSearchDataFromJson();
// getJsonDataPageTitle();
// getJsonDataType4();
// getJsonDataType5();
// getDataJsonFile();
// //webGetPageImageContentSize();
// webGetContentPageSize();
// },
// function (xmlHttpRequest, txtStatus, errorThrown) {
// showErrorScreen();
// });
//};
//END TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
......@@ -1238,19 +1238,65 @@ function renderNextPage(){
//Get next page background image
if(contentType == ContentTypeKeys.Type_PDF){
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) {
showErrorScreen();
});
//ファイルシステムが有効であればキャッシュ確認
if( CONTENTVIEW_FILESYSTEM.fs == null ){
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) {
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)
.setPageObjects(nextPageObjects)
.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) {
showErrorScreen();
}
);
}
);
}
}
//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){
......@@ -1271,19 +1317,62 @@ function renderPrevPage(){
//Get prev page background image
if(contentType == ContentTypeKeys.Type_PDF){
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) {
showErrorScreen();
});
//ファイルシステムが有効であればキャッシュ確認
if( CONTENTVIEW_FILESYSTEM.fs == null ){
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) {
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)
.setPageObjects(prevPageObjects)
.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) {
showErrorScreen();
});
}
);
}
}
//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){
......
/// <reference path="../common/js/jquery-ui-1.8.23.custom.min.js" />
/// <reference path="../common/js/common.js" />
/// <reference path="contentview_VarDef.js" />
/// <reference path="contentview_CallApi.js" />
/// <reference path="contentview_GetData.js" />
//名前空間用のオブジェクトを用意する
var CONTENTVIEW_INITOBJECTS = {};
//CONTENTVIEW_INITOBJECTS.initPage = function
/* init Image memo */
function initImageMemo() {
......@@ -132,6 +126,8 @@ function initPage() {
//abe
//alert("initPage");
console.log("initPage");
//START : TRB00034 - DATE : 09/11/2013 - Editor : Long - Summary : Fix for center loading image
setLoadingSize();
//END : TRB00034 - DATE : 09/11/2013 - Editor : Long - Summary : Fix for center loading image
......@@ -168,7 +164,6 @@ function initPage() {
}
else{
getJsonContentInfo();
//Start Function: No.4 - Editor : Long - Date: 08/20/2013
getPageTransitionConfig();
//End Function : No.4 - Editor : Long - Date : 08/20/2013
......@@ -283,6 +278,7 @@ function initPage() {
/*Init Page */
nAjaxLoad++;
console.log("nAjaxLoad:" + nAjaxLoad);
if (nAjaxLoad == 8) {
/* handle from bookmark page */
......
......@@ -403,18 +403,18 @@ function logoutFunction() {
else if (ClientData.userOpt_logoutMode() == 1) { // Logout without backup
// Do nothing
//Logout
webLogoutEvent();
COMMON.webLogoutEvent();
}
}
}
}
// In case: user_data_backup != "Y" -> No backup, logout
else {
webLogoutEvent();
COMMON.webLogoutEvent();
}
}
else{
webLogoutEvent();
COMMON.webLogoutEvent();
}
};
......@@ -423,6 +423,7 @@ function historyClickFunction(){
avwScreenMove(ScreenIds.History);
};
/*
//Web Logout Event
function webLogoutEvent(){
......@@ -453,6 +454,7 @@ function webLogoutEvent(){
return isExisted;
};
*/
//Logout Without Backup function
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
//window.location = ScreenIds.Login;
webLogoutEvent();
COMMON.webLogoutEvent();
};
//Logout With Backup function
......@@ -673,7 +675,7 @@ function DoBackup(isBackupMarking, isBackupMemo, isBackupBookmark,isLogout,funcC
else
{
if (isLogout) {
webLogoutEvent();
COMMON.webLogoutEvent();
}
}
};
......
/// <reference path="../common/js/avweb.js" />
/// <reference path="../common/js/screenLock.js" />
/// <reference path="../common/js/common.js" />
/// <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" />
//名前空間用のオブジェクトを用意する
var HOME = {};
//Start Declare Variables
//----Constant-----------//
......@@ -53,12 +47,19 @@ var home_isMove = false;
var isShowBookShelf = null;
var showNextRecordClickNumber = 1;
//名前空間用のオブジェクトを用意する
var home = {};
//==========================================================
$(document).ready(function () {
HOME.ready();
});
//==========================================================
//$(document).ready(function () {
HOME.ready = function(){
console.log("HOME.ready!");
if (!avwCheckLogin(ScreenIds.Login)) {
return;
}
......@@ -231,8 +232,8 @@ $(document).ready(function () {
if (/msie 9.0/.test(ua) && /windows nt 6.1/.test(ua) && !/tablet/.test(ua)) {
$('.tab_bg_color').css({ "overflow-x": "scroll" });
}
});
};
//});
//日比谷カスタム ここから
function dspHibiyaClickFunction(){
......@@ -1216,8 +1217,7 @@ function getDataJsonFileGroup() {
for (var nIndex = 0; nIndex < tree2.ExpandNodes.length; nIndex++) {
if ($("#" + tree2.ExpandNodes[nIndex]).parent()) {
console.log("tree2.ExpandNodes");
//console.log("tree2.ExpandNodes");
var objParent = $("#" + tree2.ExpandNodes[nIndex]).parent();
var objChild = objParent.children()[0];
if (objChild) {
......@@ -2290,12 +2290,17 @@ function checkUserHasReadContent(contId, resourceVer, metaVer) {
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]);
imgIconNew.onload = function () {
console.log("imgIconNew.onload..1");
ctx.drawImage(imgIconNew, c.width / 2 - resizeImg[0] / 2, c.height - resizeImg[1]);
$("#loadingIcon" + contId).fadeOut('slow', function () {
$('#content-thumbnail' + contId).fadeIn('slow');
});
};
imgIconNew.src = DEFAULT_IMG_CONTENT_NEW;
};
//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) {
});
};
imgIconNew.src = DEFAULT_IMG_CONTENT_NEW;
};
//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