GithubHelp home page GithubHelp logo

Comments (14)

shawnhind avatar shawnhind commented on May 28, 2024

I'm going to take a shot at adding this feature. I'm new to curses so this might take me a bit of time for learning so if anyone else already has curses experience and wants to take care of this just let me know so I don't continue working on it. :)

from rtv.

yskmt avatar yskmt commented on May 28, 2024

Ohh I just started testing/implementing it...
Can I take care of it?
yskmt@77c6d59

from rtv.

shawnhind avatar shawnhind commented on May 28, 2024

Yep no problem.

On Mar 12, 2015, at 18:48, Yusuke Sakamoto [email protected] wrote:

Ohh I just started testing/implementing it...
Can I take care of it?
yskmt/rtv@77c6d59

β€”
Reply to this email directly or view it on GitHub.

from rtv.

yskmt avatar yskmt commented on May 28, 2024

OK I implemented add_comment function. Right now it's only good for a one-line comment, but I am thinking I should create a message box in the middle of screen for commenting. What do you think?
master...yskmt:post-comment

I am also trying to implement add_reply function too. It seems much more difficult because I need to specify the object that I want to reply to.

from rtv.

michael-lazar avatar michael-lazar commented on May 28, 2024

I would also try out splitting the screen in half and using the bottom half for the comment. That way you could get away with just a horizontal bar --------- instead of a full box outline. For add reply, I think you could just select whichever comment the cursor is focused on. Something like

content.get(cursor_position)['object'].add_reply()

Also, don't forget to check if the user is logged in before opening the textbox!

from rtv.

yskmt avatar yskmt commented on May 28, 2024

I added the reply functionality too. Press c on the submission page and you can post some comment or reply to a comment.

There are a lot of rooms for improvements, such as:

  1. Better textbox for editing comment.
  2. Error handling.
  3. Prompt to log in if you are not.
  4. Refresh the page and jump to your comment after you post it.

3 and 4 should be implemented in different functions though.

from rtv.

yskmt avatar yskmt commented on May 28, 2024

The comment box now occupies the bottom half of the terminal. However I found a bug in curses, in which I can only use overwrite-mode for textbox.

The bug has been reported and patch was suggested, but somehow it has never merged to the core Python.
http://bugs.python.org/issue13051

from rtv.

michael-lazar avatar michael-lazar commented on May 28, 2024

curses is just full of fun surprises!

from rtv.

michael-lazar avatar michael-lazar commented on May 28, 2024

Merged in #38

The current textpad has the following limitations:

  1. Can't resize the window while entering text
  2. Can't type characters in insert mode (http://bugs.python.org/issue13051)
  3. Text doesn't scroll up when you reach the end of the textpad.

In the future we may want to look into an alternate solution (not curses) to handle text input for comments.

from rtv.

noahmorrison avatar noahmorrison commented on May 28, 2024

How about using a temporary text file, and them opening it in your default editor ($EDITOR). The same way git does commit messages. This actually sounds decently easy to implement. And would allow the user to enter the text anyway they want.

Just a thought, might look into writing a pull request for it tomorrow. (I'm going to Boston, so it wouldn't be till late).

from rtv.

michael-lazar avatar michael-lazar commented on May 28, 2024

Go for it, I think its a cool idea!

from rtv.

yskmt avatar yskmt commented on May 28, 2024

I actually started writing some module that is intended to replace curses.textpad with more functionality such as page scrolling, loading text, refreshing on resize, etc. It is little buggy right now, but I'll let you know if it works out.
https://github.com/yskmt/texteditpad

from rtv.

michael-lazar avatar michael-lazar commented on May 28, 2024

@yskmt keep me updated on this!

from rtv.

yskmt avatar yskmt commented on May 28, 2024

@michael-lazar I might be late on this matter, but take a look on this pull request #49

from rtv.

Related Issues (20)

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.