Commit 5496b3a5 by Masaru Abe

リファクタリング作業

parent 058280d6
...@@ -825,7 +825,7 @@ AVWEB.avwClearError = function() { ...@@ -825,7 +825,7 @@ AVWEB.avwClearError = function() {
AVWEB.avwSetLogoutNortice = function() { AVWEB.avwSetLogoutNortice = function() {
window.onbeforeunload = function(event) { window.onbeforeunload = function(event) {
if( ClientData.isGetitsMode() == true ){ if( ClientData.isGetitsMode() == true ){
COMMON.SetEndLog(contentID); COMMON.SetEndLog(CONTENTVIEW_GENERAL.contentID);
COMMON.RegisterLog(); COMMON.RegisterLog();
} else { } else {
// メッセージ表示 // メッセージ表示
......
...@@ -2237,8 +2237,8 @@ COMMON.unlockFunction = function(inputPass) { ...@@ -2237,8 +2237,8 @@ COMMON.unlockFunction = function(inputPass) {
if (result == true) { if (result == true) {
if (window.onUnlock) { if (window.CONTENTVIEW_EVENTS.onUnlock) {
onUnlock(); CONTENTVIEW_EVENTS.onUnlock();
} }
} }
return { 'result': result, 'errorCode': errorCode, 'newTimeout': COMMON.getTimeWaitLockScreen() }; return { 'result': result, 'errorCode': errorCode, 'newTimeout': COMMON.getTimeWaitLockScreen() };
...@@ -2768,8 +2768,9 @@ Get total bytes of jp chars ...@@ -2768,8 +2768,9 @@ Get total bytes of jp chars
COMMON.getBytes = function(value) { COMMON.getBytes = function(value) {
var escapedStr = encodeURI(value); var escapedStr = encodeURI(value);
var count;
if (escapedStr.indexOf("%") != -1) { if (escapedStr.indexOf("%") != -1) {
var count = escapedStr.split("%").length - 1; count = escapedStr.split("%").length - 1;
if (count == 0) count++; //perverse case; can't happen with real UTF-8 if (count == 0) count++; //perverse case; can't happen with real UTF-8
var tmp = escapedStr.length - (count * 3); var tmp = escapedStr.length - (count * 3);
......
$(function() { $(function() {
var avwUserEnvObj = new UserEnvironment();
if(avwUserEnvObj.os == 'ipad' || avwUserEnvObj.os == 'android'){ if(avwUserEnvObj.os == 'ipad' || avwUserEnvObj.os == 'android'){
//
}else{ }else{
// placement examples // placement examples
$('.home').powerTip({placement: 's'}); $('.home').powerTip({placement: 's'});
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<script> <script>
$(document).ready(function () { $(document).ready(function () {
var data = window.opener.getText(); var data = window.opener.CONTENTVIEW_GETDATA.getText();
$('#result').html(data.text); $('#result').html(data.text);
document.title = data.title; document.title = data.title;
}); });
......
This source diff could not be displayed because it is too large. You can view the blob instead.
var _3dMoveFlag = false; //名前空間用のオブジェクトを用意する
var _3dAction = ''; var CONTENTVIEW_3D = {};
var _curr3dObject;
var _3dTimeToDetect = 1000; CONTENTVIEW_3D._3dMoveFlag = false;
var _3dActionType = { CONTENTVIEW_3D._3dAction = '';
CONTENTVIEW_3D._curr3dObject;
//CONTENTVIEW_3D._3dTimeToDetect = 1000;
CONTENTVIEW_3D._3dActionType = {
'TouchStart_MouseDown' : 0, 'TouchStart_MouseDown' : 0,
'TouchMove_MouseMove' : 1, 'TouchMove_MouseMove' : 1,
'TouchEnd_MouseUp' : 2 'TouchEnd_MouseUp' : 2
}; };
function createMatrixPoints(width, height, _v, _h, imgCurrX, imgCurrY){ CONTENTVIEW_3D.createMatrixPoints = function(width, height, _v, _h, imgCurrX, imgCurrY){
var deltaX = width/ _h; var deltaX = width/ _h;
var deltaY = height/ _v; var deltaY = height/ _v;
...@@ -33,25 +36,25 @@ function createMatrixPoints(width, height, _v, _h, imgCurrX, imgCurrY){ ...@@ -33,25 +36,25 @@ function createMatrixPoints(width, height, _v, _h, imgCurrX, imgCurrY){
_arrFrame[countV]=temp; _arrFrame[countV]=temp;
} }
_arrFrame = setImageIndexToMatrix(imgCurrX, imgCurrY, _arrFrame, _h, _v); _arrFrame = CONTENTVIEW_3D.setImageIndexToMatrix(imgCurrX, imgCurrY, _arrFrame, _h, _v);
return _arrFrame; return _arrFrame;
}; };
function setImageIndexToMatrix(imgCurrX, imgCurrY, _arrFrame, _h, _v){ CONTENTVIEW_3D.setImageIndexToMatrix = function(imgCurrX, imgCurrY, _arrFrame, _h, _v){
var deltaH = (_h - 1)/2; var deltaH = (_h - 1)/2;
var deltaV = (_v - 1)/2; var deltaV = (_v - 1)/2;
for(var countY = 1;countY<=_v;countY++){ for(var countY = 1;countY<=_v;countY++){
var currY = reCalcMatrixY(imgCurrY - deltaV + (countY - 1), _v); var currY = CONTENTVIEW_3D.reCalcMatrixY(imgCurrY - deltaV + (countY - 1), _v);
for(var countX=1;countX<=_h;countX++){ for(var countX=1;countX<=_h;countX++){
var currFrame = _arrFrame[countY][countX]; var currFrame = _arrFrame[countY][countX];
currFrame.imgY = currY; currFrame.imgY = currY;
var currX = imgCurrX - deltaH + (countX-1); var currX = imgCurrX - deltaH + (countX-1);
currFrame.imgX = reCalcMatrixX(currX, _h); currFrame.imgX = CONTENTVIEW_3D.reCalcMatrixX(currX, _h);
//set value back //set value back
_arrFrame[countY][countX] = currFrame; _arrFrame[countY][countX] = currFrame;
...@@ -61,9 +64,9 @@ function setImageIndexToMatrix(imgCurrX, imgCurrY, _arrFrame, _h, _v){ ...@@ -61,9 +64,9 @@ function setImageIndexToMatrix(imgCurrX, imgCurrY, _arrFrame, _h, _v){
return _arrFrame; return _arrFrame;
}; };
function showCurrImg(id, x, y, w, h, _currFrameX, _currFrameY){ CONTENTVIEW_3D.showCurrImg = function(id, x, y, w, h, _currFrameX, _currFrameY){
var strCountH = convNumTo2Char(_currFrameX); var strCountH = CONTENTVIEW_GETDATA.convNumTo2Char(_currFrameX);
var strCountV = convNumTo2Char(_currFrameY); var strCountV = CONTENTVIEW_GETDATA.convNumTo2Char(_currFrameY);
var canvas = document.getElementById('offscreen'); var canvas = document.getElementById('offscreen');
var context = canvas.getContext('2d'); var context = canvas.getContext('2d');
...@@ -71,8 +74,8 @@ function showCurrImg(id, x, y, w, h, _currFrameX, _currFrameY){ ...@@ -71,8 +74,8 @@ function showCurrImg(id, x, y, w, h, _currFrameX, _currFrameY){
var imageId = strCountV + "-" + strCountH; var imageId = strCountV + "-" + strCountH;
var imageUrl = ""; var imageUrl = "";
for(var i = 0 ; i < _object3DImageArr.length; i++){ for(var i = 0 ; i < CONTENTVIEW_GENERAL._object3DImageArr.length; i++){
var obj = _object3DImageArr[i]; var obj = CONTENTVIEW_GENERAL._object3DImageArr[i];
if(obj.id == id){ if(obj.id == id){
var Obj1 = obj["3dview"]; var Obj1 = obj["3dview"];
...@@ -88,19 +91,19 @@ function showCurrImg(id, x, y, w, h, _currFrameX, _currFrameY){ ...@@ -88,19 +91,19 @@ function showCurrImg(id, x, y, w, h, _currFrameX, _currFrameY){
context.save(); context.save();
if (ClientData.IsAddingMarking() == false && ClientData.IsDisplayMarking() == true) { if (ClientData.IsAddingMarking() == false && ClientData.IsDisplayMarking() == true) {
drawMarkingOnScreen(); CONTENTVIEW.drawMarkingOnScreen();
if(!isExistDrawing){ if(!CONTENTVIEW.isExistDrawing){
flip(); CONTENTVIEW.flip();
} }
} }
else{ else{
flip(); CONTENTVIEW.flip();
} }
}; };
imgCurr.src = imageUrl; imgCurr.src = imageUrl;
}; };
function reCalcMatrixX(x, _h){ CONTENTVIEW_3D.reCalcMatrixX = function(x, _h){
if(x <= 0) if(x <= 0)
x = x + _h; x = x + _h;
...@@ -109,7 +112,7 @@ function reCalcMatrixX(x, _h){ ...@@ -109,7 +112,7 @@ function reCalcMatrixX(x, _h){
return x; return x;
}; };
function reCalcMatrixY(y, _v){ CONTENTVIEW_3D.reCalcMatrixY = function(y, _v){
if(y <= 0) if(y <= 0)
y = y + _v; y = y + _v;
if(y >_v) if(y >_v)
...@@ -117,11 +120,11 @@ function reCalcMatrixY(y, _v){ ...@@ -117,11 +120,11 @@ function reCalcMatrixY(y, _v){
return y; return y;
}; };
function getArrFrame(id){ CONTENTVIEW_3D.getArrFrame = function(id){
var arrResult = []; var arrResult = [];
for(var i = 0; i < _object3DImageArr.length; i++){ for(var i = 0; i < CONTENTVIEW_GENERAL._object3DImageArr.length; i++){
var obj = _object3DImageArr[i]; var obj = CONTENTVIEW_GENERAL._object3DImageArr[i];
if(obj.id == id){ if(obj.id == id){
arrResult = obj.arrFrame; arrResult = obj.arrFrame;
return arrResult; return arrResult;
...@@ -129,11 +132,11 @@ function getArrFrame(id){ ...@@ -129,11 +132,11 @@ function getArrFrame(id){
} }
}; };
function get3dLastSeclectedFrame(id){ CONTENTVIEW_3D.get3dLastSeclectedFrame = function(id){
var arrResult = Object(); var arrResult = Object();
for(var i = 0; i < _object3DImageArr.length; i++){ for(var i = 0; i < CONTENTVIEW_GENERAL._object3DImageArr.length; i++){
var obj = _object3DImageArr[i]; var obj = CONTENTVIEW_GENERAL._object3DImageArr[i];
if(obj.id == id){ if(obj.id == id){
arrResult = obj._lastSelectedFrame; arrResult = obj._lastSelectedFrame;
return arrResult; return arrResult;
...@@ -141,17 +144,17 @@ function get3dLastSeclectedFrame(id){ ...@@ -141,17 +144,17 @@ function get3dLastSeclectedFrame(id){
} }
}; };
function set3dLastSeclectedFrame(id, lastFrame){ CONTENTVIEW_3D.set3dLastSeclectedFrame = function(id, lastFrame){
for(var i = 0; i < _object3DImageArr.length; i++){ for(var i = 0; i < CONTENTVIEW_GENERAL._object3DImageArr.length; i++){
var obj = _object3DImageArr[i]; var obj = CONTENTVIEW_GENERAL._object3DImageArr[i];
if(obj.id == id){ if(obj.id == id){
_object3DImageArr[i]._lastSelectedFrame = lastFrame; CONTENTVIEW_GENERAL._object3DImageArr[i]._lastSelectedFrame = lastFrame;
} }
} }
}; };
function getMatrixIndexByPosition(id, position, left, top){ CONTENTVIEW_3D.getMatrixIndexByPosition = function(id, position, left, top){
//compate with matrix to check went to another frame or not //compate with matrix to check went to another frame or not
var posX = position.x; var posX = position.x;
...@@ -160,7 +163,7 @@ function getMatrixIndexByPosition(id, position, left, top){ ...@@ -160,7 +163,7 @@ function getMatrixIndexByPosition(id, position, left, top){
posX = posX - left; posX = posX - left;
posY = posY - top; posY = posY - top;
var _arrFrame = getArrFrame(id); var _arrFrame = CONTENTVIEW_3D.getArrFrame(id);
for(var countY=1;countY<_arrFrame.length;countY++){ for(var countY=1;countY<_arrFrame.length;countY++){
for(var countX=1;countX<_arrFrame[countY].length;countX++){ for(var countX=1;countX<_arrFrame[countY].length;countX++){
...@@ -176,11 +179,11 @@ function getMatrixIndexByPosition(id, position, left, top){ ...@@ -176,11 +179,11 @@ function getMatrixIndexByPosition(id, position, left, top){
return false; return false;
}; };
function get3dCurrentFramePos(id){ CONTENTVIEW_3D.get3dCurrentFramePos = function(id){
var currFrame = []; var currFrame = [];
for(var i = 0; i < _object3DImageArr.length; i++){ for(var i = 0; i < CONTENTVIEW_GENERAL._object3DImageArr.length; i++){
var obj = _object3DImageArr[i]; var obj = CONTENTVIEW_GENERAL._object3DImageArr[i];
if(obj.id == id){ if(obj.id == id){
currFrame['_currFrameX'] = obj['_currFrameX']; currFrame['_currFrameX'] = obj['_currFrameX'];
currFrame['_currFrameY'] = obj['_currFrameY']; currFrame['_currFrameY'] = obj['_currFrameY'];
...@@ -190,48 +193,48 @@ function get3dCurrentFramePos(id){ ...@@ -190,48 +193,48 @@ function get3dCurrentFramePos(id){
} }
}; };
function set3dCurrentFramePos(id, currFramePos){ CONTENTVIEW_3D.set3dCurrentFramePos = function(id, currFramePos){
for(var i = 0; i < _object3DImageArr.length; i++){ for(var i = 0; i < CONTENTVIEW_GENERAL._object3DImageArr.length; i++){
var obj = _object3DImageArr[i]; var obj = CONTENTVIEW_GENERAL._object3DImageArr[i];
if(obj.id == id){ if(obj.id == id){
_object3DImageArr[i]._currFrameX = currFramePos._currFrameX; CONTENTVIEW_GENERAL._object3DImageArr[i]._currFrameX = currFramePos._currFrameX;
_object3DImageArr[i]._currFrameY = currFramePos._currFrameY; CONTENTVIEW_GENERAL._object3DImageArr[i]._currFrameY = currFramePos._currFrameY;
} }
} }
}; };
function OnMouseDown3D(id, position, left, top) { CONTENTVIEW_3D.OnMouseDown3D = function(id, position, left, top) {
if(!_3dMoveFlag ){ if(!CONTENTVIEW_3D._3dMoveFlag ){
_3dMoveFlag = true; CONTENTVIEW_3D._3dMoveFlag = true;
//compate with matrix to check went to another frame or not //compate with matrix to check went to another frame or not
//and set to last selected frame to compare on move event later //and set to last selected frame to compare on move event later
var _lastSelectedFrame = getMatrixIndexByPosition(id, position, left, top); var _lastSelectedFrame = CONTENTVIEW_3D.getMatrixIndexByPosition(id, position, left, top);
set3dLastSeclectedFrame(id, _lastSelectedFrame); CONTENTVIEW_3D.set3dLastSeclectedFrame(id, _lastSelectedFrame);
} }
}; };
function OnMouseMove3D(id, position, left, top, width, height, _h, _v) { CONTENTVIEW_3D.OnMouseMove3D = function(id, position, left, top, width, height, _h, _v) {
if(!_3dMoveFlag){ if(!CONTENTVIEW_3D._3dMoveFlag){
return; return;
} }
//compate with matrix to check went to another frame or not //compate with matrix to check went to another frame or not
var selectedFrame = getMatrixIndexByPosition(id, position, left, top); var selectedFrame = CONTENTVIEW_3D.getMatrixIndexByPosition(id, position, left, top);
var _lastSeclectedFrame = get3dLastSeclectedFrame(id); var _lastSeclectedFrame = CONTENTVIEW_3D.get3dLastSeclectedFrame(id);
var _currFramePos = get3dCurrentFramePos(id); var _currFramePos = CONTENTVIEW_3D.get3dCurrentFramePos(id);
var _currFrameX = _currFramePos._currFrameX; var _currFrameX = _currFramePos._currFrameX;
var _currFrameY = _currFramePos._currFrameY; var _currFrameY = _currFramePos._currFrameY;
var strCountH = convNumTo2Char(selectedFrame.matrixX); var strCountH = CONTENTVIEW_GETDATA.convNumTo2Char(selectedFrame.matrixX);
var strCountV = convNumTo2Char(selectedFrame.matrixY); var strCountV = CONTENTVIEW_GETDATA.convNumTo2Char(selectedFrame.matrixY);
//get what action did occur //get what action did occur
var action = get3DAction(_lastSeclectedFrame, selectedFrame); var action = CONTENTVIEW_3D.get3DAction(_lastSeclectedFrame, selectedFrame);
$('#test').html(action); $('#test').html(action);
...@@ -249,49 +252,49 @@ function OnMouseMove3D(id, position, left, top, width, height, _h, _v) { ...@@ -249,49 +252,49 @@ function OnMouseMove3D(id, position, left, top, width, height, _h, _v) {
//_currFrameY++; //_currFrameY++;
_currFrameY--; _currFrameY--;
_currFrameX = reCalcMatrixX(_currFrameX, _h); _currFrameX = CONTENTVIEW_3D.reCalcMatrixX(_currFrameX, _h);
_currFrameY = reCalcMatrixY(_currFrameY, _v); _currFrameY = CONTENTVIEW_3D.reCalcMatrixY(_currFrameY, _v);
// show current img // show current img
showCurrImg(id, left, top, width, height, _currFrameX, _currFrameY); CONTENTVIEW_3D.showCurrImg(id, left, top, width, height, _currFrameX, _currFrameY);
_lastSeclectedFrame = selectedFrame; _lastSeclectedFrame = selectedFrame;
//recalculate X, Y value //recalculate X, Y value
_currFramePos._currFrameX = _currFrameX; _currFramePos._currFrameX = _currFrameX;
_currFramePos._currFrameY = _currFrameY; _currFramePos._currFrameY = _currFrameY;
set3dCurrentFramePos(id, _currFramePos); CONTENTVIEW_3D.set3dCurrentFramePos(id, _currFramePos);
set3dLastSeclectedFrame(id, _lastSeclectedFrame); CONTENTVIEW_3D.set3dLastSeclectedFrame(id, _lastSeclectedFrame);
} }
}; };
function OnMouseEnd3D(id, _h, _v) { CONTENTVIEW_3D.OnMouseEnd3D = function(id, _h, _v) {
if(_3dMoveFlag) { if(CONTENTVIEW_3D._3dMoveFlag) {
_3dMoveFlag = false; CONTENTVIEW_3D._3dMoveFlag = false;
var currFramePos = get3dCurrentFramePos(id); var currFramePos = CONTENTVIEW_3D.get3dCurrentFramePos(id);
var _currFrameX = currFramePos._currFrameX; var _currFrameX = currFramePos._currFrameX;
var _currFrameY = currFramePos._currFrameY; var _currFrameY = currFramePos._currFrameY;
var _arrFrame = getArrFrame(id); var _arrFrame = CONTENTVIEW_3D.getArrFrame(id);
//setImageIndexToMatrix(_currFrameX, _currFrameY, _arrFrame, _h, _v); //CONTENTVIEW_3D.setImageIndexToMatrix(_currFrameX, _currFrameY, _arrFrame, _h, _v);
setArrFrame(id, _h, _v, _currFrameX, _currFrameY, _arrFrame); CONTENTVIEW_3D.setArrFrame(id, _h, _v, _currFrameX, _currFrameY, _arrFrame);
} }
}; };
function setArrFrame(id, _h, _v, _currX, _currY, _arrFrame){ CONTENTVIEW_3D.setArrFrame = function(id, _h, _v, _currX, _currY, _arrFrame){
for(var i = 0; i < _object3DImageArr.length; i++){ for(var i = 0; i < CONTENTVIEW_GENERAL._object3DImageArr.length; i++){
var obj = _object3DImageArr[i]; var obj = CONTENTVIEW_GENERAL._object3DImageArr[i];
if(obj.id == id){ if(obj.id == id){
obj.arrFrame = setImageIndexToMatrix(_currX, _currY, _arrFrame, _h, _v); obj.arrFrame = CONTENTVIEW_3D.setImageIndexToMatrix(_currX, _currY, _arrFrame, _h, _v);
} }
} }
}; };
//compare 2 frame to get action //compare 2 frame to get action
function get3DAction(lastFrame, currFrame){ CONTENTVIEW_3D.get3DAction = function(lastFrame, currFrame){
var nRet = 0; var nRet = 0;
if(lastFrame.x1<currFrame.x1) if(lastFrame.x1<currFrame.x1)
...@@ -305,3 +308,4 @@ function get3DAction(lastFrame, currFrame){ ...@@ -305,3 +308,4 @@ function get3DAction(lastFrame, currFrame){
return nRet; return nRet;
}; };
//名前空間用のオブジェクトを用意する
var CONTENTVIEW_ANKET = {};
// show dialog anket content // show dialog anket content
function showAnket(url, fullscreen, objectId) { CONTENTVIEW_ANKET.showAnket = function(url, fullscreen, objectId) {
var $container = $('#dialog'); var $container = $('#dialog');
//url = url + "?sid=" + ClientData.userInfo_sid(); //url = url + "?sid=" + ClientData.userInfo_sid();
...@@ -33,10 +37,10 @@ function showAnket(url, fullscreen, objectId) { ...@@ -33,10 +37,10 @@ function showAnket(url, fullscreen, objectId) {
var dateEnd = new Date(); var dateEnd = new Date();
var actionTime = dateEnd.subtractBySeconds(dateStart); var actionTime = dateEnd.subtractBySeconds(dateStart);
//alert("actionTime:" + actionTime); //alert("actionTime:" + actionTime);
COMMON.SetObjectLogActionTime( contentID, objectId, actionTime ); COMMON.SetObjectLogActionTime( CONTENTVIEW_GENERAL.contentID, objectId, actionTime );
$container.removeAttr('style'); $container.removeAttr('style');
hideDialog(); CONTENTVIEW_GENERAL.hideDialog();
}); });
//時間記録 //時間記録
...@@ -78,27 +82,28 @@ function showAnket(url, fullscreen, objectId) { ...@@ -78,27 +82,28 @@ function showAnket(url, fullscreen, objectId) {
} }
); );
// resize anket // resize anket
resizeAnket(); CONTENTVIEW_ANKET.resizeAnket();
};
}; // resize dialog anket
CONTENTVIEW_ANKET.resizeAnket = function() {
// get canvas main
var canvas = document.getElementById('main');
var height = canvas.height;
// resize dialog anket var top = (CONTENTVIEW_GENERAL.isFullScreen?0:$('#header_toolbar').height()) + 4; // get top position for dialog 4 for space
function resizeAnket() {
// get canvas main
var canvas = document.getElementById('main');
var height = canvas.height;
var top = (isFullScreen?0:$('#header_toolbar').height()) + 4; // get top position for dialog 4 for space // set top dialog
$('#dialog').height(height).css('top', top);
// set top dialog var iframeHeight = height - $('#dialog h1').height() - $('#dialog .anket-commands').height() - 8; // 8 for 2xspace
$('#dialog').height(height).css('top', top);
var iframeHeight = height - $('#dialog h1').height() - $('#dialog .anket-commands').height() - 8; // 8 for 2xspace // set height for iframe
$('#dialog iframe').attr('height', iframeHeight);
// set height for iframe // set height for anket container
$('#dialog iframe').attr('height', iframeHeight); $('#dialog .anket-container').css('height', iframeHeight);
};
// set height for anket container
$('#dialog .anket-container').css('height', iframeHeight);
};
\ No newline at end of file
/// <reference path="../common/js/jquery-ui-1.8.23.custom.min.js" /> //名前空間用のオブジェクトを用意する
var CONTENTVIEW_CALLAPI = {};
/// <reference path="../common/js/common.js" />
/// <reference path="contentview_VarDef.js" />
//Call API //Call API
function abapi(name, param, method, callback) { CONTENTVIEW_CALLAPI.abapi = function(name, param, method, callback) {
AVWEB.avwCmsApiSync(ClientData.userInfo_accountPath(), name, method, param, callback, null); AVWEB.avwCmsApiSync(ClientData.userInfo_accountPath(), name, method, param, callback, null);
}; };
//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() { CONTENTVIEW_CALLAPI.getJsonContentInfo = function() {
AVWEB.avwGrabContentPageImage(ClientData.userInfo_accountPath(), AVWEB.avwGrabContentPageImage(ClientData.userInfo_accountPath(),
{ contentId: contentID, sid: ClientData.userInfo_sid(), pageNo: 1 }, { contentId: CONTENTVIEW_GENERAL.contentID, sid: ClientData.userInfo_sid(), pageNo: 1 },
function (data) { function (data) {
pageImages = data; CONTENTVIEW_GENERAL.pageImages = data;
webGetContentData(); CONTENTVIEW_CALLAPI.webGetContentData();
getSearchDataFromJson(); CONTENTVIEW_CALLAPI.getSearchDataFromJson();
getJsonDataPageTitle(); CONTENTVIEW_CALLAPI.getJsonDataPageTitle();
getJsonDataType4(); CONTENTVIEW_CALLAPI.getJsonDataType4();
getJsonDataType5(); CONTENTVIEW_CALLAPI.getJsonDataType5();
getDataJsonFile(); CONTENTVIEW_CALLAPI.getDataJsonFile();
//webGetPageImageContentSize(); //CONTENTVIEW_CALLAPI.webGetPageImageContentSize();
webGetContentPageSize(); CONTENTVIEW_CALLAPI.webGetContentPageSize();
}, },
function (xmlHttpRequest, txtStatus, errorThrown) { function (xmlHttpRequest, txtStatus, errorThrown) {
showErrorScreen(); 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() { //未使用
CONTENTVIEW_CALLAPI.webGetPageImageContentSize = function() {
AVWEB.avwCmsApi(ClientData.userInfo_accountPath(), AVWEB.avwCmsApi(ClientData.userInfo_accountPath(),
"webContentPageSize", "webContentPageSize",
"GET", "GET",
{ contentId: contentID, sid: ClientData.userInfo_sid() }, { contentId: CONTENTVIEW_GENERAL.contentID, sid: ClientData.userInfo_sid() },
function (data) { function (data) {
widthContentImage = data.width; CONTENTVIEW_GENERAL.widthContentImage = data.width;
heightContentImage = data.height; CONTENTVIEW_GENERAL.heightContentImage = data.height;
}, },
null); null);
}; };
//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
function webGetContentPageSize(){ CONTENTVIEW_CALLAPI.webGetContentPageSize = function(){
AVWEB.avwCmsApi(ClientData.userInfo_accountPath(), AVWEB.avwCmsApi(ClientData.userInfo_accountPath(),
"webGetContent", "webGetContent",
"GET", "GET",
{ contentId: contentID, sid: ClientData.userInfo_sid(), getType: 6 }, { contentId: CONTENTVIEW_GENERAL.contentID, sid: ClientData.userInfo_sid(), getType: 6 },
function (data) { function (data) {
if( data.contentData.pageInfoData.pagesInfo ){ if( data.contentData.pageInfoData.pagesInfo ){
$.each(data.contentData.pageInfoData.pagesInfo, function(i, n){ $.each(data.contentData.pageInfoData.pagesInfo, function(i, n){
contentPageSizeArr.push(n); CONTENTVIEW_GENERAL.contentPageSizeArr.push(n);
}); });
//Get Page size of firstPage //Get Page size of firstPage
getPageSizeByPageNo(1); CONTENTVIEW_CALLAPI.getPageSizeByPageNo(1);
} else { } else {
showErrorScreen(); CONTENTVIEW.showErrorScreen();
} }
}, },
null); null);
}; };
//Get Pagesize by pageNo //Get Pagesize by pageNo
function getPageSizeByPageNo(pageNo){ CONTENTVIEW_CALLAPI.getPageSizeByPageNo = function(pageNo){
for(var i = 0; i < contentPageSizeArr.length; i++){ for(var i = 0; i < CONTENTVIEW_GENERAL.contentPageSizeArr.length; i++){
var page = contentPageSizeArr[i]; var page = CONTENTVIEW_GENERAL.contentPageSizeArr[i];
if(page.pageNo == pageNo){ if(page.pageNo == pageNo){
widthContentImage = page.pageWidth; CONTENTVIEW_GENERAL.widthContentImage = page.pageWidth;
heightContentImage = page.pageHeight; CONTENTVIEW_GENERAL.heightContentImage = page.pageHeight;
} }
} }
}; };
//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 webGetContentData() { CONTENTVIEW_CALLAPI.webGetContentData = function() {
AVWEB.avwCmsApi(ClientData.userInfo_accountPath(), AVWEB.avwCmsApi(ClientData.userInfo_accountPath(),
"webGetContent", "webGetContent",
"GET", "GET",
{ contentId: contentID, sid: ClientData.userInfo_sid(), getType: 1 }, { contentId: CONTENTVIEW_GENERAL.contentID, sid: ClientData.userInfo_sid(), getType: 1 },
function (data) { function (data) {
totalPage = data.contentData.allPageNum; CONTENTVIEW_GENERAL.totalPage = data.contentData.allPageNum;
}, },
null); null);
}; };
/* get Json stored page title */ /* get Json stored page title */
function getJsonDataPageTitle() { CONTENTVIEW_CALLAPI.getJsonDataPageTitle = function() {
AVWEB.avwCmsApi(ClientData.userInfo_accountPath(), AVWEB.avwCmsApi(ClientData.userInfo_accountPath(),
"webGetContent", "webGetContent",
"GET", "GET",
{ contentId: contentID, sid: ClientData.userInfo_sid(), getType: 3 }, { contentId: CONTENTVIEW_GENERAL.contentID, sid: ClientData.userInfo_sid(), getType: 3 },
function (data) { function (data) {
dataPageTitle = []; CONTENTVIEW_GENERAL.dataPageTitle = [];
for (var nIndex = 0; nIndex < totalPage; nIndex++) { for (var nIndex = 0; nIndex < CONTENTVIEW_GENERAL.totalPage; nIndex++) {
dataPageTitle.push(""); CONTENTVIEW_GENERAL.dataPageTitle.push("");
} }
if (data.contentData) { if (data.contentData) {
if (data.contentData.titleInfo) { if (data.contentData.titleInfo) {
dataPageTitle = data.contentData.titleInfo; CONTENTVIEW_GENERAL.dataPageTitle = data.contentData.titleInfo;
} }
} }
}, },
...@@ -111,47 +110,47 @@ function getJsonDataPageTitle() { ...@@ -111,47 +110,47 @@ function getJsonDataPageTitle() {
}; };
/* get Json webGetContent4 */ /* get Json webGetContent4 */
function getJsonDataType4() { CONTENTVIEW_CALLAPI.getJsonDataType4 = function() {
AVWEB.avwCmsApi(ClientData.userInfo_accountPath(), AVWEB.avwCmsApi(ClientData.userInfo_accountPath(),
"webGetContent", "webGetContent",
"GET", "GET",
{ contentId: contentID, sid: ClientData.userInfo_sid(), getType: 4 }, { contentId: CONTENTVIEW_GENERAL.contentID, sid: ClientData.userInfo_sid(), getType: 4 },
function (data) { function (data) {
dataJsonType4 = data.contentData.linkData; CONTENTVIEW_GENERAL.dataJsonType4 = data.contentData.linkData;
}, },
null); null);
}; };
/* get Json webGetContent5 */ /* get Json webGetContent5 */
function getJsonDataType5() { CONTENTVIEW_CALLAPI.getJsonDataType5 = function() {
AVWEB.avwCmsApi(ClientData.userInfo_accountPath(), AVWEB.avwCmsApi(ClientData.userInfo_accountPath(),
"webGetContent", "webGetContent",
"GET", "GET",
{ contentId: contentID, sid: ClientData.userInfo_sid(), getType: 5 }, { contentId: CONTENTVIEW_GENERAL.contentID, sid: ClientData.userInfo_sid(), getType: 5 },
function (data) { function (data) {
dataJsonType5 = data.contentData.outlineData; CONTENTVIEW_GENERAL.dataJsonType5 = data.contentData.outlineData;
}, },
null); null);
}; };
/* read file Json -> get page objects */ /* read file Json -> get page objects */
function getDataJsonFile() { CONTENTVIEW_CALLAPI.getDataJsonFile = function() {
//get content from JSON //get content from JSON
AVWEB.avwCmsApi(ClientData.userInfo_accountPath(), AVWEB.avwCmsApi(ClientData.userInfo_accountPath(),
"webGetContent", "webGetContent",
"GET", "GET",
{ sid: ClientData.userInfo_sid(), contentId: contentID, getType: 2 }, { sid: ClientData.userInfo_sid(), contentId: CONTENTVIEW_GENERAL.contentID, getType: 2 },
function (data) { function (data) {
var JsonFile = data.contentData; var JsonFile = data.contentData;
pageObjectsData = []; CONTENTVIEW_GENERAL.pageObjectsData = [];
if (JsonFile.vertical) { if (JsonFile.vertical) {
if (JsonFile.vertical.pages) { if (JsonFile.vertical.pages) {
pageObjectsData = JsonFile.vertical.pages; CONTENTVIEW_GENERAL.pageObjectsData = JsonFile.vertical.pages;
//Start Function : No.9 - Editor : Long - Date : 08/16/2013 - Summary : //Start Function : No.9 - Editor : Long - Date : 08/16/2013 - Summary :
if(data.contentDataSub != null && data.contentDataSub.length > 0){ if(data.contentDataSub != null && data.contentDataSub.length > 0){
for(var i = 0; i < pageObjectsData.length; i++){ for(var i = 0; i < CONTENTVIEW_GENERAL.pageObjectsData.length; i++){
var obj = pageObjectsData[i]; var obj = CONTENTVIEW_GENERAL.pageObjectsData[i];
obj["contentDataSub"] = data.contentDataSub; obj["contentDataSub"] = data.contentDataSub;
} }
} }
...@@ -160,11 +159,11 @@ function getDataJsonFile() { ...@@ -160,11 +159,11 @@ function getDataJsonFile() {
} }
else if (JsonFile.horizontal) { else if (JsonFile.horizontal) {
if (JsonFile.horizontal.pages) { if (JsonFile.horizontal.pages) {
pageObjectsData = JsonFile.horizontal.pages; CONTENTVIEW_GENERAL.pageObjectsData = JsonFile.horizontal.pages;
//Start Function : No.9 - Editor : Long - Date : 08/16/2013 - Summary : //Start Function : No.9 - Editor : Long - Date : 08/16/2013 - Summary :
if(data.contentDataSub != null && data.contentDataSub.length > 0){ if(data.contentDataSub != null && data.contentDataSub.length > 0){
for(var i = 0; i < pageObjectsData.length; i++){ for(var i = 0; i < CONTENTVIEW_GENERAL.pageObjectsData.length; i++){
var obj = pageObjectsData[i]; var obj = CONTENTVIEW_GENERAL.pageObjectsData[i];
obj["contentDataSub"] = data.contentDataSub; obj["contentDataSub"] = data.contentDataSub;
} }
} }
...@@ -173,18 +172,18 @@ function getDataJsonFile() { ...@@ -173,18 +172,18 @@ function getDataJsonFile() {
} }
//Start : Function : No.12 - Editor : Long - Date: 08/27/2013 - Summary : Get Page Object for content type none //Start : Function : No.12 - Editor : Long - Date: 08/27/2013 - Summary : Get Page Object for content type none
else{ else{
pageObjectsData = JsonFile.content.pages; CONTENTVIEW_GENERAL.pageObjectsData = JsonFile.content.pages;
if(data.contentDataSub != null && data.contentDataSub.length > 0){ if(data.contentDataSub != null && data.contentDataSub.length > 0){
for(var i = 0; i < pageObjectsData.length; i++){ for(var i = 0; i < CONTENTVIEW_GENERAL.pageObjectsData.length; i++){
var obj = pageObjectsData[i]; var obj = CONTENTVIEW_GENERAL.pageObjectsData[i];
obj["contentDataSub"] = data.contentDataSub; obj["contentDataSub"] = data.contentDataSub;
} }
} }
} }
//Get Data Of page to draw page //Get Data Of page to draw page
if(contentType == COMMON.ContentTypeKeys.Type_NoFile){ if(CONTENTVIEW_GENERAL.contentType == COMMON.ContentTypeKeys.Type_NoFile){
var pageDataInfo = []; var pageDataInfo = [];
pageDataInfo["height"] = JsonFile.height; pageDataInfo["height"] = JsonFile.height;
...@@ -192,32 +191,33 @@ function getDataJsonFile() { ...@@ -192,32 +191,33 @@ function getDataJsonFile() {
pageDataInfo["alpha"] = JsonFile.backgroundAlpha; pageDataInfo["alpha"] = JsonFile.backgroundAlpha;
pageDataInfo["color"] = JsonFile.backgroundColor; pageDataInfo["color"] = JsonFile.backgroundColor;
totalPage = parseInt(JsonFile.totalPageNum); CONTENTVIEW_GENERAL.totalPage = parseInt(JsonFile.totalPageNum);
pageImages = returnImageString(pageDataInfo); CONTENTVIEW_GENERAL.pageImages = CONTENTVIEW_CONTENTTYPENONE.returnImageString(pageDataInfo);
widthContentImage = JsonFile.width; CONTENTVIEW_GENERAL.widthContentImage = JsonFile.width;
heightContentImage = JsonFile.height; CONTENTVIEW_GENERAL.heightContentImage = JsonFile.height;
} }
//End : Function : No.12 - Editor : Long - Date: 08/27/2013 - Summary : Get Page Object for content type none //End : Function : No.12 - Editor : Long - Date: 08/27/2013 - Summary : Get Page Object for content type none
getPageObjectsByPageIndex(pageObjectsData, 0); CONTENTVIEW_GETDATA.getPageObjectsByPageIndex(CONTENTVIEW_GENERAL.pageObjectsData, 0);
}, },
null); null);
}; };
function loadDataBookmark(lstPageNo) {
if (isSendingData == true) { CONTENTVIEW_CALLAPI.loadDataBookmark = function(lstPageNo) {
if (CONTENTVIEW_GENERAL.isSendingData == true) {
AVWEB.avwCmsApi(ClientData.userInfo_accountPath(), AVWEB.avwCmsApi(ClientData.userInfo_accountPath(),
"webContentPage", "webContentPage",
"GET", "GET",
{ sid: ClientData.userInfo_sid(), contentId: contentID, pageNos: lstPageNo[0], thumbnailFlg: 1 }, { sid: ClientData.userInfo_sid(), contentId: CONTENTVIEW_GENERAL.contentID, pageNos: lstPageNo[0], thumbnailFlg: 1 },
function (data) { function (data) {
getDataLoaded(data.pages); CONTENTVIEW_GETDATA.getDataLoaded(data.pages);
//Resize Image //Resize Image
var imgTemp = new Image(); var imgTemp = new Image();
$('#img_bookmark_' + data.pages[0].pageNo).attr('src', formatStringBase64(data.pages[0].pageThumbnail)); $('#img_bookmark_' + data.pages[0].pageNo).attr('src', COMMON.formatStringBase64(data.pages[0].pageThumbnail));
imgTemp.onload = function () { imgTemp.onload = function () {
...@@ -234,16 +234,16 @@ function loadDataBookmark(lstPageNo) { ...@@ -234,16 +234,16 @@ function loadDataBookmark(lstPageNo) {
} }
}; };
imgTemp.src = formatStringBase64(data.pages[0].pageThumbnail); imgTemp.src = COMMON.formatStringBase64(data.pages[0].pageThumbnail);
lstPageNo = jQuery.grep(lstPageNo, function (value) { lstPageNo = jQuery.grep(lstPageNo, function (value) {
return value != lstPageNo[0]; return value != lstPageNo[0];
}); });
if (lstPageNo.length > 0) { if (lstPageNo.length > 0) {
loadDataBookmark(lstPageNo); CONTENTVIEW_CALLAPI.loadDataBookmark(lstPageNo);
} else { } else {
isSendingData = false; CONTENTVIEW_GENERAL.isSendingData = false;
} }
}, },
null); null);
...@@ -251,11 +251,11 @@ function loadDataBookmark(lstPageNo) { ...@@ -251,11 +251,11 @@ function loadDataBookmark(lstPageNo) {
}; };
/* get data using for search */ /* get data using for search */
function getSearchDataFromJson() { CONTENTVIEW_CALLAPI.getSearchDataFromJson = function() {
//get data from JSON file //get data from JSON file
var arrPageNo = ''; var arrPageNo = '';
for (var nIndex = 0; nIndex < totalPage; nIndex++) { for (var nIndex = 0; nIndex < CONTENTVIEW_GENERAL.totalPage; nIndex++) {
if (nIndex == 0) { if (nIndex == 0) {
arrPageNo += (nIndex + 1); arrPageNo += (nIndex + 1);
} else { } else {
...@@ -265,28 +265,28 @@ function getSearchDataFromJson() { ...@@ -265,28 +265,28 @@ function getSearchDataFromJson() {
AVWEB.avwCmsApi(ClientData.userInfo_accountPath(), AVWEB.avwCmsApi(ClientData.userInfo_accountPath(),
"webContentPage", "webContentPage",
"GET", "GET",
{ sid: ClientData.userInfo_sid(), contentId: contentID, thumbnailFlg: 0 }, { sid: ClientData.userInfo_sid(), contentId: CONTENTVIEW_GENERAL.contentID, thumbnailFlg: 0 },
function (data) { function (data) {
contentName = data.contentTitle; CONTENTVIEW_GENERAL.contentName = data.contentTitle;
dataWebContentPage = data; CONTENTVIEW_GENERAL.dataWebContentPage = data;
}, },
null); null);
}; };
function loadDataSearch(lstPageNo) { CONTENTVIEW_CALLAPI.loadDataSearch = function(lstPageNo) {
if (isSendingData == true) { if (CONTENTVIEW_GENERAL.isSendingData == true) {
AVWEB.avwCmsApi(ClientData.userInfo_accountPath(), AVWEB.avwCmsApi(ClientData.userInfo_accountPath(),
"webContentPage", "webContentPage",
"GET", "GET",
{ sid: ClientData.userInfo_sid(), contentId: contentID, pageNos: lstPageNo[0], thumbnailFlg: 1 }, { sid: ClientData.userInfo_sid(), contentId: CONTENTVIEW_GENERAL.contentID, pageNos: lstPageNo[0], thumbnailFlg: 1 },
function (data) { function (data) {
getDataLoaded(data.pages); CONTENTVIEW_GETDATA.getDataLoaded(data.pages);
//Resize Image //Resize Image
var imgTemp = new Image(); var imgTemp = new Image();
$('#img_search_' + data.pages[0].pageNo).attr('src', formatStringBase64(data.pages[0].pageThumbnail)); $('#img_search_' + data.pages[0].pageNo).attr('src', COMMON.formatStringBase64(data.pages[0].pageThumbnail));
imgTemp.onload = function () { imgTemp.onload = function () {
...@@ -303,20 +303,19 @@ function loadDataSearch(lstPageNo) { ...@@ -303,20 +303,19 @@ function loadDataSearch(lstPageNo) {
} }
}; };
imgTemp.src = formatStringBase64(data.pages[0].pageThumbnail); imgTemp.src = COMMON.formatStringBase64(data.pages[0].pageThumbnail);
lstPageNo = jQuery.grep(lstPageNo, function (value) { lstPageNo = jQuery.grep(lstPageNo, function (value) {
return value != lstPageNo[0]; return value != lstPageNo[0];
}); });
if (lstPageNo.length > 0) { if (lstPageNo.length > 0) {
loadDataSearch(lstPageNo); CONTENTVIEW_CALLAPI.loadDataSearch(lstPageNo);
} else { } else {
isSendingData = false; CONTENTVIEW_GENERAL.isSendingData = false;
} }
}, },
null); null);
} }
}; };
function getJsonContentInfoTyeNone() {
//webGetContentData(); //名前空間用のオブジェクトを用意する
getSearchDataFromJson(); var CONTENTVIEW_CONTENTTYPENONE = {};
getJsonDataPageTitle();
getDataJsonFile(); CONTENTVIEW_CONTENTTYPENONE.getJsonContentInfoTyeNone = function() {
//CONTENTVIEW_CALLAPI.webGetContentData();
CONTENTVIEW_CALLAPI.getSearchDataFromJson();
CONTENTVIEW_CALLAPI.getJsonDataPageTitle();
CONTENTVIEW_CALLAPI.getDataJsonFile();
}; };
//Return a string base 64 image has drawn with specify data //Return a string base 64 image has drawn with specify data
function returnImageString(data){ CONTENTVIEW_CONTENTTYPENONE.returnImageString = function(data){
if(data){ if(data){
var height = data.height; var height = data.height;
var width = data.width; var width = data.width;
...@@ -30,3 +34,4 @@ function returnImageString(data){ ...@@ -30,3 +34,4 @@ function returnImageString(data){
return imageUrl; return imageUrl;
}; };
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
/// <reference path="../common/js/jquery-ui-1.8.23.custom.min.js" /> //名前空間用のオブジェクトを用意する
var CONTENTVIEW_GENERAL = {};
/// <reference path="../common/js/common.js" />
/* init const */ /* init const */
var WIDTH_DIALOG_BOOKMARK = 300; //CONTENTVIEW_GENERAL.WIDTH_DIALOG_BOOKMARK = 300;
var HEIGHT_DIALOG_BOOKMARK = 700; //CONTENTVIEW_GENERAL.HEIGHT_DIALOG_BOOKMARK = 700;
var HEIGHT_DIALOG_BOOKMARK_NO_BOOKMARK = 200; //CONTENTVIEW_GENERAL.HEIGHT_DIALOG_BOOKMARK_NO_BOOKMARK = 200;
var WIDTH_DIALOG_INDEX = 300; //CONTENTVIEW_GENERAL.WIDTH_DIALOG_INDEX = 300;
var HEIGHT_DIALOG_INDEX = 700; //CONTENTVIEW_GENERAL.HEIGHT_DIALOG_INDEX = 700;
var HEIGHT_DIALOG_INDEX_NO_INDEX = 200; //CONTENTVIEW_GENERAL.HEIGHT_DIALOG_INDEX_NO_INDEX = 200;
var WIDTH_DIALOG_SEARCH = 300; //CONTENTVIEW_GENERAL.WIDTH_DIALOG_SEARCH = 300;
var HEIGHT_DIALOG_SEARCH = 700; //CONTENTVIEW_GENERAL.HEIGHT_DIALOG_SEARCH = 700;
var HEIGHT_DIALOG_SEARCH_NO_SEARCH = 200; //CONTENTVIEW_GENERAL.HEIGHT_DIALOG_SEARCH_NO_SEARCH = 200;
var WIDTH_DIALOG_COPYTEXT = 300; //CONTENTVIEW_GENERAL.WIDTH_DIALOG_COPYTEXT = 300;
var HEIGHT_DIALOG_COPYTEXT = 500; //CONTENTVIEW_GENERAL.HEIGHT_DIALOG_COPYTEXT = 500;
var HEIGHT_DIALOG_COPYTEXT_NO_COPYTEXT = 200; //CONTENTVIEW_GENERAL.HEIGHT_DIALOG_COPYTEXT_NO_COPYTEXT = 200;
/* init variable */ /* init variable */
var pageImages = ''; CONTENTVIEW_GENERAL.pageImages = '';
var totalPage = 0; CONTENTVIEW_GENERAL.totalPage = 0;
var pageObjects = []; CONTENTVIEW_GENERAL.pageObjects = [];
var pageObjectsData = []; CONTENTVIEW_GENERAL.pageObjectsData = [];
var tool; CONTENTVIEW_GENERAL.tool;
var isFullScreen = false; CONTENTVIEW_GENERAL.isFullScreen = false;
var ctrlMode = false; CONTENTVIEW_GENERAL.ctrlMode = false;
var dataWebContentPage; CONTENTVIEW_GENERAL.dataWebContentPage;
var dataPageTitle; CONTENTVIEW_GENERAL.dataPageTitle;
var dataJsonType4; CONTENTVIEW_GENERAL.dataJsonType4;
var dataJsonType5; CONTENTVIEW_GENERAL.dataJsonType5;
var contentID; CONTENTVIEW_GENERAL.contentID;
var isOpenPopUpText = false; CONTENTVIEW_GENERAL.isOpenPopUpText = false;
var isOpenPopUpMemo = true; CONTENTVIEW_GENERAL.isOpenPopUpMemo = true;
var objEditMemo; CONTENTVIEW_GENERAL.objEditMemo;
var isCopyMemo = false; CONTENTVIEW_GENERAL.isCopyMemo = false;
var isExistCopyMemo = false; //CONTENTVIEW_GENERAL.isExistCopyMemo = false;
var posXPopupMemo = 0; CONTENTVIEW_GENERAL.posXPopupMemo = 0;
var posYPopupMemo = 0; CONTENTVIEW_GENERAL.posYPopupMemo = 0;
var contentName = ''; CONTENTVIEW_GENERAL.contentName = '';
var nCountObjectLoad = 0; CONTENTVIEW_GENERAL.nCountObjectLoad = 0;
var nAjaxLoad = 0; CONTENTVIEW_GENERAL.nAjaxLoad = 0;
var isClearDrawing = false; CONTENTVIEW_GENERAL.isClearDrawing = false;
var isDrawing = false; CONTENTVIEW_GENERAL.isDrawing = false;
var mediaType4_changeImage = 0; CONTENTVIEW_GENERAL.mediaType4_changeImage = 0;
var isLoadingObject = false; CONTENTVIEW_GENERAL.isLoadingObject = false;
var isFirstLoad = true; CONTENTVIEW_GENERAL.isFirstLoad = true;
var nPositionCanvas = []; CONTENTVIEW_GENERAL.nPositionCanvas = [];
var arrImage = []; CONTENTVIEW_GENERAL.arrImage = [];
var posTxtSearch = []; //CONTENTVIEW_GENERAL.posTxtSearch = [];
var sx, sy; CONTENTVIEW_GENERAL.sx;
var imgDrawingTemp; CONTENTVIEW_GENERAL.sy;
var imgMarkerTemp; CONTENTVIEW_GENERAL.imgDrawingTemp;
var isSizingDrawCanvas = false; CONTENTVIEW_GENERAL.imgMarkerTemp;
var isDisplayBookMarkList = false; //CONTENTVIEW_GENERAL.isSizingDrawCanvas = false;
var avwUserEnvObj = new UserEnvironment(); CONTENTVIEW_GENERAL.isDisplayBookMarkList = false;
var canvas_marker; CONTENTVIEW_GENERAL.avwUserEnvObj = new UserEnvironment();
var context_marker; CONTENTVIEW_GENERAL.canvas_marker;
var canvas_draw; CONTENTVIEW_GENERAL.context_marker;
var context_draw; CONTENTVIEW_GENERAL.canvas_draw;
var canvas_main; CONTENTVIEW_GENERAL.context_draw;
var context_main; CONTENTVIEW_GENERAL.canvas_main;
var canvas_offscreen; CONTENTVIEW_GENERAL.context_main;
var context_offscreen; CONTENTVIEW_GENERAL.canvas_offscreen;
var isAddingMarking; CONTENTVIEW_GENERAL.context_offscreen;
var penSize; CONTENTVIEW_GENERAL.isAddingMarking;
var penColor; CONTENTVIEW_GENERAL.penSize;
var makerSize; CONTENTVIEW_GENERAL.penColor;
var makerColor; CONTENTVIEW_GENERAL.makerSize;
var eraseSize; CONTENTVIEW_GENERAL.makerColor;
var markingType; CONTENTVIEW_GENERAL.eraseSize;
var isDisplayCopyText = false; CONTENTVIEW_GENERAL.markingType;
var isDisplayListIndex = false; CONTENTVIEW_GENERAL.isDisplayCopyText = false;
var isChangeSizeScreen = false; CONTENTVIEW_GENERAL.isDisplayListIndex = false;
var widthContentImage = 0; CONTENTVIEW_GENERAL.isChangeSizeScreen = false; //実質未使用
var heightContentImage = 0; CONTENTVIEW_GENERAL.widthContentImage = 0;
var widthEachPage = 0; CONTENTVIEW_GENERAL.heightContentImage = 0;
var heightEachPage = 0; CONTENTVIEW_GENERAL.widthEachPage = 0;
var px = 0; CONTENTVIEW_GENERAL.heightEachPage = 0;
var py = 0; CONTENTVIEW_GENERAL.px = 0;
var isPressLeftMouse = false; CONTENTVIEW_GENERAL.py = 0;
var isMoveOutDrawCanvas = false; CONTENTVIEW_GENERAL.isPressLeftMouse = false;
var typeSelectMemo = 0; CONTENTVIEW_GENERAL.isMoveOutDrawCanvas = false;
var arrThumbnailsLoaded = []; CONTENTVIEW_GENERAL.typeSelectMemo = 0;
var isSendingData = true; CONTENTVIEW_GENERAL.arrThumbnailsLoaded = [];
var isPlayBGMUnlock = false; CONTENTVIEW_GENERAL.isSendingData = true;
var isJumpNotFromFirstPage = false; CONTENTVIEW_GENERAL.isPlayBGMUnlock = false; //未使用
var standardRatio = 1; CONTENTVIEW_GENERAL.isJumpNotFromFirstPage = false;
var currentRatio = 1; CONTENTVIEW_GENERAL.standardRatio = 1; //未使用
var resourceImage = new Image(); CONTENTVIEW_GENERAL.currentRatio = 1; //未使用
CONTENTVIEW_GENERAL.resourceImage = new Image();
//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
//Array of pages size //Array of pages size
var contentPageSizeArr = []; CONTENTVIEW_GENERAL.contentPageSizeArr = [];
var widthEachNextPage = 0; CONTENTVIEW_GENERAL.widthEachNextPage = 0;
var heightEachNextPage = 0; CONTENTVIEW_GENERAL.heightEachNextPage = 0;
var widthEachPrevPage = 0; CONTENTVIEW_GENERAL.widthEachPrevPage = 0;
var heightEachPrevPage = 0; CONTENTVIEW_GENERAL.heightEachPrevPage = 0;
//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
//#11478 //#11478
var widthEachPageApi = 0; CONTENTVIEW_GENERAL.widthEachPageApi = 0;
var heightEachPageApi = 0; CONTENTVIEW_GENERAL.heightEachPageApi = 0;
var widthEachNextPageApi = 0; CONTENTVIEW_GENERAL.widthEachNextPageApi = 0;
var heightEachNextPageApi = 0; CONTENTVIEW_GENERAL.heightEachNextPageApi = 0;
var widthEachPrevPageApi = 0; CONTENTVIEW_GENERAL.widthEachPrevPageApi = 0;
var heightEachPrevPageApi = 0; CONTENTVIEW_GENERAL.heightEachPrevPageApi = 0;
//#11478 //#11478
/* zoom video */ /* zoom video */
var pxVideo; CONTENTVIEW_GENERAL.pxVideo;
var pyVideo; CONTENTVIEW_GENERAL.pyVideo;
var wVideo; CONTENTVIEW_GENERAL.wVideo;
var hVideo; CONTENTVIEW_GENERAL.hVideo;
var videoScale; CONTENTVIEW_GENERAL.videoScale; //未使用
//Start Function: No.12 //Start Function: No.12
//Content's types //Content's types
var contentType; CONTENTVIEW_GENERAL.contentType;
var imageTypeData; CONTENTVIEW_GENERAL.imageTypeData;
var nextPageImage = ''; CONTENTVIEW_GENERAL.nextPageImage = '';
var nextPageObjects = []; CONTENTVIEW_GENERAL.nextPageObjects = [];
var nextContent = new Content(); CONTENTVIEW_GENERAL.nextContent = new CONTENTVIEW_CREATEOBJECT.Content();
var prevPageObjects = []; CONTENTVIEW_GENERAL.prevPageObjects = [];
var prevPageImage = ''; CONTENTVIEW_GENERAL.prevPageImage = '';
var prevContent = new Content(); CONTENTVIEW_GENERAL.prevContent = new CONTENTVIEW_CREATEOBJECT.Content();
var animateTypeKeys = { CONTENTVIEW_GENERAL.animateTypeKeys = {
Type_Slide : 0, Type_Slide : 0,
Type_FadeIn : 1 Type_FadeIn : 1
}; };
var animateType; CONTENTVIEW_GENERAL.animateType;
var animatePeriod; CONTENTVIEW_GENERAL.animatePeriod;
function getNextContent(){ CONTENTVIEW_GENERAL.getNextContent = function(){
return nextContent; return CONTENTVIEW_GENERAL.nextContent;
}; };
function getPrevContent(){ CONTENTVIEW_GENERAL.getPrevContent = function(){
return prevContent; return CONTENTVIEW_GENERAL.prevContent;
}; };
...@@ -151,40 +151,40 @@ function getPrevContent(){ ...@@ -151,40 +151,40 @@ function getPrevContent(){
//Start Function : No.20 //Start Function : No.20
var _moveFlag = false; //CONTENTVIEW_GENERAL._moveFlag = false;
var _moveNum = false; CONTENTVIEW_GENERAL._moveNum = false;
var _isPageNaviTouch = false; CONTENTVIEW_GENERAL._isPageNaviTouch = false;
var _isPageZoomTouch = false; CONTENTVIEW_GENERAL._isPageZoomTouch = false;
var _clickFirstPos = null; CONTENTVIEW_GENERAL._clickFirstPos = null;
var _clickLastPos = null; CONTENTVIEW_GENERAL._clickLastPos = null;
var _touchFirstPos = null; CONTENTVIEW_GENERAL._touchFirstPos = null;
var _touchLastPos = null; CONTENTVIEW_GENERAL._touchLastPos = null;
var touchStartedTime = null; CONTENTVIEW_GENERAL.touchStartedTime = null;
var _touchMoveTimePeriod = 0; // 0 s CONTENTVIEW_GENERAL._touchMoveTimePeriod = 0; // 0 s
var _touchMoveTimePeriodInvalid = 5000; // 5 s CONTENTVIEW_GENERAL._touchMoveTimePeriodInvalid = 5000; // 5 s
var _bHasNext = false; //CONTENTVIEW_GENERAL._bHasNext = false;
var _bHasPrev = false; //CONTENTVIEW_GENERAL._bHasPrev = false;
var _startPoints = []; CONTENTVIEW_GENERAL._startPoints = [];
var _bufferPoints = []; CONTENTVIEW_GENERAL._bufferPoints = [];
var _bImageMainReload = true; // to not run onload again on the next time on set src value //CONTENTVIEW_GENERAL._bImageMainReload = true; // to not run onload again on the next time on set src value
var _bImageMainPreReload = true; // to not run onload again on the next time on set src value //CONTENTVIEW_GENERAL._bImageMainPreReload = true; // to not run onload again on the next time on set src value
var _bImageMainNextReload = true; // to not run onload again on the next time on set src value //CONTENTVIEW_GENERAL._bImageMainNextReload = true; // to not run onload again on the next time on set src value
var _lastDist = 0; CONTENTVIEW_GENERAL._lastDist = 0;
var _lastScaleDelta = 0; CONTENTVIEW_GENERAL._lastScaleDelta = 0;
var _bWin8TouchEnabled = false; CONTENTVIEW_GENERAL._bWin8TouchEnabled = false;
var _bTransitionEnable = true; CONTENTVIEW_GENERAL._bTransitionEnable = true;
var _bTouchDeviceEnabled = false; CONTENTVIEW_GENERAL._bTouchDeviceEnabled = false;
//End Function : No.20 //End Function : No.20
//Start Function : No.9 //Start Function : No.9
var _object3DImageArr = []; CONTENTVIEW_GENERAL._object3DImageArr = [];
//End Function : No.9 //End Function : No.9
/*disable all control on page */ /*disable all control on page */
function disableAllControl() { CONTENTVIEW_GENERAL.disableAllControl = function() {
/* set cursor pointer*/ /* set cursor pointer*/
$("#imgHome").css('cursor', 'default'); $("#imgHome").css('cursor', 'default');
$("#imgBack").css('cursor', 'default'); $("#imgBack").css('cursor', 'default');
...@@ -274,7 +274,7 @@ function disableAllControl() { ...@@ -274,7 +274,7 @@ function disableAllControl() {
$('#zoomout').unbind('click'); $('#zoomout').unbind('click');
$('#zoomout').removeClass(); $('#zoomout').removeClass();
$('#zoomout').addClass('reduction_off'); $('#zoomout').addClass('reduction_off');
if (avwUserEnvObj.os != "android") { if (CONTENTVIEW_GENERAL.avwUserEnvObj.os != "android") {
$("#slider_page").slider("option", "disabled", true); $("#slider_page").slider("option", "disabled", true);
} }
...@@ -286,8 +286,8 @@ function disableAllControl() { ...@@ -286,8 +286,8 @@ function disableAllControl() {
}; };
/*enable all control on page */ /*enable all control on page */
function enableAllControl() { CONTENTVIEW_GENERAL.enableAllControl = function() {
disableAllControl(); CONTENTVIEW_GENERAL.disableAllControl();
/* set cursor pointer*/ /* set cursor pointer*/
$("#imgHome").css('cursor', 'pointer'); $("#imgHome").css('cursor', 'pointer');
...@@ -296,7 +296,7 @@ function enableAllControl() { ...@@ -296,7 +296,7 @@ function enableAllControl() {
$("#imgbookmark").css('cursor', 'pointer'); $("#imgbookmark").css('cursor', 'pointer');
//Start Function: No.12 //Start Function: No.12
if (contentType == COMMON.ContentTypeKeys.Type_PDF) { if (CONTENTVIEW_GENERAL.contentType == COMMON.ContentTypeKeys.Type_PDF) {
$("#listindex").css('cursor', 'pointer'); $("#listindex").css('cursor', 'pointer');
$("#copytext").css('cursor', 'pointer'); $("#copytext").css('cursor', 'pointer');
} }
...@@ -317,7 +317,7 @@ function enableAllControl() { ...@@ -317,7 +317,7 @@ function enableAllControl() {
$("#control_screen_2").css('cursor', 'pointer'); $("#control_screen_2").css('cursor', 'pointer');
//Start Function: No.12 //Start Function: No.12
if (contentType == COMMON.ContentTypeKeys.Type_PDF || contentType == COMMON.ContentTypeKeys.Type_NoFile) { if (CONTENTVIEW_GENERAL.contentType == COMMON.ContentTypeKeys.Type_PDF || CONTENTVIEW_GENERAL.contentType == COMMON.ContentTypeKeys.Type_NoFile) {
$("#slider_page").css('cursor', 'pointer'); $("#slider_page").css('cursor', 'pointer');
$(".ui-slider-handle").css('cursor', 'pointer'); $(".ui-slider-handle").css('cursor', 'pointer');
} }
...@@ -330,61 +330,61 @@ function enableAllControl() { ...@@ -330,61 +330,61 @@ function enableAllControl() {
$("#control_screen").removeClass(); $("#control_screen").removeClass();
$("#control_screen_2").removeClass(); $("#control_screen_2").removeClass();
$('#imgHome').bind('click', imgHome_click); $('#imgHome').bind('click', CONTENTVIEW_EVENTS.imgHome_click);
$('#imgHome').removeClass(); $('#imgHome').removeClass();
$('#imgBack').bind('click', imgBack_click); $('#imgBack').bind('click', CONTENTVIEW_EVENTS.imgBack_click);
$('#imgBack').removeClass(); $('#imgBack').removeClass();
/*list bookmark */ /*list bookmark */
$('#listbookmark').bind('click', showListBookMark); $('#listbookmark').bind('click', CONTENTVIEW_EVENTS.showListBookMark);
$('#listbookmark').removeClass(); $('#listbookmark').removeClass();
$('#imgbookmark').bind('click', bookmarkPage); $('#imgbookmark').bind('click', CONTENTVIEW.bookmarkPage);
$('#imgbookmark').removeClass(); $('#imgbookmark').removeClass();
//Start Function: No.12 //Start Function: No.12
if (contentType == COMMON.ContentTypeKeys.Type_PDF) { if (CONTENTVIEW_GENERAL.contentType == COMMON.ContentTypeKeys.Type_PDF) {
$('#listindex').bind('click', showListPageIndex); $('#listindex').bind('click', CONTENTVIEW_EVENTS.showListPageIndex);
$('#listindex').removeClass(); $('#listindex').removeClass();
$('#copytext').bind('click', showCopyText); $('#copytext').bind('click', CONTENTVIEW_EVENTS.showCopyText);
$('#copytext').removeClass(); $('#copytext').removeClass();
} }
//End Function: No.12 //End Function: No.12
/* image memo */ /* image memo */
$('#imgmemo').bind('click', handleMemo); $('#imgmemo').bind('click', CONTENTVIEW.handleMemo);
$('#imgmemo').removeClass(); $('#imgmemo').removeClass();
/* image add memo */ /* image add memo */
$('#imgaddmemo').bind('click', handleAddMemo); $('#imgaddmemo').bind('click', CONTENTVIEW_EVENTS.handleAddMemo);
$('#imgaddmemo').removeClass(); $('#imgaddmemo').removeClass();
$('#imgmarking').bind('click', imgmarking_click); $('#imgmarking').bind('click', CONTENTVIEW_EVENTS.imgmarking_click);
$('#imgmarking').removeClass(); $('#imgmarking').removeClass();
if (ClientData.serviceOpt_marking() == 'Y') { if (ClientData.serviceOpt_marking() == 'Y') {
$('#imgmarkingtoolbar').bind('click', handleDrawCanvas); $('#imgmarkingtoolbar').bind('click', CONTENTVIEW.handleDrawCanvas);
$('#imgmarkingtoolbar').removeClass(); $('#imgmarkingtoolbar').removeClass();
} }
checkDisableButtonZoom(); CONTENTVIEW.checkDisableButtonZoom();
//Start Function: No.12 //Start Function: No.12
if (contentType == COMMON.ContentTypeKeys.Type_PDF || contentType == COMMON.ContentTypeKeys.Type_NoFile) { if (CONTENTVIEW_GENERAL.contentType == COMMON.ContentTypeKeys.Type_PDF || CONTENTVIEW_GENERAL.contentType == COMMON.ContentTypeKeys.Type_NoFile) {
$("#slider_page").slider("option", "disabled", false); $("#slider_page").slider("option", "disabled", false);
if(contentType == COMMON.ContentTypeKeys.Type_PDF){ if(CONTENTVIEW_GENERAL.contentType == COMMON.ContentTypeKeys.Type_PDF){
COMMON.enable('#txtSearch', '#txtSlider'); COMMON.enable('#txtSearch', '#txtSlider');
} }
else if(contentType == COMMON.ContentTypeKeys.Type_NoFile){ else if(CONTENTVIEW_GENERAL.contentType == COMMON.ContentTypeKeys.Type_NoFile){
COMMON.enable('#txtSlider'); COMMON.enable('#txtSlider');
} }
} }
if (avwUserEnvObj.os != "ipad" && avwUserEnvObj.os != "android") { if (CONTENTVIEW_GENERAL.avwUserEnvObj.os != "ipad" && CONTENTVIEW_GENERAL.avwUserEnvObj.os != "android") {
$('#button_next_canvas').css('display', 'block'); $('#button_next_canvas').css('display', 'block');
$('#button_pre_canvas').css('display', 'block'); $('#button_pre_canvas').css('display', 'block');
} }
...@@ -397,26 +397,26 @@ function enableAllControl() { ...@@ -397,26 +397,26 @@ function enableAllControl() {
//$("#control_screen_2").addClass('toolbar_device'); //$("#control_screen_2").addClass('toolbar_device');
$("#control_screen_2").addClass('toolbar_close_device'); $("#control_screen_2").addClass('toolbar_close_device');
var nBookmarkId = isExistBookmark(); var nBookmarkId = CONTENTVIEW.isExistBookmark();
if (nBookmarkId == -1) { if (nBookmarkId == -1) {
$('#imgbookmark').addClass('bmAdd_device'); $('#imgbookmark').addClass('bmAdd_device');
} else { } else {
$('#imgbookmark').addClass('bmAdd_hover'); $('#imgbookmark').addClass('bmAdd_hover');
} }
if (isDisplayBookMarkList == true) { if (CONTENTVIEW_GENERAL.isDisplayBookMarkList == true) {
$('#listbookmark').addClass('bmList_hover'); $('#listbookmark').addClass('bmList_hover');
} else { } else {
$('#listbookmark').addClass('bmList_device'); $('#listbookmark').addClass('bmList_device');
} }
if (isDisplayCopyText == true) { if (CONTENTVIEW_GENERAL.isDisplayCopyText == true) {
$('#copytext').addClass('copy_hover'); $('#copytext').addClass('copy_hover');
} else { } else {
$('#copytext').addClass('copy_device'); $('#copytext').addClass('copy_device');
} }
if (isDisplayListIndex == true) { if (CONTENTVIEW_GENERAL.isDisplayListIndex == true) {
$('#listindex').addClass('index_hover'); $('#listindex').addClass('index_hover');
} else { } else {
$('#listindex').addClass('index_device'); $('#listindex').addClass('index_device');
...@@ -452,26 +452,26 @@ function enableAllControl() { ...@@ -452,26 +452,26 @@ function enableAllControl() {
$("#control_screen").addClass('toolbar'); $("#control_screen").addClass('toolbar');
$("#control_screen_2").addClass('toolbar_close'); $("#control_screen_2").addClass('toolbar_close');
var nBookmarkId = isExistBookmark(); var nBookmarkId = CONTENTVIEW.isExistBookmark();
if (nBookmarkId == -1) { if (nBookmarkId == -1) {
$('#imgbookmark').addClass('bmAdd'); $('#imgbookmark').addClass('bmAdd');
} else { } else {
$('#imgbookmark').addClass('bmAdd_hover'); $('#imgbookmark').addClass('bmAdd_hover');
} }
if (isDisplayBookMarkList == true) { if (CONTENTVIEW_GENERAL.isDisplayBookMarkList == true) {
$('#listbookmark').addClass('bmList_hover'); $('#listbookmark').addClass('bmList_hover');
} else { } else {
$('#listbookmark').addClass('bmList'); $('#listbookmark').addClass('bmList');
} }
if (isDisplayCopyText == true) { if (CONTENTVIEW_GENERAL.isDisplayCopyText == true) {
$('#copytext').addClass('copy_hover'); $('#copytext').addClass('copy_hover');
} else { } else {
$('#copytext').addClass('copy'); $('#copytext').addClass('copy');
} }
if (isDisplayListIndex == true) { if (CONTENTVIEW_GENERAL.isDisplayListIndex == true) {
$('#listindex').addClass('index_hover'); $('#listindex').addClass('index_hover');
} else { } else {
$('#listindex').addClass('index'); $('#listindex').addClass('index');
...@@ -514,22 +514,22 @@ function enableAllControl() { ...@@ -514,22 +514,22 @@ function enableAllControl() {
$('#imgBack').addClass('back_off'); $('#imgBack').addClass('back_off');
} }
checkExistNextPrePage(); CONTENTVIEW.checkExistNextPrePage();
}; };
/* /*
Clear canvas Clear canvas
*/ */
function clearCanvas(targetCanvas) { CONTENTVIEW_GENERAL.clearCanvas = function(targetCanvas) {
targetCanvas.width = targetCanvas.width; targetCanvas.width = targetCanvas.width;
}; };
function encode(data) { //CONTENTVIEW_GENERAL.encode = function(data) {
var str = String.fromCharCode.apply(null, data); // var str = String.fromCharCode.apply(null, data);
return btoa(str).replace(/.{76}(?=.)/g, '$&\n'); // return btoa(str).replace(/.{76}(?=.)/g, '$&\n');
}; //};
function showDialog(modal) { CONTENTVIEW_GENERAL.showDialog = function(modal) {
$("#overlay").show(); $("#overlay").show();
$("#dialog").fadeIn(300); $("#dialog").fadeIn(300);
...@@ -538,13 +538,13 @@ function showDialog(modal) { ...@@ -538,13 +538,13 @@ function showDialog(modal) {
} }
else { else {
$("#overlay").click(function (e) { $("#overlay").click(function (e) {
hideDialog(); CONTENTVIEW_GENERAL.hideDialog();
}); });
} }
}; };
function hideDialog() { CONTENTVIEW_GENERAL.hideDialog = function() {
$("#overlay").hide(); $("#overlay").hide();
$("#dialog").fadeOut(200); $("#dialog").fadeOut(200);
$('#dialog').children().remove(); $('#dialog').children().remove();
}; };
\ No newline at end of file
//START TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content //名前空間用のオブジェクトを用意する
/* get Json stored content info */ var CONTENTVIEW_GETDATA = {};
function getJsonContentInfo() {
AVWEB.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
///* get url */
//function getURL(apiName) {
// var sysSettings = AVWEB.avwSysSetting();
// var url = sysSettings.apiResourceDlUrl;
// url = AVWEB.format(url, ClientData.userInfo_accountPath()) + '/' + apiName;
// return url;
//};
/* get url */ /* get url */
function getURLPageImage(apiName) { CONTENTVIEW_GETDATA.getURLPageImage = function(apiName) {
//var sysSettings = AVWEB.avwSysSetting(); //var sysSettings = AVWEB.avwSysSetting();
//var url = sysSettings.apiUrl; //var url = sysSettings.apiUrl;
var url = ClientData.conf_apiUrl(); var url = ClientData.conf_apiUrl();
...@@ -39,8 +11,8 @@ function getURLPageImage(apiName) { ...@@ -39,8 +11,8 @@ function getURLPageImage(apiName) {
return url; return url;
}; };
function getPageObjectsByPageIndex(contentData, nIndexPage) { CONTENTVIEW_GETDATA.getPageObjectsByPageIndex = function(contentData, nIndexPage) {
pageObjects = []; CONTENTVIEW_GENERAL.pageObjects = [];
var currentPageObjects; var currentPageObjects;
for (var nIndex = 0; nIndex < contentData.length; nIndex++) { for (var nIndex = 0; nIndex < contentData.length; nIndex++) {
...@@ -63,53 +35,53 @@ function getPageObjectsByPageIndex(contentData, nIndexPage) { ...@@ -63,53 +35,53 @@ function getPageObjectsByPageIndex(contentData, nIndexPage) {
for (var nIndex = 0; nIndex < currentPageObjects.length; nIndex++) { for (var nIndex = 0; nIndex < currentPageObjects.length; nIndex++) {
/*get object page*/ /*get object page*/
if (currentPageObjects[nIndex].mediaType == 1) {/*media type = 1 */ if (currentPageObjects[nIndex].mediaType == 1) {/*media type = 1 */
var pageObject = getMediaType1(currentPageObjects[nIndex]); var pageObject = CONTENTVIEW_GETDATA.getMediaType1(currentPageObjects[nIndex]);
/*add object to page */ /*add object to page */
pageObjects.push(pageObject); CONTENTVIEW_GENERAL.pageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 2) { /*mediaType = 2 */ } else if (currentPageObjects[nIndex].mediaType == 2) { /*mediaType = 2 */
var pageObject = getMediaType2(currentPageObjects[nIndex]); var pageObject = CONTENTVIEW_GETDATA.getMediaType2(currentPageObjects[nIndex]);
/*add object to page */ /*add object to page */
pageObjects.push(pageObject); CONTENTVIEW_GENERAL.pageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 3) { /*mediaType = 3*/ } else if (currentPageObjects[nIndex].mediaType == 3) { /*mediaType = 3*/
var pageObject = getMediaType3(currentPageObjects[nIndex]); var pageObject = CONTENTVIEW_GETDATA.getMediaType3(currentPageObjects[nIndex]);
/*add object to page */ /*add object to page */
pageObjects.push(pageObject); CONTENTVIEW_GENERAL.pageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 4) { /*mediaType = 4*/ } else if (currentPageObjects[nIndex].mediaType == 4) { /*mediaType = 4*/
var pageObject = getMediaType4(currentPageObjects[nIndex]); var pageObject = CONTENTVIEW_GETDATA.getMediaType4(currentPageObjects[nIndex]);
/*add object to page */ /*add object to page */
pageObjects.push(pageObject); CONTENTVIEW_GENERAL.pageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 5) { /*mediaType = 5*/ } else if (currentPageObjects[nIndex].mediaType == 5) { /*mediaType = 5*/
var pageObject = getMediaType5(currentPageObjects[nIndex]); var pageObject = CONTENTVIEW_GETDATA.getMediaType5(currentPageObjects[nIndex]);
/*add object to page */ /*add object to page */
pageObjects.push(pageObject); CONTENTVIEW_GENERAL.pageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 6) { /*mediaType = 6*/ } else if (currentPageObjects[nIndex].mediaType == 6) { /*mediaType = 6*/
var pageObject = getMediaType6(currentPageObjects[nIndex]); var pageObject = CONTENTVIEW_GETDATA.getMediaType6(currentPageObjects[nIndex]);
/*add object to page */ /*add object to page */
pageObjects.push(pageObject); CONTENTVIEW_GENERAL.pageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 7) { /*mediaType = 7*/ } else if (currentPageObjects[nIndex].mediaType == 7) { /*mediaType = 7*/
var pageObject = getMediaType7(currentPageObjects[nIndex]); var pageObject = CONTENTVIEW_GETDATA.getMediaType7(currentPageObjects[nIndex]);
/*add object to page */ /*add object to page */
pageObjects.push(pageObject); CONTENTVIEW_GENERAL.pageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 8) { /*mediaType = 8*/ } else if (currentPageObjects[nIndex].mediaType == 8) { /*mediaType = 8*/
var pageObject = getMediaType8(currentPageObjects[nIndex]); var pageObject = CONTENTVIEW_GETDATA.getMediaType8(currentPageObjects[nIndex]);
/*add object to page */ /*add object to page */
pageObjects.push(pageObject); CONTENTVIEW_GENERAL.pageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 9) { /*mediaType = 9*/ } else if (currentPageObjects[nIndex].mediaType == 9) { /*mediaType = 9*/
var pageObject = getMediaType9(currentPageObjects[nIndex]); var pageObject = CONTENTVIEW_GETDATA.getMediaType9(currentPageObjects[nIndex]);
/*add object to page */ /*add object to page */
pageObjects.push(pageObject); CONTENTVIEW_GENERAL.pageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 11) { /*mediaType = 11*/ } else if (currentPageObjects[nIndex].mediaType == 11) { /*mediaType = 11*/
var pageObject = getMediaType11(currentPageObjects[nIndex]); var pageObject = CONTENTVIEW_GETDATA.getMediaType11(currentPageObjects[nIndex]);
/*add object to page */ /*add object to page */
pageObjects.push(pageObject); CONTENTVIEW_GENERAL.pageObjects.push(pageObject);
} }
} }
} }
}; };
/*get data mediaType = 1 */ /*get data mediaType = 1 */
function getMediaType1(iValueObj) { CONTENTVIEW_GETDATA.getMediaType1 = function(iValueObj) {
/* /*
* Action Type = 1 : video * Action Type = 1 : video
* Action Type = 2 : music * Action Type = 2 : music
...@@ -183,7 +155,7 @@ function getMediaType1(iValueObj) { ...@@ -183,7 +155,7 @@ function getMediaType1(iValueObj) {
/*get video file */ /*get video file */
if (iValueObj.action.music) { if (iValueObj.action.music) {
if (avwUserEnvObj.browser == 'msie') { if (CONTENTVIEW_GENERAL.avwUserEnvObj.browser == 'msie') {
pageObject['audioFile'] = AVWEB.getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceName=" + COMMON.removeExt(iValueObj.action.music) + "&isIE=true"; pageObject['audioFile'] = AVWEB.getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceName=" + COMMON.removeExt(iValueObj.action.music) + "&isIE=true";
} else { } else {
pageObject['audioFile'] = AVWEB.getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceName=" + COMMON.removeExt(iValueObj.action.music); pageObject['audioFile'] = AVWEB.getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceName=" + COMMON.removeExt(iValueObj.action.music);
...@@ -366,7 +338,7 @@ function getMediaType1(iValueObj) { ...@@ -366,7 +338,7 @@ function getMediaType1(iValueObj) {
return pageObject; return pageObject;
}; };
function getMediaType2(iValueObj) { CONTENTVIEW_GETDATA.getMediaType2 = function(iValueObj) {
var pageObject = []; var pageObject = [];
pageObject['mediaType'] = iValueObj.mediaType; pageObject['mediaType'] = iValueObj.mediaType;
...@@ -415,7 +387,7 @@ function getMediaType2(iValueObj) { ...@@ -415,7 +387,7 @@ function getMediaType2(iValueObj) {
return pageObject; return pageObject;
}; };
function getMediaType3(iValueObj) { CONTENTVIEW_GETDATA.getMediaType3 = function(iValueObj) {
var pageObject = []; var pageObject = [];
pageObject['mediaType'] = iValueObj.mediaType; pageObject['mediaType'] = iValueObj.mediaType;
...@@ -431,7 +403,7 @@ function getMediaType3(iValueObj) { ...@@ -431,7 +403,7 @@ function getMediaType3(iValueObj) {
/*get mediaInfo */ /*get mediaInfo */
if (iValueObj.mediaInfo.resourceId) { if (iValueObj.mediaInfo.resourceId) {
if (avwUserEnvObj.browser == 'msie') { if (CONTENTVIEW_GENERAL.avwUserEnvObj.browser == 'msie') {
pageObject['audioFile'] = AVWEB.getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + iValueObj.mediaInfo.resourceId + "&isIE=true"; pageObject['audioFile'] = AVWEB.getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + iValueObj.mediaInfo.resourceId + "&isIE=true";
} else { } else {
pageObject['audioFile'] = AVWEB.getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + iValueObj.mediaInfo.resourceId; pageObject['audioFile'] = AVWEB.getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
...@@ -464,7 +436,7 @@ function getMediaType3(iValueObj) { ...@@ -464,7 +436,7 @@ function getMediaType3(iValueObj) {
return pageObject; return pageObject;
}; };
function getMediaType4(iValueObj) { CONTENTVIEW_GETDATA.getMediaType4 = function(iValueObj) {
var pageObject = []; var pageObject = [];
pageObject['mediaType'] = iValueObj.mediaType; pageObject['mediaType'] = iValueObj.mediaType;
...@@ -512,7 +484,7 @@ function getMediaType4(iValueObj) { ...@@ -512,7 +484,7 @@ function getMediaType4(iValueObj) {
return pageObject; return pageObject;
}; };
function getMediaType5(iValueObj) { CONTENTVIEW_GETDATA.getMediaType5 = function(iValueObj) {
var pageObject = []; var pageObject = [];
pageObject['mediaType'] = iValueObj.mediaType; pageObject['mediaType'] = iValueObj.mediaType;
...@@ -548,7 +520,7 @@ function getMediaType5(iValueObj) { ...@@ -548,7 +520,7 @@ function getMediaType5(iValueObj) {
return pageObject; return pageObject;
}; };
function getMediaType6(iValueObj) { CONTENTVIEW_GETDATA.getMediaType6 = function(iValueObj) {
var pageObject = []; var pageObject = [];
pageObject['mediaType'] = iValueObj.mediaType; pageObject['mediaType'] = iValueObj.mediaType;
...@@ -617,7 +589,7 @@ function getMediaType6(iValueObj) { ...@@ -617,7 +589,7 @@ function getMediaType6(iValueObj) {
return pageObject; return pageObject;
}; };
function getMediaType7(iValueObj) { CONTENTVIEW_GETDATA.getMediaType7 = function(iValueObj) {
var pageObject = []; var pageObject = [];
pageObject['mediaType'] = iValueObj.mediaType; pageObject['mediaType'] = iValueObj.mediaType;
...@@ -660,7 +632,7 @@ function getMediaType7(iValueObj) { ...@@ -660,7 +632,7 @@ function getMediaType7(iValueObj) {
}; };
//Start Function : No.9 - Editor : Long - Date : 08/15/2013 - Summary : Handle 3d object //Start Function : No.9 - Editor : Long - Date : 08/15/2013 - Summary : Handle 3d object
function getMediaType8(iValueObj) { CONTENTVIEW_GETDATA.getMediaType8 = function(iValueObj) {
var pageObject = []; var pageObject = [];
//Get object Info //Get object Info
...@@ -698,9 +670,9 @@ function getMediaType8(iValueObj) { ...@@ -698,9 +670,9 @@ function getMediaType8(iValueObj) {
horizonCnt = 1; horizonCnt = 1;
} }
_3dViewObject[convNumTo2Char(verticalCnt)+"-"+convNumTo2Char(horizonCnt)] = _3dViewObject[CONTENTVIEW_GETDATA.convNumTo2Char(verticalCnt)+"-"+CONTENTVIEW_GETDATA.convNumTo2Char(horizonCnt)] =
AVWEB.getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() AVWEB.getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid()
+ "&resourceId=" + data3d[convNumTo2Char(verticalCnt) +"-"+ convNumTo2Char(horizonCnt)].resourceId; + "&resourceId=" + data3d[CONTENTVIEW_GETDATA.convNumTo2Char(verticalCnt) +"-"+ CONTENTVIEW_GETDATA.convNumTo2Char(horizonCnt)].resourceId;
} }
pageObject['3dview'] = _3dViewObject; pageObject['3dview'] = _3dViewObject;
...@@ -716,7 +688,7 @@ function getMediaType8(iValueObj) { ...@@ -716,7 +688,7 @@ function getMediaType8(iValueObj) {
return pageObject; return pageObject;
}; };
function getMediaType9(iValueObj) { CONTENTVIEW_GETDATA.getMediaType9 = function(iValueObj) {
var pageObject = []; var pageObject = [];
//Get object Info //Get object Info
...@@ -767,7 +739,7 @@ function getMediaType9(iValueObj) { ...@@ -767,7 +739,7 @@ function getMediaType9(iValueObj) {
return pageObject; return pageObject;
}; };
function getMediaType11(iValueObj) { CONTENTVIEW_GETDATA.getMediaType11 = function(iValueObj) {
var pageObject = []; var pageObject = [];
//Get object Info //Get object Info
...@@ -806,7 +778,7 @@ function getMediaType11(iValueObj) { ...@@ -806,7 +778,7 @@ function getMediaType11(iValueObj) {
return pageObject; return pageObject;
}; };
function convNumTo2Char(num){ CONTENTVIEW_GETDATA.convNumTo2Char = function(num){
var nRet = ""; var nRet = "";
if(num < 10) if(num < 10)
nRet = "0" + num; nRet = "0" + num;
...@@ -817,13 +789,13 @@ function convNumTo2Char(num){ ...@@ -817,13 +789,13 @@ function convNumTo2Char(num){
//End Function : No.9 - Editor : Long - Date : 08/15/2013 - Summary : Handle 3d object //End Function : No.9 - Editor : Long - Date : 08/15/2013 - Summary : Handle 3d object
/* get page index */ /* get page index */
function getPageIndex() { CONTENTVIEW_GETDATA.getPageIndex = function() {
var content = getContent(); var content = CONTENTVIEW_GETDATA.getContent();
return eval(content.pageIndex); return eval(content.pageIndex);
}; };
/* get data marking from local storage */ /* get data marking from local storage */
function getDataClientStorage() { CONTENTVIEW_GETDATA.getDataClientStorage = function() {
/*set default size and color */ /*set default size and color */
if (!ClientData.penOpt_size()) { if (!ClientData.penOpt_size()) {
ClientData.penOpt_size(5); ClientData.penOpt_size(5);
...@@ -845,24 +817,24 @@ function getDataClientStorage() { ...@@ -845,24 +817,24 @@ function getDataClientStorage() {
ClientData.erase_size(5); ClientData.erase_size(5);
} }
isAddingMarking = ClientData.IsAddingMarking(); CONTENTVIEW_GENERAL.isAddingMarking = ClientData.IsAddingMarking();
penSize = ClientData.penOpt_size(); CONTENTVIEW_GENERAL.penSize = ClientData.penOpt_size();
penColor = ClientData.penOpt_color(); CONTENTVIEW_GENERAL.penColor = ClientData.penOpt_color();
makerSize = ClientData.maker_size(); CONTENTVIEW_GENERAL.makerSize = ClientData.maker_size();
makerColor = ClientData.maker_color(); CONTENTVIEW_GENERAL.makerColor = ClientData.maker_color();
eraseSize = ClientData.erase_size(); CONTENTVIEW_GENERAL.eraseSize = ClientData.erase_size();
markingType = ClientData.MarkingType(); CONTENTVIEW_GENERAL.markingType = ClientData.MarkingType();
}; };
/* get list bookmark of content */ /* get list bookmark of content */
function getBookMarkListByContentID() { CONTENTVIEW_GETDATA.getBookMarkListByContentID = function() {
var bmList = []; var bmList = [];
var bmListResult = []; var bmListResult = [];
bmList = ClientData.BookMarkData(); bmList = ClientData.BookMarkData();
for (var nIndex = 0; nIndex < bmList.length; nIndex++) { for (var nIndex = 0; nIndex < bmList.length; nIndex++) {
if (bmList[nIndex].contentid == contentID) { if (bmList[nIndex].contentid == CONTENTVIEW_GENERAL.contentID) {
bmListResult.push(bmList[nIndex]); bmListResult.push(bmList[nIndex]);
} }
} }
...@@ -871,13 +843,13 @@ function getBookMarkListByContentID() { ...@@ -871,13 +843,13 @@ function getBookMarkListByContentID() {
}; };
/* get data load*/ /* get data load*/
function getDataLoaded(data) { CONTENTVIEW_GETDATA.getDataLoaded = function(data) {
var isExist = false; var isExist = false;
for (var i = 0; i < data.length; i++) { for (var i = 0; i < data.length; i++) {
isExist = false; isExist = false;
for (var n = 0; n < arrThumbnailsLoaded.length; n++) { for (var n = 0; n < CONTENTVIEW_GENERAL.arrThumbnailsLoaded.length; n++) {
if (data[i].pageNo == arrThumbnailsLoaded[n].pageNo) { if (data[i].pageNo == CONTENTVIEW_GENERAL.arrThumbnailsLoaded[n].pageNo) {
isExist = true; isExist = true;
break; break;
} }
...@@ -885,12 +857,12 @@ function getDataLoaded(data) { ...@@ -885,12 +857,12 @@ function getDataLoaded(data) {
/* insert if not exist */ /* insert if not exist */
if (isExist == false) { if (isExist == false) {
arrThumbnailsLoaded.push(data[i]); CONTENTVIEW_GENERAL.arrThumbnailsLoaded.push(data[i]);
} }
} }
/* sort data */ /* sort data */
arrThumbnailsLoaded.sort(function (a, b) { CONTENTVIEW_GENERAL.arrThumbnailsLoaded.sort(function (a, b) {
var a1 = a.pageNo, b1 = b.pageNo; var a1 = a.pageNo, b1 = b.pageNo;
if (a1 == b1) return 0; if (a1 == b1) return 0;
return a1 > b1 ? 1 : -1; return a1 > b1 ? 1 : -1;
...@@ -900,14 +872,14 @@ function getDataLoaded(data) { ...@@ -900,14 +872,14 @@ function getDataLoaded(data) {
/* get list info bookmark */ /* get list info bookmark */
function getBookmarklist(pos) { CONTENTVIEW_GETDATA.getBookmarklist = function(pos) {
var isExistBookMarkInContent = false; var isExistBookMarkInContent = false;
sortBookmarkList(); CONTENTVIEW.sortBookmarkList();
var bmList = []; var bmList = [];
bmList = ClientData.BookMarkData(); bmList = ClientData.BookMarkData();
for (var nIndex = 0; nIndex < bmList.length; nIndex++) { for (var nIndex = 0; nIndex < bmList.length; nIndex++) {
if (bmList[nIndex].contentid == contentID) { if (bmList[nIndex].contentid == CONTENTVIEW_GENERAL.contentID) {
isExistBookMarkInContent = true; isExistBookMarkInContent = true;
break; break;
} }
...@@ -920,7 +892,7 @@ function getBookmarklist(pos) { ...@@ -920,7 +892,7 @@ function getBookmarklist(pos) {
//title start //title start
$('#bookmarkBoxHdBM').children().remove(); $('#bookmarkBoxHdBM').children().remove();
$('#bookmarkBoxHdBM').html('<a id="bookmarkClosing" class="delete" > </a>'); $('#bookmarkBoxHdBM').html('<a id="bookmarkClosing" class="delete" > </a>');
$("#bookmarkClosing").click(closeBookmarkBox); $("#bookmarkClosing").click(CONTENTVIEW_EVENTS.closeBookmarkBox);
$('#bookmarkBoxHdBM').append(I18N.i18nText('txtShioriCtnLs')); $('#bookmarkBoxHdBM').append(I18N.i18nText('txtShioriCtnLs'));
//title end //title end
//COMMON.lockLayout(); //COMMON.lockLayout();
...@@ -932,20 +904,20 @@ function getBookmarklist(pos) { ...@@ -932,20 +904,20 @@ function getBookmarklist(pos) {
$("#divListBookmark").offset({ left: pos[0], top: (pos[1] + $('#bookmarkBoxHdBM').height()) }); $("#divListBookmark").offset({ left: pos[0], top: (pos[1] + $('#bookmarkBoxHdBM').height()) });
} }
else { else {
handleAPIWebContentPage(dataWebContentPage, pos) CONTENTVIEW.handleAPIWebContentPage(CONTENTVIEW_GENERAL.dataWebContentPage, pos)
} }
}; };
/* get list info bookmark */ /* get list info bookmark */
function getPageIndexJson(pos) { CONTENTVIEW_GETDATA.getPageIndexJson = function(pos) {
if (dataJsonType5.length > 0) { if (CONTENTVIEW_GENERAL.dataJsonType5.length > 0) {
$('#divListIndex').children().remove(); $('#divListIndex').children().remove();
// $("#divListIndex").dialog({ // $("#divListIndex").dialog({
// show: "blind", // show: "blind",
// modal: true, // modal: true,
// width: WIDTH_DIALOG_INDEX, // width: CONTENTVIEW_GENERAL.WIDTH_DIALOG_INDEX,
// height:HEIGHT_DIALOG_INDEX, // height:CONTENTVIEW_GENERAL.HEIGHT_DIALOG_INDEX,
// resizable:false, // resizable:false,
// closeOnEscape: false, // closeOnEscape: false,
// title: I18N.i18nText('txtIndex'), // title: I18N.i18nText('txtIndex'),
...@@ -954,7 +926,7 @@ function getPageIndexJson(pos) { ...@@ -954,7 +926,7 @@ function getPageIndexJson(pos) {
//title start //title start
$('#indexBoxHdIndex').children().remove(); $('#indexBoxHdIndex').children().remove();
$('#indexBoxHdIndex').html('<a id="indexClosing" class="delete" > </a>'); $('#indexBoxHdIndex').html('<a id="indexClosing" class="delete" > </a>');
$("#indexClosing").click(closeIndexBox); $("#indexClosing").click(CONTENTVIEW_EVENTS.closeIndexBox);
$('#indexBoxHdIndex').append(I18N.i18nText('txtIndex')); $('#indexBoxHdIndex').append(I18N.i18nText('txtIndex'));
//title end //title end
//COMMON.lockLayout(); //COMMON.lockLayout();
...@@ -966,7 +938,7 @@ function getPageIndexJson(pos) { ...@@ -966,7 +938,7 @@ function getPageIndexJson(pos) {
$("#divListIndex").offset({ left: pos[0], top: (pos[1] + $('#indexBoxHdIndex').height()) }); $("#divListIndex").offset({ left: pos[0], top: (pos[1] + $('#indexBoxHdIndex').height()) });
//set data for dialog index //set data for dialog index
var dataContent = dataJsonType5; var dataContent = CONTENTVIEW_GENERAL.dataJsonType5;
var arrData = new Array(); var arrData = new Array();
$.each(dataContent, function (i, value) { $.each(dataContent, function (i, value) {
if (dataContent[i].level == 0) { if (dataContent[i].level == 0) {
...@@ -990,7 +962,7 @@ function getPageIndexJson(pos) { ...@@ -990,7 +962,7 @@ function getPageIndexJson(pos) {
var tree = new TreeViewIndex(); var tree = new TreeViewIndex();
tree.IsShowTotal = false; tree.IsShowTotal = false;
tree.Show("divListIndex", arrData, "listIndex_Callback"); tree.Show("divListIndex", arrData, "CONTENTVIEW_EVENTS.listIndex_Callback");
$("#divListIndex").treeview(); $("#divListIndex").treeview();
$(".treeview, .treeview ul").css('padding', '0px 8px 0'); $(".treeview, .treeview ul").css('padding', '0px 8px 0');
} else { } else {
...@@ -1002,15 +974,15 @@ function getPageIndexJson(pos) { ...@@ -1002,15 +974,15 @@ function getPageIndexJson(pos) {
// show: "blind", // show: "blind",
// modal: true, // modal: true,
// resizable:false, // resizable:false,
// width: WIDTH_DIALOG_INDEX, // width: CONTENTVIEW_GENERAL.WIDTH_DIALOG_INDEX,
// height:HEIGHT_DIALOG_INDEX_NO_INDEX, // height:CONTENTVIEW_GENERAL.HEIGHT_DIALOG_INDEX_NO_INDEX,
// title: I18N.i18nText('txtIndex'), // title: I18N.i18nText('txtIndex'),
// position: pos}); // position: pos});
//title start //title start
$('#indexBoxHdIndex').children().remove(); $('#indexBoxHdIndex').children().remove();
$('#indexBoxHdIndex').html('<a id="indexClosing" class="delete" > </a>'); $('#indexBoxHdIndex').html('<a id="indexClosing" class="delete" > </a>');
$("#indexClosing").click(closeIndexBox); $("#indexClosing").click(CONTENTVIEW_EVENTS.closeIndexBox);
$('#indexBoxHdIndex').append(I18N.i18nText('txtIndex')); $('#indexBoxHdIndex').append(I18N.i18nText('txtIndex'));
//title end //title end
//COMMON.lockLayout(); //COMMON.lockLayout();
...@@ -1024,16 +996,16 @@ function getPageIndexJson(pos) { ...@@ -1024,16 +996,16 @@ function getPageIndexJson(pos) {
} }
}; };
function getText() { CONTENTVIEW_GETDATA.getText = function() {
/* init var page text */ /* init var page text */
var data = dataWebContentPage.pages; var data = CONTENTVIEW_GENERAL.dataWebContentPage.pages;
var sPageText = ''; var sPageText = '';
var w = $("#wrapper").width() / 2 - $('#boxCopyText').width() / 2; var w = $("#wrapper").width() / 2 - $('#boxCopyText').width() / 2;
var h = $("#wrapper").height() / 2 - $('#boxCopyText').height() / 2; var h = $("#wrapper").height() / 2 - $('#boxCopyText').height() / 2;
for (var nIndex = 0; nIndex < data.length; nIndex++) { for (var nIndex = 0; nIndex < data.length; nIndex++) {
/* get text of current page */ /* get text of current page */
if (data[nIndex].pageNo == changePageIndex(getPageIndex())) { if (data[nIndex].pageNo == CONTENTVIEW.changePageIndex(CONTENTVIEW_GETDATA.getPageIndex())) {
sPageText = COMMON.htmlEncode(data[nIndex].pageText); sPageText = COMMON.htmlEncode(data[nIndex].pageText);
break; break;
} }
...@@ -1052,37 +1024,37 @@ function getText() { ...@@ -1052,37 +1024,37 @@ function getText() {
/* get contentID */ /* get contentID */
function getContentID() { CONTENTVIEW_GETDATA.getContentID = function() {
/* init contentID */ /* init contentID */
if (ClientData.common_preContentId()) { if (ClientData.common_preContentId()) {
contentID = ClientData.common_preContentId(); CONTENTVIEW_GENERAL.contentID = ClientData.common_preContentId();
ClientData.common_preContentId(null); ClientData.common_preContentId(null);
} else if (ClientData.IsJumpBack() == true) { } else if (ClientData.IsJumpBack() == true) {
var dataJump = ClientData.JumpQueue(); var dataJump = ClientData.JumpQueue();
contentID = dataJump[dataJump.length - 1].oldContentID; CONTENTVIEW_GENERAL.contentID = dataJump[dataJump.length - 1].oldContentID;
} else { } else {
contentID = ClientData.contentInfo_contentId(); CONTENTVIEW_GENERAL.contentID = ClientData.contentInfo_contentId();
} }
}; };
//Download resource //Download resource
function getResourceByIdFromAPI(resourceId){ CONTENTVIEW_GETDATA.getResourceByIdFromAPI = function(resourceId){
return AVWEB.getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + resourceId; return AVWEB.getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + resourceId;
}; };
//Get content info type Image //Get content info type Image
function getContentInfoTypeImage(){ CONTENTVIEW_GETDATA.getContentInfoTypeImage = function(){
var resourceUrl = downloadResourceById(contentID); var resourceUrl = CONTENTVIEW.downloadResourceById(CONTENTVIEW_GENERAL.contentID);
resourceImage.onload = function(){ CONTENTVIEW_GENERAL.resourceImage.onload = function(){
widthContentImage = resourceImage.width; CONTENTVIEW_GENERAL.widthContentImage = CONTENTVIEW_GENERAL.resourceImage.width;
heightContentImage = resourceImage.height; CONTENTVIEW_GENERAL.heightContentImage = CONTENTVIEW_GENERAL.resourceImage.height;
getContent().setPageImages(1, resourceUrl).setUpPage(0); CONTENTVIEW_GETDATA.getContent().setPageImages(1, resourceUrl).setUpPage(0);
handleSliderBar(); CONTENTVIEW.handleSliderBar();
getContentDataForImageType(); CONTENTVIEW_GETDATA.getContentDataForImageType();
$('#lblSlider').text('/ ' + 1); $('#lblSlider').text('/ ' + 1);
...@@ -1091,7 +1063,7 @@ function getContentInfoTypeImage(){ ...@@ -1091,7 +1063,7 @@ function getContentInfoTypeImage(){
$(window).resize(function () { $(window).resize(function () {
if (COMMON.isTouchDevice() == true) { if (COMMON.isTouchDevice() == true) {
if (avwUserEnvObj.os == "android") { if (CONTENTVIEW_GENERAL.avwUserEnvObj.os == "android") {
var tempRatio = document.documentElement.clientWidth / window.innerWidth; var tempRatio = document.documentElement.clientWidth / window.innerWidth;
if (tempRatio <= 1) { if (tempRatio <= 1) {
// Adjust position for toolbar and footer bar // Adjust position for toolbar and footer bar
...@@ -1111,34 +1083,34 @@ function getContentInfoTypeImage(){ ...@@ -1111,34 +1083,34 @@ function getContentInfoTypeImage(){
} }
} }
resizeScreen(); CONTENTVIEW.resizeScreen();
isChangeSizeScreen = false; CONTENTVIEW_GENERAL.isChangeSizeScreen = false;
/* change position dialog */ /* change position dialog */
changePosDialog(); CONTENTVIEW.changePosDialog();
/* close dialog popuptext */ /* close dialog popuptext */
closeDialogResize(); CONTENTVIEW.closeDialogResize();
}); });
/*init Image Bookmark */ /*init Image Bookmark */
initImageBookmark(); CONTENTVIEW_INITOBJECT.initImageBookmark();
/* init image had draw */ /* init image had draw */
initDisplayMarking(); CONTENTVIEW_INITOBJECT.initDisplayMarking();
/* check status */ /* check status */
checkStatusImageMarking(); CONTENTVIEW.checkStatusImageMarking();
trackTransforms(context_main); CONTENTVIEW.trackTransforms(CONTENTVIEW_GENERAL.context_main);
if (COMMON.isTouchDevice() == true) { if (COMMON.isTouchDevice() == true) {
if (avwUserEnvObj.os == "android") { if (CONTENTVIEW_GENERAL.avwUserEnvObj.os == "android") {
standardRatio = document.documentElement.clientWidth / window.innerWidth; CONTENTVIEW_GENERAL.standardRatio = document.documentElement.clientWidth / window.innerWidth;
ZOOM_DETECTOR.startDetectZoom({ time: 500, ZOOM_DETECTOR.startDetectZoom({ time: 500,
callbackFunction: function (oldRatio, newRatio, oldW, oldH, newW, newH) { callbackFunction: function (oldRatio, newRatio, oldW, oldH, newW, newH) {
currentRatio = newRatio; CONTENTVIEW_GENERAL.currentRatio = newRatio;
} }
}); });
...@@ -1147,57 +1119,58 @@ function getContentInfoTypeImage(){ ...@@ -1147,57 +1119,58 @@ function getContentInfoTypeImage(){
$("#wrapper").css("height", window.innerHeight); $("#wrapper").css("height", window.innerHeight);
$("#footer_toolbar_1").css("top", top + "px"); $("#footer_toolbar_1").css("top", top + "px");
$("#footer_toolbar_2").css("top", top + "px"); $("#footer_toolbar_2").css("top", top + "px");
sizingScreen(); CONTENTVIEW.sizingScreen();
} }
} }
}; };
//End: TRB00019 - Editor : Long - Date : 28/08/2013 - Summary : Fix for android resize //End: TRB00019 - Editor : Long - Date : 28/08/2013 - Summary : Fix for android resize
resourceImage.src = resourceUrl; CONTENTVIEW_GENERAL.resourceImage.src = resourceUrl;
}; };
function getContentDataForImageType(){ CONTENTVIEW_GETDATA.getContentDataForImageType = function(){
var params = { var params = {
sid: ClientData.userInfo_sid(), sid: ClientData.userInfo_sid(),
contentId: contentID, contentId: CONTENTVIEW_GENERAL.contentID,
getType: '1', getType: '1',
}; };
abapi('webGetContent', params, 'GET', function (data) { CONTENTVIEW_CALLAPI.abapi('webGetContent', params, 'GET', function (data) {
imageTypeData = data.contentData; CONTENTVIEW_GENERAL.imageTypeData = data.contentData;
//Set default page No to image Type //Set default page No to image Type
imageTypeData["pageNo"] = 1; CONTENTVIEW_GENERAL.imageTypeData["pageNo"] = 1;
document.title = data.contentData.contentName + ' | ' + I18N.i18nText('sysAppTitle'); document.title = data.contentData.contentName + ' | ' + I18N.i18nText('sysAppTitle');
}); });
}; };
/* grab viewer content object */ /* grab viewer content object */
function getContent() { CONTENTVIEW_GETDATA.getContent = function() {
return content; return CONTENTVIEW.content;
}; };
/* get all memo on page */ /* get all memo on page */
function getAllMemoOfPage() { CONTENTVIEW_GETDATA.getAllMemoOfPage = function() {
if (ClientData.IsDisplayMemo() == true) { if (ClientData.IsDisplayMemo() == true) {
memoObjects = []; CONTENTVIEW_CREATEOBJECT.memoObjects = [];
/*get data memo */ /*get data memo */
var memoData = ClientData.MemoData(); var memoData = ClientData.MemoData();
for (var nIndex = 0; nIndex < memoData.length; nIndex++) { for (var nIndex = 0; nIndex < memoData.length; nIndex++) {
if (memoData[nIndex].contentid == contentID if (memoData[nIndex].contentid == CONTENTVIEW_GENERAL.contentID
&& memoData[nIndex].pageNo == changePageIndex(getPageIndex())) { && memoData[nIndex].pageNo == CONTENTVIEW.changePageIndex(CONTENTVIEW_GETDATA.getPageIndex())) {
/* create object of memo */ /* create object of memo */
var memoObject = null; var memoObject = null;
if (memoData[nIndex].posY > heightEachPage - 50) { if (memoData[nIndex].posY > CONTENTVIEW_GENERAL.heightEachPage - 50) {
memoData[nIndex].posY = heightEachPage - 50; memoData[nIndex].posY = CONTENTVIEW_GENERAL.heightEachPage - 50;
} }
if (memoData[nIndex].posX > widthEachPage - 50) { if (memoData[nIndex].posX > CONTENTVIEW_GENERAL.widthEachPage - 50) {
memoData[nIndex].posX = widthEachPage - 50; memoData[nIndex].posX = CONTENTVIEW_GENERAL.widthEachPage - 50;
} }
memoObject = new memo( memoObject = new CONTENTVIEW_CREATEOBJECT.memo(
nIndex, nIndex,
memoData[nIndex].Text, memoData[nIndex].Text,
memoData[nIndex].posX, memoData[nIndex].posX,
...@@ -1207,49 +1180,49 @@ function getAllMemoOfPage() { ...@@ -1207,49 +1180,49 @@ function getAllMemoOfPage() {
"img/memo.png" "img/memo.png"
); );
memoObjects.push(memoObject); CONTENTVIEW_CREATEOBJECT.memoObjects.push(memoObject);
} }
} }
} }
}; };
function getPosVideo(px, py, width, height, scale) { CONTENTVIEW_GETDATA.getPosVideo = function(px, py, width, height, scale) {
pxVideo = px; CONTENTVIEW_GENERAL.pxVideo = px;
pyVideo = py; CONTENTVIEW_GENERAL.pyVideo = py;
wVideo = width; CONTENTVIEW_GENERAL.wVideo = width;
hVideo = height; CONTENTVIEW_GENERAL.hVideo = height;
videoScale = scale; CONTENTVIEW_GENERAL.videoScale = scale;
}; };
//Start Function: No.4 - Editor : Long - Summary : Render Next Page Content //Start Function: No.4 - Editor : Long - Summary : Render Next Page Content
//Render next Page Content //Render next Page Content
function renderNextPage(){ CONTENTVIEW_GETDATA.renderNextPage = function(){
//Get next page Number //Get next page Number
var pageNo = parseInt(changePageIndex(getPageIndex())) + 1; var pageNo = parseInt(CONTENTVIEW.changePageIndex(CONTENTVIEW_GETDATA.getPageIndex())) + 1;
//Get next page background image //Get next page background image
if(contentType == COMMON.ContentTypeKeys.Type_PDF){ if(CONTENTVIEW_GENERAL.contentType == COMMON.ContentTypeKeys.Type_PDF){
AVWEB.avwGrabContentPageImage(ClientData.userInfo_accountPath(), AVWEB.avwGrabContentPageImage(ClientData.userInfo_accountPath(),
{ contentId: contentID, sid: ClientData.userInfo_sid(), pageNo: pageNo }, { contentId: CONTENTVIEW_GENERAL.contentID, sid: ClientData.userInfo_sid(), pageNo: pageNo },
function (data) { function (data) {
nextPageImage = data; CONTENTVIEW_GENERAL.nextPageImage = data;
nextContent.setPageImages(totalPage, nextPageImage) CONTENTVIEW_GENERAL.nextContent.setPageImages(CONTENTVIEW_GENERAL.totalPage, CONTENTVIEW_GENERAL.nextPageImage)
.setPageObjects(nextPageObjects) .setPageObjects(CONTENTVIEW_GENERAL.nextPageObjects)
.nextPage(); .nextPage();
}, },
function (xmlHttpRequest, txtStatus, errorThrown) { function (xmlHttpRequest, txtStatus, errorThrown) {
showErrorScreen(); CONTENTVIEW.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 == COMMON.ContentTypeKeys.Type_NoFile){ else if(CONTENTVIEW_GENERAL.contentType == COMMON.ContentTypeKeys.Type_NoFile){
nextPageImage = pageImages; CONTENTVIEW_GENERAL.nextPageImage = CONTENTVIEW_GENERAL.pageImages;
nextContent.setPageImages(totalPage, nextPageImage) CONTENTVIEW_GENERAL.nextContent.setPageImages(CONTENTVIEW_GENERAL.totalPage, CONTENTVIEW_GENERAL.nextPageImage)
.setPageObjects(nextPageObjects) .setPageObjects(CONTENTVIEW_GENERAL.nextPageObjects)
.nextPage(); .nextPage();
} }
//End Function : No.12 - Editor : Long - Date : 08/28/2013 - Summary : Render next page content image the same with the current one //End Function : No.12 - Editor : Long - Date : 08/28/2013 - Summary : Render next page content image the same with the current one
...@@ -1257,40 +1230,40 @@ function renderNextPage(){ ...@@ -1257,40 +1230,40 @@ function renderNextPage(){
}; };
//Render prev Page Content //Render prev Page Content
function renderPrevPage(){ CONTENTVIEW_GETDATA.renderPrevPage = function(){
//Get prev page Number //Get prev page Number
var pageNo = parseInt(changePageIndex(getPageIndex())) - 1; var pageNo = parseInt(CONTENTVIEW.changePageIndex(CONTENTVIEW_GETDATA.getPageIndex())) - 1;
//Get prev page background image //Get prev page background image
if(contentType == COMMON.ContentTypeKeys.Type_PDF){ if(CONTENTVIEW_GENERAL.contentType == COMMON.ContentTypeKeys.Type_PDF){
AVWEB.avwGrabContentPageImage(ClientData.userInfo_accountPath(), AVWEB.avwGrabContentPageImage(ClientData.userInfo_accountPath(),
{ contentId: contentID, sid: ClientData.userInfo_sid(), pageNo: pageNo }, { contentId: CONTENTVIEW_GENERAL.contentID, sid: ClientData.userInfo_sid(), pageNo: pageNo },
function (data) { function (data) {
prevPageImage = data; CONTENTVIEW_GENERAL.prevPageImage = data;
prevContent.setPageImages(totalPage, prevPageImage) CONTENTVIEW_GENERAL.prevContent.setPageImages(CONTENTVIEW_GENERAL.totalPage, CONTENTVIEW_GENERAL.prevPageImage)
.setPageObjects(prevPageObjects) .setPageObjects(CONTENTVIEW_GENERAL.prevPageObjects)
.previousPage(); .previousPage();
}, },
function (xmlHttpRequest, txtStatus, errorThrown) { function (xmlHttpRequest, txtStatus, errorThrown) {
showErrorScreen(); CONTENTVIEW.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 == COMMON.ContentTypeKeys.Type_NoFile){ else if(CONTENTVIEW_GENERAL.contentType == COMMON.ContentTypeKeys.Type_NoFile){
prevPageImage = pageImages; CONTENTVIEW_GENERAL.prevPageImage = CONTENTVIEW_GENERAL.pageImages;
prevContent.setPageImages(totalPage, prevPageImage) CONTENTVIEW_GENERAL.prevContent.setPageImages(CONTENTVIEW_GENERAL.totalPage, CONTENTVIEW_GENERAL.prevPageImage)
.setPageObjects(prevPageObjects) .setPageObjects(CONTENTVIEW_GENERAL.prevPageObjects)
.previousPage(); .previousPage();
} }
//End Function : No.12 - Editor : Long - Date : 08/28/2013 - Summary : Render next page content image the same with the current one //End Function : No.12 - Editor : Long - Date : 08/28/2013 - Summary : Render next page content image the same with the current one
}; };
//Get next page objects by page index //Get next page objects by page index
function getNextPageObjectsByPageIndex(contentData, nIndexPage) { CONTENTVIEW_GETDATA.getNextPageObjectsByPageIndex = function(contentData, nIndexPage) {
nextPageObjects = []; CONTENTVIEW_GENERAL.nextPageObjects = [];
var currentPageObjects; var currentPageObjects;
for (var nIndex = 0; nIndex < contentData.length; nIndex++) { for (var nIndex = 0; nIndex < contentData.length; nIndex++) {
...@@ -1314,45 +1287,45 @@ function getNextPageObjectsByPageIndex(contentData, nIndexPage) { ...@@ -1314,45 +1287,45 @@ function getNextPageObjectsByPageIndex(contentData, nIndexPage) {
for (var nIndex = 0; nIndex < currentPageObjects.length; nIndex++) { for (var nIndex = 0; nIndex < currentPageObjects.length; nIndex++) {
/*get object page*/ /*get object page*/
if (currentPageObjects[nIndex].mediaType == 1) {/*media type = 1 */ if (currentPageObjects[nIndex].mediaType == 1) {/*media type = 1 */
var pageObject = getMediaType1(currentPageObjects[nIndex]); var pageObject = CONTENTVIEW_GETDATA.getMediaType1(currentPageObjects[nIndex]);
/*add object to page */ /*add object to page */
nextPageObjects.push(pageObject); CONTENTVIEW_GENERAL.nextPageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 2) { /*mediaType = 2 */ } else if (currentPageObjects[nIndex].mediaType == 2) { /*mediaType = 2 */
var pageObject = getMediaType2(currentPageObjects[nIndex]); var pageObject = CONTENTVIEW_GETDATA.getMediaType2(currentPageObjects[nIndex]);
/*add object to page */ /*add object to page */
nextPageObjects.push(pageObject); CONTENTVIEW_GENERAL.nextPageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 3) { /*mediaType = 3*/ } else if (currentPageObjects[nIndex].mediaType == 3) { /*mediaType = 3*/
var pageObject = getMediaType3(currentPageObjects[nIndex]); var pageObject = CONTENTVIEW_GETDATA.getMediaType3(currentPageObjects[nIndex]);
/*add object to page */ /*add object to page */
nextPageObjects.push(pageObject); CONTENTVIEW_GENERAL.nextPageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 4) { /*mediaType = 4*/ } else if (currentPageObjects[nIndex].mediaType == 4) { /*mediaType = 4*/
var pageObject = getMediaType4(currentPageObjects[nIndex]); var pageObject = CONTENTVIEW_GETDATA.getMediaType4(currentPageObjects[nIndex]);
/*add object to page */ /*add object to page */
nextPageObjects.push(pageObject); CONTENTVIEW_GENERAL.nextPageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 5) { /*mediaType = 5*/ } else if (currentPageObjects[nIndex].mediaType == 5) { /*mediaType = 5*/
var pageObject = getMediaType5(currentPageObjects[nIndex]); var pageObject = CONTENTVIEW_GETDATA.getMediaType5(currentPageObjects[nIndex]);
/*add object to page */ /*add object to page */
nextPageObjects.push(pageObject); CONTENTVIEW_GENERAL.nextPageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 6) { /*mediaType = 6*/ } else if (currentPageObjects[nIndex].mediaType == 6) { /*mediaType = 6*/
var pageObject = getMediaType6(currentPageObjects[nIndex]); var pageObject = CONTENTVIEW_GETDATA.getMediaType6(currentPageObjects[nIndex]);
/*add object to page */ /*add object to page */
nextPageObjects.push(pageObject); CONTENTVIEW_GENERAL.nextPageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 7) { /*mediaType = 7*/ } else if (currentPageObjects[nIndex].mediaType == 7) { /*mediaType = 7*/
var pageObject = getMediaType7(currentPageObjects[nIndex]); var pageObject = CONTENTVIEW_GETDATA.getMediaType7(currentPageObjects[nIndex]);
/*add object to page */ /*add object to page */
nextPageObjects.push(pageObject); CONTENTVIEW_GENERAL.nextPageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 8) { /*mediaType = 8*/ } else if (currentPageObjects[nIndex].mediaType == 8) { /*mediaType = 8*/
var pageObject = getMediaType8(currentPageObjects[nIndex]); var pageObject = CONTENTVIEW_GETDATA.getMediaType8(currentPageObjects[nIndex]);
/*add object to page */ /*add object to page */
nextPageObjects.push(pageObject); CONTENTVIEW_GENERAL.nextPageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 9) { /*mediaType = 9*/ } else if (currentPageObjects[nIndex].mediaType == 9) { /*mediaType = 9*/
var pageObject = getMediaType9(currentPageObjects[nIndex]); var pageObject = CONTENTVIEW_GETDATA.getMediaType9(currentPageObjects[nIndex]);
/*add object to page */ /*add object to page */
nextPageObjects.push(pageObject); CONTENTVIEW_GENERAL.nextPageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 11) { /*mediaType = 11*/ } else if (currentPageObjects[nIndex].mediaType == 11) { /*mediaType = 11*/
var pageObject = getMediaType11(currentPageObjects[nIndex]); var pageObject = CONTENTVIEW_GETDATA.getMediaType11(currentPageObjects[nIndex]);
/*add object to page */ /*add object to page */
nextPageObjects.push(pageObject); CONTENTVIEW_GENERAL.nextPageObjects.push(pageObject);
} }
} }
...@@ -1360,8 +1333,8 @@ function getNextPageObjectsByPageIndex(contentData, nIndexPage) { ...@@ -1360,8 +1333,8 @@ function getNextPageObjectsByPageIndex(contentData, nIndexPage) {
}; };
//Get prev page objects by page index //Get prev page objects by page index
function getPrevPageObjectsByPageIndex(contentData, nIndexPage) { CONTENTVIEW_GETDATA.getPrevPageObjectsByPageIndex = function(contentData, nIndexPage) {
prevPageObjects = []; CONTENTVIEW_GENERAL.prevPageObjects = [];
var currentPageObjects; var currentPageObjects;
for (var nIndex = 0; nIndex < contentData.length; nIndex++) { for (var nIndex = 0; nIndex < contentData.length; nIndex++) {
...@@ -1384,56 +1357,56 @@ function getPrevPageObjectsByPageIndex(contentData, nIndexPage) { ...@@ -1384,56 +1357,56 @@ function getPrevPageObjectsByPageIndex(contentData, nIndexPage) {
for (var nIndex = 0; nIndex < currentPageObjects.length; nIndex++) { for (var nIndex = 0; nIndex < currentPageObjects.length; nIndex++) {
/*get object page*/ /*get object page*/
if (currentPageObjects[nIndex].mediaType == 1) {/*media type = 1 */ if (currentPageObjects[nIndex].mediaType == 1) {/*media type = 1 */
var pageObject = getMediaType1(currentPageObjects[nIndex]); var pageObject = CONTENTVIEW_GETDATA.getMediaType1(currentPageObjects[nIndex]);
/*add object to page */ /*add object to page */
prevPageObjects.push(pageObject); CONTENTVIEW_GENERAL.prevPageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 2) { /*mediaType = 2 */ } else if (currentPageObjects[nIndex].mediaType == 2) { /*mediaType = 2 */
var pageObject = getMediaType2(currentPageObjects[nIndex]); var pageObject = CONTENTVIEW_GETDATA.getMediaType2(currentPageObjects[nIndex]);
/*add object to page */ /*add object to page */
prevPageObjects.push(pageObject); CONTENTVIEW_GENERAL.prevPageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 3) { /*mediaType = 3*/ } else if (currentPageObjects[nIndex].mediaType == 3) { /*mediaType = 3*/
var pageObject = getMediaType3(currentPageObjects[nIndex]); var pageObject = CONTENTVIEW_GETDATA.getMediaType3(currentPageObjects[nIndex]);
/*add object to page */ /*add object to page */
prevPageObjects.push(pageObject); CONTENTVIEW_GENERAL.prevPageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 4) { /*mediaType = 4*/ } else if (currentPageObjects[nIndex].mediaType == 4) { /*mediaType = 4*/
var pageObject = getMediaType4(currentPageObjects[nIndex]); var pageObject = CONTENTVIEW_GETDATA.getMediaType4(currentPageObjects[nIndex]);
/*add object to page */ /*add object to page */
prevPageObjects.push(pageObject); CONTENTVIEW_GENERAL.prevPageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 5) { /*mediaType = 5*/ } else if (currentPageObjects[nIndex].mediaType == 5) { /*mediaType = 5*/
var pageObject = getMediaType5(currentPageObjects[nIndex]); var pageObject = CONTENTVIEW_GETDATA.getMediaType5(currentPageObjects[nIndex]);
/*add object to page */ /*add object to page */
prevPageObjects.push(pageObject); CONTENTVIEW_GENERAL.prevPageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 6) { /*mediaType = 6*/ } else if (currentPageObjects[nIndex].mediaType == 6) { /*mediaType = 6*/
var pageObject = getMediaType6(currentPageObjects[nIndex]); var pageObject = CONTENTVIEW_GETDATA.getMediaType6(currentPageObjects[nIndex]);
/*add object to page */ /*add object to page */
prevPageObjects.push(pageObject); CONTENTVIEW_GENERAL.prevPageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 7) { /*mediaType = 7*/ } else if (currentPageObjects[nIndex].mediaType == 7) { /*mediaType = 7*/
var pageObject = getMediaType7(currentPageObjects[nIndex]); var pageObject = CONTENTVIEW_GETDATA.getMediaType7(currentPageObjects[nIndex]);
/*add object to page */ /*add object to page */
prevPageObjects.push(pageObject); CONTENTVIEW_GENERAL.prevPageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 8) { /*mediaType = 8*/ } else if (currentPageObjects[nIndex].mediaType == 8) { /*mediaType = 8*/
var pageObject = getMediaType8(currentPageObjects[nIndex]); var pageObject = CONTENTVIEW_GETDATA.getMediaType8(currentPageObjects[nIndex]);
/*add object to page */ /*add object to page */
prevPageObjects.push(pageObject); CONTENTVIEW_GENERAL.prevPageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 9) { /*mediaType = 9*/ } else if (currentPageObjects[nIndex].mediaType == 9) { /*mediaType = 9*/
var pageObject = getMediaType9(currentPageObjects[nIndex]); var pageObject = CONTENTVIEW_GETDATA.getMediaType9(currentPageObjects[nIndex]);
/*add object to page */ /*add object to page */
prevPageObjects.push(pageObject); CONTENTVIEW_GENERAL.prevPageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 11) { /*mediaType = 11*/ } else if (currentPageObjects[nIndex].mediaType == 11) { /*mediaType = 11*/
var pageObject = getMediaType11(currentPageObjects[nIndex]); var pageObject = CONTENTVIEW_GETDATA.getMediaType11(currentPageObjects[nIndex]);
/*add object to page */ /*add object to page */
prevPageObjects.push(pageObject); CONTENTVIEW_GENERAL.prevPageObjects.push(pageObject);
} }
} }
} }
}; };
//Switch canvas when flipping page //Switch canvas when flipping page
function switchCanvas(nav){ CONTENTVIEW_GETDATA.switchCanvas = function(nav){
// change div id // change div id
//console.log("bf widthEachPage:" + widthEachPage + " widthEachNextPage:" + widthEachNextPage + " widthEachPrevPage:" + widthEachPrevPage); //console.log("bf widthEachPage:" + CONTENTVIEW_GENERAL.widthEachPage + " widthEachNextPage:" + CONTENTVIEW_GENERAL.widthEachNextPage + " widthEachPrevPage:" + CONTENTVIEW_GENERAL.widthEachPrevPage);
//console.log("bf widthEachPageApi:" + widthEachPageApi + " widthEachNextPageApi:" + widthEachNextPageApi + " widthEachPrevPageApi:" + widthEachPrevPageApi); //console.log("bf widthEachPageApi:" + CONTENTVIEW_GENERAL.widthEachPageApi + " CONTENTVIEW_GENERAL.widthEachNextPageApi:" + CONTENTVIEW_GENERAL.widthEachNextPageApi + " widthEachPrevPageApi:" + CONTENTVIEW_GENERAL.widthEachPrevPageApi);
if(nav == 1){ if(nav == 1){
$('#mainPre').attr("id","mainPreBK"); $('#mainPre').attr("id","mainPreBK");
...@@ -1447,28 +1420,28 @@ function switchCanvas(nav){ ...@@ -1447,28 +1420,28 @@ function switchCanvas(nav){
$('#mainPreBK').attr("id","offscreenNext"); $('#mainPreBK').attr("id","offscreenNext");
//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
widthEachPrevPage = widthEachPage; CONTENTVIEW_GENERAL.widthEachPrevPage = CONTENTVIEW_GENERAL.widthEachPage;
widthEachPage = widthEachNextPage; CONTENTVIEW_GENERAL.widthEachPage = CONTENTVIEW_GENERAL.widthEachNextPage;
//#11478 //#11478
widthEachPrevPageApi = widthEachPageApi; CONTENTVIEW_GENERAL.widthEachPrevPageApi = CONTENTVIEW_GENERAL.widthEachPageApi;
widthEachPageApi = widthEachNextPageApi; CONTENTVIEW_GENERAL.widthEachPageApi = CONTENTVIEW_GENERAL.widthEachNextPageApi;
heightEachPrevPage = heightEachPage; CONTENTVIEW_GENERAL.heightEachPrevPage = CONTENTVIEW_GENERAL.heightEachPage;
heightEachPage = heightEachNextPage; CONTENTVIEW_GENERAL.heightEachPage = CONTENTVIEW_GENERAL.heightEachNextPage;
//#11478 //#11478
heightEachPrevPageApi = heightEachPageApi; CONTENTVIEW_GENERAL.heightEachPrevPageApi = CONTENTVIEW_GENERAL.heightEachPageApi;
heightEachPageApi = heightEachNextPageApi; CONTENTVIEW_GENERAL.heightEachPageApi = CONTENTVIEW_GENERAL.heightEachNextPageApi;
srcRectPrev = srcRect; CONTENTVIEW.srcRectPrev = CONTENTVIEW.srcRect;
srcRect = srcRectNext; CONTENTVIEW.srcRect = CONTENTVIEW.srcRectNext;
destRectPrev = destRect; CONTENTVIEW.destRectPrev = CONTENTVIEW.destRect;
destRect = destRectNext; CONTENTVIEW.destRect = CONTENTVIEW.destRectNext;
//#12373 //#12373
userScale = 1; CONTENTVIEW.userScale = 1;
changeScale(userScale); CONTENTVIEW.changeScale(CONTENTVIEW.userScale);
flip(); CONTENTVIEW.flip();
//#12373 //#12373
//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
} }
...@@ -1485,79 +1458,79 @@ function switchCanvas(nav){ ...@@ -1485,79 +1458,79 @@ function switchCanvas(nav){
$('#mainNextBK').attr("id","offscreenPre"); $('#mainNextBK').attr("id","offscreenPre");
//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
widthEachNextPage = widthEachPage; CONTENTVIEW_GENERAL.widthEachNextPage = CONTENTVIEW_GENERAL.widthEachPage;
widthEachPage = widthEachPrevPage; CONTENTVIEW_GENERAL.widthEachPage = CONTENTVIEW_GENERAL.widthEachPrevPage;
//#11478 //#11478
widthEachNextPageApi = widthEachPageApi; CONTENTVIEW_GENERAL.widthEachNextPageApi = CONTENTVIEW_GENERAL.widthEachPageApi;
widthEachPageApi = widthEachPrevPageApi; CONTENTVIEW_GENERAL.widthEachPageApi = CONTENTVIEW_GENERAL.widthEachPrevPageApi;
heightEachNextPage = heightEachPage; CONTENTVIEW_GENERAL.heightEachNextPage = CONTENTVIEW_GENERAL.heightEachPage;
heightEachPage = heightEachPrevPage; CONTENTVIEW_GENERAL.heightEachPage = CONTENTVIEW_GENERAL.heightEachPrevPage;
//#11478 //#11478
heightEachNextPageApi = heightEachPageApi; CONTENTVIEW_GENERAL.heightEachNextPageApi = CONTENTVIEW_GENERAL.heightEachPageApi;
heightEachPageApi = heightEachPrevPageApi; CONTENTVIEW_GENERAL.heightEachPageApi = CONTENTVIEW_GENERAL.heightEachPrevPageApi;
srcRectNext = srcRect; CONTENTVIEW.srcRectNext = CONTENTVIEW.srcRect;
srcRect = srcRectPrev; CONTENTVIEW.srcRect = CONTENTVIEW.srcRectPrev;
destRectNext = destRect; CONTENTVIEW.destRectNext = CONTENTVIEW.destRect;
destRect = destRectPrev; CONTENTVIEW.destRect = CONTENTVIEW.destRectPrev;
//#12373 //#12373
userScale = 1; CONTENTVIEW.userScale = 1;
//#12373 //#12373
changeScale(userScale); CONTENTVIEW.changeScale(CONTENTVIEW.userScale);
flip(); CONTENTVIEW.flip();
//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
} }
//console.log("af widthEachPage:" + widthEachPage + " widthEachNextPage:" + widthEachNextPage + " widthEachPrevPage:" + widthEachPrevPage); //console.log("af widthEachPage:" + CONTENTVIEW_GENERAL.widthEachPage + " widthEachNextPage:" + CONTENTVIEW_GENERAL.widthEachNextPage + " widthEachPrevPage:" + CONTENTVIEW_GENERAL.widthEachPrevPage);
//console.log("af widthEachPageApi:" + widthEachPageApi + " widthEachNextPageApi:" + widthEachNextPageApi + " widthEachPrevPageApi:" + widthEachPrevPageApi); //console.log("af widthEachPageApi:" + CONTENTVIEW_GENERAL.widthEachPageApi + " widthEachNextPageApi:" + CONTENTVIEW_GENERAL.widthEachNextPageApi + " widthEachPrevPageApi:" + CONTENTVIEW_GENERAL.widthEachPrevPageApi);
}; };
//Assign content properties //Assign content properties
function assignCurrentContentPage(nav){ CONTENTVIEW_GETDATA.assignCurrentContentPage = function(nav){
if(nav == 1){ if(nav == 1){
prevPageImage = pageImages; CONTENTVIEW_GENERAL.prevPageImage = CONTENTVIEW_GENERAL.pageImages;
pageImages = nextPageImage; CONTENTVIEW_GENERAL.pageImages = CONTENTVIEW_GENERAL.nextPageImage;
prevContent.currentPage = content.currentPage; CONTENTVIEW_GENERAL.prevContent.currentPage = CONTENTVIEW.content.currentPage;
prevContent.pageCount = content.pageCount; CONTENTVIEW_GENERAL.prevContent.pageCount = CONTENTVIEW.content.pageCount;
prevContent.pageImages = content.pageImages; CONTENTVIEW_GENERAL.prevContent.pageImages = CONTENTVIEW.content.pageImages;
prevContent.pageIndex = content.pageIndex; CONTENTVIEW_GENERAL.prevContent.pageIndex = CONTENTVIEW.content.pageIndex;
prevContent.pageObjects = content.pageObjects; CONTENTVIEW_GENERAL.prevContent.pageObjects = CONTENTVIEW.content.pageObjects;
content.currentPage = nextContent.currentPage; CONTENTVIEW.content.currentPage = CONTENTVIEW_GENERAL.nextContent.currentPage;
content.pageCount = nextContent.pageCount; CONTENTVIEW.content.pageCount = CONTENTVIEW_GENERAL.nextContent.pageCount;
content.pageImages = nextContent.pageImages; CONTENTVIEW.content.pageImages = CONTENTVIEW_GENERAL.nextContent.pageImages;
content.pageIndex = nextContent.pageIndex; CONTENTVIEW.content.pageIndex = CONTENTVIEW_GENERAL.nextContent.pageIndex;
content.pageObjects = nextContent.pageObjects; CONTENTVIEW.content.pageObjects = CONTENTVIEW_GENERAL.nextContent.pageObjects;
prevPageObjects = pageObjects; CONTENTVIEW_GENERAL.prevPageObjects = CONTENTVIEW_GENERAL.pageObjects;
pageObjects = nextPageObjects; CONTENTVIEW_GENERAL.pageObjects = CONTENTVIEW_GENERAL.nextPageObjects;
} }
else{ else{
nextPageImage = pageImages; CONTENTVIEW_GENERAL.nextPageImage = CONTENTVIEW_GENERAL.pageImages;
pageImages = prevPageImage; CONTENTVIEW_GENERAL.pageImages = CONTENTVIEW_GENERAL.prevPageImage;
nextContent.currentPage = content.currentPage; CONTENTVIEW_GENERAL.nextContent.currentPage = CONTENTVIEW.content.currentPage;
nextContent.pageCount = content.pageCount; CONTENTVIEW_GENERAL.nextContent.pageCount = CONTENTVIEW.content.pageCount;
nextContent.pageImages = content.pageImages; CONTENTVIEW_GENERAL.nextContent.pageImages = CONTENTVIEW.content.pageImages;
nextContent.pageIndex = content.pageIndex; CONTENTVIEW_GENERAL.nextContent.pageIndex = CONTENTVIEW.content.pageIndex;
nextContent.pageObjects = content.pageObjects; CONTENTVIEW_GENERAL.nextContent.pageObjects = CONTENTVIEW.content.pageObjects;
content.currentPage = prevContent.currentPage; CONTENTVIEW.content.currentPage = CONTENTVIEW_GENERAL.prevContent.currentPage;
content.pageCount = prevContent.pageCount; CONTENTVIEW.content.pageCount = CONTENTVIEW_GENERAL.prevContent.pageCount;
content.pageImages = prevContent.pageImages; CONTENTVIEW.content.pageImages = CONTENTVIEW_GENERAL.prevContent.pageImages;
content.pageIndex = prevContent.pageIndex; CONTENTVIEW.content.pageIndex = CONTENTVIEW_GENERAL.prevContent.pageIndex;
content.pageObjects = prevContent.pageObjects; CONTENTVIEW.content.pageObjects = CONTENTVIEW_GENERAL.prevContent.pageObjects;
nextPageObjects = pageObjects; CONTENTVIEW_GENERAL.nextPageObjects = CONTENTVIEW_GENERAL.pageObjects;
pageObjects = prevPageObjects; CONTENTVIEW_GENERAL.pageObjects = CONTENTVIEW_GENERAL.prevPageObjects;
} }
...@@ -1567,14 +1540,14 @@ function assignCurrentContentPage(nav){ ...@@ -1567,14 +1540,14 @@ function assignCurrentContentPage(nav){
}; };
//Correct Canvas Position //Correct Canvas Position
function correctCanvasPosition(){ CONTENTVIEW_GETDATA.correctCanvasPosition = function(){
//correct canvas position //correct canvas position
// Set default value for moving3D object to prevent other object fired when // Set default value for moving3D object to prevent other object fired when
//hold on 3d object and move next or prev page. //hold on 3d object and move next or prev page.
_3dAnimate = false; CONTENTVIEW_EVENTS._3dAnimate = false;
if(animateType == animateTypeKeys.Type_Slide){ if(CONTENTVIEW_GENERAL.animateType == CONTENTVIEW_GENERAL.animateTypeKeys.Type_Slide){
$('#canvasWrapper').css("left",'0px'); $('#canvasWrapper').css("left",'0px');
$('#main').css("left",'13px'); $('#main').css("left",'13px');
$('#mainNext').css("left", $("#canvasWrapper").width() +'px'); $('#mainNext').css("left", $("#canvasWrapper").width() +'px');
...@@ -1582,7 +1555,7 @@ function correctCanvasPosition(){ ...@@ -1582,7 +1555,7 @@ function correctCanvasPosition(){
$('#mainNext').css("display", 'none'); $('#mainNext').css("display", 'none');
$('#mainPre').css("display", 'none'); $('#mainPre').css("display", 'none');
} }
else if(animateType == animateTypeKeys.Type_FadeIn){ else if(CONTENTVIEW_GENERAL.animateType == CONTENTVIEW_GENERAL.animateTypeKeys.Type_FadeIn){
$('#mainNext').css("z-index",'0'); $('#mainNext').css("z-index",'0');
$('#mainPre').css("z-index",'0'); $('#mainPre').css("z-index",'0');
$('#mainNext').css("display", 'none'); $('#mainNext').css("display", 'none');
...@@ -1592,8 +1565,9 @@ function correctCanvasPosition(){ ...@@ -1592,8 +1565,9 @@ function correctCanvasPosition(){
}; };
//Get Page Transition configuration //Get Page Transition configuration
function getPageTransitionConfig(){ CONTENTVIEW_GETDATA.getPageTransitionConfig = function(){
animateType = ClientData.userOpt_pageTransition(); CONTENTVIEW_GENERAL.animateType = ClientData.userOpt_pageTransition();
animatePeriod = eval(ClientData.userOpt_pageTransitionPeriod()) * 1000; CONTENTVIEW_GENERAL.animatePeriod = eval(ClientData.userOpt_pageTransitionPeriod()) * 1000;
}; };
//End Function: No.4 - Editor : Long - Summary : Render Next Page Content //End Function: No.4 - Editor : Long - Summary : Render Next Page Content
/// コンテンツ閲覧画面_消しゴム書式オーバーレイ /// コンテンツ閲覧画面_消しゴム書式オーバーレイ
/// <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" />
/// =============================================================================================== /// ===============================================================================================
/// Eraser group [start] /// Eraser group [start]
/// =============================================================================================== /// ===============================================================================================
//名前空間用のオブジェクトを用意する
var CONTENTVIEW_GOMU = {};
// Show eraser // Show eraser
function ShowEraser(targetDiv) { CONTENTVIEW_GOMU.ShowEraser = function(targetDiv) {
$('#dlgGomu').show(); $('#dlgGomu').show();
$('#dlgGomu').draggable(); $('#dlgGomu').draggable();
Eraser_SetDefaultValue(); CONTENTVIEW_GOMU.Eraser_SetDefaultValue();
$('#dlgGomu').center(); $('#dlgGomu').center();
}; };
// Set default value for easer. // Set default value for easer.
function Eraser_SetDefaultValue() { CONTENTVIEW_GOMU.Eraser_SetDefaultValue = function() {
var typeValue = undefined; var typeValue = undefined;
typeValue = ClientData.erase_size(); typeValue = ClientData.erase_size();
if (typeValue == 5) { if (typeValue == 5) {
...@@ -52,10 +39,10 @@ function Eraser_SetDefaultValue() { ...@@ -52,10 +39,10 @@ function Eraser_SetDefaultValue() {
$("#dlgGomu_rdo1").attr('checked', 'checked'); $("#dlgGomu_rdo1").attr('checked', 'checked');
$("#dlgGomu_rdo1").focus(); $("#dlgGomu_rdo1").focus();
} }
dlgGomu_chooseType(typeValue); CONTENTVIEW_GOMU.dlgGomu_chooseType(typeValue);
}; };
// Choose type of eraser, and draw to canvas // Choose type of eraser, and draw to canvas
function dlgGomu_chooseType(typeValue) { CONTENTVIEW_GOMU.dlgGomu_chooseType = function(typeValue) {
var canvas = document.getElementById('dlgGomu_cvMain'); var canvas = document.getElementById('dlgGomu_cvMain');
...@@ -85,21 +72,21 @@ function dlgGomu_chooseType(typeValue) { ...@@ -85,21 +72,21 @@ function dlgGomu_chooseType(typeValue) {
} }
}; };
function dlgGomu_rdo1_click() { CONTENTVIEW_GOMU.dlgGomu_rdo1_click = function() {
dlgGomu_chooseType(5); CONTENTVIEW_GOMU.dlgGomu_chooseType(5);
}; };
function dlgGomu_rdo2_click() { CONTENTVIEW_GOMU.dlgGomu_rdo2_click = function() {
dlgGomu_chooseType(12.5); CONTENTVIEW_GOMU.dlgGomu_chooseType(12.5);
}; };
function dlgGomu_rdo3_click() { CONTENTVIEW_GOMU.dlgGomu_rdo3_click = function() {
dlgGomu_chooseType(25); CONTENTVIEW_GOMU.dlgGomu_chooseType(25);
}; };
function dlgGomu_rdo4_click() { CONTENTVIEW_GOMU.dlgGomu_rdo4_click = function() {
dlgGomu_chooseType(50); CONTENTVIEW_GOMU.dlgGomu_chooseType(50);
}; };
// Event of button OK // Event of button OK
function dlgGomu_dspOK_click() { CONTENTVIEW_GOMU.dlgGomu_dspOK_click = function() {
// Set selected value to local storage // Set selected value to local storage
var typeValue = undefined; var typeValue = undefined;
...@@ -119,7 +106,7 @@ function dlgGomu_dspOK_click() { ...@@ -119,7 +106,7 @@ function dlgGomu_dspOK_click() {
// Set value to local // Set value to local
ClientData.erase_size(typeValue); ClientData.erase_size(typeValue);
eraseSize = typeValue; CONTENTVIEW_GENERAL.eraseSize = typeValue;
// Close dialog // Close dialog
//$("#dlgGomu").dialog('close'); //$("#dlgGomu").dialog('close');
...@@ -129,9 +116,9 @@ function dlgGomu_dspOK_click() { ...@@ -129,9 +116,9 @@ function dlgGomu_dspOK_click() {
$("#dlgGomu").hide(); $("#dlgGomu").hide();
/*enable button */ /*enable button */
enableButtonMarking(); CONTENTVIEW_MARKING.enableButtonMarking();
ClientData.IsAddingMarking(true); ClientData.IsAddingMarking(true);
isAddingMarking = ClientData.IsAddingMarking(); CONTENTVIEW_GENERAL.isAddingMarking = ClientData.IsAddingMarking();
/* unlock dialog overlay */ /* unlock dialog overlay */
$("#overlay").hide(); $("#overlay").hide();
...@@ -140,15 +127,15 @@ function dlgGomu_dspOK_click() { ...@@ -140,15 +127,15 @@ function dlgGomu_dspOK_click() {
$('#dlgMarking_imgEraserOption').addClass('eraser_option_hover'); $('#dlgMarking_imgEraserOption').addClass('eraser_option_hover');
}; };
// Event of button cancel // Event of button cancel
function dlgGomu_dspCancel_click() { CONTENTVIEW_GOMU.dlgGomu_dspCancel_click = function() {
// Close dialog // Close dialog
$("#dlgGomu").hide(); $("#dlgGomu").hide();
/*enable button */ /*enable button */
enableButtonMarking(); CONTENTVIEW_MARKING.enableButtonMarking();
ClientData.IsAddingMarking(true); ClientData.IsAddingMarking(true);
isAddingMarking = ClientData.IsAddingMarking(); CONTENTVIEW_GENERAL.isAddingMarking = ClientData.IsAddingMarking();
/* unlock dialog overlay */ /* unlock dialog overlay */
$("#overlay").hide(); $("#overlay").hide();
...@@ -157,36 +144,36 @@ function dlgGomu_dspCancel_click() { ...@@ -157,36 +144,36 @@ function dlgGomu_dspCancel_click() {
$('#dlgMarking_imgEraserOption').addClass('eraser_option_hover'); $('#dlgMarking_imgEraserOption').addClass('eraser_option_hover');
}; };
function dlgGomu_rdo1_text_click(){ CONTENTVIEW_GOMU.dlgGomu_rdo1_text_click = function(){
$('#dlgGomu_rdo1').attr('checked','checked'); $('#dlgGomu_rdo1').attr('checked','checked');
$('#dlgGomu_rdo2').removeAttr('checked'); $('#dlgGomu_rdo2').removeAttr('checked');
$('#dlgGomu_rdo3').removeAttr('checked'); $('#dlgGomu_rdo3').removeAttr('checked');
$('#dlgGomu_rdo4').removeAttr('checked'); $('#dlgGomu_rdo4').removeAttr('checked');
dlgGomu_rdo1_click(); CONTENTVIEW_GOMU.dlgGomu_rdo1_click();
}; };
function dlgGomu_rdo2_text_click(){ CONTENTVIEW_GOMU.dlgGomu_rdo2_text_click = function(){
$('#dlgGomu_rdo1').removeAttr('checked'); $('#dlgGomu_rdo1').removeAttr('checked');
$('#dlgGomu_rdo2').attr('checked','checked'); $('#dlgGomu_rdo2').attr('checked','checked');
$('#dlgGomu_rdo3').removeAttr('checked'); $('#dlgGomu_rdo3').removeAttr('checked');
$('#dlgGomu_rdo4').removeAttr('checked'); $('#dlgGomu_rdo4').removeAttr('checked');
dlgGomu_rdo2_click(); CONTENTVIEW_GOMU.dlgGomu_rdo2_click();
}; };
function dlgGomu_rdo3_text_click(){ CONTENTVIEW_GOMU.dlgGomu_rdo3_text_click = function(){
$('#dlgGomu_rdo1').removeAttr('checked'); $('#dlgGomu_rdo1').removeAttr('checked');
$('#dlgGomu_rdo2').removeAttr('checked'); $('#dlgGomu_rdo2').removeAttr('checked');
$('#dlgGomu_rdo3').attr('checked','checked'); $('#dlgGomu_rdo3').attr('checked','checked');
$('#dlgGomu_rdo4').removeAttr('checked'); $('#dlgGomu_rdo4').removeAttr('checked');
dlgGomu_rdo3_click(); CONTENTVIEW_GOMU.dlgGomu_rdo3_click();
}; };
function dlgGomu_rdo4_text_click(){ CONTENTVIEW_GOMU.dlgGomu_rdo4_text_click = function(){
$('#dlgGomu_rdo1').removeAttr('checked'); $('#dlgGomu_rdo1').removeAttr('checked');
$('#dlgGomu_rdo2').removeAttr('checked'); $('#dlgGomu_rdo2').removeAttr('checked');
$('#dlgGomu_rdo3').removeAttr('checked'); $('#dlgGomu_rdo3').removeAttr('checked');
$('#dlgGomu_rdo4').attr('checked','checked'); $('#dlgGomu_rdo4').attr('checked','checked');
dlgGomu_rdo4_click(); CONTENTVIEW_GOMU.dlgGomu_rdo4_click();
}; };
/* /*
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
...@@ -202,19 +189,19 @@ Event groups [ end ] ...@@ -202,19 +189,19 @@ Event groups [ end ]
*/ */
function touchStart_BtnOk_Gomu(e){ CONTENTVIEW_GOMU.touchStart_BtnOk_Gomu = function(e){
e.preventDefault(); e.preventDefault();
$('#dlgGomu').draggable("destroy"); $('#dlgGomu').draggable("destroy");
dlgGomu_dspOK_click(); CONTENTVIEW_GOMU.dlgGomu_dspOK_click();
}; };
function touchStart_BtnCancel_Gomu(e){ CONTENTVIEW_GOMU.touchStart_BtnCancel_Gomu = function(e){
e.preventDefault(); e.preventDefault();
$('#dlgGomu').draggable("destroy"); $('#dlgGomu').draggable("destroy");
dlgGomu_dspCancel_click(); CONTENTVIEW_GOMU.dlgGomu_dspCancel_click();
}; };
// Setting dialog // Setting dialog
...@@ -223,17 +210,17 @@ $(function () { ...@@ -223,17 +210,17 @@ $(function () {
// Setup for easer [start] // Setup for easer [start]
// --------------------------------- // ---------------------------------
if(COMMON.isTouchDevice() == true){ if(COMMON.isTouchDevice() == true){
document.getElementById('dlgGomu_dspOK').addEventListener('touchstart',touchStart_BtnOk_Gomu,false); document.getElementById('dlgGomu_dspOK').addEventListener('touchstart',CONTENTVIEW_GOMU.touchStart_BtnOk_Gomu,false);
document.getElementById('dlgGomu_dspCancel').addEventListener('touchstart',touchStart_BtnCancel_Gomu,false); document.getElementById('dlgGomu_dspCancel').addEventListener('touchstart',CONTENTVIEW_GOMU.touchStart_BtnCancel_Gomu,false);
} }
$("#dlgGomu_dspOK").click(dlgGomu_dspOK_click); $("#dlgGomu_dspOK").click(CONTENTVIEW_GOMU.dlgGomu_dspOK_click);
$("#dlgGomu_dspCancel").click(dlgGomu_dspCancel_click); $("#dlgGomu_dspCancel").click(CONTENTVIEW_GOMU.dlgGomu_dspCancel_click);
$("#text_dlgGomu_rdo1").click(dlgGomu_rdo1_text_click); $("#text_dlgGomu_rdo1").click(CONTENTVIEW_GOMU.dlgGomu_rdo1_text_click);
$("#text_dlgGomu_rdo2").click(dlgGomu_rdo2_text_click); $("#text_dlgGomu_rdo2").click(CONTENTVIEW_GOMU.dlgGomu_rdo2_text_click);
$("#text_dlgGomu_rdo3").click(dlgGomu_rdo3_text_click); $("#text_dlgGomu_rdo3").click(CONTENTVIEW_GOMU.dlgGomu_rdo3_text_click);
$("#text_dlgGomu_rdo4").click(dlgGomu_rdo4_text_click); $("#text_dlgGomu_rdo4").click(CONTENTVIEW_GOMU.dlgGomu_rdo4_text_click);
}); });
......
/// <reference path="common.js" />
//名前空間用のオブジェクトを用意する
var CONTENTVIEW_IMAGEPREVIEW = {};
/*====Variable====*/ /*====Variable====*/
var slideshowImgFrom = 0; CONTENTVIEW_IMAGEPREVIEW.slideshowImgFrom = 0;
var slideshowImgTo = 4; CONTENTVIEW_IMAGEPREVIEW.slideshowImgTo = 4;
var slideshowImageCollection = []; CONTENTVIEW_IMAGEPREVIEW.slideshowImageCollection = [];
var slideshowClickFlg = false; CONTENTVIEW_IMAGEPREVIEW.slideshowClickFlg = false;
var slideshowInitFlg = true; CONTENTVIEW_IMAGEPREVIEW.slideshowInitFlg = true; //未使用
var slideshowSelectedIndex = 0; CONTENTVIEW_IMAGEPREVIEW.slideshowSelectedIndex = 0; //未使用
//0: next - 1: prev //0: next - 1: prev
var slideshowControlToggleFlg = 0; CONTENTVIEW_IMAGEPREVIEW.slideshowControlToggleFlg = 0; //未使用
var totalRecord; //CONTENTVIEW_IMAGEPREVIEW.totalRecord; //未使用
var slideshowSelectFirstIndex = 0; CONTENTVIEW_IMAGEPREVIEW.slideshowSelectFirstIndex = 0;
var slideshowSelectLastIndex = 4; CONTENTVIEW_IMAGEPREVIEW.slideshowSelectLastIndex = 4;
var slideshowMainCurrIndex = 0; CONTENTVIEW_IMAGEPREVIEW.slideshowMainCurrIndex = 0;
CONTENTVIEW_IMAGEPREVIEW.slideshow_isTransaction = false;
/*==========================================*/ /*==========================================*/
function refreshSlideShowValue(){ CONTENTVIEW_IMAGEPREVIEW.refreshSlideShowValue = function(){
slideshowImgFrom = 0; CONTENTVIEW_IMAGEPREVIEW.slideshowImgFrom = 0;
slideshowImgTo = 4; CONTENTVIEW_IMAGEPREVIEW.slideshowImgTo = 4;
slideshowImageCollection = []; CONTENTVIEW_IMAGEPREVIEW.slideshowImageCollection = [];
slideshowClickFlg = false; CONTENTVIEW_IMAGEPREVIEW.slideshowClickFlg = false;
slideshowInitFlg = true; CONTENTVIEW_IMAGEPREVIEW.slideshowInitFlg = true;
slideshowSelectedIndex = 0; CONTENTVIEW_IMAGEPREVIEW.slideshowSelectedIndex = 0;
//0: next - 1: prev //0: next - 1: prev
slideshowControlToggleFlg = 0; CONTENTVIEW_IMAGEPREVIEW.slideshowControlToggleFlg = 0;
totalRecord; //CONTENTVIEW_IMAGEPREVIEW.totalRecord;
slideshowSelectFirstIndex = 0; CONTENTVIEW_IMAGEPREVIEW.slideshowSelectFirstIndex = 0;
slideshowSelectLastIndex = 4; CONTENTVIEW_IMAGEPREVIEW.slideshowSelectLastIndex = 4;
slideshowMainCurrIndex = 0; CONTENTVIEW_IMAGEPREVIEW.slideshowMainCurrIndex = 0;
}; };
//Show Image Preview //Show Image Preview
function showImagePreview(targetId, imgList) { CONTENTVIEW_IMAGEPREVIEW.showImagePreview = function(targetId, imgList) {
refreshSlideShowValue(); CONTENTVIEW_IMAGEPREVIEW.refreshSlideShowValue();
//Check if imageList is not null //Check if imageList is not null
if (imgList != null && imgList != 'undefined' && imgList.length > 0) { if (imgList != null && imgList != 'undefined' && imgList.length > 0) {
slideshowImageCollection = setImageSource(imgList); CONTENTVIEW_IMAGEPREVIEW.slideshowImageCollection = CONTENTVIEW_IMAGEPREVIEW.setImageSource(imgList);
//Check if targetId is not null //Check if targetId is not null
if (targetId != null && targetId != 'undefined') { if (targetId != null && targetId != 'undefined') {
if (slideshowImageCollection.length == 1) { if (CONTENTVIEW_IMAGEPREVIEW.slideshowImageCollection.length == 1) {
targetId.html(''); targetId.html('');
targetId.append('<div id="slideWrapper">' targetId.append('<div id="slideWrapper">'
+ '</div>'); + '</div>');
...@@ -46,7 +50,7 @@ function showImagePreview(targetId, imgList) { ...@@ -46,7 +50,7 @@ function showImagePreview(targetId, imgList) {
var mainImg = $('#slideWrapper'); var mainImg = $('#slideWrapper');
//START FIXCSS //START FIXCSS
var cssObj = { 'background-image': 'url(' + slideshowImageCollection[0].thumbnail + ')', var cssObj = { 'background-image': 'url(' + CONTENTVIEW_IMAGEPREVIEW.slideshowImageCollection[0].thumbnail + ')',
'background-repeat': 'no-repeat', 'background-repeat': 'no-repeat',
'background-size': 'contain', 'background-size': 'contain',
'background-position': 'center' 'background-position': 'center'
...@@ -60,23 +64,23 @@ function showImagePreview(targetId, imgList) { ...@@ -60,23 +64,23 @@ function showImagePreview(targetId, imgList) {
mainImg.parent().css('padding-top', '0px'); mainImg.parent().css('padding-top', '0px');
} else { } else {
renderSlideShowBackground(targetId); CONTENTVIEW_IMAGEPREVIEW.renderSlideShowBackground(targetId);
renderSelectImage(); CONTENTVIEW_IMAGEPREVIEW.renderSelectImage();
renderMainImage(0); CONTENTVIEW_IMAGEPREVIEW.renderMainImage(0);
handleImagePreviewEvent(); CONTENTVIEW_IMAGEPREVIEW.handleImagePreviewEvent();
} }
} }
} }
else { else {
renderSlideShowBackground(targetId); CONTENTVIEW_IMAGEPREVIEW.renderSlideShowBackground(targetId);
$('.main-control').css('visibility', 'hidden'); $('.main-control').css('visibility', 'hidden');
$('.slideshow-control').css('visibility', 'hidden'); $('.slideshow-control').css('visibility', 'hidden');
} }
optimizeSizeImagePreview(); CONTENTVIEW_IMAGEPREVIEW.optimizeSizeImagePreview();
}; };
//Set image source for slide show //Set image source for slide show
function setImageSource(source){ CONTENTVIEW_IMAGEPREVIEW.setImageSource = function(source){
var oldSource = source; var oldSource = source;
var newSource = []; var newSource = [];
...@@ -88,7 +92,7 @@ function setImageSource(source){ ...@@ -88,7 +92,7 @@ function setImageSource(source){
}; };
//render background to show image preview //render background to show image preview
function renderSlideShowBackground(targetId){ CONTENTVIEW_IMAGEPREVIEW.renderSlideShowBackground = function(targetId){
var targetDiv = targetId; var targetDiv = targetId;
targetDiv.html(''); targetDiv.html('');
targetDiv.append('<div id="slideWrapper">' targetDiv.append('<div id="slideWrapper">'
...@@ -108,12 +112,13 @@ function renderSlideShowBackground(targetId){ ...@@ -108,12 +112,13 @@ function renderSlideShowBackground(targetId){
$(window).resize(function () { $(window).resize(function () {
optimizeSizeImagePreview(); CONTENTVIEW_IMAGEPREVIEW.optimizeSizeImagePreview();
}); });
//handleImagePreviewEvent(); //CONTENTVIEW_IMAGEPREVIEW.handleImagePreviewEvent();
}; };
function optimizeSizeImagePreview() {
CONTENTVIEW_IMAGEPREVIEW.optimizeSizeImagePreview = function() {
var maxW = "798"; var maxW = "798";
var ratio = 1.566; var ratio = 1.566;
var maxH = maxW / ratio; var maxH = maxW / ratio;
...@@ -139,11 +144,11 @@ function optimizeSizeImagePreview() { ...@@ -139,11 +144,11 @@ function optimizeSizeImagePreview() {
}; };
//render select image //render select image
function renderSelectImage(){ CONTENTVIEW_IMAGEPREVIEW.renderSelectImage = function(){
var selectImg = $('#selector-img'); var selectImg = $('#selector-img');
$.each(slideshowImageCollection, function(i, image){ $.each(CONTENTVIEW_IMAGEPREVIEW.slideshowImageCollection, function(i, image){
if(slideshowImgFrom <= i && i <= slideshowImgTo){ if(CONTENTVIEW_IMAGEPREVIEW.slideshowImgFrom <= i && i <= CONTENTVIEW_IMAGEPREVIEW.slideshowImgTo){
selectImg.append('<div class="thumbnail" imageId="'+ image.index +'" style="display:block; background-image : url('+image.thumbnail+')"></div>'); selectImg.append('<div class="thumbnail" imageId="'+ image.index +'" style="display:block; background-image : url('+image.thumbnail+')"></div>');
} }
else{ else{
...@@ -153,120 +158,119 @@ function renderSelectImage(){ ...@@ -153,120 +158,119 @@ function renderSelectImage(){
}; };
//Handle Image Preview Event //Handle Image Preview Event
function handleImagePreviewEvent(){ CONTENTVIEW_IMAGEPREVIEW.handleImagePreviewEvent = function(){
$('#control-next').click(imageSelectNextFunction); $('#control-next').click(CONTENTVIEW_IMAGEPREVIEW.imageSelectNextFunction);
$('#control-prev').click(imageSelectPrevFunction); $('#control-prev').click(CONTENTVIEW_IMAGEPREVIEW.imageSelectPrevFunction);
$('#main-control-next').click(imageMainSelectNextFunction); $('#main-control-next').click(CONTENTVIEW_IMAGEPREVIEW.imageMainSelectNextFunction);
$('#main-control-prev').click(imageMainSelectPrevFunction); $('#main-control-prev').click(CONTENTVIEW_IMAGEPREVIEW.imageMainSelectPrevFunction);
$('.thumbnail').click(selectImgClickFunction); $('.thumbnail').click(CONTENTVIEW_IMAGEPREVIEW.selectImgClickFunction);
$('.thumbnail').mouseenter(selectImgMouseEnterFunction); $('.thumbnail').mouseenter(CONTENTVIEW_IMAGEPREVIEW.selectImgMouseEnterFunction);
$('.thumbnail').mouseleave(selectImgMouseLeaveFunction); $('.thumbnail').mouseleave(CONTENTVIEW_IMAGEPREVIEW.selectImgMouseLeaveFunction);
$('.main-control').css('opacity','0'); $('.main-control').css('opacity','0');
$('#main-control-next').mouseleave(mainControlNextMouseLeaveFunction); $('#main-control-next').mouseleave(CONTENTVIEW_IMAGEPREVIEW.mainControlNextMouseLeaveFunction);
$('#main-control-prev').mouseleave(mainControlPrevMouseLeaveFunction); $('#main-control-prev').mouseleave(CONTENTVIEW_IMAGEPREVIEW.mainControlPrevMouseLeaveFunction);
if (COMMON.isTouchDevice() == false) { if (COMMON.isTouchDevice() == false) {
//$('.main-control').mouseenter(mainControlMouseEnterFunction); //$('.main-control').mouseenter(CONTENTVIEW_IMAGEPREVIEW.mainControlMouseEnterFunction);
$('#main-control-next').mouseenter(mainControlNextMouseEnterFunction); $('#main-control-next').mouseenter(CONTENTVIEW_IMAGEPREVIEW.mainControlNextMouseEnterFunction);
$('#main-control-prev').mouseenter(mainControlPrevMouseEnterFunction); $('#main-control-prev').mouseenter(CONTENTVIEW_IMAGEPREVIEW.mainControlPrevMouseEnterFunction);
} }
//$('.main-control').mouseleave(mainControlMouseLeaveFunction); //$('.main-control').mouseleave(CONTENTVIEW_IMAGEPREVIEW.mainControlMouseLeaveFunction);
//$('.thumbnail:first').css('box-shadow','0px 7px 7px #555'); //$('.thumbnail:first').css('box-shadow','0px 7px 7px #555');
$('.thumbnail:first').addClass('activeThumb'); $('.thumbnail:first').addClass('activeThumb');
handleDispNextPrevButton(); CONTENTVIEW_IMAGEPREVIEW.handleDispNextPrevButton();
}; };
function mainControlNextMouseEnterFunction(){ CONTENTVIEW_IMAGEPREVIEW.mainControlNextMouseEnterFunction = function(){
$(this).css('opacity','0.5'); $(this).css('opacity','0.5');
}; };
function mainControlNextMouseLeaveFunction(){ CONTENTVIEW_IMAGEPREVIEW.mainControlNextMouseLeaveFunction = function(){
$(this).css('opacity','0'); $(this).css('opacity','0');
}; };
function mainControlPrevMouseEnterFunction(){ CONTENTVIEW_IMAGEPREVIEW.mainControlPrevMouseEnterFunction = function(){
$(this).css('opacity','0.5'); $(this).css('opacity','0.5');
}; };
function mainControlPrevMouseLeaveFunction(){ CONTENTVIEW_IMAGEPREVIEW.mainControlPrevMouseLeaveFunction = function(){
$(this).css('opacity','0'); $(this).css('opacity','0');
}; };
//Image Preview next icon function //Image Preview next icon function
function imageSelectNextFunction(){ CONTENTVIEW_IMAGEPREVIEW.imageSelectNextFunction = function(){
if(slideshowSelectLastIndex < slideshowImageCollection.length - 1){ if(CONTENTVIEW_IMAGEPREVIEW.slideshowSelectLastIndex < CONTENTVIEW_IMAGEPREVIEW.slideshowImageCollection.length - 1){
$('#selector-img div:eq('+slideshowSelectFirstIndex+')').animate({width: 'hide'}, $('#selector-img div:eq('+CONTENTVIEW_IMAGEPREVIEW.slideshowSelectFirstIndex+')').animate({width: 'hide'},
{step: function(now, fx){ {step: function(now, fx){
$('#selector-img div:eq('+slideshowSelectLastIndex+')').animate({width: 'show'}); $('#selector-img div:eq('+CONTENTVIEW_IMAGEPREVIEW.slideshowSelectLastIndex+')').animate({width: 'show'});
} }
} }
); );
slideshowSelectFirstIndex = slideshowSelectFirstIndex + 1; CONTENTVIEW_IMAGEPREVIEW.slideshowSelectFirstIndex = CONTENTVIEW_IMAGEPREVIEW.slideshowSelectFirstIndex + 1;
slideshowSelectLastIndex = slideshowSelectLastIndex + 1; CONTENTVIEW_IMAGEPREVIEW.slideshowSelectLastIndex = CONTENTVIEW_IMAGEPREVIEW.slideshowSelectLastIndex + 1;
handleDispNextPrevButton(); CONTENTVIEW_IMAGEPREVIEW.handleDispNextPrevButton();
} }
}; };
//Image preview prev icon function //Image preview prev icon function
function imageSelectPrevFunction(){ CONTENTVIEW_IMAGEPREVIEW.imageSelectPrevFunction = function(){
var fixedIndex = slideshowSelectFirstIndex - 1; var fixedIndex = CONTENTVIEW_IMAGEPREVIEW.slideshowSelectFirstIndex - 1;
if(slideshowSelectFirstIndex > 0){ if(CONTENTVIEW_IMAGEPREVIEW.slideshowSelectFirstIndex > 0){
$('#selector-img div:eq('+fixedIndex+')').animate({width: 'show'}); $('#selector-img div:eq('+fixedIndex+')').animate({width: 'show'});
$('#selector-img div:eq('+slideshowSelectLastIndex+')').animate({width:'hide'}); $('#selector-img div:eq('+CONTENTVIEW_IMAGEPREVIEW.slideshowSelectLastIndex+')').animate({width:'hide'});
slideshowSelectFirstIndex = slideshowSelectFirstIndex - 1; CONTENTVIEW_IMAGEPREVIEW.slideshowSelectFirstIndex = CONTENTVIEW_IMAGEPREVIEW.slideshowSelectFirstIndex - 1;
slideshowSelectLastIndex = slideshowSelectLastIndex - 1; CONTENTVIEW_IMAGEPREVIEW.slideshowSelectLastIndex = CONTENTVIEW_IMAGEPREVIEW.slideshowSelectLastIndex - 1;
handleDispNextPrevButton(); CONTENTVIEW_IMAGEPREVIEW.handleDispNextPrevButton();
} }
}; };
var slideshow_isTransaction = false;
//Main Image next icon function //Main Image next icon function
function imageMainSelectNextFunction() { CONTENTVIEW_IMAGEPREVIEW.imageMainSelectNextFunction = function() {
if (COMMON.isTouchDevice() == true) { if (COMMON.isTouchDevice() == true) {
$('#main-control-next').css('opacity', '0.5'); $('#main-control-next').css('opacity', '0.5');
} }
if (slideshow_isTransaction == false) { if (CONTENTVIEW_IMAGEPREVIEW.slideshow_isTransaction == false) {
slideshow_isTransaction = true; CONTENTVIEW_IMAGEPREVIEW.slideshow_isTransaction = true;
var fixedIndex = eval(slideshowMainCurrIndex) + 1; var fixedIndex = eval(CONTENTVIEW_IMAGEPREVIEW.slideshowMainCurrIndex) + 1;
if (slideshowMainCurrIndex < slideshowImageCollection.length - 1) { if (CONTENTVIEW_IMAGEPREVIEW.slideshowMainCurrIndex < CONTENTVIEW_IMAGEPREVIEW.slideshowImageCollection.length - 1) {
$('#main-img div').animate( $('#main-img div').animate(
{ "left": "-=100%" }, { "left": "-=100%" },
{ {
/*duration: "slow",*/ /*duration: "slow",*/
complete: function () { complete: function () {
$('#main-img div').hide(); $('#main-img div').hide();
renderMainImage(fixedIndex); CONTENTVIEW_IMAGEPREVIEW.renderMainImage(fixedIndex);
$('#main-img div').css('left', '+=300%'); $('#main-img div').css('left', '+=300%');
$('#main-img div').show(); $('#main-img div').show();
$('<img/>').attr('src', slideshowImageCollection[fixedIndex].thumbnail).load(function () { $('<img/>').attr('src', CONTENTVIEW_IMAGEPREVIEW.slideshowImageCollection[fixedIndex].thumbnail).load(function () {
$('#main-img div').animate({ left: '0%' }); $('#main-img div').animate({ left: '0%' });
}); });
slideshowMainCurrIndex = eval(slideshowMainCurrIndex) + 1; CONTENTVIEW_IMAGEPREVIEW.slideshowMainCurrIndex = eval(CONTENTVIEW_IMAGEPREVIEW.slideshowMainCurrIndex) + 1;
syncImageMainWithSelectImage(); CONTENTVIEW_IMAGEPREVIEW.syncImageMainWithSelectImage();
handleDispNextPrevButton(); CONTENTVIEW_IMAGEPREVIEW.handleDispNextPrevButton();
} }
} }
); );
...@@ -275,31 +279,31 @@ function imageMainSelectNextFunction() { ...@@ -275,31 +279,31 @@ function imageMainSelectNextFunction() {
}; };
//Main Image prev icon function //Main Image prev icon function
function imageMainSelectPrevFunction() { CONTENTVIEW_IMAGEPREVIEW.imageMainSelectPrevFunction = function() {
if (COMMON.isTouchDevice() == true) { if (COMMON.isTouchDevice() == true) {
$('#main-control-prev').css('opacity', '0.5'); $('#main-control-prev').css('opacity', '0.5');
} }
if (slideshow_isTransaction == false) { if (CONTENTVIEW_IMAGEPREVIEW.slideshow_isTransaction == false) {
slideshow_isTransaction = true; CONTENTVIEW_IMAGEPREVIEW.slideshow_isTransaction = true;
var fixedIndex = eval(slideshowMainCurrIndex) - 1; var fixedIndex = eval(CONTENTVIEW_IMAGEPREVIEW.slideshowMainCurrIndex) - 1;
if (slideshowMainCurrIndex > 0) { if (CONTENTVIEW_IMAGEPREVIEW.slideshowMainCurrIndex > 0) {
$('#main-img div').animate( $('#main-img div').animate(
{ "left": "+=100%" }, { "left": "+=100%" },
{ {
duration: "medium", duration: "medium",
complete: function () { complete: function () {
$('#main-img div').hide(); $('#main-img div').hide();
renderMainImage(fixedIndex); CONTENTVIEW_IMAGEPREVIEW.renderMainImage(fixedIndex);
$('#main-img div').css('left', '-=300%'); $('#main-img div').css('left', '-=300%');
$('#main-img div').show(); $('#main-img div').show();
$('<img/>').attr('src', slideshowImageCollection[fixedIndex].thumbnail).load(function () { $('<img/>').attr('src', CONTENTVIEW_IMAGEPREVIEW.slideshowImageCollection[fixedIndex].thumbnail).load(function () {
$('#main-img div').animate({ left: '0%' }); $('#main-img div').animate({ left: '0%' });
}); });
slideshowMainCurrIndex = eval(slideshowMainCurrIndex) - 1; CONTENTVIEW_IMAGEPREVIEW.slideshowMainCurrIndex = eval(CONTENTVIEW_IMAGEPREVIEW.slideshowMainCurrIndex) - 1;
syncImageMainWithSelectImage(); CONTENTVIEW_IMAGEPREVIEW.syncImageMainWithSelectImage();
handleDispNextPrevButton(); CONTENTVIEW_IMAGEPREVIEW.handleDispNextPrevButton();
} }
} }
); );
...@@ -309,89 +313,89 @@ function imageMainSelectPrevFunction() { ...@@ -309,89 +313,89 @@ function imageMainSelectPrevFunction() {
}; };
//Selector Image click function //Selector Image click function
function selectImgClickFunction() { CONTENTVIEW_IMAGEPREVIEW.selectImgClickFunction = function() {
if (slideshow_isTransaction == false) { if (CONTENTVIEW_IMAGEPREVIEW.slideshow_isTransaction == false) {
slideshow_isTransaction = true; CONTENTVIEW_IMAGEPREVIEW.slideshow_isTransaction = true;
var imgIndex = $(this).attr('imageId'); var imgIndex = $(this).attr('imageId');
if (imgIndex > slideshowMainCurrIndex) { if (imgIndex > CONTENTVIEW_IMAGEPREVIEW.slideshowMainCurrIndex) {
$('#main-img div').animate( $('#main-img div').animate(
{ "left": "-=100%" }, { "left": "-=100%" },
{ {
duration: "medium", duration: "medium",
complete: function () { complete: function () {
$('#main-img div').css('display', 'none'); $('#main-img div').css('display', 'none');
renderMainImage(imgIndex); CONTENTVIEW_IMAGEPREVIEW.renderMainImage(imgIndex);
$('#main-img div').css('left', '+=300%'); $('#main-img div').css('left', '+=300%');
$('#main-img div').css('display', 'block'); $('#main-img div').css('display', 'block');
$('<img/>').attr('src', slideshowImageCollection[imgIndex].thumbnail).load(function () { $('<img/>').attr('src', CONTENTVIEW_IMAGEPREVIEW.slideshowImageCollection[imgIndex].thumbnail).load(function () {
$('#main-img div').animate({ left: '0%' }); $('#main-img div').animate({ left: '0%' });
}); });
slideshowMainCurrIndex = imgIndex; CONTENTVIEW_IMAGEPREVIEW.slideshowMainCurrIndex = imgIndex;
handleDispNextPrevButton(); CONTENTVIEW_IMAGEPREVIEW.handleDispNextPrevButton();
} }
} }
); );
} }
else if (imgIndex < slideshowMainCurrIndex) { else if (imgIndex < CONTENTVIEW_IMAGEPREVIEW.slideshowMainCurrIndex) {
$('#main-img div').animate( $('#main-img div').animate(
{ "left": "+=100%" }, { "left": "+=100%" },
{ {
duration: "medium", duration: "medium",
complete: function () { complete: function () {
$('#main-img div').css('display', 'none'); $('#main-img div').css('display', 'none');
renderMainImage(imgIndex); CONTENTVIEW_IMAGEPREVIEW.renderMainImage(imgIndex);
$('#main-img div').css('left', '-=300%'); $('#main-img div').css('left', '-=300%');
$('#main-img div').css('display', 'block'); $('#main-img div').css('display', 'block');
$('<img/>').attr('src', slideshowImageCollection[imgIndex].thumbnail).load(function () { $('<img/>').attr('src', CONTENTVIEW_IMAGEPREVIEW.slideshowImageCollection[imgIndex].thumbnail).load(function () {
$('#main-img div').animate({ left: '0%' }); $('#main-img div').animate({ left: '0%' });
}); });
slideshowMainCurrIndex = imgIndex; CONTENTVIEW_IMAGEPREVIEW.slideshowMainCurrIndex = imgIndex;
handleDispNextPrevButton(); CONTENTVIEW_IMAGEPREVIEW.handleDispNextPrevButton();
} }
} }
); );
} }
else { else {
slideshow_isTransaction = false; CONTENTVIEW_IMAGEPREVIEW.slideshow_isTransaction = false;
slideshowMainCurrIndex = imgIndex; CONTENTVIEW_IMAGEPREVIEW.slideshowMainCurrIndex = imgIndex;
handleDispNextPrevButton(); CONTENTVIEW_IMAGEPREVIEW.handleDispNextPrevButton();
} }
//$('.thumbnail').css('box-shadow', ''); //$('.thumbnail').css('box-shadow', '');
$('.thumbnail').removeClass('activeThumb'); $('.thumbnail').removeClass('activeThumb');
//$(this).css('box-shadow', '0px 7px 7px #555'); //$(this).css('box-shadow', '0px 7px 7px #555');
$(this).addClass('activeThumb'); $(this).addClass('activeThumb');
slideshowClickFlg = true; CONTENTVIEW_IMAGEPREVIEW.slideshowClickFlg = true;
} }
}; };
//Render Main Image //Render Main Image
function renderMainImage(i) { CONTENTVIEW_IMAGEPREVIEW.renderMainImage = function(i) {
var mainImg = $('#main-img div'); var mainImg = $('#main-img div');
mainImg.css('background-image', 'url(' + slideshowImageCollection[i].thumbnail + ')'); mainImg.css('background-image', 'url(' + CONTENTVIEW_IMAGEPREVIEW.slideshowImageCollection[i].thumbnail + ')');
slideshow_isTransaction = false; CONTENTVIEW_IMAGEPREVIEW.slideshow_isTransaction = false;
if (COMMON.isTouchDevice() == true) { if (COMMON.isTouchDevice() == true) {
$('#main-control-next').css('opacity', '0'); $('#main-control-next').css('opacity', '0');
$('#main-control-prev').css('opacity', '0'); $('#main-control-prev').css('opacity', '0');
} }
}; };
function selectImgMouseLeaveFunction(){ CONTENTVIEW_IMAGEPREVIEW.selectImgMouseLeaveFunction = function(){
if(!slideshowClickFlg){ if(!CONTENTVIEW_IMAGEPREVIEW.slideshowClickFlg){
//$('this').css('box-shadow',''); //$('this').css('box-shadow','');
$('this').removeClass('activeThumb'); $('this').removeClass('activeThumb');
slideshowClickFlg = false; CONTENTVIEW_IMAGEPREVIEW.slideshowClickFlg = false;
} }
else{ else{
//slideshowClickFlg = false; //CONTENTVIEW_IMAGEPREVIEW.slideshowClickFlg = false;
} }
}; };
function selectImgMouseEnterFunction(){ CONTENTVIEW_IMAGEPREVIEW.selectImgMouseEnterFunction = function(){
//$('.thumbnail').css('box-shadow',''); //$('.thumbnail').css('box-shadow','');
$('.thumbnail').removeClass('activeThumb'); $('.thumbnail').removeClass('activeThumb');
...@@ -400,25 +404,25 @@ function selectImgMouseEnterFunction(){ ...@@ -400,25 +404,25 @@ function selectImgMouseEnterFunction(){
}; };
//Main control mouse leave function //Main control mouse leave function
function mainControlMouseLeaveFunction(){ CONTENTVIEW_IMAGEPREVIEW.mainControlMouseLeaveFunction = function(){
$('.main-control').css('opacity','0'); $('.main-control').css('opacity','0');
}; };
//Main control mouse enter function //Main control mouse enter function
function mainControlMouseEnterFunction(){ CONTENTVIEW_IMAGEPREVIEW.mainControlMouseEnterFunction = function(){
$('.main-control').css('opacity','0.5'); $('.main-control').css('opacity','0.5');
}; };
//Sync Main Image with select Image //Sync Main Image with select Image
function syncImageMainWithSelectImage(){ CONTENTVIEW_IMAGEPREVIEW.syncImageMainWithSelectImage = function(){
var thumbImg = $('.thumbnail[imageId="'+ slideshowMainCurrIndex +'"]'); var thumbImg = $('.thumbnail[imageId="'+ CONTENTVIEW_IMAGEPREVIEW.slideshowMainCurrIndex +'"]');
if(thumbImg.is(':hidden')){ if(thumbImg.is(':hidden')){
if(slideshowMainCurrIndex > slideshowSelectLastIndex){ if(CONTENTVIEW_IMAGEPREVIEW.slideshowMainCurrIndex > CONTENTVIEW_IMAGEPREVIEW.slideshowSelectLastIndex){
imageSelectNextFunction(); CONTENTVIEW_IMAGEPREVIEW.imageSelectNextFunction();
} }
else if(slideshowMainCurrIndex < slideshowSelectFirstIndex){ else if(CONTENTVIEW_IMAGEPREVIEW.slideshowMainCurrIndex < CONTENTVIEW_IMAGEPREVIEW.slideshowSelectFirstIndex){
imageSelectPrevFunction(); CONTENTVIEW_IMAGEPREVIEW.imageSelectPrevFunction();
} }
} }
...@@ -429,30 +433,30 @@ function syncImageMainWithSelectImage(){ ...@@ -429,30 +433,30 @@ function syncImageMainWithSelectImage(){
}; };
//Handle display button control //Handle display button control
function handleDispNextPrevButton(){ CONTENTVIEW_IMAGEPREVIEW.handleDispNextPrevButton = function(){
if(slideshowSelectFirstIndex > 0){ if(CONTENTVIEW_IMAGEPREVIEW.slideshowSelectFirstIndex > 0){
$('#control-prev').css('visibility','visible'); $('#control-prev').css('visibility','visible');
} }
else{ else{
$('#control-prev').css('visibility','hidden'); $('#control-prev').css('visibility','hidden');
} }
if(slideshowSelectLastIndex < (eval(slideshowImageCollection.length) - 1)){ if(CONTENTVIEW_IMAGEPREVIEW.slideshowSelectLastIndex < (eval(CONTENTVIEW_IMAGEPREVIEW.slideshowImageCollection.length) - 1)){
$('#control-next').css('visibility','visible'); $('#control-next').css('visibility','visible');
} }
else{ else{
$('#control-next').css('visibility','hidden'); $('#control-next').css('visibility','hidden');
} }
if(slideshowMainCurrIndex > 0){ if(CONTENTVIEW_IMAGEPREVIEW.slideshowMainCurrIndex > 0){
$('#main-control-prev').css('visibility','visible'); $('#main-control-prev').css('visibility','visible');
} }
else{ else{
$('#main-control-prev').css('visibility','hidden'); $('#main-control-prev').css('visibility','hidden');
} }
if(slideshowMainCurrIndex < (eval(slideshowImageCollection.length) - 1)){ if(CONTENTVIEW_IMAGEPREVIEW.slideshowMainCurrIndex < (eval(CONTENTVIEW_IMAGEPREVIEW.slideshowImageCollection.length) - 1)){
$('#main-control-next').css('visibility','visible'); $('#main-control-next').css('visibility','visible');
} }
else{ else{
...@@ -460,4 +464,3 @@ function handleDispNextPrevButton(){ ...@@ -460,4 +464,3 @@ function handleDispNextPrevButton(){
} }
}; };
//名前空間用のオブジェクトを用意する
var CONTENTVIEW_INITOBJECT = {};
/* init Image memo */ /* init Image memo */
function initImageMemo() { CONTENTVIEW_INITOBJECT.initImageMemo = function() {
if (ClientData.IsDisplayMemo() == true) { if (ClientData.IsDisplayMemo() == true) {
//change class //change class
$('#imgmemo').removeClass(); $('#imgmemo').removeClass();
...@@ -14,7 +17,7 @@ function initImageMemo() { ...@@ -14,7 +17,7 @@ function initImageMemo() {
}; };
/* init Image add memo */ /* init Image add memo */
function initImageAddMemo() { CONTENTVIEW_INITOBJECT.initImageAddMemo = function() {
if (ClientData.IsAddingMemo() == true) { if (ClientData.IsAddingMemo() == true) {
//change class //change class
$('#imgaddmemo').removeClass(); $('#imgaddmemo').removeClass();
...@@ -29,7 +32,7 @@ function initImageAddMemo() { ...@@ -29,7 +32,7 @@ function initImageAddMemo() {
}; };
/*check display marking?? */ /*check display marking?? */
function initDisplayMarking() { CONTENTVIEW_INITOBJECT.initDisplayMarking = function() {
if (ClientData.IsDisplayMarking() == true) { if (ClientData.IsDisplayMarking() == true) {
// change class // change class
$('#imgmarking').removeClass(); $('#imgmarking').removeClass();
...@@ -37,10 +40,10 @@ function initDisplayMarking() { ...@@ -37,10 +40,10 @@ function initDisplayMarking() {
if (ClientData.IsAddingMarking() == true) { if (ClientData.IsAddingMarking() == true) {
if (ClientData.IsHideToolbar() == false) { if (ClientData.IsHideToolbar() == false) {
ShowMarking(); CONTENTVIEW_MARKING.ShowMarking();
} }
disableAllControl(); CONTENTVIEW_GENERAL.disableAllControl();
} }
else { else {
...@@ -71,8 +74,8 @@ function initDisplayMarking() { ...@@ -71,8 +74,8 @@ function initDisplayMarking() {
/* init Image bookmark */ /* init Image bookmark */
function initImageBookmark() { CONTENTVIEW_INITOBJECT.initImageBookmark = function() {
if (isExistBookmark() == -1) { if (CONTENTVIEW.isExistBookmark() == -1) {
//change class //change class
$('#imgbookmark').removeClass(); $('#imgbookmark').removeClass();
$('#imgbookmark').addClass('bmAdd_off'); $('#imgbookmark').addClass('bmAdd_off');
...@@ -86,7 +89,7 @@ function initImageBookmark() { ...@@ -86,7 +89,7 @@ function initImageBookmark() {
/* init flag marking, memo when init page */ /* init flag marking, memo when init page */
function initFlagDisplay() { CONTENTVIEW_INITOBJECT.initFlagDisplay = function() {
ClientData.IsDisplayMemo(false); ClientData.IsDisplayMemo(false);
ClientData.IsAddingMemo(false); ClientData.IsAddingMemo(false);
if (ClientData.userOpt_makingDsp() == "1") { if (ClientData.userOpt_makingDsp() == "1") {
...@@ -99,8 +102,8 @@ function initFlagDisplay() { ...@@ -99,8 +102,8 @@ function initFlagDisplay() {
/* set size bot toolbar for ipad */ /* set size bot toolbar for ipad */
function initDisplayToolbarDevice() { CONTENTVIEW_INITOBJECT.initDisplayToolbarDevice = function() {
if (avwUserEnvObj.os == "ipad" || avwUserEnvObj.os == "android") { if (CONTENTVIEW_GENERAL.avwUserEnvObj.os == "ipad" || CONTENTVIEW_GENERAL.avwUserEnvObj.os == "android") {
$('.transition').css('padding', '4px 0 0 0'); $('.transition').css('padding', '4px 0 0 0');
$('.sizing').css('padding', '4px 0 0 2px'); $('.sizing').css('padding', '4px 0 0 2px');
$('.toolbar').css('margin', '0 0 0 0'); $('.toolbar').css('margin', '0 0 0 0');
...@@ -108,7 +111,7 @@ function initDisplayToolbarDevice() { ...@@ -108,7 +111,7 @@ function initDisplayToolbarDevice() {
}; };
//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
function setLoadingSize(){ CONTENTVIEW_INITOBJECT.setLoadingSize = function(){
var width = $(window).width() / 2; var width = $(window).width() / 2;
var objWidth = $('#divImageLoading').width() /2 ; var objWidth = $('#divImageLoading').width() /2 ;
var result = width - objWidth; var result = width - objWidth;
...@@ -116,13 +119,13 @@ function setLoadingSize(){ ...@@ -116,13 +119,13 @@ function setLoadingSize(){
$('#divImageLoading').css('left', result); $('#divImageLoading').css('left', result);
}; };
//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
function initPage() { CONTENTVIEW_INITOBJECT.initPage = function() {
//abe //abe
//alert("initPage"); //alert("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(); CONTENTVIEW_INITOBJECT.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
$('#divImageLoading').css('display', 'block'); $('#divImageLoading').css('display', 'block');
...@@ -131,212 +134,212 @@ function initPage() { ...@@ -131,212 +134,212 @@ function initPage() {
$('#footer_toolbar_1').show(); $('#footer_toolbar_1').show();
/* init pos bottom toolbar*/ /* init pos bottom toolbar*/
initDisplayToolbarDevice(); CONTENTVIEW_INITOBJECT.initDisplayToolbarDevice();
// Lock screen // Lock screen
COMMON.LockScreen(); COMMON.LockScreen();
StartTimerUpdateLog(); CONTENTVIEW.StartTimerUpdateLog();
/* set start log */ /* set start log */
COMMON.SetStartLog(contentID); COMMON.SetStartLog(CONTENTVIEW_GENERAL.contentID);
/* get info of content */ /* get info of content */
//Start Function: No.12 //Start Function: No.12
if(contentType == COMMON.ContentTypeKeys.Type_Image){ if(CONTENTVIEW_GENERAL.contentType == COMMON.ContentTypeKeys.Type_Image){
getContentInfoTypeImage(); CONTENTVIEW_GETDATA.getContentInfoTypeImage();
} }
else if(contentType == COMMON.ContentTypeKeys.Type_NoFile){ else if(CONTENTVIEW_GENERAL.contentType == COMMON.ContentTypeKeys.Type_NoFile){
//Start Function: No.4 - Editor : Long - Date: 08/20/2013 //Start Function: No.4 - Editor : Long - Date: 08/20/2013
getPageTransitionConfig(); CONTENTVIEW_GETDATA.getPageTransitionConfig();
//End Function : No.4 - Editor : Long - Date : 08/20/2013 //End Function : No.4 - Editor : Long - Date : 08/20/2013
//Start Function: No.12 - Editor : Long - Date: 08/28/2013 //Start Function: No.12 - Editor : Long - Date: 08/28/2013
getJsonContentInfoTyeNone(); CONTENTVIEW_CONTENTTYPENONE.getJsonContentInfoTyeNone();
//Start Function: No.12 - Editor : Long - Date: 08/28/2013 //Start Function: No.12 - Editor : Long - Date: 08/28/2013
} }
else{ else{
getJsonContentInfo(); CONTENTVIEW_CALLAPI.getJsonContentInfo();
//Start Function: No.4 - Editor : Long - Date: 08/20/2013 //Start Function: No.4 - Editor : Long - Date: 08/20/2013
getPageTransitionConfig(); CONTENTVIEW_GETDATA.getPageTransitionConfig();
//End Function : No.4 - Editor : Long - Date : 08/20/2013 //End Function : No.4 - Editor : Long - Date : 08/20/2013
} }
//End Function: No.12 //End Function: No.12
initializeViewerComponent('wrapper'); CONTENTVIEW_INITOBJECT.initializeViewerComponent('wrapper');
/* handle display tooltip */ /* handle display tooltip */
handleTooltip(); CONTENTVIEW.handleTooltip();
/* set text dialog confirm of audio */ /* set text dialog confirm of audio */
createTextConfirmAudio(); CONTENTVIEW_CREATEOBJECT.createTextConfirmAudio();
/* handle toolbar */ /* handle toolbar */
$('#control_screen').click(handleDisplayToolbar); $('#control_screen').click(CONTENTVIEW.handleDisplayToolbar);
$('#control_screen_2').click(handleDisplayToolbar); $('#control_screen_2').click(CONTENTVIEW.handleDisplayToolbar);
/* bookmark Page */ /* bookmark Page */
$('#imgbookmark').click(bookmarkPage); $('#imgbookmark').click(CONTENTVIEW.bookmarkPage);
$('#listbookmark').click(showListBookMark); $('#listbookmark').click(CONTENTVIEW_EVENTS.showListBookMark);
$('#divListBookmark li').live('click', clickBookmark); $('#divListBookmark li').live('click', CONTENTVIEW_EVENTS.clickBookmark);
/* close bookmark dialog */ /* close bookmark dialog */
//$("#bookmarkClosing").live('click',closeBookmarkBox); //$("#bookmarkClosing").live('click',CONTENTVIEW_EVENTS.closeBookmarkBox);
//Start Function : No.12 //Start Function : No.12
if(contentType == COMMON.ContentTypeKeys.Type_PDF){ if(CONTENTVIEW_GENERAL.contentType == COMMON.ContentTypeKeys.Type_PDF){
/* page index */ /* page index */
$('#listindex').click(showListPageIndex); $('#listindex').click(CONTENTVIEW_EVENTS.showListPageIndex);
$('#divSearchResult li').live('click', clickSearchDetail); $('#divSearchResult li').live('click', CONTENTVIEW_EVENTS.clickSearchDetail);
/* copy text */ /* copy text */
$('#copytext').click(showCopyText); $('#copytext').click(CONTENTVIEW_EVENTS.showCopyText);
/* close copy text dialog */ /* close copy text dialog */
$("#copyTextClosing").click(closeCopyTextBox); $("#copyTextClosing").click(CONTENTVIEW_EVENTS.closeCopyTextBox);
} }
/*event click next page button */ /*event click next page button */
$('#nextpage').click(nextPage_click); $('#nextpage').click(CONTENTVIEW_EVENTS.nextPage_click);
$('#button_next_canvas').click(nextPage_click); $('#button_next_canvas').click(CONTENTVIEW_EVENTS.nextPage_click);
/*event click prev page button */ /*event click prev page button */
$('#prevpage').click(prevPage_click); $('#prevpage').click(CONTENTVIEW_EVENTS.prevPage_click);
$('#button_pre_canvas').click(prevPage_click); $('#button_pre_canvas').click(CONTENTVIEW_EVENTS.prevPage_click);
/*event click fist page button */ /*event click fist page button */
$('#firstpage').click(firstPage_click); $('#firstpage').click(CONTENTVIEW_EVENTS.firstPage_click);
/*event click last page button */ /*event click last page button */
$('#lastpage').click(lastPage_click); $('#lastpage').click(CONTENTVIEW_EVENTS.lastPage_click);
$("#imgBack").click(imgBack_click); $("#imgBack").click(CONTENTVIEW_EVENTS.imgBack_click);
$("#imgHome").click(imgHome_click); $("#imgHome").click(CONTENTVIEW_EVENTS.imgHome_click);
$("#btn_show_memo").click(showEditMemo); $("#btn_show_memo").click(CONTENTVIEW_CREATEOBJECT.showEditMemo);
$("#btn_copy_memo").click(copyMemo); $("#btn_copy_memo").click(CONTENTVIEW_CREATEOBJECT.copyMemo);
$('#memoClosing').click(closePopUpCopyMemo); $('#memoClosing').click(CONTENTVIEW_EVENTS.closePopUpCopyMemo);
$('#liAddMemo').click(click_liAddMemo); $('#liAddMemo').click(CONTENTVIEW_EVENTS.click_liAddMemo);
$('#liCopyMemo').click(click_liCopyMemo); $('#liCopyMemo').click(CONTENTVIEW_EVENTS.click_liCopyMemo);
$('#liDeleteMemo').click(click_liDeleteMemo); $('#liDeleteMemo').click(CONTENTVIEW_EVENTS.click_liDeleteMemo);
//Start Function: No.12 //Start Function: No.12
if(contentType == COMMON.ContentTypeKeys.Type_PDF){ if(CONTENTVIEW_GENERAL.contentType == COMMON.ContentTypeKeys.Type_PDF){
/*event search*/ /*event search*/
showListSearchResult(); CONTENTVIEW_EVENTS.showListSearchResult();
} }
//End Function: No.12 //End Function: No.12
/* zoom event */ /* zoom event */
$('#zoomin').click(zoomIn); $('#zoomin').click(CONTENTVIEW.zoomIn);
$('#zoomout').click(zoomOut); $('#zoomout').click(CONTENTVIEW.zoomOut);
$('#zoomfit').click(screenFit); $('#zoomfit').click(CONTENTVIEW.screenFit);
/* event memo */ /* event memo */
$('#imgmemo').click(handleMemo); $('#imgmemo').click(CONTENTVIEW.handleMemo);
$('#imgaddmemo').click(handleAddMemo); $('#imgaddmemo').click(CONTENTVIEW_EVENTS.handleAddMemo);
/* event marking */ /* event marking */
$('#imgmarking').click(imgmarking_click); $('#imgmarking').click(CONTENTVIEW_EVENTS.imgmarking_click);
$('#imgmarkingtoolbar').click(handleDrawCanvas); $('#imgmarkingtoolbar').click(CONTENTVIEW.handleDrawCanvas);
/*draw canvas*/ /*draw canvas*/
drawOnCanvas(); CONTENTVIEW.drawOnCanvas();
/*init flag */ /*init flag */
initFlagDisplay(); CONTENTVIEW_INITOBJECT.initFlagDisplay();
sizingScreen(); CONTENTVIEW.sizingScreen();
/* move image check marking*/ /* move image check marking*/
$('#divCheckExistMarking').css('top', '70px'); $('#divCheckExistMarking').css('top', '70px');
$('#divCheckExistMarking').hide(); $('#divCheckExistMarking').hide();
/* disable controls */ /* disable controls */
isLoadingObject = true; CONTENTVIEW_GENERAL.isLoadingObject = true;
disableAllControl(); CONTENTVIEW_GENERAL.disableAllControl();
/* window resize event */ /* window resize event */
$(window).resize(function () { $(window).resize(function () {
//Start : TRB00015 - Editor : Long - Date : 08/28/2013 - Summary : For win 8 rotate handling. //Start : TRB00015 - Editor : Long - Date : 08/28/2013 - Summary : For win 8 rotate handling.
setViewportForWin8(); CONTENTVIEW.setViewportForWin8();
//End : TRB00015 - Editor : Long - Date : 08/28/2013 - Summary : For win 8 rotate handling. //End : TRB00015 - Editor : Long - Date : 08/28/2013 - Summary : For win 8 rotate handling.
sizingScreen(); CONTENTVIEW.sizingScreen();
/* close dialog popuptext */ /* close dialog popuptext */
closeDialogResize(); CONTENTVIEW.closeDialogResize();
//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(); CONTENTVIEW_INITOBJECT.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
}); });
$(document).ajaxComplete(function () { $(document).ajaxComplete(function () {
/*Init Page */ /*Init Page */
nAjaxLoad++; CONTENTVIEW_GENERAL.nAjaxLoad++;
if (nAjaxLoad == 8) { if (CONTENTVIEW_GENERAL.nAjaxLoad == 8) {
/* handle from bookmark page */ /* handle from bookmark page */
//handleFromBookMarkPage(); //handleFromBookMarkPage();
/* check move content */ /* check move content */
if (ClientData.bookmark_pageNo()) { if (ClientData.bookmark_pageNo()) {
handleFromBookMarkPage(); CONTENTVIEW.handleFromBookMarkPage();
} else if (ClientData.common_prePageNo()) { } else if (ClientData.common_prePageNo()) {
/* handle from jump content */ /* handle from jump content */
handleFromJumpContent(); CONTENTVIEW.handleFromJumpContent();
} else if (ClientData.IsJumpBack() == true) { } else if (ClientData.IsJumpBack() == true) {
/* handle back */ /* handle back */
oldContent_Back(); CONTENTVIEW.oldContent_Back();
} else { } else {
if (getPageIndex() == 0) { if (CONTENTVIEW_GETDATA.getPageIndex() == 0) {
//START TRB00069 //START TRB00069
//START TRB00069 //START TRB00069
if(isHasPageBGM()){ if(CONTENTVIEW_INITOBJECT.isHasPageBGM()){
isPendingContentBGM = true; CONTENTVIEW.isPendingContentBGM = true;
} }
//END TRB00069 //END TRB00069
//END TRB00069 //END TRB00069
getContent().setPageImages(totalPage, pageImages) CONTENTVIEW_GETDATA.getContent().setPageImages(CONTENTVIEW_GENERAL.totalPage, CONTENTVIEW_GENERAL.pageImages)
.setPageObjects(pageObjects) .setPageObjects(CONTENTVIEW_GENERAL.pageObjects)
.setUpPage(0); .setUpPage(0);
//START : TRB00028 - Editor: Long - Date: 09/10/2013 - Summary : Fix For Page BGM //START : TRB00028 - Editor: Long - Date: 09/10/2013 - Summary : Fix For Page BGM
createPageBGM(); CONTENTVIEW_CREATEOBJECT.createPageBGM();
//END : TRB00028 - Editor: Long - Date: 09/10/2013 - Summary : Fix For Page BGM //END : TRB00028 - Editor: Long - Date: 09/10/2013 - Summary : Fix For Page BGM
//Start Function: No.12 - Editor : Long - Summary : Render next page //Start Function: No.12 - Editor : Long - Summary : Render next page
//Get next //Get next
if(totalPage > 1){ if(CONTENTVIEW_GENERAL.totalPage > 1){
getNextPageObjectsByPageIndex(pageObjectsData, getPageIndex() + 1); CONTENTVIEW_GETDATA.getNextPageObjectsByPageIndex(CONTENTVIEW_GENERAL.pageObjectsData, CONTENTVIEW_GETDATA.getPageIndex() + 1);
//Render next page //Render next page
renderNextPage(); CONTENTVIEW_GETDATA.renderNextPage();
} }
//End Function: No.12 - Editor : Long - Summary : Render next page //End Function: No.12 - Editor : Long - Summary : Render next page
/* set pageTitle*/ /* set pageTitle*/
if (dataPageTitle[0]) { if (CONTENTVIEW_GENERAL.dataPageTitle[0]) {
if (dataPageTitle[0] != '') { if (CONTENTVIEW_GENERAL.dataPageTitle[0] != '') {
document.title = contentName + '_' + dataPageTitle[0] + ' | ' + I18N.i18nText('sysAppTitle'); document.title = CONTENTVIEW_GENERAL.contentName + '_' + CONTENTVIEW_GENERAL.dataPageTitle[0] + ' | ' + I18N.i18nText('sysAppTitle');
} else { } else {
document.title = contentName + ' | ' + I18N.i18nText('sysAppTitle'); document.title = CONTENTVIEW_GENERAL.contentName + ' | ' + I18N.i18nText('sysAppTitle');
} }
} else { } else {
document.title = contentName + ' | ' + I18N.i18nText('sysAppTitle'); document.title = CONTENTVIEW_GENERAL.contentName + ' | ' + I18N.i18nText('sysAppTitle');
} }
/* handle slider bar */ /* handle slider bar */
handleSliderBar(); CONTENTVIEW.handleSliderBar();
} }
} }
/* window resize event */ /* window resize event */
$(window).resize(function () { $(window).resize(function () {
//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(); CONTENTVIEW_INITOBJECT.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
if (COMMON.isTouchDevice() == true) { if (COMMON.isTouchDevice() == true) {
if (avwUserEnvObj.os == "android") { if (CONTENTVIEW_GENERAL.avwUserEnvObj.os == "android") {
var tempRatio = document.documentElement.clientWidth / window.innerWidth; var tempRatio = document.documentElement.clientWidth / window.innerWidth;
if (tempRatio <= 1) { if (tempRatio <= 1) {
// Adjust position for toolbar and footer bar // Adjust position for toolbar and footer bar
...@@ -356,44 +359,44 @@ function initPage() { ...@@ -356,44 +359,44 @@ function initPage() {
} }
} }
resizeScreen(); CONTENTVIEW.resizeScreen();
isChangeSizeScreen = false; CONTENTVIEW_GENERAL.isChangeSizeScreen = false;
/* change position dialog */ /* change position dialog */
changePosDialog(); CONTENTVIEW.changePosDialog();
/* close dialog popuptext */ /* close dialog popuptext */
closeDialogResize(); CONTENTVIEW.closeDialogResize();
}); });
/* check status button */ /* check status button */
checkExistNextPrePage(); CONTENTVIEW.checkExistNextPrePage();
/*init Image Bookmark */ /*init Image Bookmark */
initImageBookmark(); CONTENTVIEW_INITOBJECT.initImageBookmark();
$('#lblSlider').text('/ ' + totalPage); $('#lblSlider').text('/ ' + CONTENTVIEW_GENERAL.totalPage);
/* memo */ /* memo */
initImageMemo(); CONTENTVIEW_INITOBJECT.initImageMemo();
initImageAddMemo(); CONTENTVIEW_INITOBJECT.initImageAddMemo();
/* init image had draw */ /* init image had draw */
initDisplayMarking(); CONTENTVIEW_INITOBJECT.initDisplayMarking();
/* check status */ /* check status */
checkStatusImageMarking(); CONTENTVIEW.checkStatusImageMarking();
trackTransforms(context_main); CONTENTVIEW.trackTransforms(CONTENTVIEW_GENERAL.context_main);
//nAjaxLoad = 0; //CONTENTVIEW_GENERAL.nAjaxLoad = 0;
if (COMMON.isTouchDevice() == true) { if (COMMON.isTouchDevice() == true) {
if (avwUserEnvObj.os == "android") { if (CONTENTVIEW_GENERAL.avwUserEnvObj.os == "android") {
standardRatio = document.documentElement.clientWidth / window.innerWidth; CONTENTVIEW_GENERAL.standardRatio = document.documentElement.clientWidth / window.innerWidth;
ZOOM_DETECTOR.startDetectZoom({ time: 500, ZOOM_DETECTOR.startDetectZoom({ time: 500,
callbackFunction: function (oldRatio, newRatio, oldW, oldH, newW, newH) { callbackFunction: function (oldRatio, newRatio, oldW, oldH, newW, newH) {
currentRatio = newRatio; CONTENTVIEW_GENERAL.currentRatio = newRatio;
} }
}); });
...@@ -402,73 +405,71 @@ function initPage() { ...@@ -402,73 +405,71 @@ function initPage() {
$("#wrapper").css("height", window.innerHeight); $("#wrapper").css("height", window.innerHeight);
$("#footer_toolbar_1").css("top", top + "px"); $("#footer_toolbar_1").css("top", top + "px");
$("#footer_toolbar_2").css("top", top + "px"); $("#footer_toolbar_2").css("top", top + "px");
sizingScreen(); CONTENTVIEW.sizingScreen();
} }
} }
//Start : TRB00015 - Editor : Long - Date : 08/28/2013 - Summary : For win 8 rotate handling. //Start : TRB00015 - Editor : Long - Date : 08/28/2013 - Summary : For win 8 rotate handling.
setViewportForWin8(); CONTENTVIEW.setViewportForWin8();
//End : TRB00015 - Editor : Long - Date : 08/28/2013 - Summary : For win 8 rotate handling. //End : TRB00015 - Editor : Long - Date : 08/28/2013 - Summary : For win 8 rotate handling.
} }
//START TRB00048 - EDITOR : Long - Date : 09/18/2013 - Summary : //START TRB00048 - EDITOR : Long - Date : 09/18/2013 - Summary :
else if(nAjaxLoad == 4){ else if(CONTENTVIEW_GENERAL.nAjaxLoad == 4){
//END TRB00048 - EDITOR : Long - Date : 09/18/2013 - Summary : //END TRB00048 - EDITOR : Long - Date : 09/18/2013 - Summary :
if(contentType == COMMON.ContentTypeKeys.Type_NoFile){ if(CONTENTVIEW_GENERAL.contentType == COMMON.ContentTypeKeys.Type_NoFile){
/* handle from bookmark page */ /* handle from bookmark page */
//handleFromBookMarkPage(); //handleFromBookMarkPage();
/* check move content */ /* check move content */
if (ClientData.bookmark_pageNo()) { if (ClientData.bookmark_pageNo()) {
CONTENTVIEW.handleFromBookMarkPage();
handleFromBookMarkPage();
} else if (ClientData.common_prePageNo()) { } else if (ClientData.common_prePageNo()) {
/* handle from jump content */ /* handle from jump content */
handleFromJumpContent(); CONTENTVIEW.handleFromJumpContent();
} else if (ClientData.IsJumpBack() == true) { } else if (ClientData.IsJumpBack() == true) {
/* handle back */ /* handle back */
oldContent_Back(); CONTENTVIEW.oldContent_Back();
} else { } else {
if (getPageIndex() == 0) { if (CONTENTVIEW_GETDATA.getPageIndex() == 0) {
//START TRB00069 //START TRB00069
if(isHasPageBGM()){ if(CONTENTVIEW_INITOBJECT.isHasPageBGM()){
isPendingContentBGM = true; CONTENTVIEW.isPendingContentBGM = true;
} }
//END TRB00069 //END TRB00069
getContent().setPageImages(totalPage, pageImages) CONTENTVIEW_GETDATA.getContent().setPageImages(CONTENTVIEW_GENERAL.totalPage, CONTENTVIEW_GENERAL.pageImages)
.setPageObjects(pageObjects) .setPageObjects(CONTENTVIEW_GENERAL.pageObjects)
.setUpPage(0); .setUpPage(0);
//START : TRB00028 - Editor: Long - Date: 09/10/2013 - Summary : Fix For Page BGM //START : TRB00028 - Editor: Long - Date: 09/10/2013 - Summary : Fix For Page BGM
createPageBGM(); CONTENTVIEW_CREATEOBJECT.createPageBGM();
//END : TRB00028 - Editor: Long - Date: 09/10/2013 - Summary : Fix For Page BGM //END : TRB00028 - Editor: Long - Date: 09/10/2013 - Summary : Fix For Page BGM
//Start Function: No.12 - Editor : Long - Summary : Render next page //Start Function: No.12 - Editor : Long - Summary : Render next page
//Get next //Get next
if(totalPage > 1){ if(CONTENTVIEW_GENERAL.totalPage > 1){
getNextPageObjectsByPageIndex(pageObjectsData, getPageIndex() + 1); CONTENTVIEW_GETDATA.getNextPageObjectsByPageIndex(CONTENTVIEW_GENERAL.pageObjectsData, CONTENTVIEW_GETDATA.getPageIndex() + 1);
//Render next page //Render next page
renderNextPage(); CONTENTVIEW_GETDATA.renderNextPage();
} }
//End Function: No.12 - Editor : Long - Summary : Render next page //End Function: No.12 - Editor : Long - Summary : Render next page
/* set pageTitle*/ /* set pageTitle*/
if (dataPageTitle[0]) { if (CONTENTVIEW_GENERAL.dataPageTitle[0]) {
if (dataPageTitle[0] != '') { if (CONTENTVIEW_GENERAL.dataPageTitle[0] != '') {
document.title = contentName + '_' + dataPageTitle[0] + ' | ' + I18N.i18nText('sysAppTitle'); document.title = CONTENTVIEW_GENERAL.contentName + '_' + CONTENTVIEW_GENERAL.dataPageTitle[0] + ' | ' + I18N.i18nText('sysAppTitle');
} else { } else {
document.title = contentName + ' | ' + I18N.i18nText('sysAppTitle'); document.title = CONTENTVIEW_GENERAL.contentName + ' | ' + I18N.i18nText('sysAppTitle');
} }
} else { } else {
document.title = contentName + ' | ' + I18N.i18nText('sysAppTitle'); document.title = CONTENTVIEW_GENERAL.contentName + ' | ' + I18N.i18nText('sysAppTitle');
} }
/* handle slider bar */ /* handle slider bar */
handleSliderBar(); CONTENTVIEW.handleSliderBar();
} }
} }
...@@ -476,7 +477,7 @@ function initPage() { ...@@ -476,7 +477,7 @@ function initPage() {
$(window).resize(function () { $(window).resize(function () {
if (COMMON.isTouchDevice() == true) { if (COMMON.isTouchDevice() == true) {
if (avwUserEnvObj.os == "android") { if (CONTENTVIEW_GENERAL.avwUserEnvObj.os == "android") {
var tempRatio = document.documentElement.clientWidth / window.innerWidth; var tempRatio = document.documentElement.clientWidth / window.innerWidth;
if (tempRatio <= 1) { if (tempRatio <= 1) {
// Adjust position for toolbar and footer bar // Adjust position for toolbar and footer bar
...@@ -496,44 +497,44 @@ function initPage() { ...@@ -496,44 +497,44 @@ function initPage() {
} }
} }
resizeScreen(); CONTENTVIEW.resizeScreen();
isChangeSizeScreen = false; CONTENTVIEW_GENERAL.isChangeSizeScreen = false;
/* change position dialog */ /* change position dialog */
changePosDialog(); CONTENTVIEW.changePosDialog();
/* close dialog popuptext */ /* close dialog popuptext */
closeDialogResize(); CONTENTVIEW.closeDialogResize();
}); });
/* check status button */ /* check status button */
checkExistNextPrePage(); CONTENTVIEW.checkExistNextPrePage();
/*init Image Bookmark */ /*init Image Bookmark */
initImageBookmark(); CONTENTVIEW_INITOBJECT.initImageBookmark();
$('#lblSlider').text('/ ' + totalPage); $('#lblSlider').text('/ ' + CONTENTVIEW_GENERAL.totalPage);
/* memo */ /* memo */
initImageMemo(); CONTENTVIEW_INITOBJECT.initImageMemo();
initImageAddMemo(); CONTENTVIEW_INITOBJECT.initImageAddMemo();
/* init image had draw */ /* init image had draw */
initDisplayMarking(); CONTENTVIEW_INITOBJECT.initDisplayMarking();
/* check status */ /* check status */
checkStatusImageMarking(); CONTENTVIEW.checkStatusImageMarking();
trackTransforms(context_main); CONTENTVIEW.trackTransforms(CONTENTVIEW_GENERAL.context_main);
//nAjaxLoad = 0; //CONTENTVIEW_GENERAL.nAjaxLoad = 0;
if (COMMON.isTouchDevice() == true) { if (COMMON.isTouchDevice() == true) {
if (avwUserEnvObj.os == "android") { if (CONTENTVIEW_GENERAL.avwUserEnvObj.os == "android") {
standardRatio = document.documentElement.clientWidth / window.innerWidth; CONTENTVIEW_GENERAL.standardRatio = document.documentElement.clientWidth / window.innerWidth;
ZOOM_DETECTOR.startDetectZoom({ time: 500, ZOOM_DETECTOR.startDetectZoom({ time: 500,
callbackFunction: function (oldRatio, newRatio, oldW, oldH, newW, newH) { callbackFunction: function (oldRatio, newRatio, oldW, oldH, newW, newH) {
currentRatio = newRatio; CONTENTVIEW_GENERAL.currentRatio = newRatio;
} }
}); });
...@@ -542,12 +543,12 @@ function initPage() { ...@@ -542,12 +543,12 @@ function initPage() {
$("#wrapper").css("height", window.innerHeight); $("#wrapper").css("height", window.innerHeight);
$("#footer_toolbar_1").css("top", top + "px"); $("#footer_toolbar_1").css("top", top + "px");
$("#footer_toolbar_2").css("top", top + "px"); $("#footer_toolbar_2").css("top", top + "px");
sizingScreen(); CONTENTVIEW.sizingScreen();
} }
} }
//Start : TRB00015 - Editor : Long - Date : 08/28/2013 - Summary : For win 8 rotate handling. //Start : TRB00015 - Editor : Long - Date : 08/28/2013 - Summary : For win 8 rotate handling.
setViewportForWin8(); CONTENTVIEW.setViewportForWin8();
//End : TRB00015 - Editor : Long - Date : 08/28/2013 - Summary : For win 8 rotate handling. //End : TRB00015 - Editor : Long - Date : 08/28/2013 - Summary : For win 8 rotate handling.
} }
} }
...@@ -556,12 +557,12 @@ function initPage() { ...@@ -556,12 +557,12 @@ function initPage() {
}; };
//START TRB00069 //START TRB00069
function isHasPageBGM(){ CONTENTVIEW_INITOBJECT.isHasPageBGM = function(){
var iResult = false; var iResult = false;
getPageObjectsByPageIndex(pageObjectsData, 0); CONTENTVIEW_GETDATA.getPageObjectsByPageIndex(CONTENTVIEW_GENERAL.pageObjectsData, 0);
for (var nIndex = 0; nIndex < pageObjects.length; nIndex++) { for (var nIndex = 0; nIndex < CONTENTVIEW_GENERAL.pageObjects.length; nIndex++) {
if (pageObjects[nIndex].mediaType == '3' && pageObjects[nIndex].playType == '2') { if (CONTENTVIEW_GENERAL.pageObjects[nIndex].mediaType == '3' && CONTENTVIEW_GENERAL.pageObjects[nIndex].playType == '2') {
iResult = true; iResult = true;
break; break;
} }
...@@ -572,7 +573,7 @@ function isHasPageBGM(){ ...@@ -572,7 +573,7 @@ function isHasPageBGM(){
//END TRB00069 //END TRB00069
function initPageMediaAndHtmlType(){ CONTENTVIEW_INITOBJECT.initPageMediaAndHtmlType = function(){
//$('#divImageLoading').css('display', 'block'); //$('#divImageLoading').css('display', 'block');
...@@ -581,29 +582,29 @@ function initPageMediaAndHtmlType(){ ...@@ -581,29 +582,29 @@ function initPageMediaAndHtmlType(){
$('#footer_toolbar_1').show(); $('#footer_toolbar_1').show();
/* init pos bottom toolbar*/ /* init pos bottom toolbar*/
initDisplayToolbarDevice(); CONTENTVIEW_INITOBJECT.initDisplayToolbarDevice();
// Lock screen // Lock screen
COMMON.LockScreen(); COMMON.LockScreen();
//START TRB00094 - Editor : Long - Date : 09/26/2013 - Summary : Setting log //START TRB00094 - Editor : Long - Date : 09/26/2013 - Summary : Setting log
StartTimerUpdateLog(); CONTENTVIEW.StartTimerUpdateLog();
/* set start log */ /* set start log */
COMMON.SetStartLog(contentID); COMMON.SetStartLog(CONTENTVIEW_GENERAL.contentID);
//END TRB00094 - Editor : Long - Date : 09/26/2013 - Summary : Setting log //END TRB00094 - Editor : Long - Date : 09/26/2013 - Summary : Setting log
//enable SpecifyControl //enable SpecifyControl
enableSpecifyControl(); CONTENTVIEW.enableSpecifyControl();
//Display overlay dialog for specify content type //Display overlay dialog for specify content type
displayOverlayForSpecifyContentType(); CONTENTVIEW.displayOverlayForSpecifyContentType();
//Resize window //Resize window
$(window).resize(function () { $(window).resize(function () {
//Check if content is zooming //Check if content is zooming
if(isZoomingContent){ if(CONTENTVIEW.isZoomingContent){
//var $container = $("#dialog"); //var $container = $("#dialog");
// var w = window.innerWidth; // var w = window.innerWidth;
//var h = window.innerHeight; //var h = window.innerHeight;
...@@ -613,10 +614,10 @@ function initPageMediaAndHtmlType(){ ...@@ -613,10 +614,10 @@ function initPageMediaAndHtmlType(){
} }
}); });
handleSliderBar(); CONTENTVIEW.handleSliderBar();
$('#lblSlider').text('/ ' + 1); $('#lblSlider').text('/ ' + 1);
if (avwUserEnvObj.os != "android") { if (CONTENTVIEW_GENERAL.avwUserEnvObj.os != "android") {
$("#slider_page").slider("option", "disabled", true); $("#slider_page").slider("option", "disabled", true);
} }
...@@ -625,7 +626,7 @@ function initPageMediaAndHtmlType(){ ...@@ -625,7 +626,7 @@ function initPageMediaAndHtmlType(){
//Start: Function: No.4 - Editor : Long - Date : 08/09/2013 - Summary : Create next and previous canvas //Start: Function: No.4 - Editor : Long - Date : 08/09/2013 - Summary : Create next and previous canvas
/* Initialize PageViewer Component */ /* Initialize PageViewer Component */
function initializeViewerComponent(viewId) { CONTENTVIEW_INITOBJECT.initializeViewerComponent = function(viewId) {
/* add some tags we need.*/ /* add some tags we need.*/
$('#' + viewId).prepend( $('#' + viewId).prepend(
...@@ -662,7 +663,7 @@ function initializeViewerComponent(viewId) { ...@@ -662,7 +663,7 @@ function initializeViewerComponent(viewId) {
//Start : Function : No.20 - Editor : Le Long - Date: 27/08/2013 - Summary : For performing on ipad. On Android 4.1.x do not use overflow : hidden in parent canvas //Start : Function : No.20 - Editor : Le Long - Date: 27/08/2013 - Summary : For performing on ipad. On Android 4.1.x do not use overflow : hidden in parent canvas
//to avoid draw duplicate canvas bug. //to avoid draw duplicate canvas bug.
if(avwUserEnvObj.os == 'ipad'){ if(CONTENTVIEW_GENERAL.avwUserEnvObj.os == 'ipad'){
$('#wrapper').css('overflow', 'hidden'); $('#wrapper').css('overflow', 'hidden');
} }
...@@ -672,8 +673,8 @@ function initializeViewerComponent(viewId) { ...@@ -672,8 +673,8 @@ function initializeViewerComponent(viewId) {
$('#main').css( $('#main').css(
{ {
'position': 'absolute', 'position': 'absolute',
'top': marginY + 'px', 'top': CONTENTVIEW.marginY + 'px',
'left': marginX + 'px', 'left': CONTENTVIEW.marginX + 'px',
'box-shadow': '3px 3px 14px #333', 'box-shadow': '3px 3px 14px #333',
'border-radius': '4px', 'border-radius': '4px',
'z-index' : '0' 'z-index' : '0'
...@@ -682,13 +683,13 @@ function initializeViewerComponent(viewId) { ...@@ -682,13 +683,13 @@ function initializeViewerComponent(viewId) {
); );
if(animateType == animateTypeKeys.Type_Slide){ if(CONTENTVIEW_GENERAL.animateType == CONTENTVIEW_GENERAL.animateTypeKeys.Type_Slide){
$('#mainNext').css( $('#mainNext').css(
{ {
'position': 'absolute', 'position': 'absolute',
'top': marginY + 'px', 'top': CONTENTVIEW.marginY + 'px',
'left': marginX + 'px', 'left': CONTENTVIEW.marginX + 'px',
'box-shadow': '3px 3px 14px #333', 'box-shadow': '3px 3px 14px #333',
'border-radius': '4px', 'border-radius': '4px',
'display': 'none', 'display': 'none',
...@@ -699,8 +700,8 @@ function initializeViewerComponent(viewId) { ...@@ -699,8 +700,8 @@ function initializeViewerComponent(viewId) {
{ {
'position': 'absolute', 'position': 'absolute',
'top': marginY + 'px', 'top': CONTENTVIEW.marginY + 'px',
'left': marginX + 'px', 'left': CONTENTVIEW.marginX + 'px',
'box-shadow': '3px 3px 14px #333', 'box-shadow': '3px 3px 14px #333',
'border-radius': '4px', 'border-radius': '4px',
'display': 'none', 'display': 'none',
...@@ -713,8 +714,8 @@ function initializeViewerComponent(viewId) { ...@@ -713,8 +714,8 @@ function initializeViewerComponent(viewId) {
{ {
'position': 'absolute', 'position': 'absolute',
'top': marginY + 'px', 'top': CONTENTVIEW.marginY + 'px',
'left': marginX + 'px', 'left': CONTENTVIEW.marginX + 'px',
'box-shadow': '3px 3px 14px #333', 'box-shadow': '3px 3px 14px #333',
'border-radius': '4px', 'border-radius': '4px',
'display': 'none', 'display': 'none',
...@@ -725,8 +726,8 @@ function initializeViewerComponent(viewId) { ...@@ -725,8 +726,8 @@ function initializeViewerComponent(viewId) {
{ {
'position': 'absolute', 'position': 'absolute',
'top': marginY + 'px', 'top': CONTENTVIEW.marginY + 'px',
'left': marginX + 'px', 'left': CONTENTVIEW.marginX + 'px',
'box-shadow': '3px 3px 14px #333', 'box-shadow': '3px 3px 14px #333',
'border-radius': '4px', 'border-radius': '4px',
'display': 'none', 'display': 'none',
...@@ -776,29 +777,29 @@ function initializeViewerComponent(viewId) { ...@@ -776,29 +777,29 @@ function initializeViewerComponent(viewId) {
$('#playvideo').css( $('#playvideo').css(
{ {
'position': 'absolute', 'position': 'absolute',
'top': marginY + 'px', 'top': CONTENTVIEW.marginY + 'px',
'left': marginX + 'px', 'left': CONTENTVIEW.marginX + 'px',
'z-index': 0 'z-index': 0
} }
); );
//set default event //set default event
setDefaultEvent(); CONTENTVIEW.setDefaultEvent();
/*init canvas value */ /*init canvas value */
canvas_marker = document.getElementById('marker_canvas'); CONTENTVIEW_GENERAL.canvas_marker = document.getElementById('marker_canvas');
context_marker = canvas_marker.getContext('2d'); CONTENTVIEW_GENERAL.context_marker = CONTENTVIEW_GENERAL.canvas_marker.getContext('2d');
canvas_draw = document.getElementById('draw_canvas'); CONTENTVIEW_GENERAL.canvas_draw = document.getElementById('draw_canvas');
context_draw = canvas_draw.getContext('2d'); CONTENTVIEW_GENERAL.context_draw = CONTENTVIEW_GENERAL.canvas_draw.getContext('2d');
canvas_main = document.getElementById('main'); CONTENTVIEW_GENERAL.canvas_main = document.getElementById('main');
context_main = canvas_main.getContext('2d'); CONTENTVIEW_GENERAL.context_main = CONTENTVIEW_GENERAL.canvas_main.getContext('2d');
canvas_offscreen = document.getElementById('offscreen'); CONTENTVIEW_GENERAL.canvas_offscreen = document.getElementById('offscreen');
context_offscreen = canvas_offscreen.getContext('2d'); CONTENTVIEW_GENERAL.context_offscreen = CONTENTVIEW_GENERAL.canvas_offscreen.getContext('2d');
}; };
//End: Function: No.4 - Editor : Long - Date : 08/09/2013 - Summary : Create next and previous canvas //End: Function: No.4 - Editor : Long - Date : 08/09/2013 - Summary : Create next and previous canvas
/* init image if exist marking in page */ /* init image if exist marking in page */
function initImageCheckMarking() { CONTENTVIEW_INITOBJECT.initImageCheckMarking = function() {
/* set draw image if exist */ /* set draw image if exist */
var dataMarking = ClientData.MarkingData(); var dataMarking = ClientData.MarkingData();
...@@ -807,18 +808,18 @@ function initImageCheckMarking() { ...@@ -807,18 +808,18 @@ function initImageCheckMarking() {
//Start Function: No.12 - Editor : Long //Start Function: No.12 - Editor : Long
var tempPageNo = 0; var tempPageNo = 0;
if(contentType == COMMON.ContentTypeKeys.Type_Image) if(CONTENTVIEW_GENERAL.contentType == COMMON.ContentTypeKeys.Type_Image)
{ {
tempPageNo = 1; tempPageNo = 1;
} }
else{ else{
tempPageNo = changePageIndex(getPageIndex()); tempPageNo = CONTENTVIEW.changePageIndex(CONTENTVIEW_GETDATA.getPageIndex());
} }
//End Function: No.12 - Editor : Long //End Function: No.12 - Editor : Long
for (var nIndex = 0; nIndex < dataMarking.length; nIndex++) { for (var nIndex = 0; nIndex < dataMarking.length; nIndex++) {
if (dataMarking[nIndex].contentid == contentID if (dataMarking[nIndex].contentid == CONTENTVIEW_GENERAL.contentID
&& dataMarking[nIndex].pageNo == tempPageNo) { && dataMarking[nIndex].pageNo == tempPageNo) {
isExistMarking = true; isExistMarking = true;
break; break;
...@@ -837,5 +838,3 @@ function initImageCheckMarking() { ...@@ -837,5 +838,3 @@ function initImageCheckMarking() {
} }
}; };
/// =============================================================================================== /// ===============================================================================================
/// Maker group [start] /// Maker group [start]
/// =============================================================================================== /// ===============================================================================================
var maker_Size; //名前空間用のオブジェクトを用意する
var maker_color; var CONTENTVIEW_MAKER = {};
var maker_targetDiv;
var maker_chooseColor; CONTENTVIEW_MAKER.maker_Size;
//CONTENTVIEW_MAKER.maker_color;
CONTENTVIEW_MAKER.maker_targetDiv;
CONTENTVIEW_MAKER.maker_chooseColor;
function ShowMaker(targetId){ CONTENTVIEW_MAKER.ShowMaker = function(targetId){
maker_targetDiv = targetId; CONTENTVIEW_MAKER.maker_targetDiv = targetId;
I18N.i18nReplaceText(); I18N.i18nReplaceText();
$('#dlgMaker').show(); $('#dlgMaker').show();
$('#dlgMaker').draggable(); $('#dlgMaker').draggable();
Maker_handleColorPickerEvent(); CONTENTVIEW_MAKER.Maker_handleColorPickerEvent();
$('#dlgMaker').center(); $('#dlgMaker').center();
}; };
function touchStart_BtnOk_Maker(e){ CONTENTVIEW_MAKER.touchStart_BtnOk_Maker = function(e){
e.preventDefault(); e.preventDefault();
Maker_dspOK_click(); CONTENTVIEW_MAKER.Maker_dspOK_click();
}; };
function touchStart_BtnCancel_Maker(e){ CONTENTVIEW_MAKER.touchStart_BtnCancel_Maker = function(e){
e.preventDefault(); e.preventDefault();
Maker_dspCancel_click(); CONTENTVIEW_MAKER.Maker_dspCancel_click();
}; };
function Maker_handleColorPickerEvent(){ CONTENTVIEW_MAKER.Maker_handleColorPickerEvent = function (){
if(avwUserEnvObj.os == "ipad" || avwUserEnvObj.os == "android"){ if(CONTENTVIEW_GENERAL.avwUserEnvObj.os == "ipad" || CONTENTVIEW_GENERAL.avwUserEnvObj.os == "android"){
$('#dlgMaker .colorpicker').unbind('mouseenter'); $('#dlgMaker .colorpicker').unbind('mouseenter');
$('#dlgMaker .colorpicker').unbind('mouseleave'); $('#dlgMaker .colorpicker').unbind('mouseleave');
$('#makerColorwrapper').unbind('mouseleave'); $('#makerColorwrapper').unbind('mouseleave');
document.getElementById('Maker_btnOk').addEventListener('touchstart',touchStart_BtnOk_Maker,false); document.getElementById('Maker_btnOk').addEventListener('touchstart',CONTENTVIEW_MAKER.touchStart_BtnOk_Maker,false);
document.getElementById('Maker_btnCancel').addEventListener('touchstart',touchStart_BtnCancel_Maker,false); document.getElementById('Maker_btnCancel').addEventListener('touchstart',CONTENTVIEW_MAKER.touchStart_BtnCancel_Maker,false);
} }
else{ else{
$('#dlgMaker .colorpicker').unbind('mouseenter'); $('#dlgMaker .colorpicker').unbind('mouseenter');
$('#dlgMaker .colorpicker').unbind('mouseleave'); $('#dlgMaker .colorpicker').unbind('mouseleave');
$('#makerColorwrapper').unbind('mouseleave'); $('#makerColorwrapper').unbind('mouseleave');
$('#dlgMaker .colorpicker').bind('mouseenter', Maker_colorPickerMouseEnterFunction); $('#dlgMaker .colorpicker').bind('mouseenter', CONTENTVIEW_MAKER.Maker_colorPickerMouseEnterFunction);
$('#dlgMaker .colorpicker').bind('mouseleave', Maker_colorPickerMouseLeaveFunction); $('#dlgMaker .colorpicker').bind('mouseleave', CONTENTVIEW_MAKER.Maker_colorPickerMouseLeaveFunction);
$('#makerColorwrapper').bind('mouseleave', Maker_colorWrapperMouseLeaveFunction); $('#makerColorwrapper').bind('mouseleave', CONTENTVIEW_MAKER.Maker_colorWrapperMouseLeaveFunction);
} }
$('#Maker_btnOk').live('click', Maker_dspOK_click); $('#Maker_btnOk').live('click', CONTENTVIEW_MAKER.Maker_dspOK_click);
$('#Maker_btnCancel').live('click', Maker_dspCancel_click); $('#Maker_btnCancel').live('click', CONTENTVIEW_MAKER.Maker_dspCancel_click);
Maker_SetDefaultValue(); CONTENTVIEW_MAKER.Maker_SetDefaultValue();
$('#marker-small-text').live('click', markerSmallTextClick); $('#marker-small-text').live('click', CONTENTVIEW_MAKER.markerSmallTextClick);
$('#marker-medium-text').live('click', markerMediumTextClick); $('#marker-medium-text').live('click', CONTENTVIEW_MAKER.markerMediumTextClick);
$('#marker-large-text').live('click', markerLargeTextClick); $('#marker-large-text').live('click', CONTENTVIEW_MAKER.markerLargeTextClick);
$('#marker-oversize-text').live('click', markerOversizeTextClick); $('#marker-oversize-text').live('click', CONTENTVIEW_MAKER.markerOversizeTextClick);
$('#dlgMaker .colorpicker').live('click', Maker_colorPickerClickFunction); $('#dlgMaker .colorpicker').live('click', CONTENTVIEW_MAKER.Maker_colorPickerClickFunction);
}; };
function markerSmallTextClick(){ CONTENTVIEW_MAKER.markerSmallTextClick = function(){
$('#maker-size-small').attr('checked','checked'); $('#maker-size-small').attr('checked','checked');
$('#maker-size-medium').removeAttr('checked'); $('#maker-size-medium').removeAttr('checked');
$('#maker-size-large').removeAttr('checked'); $('#maker-size-large').removeAttr('checked');
$('#maker-size-oversize').removeAttr('checked'); $('#maker-size-oversize').removeAttr('checked');
Maker_rdo1_click(); CONTENTVIEW_MAKER.Maker_rdo1_click();
}; };
function markerMediumTextClick(){ CONTENTVIEW_MAKER.markerMediumTextClick = function(){
$('#maker-size-small').removeAttr('checked'); $('#maker-size-small').removeAttr('checked');
$('#maker-size-medium').attr('checked','checked'); $('#maker-size-medium').attr('checked','checked');
$('#maker-size-large').removeAttr('checked'); $('#maker-size-large').removeAttr('checked');
$('#maker-size-oversize').removeAttr('checked'); $('#maker-size-oversize').removeAttr('checked');
Maker_rdo2_click(); CONTENTVIEW_MAKER.Maker_rdo2_click();
}; };
function markerLargeTextClick(){ CONTENTVIEW_MAKER.markerLargeTextClick = function(){
$('#maker-size-small').removeAttr('checked'); $('#maker-size-small').removeAttr('checked');
$('#maker-size-medium').removeAttr('checked'); $('#maker-size-medium').removeAttr('checked');
$('#maker-size-large').attr('checked','checked'); $('#maker-size-large').attr('checked','checked');
$('#maker-size-oversize').removeAttr('checked'); $('#maker-size-oversize').removeAttr('checked');
Maker_rdo3_click(); CONTENTVIEW_MAKER.Maker_rdo3_click();
}; };
function markerOversizeTextClick(){ CONTENTVIEW_MAKER.markerOversizeTextClick = function(){
$('#maker-size-small').removeAttr('checked'); $('#maker-size-small').removeAttr('checked');
$('#maker-size-medium').removeAttr('checked'); $('#maker-size-medium').removeAttr('checked');
$('#maker-size-large').removeAttr('checked'); $('#maker-size-large').removeAttr('checked');
$('#maker-size-oversize').attr('checked','checked'); $('#maker-size-oversize').attr('checked','checked');
Maker_rdo4_click(); CONTENTVIEW_MAKER.Maker_rdo4_click();
}; };
// Choose type of eraser, and draw to canvas // Choose type of eraser, and draw to canvas
function Maker_chooseType(typeValue, color) { CONTENTVIEW_MAKER.Maker_chooseType = function(typeValue, color) {
var fillColor; var fillColor;
maker_Size = typeValue; CONTENTVIEW_MAKER.maker_Size = typeValue;
var canvas = document.getElementById('Maker_cvPreviewmaker'); var canvas = document.getElementById('Maker_cvPreviewmaker');
if(color == null || color == 'undefined'){ if(color == null || color == 'undefined'){
...@@ -119,17 +123,17 @@ function Maker_chooseType(typeValue, color) { ...@@ -119,17 +123,17 @@ function Maker_chooseType(typeValue, color) {
}; };
// Set default value for maker. // Set default value for maker.
function Maker_SetDefaultValue() { CONTENTVIEW_MAKER.Maker_SetDefaultValue = function() {
var typeValue = undefined; var typeValue = undefined;
var makerColor = ClientData.maker_color(); var makerColor = ClientData.maker_color();
typeValue = ClientData.maker_size(); typeValue = ClientData.maker_size();
maker_Size = typeValue; CONTENTVIEW_MAKER.maker_Size = typeValue;
if(makerColor != null || makerColor != undefined){ if(makerColor != null || makerColor != undefined){
maker_chooseColor = makerColor; CONTENTVIEW_MAKER.maker_chooseColor = makerColor;
} }
else{ else{
maker_chooseColor = 'f8ff00'; CONTENTVIEW_MAKER.maker_chooseColor = 'f8ff00';
makerColor = 'f8ff00'; makerColor = 'f8ff00';
} }
...@@ -150,7 +154,7 @@ function Maker_SetDefaultValue() { ...@@ -150,7 +154,7 @@ function Maker_SetDefaultValue() {
$("#maker-size-oversize").focus(); $("#maker-size-oversize").focus();
} }
else { else {
maker_Size = 10; CONTENTVIEW_MAKER.maker_Size = 10;
$("#maker-size-small").attr('checked', 'checked'); $("#maker-size-small").attr('checked', 'checked');
$("#maker-size-small").focus(); $("#maker-size-small").focus();
} }
...@@ -160,58 +164,56 @@ function Maker_SetDefaultValue() { ...@@ -160,58 +164,56 @@ function Maker_SetDefaultValue() {
$('#dlgMaker .colorpicker[colorId="'+makerColor+'"]').addClass('picker-choose-on'); $('#dlgMaker .colorpicker[colorId="'+makerColor+'"]').addClass('picker-choose-on');
$('#dlgMaker .colorpicker[colorId="'+makerColor+'"]').removeClass('picker-choose-off'); $('#dlgMaker .colorpicker[colorId="'+makerColor+'"]').removeClass('picker-choose-off');
//END FIXCSS //END FIXCSS
Maker_chooseType(maker_Size, makerColor); CONTENTVIEW_MAKER.Maker_chooseType(CONTENTVIEW_MAKER.maker_Size, makerColor);
}; };
function Maker_colorPickerMouseLeaveFunction() { CONTENTVIEW_MAKER.Maker_colorPickerMouseLeaveFunction = function() {
//START FIXCSS //START FIXCSS
//$(this).css('border','1px solid white');
//$('#dlgMaker .colorpicker[colorId="'+makerColor+'"]').css('border','1px solid #e6e6e6');
$(this).addClass('picker-choose-off'); $(this).addClass('picker-choose-off');
$(this).removeClass('picker-choose-on'); $(this).removeClass('picker-choose-on');
$('#dlgMaker .colorpicker[colorId="'+makerColor+'"]').addClass('picker-choose-on'); $('#dlgMaker .colorpicker[colorId="'+CONTENTVIEW_GENERAL.makerColor+'"]').addClass('picker-choose-on');
$('#dlgMaker .colorpicker[colorId="'+makerColor+'"]').removeClass('picker-choose-off'); $('#dlgMaker .colorpicker[colorId="'+CONTENTVIEW_GENERAL.makerColor+'"]').removeClass('picker-choose-off');
//END FIXCSS //END FIXCSS
}; };
function Maker_colorPickerMouseEnterFunction() { CONTENTVIEW_MAKER.Maker_colorPickerMouseEnterFunction = function() {
//START FIXCSS //START FIXCSS
//$(this).css('border','1px solid #e6e6e6'); //$(this).css('border','1px solid #e6e6e6');
$(this).removeClass('picker-choose-off'); $(this).removeClass('picker-choose-off');
$(this).addClass('picker-choose-on'); $(this).addClass('picker-choose-on');
//END FIXCSS //END FIXCSS
var color = $(this).attr('colorId'); var color = $(this).attr('colorId');
Maker_chooseType(maker_Size, color); CONTENTVIEW_MAKER.Maker_chooseType(CONTENTVIEW_MAKER.maker_Size, color);
}; };
function Maker_colorPickerClickFunction() { CONTENTVIEW_MAKER.Maker_colorPickerClickFunction = function() {
//START FIXCSS //START FIXCSS
//$('#dlgMaker .colorpicker[colorId="' + maker_chooseColor + '"]').css('border', '1px solid white'); //$('#dlgMaker .colorpicker[colorId="' + CONTENTVIEW_MAKER.maker_chooseColor + '"]').css('border', '1px solid white');
//$(this).css('border','1px solid #e6e6e6'); //$(this).css('border','1px solid #e6e6e6');
$('#dlgMaker .colorpicker[colorId="' + maker_chooseColor + '"]').addClass('picker-choose-off'); $('#dlgMaker .colorpicker[colorId="' + CONTENTVIEW_MAKER.maker_chooseColor + '"]').addClass('picker-choose-off');
$('#dlgMaker .colorpicker[colorId="' + maker_chooseColor + '"]').removeClass('picker-choose-on'); $('#dlgMaker .colorpicker[colorId="' + CONTENTVIEW_MAKER.maker_chooseColor + '"]').removeClass('picker-choose-on');
$(this).addClass('picker-choose-on'); $(this).addClass('picker-choose-on');
$(this).removeClass('picker-choose-off'); $(this).removeClass('picker-choose-off');
//END FIXCSS //END FIXCSS
maker_chooseColor = $(this).attr('colorId'); CONTENTVIEW_MAKER.maker_chooseColor = $(this).attr('colorId');
Maker_chooseType(maker_Size, maker_chooseColor); CONTENTVIEW_MAKER.Maker_chooseType(CONTENTVIEW_MAKER.maker_Size, CONTENTVIEW_MAKER.maker_chooseColor);
}; };
function Maker_rdo1_click() { CONTENTVIEW_MAKER.Maker_rdo1_click = function() {
Maker_chooseType(5, maker_chooseColor); CONTENTVIEW_MAKER.Maker_chooseType(5, CONTENTVIEW_MAKER.maker_chooseColor);
}; };
function Maker_rdo2_click() { CONTENTVIEW_MAKER.Maker_rdo2_click = function() {
Maker_chooseType(12.5, maker_chooseColor); CONTENTVIEW_MAKER.Maker_chooseType(12.5, CONTENTVIEW_MAKER.maker_chooseColor);
}; };
function Maker_rdo3_click() { CONTENTVIEW_MAKER.Maker_rdo3_click = function() {
Maker_chooseType(25, maker_chooseColor); CONTENTVIEW_MAKER.Maker_chooseType(25, CONTENTVIEW_MAKER.maker_chooseColor);
}; };
function Maker_rdo4_click() { CONTENTVIEW_MAKER.Maker_rdo4_click = function() {
Maker_chooseType(50, maker_chooseColor); CONTENTVIEW_MAKER.Maker_chooseType(50, CONTENTVIEW_MAKER.maker_chooseColor);
}; };
// Event of button OK // Event of button OK
function Maker_dspOK_click() { CONTENTVIEW_MAKER.Maker_dspOK_click = function() {
// Set selected value to local storage // Set selected value to local storage
var typeValue = undefined; var typeValue = undefined;
...@@ -229,33 +231,33 @@ function Maker_dspOK_click() { ...@@ -229,33 +231,33 @@ function Maker_dspOK_click() {
typeValue = 50; typeValue = 50;
} }
if(ClientData.maker_color() != maker_chooseColor){ if(ClientData.maker_color() != CONTENTVIEW_MAKER.maker_chooseColor){
imgMarkerTemp = canvas_marker.toDataURL("image/png;"); CONTENTVIEW_GENERAL.imgMarkerTemp = CONTENTVIEW_GENERAL.canvas_marker.toDataURL("image/png;");
var img = new Image(); var img = new Image();
img.onload = function () { img.onload = function () {
context_draw.drawImage(img, 0, 0, canvas_draw.width, canvas_draw.height); CONTENTVIEW_GENERAL.context_draw.drawImage(img, 0, 0, CONTENTVIEW_GENERAL.canvas_draw.width, CONTENTVIEW_GENERAL.canvas_draw.height);
}; };
img.src = imgMarkerTemp; img.src = CONTENTVIEW_GENERAL.imgMarkerTemp;
context_marker.clearRect(0, 0, canvas_marker.width, canvas_marker.height); CONTENTVIEW_GENERAL.context_marker.clearRect(0, 0, CONTENTVIEW_GENERAL.canvas_marker.width, CONTENTVIEW_GENERAL.canvas_marker.height);
ClientData.maker_color(); ClientData.maker_color();
} }
// Set value to local // Set value to local
ClientData.maker_size(typeValue); ClientData.maker_size(typeValue);
ClientData.maker_color(maker_chooseColor); ClientData.maker_color(CONTENTVIEW_MAKER.maker_chooseColor);
maker_Size = typeValue; CONTENTVIEW_MAKER.maker_Size = typeValue;
makerColor = maker_chooseColor; CONTENTVIEW_GENERAL.makerColor = CONTENTVIEW_MAKER.maker_chooseColor;
maker_targetDiv.hide(); CONTENTVIEW_MAKER.maker_targetDiv.hide();
/*enable button */ /*enable button */
enableButtonMarking(); CONTENTVIEW_MARKING.enableButtonMarking();
ClientData.IsAddingMarking(true); ClientData.IsAddingMarking(true);
isAddingMarking = ClientData.IsAddingMarking(); CONTENTVIEW_GENERAL.isAddingMarking = ClientData.IsAddingMarking();
makerSize = ClientData.maker_size(); CONTENTVIEW_GENERAL.makerSize = ClientData.maker_size();
makerColor = ClientData.maker_color(); CONTENTVIEW_GENERAL.makerColor = ClientData.maker_color();
/* unlock dialog overlay */ /* unlock dialog overlay */
$("#overlay").hide(); $("#overlay").hide();
...@@ -264,13 +266,13 @@ function Maker_dspOK_click() { ...@@ -264,13 +266,13 @@ function Maker_dspOK_click() {
}; };
// Event of button cancel // Event of button cancel
function Maker_dspCancel_click() { CONTENTVIEW_MAKER.Maker_dspCancel_click = function() {
maker_targetDiv.hide(); CONTENTVIEW_MAKER.maker_targetDiv.hide();
/*enable button */ /*enable button */
enableButtonMarking(); CONTENTVIEW_MARKING.enableButtonMarking();
ClientData.IsAddingMarking(true); ClientData.IsAddingMarking(true);
isAddingMarking = ClientData.IsAddingMarking(); CONTENTVIEW_GENERAL.isAddingMarking = ClientData.IsAddingMarking();
/* unlock dialog overlay */ /* unlock dialog overlay */
$("#overlay").hide(); $("#overlay").hide();
...@@ -279,15 +281,15 @@ function Maker_dspCancel_click() { ...@@ -279,15 +281,15 @@ function Maker_dspCancel_click() {
$('#dlgMarking_imgMakerOption').addClass('maker_option_hover'); $('#dlgMarking_imgMakerOption').addClass('maker_option_hover');
}; };
function Maker_colorWrapperMouseLeaveFunction() { CONTENTVIEW_MAKER.Maker_colorWrapperMouseLeaveFunction = function() {
Maker_chooseType(maker_Size, maker_chooseColor); CONTENTVIEW_MAKER.Maker_chooseType(CONTENTVIEW_MAKER.maker_Size, CONTENTVIEW_MAKER.maker_chooseColor);
//START FIXCSS //START FIXCSS
//$('#dlgMaker .colorpicker[colorId="' + maker_chooseColor + '"]').css('border', '1px solid #e6e6e6'); //$('#dlgMaker .colorpicker[colorId="' + CONTENTVIEW_MAKER.maker_chooseColor + '"]').css('border', '1px solid #e6e6e6');
$('#dlgMaker .colorpicker[colorId="' + maker_chooseColor + '"]').addClass('picker-choose-on'); $('#dlgMaker .colorpicker[colorId="' + CONTENTVIEW_MAKER.maker_chooseColor + '"]').addClass('picker-choose-on');
$('#dlgMaker .colorpicker[colorId="' + maker_chooseColor + '"]').removeClass('picker-choose-off'); $('#dlgMaker .colorpicker[colorId="' + CONTENTVIEW_MAKER.maker_chooseColor + '"]').removeClass('picker-choose-off');
//END FIXCSS //END FIXCSS
}; };
/// =============================================================================================== /// ===============================================================================================
/// Maker group [ end ] /// Maker group [ end ]
/// =============================================================================================== /// ===============================================================================================
\ No newline at end of file
/// コンテンツ閲覧画面_マーキングツールバーオーバーレイ /// コンテンツ閲覧画面_マーキングツールバーオーバーレイ
/// <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" />
/// =============================================================================================== /// ===============================================================================================
/// Marking group [start] /// Marking group [start]
/// =============================================================================================== /// ===============================================================================================
//名前空間用のオブジェクトを用意する
var CONTENTVIEW_MARKING = {};
// Set default value for easer. // Set default value for easer.
function Marking_SetDefaultValue() { CONTENTVIEW_MARKING.Marking_SetDefaultValue = function() {
}; };
/* /*
...@@ -29,35 +16,35 @@ function Marking_SetDefaultValue() { ...@@ -29,35 +16,35 @@ function Marking_SetDefaultValue() {
Event groups [start] Event groups [start]
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
*/ */
function dlgMarking_dspSave_click() { CONTENTVIEW_MARKING.dlgMarking_dspSave_click = function() {
imgMarkerTemp = canvas_marker.toDataURL("image/png;"); CONTENTVIEW_GENERAL.imgMarkerTemp = CONTENTVIEW_GENERAL.canvas_marker.toDataURL("image/png;");
var img = new Image(); var img = new Image();
img.onload = function () { img.onload = function () {
//TRB00098 //TRB00098
context_draw.drawImage(img, 0, 0, canvas_draw.width, canvas_draw.height); CONTENTVIEW_GENERAL.context_draw.drawImage(img, 0, 0, CONTENTVIEW_GENERAL.canvas_draw.width, CONTENTVIEW_GENERAL.canvas_draw.height);
//TRB00098 //TRB00098
//START TRB00098 //START TRB00098
var saveImg = new Image(); var saveImg = new Image();
var saveImgUrl = canvas_draw.toDataURL("image/png"); var saveImgUrl = CONTENTVIEW_GENERAL.canvas_draw.toDataURL("image/png");
saveImg.onload = function(){ saveImg.onload = function(){
/*create new entity marking */ /*create new entity marking */
var marking = new MarkingEntity(); var marking = new MarkingEntity();
marking.contentid = contentID; marking.contentid = CONTENTVIEW_GENERAL.contentID;
if(contentType == COMMON.ContentTypeKeys.Type_Image){ if(CONTENTVIEW_GENERAL.contentType == COMMON.ContentTypeKeys.Type_Image){
marking.pageNo = 1; marking.pageNo = 1;
}else{ }else{
marking.pageNo = changePageIndex(getPageIndex()); marking.pageNo = CONTENTVIEW.changePageIndex(CONTENTVIEW_GETDATA.getPageIndex());
} }
var saveCanvas = document.createElement('canvas'); var saveCanvas = document.createElement('canvas');
//#11478 //#11478
//saveCanvas.width = canvas_offscreen.width; //saveCanvas.width = CONTENTVIEW_GENERAL.canvas_offscreen.width;
//saveCanvas.height = canvas_offscreen.height; //saveCanvas.height = CONTENTVIEW_GENERAL.canvas_offscreen.height;
saveCanvas.width = widthEachPageApi; saveCanvas.width = CONTENTVIEW_GENERAL.widthEachPageApi;
saveCanvas.height = heightEachPageApi; saveCanvas.height = CONTENTVIEW_GENERAL.heightEachPageApi;
var saveContext = saveCanvas.getContext('2d'); var saveContext = saveCanvas.getContext('2d');
saveContext.drawImage(saveImg, 0, 0, saveCanvas.width, saveCanvas.height); saveContext.drawImage(saveImg, 0, 0, saveCanvas.width, saveCanvas.height);
...@@ -73,15 +60,15 @@ function dlgMarking_dspSave_click() { ...@@ -73,15 +60,15 @@ function dlgMarking_dspSave_click() {
var nIndexMarking = -1; var nIndexMarking = -1;
for (var nIndex = 0; nIndex < arr.length; nIndex++) { for (var nIndex = 0; nIndex < arr.length; nIndex++) {
if (arr[nIndex].contentid == contentID if (arr[nIndex].contentid == CONTENTVIEW_GENERAL.contentID
&& arr[nIndex].pageNo == changePageIndex(getPageIndex())) { && arr[nIndex].pageNo == CONTENTVIEW.changePageIndex(CONTENTVIEW_GETDATA.getPageIndex())) {
nIndexMarking = nIndex; nIndexMarking = nIndex;
break; break;
} }
} }
if (isDrawing == true) {/* if has draw image */ if (CONTENTVIEW_GENERAL.isDrawing == true) {/* if has draw image */
if (isClearDrawing == true) { if (CONTENTVIEW_GENERAL.isClearDrawing == true) {
arr.splice(nIndexMarking, 1); arr.splice(nIndexMarking, 1);
} else { } else {
/* case not exist marking */ /* case not exist marking */
...@@ -92,7 +79,7 @@ function dlgMarking_dspSave_click() { ...@@ -92,7 +79,7 @@ function dlgMarking_dspSave_click() {
//=== Start Function : No.17 Editor : Long Date: 07/30/2013 Summary : Set UTC time when edit marking/maker. //=== Start Function : No.17 Editor : Long Date: 07/30/2013 Summary : Set UTC time when edit marking/maker.
var editedMarkingEntity = arr[nIndexMarking]; var editedMarkingEntity = arr[nIndexMarking];
//#11478 //#11478
//editedMarkingEntity.content = canvas_draw.toDataURL("image/png"); //editedMarkingEntity.content = CONTENTVIEW_GENERAL.canvas_draw.toDataURL("image/png");
editedMarkingEntity.content = marking.content; editedMarkingEntity.content = marking.content;
editedMarkingEntity.registerDate = new Date(); editedMarkingEntity.registerDate = new Date();
...@@ -118,31 +105,31 @@ function dlgMarking_dspSave_click() { ...@@ -118,31 +105,31 @@ function dlgMarking_dspSave_click() {
ClientData.IsHideToolbar(false); ClientData.IsHideToolbar(false);
/* draw again*/ /* draw again*/
//drawCanvas(); //CONTENTVIEW.drawCanvas();
//disableAllControl(); //CONTENTVIEW_GENERAL.disableAllControl();
handleDisplayToolbar(); CONTENTVIEW.handleDisplayToolbar();
/* visible button fullscreen */ /* visible button fullscreen */
//$('#control_screen_2').show(); //$('#control_screen_2').show();
/* init clear drawing canvas */ /* init clear drawing canvas */
isClearDrawing = false; CONTENTVIEW_GENERAL.isClearDrawing = false;
}; };
saveImg.src = saveImgUrl; saveImg.src = saveImgUrl;
}; };
img.src = imgMarkerTemp; img.src = CONTENTVIEW_GENERAL.imgMarkerTemp;
context_marker.clearRect(0, 0, canvas_marker.width, canvas_marker.height); CONTENTVIEW_GENERAL.context_marker.clearRect(0, 0, CONTENTVIEW_GENERAL.canvas_marker.width, CONTENTVIEW_GENERAL.canvas_marker.height);
$('#marker_canvas').css('display','none'); $('#marker_canvas').css('display','none');
}; };
function dlgMarking_dspCancel_click() { CONTENTVIEW_MARKING.dlgMarking_dspCancel_click = function() {
// Close dialog // Close dialog
$("#dlgMarking").hide(); $("#dlgMarking").hide();
/* init clear drawing canvas */ /* init clear drawing canvas */
isClearDrawing = false; CONTENTVIEW_GENERAL.isClearDrawing = false;
ClientData.IsAddingMarking(false); ClientData.IsAddingMarking(false);
$('#draw_canvas').css('display','none'); $('#draw_canvas').css('display','none');
...@@ -152,109 +139,112 @@ function dlgMarking_dspCancel_click() { ...@@ -152,109 +139,112 @@ function dlgMarking_dspCancel_click() {
$("#imgmarkingtoolbar").removeAttr("style")*/ $("#imgmarkingtoolbar").removeAttr("style")*/
ClientData.IsHideToolbar(false); ClientData.IsHideToolbar(false);
context_draw.clearRect(0, 0, canvas_draw.width, canvas_draw.height); CONTENTVIEW_GENERAL.context_draw.clearRect(0, 0, CONTENTVIEW_GENERAL.canvas_draw.width, CONTENTVIEW_GENERAL.canvas_draw.height);
/* draw again*/ /* draw again*/
//drawCanvas(); //CONTENTVIEW.drawCanvas();
//disableAllControl(); //CONTENTVIEW_GENERAL.disableAllControl();
handleDisplayToolbar(); CONTENTVIEW.handleDisplayToolbar();
/* visible button fullscreen */ /* visible button fullscreen */
//$('#control_screen_2').show(); //$('#control_screen_2').show();
$('#marker_canvas').css('display','none'); $('#marker_canvas').css('display','none');
}; };
function dlgMarking_dspPgClear_click() { CONTENTVIEW_MARKING.dlgMarking_dspPgClear_click = function() {
// Close dialog // Close dialog
context_draw.clearRect(0, 0, canvas_draw.width, canvas_draw.height); CONTENTVIEW_GENERAL.context_draw.clearRect(0, 0, CONTENTVIEW_GENERAL.canvas_draw.width, CONTENTVIEW_GENERAL.canvas_draw.height);
context_marker.clearRect(0, 0, canvas_marker.width, canvas_marker.height); CONTENTVIEW_GENERAL.context_marker.clearRect(0, 0, CONTENTVIEW_GENERAL.canvas_marker.width, CONTENTVIEW_GENERAL.canvas_marker.height);
isClearDrawing = true; CONTENTVIEW_GENERAL.isClearDrawing = true;
/* clear on local */ /* clear on local */
var arr = ClientData.MarkingData(); var arr = ClientData.MarkingData();
}; };
/* draw marker canvas to draw canvas */ /* draw marker canvas to draw canvas */
function canvasMarkerToCanvasDraw(){ CONTENTVIEW_MARKING.canvasMarkerToCanvasDraw = function(){
imgMarkerTemp = canvas_marker.toDataURL("image/png;"); CONTENTVIEW_GENERAL.imgMarkerTemp = CONTENTVIEW_GENERAL.canvas_marker.toDataURL("image/png;");
var img = new Image(); var img = new Image();
img.onload = function () { img.onload = function () {
context_draw.drawImage(img, 0, 0, canvas_draw.width, canvas_draw.height); CONTENTVIEW_GENERAL.context_draw.drawImage(img, 0, 0, CONTENTVIEW_GENERAL.canvas_draw.width, CONTENTVIEW_GENERAL.canvas_draw.height);
}; };
img.src = imgMarkerTemp; img.src = CONTENTVIEW_GENERAL.imgMarkerTemp;
context_marker.clearRect(0, 0, canvas_marker.width, canvas_marker.height); CONTENTVIEW_GENERAL.context_marker.clearRect(0, 0, CONTENTVIEW_GENERAL.canvas_marker.width, CONTENTVIEW_GENERAL.canvas_marker.height);
$('#marker_canvas').css('display','none'); $('#marker_canvas').css('display','none');
}; };
function dlgMarking_imgPen_click() { CONTENTVIEW_MARKING.dlgMarking_imgPen_click = function() {
// Choose pen // Choose pen
$("#dlgMarking_imgMaker").removeClass(); $("#dlgMarking_imgMaker").removeClass();
$("#dlgMarking_imgPen").addClass('toolbar_icon_on'); $("#dlgMarking_imgPen").addClass('toolbar_icon_on');
$("#dlgMarking_imgEraser").removeClass(); $("#dlgMarking_imgEraser").removeClass();
ClientData.MarkingType("pen"); ClientData.MarkingType("pen");
markingType = "pen"; CONTENTVIEW_GENERAL.markingType = "pen";
canvasMarkerToCanvasDraw(); CONTENTVIEW_MARKING.canvasMarkerToCanvasDraw();
setDefaultImageForMarking(); CONTENTVIEW_MARKING.setDefaultImageForMarking();
}; };
function dlgMarking_imgPenOption_click() {
CONTENTVIEW_MARKING.dlgMarking_imgPenOption_click = function() {
/*disable button */ /*disable button */
disableButtonMarking(); CONTENTVIEW_MARKING.disableButtonMarking();
//ClientData.IsAddingMarking(false); //ClientData.IsAddingMarking(false);
/* display dialog overlay */ /* display dialog overlay */
$("#overlay").show(); $("#overlay").show();
isAddingMarking = ClientData.IsAddingMarking(); CONTENTVIEW_GENERAL.isAddingMarking = ClientData.IsAddingMarking();
// Show option of pen // Show option of pen
ShowPen($('#dlgPen')); CONTENTVIEW_PEN.ShowPen($('#dlgPen'));
/* draw maker canvas */ /* draw maker canvas */
if(markingType == "maker"){ if(CONTENTVIEW_GENERAL.markingType == "maker"){
canvasMarkerToCanvasDraw(); CONTENTVIEW_MARKING.canvasMarkerToCanvasDraw();
} }
ClientData.MarkingType("pen"); ClientData.MarkingType("pen");
markingType = "pen"; CONTENTVIEW_GENERAL.markingType = "pen";
$('#dlgMarking_imgPenOption').removeClass(); $('#dlgMarking_imgPenOption').removeClass();
$('#dlgMarking_imgPenOption').addClass('pen_option_selected'); $('#dlgMarking_imgPenOption').addClass('pen_option_selected');
setDefaultImageForMarking(); CONTENTVIEW_MARKING.setDefaultImageForMarking();
}; };
function dlgMarking_imgMaker_click() {
CONTENTVIEW_MARKING.dlgMarking_imgMaker_click = function() {
// Choose maker // Choose maker
$("#dlgMarking_imgMaker").addClass('toolbar_icon_on'); $("#dlgMarking_imgMaker").addClass('toolbar_icon_on');
$("#dlgMarking_imgPen").removeClass(); $("#dlgMarking_imgPen").removeClass();
$("#dlgMarking_imgEraser").removeClass(); $("#dlgMarking_imgEraser").removeClass();
ClientData.MarkingType("maker"); ClientData.MarkingType("maker");
markingType = "maker"; CONTENTVIEW_GENERAL.markingType = "maker";
$('#marker_canvas').css('display','block'); $('#marker_canvas').css('display','block');
setDefaultImageForMarking(); CONTENTVIEW_MARKING.setDefaultImageForMarking();
}; };
function dlgMarking_imgMakerOption_click() {
CONTENTVIEW_MARKING.dlgMarking_imgMakerOption_click = function() {
/*disable button */ /*disable button */
disableButtonMarking(); CONTENTVIEW_MARKING.disableButtonMarking();
//ClientData.IsAddingMarking(false); //ClientData.IsAddingMarking(false);
/* display dialog overlay */ /* display dialog overlay */
$("#overlay").show(); $("#overlay").show();
isAddingMarking = ClientData.IsAddingMarking(); CONTENTVIEW_GENERAL.isAddingMarking = ClientData.IsAddingMarking();
// Show option of maker // Show option of maker
ShowMaker($('#dlgMaker')); CONTENTVIEW_MAKER.ShowMaker($('#dlgMaker'));
ClientData.MarkingType("maker"); ClientData.MarkingType("maker");
markingType = "maker"; CONTENTVIEW_GENERAL.markingType = "maker";
$('#marker_canvas').css('display','block'); $('#marker_canvas').css('display','block');
$('#dlgMarking_imgMakerOption').removeClass(); $('#dlgMarking_imgMakerOption').removeClass();
...@@ -262,44 +252,46 @@ function dlgMarking_imgMakerOption_click() { ...@@ -262,44 +252,46 @@ function dlgMarking_imgMakerOption_click() {
setDefaultImageForMarking(); setDefaultImageForMarking();
}; };
function dlgMarking_imgEraser_click() {
CONTENTVIEW_MARKING.dlgMarking_imgEraser_click = function() {
// Choose eraser // Choose eraser
$("#dlgMarking_imgMaker").removeClass(); $("#dlgMarking_imgMaker").removeClass();
$("#dlgMarking_imgPen").removeClass(); $("#dlgMarking_imgPen").removeClass();
$("#dlgMarking_imgEraser").addClass('toolbar_icon_on'); $("#dlgMarking_imgEraser").addClass('toolbar_icon_on');
ClientData.MarkingType("eraser"); ClientData.MarkingType("eraser");
markingType = "eraser"; CONTENTVIEW_GENERAL.markingType = "eraser";
canvasMarkerToCanvasDraw(); CONTENTVIEW_MARKING.canvasMarkerToCanvasDraw();
setDefaultImageForMarking(); CONTENTVIEW_MARKING.setDefaultImageForMarking();
}; };
function dlgMarking_imgEraserOption_click() {
CONTENTVIEW_MARKING.dlgMarking_imgEraserOption_click = function() {
/*disable button */ /*disable button */
disableButtonMarking(); CONTENTVIEW_MARKING.disableButtonMarking();
//ClientData.IsAddingMarking(false); //ClientData.IsAddingMarking(false);
/* display dialog overlay */ /* display dialog overlay */
$("#overlay").show(); $("#overlay").show();
isAddingMarking = ClientData.IsAddingMarking(); CONTENTVIEW_GENERAL.isAddingMarking = ClientData.IsAddingMarking();
// Show option of maker // Show option of maker
ShowEraser(); CONTENTVIEW_GOMU.ShowEraser();
/* draw maker canvas */ /* draw maker canvas */
if(markingType == "maker"){ if(CONTENTVIEW_GENERAL.markingType == "maker"){
canvasMarkerToCanvasDraw(); CONTENTVIEW_MARKING.canvasMarkerToCanvasDraw();
} }
ClientData.MarkingType("eraser"); ClientData.MarkingType("eraser");
markingType = "eraser"; CONTENTVIEW_GENERAL.markingType = "eraser";
$('#dlgMarking_imgEraserOption').removeClass(); $('#dlgMarking_imgEraserOption').removeClass();
$('#dlgMarking_imgEraserOption').addClass('eraser_option_selected'); $('#dlgMarking_imgEraserOption').addClass('eraser_option_selected');
setDefaultImageForMarking(); CONTENTVIEW_MARKING.setDefaultImageForMarking();
}; };
function dlgMarking_imgMin_click() { CONTENTVIEW_MARKING.dlgMarking_imgMin_click = function() {
//$("#dlgMarking_body").slideToggle('fast'); //$("#dlgMarking_body").slideToggle('fast');
$("#dlgMarking_imgMin").hide(); $("#dlgMarking_imgMin").hide();
$("#dlgMarking_imgMax").show(); $("#dlgMarking_imgMax").show();
...@@ -308,7 +300,8 @@ function dlgMarking_imgMin_click() { ...@@ -308,7 +300,8 @@ function dlgMarking_imgMin_click() {
//$('#dlgMarking').dialog({ height: 80}); //$('#dlgMarking').dialog({ height: 80});
//$('#dlgMarking').css('height', '29px'); //$('#dlgMarking').css('height', '29px');
}; };
function dlgMarking_imgMax_click() {
CONTENTVIEW_MARKING.dlgMarking_imgMax_click = function() {
//$("#dlgMarking_imgMin").slideToggle('fast'); //$("#dlgMarking_imgMin").slideToggle('fast');
$("#dlgMarking_imgMax").hide(); $("#dlgMarking_imgMax").hide();
$("#dlgMarking_imgMin").show(); $("#dlgMarking_imgMin").show();
...@@ -317,10 +310,11 @@ function dlgMarking_imgMax_click() { ...@@ -317,10 +310,11 @@ function dlgMarking_imgMax_click() {
//$('#dlgMarking').dialog({height: 350}); //$('#dlgMarking').dialog({height: 350});
//$('#dlgMarking').css('height', '300px'); //$('#dlgMarking').css('height', '300px');
}; };
function dlgMarking_imgClose_click() {
CONTENTVIEW_MARKING.dlgMarking_imgClose_click = function() {
$("#dlgMarking").hide(); $("#dlgMarking").hide();
ClientData.IsHideToolbar(true); ClientData.IsHideToolbar(true);
disableAllControl(); CONTENTVIEW_GENERAL.disableAllControl();
}; };
/* /*
...@@ -329,9 +323,9 @@ Event groups [ end ] ...@@ -329,9 +323,9 @@ Event groups [ end ]
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
*/ */
function setDefaultImageForMarking(){ CONTENTVIEW_MARKING.setDefaultImageForMarking = function(){
/* pen */ /* pen */
if(markingType == "pen"){ if(CONTENTVIEW_GENERAL.markingType == "pen"){
$('#dlgMarking_imgPen').removeClass(); $('#dlgMarking_imgPen').removeClass();
$('#dlgMarking_imgPen').addClass('pen_selected'); $('#dlgMarking_imgPen').addClass('pen_selected');
...@@ -341,7 +335,7 @@ function setDefaultImageForMarking(){ ...@@ -341,7 +335,7 @@ function setDefaultImageForMarking(){
} }
/* maker */ /* maker */
if(markingType == "maker"){ if(CONTENTVIEW_GENERAL.markingType == "maker"){
$('#dlgMarking_imgMaker').removeClass(); $('#dlgMarking_imgMaker').removeClass();
$('#dlgMarking_imgMaker').addClass('maker_selected'); $('#dlgMarking_imgMaker').addClass('maker_selected');
...@@ -351,7 +345,7 @@ function setDefaultImageForMarking(){ ...@@ -351,7 +345,7 @@ function setDefaultImageForMarking(){
} }
/* maker */ /* maker */
if(markingType == "eraser"){ if(CONTENTVIEW_GENERAL.markingType == "eraser"){
$('#dlgMarking_imgEraser').removeClass(); $('#dlgMarking_imgEraser').removeClass();
$('#dlgMarking_imgEraser').addClass('eraser_selected'); $('#dlgMarking_imgEraser').addClass('eraser_selected');
...@@ -362,7 +356,7 @@ function setDefaultImageForMarking(){ ...@@ -362,7 +356,7 @@ function setDefaultImageForMarking(){
}; };
/* disable all button on dialog marking */ /* disable all button on dialog marking */
function disableButtonMarking(){ CONTENTVIEW_MARKING.disableButtonMarking = function(){
$('#dlgMarking_dspSave').unbind('click'); $('#dlgMarking_dspSave').unbind('click');
$('#dlgMarking_dspCancel').unbind('click'); $('#dlgMarking_dspCancel').unbind('click');
$('#dlgMarking_dspPgClear').unbind('click'); $('#dlgMarking_dspPgClear').unbind('click');
...@@ -394,20 +388,20 @@ function disableButtonMarking(){ ...@@ -394,20 +388,20 @@ function disableButtonMarking(){
}; };
/* enable all button con dialog marking */ /* enable all button con dialog marking */
function enableButtonMarking(){ CONTENTVIEW_MARKING.enableButtonMarking = function(){
disableButtonMarking(); CONTENTVIEW_MARKING.disableButtonMarking();
$('#dlgMarking_dspSave').bind('click',dlgMarking_dspSave_click); $('#dlgMarking_dspSave').bind('click',CONTENTVIEW_MARKING.dlgMarking_dspSave_click);
$('#dlgMarking_dspCancel').bind('click',dlgMarking_dspCancel_click); $('#dlgMarking_dspCancel').bind('click',CONTENTVIEW_MARKING.dlgMarking_dspCancel_click);
$('#dlgMarking_dspPgClear').bind('click',dlgMarking_dspPgClear_click); $('#dlgMarking_dspPgClear').bind('click',CONTENTVIEW_MARKING.dlgMarking_dspPgClear_click);
$('#dlgMarking_imgMin').bind('click',dlgMarking_imgMin_click); $('#dlgMarking_imgMin').bind('click',CONTENTVIEW_MARKING.dlgMarking_imgMin_click);
$('#dlgMarking_imgMax').bind('click',dlgMarking_imgMax_click); $('#dlgMarking_imgMax').bind('click',CONTENTVIEW_MARKING.dlgMarking_imgMax_click);
$('#dlgMarking_imgClose').bind('click',dlgMarking_imgClose_click); $('#dlgMarking_imgClose').bind('click',CONTENTVIEW_MARKING.dlgMarking_imgClose_click);
$('#dlgMarking_imgPen').bind('click',dlgMarking_imgPen_click); $('#dlgMarking_imgPen').bind('click',CONTENTVIEW_MARKING.dlgMarking_imgPen_click);
$('#dlgMarking_imgPenOption').bind('click',dlgMarking_imgPenOption_click); $('#dlgMarking_imgPenOption').bind('click',CONTENTVIEW_MARKING.dlgMarking_imgPenOption_click);
$('#dlgMarking_imgMaker').bind('click',dlgMarking_imgMaker_click); $('#dlgMarking_imgMaker').bind('click',CONTENTVIEW_MARKING.dlgMarking_imgMaker_click);
$('#dlgMarking_imgMakerOption').bind('click',dlgMarking_imgMakerOption_click); $('#dlgMarking_imgMakerOption').bind('click',CONTENTVIEW_MARKING.dlgMarking_imgMakerOption_click);
$('#dlgMarking_imgEraser').bind('click',dlgMarking_imgEraser_click); $('#dlgMarking_imgEraser').bind('click',CONTENTVIEW_MARKING.dlgMarking_imgEraser_click);
$('#dlgMarking_imgEraserOption').bind('click',dlgMarking_imgEraserOption_click); $('#dlgMarking_imgEraserOption').bind('click',CONTENTVIEW_MARKING.dlgMarking_imgEraserOption_click);
/* set cursor pointer*/ /* set cursor pointer*/
$("#dlgMarking_dspSave").css('cursor', 'pointer'); $("#dlgMarking_dspSave").css('cursor', 'pointer');
...@@ -424,7 +418,7 @@ function enableButtonMarking(){ ...@@ -424,7 +418,7 @@ function enableButtonMarking(){
$("#dlgMarking_imgEraserOption").css('cursor', 'pointer'); $("#dlgMarking_imgEraserOption").css('cursor', 'pointer');
}; };
function ShowMarking() { CONTENTVIEW_MARKING.ShowMarking = function() {
//$("#dlgMarking_body").show(); //$("#dlgMarking_body").show();
//$("#dlgMarking_body").addClass('markingBoxBody_on'); //$("#dlgMarking_body").addClass('markingBoxBody_on');
//$("#dlgMarking_body").removeClass('markingBoxBody_on'); //$("#dlgMarking_body").removeClass('markingBoxBody_on');
...@@ -444,13 +438,13 @@ function ShowMarking() { ...@@ -444,13 +438,13 @@ function ShowMarking() {
// $('#dlgMarking').bottom(); // $('#dlgMarking').bottom();
//$(".ui-dialog-titlebar").hide(); //$(".ui-dialog-titlebar").hide();
Marking_SetDefaultValue(); CONTENTVIEW_MARKING.Marking_SetDefaultValue();
//$("#dlgMarking_imgMin").show(); //$("#dlgMarking_imgMin").show();
// $("#dlgMarking_imgMax").hide(); // $("#dlgMarking_imgMax").hide();
dlgMarking_imgPen_click(); CONTENTVIEW_MARKING.dlgMarking_imgPen_click();
setDefaultImageForMarking(); CONTENTVIEW_MARKING.setDefaultImageForMarking();
$('#dlgMarking_imgPenOption').removeClass(); $('#dlgMarking_imgPenOption').removeClass();
$('#dlgMarking_imgPenOption').addClass('pen_option_hover'); $('#dlgMarking_imgPenOption').addClass('pen_option_hover');
...@@ -465,20 +459,20 @@ function ShowMarking() { ...@@ -465,20 +459,20 @@ function ShowMarking() {
// Setting dialog // Setting dialog
$(function () { $(function () {
$("#dlgMarking_dspSave").click(dlgMarking_dspSave_click); $("#dlgMarking_dspSave").click(CONTENTVIEW_MARKING.dlgMarking_dspSave_click);
$("#dlgMarking_dspCancel").click(dlgMarking_dspCancel_click); $("#dlgMarking_dspCancel").click(CONTENTVIEW_MARKING.dlgMarking_dspCancel_click);
$("#dlgMarking_dspPgClear").click(dlgMarking_dspPgClear_click); $("#dlgMarking_dspPgClear").click(CONTENTVIEW_MARKING.dlgMarking_dspPgClear_click);
// Icons // Icons
$("#dlgMarking_imgMin").click(dlgMarking_imgMin_click); $("#dlgMarking_imgMin").click(CONTENTVIEW_MARKING.dlgMarking_imgMin_click);
$("#dlgMarking_imgMax").click(dlgMarking_imgMax_click); $("#dlgMarking_imgMax").click(CONTENTVIEW_MARKING.dlgMarking_imgMax_click);
$("#dlgMarking_imgClose").click(dlgMarking_imgClose_click); $("#dlgMarking_imgClose").click(CONTENTVIEW_MARKING.dlgMarking_imgClose_click);
$("#dlgMarking_imgPen").click(dlgMarking_imgPen_click); $("#dlgMarking_imgPen").click(CONTENTVIEW_MARKING.dlgMarking_imgPen_click);
$("#dlgMarking_imgPenOption").click(dlgMarking_imgPenOption_click); $("#dlgMarking_imgPenOption").click(CONTENTVIEW_MARKING.dlgMarking_imgPenOption_click);
$("#dlgMarking_imgMaker").click(dlgMarking_imgMaker_click); $("#dlgMarking_imgMaker").click(CONTENTVIEW_MARKING.dlgMarking_imgMaker_click);
$("#dlgMarking_imgMakerOption").click(dlgMarking_imgMakerOption_click); $("#dlgMarking_imgMakerOption").click(CONTENTVIEW_MARKING.dlgMarking_imgMakerOption_click);
$("#dlgMarking_imgEraser").click(dlgMarking_imgEraser_click); $("#dlgMarking_imgEraser").click(CONTENTVIEW_MARKING.dlgMarking_imgEraser_click);
$("#dlgMarking_imgEraserOption").click(dlgMarking_imgEraserOption_click); $("#dlgMarking_imgEraserOption").click(CONTENTVIEW_MARKING.dlgMarking_imgEraserOption_click);
/* /*
$('#dlgMarking').dialog({ $('#dlgMarking').dialog({
autoOpen: false, autoOpen: false,
......
var targetDiv;
var targetX;
var targetY;
var targetMemoId;
var EditIndex;
var saveMode;
var memoCallbackFunc;
var conid;
var pageid;
function createMemoDialog(){ //名前空間用のオブジェクトを用意する
targetDiv.show(); var CONTENTVIEW_MEMO = {};
targetDiv.html('');
targetDiv.append( CONTENTVIEW_MEMO.targetDiv;
CONTENTVIEW_MEMO.targetX;
CONTENTVIEW_MEMO.targetY;
//CONTENTVIEW_MEMO.targetMemoId;
CONTENTVIEW_MEMO.EditIndex;
CONTENTVIEW_MEMO.saveMode;
CONTENTVIEW_MEMO.memoCallbackFunc;
CONTENTVIEW_MEMO.conid;
CONTENTVIEW_MEMO.pageid;
CONTENTVIEW_MEMO.createMemoDialog = function(){
CONTENTVIEW_MEMO.targetDiv.show();
CONTENTVIEW_MEMO.targetDiv.html('');
CONTENTVIEW_MEMO.targetDiv.append(
'<aside id="memoWrapper" class="MemoIndexBox">' '<aside id="memoWrapper" class="MemoIndexBox">'
+ ' <h1 class="indexBoxHd">' + I18N.i18nText('txtMemo') + ' <h1 class="indexBoxHd">' + I18N.i18nText('txtMemo')
+' <a class="delete"></a>' +' <a class="delete"></a>'
...@@ -28,35 +32,35 @@ function createMemoDialog(){ ...@@ -28,35 +32,35 @@ function createMemoDialog(){
$('#txaMemoContent').focus(); $('#txaMemoContent').focus();
handleMemoEventFunction(); CONTENTVIEW_MEMO.handleMemoEventFunction();
}; };
function handleMemoEventFunction(){ CONTENTVIEW_MEMO.handleMemoEventFunction = function(){
$('#Memo_btnSave').click(buttonSaveFunction); $('#Memo_btnSave').click(CONTENTVIEW_MEMO.buttonSaveFunction);
$('#Memo_btnDel').click(MemoDelFunction); $('#Memo_btnDel').click(CONTENTVIEW_MEMO.MemoDelFunction);
$('#Memo_btnCancel').click(MemoCancelFunction); $('#Memo_btnCancel').click(CONTENTVIEW_MEMO.MemoCancelFunction);
$('.delete').click(MemoCancelFunction); $('.delete').click(CONTENTVIEW_MEMO.MemoCancelFunction);
}; };
function memoSaveFunction(){ CONTENTVIEW_MEMO.memoSaveFunction = function(){
var tempArr = []; var tempArr = [];
var memoObj = new MemoEntity(); var memoObj = new MemoEntity();
memoObj.pageNo = pageid; memoObj.pageNo = CONTENTVIEW_MEMO.pageid;
memoObj.contentid = conid; memoObj.contentid = CONTENTVIEW_MEMO.conid;
memoObj.Text = $('#txaMemoContent').val(); memoObj.Text = $('#txaMemoContent').val();
var imagePt = screenToImage(targetX, targetY); var imagePt = CONTENTVIEW.screenToImage(CONTENTVIEW_MEMO.targetX, CONTENTVIEW_MEMO.targetY);
//#11478 逆に縮める対応 //#11478 逆に縮める対応
var canvasWidth = $('#offscreen').width(); var canvasWidth = $('#offscreen').width();
var canvasHeight = $('#offscreen').height(); var canvasHeight = $('#offscreen').height();
//var tempRatioWidth = canvasWidth / widthEachPageApi; //var tempRatioWidth = canvasWidth / CONTENTVIEW_GENERAL.widthEachPageApi;
var tempRatioWidth = widthEachPageApi / canvasWidth; var tempRatioWidth = CONTENTVIEW_GENERAL.widthEachPageApi / canvasWidth;
if( tempRatioWidth > 1 ){ if( tempRatioWidth > 1 ){
tempRatioWidth = 1; tempRatioWidth = 1;
} }
var tempRatioHeight = heightEachPageApi / canvasHeight; var tempRatioHeight = CONTENTVIEW_GENERAL.heightEachPageApi / canvasHeight;
if( tempRatioHeight > 1 ){ if( tempRatioHeight > 1 ){
tempRatioHeight = 1; tempRatioHeight = 1;
} }
...@@ -73,58 +77,58 @@ function memoSaveFunction(){ ...@@ -73,58 +77,58 @@ function memoSaveFunction(){
tempArr.push(memoObj); tempArr.push(memoObj);
ClientData.MemoData(tempArr); ClientData.MemoData(tempArr);
if(memoCallbackFunc){ if(CONTENTVIEW_MEMO.memoCallbackFunc){
memoCallbackFunc(); CONTENTVIEW_MEMO.memoCallbackFunc();
} }
}; };
function MemoDelFunction(){ CONTENTVIEW_MEMO.MemoDelFunction = function(){
if(saveMode == 'Copy'){ if(CONTENTVIEW_MEMO.saveMode == 'Copy'){
//targetDiv.dialog('close'); //CONTENTVIEW_MEMO.targetDiv.dialog('close');
targetDiv.fadeOut('medium', function(){ CONTENTVIEW_MEMO.targetDiv.fadeOut('medium', function(){
}); });
isCopyMemo = false; CONTENTVIEW_GENERAL.isCopyMemo = false;
} }
else{ else{
var resultArr = ClientData.MemoData(); var resultArr = ClientData.MemoData();
resultArr.splice(EditIndex, 1); resultArr.splice(CONTENTVIEW_MEMO.EditIndex, 1);
ClientData.MemoData(resultArr); ClientData.MemoData(resultArr);
//targetDiv.dialog('close'); //CONTENTVIEW_MEMO.targetDiv.dialog('close');
if(memoCallbackFunc){ if(CONTENTVIEW_MEMO.memoCallbackFunc){
memoCallbackFunc(); CONTENTVIEW_MEMO.memoCallbackFunc();
} }
} }
$("#overlay").hide(); $("#overlay").hide();
targetDiv.children().remove(); CONTENTVIEW_MEMO.targetDiv.children().remove();
targetDiv.hide(); CONTENTVIEW_MEMO.targetDiv.hide();
$("#pop_up_memo").hide(); $("#pop_up_memo").hide();
/* draw again */ /* draw again */
drawCanvas(); CONTENTVIEW.drawCanvas();
//START TRB00054 - EDITOR : Long - Date : 09/19/2013 - Summary : Fix for remove loading icon when del memo //START TRB00054 - EDITOR : Long - Date : 09/19/2013 - Summary : Fix for remove loading icon when del memo
drawCanvas(1); CONTENTVIEW.drawCanvas(1);
//END TRB00054 - EDITOR : Long - Date : 09/19/2013 - Summary : Fix for remove loading icon when del memo //END TRB00054 - EDITOR : Long - Date : 09/19/2013 - Summary : Fix for remove loading icon when del memo
/* enable controls after finish copy */ /* enable controls after finish copy */
enableControlsCopyMemo(); CONTENTVIEW.enableControlsCopyMemo();
}; };
function MemoCancelFunction(){ CONTENTVIEW_MEMO.MemoCancelFunction = function(){
//targetDiv.dialog('close'); //CONTENTVIEW_MEMO.targetDiv.dialog('close');
$("#overlay").hide(); $("#overlay").hide();
targetDiv.children().remove(); CONTENTVIEW_MEMO.targetDiv.children().remove();
targetDiv.hide(); CONTENTVIEW_MEMO.targetDiv.hide();
isCopyMemo = false; CONTENTVIEW_GENERAL.isCopyMemo = false;
$("#pop_up_memo").hide(); $("#pop_up_memo").hide();
/* enable controls after finish copy */ /* enable controls after finish copy */
enableControlsCopyMemo(); CONTENTVIEW.enableControlsCopyMemo();
if(ClientData.IsAddingMemo() == true){ if(ClientData.IsAddingMemo() == true){
ClientData.IsAddingMemo(false); ClientData.IsAddingMemo(false);
...@@ -135,113 +139,113 @@ function MemoCancelFunction(){ ...@@ -135,113 +139,113 @@ function MemoCancelFunction(){
} }
}; };
function AddMemo(contentId,pageNo,targetId, posX, posY, callback) { CONTENTVIEW_MEMO.AddMemo = function(contentId,pageNo,targetId, posX, posY, callback) {
conid = contentId; CONTENTVIEW_MEMO.conid = contentId;
pageid = pageNo; CONTENTVIEW_MEMO.pageid = pageNo;
targetDiv = targetId; CONTENTVIEW_MEMO.targetDiv = targetId;
targetX = posX; CONTENTVIEW_MEMO.targetX = posX;
targetY = posY; CONTENTVIEW_MEMO.targetY = posY;
memoCallbackFunc = callback; CONTENTVIEW_MEMO.memoCallbackFunc = callback;
createMemoDialog(); CONTENTVIEW_MEMO.createMemoDialog();
saveMode = 'New'; CONTENTVIEW_MEMO.saveMode = 'New';
$('#Memo_btnDel').css('display','none'); $('#Memo_btnDel').css('display','none');
//targetDiv.dialog({width: 466, height: 390, modal: true, position: [targetX, targetY], resizable: false}); //CONTENTVIEW_MEMO.targetDiv.dialog({width: 466, height: 390, modal: true, position: [CONTENTVIEW_MEMO.targetX, CONTENTVIEW_MEMO.targetY], resizable: false});
//targetDiv.parent().removeClass('ui-draggable'); //CONTENTVIEW_MEMO.targetDiv.parent().removeClass('ui-draggable');
$("#overlay").show(); $("#overlay").show();
disableControlsCopyMemo(); CONTENTVIEW.disableControlsCopyMemo();
targetDiv.css('z-index','1005'); CONTENTVIEW_MEMO.targetDiv.css('z-index','1005');
//START TRB00097 //START TRB00097
if(targetY >= $('#wrapper').height()/2){ if(CONTENTVIEW_MEMO.targetY >= $('#wrapper').height()/2){
targetDiv.css('top', $('#wrapper').height()/3); CONTENTVIEW_MEMO.targetDiv.css('top', $('#wrapper').height()/3);
targetDiv.css('left',targetX - ($('#memoWrapper').width() /2 )); CONTENTVIEW_MEMO.targetDiv.css('left',CONTENTVIEW_MEMO.targetX - ($('#memoWrapper').width() /2 ));
} }
else{ else{
targetDiv.css('top',targetY); CONTENTVIEW_MEMO.targetDiv.css('top',CONTENTVIEW_MEMO.targetY);
targetDiv.css('left',targetX - ($('#memoWrapper').width() /2 )); CONTENTVIEW_MEMO.targetDiv.css('left',CONTENTVIEW_MEMO.targetX - ($('#memoWrapper').width() /2 ));
} }
//END TRB00097 //END TRB00097
targetDiv.draggable({ handle: "h1" }); CONTENTVIEW_MEMO.targetDiv.draggable({ handle: "h1" });
//editJqueryUIDialog(); //CONTENTVIEW_MEMO.editJqueryUIDialog();
}; };
function EditMemo(index, posXPlus, posYPlus, targetId, callback){ CONTENTVIEW_MEMO.EditMemo = function(index, posXPlus, posYPlus, targetId, callback){
targetDiv = targetId; CONTENTVIEW_MEMO.targetDiv = targetId;
targetX = ClientData.MemoData()[index].posX + posXPlus; CONTENTVIEW_MEMO.targetX = ClientData.MemoData()[index].posX + posXPlus;
targetY = ClientData.MemoData()[index].posY + posYPlus; CONTENTVIEW_MEMO.targetY = ClientData.MemoData()[index].posY + posYPlus;
EditIndex = index; CONTENTVIEW_MEMO.EditIndex = index;
memoCallbackFunc = callback; CONTENTVIEW_MEMO.memoCallbackFunc = callback;
createMemoDialog(); CONTENTVIEW_MEMO.createMemoDialog();
getMemoForEdit(); CONTENTVIEW_MEMO.getMemoForEdit();
saveMode = 'Edit'; CONTENTVIEW_MEMO.saveMode = 'Edit';
$('#Memo_btnDel').css('display','block'); $('#Memo_btnDel').css('display','block');
//targetDiv.dialog({width: 466, height: 390, modal: true, position: [targetX, targetY], resizable: false}); //CONTENTVIEW_MEMO.targetDiv.dialog({width: 466, height: 390, modal: true, position: [CONTENTVIEW_MEMO.targetX, CONTENTVIEW_MEMO.targetY], resizable: false});
//targetDiv.parent().removeClass('ui-draggable'); //CONTENTVIEW_MEMO.targetDiv.parent().removeClass('ui-draggable');
$("#overlay").show(); $("#overlay").show();
disableControlsCopyMemo(); CONTENTVIEW.disableControlsCopyMemo();
targetDiv.css('z-index','1005'); CONTENTVIEW_MEMO.targetDiv.css('z-index','1005');
var pt = imageToScreen(targetX, targetY); var pt = CONTENTVIEW.imageToScreen(CONTENTVIEW_MEMO.targetX, CONTENTVIEW_MEMO.targetY);
//START TRB00097 //START TRB00097
if(pt.y >= $('#wrapper').height()/2){ if(pt.y >= $('#wrapper').height()/2){
targetDiv.css('top', $('#wrapper').height()/3); CONTENTVIEW_MEMO.targetDiv.css('top', $('#wrapper').height()/3);
targetDiv.css('left',pt.x - ($('#memoWrapper').width() /2 )); CONTENTVIEW_MEMO.targetDiv.css('left',pt.x - ($('#memoWrapper').width() /2 ));
} }
else{ else{
targetDiv.css('top',pt.y); CONTENTVIEW_MEMO.targetDiv.css('top',pt.y);
targetDiv.css('left',pt.x - ($('#memoWrapper').width() /2 )); CONTENTVIEW_MEMO.targetDiv.css('left',pt.x - ($('#memoWrapper').width() /2 ));
} }
//END TRB00097 //END TRB00097
targetDiv.draggable({ handle: "h1" }); CONTENTVIEW_MEMO.targetDiv.draggable({ handle: "h1" });
//editJqueryUIDialog(); //CONTENTVIEW_MEMO.editJqueryUIDialog();
}; };
function CopyMemo(index,contentId,pageNo,targetId, posX, posY, callback){ CONTENTVIEW_MEMO.CopyMemo = function(index,contentId,pageNo,targetId, posX, posY, callback){
conid = contentId; CONTENTVIEW_MEMO.conid = contentId;
pageid = pageNo; CONTENTVIEW_MEMO.pageid = pageNo;
targetDiv = targetId; CONTENTVIEW_MEMO.targetDiv = targetId;
targetX = posX; CONTENTVIEW_MEMO.targetX = posX;
targetY = posY; CONTENTVIEW_MEMO.targetY = posY;
EditIndex = index; CONTENTVIEW_MEMO.EditIndex = index;
memoCallbackFunc = callback; CONTENTVIEW_MEMO.memoCallbackFunc = callback;
createMemoDialog(); CONTENTVIEW_MEMO.createMemoDialog();
//getMemoForEdit(); //CONTENTVIEW_MEMO.getMemoForEdit();
$('#txaMemoContent').val(index); $('#txaMemoContent').val(index);
saveMode = 'Copy'; CONTENTVIEW_MEMO.saveMode = 'Copy';
$('#Memo_btnDel').css('display','none'); $('#Memo_btnDel').css('display','none');
//targetDiv.dialog({width: 466, height: 390, modal: true, position: [targetX, targetY], resizable: false}); //CONTENTVIEW_MEMO.targetDiv.dialog({width: 466, height: 390, modal: true, position: [CONTENTVIEW_MEMO.targetX, CONTENTVIEW_MEMO.targetY], resizable: false});
//targetDiv.parent().removeClass('ui-draggable'); //CONTENTVIEW_MEMO.targetDiv.parent().removeClass('ui-draggable');
$("#overlay").show(); $("#overlay").show();
disableControlsCopyMemo(); CONTENTVIEW.disableControlsCopyMemo();
targetDiv.css('z-index','1005'); CONTENTVIEW_MEMO.targetDiv.css('z-index','1005');
targetDiv.css('top',targetY); CONTENTVIEW_MEMO.targetDiv.css('top',CONTENTVIEW_MEMO.targetY);
targetDiv.css('left',targetX - ($('#memoWrapper').width() /2 )); CONTENTVIEW_MEMO.targetDiv.css('left',CONTENTVIEW_MEMO.targetX - ($('#memoWrapper').width() /2 ));
targetDiv.draggable({ handle: "h1" }); CONTENTVIEW_MEMO.targetDiv.draggable({ handle: "h1" });
//editJqueryUIDialog(); //CONTENTVIEW_MEMO.editJqueryUIDialog();
}; };
function getMemoForEdit(){ CONTENTVIEW_MEMO.getMemoForEdit = function(){
var arrTemp = ClientData.MemoData(); var arrTemp = ClientData.MemoData();
var tempEntity = arrTemp[EditIndex]; var tempEntity = arrTemp[CONTENTVIEW_MEMO.EditIndex];
$('#txaMemoContent').val(tempEntity.Text); $('#txaMemoContent').val(tempEntity.Text);
}; };
function editMemoFunction(){ CONTENTVIEW_MEMO.editMemoFunction = function(){
var arrTemp = ClientData.MemoData(); var arrTemp = ClientData.MemoData();
var tempEntity = arrTemp[EditIndex]; var tempEntity = arrTemp[CONTENTVIEW_MEMO.EditIndex];
var editContent = $('#txaMemoContent').val(); var editContent = $('#txaMemoContent').val();
...@@ -249,41 +253,43 @@ function editMemoFunction(){ ...@@ -249,41 +253,43 @@ function editMemoFunction(){
//=== Start Function : No.17 Editor : Long Date: 07/30/2013 Summary : Set UTC time when edit memo. //=== Start Function : No.17 Editor : Long Date: 07/30/2013 Summary : Set UTC time when edit memo.
tempEntity.registerDate = new Date(); tempEntity.registerDate = new Date();
//=== End Function : No.17 Editor : Long Date: 07/30/2013 Summary : Set UTC time when edit memo. //=== End Function : No.17 Editor : Long Date: 07/30/2013 Summary : Set UTC time when edit memo.
arrTemp[EditIndex] = tempEntity; arrTemp[CONTENTVIEW_MEMO.EditIndex] = tempEntity;
ClientData.MemoData(arrTemp); ClientData.MemoData(arrTemp);
if(memoCallbackFunc){ if(CONTENTVIEW_MEMO.memoCallbackFunc){
memoCallbackFunc(); CONTENTVIEW_MEMO.memoCallbackFunc();
} }
/*refresh memo*/ /*refresh memo*/
//drawCanvas(); //CONTENTVIEW.drawCanvas();
}; };
function buttonSaveFunction(){ CONTENTVIEW_MEMO.buttonSaveFunction = function(){
if(saveMode == 'Edit'){ if(CONTENTVIEW_MEMO.saveMode == 'Edit'){
editMemoFunction(); CONTENTVIEW_MEMO.editMemoFunction();
} }
else if(saveMode == 'New'){ else if(CONTENTVIEW_MEMO.saveMode == 'New'){
memoSaveFunction(); CONTENTVIEW_MEMO.memoSaveFunction();
}else if(saveMode == 'Copy'){ }else if(CONTENTVIEW_MEMO.saveMode == 'Copy'){
memoSaveFunction(); CONTENTVIEW_MEMO.memoSaveFunction();
} }
//targetDiv.dialog('close'); //CONTENTVIEW_MEMO.targetDiv.dialog('close');
$("#overlay").hide(); $("#overlay").hide();
targetDiv.children().remove(); CONTENTVIEW_MEMO.targetDiv.children().remove();
targetDiv.hide(); CONTENTVIEW_MEMO.targetDiv.hide();
isCopyMemo = false; CONTENTVIEW_GENERAL.isCopyMemo = false;
$("#pop_up_memo").hide(); $("#pop_up_memo").hide();
/* enable controls after finish copy */ /* enable controls after finish copy */
enableControlsCopyMemo(); CONTENTVIEW.enableControlsCopyMemo();
}; };
function editJqueryUIDialog(){ //未使用
CONTENTVIEW_MEMO.editJqueryUIDialog = function(){
$('.ui-dialog-titlebar').hide(); $('.ui-dialog-titlebar').hide();
targetDiv.addClass('memoDialogImportantCss'); CONTENTVIEW_MEMO.targetDiv.addClass('memoDialogImportantCss');
targetDiv.parent().addClass('parentMemoDialogImportantCss'); CONTENTVIEW_MEMO.targetDiv.parent().addClass('parentMemoDialogImportantCss');
}; };
/// コンテンツ閲覧画面_消しゴム書式オーバーレイ /// コンテンツ閲覧画面_消しゴム書式オーバーレイ
/// <reference path="../common/js/avweb.js" />
/// <reference path="../common/js/screenLock.js" /> //名前空間用のオブジェクトを用意する
var CONTENTVIEW_PAINT = {};
/// <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" />
//未使用
// works out the X, Y position of the click inside the canvas from the X, Y position on the page // works out the X, Y position of the click inside the canvas from the X, Y position on the page
function getPosition(mouseEvent, sigCanvas) { CONTENTVIEW_PAINT.getPosition = function(mouseEvent, sigCanvas) {
var x, y; var x, y;
if (mouseEvent.pageX != undefined && mouseEvent.pageY != undefined) { if (mouseEvent.pageX != undefined && mouseEvent.pageY != undefined) {
x = mouseEvent.pageX; x = mouseEvent.pageX;
...@@ -30,7 +19,7 @@ function getPosition(mouseEvent, sigCanvas) { ...@@ -30,7 +19,7 @@ function getPosition(mouseEvent, sigCanvas) {
}; };
function initializeCanvas(targetCanvas) { CONTENTVIEW_PAINT.initializeCanvas = function(targetCanvas) {
// get references to the canvas element as well as the 2D drawing context // get references to the canvas element as well as the 2D drawing context
var sigCanvas = targetCanvas; var sigCanvas = targetCanvas;
var context = sigCanvas.getContext("2d"); var context = sigCanvas.getContext("2d");
...@@ -42,7 +31,7 @@ function initializeCanvas(targetCanvas) { ...@@ -42,7 +31,7 @@ function initializeCanvas(targetCanvas) {
if (is_touch_device) { if (is_touch_device) {
// create a drawer which tracks touch movements // create a drawer which tracks touch movements
var drawer = { var drawer = {
isDrawing: false, isDrawing: false,
// touchstart: function (coors) { // touchstart: function (coors) {
// context.beginPath(); // context.beginPath();
// context.moveTo(coors.x, coors.y); // context.moveTo(coors.x, coors.y);
...@@ -64,11 +53,11 @@ function initializeCanvas(targetCanvas) { ...@@ -64,11 +53,11 @@ function initializeCanvas(targetCanvas) {
context.beginPath(); context.beginPath();
context.moveTo(coors.x, coors.y); context.moveTo(coors.x, coors.y);
this.isDrawing = true; this.isDrawing = true;
drawPoint(coors, context); CONTENTVIEW_PAINT.drawPoint(coors, context);
}, },
touchmove: function (coors) { touchmove: function (coors) {
if (this.isDrawing) { if (this.isDrawing) {
drawMove(coors, context); CONTENTVIEW_PAINT.drawMove(coors, context);
} }
}, },
touchend: function (coors) { touchend: function (coors) {
...@@ -125,30 +114,31 @@ function initializeCanvas(targetCanvas) { ...@@ -125,30 +114,31 @@ function initializeCanvas(targetCanvas) {
} }
}; };
function drawMove(coors, context_draw) {
if (isAddingMarking == true) { CONTENTVIEW_PAINT.drawMove = function(coors, context_draw) {
if (CONTENTVIEW_GENERAL.isAddingMarking == true) {
if (markingType == 'eraser') { if (CONTENTVIEW_GENERAL.markingType == 'eraser') {
//context.clearRect(coors.x, coors.y, ClientData.erase_size(), ClientData.erase_size()); //context.clearRect(coors.x, coors.y, ClientData.erase_size(), ClientData.erase_size());
context_draw.globalCompositeOperation = 'destination-out'; context_draw.globalCompositeOperation = 'destination-out';
context_draw.lineWidth = eraseSize; context_draw.lineWidth = CONTENTVIEW_GENERAL.eraseSize;
context_draw.lineJoin = 'round'; context_draw.lineJoin = 'round';
context_draw.lineCap = 'round'; context_draw.lineCap = 'round';
context_draw.lineTo(sx, sy); context_draw.lineTo(CONTENTVIEW_GENERAL.sx, CONTENTVIEW_GENERAL.sy);
context_draw.stroke(); context_draw.stroke();
context_draw.globalCompositeOperation = 'source-over'; context_draw.globalCompositeOperation = 'source-over';
} }
else if (markingType == 'pen') { else if (CONTENTVIEW_GENERAL.markingType == 'pen') {
context_draw.lineCap = "round"; context_draw.lineCap = "round";
context_draw.lineJoin = "bevel"; context_draw.lineJoin = "bevel";
context_draw.lineWidth = penSize; context_draw.lineWidth = CONTENTVIEW_GENERAL.penSize;
context_draw.strokeStyle = "#" + penColor; context_draw.strokeStyle = "#" + CONTENTVIEW_GENERAL.penColor;
//context_draw.globalAlpha = 1; //context_draw.globalAlpha = 1;
context_draw.lineTo(coors.x, coors.y); context_draw.lineTo(coors.x, coors.y);
context_draw.stroke(); context_draw.stroke();
} }
else if (markingType == 'maker') { else if (CONTENTVIEW_GENERAL.markingType == 'maker') {
/*context_draw.clearRect(coors.x , coors.y,makerSize, coors.y - sy);*/ /*context_draw.clearRect(coors.x , coors.y,makerSize, coors.y - sy);*/
/*context_draw.globalCompositeOperation = 'destination-out'; /*context_draw.globalCompositeOperation = 'destination-out';
context_draw.lineWidth = makerSize/10; context_draw.lineWidth = makerSize/10;
...@@ -161,14 +151,14 @@ function drawMove(coors, context_draw) { ...@@ -161,14 +151,14 @@ function drawMove(coors, context_draw) {
//context_draw.globalCompositeOperation = 'destination-out' //context_draw.globalCompositeOperation = 'destination-out'
context_draw.beginPath(); context_draw.beginPath();
var halfSize = makerSize / 2; var halfSize = CONTENTVIEW_GENERAL.makerSize / 2;
var quotSize = makerSize / 4; var quotSize = CONTENTVIEW_GENERAL.makerSize / 4;
var ptStart = [ var ptStart = [
{ x: sx - quotSize, y: sy - halfSize }, { x: CONTENTVIEW_GENERAL.sx - quotSize, y: CONTENTVIEW_GENERAL.sy - halfSize },
{ x: sx + quotSize, y: sy - halfSize }, { x: CONTENTVIEW_GENERAL.sx + quotSize, y: CONTENTVIEW_GENERAL.sy - halfSize },
{ x: sx + quotSize, y: sy + halfSize }, { x: CONTENTVIEW_GENERAL.sx + quotSize, y: CONTENTVIEW_GENERAL.sy + halfSize },
{ x: sx - quotSize, y: sy + halfSize } { x: CONTENTVIEW_GENERAL.sx - quotSize, y: CONTENTVIEW_GENERAL.sy + halfSize }
]; ];
var ptEnd = [ var ptEnd = [
{ x: coors.x - quotSize, y: coors.y - halfSize }, { x: coors.x - quotSize, y: coors.y - halfSize },
...@@ -176,8 +166,8 @@ function drawMove(coors, context_draw) { ...@@ -176,8 +166,8 @@ function drawMove(coors, context_draw) {
{ x: coors.x + quotSize, y: coors.y + halfSize }, { x: coors.x + quotSize, y: coors.y + halfSize },
{ x: coors.x - quotSize, y: coors.y + halfSize } { x: coors.x - quotSize, y: coors.y + halfSize }
]; ];
if (sx > coors.x) { if (CONTENTVIEW_GENERAL.sx > coors.x) {
if (sy > coors.y) { if (CONTENTVIEW_GENERAL.sy > coors.y) {
context_draw.globalCompositeOperation = 'destination-out'; context_draw.globalCompositeOperation = 'destination-out';
context_draw.moveTo(ptStart[1].x, ptStart[1].y); context_draw.moveTo(ptStart[1].x, ptStart[1].y);
context_draw.lineTo(ptStart[2].x, ptStart[2].y); context_draw.lineTo(ptStart[2].x, ptStart[2].y);
...@@ -187,7 +177,7 @@ function drawMove(coors, context_draw) { ...@@ -187,7 +177,7 @@ function drawMove(coors, context_draw) {
context_draw.lineTo(ptEnd[1].x, ptEnd[1].y); context_draw.lineTo(ptEnd[1].x, ptEnd[1].y);
context_draw.lineJoin = 'bevel'; context_draw.lineJoin = 'bevel';
context_draw.lineCap = 'butt'; context_draw.lineCap = 'butt';
context_draw.fillStyle = "#" + makerColor; context_draw.fillStyle = "#" + CONTENTVIEW_GENERAL.makerColor;
context_draw.fill(); context_draw.fill();
context_draw.globalCompositeOperation = 'lighter'; context_draw.globalCompositeOperation = 'lighter';
context_draw.closePath(); context_draw.closePath();
...@@ -200,7 +190,7 @@ function drawMove(coors, context_draw) { ...@@ -200,7 +190,7 @@ function drawMove(coors, context_draw) {
context_draw.lineTo(ptEnd[0].x, ptEnd[0].y); context_draw.lineTo(ptEnd[0].x, ptEnd[0].y);
context_draw.lineTo(ptEnd[1].x, ptEnd[1].y); context_draw.lineTo(ptEnd[1].x, ptEnd[1].y);
context_draw.closePath(); context_draw.closePath();
} else if (sy < coors.y) { } else if (CONTENTVIEW_GENERAL.sy < coors.y) {
context_draw.globalCompositeOperation = 'destination-out'; context_draw.globalCompositeOperation = 'destination-out';
context_draw.moveTo(ptStart[0].x, ptStart[0].y); context_draw.moveTo(ptStart[0].x, ptStart[0].y);
context_draw.lineTo(ptStart[1].x, ptStart[1].y); context_draw.lineTo(ptStart[1].x, ptStart[1].y);
...@@ -210,7 +200,7 @@ function drawMove(coors, context_draw) { ...@@ -210,7 +200,7 @@ function drawMove(coors, context_draw) {
context_draw.lineTo(ptEnd[0].x, ptEnd[0].y); context_draw.lineTo(ptEnd[0].x, ptEnd[0].y);
context_draw.lineJoin = 'bevel'; context_draw.lineJoin = 'bevel';
context_draw.lineCap = 'butt'; context_draw.lineCap = 'butt';
context_draw.fillStyle = "#" + makerColor; context_draw.fillStyle = "#" + CONTENTVIEW_GENERAL.makerColor;
context_draw.fill(); context_draw.fill();
context_draw.globalCompositeOperation = 'lighter'; context_draw.globalCompositeOperation = 'lighter';
context_draw.closePath(); context_draw.closePath();
...@@ -232,7 +222,7 @@ function drawMove(coors, context_draw) { ...@@ -232,7 +222,7 @@ function drawMove(coors, context_draw) {
context_draw.lineTo(ptEnd[0].x, ptEnd[0].y); context_draw.lineTo(ptEnd[0].x, ptEnd[0].y);
context_draw.lineJoin = 'bevel'; context_draw.lineJoin = 'bevel';
context_draw.lineCap = 'butt'; context_draw.lineCap = 'butt';
context_draw.fillStyle = "#" + makerColor; context_draw.fillStyle = "#" + CONTENTVIEW_GENERAL.makerColor;
context_draw.fill(); context_draw.fill();
context_draw.globalCompositeOperation = 'lighter'; context_draw.globalCompositeOperation = 'lighter';
context_draw.closePath(); context_draw.closePath();
...@@ -245,8 +235,8 @@ function drawMove(coors, context_draw) { ...@@ -245,8 +235,8 @@ function drawMove(coors, context_draw) {
context_draw.lineTo(ptEnd[0].x, ptEnd[0].y); context_draw.lineTo(ptEnd[0].x, ptEnd[0].y);
context_draw.closePath(); context_draw.closePath();
} }
} else if (sx < coors.x) { } else if (CONTENTVIEW_GENERAL.sx < coors.x) {
if (sy > coors.y) { if (CONTENTVIEW_GENERAL.sy > coors.y) {
context_draw.globalCompositeOperation = 'destination-out'; context_draw.globalCompositeOperation = 'destination-out';
context_draw.moveTo(ptStart[2].x, ptStart[2].y); context_draw.moveTo(ptStart[2].x, ptStart[2].y);
context_draw.lineTo(ptStart[3].x, ptStart[3].y); context_draw.lineTo(ptStart[3].x, ptStart[3].y);
...@@ -256,7 +246,7 @@ function drawMove(coors, context_draw) { ...@@ -256,7 +246,7 @@ function drawMove(coors, context_draw) {
context_draw.lineTo(ptEnd[2].x, ptEnd[2].y); context_draw.lineTo(ptEnd[2].x, ptEnd[2].y);
context_draw.lineJoin = 'bevel'; context_draw.lineJoin = 'bevel';
context_draw.lineCap = 'butt'; context_draw.lineCap = 'butt';
context_draw.fillStyle = "#" + makerColor; context_draw.fillStyle = "#" + CONTENTVIEW_GENERAL.makerColor;
context_draw.fill(); context_draw.fill();
context_draw.globalCompositeOperation = 'lighter'; context_draw.globalCompositeOperation = 'lighter';
context_draw.closePath(); context_draw.closePath();
...@@ -270,7 +260,7 @@ function drawMove(coors, context_draw) { ...@@ -270,7 +260,7 @@ function drawMove(coors, context_draw) {
context_draw.lineTo(ptEnd[1].x, ptEnd[1].y); context_draw.lineTo(ptEnd[1].x, ptEnd[1].y);
context_draw.lineTo(ptEnd[2].x, ptEnd[2].y); context_draw.lineTo(ptEnd[2].x, ptEnd[2].y);
context_draw.closePath(); context_draw.closePath();
} else if (sy < coors.y) { } else if (CONTENTVIEW_GENERAL.sy < coors.y) {
context_draw.globalCompositeOperation = 'destination-out'; context_draw.globalCompositeOperation = 'destination-out';
context_draw.moveTo(ptStart[3].x, ptStart[3].y); context_draw.moveTo(ptStart[3].x, ptStart[3].y);
context_draw.lineTo(ptStart[0].x, ptStart[0].y); context_draw.lineTo(ptStart[0].x, ptStart[0].y);
...@@ -280,7 +270,7 @@ function drawMove(coors, context_draw) { ...@@ -280,7 +270,7 @@ function drawMove(coors, context_draw) {
context_draw.lineTo(ptEnd[3].x, ptEnd[3].y); context_draw.lineTo(ptEnd[3].x, ptEnd[3].y);
context_draw.lineJoin = 'bevel'; context_draw.lineJoin = 'bevel';
context_draw.lineCap = 'butt'; context_draw.lineCap = 'butt';
context_draw.fillStyle = "#" + makerColor; context_draw.fillStyle = "#" + CONTENTVIEW_GENERAL.makerColor;
context_draw.fill(); context_draw.fill();
context_draw.globalCompositeOperation = 'lighter'; context_draw.globalCompositeOperation = 'lighter';
context_draw.closePath(); context_draw.closePath();
...@@ -302,7 +292,7 @@ function drawMove(coors, context_draw) { ...@@ -302,7 +292,7 @@ function drawMove(coors, context_draw) {
context_draw.lineTo(ptEnd[2].x, ptEnd[2].y); context_draw.lineTo(ptEnd[2].x, ptEnd[2].y);
context_draw.lineJoin = 'bevel'; context_draw.lineJoin = 'bevel';
context_draw.lineCap = 'butt'; context_draw.lineCap = 'butt';
context_draw.fillStyle = "#" + makerColor; context_draw.fillStyle = "#" + CONTENTVIEW_GENERAL.makerColor;
context_draw.fill(); context_draw.fill();
context_draw.globalCompositeOperation = 'lighter'; context_draw.globalCompositeOperation = 'lighter';
context_draw.closePath(); context_draw.closePath();
...@@ -316,7 +306,7 @@ function drawMove(coors, context_draw) { ...@@ -316,7 +306,7 @@ function drawMove(coors, context_draw) {
context_draw.closePath(); context_draw.closePath();
} }
} else { } else {
if (sy > coors.y) { if (CONTENTVIEW_GENERAL.sy > coors.y) {
context_draw.globalCompositeOperation = 'destination-out'; context_draw.globalCompositeOperation = 'destination-out';
context_draw.moveTo(ptStart[2].x, ptStart[2].y); context_draw.moveTo(ptStart[2].x, ptStart[2].y);
context_draw.lineTo(ptStart[3].x, ptStart[3].y); context_draw.lineTo(ptStart[3].x, ptStart[3].y);
...@@ -324,7 +314,7 @@ function drawMove(coors, context_draw) { ...@@ -324,7 +314,7 @@ function drawMove(coors, context_draw) {
context_draw.lineTo(ptEnd[1].x, ptEnd[1].y); context_draw.lineTo(ptEnd[1].x, ptEnd[1].y);
context_draw.lineJoin = 'bevel'; context_draw.lineJoin = 'bevel';
context_draw.lineCap = 'butt'; context_draw.lineCap = 'butt';
context_draw.fillStyle = "#" + makerColor; context_draw.fillStyle = "#" + CONTENTVIEW_GENERAL.makerColor;
context_draw.fill(); context_draw.fill();
context_draw.globalCompositeOperation = 'lighter'; context_draw.globalCompositeOperation = 'lighter';
context_draw.closePath(); context_draw.closePath();
...@@ -336,7 +326,7 @@ function drawMove(coors, context_draw) { ...@@ -336,7 +326,7 @@ function drawMove(coors, context_draw) {
context_draw.lineTo(ptEnd[0].x, ptEnd[0].y); context_draw.lineTo(ptEnd[0].x, ptEnd[0].y);
context_draw.lineTo(ptEnd[1].x, ptEnd[1].y); context_draw.lineTo(ptEnd[1].x, ptEnd[1].y);
context_draw.closePath(); context_draw.closePath();
} else if (sy < coors.y) { } else if (CONTENTVIEW_GENERAL.sy < coors.y) {
context_draw.globalCompositeOperation = 'destination-out'; context_draw.globalCompositeOperation = 'destination-out';
context_draw.moveTo(ptStart[0].x, ptStart[0].y); context_draw.moveTo(ptStart[0].x, ptStart[0].y);
context_draw.lineTo(ptStart[1].x, ptStart[1].y); context_draw.lineTo(ptStart[1].x, ptStart[1].y);
...@@ -344,7 +334,7 @@ function drawMove(coors, context_draw) { ...@@ -344,7 +334,7 @@ function drawMove(coors, context_draw) {
context_draw.lineTo(ptEnd[3].x, ptEnd[3].y); context_draw.lineTo(ptEnd[3].x, ptEnd[3].y);
context_draw.lineJoin = 'bevel'; context_draw.lineJoin = 'bevel';
context_draw.lineCap = 'butt'; context_draw.lineCap = 'butt';
context_draw.fillStyle = "#" + makerColor; context_draw.fillStyle = "#" + CONTENTVIEW_GENERAL.makerColor;
context_draw.fill(); context_draw.fill();
context_draw.globalCompositeOperation = 'lighter'; context_draw.globalCompositeOperation = 'lighter';
context_draw.closePath(); context_draw.closePath();
...@@ -364,7 +354,7 @@ function drawMove(coors, context_draw) { ...@@ -364,7 +354,7 @@ function drawMove(coors, context_draw) {
context_draw.lineTo(ptStart[3].x, ptStart[3].y); context_draw.lineTo(ptStart[3].x, ptStart[3].y);
context_draw.lineJoin = 'bevel'; context_draw.lineJoin = 'bevel';
context_draw.lineCap = 'butt'; context_draw.lineCap = 'butt';
context_draw.fillStyle = "#" + makerColor; context_draw.fillStyle = "#" + CONTENTVIEW_GENERAL.makerColor;
context_draw.fill(); context_draw.fill();
context_draw.globalCompositeOperation = 'lighter'; context_draw.globalCompositeOperation = 'lighter';
context_draw.closePath(); context_draw.closePath();
...@@ -381,7 +371,7 @@ function drawMove(coors, context_draw) { ...@@ -381,7 +371,7 @@ function drawMove(coors, context_draw) {
context_draw.lineJoin = 'bevel'; context_draw.lineJoin = 'bevel';
context_draw.lineCap = 'butt'; context_draw.lineCap = 'butt';
context_draw.globalAlpha = 0.4; // Opacity 20% context_draw.globalAlpha = 0.4; // Opacity 20%
context_draw.fillStyle = "#" + makerColor; context_draw.fillStyle = "#" + CONTENTVIEW_GENERAL.makerColor;
context_draw.fill(); context_draw.fill();
context_draw.globalAlpha = 1; // Opacity 100% context_draw.globalAlpha = 1; // Opacity 100%
...@@ -394,60 +384,58 @@ function drawMove(coors, context_draw) { ...@@ -394,60 +384,58 @@ function drawMove(coors, context_draw) {
context_draw.globalCompositeOperation = 'source-over'; context_draw.globalCompositeOperation = 'source-over';
// 終点を保存 // 終点を保存
sx = coors.x; CONTENTVIEW_GENERAL.sx = coors.x;
sy = coors.y; CONTENTVIEW_GENERAL.sy = coors.y;
} }
}; };
function drawPoint(coors, context_draw) { CONTENTVIEW_PAINT.drawPoint = function(coors, context_draw) {
/* set value sx,sy */ /* set value sx,sy */
sx = coors.x; CONTENTVIEW_GENERAL.sx = coors.x;
sy = coors.y; CONTENTVIEW_GENERAL.sy = coors.y;
if (isAddingMarking == true) { if (CONTENTVIEW_GENERAL.isAddingMarking == true) {
/* begin draw*/ /* begin draw*/
isClearDrawing = false; CONTENTVIEW_GENERAL.isClearDrawing = false;
if (markingType == 'eraser') { if (CONTENTVIEW_GENERAL.markingType == 'eraser') {
context_draw.globalCompositeOperation = 'destination-out'; context_draw.globalCompositeOperation = 'destination-out';
context_draw.lineWidth = eraseSize; context_draw.lineWidth = CONTENTVIEW_GENERAL.eraseSize;
context_draw.lineJoin = 'round'; context_draw.lineJoin = 'round';
context_draw.lineCap = 'round'; context_draw.lineCap = 'round';
context_draw.lineTo(coors.x + 0.001, coors.y + 0.001); context_draw.lineTo(coors.x + 0.001, coors.y + 0.001);
context_draw.stroke(); context_draw.stroke();
context_draw.globalCompositeOperation = 'source-over'; context_draw.globalCompositeOperation = 'source-over';
} }
else if (markingType == 'pen') { else if (CONTENTVIEW_GENERAL.markingType == 'pen') {
/* set flag */ /* set flag */
isDrawing = true; CONTENTVIEW_GENERAL.isDrawing = true;
context_draw.lineCap = "round"; context_draw.lineCap = "round";
context_draw.lineWidth = penSize; context_draw.lineWidth = CONTENTVIEW_GENERAL.penSize;
context_draw.strokeStyle = "#" + penColor; context_draw.strokeStyle = "#" + CONTENTVIEW_GENERAL.penColor;
context_draw.lineTo(coors.x + 0.001, coors.y + 0.001); context_draw.lineTo(coors.x + 0.001, coors.y + 0.001);
context_draw.stroke(); context_draw.stroke();
} }
else if (markingType == 'maker') { else if (CONTENTVIEW_GENERAL.markingType == 'maker') {
/* set flag */ /* set flag */
isDrawing = true; CONTENTVIEW_GENERAL.isDrawing = true;
context_draw.globalCompositeOperation = 'destination-out'; context_draw.globalCompositeOperation = 'destination-out';
context_draw.lineWidth = makerSize ; context_draw.lineWidth = CONTENTVIEW_GENERAL.makerSize ;
context_draw.lineHeight = makerSize; context_draw.lineHeight = CONTENTVIEW_GENERAL.makerSize;
context_draw.lineTo(coors.x , coors.y + 0.001); context_draw.lineTo(coors.x , coors.y + 0.001);
context_draw.lineCap = 'square'; context_draw.lineCap = 'square';
context_draw.strokeStyle = "#" + makerColor; context_draw.strokeStyle = "#" + CONTENTVIEW_GENERAL.makerColor;
context_draw.stroke(); context_draw.stroke();
context_draw.globalCompositeOperation = 'lighter'; context_draw.globalCompositeOperation = 'lighter';
context_draw.lineCap = "square"; context_draw.lineCap = "square";
context_draw.lineWidth = makerSize; context_draw.lineWidth = CONTENTVIEW_GENERAL.makerSize;
context_draw.lineHeight = makerSize; context_draw.lineHeight = CONTENTVIEW_GENERAL.makerSize;
context_draw.globalAlpha = 0.4; context_draw.globalAlpha = 0.4;
context_draw.strokeStyle = "#" + makerColor; context_draw.strokeStyle = "#" + CONTENTVIEW_GENERAL.makerColor;
context_draw.lineTo(coors.x, coors.y + 0.001); context_draw.lineTo(coors.x, coors.y + 0.001);
context_draw.stroke(); context_draw.stroke();
context_draw.globalAlpha = 1; context_draw.globalAlpha = 1;
...@@ -455,4 +443,5 @@ function drawPoint(coors, context_draw) { ...@@ -455,4 +443,5 @@ function drawPoint(coors, context_draw) {
} }
}; };
\ No newline at end of file
...@@ -2,43 +2,46 @@ ...@@ -2,43 +2,46 @@
/// Pen group [start] /// Pen group [start]
/// =============================================================================================== /// ===============================================================================================
var pen_Size; //名前空間用のオブジェクトを用意する
var pen_Color; var CONTENTVIEW_PEN = {};
var pen_targetDiv;
var pen_chooseColor;
function ShowPen(targetId) { CONTENTVIEW_PEN.pen_Size;
pen_targetDiv = targetId; //CONTENTVIEW_PEN.pen_Color;
CONTENTVIEW_PEN.pen_targetDiv;
CONTENTVIEW_PEN.pen_chooseColor;
CONTENTVIEW_PEN.ShowPen = function(targetId) {
CONTENTVIEW_PEN.pen_targetDiv = targetId;
I18N.i18nReplaceText(); I18N.i18nReplaceText();
$('#dlgPen').show(); $('#dlgPen').show();
$('#dlgPen').draggable({ revert: false}); $('#dlgPen').draggable({ revert: false});
Pen_handleColorPickerEvent(); CONTENTVIEW_PEN.Pen_handleColorPickerEvent();
$('#dlgPen').center(); $('#dlgPen').center();
}; };
function touchStart_BtnOk_Pen(e){ CONTENTVIEW_PEN.touchStart_BtnOk_Pen = function(e){
e.preventDefault(); e.preventDefault();
pen_targetDiv.draggable("destroy"); CONTENTVIEW_PEN.pen_targetDiv.draggable("destroy");
Pen_dspOK_click(); CONTENTVIEW_PEN.Pen_dspOK_click();
}; };
function touchStart_BtnCancel_Pen(e){ CONTENTVIEW_PEN.touchStart_BtnCancel_Pen = function(e){
e.preventDefault(); e.preventDefault();
pen_targetDiv.draggable("destroy"); CONTENTVIEW_PEN.pen_targetDiv.draggable("destroy");
Pen_dspCancel_click(); CONTENTVIEW_PEN.Pen_dspCancel_click();
}; };
function Pen_handleColorPickerEvent() { CONTENTVIEW_PEN.Pen_handleColorPickerEvent = function() {
if(avwUserEnvObj.os == "ipad" || avwUserEnvObj.os == "android"){ if(CONTENTVIEW_GENERAL.avwUserEnvObj.os == "ipad" || CONTENTVIEW_GENERAL.avwUserEnvObj.os == "android"){
$('#dlgPen .colorpicker').unbind('mouseenter'); $('#dlgPen .colorpicker').unbind('mouseenter');
$('#dlgPen .colorpicker').unbind('mouseleave'); $('#dlgPen .colorpicker').unbind('mouseleave');
$('#penColorwrapper').unbind('mouseleave'); $('#penColorwrapper').unbind('mouseleave');
document.getElementById('Pen_btnOk').addEventListener('touchstart',touchStart_BtnOk_Pen,false); document.getElementById('Pen_btnOk').addEventListener('touchstart',CONTENTVIEW_PEN.touchStart_BtnOk_Pen,false);
document.getElementById('Pen_btnCancel').addEventListener('touchstart',touchStart_BtnCancel_Pen,false); document.getElementById('Pen_btnCancel').addEventListener('touchstart',CONTENTVIEW_PEN.touchStart_BtnCancel_Pen,false);
} }
else{ else{
...@@ -46,62 +49,60 @@ function Pen_handleColorPickerEvent() { ...@@ -46,62 +49,60 @@ function Pen_handleColorPickerEvent() {
$('#dlgPen .colorpicker').unbind('mouseleave'); $('#dlgPen .colorpicker').unbind('mouseleave');
$('#penColorwrapper').unbind('mouseleave'); $('#penColorwrapper').unbind('mouseleave');
$('#dlgPen .colorpicker').bind('mouseenter', Pen_colorPickerMouseEnterFunction); $('#dlgPen .colorpicker').bind('mouseenter', CONTENTVIEW_PEN.Pen_colorPickerMouseEnterFunction);
$('#dlgPen .colorpicker').bind('mouseleave', Pen_colorPickerMouseLeaveFunction); $('#dlgPen .colorpicker').bind('mouseleave', CONTENTVIEW_PEN.Pen_colorPickerMouseLeaveFunction);
$('#penColorwrapper').bind('mouseleave', Pen_colorWrapperMouseLeaveFunction); $('#penColorwrapper').bind('mouseleave', CONTENTVIEW_PEN.Pen_colorWrapperMouseLeaveFunction);
} }
$('#Pen_btnOk').live('click', Pen_dspOK_click); $('#Pen_btnOk').live('click', CONTENTVIEW_PEN.Pen_dspOK_click);
$('#Pen_btnCancel').live('click', Pen_dspCancel_click); $('#Pen_btnCancel').live('click', CONTENTVIEW_PEN.Pen_dspCancel_click);
Pen_SetDefaultValue(); CONTENTVIEW_PEN.Pen_SetDefaultValue();
$('#pen-small-text').live('click', penSmallTextClick); $('#pen-small-text').live('click', CONTENTVIEW_PEN.penSmallTextClick);
$('#pen-medium-text').live('click', penMediumTextClick); $('#pen-medium-text').live('click', CONTENTVIEW_PEN.penMediumTextClick);
$('#pen-large-text').live('click', penLargeTextClick); $('#pen-large-text').live('click', CONTENTVIEW_PEN.penLargeTextClick);
$('#pen-oversize-text').live('click', penOversizeTextClick); $('#pen-oversize-text').live('click', CONTENTVIEW_PEN.penOversizeTextClick);
$('#dlgPen .colorpicker').live('click', Pen_colorPickerClickFunction); $('#dlgPen .colorpicker').live('click', CONTENTVIEW_PEN.Pen_colorPickerClickFunction);
}; };
function penSmallTextClick(){ CONTENTVIEW_PEN.penSmallTextClick = function(){
$('#pen-size-small').attr('checked','checked'); $('#pen-size-small').attr('checked','checked');
$('#pen-size-medium').removeAttr('checked'); $('#pen-size-medium').removeAttr('checked');
$('#pen-size-large').removeAttr('checked'); $('#pen-size-large').removeAttr('checked');
$('#pen-size-oversize').removeAttr('checked'); $('#pen-size-oversize').removeAttr('checked');
Pen_rdo1_click(); CONTENTVIEW_PEN.Pen_rdo1_click();
}; };
function penMediumTextClick(){ CONTENTVIEW_PEN.penMediumTextClick = function(){
$('#pen-size-small').removeAttr('checked'); $('#pen-size-small').removeAttr('checked');
$('#pen-size-medium').attr('checked','checked'); $('#pen-size-medium').attr('checked','checked');
$('#pen-size-large').removeAttr('checked'); $('#pen-size-large').removeAttr('checked');
$('#pen-size-oversize').removeAttr('checked'); $('#pen-size-oversize').removeAttr('checked');
Pen_rdo2_click(); CONTENTVIEW_PEN.Pen_rdo2_click();
}; };
function penLargeTextClick(){ CONTENTVIEW_PEN.penLargeTextClick = function(){
$('#pen-size-small').removeAttr('checked'); $('#pen-size-small').removeAttr('checked');
$('#pen-size-medium').removeAttr('checked'); $('#pen-size-medium').removeAttr('checked');
$('#pen-size-large').attr('checked','checked'); $('#pen-size-large').attr('checked','checked');
$('#pen-size-oversize').removeAttr('checked'); $('#pen-size-oversize').removeAttr('checked');
Pen_rdo3_click(); CONTENTVIEW_PEN.Pen_rdo3_click();
}; };
function penOversizeTextClick(){ CONTENTVIEW_PEN.penOversizeTextClick = function(){
$('#pen-size-small').removeAttr('checked'); $('#pen-size-small').removeAttr('checked');
$('#pen-size-medium').removeAttr('checked'); $('#pen-size-medium').removeAttr('checked');
$('#pen-size-large').removeAttr('checked'); $('#pen-size-large').removeAttr('checked');
$('#pen-size-oversize').attr('checked','checked'); $('#pen-size-oversize').attr('checked','checked');
Pen_rdo4_click(); CONTENTVIEW_PEN.Pen_rdo4_click();
}; };
// Choose type of eraser, and draw to canvas // Choose type of eraser, and draw to canvas
function Pen_chooseType(typeValue, color) { CONTENTVIEW_PEN.Pen_chooseType = function(typeValue, color) {
var fillColor; var fillColor;
pen_Size = typeValue; CONTENTVIEW_PEN.pen_Size = typeValue;
var canvas = document.getElementById('Pen_cvPreviewPen'); var canvas = document.getElementById('Pen_cvPreviewPen');
if (color == null || color == 'undefined') { if (color == null || color == 'undefined') {
...@@ -131,17 +132,17 @@ function Pen_chooseType(typeValue, color) { ...@@ -131,17 +132,17 @@ function Pen_chooseType(typeValue, color) {
}; };
// Set default value for Pen. // Set default value for Pen.
function Pen_SetDefaultValue() { CONTENTVIEW_PEN.Pen_SetDefaultValue = function() {
var typeValue = undefined; var typeValue = undefined;
var penColor = ClientData.penOpt_color(); var penColor = ClientData.penOpt_color();
typeValue = ClientData.penOpt_size(); typeValue = ClientData.penOpt_size();
pen_Size = typeValue; CONTENTVIEW_PEN.pen_Size = typeValue;
if(penColor != null || penColor != undefined){ if(penColor != null || penColor != undefined){
pen_chooseColor = penColor; CONTENTVIEW_PEN.pen_chooseColor = penColor;
} }
else{ else{
pen_chooseColor = 'fe0000'; CONTENTVIEW_PEN.pen_chooseColor = 'fe0000';
penColor = 'fe0000'; penColor = 'fe0000';
} }
...@@ -167,7 +168,7 @@ function Pen_SetDefaultValue() { ...@@ -167,7 +168,7 @@ function Pen_SetDefaultValue() {
$("#pen-size-small").focus(); $("#pen-size-small").focus();
} }
Pen_chooseType(typeValue, penColor); CONTENTVIEW_PEN.Pen_chooseType(typeValue, penColor);
//START FIXCSS //START FIXCSS
//$('#dlgPen .colorpicker[colorId="'+penColor+'"]').css('border','1px solid #e6e6e6'); //$('#dlgPen .colorpicker[colorId="'+penColor+'"]').css('border','1px solid #e6e6e6');
$('#dlgPen .colorpicker[colorId="'+penColor+'"]').addClass('picker-choose-on'); $('#dlgPen .colorpicker[colorId="'+penColor+'"]').addClass('picker-choose-on');
...@@ -175,56 +176,56 @@ function Pen_SetDefaultValue() { ...@@ -175,56 +176,56 @@ function Pen_SetDefaultValue() {
//END FIXCSS //END FIXCSS
}; };
function Pen_colorPickerMouseLeaveFunction() { CONTENTVIEW_PEN.Pen_colorPickerMouseLeaveFunction = function() {
//START FIXCSS //START FIXCSS
//$(this).css('border','1px solid white'); //$(this).css('border','1px solid white');
//$('#dlgMaker .colorpicker[colorId="'+makerColor+'"]').css('border','1px solid #e6e6e6'); //$('#dlgMaker .colorpicker[colorId="'+makerColor+'"]').css('border','1px solid #e6e6e6');
$(this).addClass('picker-choose-off'); $(this).addClass('picker-choose-off');
$(this).removeClass('picker-choose-on'); $(this).removeClass('picker-choose-on');
$('#dlgPen .colorpicker[colorId="' + pen_chooseColor + '"]').addClass('picker-choose-on'); $('#dlgPen .colorpicker[colorId="' + CONTENTVIEW_PEN.pen_chooseColor + '"]').addClass('picker-choose-on');
$('#dlgPen .colorpicker[colorId="' + pen_chooseColor + '"]').removeClass('picker-choose-off'); $('#dlgPen .colorpicker[colorId="' + CONTENTVIEW_PEN.pen_chooseColor + '"]').removeClass('picker-choose-off');
//END FIXCSS //END FIXCSS
}; };
function Pen_colorPickerMouseEnterFunction() { CONTENTVIEW_PEN.Pen_colorPickerMouseEnterFunction = function() {
//START FIXCSS //START FIXCSS
//$(this).css('border','1px solid #e6e6e6'); //$(this).css('border','1px solid #e6e6e6');
$(this).removeClass('picker-choose-off'); $(this).removeClass('picker-choose-off');
$(this).addClass('picker-choose-on'); $(this).addClass('picker-choose-on');
//END FIXCSS //END FIXCSS
var color = $(this).attr('colorId'); var color = $(this).attr('colorId');
Pen_chooseType(pen_Size, color); CONTENTVIEW_PEN.Pen_chooseType(CONTENTVIEW_PEN.pen_Size, color);
}; };
function Pen_colorPickerClickFunction() { CONTENTVIEW_PEN.Pen_colorPickerClickFunction = function() {
//START FIXCSS //START FIXCSS
//$('#dlgMaker .colorpicker[colorId="' + maker_chooseColor + '"]').css('border', '1px solid white'); //$('#dlgMaker .colorpicker[colorId="' + CONTENTVIEW_MAKER.maker_chooseColor + '"]').css('border', '1px solid white');
//$(this).css('border','1px solid #e6e6e6'); //$(this).css('border','1px solid #e6e6e6');
$('#dlgPen .colorpicker[colorId="' + pen_chooseColor + '"]').addClass('picker-choose-off'); $('#dlgPen .colorpicker[colorId="' + CONTENTVIEW_PEN.pen_chooseColor + '"]').addClass('picker-choose-off');
$('#dlgPen .colorpicker[colorId="' + pen_chooseColor + '"]').removeClass('picker-choose-on'); $('#dlgPen .colorpicker[colorId="' + CONTENTVIEW_PEN.pen_chooseColor + '"]').removeClass('picker-choose-on');
$(this).addClass('picker-choose-on'); $(this).addClass('picker-choose-on');
$(this).removeClass('picker-choose-off'); $(this).removeClass('picker-choose-off');
//END FIXCSS //END FIXCSS
pen_chooseColor = $(this).attr('colorId'); CONTENTVIEW_PEN.pen_chooseColor = $(this).attr('colorId');
Pen_chooseType(pen_Size, pen_chooseColor); CONTENTVIEW_PEN.Pen_chooseType(CONTENTVIEW_PEN.pen_Size, CONTENTVIEW_PEN.pen_chooseColor);
}; };
function Pen_rdo1_click() { CONTENTVIEW_PEN.Pen_rdo1_click = function() {
Pen_chooseType(5, pen_chooseColor); CONTENTVIEW_PEN.Pen_chooseType(5, CONTENTVIEW_PEN.pen_chooseColor);
}; };
function Pen_rdo2_click() { CONTENTVIEW_PEN.Pen_rdo2_click = function() {
Pen_chooseType(12.5, pen_chooseColor); CONTENTVIEW_PEN.Pen_chooseType(12.5, CONTENTVIEW_PEN.pen_chooseColor);
}; };
function Pen_rdo3_click() { CONTENTVIEW_PEN.Pen_rdo3_click = function() {
Pen_chooseType(25, pen_chooseColor); CONTENTVIEW_PEN.Pen_chooseType(25, CONTENTVIEW_PEN.pen_chooseColor);
}; };
function Pen_rdo4_click() { CONTENTVIEW_PEN.Pen_rdo4_click = function() {
Pen_chooseType(50, pen_chooseColor); CONTENTVIEW_PEN.Pen_chooseType(50, CONTENTVIEW_PEN.pen_chooseColor);
}; };
// Event of button OK // Event of button OK
function Pen_dspOK_click() { CONTENTVIEW_PEN.Pen_dspOK_click = function() {
// Set selected value to local storage // Set selected value to local storage
var typeValue = undefined; var typeValue = undefined;
...@@ -243,19 +244,19 @@ function Pen_dspOK_click() { ...@@ -243,19 +244,19 @@ function Pen_dspOK_click() {
// Set value to local // Set value to local
ClientData.penOpt_size(typeValue); ClientData.penOpt_size(typeValue);
ClientData.penOpt_color(pen_chooseColor); ClientData.penOpt_color(CONTENTVIEW_PEN.pen_chooseColor);
pen_Size = typeValue; CONTENTVIEW_PEN.pen_Size = typeValue;
//c = pen_chooseColor; //c = CONTENTVIEW_PEN.pen_chooseColor;
/*enable button */ /*enable button */
enableButtonMarking(); CONTENTVIEW_MARKING.enableButtonMarking();
ClientData.IsAddingMarking(true); ClientData.IsAddingMarking(true);
isAddingMarking = ClientData.IsAddingMarking(); CONTENTVIEW_GENERAL.isAddingMarking = ClientData.IsAddingMarking();
penSize = ClientData.penOpt_size(); CONTENTVIEW_GENERAL.penSize = ClientData.penOpt_size();
penColor = ClientData.penOpt_color(); CONTENTVIEW_GENERAL.penColor = ClientData.penOpt_color();
// Close dialog // Close dialog
pen_targetDiv.hide(); CONTENTVIEW_PEN.pen_targetDiv.hide();
/* unlock dialog overlay */ /* unlock dialog overlay */
$("#overlay").hide(); $("#overlay").hide();
...@@ -265,14 +266,14 @@ function Pen_dspOK_click() { ...@@ -265,14 +266,14 @@ function Pen_dspOK_click() {
}; };
// Event of button cancel // Event of button cancel
function Pen_dspCancel_click() { CONTENTVIEW_PEN.Pen_dspCancel_click = function() {
/*enable button */ /*enable button */
enableButtonMarking(); CONTENTVIEW_MARKING.enableButtonMarking();
ClientData.IsAddingMarking(true); ClientData.IsAddingMarking(true);
isAddingMarking = ClientData.IsAddingMarking(); CONTENTVIEW_GENERAL.isAddingMarking = ClientData.IsAddingMarking();
// Close dialog // Close dialog
pen_targetDiv.hide(); CONTENTVIEW_PEN.pen_targetDiv.hide();
/* unlock dialog overlay */ /* unlock dialog overlay */
$("#overlay").hide(); $("#overlay").hide();
...@@ -282,12 +283,13 @@ function Pen_dspCancel_click() { ...@@ -282,12 +283,13 @@ function Pen_dspCancel_click() {
}; };
function Pen_colorWrapperMouseLeaveFunction() { CONTENTVIEW_PEN.Pen_colorWrapperMouseLeaveFunction = function() {
Pen_chooseType(pen_Size, pen_chooseColor); CONTENTVIEW_PEN.Pen_chooseType(CONTENTVIEW_PEN.pen_Size, CONTENTVIEW_PEN.pen_chooseColor);
//$('#dlgPen .colorpicker[colorId="' + pen_chooseColor + '"]').css('border', '1px solid #e6e6e6'); //$('#dlgPen .colorpicker[colorId="' + CONTENTVIEW_PEN.pen_chooseColor + '"]').css('border', '1px solid #e6e6e6');
//START FIXCSS //START FIXCSS
//$('#dlgMaker .colorpicker[colorId="' + maker_chooseColor + '"]').css('border', '1px solid #e6e6e6'); //$('#dlgMaker .colorpicker[colorId="' + CONTENTVIEW_MAKER.maker_chooseColor + '"]').css('border', '1px solid #e6e6e6');
$('#dlgPen .colorpicker[colorId="' + pen_chooseColor + '"]').addClass('picker-choose-on'); $('#dlgPen .colorpicker[colorId="' + CONTENTVIEW_PEN.pen_chooseColor + '"]').addClass('picker-choose-on');
$('#dlgPen .colorpicker[colorId="' + pen_chooseColor + '"]').removeClass('picker-choose-off'); $('#dlgPen .colorpicker[colorId="' + CONTENTVIEW_PEN.pen_chooseColor + '"]').removeClass('picker-choose-off');
//END FIXCSS //END FIXCSS
}; };
var popuptext_dialogDiv;
var popuptext_arrowDiv; //名前空間用のオブジェクトを用意する
var CONTENTVIEW_POPUPTEXT = {};
CONTENTVIEW_POPUPTEXT.popuptext_dialogDiv;
CONTENTVIEW_POPUPTEXT.popuptext_arrowDiv;
///ShowDialog ///ShowDialog
///direction: arrow value: 0: top right ///direction: arrow value: 0: top right
/// 1: bottom right /// 1: bottom right
/// 2: top left /// 2: top left
/// 3: bottom left /// 3: bottom left
function OpenPopupText(posX, posY, content, dialogDiv, arrowDiv) { CONTENTVIEW_POPUPTEXT.OpenPopupText = function(posX, posY, content, dialogDiv, arrowDiv) {
popuptext_dialogDiv = dialogDiv; CONTENTVIEW_POPUPTEXT.popuptext_dialogDiv = dialogDiv;
popuptext_arrowDiv = arrowDiv; CONTENTVIEW_POPUPTEXT.popuptext_arrowDiv = arrowDiv;
var direction = 2; var direction = 2;
var left_arrow; // left of arrow div (px) var left_arrow; // left of arrow div (px)
var top_arrow; // topof arrow div (px) var top_arrow; // topof arrow div (px)
var left_dialog; // left of dialog div (px) var left_dialog; // left of dialog div (px)
...@@ -96,12 +99,12 @@ function OpenPopupText(posX, posY, content, dialogDiv, arrowDiv) { ...@@ -96,12 +99,12 @@ function OpenPopupText(posX, posY, content, dialogDiv, arrowDiv) {
/* /*
Close popup text Close popup text
*/ */
function ClosePopupText() { CONTENTVIEW_POPUPTEXT.ClosePopupText = function() {
if (popuptext_dialogDiv) { if (CONTENTVIEW_POPUPTEXT.popuptext_dialogDiv) {
$(popuptext_dialogDiv).fadeOut(300); $(CONTENTVIEW_POPUPTEXT.popuptext_dialogDiv).fadeOut(300);
} }
if (popuptext_arrowDiv) { if (CONTENTVIEW_POPUPTEXT.popuptext_arrowDiv) {
$(popuptext_arrowDiv).fadeOut(300); $(CONTENTVIEW_POPUPTEXT.popuptext_arrowDiv).fadeOut(300);
} }
}; };
...@@ -109,6 +112,7 @@ function ClosePopupText() { ...@@ -109,6 +112,7 @@ function ClosePopupText() {
/* /*
Open default system email to send Open default system email to send
*/ */
function MailTo(email, subject) { CONTENTVIEW_POPUPTEXT.MailTo = function(email, subject) {
window.open("mailto:" + email + "?subject=" + subject, '_self'); window.open("mailto:" + email + "?subject=" + subject, '_self');
}; };
\ No newline at end of file
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