2020 */
2121
2222/*jslint forin: true */
23- /*global Node, MessageEvent */
23+ /*global Node, MessageEvent, strings */
2424/*theseus instrument: false */
2525
2626/**
@@ -81,8 +81,6 @@ function RemoteFunctions(config = {}) {
8181
8282 // initialized from config, defaults to true if not set
8383 let imageGallerySelected = config . imageGalleryState !== undefined ? config . imageGalleryState : true ;
84- config . strings = config . strings || { } ;
85-
8684
8785 var req , timeout ;
8886 var animateHighlight = function ( time ) {
@@ -1755,46 +1753,46 @@ function RemoteFunctions(config = {}) {
17551753
17561754 // @abose @devansh
17571755 // hiding it for now as AI is not yet ready
1758- // content += `<span data-action="ai" title="${config. strings.ai}">
1756+ // content += `<span data-action="ai" title="${strings.ai}">
17591757 // ${ICONS.ai}
17601758 // </span>`;
17611759
17621760 // Only include select parent option if element supports it
17631761 if ( showSelectParentOption ) {
1764- content += `<span data-action="select-parent" title="${ config . strings . selectParent } ">
1762+ content += `<span data-action="select-parent" title="${ strings . selectParent } ">
17651763 ${ config . icons . arrowUp }
17661764 </span>` ;
17671765 }
17681766
17691767 // Only include edit text option if element supports it
17701768 if ( showEditTextOption ) {
1771- content += `<span data-action="edit-text" title="${ config . strings . editText } ">
1769+ content += `<span data-action="edit-text" title="${ strings . editText } ">
17721770 ${ config . icons . edit }
17731771 </span>` ;
17741772 }
17751773
17761774 // if its a link element, we show the edit hyperlink icon
17771775 if ( this . element && this . element . tagName . toLowerCase ( ) === 'a' ) {
1778- content += `<span data-action="edit-hyperlink" title="${ config . strings . editHyperlink } ">
1776+ content += `<span data-action="edit-hyperlink" title="${ strings . editHyperlink } ">
17791777 ${ config . icons . link }
17801778 </span>` ;
17811779 }
17821780
17831781 // if its an image element, we show the image gallery icon
17841782 if ( this . element && this . element . tagName . toLowerCase ( ) === 'img' ) {
1785- content += `<span data-action="image-gallery" title="${ config . strings . imageGallery } ">
1783+ content += `<span data-action="image-gallery" title="${ strings . imageGallery } ">
17861784 ${ config . icons . imageGallery }
17871785 </span>` ;
17881786 }
17891787
17901788 // Always include duplicate and delete options
1791- content += `<span data-action="duplicate" title="${ config . strings . duplicate } ">
1789+ content += `<span data-action="duplicate" title="${ strings . duplicate } ">
17921790 ${ config . icons . duplicate }
17931791 </span>
1794- <span data-action="delete" title="${ config . strings . delete } ">
1792+ <span data-action="delete" title="${ strings . delete } ">
17951793 ${ config . icons . trash }
17961794 </span>
1797- <span data-action="more-options" title="${ config . strings . moreOptions } ">
1795+ <span data-action="more-options" title="${ strings . moreOptions } ">
17981796 ${ config . icons . verticalEllipsis }
17991797 </span>
18001798 </div>` ;
@@ -1896,7 +1894,7 @@ function RemoteFunctions(config = {}) {
18961894 ${ config . styles . hyperlinkEditor }
18971895 </style>
18981896 <div class="hyperlink-input-box">
1899- <div class="link-icon" title="${ currentHref . trim ( ) || config . strings . hyperlinkNoHref } ">
1897+ <div class="link-icon" title="${ currentHref . trim ( ) || strings . hyperlinkNoHref } ">
19001898 ${ config . icons . link }
19011899 </div>
19021900 <input type="text" value="${ currentHref . trim ( ) } " placeholder="https://example.com" spellcheck="false" />
@@ -2116,20 +2114,20 @@ function RemoteFunctions(config = {}) {
21162114 <div class="more-options-dropdown">
21172115 <div class="dropdown-item" data-action="cut">
21182116 <span class="item-icon">${ config . icons . cut } </span>
2119- <span class="item-label">${ config . strings . cut } </span>
2117+ <span class="item-label">${ strings . cut } </span>
21202118 </div>
21212119 <div class="dropdown-item" data-action="copy">
21222120 <span class="item-icon">${ config . icons . copy } </span>
2123- <span class="item-label">${ config . strings . copy } </span>
2121+ <span class="item-label">${ strings . copy } </span>
21242122 </div>
21252123 <div class="dropdown-item" data-action="paste">
21262124 <span class="item-icon">${ config . icons . paste } </span>
2127- <span class="item-label">${ config . strings . paste } </span>
2125+ <span class="item-label">${ strings . paste } </span>
21282126 </div>
21292127 <div class="dropdown-separator"></div>
21302128 <div class="dropdown-item" data-action="toggle-ruler-lines">
21312129 <span class="item-icon">${ config . icons . ruler } </span>
2132- <span class="item-label show-ruler-label">${ config . strings . showRulerLines } </span>
2130+ <span class="item-label show-ruler-label">${ strings . showRulerLines } </span>
21332131 <span class="item-checkmark" style="visibility: ${ config . showRulerLines ? 'visible' : 'hidden' } ">${ config . icons . check } </span>
21342132 </div>
21352133 </div>
@@ -2372,7 +2370,7 @@ function RemoteFunctions(config = {}) {
23722370 <div class="phoenix-ai-prompt-input-container">
23732371 <textarea
23742372 class="phoenix-ai-prompt-textarea"
2375- placeholder="${ config . strings . aiPromptPlaceholder } "
2373+ placeholder="${ strings . aiPromptPlaceholder } "
23762374 ></textarea>
23772375 </div>
23782376 <div class="phoenix-ai-bottom-controls">
@@ -2619,31 +2617,31 @@ function RemoteFunctions(config = {}) {
26192617 ${ config . icons . imageGallery }
26202618 </div>
26212619 <div class='phoenix-image-gallery-header-text'>
2622- ${ config . strings . imageGallery }
2620+ ${ strings . imageGallery }
26232621 </div>
26242622 </div>
26252623
26262624 <div class="phoenix-image-gallery-search-container">
26272625 <div class="search-wrapper">
2628- <button class="search-icon" title="${ config . strings . imageGallerySearchButton } ">${ config . icons . search } </button>
2626+ <button class="search-icon" title="${ strings . imageGallerySearchButton } ">${ config . icons . search } </button>
26292627 <input
26302628 type="text"
2631- placeholder="${ config . strings . imageGallerySearchPlaceholder } "
2629+ placeholder="${ strings . imageGallerySearchPlaceholder } "
26322630 />
26332631 </div>
26342632 </div>
26352633
26362634 <div class='phoenix-image-gallery-upload-container'>
2637- <button title="${ config . strings . imageGallerySelectFromComputerTooltip } ">${ config . icons . selectImageFromComputer } ${ config . strings . imageGallerySelectFromComputer } </button>
2635+ <button title="${ strings . imageGallerySelectFromComputerTooltip } ">${ config . icons . selectImageFromComputer } ${ strings . imageGallerySelectFromComputer } </button>
26382636 <input type="file" class="phoenix-file-input" accept="image/*" style="display: none !important;">
26392637 </div>
26402638
26412639 <div class='phoenix-image-gallery-right-buttons'>
2642- <button class='phoenix-image-gallery-download-folder-button' title="${ config . strings . imageGallerySelectDownloadFolder } ">
2640+ <button class='phoenix-image-gallery-download-folder-button' title="${ strings . imageGallerySelectDownloadFolder } ">
26432641 ${ config . icons . folderSettings }
26442642 </button>
26452643
2646- <button class='phoenix-image-gallery-close-button' title="${ config . strings . imageGalleryClose } ">
2644+ <button class='phoenix-image-gallery-close-button' title="${ strings . imageGalleryClose } ">
26472645 ${ config . icons . close }
26482646 </button>
26492647 </div>
@@ -2652,7 +2650,7 @@ function RemoteFunctions(config = {}) {
26522650 <div class="phoenix-image-gallery-nav left">‹</div>
26532651 <div class="phoenix-image-gallery-strip">
26542652 <div class="phoenix-image-gallery-row phoenix-image-gallery-loading">
2655- ${ config . strings . imageGalleryLoadingInitial }
2653+ ${ strings . imageGalleryLoadingInitial }
26562654 </div>
26572655 </div>
26582656 <div class="phoenix-image-gallery-nav right">›</div>
@@ -2725,7 +2723,7 @@ function RemoteFunctions(config = {}) {
27252723 this . _updateSearchInput ( searchQuery ) ;
27262724 this . _updateCache ( searchQuery , data , append ) ;
27272725 } else if ( ! append ) {
2728- this . _showError ( config . strings . imageGalleryNoImages ) ;
2726+ this . _showError ( strings . imageGalleryNoImages ) ;
27292727 }
27302728
27312729 if ( append ) {
@@ -2736,7 +2734,7 @@ function RemoteFunctions(config = {}) {
27362734 . catch ( error => {
27372735 console . error ( 'Failed to fetch images:' , error ) ;
27382736 if ( ! append ) {
2739- this . _showError ( config . strings . imageGalleryLoadError ) ;
2737+ this . _showError ( strings . imageGalleryLoadError ) ;
27402738 } else {
27412739 this . _isLoadingMore = false ;
27422740 this . _hideLoadingMore ( ) ;
@@ -2905,7 +2903,7 @@ function RemoteFunctions(config = {}) {
29052903 const rowElement = this . _shadow . querySelector ( '.phoenix-image-gallery-row' ) ;
29062904 if ( ! rowElement ) { return ; }
29072905
2908- rowElement . innerHTML = config . strings . imageGalleryLoadingInitial ;
2906+ rowElement . innerHTML = strings . imageGalleryLoadingInitial ;
29092907 rowElement . className = 'phoenix-image-gallery-row phoenix-image-gallery-loading' ;
29102908
29112909 this . _handleNavButtonsDisplay ( 'hidden' ) ;
@@ -2918,7 +2916,7 @@ function RemoteFunctions(config = {}) {
29182916 // when loading more images we need to show the message at the end of the image ribbon
29192917 const loadingIndicator = window . document . createElement ( 'div' ) ;
29202918 loadingIndicator . className = 'phoenix-loading-more' ;
2921- loadingIndicator . textContent = config . strings . imageGalleryLoadingMore ;
2919+ loadingIndicator . textContent = strings . imageGalleryLoadingMore ;
29222920 rowElement . appendChild ( loadingIndicator ) ;
29232921 } ,
29242922
@@ -3113,7 +3111,7 @@ function RemoteFunctions(config = {}) {
31133111 // download icon
31143112 const downloadIcon = window . document . createElement ( 'div' ) ;
31153113 downloadIcon . className = 'phoenix-download-icon' ;
3116- downloadIcon . title = config . strings . imageGalleryUseImage ;
3114+ downloadIcon . title = strings . imageGalleryUseImage ;
31173115 downloadIcon . innerHTML = config . icons . downloadImage ;
31183116
31193117 // when the image is clicked we download the image
@@ -3871,7 +3869,7 @@ function RemoteFunctions(config = {}) {
38713869
38723870 const content = `
38733871 <div class="phoenix-dialog-overlay">
3874- <div class="phoenix-dialog-message-bar">${ config . strings . imageGalleryDialogOverlayMessage } </div>
3872+ <div class="phoenix-dialog-message-bar">${ strings . imageGalleryDialogOverlayMessage } </div>
38753873 </div>
38763874 ` ;
38773875
@@ -4898,8 +4896,8 @@ function RemoteFunctions(config = {}) {
48984896 let _toastTimeout = null ;
48994897
49004898 const TOAST_TYPE_MAPPING = {
4901- notEditable : config . strings . toastNotEditable ,
4902- copyFirstTime : config . strings . toastCopyFirstTime
4899+ notEditable : strings . toastNotEditable ,
4900+ copyFirstTime : strings . toastCopyFirstTime
49034901 } ;
49044902
49054903 /**
0 commit comments