Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I would like to make a codemirror textarea as a datatype. I can easily create a textarea on the frontend and convert it into a code area using Umbraco's native files:
<link href="~/umbraco_client/CodeMirror/Js/Lib/codemirror.css" rel="stylesheet" /> <script src="~/umbraco_client/CodeMirror/Js/Lib/codemirror.js"></script> <script src="~/umbraco_client/CodeMirror/Js/Mode/Xml/xml.js"></script> <script src="~/umbraco_client/CodeMirror/Js/Mode/Javascript/javascript.js"></script> <script src="~/umbraco_client/CodeMirror/Js/Mode/Css/css.js"></script> <script src="~/umbraco_client/CodeMirror/Js/Mode/Htmlmixed/htmlmixed.js"></script> <script> var editor = CodeMirror.fromTextArea(document.getElementById("demotext"), { lineNumbers: true, mode: "text/html", matchBrackets: true }); </script>
When I try to pack it up as a datatype I only get the raw Textarea
.controller
angular.module("umbraco").controller("CodeMirrorEditorController", function ($scope) { var editor = CodeMirror.fromTextArea(document.getElementById("codeTextBox"), { lineNumbers: true, mode: "text/html", matchBrackets: true });});
.html
<div ng-controller="CodeMirrorEditorController" class="guiInputStandardSize"> <textarea id="codeTextBox" class="umb-editor umb-textarea textstring ng-scope" rows="30" ng-model="model.value"></textarea></div>
.manifest
{ "propertyEditors": [ { "name": "Codemirror", "alias": "Demo.Codemirror", "editor": { "view": "~/App_Plugins/CodeMirrorEditor/codemirroreditor.html" } } ], "css": [ "~/umbraco_client/CodeMirror/js/lib/codemirror.css" ], "javascript": [ "~/umbraco_client/CodeMirror/Js/Lib/codemirror.js", "~/umbraco_client/CodeMirror/Js/Mode/Xml/xml.js", "~/umbraco_client/CodeMirror/Js/Mode/Javascript/javascript.js", "~/umbraco_client/CodeMirror/Js/Mode/Css/css.js", "~/umbraco_client/CodeMirror/Js/Mode/Htmlmixed/htmlmixed.js", "~/App_Plugins/CodeMirrorEditor/codemirroreditor.controller.js" ]
}
I'm not very familiar with custom datatype creation - can any one spot what I'm doing wrong...? :-|
Did you eventually succeed? Care sharing the result?
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Codemirror textarea as datatype
I would like to make a codemirror textarea as a datatype. I can easily create a textarea on the frontend and convert it into a code area using Umbraco's native files:
When I try to pack it up as a datatype I only get the raw Textarea
.controller
.html
.manifest
}
I'm not very familiar with custom datatype creation - can any one spot what I'm doing wrong...? :-|
Did you eventually succeed? Care sharing the result?
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.