[Build] Remove unused variables

...to satisfy JSHint
This commit is contained in:
Victor Woeltjen 2016-03-04 11:41:48 -08:00
parent bf232d0593
commit a1a7b2b8ce
44 changed files with 55 additions and 109 deletions

View File

@ -25,10 +25,8 @@
* @namespace platform/commonUI/browse * @namespace platform/commonUI/browse
*/ */
define( define(
[ [],
'../../../representation/src/gestures/GestureConstants' function () {
],
function (GestureConstants) {
var ROOT_ID = "ROOT"; var ROOT_ID = "ROOT";

View File

@ -28,9 +28,7 @@ define(
function () { function () {
var NON_PERSISTENT_WARNING = var NON_PERSISTENT_WARNING =
"Tried to create an object in non-persistent container.", "Tried to create an object in non-persistent container.";
NO_COMPOSITION_WARNING =
"Could not add to composition; no composition in ";
/** /**
* The creation service is responsible for instantiating and * The creation service is responsible for instantiating and

View File

@ -26,8 +26,6 @@
define( define(
[], [],
function () { function () {
var ROOT_ID = "ROOT",
DEFAULT_PATH = "/mine";
/** /**
* The new tab action allows a domain object to be opened * The new tab action allows a domain object to be opened
* into a new browser tab. * into a new browser tab.

View File

@ -79,8 +79,7 @@ define(
} }
function doWizardSave(parent) { function doWizardSave(parent) {
var context = domainObject.getCapability("context"), var wizard = new CreateWizard(
wizard = new CreateWizard(
domainObject, domainObject,
parent, parent,
self.policyService self.policyService

View File

@ -37,10 +37,7 @@ define(
* @implements {PersistenceCapability} * @implements {PersistenceCapability}
*/ */
function EditableActionCapability( function EditableActionCapability(
actionCapability, actionCapability
editableObject,
domainObject,
cache
) { ) {
var action = Object.create(actionCapability); var action = Object.create(actionCapability);

View File

@ -68,8 +68,7 @@ define(
EditableDomainObjectCache.prototype.getEditableObject = function (domainObject) { EditableDomainObjectCache.prototype.getEditableObject = function (domainObject) {
var type = domainObject.getCapability('type'), var type = domainObject.getCapability('type'),
EditableDomainObject = this.EditableDomainObject, EditableDomainObject = this.EditableDomainObject,
editableObject, editableObject;
statusListener;
// Track the top-level domain object; this will have // Track the top-level domain object; this will have
// some special behavior for its context capability. // some special behavior for its context capability.

View File

@ -109,8 +109,8 @@ define(
// Handle a specific representation of a specific domain object // Handle a specific representation of a specific domain object
EditRepresenter.prototype.represent = function represent(representation, representedObject) { EditRepresenter.prototype.represent = function represent(representation, representedObject) {
var scope = this.scope, var scope = this.scope;
self = this;
// Track the key, to know which view configuration to save to. // Track the key, to know which view configuration to save to.
this.key = (representation || {}).key; this.key = (representation || {}).key;
// Track the represented object // Track the represented object

View File

@ -21,8 +21,8 @@
*****************************************************************************/ *****************************************************************************/
define( define(
['moment'], [],
function (moment) { function () {
var TICK_SPACING_PX = 150; var TICK_SPACING_PX = 150;
@ -180,7 +180,7 @@ define(
}; };
} }
function updateOuterStart(t) { function updateOuterStart() {
var ngModel = $scope.ngModel; var ngModel = $scope.ngModel;
ngModel.inner.start = ngModel.inner.start =
@ -195,7 +195,7 @@ define(
updateTicks(); updateTicks();
} }
function updateOuterEnd(t) { function updateOuterEnd() {
var ngModel = $scope.ngModel; var ngModel = $scope.ngModel;
ngModel.inner.end = ngModel.inner.end =

View File

@ -60,9 +60,7 @@ define(
*/ */
function TreeNodeController($scope, $timeout) { function TreeNodeController($scope, $timeout) {
var self = this, var self = this,
selectedObject = ($scope.ngModel || {}).selectedObject, selectedObject = ($scope.ngModel || {}).selectedObject;
isSelected = false,
hasBeenExpanded = false;
// Look up the id for a domain object. A convenience // Look up the id for a domain object. A convenience
// for mapping; additionally does some undefined-checking. // for mapping; additionally does some undefined-checking.

View File

@ -94,13 +94,6 @@ define(
* @constructor * @constructor
*/ */
function MCTSplitPane($parse, $log, $interval) { function MCTSplitPane($parse, $log, $interval) {
var anchors = {
left: true,
right: true,
top: true,
bottom: true
};
function controller($scope, $element, $attrs) { function controller($scope, $element, $attrs) {
var anchorKey = $attrs.anchor || DEFAULT_ANCHOR, var anchorKey = $attrs.anchor || DEFAULT_ANCHOR,
anchor, anchor,
@ -162,7 +155,7 @@ define(
// Getter-setter for the pixel offset of the splitter, // Getter-setter for the pixel offset of the splitter,
// relative to the current edge. // relative to the current edge.
function getSetPosition(value) { function getSetPosition(value) {
var min, max, prior = position; var prior = position;
if (typeof value === 'number') { if (typeof value === 'number') {
position = value; position = value;
enforceExtrema(); enforceExtrema();

View File

@ -28,13 +28,7 @@ define(
var SPLITTER_TEMPLATE = "<div class='abs'" + var SPLITTER_TEMPLATE = "<div class='abs'" +
"mct-drag-down=\"splitter.startMove()\" " + "mct-drag-down=\"splitter.startMove()\" " +
"mct-drag=\"splitter.move(delta)\" " + "mct-drag=\"splitter.move(delta)\" " +
"mct-drag-up=\"splitter.endMove()\"></div>", "mct-drag-up=\"splitter.endMove()\"></div>";
OFFSETS_BY_EDGE = {
left: "offsetLeft",
right: "offsetRight",
top: "offsetTop",
bottom: "offsetBottom"
};
/** /**
* Implements `mct-splitter` directive. * Implements `mct-splitter` directive.
@ -50,7 +44,6 @@ define(
scope.splitter = { scope.splitter = {
// Begin moving this splitter // Begin moving this splitter
startMove: function () { startMove: function () {
var splitter = element[0];
initialPosition = mctSplitPane.position(); initialPosition = mctSplitPane.position();
mctSplitPane.toggleClass('resizing'); mctSplitPane.toggleClass('resizing');
}, },

View File

@ -81,8 +81,7 @@ define(
winDim = [ $window.innerWidth, $window.innerHeight ], winDim = [ $window.innerWidth, $window.innerHeight ],
styles = { position: 'absolute' }, styles = { position: 'absolute' },
margin, margin,
offset, offset;
bubble;
function adjustNegatives(value, index) { function adjustNegatives(value, index) {
return value < 0 ? (value + winDim[index]) : value; return value < 0 ? (value + winDim[index]) : value;

View File

@ -379,9 +379,8 @@ define(
*/ */
NotificationService.prototype.setActiveNotification = NotificationService.prototype.setActiveNotification =
function (notification) { function (notification) {
var timeout;
var self = this,
timeout;
this.active.notification = notification; this.active.notification = notification;
/* /*
If autoDismiss has been specified, OR there are other If autoDismiss has been specified, OR there are other

View File

@ -13,7 +13,7 @@ define(
function CompositionModelPolicy() { function CompositionModelPolicy() {
} }
CompositionModelPolicy.prototype.allow = function (candidate, context) { CompositionModelPolicy.prototype.allow = function (candidate) {
return Array.isArray( return Array.isArray(
(candidate.getInitialModel() || {}).composition (candidate.getInitialModel() || {}).composition
); );

View File

@ -21,8 +21,8 @@
*****************************************************************************/ *****************************************************************************/
define( define(
['../objects/DomainObjectImpl'], [],
function (DomainObjectImpl) { function () {
/** /**
* Implements the `instantiation` capability. This allows new domain * Implements the `instantiation` capability. This allows new domain

View File

@ -61,7 +61,7 @@ define(
* @memberof platform/core * @memberof platform/core
* @constructor * @constructor
*/ */
function DomainObjectProvider(modelService, instantiate, $q) { function DomainObjectProvider(modelService, instantiate) {
this.modelService = modelService; this.modelService = modelService;
this.instantiate = instantiate; this.instantiate = instantiate;
} }
@ -75,7 +75,7 @@ define(
// from this service. // from this service.
function assembleResult(models) { function assembleResult(models) {
var result = {}; var result = {};
ids.forEach(function (id, index) { ids.forEach(function (id) {
if (models[id]) { if (models[id]) {
// Create the domain object // Create the domain object
result[id] = instantiate(models[id], id); result[id] = instantiate(models[id], id);

View File

@ -48,8 +48,7 @@ define(
function isCrossSpace(context) { function isCrossSpace(context) {
var domainObject = context.domainObject, var domainObject = context.domainObject,
selectedObject = context.selectedObject, selectedObject = context.selectedObject;
spaces = [ domainObject, selectedObject ].map(lookupSpace);
return selectedObject !== undefined && return selectedObject !== undefined &&
domainObject !== undefined && domainObject !== undefined &&
lookupSpace(domainObject) !== lookupSpace(selectedObject); lookupSpace(domainObject) !== lookupSpace(selectedObject);

View File

@ -38,8 +38,7 @@ define(
* time (typically wrapping `Date.now`) * time (typically wrapping `Date.now`)
*/ */
function TimerController($scope, $window, now) { function TimerController($scope, $window, now) {
var timerObject, var formatter,
formatter,
active = true, active = true,
relativeTimestamp, relativeTimestamp,
lastTimestamp, lastTimestamp,

View File

@ -21,8 +21,8 @@
*****************************************************************************/ *****************************************************************************/
define( define(
['moment'], [],
function (moment) { function () {
/** /**
* Calls functions every second, as close to the actual second * Calls functions every second, as close to the actual second

View File

@ -144,7 +144,7 @@ define(
}; };
// Handle a specific representation of a specific domain object // Handle a specific representation of a specific domain object
ConductorRepresenter.prototype.represent = function represent(representation, representedObject) { ConductorRepresenter.prototype.represent = function represent(representation) {
this.destroy(); this.destroy();
if (this.views.indexOf(representation) !== -1 && !GLOBAL_SHOWING) { if (this.views.indexOf(representation) !== -1 && !GLOBAL_SHOWING) {

View File

@ -57,14 +57,11 @@ define(
}; };
ConductorTelemetryDecorator.prototype.requestTelemetry = function (requests) { ConductorTelemetryDecorator.prototype.requestTelemetry = function (requests) {
var self = this;
return this.telemetryService return this.telemetryService
.requestTelemetry(this.amendRequests(requests)); .requestTelemetry(this.amendRequests(requests));
}; };
ConductorTelemetryDecorator.prototype.subscribe = function (callback, requests) { ConductorTelemetryDecorator.prototype.subscribe = function (callback, requests) {
var self = this;
return this.telemetryService return this.telemetryService
.subscribe(callback, this.amendRequests(requests)); .subscribe(callback, this.amendRequests(requests));
}; };

View File

@ -36,7 +36,7 @@ define(
* @memberof platform/features/imagery * @memberof platform/features/imagery
*/ */
function MCTBackgroundImage($document) { function MCTBackgroundImage($document) {
function link(scope, element, attrs) { function link(scope, element) {
// General strategy here: // General strategy here:
// - Keep count of how many images have been requested; this // - Keep count of how many images have been requested; this
// counter will be used as an internal identifier or sorts // counter will be used as an internal identifier or sorts
@ -49,7 +49,7 @@ define(
// in which images are actually loaded may be different, so // in which images are actually loaded may be different, so
// some strategy like this is necessary to ensure that images // some strategy like this is necessary to ensure that images
// do not display out-of-order. // do not display out-of-order.
var div, requested = 0, loaded = 0; var requested = 0, loaded = 0;
function nextImage(url) { function nextImage(url) {
var myCounter = requested, var myCounter = requested,

View File

@ -36,7 +36,7 @@ define(
* @constructor * @constructor
* @param {Scope} $scope the controller's Angular scope * @param {Scope} $scope the controller's Angular scope
*/ */
function FixedController($scope, $q, dialogService, telemetryHandler, telemetryFormatter, throttle) { function FixedController($scope, $q, dialogService, telemetryHandler, telemetryFormatter) {
var self = this, var self = this,
handle, handle,
names = {}, // Cache names by ID names = {}, // Cache names by ID
@ -230,7 +230,7 @@ define(
} }
// Handle changes in the object's composition // Handle changes in the object's composition
function updateComposition(ids) { function updateComposition() {
// Populate panel positions // Populate panel positions
// TODO: Ensure defaults here // TODO: Ensure defaults here
// Resubscribe - objects in view have changed // Resubscribe - objects in view have changed

View File

@ -21,8 +21,8 @@
*****************************************************************************/ *****************************************************************************/
define( define(
['./TextProxy', './AccessorMutator'], ['./TextProxy'],
function (TextProxy, AccessorMutator) { function (TextProxy) {
// Method names to expose from this proxy // Method names to expose from this proxy
var HIDE = 'hideTitle', SHOW = 'showTitle'; var HIDE = 'hideTitle', SHOW = 'showTitle';

View File

@ -58,11 +58,7 @@ define(
lastIds.some(mismatch); lastIds.some(mismatch);
} }
function setupColumns(telemetryObjects) { function setupColumns() {
var id = $scope.domainObject && $scope.domainObject.getId(),
firstId =
telemetryObjects[0] && telemetryObjects[0].getId();
columns = []; columns = [];
columns.push(new DomainColumn(telemetryFormatter)); columns.push(new DomainColumn(telemetryFormatter));

View File

@ -143,7 +143,7 @@ define(
self = this; self = this;
if (handle) { if (handle) {
handle.promiseTelemetryObjects().then(function (objects) { handle.promiseTelemetryObjects().then(function () {
table.buildColumns(handle.getMetadata()); table.buildColumns(handle.getMetadata());
self.filterColumns(); self.filterColumns();

View File

@ -3,7 +3,7 @@ define(
["../controllers/MCTTableController"], ["../controllers/MCTTableController"],
function (MCTTableController) { function (MCTTableController) {
function MCTTable($timeout) { function MCTTable() {
return { return {
restrict: "E", restrict: "E",
templateUrl: "platform/features/table/res/templates/mct-data-table.html", templateUrl: "platform/features/table/res/templates/mct-data-table.html",
@ -13,7 +13,7 @@ define(
rows: "=", rows: "=",
enableFilter: "=?", enableFilter: "=?",
enableSort: "=?" enableSort: "=?"
}, }
}; };
} }

View File

@ -35,10 +35,10 @@ define(
getPointCount: function () { getPointCount: function () {
return 0; return 0;
}, },
getDomainValue: function (index) { getDomainValue: function () {
return 0; return 0;
}, },
getRangeValue: function (index) { getRangeValue: function () {
return 0; return 0;
} }
}; };

View File

@ -55,7 +55,6 @@ define(
function initializeValues() { function initializeValues() {
var values = [], var values = [],
slope = 0, slope = 0,
previous = 0,
i; i;
// Add a point (or points, if needed) reaching to the provided // Add a point (or points, if needed) reaching to the provided

View File

@ -63,12 +63,12 @@ define(
} }
// Set the duration associated with this object // Set the duration associated with this object
function setDuration(value) { function setDuration() {
// No-op; duration is implicit // No-op; duration is implicit
} }
// Set the end time associated with this object // Set the end time associated with this object
function setEnd(value) { function setEnd() {
// No-op; end time is implicit // No-op; end time is implicit
} }

View File

@ -20,11 +20,8 @@
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
define( define(
['../TimelineFormatter'], [],
function (TimelineFormatter) { function () {
var FORMATTER = new TimelineFormatter();
/** /**
* Controls the pan-zoom state of a timeline view. * Controls the pan-zoom state of a timeline view.
@ -113,7 +110,6 @@ define(
* @returns {number} duration, in milliseconds * @returns {number} duration, in milliseconds
*/ */
duration: function (value) { duration: function (value) {
var prior = duration;
if (arguments.length > 0) { if (arguments.length > 0) {
duration = roundDuration(value); duration = roundDuration(value);
} }

View File

@ -45,8 +45,6 @@ define(
min = 0, min = 0,
// current maximum // current maximum
max = 0, max = 0,
// current displayed time span
duration = 1000,
// line colors to display // line colors to display
colors = Object.keys(domainObjects); colors = Object.keys(domainObjects);

View File

@ -40,7 +40,6 @@ define(
height = element[0].offsetHeight, height = element[0].offsetHeight,
rect = element[0].getBoundingClientRect(), rect = element[0].getBoundingClientRect(),
offset = event.pageY - rect.top, offset = event.pageY - rect.top,
dataTransfer = event.dataTransfer,
id = dndService.getData( id = dndService.getData(
SwimlaneDragConstants.MCT_DRAG_TYPE SwimlaneDragConstants.MCT_DRAG_TYPE
), ),

View File

@ -55,7 +55,7 @@ define(
} }
function initializeGroups() { function initializeGroups() {
var i, group; var group;
// Ten grayscale colors // Ten grayscale colors
group = []; group = [];

View File

@ -74,7 +74,7 @@ define(
// Callback if the HTTP request to Couch fails // Callback if the HTTP request to Couch fails
function handleError(err) { function handleError() {
self.state = DISCONNECTED; self.state = DISCONNECTED;
} }

View File

@ -116,7 +116,7 @@ define(
return this.$q.when(this.spaces); return this.$q.when(this.spaces);
}; };
CouchPersistenceProvider.prototype.listObjects = function (space) { CouchPersistenceProvider.prototype.listObjects = function () {
return this.get("_all_docs").then(bind(getIdsFromAllDocs, this)); return this.get("_all_docs").then(bind(getIdsFromAllDocs, this));
}; };

View File

@ -157,7 +157,7 @@ define(
.then(checkUpdate); .then(checkUpdate);
}; };
ElasticPersistenceProvider.prototype.deleteObject = function (space, key, value) { ElasticPersistenceProvider.prototype.deleteObject = function (space, key) {
return this.del(key).then(bind(this.checkResponse, this)); return this.del(key).then(bind(this.checkResponse, this));
}; };

View File

@ -73,7 +73,7 @@ define([
}) })
.then(function success(succesResponse) { .then(function success(succesResponse) {
return provider.parseResponse(succesResponse); return provider.parseResponse(succesResponse);
}, function error(errorResponse) { }, function error() {
// Gracefully fail. // Gracefully fail.
return { return {
hits: [], hits: [],

View File

@ -79,7 +79,7 @@ define(
return this.$q.when(spaceObj[key]); return this.$q.when(spaceObj[key]);
}; };
LocalStoragePersistenceProvider.prototype.deleteObject = function (space, key, value) { LocalStoragePersistenceProvider.prototype.deleteObject = function (space, key) {
var spaceObj = this.getValue(space); var spaceObj = this.getValue(space);
delete spaceObj[key]; delete spaceObj[key];
this.setValue(space, spaceObj); this.setValue(space, spaceObj);

View File

@ -53,8 +53,7 @@ define(
* @param {ViewDefinition[]} views an array of view extensions * @param {ViewDefinition[]} views an array of view extensions
*/ */
function MCTRepresentation(representations, views, representers, $q, templateLinker, $log) { function MCTRepresentation(representations, views, representers, $q, templateLinker, $log) {
var representationMap = {}, var representationMap = {};
gestureMap = {};
// Assemble all representations and views // Assemble all representations and views
// The distinction between views and representations is // The distinction between views and representations is
@ -82,7 +81,7 @@ define(
} }
} }
function link($scope, element, attrs, ctrl, transclude) { function link($scope, element, attrs) {
var activeRepresenters = representers.map(function (Representer) { var activeRepresenters = representers.map(function (Representer) {
return new Representer($scope, element, attrs); return new Representer($scope, element, attrs);
}), }),

View File

@ -31,7 +31,7 @@ define(
* @param {...Array.<{templateUrl: string}>} extensions arrays * @param {...Array.<{templateUrl: string}>} extensions arrays
* of template or template-like extensions * of template or template-like extensions
*/ */
function TemplatePrefetcher(templateLinker, extensions) { function TemplatePrefetcher(templateLinker) {
Array.prototype.slice.apply(arguments, [1]) Array.prototype.slice.apply(arguments, [1])
.reduce(function (a, b) { .reduce(function (a, b) {
return a.concat(b); return a.concat(b);

View File

@ -91,7 +91,7 @@ define(
}); });
// Whenever the touch event ends, 'isPressing' is false. // Whenever the touch event ends, 'isPressing' is false.
element.on('touchend', function (event) { element.on('touchend', function () {
isPressing = false; isPressing = false;
}); });
} }

View File

@ -71,13 +71,6 @@ define(
} }
} }
function canCompose(domainObject, selectedObject){
return domainObject.getCapability("action").getActions({
key: 'compose',
selectedObject: selectedObject
}).length > 0;
}
function dragOver(e) { function dragOver(e) {
//Refresh domain object on each dragOver to catch external //Refresh domain object on each dragOver to catch external
// updates to the model // updates to the model
@ -121,7 +114,7 @@ define(
// destination domain object's composition, and persist // destination domain object's composition, and persist
// the change. // the change.
if (id) { if (id) {
$q.when(action && action.perform()).then(function (result) { $q.when(action && action.perform()).then(function () {
//Don't go into edit mode for folders //Don't go into edit mode for folders
if (domainObjectType!=='folder') { if (domainObjectType!=='folder') {
editableDomainObject.getCapability('action').perform('edit'); editableDomainObject.getCapability('action').perform('edit');

View File

@ -70,7 +70,7 @@ define(
* @returns {string} a textual representation of the * @returns {string} a textual representation of the
* value, suitable for display. * value, suitable for display.
*/ */
TelemetryFormatter.prototype.formatRangeValue = function (v, key) { TelemetryFormatter.prototype.formatRangeValue = function (v) {
return isNaN(v) ? String(v) : v.toFixed(VALUE_FORMAT_DIGITS); return isNaN(v) ? String(v) : v.toFixed(VALUE_FORMAT_DIGITS);
}; };