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

[BROOKLYN-166] add codemirror, yaml syntax-highlighting, autocompletion) #865

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
9d0ff3a
[BROOKLYN-166] add codemirror, yaml syntax-highlighting, autocompletion)
azbarcea Aug 23, 2015
c1a40a7
[BROOKLYN-166] fix old-editor redraw; catalog entry yaml editor
azbarcea Sep 18, 2015
f68bbcc
[BROOKLYN-166] add codemirror, yaml syntax-highlighting, autocompletion)
azbarcea Aug 23, 2015
b42ebdb
[BROOKLYN-166] fix old-editor redraw; catalog entry yaml editor
azbarcea Sep 18, 2015
6008c5e
fix identation; remove unused code
azbarcea Sep 18, 2015
35dd815
merge branch 'apache/master' into codemirror-yaml
azbarcea Oct 18, 2015
28b8928
fix codemirror licensing
azbarcea Oct 18, 2015
24cf733
fix launch JsGui with catalog data
azbarcea Oct 1, 2015
6a03623
add dependencies for BROOKLYN-166
azbarcea Oct 29, 2015
b2cda8a
refactor add-catalog-entry
azbarcea Oct 29, 2015
c3b345b
add support for testing with DefaultCatalolog; fix rollback rest-serv…
azbarcea Nov 8, 2015
c0e3546
add codemirror as a build dependency
azbarcea Nov 8, 2015
3bfe7ac
add codemirror to app-add-wizard
azbarcea Nov 8, 2015
8c994bb
add codemirror placeholder;add a meaningful placeholder
azbarcea Nov 8, 2015
e6d061d
fix refreshEditor when DefaultCatalog is used
azbarcea Nov 8, 2015
a49b1f9
fix 2x codemirror editor when switching tabs
azbarcea Nov 8, 2015
27a1d11
fix previewStep when generating yaml from catalog (wizard)
azbarcea Nov 8, 2015
c636515
fix missing CodeMirror editor when opeing the wizard twice
azbarcea Nov 8, 2015
c870743
fix missing CodeMirror editor
azbarcea Nov 9, 2015
2790703
merge codemirror2
azbarcea Nov 11, 2015
c4f0c79
remove yamlTab from ModalWizzard
azbarcea Nov 14, 2015
2dfe4d1
add editor tab; copied from apidoc
azbarcea Nov 16, 2015
c900952
add catalog and tab section for editor tab
azbarcea Nov 16, 2015
b90bb46
merge with editor branch
azbarcea Nov 18, 2015
95c4c27
fix identation for brooklyn.css
azbarcea Nov 22, 2015
4e6de63
remove catalog pane from composer
azbarcea Nov 22, 2015
59968ea
add codemirror editor
azbarcea Nov 25, 2015
3839319
add run; onSubmissionComplete
azbarcea Nov 25, 2015
d925dcc
Merge branch 'codemirror3' into codemirror-yaml
azbarcea Nov 25, 2015
5ace388
This closes #865
ahgittin Nov 27, 2015
bce8d79
correct router.js args mismatch re `CodeMirror`
ahgittin Nov 27, 2015
3c9cbcc
fix missplaced license for CodeMirror
azbarcea Nov 27, 2015
1125983
add error div
azbarcea Nov 27, 2015
31091a8
merge ahgittin/ui; fix for the router.js; fix merge conflicts apache/…
azbarcea Nov 27, 2015
b2fbc4b
Merge branch 'apache-master' into codemirror-yaml
azbarcea Jan 15, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions brooklyn-dist/dist/licensing/overrides.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,16 @@
notice: Copyright (c) Twitter, Inc. and other contributors (2013-2014)
license: MIT

# CodeMirror: used by jsGUI to provide edit in place for any textarea
- id: codemirror.js
name: CodeMirror
version: "5.7.0"
files: codemirror*.{js,css}
url: https://codemirror.net/
organization: { name: "CodeMirror", url:"https://codemirror.net" }
notice: Copyright (c) Marijn Haverbeke (2015)
license: MIT

# used for CLI to build catalog
- id: marked.js
version: 0.3.1
Expand Down Expand Up @@ -379,5 +389,3 @@
url: https://github.com/carhartl/jquery-cookie
notice: Copyright (c) 2013 Klaus Hartl
license: MIT


1 change: 1 addition & 0 deletions brooklyn-ui/src/build/optimize-js.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
// Set to "none" to skip minification
optimize: "uglify"
})

8 changes: 8 additions & 0 deletions brooklyn-ui/src/main/license/files/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,14 @@ This project includes the software: marked.js
Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
Copyright (c) Christopher Jeffrey (2011-2014)

This project includes the software: CodeMirror
Available at: https://codemirror.net/
Developed by: CodeMirror (https://codemirror.net)
Inclusive of: codemirror*.{js,css}
Version used: 5.7.0
Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
Copyright (c) Marijn Haverbeke (2015)

---------------------------------------------------

(3) Licenses for bundled software
Expand Down
1 change: 1 addition & 0 deletions brooklyn-ui/src/main/license/source-inclusions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@
- id: js-yaml.js
- id: jquery.form.js
- id: marked.js
- id: codemirror.js
13 changes: 12 additions & 1 deletion brooklyn-ui/src/main/webapp/assets/css/brooklyn.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ BODY {
textarea {
white-space: pre;
word-wrap: normal;
overflow-x: scroll;
}

/* HEADER */
Expand Down Expand Up @@ -269,3 +268,15 @@ textarea {
content: 'Not Available';
*/
}

button.catalog-submit-button.btn {
margin-top: 10px;
}

.CodeMirror .cm-s-default {
height: 560px;
}

.CodeMirror .CodeMirror-placeholder {
color: #999;
}
22 changes: 21 additions & 1 deletion brooklyn-ui/src/main/webapp/assets/js/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ require.config({
"underscore":"libs/underscore",
"backbone":"libs/backbone",
"bootstrap":"libs/bootstrap",

"jquery-form":"libs/jquery.form",
"jquery-datatables":"libs/jquery.dataTables",
"jquery-slideto":"util/jquery.slideto",
"jquery-wiggle":"libs/jquery.wiggle.min",
"jquery-ba-bbq":"libs/jquery.ba-bbq.min",

"moment":"libs/moment",
"handlebars":"libs/handlebars-1.0.rc.1",
"brooklyn":"util/brooklyn",
Expand All @@ -47,7 +49,17 @@ require.config({
"uri":"libs/URI",
"zeroclipboard":"libs/ZeroClipboard",
"js-yaml":"libs/js-yaml",


"codemirror":"lib/codemirror",

"mode":"mode",
"addon":"addon",

"codemirror-mode-yaml":"mode/yaml/yaml",
"codemirror-addon-show-hint":"addon/hint/show-hint",
"codemirror-addon-anyword-hint":"addon/hint/anyword-hint",
"codemirror-addon-display-placeholder":"addon/display/placeholder",

"tpl":"../tpl"
},

Expand All @@ -70,6 +82,14 @@ require.config({
"jquery-wiggle": { deps: [ "jquery" ] },
"jquery-ba-bbq": { deps: [ "jquery" ] },
"handlebars": { deps: [ "jquery" ] },
"codemirror":{
exports:"CodeMirror"
},
"codemirror-mode-yaml":{ deps: ["codemirror"] },
"codemirror-addon-show-hint":{ deps: ["codemirror"] },
"codemirror-addon-anyword-hint":{ deps: ["codemirror"] },
"codemirror-addon-display-placeholder":{ deps: ["codemirror"] },

"bootstrap": { deps: [ "jquery" ] /* http://stackoverflow.com/questions/9227406/bootstrap-typeerror-undefined-is-not-a-function-has-no-method-tab-when-us */ }
}
});
Expand Down
1 change: 1 addition & 0 deletions brooklyn-ui/src/main/webapp/assets/js/libs/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@
}

Button.prototype.toggle = function () {
// TODO: buttons-radio :div is replaced by :ul
var $parent = this.$element.parent('[data-toggle="buttons-radio"]')

$parent && $parent
Expand Down
17 changes: 15 additions & 2 deletions brooklyn-ui/src/main/webapp/assets/js/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ define([
"brooklyn", "underscore", "jquery", "backbone",
"model/application", "model/app-tree", "model/location",
"model/server-extended-status",
"view/home", "view/application-explorer", "view/catalog", "view/script-groovy",
"view/home", "view/editor", "view/application-explorer", "view/catalog", "view/script-groovy",
"text!tpl/help/page.html","text!tpl/labs/page.html", "text!tpl/home/server-caution.html"
], function (Brooklyn, _, $, Backbone,
Application, AppTree, Location,
serverStatus,
HomeView, ExplorerView, CatalogView, ScriptGroovyView,
HomeView, EditorView, ExplorerView, CatalogView, ScriptGroovyView,
HelpHtml, LabsHtml, ServerCautionHtml) {

var ServerCautionOverlay = Backbone.View.extend({
Expand Down Expand Up @@ -122,6 +122,8 @@ define([
var Router = Backbone.Router.extend({
routes:{
'v1/home/*trail':'homePage',
'v1/editor/*trail':'editorPage',
'v1/editor':'editorPage',
'v1/applications/:app/entities/*trail':'applicationsPage',
'v1/applications/*trail':'applicationsPage',
'v1/applications':'applicationsPage',
Expand All @@ -135,6 +137,7 @@ define([
},

showView: function(selector, view) {
console.log("showView");
// close the previous view - does binding clean-up and avoids memory leaks
if (this.currentView) {
this.currentView.close();
Expand Down Expand Up @@ -177,6 +180,16 @@ define([
}
}, error: render});
},
editorPage: function (trail) {
console.log("editorPage");
var editorView = new EditorView({
collection: this.applications,
appRouter: this
});
this.showView("#application-content", editorView);
$(".nav1").removeClass("active");
$(".nav1_editor").addClass("active");
},
applicationsPage:function (app, trail, tab) {
if (trail === undefined) trail = app
var that = this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ define([
if ($input.attr("type") === "checkbox") {
return $input.is(":checked");
} else {
// TODO: get codemirror.getValue() in case this is a textarea ...
return $input.val();
}
};
Expand Down
Loading