mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-06 16:32:40 +00:00
match brewRenderer.jsx output to printPage.jsx output
This commit is contained in:
@@ -188,7 +188,6 @@ const BrewRenderer = createClass({
|
|||||||
: null}
|
: null}
|
||||||
|
|
||||||
<Frame initialContent={this.state.initialContent}
|
<Frame initialContent={this.state.initialContent}
|
||||||
head = <link href={`${this.props.renderer == 'legacy' ? '/themes/5ePhbLegacy.style.css' : '/themes/5ePhb.style.css'}`} rel='stylesheet'/>
|
|
||||||
style={{ width: '100%', height: '100%', visibility: this.state.visibility }}
|
style={{ width: '100%', height: '100%', visibility: this.state.visibility }}
|
||||||
contentDidMount={this.frameDidMount}>
|
contentDidMount={this.frameDidMount}>
|
||||||
<div className={'brewRenderer'}
|
<div className={'brewRenderer'}
|
||||||
@@ -200,17 +199,17 @@ const BrewRenderer = createClass({
|
|||||||
<RenderWarnings />
|
<RenderWarnings />
|
||||||
<NotificationPopup />
|
<NotificationPopup />
|
||||||
</div>
|
</div>
|
||||||
|
<link href={`${this.props.renderer == 'legacy' ? '/themes/5ePhbLegacy.style.css' : '/themes/5ePhb.style.css'}`} rel='stylesheet'/>
|
||||||
<div className='pages' ref='pages'>
|
{/* Apply CSS from Style tab and render pages from Markdown tab */}
|
||||||
{/* Apply CSS from Style tab and render pages from Markdown tab */}
|
{this.state.isMounted
|
||||||
{this.state.isMounted
|
&&
|
||||||
&&
|
<>
|
||||||
<>
|
{this.renderStyle()}
|
||||||
{this.renderStyle()}
|
<div className='pages' ref='pages'>
|
||||||
{this.renderPages()}
|
{this.renderPages()}
|
||||||
</>
|
</div>
|
||||||
}
|
</>
|
||||||
</div>
|
}
|
||||||
</div>
|
</div>
|
||||||
</Frame>
|
</Frame>
|
||||||
{this.renderPageInfo()}
|
{this.renderPageInfo()}
|
||||||
|
|||||||
@@ -35,6 +35,11 @@ const PrintPage = createClass({
|
|||||||
if(this.props.query.dialog) window.print();
|
if(this.props.query.dialog) window.print();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
renderStyle : function() {
|
||||||
|
if(!this.props.brew.style) return;
|
||||||
|
return <div style={{ display: 'none' }} dangerouslySetInnerHTML={{ __html: `<style> ${this.props.brew.style} </style>` }} />;
|
||||||
|
},
|
||||||
|
|
||||||
renderPages : function(){
|
renderPages : function(){
|
||||||
if(this.props.brew.renderer == 'legacy') {
|
if(this.props.brew.renderer == 'legacy') {
|
||||||
return _.map(this.state.brewText.split('\\page'), (pageText, index)=>{
|
return _.map(this.state.brewText.split('\\page'), (pageText, index)=>{
|
||||||
@@ -62,8 +67,8 @@ const PrintPage = createClass({
|
|||||||
<Meta name='robots' content='noindex, nofollow' />
|
<Meta name='robots' content='noindex, nofollow' />
|
||||||
<link href={`${this.props.brew.renderer == 'legacy' ? '/themes/5ePhbLegacy.style.css' : '/themes/5ePhb.style.css'}`} rel='stylesheet'/>
|
<link href={`${this.props.brew.renderer == 'legacy' ? '/themes/5ePhbLegacy.style.css' : '/themes/5ePhb.style.css'}`} rel='stylesheet'/>
|
||||||
{/* Apply CSS from Style tab */}
|
{/* Apply CSS from Style tab */}
|
||||||
<div style={{ display: 'none' }} dangerouslySetInnerHTML={{ __html: `<style> ${this.props.brew.style} </style>` }} />
|
{this.renderStyle()}
|
||||||
<div className='pages'>
|
<div className='pages' ref='pages'>
|
||||||
{this.renderPages()}
|
{this.renderPages()}
|
||||||
</div>
|
</div>
|
||||||
</div>;
|
</div>;
|
||||||
|
|||||||
Reference in New Issue
Block a user