[Templates] load plot templates with require

Load templates with requirejs.

https://github.com/nasa/openmctweb/issues/673
This commit is contained in:
Pete Richards 2016-03-01 10:52:07 -08:00
parent 748673f99b
commit 96d9f8c194
3 changed files with 12 additions and 4 deletions

View File

@ -47,6 +47,8 @@ define([
"text!./res/templates/menu-arrow.html", "text!./res/templates/menu-arrow.html",
"text!./res/templates/back-arrow.html", "text!./res/templates/back-arrow.html",
"text!./res/templates/items/items.html", "text!./res/templates/items/items.html",
"text!./res/templates/browse/object-properties.html",
"text!./res/templates/browse/inspector-region.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
BrowseController, BrowseController,
@ -74,6 +76,8 @@ define([
menuArrowTemplate, menuArrowTemplate,
backArrowTemplate, backArrowTemplate,
itemsTemplate, itemsTemplate,
objectPropertiesTemplate,
inspectorRegionTemplate,
legacyRegistry legacyRegistry
) { ) {
"use strict"; "use strict";
@ -226,11 +230,11 @@ define([
}, },
{ {
"key": "object-properties", "key": "object-properties",
"templateUrl": "templates/browse/object-properties.html" "template": objectPropertiesTemplate
}, },
{ {
"key": "inspector-region", "key": "inspector-region",
"templateUrl": "templates/browse/inspector-region.html" "template": inspectorRegionTemplate
} }
], ],
"services": [ "services": [

View File

@ -27,6 +27,7 @@ define([
"./src/policies/PlotViewPolicy", "./src/policies/PlotViewPolicy",
"./src/PlotOptionsController", "./src/PlotOptionsController",
"text!./res/templates/plot.html", "text!./res/templates/plot.html",
"text!./res/templates/plot-options-browse.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
MCTChart, MCTChart,
@ -34,6 +35,7 @@ define([
PlotViewPolicy, PlotViewPolicy,
PlotOptionsController, PlotOptionsController,
plotTemplate, plotTemplate,
plotOptionsBrowseTemplate,
legacyRegistry legacyRegistry
) { ) {
"use strict"; "use strict";
@ -101,7 +103,7 @@ define([
"representations": [ "representations": [
{ {
"key": "plot-options-browse", "key": "plot-options-browse",
"templateUrl": "templates/plot-options-browse.html" "template": plotOptionsBrowseTemplate
} }
] ]
} }

View File

@ -38,6 +38,7 @@ define([
"text!./res/templates/controls/composite.html", "text!./res/templates/controls/composite.html",
"text!./res/templates/controls/menu-button.html", "text!./res/templates/controls/menu-button.html",
"text!./res/templates/controls/dialog.html", "text!./res/templates/controls/dialog.html",
"text!./res/templates/controls/radio.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
MCTForm, MCTForm,
@ -56,6 +57,7 @@ define([
compositeTemplate, compositeTemplate,
menuButtonTemplate, menuButtonTemplate,
dialogTemplate, dialogTemplate,
radioTemplate,
legacyRegistry legacyRegistry
) { ) {
"use strict"; "use strict";
@ -89,7 +91,7 @@ define([
}, },
{ {
"key": "radio", "key": "radio",
"templateUrl": "templates/controls/radio.html" "template": radioTemplate
}, },
{ {
"key": "datetime", "key": "datetime",