{style}{literal} textarea.ow_newsfeed_status_input { height: 50px; } textarea.ow_newsfeed_status_input.invitation { height: 20px; } .newsfeed-attachment-preview { width: 95%; } .ow_side_preloader { float: right; padding: 0px 4px 0px 0px; margin-top: 6px; } .ow_side_preloader { display: inline-block; width: 16px; height: 16px; background-repeat: no-repeat; } {/literal}{/style} {script} {literal} function checkRtl( character ) { var RTL = ['ا','ب','پ','ت','س','ج','چ','ح','خ','د','ذ','ر','ز','ژ','س','ش','ص','ض','ط','ظ','ع','غ','ف','ق','ک','گ','ل','م','ن','و','ه','ی']; return RTL.indexOf( character ) > -1; } function checkLtr( character ) { var LTR = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']; return LTR.indexOf( character ) > -1; } function checkInput(){ var isRtl=true; var inputValue = $(this).val(); inputValue = $.trim(inputValue); if(inputValue.length==0){ jQuery( this ).css( 'direction','rtl'); isRtl =true; return; } for ( var indexText = 0; indexText < inputValue.length; indexText++ ) { if( checkRtl(inputValue[indexText]) ) { jQuery( this ).css( 'direction','rtl'); isRtl =true; break; }else if( checkLtr(inputValue[indexText]) ){ isRtl =false; break; } } if(!isRtl){ jQuery( this ).css( 'direction','ltr'); } } $('textarea').change( checkInput ); $('textarea').keydown( checkInput ); $('textarea').keyup( checkInput ); $('input').change( checkInput ); $('input').keydown( checkInput ); $('input').keyup( checkInput ); {/literal} {/script} {form name="newsfeed_update_status"}