Skip to content

Instantly share code, notes, and snippets.

@thachnuida
Created April 23, 2015 08:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thachnuida/3f630678b484d262fb53 to your computer and use it in GitHub Desktop.
Save thachnuida/3f630678b484d262fb53 to your computer and use it in GitHub Desktop.
/**
* @fileOverview
* @author <a href="mailto:ovaraksin@googlemail.com">Oleg Varaksin</a>
* @version 0.2
*/
/**
* Whiteboard designer class for element drawing.
* @class
* @param witeboardConfig whiteboard's configuration {@link WhiteboardConfig}
* @param whiteboardId whiteboard's id
* @param user user (user name) working with this whiteboard
* @param pubSubUrl URL for bidirectional communication
* @param pubSubTransport transport protocol "long-polling" | "streaming" | "websocket"
*/
WhiteboardDesigner = function(witeboardConfig, whiteboardId, user, pubSubUrl, pubSubTransport) {
/**
* Whiteboard's configuration {@link WhiteboardConfig}.
* @public
* @type WhiteboardConfig
*/
this.config = witeboardConfig;
/**
* Whiteboard's id.
* @public
* @type uuid
*/
this.whiteboardId = whiteboardId;
/**
* User which works with this whiteboard.
* @public
* @type string
*/
this.user = user;
/**
* URL for bidirectional communication.
* @public
* @type string
*/
this.pubSubUrl = pubSubUrl;
/**
* Transport protocol "long-polling" | "streaming" | "websocket".
* @public
* @type string
*/
this.pubSubTransport = pubSubTransport;
/**
* Logging flag, true - logging is visible, false - otherwise.
* @public
* @type boolean
*/
this.logging = false;
/**
* Raphael's canvas.
* @private
* @type Raphael's paper
*/
var paper = Raphael(this.config.ids.whiteboard, whiteboard.width(), whiteboard.height());
...
/** Draws image with default properties.
* @public
* @param inputUrl image URL.
* @param width image width.
* @param height image height.
*/
this.drawImage = function(inputUrl, width, height) {
...
}
/** Gets currently selected whiteboard element.
* @public
* @returns {Raphael's element} currently selected element
*/
this.getSelectedObject = function() {
...
}
...
/** Outputs debug messages.
* @private
* @param msg message
*/
var logDebug = function(msg) {
...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment