JSDoc cleanups and dead code removal

* Removed some unused variables and methods
* Removed redundant variable initialisation
* cursorNode in OdtCursor and Cursor is always set to a valid DOM element. Updated jsdoc accordingly
* Ignore WebStorm project-related files
This commit is contained in:
Philip Peitsch
2013-04-09 12:07:56 +10:00
parent 259b203d21
commit 1ecc0ec1f9
6 changed files with 8 additions and 15 deletions
+1
View File
@@ -15,3 +15,4 @@ programs/ios/www/webodf.js
webodf/webodf.css.js
build
*.sw?
.idea
-1
View File
@@ -66,7 +66,6 @@ define("webodf/editor/Editor", [
userList,
networked = args.networked === true,
opRouter,
sessionid,
userModel,
saveOdtFile = args.saveCallback,
documentUrl;
+1 -1
View File
@@ -369,9 +369,9 @@ define("webodf/editor/EditorSession", [
*/
this.getDeclaredFonts = function () {
var fontMap = formatting.getFontMap(),
sortedNames = [],
usedFamilies = [],
array = [],
sortedNames,
key,
value,
i;
+1 -5
View File
@@ -47,11 +47,6 @@ runtime.loadClass("ops.OdtCursor");
*/
gui.Caret = function Caret(cursor, avatarInitiallyVisible) {
"use strict";
function clearNode(node) {
while (node.firstChild !== null) {
node.removeNode(node.firstChild);
}
}
var self = this,
span,
avatar,
@@ -222,6 +217,7 @@ gui.Caret = function Caret(cursor, avatarInitiallyVisible) {
* without any scrolling
* @param {!Element} caretElement
* @param {?Element} containerElement
* @param {!number} margin
* @return {!{left:!number,top:!number,right:!number,bottom:!number}}
*/
function getRelativeCaretOffsetRect(caretElement, containerElement, margin) {
+3 -5
View File
@@ -73,16 +73,14 @@ gui.SessionView = (function () {
}
/**
* @constructor
* @constructor
* @param {gui.SessionViewOptions} viewOptions
* @param {ops.Session} session
* @param {gui.CaretFactory} caretFactory
*/
*/
function SessionView(viewOptions, session, caretFactory) {
var carets = {},
avatarInfoStyles,
headlineNodeName = 'text|h',
paragraphNodeName = 'text|p',
editHighlightingEnabled = true,
editInfons = 'urn:webodf:names:editinfo',
editInfoMap = {},
@@ -96,6 +94,7 @@ gui.SessionView = (function () {
/**
* @param {string} nodeName
* @param {string} className
* @param {string} memberId
* @return {?Node}
*/
@@ -157,7 +156,6 @@ gui.SessionView = (function () {
var editInfo,
editInfoMarker,
id = '',
userModel = session.getUserModel(),
editInfoNode = element.getElementsByTagNameNS(editInfons, 'editinfo')[0];
if (editInfoNode) {
+2 -3
View File
@@ -109,7 +109,7 @@ ops.OdtCursor = function OdtCursor(memberId, odtDocument) {
};
/**
* Obtain the node representing the cursor.
* @return {Element}
* @return {!Element}
*/
this.getNode = function () {
return cursor.getNode();
@@ -130,8 +130,7 @@ ops.OdtCursor = function OdtCursor(memberId, odtDocument) {
};
function init() {
var distanceToFirstTextNode, selection;
selection = new core.Selection(odtDocument.getDOM());
var selection = new core.Selection(odtDocument.getDOM());
cursor = new core.Cursor(selection, odtDocument.getDOM());
// mark cursornode with memberid