Comments (2)
I had a PR that didn't get merged a while back for code snippets: #29. The branch no longer exists. However, the diffs are still available and could be used to implement the functionality.
Squire has the functionality to display images. However to upload them you would want to integrate your UI with a library like http://fineuploader.com/, http://www.dropzonejs.com/, or ProgerXP/FileDrop.
from squire.
Uploading images is left to the integration (and how you handle this will depend on what you are building; you may need to upload them to your server, and then get back a URL, or you might just want to insert base64). Once you have a URL, you can use the insertImage method to insert it into Squire. This returns a reference to the returned image, so you can also generate a preview from the local file first, then upload it, then update the src with the uploaded one. It all depends on your requirements really.
Inserting code snippets again depends on what you want. If you want to be able to edit them in a code mirror like environment (with syntax highlighting, code-completion etc.), this will require some complicated custom integration. Otherwise, you can just use the insertElement method to insert a <pre><code>
block with the code in it.
from squire.
Related Issues (20)
- Functionality to "flatten" HTML into plaintext suitable data HOT 1
- Why does _mergeInlines() only happen on _removeFormat()? HOT 2
- sanitizeToDOMFragment incorrectly documented?
- Can't paste image from clipboard into demo HOT 3
- linkifyText throws a DOMException if a link is inserted inside a text node HOT 1
- fixContainer ignores config HOT 1
- Please include types in the release. HOT 1
- Attempt to wrap in iframe is failing HOT 4
- Setting linkRegExp to null breaks insertHTML HOT 1
- Blockmodification always inserts br after block HOT 4
- execCommand not needed in Firefox. HOT 1
- copy event handler produces more newlines than the user typed for "text/plain" HOT 2
- Invalid `setKeyHandler` `key` parameter type HOT 2
- Undo/ Redo does not reset the cursor position HOT 6
- Moving the editor causes a partial breakage of functionality HOT 3
- User controlled markup vs programatically generated markup HOT 1
- Regarding inline text formatting
- The purpose of the `while` loop in the `fixCursor` function is unclear
- Lists are not created automatically on Chrome Android
- Cursor position bug after link('a' element) paste in Firefox
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from squire.