
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Firepad is an open-source, collaborative code and text editor. It is designed to be embedded inside larger web applications.
Join our Firebase Google Group to ask questions, request features, or share your Firepad apps with the community.
Firepad requires Firebase in order to sync and store data. Firebase is a suite of integrated products designed to help you develop your app, grow your user base, and earn money. You can sign up here for a free account.
Visit firepad.io to see a live demo of Firepad in rich text mode, or the examples page to see it setup for collaborative code editing.
Firepad uses Firebase as a backend, so it requires no server-side code. It can be added to any web app by including a few JavaScript files:
<head>
<!-- Firebase -->
<script src="https://www.gstatic.com/firebasejs/5.5.4/firebase.js"></script>
<!-- CodeMirror -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.17.0/codemirror.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.17.0/codemirror.css"/>
<!-- Firepad -->
<link rel="stylesheet" href="https://cdn.firebase.com/libs/firepad/1.5.3/firepad.css" />
<script src="https://cdn.firebase.com/libs/firepad/1.5.3/firepad.min.js"></script>
</head>
Then, you need to initialize the Firebase SDK and Firepad:
<body onload="init()">
<div id="firepad"></div>
<script>
function init() {
// Initialize the Firebase SDK.
firebase.initializeApp({
apiKey: '<API_KEY>',
databaseURL: 'https://<DATABASE_NAME>.firebaseio.com'
});
// Get Firebase Database reference.
var firepadRef = firebase.database().ref();
// Create CodeMirror (with lineWrapping on).
var codeMirror = CodeMirror(document.getElementById('firepad'), { lineWrapping: true });
// Create Firepad (with rich text toolbar and shortcuts enabled).
var firepad = Firepad.fromCodeMirror(firepadRef, codeMirror,
{ richTextShortcuts: true, richTextToolbar: true, defaultText: 'Hello, World!' });
}
</script>
</body>
Firepad supports rich text editing with CodeMirror and code editing via Ace. Check out the detailed setup instructions at firepad.io/docs.
You can find some Firepad examples here.
If you'd like to contribute to Firepad, please first read through our contribution guidelines. Local setup instructions are available here.
Here are some highlights of the directory structure and notable source files:
dist/
- output directory for all files generated by grunt (firepad.js
, firepad.min.js
, firepad.css
, firepad.eot
).examples/
- examples of embedding Firepad.font/
- icon font used for rich text toolbar.lib/
firepad.js
- Entry point for Firepad.text-operation.js
, client.js
- Heart of the Operation Transformation implementation. Based on
ot.js but extended to allow arbitrary
attributes on text (for representing rich-text).annotation-list.js
- A data model for representing annotations on text (i.e. spans of text with a particular
set of attributes).rich-text-codemirror.js
- Uses AnnotationList
to track annotations on the text and maintain the appropriate
set of markers on a CodeMirror instance.firebase-adapter.js
- Handles integration with Firebase (appending operations, triggering retries,
presence, etc.).test/
- Jasmine tests for Firepad (many of these were borrowed from ot.js).FAQs
Collaborative text editing powered by Firebase
The npm package firepad-x receives a total of 10 weekly downloads. As such, firepad-x popularity was classified as not popular.
We found that firepad-x demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.