Fix JSDoc.

This commit is contained in:
Michael Jumper
2012-12-01 20:57:59 -08:00
parent 4efc08e8ef
commit 0b88c48038
4 changed files with 76 additions and 7 deletions

View File

@@ -55,6 +55,7 @@ Guacamole.AudioChannel = function() {
/**
* When the next packet should play.
* @private
*/
var next_packet_time = 0;
@@ -92,6 +93,14 @@ if (window.webkitAudioContext) {
Guacamole.AudioChannel.context = new webkitAudioContext();
}
/**
* Returns a base timestamp which can be used for scheduling future audio
* playback. Scheduling playback for the value returned by this function plus
* N will cause the associated audio to be played back N milliseconds after
* the function is called.
*
* @return {Number} An arbitrary channel-relative timestamp, in milliseconds.
*/
Guacamole.AudioChannel.getTimestamp = function() {
// If we have an audio context, use its timestamp
@@ -124,6 +133,15 @@ Guacamole.AudioChannel.getTimestamp = function() {
*/
Guacamole.AudioChannel.Packet = function(mimetype, data) {
/**
* Schedules this packet for playback at the given time.
*
* @function
* @param {Number} when The time this packet should be played, in
* milliseconds.
*/
this.play = undefined; // Defined conditionally depending on support
// If audio API available, use it.
if (Guacamole.AudioChannel.context) {
@@ -160,6 +178,7 @@ Guacamole.AudioChannel.Packet = function(mimetype, data) {
source.noteOn(play_when / 1000);
}
/** @ignore */
this.play = function(when) {
play_when = when;
@@ -185,9 +204,7 @@ Guacamole.AudioChannel.Packet = function(mimetype, data) {
var audio = new Audio();
audio.src = data_uri;
/**
* Plays the sound data contained by this packet immediately.
*/
/** @ignore */
this.play = function(when) {
// Calculate time until play

View File

@@ -61,7 +61,7 @@ Guacamole.Parser = function() {
* element is available. After a full element is available, that element
* is flushed into the element buffer.
*
* @priate
* @private
*/
var buffer = "";
@@ -69,7 +69,7 @@ Guacamole.Parser = function() {
* Buffer of all received, complete elements. After an entire instruction
* is read, this buffer is flushed, and a new instruction begins.
*
* @priate
* @private
*/
var element_buffer = [];
@@ -79,6 +79,13 @@ Guacamole.Parser = function() {
// Where to start the next length search or the next element
var start_index = 0;
/**
* Appends the given instruction data packet to the internal buffer of
* this Guacamole.Parser, executing all completed instructions at
* the beginning of this buffer, if any.
*
* @param {String} packet The instruction data to append.
*/
this.receive = function(packet) {
// Truncate buffer as necessary
@@ -1096,6 +1103,9 @@ Guacamole.Client = function(tunnel) {
};
/**
* Sends a disconnect instruction to the server and closes the tunnel.
*/
this.disconnect = function() {
// Only attempt disconnection not disconnected.
@@ -1117,6 +1127,13 @@ Guacamole.Client = function(tunnel) {
};
/**
* Connects the underlying tunnel of this Guacamole.Client, passing the
* given arbitrary data to the tunnel during the connection process.
*
* @param data Arbitrary connection data to be sent to the underlying
* tunnel during the connection process.
*/
this.connect = function(data) {
setState(STATE_CONNECTING);
@@ -1137,6 +1154,14 @@ Guacamole.Client = function(tunnel) {
setState(STATE_WAITING);
};
/**
* Sets the scale of the client display element such that it renders at
* a relatively smaller or larger size, without affecting the true
* resolution of the display.
*
* @param {Number} scale The scale to resize to, where 1.0 is normal
* size (1:1 scale).
*/
this.scale = function(scale) {
display.style.transform =
@@ -1155,14 +1180,29 @@ Guacamole.Client = function(tunnel) {
};
/**
* Returns the width of the display.
*
* @return {Number} The width of the display.
*/
this.getWidth = function() {
return displayWidth;
};
/**
* Returns the height of the display.
*
* @return {Number} The height of the display.
*/
this.getHeight = function() {
return displayHeight;
};
/**
* Returns the scale of the display.
*
* @return {Number} The scale of the display.
*/
this.getScale = function() {
return displayScale;
};
@@ -1170,6 +1210,9 @@ Guacamole.Client = function(tunnel) {
/**
* Returns a canvas element containing the entire display, with all child
* layers composited within.
*
* @return {HTMLCanvasElement} A new canvas element containing a copy of
* the display.
*/
this.flatten = function() {
@@ -1248,7 +1291,8 @@ Guacamole.Client.LayerContainer = function(width, height) {
/**
* Returns the Layer contained within this LayerContainer.
* @returns {Guacamole.Layer} The Layer contained within this LayerContainer.
* @returns {Guacamole.Layer} The Layer contained within this
* LayerContainer.
*/
this.getLayer = function() {
return layer;
@@ -1256,7 +1300,8 @@ Guacamole.Client.LayerContainer = function(width, height) {
/**
* Returns the element containing the Layer within this LayerContainer.
* @returns {Element} The element containing the Layer within this LayerContainer.
* @returns {Element} The element containing the Layer within this
* LayerContainer.
*/
this.getElement = function() {
return div;

View File

@@ -215,6 +215,7 @@ Guacamole.Keyboard = function(element) {
/**
* All keysyms which should not repeat when held down.
* @private
*/
var no_repeat = {
0xFFE1: true,
@@ -253,17 +254,20 @@ Guacamole.Keyboard = function(element) {
/**
* The keysym associated with a given keycode when keydown fired.
* @private
*/
var keydownChar = [];
/**
* Timeout before key repeat starts.
* @private
*/
var key_repeat_timeout = null;
/**
* Interval which presses and releases the last key pressed while that
* key is still being held down.
* @private
*/
var key_repeat_interval = null;
@@ -332,6 +336,7 @@ Guacamole.Keyboard = function(element) {
* Marks a key as pressed, firing the keydown event if registered. Key
* repeat for the pressed key will start after a delay if that key is
* not a modifier.
* @private
*/
function press_key(keysym) {
@@ -369,6 +374,7 @@ Guacamole.Keyboard = function(element) {
/**
* Marks a key as released, firing the keyup event if registered.
* @private
*/
function release_key(keysym) {

View File

@@ -436,6 +436,7 @@ Guacamole.HTTPTunnel = function(tunnelURL) {
/**
* Arbitrary integer, unique for each tunnel read request.
* @private
*/
var request_id = 0;