Ajout de la fonctionnalité Favoris (V2.2)
- Nouvelle catégorie Favoris: recuperation des favoris depuis Project.gfx (getFavorites.dg5) - Pages menuFavorites.dg5 et showDataFav.dg5 + bibliothèques JSZip/jQuery - Navigation index.dg5: ajout de la catégorie Favoris - Correctif override.dg5: exclusion des points /services/subnet - Bump version 2.2 et description "Alternative to Command" - Mise a jour README (doc Favoris + changelog)
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
// test if a parameter value is designer table
|
||||
let dgIframeId;
|
||||
function dgIsParamTable(val){
|
||||
return (val !== null && typeof(val)=='object' && val.hasOwnProperty('cols')
|
||||
&& val.hasOwnProperty('rows'));
|
||||
}
|
||||
// interface to the dglux5 application
|
||||
function onDGFrameMessage(e){
|
||||
var data = e.data;
|
||||
if (typeof(data)=='object'){
|
||||
if (data.hasOwnProperty('dgIframeInit')){
|
||||
dgIframeId = data['dgIframeInit'];
|
||||
console.log(dgIframeId);
|
||||
if (window.parent !== null){
|
||||
// the first post back shouldn't contain any data change
|
||||
window.parent.postMessage({'dgIframe':dgIframeId},'*');
|
||||
}
|
||||
} else if (data.hasOwnProperty('dgIframeUpdate')){
|
||||
var updates = data['updates'];
|
||||
if (typeof(updates)=='object'){
|
||||
if (typeof(dgParams) == 'object'){
|
||||
for (key in dgParams){
|
||||
if (updates.hasOwnProperty(key)){
|
||||
dgParams[key](updates[key]);
|
||||
}}}
|
||||
if (typeof(dgParamsUpdated) == 'function'){
|
||||
dgParamsUpdated();
|
||||
}}}}}
|
||||
window.addEventListener('message',onDGFrameMessage);
|
||||
// push parameter changes back to dglux
|
||||
function dgUpdateParams(changes) {
|
||||
if (dgIframeId !== null) {
|
||||
window.parent.postMessage({'dgIframe':dgIframeId, changes:changes},'*');
|
||||
} else {
|
||||
throw 'dgUpdateParams failed, handshake not finished';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user