[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
*/
define(
[
'../../../representation/src/gestures/GestureConstants'
],
function (GestureConstants) {
[],
function () {
var ROOT_ID = "ROOT";

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -21,8 +21,8 @@
*****************************************************************************/
define(
['moment'],
function (moment) {
[],
function () {
/**
* 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
ConductorRepresenter.prototype.represent = function represent(representation, representedObject) {
ConductorRepresenter.prototype.represent = function represent(representation) {
this.destroy();
if (this.views.indexOf(representation) !== -1 && !GLOBAL_SHOWING) {

View File

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

View File

@ -36,7 +36,7 @@ define(
* @memberof platform/features/imagery
*/
function MCTBackgroundImage($document) {
function link(scope, element, attrs) {
function link(scope, element) {
// General strategy here:
// - Keep count of how many images have been requested; this
// 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
// some strategy like this is necessary to ensure that images
// do not display out-of-order.
var div, requested = 0, loaded = 0;
var requested = 0, loaded = 0;
function nextImage(url) {
var myCounter = requested,

View File

@ -36,7 +36,7 @@ define(
* @constructor
* @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,
handle,
names = {}, // Cache names by ID
@ -230,7 +230,7 @@ define(
}
// Handle changes in the object's composition
function updateComposition(ids) {
function updateComposition() {
// Populate panel positions
// TODO: Ensure defaults here
// Resubscribe - objects in view have changed

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -55,7 +55,6 @@ define(
function initializeValues() {
var values = [],
slope = 0,
previous = 0,
i;
// 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
function setDuration(value) {
function setDuration() {
// No-op; duration is implicit
}
// Set the end time associated with this object
function setEnd(value) {
function setEnd() {
// No-op; end time is implicit
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -53,8 +53,7 @@ define(
* @param {ViewDefinition[]} views an array of view extensions
*/
function MCTRepresentation(representations, views, representers, $q, templateLinker, $log) {
var representationMap = {},
gestureMap = {};
var representationMap = {};
// Assemble all representations and views
// 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) {
return new Representer($scope, element, attrs);
}),

View File

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

View File

@ -91,7 +91,7 @@ define(
});
// Whenever the touch event ends, 'isPressing' is false.
element.on('touchend', function (event) {
element.on('touchend', function () {
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) {
//Refresh domain object on each dragOver to catch external
// updates to the model
@ -121,7 +114,7 @@ define(
// destination domain object's composition, and persist
// the change.
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
if (domainObjectType!=='folder') {
editableDomainObject.getCapability('action').perform('edit');

View File

@ -70,7 +70,7 @@ define(
* @returns {string} a textual representation of the
* 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);
};