@@ -26,6 +26,7 @@ jQuery.noConflict();
2626 , GTT_DOMAIN_REGEX = / t r a n s l a t e .g o o g l e .c o m /
2727 , OUTLOOK_DOMAIN_REGEX = / m a i l .l i v e .c o m /
2828 , MAILCHIMP_DOMAIN_REGEX = / a d m i n .m a i l c h i m p .c o m /
29+ , ATLASSIAN_DOMAIN_REGEX = / a t l a s s i a n .n e t /
2930
3031 , EVENT_NAME_KEYPRESS = 'keypress.auto-expander'
3132 , EVENT_NAME_KEYUP = 'keyup.auto-expander'
@@ -43,6 +44,7 @@ jQuery.noConflict();
4344 , SELECTOR_OUTLOOK_EDIT = '#ComposeRteEditor_surface' // Outlook web editor
4445 , SELECTOR_EVERNOTE_EDIT = 'gwt-debug-noteEditor' // Evernote web note editor
4546 , SELECTOR_BASECAMP_EDIT = 'iframe.wysihtml5-sandbox' // Basecamp message editor
47+ , SELECTOR_ATLASSIAN_EDIT = 'iframe#wysiwygTextarea_ifr' // Confluence editor
4648 ;
4749
4850 var typingBuffer = [ ] ; // Keep track of what's been typed before timeout
@@ -220,7 +222,9 @@ jQuery.noConflict();
220222 } else if ( MAILCHIMP_DOMAIN_REGEX . test ( domain ) ) {
221223 replaceTextMailchimp ( shortcut , autotext ) ;
222224 } else if ( GTT_DOMAIN_REGEX . test ( domain ) ) {
223- replaceTextTranslate ( shortcut , autotext ) ;
225+ replaceTextGTT ( shortcut , autotext ) ;
226+ } else if ( ATLASSIAN_DOMAIN_REGEX . test ( domain ) ) {
227+ replaceTextAtlassian ( shortcut , autotext ) ;
224228 } else if ( BASECAMP_DOMAIN_REGEX . test ( domain ) ) {
225229 replaceTextBasecamp ( shortcut , autotext ) ;
226230 } else {
@@ -370,8 +374,8 @@ jQuery.noConflict();
370374 replaceTextContentEditable ( shortcut , autotext , node , iframeWindow ) ;
371375 }
372376
373- // Specific handler for Google Translate iframe replacements
374- function replaceTextTranslate ( shortcut , autotext )
377+ // Specific handler for Google Translate iframe text replacements
378+ function replaceTextGTT ( shortcut , autotext )
375379 {
376380 debugLog ( "Domain: Google Translate" ) ;
377381
@@ -385,6 +389,20 @@ jQuery.noConflict();
385389 replaceTextContentEditable ( shortcut , autotext , node , iframeWindow ) ;
386390 }
387391
392+ // Specific handler for Atlassian frame editor text replacements
393+ function replaceTextAtlassian ( shortcut , autotext )
394+ {
395+ debugLog ( "Domain: Atlassian" ) ;
396+
397+ // Get the focused / selected text node
398+ var iframeWindow = document . querySelector ( SELECTOR_ATLASSIAN_EDIT ) . contentWindow ;
399+ var node = findFocusedNode ( iframeWindow ) ;
400+ debugLog ( "node:" , node ) ;
401+
402+ // Pass onto editable iframe text handler
403+ replaceTextContentEditable ( shortcut , autotext , node , iframeWindow ) ;
404+ }
405+
388406 // Reusable handler for editable iframe text replacements
389407 function replaceTextContentEditable ( shortcut , autotext , node , win )
390408 {
@@ -895,6 +913,21 @@ jQuery.noConflict();
895913 } , TIME_EDITOR_CHECK ) ;
896914 }
897915
916+ // Special case for Atlassian
917+ if ( ATLASSIAN_DOMAIN_REGEX . test ( domain ) )
918+ {
919+ debugLog ( "Domain: Atlassian" ) ;
920+
921+ // SUPER annoying, need to continually check for existence of editor iframe
922+ // because the iframe gets recreated each time and starts with cross-origin
923+ var editorCheck = setInterval ( function ( ) {
924+ var $target = $ ( SELECTOR_ATLASSIAN_EDIT ) ;
925+ if ( $target . length ) {
926+ addListenersToIframe ( $target ) ;
927+ }
928+ } , TIME_EDITOR_CHECK ) ;
929+ }
930+
898931 // Special case for Mailchimp
899932 if ( MAILCHIMP_DOMAIN_REGEX . test ( domain ) )
900933 {
0 commit comments