From 87de7d7180877c554c4320df457d342dc17086a7 Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Sun, 23 Apr 2017 19:23:38 +0300 Subject: [PATCH 01/17] build: finish script for CDN releases closes #87, [skip ci] --- build/prepare_deploy.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/prepare_deploy.js b/build/prepare_deploy.js index 0f20b486..566eae61 100755 --- a/build/prepare_deploy.js +++ b/build/prepare_deploy.js @@ -16,10 +16,10 @@ mkdir('-p', 'dist'); cp('-R', '../dist/*', './dist/'); cd('..'); -var version = 'v' + require(path.join(__dirname, '../package.json')).version + '/'; -var versionDir = path.join(paths.releases, version); +var version = require(path.join(__dirname, '../package.json')).version; +var versionDir = path.join(paths.releases, 'v' + version + '/'); var latestDir = path.join(paths.releases, 'latest/'); -var v1Dir = path.join(paths.releases, 'v1.x.x/'); +var v1Dir = path.join(paths.releases, 'v' + version.split('.')[0] + '.x.x/'); mkdir('-p', versionDir) mkdir('-p', latestDir); mkdir('-p', v1Dir); From 6b363a5f44293bff7bfd43340a49898b5ae7f02a Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Tue, 25 Apr 2017 10:36:35 +0300 Subject: [PATCH 02/17] fix: typo in download button classname (thanks @dwilding) --- lib/components/ApiInfo/api-info.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/components/ApiInfo/api-info.html b/lib/components/ApiInfo/api-info.html index 294517b9..f353328a 100644 --- a/lib/components/ApiInfo/api-info.html +++ b/lib/components/ApiInfo/api-info.html @@ -1,6 +1,6 @@

{{info.title}} ({{info.version}})

-

+

Download OpenAPI (fka Swagger) specification: Download

From 0341db455957f57f0a6f156eac017c21e151e522 Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Tue, 25 Apr 2017 10:41:09 +0300 Subject: [PATCH 03/17] feat: clear button (x) in search box --- lib/components/Search/redoc-search.html | 1 + lib/components/Search/redoc-search.scss | 14 +++++++++++++- lib/components/Search/redoc-search.ts | 5 +++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/lib/components/Search/redoc-search.html b/lib/components/Search/redoc-search.html index 5c7becf6..aef24371 100644 --- a/lib/components/Search/redoc-search.html +++ b/lib/components/Search/redoc-search.html @@ -1,4 +1,5 @@
+
×
diff --git a/lib/components/Search/redoc-search.scss b/lib/components/Search/redoc-search.scss index 8b25e5c7..601917af 100644 --- a/lib/components/Search/redoc-search.scss +++ b/lib/components/Search/redoc-search.scss @@ -18,12 +18,24 @@ fill: lighten($text-color, 20%); } } + + .clear-button { + position: absolute; + display: inline-block; + width: 13px; + text-align: center; + right: 20px; + height: 28px; + line-height: 28px; + vertical-align: middle; + cursor: pointer; + } } input { width: 100%; box-sizing: border-box; - padding: 5px 5px 5px 20px; + padding: 5px 20px 5px 20px; border: 0; border-bottom: 1px solid darken($side-bar-bg-color, 10%); diff --git a/lib/components/Search/redoc-search.ts b/lib/components/Search/redoc-search.ts index 5cf8b286..96b85ea2 100644 --- a/lib/components/Search/redoc-search.ts +++ b/lib/components/Search/redoc-search.ts @@ -38,6 +38,11 @@ export class RedocSearch implements OnInit { this.search.indexAll(); } + clearSearch() { + this.searchTerm = ''; + this.updateSearch(); + } + update(event:KeyboardEvent, val) { if (event && event.keyCode === 27) { // escape this.searchTerm = ''; From 6edbbe7b0c899484a718c88f050d48e75ddc2492 Mon Sep 17 00:00:00 2001 From: Joe Honzawa Date: Wed, 3 May 2017 17:01:53 +0900 Subject: [PATCH 04/17] fix: Slugifying non-ascii headers make duplicate permalinks (#264) --- lib/utils/md-renderer.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/utils/md-renderer.ts b/lib/utils/md-renderer.ts index 214da611..bdb5890f 100644 --- a/lib/utils/md-renderer.ts +++ b/lib/utils/md-renderer.ts @@ -53,7 +53,8 @@ export class MdRenderer { } saveHeading(title: string, parent:MarkdownHeading = {id:null, children: this.headings}) :MarkdownHeading { - let slug = slugify(title); + // if title contains some non-ASCII characters (e.g. chinese) slugify returns empty string + let slug = slugify(title) || title; let id = slug; if (parent && parent.id) id = `${parent.id}/${id}`; parent.children = parent.children || {}; From 583c5719db019628d386a7af2b9f1e94fc45bcb7 Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Sun, 30 Apr 2017 14:21:29 +0300 Subject: [PATCH 05/17] fix: openapi button add `download` attribute --- lib/components/ApiInfo/api-info.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/components/ApiInfo/api-info.html b/lib/components/ApiInfo/api-info.html index f353328a..d9d5094f 100644 --- a/lib/components/ApiInfo/api-info.html +++ b/lib/components/ApiInfo/api-info.html @@ -2,7 +2,7 @@

{{info.title}} ({{info.version}})

Download OpenAPI (fka Swagger) specification: - Download + Download

From e7130d2d04f7ecfc24eb87fc0c5b632097ce8fef Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Sun, 30 Apr 2017 14:24:24 +0300 Subject: [PATCH 06/17] feat: add triangle icon for expandable menu items --- lib/components/SideMenu/side-menu-items.html | 3 +++ lib/components/SideMenu/side-menu-items.scss | 23 ++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/lib/components/SideMenu/side-menu-items.html b/lib/components/SideMenu/side-menu-items.html index 74e72a90..dbbfbb59 100644 --- a/lib/components/SideMenu/side-menu-items.html +++ b/lib/components/SideMenu/side-menu-items.html @@ -3,6 +3,9 @@