Git Product home page Git Product logo

ep_comments_page's Introduction

Publish Status Backend Tests Status

Comments and annotations for Etherpad

Screen shot

Installing this plugin with npm.

npm install ep_comments_page

Extra settings

This plugin has some extra features that can be enabled by changing values on settings.json of your Etherpad instance.

Alternative comment display

There is an alternative way to display comments. Instead of having all comments visible on the right of the page, you can have just an icon on the right margin of the page. Comment details are displayed when user clicks on the comment icon:

Screen shot

To use this way of displaying comments, add the following to your settings.json:

// Display comments as icons, not boxes
"ep_comments_page": {
  "displayCommentAsIcon": true
},

Highlight selected text when creating a comment

It is also possible to mark the text originally selected when user adds a comment: Screen shot

To enable this feature, add the following code to your settings.json:

// Highlight selected text when adding comment
"ep_comments_page": {
  "highlightSelectedText": true
},

Warning: there is a side effect when you enable this feature: a revision is created everytime the text is highlighted, resulting on apparently "empty" changes when you check your pad on the timeslider. If that is an issue for you, we don't recommend you to use this feature.

Disable HTML export

By default comments are exported to HTML, but if you don't wish to do that then you can disable it by adding the following to your settings.json:

"ep_comments_page": {
  "exportHtml": false
},

Creating comment via API

If you need to add comments to a pad:

  • Call this route to create the comments on Etherpad and get the comment ids:

    curl -X POST http://localhost:9001/p/THE_PAD_ID/comments -d "apikey=YOUR_API_KEY" -d 'data=[{"name":"AUTHOR","text":"COMMENT"}, {"name":"ANOTHER_AUTHOR","text":"ANOTHER_COMMENT"}]'
    

    The response will be:

    {"code":0,"commentIds":["c-VEtzKolgD5krJOVU","c-B8MEmAT0NJ9usUwc"]}
    
  • Use the returned comment ids to set the pad HTML via API:

    My comment goes <span class="comment c-VEtzKolgD5krJOVU">here<span>.
    

    Result: Screen shot

NOTE: Adding a comment to a pad via API will make the other editors with that pad to be alerted, but this feature is only active if your Etherpad is run in loadTest mode. Read the Etherpad Guide for how to enable load testing.

License

Apache 2

ep_comments_page's People

Contributors

johnmclear avatar rhansen avatar github-actions[bot] avatar ilmartyrk avatar lpagliari avatar joassouza avatar translatewiki avatar jdittrich avatar dependabot[bot] avatar seballot avatar webzwo0i avatar kentonv avatar pr4xx avatar ovari avatar woeterman94 avatar vadimirorlov avatar ldidry avatar automcoding avatar chocobozzz avatar orblivion avatar erikdw1 avatar crablab avatar izendegi avatar tiblu avatar phillal avatar steffan153 avatar henrik-wolf avatar gulaschskanone avatar liuliming2008 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.