Skip to content
This repository was archived by the owner on May 10, 2024. It is now read-only.

Commit b7dc8ca

Browse files
authored
Merge pull request #503 from mulesoft/develop
Update console and version
2 parents 2e2a18c + 96312a1 commit b7dc8ca

4 files changed

Lines changed: 47 additions & 22 deletions

File tree

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"angular": "~1.3.17",
1111
"angular-bootstrap": ">=0.11.0 <0.14.0",
1212
"angular-ui-tree": "2.1.5",
13-
"api-console": "mulesoft/api-console#v3.0.20",
13+
"api-console": "mulesoft/api-console#v3.0.21",
1414
"es5-shim": "~2.3.0",
1515
"file-saver.js": "~1.20150304.1",
1616
"font-awesome": "~4.0.3",

dist/scripts/api-designer-vendor.js

Lines changed: 41 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -81763,25 +81763,47 @@ exports.javascript = require('./javascript');
8176381763
scope: {
8176481764
markdown: '='
8176581765
},
81766-
controller: ['$scope', '$sanitize', '$window', '$element', function($scope, $sanitize, $window, $element) {
81767-
$scope.$watch('markdown', function (markdown) {
81768-
var allowUnsafeMarkdown = $scope.$parent.allowUnsafeMarkdown;
81766+
controller: 'MarkdownController'
81767+
};
81768+
};
8176981769

81770-
var markdownString = typeof markdown === 'string' ? markdown || '' : '';
81771-
var html = $window.marked(markdownString, RAML.Settings.marked);
81770+
RAML.Directives.markdownString = function () {
81771+
return {
81772+
restrict: 'A',
81773+
scope: {
81774+
markdownString: '@'
81775+
},
81776+
controller: 'MarkdownStringController'
81777+
};
81778+
};
8177281779

81773-
if (!allowUnsafeMarkdown) {
81774-
html = $sanitize(html);
81775-
}
81780+
var watchMarkdown = function(expression, $scope, $window, $sanitize, $element) {
81781+
$scope.$watch(expression, function (markdown) {
81782+
var allowUnsafeMarkdown = $scope.$parent.allowUnsafeMarkdown;
81783+
var markdownString = typeof markdown === 'string' ? markdown || '' : '';
81784+
var html = $window.marked(markdownString, RAML.Settings.marked);
8177681785

81777-
$element.html(html);
81778-
});
81779-
}]
81780-
};
81786+
if (!allowUnsafeMarkdown) {
81787+
html = $sanitize(html);
81788+
}
81789+
81790+
$element.html(html);
81791+
});
8178181792
};
8178281793

81794+
function controller($scope, $sanitize, $window, $element) {
81795+
watchMarkdown('markdown', $scope, $window, $sanitize, $element);
81796+
}
81797+
81798+
function stringController($scope, $sanitize, $window, $element) {
81799+
watchMarkdown('markdownString', $scope, $window, $sanitize, $element);
81800+
}
81801+
8178381802
angular.module('RAML.Directives')
81784-
.directive('markdown', RAML.Directives.markdown);
81803+
.controller('MarkdownController', controller)
81804+
.controller('MarkdownStringController', stringController)
81805+
.directive('markdown', RAML.Directives.markdown)
81806+
.directive('markdownString', RAML.Directives.markdownString);
8178581807
})();
8178681808

8178781809
(function () {
@@ -83032,7 +83054,7 @@ exports.javascript = require('./javascript');
8303283054
element.append(resourceHeadingElement(resource, currentId));
8303383055
element.append(resourceTypeElement(resource));
8303483056
element.append(resourceHeadingFlagElement($scope, resource));
83035-
element.append(resourceLevelDescriptionElement(resource));
83057+
element.append(resourceLevelDescriptionElement($scope, $compile, resource));
8303683058
element.append(methodListElement($scope, resource, currentId, showResource, resourceId));
8303783059
element.append(closeMethodButton($scope, resource, currentId, showResource, resourceId));
8303883060

@@ -83056,9 +83078,12 @@ exports.javascript = require('./javascript');
8305683078
return '';
8305783079
}
8305883080

83059-
function resourceLevelDescriptionElement(resource) {
83081+
function resourceLevelDescriptionElement($scope, $compile, resource) {
8306083082
var element = angular.element('<span class="raml-console-resource-level-description raml-console-marked-content"></span>');
83061-
element.append(angular.element('<p>' + resource.description + '</p>'));
83083+
element.attr('markdown-string', resource.description);
83084+
83085+
$compile(element)($scope);
83086+
8306283087
return element;
8306383088
}
8306483089

dist/scripts/api-designer-vendor.min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "api-designer",
3-
"version": "0.4.4",
3+
"version": "0.4.6",
44
"description": "A web editor for creating and sharing RAML API specifications",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)