Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

51 lines (40 sloc) 2.234 kb
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Etherpad jQuery Plugin Example</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script src="js/etherpad.js"></script>
</head>
<body id="home">
<h1>Etherpad jQuery Plugin Example</h1>
<h2>Usage:</h2>
<p>Include jQuery.js, include etherpad.js</p>
<h2>Example #1: Sets the pad id and puts the pad in the div</h2>
<pre>$('#examplePadBasic').pad({'padId':'test'});</pre>
<div id="examplePadBasic"></div>
<h2>Example #2: Sets the pad id, some more parameters and puts the pad in the div</h2>
<pre>$('#examplePadIntense').pad({'padId':'test','showChat':'true'});</pre>
<div id="examplePadIntense"></div>
<h2>Example #3: Gets the padContents from Example #2</h2>
<pre>$('#examplePadIntense').pad({'getContents':'exampleGetContents'});</pre>
<div id="exampleGetContents"><a id="contents" onClick="$('#examplePadIntense').pad({'getContents':'exampleGetContents'});">Click me to Replace me with the pad contents</a></div>
<h2>Available options and parameters</h2>
<pre>
'host' : 'http://beta.etherpad.org', // the host and port of the Etherpad instance, by default the foundation will host your pads for you
'baseUrl' : '/p/', // The base URL of the pads
'showControls' : false, // If you want to show controls IE bold, italic etc.
'showChat' : false, // If you want to show the chat button or not
'showLineNumbers' : false, // If you want to show the line numbers or not
'userName' : 'unnamed', // The username you want to pass to the pad.
'useMonospaceFont' : false // Use monospaced fonts
</pre>
<script type="text/javascript">
// The most basic example
$('#examplePadBasic').pad({'padId':'test'}); // sets the pad id and puts the pad in the div
// A slightly more intense example
$('#examplePadIntense').pad({'padId':'test2','showChat':'true'}); // sets the pad id and puts the pad in the div
</script>
<h3>If you are confused, view the source code for examples</h3>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.