style fixes

This commit is contained in:
Thijs Wenker 2018-11-09 01:22:59 +01:00
parent 08da8c4190
commit 9005efb639
5 changed files with 63 additions and 52 deletions

View file

@ -494,9 +494,9 @@ var toolBar = (function () {
applyProperties(properties, DEFAULT_ENTITY_PROPERTIES.All);
var type = requestedProperties.type;
if (type == "Box" || type == "Sphere") {
if (type === "Box" || type === "Sphere") {
applyProperties(properties, DEFAULT_ENTITY_PROPERTIES.Shape);
} else if (type == "Image") {
} else if (type === "Image") {
requestedProperties.type = "Model";
applyProperties(properties, DEFAULT_ENTITY_PROPERTIES.Image);
} else {
@ -1218,7 +1218,7 @@ function mouseClickEvent(event) {
var result, properties, tabletClicked;
if (isActive && event.isLeftButton) {
result = findClickedEntity(event);
tabletOrEditHandleClicked = wasTabletOrEditHandleClicked(event);
var tabletOrEditHandleClicked = wasTabletOrEditHandleClicked(event);
if (tabletOrEditHandleClicked) {
return;
}
@ -1541,7 +1541,7 @@ function insideBox(center, dimensions, point) {
(Math.abs(point.z - center.z) <= (dimensions.z / 2.0));
}
function selectAllEtitiesInCurrentSelectionBox(keepIfTouching) {
function selectAllEntitiesInCurrentSelectionBox(keepIfTouching) {
if (selectionManager.hasSelection()) {
// Get all entities touching the bounding box of the current selection
var boundingBoxCorner = Vec3.subtract(selectionManager.worldPosition,
@ -1820,9 +1820,9 @@ function handleMenuEvent(menuItem) {
Window.promptAsync("URL of SVO to import", "");
}
} else if (menuItem === "Select All Entities In Box") {
selectAllEtitiesInCurrentSelectionBox(false);
selectAllEntitiesInCurrentSelectionBox(false);
} else if (menuItem === "Select All Entities Touching Box") {
selectAllEtitiesInCurrentSelectionBox(true);
selectAllEntitiesInCurrentSelectionBox(true);
} else if (menuItem === MENU_SHOW_LIGHTS_AND_PARTICLES_IN_EDIT_MODE) {
entityIconOverlayManager.setVisible(isActive && Menu.isOptionChecked(MENU_SHOW_LIGHTS_AND_PARTICLES_IN_EDIT_MODE));
} else if (menuItem === MENU_SHOW_ZONES_IN_EDIT_MODE) {
@ -2108,14 +2108,14 @@ var DELETED_ENTITY_MAP = {};
function applyEntityProperties(data) {
var editEntities = data.editEntities;
var selectedEntityIDs = [];
var selectEdits = data.createEntities.length == 0 || !data.selectCreated;
var i, entityID;
var selectEdits = data.createEntities.length === 0 || !data.selectCreated;
var i, entityID, entityProperties;
for (i = 0; i < editEntities.length; i++) {
var entityID = editEntities[i].entityID;
entityID = editEntities[i].entityID;
if (DELETED_ENTITY_MAP[entityID] !== undefined) {
entityID = DELETED_ENTITY_MAP[entityID];
}
var entityProperties = editEntities[i].properties;
entityProperties = editEntities[i].properties;
if (entityProperties !== null) {
Entities.editEntity(entityID, entityProperties);
}
@ -2125,7 +2125,7 @@ function applyEntityProperties(data) {
}
for (i = 0; i < data.createEntities.length; i++) {
entityID = data.createEntities[i].entityID;
var entityProperties = data.createEntities[i].properties;
entityProperties = data.createEntities[i].properties;
var newEntityID = Entities.addEntity(entityProperties);
recursiveAdd(newEntityID, data.createEntities[i]);
DELETED_ENTITY_MAP[entityID] = newEntityID;
@ -2597,7 +2597,7 @@ var PopupMenu = function () {
y: event.y
});
if (!pressingOverlay) {
if (hoveringOverlay !== null && hoveringOverlay !== null && overlay !== hoveringOverlay) {
if (hoveringOverlay !== null && overlay !== hoveringOverlay) {
Overlays.editOverlay(hoveringOverlay, {
backgroundColor: upColor
});

View file

@ -103,7 +103,7 @@ thead {
font-size: 12px;
text-transform: uppercase;
background-color: #1c1c1c;
padding: 1px 0px;
padding: 1px 0;
border-bottom: 1px solid #575757;
width: 100%;
}
@ -283,7 +283,7 @@ input[type=number]::-webkit-inner-spin-button {
width: 10px;
height: 90%;
overflow: hidden;
font-family: hifi-glyphs;
font-family: HiFi-Glyphs;
font-size: 32px;
color: #afafaf;
cursor: pointer;
@ -347,7 +347,7 @@ input[type=button], button.hifi-edit-button {
vertical-align: top;
height: 28px;
min-width: 120px;
padding: 0px 18px;
padding: 0 18px;
margin-right: 6px;
border-radius: 5px;
border: none;
@ -447,7 +447,7 @@ input[type=checkbox]:checked + label:hover {
position: absolute;
left: 6px;
top: -2px;
font-family: hifi-glyphs;
font-family: HiFi-Glyphs;
font-size: 30px;
color: #afafaf;
}
@ -1100,7 +1100,6 @@ body#entity-list-body {
float: right;
margin-right: 0;
background-color: #ff0000;
min-width: 90px;
}
#entity-list {
@ -1129,7 +1128,7 @@ body#entity-list-body {
#filter-type-checkboxes span {
position: relative;
top: 3px;
font-family: hifi-glyphs;
font-family: HiFi-Glyphs;
font-size: 13px;
color: #000000;
padding-left: 6px;
@ -1173,7 +1172,7 @@ body#entity-list-body {
#filter-in-view {
position: absolute;
top: 0px;
top: 0;
right: 126px;
}
@ -1453,7 +1452,7 @@ th#entity-hasScript {
}
#properties-base #property-type-icon {
font-family: hifi-glyphs;
font-family: HiFi-Glyphs;
font-size: 31px;
color: #00b4ef;
margin: -4px 12px -4px -2px;

View file

@ -139,9 +139,9 @@ input[type=radio]:active + label > span > span{
font-family: Raleway-Bold;
font-size: 13px;
color: black;
padding: 0px 10px;
padding: 0 10px;
border-radius: 3px;
border-width: 0px;
border-width: 0;
background-image: linear-gradient(#FFFFFF, #AFAFAF);
min-height: 30px;
}
@ -158,9 +158,9 @@ input[type=radio]:active + label > span > span{
font-family: Raleway-Bold;
font-size: 13px;
color: white;
padding: 0px 10px;
padding: 0 10px;
border-radius: 3px;
border-width: 0px;
border-width: 0;
background-image: linear-gradient(#00B4EF, #1080B8);
min-height: 30px;
}

View file

@ -23,7 +23,6 @@ const FILTER_IN_VIEW_ATTRIBUTE = "pressed";
const WINDOW_NONVARIABLE_HEIGHT = 227;
const NUM_COLUMNS = 12;
const EMPTY_ENTITY_ID = "0";
const MAX_LENGTH_RADIUS = 9;
const DELETE = 46; // Key code for the delete key.
const KEY_P = 80; // Key code for letter p used for Parenting hotkey.
@ -85,29 +84,52 @@ const ICON_FOR_TYPE = {
};
// List of all entities
var entities = [];
let entities = [];
// List of all entities, indexed by Entity ID
var entitiesByID = {};
let entitiesByID = {};
// The filtered and sorted list of entities passed to ListView
var visibleEntities = [];
let visibleEntities = [];
// List of all entities that are currently selected
var selectedEntities = [];
let selectedEntities = [];
var entityList = null; // The ListView
let entityList = null; // The ListView
/**
* @type EntityListContextMenu
*/
var entityListContextMenu = null;
let entityListContextMenu = null;
var currentSortColumn = 'type';
var currentSortOrder = ASCENDING_SORT;
var typeFilters = [];
var isFilterInView = false;
var showExtraInfo = false;
let currentSortColumn = 'type';
let currentSortOrder = ASCENDING_SORT;
let typeFilters = [];
let isFilterInView = false;
let showExtraInfo = false;
let elEntityTable,
elEntityTableBody,
elEntityTableScroll,
elEntityTableHeaderRow,
elRefresh,
elToggleLocked,
elToggleVisible,
elDelete,
elFilterTypeSelectBox,
elFilterTypeText,
elFilterTypeCheckboxes,
elFilterSearch,
elFilterInView,
elFilterRadius,
elExport,
elPal,
elInfoToggle,
elInfoToggleGlyph,
elSelectedEntitiesCount,
elVisibleEntitiesCount,
elNoEntitiesMessage,
elToggleSpaceMode;
const ENABLE_PROFILING = false;
var profileIndent = '';
let profileIndent = '';
const PROFILE_NOOP = function(_name, fn, args) {
fn.apply(this, args);
} ;
@ -140,7 +162,7 @@ function loaded() {
elFilterTypeText = document.getElementById("filter-type-text");
elFilterTypeCheckboxes = document.getElementById("filter-type-checkboxes");
elFilterSearch = document.getElementById("filter-search");
elFilterInView = document.getElementById("filter-in-view")
elFilterInView = document.getElementById("filter-in-view");
elFilterRadius = document.getElementById("filter-radius");
elExport = document.getElementById("export");
elPal = document.getElementById("pal");

View file

@ -281,7 +281,7 @@ SelectionManager = (function() {
var actionArguments = Entities.getActionArguments(properties.id, actionID);
if (actionArguments) {
var type = actionArguments.type;
if (type == 'hold' || type == 'far-grab') {
if (type === 'hold' || type === 'far-grab') {
continue;
}
delete actionArguments.ttl;
@ -501,6 +501,7 @@ SelectionManager = (function() {
if (selectionUpdated) {
SelectionDisplay.useDesiredSpaceMode();
//SelectionDisplay.setSpaceMode(SPACE_LOCAL, false);
}
} else {
properties = Entities.getEntityProperties(that.selections[0], ['type', 'boundingBox']);
@ -633,17 +634,6 @@ SelectionDisplay = (function() {
ALL: 3
};
const SCALE_DIRECTION = {
LBN: 0,
RBN: 1,
LBF: 2,
RBF: 3,
LTN: 4,
RTN: 5,
LTF: 6,
RTF: 7
};
const ROTATE_DIRECTION = {
PITCH: 0,
YAW: 1,
@ -1342,7 +1332,7 @@ SelectionDisplay = (function() {
}
};
function controllerComputePickRay(hand) {
function controllerComputePickRay() {
var hand = that.triggered() ? that.triggeredHand : that.pressedHand;
var controllerPose = getControllerWorldLocation(hand, true);
if (controllerPose.valid) {
@ -1832,7 +1822,7 @@ SelectionDisplay = (function() {
!isActiveTool(handleRotateYawRing) &&
!isActiveTool(handleRotateRollRing)));
// keep duplicator always hidden for now since you can hold Alt to duplciate while
// keep duplicator always hidden for now since you can hold Alt to duplicate while
// translating an entity - we may bring duplicator back for HMD only later
// that.setHandleDuplicatorVisible(!activeTool || isActiveTool(handleDuplicator));