[
https://issues.apache.org/jira/browse/BROOKLYN-166?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14805074#comment-14805074
]
ASF GitHub Bot commented on BROOKLYN-166:
-----------------------------------------
Github user tbouron commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/865#discussion_r39827848
--- Diff: usage/jsgui/src/main/webapp/assets/js/view/catalog.js ---
@@ -134,54 +135,62 @@ define([
initialize: function() {
_.bindAll(this);
},
+ editor: null,
render: function (initialView) {
this.$el.html(this.template());
- if (initialView) {
- if (initialView == "entity") initialView = "yaml";
-
-
this.$("[data-context='"+initialView+"']").addClass("active");
- this.showFormForType(initialView)
- }
return this;
},
clearWithHtml: function(template) {
if (this.contextView) this.contextView.close();
this.context = undefined;
- this.$(".btn").removeClass("active");
this.$("#catalog-add-form").html(template);
},
beforeClose: function () {
if (this.contextView) this.contextView.close();
},
+ setupCodeEditor: function() {
+ if (this.editor === null) {
+ this.editor =
CodeMirror.fromTextArea(document.getElementById("new-blueprint"), {
+ height: "150px",
+ lineNumbers: true,
+ extraKeys: {"Ctrl-Space": "autocomplete"},
+ textWrapping: true,
+ mode: {name: "yaml", globalVars: true}
+ });
+
+ this.editor.setValue("# Please add your blueprint here\n");
+ }
+ },
showContext: function(event) {
+ log("showContext");
--- End diff --
This line has a wrong indentation.
> Use a feature rich yaml editor
> ------------------------------
>
> Key: BROOKLYN-166
> URL: https://issues.apache.org/jira/browse/BROOKLYN-166
> Project: Brooklyn
> Issue Type: Improvement
> Reporter: Hadrian Zbarcea
> Fix For: 0.8.0
>
>
> Brooklyn would benefit from a feature rich editor that would give a user more
> feedback on what is possible when editing a camp blueprint.
> The best candidate is imho codemirror, used by many apps, including swagger.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)