Commit 5496b3a5 by Masaru Abe

リファクタリング作業

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