mirror of
https://github.com/nasa/openmct.git
synced 2025-06-22 00:57:11 +00:00
Merge pull request #1213 from nasa/api-platform-updates
[API] Miscellaneous platform updates
This commit is contained in:
@ -41,6 +41,7 @@ define([
|
|||||||
"text!./res/templates/items/items.html",
|
"text!./res/templates/items/items.html",
|
||||||
"text!./res/templates/browse/object-properties.html",
|
"text!./res/templates/browse/object-properties.html",
|
||||||
"text!./res/templates/browse/inspector-region.html",
|
"text!./res/templates/browse/inspector-region.html",
|
||||||
|
"text!./res/templates/view-object.html",
|
||||||
'legacyRegistry'
|
'legacyRegistry'
|
||||||
], function (
|
], function (
|
||||||
BrowseController,
|
BrowseController,
|
||||||
@ -63,6 +64,7 @@ define([
|
|||||||
itemsTemplate,
|
itemsTemplate,
|
||||||
objectPropertiesTemplate,
|
objectPropertiesTemplate,
|
||||||
inspectorRegionTemplate,
|
inspectorRegionTemplate,
|
||||||
|
viewObjectTemplate,
|
||||||
legacyRegistry
|
legacyRegistry
|
||||||
) {
|
) {
|
||||||
|
|
||||||
@ -142,7 +144,7 @@ define([
|
|||||||
"representations": [
|
"representations": [
|
||||||
{
|
{
|
||||||
"key": "view-object",
|
"key": "view-object",
|
||||||
"templateUrl": "templates/view-object.html"
|
"template": viewObjectTemplate
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "browse-object",
|
"key": "browse-object",
|
||||||
|
@ -48,6 +48,7 @@ define([
|
|||||||
"./src/directives/MCTSplitPane",
|
"./src/directives/MCTSplitPane",
|
||||||
"./src/directives/MCTSplitter",
|
"./src/directives/MCTSplitter",
|
||||||
"./src/directives/MCTTree",
|
"./src/directives/MCTTree",
|
||||||
|
"./src/filters/ReverseFilter",
|
||||||
"text!./res/templates/bottombar.html",
|
"text!./res/templates/bottombar.html",
|
||||||
"text!./res/templates/controls/action-button.html",
|
"text!./res/templates/controls/action-button.html",
|
||||||
"text!./res/templates/controls/input-filter.html",
|
"text!./res/templates/controls/input-filter.html",
|
||||||
@ -96,6 +97,7 @@ define([
|
|||||||
MCTSplitPane,
|
MCTSplitPane,
|
||||||
MCTSplitter,
|
MCTSplitter,
|
||||||
MCTTree,
|
MCTTree,
|
||||||
|
ReverseFilter,
|
||||||
bottombarTemplate,
|
bottombarTemplate,
|
||||||
actionButtonTemplate,
|
actionButtonTemplate,
|
||||||
inputFilterTemplate,
|
inputFilterTemplate,
|
||||||
@ -146,7 +148,8 @@ define([
|
|||||||
"depends": [
|
"depends": [
|
||||||
"stylesheets[]",
|
"stylesheets[]",
|
||||||
"$document",
|
"$document",
|
||||||
"THEME"
|
"THEME",
|
||||||
|
"ASSETS_PATH"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -158,7 +161,7 @@ define([
|
|||||||
],
|
],
|
||||||
"filters": [
|
"filters": [
|
||||||
{
|
{
|
||||||
"implementation": "filters/ReverseFilter.js",
|
"implementation": ReverseFilter,
|
||||||
"key": "reverse"
|
"key": "reverse"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -405,6 +408,11 @@ define([
|
|||||||
"key": "THEME",
|
"key": "THEME",
|
||||||
"value": "unspecified",
|
"value": "unspecified",
|
||||||
"priority": "fallback"
|
"priority": "fallback"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "ASSETS_PATH",
|
||||||
|
"value": ".",
|
||||||
|
"priority": "fallback"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"containers": [
|
"containers": [
|
||||||
|
@ -37,8 +37,10 @@ define(
|
|||||||
* @param {object[]} stylesheets stylesheet extension definitions
|
* @param {object[]} stylesheets stylesheet extension definitions
|
||||||
* @param $document Angular's jqLite-wrapped document element
|
* @param $document Angular's jqLite-wrapped document element
|
||||||
* @param {string} activeTheme the theme in use
|
* @param {string} activeTheme the theme in use
|
||||||
|
* @param {string} [assetPath] the directory relative to which
|
||||||
|
* stylesheets will be found
|
||||||
*/
|
*/
|
||||||
function StyleSheetLoader(stylesheets, $document, activeTheme) {
|
function StyleSheetLoader(stylesheets, $document, activeTheme, assetPath) {
|
||||||
var head = $document.find('head'),
|
var head = $document.find('head'),
|
||||||
document = $document[0];
|
document = $document[0];
|
||||||
|
|
||||||
@ -47,6 +49,7 @@ define(
|
|||||||
// Create a link element, and construct full path
|
// Create a link element, and construct full path
|
||||||
var link = document.createElement('link'),
|
var link = document.createElement('link'),
|
||||||
path = [
|
path = [
|
||||||
|
assetPath,
|
||||||
stylesheet.bundle.path,
|
stylesheet.bundle.path,
|
||||||
stylesheet.bundle.resources,
|
stylesheet.bundle.resources,
|
||||||
stylesheet.stylesheetUrl
|
stylesheet.stylesheetUrl
|
||||||
@ -68,6 +71,8 @@ define(
|
|||||||
stylesheet.theme === activeTheme;
|
stylesheet.theme === activeTheme;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assetPath = assetPath || ".";
|
||||||
|
|
||||||
// Add all stylesheets from extensions
|
// Add all stylesheets from extensions
|
||||||
stylesheets.filter(matchesTheme).forEach(addStyleSheet);
|
stylesheets.filter(matchesTheme).forEach(addStyleSheet);
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ define(
|
|||||||
|
|
||||||
it("adjusts link locations", function () {
|
it("adjusts link locations", function () {
|
||||||
expect(mockElement.setAttribute)
|
expect(mockElement.setAttribute)
|
||||||
.toHaveBeenCalledWith('href', "a/b/c/d.css");
|
.toHaveBeenCalledWith('href', "./a/b/c/d.css");
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("for themed stylesheets", function () {
|
describe("for themed stylesheets", function () {
|
||||||
@ -95,12 +95,13 @@ define(
|
|||||||
|
|
||||||
it("includes matching themes", function () {
|
it("includes matching themes", function () {
|
||||||
expect(mockElement.setAttribute)
|
expect(mockElement.setAttribute)
|
||||||
.toHaveBeenCalledWith('href', "a/b/c/themed.css");
|
.toHaveBeenCalledWith('href', "./a/b/c/themed.css");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("excludes mismatching themes", function () {
|
it("excludes mismatching themes", function () {
|
||||||
expect(mockElement.setAttribute)
|
expect(mockElement.setAttribute)
|
||||||
.not.toHaveBeenCalledWith('href', "a/b/c/bad-theme.css");
|
.not
|
||||||
|
.toHaveBeenCalledWith('href', "./a/b/c/bad-theme.css");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -42,11 +42,19 @@ define(
|
|||||||
function addWorker(worker) {
|
function addWorker(worker) {
|
||||||
var key = worker.key;
|
var key = worker.key;
|
||||||
if (!workerUrls[key]) {
|
if (!workerUrls[key]) {
|
||||||
|
if (worker.scriptUrl) {
|
||||||
workerUrls[key] = [
|
workerUrls[key] = [
|
||||||
worker.bundle.path,
|
worker.bundle.path,
|
||||||
worker.bundle.sources,
|
worker.bundle.sources,
|
||||||
worker.scriptUrl
|
worker.scriptUrl
|
||||||
].join("/");
|
].join("/");
|
||||||
|
} else if (worker.scriptText) {
|
||||||
|
var blob = new Blob(
|
||||||
|
[worker.scriptText],
|
||||||
|
{type: 'application/javascript'}
|
||||||
|
);
|
||||||
|
workerUrls[key] = URL.createObjectURL(blob);
|
||||||
|
}
|
||||||
sharedWorkers[key] = worker.shared;
|
sharedWorkers[key] = worker.shared;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,9 @@ define([
|
|||||||
"./src/controllers/TableOptionsController",
|
"./src/controllers/TableOptionsController",
|
||||||
'../../commonUI/regions/src/Region',
|
'../../commonUI/regions/src/Region',
|
||||||
'../../commonUI/browse/src/InspectorRegion',
|
'../../commonUI/browse/src/InspectorRegion',
|
||||||
|
"text!./res/templates/table-options-edit.html",
|
||||||
|
"text!./res/templates/rt-table.html",
|
||||||
|
"text!./res/templates/historical-table.html",
|
||||||
"legacyRegistry"
|
"legacyRegistry"
|
||||||
], function (
|
], function (
|
||||||
MCTTable,
|
MCTTable,
|
||||||
@ -35,6 +38,9 @@ define([
|
|||||||
TableOptionsController,
|
TableOptionsController,
|
||||||
Region,
|
Region,
|
||||||
InspectorRegion,
|
InspectorRegion,
|
||||||
|
tableOptionsEditTemplate,
|
||||||
|
rtTableTemplate,
|
||||||
|
historicalTableTemplate,
|
||||||
legacyRegistry
|
legacyRegistry
|
||||||
) {
|
) {
|
||||||
/**
|
/**
|
||||||
@ -127,8 +133,8 @@ define([
|
|||||||
{
|
{
|
||||||
"name": "Historical Table",
|
"name": "Historical Table",
|
||||||
"key": "table",
|
"key": "table",
|
||||||
|
"template": historicalTableTemplate,
|
||||||
"cssclass": "icon-tabular",
|
"cssclass": "icon-tabular",
|
||||||
"templateUrl": "templates/historical-table.html",
|
|
||||||
"needs": [
|
"needs": [
|
||||||
"telemetry"
|
"telemetry"
|
||||||
],
|
],
|
||||||
@ -139,7 +145,7 @@ define([
|
|||||||
"name": "Real-time Table",
|
"name": "Real-time Table",
|
||||||
"key": "rt-table",
|
"key": "rt-table",
|
||||||
"cssclass": "icon-tabular-realtime",
|
"cssclass": "icon-tabular-realtime",
|
||||||
"templateUrl": "templates/rt-table.html",
|
"template": rtTableTemplate,
|
||||||
"needs": [
|
"needs": [
|
||||||
"telemetry"
|
"telemetry"
|
||||||
],
|
],
|
||||||
@ -157,7 +163,7 @@ define([
|
|||||||
"representations": [
|
"representations": [
|
||||||
{
|
{
|
||||||
"key": "table-options-edit",
|
"key": "table-options-edit",
|
||||||
"templateUrl": "templates/table-options-edit.html"
|
"template": tableOptionsEditTemplate
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"stylesheets": [
|
"stylesheets": [
|
||||||
|
@ -72,7 +72,7 @@ define(
|
|||||||
|
|
||||||
// Assemble all gestures into a map, for easy look up
|
// Assemble all gestures into a map, for easy look up
|
||||||
gestures.forEach(function (gesture) {
|
gestures.forEach(function (gesture) {
|
||||||
gestureMap[gesture.key] = gesture;
|
gestureMap[gesture.key] = gestureMap[gesture.key] || gesture;
|
||||||
});
|
});
|
||||||
|
|
||||||
this.gestureMap = gestureMap;
|
this.gestureMap = gestureMap;
|
||||||
|
@ -28,6 +28,7 @@ define([
|
|||||||
"text!./res/templates/search-item.html",
|
"text!./res/templates/search-item.html",
|
||||||
"text!./res/templates/search.html",
|
"text!./res/templates/search.html",
|
||||||
"text!./res/templates/search-menu.html",
|
"text!./res/templates/search-menu.html",
|
||||||
|
"text!./src/services/GenericSearchWorker.js",
|
||||||
'legacyRegistry'
|
'legacyRegistry'
|
||||||
], function (
|
], function (
|
||||||
SearchController,
|
SearchController,
|
||||||
@ -37,6 +38,7 @@ define([
|
|||||||
searchItemTemplate,
|
searchItemTemplate,
|
||||||
searchTemplate,
|
searchTemplate,
|
||||||
searchMenuTemplate,
|
searchMenuTemplate,
|
||||||
|
searchWorkerText,
|
||||||
legacyRegistry
|
legacyRegistry
|
||||||
) {
|
) {
|
||||||
|
|
||||||
@ -114,7 +116,7 @@ define([
|
|||||||
"workers": [
|
"workers": [
|
||||||
{
|
{
|
||||||
"key": "genericSearchWorker",
|
"key": "genericSearchWorker",
|
||||||
"scriptUrl": "services/GenericSearchWorker.js"
|
"scriptText": searchWorkerText
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user