tpi plugin

This commit is contained in:
Val Erastov 2018-01-23 01:13:56 -08:00
parent 557ff168df
commit 2bd771a4a3
4 changed files with 14 additions and 4 deletions

View file

@ -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 = [

8
web/app/cad/tpiPlugin.js Normal file
View file

@ -0,0 +1,8 @@
import TPI from './tpi'
/*
* TPI stands for the Test Program Interface
*/
export function activate({services}) {
services.TPI = TPI;
}

View file

@ -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.$ = $;

View file

@ -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)