Commit 0587e6fe by vietdo

#10774 プッシュメッセージの時間表示

parent 2333695b
......@@ -136,9 +136,9 @@ HEADER.setDisabledButton = function(selector, buttonid) {
HEADER.bodyClickFunction = function(event) {
if (COMMON.isTouchDevice()) {
// Check mouse is in rectangle of searching panel
if ($('#header-searchbox').is(":visible")) //if ($('#header-searchbox').css('display') != "none")
if ($('#header-searchbox').is(":visible")) //if ($('#header-searchbox').css('display') != "none")
{
var currPosX, currPosY;
......@@ -189,7 +189,7 @@ HEADER.bodyClickFunction = function(event) {
};
HEADER.headerSearchBodyClickFunction = function() {
$('#searchbox-body').attr('checked','checked');
$('#searchbox-tag').removeAttr('checked');
$('#searchbox-content').removeAttr('checked');
......@@ -197,7 +197,7 @@ HEADER.headerSearchBodyClickFunction = function() {
};
HEADER.headerSearchTagClickFunction = function() {
$('#searchbox-tag').attr('checked','checked');
$('#searchbox-body').removeAttr('checked');
$('#searchbox-content').removeAttr('checked');
......@@ -205,7 +205,7 @@ HEADER.headerSearchTagClickFunction = function() {
};
HEADER.headerSearchContentClickFunction = function() {
$('#searchbox-content').attr('checked','checked');
$('#searchbox-tag').removeAttr('checked');
$('#searchbox-body').removeAttr('checked');
......@@ -237,7 +237,7 @@ HEADER.toggleSearchPanel = function(){
} else {
$('div#header-searchbox').hide();
}
}
};
//Button Search Event function
......@@ -245,7 +245,7 @@ HEADER.searchHeaderButtonFunction = function(){
var content = $('#searchbox-content').attr('checked');
var tag = $('#searchbox-tag').attr('checked');
var body = $('#searchbox-body').attr('checked');
var searchDivision;
var searchText = $('#searchbox-key').val();
if(content == 'checked')
......@@ -259,7 +259,7 @@ HEADER.searchHeaderButtonFunction = function(){
if(body == 'checked')
{
searchDivision = $('#searchbox-body').val();
}
}
ClientData.searchCond_searchText(searchText);
ClientData.searchCond_searchDivision(searchDivision);
......@@ -274,7 +274,7 @@ HEADER.homeClickFunction = function(){
//Change Language Japanese function
HEADER.changeLanguageJa = function(){
I18N.changeLanguage(COMMON.Consts.ConstLanguage_Ja);
I18N.changeLanguage(COMMON.Consts.ConstLanguage_Ja);
//ClientData.userInfo_language(COMMON.Consts.ConstLanguage_Ja);
//$('#control-sort-titlekana').css('display','inline-block');
//$('#separate').css('display','inline-block');
......@@ -287,7 +287,7 @@ HEADER.changeLanguageJa = function(){
//Change Language English functions
HEADER.changeLanguageEn = function(){
I18N.changeLanguage(COMMON.Consts.ConstLanguage_En);
I18N.changeLanguage(COMMON.Consts.ConstLanguage_En);
//ClientData.userInfo_language(COMMON.Consts.ConstLanguage_En);
//$('#control-sort-titlekana').css('display','none');
//$('#separate').css('display','none');
......@@ -300,7 +300,7 @@ HEADER.changeLanguageEn = function(){
//Change Language English function
HEADER.changeLanguageKo = function(){
I18N.changeLanguage(COMMON.Consts.ConstLanguage_Ko);
I18N.changeLanguage(COMMON.Consts.ConstLanguage_Ko);
//ClientData.userInfo_language(COMMON.Consts.ConstLanguage_Ko);
//$('#control-sort-titlekana').css('display','none');
//$('#separate').css('display','none');
......@@ -328,14 +328,14 @@ HEADER.logoutFunction = function() {
// check content is changed, update status option backup
if (ClientData.isChangedBookmark())
if (ClientData.isChangedBookmark())
{
if (ClientData.userOpt_bkShioriFlag() == 0) {
$("#chkBkAllShiori").removeAttr('checked');
}
else {
$("#chkBkAllShiori").attr('checked', 'checked');
}
}
}
else {
$('#chkBkAllShiori').attr('disabled', 'disabled').removeAttr('checked');
......@@ -348,21 +348,21 @@ HEADER.logoutFunction = function() {
}
else {
$("#chkBkAllMemo").attr('checked', 'checked');
}
}
}
else
else
{
$('#chkBkAllMemo').attr('disabled', 'disabled').removeAttr('checked');
}
if (ClientData.isChangedMarkingData())
if (ClientData.isChangedMarkingData())
{
if (ClientData.userOpt_bkMakingFlag() == 0) {
$("#chkBkAllMarking").removeAttr('checked');
}
else {
$("#chkBkAllMarking").attr('checked', 'checked');
}
}
}
else {
$('#chkBkAllMarking').attr('disabled', 'disabled').removeAttr('checked');
......@@ -373,7 +373,7 @@ HEADER.logoutFunction = function() {
// In case: user_data_backup = "Y" -> backup
if (ClientData.serviceOpt_user_data_backup() == "Y") {
if (ClientData.userOpt_bkConfirmFlg() == 1) { // Show confirming dialog
if (ClientData.userOpt_bkConfirmFlg() == 1) { // Show confirming dialog
//$('#dlgConfirmBackup1').dialog({ width: 600, height: 200, modal: true });
COMMON.lockLayout();
$('#dlgConfirmBackup1').show();
......@@ -390,8 +390,8 @@ HEADER.logoutFunction = function() {
$('#dlgConfirmBackup1').center();
}
else {
if (ClientData.userOpt_logoutMode() == 0) { // Logout with backup
if (ClientData.userOpt_logoutMode() == 0) { // Logout with backup
var isBackupMarking=ClientData.userOpt_bkMakingFlag() == 1;
var isBackupMemo=ClientData.userOpt_bkMemoFlag() == 1;
var isBackupBookmark = ClientData.userOpt_bkShioriFlag() == 1;
......@@ -407,7 +407,7 @@ HEADER.logoutFunction = function() {
}
}
// In case: user_data_backup != "Y" -> No backup, logout
else {
else {
HEADER.webLogoutEvent();
}
}
......@@ -449,7 +449,7 @@ HEADER.webLogoutEvent = function(){
isExisted = true;
}
});
return isExisted;
};
......@@ -457,7 +457,7 @@ HEADER.webLogoutEvent = function(){
HEADER.confirmWithoutBackupFunction = function(e) {
e.preventDefault();
var remember = $('#chkRememberBackup').attr('checked');
if(remember == 'checked'){
ClientData.userOpt_bkConfirmFlg(0); // Do not show dialog in next time
}
......@@ -483,7 +483,7 @@ HEADER.confirmWithBackupFunction = function(e) {
var isBackupMarking=$("#chkBkAllMarking").attr('checked') == 'checked';
var isBackupMemo = $("#chkBkAllMemo").attr('checked') == 'checked';
var isBackupBookmark = $("#chkBkAllShiori").attr('checked') == 'checked';
var remember = $('#chkRememberBackup').attr('checked');
COMMON.unlockLayout();
$('#dlgConfirmBackup1').css('z-index', '99');
......@@ -504,7 +504,7 @@ HEADER.confirmWithBackupFunction = function(e) {
ClientData.userOpt_bkConfirmFlg(1); // Show dialog in next time
HEADER.DoBackup(isBackupMarking, isBackupMemo, isBackupBookmark, true);
}
ClientData.userOpt_logoutMode(0); // In next time, if choose: [do not show dialog], will backup and logout
//HEADER.webLogoutEvent();
};
......@@ -528,17 +528,17 @@ HEADER.DoBackup = function(isBackupMarking, isBackupMemo, isBackupBookmark,isLog
// ClientData.isChangedMarkingData(false);
// ClientData.isChangedMemo(false);
// //alert(I18N.i18nText('msgBackupSuccess'));
//
//
// // Show message: msgBackupSuccess
// $().toastmessage({ position: 'middle-center' });
// $().toastmessage('showToast', {
// type: 'success',
// sticky: true,
// text: I18N.i18nText('msgBackupSuccess'),
// text: I18N.i18nText('msgBackupSuccess'),
// });
// $('.toast-position-middle-center').css('width', '500px');
// $('.toast-position-middle-center').css('margin-left', '-250px');
// $('.toast-item-close').live('click', HEADER.webLogoutEvent);
// $('.toast-item-close').live('click', HEADER.webLogoutEvent);
// }
// else {
// //alert(I18N.i18nText('msgBackupFailed'));
......@@ -568,7 +568,7 @@ HEADER.DoBackup = function(isBackupMarking, isBackupMemo, isBackupBookmark,isLog
// $('.toast-item-close').live('click', HEADER.webLogoutEvent);
// });
// Backup for No.17
// Backup for No.17
// if (!isBackupMarking && !isBackupMemo && !isBackupBookmark)
// return;
......@@ -669,7 +669,7 @@ HEADER.DoBackup = function(isBackupMarking, isBackupMemo, isBackupBookmark,isLog
}, 1000);
}
else
else
{
if (isLogout) {
HEADER.webLogoutEvent();
......@@ -688,7 +688,7 @@ HEADER.backupFile = function(data, file,type) {
AVWEB.avwUploadBackupFile(ClientData.userInfo_accountPath(), params, false,
function (data)
{
if (JSON.parse(data).result == "success")
if (JSON.parse(data).result == "success")
{
result = true;
}
......@@ -702,7 +702,7 @@ HEADER.sendSignalBackupStart = function(typeBackup)
var result = false;
var params = { "sid": ClientData.userInfo_sid(), "fileType": typeBackup };
AVWEB.avwCmsApiSync(ClientData.userInfo_accountPath(), "notifyBackupStart", "post", params,
function (data) {
function (data) {
if (data.result == "success") {
result = true;
}
......@@ -739,13 +739,13 @@ HEADER.checkForceChangePassword = function(){
HEADER.showErrorScreenForceChangePassword = function(){
var tags = '<div id="avw-auth-error">' +
'<div style="display:table; width:100%; height:100%;">' +
'<div style="display:table; width:100%; height:100%;">' +
'<div style="display:table-cell; text-align:center; vertical-align:middle;">' +
'<p>'+I18N.i18nText('msgPWDNeedChange')+'</p>' +
'<p>'+I18N.i18nText('msgPWDNeedChange')+'</p>' +
'<div><button id="avw-unauth-ok">OK</button></div>' +
'</div></div></div>';
$('body').prepend(tags);
$('#avw-auth-error').css( {
$('#avw-auth-error').css( {
'opacity': 1,
'position': 'fixed',
'top': '0',
......@@ -754,18 +754,18 @@ HEADER.showErrorScreenForceChangePassword = function(){
'height': $(window).height(),
'zIndex': '10000'
});
// resize error page
// resize error page
$(window).resize(function() {
$('#avw-auth-error').css( {
'width': $(window).width(),
'height': $(window).height()
});
});
});
$('#avw-unauth-ok').click(function() {
ClientData.BookmarkScreen(COMMON.ScreenIds.Setting);
AVWEB.avwScreenMove(COMMON.ScreenIds.Setting);
});
AVWEB.avwScreenMove(COMMON.ScreenIds.Setting);
});
};
/* region for Push message */
......@@ -829,8 +829,8 @@ HEADER.initPushMessage = function()
};
// get time wait check new push message
HEADER.getTimeWaitCheckNewPushMessage = function()
{
HEADER.getTimeWaitCheckNewPushMessage = function()
{
return AVWEB.avwSysSetting().pushTimePeriod * 1000;// time unit is seconds
};
......@@ -860,7 +860,7 @@ HEADER.getPushMessageNew = function()
// callback get number new message success
HEADER.callbackGetPushMessageNewSuccess = function(data) {
if (data) {
if (data) {
// get current number message in session
var currentMessage = parseInt(ClientData.pushInfo_newMsgNumber());
if (isNaN(currentMessage)) {
......@@ -932,13 +932,30 @@ HEADER.getPushMessageList = function() {
// get string from date crate pushmessage
HEADER.getDateCreatePushMessage = function(data) {
return (data.year + 1900) + "/" + (data.month + 1) + "/" + data.date + " " + data.hours + ":" + data.minutes;
var flagMonth = "";
var flagDate = "";
var flagHours = "";
var flagMinutes = "";
if((data.month >=1) && (data.month <= 9)) {
flagMonth = "0";
}
if((data.date >=1) && (data.date <= 9)) {
flagDate = "0";
}
if((data.hours >=1) && (data.hours <= 9)) {
flagHours = "0";
}
if((data.minutes >=1) && (data.minutes <= 9)) {
flagMinutes = "0";
}
return (data.year + 1900) + "/" + flagMonth +(data.month + 1) + "/" + flagDate + data.date + " " + flagHours + data.hours + ":" + flagMinutes + data.minutes;
};
// show push message list
HEADER.showListPushMessage = function(data)
{
$('#show-push-message').html('');
for (var i = 0; i < data.messageList.length && i <= (data.recordTo - data.recordFrom); i++)
for (var i = 0; i < data.messageList.length && i <= (data.recordTo - data.recordFrom); i++)
{
var titleMessage = COMMON.truncate(data.messageList[i].messageDetail, 30).replace(/</g, '&lt;').replace(/>/g, '&gt;');
var detailMessage = data.messageList[i].messageDetail.replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\n/g, '<br/>');
......@@ -969,8 +986,8 @@ HEADER.showListPushMessage = function(data)
$('#next-page-message').hide();
}
// check show previous button
if (HEADER.currentPagePushMessage > 1) {
// check show previous button
if (HEADER.currentPagePushMessage > 1) {
$('#prev-page-message').css({ "visibility": "visible" });
}
else {
......@@ -1008,11 +1025,11 @@ HEADER.previousPushMessageClick = function() {
HEADER.setStatusSort = function(currentid, isAsc) {
$('#menu_sort li a').removeClass('descending_sort').removeClass('ascending_sort');
if($('#menu_sort li a#off-default').size()){
$('#menu_sort li a#off-default').addClass('descending_sort');
}
}
$('#menu_sort li').removeClass('current');
$(currentid).addClass(isAsc ? 'ascending_sort' : 'descending_sort').parent().addClass("current");
};
......@@ -1131,9 +1148,9 @@ HEADER.viewLinkContentById = function(contentId){
if( !linkUrl ){
return;
}
window.open(linkUrl, "_blank", "new window, scrollbars=yes");
/*
//httpで始まる場合は別ウィンドウで開く
if (linkUrl.toLowerCase().indexOf('http') === 0) {
......@@ -1184,7 +1201,7 @@ HEADER.getThumbnailForOtherType = function(contentType){
else if(contentType == COMMON.ContentTypeKeys.Type_Link){
src = COMMON.ThumbnailForOtherType.Thumbnail_LinkType;
}
return src;
};
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