diff --git a/buildchain/src/js/canto-embed.js b/buildchain/src/js/canto-embed.js index bd84b54..a095525 100644 --- a/buildchain/src/js/canto-embed.js +++ b/buildchain/src/js/canto-embed.js @@ -27,6 +27,7 @@ function setToken(tokenInfo) { _formatDistrict = tokenInfo.formatDistrict; } + cantoAPI.loadTree = function (callback) { var url = "https://" + _tenants + "/api/v1/tree?sortBy=name&sortDirection=ascending&layer=1"; $.ajax({ @@ -371,6 +372,8 @@ $(document).ready(function () { $("#cantoViewBody").find("#globalSearch input").val(""); getImageInit(initSchme); }); + + }); function getTokenInfo() { @@ -397,7 +400,13 @@ function addEventListener() { _tokenType = tokenInfo.tokenType; }); - $(document).off('click').on("click", "#treeviewSwitch", function (e) { + $(document).off('click').on("change", "#uploadBtnInvisible", (e) => { + uploadFileToCanto(e); + }) + .on("click", "#uploadBtn", (e) => { + document.querySelector("#uploadBtnInvisible").click(); + }) + .on("click", "#treeviewSwitch", function (e) { if ($('#treeviewSection').hasClass("expanded")) { $('#treeviewSection').stop().animate({ left: '-20%' @@ -930,10 +939,6 @@ function loadMoreAction() { } } -function uploadClick(e) { - document.querySelector("#uploadBtnInvisible").click(); -} - function uploadFileToCanto(e) { let url = `https://${_tenants}/api/v1/upload/setting`; fetch(url, { @@ -951,12 +956,12 @@ function uploadFileToCanto(e) { formData.append("AWSAccessKeyId", data.AWSAccessKeyId); formData.append("Policy", data.Policy); formData.append("Signature", data.Signature); - formData.append("x-amz-meta-file_name", e.files[0].name); + formData.append("x-amz-meta-file_name", e.currentTarget.files[0].name); formData.append("x-amz-meta-tag", ""); formData.append("x-amz-meta-scheme", ""); formData.append("x-amz-meta-id", ""); formData.append("x-amz-meta-album_id", ""); - formData.append("file", e.files[0]); + formData.append("file", e.currentTarget.files[0]); let statusBar = parent.document.querySelector(".modal-status-bar"); fetch(data.url, { @@ -965,14 +970,13 @@ function uploadFileToCanto(e) { mode: "no-cors", redirect: 'follow' }).then(response => { - statusBar.style.display = "block"; - statusBar.innerHTML = "Uploading image..."; - + document.getElementById("uploadBtn").style.background = "linear-gradient(16deg, rgb(205 101 1) 0%, rgb(169 218 0 / 100%) 100%)"; + document.getElementById("uploadBtn").value = "Uploading image..."; }).catch(error => { console.log(error); }).finally(() => { - statusBar.innerHTML = "Uploading - This can take several minutes..."; - checkStatusInterval(e.files[0].name); + document.getElementById("uploadBtn").value = "Upload complete - processing"; + checkStatusInterval(e.currentTarget.files[0].name); }); }).catch(error => { console.log("An error occurred while attempting to grab upload settings!"); @@ -982,7 +986,7 @@ function uploadFileToCanto(e) { function checkStatusInterval(filename) { let url = `https://${_tenants}/api/v1/upload/status?hours=1`; let statusBar = parent.document.querySelector(".modal-status-bar"); - statusChecker = setInterval(() => { + setInterval(() => { fetch(url, { method: "get", @@ -992,14 +996,12 @@ function uploadFileToCanto(e) { }).then(body => { if (body.results && body.results.length > 0) { let results = body.results.filter(e => { - console.log("evaluating: ", e); if (e.name == filename && e.status != "Done") { - console.log("match!!!"); return e; } }); if (results.filter(e => e != undefined).length == 0) { - statusBar.innerHTML = "Canto processing complete! Reloading" + document.getElementById("uploadBtn").value = "Canto processing complete! Reloading"; window.location.reload(); } } @@ -1020,3 +1022,4 @@ if (import.meta.hot) { console.log("HMR") }); } + diff --git a/src/templates/canto-embed.twig b/src/templates/canto-embed.twig index f4e0ac7..8998026 100644 --- a/src/templates/canto-embed.twig +++ b/src/templates/canto-embed.twig @@ -46,8 +46,8 @@
- - + diff --git a/src/web/assets/dist/assets/app-7c0be19c.css b/src/web/assets/dist/assets/app-7c0be19c.css new file mode 100644 index 0000000..4cf3e83 --- /dev/null +++ b/src/web/assets/dist/assets/app-7c0be19c.css @@ -0,0 +1 @@ +#uploadBtnInvisible{display:none}#uploadBtn{background:linear-gradient(16deg,rgb(7 139 140 / 100%) 0%,rgb(169 218 0 / 100%) 100%);color:#fff;border-radius:17px;border-top:none;border-right:none;border-bottom:2px solid green;border-left:2px solid green;margin:0;padding:5px 16px;font-size:15px}#uploadBtn::-webkit-file-upload-button{visibility:hidden}#uploadBtn:before{content:"Upload File";color:#fff;display:inline-block;background:#078b8c!important;border-radius:17px;padding:5px 8px;outline:none;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:pointer;font-weight:700;font-size:15px}#uploadBtn:hover:before{border-color:#000}#uploadBtn:active{outline:0}#uploadBtn:active:before{background:linear-gradient(to bottom,#e3e3e3,#f9f9f9)}.header-section .insert-album-section{display:inline-block;float:none!important;margin-left:15px}.loading-message{z-index:110;color:#fff;text-align:center}body:not(.can-select-single) div#insertBtn,body:not(.can-select-single) .image-preview-modal .detail-box .insert-action-section .insert-text{display:none}body:not(.can-select-multiple) .body-section .single-image:hover .select-box,body:not(.can-select-multiple) .body-section .single-image:hover .select-icon-background{display:none}body:not(.can-select-album) div#insertAlbumWrapper{display:none}.canto-uc-subiframe{width:100%;height:100%}.modal-test{height:100%}.modal-status-bar{height:25px;background:linear-gradient(87deg,rgb(7 139 140 / 100%) 0%,rgb(255 255 255 / 100%) 50%);margin:-5px 25px 0 0;padding-left:25px;color:#fff;display:none}.canto-asset-preview-stack{background:#f6f6f6;border:1px solid #ccc;margin-bottom:20px;box-shadow:0 0 #0000007f,0 3px 0 -2px #f6f6f6,0 3px 2px -2px #0006,0 7px 0 -4px #f6f6f6,0 7px 2px -4px #0006,0 11px 0 -6px #f6f6f6,0 11px 2px -6px #0006,0 15px 0 -8px #f6f6f6,0 15px 2px -8px #0006,0 19px 0 -10px #f6f6f6,0 19px 2px -10px #0006,0 23px 0 -12px #f6f6f6,0 23px 2px -12px #0006}.flex{display:flex}.hidden{display:none}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@font-face{font-family:icomoon_flight_01;src:url(./icomoon_flight_01-1a8cae7d.eot?xm1ff0);src:url(./icomoon_flight_01-1a8cae7d.eot?xm1ff0#iefix) format("embedded-opentype"),url(./icomoon_flight_01-52dbb8ac.ttf?xm1ff0) format("truetype"),url(./icomoon_flight_01-5ef695f8.woff?xm1ff0) format("woff"),url(./icomoon_flight_01-ebe3313e.svg?xm1ff0#icomoon_flight_01) format("svg");font-weight:400;font-style:normal}[class^=icon-],[class*=" icon-"]{font-family:icomoon_flight_01!important;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;cursor:pointer;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-capture:before{content:""}.icon-help:before{content:""}.icon-icn_flight_box_folder_01:before{content:""}.icon-icn_flight_dropbox_folder_01:before{content:""}.icon-icn_flight_googleDrive_folder_01:before{content:""}.icon-dropbox_folder_open:before{content:""}.icon-dropbox_folder:before{content:""}.icon-geo_data:before{content:""}.icon-timeline:before{content:""}.icon-dashboard:before{content:""}.icon-Coordinate:before{content:""}.icon-dimensions:before{content:""}.icon-fullscreen_01:before{content:""}.icon-more01:before{content:""}.icon-cold_restore:before{content:""}.icon-cold_request:before{content:""}.icon-cold_move:before{content:""}.icon-offline:before{content:""}.icon-googleDrive_folder:before{content:""}.icon-googleDrive_folder_open:before{content:""}.icon-library:before{content:""}.icon-triangle-down:before{content:""}.icon-triangle-up:before{content:""}.icon-box_folder:before{content:"}"}.icon-box_folder_open:before{content:"~"}.icon-copy1:before{content:"|"}.icon-copy:before{content:"{"}.icon-add_1:before{content:"`"}.icon-subtract_1:before{content:"a"}.icon-closed2:before{content:"_"}.icon-warning:before{content:"^"}.icon-pdf_preview:before{content:"M"}.icon-rotate_left:before{content:"*"}.icon-rotate_right:before{content:"-"}.icon-move:before{content:"0"}.icon-resize:before{content:":"}.icon-resize2:before{content:">"}.icon-keyphoto:before{content:"?"}.icon-icn_delete:before{content:"&"}.icon-icn_remove:before{content:"'"}.icon-crop:before{content:""}.icon-more:before{content:'"'}.icon-edit:before{content:"#"}.icon-add:before{content:"!"}.icon-icn_expand_02:before{content:""}.icon-icn_linkedin_01:before{content:""}.icon-icn_upload_cloud_01:before{content:""}.icon-icn_checkbox_checked_02:before{content:""}.icon-icn_grid_filled_01:before{content:"I"}.icon-icn_flight_logo_01:before{content:""}.icon-icn_default_user_01:before{content:""}.icon-box_logo_01:before{content:""}.icon-icn_tree4:before{content:""}.icon-icn_tree3:before{content:""}.icon-icn_tree2:before{content:""}.icon-icn_tree:before{content:""}.icon-icn_upload4:before{content:""}.icon-icn_box_filled:before{content:""}.icon-icn_upload3:before{content:""}.icon-icn_dropbox_02:before{content:""}.icon-icn_bell_02:before{content:""}.icon-icn_star_01:before{content:""}.icon-icn_disk_01:before{content:""}.icon-icn_close_x_01:before{content:""}.icon-icn_close_circle_x_01:before{content:""}.icon-icn_checkmark_circle_01:before{content:""}.icon-icn_eye_01:before{content:""}.icon-icn_flight_arrow_up_01:before{content:""}.icon-icn_flight_arrow_down_01:before{content:""}.icon-icn_flight_sort_descend_01:before{content:""}.icon-icn_reload_alt_01:before{content:""}.icon-icn_checkbox_checked_01:before{content:";"}.icon-icn_pencil_01:before{content:"·"}.icon-icn_flight_arrow_left_01:before{content:"≤"}.icon-icn_flight_arrow_right_01:before{content:"≥"}.icon-icn_flight_album_assign_01:before{content:"Å"}.icon-icn_flight_folder_open3{font-family:icomoon!important}.icon-icn_flight_folder_open3:before{content:""}.icon-icn_flight_folder_01{font-family:icomoon!important}.icon-icn_flight_folder_01:before{content:""}.icon-icn_reload_01:before{content:"‰"}.icon-icn_flight_plus_sm_thick_01:before{content:"≠"}.icon-icn_flight_plus_sm_01:before{content:"±"}.icon-icn_flight_power:before{content:"\\"}.icon-icn_checkbox_checked_013:before{content:"<"}.icon-icn_flight_preso:before{content:"."}.icon-cal:before{content:"/"}.icon-icn_flight_sort_01:before{content:"="}.icon-icn_flight_info_01:before{content:","}.icon-icn_flight_preso_01:before{content:")"}.icon-icn_portal_01:before{content:"("}.icon-icn_flight_plus_01:before{content:"]"}.icon-icn_album_01:before{content:"["}.icon-Plus-02:before{content:"¡"}.icon-image:before{content:"b"}.icon-image2:before{content:"c"}.icon-music:before{content:"d"}.icon-film:before{content:"e"}.icon-camera:before{content:"f"}.icon-bullhorn:before{content:""}.icon-book:before{content:"g"}.icon-books:before{content:"h"}.icon-file:before{content:"i"}.icon-file2:before{content:"j"}.icon-file3:before{content:"k"}.icon-file4:before{content:"l"}.icon-stack:before{content:"m"}.icon-folder:before{content:"n"}.icon-folder-open:before{content:"o"}.icon-tag:before{content:""}.icon-notebook:before{content:"p"}.icon-envelope:before{content:"q"}.icon-history:before{content:""}.icon-bell:before{content:"r"}.icon-calendar:before{content:"s"}.icon-screen:before{content:"t"}.icon-laptop:before{content:"u"}.icon-drawer:before{content:"v"}.icon-upload:before{content:"x"}.icon-user:before{content:"y"}.icon-users:before{content:"z"}.icon-user2:before{content:"Z"}.icon-spinner:before{content:"Í"}.icon-search:before{content:"S"}.icon-zoomin:before{content:"A"}.icon-zoomout:before{content:"B"}.icon-key:before{content:""}.icon-lock:before{content:""}.icon-unlocked:before{content:""}.icon-settings:before{content:"ˇ"}.icon-cog:before{content:"C"}.icon-pie:before{content:"D"}.icon-bars:before{content:"E"}.icon-remove:before{content:"F"}.icon-remove2:before{content:"G"}.icon-briefcase:before{content:"H"}.icon-list:before{content:"L"}.icon-menu:before{content:"J"}.icon-tree:before{content:"K"}.icon-download2:before{content:""}.icon-upload2:before{content:""}.icon-flag:before{content:"N"}.icon-star:before{content:"O"}.icon-star2:before{content:"P"}.icon-heart:before{content:"Q"}.icon-heart2:before{content:"R"}.icon-thumbs-up:before{content:"¨"}.icon-info:before{content:"ˆ"}.icon-close:before{content:"ç"}.icon-checkmark:before{content:"T"}.icon-checkmark2:before{content:"U"}.icon-minus:before{content:"µ"}.icon-plus:before{content:"+"}.icon-enter:before{content:"V"}.icon-exit:before{content:"W"}.icon-stop:before{content:""}.icon-arrow-down:before{content:"å"}.icon-checkbox-checked:before{content:"X"}.icon-checkbox-unchecked:before{content:"Y"}.icon-checkbox-partial:before{content:"1"}.icon-radio-checked:before{content:"2"}.icon-radio-unchecked:before{content:"3"}.icon-filter:before{content:"4"}.icon-filter2:before{content:"5"}.icon-table:before{content:"6"}.icon-paragraph-justify:before{content:"7"}.icon-share:before{content:"8"}.icon-mail:before{content:"9"}.icon-googleplus:before{content:""}.icon-googleplus2:before{content:""}.icon-googleplus3:before{content:""}.icon-facebook:before{content:""}.icon-facebook2:before{content:""}.icon-facebook3:before{content:""}.icon-twitter:before{content:""}.icon-twitter2:before{content:""}.icon-twitter3:before{content:""}.icon-wordpress:before{content:""}.icon-wordpress2:before{content:""}.icon-linkedin:before{content:""}.icon-pinterest:before{content:""}.icon-pinterest2:before{content:""}.icon-file-pdf:before{content:"@"}.icon-file-word:before{content:"$"}.icon-file-excel:before{content:"%"}.icon-arrow-up-right:before{content:""}.icon-arrow-right:before{content:""}.icon-arrow-left:before{content:""}.icon-arrow-right2:before{content:""}.icon-arrow-left2:before{content:""}.icon-weather-snow:before{content:""}.icon-uniF16B:before{content:""}.icon-download:before{content:"w"}@font-face{font-family:icomoon;src:url(./icomoon-59ef1723.eot?n9woxf);src:url(./icomoon-59ef1723.eot?n9woxf#iefix) format("embedded-opentype"),url(./icomoon-e9b5396f.ttf?n9woxf) format("truetype"),url(./icomoon-96885745.woff?n9woxf) format("woff"),url(./icomoon-bc1681f9.svg?n9woxf#icomoon) format("svg");font-weight:400;font-style:normal}[class^=icon-s-],[class*=" icon-s-"]{font-family:icomoon!important;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-s-folder-01:before{content:""}.icon-s-more-24:before{content:""}.icon-s-Treemenu-24:before{content:""}.icon-s-arrow-24:before{content:""}.icon-s-profile-24:before{content:""}.icon-s-settings-24:before{content:""}.icon-s-advanceduploader-24:before{content:""}.icon-s-mycollections-24:before{content:""}.icon-s-logoout-24:before{content:""}.icon-s-help-24:before{content:""}.icon-s-gotoportal-24:before{content:""}.icon-s-aboutus-24:before{content:""}.icon-s-TypeASC-20:before{content:""}.icon-s-TypeDESC-20:before{content:""}.icon-s-DateASC-20:before{content:""}.icon-s-DateDESC-20:before{content:""}.icon-s-NameASC:before{content:""}.icon-s-NameDESC:before{content:""}.icon-s-Workspace-20:before{content:""}.icon-s-MasonryGridView-20:before{content:""}.icon-s-Edit-20:before{content:""}.icon-s-Search-20:before{content:""}.icon-s-ThumbnailView-20:before{content:""}.icon-s-GEOView-20:before{content:""}.icon-s-ListView-20:before{content:""}.icon-s-Filter-20:before{content:""}.icon-s-Date-20:before{content:""}.icon-s-Comment-22:before{content:""}.icon-s-Delete-22:before{content:""}.icon-s-UnrelateFile-22:before{content:""}.icon-s-RelateFile-22:before{content:""}.icon-s-Portal-22:before{content:""}.icon-s-AllFiles-32:before{content:""}.icon-s-Audio-32:before{content:""}.icon-s-Documents-32:before{content:""}.icon-s-Images-32:before{content:""}.icon-s-Others-32:before{content:""}.icon-s-Presentations-32:before{content:""}.icon-s-Videos-32:before{content:""}.icon-s-PageDown-32:before{content:""}.icon-s-PageUp-32:before{content:""}.icon-s-Add_Section-32:before{content:""}.icon-s-Portal-32:before{content:""}.icon-s-Error-24:before{content:""}.icon-s-Approval-56:before{content:""}.icon-s-SmartTags-56:before{content:""}.icon-s-Uploadicon-56:before{content:""}.icon-s-importicon-56:before{content:""}.icon-s-Workspace-56:before{content:""}.icon-s-Slack-56:before{content:""}.icon-s-Arrow001-56:before{content:""}.icon-s-Arrow002-56:before{content:""}.icon-s-SelfRegistration-56:before{content:""}.icon-s-InfoPage-56:before{content:""}.icon-s-NewUploadLink-56:before{content:""}.icon-s-UploadLinks-56:before{content:""}.icon-s-Integrations-56:before{content:""}.icon-s-CustomFields-56:before{content:""}.icon-s-Keywords-56:before{content:""}.icon-s-CrewSettings-56:before{content:""}.icon-s-Portal-56:before{content:""}.icon-s-Metadata-56:before{content:""}.icon-s-NewPortal-56:before{content:""}.icon-s-Account-56:before{content:""}.icon-s-Branding-56:before{content:""}.icon-s-PassengerSettings-56:before{content:""}.icon-s-box-56:before{content:""}.icon-s-DigitalRights-56:before{content:""}.icon-s-Dropbox-56:before{content:""}.icon-s-DuplicateCheck-56:before{content:""}.icon-s-NewUser-56:before{content:""}.icon-s-Reports-56:before{content:""}.icon-s-UsersAccounts-56:before{content:""}.icon-s-Workflow-56:before{content:""}.icon-s-Google-56:before{content:""}.icon-s-Defaults-56:before{content:""}.icon-s-Groups-56:before{content:""}.icon-s-lock_16:before{content:""}.icon-s-notlock_16:before{content:""}.icon-s-Type-16:before{content:""}.icon-s-Name-16:before{content:""}.icon-s-Custom-16:before{content:""}.icon-s-Date-16:before{content:""}.icon-s-Warning-16:before{content:""}.icon-canto-eye-16:before{content:""}.icon-s-Unlink_16:before{content:""}.icon-s-Search_16:before{content:""}.icon-s-Refresh_16:before{content:""}.icon-s-RadioButton2_16:before{content:""}.icon-s-RadioButton1_16:before{content:""}.icon-s-UnselectedCheck_32:before{content:""}.icon-s-Ok2_32:before{content:""}.icon-s-Ok1_16:before{content:""}.icon-s-Edit_16:before{content:""}.icon-s-Dropdown_16:before{content:""}.icon-s-Delete_16:before{content:""}.icon-s-Date_16:before{content:""}.icon-s-ClosePopup_16:before{content:""}.icon-s-Checkbox2_16:before{content:""}.icon-s-Checkbox1_16:before{content:""}.icon-s-Cancel_16:before{content:""}.icon-s-BackButton_28:before{content:""}.icon-s-Arrow3_16:before{content:""}.icon-s-Arrow2_16:before{content:""}.icon-s-Arrow1_16:before{content:""}.icon-s-PasswordPolicy-56:before{content:""}.icon-s-dashboard_24:before{content:""}.icon-s-Album_locked-20px:before{content:""}.icon-s-Album-20px:before{content:""}.icon-s-Folder_locked-20px:before{content:""}.icon-s-Folder_open_locked-20px:before{content:""}.icon-s-Folder_open-20px:before{content:""}.icon-s-closeicon-16px:before{content:""}.icon-s-refreshicon-16px:before{content:""}.icon-s-RequestAccessUser-16:before{content:""}.icon-s-LandingPageTempl08-32:before{content:""}.icon-s-LandingPageTempl07-32:before{content:""}.icon-s-LandingPageTempl06-32:before{content:""}.icon-s-LandingPageTempl05-32:before{content:""}.icon-s-LandingPageTempl04-32:before{content:""}.icon-s-LandingPageTempl03-32:before{content:""}.icon-s-LandingPageTempl02-32:before{content:""}.icon-s-LandingPageTempl01-32:before{content:""}.icon-s-db-32:before{content:"";color:#60acec}.icon-s-box-32:before{content:"";color:#307abb}.icon-s-twitter-32:before{content:"";color:#1ab2e8}.icon-s-youtube-32:before{content:"";color:#c8312b}.icon-s-vimeo-32:before{content:"";color:#30b9eb}.icon-s-slack-32:before{content:"";color:#77d4b6}.icon-s-mail-32:before{content:"";color:#566ed6}.icon-s-googledrive-32:before{content:"";color:#029d54}.icon-s-googleanalytics-32:before{content:""}.icon-s-facebook-32:before{content:"";color:#6678c5}.icon-s-pinterest-32:before{content:"";color:#df4a3e}.icon-s-arrow_circle_down-62:before{content:""}.icon-s-Email-56:before{content:""}.icon-s-hamburger-20:before{content:""}.icon-s-dagger_solid-20:before{content:""}.icon-s-dagger-20:before{content:""}.icon-s-align_center-16:before{content:"";color:#8a8a8a}.icon-s-align_left-16:before{content:""}.icon-s-align_right-16:before{content:""}.icon-s-bold-16:before{content:""}.icon-s-calendar-16:before{content:""}.icon-s-italics-16:before{content:""}.icon-s-pencil-16:before{content:""}.icon-s-portal-16:before{content:""}.icon-s-canto-eyeno-16:before{content:""}.icon-s-filter-16:before{content:""}.icon-s-sort-16:before{content:""}.icon-s-undo-16:before{content:""}.icon-s-help-16:before{content:""}.icon-s-layout01-32:before{content:""}.icon-s-layout02-32:before{content:""}.icon-s-layout03-32:before{content:""}.icon-s-layout04-32:before{content:""}.icon-s-layout05-32:before{content:""}.icon-s-layout06-32:before{content:""}.icon-s-layout07-32:before{content:""}.icon-s-layout08-32:before{content:""}.icon-s-layout09-32:before{content:""}.icon-s-layout10-32:before{content:""}.icon-s-layout11-32:before{content:""}.icon-s-layout12-32:before{content:""}.icon-s-layout13-32:before{content:""}.icon-s-layout14-32:before{content:""}.icon-s-TextColor-16:before{content:""}.icon-s-Clone-16:before{content:""}.icon-s-save-16:before{content:""}.icon-s-Portal_Private-20:before{content:""}.icon-s-Portal_Public-20:before{content:""}.icon-s-Portal_Common-20:before{content:""}.icon-s-Keyword-16:before{content:""}.icon-s-single_workspace-20:before{content:""}.icon-s-workspaces-20:before{content:""}.icon-s-Fullscreen:before{content:""}.icon-s-indesignPackage:before{content:""}.icon-s-documentPackage:before{content:""}.icon-s-comments:before{content:""}.icon-s-map:before{content:""}.canto-pickup-img-btn{height:30px;line-height:26px;margin:15px;padding:0 15px;font-size:15px;background-color:#ff9800;font-weight:700;border:0;display:block}.canto-pickup-img-btn:hover{background-color:#c77b09}.canto-uc-frame{position:fixed;width:90%;height:90%;margin:auto;top:5%;left:5%;background:#fff;border:0;box-shadow:0 0 5px #ccc;z-index:999}.canto-uc-frame .header{height:20px;padding:15px;background:#f5f5f5;border-bottom:1px solid #ddd}.canto-uc-frame .header .title{font-size:17px;font-weight:700}.canto-uc-frame .header .close-btn{position:absolute;right:20px;top:14px;font-size:23px;color:#000}.canto-uc-frame .header .close-btn:hover{cursor:pointer}.canto-uc-frame .canto-uc-subiframe{width:100%;position:relative;height:calc(100% - 50px);border:0;padding:0}.text-lowercase{text-transform:lowercase!important}.text-orange{color:#733!important}.text-orange:focus,.text-orange:hover{color:#733}.text-black{color:#000!important}.text-white{color:#fff!important}.text-grey{color:#444!important}body{font-family:sans-serif,Helvetica,Arial;font-size:14px;line-height:1.4286;color:#333;background-color:#fff;min-width:850px;overflow-x:hidden}.canto-body{height:100vh;width:100%;position:relative;overflow:hidden;z-index:1;margin:0}.header-section{height:50px;width:100%;position:relative;background-color:#f5f5f5;box-shadow:0 0 5px #0003}.header-section .library{display:inline-block;cursor:pointer}.header-section .library .treeview-icon{line-height:50px;margin-left:20px;position:relative;top:1px}.header-section .library .treeview-icon:before{margin-right:5px}.header-section .library .treeview-desc{font-size:15px;margin-left:0}.header-section .search-box{display:inline-block;margin-left:25px;width:200px;position:relative}.header-section .search-box input{width:170px;padding:2px 10px;border-radius:15px;border:1px solid #ccc;height:20px}.header-section .search-box span{position:absolute;right:0;top:0;color:#888;height:25px;width:32px;padding-top:7px;padding-left:10px;cursor:pointer}.header-section .filter-section{line-height:50px;margin-right:20px;position:relative;display:inline-block}.header-section .filter-section .type-font{font-size:25px;color:#000;position:relative;top:5px;cursor:pointer}.header-section .filter-section .type-font.current{color:#fff;border-radius:50%;background-color:#222}.header-section .filter-section .type-font:hover{border-radius:50%;background-color:#dedede}.header-section .filter-section .type-font:hover.current{color:#fff;border-radius:50%;background-color:#222}.header-section .selected-count-section{display:inline-block;margin-left:calc(50% - 100px)}.header-section .selected-action-section{display:inline-block;float:right;line-height:50px;margin-right:0}.header-section .selected-action-section .action-icon{font-size:20px;color:#555;margin-right:20px;position:relative;top:3px;cursor:pointer}.header-section .selected-action-section .action-icon:hover{border-radius:50%;color:#333}.header-section .selected-action-section .action-icon.all-selected{color:#111}.header-section .selected-action-section .action-icon.all-selected:hover{color:#000}.header-section .selected-action-section .action-btn{padding:4px 10px;width:54px;background:#555;line-height:50px;margin-top:20px;border-radius:15px;color:#ddd;margin-right:29px;vertical-align:top;cursor:pointer}.header-section .selected-action-section .action-btn:hover{background:#333}.header-section .logout-btn{z-index:3;height:50px;width:47px;background-color:#f5f5f5;border-radius:50%;display:block;cursor:pointer;border:1px solid #f1f1f1;float:right;text-align:center;margin-right:10px}.header-section .logout-btn span{font-size:21px;margin:auto;color:#555;position:relative;line-height:50px}.header-section .logout-btn:hover,.header-section .logout-btn:hover span{color:#333}.max-select-tips{position:fixed;top:50px;text-align:center;left:20%;z-index:100;background:#e89600;color:#fff;font-size:15px;display:none;width:calc(80% - 15px);line-height:35px;opacity:.85}.no-treeview{left:0!important;width:100%!important}.hidden{display:none!important}.tree-view-section{width:20%;border-right:1px solid #ddd;height:calc(100% - 50px);display:inline-block;position:relative;background-color:#f5f5f5;border-top:1px solid #ddd;overflow:scroll}.tree-view-section .tree-view{margin-top:10px}.tree-view-section .tree-view .logo{width:18px;position:relative;display:inline-block;top:5px;vertical-align:top}.tree-view-section .tree-view ul{list-style:none;padding-left:0;cursor:pointer}.tree-view-section .tree-view li{list-style:none;line-height:30px;padding-left:10px;margin-left:10px;position:relative;white-space:nowrap}.tree-view-section .tree-view li:before{content:"";border-left:1px solid #e0e0e0;height:100%;position:absolute;left:-1px}.tree-view-section .tree-view li:after{content:"";left:-1px;position:absolute;right:auto;border-top:1px solid #e0e0e0;height:20px;top:25px;width:15px}.tree-view-section .tree-view li:last-child:before{height:30px}.tree-view-section .tree-view li.selected,.tree-view-section .tree-view li.selected span{color:#ff9800}.tree-view-section .tree-view li.no-child{color:#aaa}.tree-view-section .tree-view li.no-child span{color:#aaa;font-style:italic;margin-left:1px}.tree-view-section .tree-view li .tree-whole-row{position:absolute;height:28px;width:100%;left:0;background-color:#f5f5f5;z-index:0}.tree-view-section .tree-view li .tree-whole-row:hover{background-color:#ddd}.tree-view-section .tree-view i{width:15px;height:20px;display:inline-block;font-size:18px;margin-right:5px;position:relative;top:2px}.tree-view-section .tree-view .folder-loading{width:18px;height:18px;position:relative;top:2px}.tree-view-section .tree-view a,.tree-view-section .tree-view span{color:#666;font-size:14px;z-index:2;position:relative}.tree-view-section .tree-view>ul{padding-left:0;border-left:none}.tree-view-section .tree-view>ul>li:before{border-left:none}.tree-view-section .tree-view>ul>li:after{border-top:none}.body-section{display:inline-block;vertical-align:top;width:80%;position:absolute;left:20%;font-size:0;height:calc(100% - 50px);overflow-y:scroll}.body-section .loading-more{position:fixed;bottom:0;width:calc(80% - 15px);height:33px;z-index:100;background:#bcbcbc;color:#000;text-align:center;font-size:15px;line-height:33px;display:none;left:20%;opacity:.95}.body-section .no-item{position:fixed;top:20%;width:80%;height:50px;z-index:100;color:#626262;display:block;text-align:center;font-size:15px;line-height:35px;font-weight:400}.body-section .image-section{padding:3px}.body-section .single-image{margin:1px;height:189px;width:189px;position:relative;display:inline-block;vertical-align:top;overflow:hidden}.body-section .single-image img{width:100%;height:100%;-o-object-fit:cover;object-fit:cover;opacity:.9}.body-section .single-image .mask-layer{display:none;background-color:#3232324d;z-index:2;height:100%;width:100%;position:absolute;top:0;left:0;overflow:hidden}.body-section .single-image .single-image-name{position:absolute;width:100%;top:100%;background:rgb(50 50 50 / 50%);color:#fff;font-size:12px;line-height:20px;padding:10px 0;text-align:center;z-index:99;word-break:break-all;white-space:pre-wrap}.body-section .single-image .select-box{display:none;position:absolute;top:10px;right:10px;color:#555;font-size:25px;z-index:5}.body-section .single-image .select-icon-background{display:none;background-color:#fff;box-shadow:0 0 6px #777;border-radius:100%;width:23px;height:23px;position:absolute;top:11px;right:11px;z-index:4}.body-section .single-image:hover img{opacity:1}.body-section .single-image:hover .mask-layer,.body-section .single-image:hover .select-box,.body-section .single-image:hover .select-icon-background,.body-section .single-image.selected .select-box,.body-section .single-image.selected .select-icon-background{display:block}.page-mask{z-index:99;position:fixed;width:100%;height:100%;top:0;left:0;background-color:#000c}.loading-icon{z-index:110;position:fixed;width:100%;height:100%;top:0;left:0;background-color:#000c}.loading-icon img{top:50%;left:50%;transform:translate(-50%) translateY(-50%);position:absolute}.loading-icon .loading-icon-circle{top:50%;left:50%;transform:translate(-50%) translateY(-50%);height:50px;width:50px;line-height:32px;position:relative;display:inline-block;overflow:hidden;white-space:nowrap}.loading-icon .loading-icon-circle .loading-icon-markup{animation:icon-spin 2s infinite linear}.loading-icon .loading-icon-circle .loading-icon-markup .icon-color{color:#fff}.view-image-modal{z-index:99;position:fixed;display:block;top:50%;left:50%;transform:translate(-50%) translateY(-50%);max-width:100%;max-height:100%}.view-image-modal .page-mask{z-index:100;position:fixed;width:100%;height:100%;top:0;left:0;background-color:#000c}.view-image-modal img{z-index:101;position:relative;max-width:100vw;max-height:100vh}.view-image-modal .close-btn{position:absolute;right:20px;top:20px;font-size:30px;width:30px;height:30px;color:#fff;z-index:102;cursor:pointer}.image-detail-modal{z-index:99;position:fixed;display:block;width:540px;height:320px;background-color:#fff;top:calc(50% - 150px);left:calc(50% - 250px)}.image-detail-modal .page-mask{z-index:100;position:fixed;width:100%;height:100%;top:0;left:0;background-color:#000c}.image-detail-modal .close-btn{position:absolute;color:#000;right:20px;top:20px;font-size:30px;width:30px;height:30px;z-index:102;cursor:pointer}.image-detail-modal .detail-section{position:relative;padding:20px;z-index:101;width:500px;height:350px;background-color:#fff}.image-detail-modal .detail-section .detail-title{font-size:20px;text-align:center;margin-bottom:10px;margin-top:15px}.image-detail-modal .detail-section .detail-li{line-height:30px}.image-detail-modal .detail-section .detail-li .title{width:200px;text-align:right;display:inline-block;font-size:15px;font-weight:700}.image-detail-modal .detail-section .detail-li .content{text-align:left;margin-left:5px;font-size:15px}.image-detail-modal .insert-btn{line-height:20px;border:1px solid #333;position:absolute;bottom:0;z-index:102;margin:auto;text-align:center;left:190px;padding:5px 10px;border-radius:20px;cursor:pointer}.image-detail-modal .insert-btn:hover{border:1px solid #006799;background-color:#006799;color:#fff}.load-more{position:relative;top:20px;display:block;height:20px;color:#828282;margin:auto;font-size:15px;text-align:center;cursor:pointer}.load-more span{font-family:sans-serif,Helvetica,Arial}.load-more:before{font-size:20px;position:relative;top:5px}.image-preview-modal{z-index:99;position:fixed;width:100%;height:100%;top:0;left:0;background-color:#000000e5;padding:20px;box-sizing:border-box}.image-preview-modal .close-btn{position:absolute;right:20px;top:30px;font-size:25px;color:#fff;cursor:pointer;z-index:99}.image-preview-modal .image-box{position:relative;width:calc(100% - 575px);height:100%}.image-preview-modal .image-box img{position:relative;max-width:100%;max-height:100%;margin:auto;left:50%;top:50%;transform:translate(-50%,-50%)}.image-preview-modal .detail-box{width:575px;top:0;position:absolute;right:0;box-sizing:border-box;height:90%;padding:20px 20px 20px 40px;background-color:#444}.image-preview-modal .detail-box .clear{clear:both}.image-preview-modal .detail-box .detail-list-cotnt{height:75%;overflow-y:auto;position:relative;overflow-x:hidden}.image-preview-modal .detail-box .image-name{font-size:18px;color:#fff;margin-top:15px;line-height:30px;margin-bottom:20px;width:calc(100% - 30px);display:block;position:relative;word-break:break-all}.image-preview-modal .detail-box .detail-item{font-size:12px;line-height:20px;color:#bbb;margin:5px 0}.image-preview-modal .detail-box .detail-item .title{font-weight:700}.image-preview-modal .detail-box .detail-item .more{display:none}.image-preview-modal .detail-box .detail-item.restrict-height .content{max-height:40px;overflow-y:hidden}.image-preview-modal .detail-box .detail-item.restrict-height .more{display:block;float:right;text-decoration:underline;cursor:pointer}.image-preview-modal .detail-box .insert-action-section{position:absolute;padding-bottom:20px;bottom:0;color:#ff9800;background-color:inherit;font-size:17px;width:calc(100% - 40px);box-sizing:border-box;line-height:50px}.image-preview-modal .detail-box .insert-action-section .insert-text{display:inline;color:#fff}.image-preview-modal .detail-box .insert-action-section .cancel-btn{display:inline;background-color:#666;padding:6px 15px;border-radius:15px;color:#fff;font-size:15px;margin-left:40px;cursor:pointer}.image-preview-modal .detail-box .insert-action-section .cancel-btn:hover{background-color:#555}.image-preview-modal .detail-box .insert-action-section .insert-btn{display:inline;background-color:#777;padding:6px 15px;border-radius:15px;color:#fff;font-size:15px;margin:10px;cursor:pointer}.image-preview-modal .detail-box .insert-action-section .insert-btn:hover{background-color:#666}.image-preview-modal .detail-box .insert-action-section .btn-group{float:right;margin-right:10px}.canto-pick-box{width:95%;background-color:#ff9800;padding:10px}.canto-pick-box .header{position:relative}.canto-pick-box .header .title{font-size:16px;font-weight:700;color:#fff}.canto-pick-box .header .close-btn{position:absolute;right:0;top:0;font-size:23px;color:#fff}.canto-pick-box .img-box{background-color:#fff;margin-top:10px;padding:10px}.canto-pick-box .btn-section{text-align:center}.canto-pick-box .btn-section button{height:30px;width:100px;line-height:26px;margin:15px;padding:0;font-size:15px;background-color:#ff9800;color:#fff;border:2px solid #fff;font-weight:700}.canto-pick-box .btn-section button:hover{background-color:#c77b09}.canto-preview-img{width:200px;height:200px;-o-object-fit:cover;object-fit:cover} diff --git a/src/web/assets/dist/assets/app-7c0be19c.css.gz b/src/web/assets/dist/assets/app-7c0be19c.css.gz new file mode 100644 index 0000000..3763f11 Binary files /dev/null and b/src/web/assets/dist/assets/app-7c0be19c.css.gz differ diff --git a/src/web/assets/dist/assets/app-fe94df30.js b/src/web/assets/dist/assets/app-fe94df30.js new file mode 100644 index 0000000..b12ec7b --- /dev/null +++ b/src/web/assets/dist/assets/app-fe94df30.js @@ -0,0 +1,2 @@ + +//# sourceMappingURL=app-fe94df30.js.map diff --git a/src/web/assets/dist/assets/app-fe94df30.js.map b/src/web/assets/dist/assets/app-fe94df30.js.map new file mode 100644 index 0000000..77a89ee --- /dev/null +++ b/src/web/assets/dist/assets/app-fe94df30.js.map @@ -0,0 +1 @@ +{"version":3,"file":"app-fe94df30.js","sources":[],"sourcesContent":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/src/web/assets/dist/assets/canto-embed-f0b95696.js b/src/web/assets/dist/assets/canto-embed-f0b95696.js new file mode 100644 index 0000000..d521644 --- /dev/null +++ b/src/web/assets/dist/assets/canto-embed-f0b95696.js @@ -0,0 +1,11 @@ +let g="",p="",m="",s={},f={},h="",u=[],k=50,v=0,r=!1,w="";const x=100,A=1e3;function M(e){g=e.accessToken,m=e.tenant,p=e.tokenType?e.tokenType:"bearer",f={Authorization:p+" "+g,"Content-Type":"application/x-www-form-urlencoded"},w=e.formatDistrict}s.loadTree=function(e){var a="https://"+m+"/api/v1/tree?sortBy=name&sortDirection=ascending&layer=1";$.ajax({headers:f,type:"GET",url:a,async:!0,error:function(n){alert("load tree error")},success:function(n){e(n.results)}})};s.loadSubTree=function(e,a){let n=`https://${m}/api/v1/tree/${e}`;$.ajax({headers:f,type:"GET",url:n,async:!0,error:function(t){alert("load tree error")},success:function(t){a(t.results)}})};s.getListByAlbum=function(e,a){if(r)return;let n=T(k),t=`https://${m}/api/v1/album/${e}?${n}`;$.ajax({type:"GET",headers:f,url:t,async:!0,error:function(o){alert("load list error")},success:function(o){u.push.apply(u,o.results),o.start||(o.start=0),o.found-o.limit<=o.start?r=!0:r=!1,v=o.start+o.limit+1,$("#loadingMore").delay(1500).fadeOut("slow"),a(o.results)}})};s.getRedirectURL=function(e,a){if(!(e&&a))return;let n=e+"URI";$.ajax({type:"GET",headers:f,url:n,error:function(t){console.error(t.getError())},success:function(t){$("img#"+a).attr("src",t)}})};s.getHugeRedirectURL=function(e,a){if(!(e&&a))return;let n=`${e}URI/2000`;$.ajax({type:"GET",headers:f,url:n,error:function(t){console.error(t.getError())},success:function(t){$("#cantoViewBody").find("#imageBox").find("img").attr("src",t)}})};s.getListByScheme=function(e,a){if(e=="allfile"){let n={scheme:"allfile",keywords:""};s.getFilterList(n,a)}else{if(r)return;let n=T(k),t=`https://${m}/api/v1/${e}?${n}`;$.ajax({type:"GET",headers:f,url:t,async:!1,error:function(o){alert("load list error")},success:function(o){u.push.apply(u,o.results),o.start||(o.start=0),o.found-o.limit<=o.start?r=!0:r=!1,v=o.start+o.limit+1,$("#loadingMore").delay(1500).fadeOut("slow"),a(o.results)}})}};s.getDetail=function(e,a,n){let t=`https://${m}/api/v1/${a}/${e}`;$.ajax({type:"GET",headers:f,url:t,async:!0,error:function(o){alert("load detail error")},success:function(o){n(o)}})};s.getFilterList=function(e,a){if(r)return;let n=T(k),t=`https://${m}/api/v1/search?${n}`;t+=`&keyword=${e.keywords}`,e.scheme&&e.scheme=="allfile"?t+=`&scheme=${encodeURIComponent("image|presentation|document|audio|video|other")}`:e.scheme&&(t+=`&scheme=${e.scheme}`),$.ajax({type:"GET",headers:f,url:t,async:!1,error:function(o){alert("load List error")},success:function(o){u.push.apply(u,o.results),o.start||(o.start=0),o.found-o.limit<=o.start?r=!0:r=!1,v=o.start+o.limit+1,$("#loadingMore").delay(1500).fadeOut("slow"),a(o.results)}})};s.logout=function(){let e=parent,a={};a.type="cantoLogout",e.postMessage(a,"*")};s.paginatedAlbumRequest=async(e,a,n=0)=>{let t=`https://${m}/api/v1/album/${a}`,o="sortBy=time&sortDirection=descending&limit="+A+"&start="+n,l=await fetch(`${t}?${o}`,{method:"get",headers:{Authorization:`${p} ${g}`,"Content-Type":"application/json; charset=utf-8"}}).then(c=>c.json());return e.push(...l.results),e.length{let t=`https://${m}/api/v1/batch/content`;const o=a.slice(n,n+x);let l=await fetch(t,{method:"post",headers:{Authorization:`${p} ${g}`,"Content-Type":"application/json; charset=utf-8"},body:JSON.stringify(o)}).then(c=>c.json());return e.push(...l.docResult),e.length{let n=a.length===1?a[0].id:0,t=$("#treeviewSection").find("li.selected");const o=t.data("id");let l=t.find("span").text(),d={type:"closeModal",cantoId:n,cantoAlbumId:0,cantoAssetData:a,cantoAlbumData:{id:o,name:l}};parent.postMessage(d,"*")}).catch(a=>{console.error(a.message),data.type="cantoInsertImage",data.assetList=[],parent.postMessage(data,"*")})};s.insertAlbum=function(e,a){s.paginatedAlbumRequest([],e,0).then(n=>{let o={type:"closeModal",cantoId:0,cantoAlbumId:e,cantoAssetData:n,cantoAlbumData:{id:e,name:a}};parent.postMessage(o,"*")}).catch(n=>{console.error(n.message),data.type="cantoInsertImage",data.assetList=[],parent.postMessage(data,"*")})};$(document).ready(function(){E(),z(),R(),window.addEventListener("message",e=>{let a=e.data;a&&a.accessToken&&a.accessToken.length>0?M(a):M({accessToken:parent.document.querySelector(".canto-uc-subiframe").dataset.access,tenant:parent.document.querySelector(".canto-uc-subiframe").dataset.tenant}),D();let n=$("#cantoViewBody").find(".type-font.current").data("type");$("#cantoViewBody").find("#globalSearch input").val(""),C(n)})});function R(){let e=parent,a={};a.type="getTokenInfo",e.postMessage(a,"*")}function E(){let e=document.getElementsByClassName("canto-uc-subiframe")[0];e&&e.contentDocument}function z(){document.addEventListener("sendTokenInfo",function(n){let t=n.data;g=t.accessToken,t.refreshToken,p=t.tokenType}),$(document).off("click").on("change","#uploadBtnInvisible",n=>{N(n)}).on("click","#uploadBtn",n=>{document.querySelector("#uploadBtnInvisible").click()}).on("click","#treeviewSwitch",function(n){$("#treeviewSection").hasClass("expanded")?($("#treeviewSection").stop().animate({left:"-20%"}),$("#cantoImageBody").stop().animate({width:"100%",left:"0"},B),$("#treeviewSection").removeClass("expanded"),$("#loadingMore").addClass("no-treeview"),$("#noItem").addClass("no-treeview"),$(".max-select-tips").addClass("no-treeview")):($("#treeviewSection").stop().animate({left:"0px"}),$("#cantoImageBody").stop().animate({width:"80%",left:"20%"},B),$("#treeviewSection").addClass("expanded"),$("#loadingMore").removeClass("no-treeview"),$("#noItem").removeClass("no-treeview"),$(".max-select-tips").removeClass("no-treeview"))}).on("click",".type-font",function(n){h="byScheme",$(".type-font").removeClass("current"),$(this).addClass("current"),$("#cantoViewBody").find("#globalSearch input").val(""),$("#cantoViewBody").find("#treeviewSection ul li").removeClass("selected");let t={};t.scheme=$("#cantoViewBody").find(".type-font.current").data("type"),t.keywords="",$("#cantoViewBody").find("#imagesContent").html(""),$("#cantoViewBody").find("#imagesContent").scrollTop(0),r=!1,u=[],s.getFilterList(t,y)}).on("click","#selectAllBtn",function(n){$("#cantoViewBody").find(".single-image .select-box").removeClass("icon-s-Ok2_32"),$("#cantoViewBody").find(".single-image").removeClass("selected"),S()}).on("click","#insertAssetsBtn",function(n){$("#cantoViewBody").find(".loading-icon").removeClass("hidden");let t=[],o=$("#cantoViewBody").find(".single-image .icon-s-Ok2_32").closest(".single-image");for(let l=0;l0))return;let a=[];w&&w.length>1&&(a=w.split(";"));for(let c=0;c150&&(I=d.name.substr(0,142)+"..."+d.name.substr(-5)),V+=`
+ ${d.scheme} +
+
${I}
+ +
`,$("#cantoViewBody").find("#imagesContent").append(V),s.getRedirectURL(d.url.preview,d.id)}$("#cantoViewBody").find(".single-image").length==0?$("#cantoViewBody").find("#noItem").removeClass("hidden"):$("#cantoViewBody").find("#noItem").addClass("hidden");let t=[];$("#cantoViewBody").find(".single-image").hover(function(){let c=$(this).height()-$(this).find(".single-image-name").height()-20;$(this).find(".single-image-name").stop().animate({top:c})},function(){$(this).find(".single-image-name").stop().animate({top:"100%"})}),$("#cantoViewBody").find(".single-image .select-box").off("click").on("click",function(c){if(c.cancelBubble=!0,c.stopPropagation(),c.preventDefault(),t.push($(".single-image").index($(this).closest(".single-image"))),c.shiftKey){let d=Math.min(t[t.length-2],t[t.length-1]),b=Math.max(t[t.length-2],t[t.length-1]);for(i=d;i<=b;i++){if($("#cantoViewBody").find(".single-image .icon-s-Ok2_32").length>=20){$(".max-select-tips").fadeIn("normal").delay(2e3).fadeOut(1e3);return}$(".single-image:eq("+i+") .select-box").addClass("icon-s-Ok2_32"),$(".single-image:eq("+i+")").addClass("selected")}}else if($("#cantoViewBody").find(".single-image .icon-s-Ok2_32").length>=20){$(this).hasClass("icon-s-Ok2_32")||$(".max-select-tips").fadeIn("normal").delay(2e3).fadeOut(1e3),$(this).removeClass("icon-s-Ok2_32"),$(this).closest(".single-image").removeClass("selected");return}else $(this).toggleClass("icon-s-Ok2_32"),$(this).closest(".single-image").toggleClass("selected");S()}),B(),S();let o=$("#cantoImageBody").height();$("#imagesContent").height()l?($(o).removeClass("hidden"),t.slice(0,l)+"..."):($(o).addClass("hidden"),t)};if(e){$("#cantoViewBody").find("#imagebox_name").html(e.name),$("#cantoViewBody").find("#imagebox_size").html(Math.round(e.size/1024)+"KB"),$("#cantoViewBody").find("#imagebox_created").html(e.metadata&&e.metadata["Create Date"]?e.metadata["Create Date"]:" "),$("#cantoViewBody").find("#imagebox_uploaded").html(j(e.lastUploaded)),$("#cantoViewBody").find("#imagebox_status").html(e.approvalStatus);let t=$("#imagebox_copyright").closest(".detail-item").find(".more");$("#cantoViewBody").find("#imagebox_copyright").html(a(e.copyright,t,177)),$("#cantoViewBody").find("#imagebox_copyright").data("field",e.copyright);let o=$("#imagebox_tac").closest(".detail-item").find(".more");$("#cantoViewBody").find("#imagebox_tac").html(a(e.termsAndConditions,o,160)),$("#cantoViewBody").find("#imagebox_tac").data("field",e.termsAndConditions),$("#cantoViewBody").find("#insertBtn").data("id",e.id),$("#cantoViewBody").find("#insertBtn").data("scheme",e.scheme)}let n=$("#cantoViewBody").find("#imagePreviewModal");$("#cantoViewBody").find(".loading-icon").addClass("hidden"),n.removeClass("hidden"),$("#cantoViewBody").find("#imagePreviewModal .close-btn").off("click").on("click",function(){n.addClass("hidden")}),$("#cantoViewBody").find("#imagePreviewModal #cancelBtn").off("click").on("click",function(){n.addClass("hidden")}),$("#cantoViewBody").find("#imagePreviewModal .detail-item .more").off("click").on("click",function(){let t=$(this).closest(".detail-item").find(".content").data("field");$(this).closest(".detail-item").find(".content").html(t),$(this).addClass("hidden")}),$("#cantoViewBody").find("#imagePreviewModal #insertBtn").off("click").on("click",function(){$("#cantoViewBody").find(".loading-icon").removeClass("hidden");let t=[{id:e.id,scheme:e.scheme}];s.insertImage(t)})}function j(e){return e.substr(0,4)+"-"+e.substr(4,2)+"-"+e.substr(6,2)+" "+e.substr(8,2)+":"+e.substr(10,2)}function D(){s.loadTree(U)}let U=function(e){let a="";a=F(e),$("#cantoViewBody").find("#treeviewContent").append(a),$("#cantoViewBody").find("#treeviewContent > ul").animate({height:"toggle"})},F=function(e){let a="
    ";return $.each(e,function(n,t){let o=" ";t.size==0?o="no-child":t.scheme=="folder"&&(o="has-sub-folder"),a+=`
  • `;let l="icon-s-Folder_open-20px";t.scheme=="album"&&(l="icon-s-Album-20px"),a+=` + + ${t.name} +
  • `}),a+="
",a},P=function(e){let a=_(e);$("#cantoViewBody").find(".current-tree-node").append(a),$("#cantoViewBody").find(".current-tree-node > ul").animate({height:"toggle"}),$("#cantoViewBody").find(".current-tree-node").find(".folder-loading").addClass("hidden"),$("#cantoViewBody").find(".current-tree-node").find(".icon-s-Folder_open-20px").removeClass("hidden"),$("#cantoViewBody").find(".current-tree-node").removeClass("current-tree-node")},_=function(e){let a="
    ";return $.each(e,function(n,t){let o=" ";t.size==0&&(o="no-child"),a+=`
  • `;let l="icon-s-Folder_open-20px";t.scheme=="album"&&(l="icon-s-Album-20px"),a+=` + ${t.name}`,t.children&&t.children.length&&(a+=_(t.children)),a+="
  • "}),a+="
",a};function B(){let e=8,a=Number($("#cantoViewBody").find("#imagesContent")[0].offsetWidth),n=0,t=function(l){if(n=Number((a-8)/l-2),n>=160&&n<=210)return n;n<160?(l--,t(l)):n>210&&(l++,t(l))},o=t(e);$("#cantoViewBody").find(".single-image").css("width",o)}function H(){let e=$("#cantoImageBody").height(),a=$("#imagesContent").height(),n=$("#cantoImageBody").scrollTop(),t=a-e-n<0,o=$(".single-image").length==0;return t&&!o}function T(e){let a=u.length==0?0:v,n="sortBy=time&sortDirection=descending&limit="+e+"&start="+a;return $(".single-image").length!==0?$("#loadingMore").fadeIn("slow"):$("#cantoViewBody").find("#imagesContent").html(""),n}function L(){if(h=="bySearch"){let e=$("#cantoViewBody").find("#globalSearch input").val();if(!e)return;let a=$("#cantoViewBody").find(".type-font.current").data("type"),n={};n.scheme=a,n.keywords=e,s.getFilterList(n,y)}else if(h=="bytree"){let e=$("#cantoViewBody").find("#treeviewSection ul li").find(".selected").data("id");s.getListByAlbum(e,y)}else{let e=$("#cantoViewBody").find(".type-font.current").data("type");C(e)}}function N(e){let a=`https://${m}/api/v1/upload/setting`;fetch(a,{method:"GET",headers:{Authorization:`${p} ${g}`,"Content-Type":"application/json; charset=utf-8"}}).then(t=>t.json()).then(t=>{const o=new FormData;o.append("key",t.key),o.append("acl",t.acl),o.append("AWSAccessKeyId",t.AWSAccessKeyId),o.append("Policy",t.Policy),o.append("Signature",t.Signature),o.append("x-amz-meta-file_name",e.currentTarget.files[0].name),o.append("x-amz-meta-tag",""),o.append("x-amz-meta-scheme",""),o.append("x-amz-meta-id",""),o.append("x-amz-meta-album_id",""),o.append("file",e.currentTarget.files[0]),parent.document.querySelector(".modal-status-bar"),fetch(t.url,{method:"post",body:o,mode:"no-cors",redirect:"follow"}).then(l=>{document.getElementById("uploadBtn").style.background="linear-gradient(16deg, rgb(205 101 1) 0%, rgb(169 218 0 / 100%) 100%)",document.getElementById("uploadBtn").value="Uploading image..."}).catch(l=>{console.log(l)}).finally(()=>{document.getElementById("uploadBtn").value="Upload complete - processing",n(e.currentTarget.files[0].name)})}).catch(t=>{console.log("An error occurred while attempting to grab upload settings!"),console.log(t)});function n(t){let o=`https://${m}/api/v1/upload/status?hours=1`;parent.document.querySelector(".modal-status-bar"),setInterval(()=>{fetch(o,{method:"get",headers:{Authorization:p+" "+g}}).then(l=>l.json()).then(l=>{l.results&&l.results.length>0&&l.results.filter(d=>{if(d.name==t&&d.status!="Done")return d}).filter(d=>d!=null).length==0&&(document.getElementById("uploadBtn").value="Canto processing complete! Reloading",window.location.reload())}).catch(l=>{console.log("an error occurred!"),console.log(l)})},5e3)}}parent.document.querySelector(".modal-status-bar").style.display="none"; +//# sourceMappingURL=canto-embed-f0b95696.js.map diff --git a/src/web/assets/dist/assets/canto-embed-f0b95696.js.gz b/src/web/assets/dist/assets/canto-embed-f0b95696.js.gz new file mode 100644 index 0000000..4b687db Binary files /dev/null and b/src/web/assets/dist/assets/canto-embed-f0b95696.js.gz differ diff --git a/src/web/assets/dist/assets/canto-embed-f0b95696.js.map b/src/web/assets/dist/assets/canto-embed-f0b95696.js.map new file mode 100644 index 0000000..cd6808a --- /dev/null +++ b/src/web/assets/dist/assets/canto-embed-f0b95696.js.map @@ -0,0 +1 @@ +{"version":3,"file":"canto-embed-f0b95696.js","sources":["../../../../../buildchain/src/js/canto-embed.js"],"sourcesContent":["let cantoViewDom = {};\nlet _accessToken = \"\";\nlet _refreshToken = \"\";\nlet _tokenType = \"\";\nlet _tenants = \"\";\nlet cantoAPI = {};\nlet _APIHeaders = {};\nlet searchedBy = \"\"; //bySearch bytree byScheme''\nlet currentImageList = [];\nlet singleCountLoad = 50;\nlet apiNextStart = 0;\nlet isLoadingComplete = false;\nlet _formatDistrict = '';\nconst MAX_CONTENT_REQUEST_ITEMS = 100;\nconst MAX_ALBUM_REQUEST_ITEMS = 1000;\n\n/* -----------------canto API start-------------------------------------------------------------*/\n\nfunction setToken(tokenInfo) {\n _accessToken = tokenInfo.accessToken;\n _tenants = tokenInfo.tenant;\n _tokenType = tokenInfo.tokenType ? tokenInfo.tokenType : \"bearer\";\n _APIHeaders = {\n \"Authorization\": _tokenType + \" \" + _accessToken,\n \"Content-Type\": \"application/x-www-form-urlencoded\"\n };\n _formatDistrict = tokenInfo.formatDistrict;\n}\n\n\ncantoAPI.loadTree = function (callback) {\n var url = \"https://\" + _tenants + \"/api/v1/tree?sortBy=name&sortDirection=ascending&layer=1\";\n $.ajax({\n headers: _APIHeaders,\n type: \"GET\",\n url: url,\n async: true,\n error: function (request) {\n alert(\"load tree error\");\n },\n success: function (data) {\n callback(data.results);\n }\n });\n};\ncantoAPI.loadSubTree = function (treeID, callback) {\n let url = `https://${_tenants}/api/v1/tree/${treeID}`;\n $.ajax({\n headers: _APIHeaders,\n type: \"GET\",\n url: url,\n async: true,\n error: function (request) {\n alert(\"load tree error\");\n },\n success: function (data) {\n callback(data.results);\n }\n });\n};\ncantoAPI.getListByAlbum = function (albumID, callback) {\n if (isLoadingComplete) {\n return;\n }\n let filterString = loadMoreHandler(singleCountLoad);\n let url = `https://${_tenants}/api/v1/album/${albumID}?${filterString}`;\n $.ajax({\n type: \"GET\",\n headers: _APIHeaders,\n url: url,\n async: true,\n error: function (request) {\n alert(\"load list error\");\n },\n success: function (data) {\n currentImageList.push.apply(currentImageList, data.results);\n if (!data.start) {\n data.start = 0;\n }\n if (data.found - data.limit <= data.start) {\n isLoadingComplete = true;\n } else {\n isLoadingComplete = false;\n }\n apiNextStart = data.start + data.limit + 1;\n $(\"#loadingMore\").delay(1500).fadeOut(\"slow\");\n callback(data.results);\n }\n });\n};\ncantoAPI.getRedirectURL = function (previewURL, ID) {\n if (!(previewURL && ID)) return;\n let url = previewURL + 'URI';\n $.ajax({\n type: \"GET\",\n headers: _APIHeaders,\n url: url,\n error: function (request) {\n console.error(request.getError());\n },\n success: function (data) {\n $(\"img#\" + ID).attr('src', data);\n }\n });\n};\ncantoAPI.getHugeRedirectURL = function (previewURL, ID) {\n if (!(previewURL && ID)) return;\n let url = `${previewURL}URI/2000`;\n $.ajax({\n type: \"GET\",\n headers: _APIHeaders,\n url: url,\n error: function (request) {\n console.error(request.getError());\n },\n success: function (data) {\n let $viewImageModal = $(\"#cantoViewBody\").find(\"#imageBox\");\n $viewImageModal.find(\"img\").attr(\"src\", data);\n }\n });\n};\n\n\ncantoAPI.getListByScheme = function (scheme, callback) {\n if (scheme == \"allfile\") {\n let data = {scheme: \"allfile\", keywords: \"\"};\n cantoAPI.getFilterList(data, callback);\n } else {\n if (isLoadingComplete) {\n return;\n }\n let filterString = loadMoreHandler(singleCountLoad);\n let url = `https://${_tenants}/api/v1/${scheme}?${filterString}`;\n $.ajax({\n type: \"GET\",\n headers: _APIHeaders,\n url: url,\n async: false,\n error: function (request) {\n alert(\"load list error\");\n },\n success: function (data) {\n currentImageList.push.apply(currentImageList, data.results);\n if (!data.start) {\n data.start = 0;\n }\n if (data.found - data.limit <= data.start) {\n isLoadingComplete = true;\n } else {\n isLoadingComplete = false;\n }\n apiNextStart = data.start + data.limit + 1;\n $(\"#loadingMore\").delay(1500).fadeOut(\"slow\");\n callback(data.results);\n }\n });\n }\n\n};\n\ncantoAPI.getDetail = function (contentID, scheme, callback) {\n let url = `https://${_tenants}/api/v1/${scheme}/${contentID}`;\n $.ajax({\n type: \"GET\",\n headers: _APIHeaders,\n url: url,\n async: true,\n error: function (request) {\n alert(\"load detail error\");\n },\n success: function (data) {\n callback(data);\n }\n });\n};\n\ncantoAPI.getFilterList = function (data, callback) {\n if (isLoadingComplete) {\n return;\n }\n let filterString = loadMoreHandler(singleCountLoad);\n let url = `https://${_tenants}/api/v1/search?${filterString}`;\n url += `&keyword=${data.keywords}`;\n if (data.scheme && data.scheme == \"allfile\") {\n url += `&scheme=${encodeURIComponent(\"image|presentation|document|audio|video|other\")}`;\n } else if (data.scheme) {\n url += `&scheme=${data.scheme}`;\n }\n $.ajax({\n type: \"GET\",\n headers: _APIHeaders,\n url: url,\n async: false,\n error: function (request) {\n alert(\"load List error\");\n },\n success: function (data) {\n currentImageList.push.apply(currentImageList, data.results);\n if (!data.start) {\n data.start = 0;\n }\n if (data.found - data.limit <= data.start) {\n isLoadingComplete = true;\n } else {\n isLoadingComplete = false;\n }\n apiNextStart = data.start + data.limit + 1;\n $(\"#loadingMore\").delay(1500).fadeOut(\"slow\");\n callback(data.results);\n }\n });\n};\n\ncantoAPI.logout = function () {\n //clear cookie and trun to login page.\n let targetWindow = parent;\n let data = {};\n data.type = \"cantoLogout\";\n targetWindow.postMessage(data, '*');\n};\n\n/**\n * Retrieve all of the assets from the albumId album, paginated to handle API limits\n *\n * @param {[]} buffer\n * @param {string} albumId\n * @param {number} start\n * @returns {Promise<*>}\n */\ncantoAPI.paginatedAlbumRequest = async (buffer, albumId, start = 0) => {\n let url = `https://${_tenants}/api/v1/album/${albumId}`;\n let filterString = \"sortBy=time&sortDirection=descending&limit=\" + MAX_ALBUM_REQUEST_ITEMS + \"&start=\" + start;\n let result = await fetch(`${url}?${filterString}`, {\n method: \"get\",\n headers: {\n \"Authorization\": `${_tokenType} ${_accessToken}`,\n \"Content-Type\": \"application/json; charset=utf-8\"\n },\n }).then((response) => {\n return response.json();\n });\n buffer.push(...result['results']);\n if (buffer.length < result.found) {\n return cantoAPI.paginatedAlbumRequest(buffer, albumId, start + MAX_ALBUM_REQUEST_ITEMS);\n } else {\n return buffer;\n }\n}\n\n/**\n * Retrieve all of the assets in the imageArray array, paginated to handle API limits\n *\n * @param {[]} buffer\n * @param {{id: string, scheme: string}[]} imageArray\n * @param {number} start\n * @returns {Promise<*>}\n */\ncantoAPI.paginatedContentRequest = async (buffer, imageArray, start = 0) => {\n let url = `https://${_tenants}/api/v1/batch/content`;\n const imageArraySubset = imageArray.slice(start, start + MAX_CONTENT_REQUEST_ITEMS);\n let result = await fetch(url, {\n method: \"post\",\n headers: {\n \"Authorization\": `${_tokenType} ${_accessToken}`,\n \"Content-Type\": \"application/json; charset=utf-8\"\n },\n body: JSON.stringify(imageArraySubset)\n }).then((response) => {\n return response.json();\n });\n buffer.push(...result['docResult']);\n if (buffer.length < imageArray.length) {\n return cantoAPI.paginatedContentRequest(buffer, imageArray, start + MAX_CONTENT_REQUEST_ITEMS);\n } else {\n return buffer;\n }\n}\n\n/**\n * Insert the images in imageArray into the CMS\n *\n * @param {{id: string, scheme: string}[]} imageArray\n */\ncantoAPI.insertImage = function (imageArray) {\n if (!(imageArray && imageArray.length)) {\n return;\n }\n cantoAPI.paginatedContentRequest([], imageArray, 0).then((response) => {\n // Get the id of the canto asset, or 0 if it is a collection of images\n let id = response.length === 1 ? response[0].id : 0;\n // Gather information about the selected album\n let album = $(\"#treeviewSection\").find(\"li.selected\");\n const albumId = album.data('id');\n let albumName = album.find('span').text();\n const albumData = {\n id: albumId,\n name: albumName,\n };\n // Compose the payload to send as an event\n let data = {\n type: \"closeModal\",\n // The id of the canto asset, or 0 if it not a single image selection\n cantoId: id,\n // The id of the album, or 0 if it not a full album selection\n cantoAlbumId: 0,\n cantoAssetData: response,\n cantoAlbumData: albumData,\n };\n // Let our canto-field.js know what asset(s) were picked\n parent.postMessage(data, '*');\n }).catch((error) => {\n console.error(error.message);\n data.type = \"cantoInsertImage\";\n data.assetList = [];\n parent.postMessage(data, '*');\n });\n};\n\n/**\n * Insert the images in imageArray into the CMS\n *\n * @param {string} albumId\n * @param {string} albumName\n */\ncantoAPI.insertAlbum = function (albumId, albumName) {\n cantoAPI.paginatedAlbumRequest([], albumId, 0).then((response) => {\n // Gather information about the selected album\n const albumData = {\n id: albumId,\n name: albumName,\n };\n // Compose the payload to send as an event\n let data = {\n type: \"closeModal\",\n // The id of the canto asset, or 0 if it not a single image selection\n cantoId: 0,\n // The id of the album, or 0 if it not a full album selection\n cantoAlbumId: albumId,\n cantoAssetData: response,\n cantoAlbumData: albumData,\n };\n // Let our canto-field.js know what asset(s) were picked\n parent.postMessage(data, '*');\n }).catch((error) => {\n console.error(error.message);\n data.type = \"cantoInsertImage\";\n data.assetList = [];\n parent.postMessage(data, '*');\n });\n};\n\n/* -----------------canto API end--------------------------------------------------------*/\n\n$(document).ready(function () {\n getFrameDom();\n addEventListener();\n getTokenInfo();\n\n window.addEventListener(\"message\", (event) => {\n let tokenInfo = event.data;\n\n if (tokenInfo && tokenInfo.accessToken && tokenInfo.accessToken.length > 0) {\n setToken(tokenInfo);\n } else {\n setToken({\n accessToken: parent.document.querySelector(\".canto-uc-subiframe\").dataset.access,\n tenant: parent.document.querySelector(\".canto-uc-subiframe\").dataset.tenant,\n });\n }\n treeviewDataHandler();\n let initSchme = $(\"#cantoViewBody\").find(\".type-font.current\").data(\"type\");\n $(\"#cantoViewBody\").find(\"#globalSearch input\").val(\"\");\n getImageInit(initSchme);\n });\n\n\n});\n\nfunction getTokenInfo() {\n let targetWindow = parent;\n let data = {};\n data.type = \"getTokenInfo\";\n targetWindow.postMessage(data, '*');\n}\n\nfunction getFrameDom() {\n let parentDocument = document;\n let contentIframe = document.getElementsByClassName('canto-uc-subiframe')[0];\n if (contentIframe) {\n parentDocument = contentIframe.contentDocument;\n }\n cantoViewDom = parentDocument;\n}\n\nfunction addEventListener() {\n document.addEventListener('sendTokenInfo', function (e) {\n let tokenInfo = e.data;\n _accessToken = tokenInfo.accessToken;\n _refreshToken = tokenInfo.refreshToken;\n _tokenType = tokenInfo.tokenType;\n });\n\n $(document).off('click').on(\"change\", \"#uploadBtnInvisible\", (e) => {\n uploadFileToCanto(e);\n })\n .on(\"click\", \"#uploadBtn\", (e) => {\n document.querySelector(\"#uploadBtnInvisible\").click();\n })\n .on(\"click\", \"#treeviewSwitch\", function (e) {\n if ($('#treeviewSection').hasClass(\"expanded\")) {\n $('#treeviewSection').stop().animate({\n left: '-20%'\n });\n $('#cantoImageBody').stop().animate({\n width: '100%',\n left: '0'\n }, imageResize);\n $('#treeviewSection').removeClass(\"expanded\");\n $(\"#loadingMore\").addClass(\"no-treeview\");\n $(\"#noItem\").addClass(\"no-treeview\");\n $(\".max-select-tips\").addClass(\"no-treeview\");\n } else {\n $('#treeviewSection').stop().animate({\n left: '0px'\n });\n $('#cantoImageBody').stop().animate({\n width: '80%',\n left: '20%'\n }, imageResize);\n $('#treeviewSection').addClass(\"expanded\");\n $(\"#loadingMore\").removeClass(\"no-treeview\");\n $(\"#noItem\").removeClass(\"no-treeview\");\n $(\".max-select-tips\").removeClass(\"no-treeview\");\n }\n\n })\n .on(\"click\", \".type-font\", function (e) {\n searchedBy = \"byScheme\";\n $(\".type-font\").removeClass(\"current\");\n $(this).addClass(\"current\");\n // let type = $(this).data(\"type\");\n $(\"#cantoViewBody\").find(\"#globalSearch input\").val(\"\");\n $(\"#cantoViewBody\").find(\"#treeviewSection ul li\").removeClass(\"selected\");\n\n let data = {};\n data.scheme = $(\"#cantoViewBody\").find(\".type-font.current\").data(\"type\");\n data.keywords = \"\";\n $(\"#cantoViewBody\").find(\"#imagesContent\").html(\"\");\n $(\"#cantoViewBody\").find(\"#imagesContent\").scrollTop(0);\n isLoadingComplete = false;\n currentImageList = [];\n cantoAPI.getFilterList(data, imageListDisplay);\n\n })\n .on(\"click\", \"#selectAllBtn\", function (e) {\n $(\"#cantoViewBody\").find('.single-image .select-box').removeClass(\"icon-s-Ok2_32\");\n $(\"#cantoViewBody\").find(\".single-image\").removeClass(\"selected\");\n handleSelectedMode();\n })\n .on(\"click\", \"#insertAssetsBtn\", function (e) {\n $(\"#cantoViewBody\").find(\".loading-icon\").removeClass(\"hidden\");\n let assetArray = [];\n let selectedArray = $(\"#cantoViewBody\").find(\".single-image .icon-s-Ok2_32\").closest(\".single-image\");\n for (let i = 0; i < selectedArray.length; i++) {\n let obj = {};\n obj.id = $(selectedArray[i]).data(\"id\");\n obj.scheme = $(selectedArray[i]).data(\"scheme\");\n assetArray.push(obj);\n }\n cantoAPI.insertImage(assetArray);\n })\n // Allow for the insertion of the entire album into the target system\n .on(\"click\", \"#insertAlbumBtn\", function (e) {\n $(\"#cantoViewBody\").find(\".loading-icon\").removeClass(\"hidden\");\n let album = $(\"#treeviewSection\").find(\"li.selected\");\n const albumId = album.data('id');\n let albumName = album.find('span').text();\n cantoAPI.insertAlbum(albumId, albumName);\n })\n .on(\"click\", \".icon-s-Fullscreen\", function (e) {\n e.cancelBubble = true;\n e.stopPropagation();\n e.preventDefault();\n $(\"#cantoViewBody\").find(\".loading-icon\").removeClass(\"hidden\");\n let targetURL = $(e.currentTarget).closest(\".single-image\").data(\"xurl\");\n let previewURL = targetURL + \"?Authorization=\" + _accessToken;\n displayFullyImage(previewURL);\n })\n .on(\"click\", \".single-image\", function (e) {\n $(\"#cantoViewBody\").find(\".loading-icon\").removeClass(\"hidden\");\n //display image\n let targetURL = $(e.currentTarget).closest(\".single-image\").data(\"xurl\");\n let targetID = $(e.currentTarget).closest(\".single-image\").data(\"id\");\n cantoAPI.getHugeRedirectURL(targetURL, targetID);\n //display detail\n let id = $(this).data(\"id\");\n let scheme = $(this).data(\"scheme\");\n cantoAPI.getDetail(id, scheme, imageNewDetail);\n })\n .on(\"click\", \"#logoutBtn\", function (e) {\n $(\".loading-icon\").removeClass(\"hidden\");\n cantoAPI.logout();\n })\n //treeview event\n .on(\"click\", \"#treeviewSection ul li\", function (e) {\n e.cancelBubble = true;\n e.stopPropagation();\n e.preventDefault();\n let childList = $(e.currentTarget).children(\"ul\");\n // childList.toggleClass(\"hidden\");\n if (\"treeviewContent\" == $(e.currentTarget)[0].id) {\n //load init image list.\n $(\"#cantoViewBody\").find(\"#globalSearch input\").val(\"\");\n $(\"#cantoViewBody\").find(\"#treeviewSection ul li\").removeClass(\"selected\");\n $(\"#cantoViewBody\").find(\".type-font\").removeClass(\"current\");\n $(\"#cantoViewBody\").find(\"#imagesContent\").html(\"\");\n $(\"#cantoViewBody\").find(\"#imagesContent\").scrollTop(0);\n currentImageList = [];\n searchedBy = \"\";\n isLoadingComplete = false;\n getImageInit(\"allfile\");\n\n } else if (childList && childList.length) {\n childList.animate({\n height: 'toggle'\n });\n } else if ($(e.currentTarget).hasClass(\"has-sub-folder\")) {\n let subTreeId = $(e.currentTarget).data(\"id\");\n $(e.currentTarget).addClass(\"current-tree-node\");\n $(e.currentTarget).find(\".folder-loading\").removeClass(\"hidden\");\n $(e.currentTarget).find(\".icon-s-Folder_open-20px\").addClass(\"hidden\");\n cantoAPI.loadSubTree(subTreeId, subTreeRender);\n\n } else {\n $(\"#treeviewSection ul li\").removeClass(\"selected\");\n $(\"#cantoViewBody\").find(\".type-font\").removeClass(\"current\");\n $(\"#insertAlbumWrapper\").removeClass(\"hidden\");\n $(e.currentTarget).addClass(\"selected\");\n $(\"#cantoViewBody\").find(\"#globalSearch input\").val(\"\");\n $(\"#cantoViewBody\").find(\"#imagesContent\").html(\"\");\n $(\"#cantoViewBody\").find(\"#imagesContent\").scrollTop(0);\n currentImageList = [];\n isLoadingComplete = false;\n searchedBy = \"bytree\";\n let albumId = $(e.currentTarget).data(\"id\");\n cantoAPI.getListByAlbum(albumId, imageListDisplay);\n }\n\n })\n .on(\"click\", \"#globalSearchBtn\", function (e) {\n let value = $(\"#cantoViewBody\").find(\"#globalSearch input\").val();\n if (!value) {\n //load init image list.\n $(\"#cantoViewBody\").find(\"#treeviewSection ul li\").removeClass(\"selected\");\n let initSchme = $(\"#cantoViewBody\").find(\".type-font.current\").data(\"type\");\n $(\"#cantoViewBody\").find(\"#globalSearch input\").val(\"\");\n $(\"#cantoViewBody\").find(\"#imagesContent\").html(\"\");\n $(\"#cantoViewBody\").find(\"#imagesContent\").scrollTop(0);\n currentImageList = [];\n searchedBy = \"\";\n isLoadingComplete = false;\n getImageInit(initSchme);\n }\n searchedBy = \"bySearch\";\n isLoadingComplete = false;\n $(\"#cantoViewBody\").find(\"#treeviewSection ul li\").removeClass(\"selected\");\n $(\"#cantoViewBody\").find(\".type-font\").removeClass(\"current\");\n let initSchme = $(\"#cantoViewBody\").find(\".type-font.current\").data(\"type\");\n let data = {};\n data.scheme = initSchme;\n data.keywords = value;\n $(\"#cantoViewBody\").find(\"#imagesContent\").html(\"\");\n $(\"#cantoViewBody\").find(\"#imagesContent\").scrollTop(0);\n currentImageList = [];\n cantoAPI.getFilterList(data, imageListDisplay);\n });\n $(\"#cantoViewBody\").find(\"#cantoImageBody\").on(\"scroll\", function () {\n if (isScrollToPageBottom() && !isLoadingComplete) {\n loadMoreAction();\n }\n });\n\n let inputObj = $(\"#cantoViewBody\").find(\"#globalSearch input\");\n $(inputObj).bind('keyup', function (event) {\n if (event.keyCode == \"13\") {\n $(\"#cantoViewBody\").find('#globalSearchBtn').click();\n }\n });\n\n let imageListSection = $(\"#cantoViewBody\").find(\"#cantoImageBody\");\n $(imageListSection).resize(function () {\n imageResize();\n });\n}\n\nfunction getImageInit(scheme) {\n cantoAPI.getListByScheme(scheme, imageListDisplay);\n}\n\nfunction imageListDisplay(imageList) {\n if (!(imageList && imageList.length > 0)) {\n return;\n }\n let formatArr = [];\n if (_formatDistrict && _formatDistrict.length > 1) {\n formatArr = _formatDistrict.split(\";\");\n }\n for (let i = 0; i < imageList.length; i++) {\n let d = imageList[i];\n let extension = d.name.substring(d.name.lastIndexOf('.') + 1);\n if (formatArr.length && !formatArr.includes(extension)) {\n continue;\n }\n let html = \"\";\n let disname = d.name;\n if (d.name.length > 150) {\n disname = d.name.substr(0, 142) + '...' + d.name.substr(-5);\n }\n html += `
\n \"${d.scheme}\"\n
\n
${disname}
\n \n
`;\n $(\"#cantoViewBody\").find(\"#imagesContent\").append(html);\n cantoAPI.getRedirectURL(d.url.preview, d.id);\n }\n let currentCount = $(\"#cantoViewBody\").find('.single-image').length;\n if (currentCount == 0) {\n $(\"#cantoViewBody\").find(\"#noItem\").removeClass(\"hidden\");\n } else {\n $(\"#cantoViewBody\").find(\"#noItem\").addClass(\"hidden\");\n }\n let rem = [];\n $(\"#cantoViewBody\").find('.single-image').hover(function () {\n let nameTop = $(this).height() - $(this).find(\".single-image-name\").height() - 20;\n $(this).find('.single-image-name').stop().animate({top: nameTop});\n }, function () {\n $(this).find('.single-image-name').stop().animate({top: '100%'});\n });\n $(\"#cantoViewBody\").find('.single-image .select-box').off('click').on('click', function (e) {\n e.cancelBubble = true;\n e.stopPropagation();\n e.preventDefault();\n\n rem.push($(\".single-image\").index($(this).closest(\".single-image\")));\n if (e.shiftKey) {\n let iMin = Math.min(rem[rem.length - 2], rem[rem.length - 1]);\n let iMax = Math.max(rem[rem.length - 2], rem[rem.length - 1]);\n for (i = iMin; i <= iMax; i++) {\n let selectedCount = $(\"#cantoViewBody\").find(\".single-image .icon-s-Ok2_32\").length;\n if (selectedCount >= 20) {\n $(\".max-select-tips\").fadeIn(\"normal\").delay(2000).fadeOut(1000);\n return;\n }\n $(\".single-image:eq(\" + i + \") .select-box\").addClass(\"icon-s-Ok2_32\");\n $(\".single-image:eq(\" + i + \")\").addClass(\"selected\");\n }\n } else {\n let selectedCount = $(\"#cantoViewBody\").find(\".single-image .icon-s-Ok2_32\").length;\n if (selectedCount >= 20) {\n if (!$(this).hasClass(\"icon-s-Ok2_32\")) {\n $(\".max-select-tips\").fadeIn(\"normal\").delay(2000).fadeOut(1000);\n }\n $(this).removeClass(\"icon-s-Ok2_32\");\n $(this).closest(\".single-image\").removeClass(\"selected\");\n return;\n } else {\n $(this).toggleClass(\"icon-s-Ok2_32\");\n $(this).closest(\".single-image\").toggleClass(\"selected\");\n }\n\n }\n handleSelectedMode();\n });\n imageResize();\n handleSelectedMode();\n\n let bodyHeight = $(\"#cantoImageBody\").height();\n let documentHeight = $(\"#imagesContent\").height();\n if (documentHeight < bodyHeight && !isLoadingComplete) {\n loadMoreAction();\n }\n}\n\nlet handleSelectedMode = function () {\n let selectedCount = $(\"#cantoViewBody\").find(\".single-image .icon-s-Ok2_32\").length;\n $(\"#cantoViewBody\").find(\"#selected-count\").html(selectedCount);\n if (selectedCount) {\n $(\"#cantoViewBody\").find(\"#globalSearch\").addClass(\"hidden\");\n $(\"#cantoViewBody\").find(\"#filterSection\").addClass(\"hidden\");\n $(\"#cantoViewBody\").find(\"#selectedCountSection\").removeClass(\"hidden\");\n $(\"#cantoViewBody\").find(\"#selectedActionSection\").removeClass(\"hidden\");\n $(\"#insertAlbumWrapper\").addClass(\"hidden\");\n } else {\n $(\"#cantoViewBody\").find(\"#globalSearch\").removeClass(\"hidden\");\n $(\"#cantoViewBody\").find(\"#filterSection\").removeClass(\"hidden\");\n $(\"#cantoViewBody\").find(\"#selectedCountSection\").addClass(\"hidden\");\n $(\"#cantoViewBody\").find(\"#selectedActionSection\").addClass(\"hidden\");\n $(\"#insertAlbumWrapper\").removeClass(\"hidden\");\n }\n //toggle isAllSelectedMode\n $(\"#cantoViewBody\").find(\"#selectAllBtn\").addClass(\"all-selected\");\n $(\"#cantoViewBody\").find(\"#selectAllBtn\").attr(\"title\", \"Deselect All\");\n};\nlet resetImageURL = function (id, url) {\n let imgDom = $(\"#cantoViewBody\").find(\"#\" + id);\n let data = \"data:image\" + url;\n imgDom.attr(\"src\", data);\n};\n\nfunction displayFullyImage(src) {\n let $viewImageModal = $(\"#cantoViewBody\").find(\"#viewImageModal\");\n let $pageMask = $(\"#cantoViewBody\").find(\"#pageMask\");\n $viewImageModal.find(\"img\").attr(\"src\", src);\n $(\"#cantoViewBody\").find(\".loading-icon\").addClass(\"hidden\");\n $viewImageModal.removeClass(\"hidden\");\n $pageMask.removeClass(\"hidden\");\n $(\"#cantoViewBody\").find('.view-image-modal .close-btn').off('click').on('click', function () {\n $viewImageModal.addClass(\"hidden\");\n $pageMask.addClass(\"hidden\");\n });\n}\n\n\nfunction imageDetail(detailData) {\n if (detailData) {\n $(\"#cantoViewBody\").find(\"#imageDetailModal_name\").html(detailData.name);\n $(\"#cantoViewBody\").find(\"#imageDetailModal_size\").html(detailData.size + \"KB\");\n $(\"#cantoViewBody\").find(\"#imageDetailModal_created\").html(dateHandler(detailData.created));\n $(\"#cantoViewBody\").find(\"#imageDetailModal_uploaded\").html(dateHandler(detailData.lastUploaded));\n $(\"#cantoViewBody\").find(\"#imageDetailModal_status\").html(detailData.approvalStatus);\n $(\"#cantoViewBody\").find(\"#insertIntoPostBtn\").data(\"downloadurl\", detailData.url.download);\n\n let $imageDetailModal = $(\"#cantoViewBody\").find(\"#imageDetailModal\");\n $(\"#cantoViewBody\").find(\".loading-icon\").addClass(\"hidden\");\n $imageDetailModal.removeClass(\"hidden\");\n $(\"#cantoViewBody\").find('#imageDetailModal .close-btn').off('click').on('click', function () {\n $imageDetailModal.addClass(\"hidden\");\n });\n }\n}\n\nfunction imageNewDetail(detailData) {\n let sliceString = function (string, dom, length) {\n if (!string) {\n $(dom).closest(\".detail-item\").addClass(\"hidden\");\n return \"Null\";\n } else {\n $(dom).closest(\".detail-item\").removeClass(\"hidden\");\n }\n if (!length) {\n length = 150;\n }\n if (string.length > length) {\n $(dom).removeClass(\"hidden\");\n return string.slice(0, length) + \"...\";\n } else {\n $(dom).addClass(\"hidden\");\n return string;\n }\n };\n if (detailData) {\n $(\"#cantoViewBody\").find(\"#imagebox_name\").html(detailData.name);\n $(\"#cantoViewBody\").find(\"#imagebox_size\").html(Math.round(detailData.size / 1024) + \"KB\");\n $(\"#cantoViewBody\").find(\"#imagebox_created\").html(detailData.metadata ? (detailData.metadata[\"Create Date\"] ? detailData.metadata[\"Create Date\"] : \" \") : \" \");\n $(\"#cantoViewBody\").find(\"#imagebox_uploaded\").html(dateHandler(detailData.lastUploaded));\n $(\"#cantoViewBody\").find(\"#imagebox_status\").html(detailData.approvalStatus);\n let copyrightMoreDom = $(\"#imagebox_copyright\").closest(\".detail-item\").find(\".more\");\n $(\"#cantoViewBody\").find(\"#imagebox_copyright\").html(sliceString(detailData.copyright, copyrightMoreDom, 177));\n $(\"#cantoViewBody\").find(\"#imagebox_copyright\").data(\"field\", detailData.copyright);\n let tactMoreDom = $(\"#imagebox_tac\").closest(\".detail-item\").find(\".more\");\n $(\"#cantoViewBody\").find(\"#imagebox_tac\").html(sliceString(detailData.termsAndConditions, tactMoreDom, 160));\n $(\"#cantoViewBody\").find(\"#imagebox_tac\").data(\"field\", detailData.termsAndConditions);\n $(\"#cantoViewBody\").find(\"#insertBtn\").data(\"id\", detailData.id);\n $(\"#cantoViewBody\").find(\"#insertBtn\").data(\"scheme\", detailData.scheme);\n }\n\n let $imageDetailModal = $(\"#cantoViewBody\").find(\"#imagePreviewModal\");\n $(\"#cantoViewBody\").find(\".loading-icon\").addClass(\"hidden\");\n $imageDetailModal.removeClass(\"hidden\");\n $(\"#cantoViewBody\").find('#imagePreviewModal .close-btn').off('click').on('click', function () {\n $imageDetailModal.addClass(\"hidden\");\n });\n $(\"#cantoViewBody\").find('#imagePreviewModal #cancelBtn').off('click').on('click', function () {\n $imageDetailModal.addClass(\"hidden\");\n });\n $(\"#cantoViewBody\").find('#imagePreviewModal .detail-item .more').off('click').on('click', function () {\n let text = $(this).closest(\".detail-item\").find(\".content\").data(\"field\");\n $(this).closest(\".detail-item\").find(\".content\").html(text);\n $(this).addClass(\"hidden\");\n });\n $(\"#cantoViewBody\").find('#imagePreviewModal #insertBtn').off('click').on('click', function () {\n $(\"#cantoViewBody\").find(\".loading-icon\").removeClass(\"hidden\");\n let assetArray = [\n {\n id: detailData.id,\n scheme: detailData.scheme,\n }\n ];\n cantoAPI.insertImage(assetArray);\n });\n}\n\nfunction dateHandler(str) {\n return str.substr(0, 4) + '-' + str.substr(4, 2) + '-'\n + str.substr(6, 2) + ' ' + str.substr(8, 2) + ':' + str.substr(10, 2);\n}\n\nfunction treeviewDataHandler() {\n cantoAPI.loadTree(treeviewController);\n}\n\nlet treeviewController = function (dummyData) {\n let html = \"\";\n html = treeviewFirstRender(dummyData);\n $(\"#cantoViewBody\").find(\"#treeviewContent\").append(html);\n $(\"#cantoViewBody\").find(\"#treeviewContent > ul\").animate({\n height: 'toggle'\n });\n\n};\nlet treeviewFirstRender = function (data) {\n let html = \"
    \";\n $.each(data, function (i, d) {\n let listclass = \" \";\n if (d.size == 0) {\n listclass = \"no-child\";\n } else if (d.scheme == \"folder\") {\n listclass = \"has-sub-folder\";\n }\n html += `
  • `;\n let iconStyle = \"icon-s-Folder_open-20px\";\n if (d.scheme == \"album\") {\n iconStyle = \"icon-s-Album-20px\";\n }\n html += `\n \"Loading\"\n ${d.name}\n
  • `;\n });\n html += \"
\";\n return html;\n};\nlet subTreeRender = function (data) {\n let html = treeviewRender(data);\n $(\"#cantoViewBody\").find(\".current-tree-node\").append(html);\n $(\"#cantoViewBody\").find(\".current-tree-node > ul\").animate({\n height: 'toggle'\n });\n $(\"#cantoViewBody\").find(\".current-tree-node\").find(\".folder-loading\").addClass(\"hidden\");\n $(\"#cantoViewBody\").find(\".current-tree-node\").find(\".icon-s-Folder_open-20px\").removeClass(\"hidden\");\n $(\"#cantoViewBody\").find(\".current-tree-node\").removeClass(\"current-tree-node\");\n};\nlet treeviewRender = function (data) {\n let html = \"
    \";\n $.each(data, function (i, d) {\n let listclass = \" \";\n if (d.size == 0) {\n listclass = \"no-child\";\n }\n html += `
  • `;\n let iconStyle = \"icon-s-Folder_open-20px\";\n if (d.scheme == \"album\") {\n iconStyle = \"icon-s-Album-20px\";\n }\n html += `\n ${d.name}`;\n if (d.children && d.children.length) {\n html += treeviewRender(d.children);\n }\n html += '
  • ';\n });\n html += \"
\";\n return html;\n};\n\nfunction imageResize() {\n let initCount = 8;\n // let totalWidth = totalWidth = Number($(\"#cantoViewBody\").find(\"#imagesContent\")[0].offsetWidth);\n let totalWidth = Number($(\"#cantoViewBody\").find(\"#imagesContent\")[0].offsetWidth);\n let singleImageWidth = 0;\n let getCountInALine = function (n) {\n singleImageWidth = Number((totalWidth - 8) / n - 2);\n if ((singleImageWidth >= 160) && (singleImageWidth <= 210)) {\n return singleImageWidth;\n } else if (singleImageWidth < 160) {\n n--;\n getCountInALine(n);\n } else if (singleImageWidth > 210) {\n n++;\n getCountInALine(n);\n }\n };\n let singleWidth = getCountInALine(initCount);\n $(\"#cantoViewBody\").find('.single-image').css(\"width\", singleWidth);\n}\n\n//scroll to load more\n\nfunction isScrollToPageBottom() {\n let bodyHeight = $(\"#cantoImageBody\").height();\n let documentHeight = $(\"#imagesContent\").height();\n let scrollHeight = $(\"#cantoImageBody\").scrollTop();\n let isToBottom = documentHeight - bodyHeight - scrollHeight < 0;\n let nowCount = $(\".single-image\").length == 0;\n return isToBottom && !nowCount;\n}\n\nfunction loadMoreHandler(limit) {\n let start = currentImageList.length == 0 ? 0 : apiNextStart;\n let filterString = \"sortBy=time&sortDirection=descending&limit=\" + limit + \"&start=\" + start;\n let imageCount = $(\".single-image\").length;\n if (imageCount !== 0) {\n $(\"#loadingMore\").fadeIn(\"slow\");\n } else {\n $(\"#cantoViewBody\").find(\"#imagesContent\").html(\"\");\n }\n return filterString;\n}\n\nfunction loadMoreAction() {\n if (searchedBy == \"bySearch\") {\n let value = $(\"#cantoViewBody\").find(\"#globalSearch input\").val();\n if (!value) {\n return;\n }\n let initSchme = $(\"#cantoViewBody\").find(\".type-font.current\").data(\"type\");\n let data = {};\n data.scheme = initSchme;\n data.keywords = value;\n cantoAPI.getFilterList(data, imageListDisplay);\n } else if (searchedBy == \"bytree\") {\n let albumId = $(\"#cantoViewBody\").find(\"#treeviewSection ul li\").find(\".selected\").data(\"id\");\n cantoAPI.getListByAlbum(albumId, imageListDisplay);\n } else {\n let initSchme = $(\"#cantoViewBody\").find(\".type-font.current\").data(\"type\");\n getImageInit(initSchme);\n }\n}\n\nfunction uploadFileToCanto(e) {\n let url = `https://${_tenants}/api/v1/upload/setting`;\n fetch(url, {\n method: \"GET\",\n headers: {\n \"Authorization\": `${_tokenType} ${_accessToken}`,\n \"Content-Type\": \"application/json; charset=utf-8\"\n },\n }).then(response => {\n return response.json();\n }).then(data => {\n const formData = new FormData();\n formData.append(\"key\", data.key);\n formData.append(\"acl\", data.acl);\n formData.append(\"AWSAccessKeyId\", data.AWSAccessKeyId);\n formData.append(\"Policy\", data.Policy);\n formData.append(\"Signature\", data.Signature);\n formData.append(\"x-amz-meta-file_name\", e.currentTarget.files[0].name);\n formData.append(\"x-amz-meta-tag\", \"\");\n formData.append(\"x-amz-meta-scheme\", \"\");\n formData.append(\"x-amz-meta-id\", \"\");\n formData.append(\"x-amz-meta-album_id\", \"\");\n formData.append(\"file\", e.currentTarget.files[0]);\n let statusBar = parent.document.querySelector(\".modal-status-bar\");\n\n fetch(data.url, {\n method: \"post\",\n body: formData,\n mode: \"no-cors\",\n redirect: 'follow'\n }).then(response => {\n document.getElementById(\"uploadBtn\").style.background = \"linear-gradient(16deg, rgb(205 101 1) 0%, rgb(169 218 0 / 100%) 100%)\";\n document.getElementById(\"uploadBtn\").value = \"Uploading image...\";\n }).catch(error => {\n console.log(error);\n }).finally(() => {\n document.getElementById(\"uploadBtn\").value = \"Upload complete - processing\";\n checkStatusInterval(e.currentTarget.files[0].name);\n });\n }).catch(error => {\n console.log(\"An error occurred while attempting to grab upload settings!\");\n console.log(error);\n });\n\n function checkStatusInterval(filename) {\n let url = `https://${_tenants}/api/v1/upload/status?hours=1`;\n let statusBar = parent.document.querySelector(\".modal-status-bar\");\n setInterval(() => {\n\n fetch(url, {\n method: \"get\",\n headers: {\"Authorization\": _tokenType + \" \" + _accessToken},\n }).then(response => {\n return response.json();\n }).then(body => {\n if (body.results && body.results.length > 0) {\n let results = body.results.filter(e => {\n if (e.name == filename && e.status != \"Done\") {\n return e;\n }\n });\n if (results.filter(e => e != undefined).length == 0) {\n document.getElementById(\"uploadBtn\").value = \"Canto processing complete! Reloading\";\n window.location.reload();\n }\n }\n }).catch(error => {\n console.log(\"an error occurred!\");\n console.log(error)\n });\n }, 5000);\n }\n\n}\n\nparent.document.querySelector(\".modal-status-bar\").style.display = \"none\";\n\n// Accept HMR as per: https://vitejs.dev/guide/api-hmr.html\nif (import.meta.hot) {\n import.meta.hot.accept(() => {\n console.log(\"HMR\")\n });\n}\n\n"],"names":["_accessToken","_tokenType","_tenants","cantoAPI","_APIHeaders","searchedBy","currentImageList","singleCountLoad","apiNextStart","isLoadingComplete","_formatDistrict","MAX_CONTENT_REQUEST_ITEMS","MAX_ALBUM_REQUEST_ITEMS","setToken","tokenInfo","callback","url","request","data","treeID","albumID","filterString","loadMoreHandler","previewURL","ID","scheme","contentID","targetWindow","buffer","albumId","start","result","response","imageArray","imageArraySubset","id","album","albumName","error","getFrameDom","addEventListener","getTokenInfo","event","treeviewDataHandler","initSchme","getImageInit","contentIframe","e","uploadFileToCanto","imageResize","imageListDisplay","handleSelectedMode","assetArray","selectedArray","i","obj","displayFullyImage","targetURL","targetID","imageNewDetail","childList","subTreeId","subTreeRender","value","isScrollToPageBottom","loadMoreAction","inputObj","imageListSection","imageList","formatArr","extension","html","disname","rem","nameTop","iMin","iMax","bodyHeight","selectedCount","src","$viewImageModal","$pageMask","detailData","sliceString","string","dom","length","dateHandler","copyrightMoreDom","tactMoreDom","$imageDetailModal","text","str","treeviewController","dummyData","treeviewFirstRender","d","listclass","iconStyle","treeviewRender","initCount","totalWidth","singleImageWidth","getCountInALine","n","singleWidth","documentHeight","scrollHeight","isToBottom","nowCount","limit","formData","checkStatusInterval","filename","body"],"mappings":"AACA,IAAIA,EAAe,GAEfC,EAAa,GACbC,EAAW,GACXC,EAAW,CAAA,EACXC,EAAc,CAAA,EACdC,EAAa,GACbC,EAAmB,CAAA,EACnBC,EAAkB,GAClBC,EAAe,EACfC,EAAoB,GACpBC,EAAkB,GACtB,MAAMC,EAA4B,IAC5BC,EAA0B,IAIhC,SAASC,EAASC,EAAW,CAC3Bd,EAAec,EAAU,YACzBZ,EAAWY,EAAU,OACrBb,EAAaa,EAAU,UAAYA,EAAU,UAAY,SACzDV,EAAc,CACZ,cAAiBH,EAAa,IAAMD,EACpC,eAAgB,mCACpB,EACEU,EAAkBI,EAAU,cAC9B,CAGAX,EAAS,SAAW,SAAUY,EAAU,CACtC,IAAIC,EAAM,WAAad,EAAW,2DAClC,EAAE,KAAK,CACL,QAASE,EACT,KAAM,MACN,IAAKY,EACL,MAAO,GACP,MAAO,SAAUC,EAAS,CACxB,MAAM,iBAAiB,CACxB,EACD,QAAS,SAAUC,EAAM,CACvBH,EAASG,EAAK,OAAO,CACtB,CACL,CAAG,CACH,EACAf,EAAS,YAAc,SAAUgB,EAAQJ,EAAU,CACjD,IAAIC,EAAM,WAAWd,iBAAwBiB,IAC7C,EAAE,KAAK,CACL,QAASf,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O,SAAS,SAG5B,CAAO,EAAE,MAAMT,GAAS,CAChB,QAAQ,IAAI,oBAAoB,EAChC,QAAQ,IAAIA,CAAK,CACzB,CAAO,CACF,EAAE,GAAI,CACR,CAEH,CAEA,OAAO,SAAS,cAAc,mBAAmB,EAAE,MAAM,QAAU"} \ No newline at end of file diff --git a/src/web/assets/dist/assets/canto-embed-f0b95696.js.map.gz b/src/web/assets/dist/assets/canto-embed-f0b95696.js.map.gz new file mode 100644 index 0000000..1701ead Binary files /dev/null and b/src/web/assets/dist/assets/canto-embed-f0b95696.js.map.gz differ diff --git a/src/web/assets/dist/assets/canto-field-ce0b6f6c.js b/src/web/assets/dist/assets/canto-field-ce0b6f6c.js new file mode 100644 index 0000000..d1f756d --- /dev/null +++ b/src/web/assets/dist/assets/canto-field-ce0b6f6c.js @@ -0,0 +1,17 @@ +(function(t){let d={},f,g,p,C,v;const r="CantoDamConnector",b={env:"canto.com"};function y(a,n){this.element=a,this.options=t.extend({},b,n),this._defaults=b,this._name=r,this.init()}y.prototype={init:function(){t(()=>{I(this.options);const a=o=>"#"+this.options.prefix+"-"+Craft.namespaceId(o,this.options.id),n=a("damAssetPreview");function m(){const o=a("damAssetPreviewWrapper");if(t(o).remove(),t(n).attr("data-thumbnailurl")==null||t(n).attr("data-thumbnailurl")=="none")t(n).hide();else{const e=t(n).attr("data-thumbnailurl"),l=t(n).attr("data-albumName");let i=t(n).attr("data-thumbnailName");const c=t(n).attr("data-assetCount"),u=c==1?"":"canto-asset-preview-stack";i=c==1?i:`${c} images`,l.length&&(i+=" / "+l),t(a("chooseAsset")).html("Choose a Different DAM Asset"),t(n).prepend(` +
+ +${i}
+
+`)}}function h(o){t.ajax({type:"POST",url:"https://oauth.canto.com/oauth/api/oauth2/universal2/token",dataType:"json",data:{app_id:g,grant_type:"authorization_code",redirect_uri:"http://localhost:8080",code:o,code_verifier:"1649285048042"},success:function(e){d=e,k(d)},error:function(){alert("Get token errorz")}})}t(a("chooseAsset")).click(o=>{A.show();let e=o.target.dataset.field,l=o.target.dataset.element,i=o.target.dataset.type,c=o.target.dataset.access;D(e,l,i,c,this.options.bodyClass)}),t(a("removeDamAsset")).click(o=>{t(a("chooseAsset")).html("Add a DAM Asset"),t(n).hide(),t(a("cantoId")).val(null),t(a("cantoAlbumId")).val(null),t(a("cantoAssetData")).val([]),t(a("cantoAlbumData")).val([])}),window.addEventListener("message",o=>{const e=o.data;if(t(s).attr("data-field")==this.options.fieldId)if(e&&e.type=="getTokenInfo"){var l=document.getElementById(s.slice(1)).contentWindow;d.formatDistrict=v,d.tenant=p,l.postMessage(d,"*")}else if(e&&e.type=="cantoLogout")d={},t(".canto-uc-iframe-close-btn").trigger("click");else if(e&&e.type=="cantoInsertImage")t(".canto-uc-iframe-close-btn").trigger("click"),callback(C,e.assetList);else if(e&&e.type=="closeModal"){let i=e.cantoAssetData[0];const c=e.cantoAssetData.length;t(n).attr("data-assetCount",c),t(n).attr("data-thumbnailUrl",i.url.directUrlPreview),t(n).attr("data-thumbnailName",i.name),t(n).attr("data-albumName",e.cantoAlbumData.name),m(),t(a("cantoId")).val(e.cantoId),t(a("cantoAlbumId")).val(e.cantoAlbumId),t(a("cantoAssetData")).val(JSON.stringify(e.cantoAssetData)),t(a("cantoAlbumData")).val(JSON.stringify(e.cantoAlbumData)),t(n).show(),A.hide()}else e&&h(e)})})}},t.fn[r]=function(a){return this.each(function(){t.data(this,"plugin_"+r)||t.data(this,"plugin_"+r,new y(this,a))})};function I(a){f=a.env,g=a.appId,p=a.tenantHostName,v=a.extensions}const s="#cantoDamAssetsUCFrame";let w=t(` + + `),A=new Garnish.Modal(w,{autoShow:!1});function D(a,n,m,h,o){let e={accessToken:h,tenant:p},l="https://oauth.canto.com/oauth/api/oauth2/universal2/authorize?response_type=code&app_id=52ff8ed9d6874d48a3bef9621bc1af26&redirect_uri=http://localhost:8080&state=abcd&code_challenge=1649285048042&code_challenge_method=plain";var i="/admin/_canto-dam-assets/canto-embed.twig";e.accessToken?(t(s).attr("data-element",n),t(s).attr("data-field",a),t(s).attr("data-type",m),t(s).attr("data-access",e.accessToken),t(s).attr("data-tenant",e.tenant),t(s).attr("src",i)):(t(s).attr("data-element",n),t(s).attr("data-field",a),t(s).attr("data-type",m),t(s).attr("src",l));function c(){const u=t(s).contents().find("body");u.removeClass("can-select-single can-select-multiple can-select-album"),u.addClass(o)}t(s).on("load",c),c()}function k(a){t.ajax({type:"GET",url:"https://oauth."+f+":443/oauth/api/oauth2/tenant/"+a.refreshToken,success:function(n){a.tenant=n,t(s).attr("src","/admin/_canto-dam-assets/canto-embed.twig")},error:function(){alert("Get tenant error")}})}})(jQuery);$(document).ready(function(){const t=new CustomEvent("vite-script-loaded",{detail:{path:"src/js/canto-field.js"}});document.dispatchEvent(t)}); +//# sourceMappingURL=canto-field-ce0b6f6c.js.map diff --git a/src/web/assets/dist/assets/canto-field-ce0b6f6c.js.gz b/src/web/assets/dist/assets/canto-field-ce0b6f6c.js.gz new file mode 100644 index 0000000..651fa78 Binary files /dev/null and b/src/web/assets/dist/assets/canto-field-ce0b6f6c.js.gz differ diff --git a/src/web/assets/dist/assets/canto-field-ce0b6f6c.js.map b/src/web/assets/dist/assets/canto-field-ce0b6f6c.js.map new file mode 100644 index 0000000..f7b49e9 --- /dev/null +++ b/src/web/assets/dist/assets/canto-field-ce0b6f6c.js.map @@ -0,0 +1 @@ +{"version":3,"file":"canto-field-ce0b6f6c.js","sources":["../../../../../buildchain/src/js/canto-field.js"],"sourcesContent":["/**\n * =====================================================================================================================\n * Refactored plugin code\n * =====================================================================================================================\n **/\n\n(function ($) {\n let tokenInfo = {},\n env,\n appId,\n tenantHostName,\n currentCantoTagID,\n formatDistrict;\n\n const pluginName = \"CantoDamConnector\",\n defaults = {\n env: \"canto.com\",\n };\n\n // Plugin constructor\n function Plugin(element, options) {\n this.element = element;\n\n this.options = $.extend({}, defaults, options);\n\n this._defaults = defaults;\n this._name = pluginName;\n\n this.init();\n }\n\n Plugin.prototype = {\n\n init: function () {\n\n $(() => {\n // this.options gives us access to the $jsonVars that our FieldType passed down to us\n settings(this.options);\n\n // Macro for getting a namespaced field selector\n const fieldNamespaceIdSelector = (fieldName) => '#' + this.options.prefix + '-' + Craft.namespaceId(fieldName, this.options.id);\n\n // Display the image preview on init\n const damAssetPreview = fieldNamespaceIdSelector('damAssetPreview');\n\n function uploadClick() {\n console.log(\"canto-field.js:Plugin.prototype.uploadClick()\")\n }\n\n /**\n * Displays the image preview for the chosen Canto asset(s)\n */\n function displayImagePreview() {\n const damAssetPreviewWrapper = fieldNamespaceIdSelector('damAssetPreviewWrapper');\n $(damAssetPreviewWrapper).remove();\n if ($(damAssetPreview).attr(\"data-thumbnailurl\") == null ||\n $(damAssetPreview).attr(\"data-thumbnailurl\") == \"none\") {\n $(damAssetPreview).hide();\n } else {\n const url = $(damAssetPreview).attr(\"data-thumbnailurl\");\n const albumName = $(damAssetPreview).attr(\"data-albumName\");\n let name = $(damAssetPreview).attr(\"data-thumbnailName\");\n const assetCount = $(damAssetPreview).attr(\"data-assetCount\");\n const className = assetCount == 1 ? \"\" : \"canto-asset-preview-stack\";\n name = assetCount == 1 ? name : `${assetCount} images`;\n if (albumName.length) {\n name += ' / ' + albumName;\n }\n $(fieldNamespaceIdSelector('chooseAsset')).html(\"Choose a Different DAM Asset\");\n $(damAssetPreview).prepend(`\n
\n\n${name}
\n
\n`);\n }\n }\n\n function getTokenByVerifycode(verifyCode) {\n $.ajax({\n type: \"POST\",\n url: \"https://oauth.canto.com/oauth/api/oauth2/universal2/token\",\n dataType: \"json\",\n data: {\n \"app_id\": appId,\n \"grant_type\": \"authorization_code\",\n \"redirect_uri\": \"http://localhost:8080\",\n \"code\": verifyCode,\n \"code_verifier\": \"1649285048042\"\n },\n success: function (data) {\n tokenInfo = data;\n getTenant(tokenInfo);\n\n },\n error: function () {\n alert(\"Get token errorz\");\n }\n });\n }\n\n // Handle adding or changing an asset\n $(fieldNamespaceIdSelector('chooseAsset')).click((e) => {\n $modal.show();\n let fieldId = e.target.dataset.field;\n let elementId = e.target.dataset.element;\n let type = e.target.dataset.type;\n let accessToken = e.target.dataset.access;\n loadIframeContent(fieldId, elementId, type, accessToken, this.options.bodyClass);\n });\n\n // Handle clicks to remove the asset\n $(fieldNamespaceIdSelector('removeDamAsset')).click((e) => {\n // Hide the preview, and change the button name\n $(fieldNamespaceIdSelector('chooseAsset')).html(\"Add a DAM Asset\");\n $(damAssetPreview).hide();\n $(fieldNamespaceIdSelector('cantoId')).val(null);\n $(fieldNamespaceIdSelector('cantoAlbumId')).val(null);\n $(fieldNamespaceIdSelector('cantoAssetData')).val([]);\n $(fieldNamespaceIdSelector('cantoAlbumData')).val([]);\n });\n\n // Beginning of Canto's Universal Connector code:\n window.addEventListener(\"message\", (event) => {\n const data = event.data;\n // Onlu listen in if we are the target for this fieldId\n if ($(cantoUCFrame).attr(\"data-field\") != this.options.fieldId) {\n return;\n }\n if (data && data.type == \"getTokenInfo\") {\n var receiver = document.getElementById(cantoUCFrame.slice(1)).contentWindow;\n tokenInfo.formatDistrict = formatDistrict;\n tokenInfo.tenant = tenantHostName;\n receiver.postMessage(tokenInfo, '*');\n } else if (data && data.type == \"cantoLogout\") {\n tokenInfo = {};\n $(\".canto-uc-iframe-close-btn\").trigger(\"click\");\n\n } else if (data && data.type == \"cantoInsertImage\") {\n $(\".canto-uc-iframe-close-btn\").trigger(\"click\");\n callback(currentCantoTagID, data.assetList);\n\n } else if (data && data.type == \"closeModal\") {\n let cantoAsset = data.cantoAssetData[0];\n const assetCount = data.cantoAssetData.length;\n $(damAssetPreview).attr(\"data-assetCount\", assetCount);\n $(damAssetPreview).attr(\"data-thumbnailUrl\", cantoAsset.url.directUrlPreview);\n $(damAssetPreview).attr(\"data-thumbnailName\", cantoAsset.name);\n $(damAssetPreview).attr(\"data-albumName\", data.cantoAlbumData.name);\n displayImagePreview();\n // Save the cantoId & cantoAssetData into the hidden field data\n $(fieldNamespaceIdSelector('cantoId')).val(data.cantoId);\n $(fieldNamespaceIdSelector('cantoAlbumId')).val(data.cantoAlbumId);\n $(fieldNamespaceIdSelector('cantoAssetData')).val(JSON.stringify(data.cantoAssetData));\n $(fieldNamespaceIdSelector('cantoAlbumData')).val(JSON.stringify(data.cantoAlbumData));\n $(damAssetPreview).show();\n $modal.hide();\n\n } else if (data) {\n let verifyCode = data;\n getTokenByVerifycode(verifyCode);\n\n }\n\n });\n });\n }\n\n };\n\n // A really lightweight plugin wrapper around the constructor,\n // preventing against multiple instantiations\n $.fn[pluginName] = function (options) {\n return this.each(function () {\n if (!$.data(this, \"plugin_\" + pluginName)) {\n $.data(this, \"plugin_\" + pluginName,\n new Plugin(this, options));\n }\n });\n };\n\n function settings(options) {\n env = options.env;\n appId = options.appId;\n tenantHostName = options.tenantHostName;\n formatDistrict = options.extensions;\n }\n\n // The modal for the Canto picker\n const cantoUCFrame = '#cantoDamAssetsUCFrame';\n let modalMarkup = $(`\n
\n
\n
\n

Canto Assets

\n
\n \n
Uploading Image...
\n
\n
\n `);\n let $modal = new Garnish.Modal(modalMarkup, {'autoShow': false});\n\n /*--------------------------load iframe content---------------------------------------*/\n function loadIframeContent(fieldId, elementId, type, accessToken, bodyClass) {\n// let timeStamp = new Date().getTime();\n let tokenInfo = {\n accessToken: accessToken,\n tenant: tenantHostName,\n };\n let cantoLoginPage = \"https://oauth.canto.com/oauth/api/oauth2/universal2/authorize?response_type=code&app_id=\" + \"52ff8ed9d6874d48a3bef9621bc1af26\" + \"&redirect_uri=http://localhost:8080&state=abcd\" + \"&code_challenge=\" + \"1649285048042\" + \"&code_challenge_method=plain\";\n\n var cantoContentPage = \"/admin/_canto-dam-assets/canto-embed.twig\";\n if (tokenInfo.accessToken) {\n $(cantoUCFrame).attr(\"data-element\", elementId);\n $(cantoUCFrame).attr(\"data-field\", fieldId);\n $(cantoUCFrame).attr(\"data-type\", type);\n $(cantoUCFrame).attr(\"data-access\", tokenInfo.accessToken);\n $(cantoUCFrame).attr(\"data-tenant\", tokenInfo.tenant);\n $(cantoUCFrame).attr(\"src\", cantoContentPage);\n } else {\n $(cantoUCFrame).attr(\"data-element\", elementId);\n $(cantoUCFrame).attr(\"data-field\", fieldId);\n $(cantoUCFrame).attr(\"data-type\", type);\n $(cantoUCFrame).attr(\"src\", cantoLoginPage);\n }\n\n // Apply the feature classes for the iFrame immediately, and also after the iFrame as loaded\n function applyIFrameClasses() {\n const $iFrameBody = $(cantoUCFrame).contents().find(\"body\");\n $iFrameBody.removeClass('can-select-single can-select-multiple can-select-album');\n $iFrameBody.addClass(bodyClass);\n }\n\n $(cantoUCFrame).on(\"load\", applyIFrameClasses);\n applyIFrameClasses();\n }\n\n function uploadClick() {\n console.log(\"canto-field.js:uploadClick()\")\n }\n\n function getTenant(tokenInfo) {\n $.ajax({\n type: \"GET\",\n url: \"https://oauth.\" + env + \":443/oauth/api/oauth2/tenant/\" + tokenInfo.refreshToken,\n success: function (data) {\n tokenInfo.tenant = data;\n $(cantoUCFrame).attr(\"src\", \"/admin/_canto-dam-assets/canto-embed.twig\");\n },\n error: function () {\n alert(\"Get tenant error\");\n }\n });\n }\n\n})(jQuery, window, document);\n\n// Accept HMR as per: https://vitejs.dev/guide/api-hmr.html\nif (import.meta.hot) {\n import.meta.hot.accept(() => {\n console.log(\"HMR\")\n });\n}\n\n// Re-broadcast the custom `vite-script-loaded` event so that we know that this module has loaded\n// Needed because when