ace-editor

Ace editor - save/send session on server via POST

∥☆過路亽.° 提交于 2019-12-04 07:11:15
I write online webpage editor and I would like save current view/work on server, for restore in future. I also want do multiple tabs. I know, that is editor.getSession() and editor.setSession() . JS: var editor = ace.edit("description"); editor.session.setMode("ace/mode/javascript"); editor.setTheme("ace/theme/tomorrow"); editor.setShowPrintMargin(false); editor.setOptions({ enableBasicAutocompletion: true, enableSnippets: true }); Now I try save session via jQuery $.data() to element: $('#tab1').data('sesi',editor.getSession()); //save session editor.setSession($('#tab2').data('sesi')); /

Ace Editor Plugin for MVC Razor syntax [closed]

久未见 提交于 2019-12-04 06:36:32
Closed . This question needs to be more focused. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it focuses on one problem only by editing this post . Closed 5 years ago . How i can create a plugin for ACE Editor to support Razor syntax. Ace Home Page: http://ace.c9.io Piotr Kula Here is a started implementation of Razor syntax highlighting in ACE. All credits goes to Andrey Shchekin a member of Stack Overflow. Download his branch of the ACE from GIT . In Node.JS command prompt go to the directory and do the following: npm install node

Embedding Ace Editor inside jQuery UI Resizable Component

喜欢而已 提交于 2019-12-03 16:30:21
I'm trying to make an ace editor resizable by embedding it inside a resizable component. I've been trying to use the jQuery UI Resizable component, but I can't get the ace editor to appear inside the resizable component. Code: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Resizable Ace Editor Using jQuery</title> <script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.1.3/ace.js" type="text/javascript" charset="utf-8"></script> <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.10.2.js"></script

How do I use ACE with my ASP.NET MVC application?

感情迁移 提交于 2019-12-03 11:51:08
I want to use the ACE online code editor in my project. How do I use it in ASP.NET MVC? I'd like to save whatever edits are made with that editor in the database. How do I do that? Let's assume you have a strong typed model with a property called Editor with the data in it. Now use a normal <div> to load the data: <div id="editor"><%=Model.Editor %></div> Now you can create an ace editor in place of the div with javascript: <script src="src/ace.js" type="text/javascript" charset="utf-8"></script> <script> window.onload = function() { var editor = ace.edit("editor"); }; </script> Now when you

How do I change the Font Style in ACE editor?

早过忘川 提交于 2019-12-03 11:09:18
问题 I am using ACE editor on my page, <script src="ace-builds-master/src-noconflict/ace.js" type="text/javascript" charset="utf-8"> </script> <script> var editor = ace.edit("editor"); editor.setTheme("ace/theme/cobalt"); editor.getSession().setMode("ace/mode/geco"); </script> By default it is showing a font, I want to change my font to 'Tahoma 10pt'. How do I do that? 回答1: To change font you can either add a css rule for #editor . or use editor.setOptions({ fontFamily: "tahoma", fontSize: "10pt"

Is there a way to hide the vertical ruler in Ace Editor?

谁说胖子不能爱 提交于 2019-12-03 04:13:59
Is there a way to hide the vertical ruler in Ace? By vertical ruler I mean the vertical line in the editor at 80 chars which helps to keep lines under a certain length. I'd like to give my users the options to enable/disable it If possible Found it, you need to use this: editor.setShowPrintMargin(false); https://ace.c9.io/api/editor.html#Editor.setShowPrintMargin 来源: https://stackoverflow.com/questions/14907184/is-there-a-way-to-hide-the-vertical-ruler-in-ace-editor

How do I change the Font Style in ACE editor?

旧时模样 提交于 2019-12-03 01:33:15
I am using ACE editor on my page, <script src="ace-builds-master/src-noconflict/ace.js" type="text/javascript" charset="utf-8"> </script> <script> var editor = ace.edit("editor"); editor.setTheme("ace/theme/cobalt"); editor.getSession().setMode("ace/mode/geco"); </script> By default it is showing a font, I want to change my font to 'Tahoma 10pt'. How do I do that? To change font you can either add a css rule for #editor . or use editor.setOptions({ fontFamily: "tahoma", fontSize: "10pt" }); But Ace only supports monospace fonts for now, and tahoma isn't monospace, so cursor position will be

How to set focus on the ace editor?

夙愿已清 提交于 2019-12-02 23:25:21
I am using the ace editor component from ajax.org inside a jquery tab interface. Each tab will contain a separate ace editor. Whenever I switch to a new tab, the editor in it won't get the focus. I can detect when a tab is selected by binding to the "tabsshow" event of jquery UI. Does any one know how to set focus to the editor in it if say the id of my editor div is editor-tab-0 for the first tab, and so on...? Please can some one help? editor.focus(); //To focus the ace editor var n = editor.getSession().getValue().split("\n").length; // To count total no. of lines editor.gotoLine(n); //Go

How to save or edit javascript files in ace editor

冷暖自知 提交于 2019-12-02 23:13:26
问题 I want to use the Ace editor to save and edit javascript files it's not clear in the documentation how to do that. 回答1: Ace editor is only the UI part of the editor. Think of it as: like a textarea but cool! . To deal with files you need some kind of server that will read and save the files and will send the text to the webpage where Ace lives. (You can also use html5 filesystem api, but that only works on chrome). You can find many interesting implementations of this in Zed source code at

How to save or edit javascript files in ace editor

て烟熏妆下的殇ゞ 提交于 2019-12-02 14:11:15
I want to use the Ace editor to save and edit javascript files it's not clear in the documentation how to do that. Ace editor is only the UI part of the editor. Think of it as: like a textarea but cool! . To deal with files you need some kind of server that will read and save the files and will send the text to the webpage where Ace lives. (You can also use html5 filesystem api, but that only works on chrome). You can find many interesting implementations of this in Zed source code at https://github.com/zedapp/zed/tree/master/app/js/fs , which is a code editor based on Ace. Lets say you have a