[About OOPStudios.com]

The DCODR Page

Convert HTML to DCODE and even intercept "CTRL+C" events

DCODR is a cool javascript lib that converts (X)HTML to DCODE format and can even intercept "CTRL+C" events.

The "CTRL+C" events thinger allows your visitors to copy your pages content in the usual manner (select and hit CTRL+C) but instead of pasting plain text, they paste fully formatted DCODE text!


Select me, I'm sexy

Try selecting a big chunk of this page and hitting CTRL+C, when you paste (into the handy <textarea> below) you will paste DCODE formatted text!

Here's a few of the features of DCODR

  • It parses into well formed DCODE tags
  • DCODR can even intercept CTRL+C commands and automaticaly format the user selection.
  • It works on all modern browsers
  • It can handle all manner of mad characters like: < > " ¡ ¢ £ ¤ ¥ ¦ § ¨ ©

Some of the reasons for writing DCODR

  1. I want DCODE to be the best Light-Markup around
  2. I'd love to use DCODR on my regular forums
  3. The ubiquity project inspired me to create DCODR

Finally

You can paste your findings into here to see the result!

Pretty swanky eh? Note that it degrades into regular copy paste functionality, and works on most modern browsers. Check the compatibility table below for more.


Basic Integration

...is very straightforward. Assuming you have uploaded the kit somewhere to your server, you simply need to include the DCODR Javascript file like so:

<script type="text/javascript" src="/dcode/dcodr.js"></script>

Bunnggg! You're done!


I don't want the CTRL+C action

This feature can be turned off by adding a parameter to the src atrribute of the script tag. The parameter is:

  • nocopyevents

For example

<script type="text/javascript" src="/dcode/dcodr.js?nocopyevents"></script>

Using the converter directly

If you want to use the parser directly in your own Javascript project, the function you want is DCODR.formatHTML (html [, fixIE] ) which will return nice clean DCODE formatted text.

Note: that the second parameter, fixIE, defaults to false, and should be set to true whenever dealing with ranges or innerHTML for this reason.

[about OOPStudios]