I'm following the instruction from here to create a firepad editor.
my code is:
function init() {
var firepadRef = getExampleRef();
var codeMirror = CodeMirror(document.getElementById('firepad-container'), {
lineWrapping: true
});
var firepad = Firepad.fromCodeMirror(firepadRef, codeMirror, {
richTextToolbar: true,
richTextShortcuts: true
});
firepad.on('ready', function() {
if (firepad.isHistoryEmpty()) {
firepad.setHtml('<span style="font-size: 24px;">Rich-text editing with <span style="color: red">Firepad!</span></span><br/><br/>Collaborative-editing made easy.\n');
}
});
}
function getExampleRef() {
var ref = new Firebase('https://firepad.firebaseio-demo.com');
var hash = window.location.hash.replace(/#/g, '');
if (hash) {
ref = ref.child(hash);
} else {
ref = ref.push();
window.location = window.location + '#' + ref.key(); // add it as a hash to the URL.
}
return ref;
}
init();
<script src="https://cdn.firebase.com/js/client/2.2.4/firebase.js"></script>
<!-- CodeMirror -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.2.0/codemirror.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.2.0/codemirror.css" />
<!-- Firepad -->
<link rel="stylesheet" href="https://cdn.firebase.com/libs/firepad/1.2.0/firepad.css" />
<script src="https://cdn.firebase.com/libs/firepad/1.2.0/firepad.min.js"></script>
<div class="page-content">
<div id="firepad-container">
</div>
</div>
The problem is i got the button for option as shown in the figure.
but the text field is not coming, even i mention the correct id
. The original will be like this.
what i'm doing wrong. is there any other text editor available to work with?
Here is an example of firebase pad:
Edit: If you are putting the
firepad-container
within another div then set a height to that div to avoidheight:0px;
(and hence text-area being hidden)Refer : Firepad example