Jump to content

Mark a text part on a html page and get a txt to quote in BBC-codes


Johann

Recommended Posts

Dear W3Schools supporters and W3S friends, just had the thought, that it would be great to provide the service on ones websites to mark a text passage "push" a button and get a pop up with a translation in BBC-code format (a little similar like the code BBC) where you can easy copy the part (including a reference to the origin page and post it in php or SMF forums). Not sure if I put it into the right section here, so sorry if not. Does anybody have an idea or even a solution? Reasons for it are:* to be able to make "quick" and nice posts with good references, inks and pics (for the user)* to provide a standard people should quote your site (incl. copyrights) (for the provider) Not to speak about forum owner, who would get right of remembering user to put references to get no copyright troubles. Maybe it's more about an add on the browser side. Not sure it it is useful manageable on the website it self. Currently I do such manual via the generously provided solution here: http://www.seabreezecomputers.com/html2bbcode/ sadhu_sangham_sw.gif

Link to comment
Share on other sites

It's just a lot of replacements, probably using regular expressions. The page you linked to has a table on the bottom that lists what they convert, you would probably do replacements similar to those. If you want a Javascript solution then you can add a link or button to any element to run a function, and the function could get the innerHTML of the button's parent node, remove the button itself, and convert everything else using regular expressions then display that in your popup.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...