开发者

How to develop a webapp which allows the user to add markup to text files?

I need to develop a simple webapp that allows the user to highlight a couple of words in the file (text or HTML) that he can load from the screen, and then right-click and have some options show up to choose from.

When she chooses the option , the text of it is added to the file shown on the screen,right after the highlighted text, inside some parenthesis or similar.

Is Ruby on Rails a suitable platform for developing such an app?

Is Grails more suitable ? (Assuming similar level of knowledge in Groovy and Ruby)

In both cases, I'd ap开发者_运维知识库preciate pointers to gems/libraries I should be looking into for these tasks.

Thanks!


I'm not 100% sure I understand your requirements, but have you considered integrating a WYSIWYG (what-you-see-is-what-you-get) editor into your web app? Something like CKeditor is open-source, and effective.

You could load the file into the editor and setup a custom context menu like described in part 6 of this tutorial. So when the user right clicks in the editor, the custom context menu item could be configured to facilitate the insertion you are looking to accomplish.

I agree with corroded's advice to choose a language/framework you know and can work better in, as you'll be able to achieve your desired functionality through a variety of languages/frameworks.

Best of Luck!


Find a language/framework you know and can work better in. Also, you're gonna need some javascript magicks so I suggest using jquery. Here's a link on how to do your right click action: How to distinguish between left and right mouse click with jQuery


I think the function you describe is more about client user-friendliness than server processing. I think it's can only be done with javascript/jQuery or similar tools.

Same as tmarsden, I think a good way to do that is integrating a WYSIWYG free editor. I have done it before with TinyMCE, by writing a custom plugin for this tool. If you choose using Grails as server technology, you can take a look at TinyMCE plugin for Grails.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜