Skip to content

Commit 27e1e39

Browse files
committed
Merge remote branch 'mainline/develop' into TrollS51Bugfixes
2 parents ec7fff8 + 5f4871b commit 27e1e39

File tree

46 files changed

+817
-445
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+817
-445
lines changed

.htaccess

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,6 @@
243243
order allow,deny
244244
deny from all
245245
</Files>
246-
<Files CONTRIBUTOR_LICENSE_AGREEMENT.html>
247-
order allow,deny
248-
deny from all
249-
</Files>
250246
<Files COPYING.txt>
251247
order allow,deny
252248
deny from all

.htaccess.sample

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,6 @@
209209
order allow,deny
210210
deny from all
211211
</Files>
212-
<Files CONTRIBUTOR_LICENSE_AGREEMENT.html>
213-
order allow,deny
214-
deny from all
215-
</Files>
216212
<Files COPYING.txt>
217213
order allow,deny
218214
deny from all

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The Magento 2 development team will review all issues and contributions submitte
1010

1111
## Contribution requirements
1212

13-
1. Contributions must adhere to [Magento coding standards](http://devdocs.magento.com/guides/v1.0/coding-standards/bk-coding-standards.html).
13+
1. Contributions must adhere to [Magento coding standards](http://devdocs.magento.com/guides/v2.0/coding-standards/bk-coding-standards.html).
1414
2. Pull requests (PRs) must be accompanied by a meaningful description of their purpose. Comprehensive descriptions increase the chances of a pull request to be merged quickly and without additional clarification requests.
1515
3. Commits must be accompanied by meaningful commit messages.
1616
4. PRs which include bug fixing, must be accompanied with step-by-step description of how to reproduce the bug.
@@ -25,7 +25,7 @@ The Magento 2 development team will review all issues and contributions submitte
2525
If you are a new GitHub user, we recommend that you create your own [free github account](https://github.com/signup/free). By doing that, you will be able to collaborate with the Magento 2 development team, “fork” the Magento 2 project and be able to easily send “pull requests”.
2626

2727
1. Search current [listed issues](https://github.com/magento/magento2/issues) (open or closed) for similar proposals of intended contribution before starting work on a new contribution.
28-
2. Review the [Contributor License Agreement](https://github.com/magento/magento2/blob/master/CONTRIBUTOR_LICENSE_AGREEMENT.html) if this is your first time contributing.
28+
2. Review the [Contributor License Agreement](https://magento.com/legaldocuments/mca) if this is your first time contributing.
2929
3. Create and test your work.
30-
4. Fork the Magento 2 repository according to [Fork a repository instructions](http://devdocs.magento.com/guides/v1.0/contributor-guide/CONTRIBUTING.html#fork) and when you are ready to send us a pull request – follow [Create a pull request instructions](http://devdocs.magento.com/guides/v1.0/contributor-guide/CONTRIBUTING.html#pull_request).
30+
4. Fork the Magento 2 repository according to [Fork a repository instructions](http://devdocs.magento.com/guides/v2.0/contributor-guide/contributing.html#fork) and when you are ready to send us a pull request – follow [Create a pull request instructions](http://devdocs.magento.com/guides/v2.0/contributor-guide/contributing.html#pull_request).
3131
5. Once your contribution is received, Magento 2 development team will review the contribution and collaborate with you as needed to improve the quality of the contribution.

CONTRIBUTOR_LICENSE_AGREEMENT.html

Lines changed: 0 additions & 137 deletions
This file was deleted.

app/code/Magento/Swagger/view/frontend/layout/swagger_index_index.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
<link src='Magento_Swagger::swagger-ui/js/lang/translator.js' type='text/javascript'/>
3030
<link src='Magento_Swagger::swagger-ui/js/lang/ru.js' type='text/javascript'/>
3131
<link src='Magento_Swagger::swagger-ui/js/lang/en.js' type='text/javascript'/>
32+
<link src='Magento_Swagger::swagger-ui/js/magento-swagger.js' type='text/javascript'/>
3233

3334
<!--Remove require-js assets-->
3435
<remove src="requirejs/require.js"/>

app/code/Magento/Swagger/view/frontend/templates/swagger-ui/index.phtml

Lines changed: 5 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -17,84 +17,14 @@
1717
$schemaUrl = rtrim($block->getBaseUrl(), '/') . '/rest/default/schema?services=all';
1818
?>
1919

20-
<!DOCTYPE html>
21-
<script>
22-
$(function () {
23-
var url = window.location.search.match(/url=([^&]+)/);
24-
if (url && url.length > 1) {
25-
url = decodeURIComponent(url[1]);
26-
} else {
27-
url = '<?php /* @escapeNotVerified */ echo $schemaUrl ?>';
28-
}
29-
30-
// Pre load translate...
31-
if(window.SwaggerTranslator) {
32-
window.SwaggerTranslator.translate();
33-
}
34-
window.swaggerUi = new SwaggerUi({
35-
url: url,
36-
dom_id: "swagger-ui-container",
37-
supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'],
38-
onComplete: function(swaggerApi, swaggerUi){
39-
if(typeof initOAuth == "function") {
40-
initOAuth({
41-
clientId: "your-client-id",
42-
clientSecret: "your-client-secret",
43-
realm: "your-realms",
44-
appName: "your-app-name",
45-
scopeSeparator: ","
46-
});
47-
}
48-
49-
if(window.SwaggerTranslator) {
50-
window.SwaggerTranslator.translate();
51-
}
52-
53-
$('pre code').each(function(i, e) {
54-
hljs.highlightBlock(e)
55-
});
56-
57-
addApiKeyAuthorization();
58-
},
59-
onFailure: function(data) {
60-
log("Unable to Load SwaggerUI");
61-
},
62-
docExpansion: "none",
63-
apisSorter: "alpha",
64-
showRequestHeaders: false
65-
});
66-
67-
function addApiKeyAuthorization(){
68-
var key = encodeURIComponent($('#input_apiKey')[0].value);
69-
if(key && key.trim() != "") {
70-
var apiKeyAuth = new SwaggerClient.ApiKeyAuthorization("api_key", key, "query");
71-
window.swaggerUi.api.clientAuthorizations.add("api_key", apiKeyAuth);
72-
log("added key " + key);
73-
}
74-
}
75-
76-
$('#input_apiKey').change(addApiKeyAuthorization);
77-
78-
// if you have an apiKey you would like to pre-populate on the page for demonstration purposes...
79-
/*
80-
var apiKey = "myApiKeyXXXX123456789";
81-
$('#input_apiKey').val(apiKey);
82-
*/
83-
84-
window.swaggerUi.load();
85-
86-
function log() {
87-
if ('console' in window) {
88-
console.log.apply(console, arguments);
89-
}
90-
}
91-
});
92-
</script>
93-
94-
9520
<div id='header'>
9621
<div class="swagger-ui-wrap">
9722
<a id="logo" href="http://swagger.io">swagger</a>
23+
<form id='api_selector'>
24+
<input id="input_baseUrl" type="hidden" value="<?php /* @escapeNotVerified */ echo $schemaUrl ?>"/>
25+
<div class='input'><input placeholder="api_key" id="input_apiKey" name="apiKey" type="text"/></div>
26+
<div class='input'><a id="explore" href="#" data-sw-translate>apply</a></div>
27+
</form>
9828
</div>
9929
</div>
10030

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/**
2+
* Copyright © 2015 Magento. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
$(function () {
6+
var url = $('#input_baseUrl').val();
7+
8+
// Pre load translate...
9+
if(window.SwaggerTranslator) {
10+
window.SwaggerTranslator.translate();
11+
}
12+
window.swaggerUi = new SwaggerUi({
13+
url: url,
14+
dom_id: "swagger-ui-container",
15+
supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'],
16+
onComplete: function(swaggerApi, swaggerUi){
17+
if(typeof initOAuth == "function") {
18+
initOAuth({
19+
clientId: "your-client-id",
20+
clientSecret: "your-client-secret",
21+
realm: "your-realms",
22+
appName: "your-app-name",
23+
scopeSeparator: ","
24+
});
25+
}
26+
27+
if(window.SwaggerTranslator) {
28+
window.SwaggerTranslator.translate();
29+
}
30+
31+
$('pre code').each(function(i, e) {
32+
hljs.highlightBlock(e)
33+
});
34+
35+
addApiKeyAuthorization();
36+
},
37+
onFailure: function(data) {
38+
log("Unable to Load SwaggerUI");
39+
},
40+
docExpansion: "none",
41+
apisSorter: "alpha",
42+
showRequestHeaders: false
43+
});
44+
45+
function addApiKeyAuthorization(){
46+
var key = encodeURIComponent($('#input_apiKey')[0].value);
47+
if(key && key.trim() != "") {
48+
var apiKeyAuth = new SwaggerClient.ApiKeyAuthorization("Authorization", "Bearer " + key, "header");
49+
window.swaggerUi.api.clientAuthorizations.add("apiKeyAuth", apiKeyAuth);
50+
}
51+
}
52+
53+
$('#input_apiKey').change(addApiKeyAuthorization);
54+
55+
56+
window.swaggerUi.load();
57+
58+
function log() {
59+
if ('console' in window) {
60+
console.log.apply(console, arguments);
61+
}
62+
}
63+
});

app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/swagger-ui.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@
427427
},"22":function(depth0,helpers,partials,data) {
428428
return "";
429429
},"24":function(depth0,helpers,partials,data) {
430-
return " <div class='sandbox_header'>\n <input class='submit' type='hidden' value='Try it out!' data-sw-translate/>\n <a href='#' class='response_hider' style='display:none' data-sw-translate>Hide Response</a>\n <span class='response_throbber' style='display:none'></span>\n </div>\n";
430+
return " <div class='sandbox_header'>\n <input class='submit' type='button' value='Try it out!' data-sw-translate/>\n <a href='#' class='response_hider' style='display:none' data-sw-translate>Hide Response</a>\n <span class='response_throbber' style='display:none'></span>\n </div>\n";
431431
},"26":function(depth0,helpers,partials,data) {
432432
return " <h4 data-sw-translate>Request Headers</h4>\n <div class='block request_headers'></div>\n";
433433
},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {

0 commit comments

Comments
 (0)