Documentation / Tutorials / Generic

Enabling Spellcheker in Awesome

/ Generic / Enabling Spellcheker in Awesome

Simple put this code in your awesome js app.

To use it enable use Shfit + Z

<script type=spa/axn axn='core.run_script' data-safe_id="[app.safe_id/]">
          $(document).keydown(function(e) {
            if (e.shiftKey) {
              if (e.keyCode == 90) { 
              console.log(document.body.contentEditable);
                  if(document.body.contentEditable=='true'){
                  alert('Spelling Check OFF');
                    document.body.contentEditable = 'false'; 
                    document.designMode='off';
                    e.preventDefault();
                  }else{
                  alert('Spelling Check ON');
                    document.body.contentEditable = 'true'; 
                    document.designMode='on';
                    e.preventDefault();
                  }
              }
            }
          });
   </script>

 

Categories
Most Popular

Leave a Reply

Your email address will not be published. Required fields are marked *