Skip to content

Commit 4e37817

Browse files
Separate header to partial, minor fixes
1 parent 12c4125 commit 4e37817

File tree

13 files changed

+135
-126
lines changed

13 files changed

+135
-126
lines changed

bin/themes/default/assets/css/main.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,8 @@ pre code { padding: 0; font-size: 100%; background-color: transparent; }
499499
html.default .col-menu { width: 28%; }
500500
html.default .tsd-navigation { padding-left: 10px; } }
501501
@media (max-width: 900px) { html.default .col-content { float: none; width: 100%; }
502-
html.default .col-menu { position: fixed !important; overflow: auto; -webkit-overflow-scrolling: touch; overflow-scrolling: touch; z-index: 1024; top: 0 !important; bottom: 0 !important; left: auto !important; right: 0 !important; width: 100%; padding: 20px 20px 20px 0; max-width: 450px; visibility: hidden; background-color: white; -webkit-transform: translate(100%, 0); -ms-transform: translate(100%, 0); transform: translate(100%, 0); }
502+
html.default .col-menu { position: fixed !important; overflow: auto; -webkit-overflow-scrolling: touch; overflow-scrolling: touch; z-index: 1024; top: 0 !important; bottom: 0 !important; left: auto !important; right: 0 !important; width: 100%; padding: 20px 20px 0 0; max-width: 450px; visibility: hidden; background-color: white; -webkit-transform: translate(100%, 0); -ms-transform: translate(100%, 0); transform: translate(100%, 0); }
503+
html.default .col-menu > *:last-child { padding-bottom: 20px; }
503504
html.default .overlay { content: ""; display: block; position: fixed; z-index: 1023; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0, 0, 0, 0.75); visibility: hidden; }
504505
html.default.to-has-menu .overlay { -webkit-animation: fade-in 0.4s; animation: fade-in 0.4s; }
505506
html.default.to-has-menu header, html.default.to-has-menu footer, html.default.to-has-menu .col-content { -webkit-animation: shift-to-left 0.4s; animation: shift-to-left 0.4s; }

bin/themes/default/layouts/default.hbs

Lines changed: 1 addition & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -12,58 +12,7 @@
1212
</head>
1313
<body>
1414

15-
<header>
16-
<div class="tsd-page-toolbar">
17-
<div class="container">
18-
<div class="table-wrap">
19-
<div class="table-cell" id="tsd-search" data-index="{{relativeURL "assets/js/search.js"}}" data-base="{{relativeURL "./"}}">
20-
<div class="field">
21-
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
22-
<input id="tsd-search-field" type="text" />
23-
</div>
24-
25-
<ul class="results">
26-
<li class="state loading">Preparing search index...</li>
27-
<li class="state failure">The search index is not available</li>
28-
</ul>
29-
30-
<a href="{{relativeURL "index.html"}}" class="title">{{project.name}}</a>
31-
</div>
32-
33-
<div class="table-cell" id="tsd-widgets">
34-
<div id="tsd-filter">
35-
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
36-
<div class="tsd-filter-group">
37-
<input type="checkbox" id="tsd-filter-inherited" checked />
38-
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
39-
40-
<input type="checkbox" id="tsd-filter-private" checked />
41-
<label class="tsd-widget" for="tsd-filter-private">Private</label>
42-
43-
{{#unless settings.excludeExternals}}
44-
<input type="checkbox" id="tsd-filter-externals" checked />
45-
<label class="tsd-widget" for="tsd-filter-externals">Externals</label>
46-
{{/unless}}
47-
48-
<input type="checkbox" id="tsd-filter-only-exported" />
49-
<label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label>
50-
</div>
51-
</div>
52-
53-
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
54-
</div>
55-
</div>
56-
</div>
57-
</div>
58-
<div class="tsd-page-title">
59-
<div class="container">
60-
<ul class="tsd-breadcrumb">
61-
{{#with model}}{{> breadcrumb}}{{/with}}
62-
</ul>
63-
<h1>{{model.kindString}} {{model.name}}</h1>
64-
</div>
65-
</div>
66-
</header>
15+
{{> header}}
6716

6817
<div class="container container-main">
6918
<div class="row">
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
{{#if parent}}{{#with parent}}{{> breadcrumb}}{{/with}}{{/if}}
2-
{{#ifCond url '==' 'globals.html'}}
1+
{{#if parent}}
2+
{{#with parent}}{{> breadcrumb}}{{/with}}
33
<li>
4-
<a href="{{relativeURL url}}">Globals</a>
4+
<a href="{{relativeURL url}}">{{name}}</a>
55
</li>
66
{{else}}
77
<li>
8-
<a href="{{relativeURL url}}">{{name}}</a>
8+
<a href="{{relativeURL url}}">Globals</a>
99
</li>
10-
{{/ifCond}}
10+
{{/if}}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<header>
2+
<div class="tsd-page-toolbar">
3+
<div class="container">
4+
<div class="table-wrap">
5+
<div class="table-cell" id="tsd-search" data-index="{{relativeURL "assets/js/search.js"}}" data-base="{{relativeURL "./"}}">
6+
<div class="field">
7+
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
8+
<input id="tsd-search-field" type="text" />
9+
</div>
10+
11+
<ul class="results">
12+
<li class="state loading">Preparing search index...</li>
13+
<li class="state failure">The search index is not available</li>
14+
</ul>
15+
16+
<a href="{{relativeURL "index.html"}}" class="title">{{project.name}}</a>
17+
</div>
18+
19+
<div class="table-cell" id="tsd-widgets">
20+
<div id="tsd-filter">
21+
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
22+
<div class="tsd-filter-group">
23+
<input type="checkbox" id="tsd-filter-inherited" checked />
24+
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
25+
26+
<input type="checkbox" id="tsd-filter-private" checked />
27+
<label class="tsd-widget" for="tsd-filter-private">Private</label>
28+
29+
{{#unless settings.excludeExternals}}
30+
<input type="checkbox" id="tsd-filter-externals" checked />
31+
<label class="tsd-widget" for="tsd-filter-externals">Externals</label>
32+
{{/unless}}
33+
34+
<input type="checkbox" id="tsd-filter-only-exported" />
35+
<label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label>
36+
</div>
37+
</div>
38+
39+
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
40+
</div>
41+
</div>
42+
</div>
43+
</div>
44+
<div class="tsd-page-title">
45+
<div class="container">
46+
<ul class="tsd-breadcrumb">
47+
{{#with model}}{{> breadcrumb}}{{/with}}
48+
</ul>
49+
<h1>{{model.kindString}} {{model.name}}</h1>
50+
</div>
51+
</div>
52+
</header>

bin/themes/minimal/layouts/default.hbs

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,8 @@ pre code { padding: 0; font-size: 100%; background-color: transparent; }
507507
html.default .col-menu { width: 28%; }
508508
html.default .tsd-navigation { padding-left: 10px; } }
509509
@media (max-width: 900px) { html.default .col-content { float: none; width: 100%; }
510-
html.default .col-menu { position: fixed !important; overflow: auto; -webkit-overflow-scrolling: touch; overflow-scrolling: touch; z-index: 1024; top: 0 !important; bottom: 0 !important; left: auto !important; right: 0 !important; width: 100%; padding: 20px 20px 20px 0; max-width: 450px; visibility: hidden; background-color: white; -webkit-transform: translate(100%, 0); -ms-transform: translate(100%, 0); transform: translate(100%, 0); }
510+
html.default .col-menu { position: fixed !important; overflow: auto; -webkit-overflow-scrolling: touch; overflow-scrolling: touch; z-index: 1024; top: 0 !important; bottom: 0 !important; left: auto !important; right: 0 !important; width: 100%; padding: 20px 20px 0 0; max-width: 450px; visibility: hidden; background-color: white; -webkit-transform: translate(100%, 0); -ms-transform: translate(100%, 0); transform: translate(100%, 0); }
511+
html.default .col-menu > *:last-child { padding-bottom: 20px; }
511512
html.default .overlay { content: ""; display: block; position: fixed; z-index: 1023; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0, 0, 0, 0.75); visibility: hidden; }
512513
html.default.to-has-menu .overlay { -webkit-animation: fade-in 0.4s; animation: fade-in 0.4s; }
513514
html.default.to-has-menu header, html.default.to-has-menu footer, html.default.to-has-menu .col-content { -webkit-animation: shift-to-left 0.4s; animation: shift-to-left 0.4s; }
@@ -726,37 +727,7 @@ input[type=checkbox]:checked + .tsd-widget:before { background-position: -160px
726727
</head>
727728
<body>
728729

729-
<header>
730-
<div class="tsd-page-toolbar">
731-
<div class="container">
732-
<div class="table-wrap">
733-
<div class="table-cell">
734-
<strong>{{project.name}}</strong>
735-
</div>
736-
<div class="table-cell" id="tsd-widgets">
737-
<div id="tsd-filter">
738-
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
739-
<div class="tsd-filter-group">
740-
<input type="checkbox" id="tsd-filter-inherited" checked />
741-
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
742-
743-
<input type="checkbox" id="tsd-filter-private" checked />
744-
<label class="tsd-widget" for="tsd-filter-private">Private</label>
745-
746-
{{#unless settings.excludeExternals}}
747-
<input type="checkbox" id="tsd-filter-externals" checked />
748-
<label class="tsd-widget" for="tsd-filter-externals">Externals</label>
749-
{{/unless}}
750-
751-
<input type="checkbox" id="tsd-filter-only-exported" />
752-
<label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label>
753-
</div>
754-
</div>
755-
</div>
756-
</div>
757-
</div>
758-
</div>
759-
</header>
730+
{{> header}}
760731

761732
<nav class="tsd-navigation secondary">
762733
<ul>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<header>
2+
<div class="tsd-page-toolbar">
3+
<div class="container">
4+
<div class="table-wrap">
5+
<div class="table-cell">
6+
<strong>{{project.name}}</strong>
7+
</div>
8+
<div class="table-cell" id="tsd-widgets">
9+
<div id="tsd-filter">
10+
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
11+
<div class="tsd-filter-group">
12+
<input type="checkbox" id="tsd-filter-inherited" checked />
13+
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
14+
15+
<input type="checkbox" id="tsd-filter-private" checked />
16+
<label class="tsd-widget" for="tsd-filter-private">Private</label>
17+
18+
{{#unless settings.excludeExternals}}
19+
<input type="checkbox" id="tsd-filter-externals" checked />
20+
<label class="tsd-widget" for="tsd-filter-externals">Externals</label>
21+
{{/unless}}
22+
23+
<input type="checkbox" id="tsd-filter-only-exported" />
24+
<label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label>
25+
</div>
26+
</div>
27+
</div>
28+
</div>
29+
</div>
30+
</div>
31+
</header>

bin/themes/minimal/theme.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ var Theme = (function (_super) {
99
function Theme(renderer, basePath) {
1010
_super.call(this, renderer, basePath);
1111

12+
renderer.removePlugin(TypeDoc.Output.AssetsPlugin);
1213
renderer.removePlugin(TypeDoc.Output.JavascriptIndexPlugin);
1314
renderer.removePlugin(TypeDoc.Output.NavigationPlugin);
1415
renderer.removePlugin(TypeDoc.Output.TocPlugin);

bin/typedoc.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2818,6 +2818,10 @@ declare module TypeDoc.Output {
28182818
* source folder to the output directory.
28192819
*/
28202820
class AssetsPlugin extends BasePlugin {
2821+
/**
2822+
* Should the default assets always be copied to the output directory?
2823+
*/
2824+
public copyDefaultAssets: boolean;
28212825
/**
28222826
* Create a new AssetsPlugin instance.
28232827
*

bin/typedoc.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6466,6 +6466,10 @@ var TypeDoc;
64666466
*/
64676467
function AssetsPlugin(renderer) {
64686468
_super.call(this, renderer);
6469+
/**
6470+
* Should the default assets always be copied to the output directory?
6471+
*/
6472+
this.copyDefaultAssets = true;
64696473
renderer.on(Output.Renderer.EVENT_BEGIN, this.onRendererBegin, this);
64706474
}
64716475
/**
@@ -6474,9 +6478,17 @@ var TypeDoc;
64746478
* @param event An event object describing the current render operation.
64756479
*/
64766480
AssetsPlugin.prototype.onRendererBegin = function (event) {
6481+
var fromDefault = Path.join(Output.Renderer.getDefaultTheme(), 'assets');
6482+
var to = Path.join(event.outputDirectory, 'assets');
6483+
6484+
if (this.copyDefaultAssets) {
6485+
FS.copySync(fromDefault, to);
6486+
} else {
6487+
fromDefault = null;
6488+
}
6489+
64776490
var from = Path.join(this.renderer.theme.basePath, 'assets');
6478-
if (FS.existsSync(from)) {
6479-
var to = Path.join(event.outputDirectory, 'assets');
6491+
if (from != fromDefault && FS.existsSync(from)) {
64806492
FS.copySync(from, to);
64816493
}
64826494
};

src/typedoc/output/plugins/AssetsPlugin.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ module TypeDoc.Output
66
*/
77
export class AssetsPlugin extends BasePlugin
88
{
9+
/**
10+
* Should the default assets always be copied to the output directory?
11+
*/
12+
copyDefaultAssets:boolean = true;
13+
14+
915
/**
1016
* Create a new AssetsPlugin instance.
1117
*
@@ -23,9 +29,17 @@ module TypeDoc.Output
2329
* @param event An event object describing the current render operation.
2430
*/
2531
private onRendererBegin(event:OutputEvent) {
32+
var fromDefault = Path.join(Renderer.getDefaultTheme(), 'assets');
33+
var to = Path.join(event.outputDirectory, 'assets');
34+
35+
if (this.copyDefaultAssets) {
36+
FS.copySync(fromDefault, to);
37+
} else {
38+
fromDefault = null;
39+
}
40+
2641
var from = Path.join(this.renderer.theme.basePath, 'assets');
27-
if (FS.existsSync(from)) {
28-
var to = Path.join(event.outputDirectory, 'assets');
42+
if (from != fromDefault && FS.existsSync(from)) {
2943
FS.copySync(from, to);
3044
}
3145
}

0 commit comments

Comments
 (0)