contentview_GetData.js 69.5 KB
Newer Older
1

2 3
//名前空間用のオブジェクトを用意する
var CONTENTVIEW_GETDATA = {};
4 5

/* get url */
6
CONTENTVIEW_GETDATA.getURLPageImage = function(apiName) {
7 8 9 10 11 12

    var isStreaming = "false";
    if(ClientData.isStreamingMode()){
        isStreaming = "true";
    }

13
    var url = ClientData.conf_apiUrl();
14 15 16 17 18 19 20
    url = AVWEB.format(url, ClientData.userInfo_accountPath()) + '/' + apiName + '/?isStreaming=' + isStreaming;
    
    //オーサリングプレビュー対応
    if(COMMON.isAuthoringPreview() && CONTENTVIEW_GENERAL.pid != ''){
    	url = url + '&pid=' + CONTENTVIEW_GENERAL.pid;
    }
    
21 22 23
    return url;
};

24 25
CONTENTVIEW_GETDATA.getPageObjectsByPageIndex = function(contentData, nIndexPage) {
	CONTENTVIEW_GENERAL.pageObjects = [];
26 27 28 29 30

    var currentPageObjects;
    for (var nIndex = 0; nIndex < contentData.length; nIndex++) {
        if (contentData[nIndex].page == nIndexPage) {
            currentPageObjects = contentData[nIndex].objects;
31
            //Start Function: No.9 - Editor : Long - Summary :
32 33 34 35 36
            if(contentData[nIndex].contentDataSub != null && contentData[nIndex].contentDataSub.length > 0){
                //currentPageObjects["contentDataSub"] = contentData[nIndex].contentDataSub;
                for(var i = 0; i < currentPageObjects.length; i++){
                    var tempObj = currentPageObjects[i];
                    tempObj["contentDataSub"] = contentData[nIndex].contentDataSub;
37 38 39
                }
            }
            //End Function: No.9 - Editor : Long
40 41 42 43 44 45 46 47
            break;
        }
    }

    if (currentPageObjects != undefined) {
        for (var nIndex = 0; nIndex < currentPageObjects.length; nIndex++) {
            /*get object page*/
            if (currentPageObjects[nIndex].mediaType == 1) {/*media type = 1 */
48
                var pageObject = CONTENTVIEW_GETDATA.getMediaType1(currentPageObjects[nIndex]);
49
                /*add object to page */
50
                CONTENTVIEW_GENERAL.pageObjects.push(pageObject);
51
            } else if (currentPageObjects[nIndex].mediaType == 2) { /*mediaType = 2 */
52
                var pageObject = CONTENTVIEW_GETDATA.getMediaType2(currentPageObjects[nIndex]);
53
                /*add object to page */
54
                CONTENTVIEW_GENERAL.pageObjects.push(pageObject);
55
            } else if (currentPageObjects[nIndex].mediaType == 3) { /*mediaType = 3*/
56
                var pageObject = CONTENTVIEW_GETDATA.getMediaType3(currentPageObjects[nIndex]);
57
                /*add object to page */
58
                CONTENTVIEW_GENERAL.pageObjects.push(pageObject);
59
            } else if (currentPageObjects[nIndex].mediaType == 4) { /*mediaType = 4*/
60
                var pageObject = CONTENTVIEW_GETDATA.getMediaType4(currentPageObjects[nIndex]);
61
                /*add object to page */
62
                CONTENTVIEW_GENERAL.pageObjects.push(pageObject);
63
            } else if (currentPageObjects[nIndex].mediaType == 5) { /*mediaType = 5*/
64
                var pageObject = CONTENTVIEW_GETDATA.getMediaType5(currentPageObjects[nIndex]);
65
                /*add object to page */
66
                CONTENTVIEW_GENERAL.pageObjects.push(pageObject);
67
            } else if (currentPageObjects[nIndex].mediaType == 6) { /*mediaType = 6*/
68
                var pageObject = CONTENTVIEW_GETDATA.getMediaType6(currentPageObjects[nIndex]);
69
                /*add object to page */
70
                CONTENTVIEW_GENERAL.pageObjects.push(pageObject);
71
            } else if (currentPageObjects[nIndex].mediaType == 7) { /*mediaType = 7*/
72
                var pageObject = CONTENTVIEW_GETDATA.getMediaType7(currentPageObjects[nIndex]);
73
                /*add object to page */
74
                CONTENTVIEW_GENERAL.pageObjects.push(pageObject);
75
            } else if (currentPageObjects[nIndex].mediaType == 8) { /*mediaType = 8*/
76
                var pageObject = CONTENTVIEW_GETDATA.getMediaType8(currentPageObjects[nIndex]);
77
                /*add object to page */
78
                CONTENTVIEW_GENERAL.pageObjects.push(pageObject);
79
            } else if (currentPageObjects[nIndex].mediaType == 9) { /*mediaType = 9*/
80
                var pageObject = CONTENTVIEW_GETDATA.getMediaType9(currentPageObjects[nIndex]);
81
                /*add object to page */
82
                CONTENTVIEW_GENERAL.pageObjects.push(pageObject);
83
            } else if (currentPageObjects[nIndex].mediaType == 11) { /*mediaType = 11*/
84
                var pageObject = CONTENTVIEW_GETDATA.getMediaType11(currentPageObjects[nIndex]);
85
                /*add object to page */
86
                CONTENTVIEW_GENERAL.pageObjects.push(pageObject);
87 88 89 90
            } else if (currentPageObjects[nIndex].mediaType == 12) { /*mediaType = 12*/
                var pageObject = CONTENTVIEW_GETDATA.getMediaType12(currentPageObjects[nIndex]);
                /*add object to page */
                CONTENTVIEW_GENERAL.pageObjects.push(pageObject);
91
            } else if (currentPageObjects[nIndex].mediaType == 13) { /*mediaType = 13*/
92 93 94
                var pageObject = CONTENTVIEW_GETDATA.getMediaType13(currentPageObjects[nIndex]);
                /*add object to page */
                CONTENTVIEW_GENERAL.pageObjects.push(pageObject);
95 96 97 98 99 100
            }
        }
    }
};

/*get data mediaType = 1 */
101
CONTENTVIEW_GETDATA.getMediaType1 = function(iValueObj) {
102 103 104 105 106 107 108
    /*
    * Action Type = 1 : video
    * Action Type = 2 : music
    * Action Type = 3 : url
    * Action Type = 4 : image preview
    * Action Type = 5 : jump page
    * Action Type = 6 : email
109
    * Action Type = 7 :
110 111 112 113 114
    * Action Type = 8 : popup
    * Action Type = 9 : video
    * Action Type = 10 : content
    * Action Type = 11 : html
    */
115

116 117 118 119 120 121 122 123 124 125 126 127
    var pageObject = [];

    pageObject['mediaType'] = iValueObj.mediaType;
    pageObject['actionType'] = iValueObj.action.actionType;
    pageObject['visible'] = true;

    /*get location */
    pageObject['x'] = iValueObj.location.x;
    pageObject['y'] = iValueObj.location.y;
    pageObject['width'] = iValueObj.location.width;
    pageObject['height'] = iValueObj.location.height;
    pageObject['id'] = "MediaType1_" + iValueObj.action.actionType;
128

129 130 131 132 133 134
    //詳細ログ用
    try{
        pageObject["objectId"] = iValueObj.action.objectId;
    }catch(e){
        pageObject["objectId"] = "";
    }
135

136 137 138 139
    if (iValueObj.action.actionType == 0) {
        /*get mediaInfo */
        if (iValueObj.mediaInfo) {
            /* get image from Json */
140
            pageObject['imageUrl'] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
141 142 143 144 145 146 147
        } else {
            pageObject['imageUrl'] = null;
        }
    } else if (iValueObj.action.actionType == 1) {
        /*get mediaInfo */
        if (iValueObj.mediaInfo) {
            /* get image from Json */
148
            pageObject['imageUrl'] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
149 150 151 152 153 154
        } else {
            pageObject['imageUrl'] = null;
        }

        /*get video file */
        if (iValueObj.action.video) {
155
            pageObject['mediaFile'] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceName=" + COMMON.removeExt(iValueObj.action.video);
156
            pageObject['media'] = iValueObj.action.video;
Masaru Abe committed
157
            pageObject['mediaResourceId'] = iValueObj.action.resourceId;
158 159 160
        } else {
            pageObject['mediaFile'] = '';
            pageObject['media'] = '';
Masaru Abe committed
161
            pageObject['mediaResourceId'] = '';
162 163 164 165 166 167
        }

    } else if (iValueObj.action.actionType == 2) {
        /*get mediaInfo */
        if (iValueObj.mediaInfo) {
            /* get image from Json */
168
            pageObject['imageUrl'] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
169 170 171 172 173 174
        } else {
            pageObject['imageUrl'] = null;
        }

        /*get video file */
        if (iValueObj.action.music) {
175
            if (CONTENTVIEW_GENERAL.avwUserEnvObj.browser == 'msie') {
176
                pageObject['audioFile'] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceName=" + COMMON.removeExt(iValueObj.action.music) + "&isIE=true";
177
            } else {
178
                pageObject['audioFile'] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceName=" + COMMON.removeExt(iValueObj.action.music);
179
            }
Masaru Abe committed
180 181
            pageObject['audio'] = iValueObj.action.music;
            pageObject['audioResourceId'] = iValueObj.action.resourceId;
182 183
        } else {
            pageObject['audioFile'] = '';
Masaru Abe committed
184 185
            pageObject['audio'] = "";
            pageObject['audioResourceId'] = "";
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212
        }

    } else if (iValueObj.action.actionType == 3) {
        /*get browserType */
        if (iValueObj.action.browserType) {
            pageObject['browserType'] = iValueObj.action.browserType;
        } else {
            pageObject['browserType'] = '';
        }

        /*get browser */
        if (iValueObj.action.browser) {
            pageObject['browser'] = iValueObj.action.browser;
        } else {
            pageObject['browser'] = '';
        }

        /*get linkUrl */
        if (iValueObj.action.linkUrl) {
            pageObject['linkUrl'] = iValueObj.action.linkUrl;
        } else {
            pageObject['linkUrl'] = '';
        }

        /*get mediaInfo */
        if (iValueObj.mediaInfo) {
            /* get image from Json */
213
            pageObject['imageUrl'] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
214 215 216 217 218 219 220 221 222 223 224
        } else {
            pageObject['imageUrl'] = null;
        }

        /* action */
        pageObject['action'] = null;

    } else if (iValueObj.action.actionType == 4) {
        /*get mediaInfo */
        if (iValueObj.mediaInfo.resourceId) {
            /* get image from Json */
225
            pageObject['imageUrl'] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
226 227 228 229 230 231 232
        } else {
            pageObject['imageUrl'] = null;
        }

        /*get Image Preview */
        var dataResourceImage = iValueObj.action.preview;
        var dataImageFromResource = [];
Masaru Abe committed
233
        pageObject['imagePreviewResourceIds'] = [];
234
        //START TRB00077 - Editor : Long - Date: 09/24/2013- Summary : Display image preview no image
235
        if(dataResourceImage){
236
            for (var nIndex = 0; nIndex < dataResourceImage.length; nIndex++) {
237
                dataImageFromResource.push(AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceName=" + COMMON.removeExt(dataResourceImage[nIndex]));
238
            }
Masaru Abe committed
239
            pageObject['imagePreviewResourceIds'] = iValueObj.action.resourceIds;
240
        }
241 242 243 244 245 246 247
        //END TRB00077 - Editor : Long - Date: 09/24/2013- Summary : Display image preview no image
        pageObject['imagePreview'] = dataImageFromResource;

    } else if (iValueObj.action.actionType == 5) {
        /*get mediaInfo */
        if (iValueObj.mediaInfo.resourceId) {
            /* get image from Json */
248
            pageObject['imageUrl'] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264
        } else {
            pageObject['imageUrl'] = null;
        }

        /*get Image Preview */
        if (iValueObj.action.jumpPage) {
            pageObject['jumpPage'] = iValueObj.action.jumpPage;
        } else {
            pageObject['jumpPage'] = '';
        }

    }
    else if (iValueObj.action.actionType == 6) {
        /*get mediaInfo */
        if (iValueObj.mediaInfo.resourceId) {
            /* get image from Json */
265
            pageObject['imageUrl'] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288
        } else {
            pageObject['imageUrl'] = null;
        }

        /*get emailSubject */
        if (iValueObj.action.emailSubject) {
            pageObject['emailSubject'] = iValueObj.action.emailSubject;
        } else {
            pageObject['emailSubject'] = '';
        }

        /*get emailAddress */
        if (iValueObj.action.emailAddress) {
            pageObject['emailAddress'] = iValueObj.action.emailAddress;
        } else {
            pageObject['emailAddress'] = '';
        }

    }
    else if (iValueObj.action.actionType == 8) {
        /*get mediaInfo */
        if (iValueObj.mediaInfo.resourceId) {
            /* get image from Json */
289
            pageObject['imageUrl'] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
290 291 292 293 294 295 296 297 298 299 300
        } else {
            pageObject['imageUrl'] = null;
        }

        /*get content */
        pageObject['content'] = iValueObj.action.content;
    }
    else if (iValueObj.action.actionType == 10) {
        /*get mediaInfo */
        if (iValueObj.mediaInfo.resourceId) {
            /* get image from Json */
301
            pageObject['imageUrl'] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
302 303 304 305 306 307 308 309 310 311 312
        } else {
            pageObject['imageUrl'] = null;
        }

        /*get contentId */
        pageObject['contentId'] = iValueObj.action.contentId;

        /*get pageNo */
        pageObject['pageNo'] = iValueObj.action.pageNo;

    }
313
    //Start Function : No.9 - Editor : Long - Date: 08/16/2013 - Summary :
314 315 316
    else if(iValueObj.action.actionType == 11){
        var resourceId = iValueObj.action.resourceId;
        var resourceUrl = "";
317

318 319
        //START TRB00093 - Editor : Long - Date: 09/26/2013 - Summary : Check undefine before get
        if(iValueObj.contentDataSub){
320

321 322
            for(var i = 0; i < iValueObj.contentDataSub.length; i++){
                var tempData = iValueObj.contentDataSub[i];
323

324
                if(tempData.resourceId == resourceId){
325

326
                    resourceUrl = tempData.resourceUrl;
327 328
                    //HTMLカスタムログオプション有り
                    if(ClientData.serviceOpt_html_custom_log() == 'Y'){
Masaru Abe committed
329
                        var apiUrl = AVWEB.getApiUrl(ClientData.userInfo_accountPath());
330
                        resourceUrl = resourceUrl + "?sid=" + CONTENTVIEW.getSessionId() + "&apiurl=" + apiUrl + "&cid=" + CONTENTVIEW_GENERAL.contentID;
331
                    }
332 333 334
                    break;
                }
            }
335
        }
336
        //END TRB00093 - Editor : Long - Date: 09/26/2013 - Summary : Check undefine before get
337

Masaru Abe committed
338
    	//CONTENTVIEW_STREAMING.debugLog("resourceUrl:" + obj.resourceUrl);
339

340
        pageObject["imageUrl"] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
341 342 343
        pageObject["resourceUrl"] = resourceUrl;
    }
    else if(iValueObj.action.actionType == 12){
344

345
        pageObject["imageUrl"] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
346
        pageObject["resourceUrl"] = resourceUrl;
347

348 349 350 351
        pageObject["questionNo"] = iValueObj.action.questionNo;
        pageObject["replyLimit"] = iValueObj.action.replyLimit;
        pageObject["fullScreen"] = iValueObj.action.fullScreen;
        pageObject["saveAs"] = iValueObj.action.saveAs;
Masaru Abe committed
352 353
        pageObject["resourceId"] = iValueObj.action.resourceId;
        pageObject["enquete"] = iValueObj.action.enquete;
354
        //pageObject["objectId"] = iValueObj.action.objectId;
355
    }
356 357 358 359 360
    else if(iValueObj.action.actionType == 14){

        pageObject["imageUrl"] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
        pageObject["resourceUrl"] = resourceUrl;

361 362
        pageObject["showResult"] = iValueObj.action.showResult;
        pageObject["sendResult"] = iValueObj.action.sendResult;
363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381
        pageObject["replyLimit"] = iValueObj.action.replyLimit;
        pageObject["fullScreen"] = iValueObj.action.fullScreen;
        pageObject["saveAs"] = iValueObj.action.saveAs;
        pageObject["resourceId"] = iValueObj.action.resourceId;
        pageObject["enquete"] = iValueObj.action.enquete;
        //pageObject["objectId"] = iValueObj.action.objectId;
    }
    else if(iValueObj.action.actionType == 15){

        pageObject["imageUrl"] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
        pageObject["resourceUrl"] = resourceUrl;

        pageObject["replyLimit"] = iValueObj.action.replyLimit;
        pageObject["fullScreen"] = iValueObj.action.fullScreen;
        pageObject["saveAs"] = iValueObj.action.saveAs;
        pageObject["resourceId"] = iValueObj.action.resourceId;
        pageObject["enquete"] = iValueObj.action.enquete;
        //pageObject["objectId"] = iValueObj.action.objectId;
    }
382
    //End Function : No.9 - Editor : Long - Date: 08/16/2013 - Summary :
383 384 385
    return pageObject;
};

386
CONTENTVIEW_GETDATA.getMediaType2 = function(iValueObj) {
387 388 389 390 391 392 393 394 395 396 397 398 399 400 401
    var pageObject = [];

    pageObject['mediaType'] = iValueObj.mediaType;

    /*get actionType*/
    if (iValueObj.action.actionType) {
        pageObject['actionType'] = iValueObj.action.actionType;
    } else {
        pageObject['actionType'] = '';
    }

    pageObject['id'] = "media" + iValueObj.mediaInfo.resourceId;

    /*get mediaInfo */
    if (iValueObj.mediaInfo.resourceId) {
402
        pageObject['mediaFile'] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
Masaru Abe committed
403
        pageObject['media'] = iValueObj.mediaInfo.resourceId; //video1のほうはリソース名で取得している。IDのほうが良いのでは。
404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424
    } else {
        pageObject['mediaFile'] = '';
        pageObject['media'] = '';
    }

    /*get mediaInfo */
    if (iValueObj.action.embed) {
        pageObject['embed'] = iValueObj.action.embed;
    } else {
        pageObject['embed'] = '';
    }

    pageObject['imageUrl'] = 'img/iPad_video.png';

    /*get location */
    pageObject['x'] = iValueObj.location.x;
    pageObject['y'] = iValueObj.location.y;
    pageObject['width'] = iValueObj.location.width;
    pageObject['height'] = iValueObj.location.height;
    pageObject['visible'] = true;

425 426 427 428 429 430
    //詳細ログ用
    try{
        pageObject["objectId"] = iValueObj.action.objectId;
    }catch(e){
        pageObject["objectId"] = "";
    }
431

432 433 434
    return pageObject;
};

435
CONTENTVIEW_GETDATA.getMediaType3 = function(iValueObj) {
436 437 438 439 440 441 442 443 444 445 446 447 448 449 450
    var pageObject = [];

    pageObject['mediaType'] = iValueObj.mediaType;

    /*get actionType*/
    if (iValueObj.action.actionType) {
        pageObject['actionType'] = iValueObj.action.actionType;
    } else {
        pageObject['actionType'] = '';
    }

    pageObject['id'] = "audio" + iValueObj.mediaInfo.resourceId;

    /*get mediaInfo */
    if (iValueObj.mediaInfo.resourceId) {
451
        if (CONTENTVIEW_GENERAL.avwUserEnvObj.browser == 'msie') {
452
            pageObject['audioFile'] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + iValueObj.mediaInfo.resourceId + "&isIE=true";
453
        } else {
454
            pageObject['audioFile'] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
455
        }
Masaru Abe committed
456
        pageObject['audioResourceId'] = iValueObj.mediaInfo.resourceId;
457 458
    } else {
        pageObject['audioFile'] = '';
Masaru Abe committed
459
        pageObject['audioResourceId'] = '';
460 461 462 463 464 465 466 467 468 469 470 471 472 473
    }

    /*get playtype */
    pageObject['playType'] = iValueObj.action.playType;

    pageObject['imageUrl'] = 'img/iPad_music.png';

    /*get location */
    pageObject['x'] = iValueObj.location.x;
    pageObject['y'] = iValueObj.location.y;
    pageObject['width'] = iValueObj.location.width;
    pageObject['height'] = iValueObj.location.height;
    pageObject['visible'] = true;

474 475 476 477 478 479
    //詳細ログ用
    try{
        pageObject["objectId"] = iValueObj.action.objectId;
    }catch(e){
        pageObject["objectId"] = "";
    }
480

481 482 483
    return pageObject;
};

484
CONTENTVIEW_GETDATA.getMediaType4 = function(iValueObj) {
485 486 487 488 489 490 491 492 493 494 495
    var pageObject = [];

    pageObject['mediaType'] = iValueObj.mediaType;

    pageObject['id'] = iValueObj.mediaInfo.id;

    /*get image List info */
    var imageObjects = iValueObj.mediaInfo.media;

    for (var nIndex = 0; nIndex < imageObjects.length; nIndex++) {
        /* get image from Json */
496
        imageObjects[nIndex].fileName = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + imageObjects[nIndex].resourceId;
497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521
    }

    pageObject['dataObjects'] = imageObjects;

    if (iValueObj.mediaInfo.triggerType) {
        pageObject['triggerType'] = iValueObj.mediaInfo.triggerType;
    } else {
        pageObject['triggerType'] = '';
    }

    /*get image url */
    if (imageObjects.length > 0) {
        pageObject['imageUrl'] = imageObjects[0].fileName;
    } else {
        pageObject['imageUrl'] = null;
    }


    /*get location */
    pageObject['x'] = iValueObj.location.x;
    pageObject['y'] = iValueObj.location.y;
    pageObject['width'] = iValueObj.location.width;
    pageObject['height'] = iValueObj.location.height;
    pageObject['visible'] = true;

522 523 524 525 526 527
    //詳細ログ用(使わない)
    try{
        pageObject["objectId"] = iValueObj.action.objectId;
    }catch(e){
        pageObject["objectId"] = "";
    }
528

529 530 531
    return pageObject;
};

532
CONTENTVIEW_GETDATA.getMediaType5 = function(iValueObj) {
533 534 535 536 537 538 539 540 541 542
    var pageObject = [];

    pageObject['mediaType'] = iValueObj.mediaType;

    pageObject['id'] = iValueObj.mediaInfo.id;

    /*get video List info */
    var videoObjects = iValueObj.mediaInfo.media;
    for (var nIndex = 0; nIndex < videoObjects.length; nIndex++) {
        /* get image from Json */
543
        videoObjects[nIndex].fileName = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + videoObjects[nIndex].resourceId;
544 545 546 547 548 549 550 551 552 553 554 555 556 557
    }

    pageObject['dataObjects'] = videoObjects;

    /*get image url */
    pageObject['imageUrl'] = '';

    /*get location */
    pageObject['x'] = iValueObj.location.x;
    pageObject['y'] = iValueObj.location.y;
    pageObject['width'] = iValueObj.location.width;
    pageObject['height'] = iValueObj.location.height;
    pageObject['visible'] = true;

558 559 560 561 562 563
    //詳細ログ用(使わない)
    try{
        pageObject["objectId"] = iValueObj.action.objectId;
    }catch(e){
        pageObject["objectId"] = "";
    }
564

565 566 567
    return pageObject;
};

568
CONTENTVIEW_GETDATA.getMediaType6 = function(iValueObj) {
569 570 571 572 573 574 575 576 577 578 579
    var pageObject = [];

    pageObject['mediaType'] = iValueObj.mediaType;

    /*get actionType*/
    if (iValueObj.action.actionType) {
        pageObject['actionType'] = iValueObj.action.actionType;
    } else {
        pageObject['actionType'] = '';
    }

580

581 582 583 584 585 586 587 588 589
    if(iValueObj.mediaInfo.resourceId){
        pageObject['id'] = "trigger" + iValueObj.mediaInfo.resourceId;
    }
    else if(iValueObj.mediaInfo.resourceThumbnailId){
        pageObject['id'] = "trigger" + iValueObj.mediaInfo.resourceThumbnailId;
    }

    /*get mediaInfo */
    if (iValueObj.mediaInfo) {
590

591 592
        if(iValueObj.mediaInfo.resourceId){
            /* get image from Json */
593
            pageObject['imageUrl'] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
594 595 596 597
        }
        else{
            pageObject['imageUrl'] = 'img/iPad_video.png';
        }
598 599

    }
600 601 602 603 604 605 606
    else {
        pageObject['imageUrl'] = null;
    }

    /*get index */
    if (iValueObj.action.index) {
        pageObject['index'] = iValueObj.action.index;
607
    }
608 609 610 611 612 613 614
    else {
        pageObject['index'] = '';
    }

    /*get target */
    if (iValueObj.action.target) {
        pageObject['target'] = iValueObj.action.target;
615
    }
616 617 618 619 620 621 622 623 624 625 626
    else {
        pageObject['target'] = '';
    }

    /*get location */
    pageObject['x'] = iValueObj.location.x;
    pageObject['y'] = iValueObj.location.y;
    pageObject['width'] = iValueObj.location.width;
    pageObject['height'] = iValueObj.location.height;
    pageObject['visible'] = true;

627 628 629 630 631 632
    //詳細ログ用
    try{
        pageObject["objectId"] = iValueObj.action.objectId;
    }catch(e){
        pageObject["objectId"] = "";
    }
633

634 635 636
    return pageObject;
};

637
CONTENTVIEW_GETDATA.getMediaType7 = function(iValueObj) {
638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668
    var pageObject = [];

    pageObject['mediaType'] = iValueObj.mediaType;

    /*get actionType*/
    if (iValueObj.action.actionType) {
        pageObject['actionType'] = iValueObj.action.actionType;
    } else {
        pageObject['actionType'] = '';
    }

    pageObject['id'] = "testText";

    /*get mediaInfo */
    if (iValueObj.mediaInfo.content) {
        pageObject['content'] = iValueObj.mediaInfo.content;
    } else {
        pageObject['content'] = '';
    }

    if (iValueObj.action) {
        pageObject['action'] = "";
    }

    /*get location */
    pageObject['x'] = iValueObj.location.x;
    pageObject['y'] = iValueObj.location.y;
    pageObject['width'] = iValueObj.location.width;
    pageObject['height'] = iValueObj.location.height;
    pageObject['visible'] = true;

669 670 671 672 673 674
    //詳細ログ用(使わない)
    try{
        pageObject["objectId"] = iValueObj.action.objectId;
    }catch(e){
        pageObject["objectId"] = "";
    }
675

676 677 678 679
    return pageObject;
};

//Start Function : No.9 - Editor : Long - Date : 08/15/2013 - Summary : Handle 3d object
680
CONTENTVIEW_GETDATA.getMediaType8 = function(iValueObj) {
681
    var pageObject = [];
682

683 684 685 686
    //Get object Info
    pageObject['mediaType'] = iValueObj.mediaType;
    pageObject['id'] = "MediaType8_" + iValueObj.mediaInfo.resourceId;
    pageObject['actionType'] = iValueObj.action.actionType;
687

688 689 690 691 692 693
    //Get object Location
    pageObject['x'] = iValueObj.location.x;
    pageObject['y'] = iValueObj.location.y;
    pageObject['width'] = iValueObj.location.width;
    pageObject['height'] = iValueObj.location.height;
    pageObject['visible'] = true;
694

695
    if(iValueObj.action.actionType == 9){
696

697 698
        pageObject['horizonCount'] = iValueObj.mediaInfo.horizonCount;
        pageObject['verticalCount'] = iValueObj.mediaInfo.verticalCount;
699
        pageObject['initImage'] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
700

701 702 703 704
        var _3dViewObject = [];
        var data3d = iValueObj.action["3dview"];

        var horizonCnt = 0;
705 706 707
        var verticalCnt = 1;


708 709 710 711 712 713 714 715 716 717
        while(verticalCnt <= iValueObj.mediaInfo.verticalCount){
             horizonCnt++;
             if(horizonCnt > iValueObj.mediaInfo.horizonCount){
                verticalCnt++;
                if(verticalCnt > iValueObj.mediaInfo.verticalCount){
                    break;
                }
                horizonCnt = 1;
             }

718 719
             _3dViewObject[CONTENTVIEW_GETDATA.convNumTo2Char(verticalCnt)+"-"+CONTENTVIEW_GETDATA.convNumTo2Char(horizonCnt)] =
                            AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId()
720
                            + "&resourceId=" + data3d[CONTENTVIEW_GETDATA.convNumTo2Char(verticalCnt) +"-"+ CONTENTVIEW_GETDATA.convNumTo2Char(horizonCnt)].resourceId;
721 722
        }

723 724 725
        pageObject['3dview'] = _3dViewObject;
    }

726 727 728 729 730 731
    //詳細ログ用
    try{
        pageObject["objectId"] = iValueObj.action.objectId;
    }catch(e){
        pageObject["objectId"] = "";
    }
732

733 734 735
    return pageObject;
};

736
CONTENTVIEW_GETDATA.getMediaType9 = function(iValueObj) {
737
    var pageObject = [];
738

739 740 741 742
    //Get object Info
    pageObject['mediaType'] = iValueObj.mediaType;
    pageObject['id'] = "MediaType9_" + iValueObj.mediaInfo.resourceId;
    pageObject['actionType'] = iValueObj.action.actionType;
743

744 745 746 747 748 749
    //Get object Location
    pageObject['x'] = iValueObj.location.x;
    pageObject['y'] = iValueObj.location.y;
    pageObject['width'] = iValueObj.location.width;
    pageObject['height'] = iValueObj.location.height;
    pageObject['visible'] = true;
750

751 752 753 754 755 756
    //詳細ログ用
    try{
        pageObject["objectId"] = iValueObj.action.objectId;
    }catch(e){
        pageObject["objectId"] = "";
    }
757 758

    if(iValueObj.action.actionType == 11){
759 760
        var resourceId = iValueObj.mediaInfo.resourceId;
        var resourceUrl = "";
761

762 763 764 765
        //START TRB00093 - Editor : Long - Date: 09/26/2013 - Summary : Check undefine before get
        if(iValueObj.contentDataSub){
            for(var i = 0; i < iValueObj.contentDataSub.length; i++){
                var tempData = iValueObj.contentDataSub[i];
766

767 768
                if(tempData.resourceId == resourceId){
                    resourceUrl = tempData.resourceUrl;
769 770
                    //HTMLカスタムログオプション有り
                    if(ClientData.serviceOpt_html_custom_log() == 'Y'){
Masaru Abe committed
771
                        var apiUrl = AVWEB.getApiUrl(ClientData.userInfo_accountPath());
772
                        resourceUrl = resourceUrl + "?sid=" + CONTENTVIEW.getSessionId() + "&apiurl=" + apiUrl + "&cid=" + CONTENTVIEW_GENERAL.contentID;
773
                    }
774 775 776
                    break;
                }
            }
777
        }
778
        //START TRB00093 - Editor : Long - Date: 09/26/2013 - Summary : Check undefine before get
779

780
        pageObject["imageUrl"] = 'img/htmltype.png';
781
        pageObject["resourceUrl"] = resourceUrl;
782 783 784 785 786
    }

    return pageObject;
};

787
CONTENTVIEW_GETDATA.getMediaType11 = function(iValueObj) {
788 789 790
    var pageObject = [];
    //Get object Info
    pageObject['mediaType'] = iValueObj.mediaType;
Masaru Abe committed
791
    pageObject['id'] = "MediaType11_" + iValueObj.mediaInfo.resourceId;
792
    pageObject['actionType'] = iValueObj.action.actionType;
793

794 795 796 797 798 799
    //Get object Location
    pageObject['x'] = iValueObj.location.x;
    pageObject['y'] = iValueObj.location.y;
    pageObject['width'] = iValueObj.location.width;
    pageObject['height'] = iValueObj.location.height;
    pageObject['visible'] = true;
800

801 802 803 804 805 806
    //詳細ログ用
    try{
        pageObject["objectId"] = iValueObj.action.objectId;
    }catch(e){
        pageObject["objectId"] = "";
    }
807 808

    if(iValueObj.action.actionType == 12){
809
        var resourceId = iValueObj.mediaInfo.resourceId;
810

811
        pageObject["imageUrl"] = 'img/anket.jpg';
812

813 814 815 816
        pageObject["questionNo"] = iValueObj.action.questionNo;
        pageObject["replyLimit"] = iValueObj.action.replyLimit;
        pageObject["fullScreen"] = iValueObj.action.fullScreen;
        pageObject["saveAs"] = iValueObj.action.saveAs;
Masaru Abe committed
817 818 819
        pageObject["resourceId"] = resourceId;
        pageObject["enquete"] = iValueObj.action.enquete;
        //pageObject["objectId"] = iValueObj.action.objectId;
820 821 822 823 824
    }

    return pageObject;
};

825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850
CONTENTVIEW_GETDATA.getMediaType12 = function(iValueObj) {

	var pageObject = [];

	//Get object Info
	pageObject['mediaType'] = iValueObj.mediaType;
	pageObject['id'] = "MediaType12_" + iValueObj.mediaInfo.resourceId;
	pageObject['actionType'] = iValueObj.action.actionType;

	//Get object Location
	pageObject['x'] = iValueObj.location.x;
	pageObject['y'] = iValueObj.location.y;
	pageObject['width'] = iValueObj.location.width;
	pageObject['height'] = iValueObj.location.height;
	pageObject['visible'] = true;

	//詳細ログ用
    try{
        pageObject["objectId"] = iValueObj.action.objectId;
    }catch(e){
        pageObject["objectId"] = "";
    }

    if(iValueObj.action.actionType == 14){
    	var resourceId = iValueObj.mediaInfo.resourceId;

851
    	pageObject["imageUrl"] = 'img/test.png';
852 853 854 855 856 857 858 859 860 861 862 863

    	pageObject["replyLimit"] = iValueObj.action.replyLimit;
        pageObject["fullScreen"] = iValueObj.action.fullScreen;
        pageObject["saveAs"] = iValueObj.action.saveAs;
        pageObject["resourceId"] = resourceId;
        pageObject["enquete"] = iValueObj.action.enquete;
        pageObject["showResult"] = iValueObj.action.showResult;
        pageObject["sendResult"] = iValueObj.action.sendResult;
        //pageObject["objectId"] = iValueObj.action.objectId;
    }

    return pageObject;
864
};
865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891

CONTENTVIEW_GETDATA.getMediaType13 = function(iValueObj) {

	var pageObject = [];

	//Get object Info
	pageObject['mediaType'] = iValueObj.mediaType;
	pageObject['id'] = "MediaType12_" + iValueObj.mediaInfo.resourceId;
	pageObject['actionType'] = iValueObj.action.actionType;

	//Get object Location
	pageObject['x'] = iValueObj.location.x;
	pageObject['y'] = iValueObj.location.y;
	pageObject['width'] = iValueObj.location.width;
	pageObject['height'] = iValueObj.location.height;
	pageObject['visible'] = true;

	//詳細ログ用
    try{
        pageObject["objectId"] = iValueObj.action.objectId;
    }catch(e){
        pageObject["objectId"] = "";
    }

    if(iValueObj.action.actionType == 15){
    	var resourceId = iValueObj.mediaInfo.resourceId;

892
    	pageObject["imageUrl"] = 'img/quize.png';
893 894 895 896 897 898 899 900 901 902

    	pageObject["replyLimit"] = iValueObj.action.replyLimit;
        pageObject["fullScreen"] = iValueObj.action.fullScreen;
        pageObject["saveAs"] = iValueObj.action.saveAs;
        pageObject["resourceId"] = resourceId;
        pageObject["enquete"] = iValueObj.action.enquete;
        //pageObject["objectId"] = iValueObj.action.objectId;
    }

    return pageObject;
903
};
904

905
CONTENTVIEW_GETDATA.convNumTo2Char = function(num){
906 907 908
    var nRet = "";
    if(num < 10)
        nRet = "0" + num;
909
    else
910 911 912 913 914 915
        nRet =  "" + num;
    return nRet;
};
//End Function : No.9 - Editor : Long - Date : 08/15/2013 - Summary : Handle 3d object

/* get page index */
916 917
CONTENTVIEW_GETDATA.getPageIndex = function() {
    var content = CONTENTVIEW_GETDATA.getContent();
918 919 920 921
    return eval(content.pageIndex);
};

/* get data marking from local storage */
922
CONTENTVIEW_GETDATA.getDataClientStorage = function() {
923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943
    /*set default size and color */
    if (!ClientData.penOpt_size()) {
        ClientData.penOpt_size(5);
    }

    if (!ClientData.penOpt_color()) {
        ClientData.penOpt_color("fe0000");
    }

    if (!ClientData.maker_size()) {
        ClientData.maker_size(5);
    }

    if (!ClientData.maker_color()) {
        ClientData.maker_color("f8ff00");
    }

    if (!ClientData.erase_size()) {
        ClientData.erase_size(5);
    }

944 945 946 947 948 949 950
    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();
951 952 953 954
};


/* get list bookmark of content */
955
CONTENTVIEW_GETDATA.getBookMarkListByContentID = function() {
956 957 958 959 960
    var bmList = [];
    var bmListResult = [];
    bmList = ClientData.BookMarkData();

    for (var nIndex = 0; nIndex < bmList.length; nIndex++) {
961
        if (bmList[nIndex].contentid == CONTENTVIEW_GENERAL.contentID) {
962 963 964 965 966 967 968 969
            bmListResult.push(bmList[nIndex]);
        }
    }

    return bmListResult;
};

/* get data load*/
970
CONTENTVIEW_GETDATA.getDataLoaded = function(data) {
971 972 973 974
    var isExist = false;

    for (var i = 0; i < data.length; i++) {
        isExist = false;
975 976
        for (var n = 0; n < CONTENTVIEW_GENERAL.arrThumbnailsLoaded.length; n++) {
            if (data[i].pageNo == CONTENTVIEW_GENERAL.arrThumbnailsLoaded[n].pageNo) {
977 978 979 980 981 982 983
                isExist = true;
                break;
            }
        }

        /* insert if not exist */
        if (isExist == false) {
984
        	CONTENTVIEW_GENERAL.arrThumbnailsLoaded.push(data[i]);
985 986 987 988
        }
    }

    /* sort data */
989
    CONTENTVIEW_GENERAL.arrThumbnailsLoaded.sort(function (a, b) {
990 991 992 993 994 995 996 997 998
        var a1 = a.pageNo, b1 = b.pageNo;
        if (a1 == b1) return 0;
        return a1 > b1 ? 1 : -1;
    });

};


/* get list info bookmark */
999
CONTENTVIEW_GETDATA.getBookmarklist = function(pos) {
1000
    var isExistBookMarkInContent = false;
1001
    CONTENTVIEW.sortBookmarkList();
1002 1003 1004 1005
    var bmList = [];
    bmList = ClientData.BookMarkData();

    for (var nIndex = 0; nIndex < bmList.length; nIndex++) {
1006
        if (bmList[nIndex].contentid == CONTENTVIEW_GENERAL.contentID) {
1007 1008 1009 1010 1011 1012 1013
            isExistBookMarkInContent = true;
            break;
        }
    }

    if (isExistBookMarkInContent == false) {
        $('#divListBookmark').children().remove();
1014
        $('#divListBookmark').append('<span class="last">' + I18N.i18nText('msgShioriNotExists') + '</span>');
1015 1016 1017 1018

        //title start
        $('#bookmarkBoxHdBM').children().remove();
        $('#bookmarkBoxHdBM').html('<a id="bookmarkClosing" class="delete" > </a>');
1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029
        //$("#bookmarkClosing").click(CONTENTVIEW_EVENTS.closeBookmarkBox);
        $("#bookmarkClosing").on({
        	'click touchend': function(ev){
        		CONTENTVIEW_EVENTS.closeBookmarkBox(ev);
                return false;
        	},
        	'touchstart touchmove': function(){
        		//これを入れないと次にダイアログを開くと表示位置が大きくズレる
        		return false;
        	}
        });
1030

1031
        $('#bookmarkBoxHdBM').append(I18N.i18nText('txtShioriCtnLs'));
1032
        //title end
Masaru Abe committed
1033
        //COMMON.lockLayout();
1034 1035 1036 1037 1038 1039 1040
        $('#boxBookMark').css('z-index', '101');
        $('#boxBookMark').css('display', 'block');
        $('#boxBookMark').draggable({ handle: "h1" });
        $("#boxBookMark").offset({ left: pos[0], top: pos[1] });
        $("#divListBookmark").show();
        $("#divListBookmark").offset({ left: pos[0], top: (pos[1] + $('#bookmarkBoxHdBM').height()) });
    }
1041
    else {
1042
    	CONTENTVIEW.handleAPIWebContentPage(CONTENTVIEW_GENERAL.dataWebContentPage, pos)
1043 1044 1045 1046
    }
};

/* get list info bookmark */
1047 1048
CONTENTVIEW_GETDATA.getPageIndexJson = function(pos) {
    if (CONTENTVIEW_GENERAL.dataJsonType5.length > 0) {
1049 1050
        $('#divListIndex').children().remove();

1051
        // $("#divListIndex").dialog({
1052 1053
        // show: "blind",
        // modal: true,
1054 1055
        // width: CONTENTVIEW_GENERAL.WIDTH_DIALOG_INDEX,
        // height:CONTENTVIEW_GENERAL.HEIGHT_DIALOG_INDEX,
1056 1057
        // resizable:false,
        // closeOnEscape: false,
1058
        // title: I18N.i18nText('txtIndex'),
1059 1060 1061 1062 1063
        // position: pos});

        //title start
        $('#indexBoxHdIndex').children().remove();
        $('#indexBoxHdIndex').html('<a id="indexClosing" class="delete" > </a>');
1064

1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075
        //$("#indexClosing").click(CONTENTVIEW_EVENTS.closeIndexBox);
        $("#indexClosing").on({
        	'click touchend': function(ev){
        		CONTENTVIEW_EVENTS.closeIndexBox(ev);
        		return false;
        	},
        	'touchstart touchmove': function(){
        		//これを入れないと次にダイアログを開くと表示位置が大きくズレる
        		return false;
        	}
        });
1076

1077
        $('#indexBoxHdIndex').append(I18N.i18nText('txtIndex'));
1078
        //title end
Masaru Abe committed
1079
        //COMMON.lockLayout();
1080 1081 1082 1083 1084 1085 1086
        $('#boxIndex').css('z-index', '101');
        $('#boxIndex').css('display', 'block');
        $('#boxIndex').draggable({ handle: "h1" });
        $("#boxIndex").offset({ left: pos[0], top: pos[1] });
        $("#divListIndex").show();
        $("#divListIndex").offset({ left: pos[0], top: (pos[1] + $('#indexBoxHdIndex').height()) });

1087
        //set data for dialog index
1088
        var dataContent = CONTENTVIEW_GENERAL.dataJsonType5;
1089 1090 1091 1092 1093 1094
        var arrData = new Array();
        $.each(dataContent, function (i, value) {
            if (dataContent[i].level == 0) {
                //add parent node
                var node = new TreeNode();
                node.IsCategory = true;
Masaru Abe committed
1095
                //node.Text = COMMON.htmlEncode(COMMON.truncateByBytes(dataContent[i].title, 30));
1096
                /* check data text */
Masaru Abe committed
1097 1098
                if (COMMON.getBytes(dataContent[i].title) > 30) {
                    node.Text = COMMON.htmlEncode(COMMON.truncateByBytes(dataContent[i].title, 30)) + '...';
1099
                } else {
Masaru Abe committed
1100
                    node.Text = COMMON.htmlEncode(dataContent[i].title);
1101 1102 1103
                }
                node.id = dataContent[i].ID;
                node.Value = dataContent[i].destPageNumber;
1104
                CONTENTVIEW.AddChidrenNode(node, dataContent);
1105 1106 1107 1108 1109 1110 1111

                arrData.push(node);
            }
        });

        var tree = new TreeViewIndex();
        tree.IsShowTotal = false;
1112
        tree.Show("divListIndex", arrData, "CONTENTVIEW_EVENTS.listIndex_Callback");
1113 1114 1115 1116
        $("#divListIndex").treeview();
        $(".treeview, .treeview ul").css('padding', '0px 8px 0');
    } else {
        $('#divListIndex').children().remove();
1117
        $('#divListIndex').append('<span class="no-item">' + I18N.i18nText('msgNoIndex') + '</span>');
1118 1119

        // //show dialog index
1120
        // $("#divListIndex").dialog({
1121 1122 1123
        // show: "blind",
        // modal: true,
        // resizable:false,
1124 1125
        // width: CONTENTVIEW_GENERAL.WIDTH_DIALOG_INDEX,
        // height:CONTENTVIEW_GENERAL.HEIGHT_DIALOG_INDEX_NO_INDEX,
1126
        // title: I18N.i18nText('txtIndex'),
1127 1128 1129 1130 1131
        // position: pos});

        //title start
        $('#indexBoxHdIndex').children().remove();
        $('#indexBoxHdIndex').html('<a id="indexClosing" class="delete" > </a>');
1132

1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143
        //$("#indexClosing").click(CONTENTVIEW_EVENTS.closeIndexBox);
        $("#indexClosing").on({
        	'click touchend': function(ev){
        		CONTENTVIEW_EVENTS.closeIndexBox(ev);
                return false;
        	},
        	'touchstart touchmove': function(){
        		//これを入れないと次にダイアログを開くと表示位置が大きくズレる
        		return false;
        	}
        });
1144

1145
        $('#indexBoxHdIndex').append(I18N.i18nText('txtIndex'));
1146
        //title end
Masaru Abe committed
1147
        //COMMON.lockLayout();
1148 1149 1150 1151 1152 1153 1154 1155 1156 1157
        $('#boxIndex').css('z-index', '101');
        $('#boxIndex').css('display', 'block');
        $('#boxIndex').draggable({ handle: "h1" });
        $("#boxIndex").offset({ left: pos[0], top: pos[1] });
        $("#divListIndex").show();
        $("#divListIndex").offset({ left: pos[0], top: (pos[1] + $('#indexBoxHdIndex').height()) });

    }
};

1158
CONTENTVIEW_GETDATA.getText = function() {
1159
    /* init var page text */
1160
    var data = CONTENTVIEW_GENERAL.dataWebContentPage.pages;
1161 1162 1163 1164 1165 1166
    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 */
1167
        if (data[nIndex].pageNo == CONTENTVIEW.changePageIndex(CONTENTVIEW_GETDATA.getPageIndex())) {
Masaru Abe committed
1168
            sPageText = COMMON.htmlEncode(data[nIndex].pageText);
1169 1170 1171 1172
            break;
        }
    }
    if (sPageText == '') {
1173
        return { text: I18N.i18nText('txtNoTextCopy'), title: I18N.i18nText('txtTextCopy') + ' | ' + I18N.i18nText('sysAppTitle') };
1174 1175 1176 1177 1178 1179
    }
    else {
        var strPattern = "\n";
        var strTemp = sPageText;
        strTemp = strTemp.replaceAll(strPattern, "<br/>");
        strTemp += "<br/>";
1180
        return { text: strTemp, title: I18N.i18nText('txtTextCopy') + ' | ' + I18N.i18nText('sysAppTitle') };
1181 1182 1183 1184 1185
    }
};


/* get contentID */
1186
CONTENTVIEW_GETDATA.getContentID = function() {
1187 1188
    /* init contentID */
    if (ClientData.common_preContentId()) {
1189
    	CONTENTVIEW_GENERAL.contentID = ClientData.common_preContentId();
1190 1191 1192
        ClientData.common_preContentId(null);
    } else if (ClientData.IsJumpBack() == true) {
        var dataJump = ClientData.JumpQueue();
1193
        CONTENTVIEW_GENERAL.contentID = dataJump[dataJump.length - 1].oldContentID;
1194

Masaru Abe committed
1195 1196 1197 1198
        //ストリーミングならデバイスに通知
        if(ClientData.isStreamingMode()){
        	CONTENTVIEW_STREAMING.moveContent(CONTENTVIEW_GENERAL.contentID);
        }
1199

1200
    } else {
1201
    	CONTENTVIEW_GENERAL.contentID = ClientData.contentInfo_contentId();
1202 1203 1204 1205
    }
};

//Download resource
1206
CONTENTVIEW_GETDATA.getResourceByIdFromAPI = function(resourceId){
1207
    return AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + resourceId;
1208 1209 1210
};

//Get content info type Image
1211
CONTENTVIEW_GETDATA.getContentInfoTypeImage = function(){
1212 1213 1214 1215

    var resourceUrl = CONTENTVIEW.downloadResourceById(CONTENTVIEW_GENERAL.contentID);

    CONTENTVIEW_GENERAL.resourceImage.onload = function(){
1216
    	CONTENTVIEW_GENERAL.widthContentImage = CONTENTVIEW_GENERAL.resourceImage.width;
1217 1218 1219 1220 1221
    	CONTENTVIEW_GENERAL.heightContentImage = CONTENTVIEW_GENERAL.resourceImage.height;

        CONTENTVIEW_GETDATA.getContent().setPageImages(1, resourceUrl).setUpPage(0);
        CONTENTVIEW.handleSliderBar();

1222
        CONTENTVIEW_GETDATA.getContentDataForImageType();
1223

1224
        $('#lblSlider').text('/ ' + 1);
1225

1226 1227 1228 1229
        //Start: TRB00019 - Editor : Long - Date : 28/08/2013 - Summary : Fix for android resize
        /* window resize event */
        $(window).resize(function () {

Masaru Abe committed
1230
            if (COMMON.isTouchDevice() == true) {
Masaru Abe committed
1231
                if (CONTENTVIEW_GENERAL.avwUserEnvObj.isAndroid()) {
1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250
                    var tempRatio = document.documentElement.clientWidth / window.innerWidth;
                    if (tempRatio <= 1) {
                        // Adjust position for toolbar and footer bar
                        var top = window.innerHeight - $("#footer_toolbar_1").height();
                        $("#wrapper").css("width", window.innerWidth);
                        $("#wrapper").css("height", window.innerHeight);
                        $("#footer_toolbar_1").css("top", top + "px");
                        $("#footer_toolbar_2").css("top", top + "px");
                    }
                    else {
                        var top = $(window).height() - $("#footer_toolbar_1").height();
                        $("#wrapper").css("width", $(window).width());
                        $("#wrapper").css("height", $(window).height());
                        $("#footer_toolbar_1").css("top", top + "px");
                        $("#footer_toolbar_2").css("top", top + "px");
                    }
                }
            }

1251 1252
            CONTENTVIEW.resizeScreen();
            CONTENTVIEW_GENERAL.isChangeSizeScreen = false;
1253 1254

            /* change position dialog */
1255
            CONTENTVIEW.changePosDialog();
1256 1257

            /* close dialog popuptext */
1258
            CONTENTVIEW.closeDialogResize();
1259 1260

        });
1261

1262
        /*init Image Bookmark */
1263
        CONTENTVIEW_INITOBJECT.initImageBookmark();
1264

1265
        /* init image had draw */
1266
        CONTENTVIEW_INITOBJECT.initDisplayMarking();
1267

1268
        /* check status */
1269
        CONTENTVIEW.checkStatusImageMarking();
1270

1271
        CONTENTVIEW.trackTransforms(CONTENTVIEW_GENERAL.context_main);
1272

Masaru Abe committed
1273
        if (COMMON.isTouchDevice() == true) {
Masaru Abe committed
1274
            if (CONTENTVIEW_GENERAL.avwUserEnvObj.isAndroid()) {
1275
            	CONTENTVIEW_GENERAL.standardRatio = document.documentElement.clientWidth / window.innerWidth;
1276
                ZOOM_DETECTOR.startDetectZoom({ time: 500,
1277
                    callbackFunction: function (oldRatio, newRatio, oldW, oldH, newW, newH) {
1278
                    	CONTENTVIEW_GENERAL.currentRatio = newRatio;
1279 1280 1281 1282 1283 1284 1285 1286

                    }
                });
                var top = window.innerHeight - $("#footer_toolbar_1").height();
                $("#wrapper").css("width", window.innerWidth);
                $("#wrapper").css("height", window.innerHeight);
                $("#footer_toolbar_1").css("top", top + "px");
                $("#footer_toolbar_2").css("top", top + "px");
1287
                CONTENTVIEW.sizingScreen();
1288 1289 1290 1291 1292
            }
        }

    };
    //End: TRB00019 - Editor : Long - Date : 28/08/2013 - Summary : Fix for android resize
1293
    CONTENTVIEW_GENERAL.resourceImage.src = resourceUrl;
1294 1295
};

1296
CONTENTVIEW_GETDATA.getContentDataForImageType = function(){
1297
    var params = {
1298
        sid: CONTENTVIEW.getSessionId(),
1299
        contentId: CONTENTVIEW_GENERAL.contentID,
1300
        getType: '1',
Masaru Abe committed
1301
        isStreaming: ClientData.isStreamingMode()
1302
    };
1303

1304 1305
    CONTENTVIEW_CALLAPI.abapi('webGetContent', params, 'GET', function (data) {
    	CONTENTVIEW_GENERAL.imageTypeData = data.contentData;
1306
        //Set default page No to image Type
1307
    	CONTENTVIEW_GENERAL.imageTypeData["pageNo"] = 1;
1308 1309 1310

        document.title = data.contentData.contentName + ' | ' + I18N.i18nText('sysAppTitle');
    });
1311 1312 1313
};

/* grab viewer content object */
1314 1315
CONTENTVIEW_GETDATA.getContent = function() {
    return CONTENTVIEW.content;
1316
};
1317

1318
/* get all memo on page */
1319
CONTENTVIEW_GETDATA.getAllMemoOfPage = function() {
1320
    if (ClientData.IsDisplayMemo() == true) {
1321
    	CONTENTVIEW_CREATEOBJECT.memoObjects = [];
1322 1323 1324 1325 1326

        /*get data memo */
        var memoData = ClientData.MemoData();

        for (var nIndex = 0; nIndex < memoData.length; nIndex++) {
1327 1328
            if (memoData[nIndex].contentid == CONTENTVIEW_GENERAL.contentID
            && memoData[nIndex].pageNo == CONTENTVIEW.changePageIndex(CONTENTVIEW_GETDATA.getPageIndex())) {
1329 1330 1331
                /* create object of memo */
                var memoObject = null;

1332 1333
                if (memoData[nIndex].posY > CONTENTVIEW_GENERAL.heightEachPage - 50) {
                    memoData[nIndex].posY = CONTENTVIEW_GENERAL.heightEachPage - 50;
1334 1335
                }

1336 1337
                if (memoData[nIndex].posX > CONTENTVIEW_GENERAL.widthEachPage - 50) {
                    memoData[nIndex].posX = CONTENTVIEW_GENERAL.widthEachPage - 50;
1338
                }
1339
                memoObject = new CONTENTVIEW_CREATEOBJECT.memo(
Vo Duc Thang committed
1340 1341 1342 1343 1344 1345 1346 1347
                    nIndex,
                    memoData[nIndex].Text,
                    memoData[nIndex].posX,
                    memoData[nIndex].posY,
                    50,
                    50,
                    "img/memo.png"
                );
1348

1349
                CONTENTVIEW_CREATEOBJECT.memoObjects.push(memoObject);
1350 1351 1352 1353 1354
            }
        }
    }
};

1355 1356 1357 1358 1359 1360
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;
1361 1362 1363 1364 1365
};

//Start Function: No.4 - Editor : Long - Summary : Render Next Page Content

//Render next Page Content
1366
CONTENTVIEW_GETDATA.renderNextPage = function(){
1367

1368
    //Get next page Number
1369
    var pageNo = parseInt(CONTENTVIEW.changePageIndex(CONTENTVIEW_GETDATA.getPageIndex())) + 1;
1370

1371
    //Get next page background image
1372
    if(CONTENTVIEW_GENERAL.contentType == COMMON.ContentTypeKeys.Type_PDF){
1373

1374 1375
    		//console.log("CONTENTVIEW_GETDATA.renderNextPage");
    		AVWEB.avwGrabContentPageImage(ClientData.userInfo_accountPath(),
1376
            	{ contentId: CONTENTVIEW_GENERAL.contentID, sid: CONTENTVIEW.getSessionId(), pageNo: pageNo },
1377 1378 1379
            	function (data) {
            		CONTENTVIEW_GENERAL.nextPageImage = data;

1380
            		CONTENTVIEW_GENERAL.nextContent.setPageImages(CONTENTVIEW_GENERAL.totalPage, CONTENTVIEW_GENERAL.nextPageImage)
1381
                                 .setPageObjects(CONTENTVIEW_GENERAL.nextPageObjects)
1382
                                 .nextPage();
1383

1384 1385 1386 1387 1388
            	},
            	function (xmlHttpRequest, txtStatus, errorThrown) {
            		CONTENTVIEW.showErrorScreen();
            	}
            );
1389

1390
    }
1391
    //Start Function : No.12 - Editor : Long - Date : 08/28/2013 - Summary : Render next page content image the same with the current one
1392 1393 1394
    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)
1395
                                 .setPageObjects(CONTENTVIEW_GENERAL.nextPageObjects)
1396 1397 1398 1399 1400 1401 1402
                                 .nextPage();
    }
    //End Function : No.12 - Editor : Long - Date : 08/28/2013 - Summary : Render next page content image the same with the current one

};

//Render prev Page Content
1403
CONTENTVIEW_GETDATA.renderPrevPage = function(){
1404

1405
    //Get prev page Number
1406
    var pageNo = parseInt(CONTENTVIEW.changePageIndex(CONTENTVIEW_GETDATA.getPageIndex())) - 1;
1407

1408
    //Get prev page background image
1409
    if(CONTENTVIEW_GENERAL.contentType == COMMON.ContentTypeKeys.Type_PDF){
1410

1411 1412
    		//console.log("CONTENTVIEW_GETDATA.renderPrevPage");
    		AVWEB.avwGrabContentPageImage(ClientData.userInfo_accountPath(),
1413
        		{ contentId: CONTENTVIEW_GENERAL.contentID, sid: CONTENTVIEW.getSessionId(), pageNo: pageNo },
1414
        		function (data) {
1415 1416
        			CONTENTVIEW_GENERAL.prevPageImage = data;
        			CONTENTVIEW_GENERAL.prevContent.setPageImages(CONTENTVIEW_GENERAL.totalPage, CONTENTVIEW_GENERAL.prevPageImage)
1417
                             .setPageObjects(CONTENTVIEW_GENERAL.prevPageObjects)
1418
                             .previousPage();
1419 1420 1421 1422 1423
        		},
        		function (xmlHttpRequest, txtStatus, errorThrown) {
        			CONTENTVIEW.showErrorScreen();
        		}
        	);
1424

1425
     }
1426
    else if(CONTENTVIEW_GENERAL.contentType == COMMON.ContentTypeKeys.Type_NoFile){
1427
    	CONTENTVIEW_GENERAL.prevPageImage = CONTENTVIEW_GENERAL.pageImages;
1428
    	CONTENTVIEW_GENERAL.prevContent.setPageImages(CONTENTVIEW_GENERAL.totalPage, CONTENTVIEW_GENERAL.prevPageImage)
1429
                             .setPageObjects(CONTENTVIEW_GENERAL.prevPageObjects)
1430 1431
                             .previousPage();
    }
1432

1433 1434 1435
};

//Get next page objects by page index
1436 1437
CONTENTVIEW_GETDATA.getNextPageObjectsByPageIndex = function(contentData, nIndexPage) {
	CONTENTVIEW_GENERAL.nextPageObjects = [];
1438 1439 1440 1441
    var currentPageObjects;
    for (var nIndex = 0; nIndex < contentData.length; nIndex++) {
        if (contentData[nIndex].page == nIndexPage) {
            currentPageObjects = contentData[nIndex].objects;
1442
            //Start Function: No.9 - Editor : Long - Summary :
1443 1444 1445 1446 1447
            if(contentData[nIndex].contentDataSub != null && contentData[nIndex].contentDataSub.length > 0){
                //currentPageObjects["contentDataSub"] = contentData[nIndex].contentDataSub;
                for(var i = 0; i < currentPageObjects.length; i++){
                    var tempObj = currentPageObjects[i];
                    tempObj["contentDataSub"] = contentData[nIndex].contentDataSub;
1448 1449 1450
                }
            }
            //End Function: No.9 - Editor : Long
1451 1452 1453
            break;
        }
    }
1454 1455


1456 1457 1458 1459
    if (currentPageObjects != undefined) {
        for (var nIndex = 0; nIndex < currentPageObjects.length; nIndex++) {
            /*get object page*/
            if (currentPageObjects[nIndex].mediaType == 1) {/*media type = 1 */
1460
                var pageObject = CONTENTVIEW_GETDATA.getMediaType1(currentPageObjects[nIndex]);
Masaru Abe committed
1461 1462
            	/*add object to page */
            	CONTENTVIEW_GENERAL.nextPageObjects.push(pageObject);
1463
            } else if (currentPageObjects[nIndex].mediaType == 2) { /*mediaType = 2 */
1464
                var pageObject = CONTENTVIEW_GETDATA.getMediaType2(currentPageObjects[nIndex]);
1465
                /*add object to page */
1466
                CONTENTVIEW_GENERAL.nextPageObjects.push(pageObject);
1467
            } else if (currentPageObjects[nIndex].mediaType == 3) { /*mediaType = 3*/
1468
                var pageObject = CONTENTVIEW_GETDATA.getMediaType3(currentPageObjects[nIndex]);
1469
                /*add object to page */
1470
                CONTENTVIEW_GENERAL.nextPageObjects.push(pageObject);
1471
            } else if (currentPageObjects[nIndex].mediaType == 4) { /*mediaType = 4*/
1472
                var pageObject = CONTENTVIEW_GETDATA.getMediaType4(currentPageObjects[nIndex]);
1473
                /*add object to page */
1474
                CONTENTVIEW_GENERAL.nextPageObjects.push(pageObject);
1475
            } else if (currentPageObjects[nIndex].mediaType == 5) { /*mediaType = 5*/
1476
                var pageObject = CONTENTVIEW_GETDATA.getMediaType5(currentPageObjects[nIndex]);
1477
                /*add object to page */
1478
                CONTENTVIEW_GENERAL.nextPageObjects.push(pageObject);
1479
            } else if (currentPageObjects[nIndex].mediaType == 6) { /*mediaType = 6*/
1480
                var pageObject = CONTENTVIEW_GETDATA.getMediaType6(currentPageObjects[nIndex]);
1481
                /*add object to page */
1482
                CONTENTVIEW_GENERAL.nextPageObjects.push(pageObject);
1483
            } else if (currentPageObjects[nIndex].mediaType == 7) { /*mediaType = 7*/
1484
                var pageObject = CONTENTVIEW_GETDATA.getMediaType7(currentPageObjects[nIndex]);
1485
                /*add object to page */
1486
                CONTENTVIEW_GENERAL.nextPageObjects.push(pageObject);
1487
            } else if (currentPageObjects[nIndex].mediaType == 8) { /*mediaType = 8*/
1488
                var pageObject = CONTENTVIEW_GETDATA.getMediaType8(currentPageObjects[nIndex]);
1489
                /*add object to page */
1490
                CONTENTVIEW_GENERAL.nextPageObjects.push(pageObject);
1491
            } else if (currentPageObjects[nIndex].mediaType == 9) { /*mediaType = 9*/
1492
                var pageObject = CONTENTVIEW_GETDATA.getMediaType9(currentPageObjects[nIndex]);
1493
                /*add object to page */
1494
                CONTENTVIEW_GENERAL.nextPageObjects.push(pageObject);
1495
            } else if (currentPageObjects[nIndex].mediaType == 11) { /*mediaType = 11*/
1496
                var pageObject = CONTENTVIEW_GETDATA.getMediaType11(currentPageObjects[nIndex]);
1497
                /*add object to page */
1498
                CONTENTVIEW_GENERAL.nextPageObjects.push(pageObject);
1499 1500 1501 1502 1503 1504 1505 1506 1507 1508
            } else if (currentPageObjects[nIndex].mediaType == 12) { /*mediaType = 12*/
        		var pageObject = CONTENTVIEW_GETDATA.getMediaType12(currentPageObjects[nIndex]);
            	/*add object to page */
        		CONTENTVIEW_GENERAL.nextPageObjects.push(pageObject);
        	} else if (currentPageObjects[nIndex].mediaType == 13) { /*mediaType = 12*/
        		var pageObject = CONTENTVIEW_GETDATA.getMediaType13(currentPageObjects[nIndex]);
            	/*add object to page */
        		CONTENTVIEW_GENERAL.nextPageObjects.push(pageObject);
        	}

1509 1510 1511 1512 1513
        }
    }
};

//Get prev page objects by page index
1514
CONTENTVIEW_GETDATA.getPrevPageObjectsByPageIndex = function(contentData, nIndexPage) {
1515

1516
	CONTENTVIEW_GENERAL.prevPageObjects = [];
1517 1518 1519 1520 1521

    var currentPageObjects;
    for (var nIndex = 0; nIndex < contentData.length; nIndex++) {
        if (contentData[nIndex].page == nIndexPage) {
            currentPageObjects = contentData[nIndex].objects;
1522
            //Start Function: No.9 - Editor : Long - Summary :
1523 1524 1525 1526 1527
            if(contentData[nIndex].contentDataSub != null && contentData[nIndex].contentDataSub.length > 0){
                //currentPageObjects["contentDataSub"] = contentData[nIndex].contentDataSub;
                for(var i = 0; i < currentPageObjects.length; i++){
                    var tempObj = currentPageObjects[i];
                    tempObj["contentDataSub"] = contentData[nIndex].contentDataSub;
1528 1529 1530
                }
            }
            //End Function: No.9 - Editor : Long
1531 1532 1533 1534 1535 1536 1537 1538
            break;
        }
    }

    if (currentPageObjects != undefined) {
        for (var nIndex = 0; nIndex < currentPageObjects.length; nIndex++) {
            /*get object page*/
            if (currentPageObjects[nIndex].mediaType == 1) {/*media type = 1 */
1539
                var pageObject = CONTENTVIEW_GETDATA.getMediaType1(currentPageObjects[nIndex]);
Masaru Abe committed
1540 1541
            	/*add object to page */
            	CONTENTVIEW_GENERAL.prevPageObjects.push(pageObject);
1542
            } else if (currentPageObjects[nIndex].mediaType == 2) { /*mediaType = 2 */
1543
                var pageObject = CONTENTVIEW_GETDATA.getMediaType2(currentPageObjects[nIndex]);
1544
                /*add object to page */
1545
                CONTENTVIEW_GENERAL.prevPageObjects.push(pageObject);
1546
            } else if (currentPageObjects[nIndex].mediaType == 3) { /*mediaType = 3*/
1547
                var pageObject = CONTENTVIEW_GETDATA.getMediaType3(currentPageObjects[nIndex]);
1548
                /*add object to page */
1549
                CONTENTVIEW_GENERAL.prevPageObjects.push(pageObject);
1550
            } else if (currentPageObjects[nIndex].mediaType == 4) { /*mediaType = 4*/
1551
                var pageObject = CONTENTVIEW_GETDATA.getMediaType4(currentPageObjects[nIndex]);
1552
                /*add object to page */
1553
                CONTENTVIEW_GENERAL.prevPageObjects.push(pageObject);
1554
            } else if (currentPageObjects[nIndex].mediaType == 5) { /*mediaType = 5*/
1555
                var pageObject = CONTENTVIEW_GETDATA.getMediaType5(currentPageObjects[nIndex]);
1556
                /*add object to page */
1557
                CONTENTVIEW_GENERAL.prevPageObjects.push(pageObject);
1558
            } else if (currentPageObjects[nIndex].mediaType == 6) { /*mediaType = 6*/
1559
                var pageObject = CONTENTVIEW_GETDATA.getMediaType6(currentPageObjects[nIndex]);
1560
                /*add object to page */
1561
                CONTENTVIEW_GENERAL.prevPageObjects.push(pageObject);
1562
            } else if (currentPageObjects[nIndex].mediaType == 7) { /*mediaType = 7*/
1563
                var pageObject = CONTENTVIEW_GETDATA.getMediaType7(currentPageObjects[nIndex]);
1564
                /*add object to page */
1565
                CONTENTVIEW_GENERAL.prevPageObjects.push(pageObject);
1566
            } else if (currentPageObjects[nIndex].mediaType == 8) { /*mediaType = 8*/
1567
                var pageObject = CONTENTVIEW_GETDATA.getMediaType8(currentPageObjects[nIndex]);
1568
                /*add object to page */
1569
                CONTENTVIEW_GENERAL.prevPageObjects.push(pageObject);
1570
            } else if (currentPageObjects[nIndex].mediaType == 9) { /*mediaType = 9*/
1571
                var pageObject = CONTENTVIEW_GETDATA.getMediaType9(currentPageObjects[nIndex]);
1572
                /*add object to page */
1573
                CONTENTVIEW_GENERAL.prevPageObjects.push(pageObject);
1574
            } else if (currentPageObjects[nIndex].mediaType == 11) { /*mediaType = 11*/
1575
                var pageObject = CONTENTVIEW_GETDATA.getMediaType11(currentPageObjects[nIndex]);
1576
                /*add object to page */
1577
                CONTENTVIEW_GENERAL.prevPageObjects.push(pageObject);
1578 1579 1580 1581 1582 1583 1584 1585 1586
            } else if (currentPageObjects[nIndex].mediaType == 12) { /*mediaType = 12*/
            	var pageObject = CONTENTVIEW_GETDATA.getMediaType12(currentPageObjects[nIndex]);
            	/*add object to page */
            	CONTENTVIEW_GENERAL.prevPageObjects.push(pageObject);
        	} else if (currentPageObjects[nIndex].mediaType == 13) { /*mediaType = 12*/
            	var pageObject = CONTENTVIEW_GETDATA.getMediaType13(currentPageObjects[nIndex]);
            	/*add object to page */
            	CONTENTVIEW_GENERAL.prevPageObjects.push(pageObject);
        	}
1587 1588
        }
    }
1589

1590 1591 1592
};

//Switch canvas when flipping page
1593
CONTENTVIEW_GETDATA.switchCanvas = function(nav){
1594
    // change div id
1595

1596 1597
    //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);
1598

1599 1600 1601 1602 1603
    if(nav == 1){
        $('#mainPre').attr("id","mainPreBK");
        $('#main').attr("id","mainPre");
        $('#mainNext').attr("id","main");
        $('#mainPreBK').attr("id","mainNext");
1604

1605 1606 1607 1608
        $('#offscreenPre').attr("id","mainPreBK");
        $('#offscreen').attr("id","offscreenPre");
        $('#offscreenNext').attr("id","offscreen");
        $('#mainPreBK').attr("id","offscreenNext");
1609

1610
        //START TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
1611 1612
        CONTENTVIEW_GENERAL.widthEachPrevPage = CONTENTVIEW_GENERAL.widthEachPage;
        CONTENTVIEW_GENERAL.widthEachPage = CONTENTVIEW_GENERAL.widthEachNextPage;
1613
        //#11478
1614 1615
        CONTENTVIEW_GENERAL.widthEachPrevPageApi = CONTENTVIEW_GENERAL.widthEachPageApi;
        CONTENTVIEW_GENERAL.widthEachPageApi = CONTENTVIEW_GENERAL.widthEachNextPageApi;
1616

1617 1618
        CONTENTVIEW_GENERAL.heightEachPrevPage = CONTENTVIEW_GENERAL.heightEachPage;
        CONTENTVIEW_GENERAL.heightEachPage = CONTENTVIEW_GENERAL.heightEachNextPage;
1619
        //#11478
1620 1621
        CONTENTVIEW_GENERAL.heightEachPrevPageApi = CONTENTVIEW_GENERAL.heightEachPageApi;
        CONTENTVIEW_GENERAL.heightEachPageApi = CONTENTVIEW_GENERAL.heightEachNextPageApi;
1622

1623
        CONTENTVIEW.srcRectPrev = CONTENTVIEW.srcRect;
1624 1625
        CONTENTVIEW.srcRect = CONTENTVIEW.srcRectNext;

1626 1627
        CONTENTVIEW.destRectPrev = CONTENTVIEW.destRect;
        CONTENTVIEW.destRect = CONTENTVIEW.destRectNext;
1628

1629
        //#12373
1630 1631 1632
        CONTENTVIEW.userScale = 1;
        CONTENTVIEW.changeScale(CONTENTVIEW.userScale);
        CONTENTVIEW.flip();
1633
        //#12373
1634 1635 1636 1637 1638 1639 1640 1641
        //END TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
    }
    else{
        // change div id
        $('#mainNext').attr("id","mainNextBK");
        $('#main').attr("id","mainNext");
        $('#mainPre').attr("id","main");
        $('#mainNextBK').attr("id","mainPre");
1642

1643 1644 1645 1646
        $('#offscreenNext').attr("id","mainNextBK");
        $('#offscreen').attr("id","offscreenNext");
        $('#offscreenPre').attr("id","offscreen");
        $('#mainNextBK').attr("id","offscreenPre");
1647

1648
        //START TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
1649 1650
        CONTENTVIEW_GENERAL.widthEachNextPage = CONTENTVIEW_GENERAL.widthEachPage;
        CONTENTVIEW_GENERAL.widthEachPage = CONTENTVIEW_GENERAL.widthEachPrevPage;
1651
        //#11478
1652 1653
        CONTENTVIEW_GENERAL.widthEachNextPageApi = CONTENTVIEW_GENERAL.widthEachPageApi;
        CONTENTVIEW_GENERAL.widthEachPageApi = CONTENTVIEW_GENERAL.widthEachPrevPageApi;
1654

1655 1656
        CONTENTVIEW_GENERAL.heightEachNextPage = CONTENTVIEW_GENERAL.heightEachPage;
        CONTENTVIEW_GENERAL.heightEachPage = CONTENTVIEW_GENERAL.heightEachPrevPage;
1657
        //#11478
1658 1659
        CONTENTVIEW_GENERAL.heightEachNextPageApi = CONTENTVIEW_GENERAL.heightEachPageApi;
        CONTENTVIEW_GENERAL.heightEachPageApi = CONTENTVIEW_GENERAL.heightEachPrevPageApi;
1660

1661
        CONTENTVIEW.srcRectNext = CONTENTVIEW.srcRect;
1662 1663
        CONTENTVIEW.srcRect = CONTENTVIEW.srcRectPrev;

1664 1665
        CONTENTVIEW.destRectNext = CONTENTVIEW.destRect;
        CONTENTVIEW.destRect = CONTENTVIEW.destRectPrev;
1666

1667
        //#12373
1668
        CONTENTVIEW.userScale = 1;
1669
        //#12373
1670 1671
        CONTENTVIEW.changeScale(CONTENTVIEW.userScale);
        CONTENTVIEW.flip();
1672 1673
        //END TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
    }
1674

1675 1676
    //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);
1677

1678 1679 1680
};

//Assign content properties
1681
CONTENTVIEW_GETDATA.assignCurrentContentPage = function(nav){
1682 1683 1684

    if(nav == 1){

1685 1686
    	CONTENTVIEW_GENERAL.prevPageImage = CONTENTVIEW_GENERAL.pageImages;
        CONTENTVIEW_GENERAL.pageImages = CONTENTVIEW_GENERAL.nextPageImage;
1687

1688 1689 1690 1691
        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;
1692 1693
        CONTENTVIEW_GENERAL.prevContent.pageObjects = CONTENTVIEW.content.pageObjects;

1694 1695 1696 1697 1698
        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;
1699

1700 1701
        CONTENTVIEW_GENERAL.prevPageObjects = CONTENTVIEW_GENERAL.pageObjects;
        CONTENTVIEW_GENERAL.pageObjects = CONTENTVIEW_GENERAL.nextPageObjects;
1702

1703 1704
    }
    else{
1705 1706
    	CONTENTVIEW_GENERAL.nextPageImage = CONTENTVIEW_GENERAL.pageImages;
        CONTENTVIEW_GENERAL.pageImages = CONTENTVIEW_GENERAL.prevPageImage;
1707

1708 1709 1710 1711
        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;
1712 1713
        CONTENTVIEW_GENERAL.nextContent.pageObjects = CONTENTVIEW.content.pageObjects;

1714 1715 1716 1717
        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;
1718 1719
        CONTENTVIEW.content.pageObjects = CONTENTVIEW_GENERAL.prevContent.pageObjects;

1720 1721
        CONTENTVIEW_GENERAL.nextPageObjects = CONTENTVIEW_GENERAL.pageObjects;
        CONTENTVIEW_GENERAL.pageObjects = CONTENTVIEW_GENERAL.prevPageObjects;
1722

1723
    }
1724

1725 1726
    //abe
    //alert("assignCurrentContentPage:" + content.currentPage);
1727

1728 1729 1730
};

//Correct Canvas Position
1731
CONTENTVIEW_GETDATA.correctCanvasPosition = function(){
1732
    //correct canvas position
1733

1734
    //   Set default value for moving3D object to prevent other object fired when
1735
    //hold on 3d object and move next or prev page.
1736
	CONTENTVIEW_EVENTS._3dAnimate = false;
1737

1738
    if(CONTENTVIEW_GENERAL.animateType == CONTENTVIEW_GENERAL.animateTypeKeys.Type_Slide){
1739 1740 1741 1742 1743 1744 1745
        $('#canvasWrapper').css("left",'0px');
        $('#main').css("left",'13px');
        $('#mainNext').css("left", $("#canvasWrapper").width() +'px');
        $('#mainPre').css("left", '-' + $("#canvasWrapper").width() +'px');
        $('#mainNext').css("display", 'none');
        $('#mainPre').css("display", 'none');
    }
1746
    else if(CONTENTVIEW_GENERAL.animateType == CONTENTVIEW_GENERAL.animateTypeKeys.Type_FadeIn){
1747
       $('#mainNext').css("z-index",'0');
1748
       $('#mainPre').css("z-index",'0');
1749
       $('#mainNext').css("display", 'none');
1750
       $('#mainPre').css("display", 'none');
1751
    }
1752

1753 1754 1755
};

//Get Page Transition configuration
1756 1757 1758
CONTENTVIEW_GETDATA.getPageTransitionConfig = function(){
	CONTENTVIEW_GENERAL.animateType = ClientData.userOpt_pageTransition();
	CONTENTVIEW_GENERAL.animatePeriod = eval(ClientData.userOpt_pageTransitionPeriod()) * 1000;
1759
};
1760
//End Function: No.4 - Editor : Long - Summary : Render Next Page Content
1761

1762 1763 1764 1765
CONTENTVIEW_GETDATA.ready = function(){
};