Coder Social home page Coder Social logo

Comments (11)

laderast avatar laderast commented on June 12, 2024 1

@elinw I'm going to see if I can help with this. I'm learning ShinyJS, and this seems to be a good reason to work on this.

from qcoder.

elinw avatar elinw commented on June 12, 2024 1

from qcoder.

laderast avatar laderast commented on June 12, 2024 1

Aha! Got it to work: https://tladeras.shinyapps.io/add_code_test/

I was using useShinyjs() in the wrong place. Focus now is on the end of the selection.

Ok, I'll work on adding it in this week. I'm just trying to figure out whether the docs() reactive is going to have issues when I add this.

from qcoder.

elinw avatar elinw commented on June 12, 2024

https://github.com/ajaxorg/ace/blob/v1.1.9/lib/ace/mode/behaviour/cstyle.js#L79 shows the JS pattern needed.

from qcoder.

laderast avatar laderast commented on June 12, 2024

I've put up a simple test app here that shows a way of doing text replacement to include qcodes: https://tladeras.shinyapps.io/add_code_test/ - I just wanted to get some feedback before I implement it in the main qcode shiny app.

You can select some text, and then select codes to add, and it will insert the appropriate QCODE tags.

Sorry for the delay - I ended up submitting a code fix for the shinyAce so that the selection code would work, and I'm still a little new to understanding javascript.

from qcoder.

elinw avatar elinw commented on June 12, 2024

Cool! Taking a look at it now.

from qcoder.

elinw avatar elinw commented on June 12, 2024

I really like the way that works, very clean and smooth. @dsholler @bduckles @learithe Please check this out!

from qcoder.

laderast avatar laderast commented on June 12, 2024

@elinw Thanks! I'll add this functionality to the main qcoder app.

I am trying to figure out how to place the cursor after someone selects and tags something. Supposedly, there is a focus() method for the Ace editor which does this, but I can't seem to get it to work.

from qcoder.

bduckles avatar bduckles commented on June 12, 2024

Very cool @laderast! Looks awesome and it really does improve the functionality. Thank you for adding to this project. I so appreciate it.

I wonder if @kylehamilton might have some insights or resources to share on this Shiny problem.

from qcoder.

elinw avatar elinw commented on June 12, 2024

I think focus should probably should go after the close of the tag. I feel like that would be the most logical /natural place for someone coding to want to be.

from qcoder.

elinw avatar elinw commented on June 12, 2024

Done!

from qcoder.

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.