mirror of
https://github.com/webodf/WebODF.git
synced 2026-11-30 16:47:58 +01:00
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:
@@ -15,3 +15,4 @@ programs/ios/www/webodf.js
|
||||
webodf/webodf.css.js
|
||||
build
|
||||
*.sw?
|
||||
.idea
|
||||
@@ -66,7 +66,6 @@ define("webodf/editor/Editor", [
|
||||
userList,
|
||||
networked = args.networked === true,
|
||||
opRouter,
|
||||
sessionid,
|
||||
userModel,
|
||||
saveOdtFile = args.saveCallback,
|
||||
documentUrl;
|
||||
|
||||
@@ -369,9 +369,9 @@ define("webodf/editor/EditorSession", [
|
||||
*/
|
||||
this.getDeclaredFonts = function () {
|
||||
var fontMap = formatting.getFontMap(),
|
||||
sortedNames = [],
|
||||
usedFamilies = [],
|
||||
array = [],
|
||||
sortedNames,
|
||||
key,
|
||||
value,
|
||||
i;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user