Can anyone please tell em how to embed c c++ mode of ACE on web page.
I am using .net c# for it. Following is code I have written:
<%@ Page Language="C#" AutoEventWireup="true"
CodeBehind="edit.aspx.cs" Inherits="code.edit" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div id="editor" style="height: 500px; width: 500px">some text</
div>
<script src="src/ace.js" type="text/javascript" charset="utf-8"></
script>
<script src="src/theme-twilight.js" type="text/javascript"
charset="utf-8"></script>
<script src="src/mode-c_cpp.js" type="text/javascript"
charset="utf-8"></script>
<script>
window.onload = function () {
var editor = ace.edit("editor");
editor.setTheme("ace/theme/twilight");
editor.getSession().setTabSize(4);
var ccppMode = require("ace/mode/c_cpp").Mode;
editor.getSession().setMode(new ccppMode());
editor.getSession().setUseSoftTabs(true);
editor.getSession().
editor.setShowPrintMargin(false);
editor.setHighlightActiveLine(false);
editor.setReadOnly(false);
};
editor.getSession().setValue("the new text here");
editor.getSession().getValue();
editor.getSession().doc.getTextRange(editor.getSelectionRange());
editor.getSession().on('change', callback);
editor.getSession().selection.on('changeSelection', callback);
editor.getSession().selection.on('changeCursor', callback);
</script>
</form>
</body>
</html>
</html>