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 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
};
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/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);
});
......
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