header.js 41.6 KB
Newer Older
1

2
//名前空間用のオブジェクトを用意する
Masaru Abe committed
3 4 5 6 7
var HEADER = {};

HEADER.timeWaitCloseNewInfoPushMessage = 5000; // time wait close info new push message 5 seconds
HEADER.currentPagePushMessage = 1;
HEADER.isHoverOn = false;
8

9 10
$(document).ready(function () {

11
    if (!AVWEB.avwCheckLogin(COMMON.ScreenIds.Login)) return;
12 13

    // Set event to prevent leave
14
    //AVWEB.avwSetLogoutNortice();
15
    if (ClientData.requirePasswordChange() != 1) {
Masaru Abe committed
16
        COMMON.ToogleLogoutNortice();
17 18 19
    }

    //Toggle Searchbox
Masaru Abe committed
20
    $('input#searchbox-key').click(HEADER.toggleSearchPanel);
21

22
    $("#searchbox-key").attr('placeholder', I18N.i18nText('msgPlaceHolder'));
23 24

    //Go to Search Page
Masaru Abe committed
25
    $('#searchbox-search').click(HEADER.searchHeaderButtonFunction);
26 27

    //Change Language JP
Masaru Abe committed
28
    $('#language-jp').click(HEADER.changeLanguageJa);
29 30

    //Change Language KR
Masaru Abe committed
31
    $('#language-kr').click(HEADER.changeLanguageKo);
32 33

    //Change Language EN
Masaru Abe committed
34
    $('#language-en').click(HEADER.changeLanguageEn);
35 36

    //Go To Bookmark Page
Masaru Abe committed
37
    $('#dspShiori').click(HEADER.bookmarkFunction);
38 39

    //Go To update configuration
Masaru Abe committed
40
    $('#dspSetting').click(HEADER.updateConfigFunction);
41 42

    // hide logout button with anonymous user
Masaru Abe committed
43
    if (COMMON.isAnonymousLogin()) {
44 45 46 47 48
        $('#dspLogout').hide();
        $('#dspSetting').hide();
    }
    else {
        //Go To Login Page
Masaru Abe committed
49
        $('#dspLogout').click(HEADER.logoutFunction);
50 51 52 53
        $('#dspLogout').show();
        $('#dspSetting').show();
    }

Masaru Abe committed
54
    $('#dspViewHistory').click(HEADER.historyClickFunction);
55

Masaru Abe committed
56
    $('#dspHome').click(HEADER.homeClickFunction);
57 58 59 60

    //Hide search panel until click on text field
    $('div#header-searchbox').css('display', 'none');

Masaru Abe committed
61
    if (COMMON.isAnonymousLogin()) {
62 63 64 65 66 67 68
        $('#li-login-username').hide();
    }
    else {
        //li-login-username
        $('#li-login-username').show();
        //Display user name
        $('#login-username').text(ClientData.userInfo_userName());
Masaru Abe committed
69
        $('#login-username').attr("title", ClientData.userInfo_userName());
70 71
    }

72 73
    //ログアウト時バックアップ確認パーツ読み込み
    $("#inc_backup").load("./inc_backup.html", function (myData, myStatus, xhr){
Masaru Abe committed
74
    	I18N.i18nReplaceText();
75 76 77 78
        $('#dlgConfirmBackup-backup').click(HEADER.confirmWithBackupFunction);
        $('#dlgConfirmBackup-withoutbackup').click(HEADER.confirmWithoutBackupFunction);
        $('#dlgConfirmBackup1').hide();
    });
79

Masaru Abe committed
80
    $('#searchbox-key').keydown(HEADER.headerSearchKeyDownEventFunction);
81

Masaru Abe committed
82
    $('#searchbox-content-header').click(HEADER.headerSearchContentClickFunction);
83

Masaru Abe committed
84
    $('#searchbox-tag-header').click(HEADER.headerSearchTagClickFunction);
85

Masaru Abe committed
86
    $('#searchbox-body-header').click(HEADER.headerSearchBodyClickFunction);
87 88

    //init push message
Masaru Abe committed
89
    HEADER.initPushMessage();
90 91 92

    //$('*').click(handleHeaderSearchBoxEvent);

Masaru Abe committed
93 94
    if (COMMON.isTouchDevice() == false) {
        $('#searchbox-key').hover(HEADER.searchBoxHoverFunction, HEADER.searchBoxHoverOffFunction);
95

Masaru Abe committed
96
        $('#header-searchbox').hover(HEADER.searchBoxHoverFunction, HEADER.searchBoxHoverOffFunction);
97 98
    }

Masaru Abe committed
99
    if (COMMON.isTouchDevice() == true) {
100
        var bodyTag = document.getElementsByTagName('body')[0];
Masaru Abe committed
101
        bodyTag.addEventListener('touchstart', HEADER.bodyClickFunction, false);
102 103
    }
    else {
Masaru Abe committed
104
        $('body').click(HEADER.bodyClickFunction);
105 106 107 108
    }

});

Masaru Abe committed
109 110
HEADER.searchBoxHoverFunction = function(){
	HEADER.isHoverOn = true;
111 112
};

Masaru Abe committed
113 114
HEADER.searchBoxHoverOffFunction = function() {
	HEADER.isHoverOn = false;
115 116 117
};

// check disabled button
Masaru Abe committed
118
HEADER.checkDisabledButton = function(selector, buttonid) {
119 120
    $(selector).click(
            function () {
Masaru Abe committed
121
                HEADER.setDisabledButton(selector, buttonid);
122
            });
Masaru Abe committed
123
    HEADER.setDisabledButton(selector, buttonid);
124 125
};

Masaru Abe committed
126
HEADER.setDisabledButton = function(selector, buttonid) {
127 128 129 130 131 132 133 134 135 136
    var isDisabled = $(selector + ':checked').length == 0;
    if (isDisabled) {
        $(buttonid).addClass('disabled');
    }
    else {
        $(buttonid).removeClass('disabled');
    }
};


Masaru Abe committed
137 138
HEADER.bodyClickFunction = function(event) {
    if (COMMON.isTouchDevice()) {
139

140
        // Check mouse is in rectangle of searching panel
141
        if ($('#header-searchbox').is(":visible"))  //if ($('#header-searchbox').css('display') != "none")
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
        {

            var currPosX, currPosY;
            var avwUserEnvObj = new UserEnvironment();

            if (avwUserEnvObj.os == 'android') {
                //$("#searchbox-key").val(event.targetTouches[0].pageX + "_" + $('#header-searchbox').position().left + ":" + ($('#header-searchbox').position().left + $('#header-searchbox').width()));
                currPosX = event.targetTouches[0].pageX;
                currPosY = event.targetTouches[0].pageY;
            }
            else {
                currPosX = event.targetTouches[0].clientX;
                currPosY = event.targetTouches[0].clientY;
            }

            var leftsearch = $('#header-searchbox').offset().left;
            var topsearch = $('#header-searchbox').offset().top;
            var rightsearch = $('#header-searchbox').width() + leftsearch;
            var bottomsearch = $('#header-searchbox').height() + topsearch;

            // check mouse position in search region
            if (currPosX >= leftsearch && currPosX <= rightsearch && currPosY >= topsearch && currPosY <= bottomsearch) {
Masaru Abe committed
164
                HEADER.isHoverOn = true;
165 166
            }
            else {
Masaru Abe committed
167
                HEADER.isHoverOn = false;
168 169 170 171 172 173 174 175 176
                $('#header-searchbox').hide();
            }


//            if (currPosX >= $('#header-searchbox').position().left
//                && currPosX <= ($('#header-searchbox').position().left + $('#header-searchbox').width())
//                && currPosY >= $('#header-searchbox').position().top
//                && currPosY <= ($('#header-searchbox').position().top + $('#header-searchbox').height())) {

Masaru Abe committed
177
//                HEADER.isHoverOn = true;
178 179
//            }
//            else {
Masaru Abe committed
180
//                HEADER.isHoverOn = false;
181 182 183 184
//            }
        }
    }
    else {
Masaru Abe committed
185
        if (!HEADER.isHoverOn) {
186 187 188 189 190
            $('#header-searchbox').hide();
        }
    }
};

Masaru Abe committed
191
HEADER.headerSearchBodyClickFunction = function() {
192

193 194 195
	$('#searchbox-body').attr('checked','checked');
	$('#searchbox-tag').removeAttr('checked');
	$('#searchbox-content').removeAttr('checked');
Masaru Abe committed
196
	HEADER.isHoverOn = true;
197 198
};

Masaru Abe committed
199
HEADER.headerSearchTagClickFunction = function() {
200

201 202 203
	$('#searchbox-tag').attr('checked','checked');
	$('#searchbox-body').removeAttr('checked');
	$('#searchbox-content').removeAttr('checked');
Masaru Abe committed
204
	HEADER.isHoverOn = true;
205 206
};

Masaru Abe committed
207
HEADER.headerSearchContentClickFunction = function() {
208

209 210 211
	$('#searchbox-content').attr('checked','checked');
	$('#searchbox-tag').removeAttr('checked');
	$('#searchbox-body').removeAttr('checked');
Masaru Abe committed
212
	HEADER.isHoverOn = true;
213 214 215 216
};


//function header search box key down function
Masaru Abe committed
217
HEADER.headerSearchKeyDownEventFunction = function(e){
218 219 220 221
 	var code = (e.keyCode ? e.keyCode : e.which);
 	if(code == 13) { //Enter keycode
   		$('#searchbox-search').click();
 }
Masaru Abe committed
222
 HEADER.isHoverOn = true;
223 224 225
};

//Toggle Search Panel Click function
Masaru Abe committed
226
HEADER.toggleSearchPanel = function(){
227 228 229 230 231 232 233 234 235 236 237 238 239
    if ($("div#header-searchbox").is(":hidden")) {

        // show radio options
        $('div#header-searchbox').slideDown('slow');

        // set default option search
        if ($('#header-searchbox input:checked').length == 0) {
            // set option default is searchbox content
            $('#searchbox-content').attr('checked', 'checked');
        }

	} else {
		$('div#header-searchbox').hide();
240
	}
241 242 243
};

//Button Search Event function
Masaru Abe committed
244
HEADER.searchHeaderButtonFunction = function(){
245 246 247
	var content = $('#searchbox-content').attr('checked');
	var tag = $('#searchbox-tag').attr('checked');
	var body = $('#searchbox-body').attr('checked');
248

249 250 251 252 253 254 255 256 257 258 259 260 261
	var searchDivision;
	var searchText = $('#searchbox-key').val();
	if(content == 'checked')
	{
		searchDivision = $('#searchbox-content').val();
	}
	if(tag == 'checked')
	{
		searchDivision = $('#searchbox-tag').val();
	}
	if(body == 'checked')
	{
		searchDivision = $('#searchbox-body').val();
262
	}
263 264 265

	ClientData.searchCond_searchText(searchText);
	ClientData.searchCond_searchDivision(searchDivision);
266
	//window.location = COMMON.ScreenIds.ContentSearch;
267
	AVWEB.avwScreenMove(COMMON.ScreenIds.ContentSearch);
268 269
};

Masaru Abe committed
270
HEADER.homeClickFunction = function(){
271
    //window.location = COMMON.ScreenIds.Home;
272
	AVWEB.avwScreenMove(COMMON.ScreenIds.Home);
273 274 275
};

//Change Language Japanese function
Masaru Abe committed
276
HEADER.changeLanguageJa = function(){
277
	I18N.changeLanguage(COMMON.Consts.ConstLanguage_Ja);
278
	//ClientData.userInfo_language(COMMON.Consts.ConstLanguage_Ja);
279 280 281 282 283 284
	//$('#control-sort-titlekana').css('display','inline-block');
	//$('#separate').css('display','inline-block');
	//formatDisplayMoreRecord();
	if(window.changeLanguageCallBackFunction){
		changeLanguageCallBackFunction();
	}
285
    $("#searchbox-key").attr('placeholder', I18N.i18nText('msgPlaceHolder'));
286 287 288
};

//Change Language English functions
Masaru Abe committed
289
HEADER.changeLanguageEn = function(){
290
	I18N.changeLanguage(COMMON.Consts.ConstLanguage_En);
291
	//ClientData.userInfo_language(COMMON.Consts.ConstLanguage_En);
292 293 294 295 296 297
	//$('#control-sort-titlekana').css('display','none');
	//$('#separate').css('display','none');
	//formatDisplayMoreRecord();
	if(window.changeLanguageCallBackFunction){
		changeLanguageCallBackFunction();
	}
298
    $("#searchbox-key").attr('placeholder', I18N.i18nText('msgPlaceHolder'));
299 300 301
};

//Change Language English function
Masaru Abe committed
302
HEADER.changeLanguageKo = function(){
303
	I18N.changeLanguage(COMMON.Consts.ConstLanguage_Ko);
304
	//ClientData.userInfo_language(COMMON.Consts.ConstLanguage_Ko);
305 306 307 308 309 310
	//$('#control-sort-titlekana').css('display','none');
	//$('#separate').css('display','none');
	//formatDisplayMoreRecord();
	if(window.changeLanguageCallBackFunction){
		changeLanguageCallBackFunction();
    }
311
    $("#searchbox-key").attr('placeholder', I18N.i18nText('msgPlaceHolder'));
312 313 314
};

//Shiori function
Masaru Abe committed
315
HEADER.bookmarkFunction = function(){
316
    //window.location = COMMON.ScreenIds.BookmarkList;
317
	AVWEB.avwScreenMove(COMMON.ScreenIds.BookmarkList);
318 319 320
};

//Update Config function
Masaru Abe committed
321
HEADER.updateConfigFunction = function(){
322
    //window.location = COMMON.ScreenIds.Setting;
323
	AVWEB.avwScreenMove(COMMON.ScreenIds.Setting);
324 325 326
};

//Logout function
Masaru Abe committed
327
HEADER.logoutFunction = function() {
328 329 330

    // check content is changed, update status option backup

331
    if (ClientData.isChangedBookmark())
332 333 334 335 336 337
    {
        if (ClientData.userOpt_bkShioriFlag() == 0) {
            $("#chkBkAllShiori").removeAttr('checked');
        }
        else {
            $("#chkBkAllShiori").attr('checked', 'checked');
338
        }
339 340 341 342 343 344 345 346 347 348 349 350
    }
    else {
        $('#chkBkAllShiori').attr('disabled', 'disabled').removeAttr('checked');
    }

    if (ClientData.isChangedMemo()) {

        if (ClientData.userOpt_bkMemoFlag() == 0) {
            $("#chkBkAllMemo").removeAttr('checked');
        }
        else {
            $("#chkBkAllMemo").attr('checked', 'checked');
351
        }
352
    }
353
    else
354 355 356 357
    {
        $('#chkBkAllMemo').attr('disabled', 'disabled').removeAttr('checked');
    }

358
    if (ClientData.isChangedMarkingData())
359 360 361 362 363 364
    {
        if (ClientData.userOpt_bkMakingFlag() == 0) {
            $("#chkBkAllMarking").removeAttr('checked');
        }
        else {
            $("#chkBkAllMarking").attr('checked', 'checked');
365
        }
366 367 368 369 370 371 372 373 374 375
    }
    else {
        $('#chkBkAllMarking').attr('disabled', 'disabled').removeAttr('checked');
    }


    if (ClientData.isChangedBookmark() == true || ClientData.isChangedMarkingData() == true || ClientData.isChangedMemo() == true) {
        // In case: user_data_backup = "Y" -> backup
        if (ClientData.serviceOpt_user_data_backup() == "Y") {

376
            if (ClientData.userOpt_bkConfirmFlg() == 1) {  // Show confirming dialog
377
                //$('#dlgConfirmBackup1').dialog({ width: 600, height: 200, modal: true });
378
                COMMON.lockLayout();
379 380 381 382
                $('#dlgConfirmBackup1').show();
                $('#dlgConfirmBackup1').center();

                // check disabled button backup
Masaru Abe committed
383
                HEADER.checkDisabledButton('#dlgConfirmBackup1 .option_backup input', '#dlgConfirmBackup-backup');
384 385 386 387
            }
            else {  // Do not show confirming dialog
                if (ClientData.userOpt_logoutMode() == null || ClientData.userOpt_logoutMode() == undefined) {
                    //$('#dlgConfirmBackup1').dialog({ width: 600, height: 200, modal: true });
388
                    COMMON.lockLayout();
389 390 391 392
                    $('#dlgConfirmBackup1').show();
                    $('#dlgConfirmBackup1').center();
                }
                else {
393 394
                    if (ClientData.userOpt_logoutMode() == 0) {  // Logout with backup

395 396 397 398
                        var isBackupMarking=ClientData.userOpt_bkMakingFlag() == 1;
                        var isBackupMemo=ClientData.userOpt_bkMemoFlag() == 1;
                        var isBackupBookmark = ClientData.userOpt_bkShioriFlag() == 1;

Masaru Abe committed
399
                        HEADER.DoBackup(isBackupMarking, isBackupMemo, isBackupBookmark, true);
400 401 402 403
                    }
                    else if (ClientData.userOpt_logoutMode() == 1) {  // Logout without backup
                        // Do nothing
                        //Logout
Masaru Abe committed
404
                        HEADER.webLogoutEvent();
405 406 407 408 409
                    }
                }
            }
        }
        // In case: user_data_backup != "Y" -> No backup, logout
410
        else {
Masaru Abe committed
411
            HEADER.webLogoutEvent();
412 413 414
        }
	}
	else{
Masaru Abe committed
415
		HEADER.webLogoutEvent();
416 417 418
	}
};

Masaru Abe committed
419
HEADER.historyClickFunction = function(){
420
    //window.location = COMMON.ScreenIds.History;
421
	AVWEB.avwScreenMove(COMMON.ScreenIds.History);
422 423 424
};

//Web Logout Event
Masaru Abe committed
425
HEADER.webLogoutEvent = function(){
426

427 428
    var isExisted = false;

429 430 431 432
    var params = {
        sid: ClientData.userInfo_sid()
    };

433
    AVWEB.avwCmsApiSync(ClientData.userInfo_accountPath(), "webLogout", "GET", params,
434
                    function (data) {
435
                        isExisted = true;
436
                        SessionStorageUtils.clear();
437
                        AVWEB.avwUserSetting().remove(COMMON.Keys.userInfo_sid);
438
                        AVWEB.avwUserSetting().remove(COMMON.Keys.userInfo_sid_bak);
439
                        // Move to login screen
440
                        //window.location = COMMON.ScreenIds.Login;
441
                        AVWEB.avwScreenMove(COMMON.ScreenIds.Login);
442
                    },
443 444 445 446 447 448 449 450 451
                    function (xmlHttpRequest, txtStatus, errorThrown) {
                        if (xmlHttpRequest.status == 403) {
                            isExisted = false;
                        }
                        else {
                            // Show system error
                            isExisted = true;
                        }
                    });
452

453
    return isExisted;
454 455 456
};

//Logout Without Backup function
457
HEADER.confirmWithoutBackupFunction = function(e) {
458 459
    e.preventDefault();
	var remember = $('#chkRememberBackup').attr('checked');
460

461 462 463 464 465 466 467 468
	if(remember == 'checked'){
	    ClientData.userOpt_bkConfirmFlg(0); // Do not show dialog in next time
	}
	else{
	    ClientData.userOpt_bkConfirmFlg(1); // Show dialog in next time
	}

	ClientData.userOpt_logoutMode(1); // In next time, if choose: [do not show dialog], will not backup and logout
469
	//window.location = COMMON.ScreenIds.Login;
Masaru Abe committed
470
	HEADER.webLogoutEvent();
471 472 473
};

//Logout With Backup function
Masaru Abe committed
474
HEADER.confirmWithBackupFunction = function(e) {
475 476 477 478 479 480 481 482 483 484 485
    e.preventDefault();

    // check button is disabled
    if ($(this).hasClass('disabled'))
        return;

    // update status flag update options No.17

    var isBackupMarking=$("#chkBkAllMarking").attr('checked') == 'checked';
    var isBackupMemo = $("#chkBkAllMemo").attr('checked') == 'checked';
    var isBackupBookmark = $("#chkBkAllShiori").attr('checked') == 'checked';
486

487
	var remember = $('#chkRememberBackup').attr('checked');
Masaru Abe committed
488
	COMMON.unlockLayout();
489
	$('#dlgConfirmBackup1').css('z-index', '99');
490
	COMMON.lockLayout();
491 492 493 494 495 496 497 498 499 500

	if (remember == 'checked') {

	    ClientData.userOpt_bkConfirmFlg(0);  // Do not show dialog in next time

	    // update status backup in setting
	    ClientData.userOpt_bkMakingFlag(isBackupMarking);
	    ClientData.userOpt_bkMemoFlag(isBackupMemo);
	    ClientData.userOpt_bkShioriFlag(isBackupBookmark);

Masaru Abe committed
501
        HEADER.DoBackup(isBackupMarking, isBackupMemo, isBackupBookmark, true);
502 503 504
	}
	else{
		ClientData.userOpt_bkConfirmFlg(1);  // Show dialog in next time
Masaru Abe committed
505
		HEADER.DoBackup(isBackupMarking, isBackupMemo, isBackupBookmark, true);
506
	}
507

508
	ClientData.userOpt_logoutMode(0);  // In next time, if choose: [do not show dialog], will backup and logout
Masaru Abe committed
509
	//HEADER.webLogoutEvent();
510 511
};
//Confirm Back Up Ok
Masaru Abe committed
512
HEADER.DoBackup = function(isBackupMarking, isBackupMemo, isBackupBookmark,isLogout,funcCallback) {
513 514 515 516 517 518 519 520 521 522 523
    // ----------------------------
    // Process backup here
    // ----------------------------

     //Bakup memo/marking/bookmark

//    var params = [
//        { name: 'sid', content: ClientData.userInfo_sid() },
//        { name: 'deviceType', content: '4' },
//        { name: 'formFile', content: JSON.stringify(buildBackupData()), fileName: 'webBackupData.json', contentType: 'text-plain' }
//    ];
524
//        AVWEB.avwUploadBackupFile(ClientData.userInfo_accountPath(), params, false,
525 526 527 528 529
//                        function (data) {
//                            if (JSON.parse(data).result == "success") {
//                                ClientData.isChangedBookmark(false);
//                                ClientData.isChangedMarkingData(false);
//                                ClientData.isChangedMemo(false);
530
//                                //alert(I18N.i18nText('msgBackupSuccess'));
531
//
532 533 534 535 536
//                               // Show message: msgBackupSuccess
//                               $().toastmessage({ position: 'middle-center' });
//                               $().toastmessage('showToast', {
//                                   type: 'success',
//                                   sticky: true,
537
//                                   text: I18N.i18nText('msgBackupSuccess'),
538 539 540
//                               });
//                               $('.toast-position-middle-center').css('width', '500px');
//                               $('.toast-position-middle-center').css('margin-left', '-250px');
541
//                               $('.toast-item-close').live('click', HEADER.webLogoutEvent);
542 543
//                            }
//                            else {
544
//                                //alert(I18N.i18nText('msgBackupFailed'));
545 546 547 548 549
//                               // Show error message: msgBackupFailed
//                               $().toastmessage({ position: 'middle-center' });
//                               $().toastmessage('showToast', {
//                                   type: 'error',
//                                   sticky: true,
550
//                                   text: I18N.i18nText('msgBackupFailed')
551 552 553
//                               });
//                               $('.toast-position-middle-center').css('width', '500px');
//                               $('.toast-position-middle-center').css('margin-left', '-250px');
Masaru Abe committed
554
//                               $('.toast-item-close').live('click', HEADER.webLogoutEvent);
555 556 557
//                            }
//                        },
//                        function (a, b, c) {
558
//                            //alert(I18N.i18nText('msgBackupFailed'));
559 560 561 562 563
//                           // Show error message: msgBackupFailed
//                           $().toastmessage({ position: 'middle-center' });
//                           $().toastmessage('showToast', {
//                               type: 'error',
//                               sticky: true,
564
//                               text: I18N.i18nText('msgBackupFailed')
565 566 567
//                           });
//                           $('.toast-position-middle-center').css('width', '500px');
//                           $('.toast-position-middle-center').css('margin-left', '-250px');
Masaru Abe committed
568
//                           $('.toast-item-close').live('click', HEADER.webLogoutEvent);
569 570
//                            });

571
    // Backup for No.17
572 573 574 575 576 577 578 579

//    if (!isBackupMarking && !isBackupMemo && !isBackupBookmark)
//        return;

    // check if data is changed and has option backup
    if ((ClientData.isChangedBookmark() == true && isBackupBookmark) || (ClientData.isChangedMarkingData() == true && isBackupMarking) || (ClientData.isChangedMemo() == true && isBackupMemo)) {

        if (isLogout) {
580
            COMMON.lockLayout();
581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601
        }

        $().toastmessage({ position: 'middle-center' });
        $().toastmessage('showToast', {
            type: '',
            sticky: true,
            text: '',
            customMessages: 'divResultMessage'
        });

        // show item loading
        $('#divResultMessage').append("<div class='toast-item-loading'></div>");

        setTimeout(function () {

            // backup Marking
            var isBackupMarkingOK = true;
            var isBackupMemoOK = true;
            var isBackupBookmarkOK = true;

            if (isBackupMarking && ClientData.isChangedMarkingData() == true) {
Masaru Abe committed
602
                isBackupMarkingOK = HEADER.sendSignalBackupStart(2); // start backup type marking
603
                if (isBackupMarkingOK) {
Masaru Abe committed
604
                    isBackupMarkingOK = HEADER.backupFile(JSON.stringify({ "type": 2, "data": ClientData.MarkingData() }), 'Marking.json', 2);
605 606
                    if (isBackupMarkingOK) {
                        ClientData.isChangedMarkingData(false);
607
                        $('#divResultMessage').append("<div class='toast-item-image-success toast-item-message'>" + I18N.i18nText('txtBkMarking') + " " + I18N.i18nText('msgBackupSuccess') + "</div>");
608 609
                    }
                    // finish backup marking if start backup marking success
Masaru Abe committed
610
                    HEADER.sendSignalBackupFinish(2);
611 612
                }
                if (!isBackupMarkingOK) {
613
                    $('#divResultMessage').append("<div class='toast-item-image-error toast-item-message'>" + I18N.i18nText('txtBkMarking') + " " + I18N.i18nText('msgBackupFailed') + "</div>");
614 615 616 617 618
                }
            }

            // Backup bookmark
            if (isBackupBookmark && ClientData.isChangedBookmark() == true) {
Masaru Abe committed
619
                isBackupBookmarkOK = HEADER.sendSignalBackupStart(4); // start backup type bookmark
620
                if (isBackupBookmarkOK) {
Masaru Abe committed
621
                    isBackupBookmarkOK = HEADER.backupFile(JSON.stringify({ "type": 3, "data": ClientData.BookMarkData() }), 'Bookmark.json', 4);
622 623 624
                    if (isBackupBookmarkOK) {
                        ClientData.isChangedBookmark(false);

625
                        $('#divResultMessage').append("<div class='toast-item-image-success toast-item-message'>" + I18N.i18nText('txtBkShiori') + " " + I18N.i18nText('msgBackupSuccess') + "</div>");
626 627
                    }
                    // finish backup bookmark if start backup bookmark ok
Masaru Abe committed
628
                    HEADER.sendSignalBackupFinish(4);
629 630
                }
                if (!isBackupBookmarkOK) {
631
                    $('#divResultMessage').append("<div class='toast-item-image-error toast-item-message'>" + I18N.i18nText('txtBkShiori') + " " + I18N.i18nText('msgBackupFailed') + "</div>");
632 633 634 635 636 637
                }
            }

            // Backup Memo

            if (isBackupMemo && ClientData.isChangedMemo() == true) {
Masaru Abe committed
638
                isBackupMemoOK = HEADER.sendSignalBackupStart(1); // start backup type memo
639
                if (isBackupMemoOK) {
Masaru Abe committed
640
                    isBackupMemoOK = HEADER.backupFile(JSON.stringify({ "type": 1, "data": ClientData.MemoData() }), 'ContentMemo.json', 1);
641 642
                    if (isBackupMemoOK) {
                        ClientData.isChangedMemo(false);
643
                        $('#divResultMessage').append("<div class='toast-item-image-success toast-item-message'>" + I18N.i18nText('txtBkMemo') + " " + I18N.i18nText('msgBackupSuccess') + "</div>");
644 645
                    }
                    // finish backup memo if start backup memo ok
Masaru Abe committed
646
                    HEADER.sendSignalBackupFinish(1);
647 648
                }
                if (!isBackupMemoOK) {
649
                    $('#divResultMessage').append("<div class='toast-item-image-error toast-item-message'>" + I18N.i18nText('txtBkMemo') + " " + I18N.i18nText('msgBackupFailed') + "</div>");
650 651 652 653 654 655 656 657 658 659 660 661
                }
            }

            // hide item loading
            $('#divResultMessage .toast-item-loading').hide();

            // active close toast button
            $('.toast-item-close').click(function () { $().toastmessage('removeToast', $('#divResultMessage'), null) });

            if (isLogout) {
                $('.toast-position-middle-center').css('width', '500px');
                $('.toast-position-middle-center').css('margin-left', '-250px');
Masaru Abe committed
662
                $('.toast-item-close').live('click', HEADER.webLogoutEvent);
663 664 665 666 667 668 669 670 671
            }

            // check call back function
            if (funcCallback) {
                funcCallback();
            }

        }, 1000);
    }
672
    else
673 674
    {
        if (isLogout) {
Masaru Abe committed
675
            HEADER.webLogoutEvent();
676 677 678 679
        }
    }
};

Masaru Abe committed
680
HEADER.backupFile = function(data, file,type) {
681 682 683
    var result = false;
    var params = [
        { name: 'sid', content: ClientData.userInfo_sid() },
Masaru Abe committed
684
        //{ name: 'deviceType', content: '4' },
685 686 687
        //{name: 'fileType', content: type },
        { name: 'formFile', content: data, fileName: file, contentType: 'text-plain' }
    ];
688
    AVWEB.avwUploadBackupFile(ClientData.userInfo_accountPath(), params, false,
689 690
                function (data)
                {
691
                    if (JSON.parse(data).result == "success")
692 693 694 695 696 697 698 699
                    {
                        result = true;
                    }
                }, function (a, b, c) { });
    return result;
};

// send signal backup start
Masaru Abe committed
700
HEADER.sendSignalBackupStart = function(typeBackup)
701 702 703
{
    var result = false;
    var params = { "sid": ClientData.userInfo_sid(), "fileType": typeBackup };
704
    AVWEB.avwCmsApiSync(ClientData.userInfo_accountPath(), "notifyBackupStart", "post", params,
705
                    function (data) {
706 707 708 709 710 711 712 713 714
                        if (data.result == "success") {
                            result = true;
                        }
                    },
                    function (xhr, b, c) { });
    return result;
};

// send signal backup finish
Masaru Abe committed
715
HEADER.sendSignalBackupFinish = function(typeBackup)
716 717 718
{
    var result = false;
    var params = { "sid": ClientData.userInfo_sid(), "fileType": typeBackup };
719
    AVWEB.avwCmsApiSync(ClientData.userInfo_accountPath(), "notifyBackupFinish", "post", params,
720 721 722 723 724 725 726 727 728 729 730
                    function (data) {
                        if (data.result == "success") {
                            result = true;
                        }
                    },
                    function (xhr, b, c) { });
    return result;
};

/* ------ */

Masaru Abe committed
731
HEADER.checkForceChangePassword = function(){
732
	if(ClientData.BookmarkScreen() != COMMON.ScreenIds.Setting){
733
	   if(ClientData.requirePasswordChange() == 1){
734
	   		//alert(I18N.i18nText('msgPWDNeedChange'));
Masaru Abe committed
735
			HEADER.showErrorScreenForceChangePassword();
736 737 738 739
	   }
	}
};

Masaru Abe committed
740
HEADER.showErrorScreenForceChangePassword = function(){
741
	var tags = '<div id="avw-auth-error">' +
742
				   '<div style="display:table; width:100%; height:100%;">' +
743
				   '<div style="display:table-cell; text-align:center; vertical-align:middle;">' +
744
				   '<p>'+I18N.i18nText('msgPWDNeedChange')+'</p>' +
745 746 747
				   '<div><button id="avw-unauth-ok">OK</button></div>' +
				   '</div></div></div>';
		$('body').prepend(tags);
748
		$('#avw-auth-error').css( {
749 750 751 752 753 754 755 756
			'opacity': 1,
			'position': 'fixed',
			'top': '0',
			'left': '0',
			'width': $(window).width(),
			'height': $(window).height(),
			'zIndex': '10000'
		});
757
		// resize error page
758 759 760 761
		$(window).resize(function() {
			$('#avw-auth-error').css( {
				'width': $(window).width(),
				'height': $(window).height()
762
			});
763
		});
764

765
		$('#avw-unauth-ok').click(function() {
766
			ClientData.BookmarkScreen(COMMON.ScreenIds.Setting);
767 768
			AVWEB.avwScreenMove(COMMON.ScreenIds.Setting);
		});
769 770 771 772 773
};

/* region for Push message */

// init for push message
Masaru Abe committed
774
HEADER.initPushMessage = function()
775 776 777 778 779 780 781 782 783 784 785 786 787
{
    $('#liPushMessage').click(
        function () {

            if ($(this).hasClass('show')) {
                $(this).removeClass('show').addClass('hide');
                $('#accordion').slideUp();
            }
            else {

                $('.notification-pushmessage').hide(); // hide notification
                $(this).removeClass('hide').addClass('show');

Masaru Abe committed
788 789
                HEADER.currentPagePushMessage = 1;
                HEADER.getPushMessageList();
790 791 792 793 794 795 796 797
            }
        }
    );

    // set default hide list message
    $('#liPushMessage').removeClass('show').addClass('hide');

        $('#prev-page-message').click(function (e) {
Masaru Abe committed
798
            HEADER.previousPushMessageClick();
799 800 801 802
            e.stopPropagation();
            return false;
        });
        $('#next-page-message').click(function (e) {
Masaru Abe committed
803
            HEADER.nextPushMessageClick();
804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825
            e.stopPropagation();
            return false;
        });

//        $('#list-push-message').click(
//            function (e) {

//                $('#liPushMessage').removeClass('show').addClass('hide');
//                $('#list-push-message').slideUp();

//                e.stopPropagation();
//                return false;
//            }
//        );

            $('.notification-pushmessage').click(
            function () {
                $(this).slideUp();
            }
        );

        // check new push message
Masaru Abe committed
826
        if (COMMON.isAnonymousLogin() == false ) {
827 828 829 830
        	if((ClientData.serviceOpt_apns() == 'Y') || (ClientData.serviceOpt_usable_push_message() == 'Y')) {
        		 HEADER.getPushMessageNew();
            }

Masaru Abe committed
831
        }
832 833 834
    };

// get time wait check new push message
835 836
HEADER.getTimeWaitCheckNewPushMessage = function()
{
837
    return AVWEB.avwSysSetting().pushTimePeriod * 1000;// time unit is seconds
Masaru Abe committed
838
};
839 840

// get message new
Masaru Abe committed
841
HEADER.getPushMessageNew = function()
842
{
843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861
	//ロック中かビューア画面ならチェックしない
	if ($("#viewer").length) {
		//表示状態か
		if( $('#viewer').is(':visible')){
			return;
		}
	}
	//$('.notification-pushmessage').hide();
	var params = {
			"sid": ClientData.userInfo_sid()
	};
	AVWEB.avwCmsApi(
			ClientData.userInfo_accountPath(),
			"webPushMessageNew",
			"post",
			params,
			HEADER.callbackGetPushMessageNewSuccess,
			function (xhr, b, c) { }
	);
862 863 864
};

// callback get number new message success
Masaru Abe committed
865
HEADER.callbackGetPushMessageNewSuccess = function(data) {
866

867
    if (data) {
868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887
        // get current number message in session
        var currentMessage = parseInt(ClientData.pushInfo_newMsgNumber());
        if (isNaN(currentMessage)) {
            currentMessage = 0;
        }
        var totalMessage = currentMessage + data.count;
        if ($('#liPushMessage').hasClass('hide')) {
            // update new number message to session
            ClientData.pushInfo_newMsgNumber(totalMessage);

            // only show number new message when total messages greater than 0
            if (totalMessage > 0) {
                // show current number message
                $('#numbermessage').html(totalMessage);
            }
            else $('#numbermessage').html('');
        }
        // show notification for new message
        if (data.count > 0)
        {
888
            $('.notification-pushmessage').html(I18N.i18nText("msgPushAlert")).slideDown();
889 890 891 892 893

            // auto off notification push message after timeWaitCloseNewInfoPushMessage
            setTimeout(function () {
                $('.notification-pushmessage').slideUp();

Masaru Abe committed
894
            }, HEADER.timeWaitCloseNewInfoPushMessage);
895 896 897 898
        }
    }

    // continue check new push message
Masaru Abe committed
899
    setTimeout(HEADER.getPushMessageNew, HEADER.getTimeWaitCheckNewPushMessage());
900 901 902 903

};

// get message
Masaru Abe committed
904
HEADER.getPushMessageList = function() {
905

906
    var sysSettings = AVWEB.avwSysSetting();
907 908
    var pushPageCount=sysSettings.pushPageCount;

Masaru Abe committed
909 910
    var from = (HEADER.currentPagePushMessage - 1) * pushPageCount + 1;
    var to = HEADER.currentPagePushMessage * pushPageCount;
911

912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932
    var params = {
    		"sid": ClientData.userInfo_sid(),
    		"recordFrom": from,
    		"recordTo": to
    };
    AVWEB.avwCmsApiSync(
    		ClientData.userInfo_accountPath(),
    		"webPushMessageList",
    		"post",
    		params,
    		function (data) {
    			// reset number message
    			ClientData.pushInfo_newMsgNumber(0);
    			// hide number new message
    			$('#numbermessage').html('');
    			HEADER.showListPushMessage(data);
    		},
    		function (xhr, b, c) {
    			AVWEB.showSystemError();
    		}
    );
933 934 935 936
};

// get string from date crate pushmessage

Masaru Abe committed
937
HEADER.getDateCreatePushMessage = function(data) {
938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955
	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;
Masaru Abe committed
956
};
957
// show push message list
Masaru Abe committed
958
HEADER.showListPushMessage = function(data)
959 960
{
    $('#show-push-message').html('');
961
    for (var i = 0; i < data.messageList.length && i <= (data.recordTo - data.recordFrom); i++)
962
    {
Masaru Abe committed
963
        var titleMessage = COMMON.truncate(data.messageList[i].messageDetail, 30).replace(/</g, '&lt;').replace(/>/g, '&gt;');
964 965 966
        var detailMessage = data.messageList[i].messageDetail.replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\n/g, '<br/>');
        var message = '<div class="newmsg">';
        message += '<h5 class="postItem"><a href="#">' + titleMessage + '</a></h5>';
Masaru Abe committed
967
        message += '<p>' + detailMessage + '<span class="date">' + HEADER.getDateCreatePushMessage(data.messageList[i].messageSendDate) + '</span></p></div>';
968 969 970 971 972 973 974 975 976
        $('#show-push-message').append(message);
    }

    // hide all detail message
    $('#show-push-message .newmsg p').hide();

    // show list title message
    $('#accordion').slideDown();

Masaru Abe committed
977
    if (HEADER.currentPagePushMessage > 1 || data.recordTo < data.totalRecord) {
978 979 980 981 982 983 984 985 986 987 988 989 990 991
        $('#accordion .pagechange').show();
    }
    else {
        $('#accordion .pagechange').hide();
    }

    // check show next button
    if (data.recordTo < data.totalRecord) {
        $('#next-page-message').show();
    }
    else {
        $('#next-page-message').hide();
    }

992 993
    // check show previous button
    if (HEADER.currentPagePushMessage > 1) {
994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013
        $('#prev-page-message').css({ "visibility": "visible" });
    }
    else {
        $('#prev-page-message').css({ "visibility":"hidden"});
    }


    // show detail message when click at title
    $('#show-push-message .newmsg h5').click(
        function () {
            var isshow = !$(this).parent().find('p').is(':visible');
            $('#show-push-message .newmsg p').slideUp();
            if (isshow) {
                $(this).parent().find('p').slideDown();
            }
        }
    );
};

// load next page message
Masaru Abe committed
1014 1015 1016
HEADER.nextPushMessageClick = function() {
    HEADER.currentPagePushMessage++;
    HEADER.getPushMessageList();
1017 1018 1019
};

// load previous page message
Masaru Abe committed
1020 1021 1022 1023 1024
HEADER.previousPushMessageClick = function() {
    if (HEADER.currentPagePushMessage > 1){
        HEADER.currentPagePushMessage--;
    } else {
        HEADER.currentPagePushMessage = 1;
1025
    }
Masaru Abe committed
1026
    HEADER.getPushMessageList();
1027 1028
};

Masaru Abe committed
1029
HEADER.setStatusSort = function(currentid, isAsc) {
1030
    $('#menu_sort li a').removeClass('descending_sort').removeClass('ascending_sort');
1031

1032 1033
    if($('#menu_sort li a#off-default').size()){
        $('#menu_sort li a#off-default').addClass('descending_sort');
1034 1035
    }

1036 1037 1038 1039 1040
    $('#menu_sort li').removeClass('current');
    $(currentid).addClass(isAsc ? 'ascending_sort' : 'descending_sort').parent().addClass("current");
};

// get icon of content type
Masaru Abe committed
1041
HEADER.getIconTypeContent = function(contentType) {
1042 1043 1044

    var src = '';
    switch (contentType) {
1045
        case COMMON.ContentTypeKeys.Type_PDF:
1046
            {
1047
                src = 'img/bookshelf/icon_01.png';
1048 1049
                break;
            }
1050
        case COMMON.ContentTypeKeys.Type_Enquete:
1051
            {
1052
                src = 'img/bookshelf/icon_09.png';
1053 1054
                break;
            }
1055 1056 1057 1058 1059
        case COMMON.ContentTypeKeys.Type_Exam:
        	{
	            src = 'img/bookshelf/icon_10.png';
	            break;
        	}
1060
        case COMMON.ContentTypeKeys.Type_Html:
1061
            {
1062
                src = 'img/bookshelf/icon_05.png';
1063 1064
                break;
            }
1065
        case COMMON.ContentTypeKeys.Type_Image:
1066
            {
1067
                src = 'img/bookshelf/icon_02.png';
1068 1069
                break;
            }
1070
        case COMMON.ContentTypeKeys.Type_Music:
1071
            {
1072
                src = 'img/bookshelf/icon_06.png';
1073 1074
                break;
            }
1075
        case COMMON.ContentTypeKeys.Type_NoFile:
1076 1077 1078 1079
            {
                src = 'img/bookshelf/icon_07.png';
                break;
            }
1080
        case COMMON.ContentTypeKeys.Type_Others:
1081
            {
1082
                src = 'img/bookshelf/icon_03.png';
1083 1084
                break;
            }
1085
        case COMMON.ContentTypeKeys.Type_Video:
1086
            {
1087
                src = 'img/bookshelf/icon_04.png';
1088 1089
                break;
            }
1090
        case COMMON.ContentTypeKeys.Type_Link:
1091 1092 1093 1094
            {
                src = 'img/bookshelf/icon_08.png';
                break;
            }
1095 1096 1097 1098 1099
        case COMMON.ContentTypeKeys.Type_PanoMovie:
	        {
	            src = 'img/bookshelf/icon_11.png';
	            break;
	        }
vietdo committed
1100 1101 1102 1103 1104
        case COMMON.ContentTypeKeys.Type_PanoImage:
		    {
		        src = 'img/bookshelf/icon_12.png';
		        break;
		    }
1105 1106 1107 1108 1109
        case COMMON.ContentTypeKeys.Type_ObjectVR:
		    {
		        src = 'img/bookshelf/icon_13.png';
		        break;
		    }
1110
        default: break;
1111 1112 1113 1114 1115
    }
    return src;
};

// download resouce content id
Masaru Abe committed
1116
HEADER.downloadResourceById = function(contentId){
1117 1118 1119 1120 1121
    var params = {
        sid: ClientData.userInfo_sid(),
        contentId: contentId,
        getType: '2'
    };
1122
    AVWEB.avwCmsApiSync(ClientData.userInfo_accountPath(), "webGetContent", "get", params,
1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141
    		function (data) {
    			//Get resourceurl
    			if( data.contentData.content ){
    				var resourceUrl = HEADER.getResourceByIdFromAPI(data.contentData.content.resourceId);
    				// open url to download file
    				if (HEADER.isSafariNotOnIpad()) {
    					window.onbeforeunload = null;
    					window.open(resourceUrl, "_self"); // open url to download file on safari not for ipad
    					var toogleTime = setTimeout(function () { COMMON.ToogleLogoutNortice() }, 200);
    				}
    				else {
    					window.open(resourceUrl); //open url to download file on orther browser
    				}
    			} else {
    				alert("ダウンロード出来ません。");
    			}
    		},
    		function (xhr, b, c) { }
    );
1142 1143 1144
};

//Download resource
Masaru Abe committed
1145
HEADER.getResourceByIdFromAPI = function(resourceId){
Masaru Abe committed
1146
	return AVWEB.getURL("webResourceDownload") + "&sid=" + ClientData.userInfo_sid() + "&resourceId=" + resourceId + "&isDownload=true";
1147 1148 1149
};

// check is browser safari on Mac and Window devide ( not Ipad )
Masaru Abe committed
1150
HEADER.isSafariNotOnIpad = function() {
1151 1152 1153 1154 1155 1156 1157
    if (!window.chrome) {
        var ua = navigator.userAgent.toLowerCase();
        if (!/ipad/.test(ua) && /safari/.test(ua)) {
            return true;
        }
    }
    return false;
1158 1159 1160
};

//link content
Masaru Abe committed
1161
HEADER.viewLinkContentById = function(contentId){
1162 1163 1164 1165 1166
    var params = {
        sid: ClientData.userInfo_sid(),
        contentId: contentId,
        getType: '2'
    };
1167
    AVWEB.avwCmsApiSync(ClientData.userInfo_accountPath(), "webGetContent", "get", params,
1168 1169 1170 1171 1172 1173
            function (data) {
                //Get linkUrl
                var linkUrl = data.contentData.content.url;
                if( !linkUrl ){
                    return;
                }
1174

1175
                window.open(linkUrl, "_blank", "new window, scrollbars=yes");
1176

1177
                /*
1178 1179 1180 1181 1182 1183 1184 1185 1186 1187
                //httpで始まる場合は別ウィンドウで開く
                if (linkUrl.toLowerCase().indexOf('http') === 0) {
                    window.open(linkUrl, "_blank", "new window, scrollbars=yes");
                }
                else if( linkUrl.toLowerCase().indexOf('mailto') === 0 ){
                    //window.open(linkUrl, "_self");
                    location.href=linkUrl;
                }
                else {
                    // open url to download file
Masaru Abe committed
1188
                    if (HEADER.isSafariNotOnIpad()) {
1189 1190
                        window.onbeforeunload = null;
                        window.open(linkUrl, "_self"); // open url to download file on safari not for ipad
Masaru Abe committed
1191
                        var toogleTime = setTimeout(function () { COMMON.ToogleLogoutNortice() }, 200);
1192 1193 1194 1195 1196
                    }
                    else {
                        window.open(linkUrl); //open url to download file on orther browser
                    }
                }
1197
                */
1198 1199 1200 1201 1202
            },
        function (xhr, b, c) { });
};

// get ThumbnailForOtherType
Masaru Abe committed
1203
HEADER.getThumbnailForOtherType = function(contentType){
1204 1205

    var src = '';
1206
    if(contentType == COMMON.ContentTypeKeys.Type_Image){
1207
        src = COMMON.ThumbnailForOtherType.Thumbnail_ImageType;
1208
    }
1209
    else if(contentType == COMMON.ContentTypeKeys.Type_Music){
1210
        src = COMMON.ThumbnailForOtherType.Thumbnail_MusicType;
1211
    }
1212
    else if(contentType == COMMON.ContentTypeKeys.Type_Video){
1213
        src = COMMON.ThumbnailForOtherType.Thumbnail_VideoType;
1214
    }
1215
    else if(contentType == COMMON.ContentTypeKeys.Type_NoFile){
1216
        src = COMMON.ThumbnailForOtherType.Thumbnail_NoFileType;
1217
    }
1218
    else if(contentType == COMMON.ContentTypeKeys.Type_Others){
1219
        src = COMMON.ThumbnailForOtherType.Thumbnail_OthersType;
1220
    }
1221
    else if(contentType == COMMON.ContentTypeKeys.Type_Html){
1222
        src = COMMON.ThumbnailForOtherType.Thumbnail_HtmlType;
1223
    }
1224
    else if(contentType == COMMON.ContentTypeKeys.Type_Link){
1225
        src = COMMON.ThumbnailForOtherType.Thumbnail_LinkType;
1226
    }
1227

1228 1229 1230
    return src;
};