diff --git a/web/app/cad/init/startApplication.js b/web/app/cad/init/startApplication.js index ab79961a..c76ab091 100644 --- a/web/app/cad/init/startApplication.js +++ b/web/app/cad/init/startApplication.js @@ -15,6 +15,7 @@ import * as CraftPlugin from '../craft/craftPlugin'; import * as StoragePlugin from '../storagePlugin'; import * as ProjectPlugin from '../projectPlugin'; import * as SketcherPlugin from '../sketch/sketcherPlugin'; +import * as tpiPlugin from '../tpiPlugin'; import * as PartModellerPlugin from '../part/partModellerPlugin'; @@ -37,7 +38,8 @@ export default function startApplication(callback) { OperationPlugin, CadRegistryPlugin, CraftPlugin, - SketcherPlugin + SketcherPlugin, + tpiPlugin ]; let plugins = [ diff --git a/web/app/cad/tpiPlugin.js b/web/app/cad/tpiPlugin.js new file mode 100644 index 00000000..7095e1e3 --- /dev/null +++ b/web/app/cad/tpiPlugin.js @@ -0,0 +1,8 @@ +import TPI from './tpi' + +/* + * TPI stands for the Test Program Interface + */ +export function activate({services}) { + services.TPI = TPI; +} \ No newline at end of file diff --git a/web/app/utils/jqueryfy.js b/web/app/utils/jqueryfy.js index 74ce9c95..3fe758b6 100644 --- a/web/app/utils/jqueryfy.js +++ b/web/app/utils/jqueryfy.js @@ -1,6 +1,6 @@ import $ from 'jquery' -// Usage of jquery is totally deprecated. It exists only to support legacy code and -// will be gone soon after complete transition to React. +// Usage of jquery is absolutely deprecated. It exists only to support legacy code(2d sketcher and test framework) and +// will be gone soon after complete transition to React. Main application never uses jquery. window.jQuery = window.$ = $; diff --git a/web/test/test.js b/web/test/test.js index 03310f98..c1e0949b 100644 --- a/web/test/test.js +++ b/web/test/test.js @@ -147,7 +147,7 @@ export function load(url, callback) { $(function() { // fire event when iframe is ready frame.load(function() { const win = frame.get(0).contentWindow; - callback(win, win.__CAD_APP) + callback(win, {TPI: win.__CAD_APP.services.tpi}) }); }); frame.attr('src', window.location.origin + url)