mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 23:00:56 +01:00
Remove not used library from api
This commit is contained in:
parent
205377e346
commit
42ff5bc5aa
@ -1,48 +0,0 @@
|
|||||||
# Description
|
|
||||||
|
|
||||||
The Etherpad jQuery Plugin easily allows you to embed and access a pad from Etherpad in a web page. The plugin injects the pad contents into a div using iframes. It can also read the contents of a Pad and write it to a div.
|
|
||||||
|
|
||||||
# Usage & Examples
|
|
||||||
<p>Include jQuery.js, include etherpad.js, assign a pad to a div. If you get confused look at the examples in index.html</p>
|
|
||||||
|
|
||||||
### Sets the pad id and puts the pad in the div
|
|
||||||
`$('#examplePadBasic').pad({'padId':'test'});`
|
|
||||||
<div id="examplePadBasic"></div>
|
|
||||||
|
|
||||||
### Sets the pad id, some more parameters and puts the pad in the div
|
|
||||||
`$('#examplePadBasic').pad({'padId':'test','showChat':true});`
|
|
||||||
<div id="examplePadIntense"></div>
|
|
||||||
|
|
||||||
### Sets the pad id, some plugin parameters and puts the pad in the div
|
|
||||||
`$('#examplePadPlugins').pad({'padId':'test','plugins':{'pageview':'true'}});`
|
|
||||||
<div id="examplePadPlugins"></div>
|
|
||||||
|
|
||||||
### Gets the padContents from Example #2 and writes it to the target div "exampleGetContents"
|
|
||||||
`$('#examplePadBasic').pad({'getContents':'exampleGetContents'});`
|
|
||||||
|
|
||||||
# Available options and parameters
|
|
||||||
<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
|
|
||||||
'noColors' : false, // Disable background colors on author text
|
|
||||||
'userColor' : false, // The background color of this authors text in hex format IE #000
|
|
||||||
'hideQRCode' : false, // Hide QR code
|
|
||||||
'alwaysShowChat' : false, // Always show the chat on the UI
|
|
||||||
'width' : 100, // The width of the embedded IFrame
|
|
||||||
'height' : 100, // The height of the embedded IFrame
|
|
||||||
'border' : 0, // The width of the border (make sure to append px to a numerical value)
|
|
||||||
'borderStyle' : 'solid', // The CSS style of the border [none, dotted, dashed, solid, double, groove, ridge, inset, outset]
|
|
||||||
'plugins' : {}, // The options related to the plugins, not to the basic Etherpad configuration
|
|
||||||
'rtl' : false // Show text from right to left
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
# Copyright
|
|
||||||
jQuery Etherpad plugin written by John McLear (c) Primary Technology 2011<br/>
|
|
||||||
Development funded by the Etherpad Foundation.
|
|
||||||
Feel free to re-use, distribute, butcher, edit and whatever else you want.
|
|
||||||
It's under the Apache licence.
|
|
@ -1,25 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "etherpad",
|
|
||||||
"title": "jQuery Etherpad",
|
|
||||||
"description": "jQuery plugin for embedding Etherpad",
|
|
||||||
"keywords": [
|
|
||||||
"color",
|
|
||||||
"animation"
|
|
||||||
],
|
|
||||||
"version": "1.0.2",
|
|
||||||
"author": {
|
|
||||||
"name": "John McLear",
|
|
||||||
"url": "https://github.com/ether/etherpad-lite-jquery-plugin"
|
|
||||||
},
|
|
||||||
"licenses": [
|
|
||||||
{
|
|
||||||
"type": "Apache 2",
|
|
||||||
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"bugs": "https://github.com/ether/etherpad-lite-jquery-plugin/issues/",
|
|
||||||
"homepage": "https://github.com/ether/etherpad-lite-jquery-plugin",
|
|
||||||
"dependencies": {
|
|
||||||
"jquery": ">=1.5"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,67 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
<title>Etherpad jQuery Plugin Example</title>
|
|
||||||
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></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':'test2','showChat':'true'});</pre>
|
|
||||||
<div id="examplePadIntense"></div>
|
|
||||||
|
|
||||||
<h2>Example #3: Sets the pad id, some plugin parameters and puts the pad in the div</h2>
|
|
||||||
<pre>$('#examplePadPlugins').pad({'padId':'test3','plugins':{'pageview':'true'}});</pre>
|
|
||||||
<div id="examplePadPlugins"></div>
|
|
||||||
|
|
||||||
<h2>Example #4: 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
|
|
||||||
'noColors' : false, // Disable background colors on author text
|
|
||||||
'userColor' : false, // The background color of this authors text in hex format IE #000
|
|
||||||
'hideQRCode' : false, // Hide QR code
|
|
||||||
'alwaysShowChat' : false, // Always show the chat on the UI
|
|
||||||
'width' : 100, // The width of the embedded IFrame
|
|
||||||
'height' : 100, // The height of the embedded IFrame
|
|
||||||
'border' : 0, // The width of the border (make sure to append px to a numerical value)
|
|
||||||
'borderStyle' : 'solid' // The CSS style of the border [none, dotted, dashed, solid, double, groove, ridge, inset, outset]
|
|
||||||
'plugins' : {}, // The options related to the plugins, not to the basic Etherpad configuration
|
|
||||||
'rtl' : false // Show right to left text
|
|
||||||
</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
|
|
||||||
|
|
||||||
// An example with plugin parameters
|
|
||||||
$('#examplePadPlugins').pad({'padId':'test3','plugins':{'pageview':'true'}}); // sets the pad id, some plugin parameters, and puts the pad in the div
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<h3>If you are confused, view the source code for examples</h3>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
113
api/js/jquery/etherpad/js/etherpad.js
vendored
113
api/js/jquery/etherpad/js/etherpad.js
vendored
@ -1,113 +0,0 @@
|
|||||||
(function( $ ){
|
|
||||||
|
|
||||||
$.fn.pad = function( options ) {
|
|
||||||
var settings = {
|
|
||||||
'host' : 'http://localhost:9001',
|
|
||||||
'baseUrl' : '/p/',
|
|
||||||
'showControls' : false,
|
|
||||||
'showChat' : false,
|
|
||||||
'showLineNumbers' : false,
|
|
||||||
'userName' : 'unnamed',
|
|
||||||
'lang' : '',
|
|
||||||
'useMonospaceFont' : false,
|
|
||||||
'noColors' : false,
|
|
||||||
'userColor' : false,
|
|
||||||
'hideQRCode' : false,
|
|
||||||
'alwaysShowChat' : false,
|
|
||||||
'width' : 100,
|
|
||||||
'height' : 100,
|
|
||||||
'border' : 0,
|
|
||||||
'borderStyle' : 'solid',
|
|
||||||
'toggleTextOn' : 'Disable Rich-text',
|
|
||||||
'toggleTextOff' : 'Enable Rich-text',
|
|
||||||
'plugins' : {},
|
|
||||||
'rtl' : false
|
|
||||||
};
|
|
||||||
|
|
||||||
var $self = this;
|
|
||||||
if (!$self.length) return;
|
|
||||||
if (!$self.attr('id')) throw new Error('No "id" attribute');
|
|
||||||
|
|
||||||
var useValue = $self[0].tagName.toLowerCase() == 'textarea';
|
|
||||||
var selfId = $self.attr('id');
|
|
||||||
var epframeId = 'epframe'+ selfId;
|
|
||||||
// This writes a new frame if required
|
|
||||||
if ( !options.getContents ) {
|
|
||||||
if ( options ) {
|
|
||||||
$.extend( settings, options );
|
|
||||||
}
|
|
||||||
|
|
||||||
var pluginParams = '';
|
|
||||||
for(var option in settings.plugins) {
|
|
||||||
pluginParams += '&' + option + '=' + settings.plugins[option]
|
|
||||||
}
|
|
||||||
|
|
||||||
var iFrameLink = '<iframe id="'+epframeId;
|
|
||||||
iFrameLink = iFrameLink +'" name="' + epframeId;
|
|
||||||
iFrameLink = iFrameLink +'" src="' + settings.host+settings.baseUrl+settings.padId;
|
|
||||||
iFrameLink = iFrameLink + '?showControls=' + settings.showControls;
|
|
||||||
iFrameLink = iFrameLink + '&showChat=' + settings.showChat;
|
|
||||||
iFrameLink = iFrameLink + '&showLineNumbers=' + settings.showLineNumbers;
|
|
||||||
iFrameLink = iFrameLink + '&useMonospaceFont=' + settings.useMonospaceFont;
|
|
||||||
iFrameLink = iFrameLink + '&userName=' + settings.userName;
|
|
||||||
if (settings.lang) {
|
|
||||||
iFrameLink = iFrameLink + '&lang=' + settings.lang;
|
|
||||||
}
|
|
||||||
iFrameLink = iFrameLink + '&noColors=' + settings.noColors;
|
|
||||||
iFrameLink = iFrameLink + '&userColor=' + settings.userColor;
|
|
||||||
iFrameLink = iFrameLink + '&hideQRCode=' + settings.hideQRCode;
|
|
||||||
iFrameLink = iFrameLink + '&alwaysShowChat=' + settings.alwaysShowChat;
|
|
||||||
iFrameLink = iFrameLink + '&rtl=' + settings.rtl;
|
|
||||||
iFrameLink = iFrameLink + pluginParams;
|
|
||||||
iFrameLink = iFrameLink +'" style="border:' + settings.border;
|
|
||||||
iFrameLink = iFrameLink +'; border-style:' + settings.borderStyle;
|
|
||||||
iFrameLink = iFrameLink +';" width="' + '100%';//settings.width;
|
|
||||||
iFrameLink = iFrameLink +'" height="' + settings.height;
|
|
||||||
iFrameLink = iFrameLink +'"></iframe>';
|
|
||||||
|
|
||||||
|
|
||||||
var $iFrameLink = $(iFrameLink);
|
|
||||||
|
|
||||||
if (useValue) {
|
|
||||||
var $toggleLink = $('<a href="#'+ selfId +'">'+ settings.toggleTextOn +'</a>').click(function(){
|
|
||||||
var $this = $(this);
|
|
||||||
$this.toggleClass('active');
|
|
||||||
if ($this.hasClass('active')) $this.text(settings.toggleTextOff);
|
|
||||||
$self.pad({getContents: true});
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
$self
|
|
||||||
.hide()
|
|
||||||
.after($toggleLink)
|
|
||||||
.after($iFrameLink)
|
|
||||||
;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$self.html(iFrameLink);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// This reads the etherpad contents if required
|
|
||||||
else {
|
|
||||||
var frameUrl = $('#'+ epframeId).attr('src').split('?')[0];
|
|
||||||
var contentsUrl = frameUrl + "/export/html";
|
|
||||||
var target = $('#'+ options.getContents);
|
|
||||||
|
|
||||||
// perform an ajax call on contentsUrl and write it to the parent
|
|
||||||
$.get(contentsUrl, function(data) {
|
|
||||||
|
|
||||||
if (target.is(':input')) {
|
|
||||||
target.val(data).show();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
target.html(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
$('#'+ epframeId).remove();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return $self;
|
|
||||||
};
|
|
||||||
})( jQuery );
|
|
Loading…
Reference in New Issue
Block a user