mirror of
https://github.com/nasa/openmct.git
synced 2024-12-30 01:48:51 +00:00
04c2eac9ef
Fixes #1437 Markup and CSS for `view large` button in frame context; Sass formatting cleanups; removed unused styles from _layout.scss; mods to MCTTriggerModal.js to remove button label functionality; Added new "icon-expand" glyph and class; Fixes #1437 Fixes #1423 New overlay > l-dialog and l-large-view classes; Fix context-menu z-index to allow context menu to appear in the overlay; .object-top-bar refactored and replaced with .object-browse-bar; frame > hover now only displays local controls for proper level, handles nested layout situation; Fixed font-weight display issues; MCTTriggerModal.js modified to do the following: - Remove .frame classes when displaying object in overlay - Allow click on this overlay .blocker to dismiss overlay Fixed min-width issue incorrectly targeting .object-browse-bar in frame context; Added expand anim to large view holder; Changed close button icon Significant mobile styling and cleanups; Markup mods for overlay.html; Handles dialog on top of large view; Form validation now displays better in mobile; Updated /src/api/ui/dialog.html to be in-line with /platform/commonUI/dialog/res/templates/overlay.html; Moved border-radius from containerBase to btnBase mixins; Animate with scale for GPU acceleration Change desktop animation to use scale, so that it is hardware accelerated and buttery smooth. Also fixes text anti-aliasing to improve readability. Moved mobile/overlay/_overlay.scss styles into overlay/_overlay.scss; removed mobile/overlay/_overlay.scss; Cleanups in _overlay.scss; restored max-width/max-height to dialogs (removed in #1376 for #1298) and added min-width; [Frontend] Mobile fixes in overlay and related Fixes #1437 Added mobile-specific styling to _messages.scss; Fixed button layout and margins in _overlay.scss; Fixed message.html to not default to major style buttons; [Frontend] Timing tweaks Fixes #1437 Moved large view expand transition duration into theme _constants files; shortened anim duration Fix Style errors [mctTriggerModal] correct scope for toggle Correct scope for toggleFunction such that #1503 no longer occurs. Fixes #1503 [Style] Add copyright header
360 lines
16 KiB
JavaScript
360 lines
16 KiB
JavaScript
/*****************************************************************************
|
|
* Open MCT, Copyright (c) 2014-2017, United States Government
|
|
* as represented by the Administrator of the National Aeronautics and Space
|
|
* Administration. All rights reserved.
|
|
*
|
|
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
|
* "License"); you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
* License for the specific language governing permissions and limitations
|
|
* under the License.
|
|
*
|
|
* Open MCT includes source code licensed under additional open source
|
|
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
|
* this source code distribution or the Licensing information page available
|
|
* at runtime from the About dialog for additional information.
|
|
*****************************************************************************/
|
|
|
|
define([
|
|
"./src/LayoutController",
|
|
"./src/FixedController",
|
|
"./src/LayoutCompositionPolicy",
|
|
'./src/MCTTriggerModal',
|
|
"text!./res/templates/layout.html",
|
|
"text!./res/templates/fixed.html",
|
|
"text!./res/templates/frame.html",
|
|
"text!./res/templates/elements/telemetry.html",
|
|
"text!./res/templates/elements/box.html",
|
|
"text!./res/templates/elements/line.html",
|
|
"text!./res/templates/elements/text.html",
|
|
"text!./res/templates/elements/image.html",
|
|
'legacyRegistry'
|
|
], function (
|
|
LayoutController,
|
|
FixedController,
|
|
LayoutCompositionPolicy,
|
|
MCTTriggerModal,
|
|
layoutTemplate,
|
|
fixedTemplate,
|
|
frameTemplate,
|
|
telemetryTemplate,
|
|
boxTemplate,
|
|
lineTemplate,
|
|
textTemplate,
|
|
imageTemplate,
|
|
legacyRegistry
|
|
) {
|
|
|
|
legacyRegistry.register("platform/features/layout", {
|
|
"name": "Layout components.",
|
|
"description": "Plug in adding Layout capabilities.",
|
|
"extensions": {
|
|
"views": [
|
|
{
|
|
"key": "layout",
|
|
"name": "Display Layout",
|
|
"cssClass": "icon-layout",
|
|
"type": "layout",
|
|
"template": layoutTemplate,
|
|
"editable": true,
|
|
"uses": []
|
|
},
|
|
{
|
|
"key": "fixed",
|
|
"name": "Fixed Position",
|
|
"cssClass": "icon-box-with-dashed-lines",
|
|
"type": "telemetry.panel",
|
|
"template": fixedTemplate,
|
|
"uses": [
|
|
"composition"
|
|
],
|
|
"toolbar": {
|
|
"sections": [
|
|
{
|
|
"items": [
|
|
{
|
|
"method": "add",
|
|
"cssClass": "icon-plus",
|
|
"control": "menu-button",
|
|
"text": "Add",
|
|
"title": "Add",
|
|
"description": "Add new items",
|
|
"options": [
|
|
{
|
|
"name": "Box",
|
|
"cssClass": "icon-box",
|
|
"key": "fixed.box"
|
|
},
|
|
{
|
|
"name": "Line",
|
|
"cssClass": "icon-line-horz",
|
|
"key": "fixed.line"
|
|
},
|
|
{
|
|
"name": "Text",
|
|
"cssClass": "icon-T",
|
|
"key": "fixed.text"
|
|
},
|
|
{
|
|
"name": "Image",
|
|
"cssClass": "icon-image",
|
|
"key": "fixed.image"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"items": [
|
|
{
|
|
"method": "order",
|
|
"cssClass": "icon-layers",
|
|
"control": "menu-button",
|
|
"title": "Layering",
|
|
"description": "Move the selected object above or below other objects",
|
|
"options": [
|
|
{
|
|
"name": "Move to Top",
|
|
"cssClass": "icon-arrow-double-up",
|
|
"key": "top"
|
|
},
|
|
{
|
|
"name": "Move Up",
|
|
"cssClass": "icon-arrow-up",
|
|
"key": "up"
|
|
},
|
|
{
|
|
"name": "Move Down",
|
|
"cssClass": "icon-arrow-down",
|
|
"key": "down"
|
|
},
|
|
{
|
|
"name": "Move to Bottom",
|
|
"cssClass": "icon-arrow-double-down",
|
|
"key": "bottom"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"property": "fill",
|
|
"cssClass": "icon-paint-bucket",
|
|
"title": "Fill color",
|
|
"description": "Set fill color",
|
|
"control": "color"
|
|
},
|
|
{
|
|
"property": "stroke",
|
|
"cssClass": "icon-line-horz",
|
|
"title": "Border color",
|
|
"description": "Set border color",
|
|
"control": "color"
|
|
},
|
|
{
|
|
"property": "color",
|
|
"cssClass": "icon-T",
|
|
"title": "Text color",
|
|
"description": "Set text color",
|
|
"mandatory": true,
|
|
"control": "color"
|
|
},
|
|
{
|
|
"property": "url",
|
|
"cssClass": "icon-image",
|
|
"control": "dialog-button",
|
|
"title": "Image Properties",
|
|
"description": "Edit image properties",
|
|
"dialog": {
|
|
"control": "textfield",
|
|
"name": "Image URL",
|
|
"cssClass": "l-input-lg",
|
|
"required": true
|
|
}
|
|
},
|
|
{
|
|
"property": "text",
|
|
"cssClass": "icon-gear",
|
|
"control": "dialog-button",
|
|
"title": "Text Properties",
|
|
"description": "Edit text properties",
|
|
"dialog": {
|
|
"control": "textfield",
|
|
"name": "Text",
|
|
"required": true
|
|
}
|
|
},
|
|
{
|
|
"method": "showTitle",
|
|
"cssClass": "icon-two-parts-both",
|
|
"control": "button",
|
|
"title": "Show title",
|
|
"description": "Show telemetry element title"
|
|
},
|
|
{
|
|
"method": "hideTitle",
|
|
"cssClass": "icon-two-parts-one-only",
|
|
"control": "button",
|
|
"title": "Hide title",
|
|
"description": "Hide telemetry element title"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"items": [
|
|
{
|
|
"method": "remove",
|
|
"control": "button",
|
|
"cssClass": "icon-trash",
|
|
"title": "Delete",
|
|
"description": "Delete the selected item"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"representations": [
|
|
{
|
|
"key": "frame",
|
|
"template": frameTemplate
|
|
}
|
|
],
|
|
"directives": [
|
|
{
|
|
"key": "mctTriggerModal",
|
|
"implementation": MCTTriggerModal,
|
|
"depends": [
|
|
"$document"
|
|
]
|
|
}
|
|
],
|
|
"controllers": [
|
|
{
|
|
"key": "LayoutController",
|
|
"implementation": LayoutController,
|
|
"depends": [
|
|
"$scope"
|
|
]
|
|
},
|
|
{
|
|
"key": "FixedController",
|
|
"implementation": FixedController,
|
|
"depends": [
|
|
"$scope",
|
|
"$q",
|
|
"dialogService",
|
|
"openmct"
|
|
]
|
|
}
|
|
],
|
|
"templates": [
|
|
{
|
|
"key": "fixed.telemetry",
|
|
"template": telemetryTemplate
|
|
},
|
|
{
|
|
"key": "fixed.box",
|
|
"template": boxTemplate
|
|
},
|
|
{
|
|
"key": "fixed.line",
|
|
"template": lineTemplate
|
|
},
|
|
{
|
|
"key": "fixed.text",
|
|
"template": textTemplate
|
|
},
|
|
{
|
|
"key": "fixed.image",
|
|
"template": imageTemplate
|
|
}
|
|
],
|
|
"policies": [
|
|
{
|
|
"category": "composition",
|
|
"implementation": LayoutCompositionPolicy
|
|
}
|
|
],
|
|
"types": [
|
|
{
|
|
"key": "layout",
|
|
"name": "Display Layout",
|
|
"cssClass": "icon-layout",
|
|
"description": "Assemble other objects and components together into a reusable screen layout. Working in a simple canvas workspace, simply drag in the objects you want, position and size them. Save your design and view or edit it at any time.",
|
|
"priority": 900,
|
|
"features": "creation",
|
|
"model": {
|
|
"composition": []
|
|
},
|
|
"properties": [
|
|
{
|
|
"name": "Layout Grid",
|
|
"control": "composite",
|
|
"pattern": "^(\\d*[1-9]\\d*)?$",
|
|
"items": [
|
|
{
|
|
"name": "Horizontal grid (px)",
|
|
"control": "textfield",
|
|
"cssClass": "l-input-sm l-numeric"
|
|
},
|
|
{
|
|
"name": "Vertical grid (px)",
|
|
"control": "textfield",
|
|
"cssClass": "l-input-sm l-numeric"
|
|
}
|
|
],
|
|
"key": "layoutGrid",
|
|
"conversion": "number[]"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"key": "telemetry.panel",
|
|
"name": "Telemetry Panel",
|
|
"cssClass": "icon-telemetry-panel",
|
|
"description": "A panel for collecting telemetry elements.",
|
|
"priority": 899,
|
|
"delegates": [
|
|
"telemetry"
|
|
],
|
|
"features": "creation",
|
|
"contains": [
|
|
{
|
|
"has": "telemetry"
|
|
}
|
|
],
|
|
"model": {
|
|
"composition": []
|
|
},
|
|
"properties": [
|
|
{
|
|
"name": "Layout Grid",
|
|
"control": "composite",
|
|
"items": [
|
|
{
|
|
"name": "Horizontal grid (px)",
|
|
"control": "textfield",
|
|
"cssClass": "l-input-sm l-numeric"
|
|
},
|
|
{
|
|
"name": "Vertical grid (px)",
|
|
"control": "textfield",
|
|
"cssClass": "l-input-sm l-numeric"
|
|
}
|
|
],
|
|
"pattern": "^(\\d*[1-9]\\d*)?$",
|
|
"property": "layoutGrid",
|
|
"conversion": "number[]"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
});
|
|
});
|