https://github.com/owncloud/files_texteditor
https://github.com/owncloud/files_texteditor
owncloud-app
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/owncloud/files_texteditor
- Owner: owncloud
- License: agpl-3.0
- Created: 2014-02-06T15:22:42.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2024-10-17T01:01:55.000Z (over 1 year ago)
- Last Synced: 2025-06-27T21:13:47.180Z (12 months ago)
- Topics: owncloud-app
- Language: JavaScript
- Homepage:
- Size: 5.45 MB
- Stars: 17
- Watchers: 63
- Forks: 25
- Open Issues: 37
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Texteditor
[](https://drone.owncloud.com/owncloud/files_texteditor)
[](https://sonarcloud.io/dashboard?id=owncloud_files_texteditor)
[](https://sonarcloud.io/dashboard?id=owncloud_files_texteditor)
[](https://sonarcloud.io/dashboard?id=owncloud_files_texteditor)
The original text editor app for ownCloud, based on [Ace](http://ace.c9.io/).
Features:
- Syntax highlighting
- Autosave
- Syntax checking
- Responsive design (optimised on mobile and desktop)
## Install
Simply copy the `files_texteditor` folder into the `apps` directory and enable the app within the ownCloud settings.
## Usage
To use the editor, click on a [supported file](https://github.com/owncloud/files_texteditor/blob/master/js/editor.js#L6) within the Files app and the file will be loaded into the editor. Saving is automatic, but can also be triggered manually with `Ctrl+S` or `Cmd+S`.
## Contributors
Maintainer: [Tom Needham](http://github.com/tomneedham)
Past contributors: [Thomas Müller](http://github.com/deepdiver1975) [Robin Appelman](http://github.com/icewind) [Jörn Friedrich Dreyer](http://github.com/butonic) [Vincent Petry](http://github.com/pvince)
Preview apps
------------
Apps can add side-by-side previews to the app for certain file types by using the preview api
```js
OCA.MYApp.Preview = function(){
...
}
OCA.MYApp.Preview.Prototype = {
/**
* Give the app the opportunity to load any resources it needs and prepare for rendering a preview
*/
init: function() {
...
},
/**
* @param {string} the text to create the preview for
* @param {jQuery} the jQuery element to render the preview in
*/
preview: function(text, previewElement) {
...
}
}
OCA.Files_Texteditor.registerPreviewPlugin('text/markdown', new OCA.MYApp.Preview());
```
For styling of the preview, the preview element will have the id `preview` and the className will be set to the mimetype of the file being edited with any slash replaced by dashes.
e.g. when editing a markdown file the preview element can be styled using the `#preview.text-markdown` css query.