Commit 44899bb0 by Masaru Abe

テスト対応

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