1313import { Dropdown } from 'bootstrap' ;
1414/* eslint-disable new-cap */
1515import 'bootstrap/dist/css/bootstrap.min.css' ;
16+ import 'ace-diff/styles' ;
1617import './main.scss' ;
1718import * as Connections from './modules/connections/connections.js' ;
1819import * as ConnectionsCRUD from './modules/connections/connectionsCRUD.js' ;
@@ -33,13 +34,16 @@ import * as Attributes from './modules/things/attributes.js';
3334import * as FeatureMessages from './modules/things/featureMessages.js' ;
3435import * as Features from './modules/things/features.js' ;
3536import * as Fields from './modules/things/fields.js' ;
36- import * as MessagesIncoming from './modules/things/messagesIncoming.js' ;
37+ import * as ThingsHistory from './modules/things/thingsHistory.js' ;
38+ import * as ThingUpdates from './modules/things/thingUpdates.js' ;
3739import * as SearchFilter from './modules/things/searchFilter.js' ;
3840import * as ThingMessages from './modules/things/thingMessages.js' ;
3941import * as Things from './modules/things/things.js' ;
4042import * as ThingsCRUD from './modules/things/thingsCRUD.js' ;
4143import * as ThingsSearch from './modules/things/thingsSearch.js' ;
4244import * as ThingsSSE from './modules/things/thingsSSE.js' ;
45+ import { SubDiff } from './modules/things/subDiff.js' ;
46+ import { ThingsDiff } from './modules/things/thingsDiff.js' ;
4347import { WoTDescription } from './modules/things/wotDescription.js' ;
4448import * as Utils from './modules/utils.js' ;
4549import './modules/utils/crudToolbar.js' ;
@@ -56,7 +60,8 @@ document.addEventListener('DOMContentLoaded', async function() {
5660 await ThingsCRUD . ready ( ) ;
5761 await ThingMessages . ready ( ) ;
5862 await ThingsSSE . ready ( ) ;
59- MessagesIncoming . ready ( ) ;
63+ ThingsHistory . ready ( ) ;
64+ ThingUpdates . ready ( ) ;
6065 Attributes . ready ( ) ;
6166 await Fields . ready ( ) ;
6267 await SearchFilter . ready ( ) ;
@@ -86,13 +91,35 @@ document.addEventListener('DOMContentLoaded', async function() {
8691 Things . addChangeListener ( thingDescription . onReferenceChanged ) ;
8792 await thingDescription . ready ( ) ;
8893
94+ const thingsDiff = ThingsDiff ( {
95+ itemsId : 'tabItemsThing' ,
96+ contentId : 'tabContentThing' ,
97+ } ) ;
98+ await thingsDiff . ready ( ) ;
99+ Things . addChangeListener ( thingsDiff . onThingChanged ) ;
100+
101+ const attributesDiff = SubDiff ( {
102+ itemsId : 'tabItemsAttribute' ,
103+ contentId : 'tabContentAttribute' ,
104+ } , 'Compare attributes between two revisions' ) ;
105+ await attributesDiff . ready ( ) ;
106+ thingsDiff . addSubDiff ( attributesDiff , 'attributes' ) ;
107+
89108 const featureDescription = WoTDescription ( {
90109 itemsId : 'tabItemsFeatures' ,
91110 contentId : 'tabContentFeatures' ,
92111 } , true ) ;
93112 Features . addChangeListener ( featureDescription . onReferenceChanged ) ;
94113 await featureDescription . ready ( ) ;
95114
115+ const featureDiff = SubDiff ( {
116+ itemsId : 'tabItemsFeatures' ,
117+ contentId : 'tabContentFeatures' ,
118+ } , 'Compare selected feature between two revisions' ) ;
119+ await featureDiff . ready ( ) ;
120+ thingsDiff . addSubDiff ( featureDiff , 'feature' ) ;
121+ Features . addChangeListener ( thingsDiff . onFeatureChanged ) ;
122+
96123 // make dropdowns not cutting off
97124 new Dropdown ( document . querySelector ( '.dropdown-toggle' ) , {
98125 popperConfig : {
0 commit comments