Skip to content

Commit cce09b2

Browse files
committed
### 4.3.4 (2019-10-28)
* (bluefox) Values are showed in select ID dialog * (bluefox) Allow select with $ the schedule objects
1 parent 148dcc4 commit cce09b2

File tree

2 files changed

+35
-2
lines changed

2 files changed

+35
-2
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ And then call "npm run build".
3232
- ...
3333

3434
## Changelog
35+
### 4.3.4 (2019-10-28)
36+
* (bluefox) Values are showed in select ID dialog
37+
* (bluefox) Allow select with $ the schedule objects
38+
3539
### 4.3.3 (2019-10-28)
3640
* (bluefox) Search in scripts was corrected
3741

lib/sandbox.js

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,17 @@ function sandBox(script, name, verbose, debug, context) {
641641
}
642642
}
643643

644+
if (name === 'schedule') {
645+
if (!context.schedules) {
646+
context.schedules = [];
647+
for (const _id in objects) {
648+
if (objects.hasOwnProperty(_id) && objects[_id].type === 'schedule') {
649+
context.schedules.push(_id);
650+
}
651+
}
652+
}
653+
}
654+
644655
/**
645656
* applies all selectors targeting an object or state ID
646657
* @param {string} objId
@@ -700,7 +711,25 @@ function sandBox(script, name, verbose, debug, context) {
700711
let res = [];
701712

702713
if (name === 'schedule') {
703-
adapter.getObjectsView
714+
res = context.schedules;
715+
if (objectIdSelectors.length) {
716+
res = res.filter(channelId => applyIDSelectors(channelId, objectIdSelectors));
717+
}
718+
719+
// filter out those that don't match every common selector
720+
if (commonSelectors.length) {
721+
res = res.filter(id => applyCommonSelectors(id));
722+
}
723+
724+
// filter out those that don't match every native selector
725+
if (nativeSelectors.length) {
726+
res = res.filter(id => applyNativeSelectors(id));
727+
}
728+
729+
// filter out those that don't match every enum selector
730+
if (enumSelectors.length) {
731+
res = res.filter(channelId => applyEnumSelectors(channelId));
732+
}
704733
} else
705734
if (name === 'channel') {
706735
if (!context.channels) {
@@ -774,7 +803,7 @@ function sandBox(script, name, verbose, debug, context) {
774803
} else {
775804
// go through all states
776805
res = context.stateIds;
777-
// if the "name" is not state then we filter for the ID aswell
806+
// if the "name" is not state then we filter for the ID as well
778807
if (name && name !== 'state') {
779808
const r = new RegExp('^' + name.replace(/\./g, '\\.').replace(/\*/g, '.*') + '$');
780809
res = res.filter(id => r.test(id));

0 commit comments

Comments
 (0)