svghmi/gen_index_xhtml.ysl2
branchsvghmi
changeset 2867 901c89c0cc08
parent 2866 59a855c17aa6
child 2868 8d9757191f05
equal deleted inserted replaced
2866:59a855c17aa6 2867:901c89c0cc08
    67         noindex > HMI_ROOT
    67         noindex > HMI_ROOT
    68         noindex > HMI_PLC_STATUS
    68         noindex > HMI_PLC_STATUS
    69         noindex > HMI_CURRENT_PAGE
    69         noindex > HMI_CURRENT_PAGE
    70     }
    70     }
    71     const "categories", "exsl:node-set($_categories)";
    71     const "categories", "exsl:node-set($_categories)";
    72     const "_indexed_hmitree" apply "$hmitree", mode="index";
       
    73     const "indexed_hmitree", "exsl:node-set($_indexed_hmitree)";
       
    74 
    72 
    75 
    73 
    76     // returns all directly or indirectly refered elements
    74     // returns all directly or indirectly refered elements
    77     def "func:refered_elements" {
    75     def "func:refered_elements" {
    78         param "elems";
    76         param "elems";
   261 
   259 
   262     // Avoid nested detachables
   260     // Avoid nested detachables
   263     const "_detachable_elements", "func:detachable_elements($hmi_pages)";
   261     const "_detachable_elements", "func:detachable_elements($hmi_pages)";
   264     const "detachable_elements", "$_detachable_elements[not(ancestor::*/@id = $_detachable_elements/@id)]";
   262     const "detachable_elements", "$_detachable_elements[not(ancestor::*/@id = $_detachable_elements/@id)]";
   265 
   263 
       
   264 
   266     //////////////// HMI Tree Index
   265     //////////////// HMI Tree Index
       
   266 
       
   267     const "_indexed_hmitree" apply "$hmitree", mode="index";
       
   268     const "indexed_hmitree", "exsl:node-set($_indexed_hmitree)";
   267 
   269 
   268     template "*", mode="index" {
   270     template "*", mode="index" {
   269         param "index", "0";
   271         param "index", "0";
   270         param "parentpath", "''";
   272         param "parentpath", "''";
   271         const "content" {
   273         const "content" {
   820         |     ],
   822         |     ],
   821     }
   823     }
   822     template "widget[@type='Jump']", mode="widget_defs" {
   824     template "widget[@type='Jump']", mode="widget_defs" {
   823         param "hmi_element";
   825         param "hmi_element";
   824         |     on_click: function(evt) {
   826         |     on_click: function(evt) {
   825         |         console.log(evt);
       
   826         |         switch_page(this.args[0]);
   827         |         switch_page(this.args[0]);
   827         |     },
   828         |     },
   828         |     init: function() {
   829         |     init: function() {
   829         /* registering event this way doies not "click" through svg:use 
   830         /* registering event this way doies not "click" through svg:use 
   830         |     this.element.onclick = evt => switch_page(this.args[0]);
   831         |     this.element.onclick = evt => switch_page(this.args[0]);