|
1581 | 1581 | var $this = jQuery($event.currentTarget); |
1582 | 1582 |
|
1583 | 1583 | if ($this.hasClass('raml-console-resources-expanded')) { |
| 1584 | + $scope.collapsed = true; |
1584 | 1585 | $this.text('expand all'); |
1585 | 1586 | $this.removeClass('raml-console-resources-expanded'); |
1586 | 1587 | jQuery('#raml-console-resources-container').find('ol.raml-console-resource-list').velocity('slideUp', { |
1587 | 1588 | duration: 200 |
1588 | 1589 | }); |
1589 | 1590 | } else { |
| 1591 | + $scope.collapsed = false; |
1590 | 1592 | $this.text('collapse all'); |
1591 | 1593 | $this.addClass('raml-console-resources-expanded'); |
1592 | 1594 | jQuery('#raml-console-resources-container').find('ol.raml-console-resource-list').velocity('slideDown', { |
1593 | 1595 | duration: 200 |
1594 | 1596 | }); |
1595 | 1597 | } |
1596 | 1598 |
|
1597 | | - jQuery('#raml-console-resources-container').find('.raml-console-resource-list-root ol.raml-console-resource-list').toggleClass('raml-console-is-collapsed'); |
1598 | | - jQuery('#raml-console-resources-container').find('button.raml-console-resource-root-toggle').toggleClass('raml-console-is-active'); |
| 1599 | + // jQuery('#raml-console-resources-container').find('.raml-console-resource-list-item ol.raml-console-resource-list').toggleClass('raml-console-is-collapsed'); |
| 1600 | + // jQuery('#raml-console-resources-container').find('button.raml-console-resource-root-toggle').toggleClass('raml-console-is-active'); |
1599 | 1601 | }; |
1600 | 1602 |
|
1601 | 1603 | $scope.hasResourcesWithChilds = function () { |
|
2082 | 2084 | var options = request.toOptions(); |
2083 | 2085 |
|
2084 | 2086 | return [ |
2085 | | - options.type.toUpperCase(), |
| 2087 | + options.method.toUpperCase(), |
2086 | 2088 | this.encodeURI(options.url), |
2087 | 2089 | rfc3986Encode(this.encodeParameters(request, oauthParams)) |
2088 | 2090 | ].join('&'); |
|
2438 | 2440 |
|
2439 | 2441 | RAML.Client.Request = { |
2440 | 2442 | create: function(url, method) { |
2441 | | - return new RequestDsl({ url: url, type: method }); |
| 2443 | + return new RequestDsl({ url: url, method: method }); |
2442 | 2444 | } |
2443 | 2445 | }; |
2444 | 2446 | })(); |
@@ -3600,8 +3602,8 @@ RAML.Inspector = (function() { |
3600 | 3602 | var xhr = new root.XMLHttpRequest(); |
3601 | 3603 | var headers = options.headers || {}; |
3602 | 3604 |
|
3603 | | - // Open the request to the uri and method. |
3604 | | - xhr.open(options.method, options.uri); |
| 3605 | + // Open the request to the url and method. |
| 3606 | + xhr.open(options.method, options.url); |
3605 | 3607 |
|
3606 | 3608 | // When the request has loaded, attempt to automatically parse the body. |
3607 | 3609 | xhr.onload = function () { |
@@ -3638,20 +3640,20 @@ RAML.Inspector = (function() { |
3638 | 3640 | * @param {Function} done |
3639 | 3641 | */ |
3640 | 3642 | ClientOAuth2.prototype.request = function (options, done) { |
3641 | | - var lib = http; |
3642 | | - var reqOpts = url.parse(options.uri); |
| 3643 | + var lib = http; |
| 3644 | + var reqOptions = url.parse(options.url); |
3643 | 3645 |
|
3644 | 3646 | // If the protocol is over https, switch request library. |
3645 | | - if (reqOpts.protocol === 'https:') { |
| 3647 | + if (reqOptions.protocol === 'https:') { |
3646 | 3648 | lib = https; |
3647 | 3649 | } |
3648 | 3650 |
|
3649 | 3651 | // Alias request options. |
3650 | | - reqOpts.method = options.method; |
3651 | | - reqOpts.headers = options.headers; |
| 3652 | + reqOptions.method = options.method; |
| 3653 | + reqOptions.headers = options.headers; |
3652 | 3654 |
|
3653 | 3655 | // Send the http request and listen for the response to finish. |
3654 | | - var req = lib.request(reqOpts, function (res) { |
| 3656 | + var req = lib.request(reqOptions, function (res) { |
3655 | 3657 | var data = ''; |
3656 | 3658 |
|
3657 | 3659 | // Callback to `done` if a response error occurs. |
@@ -3711,44 +3713,44 @@ RAML.Inspector = (function() { |
3711 | 3713 | /** |
3712 | 3714 | * Sign a standardised request object with user authentication information. |
3713 | 3715 | * |
3714 | | - * @param {Object} opts |
| 3716 | + * @param {Object} options |
3715 | 3717 | * @return {Object} |
3716 | 3718 | */ |
3717 | | - ClientOAuth2Token.prototype.sign = function (opts) { |
| 3719 | + ClientOAuth2Token.prototype.sign = function (options) { |
3718 | 3720 | if (!this.accessToken) { |
3719 | 3721 | throw new Error('Unable to sign without access token'); |
3720 | 3722 | } |
3721 | 3723 |
|
3722 | | - opts.headers = opts.headers || {}; |
| 3724 | + options.headers = options.headers || {}; |
3723 | 3725 |
|
3724 | 3726 | if (this.tokenType === 'bearer') { |
3725 | | - opts.headers.Authorization = 'Bearer ' + this.accessToken; |
| 3727 | + options.headers.Authorization = 'Bearer ' + this.accessToken; |
3726 | 3728 | } else { |
3727 | | - var parts = opts.uri.split('#'); |
| 3729 | + var parts = options.url.split('#'); |
3728 | 3730 | var token = 'access_token=' + this.accessToken; |
3729 | | - var uri = parts[0].replace(/[?&]access_token=[^&#]/, ''); |
| 3731 | + var url = parts[0].replace(/[?&]access_token=[^&#]/, ''); |
3730 | 3732 | var fragment = parts[1] ? '#' + parts[1] : ''; |
3731 | 3733 |
|
3732 | | - // Prepend the correct query string parameter to the uri. |
3733 | | - opts.uri = uri + (uri.indexOf('?') > -1 ? '&' : '?') + token + fragment; |
| 3734 | + // Prepend the correct query string parameter to the url. |
| 3735 | + options.url = url + (url.indexOf('?') > -1 ? '&' : '?') + token + fragment; |
3734 | 3736 |
|
3735 | | - // Attempt to avoid storing the uri in proxies, since the access token |
| 3737 | + // Attempt to avoid storing the url in proxies, since the access token |
3736 | 3738 | // is exposed in the query parameters. |
3737 | | - opts.headers.Pragma = 'no-store'; |
3738 | | - opts.headers['Cache-Control'] = 'no-store'; |
| 3739 | + options.headers.Pragma = 'no-store'; |
| 3740 | + options.headers['Cache-Control'] = 'no-store'; |
3739 | 3741 | } |
3740 | 3742 |
|
3741 | | - return opts; |
| 3743 | + return options; |
3742 | 3744 | }; |
3743 | 3745 |
|
3744 | 3746 | /** |
3745 | 3747 | * Make a HTTP request as the user. |
3746 | 3748 | * |
3747 | | - * @param {Object} opts |
| 3749 | + * @param {Object} options |
3748 | 3750 | * @param {Function} done |
3749 | 3751 | */ |
3750 | | - ClientOAuth2Token.prototype.request = function (opts, done) { |
3751 | | - return this.client.client.request(this.sign(opts), done); |
| 3752 | + ClientOAuth2Token.prototype.request = function (options, done) { |
| 3753 | + return this.client.client.request(this.sign(options), done); |
3752 | 3754 | }; |
3753 | 3755 |
|
3754 | 3756 | /** |
@@ -5390,7 +5392,7 @@ angular.module('ramlConsoleApp').run(['$templateCache', function($templateCache) |
5390 | 5392 | "\n" + |
5391 | 5393 | " <root-documentation></root-documentation>\n" + |
5392 | 5394 | "\n" + |
5393 | | - " <ol <ol ng-class=\"{'raml-console-resources-container-no-title': disableTitle, 'raml-console-resources-container': !disableTitle}\" id=\"raml-console-resources-container\" class=\"raml-console-resource-list raml-console-resource-list-root\">\n" + |
| 5395 | + " <ol ng-class=\"{'raml-console-resources-container-no-title': disableTitle, 'raml-console-resources-container': !disableTitle}\" id=\"raml-console-resources-container\" class=\"raml-console-resource-list raml-console-resource-list-root\">\n" + |
5394 | 5396 | " <li id=\"raml_documentation\" class=\"raml-console-resource-list-item raml-console-documentation-header\">\n" + |
5395 | 5397 | " <div ng-if=\"proxy\" align=\"right\" class=\"raml-console-resource-proxy\">\n" + |
5396 | 5398 | " <label for=\"raml-console-api-behind-firewall\">API is behind a firewall <a href=\"http://www.mulesoft.org/documentation/display/current/Accessing+Your+API+Behind+a+Firewall\" target=\"_blank\">(?)</a></label>\n" + |
|
0 commit comments