Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
check
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abook_web
check
Commits
cdc165ad
Commit
cdc165ad
authored
Feb 10, 2015
by
Masaru Abe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
テスト対応
parent
c24693d5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
277 additions
and
44 deletions
+277
-44
abvw/bookmark.html
+1
-0
abvw/common/js/common.js
+2
-0
abvw/common/json/sys/conf.json
+2
-1
abvw/contentsearch.html
+1
-0
abvw/css/layout/viewer.css
+21
-0
abvw/css/theme/viewer.css
+13
-0
abvw/history.html
+1
-0
abvw/home.html
+1
-0
abvw/inc_contentview.html
+3
-1
abvw/js/bookmark.js
+0
-3
abvw/js/contentview.js
+0
-0
abvw/js/contentview_CallApi.js
+3
-3
abvw/js/contentview_CreateObjects.js
+15
-7
abvw/js/contentview_Events.js
+4
-4
abvw/js/contentview_FileSystem.js
+137
-11
abvw/js/contentview_GetData.js
+4
-4
abvw/js/contentview_InitObjects.js
+52
-7
abvw/js/header.js
+3
-0
abvw/js/history.js
+12
-3
abvw/js/home.js
+1
-0
abvw/settings.html
+1
-0
No files found.
abvw/bookmark.html
View file @
cdc165ad
...
...
@@ -55,6 +55,7 @@
<script
type=
"text/javascript"
src=
"./js/bookmark.js?__UPDATEID__"
></script>
<script
type=
"text/javascript"
src=
"./common/js/thickbox.js?__UPDATEID__"
></script>
<script
type=
"text/javascript"
src=
"./common/js/scrolltopcontrol.js?__UPDATEID__"
></script>
<script
type=
"text/javascript"
src=
"./js/contentview_FileSystem.js?__UPDATEID__"
></script>
</head>
<body
id=
"bookmark"
oncontextmenu=
"return false;"
>
...
...
abvw/common/js/common.js
View file @
cdc165ad
...
...
@@ -26,6 +26,8 @@ COMMON.ThumbnailForOtherType = {
Thumbnail_LinkType
:
'img/thumb_default_link.png'
};
//1メガのバイト数定数
COMMON
.
MB_BYTE
=
1048576
;
// =============================================================================================
// Constants [start]
...
...
abvw/common/json/sys/conf.json
View file @
cdc165ad
...
...
@@ -13,5 +13,6 @@
"anonymousLoginPath"
:
"test"
,
"anonymousLoginId"
:
"nologin"
,
"appName"
:
"ABookWebCL"
,
"appVersion"
:
"0.0.1"
"appVersion"
:
"0.0.1"
,
"movieCacheLimitMB"
:
200
}
abvw/contentsearch.html
View file @
cdc165ad
...
...
@@ -57,6 +57,7 @@
<script
type=
"text/javascript"
src=
"./common/js/screenLock.js?__UPDATEID__"
></script>
<script
type=
"text/javascript"
src=
"./js/detail.js?__UPDATEID__"
></script>
<script
type=
"text/javascript"
src=
"./common/js/scrolltopcontrol.js?__UPDATEID__"
></script>
<script
type=
"text/javascript"
src=
"./js/contentview_FileSystem.js?__UPDATEID__"
></script>
</head>
<body
id=
"contentsearch"
oncontextmenu=
"return false;"
>
...
...
abvw/css/layout/viewer.css
View file @
cdc165ad
...
...
@@ -1265,12 +1265,33 @@ div .ui-slider-range, .ui-widget-header, .ui-slider-range-max {
}
#divImageLoading
img
{
/*
padding-left: 1px;
padding-top: 1px;
*/
}
#divCacheLoading
{
/*bottom: 65px; */
top
:
65px
;
right
:
20px
;
position
:
fixed
;
display
:
none
;
/*
width:30px;
height:30px;
*/
z-index
:
3
;
}
#divCacheLoading
img
{
padding-left
:
3px
;
padding-top
:
3px
;
}
/* loading image [end]*/
/* navigate button [start]*/
#button_pre_canvas
{
position
:
absolute
;
...
...
abvw/css/theme/viewer.css
View file @
cdc165ad
...
...
@@ -1038,6 +1038,19 @@ div .ui-slider-range, .ui-widget-header, .ui-slider-range-max {
#divImageLoading
img
{
}
#divCacheLoading
{
/*
background-color:#ccc;
border-radius: 10px;
opacity: 0.7;
*/
}
#divCacheLoading
img
{
}
/* loading image [end]*/
/* navigate button [start]*/
...
...
abvw/history.html
View file @
cdc165ad
...
...
@@ -60,6 +60,7 @@
<script
type=
"text/javascript"
src=
"./common/js/tab.js?__UPDATEID__"
></script>
<script
type=
"text/javascript"
src=
"./common/js/screenLock.js?__UPDATEID__"
></script>
<script
type=
"text/javascript"
src=
"./js/detail.js?__UPDATEID__"
></script>
<script
type=
"text/javascript"
src=
"./js/contentview_FileSystem.js?__UPDATEID__"
></script>
</head>
<body
id=
"history"
oncontextmenu=
"return false;"
>
...
...
abvw/home.html
View file @
cdc165ad
...
...
@@ -68,6 +68,7 @@
<script
type=
"text/javascript"
src=
"./common/js/jquery.treeview.js?__UPDATEID__"
></script>
<script
type=
"text/javascript"
src=
"./common/js/screenLock.js?__UPDATEID__"
></script>
<script
type=
"text/javascript"
src=
"./js/detail.js?__UPDATEID__"
></script>
<script
type=
"text/javascript"
src=
"./js/contentview_FileSystem.js?__UPDATEID__"
></script>
<script
type=
"text/javascript"
>
$
(
function
()
{
...
...
abvw/inc_contentview.html
View file @
cdc165ad
...
...
@@ -84,6 +84,9 @@
<div
id=
"divImageLoading"
>
<img
src=
"img/view_loading.gif"
width=
"64px"
height=
"64px"
>
</div>
<div
id=
"divCacheLoading"
>
<img
src=
"img/data2_loading.gif"
>
</div>
<!-- ================================================================================== -->
<!-- Marking group [start]
<!-- ================================================================================== -->
...
...
@@ -385,7 +388,6 @@
<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>
<script
type=
"text/javascript"
src=
"./common/js/jquery.powertip.js?__UPDATEID__"
></script>
<script
type=
"text/javascript"
src=
"./common/js/script.js?__UPDATEID__"
></script>
...
...
abvw/js/bookmark.js
View file @
cdc165ad
...
...
@@ -894,9 +894,6 @@ BOOKMARK.IsExistContent = function(strContentId) {
authCode
:
ClientData
.
authCode
()
};
var
method
=
"GET"
;
if
(
ClientData
.
authCode
()
AVWEB
.
avwCmsApiSync
(
ClientData
.
userInfo_accountPath
(),
"webGetContent"
,
'GET'
,
params
,
function
(
data
)
{
isExisted
=
true
;
...
...
abvw/js/contentview.js
View file @
cdc165ad
This diff is collapsed.
Click to expand it.
abvw/js/contentview_CallApi.js
View file @
cdc165ad
...
...
@@ -25,8 +25,8 @@ CONTENTVIEW_CALLAPI.getJsonContentInfo = function( doneFunc ) {
);
}
else
{
// 1ページ目のファイル取得
var
fileName
=
contentID
+
"/page_1.dat"
;
CONTENTVIEW_FILESYSTEM
.
fs
.
root
.
getFile
(
'/abook/'
+
fileName
,
{
create
:
false
},
var
fileName
=
'/abook/'
+
CONTENTVIEW_GENERAL
.
contentID
+
"/page_1.dat"
;
CONTENTVIEW_FILESYSTEM
.
fs
.
root
.
getFile
(
fileName
,
{
create
:
false
},
function
(
fileEntry
){
fileEntry
.
file
(
function
(
file
){
var
reader
=
new
FileReader
();
...
...
@@ -43,7 +43,7 @@ CONTENTVIEW_CALLAPI.getJsonContentInfo = function( doneFunc ) {
function
(
err
){
// 失敗時のコールバック関数
AVWEB
.
avwLog
(
"NotRead FileSystem"
);
avwGrabContentPageImage
(
AVWEB
.
avwGrabContentPageImage
(
ClientData
.
userInfo_accountPath
(),
{
contentId
:
CONTENTVIEW_GENERAL
.
contentID
,
sid
:
ClientData
.
userInfo_sid
(),
pageNo
:
1
},
function
(
data
)
{
...
...
abvw/js/contentview_CreateObjects.js
View file @
cdc165ad
...
...
@@ -787,7 +787,7 @@ CONTENTVIEW_CREATEOBJECT.trigger = function (mediaType, actionType, id, imageUrl
objectLog
.
resourceId
=
CONTENTVIEW
.
objType4_5
[
nIndex
].
dataObjects
[
nIndex1
].
resourceId
;
}
else
{
/* video */
CONTENTVIEW
.
stopAllAudio
();
CONTENTVIEW_FILESYSTEM
.
showVideoObjectCache
(
objType4_5
[
nIndex
].
x
,
objType4_5
[
nIndex
].
y
,
objType4_5
[
nIndex
].
width
,
objType4_5
[
nIndex
].
height
,
objType4_5
[
nIndex
].
dataObjects
[
nIndex1
].
fileName
,
false
,
contentID
,
objType4_5
[
nIndex
].
dataObjects
[
nIndex1
].
resourceId
);
CONTENTVIEW_FILESYSTEM
.
showVideoObjectCache
(
CONTENTVIEW
.
objType4_5
[
nIndex
].
x
,
CONTENTVIEW
.
objType4_5
[
nIndex
].
y
,
CONTENTVIEW
.
objType4_5
[
nIndex
].
width
,
CONTENTVIEW
.
objType4_5
[
nIndex
].
height
,
CONTENTVIEW
.
objType4_5
[
nIndex
].
dataObjects
[
nIndex1
].
fileName
,
false
,
CONTENTVIEW_GENERAL
.
contentID
,
CONTENTVIEW
.
objType4_5
[
nIndex
].
dataObjects
[
nIndex1
].
resourceId
);
//CONTENTVIEW.showVideoObject(CONTENTVIEW.objType4_5[nIndex].x, CONTENTVIEW.objType4_5[nIndex].y, CONTENTVIEW.objType4_5[nIndex].width, CONTENTVIEW.objType4_5[nIndex].height, CONTENTVIEW.objType4_5[nIndex].dataObjects[nIndex1].fileName, false);
if
(
ClientData
.
isStreamingMode
()){
...
...
@@ -1448,7 +1448,7 @@ CONTENTVIEW_CREATEOBJECT.videoType2 = function (mediaType, actionType, id, image
CONTENTVIEW
.
stopAllAudio
();
if
(
embed
==
"1"
)
{
CONTENTVIEW_FILESYSTEM
.
showVideoObjectCache
(
x
,
y
,
w
,
h
,
mediaFile
,
false
,
contentID
,
media
);
CONTENTVIEW_FILESYSTEM
.
showVideoObjectCache
(
x
,
y
,
w
,
h
,
mediaFile
,
false
,
CONTENTVIEW_GENERAL
.
contentID
,
media
);
//CONTENTVIEW.showVideoObject(x, y, w, h, mediaFile, false);
if
(
ClientData
.
isStreamingMode
()){
...
...
@@ -1522,8 +1522,8 @@ CONTENTVIEW_CREATEOBJECT.videoType2 = function (mediaType, actionType, id, image
}
else
{
//キャッシュが存在するか確認
var
fileName
=
CONTENTVIEW_GENERAL
.
contentID
+
"/res_"
+
media
+
".dat"
;
CONTENTVIEW_FILESYSTEM
.
fs
.
root
.
getFile
(
'/abook/'
+
fileName
,
{
create
:
false
},
var
fileName
=
'/abook/'
+
CONTENTVIEW_GENERAL
.
contentID
+
"/res_"
+
media
+
".dat"
;
CONTENTVIEW_FILESYSTEM
.
fs
.
root
.
getFile
(
fileName
,
{
create
:
false
},
function
(
fileEntry
){
fileEntry
.
file
(
function
(
file
){
...
...
@@ -1531,7 +1531,7 @@ CONTENTVIEW_CREATEOBJECT.videoType2 = function (mediaType, actionType, id, image
var
resSrc
=
url
.
createObjectURL
(
file
);
AVWEB
.
avwLog
(
"read cache: createObjectURL "
+
resSrc
);
createVideoFulScreen
(
resSrc
,
id
);
CONTENTVIEW_CREATEOBJECT
.
createVideoFulScreen
(
resSrc
,
id
);
$
(
"#btnCloseVideo"
).
on
({
'click touchend'
:
function
(
ev
){
//時間記録
...
...
@@ -1554,6 +1554,9 @@ CONTENTVIEW_CREATEOBJECT.videoType2 = function (mediaType, actionType, id, image
function
(
err
){
// 失敗時のコールバック関数
AVWEB
.
avwLog
(
"NotRead FileSystem"
);
CONTENTVIEW_FILESYSTEM
.
createMovieCache
(
mediaFile
,
fileName
);
/*
//キャッシュ化
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function(){
...
...
@@ -1603,6 +1606,7 @@ CONTENTVIEW_CREATEOBJECT.videoType2 = function (mediaType, actionType, id, image
} else {
AVWEB.avwLog("xhr is busy.");
}
*/
//タグは書き出し
CONTENTVIEW_CREATEOBJECT
.
createVideoFulScreen
(
mediaFile
,
id
);
...
...
@@ -1693,8 +1697,8 @@ CONTENTVIEW_CREATEOBJECT.videoType1 = function (mediaType, actionType, id, image
}
else
{
//キャッシュが存在するか確認
var
fileName
=
CONTENTVIEW_GENERAL
.
contentID
+
"/res_"
+
mediaResourceId
+
".dat"
;
CONTENTVIEW_FILESYSTEM
.
fs
.
root
.
getFile
(
'/abook/'
+
fileName
,
{
create
:
false
},
var
fileName
=
'/abook/'
+
CONTENTVIEW_GENERAL
.
contentID
+
"/res_"
+
mediaResourceId
+
".dat"
;
CONTENTVIEW_FILESYSTEM
.
fs
.
root
.
getFile
(
fileName
,
{
create
:
false
},
function
(
fileEntry
){
fileEntry
.
file
(
function
(
file
){
...
...
@@ -1728,6 +1732,9 @@ CONTENTVIEW_CREATEOBJECT.videoType1 = function (mediaType, actionType, id, image
function
(
err
){
// 失敗時のコールバック関数
AVWEB
.
avwLog
(
"NotRead FileSystem"
);
CONTENTVIEW_FILESYSTEM
.
createMovieCache
(
mediaFile
,
fileName
);
/*
//キャッシュ化
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function(){
...
...
@@ -1778,6 +1785,7 @@ CONTENTVIEW_CREATEOBJECT.videoType1 = function (mediaType, actionType, id, image
} else {
AVWEB.avwLog("xhr is busy.");
}
*/
//タグは書き出し
CONTENTVIEW_CREATEOBJECT
.
createVideoFulScreen
(
mediaFile
,
id
);
...
...
abvw/js/contentview_Events.js
View file @
cdc165ad
...
...
@@ -389,8 +389,8 @@ CONTENTVIEW_EVENTS.firstPage_click = function() {
}
else
{
// ファイル取得
var
fileName
=
CONTENTVIEW_GENERAL
.
contentID
+
"/page_1.dat"
;
CONTENTVIEW_FILESYSTEM
.
fs
.
root
.
getFile
(
'/abook/'
+
fileName
,
{
create
:
false
},
var
fileName
=
'/abook/'
+
CONTENTVIEW_GENERAL
.
contentID
+
"/page_1.dat"
;
CONTENTVIEW_FILESYSTEM
.
fs
.
root
.
getFile
(
fileName
,
{
create
:
false
},
function
(
fileEntry
){
fileEntry
.
file
(
function
(
file
){
...
...
@@ -516,8 +516,8 @@ CONTENTVIEW_EVENTS.lastPage_click = function() {
}
else
{
// ファイル取得
var
fileName
=
contentID
+
"/page_"
+
totalPage
+
".dat"
;
CONTENTVIEW_FILESYSTEM
.
fs
.
root
.
getFile
(
'/abook/'
+
fileName
,
{
create
:
false
},
var
fileName
=
'/abook/'
+
CONTENTVIEW_GENERAL
.
contentID
+
"/page_"
+
CONTENTVIEW_GENERAL
.
totalPage
+
".dat"
;
CONTENTVIEW_FILESYSTEM
.
fs
.
root
.
getFile
(
fileName
,
{
create
:
false
},
function
(
fileEntry
){
fileEntry
.
file
(
function
(
file
){
...
...
abvw/js/contentview_FileSystem.js
View file @
cdc165ad
...
...
@@ -2,9 +2,11 @@
//名前空間用のオブジェクトを用意する
var
CONTENTVIEW_FILESYSTEM
=
{};
CONTENTVIEW_FILESYSTEM
.
initFS
=
function
(
func
)
{
CONTENTVIEW_FILESYSTEM
.
fs
=
null
;
CONTENTVIEW_FILESYSTEM
.
isXhrBusy
=
false
;
window
.
requestFileSystem
=
window
.
requestFileSystem
||
window
.
webkitRequestFileSystem
;
// Initiate filesystem on page load.
...
...
@@ -20,7 +22,7 @@ CONTENTVIEW_FILESYSTEM.initFS = function( func ) {
window
.
TEMPORARY
,
1024
*
1024
,
function
(
filesystem
)
{
//
AVWEB.avwLog("initFS window.requestFileSystem");
AVWEB
.
avwLog
(
"initFS window.requestFileSystem"
);
CONTENTVIEW_FILESYSTEM
.
fs
=
filesystem
;
CONTENTVIEW_FILESYSTEM
.
fs
.
root
.
getDirectory
(
'abook'
,
...
...
@@ -121,7 +123,7 @@ CONTENTVIEW_FILESYSTEM.checkUpdate = function(contentId, data, func) {
}
//既にjson.txtが存在するか
var
fileName
=
contentI
D
+
"/json.txt"
;
var
fileName
=
contentI
d
+
"/json.txt"
;
CONTENTVIEW_FILESYSTEM
.
fs
.
root
.
getFile
(
'/abook/'
+
fileName
,
{
create
:
false
},
...
...
@@ -264,33 +266,36 @@ CONTENTVIEW_FILESYSTEM.showVideoObjectCache = function(x, y, width, height, src,
if
(
!
CONTENTVIEW_FILESYSTEM
.
fs
)
{
//AVWEB.avwLog('CONTENTVIEW_FILESYSTEM.fs is null. id=' + contentId);
showVideoObject
(
x
,
y
,
width
,
height
,
src
,
isFullscreen
,
true
);
CONTENTVIEW
.
showVideoObject
(
x
,
y
,
width
,
height
,
src
,
isFullscreen
,
true
);
return
;
}
//キャッシュが存在するか確認
var
fileName
=
contentID
+
"/res_"
+
resourceId
+
".dat"
;
CONTENTVIEW_FILESYSTEM
.
fs
.
root
.
getFile
(
'/abook/'
+
fileName
,
{
create
:
false
},
var
fileName
=
'/abook/'
+
contentId
+
"/res_"
+
resourceId
+
".dat"
;
CONTENTVIEW_FILESYSTEM
.
fs
.
root
.
getFile
(
fileName
,
{
create
:
false
},
function
(
fileEntry
){
fileEntry
.
file
(
function
(
file
){
//AVWEB.avwLog("read cache");
var
url
=
window
.
URL
||
window
.
webkitURL
;
var
resSrc
=
url
.
createObjectURL
(
file
);
showVideoObject
(
x
,
y
,
width
,
height
,
resSrc
,
isFullscreen
,
false
);
CONTENTVIEW
.
showVideoObject
(
x
,
y
,
width
,
height
,
resSrc
,
isFullscreen
,
false
);
}
);
},
function
(
err
){
// 失敗時のコールバック関数
//AVWEB.avwLog("NotRead FileSystem");
CONTENTVIEW_FILESYSTEM
.
createMovieCache
(
src
,
fileName
);
/*
//キャッシュ化
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function(){
if (this.readyState == 4 && this.status == 200){
var
size
=
xhr
.
getResponseHeader
(
'Content-Length'
)
console
.
log
(
"size:"
+
size
);
//
var size = xhr.getResponseHeader('Content-Length')
//
console.log("size:" + size);
CONTENTVIEW_FILESYSTEM.isXhrBusy = false;
$('#divImageLoading').css('display', 'none');
...
...
@@ -337,16 +342,137 @@ CONTENTVIEW_FILESYSTEM.showVideoObjectCache = function(x, y, width, height, src,
} else {
//AVWEB.avwLog("xhr is busy.");
}
*/
//タグは書き出し
showVideoObject
(
x
,
y
,
width
,
height
,
src
,
isFullscreen
,
true
);
CONTENTVIEW
.
showVideoObject
(
x
,
y
,
width
,
height
,
src
,
isFullscreen
,
true
);
}
);
};
CONTENTVIEW_FILESYSTEM
.
createMovieCache
=
function
(
resourceUrl
,
fileName
)
{
if
(
!
CONTENTVIEW_FILESYSTEM
.
fs
)
{
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
){
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);
downloadSize
=
xhr
.
getResponseHeader
(
'Content-Length'
);
console
.
log
(
"Content-Length:"
+
downloadSize
);
console
.
log
(
"limit:"
+
AVWEB
.
avwSysSetting
().
movieCacheLimitMB
);
//制限値チェック
if
(
downloadSize
&&
downloadSize
>
AVWEB
.
avwSysSetting
().
movieCacheLimitMB
*
COMMON
.
MB_BYTE
){
console
.
log
(
"abort"
);
xhr
.
abort
();
}
else
{
CONTENTVIEW_FILESYSTEM
.
isXhrBusy
=
true
;
$
(
'#divCacheLoading'
).
css
(
'z-index'
,
'99999'
);
$
(
'#divCacheLoading'
).
css
(
'display'
,
'block'
);
}
}
//AVWEB.avwLog("onreadystatechange:" + this.readyState + " " + this.status);
}
};
xhr
.
onabort
=
function
(
e
){
console
.
log
(
"XHR 通信中止"
);
CONTENTVIEW_FILESYSTEM
.
isXhrBusy
=
false
;
$
(
'#divCacheLoading'
).
css
(
'display'
,
'none'
);
};
//var resourceUrl = CONTENTVIEW.downloadResourceById(CONTENTVIEW_GENERAL.contentID);
if
(
!
CONTENTVIEW_FILESYSTEM
.
isXhrBusy
){
xhr
.
open
(
'GET'
,
resourceUrl
);
xhr
.
responseType
=
'blob'
;
xhr
.
send
();
}
else
{
//AVWEB.avwLog("xhr is busy.");
}
};
CONTENTVIEW_FILESYSTEM
.
deleteMovieCache
=
function
(
fileName
)
{
if
(
!
CONTENTVIEW_FILESYSTEM
.
fs
)
{
return
;
}
CONTENTVIEW_FILESYSTEM
.
fs
.
root
.
getFile
(
'/abook/'
+
fileName
,
{
create
:
false
},
function
(
fileEntry
)
{
fileEntry
.
remove
(
function
()
{
AVWEB
.
avwLog
(
'File removed. path='
+
fileName
);
},
null
);
},
null
);
};
CONTENTVIEW_FILESYSTEM
.
errorHandler
=
function
(
e
)
{
var
msg
=
''
;
switch
(
e
.
code
)
{
...
...
@@ -379,7 +505,7 @@ $(function () {
});
CONTENTVIEW_FILESYSTEM
.
ready
=
function
(){
CONTENTVIEW_FILESYSTEM
.
fs
=
null
;
CONTENTVIEW_FILESYSTEM
.
isXhrBusy
=
false
;
//
CONTENTVIEW_FILESYSTEM.fs = null;
//
CONTENTVIEW_FILESYSTEM.isXhrBusy = false;
};
abvw/js/contentview_GetData.js
View file @
cdc165ad
...
...
@@ -1273,8 +1273,8 @@ CONTENTVIEW_GETDATA.renderNextPage = function(){
}
else
{
// ファイル取得
var
fileName
=
contentID
+
"/page_"
+
pageNo
+
".dat"
;
CONTENTVIEW_FILESYSTEM
.
fs
.
root
.
getFile
(
'/abook/'
+
fileName
,
{
create
:
false
},
var
fileName
=
'/abook/'
+
CONTENTVIEW_GENERAL
.
contentID
+
"/page_"
+
pageNo
+
".dat"
;
CONTENTVIEW_FILESYSTEM
.
fs
.
root
.
getFile
(
fileName
,
{
create
:
false
},
function
(
fileEntry
){
fileEntry
.
file
(
function
(
file
){
...
...
@@ -1348,8 +1348,8 @@ CONTENTVIEW_GETDATA.renderPrevPage = function(){
}
else
{
// ファイル取得
var
fileName
=
contentID
+
"/page_"
+
pageNo
+
".dat"
;
CONTENTVIEW_FILESYSTEM
.
fs
.
root
.
getFile
(
'/abook/'
+
fileName
,
{
create
:
false
},
var
fileName
=
'/abook/'
+
CONTENTVIEW_GENERAL
.
contentID
+
"/page_"
+
pageNo
+
".dat"
;
CONTENTVIEW_FILESYSTEM
.
fs
.
root
.
getFile
(
fileName
,
{
create
:
false
},
function
(
fileEntry
){
fileEntry
.
file
(
function
(
file
){
...
...
abvw/js/contentview_InitObjects.js
View file @
cdc165ad
...
...
@@ -547,6 +547,8 @@ CONTENTVIEW_INITOBJECT.isHasPageBGM = function(){
CONTENTVIEW_INITOBJECT
.
initPageMediaAndHtmlType
=
function
(){
console
.
log
(
"CONTENTVIEW_INITOBJECT.initPageMediaAndHtmlType"
);
//$('#divImageLoading').css('display', 'block');
/* init footer toolbar */
...
...
@@ -581,14 +583,14 @@ CONTENTVIEW_INITOBJECT.initPageMediaAndHtmlType = function(){
var
resourceId
=
CONTENTVIEW
.
getVideoContentResourceId
(
CONTENTVIEW_GENERAL
.
contentID
);
//キャッシュが存在するか確認
var
fileName
=
CONTENTVIEW_GENERAL
.
contentID
+
"/res_"
+
resourceId
+
".dat"
;
CONTENTVIEW_FILESYSTEM
.
fs
.
root
.
getFile
(
'/abook/'
+
fileName
,
{
create
:
false
},
var
fileName
=
'/abook/'
+
CONTENTVIEW_GENERAL
.
contentID
+
"/res_"
+
resourceId
+
".dat"
;
CONTENTVIEW_FILESYSTEM
.
fs
.
root
.
getFile
(
fileName
,
{
create
:
false
},
function
(
fileEntry
){
fileEntry
.
file
(
function
(
file
){
var
url
=
window
.
URL
||
window
.
webkitURL
;
var
resSrc
=
url
.
createObjectURL
(
file
);
//
AVWEB.avwLog("read cache: createObjectURL " + resSrc);
AVWEB
.
avwLog
(
"read cache: createObjectURL "
+
resSrc
);
CONTENTVIEW
.
displayOverlayForSpecifyContentType
(
resSrc
);
...
...
@@ -598,9 +600,28 @@ CONTENTVIEW_INITOBJECT.initPageMediaAndHtmlType = function(){
function
(
err
){
// 失敗時のコールバック関数
//AVWEB.avwLog("NotRead FileSystem");
var
resourceUrl
=
CONTENTVIEW
.
downloadResourceById
(
CONTENTVIEW_GENERAL
.
contentID
);
CONTENTVIEW_FILESYSTEM
.
createMovieCache
(
resourceUrl
,
fileName
);
/*
//キャッシュ化
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){
CONTENTVIEW_FILESYSTEM.isXhrBusy = false;
...
...
@@ -615,7 +636,14 @@ CONTENTVIEW_INITOBJECT.initPageMediaAndHtmlType = function(){
fileEntry.createWriter(
function(fileWriter) {
fileWriter.onwriteend = function(e) {
//AVWEB.avwLog('RES書き込み完了');
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());
...
...
@@ -633,13 +661,29 @@ CONTENTVIEW_INITOBJECT.initPageMediaAndHtmlType = function(){
} else {
if( this.readyState == 2 ){
//AVWEB.avwLog("onreadystatechange:" + this.readyState + " " + this.status);
CONTENTVIEW_FILESYSTEM
.
isXhrBusy
=
true
;
$
(
'#divImageLoading'
).
css
(
'z-index'
,
'99999'
);
$
(
'#divImageLoading'
).
css
(
'display'
,
'block'
);
downloadSize = xhr.getResponseHeader('Content-Length');
console.log("Content-Length:" + downloadSize);
console.log("limit:" + AVWEB.avwSysSetting().movieCacheLimitMB);
//制限値チェック
if( downloadSize && downloadSize > AVWEB.avwSysSetting().movieCacheLimitMB * COMMON.MB_BYTE ){
console.log("abort");
xhr.abort();
} else {
CONTENTVIEW_FILESYSTEM.isXhrBusy = true;
$('#divImageLoading').css('z-index', '99999');
$('#divImageLoading').css('display', 'block');
}
}
//AVWEB.avwLog("onreadystatechange:" + this.readyState + " " + this.status);
}
};
xhr.onabort = function(e){
console.log("XHR 通信中止");
CONTENTVIEW_FILESYSTEM.isXhrBusy = false;
$('#divImageLoading').css('display', 'none');
};
var resourceUrl = CONTENTVIEW.downloadResourceById(CONTENTVIEW_GENERAL.contentID);
if( !CONTENTVIEW_FILESYSTEM.isXhrBusy ){
...
...
@@ -649,6 +693,7 @@ CONTENTVIEW_INITOBJECT.initPageMediaAndHtmlType = function(){
} else {
//AVWEB.avwLog("xhr is busy.");
}
*/
//タグは書き出し
CONTENTVIEW
.
displayOverlayForSpecifyContentType
(
resourceUrl
);
...
...
abvw/js/header.js
View file @
cdc165ad
...
...
@@ -112,6 +112,9 @@ $(document).ready(function () {
$
(
'#authGroupBox'
).
hide
();
}
//chromeキャッシュ対応
CONTENTVIEW_FILESYSTEM
.
initFS
(
null
);
});
//グループ認証 戻る
...
...
abvw/js/history.js
View file @
cdc165ad
...
...
@@ -197,7 +197,8 @@ HISTORY.renderContent = function(id, text, division, type, order, from, to, cate
}
htmlTemp
=
htmlTemp
.
replace
(
/
\{
download
\}
/g
,
downloadHtml
);
$
(
'#content-grid'
).
append
(
htmlTemp
);
//効率化
//$('#content-grid').append(htmlTemp);
}
}
...
...
@@ -224,8 +225,9 @@ HISTORY.renderContent = function(id, text, division, type, order, from, to, cate
HISTORY
.
contentTypeArr
.
push
({
contentId
:
post
.
contentId
,
contentType
:
post
.
contentType
});
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Assign content type to array to manage.
//効率化
//Check if user has read this content or not.
HISTORY
.
checkUserHasReadContent
(
post
.
contentId
,
post
.
resourceVersion
,
post
.
metaVersion
);
//
HISTORY.checkUserHasReadContent(post.contentId, post.resourceVersion, post.metaVersion);
//assign version to array
COMMON
.
resourceVersionArr
.
push
({
contentid
:
post
.
contentId
,
resourceversion
:
post
.
resourceVersion
});
...
...
@@ -236,7 +238,8 @@ HISTORY.renderContent = function(id, text, division, type, order, from, to, cate
//Check if content has marking or memo
HISTORY
.
checkContentMarkingMemoOption
(
post
.
contentId
);
$
(
'#lblVdate'
+
post
.
contentId
).
html
(
viewdate
);
//効率化
//$('#lblVdate' + post.contentId).html(viewdate);
HISTORY
.
addReadContentToArray
(
post
.
contentId
,
post
.
resourceVersion
,
post
.
metaVersion
,
post
.
contentThumbnail
,
post
.
contentTitle
,
HISTORY
.
returnContentTitleKana
(
post
.
contentId
),
post
.
contentDeliveryDate
,
post
.
contentType
,
post
.
readerShare
,
post
.
download
);
...
...
@@ -1124,6 +1127,9 @@ HISTORY.formatDate = function(originDate){
};
HISTORY
.
sortByViewDateDesc
=
function
(){
console
.
log
(
"HISTORY.sortByViewDateDesc"
);
var
sortArr
=
HISTORY
.
contentViewData
;
var
temp
;
...
...
@@ -1367,6 +1373,9 @@ HISTORY.sortByTitleKanaDesc = function(){
HISTORY
.
renderContentAfterSort
=
function
(
contentSortArr
){
console
.
log
(
"HISTORY.renderContentAfterSort"
);
HISTORY
.
refreshGrid
();
//var htmlTemp = "";
for
(
var
i
=
0
;
i
<
contentSortArr
.
length
;
i
++
)
{
...
...
abvw/js/home.js
View file @
cdc165ad
...
...
@@ -2766,6 +2766,7 @@ HOME.showContentView = function(){
CONTENTVIEW
.
cssInit
();
$
(
"#viewer"
).
show
();
//CONTENTVIEW_FILESYSTEM.initFS(CONTENTVIEW.ready);
CONTENTVIEW
.
ready
();
};
...
...
abvw/settings.html
View file @
cdc165ad
...
...
@@ -42,6 +42,7 @@
<script
type=
"text/javascript"
src=
"./common/js/screenLock.js?__UPDATEID__"
></script>
<script
type=
"text/javascript"
src=
"./js/header.js?__UPDATEID__"
></script>
<script
type=
"text/javascript"
src=
"./js/settings.js?__UPDATEID__"
></script>
<script
type=
"text/javascript"
src=
"./js/contentview_FileSystem.js?__UPDATEID__"
></script>
<style>
#slidebar-animation
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment