Commit 542d8bfe by Masaru Abe

警告文表示処理修正

parent 69b87573
...@@ -13,13 +13,26 @@ ...@@ -13,13 +13,26 @@
/** /**
* 定数:言語ファイル配置場所 * 定数:言語ファイル配置場所
*/ */
var avwsys_location = "/common/json/lang"; var avwsys_location = "";
var avwsys_dir = "/abvw"; var avwsys_dir = "";
var avwsys_storagekey = "AVWUS_Lang"; var avwsys_storagekey = "";
var avwsys_currLang = "AVW_CurrLang"; var avwsys_currLang = "";
/* 言語の初期化 */ /* 言語の初期化 */
$(function() { $(function() {
initi18n();
});
/** 言語リソース設定初期化 */
function initi18n(){
avwsys_location = "/common/json/lang";
avwsys_dir = "/abvw";
avwsys_storagekey = "AVWUS_Lang";
avwsys_currLang = "AVW_CurrLang";
// ログイン画面/直接アクセス対策 // ログイン画面/直接アクセス対策
var location = window.location.toString().toLowerCase(); var location = window.location.toString().toLowerCase();
if (location.indexOf(avwsys_dir) < 0) { if (location.indexOf(avwsys_dir) < 0) {
...@@ -40,7 +53,9 @@ $(function() { ...@@ -40,7 +53,9 @@ $(function() {
} }
// 言語ファイルを初期化する // 言語ファイルを初期化する
loadLanguage(lang); loadLanguage(lang);
});
}
/* ブラウザの言語設定を取得する */ /* ブラウザの言語設定を取得する */
function getNavigatorLanguage() { function getNavigatorLanguage() {
var lang = (navigator.browserLanguage || navigator.language || navigator.userLanguage); var lang = (navigator.browserLanguage || navigator.language || navigator.userLanguage);
......
 
var messageLevel = {}; var messageLevel = {};
function checkLimitContent(contentId, func,isNotUnlockScreen) { function checkLimitContent(contentId, funcOk, funcCancel, isNotUnlockScreen) {
var levelContent = parseInt(messageLevel[contentId].alertMessageLevel); var levelContent = parseInt(messageLevel[contentId].alertMessageLevel);
...@@ -24,6 +24,8 @@ function checkLimitContent(contentId, func,isNotUnlockScreen) { ...@@ -24,6 +24,8 @@ function checkLimitContent(contentId, func,isNotUnlockScreen) {
unlockLayout(); unlockLayout();
} }
$('#limit_level1').hide(); $('#limit_level1').hide();
//キャンセル
funcCancel();
} }
); );
...@@ -33,13 +35,11 @@ function checkLimitContent(contentId, func,isNotUnlockScreen) { ...@@ -33,13 +35,11 @@ function checkLimitContent(contentId, func,isNotUnlockScreen) {
$('#limit_level1').show().center(); $('#limit_level1').show().center();
$('#limit_level1 .deletebtn .ok').unbind('click').click( $('#limit_level1 .deletebtn .ok').unbind('click').click(
function () { function () {
if (isNotUnlockScreen != 1) { if (isNotUnlockScreen != 1) {
unlockLayout(); unlockLayout();
} }
$('#limit_level1').hide(); $('#limit_level1').hide();
funcOk();
func();
} }
); );
} }
...@@ -69,7 +69,6 @@ function checkLimitContent(contentId, func,isNotUnlockScreen) { ...@@ -69,7 +69,6 @@ function checkLimitContent(contentId, func,isNotUnlockScreen) {
if (code == 13) { //Enter keycode if (code == 13) { //Enter keycode
$('#limit_level2 .deletebtn .ok').click(); $('#limit_level2 .deletebtn .ok').click();
} }
} }
); );
} }
...@@ -80,10 +79,11 @@ function checkLimitContent(contentId, func,isNotUnlockScreen) { ...@@ -80,10 +79,11 @@ function checkLimitContent(contentId, func,isNotUnlockScreen) {
unlockLayout(); unlockLayout();
} }
$('#limit_level2').hide(); $('#limit_level2').hide();
//キャンセル
funcCancel();
} }
); );
// lock layout // lock layout
lockLayout(); lockLayout();
...@@ -127,7 +127,7 @@ function checkLimitContent(contentId, func,isNotUnlockScreen) { ...@@ -127,7 +127,7 @@ function checkLimitContent(contentId, func,isNotUnlockScreen) {
} }
$('#limit_level2').hide(); $('#limit_level2').hide();
// open content // open content
func(); funcOk();
} }
else { else {
$('#lblMessageLimitError').html(format(i18nText('msgLoginErrWrong'), data.errorMessage).toString()).show(); $('#lblMessageLimitError').html(format(i18nText('msgLoginErrWrong'), data.errorMessage).toString()).show();
...@@ -139,13 +139,14 @@ function checkLimitContent(contentId, func,isNotUnlockScreen) { ...@@ -139,13 +139,14 @@ function checkLimitContent(contentId, func,isNotUnlockScreen) {
errorCode = JSON.parse(xhr.responseText).errorMessage; errorCode = JSON.parse(xhr.responseText).errorMessage;
} }
$('#lblMessageLimitError').html(format(i18nText('msgLoginErrWrong'), errorCode).toString()).show(); $('#lblMessageLimitError').html(format(i18nText('msgLoginErrWrong'), errorCode).toString()).show();
}); }
);
} }
); );
} }
else // content level 0 or null else // content level 0 or null
{ {
func(); funcOk();
} }
}; };
\ No newline at end of file
...@@ -191,7 +191,14 @@ function dspRead_Click() { ...@@ -191,7 +191,14 @@ function dspRead_Click() {
var jsondata = $(this).attr("value"); var jsondata = $(this).attr("value");
var data = JSON.parse(jsondata); var data = JSON.parse(jsondata);
checkLimitContent(data.contentid, function () { dspRead_Click_callback(data); }); checkLimitContent(
data.contentid,
function (){
dspRead_Click_callback(data);
},
function(){
}
);
}; };
// //
function dspRead_Click_callback(data) { function dspRead_Click_callback(data) {
......
...@@ -968,7 +968,10 @@ function readSubmenuFunction(e){ ...@@ -968,7 +968,10 @@ function readSubmenuFunction(e){
function() function()
{ {
readSubmenuFunction_callback(contentId); readSubmenuFunction_callback(contentId);
}); },
function(){
}
);
}; };
......
...@@ -160,7 +160,11 @@ function contentdetail_dspRead_Click(e) { ...@@ -160,7 +160,11 @@ function contentdetail_dspRead_Click(e) {
checkLimitContent(outputId, checkLimitContent(outputId,
function () { function () {
contentdetail_dspRead_Click_callback(outputId); contentdetail_dspRead_Click_callback(outputId);
},1); },
function(){
},
1
);
}; };
function contentdetail_dspRead_Click_callback(outputId) { function contentdetail_dspRead_Click_callback(outputId) {
......
...@@ -792,7 +792,10 @@ function readSubmenuFunction(e){ ...@@ -792,7 +792,10 @@ function readSubmenuFunction(e){
function() function()
{ {
readSubmenuFunction_callback(contentId); readSubmenuFunction_callback(contentId);
}); },
function(){
}
);
}; };
......
...@@ -472,7 +472,10 @@ function canvasClickFunction(e) { ...@@ -472,7 +472,10 @@ function canvasClickFunction(e) {
checkLimitContent(outputId, checkLimitContent(outputId,
function(){ function(){
canvasClickFunction_callback(outputId); canvasClickFunction_callback(outputId);
}); },
function(){
}
);
}; };
...@@ -1416,7 +1419,10 @@ function readSubmenuFunction(e) { ...@@ -1416,7 +1419,10 @@ function readSubmenuFunction(e) {
function() function()
{ {
readSubmenuFunction_callback(contentId); readSubmenuFunction_callback(contentId);
}); },
function(){
}
);
}; };
......
...@@ -556,6 +556,8 @@ function initLoginNormalUser() { ...@@ -556,6 +556,8 @@ function initLoginNormalUser() {
// init login for anonymous user // init login for anonymous user
function initLoginAnonymousUser() { function initLoginAnonymousUser() {
document.title = i18nText('dspLogin') + ' | ' + i18nText('sysAppTitle');
var sysSettings = avwSysSetting(); // get info in conf.json var sysSettings = avwSysSetting(); // get info in conf.json
var params = { var params = {
...@@ -569,8 +571,10 @@ function initLoginAnonymousUser() { ...@@ -569,8 +571,10 @@ function initLoginAnonymousUser() {
//clear session of old anonymous user //clear session of old anonymous user
SessionStorageUtils.clear(); SessionStorageUtils.clear();
avwUserSessionObj = null; //警告表示を組み込んだら i18nText()の値が未定義になるので言語リソース再読み込み
initi18n();
avwUserSessionObj = null;
// create new session for anonymous user // create new session for anonymous user
avwCreateUserSession(); avwCreateUserSession();
...@@ -666,6 +670,7 @@ function showMessageErrorLoginAnonymous(errorMessage) { ...@@ -666,6 +670,7 @@ function showMessageErrorLoginAnonymous(errorMessage) {
$('.toast-position-middle-center').css('width', '400px'); $('.toast-position-middle-center').css('width', '400px');
}; };
/* OpenUriで開いた場合の直接コンテンツ表示 */
login.showContentViewByOpenUrl = function(strContentId) { login.showContentViewByOpenUrl = function(strContentId) {
var contentType = ''; var contentType = '';
...@@ -689,7 +694,23 @@ login.showContentViewByOpenUrl = function(strContentId) { ...@@ -689,7 +694,23 @@ login.showContentViewByOpenUrl = function(strContentId) {
//drawEditImage(contentId); 不要 //drawEditImage(contentId); 不要
} else { } else {
//Go to Conten view page //Go to Conten view page
avwScreenMove("abvw/" + ScreenIds.ContentView);
//アラート表示組み込めるか
messageLevel[data.contentData.contentId] = { alertMessageLevel:data.contentData.alertMessageLevel, alertMessage:data.contentData.alertMessage};
// check limit of content
checkLimitContent(
data.contentData.contentId,
function()
{
login.alertMessageOkFunction_callback();
},
function()
{
login.alertMessageCancelFunction_callback();
}
);
//avwScreenMove("abvw/" + ScreenIds.ContentView);
} }
}, },
...@@ -701,6 +722,15 @@ login.showContentViewByOpenUrl = function(strContentId) { ...@@ -701,6 +722,15 @@ login.showContentViewByOpenUrl = function(strContentId) {
}; };
//警告表示時のOK処理
login.alertMessageOkFunction_callback = function(){
avwScreenMove("abvw/" + ScreenIds.ContentView);
}
//警告表示時のキャンセル処理
login.alertMessageCancelFunction_callback = function(){
avwScreenMove("abvw/" + ScreenIds.Home);
}
//Get param url //Get param url
login.getUrlParams = function(name){ login.getUrlParams = function(name){
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
......
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