PageSourceSearch

https://www.brei.men/assets/js/page/news.in.js

js brei.men collected 2026-10-04 21:18:42 UTC 4,066 bytes, 108 lines download raw bytes

1'use strict';
2(() => {
3  const layer = [
4    {
5      name: 'TOP',
6      href: '/',
7    },
8    {
9      name: 'NEWS',
10      href: '/news/',
11    },
12  ];
13
14  PAGE_FUNCTION.add('news_in', {
15    enter() {
16      var _PAGE_LAYER, _PAGE_LAYER$change;
17      (_PAGE_LAYER = PAGE_LAYER) === null || _PAGE_LAYER === void 0 ? void 0 : (_PAGE_LAYER$change = _PAGE_LAYER.change) === null || _PAGE_LAYER$change === void 0 ? void 0 : _PAGE_LAYER$change.call(_PAGE_LAYER, layer);
18      PAGE_NEWS_IN.setup();
19    },
20    leave() {
21      PAGE_NEWS_IN.destroy();
22    },
23  });
24
25  const PAGE_NEWS_IN = {
26    instance: {},
27    setup() {
28      this.instance[CURRENT_AREA_ID] = Vue.createApp(vNewsIn);
29      this.instance[CURRENT_AREA_ID].mount($_CURRENT_CONTENT.find('.v-news-in').get()[0]);
30    },
31    destroy() {
32      this.instance[PREV_AREA_ID].unmount();
33    },
34  };
35
36  const vNewsIn = Vue.defineComponent({
37    name: 'NewsIn',
38    setup(props, context) {
39      var _barba, _barba$history, _barba$history$previo, _barba2, _barba2$history, _barba2$history$previ;
40      // ========== INITIAL AREA ==========
41      const init = Vue.ref(false);
42      const state = Vue.ref(vStore.state);
43      Vue.onMounted(() => {
44        var _PAGE_LAYER2, _PAGE_LAYER2$push, _news$value;
45        if (!id) Pjax.changePage(''.concat(root.value, '/news/'));
46        init.value = true;
47
48        (_PAGE_LAYER2 = PAGE_LAYER) === null || _PAGE_LAYER2 === void 0
49          ? void 0
50          : (_PAGE_LAYER2$push = _PAGE_LAYER2.push) === null || _PAGE_LAYER2$push === void 0
51          ? void 0
52          : _PAGE_LAYER2$push.call(_PAGE_LAYER2, {
53              name: news === null || news === void 0 ? void 0 : (_news$value = news.value) === null || _news$value === void 0 ? void 0 : _news$value.title,
54            });
55        Vue.nextTick(() => {
56          Lazy.update();
57        });
58      });
59
60      // NEWS IN
61      const query = url.getQuery();
62      const id = query.id;
63      const newsApi = vStore.API.news;
64      const newsIndex = Vue.ref(-1);
65
66      const news = Vue.computed(() => {
67        newsIndex.value = newsApi.data.findIndex((data) => String(data.id) === id);
68        return newsIndex.value >= 0 ? newsApi.data[newsIndex.value] : null;
69      });
70      function linkURL(link) {
71        let id = undefined;
72        if (link.page === 'live') {
73          var _vStore$API$live, _vStore$API$live$data, _vStore$API$live$data2, _vStore$API$live$data3;
74          const filterTitle = news.value.title.replace(/^ライブ情報更新(|)$/g, '');
75          id =
76            (_vStore$API$live = vStore.API.live) === null || _vStore$API$live === void 0
77              ? void 0
78              : (_vStore$API$live$data = _vStore$API$live.data) === null || _vStore$API$live$data === void 0
79              ? void 0
80              : (_vStore$API$live$data2 = _vStore$API$live$data.filter((live) => live.title === filterTitle)) === null || _vStore$API$live$data2 === void 0
81              ? void 0
82              : (_vStore$API$live$data3 = _vStore$API$live$data2[0]) === null || _vStore$API$live$data3 === void 0
83              ? void 0
84              : _vStore$API$live$data3.id;
85        }
86        return id ? ''.concat(link.url, 'detail/?id=').concat(id) : link.url;
87      }
88      // back
89      const prevQuery =
90        ((_barba = barba) === null || _barba === void 0 ? void 0 : (_barba$history = _barba.history) === null || _barba$history === void 0 ? void 0 : (_barba$history$previo = _barba$history.previous) === null || _barba$history$previo === void 0 ? void 0 : _barba$history$previo.url) &&
91        new URI(
92          (_barba2 = barba) === null || _barba2 === void 0 ? void 0 : (_barba2$history = _barba2.history) === null || _barba2$history === void 0 ? void 0 : (_barba2$history$previ = _barba2$history.previous) === null || _barba2$history$previ === void 0 ? void 0 : _barba2$history$previ.url
93        ).search();
94
95      return {
96        // initial
97        root: root,
98        init,
99        state,
100        // news in
101        news,
102        // url
103        prevQuery,
104        linkURL,
105      };
106    },
107  });
108})();

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.