mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-03 12:42:41 +00:00
Improved the view source to include showing html properly
This commit is contained in:
@@ -5,6 +5,10 @@ var Moment = require('moment');
|
|||||||
|
|
||||||
var Logo = require('naturalCrit/logo/logo.jsx');
|
var Logo = require('naturalCrit/logo/logo.jsx');
|
||||||
|
|
||||||
|
var replaceAll = function(str, find, replace) {
|
||||||
|
return str.replace(new RegExp(find, 'g'), replace);
|
||||||
|
}
|
||||||
|
|
||||||
var Statusbar = React.createClass({
|
var Statusbar = React.createClass({
|
||||||
|
|
||||||
getDefaultProps: function() {
|
getDefaultProps: function() {
|
||||||
@@ -36,7 +40,13 @@ var Statusbar = React.createClass({
|
|||||||
|
|
||||||
openSourceWindow : function(){
|
openSourceWindow : function(){
|
||||||
var sourceWindow = window.open();
|
var sourceWindow = window.open();
|
||||||
sourceWindow.document.write('<code><pre>' + this.props.sourceText + '</pre></code>');
|
|
||||||
|
var content = replaceAll(this.props.sourceText, '<', '<');
|
||||||
|
content = replaceAll(content, '>', '>');
|
||||||
|
|
||||||
|
console.log(content);
|
||||||
|
|
||||||
|
sourceWindow.document.write('<code><pre>' + content + '</pre></code>');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user