Skip to content

Commit

Permalink
Add code formatting and update license headers
Browse files Browse the repository at this point in the history
  • Loading branch information
ramindu90 committed Jan 12, 2021
1 parent 0a1af0d commit d807fbc
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 35 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,7 +14,7 @@
* limitations under the License.
*/

define("ace/mode/asyncapi", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/mode/asyncapi_highlight_rules", "ace/range", "ace/mode/folding/asyncapi"],
define("ace/mode/asyncapi", ["require", "exports", "module"],
function (require, exports, module) {

"use strict"; // JS strict mode
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,29 +14,22 @@
* limitations under the License.
*/

define("ace/mode/asyncapi_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules"], function (require, exports, module) {

define("ace/mode/asyncapi_highlight_rules", ["require", "exports", "module", "ace/lib/oop",
"ace/mode/text_highlight_rules"], function (require, exports, module) {
"use strict"; // JS strict mode

var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;

var AsyncAPIHighlightRules = function () {
var keywords = "WEBSOCKET|SSE|WEBHOOK";

var builtInConstants = "TRUE|FALSE|NULL";

var builtInBooleanConstants = "TRUE|FALSE";

var builtInTypes = "STRING|INT|LONG|FLOAT|DOUBLE|BOOL|OBJECT";

var keywordMapper = this.createKeywordMapper({
"keyword": keywords,
"constant.language": builtInConstants,
"constant.language.boolean": builtInBooleanConstants,
"support.type": builtInTypes
}, "identifier", true);

this.$rules = {
"start": [
{
Expand All @@ -52,10 +45,8 @@ define("ace/mode/asyncapi_highlight_rules", ["require", "exports", "module", "ac
}
]
};

this.normalizeRules();
};

oop.inherits(AsyncAPIHighlightRules, TextHighlightRules);
exports.AsyncAPIHighlightRules = AsyncAPIHighlightRules;
});
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,11 @@ define(['require', 'jquery', 'lodash', 'log', 'smart_wizard', 'app/source-editor
this.designContainer = this.__$parent_el_container.find(_.get(initOpts, 'design_view.container'));
this.previewContainer = this.__$parent_el_container.find(_.get(initOpts, 'preview.container'));
this.toggleControlsContainer = this.__$parent_el_container.find('.toggle-controls-container');

this.asyncAPIViewContainer = initOpts.asyncAPIViewContainer;
this.asyncAPIViewContainer.removeClass("hide-div");
this.asyncAPISpecContainer = this.asyncAPIViewContainer.find(_.get(initOpts, 'async_api_view.specContainer'));
this.asyncAPIGenContainer = this.asyncAPIViewContainer.find(_.get(initOpts, 'async_api_view.generatorContainer'));
this.asyncAPIYamlContainer = this.asyncAPIViewContainer.find(_.get(initOpts, 'async_api_view.yamlContainer'));

this.renderCallback = this.renderCallback.bind(this);
self.__options = initOpts;
self.__editorInstance = initOpts.editorInstance;
Expand All @@ -65,14 +63,11 @@ define(['require', 'jquery', 'lodash', 'log', 'smart_wizard', 'app/source-editor
} else {
$(self.toggleControlsContainer[0]).find('.async-api-add-update-button').html('Update Async API');
}

self.hideOthers();
self.hideInternalViews();
self.renderAsyncAPIView();

$(self.toggleControlsContainer[0]).find('#asyncbtn-to-code-view').removeClass('hide-div');
$(self.toggleControlsContainer[0]).find('#asyncbtn-asyncapi-view').addClass('hide-div');

$('.toggle-controls-container #asyncbtn-to-code-view').on('click', function(e) {
e.preventDefault();
if (self._contentChanged) {
Expand All @@ -89,7 +84,6 @@ define(['require', 'jquery', 'lodash', 'log', 'smart_wizard', 'app/source-editor
var asyncAPIViewButton = $(self.toggleControlsContainer[0]).find('#asyncbtn-asyncapi-view');
asyncAPIViewButton.removeClass('hide-div');
});

$('.toggle-controls-container #btn-add-update-async-btn').on('click', function(e) {
e.preventDefault();
var response = AsyncAPIRESTClient.getSiddhiElements(self.__tab.getFile().getContent());
Expand Down Expand Up @@ -122,8 +116,6 @@ define(['require', 'jquery', 'lodash', 'log', 'smart_wizard', 'app/source-editor
} else if (response.status === "fail") {
alerts.error(response.errorMessage);
}


});
};
//Constructor for the AsyncAPIView
Expand Down Expand Up @@ -159,8 +151,6 @@ define(['require', 'jquery', 'lodash', 'log', 'smart_wizard', 'app/source-editor

AsyncAPIView.prototype.renderCallback = function () {
var self = this;
self.checkVar = "dsfsdf";
console.log(self.checkVar);
if (self.editor.getSession().getValue() !== "" && self.asyncAPIDefYaml !== self.editor.getSession().getValue()) {
self._contentChanged = true;
window.getAsyncAPIUI(self.asyncAPISpecContainerDom, self.editor.getSession().getValue());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
/**
* Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0
/*
* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

define(["jquery", "utils"], function (jQuery, Utils) {

"use strict"; // JS strict mode
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
/**
* Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0
/*
* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

define(function () {

"use strict"; // JS strict mode
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
/**
* Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0
/*
* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
define(['jquery', 'log', '../dist/bundle.js', 'lodash', 'workspace',
/* void libs*/ 'bootstrap', 'theme_wso2', 'jquery_ui', 'jquery_validate', 'jquery_timepicker', './templates'],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
/**
* Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0
/*
* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

define(['jquery', 'backbone', 'lodash', 'log', /** void module - jquery plugin **/ 'js_tree'], function ($, Backbone, _, log) {

var ElementBrowser = Backbone.View.extend({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2761,9 +2761,6 @@ <h4 class='modal-title export-dialog-title' id='initialHeading'>Exporting Siddhi
</div>
</div>

!-- Async API Dialog -->


<!--Cron Generator Dialog-->
<div class='modal fade' id='cronGenerator' tabindex='-1' role='dialog'>
<div class='modal-dialog cron-generator' role='document'>
Expand Down

0 comments on commit d807fbc

Please sign in to comment.