diff --git a/platform/commonUI/browse/bundle.js b/platform/commonUI/browse/bundle.js index 5ff13d789e..b0aa7e4277 100644 --- a/platform/commonUI/browse/bundle.js +++ b/platform/commonUI/browse/bundle.js @@ -41,6 +41,7 @@ define([ "text!./res/templates/items/items.html", "text!./res/templates/browse/object-properties.html", "text!./res/templates/browse/inspector-region.html", + "text!./res/templates/view-object.html", 'legacyRegistry' ], function ( BrowseController, @@ -63,6 +64,7 @@ define([ itemsTemplate, objectPropertiesTemplate, inspectorRegionTemplate, + viewObjectTemplate, legacyRegistry ) { @@ -142,7 +144,7 @@ define([ "representations": [ { "key": "view-object", - "templateUrl": "templates/view-object.html" + "template": viewObjectTemplate }, { "key": "browse-object", diff --git a/platform/commonUI/general/bundle.js b/platform/commonUI/general/bundle.js index 15ea3076a6..66d9b3de95 100644 --- a/platform/commonUI/general/bundle.js +++ b/platform/commonUI/general/bundle.js @@ -48,6 +48,7 @@ define([ "./src/directives/MCTSplitPane", "./src/directives/MCTSplitter", "./src/directives/MCTTree", + "./src/filters/ReverseFilter", "text!./res/templates/bottombar.html", "text!./res/templates/controls/action-button.html", "text!./res/templates/controls/input-filter.html", @@ -96,6 +97,7 @@ define([ MCTSplitPane, MCTSplitter, MCTTree, + ReverseFilter, bottombarTemplate, actionButtonTemplate, inputFilterTemplate, @@ -146,7 +148,8 @@ define([ "depends": [ "stylesheets[]", "$document", - "THEME" + "THEME", + "ASSETS_PATH" ] }, { @@ -158,7 +161,7 @@ define([ ], "filters": [ { - "implementation": "filters/ReverseFilter.js", + "implementation": ReverseFilter, "key": "reverse" } ], @@ -405,6 +408,11 @@ define([ "key": "THEME", "value": "unspecified", "priority": "fallback" + }, + { + "key": "ASSETS_PATH", + "value": ".", + "priority": "fallback" } ], "containers": [ diff --git a/platform/commonUI/general/src/StyleSheetLoader.js b/platform/commonUI/general/src/StyleSheetLoader.js index 13c5075a8b..7f5cabe7c1 100644 --- a/platform/commonUI/general/src/StyleSheetLoader.js +++ b/platform/commonUI/general/src/StyleSheetLoader.js @@ -37,8 +37,10 @@ define( * @param {object[]} stylesheets stylesheet extension definitions * @param $document Angular's jqLite-wrapped document element * @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'), document = $document[0]; @@ -47,6 +49,7 @@ define( // Create a link element, and construct full path var link = document.createElement('link'), path = [ + assetPath, stylesheet.bundle.path, stylesheet.bundle.resources, stylesheet.stylesheetUrl @@ -68,6 +71,8 @@ define( stylesheet.theme === activeTheme; } + assetPath = assetPath || "."; + // Add all stylesheets from extensions stylesheets.filter(matchesTheme).forEach(addStyleSheet); } diff --git a/platform/commonUI/general/test/StyleSheetLoaderSpec.js b/platform/commonUI/general/test/StyleSheetLoaderSpec.js index 272ad61bf9..4dfb20e82d 100644 --- a/platform/commonUI/general/test/StyleSheetLoaderSpec.js +++ b/platform/commonUI/general/test/StyleSheetLoaderSpec.js @@ -69,7 +69,7 @@ define( it("adjusts link locations", function () { expect(mockElement.setAttribute) - .toHaveBeenCalledWith('href', "a/b/c/d.css"); + .toHaveBeenCalledWith('href', "./a/b/c/d.css"); }); describe("for themed stylesheets", function () { @@ -95,12 +95,13 @@ define( it("includes matching themes", function () { expect(mockElement.setAttribute) - .toHaveBeenCalledWith('href', "a/b/c/themed.css"); + .toHaveBeenCalledWith('href', "./a/b/c/themed.css"); }); it("excludes mismatching themes", function () { expect(mockElement.setAttribute) - .not.toHaveBeenCalledWith('href', "a/b/c/bad-theme.css"); + .not + .toHaveBeenCalledWith('href', "./a/b/c/bad-theme.css"); }); }); diff --git a/platform/execution/src/WorkerService.js b/platform/execution/src/WorkerService.js index d809a568f2..87efd6f7da 100644 --- a/platform/execution/src/WorkerService.js +++ b/platform/execution/src/WorkerService.js @@ -42,11 +42,19 @@ define( function addWorker(worker) { var key = worker.key; if (!workerUrls[key]) { - workerUrls[key] = [ - worker.bundle.path, - worker.bundle.sources, - worker.scriptUrl - ].join("/"); + if (worker.scriptUrl) { + workerUrls[key] = [ + worker.bundle.path, + worker.bundle.sources, + worker.scriptUrl + ].join("/"); + } else if (worker.scriptText) { + var blob = new Blob( + [worker.scriptText], + {type: 'application/javascript'} + ); + workerUrls[key] = URL.createObjectURL(blob); + } sharedWorkers[key] = worker.shared; } } diff --git a/platform/features/table/bundle.js b/platform/features/table/bundle.js index 4c7b77b47e..6f7d285a50 100644 --- a/platform/features/table/bundle.js +++ b/platform/features/table/bundle.js @@ -27,6 +27,9 @@ define([ "./src/controllers/TableOptionsController", '../../commonUI/regions/src/Region', '../../commonUI/browse/src/InspectorRegion', + "text!./res/templates/table-options-edit.html", + "text!./res/templates/rt-table.html", + "text!./res/templates/historical-table.html", "legacyRegistry" ], function ( MCTTable, @@ -35,6 +38,9 @@ define([ TableOptionsController, Region, InspectorRegion, + tableOptionsEditTemplate, + rtTableTemplate, + historicalTableTemplate, legacyRegistry ) { /** @@ -127,8 +133,8 @@ define([ { "name": "Historical Table", "key": "table", + "template": historicalTableTemplate, "cssclass": "icon-tabular", - "templateUrl": "templates/historical-table.html", "needs": [ "telemetry" ], @@ -139,7 +145,7 @@ define([ "name": "Real-time Table", "key": "rt-table", "cssclass": "icon-tabular-realtime", - "templateUrl": "templates/rt-table.html", + "template": rtTableTemplate, "needs": [ "telemetry" ], @@ -157,7 +163,7 @@ define([ "representations": [ { "key": "table-options-edit", - "templateUrl": "templates/table-options-edit.html" + "template": tableOptionsEditTemplate } ], "stylesheets": [ diff --git a/platform/representation/src/gestures/GestureProvider.js b/platform/representation/src/gestures/GestureProvider.js index 5e170f68ac..051dafd5a7 100644 --- a/platform/representation/src/gestures/GestureProvider.js +++ b/platform/representation/src/gestures/GestureProvider.js @@ -72,7 +72,7 @@ define( // Assemble all gestures into a map, for easy look up gestures.forEach(function (gesture) { - gestureMap[gesture.key] = gesture; + gestureMap[gesture.key] = gestureMap[gesture.key] || gesture; }); this.gestureMap = gestureMap; diff --git a/platform/search/bundle.js b/platform/search/bundle.js index 61a266d049..7f8a64ab04 100644 --- a/platform/search/bundle.js +++ b/platform/search/bundle.js @@ -28,6 +28,7 @@ define([ "text!./res/templates/search-item.html", "text!./res/templates/search.html", "text!./res/templates/search-menu.html", + "text!./src/services/GenericSearchWorker.js", 'legacyRegistry' ], function ( SearchController, @@ -37,6 +38,7 @@ define([ searchItemTemplate, searchTemplate, searchMenuTemplate, + searchWorkerText, legacyRegistry ) { @@ -114,7 +116,7 @@ define([ "workers": [ { "key": "genericSearchWorker", - "scriptUrl": "services/GenericSearchWorker.js" + "scriptText": searchWorkerText } ] }