PageSourceSearch

https://www.juniperresearch.com/vue/scripts/GLOBAL_MobileMenu.js

js juniperresearch.com collected 2026-09-24 07:33:14 UTC 11,606 bytes, 289 lines download raw bytes

1import { _ as _export_sfc } from "./_plugin-vue_export-helper.js";
2import { o as openBlock, c as createElementBlock, a as createBaseVNode, n as normalizeClass, F as Fragment, b as renderList, t as toDisplayString, f as createCommentVNode, g as createApp } from "./@vue.js";
3import { A as APISettings } from "./ApiConfig.js";
4const MenuMobileMenu_vue_vue_type_style_index_0_lang = "";
5const _sfc_main$1 = {
6  props: ["menuitems"],
7  data() {
8    return {
9      activePath: "",
10      activeMenuItems: [],
11      latestActive: false,
12      subActive: false
13    };
14  },
15  methods: {
16    hasChildren(item) {
17      return item.children && item.children.length > 0;
18    },
19    toggleSubMenu(item) {
20      if (item === "latest") {
21        this.latestActive = !this.latestActive;
22        this.activePath = this.latestActive ? "latest" : "";
23      } else if (item === "subscription") {
24        this.subActive = !this.subActive;
25        this.activePath = this.subActive ? "subscription" : "";
26      } else {
27        if (this.isActive(item)) {
28          this.activePath = this.getParentPath(item);
29          this.activeMenuItems.pop();
30        } else {
31          this.activePath = item.url;
32          this.activeMenuItems.push(item);
33        }
34      }
35    },
36    isActive(item) {
37      return this.activePath.startsWith(item.url);
38    },
39    isActiveLatest() {
40      return this.latestActive;
41    },
42    isActiveSub() {
43      return this.subActive;
44    },
45    findItemByPath(path) {
46      return this.menuitems.streams.reduce((found, item) => {
47        if (found) {
48          return found;
49        }
50        if (this.hasChildren(item)) {
51          const childMatch = item.children.find((child) => path.startsWith(child.url));
52          if (childMatch) {
53            return childMatch;
54          }
55        }
56        return null;
57      }, null);
58    },
59    getParentPath(item) {
60      const parent = this.findItemByPath(item.url);
61      return parent ? parent.url : "";
62    },
63    goBack(item) {
64      const index = this.activeMenuItems.findIndex((menuItem) => menuItem === item);
65      this.activeMenuItems.splice(index + 1);
66      const parentItem = this.activeMenuItems[this.activeMenuItems.length - 1];
67      this.activePath = parentItem ? parentItem.url : "";
68    },
69    goBackLatest() {
70      this.latestActive = false;
71      this.activePath = "";
72    },
73    goBackSub() {
74      this.subActive = false;
75      this.activePath = "";
76    }
77  }
78};
79const _hoisted_1 = {
80  key: 0,
81  class: "submenu-overlay"
82};
83const _hoisted_2 = ["href"];
84const _hoisted_3 = ["onClick"];
85const _hoisted_4 = {
86  key: 0,
87  class: "submenu-overlay"
88};
89const _hoisted_5 = ["onClick"];
90const _hoisted_6 = {
91  key: 0,
92  class: "submenu-overlay"
93};
94const _hoisted_7 = ["onClick"];
95const _hoisted_8 = {
96  key: 0,
97  class: "submenu-overlay"
98};
99const _hoisted_9 = ["href"];
100const _hoisted_10 = ["onClick"];
101const _hoisted_11 = ["href"];
102const _hoisted_12 = ["onClick"];
103const _hoisted_13 = ["href"];
104const _hoisted_14 = ["href"];
105const _hoisted_15 = { class: "menu-label" };
106const _hoisted_16 = {
107  key: 0,
108  class: "submenu-overlay"
109};
110const _hoisted_17 = ["href"];
111function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
112  return openBlock(), createElementBlock("ul", null, [
113    createBaseVNode("li", null, [
114      createBaseVNode("div", {
115        onClick: _cache[0] || (_cache[0] = ($event) => $options.toggleSubMenu("latest")),
116        class: normalizeClass(["menu-label", { active: $options.isActiveLatest() }])
117      }, "Latest Research", 2),
118      $options.isActiveLatest() ? (openBlock(), createElementBlock("ul", _hoisted_1, [
119        (openBlock(true), createElementBlock(Fragment, null, renderList($props.menuitems.latest, (child, index) => {
120          return openBlock(), createElementBlock("li", {
121            key: "latest-" + index
122          }, [
123            createBaseVNode("div", {
124              class: normalizeClass(["menu-item", { active: $options.isActive(child) }])
125            }, [
126              createBaseVNode("a", {
127                class: "menu-label",
128                href: child.url
129              }, toDisplayString(child.title), 9, _hoisted_2)
130            ], 2)
131          ]);
132        }), 128)),
133        createBaseVNode("div", {
134          class: "submenu-back",
135          onClick: _cache[1] || (_cache[1] = ($event) => $options.goBackLatest())
136        }, "Back")
137      ])) : createCommentVNode("", true)
138    ]),
139    (openBlock(true), createElementBlock(Fragment, null, renderList($props.menuitems.streams, (item, index) => {
140      return openBlock(), createElementBlock("li", { key: index }, [
141        $options.hasChildren(item) ? (openBlock(), createElementBlock("div", {
142          key: 0,
143          class: normalizeClass({ active: $options.isActive(item) })
144        }, [
145          createBaseVNode("div", {
146            onClick: ($event) => $options.toggleSubMenu(item),
147            class: normalizeClass(["menu-label", { active: $options.isActive(item) }])
148          }, toDisplayString(item.title), 11, _hoisted_3),
149          $options.isActive(item) ? (openBlock(), createElementBlock("ul", _hoisted_4, [
150            (openBlock(true), createElementBlock(Fragment, null, renderList(item.children, (child, index2) => {
151              return openBlock(), createElementBlock("li", {
152                key: "child-" + index2
153              }, [
154                $options.hasChildren(child) ? (openBlock(), createElementBlock("div", {
155                  key: 0,
156                  class: normalizeClass(["menu-item", { active: $options.isActive(child) }])
157                }, [
158                  createBaseVNode("div", {
159                    onClick: ($event) => $options.toggleSubMenu(child),
160                    class: "menu-label"
161                  }, toDisplayString(child.title), 9, _hoisted_5),
162                  $options.isActive(child) ? (openBlock(), createElementBlock("ul", _hoisted_6, [
163                    (openBlock(true), createElementBlock(Fragment, null, renderList(child.children, (grandchild, index3) => {
164                      return openBlock(), createElementBlock("li", {
165                        key: "grandchild-" + index3
166                      }, [
167                        $options.hasChildren(grandchild) ? (openBlock(), createElementBlock("div", {
168                          key: 0,
169                          class: normalizeClass(["menu-item", { active: $options.isActive(grandchild) }])
170                        }, [
171                          createBaseVNode("div", {
172                            onClick: ($event) => $options.toggleSubMenu(grandchild),
173                            class: "menu-label"
174                          }, toDisplayString(grandchild.title), 9, _hoisted_7),
175                          $options.isActive(grandchild) ? (openBlock(), createElementBlock("ul", _hoisted_8, [
176                            (openBlock(true), createElementBlock(Fragment, null, renderList(grandchild.children, (greatgrandchild, index4) => {
177                              return openBlock(), createElementBlock("li", {
178                                key: "greatgrandchild-" + index4
179                              }, [
180                                createBaseVNode("a", {
181                                  class: "menu-label",
182                                  href: greatgrandchild.url
183                                }, toDisplayString(greatgrandchild.title), 9, _hoisted_9)
184                              ]);
185                            }), 128)),
186                            createBaseVNode("div", {
187                              class: "submenu-back",
188                              onClick: ($event) => $options.goBack(child)
189                            }, "Back", 8, _hoisted_10)
190                          ])) : createCommentVNode("", true)
191                        ], 2)) : (openBlock(), createElementBlock("div", {
192                          key: 1,
193                          class: normalizeClass({ active: $options.isActive(grandchild) })
194                        }, [
195                          createBaseVNode("a", {
196                            class: "menu-label",
197                            href: grandchild.url
198                          }, toDisplayString(grandchild.title), 9, _hoisted_11)
199                        ], 2))
200                      ]);
201                    }), 128)),
202                    createBaseVNode("div", {
203                      class: "submenu-back",
204                      onClick: ($event) => $options.goBack(item)
205                    }, "Back", 8, _hoisted_12)
206                  ])) : createCommentVNode("", true)
207                ], 2)) : (openBlock(), createElementBlock("div", {
208                  key: 1,
209                  class: normalizeClass({ active: $options.isActive(child) })
210                }, [
211                  createBaseVNode("a", {
212                    class: "menu-label",
213                    href: child.url
214                  }, toDisplayString(child.title), 9, _hoisted_13)
215                ], 2))
216              ]);
217            }), 128))
218          ])) : createCommentVNode("", true)
219        ], 2)) : (openBlock(), createElementBlock("a", {
220          key: 1,
221          href: item.url,
222          class: normalizeClass({ active: $options.isActive(item) })
223        }, [
224          createBaseVNode("div", _hoisted_15, toDisplayString(item.title), 1)
225        ], 10, _hoisted_14))
226      ]);
227    }), 128)),
228    createBaseVNode("li", null, [
229      createBaseVNode("div", {
230        onClick: _cache[2] || (_cache[2] = ($event) => $options.toggleSubMenu("subscription")),
231        class: normalizeClass(["menu-label", { active: $options.isActiveSub() }])
232      }, "Subscriptions", 2),
233      $options.isActiveSub() ? (openBlock(), createElementBlock("ul", _hoisted_16, [
234        (openBlock(true), createElementBlock(Fragment, null, renderList($props.menuitems.subscriptions, (child, index) => {
235          return openBlock(), createElementBlock("li", {
236            key: "sub-" + index
237          }, [
238            createBaseVNode("div", {
239              class: normalizeClass(["menu-item", { active: $options.isActive(child) }])
240            }, [
241              createBaseVNode("a", {
242                class: "menu-label",
243                href: child.url
244              }, toDisplayString(child.title), 9, _hoisted_17)
245            ], 2)
246          ]);
247        }), 128)),
248        createBaseVNode("div", {
249          class: "submenu-back",
250          onClick: _cache[3] || (_cache[3] = ($event) =>
250 $options.goBackSub())
251        }, "Back")
252      ])) : createCommentVNode("", true)
253    ])
254  ]);
255}
256const MobileMenu = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render], ["__file", "C:/Work/Juniper research/2023/JuniperUmbraco11/VueSrc/components/Menu-MobileMenu.vue"]]);
257const _sfc_main = {
258  name: "Global.Mobile.Menu",
259  components: {
260    "j-mobilemenu": MobileMenu
261  },
262  data() {
263    return {
264      menuitems: []
265    };
266  },
267  mounted() {
268    this.show();
269    this.getData();
270  },
271  methods: {
272    show() {
273      $(".vue-inital-load").show();
274    },
275    getData() {
276      APISettings.headers.set("Content-Type", "multipart/form-data");
277      APISettings.headers.set("Authorization", "Bearer " + window.token);
278      fetch(APISettings.baseURL + "/menuoptionapi/getmobilemenu", {
279        method: "POST",
280        headers: APISettings.headers
281        //body: data
282      }).then((response) => response.json()).then((data) => {
283        this.menuitems = data;
284      });
285    }
286  }
287};
288const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "C:/Work/Juniper research/2023/JuniperUmbraco11/VueSrc/apps/Global_MobileMenu.vue"]]);
289createApp(App).mount("#mobilemenu");

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.