You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Julius Härtl b74740e293
Merge pull request #193 from nextcloud/frontend/bump
3 days ago
.github add build instructions to contributing 1 year ago
.tx Fix tx config 1 year ago
appinfo Update version on master 5 days ago
css Adjust element id to avoid conflicts 1 month ago
img add missing images 2 years ago
js Adjust element id to avoid conflicts 1 month ago
l10n [tx-robot] updated from transifex 1 week ago
lib/Controller Show 'could not write to file'-message is writing file failed 1 year ago
tests Update master php testing versions 1 month ago
.drone.yml Bundles are not committed anymore 1 month ago
.gitignore Bump frontend dependencies and remove build files 1 month ago
.scrutinizer.yml Ignore js/vendor/* aswell, not our code 4 years ago
.travis.yml Update master php testing versions 1 month ago
Makefile switch to webpack bundling 1 year ago
README.md update maintainer 1 year ago
babel.config.js Bump frontend dependencies and remove build files 1 month ago
krankerl.toml Add krankerl config 1 month ago
package-lock.json Add missing babel-loader 1 month ago
package.json Add missing babel-loader 1 month ago
webpack.config.js Bump frontend dependencies and remove build files 1 month ago

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: Robin Appelman Past contributors: Thomas Müller Tom Needham 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.