Commit 44899bb0 by Masaru Abe

テスト対応

parent 1377ba9a
......@@ -5506,12 +5506,7 @@ CONTENTVIEW.screenMove = function(){
CONTENTVIEW.screenBack = function(){
//後始末
$('#dialog').hide();
$('#dialog').empty();
$('#dialog').removeClass();
$('#dialog').removeAttr('style');
$('#dialog').addClass('web_dialog');
$('#divCacheLoading').hide();
CONTENTVIEW.initScreen();
$("#viewer").hide();
if( $('#bookshelf').length || $('#list').length ){
......@@ -5548,6 +5543,23 @@ CONTENTVIEW.screenBack = function(){
};
CONTENTVIEW.initScreen = function(){
//画面初期化
if ($('#canvasWrapper').length) {
$('#canvasWrapper').empty();
}
if ($('#dialog').length) {
$('#dialog').hide();
$('#dialog').empty();
$('#dialog').removeClass();
$('#dialog').removeAttr('style');
$('#dialog').addClass('web_dialog');
}
$('#divCacheLoading').hide();
};
$(function () {
//CONTENTVIEW.ready();
});
......@@ -5625,12 +5637,7 @@ CONTENTVIEW.ready = function(){
}
//画面初期化
$('#dialog').hide();
$('#dialog').empty();
$('#dialog').removeClass();
$('#dialog').removeAttr('style');
$('#dialog').addClass('web_dialog');
$('#divCacheLoading').hide();
CONTENTVIEW.initScreen();
/* check login */
if (!AVWEB.avwCheckLogin(COMMON.ScreenIds.Login)) return;
......
......@@ -358,69 +358,61 @@ CONTENTVIEW_FILESYSTEM.createMovieCache = function(resourceUrl, fileName) {
return;
}
//既にビジーなら戻る
if(CONTENTVIEW_FILESYSTEM.isXhrBusy){
return;
}
//キャッシュ化
var downloadSize = null;
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function(){
if (this.readyState == 2 ){
downloadSize = xhr.getResponseHeader('Content-Length');
console.log("Content-Length:" + downloadSize);
console.log("limit:" + AVWEB.avwSysSetting().movieCacheLimitMB);
//制限値チェック
if(downloadSize){
if( downloadSize > AVWEB.avwSysSetting().movieCacheLimitMB * COMMON.MB_BYTE ){
console.log("abort");
xhr.abort();
}
}
}
if (this.readyState == 4 && this.status == 200){
if(this.readyState == 4){
CONTENTVIEW_FILESYSTEM.isXhrBusy = false;
$('#divCacheLoading').css('display', 'none');
//this.response is what you're looking for
//AVWEB.avwLog(this.response, typeof this.response);
CONTENTVIEW_FILESYSTEM.fs.root.getFile(
fileName,
{create: true},
function(fileEntry){
fileEntry.createWriter(
function(fileWriter) {
fileWriter.onwriteend = function(e) {
AVWEB.avwLog('RES書き込み完了 size=' + fileWriter.length);
if(downloadSize){
if( downloadSize > AVWEB.avwSysSetting().movieCacheLimitMB * COMMON.MB_BYTE ){
CONTENTVIEW_FILESYSTEM.deleteMovieCache(fileName);
} else if( downloadSize != fileWriter.length ){
CONTENTVIEW_FILESYSTEM.deleteMovieCache(fileName);
}
}
};
fileWriter.onerror = function(e) {
//AVWEB.avwLog('RES書き込みエラー: ' + e.toString());
};
var blobData = new Blob([xhr.response], {type:"application/octet-stream"});
fileWriter.write(blobData);
}
);
},
CONTENTVIEW_FILESYSTEM.errorHandler
);
} else {
if( this.readyState == 2 ){
//AVWEB.avwLog("onreadystatechange:" + this.readyState + " " + this.status);
if(this.status == 200){
//this.response is what you're looking for
//AVWEB.avwLog(this.response, typeof this.response);
CONTENTVIEW_FILESYSTEM.fs.root.getFile(
fileName,
{create: true},
function(fileEntry){
fileEntry.createWriter(
function(fileWriter) {
fileWriter.onwriteend = function(e) {
AVWEB.avwLog('RES書き込み完了 size=' + fileWriter.length);
if(downloadSize){
if( downloadSize > AVWEB.avwSysSetting().movieCacheLimitMB * COMMON.MB_BYTE ){
CONTENTVIEW_FILESYSTEM.deleteMovieCache(fileName);
} else if( downloadSize != fileWriter.length ){
CONTENTVIEW_FILESYSTEM.deleteMovieCache(fileName);
}
}
};
fileWriter.onerror = function(e) {
//AVWEB.avwLog('RES書き込みエラー: ' + e.toString());
};
var blobData = new Blob([xhr.response], {type:"application/octet-stream"});
fileWriter.write(blobData);
}
);
},
CONTENTVIEW_FILESYSTEM.errorHandler
);
}
} else if( this.readyState == 2 ){
AVWEB.avwLog("onreadystatechange:" + this.readyState + " " + this.status);
downloadSize = xhr.getResponseHeader('Content-Length');
console.log("Content-Length:" + downloadSize);
console.log("limit:" + AVWEB.avwSysSetting().movieCacheLimitMB);
AVWEB.avwLog("Content-Length:" + downloadSize);
AVWEB.avwLog("Cachelimit:" + AVWEB.avwSysSetting().movieCacheLimitMB);
//制限値チェック
if( downloadSize && downloadSize > AVWEB.avwSysSetting().movieCacheLimitMB * COMMON.MB_BYTE ){
console.log("abort");
AVWEB.avwLog("CacheLimit abort");
xhr.abort();
} else {
CONTENTVIEW_FILESYSTEM.isXhrBusy = true;
......@@ -433,7 +425,7 @@ CONTENTVIEW_FILESYSTEM.createMovieCache = function(resourceUrl, fileName) {
}
};
xhr.onabort = function(e){
console.log("XHR 通信中止");
AVWEB.avwLog("XHR 通信中止");
CONTENTVIEW_FILESYSTEM.isXhrBusy = false;
$('#divCacheLoading').css('display', 'none');
};
......
......@@ -1128,7 +1128,7 @@ HISTORY.formatDate = function(originDate){
HISTORY.sortByViewDateDesc = function(){
console.log("HISTORY.sortByViewDateDesc");
//console.log("HISTORY.sortByViewDateDesc");
var sortArr = HISTORY.contentViewData;
......@@ -1374,7 +1374,7 @@ HISTORY.sortByTitleKanaDesc = function(){
HISTORY.renderContentAfterSort = function(contentSortArr){
console.log("HISTORY.renderContentAfterSort");
//console.log("HISTORY.renderContentAfterSort");
HISTORY.refreshGrid();
//var htmlTemp = "";
......
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