Π·Π΅Ρ€ΠΊΠ°Π»ΠΎ ΠΈΠ·
1
0
Π€ΠΎΡ€ΠΊΠ½ΡƒΡ‚ΡŒ 0
πŸ“„ Text editor for plaintext files
ΠŸΠ΅Ρ€Π΅ΠΉΡ‚ΠΈ ΠΊ Ρ„Π°ΠΉΠ»Ρƒ
Morris Jobke 2b4bca75c4 Update to 11
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2016-11-30 17:37:35 +01:00
appinfo Update to 11 2016-11-30 17:37:35 +01:00
controller Display the error message when one was given 2015-12-10 09:18:56 +01:00
css Dont hide main navigation when showing a preview 2015-12-05 14:30:28 +01:00
img add viewBox to app icon for proper scaling in firefox 2016-08-17 18:07:25 +02:00
js Fix phpstorm complains 2016-08-30 13:36:42 +02:00
l10n [tx-robot] updated from transifex 2016-04-01 02:11:52 -04:00
tests Fix the whitelist stuff 2015-12-10 09:26:54 +01:00
.drone.yml Add signed-off-checker 2016-09-27 00:48:51 +02:00
.gitignore Fix the whitelist stuff 2015-12-10 09:26:54 +01:00
.scrutinizer.yml
…
.travis.yml Remove 5.4 and 5.5 support 2016-08-31 13:51:29 +02:00
CONTRIBUTING.md
…
README.md Add branding 2016-07-21 01:09:52 +02:00

README.md

Texteditor

Build Status Scrutinizer Code Quality Code Coverage

The original text editor app for Nextcloud, based on Ace.

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 Nextcloud settings.

Usage

To use the editer, click on a supported file 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 Past contributors: Thomas MΓΌller Robin Appelman JΓΆrn Friedrich Dreyer Vincent Petry

Preview apps

Apps can add side-by-side previews to the app for certain file types by using the preview api


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 eddited 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.