Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors when mode-css.js is used #526

Closed
lautiamkok opened this issue Nov 22, 2011 · 1 comment
Closed

Errors when mode-css.js is used #526

lautiamkok opened this issue Nov 22, 2011 · 1 comment

Comments

@lautiamkok
Copy link

I have been working on the ace for a few days but I still cannot get
it worked with css properly, been trying to look for solutions online
or ace weki/ documentation, etc, but no luck at all.

This is my attempt http://lauthiamkok.net/dump/ace/editor_3.html, to
highlight css with ace, but it has two issues/ bugs,

  1. it does not give the highlight the same as this demo page,
    http://ace.ajax.org/build/kitchen-sink.html, if u select css option
    from the select box.

  2. it has these error message on firefox,

    Could not load worker ace.js (line 1)
    Error: Could not get domain! [Break On This Error] define("ace/mode/css",["require","expo...).call(f.prototype),b.WorkerClient=f})

Any ideas?

The entire code,

   <script src="jquery-1.7.min.js" type="text/javascript" charset="utf-8"></script>
   <script src="src/ace.js" type="text/javascript" charset="utf-8"></script>
   <script src="src/theme-eclipse.js" type="text/javascript"charset="utf-8"></script>
   <script src="src/mode-css.js" type="text/javascript" charset="utf-8"></script>

   <script>
   $(document).ready(function(){

           var editor = ace.edit("ace-editor");
           editor.setTheme("ace/theme/eclipse");

           var CssMode = require("ace/mode/css").Mode;
           editor.getSession().setMode(new CssMode());

           //var textarea = $('.code').hide();
           var textarea = $('.code');

           // Get the value from the editor and place it into the texrarea.
           var text = editor.getSession().getValue();
           textarea.val(text);

           // Update the textarea on change.
           editor.getSession().on('change', function(){

                   // Get the value from the editor and place it into the texrarea.
                   var text = editor.getSession().getValue();
                   textarea.val(text);
                   //alert(text);
           });

           $('#form_data').submit(function(e){
                   //alert($(this).serialize());

                   var object = $(this);
                   var path = object.attr('action');

                   alert(object.serialize());

                   $.post(path, object.serialize(),function(xml){

                   });
                   return false;
           });
   });
   </script>
   <textarea rows="5" cols="10" class="code" name="ace-editor"></textarea>

   <div style="height:450px; border:1px solid #000;">
           <div id="ace-editor"><style>.text-layer {
   font-family: Monaco, "Courier New", monospace;
   font-size: 12px;
   cursor: text;

}</style>

@fjakobs
Copy link
Contributor

fjakobs commented Nov 25, 2011

this is a firefox bug https://bugzilla.mozilla.org/show_bug.cgi?id=683280. It only happens if you run it from localhost and will be fixed in Firefox 9.

@fjakobs fjakobs closed this as completed Nov 25, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants