PageSourceSearch

https://shen-assistant-aliyun.zeabur.app/assets/policy-source.js

js shen-assistant-aliyun.zeabur.app collected 2026-10-03 16:35:38 UTC 5,017 bytes, 102 lines download raw bytes

1(function () {
2  'use strict';
3
4  var sources = {
5    'ltc-apply': {
6      label: '衛福部 1966 長照專區|申請長照服務',
7      url: 'https://1966.gov.tw/ltc/cp-6533-70777-207.html'
8    },
9    'ltc-payment': {
10      label: '衛福部 1966 長照專區|給付、額度與部分負擔',
11      url: 'https://1966.gov.tw/ltc/cp-6533-70777-207.html'
12    },
13    'ltc-2026': {
14      label: '衛福部|長照 3.0 給付辦法修正重點',
15      url: 'https://www.mohw.gov.tw/cp-7177-82811-1.html'
16    },
17    'yilan-ltc': {
18      label: '宜蘭縣長期照護服務管理所|申請方式及流程',
19      url: 'https://ltc.ilshb.gov.tw/cp.aspx?n=16276'
20    },
21    'foreign-caregiver': {
22      label: '勞動部|80 歲免評聘僱外籍家庭看護問答',
23      url: 'https://fw.wda.gov.tw/wda-employer/home/activity/2c95efb398624bf5019862cb5d920060'
24    },
25    'foreign-caregiver-options': {
26      label: '勞動部|家庭看護工申請與多元免評資格',
27      url: 'https://fw.wda.gov.tw/wda-employer/home/extra-mid-level/index/subCategory/2c95efb38e5d7562018e5f710c9d03a1?locale=zh'
28    },
29    'ltc-residential': {
30      label: '衛福部 1966 長照專區|住宿式服務使用者補助方案',
31      url: 'https://1966.gov.tw/ltc/cp-6457-69925-207.html'
32    }
33  };
34
35  if (!document.querySelector('[data-policy-source]')) return;
36
37  var style = document.createElement('style');
38  style.textContent = [
39    '.policy-source-notice,.policy-source-foot{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans TC",sans-serif;box-sizing:border-box}',
40    '.policy-source-notice{margin:1.25rem 0 .75rem;padding:.8rem 1rem;border-left:4px solid #9E7A34;border-radius:0 10px 10px 0;background:#fff8e7;color:#5f4a25;font-size:.88rem;line-height:1.7;font-weight:700}',
41    '.policy-source-foot{margin:.75rem 0 1.5rem;padding:.8rem 1rem;border:1px solid rgba(94,122,104,.22);border-radius:10px;background:#f6faf7;color:#4d6259;font-size:.8rem;line-height:1.7}',
42    '.policy-source-foot__links{display:flex;flex-wrap:wrap;gap:.25rem .7rem;margin-bottom:.25rem}',
43    '.policy-source-foot a{color:#285b48;text-decoration:underline;text-underline-offset:3px;font-weight:700}',
44    '.policy-source-foot__meta{display:flex;flex-wrap:wrap;gap:.4rem .85rem;align-items:center}',
45    '.policy-source-foot button{border:0;background:transparent;color:#285b48;padding:0;text-decoration:underline;text-underline-offset:3px;font:700 inherit;cursor:pointer}',
46    '@media print{.policy-source-foot button{display:none}}'
47  ].join('');
48  document.head.appendChild(style);
49
50  function displayDate(value) {
51    var parts = String(value || '').split('-');
52    if (parts.length !== 3) return value || '未標示';
53    return Number(parts[0]) + ' 年 ' + Number(parts[1]) + ' 月 ' + Number(parts[2]) + ' 日';
54  }
55
56  document.querySelectorAll('[data-policy-source]').forEach(function (block) {
57    if (block.dataset.policyDecorated === 'true') return;
58    block.dataset.policyDecorated = 'true';
59
60    var notice = document.createElement('aside');
61    notice.className = 'policy-source-notice';
62    notice.setAttribute('role', 'note');
63    notice.textContent = '長照政策與給付標準會隨政策調整,建議直接向官方查詢最新資訊';
64    block.parentNode.insertBefore(notice, block);
65
66    var keys = String(block.dataset.policySource || '').trim().split(/\s+/).filter(Boolean);
67    var links = keys.map(function (key) { return sources[key]; }).filter(Boolean);
68    var foot = document.createElement('aside');
69    foot.className = 'policy-source-foot';
70
71    var linksBox = document.createElement('div');
72    linksBox.className = 'policy-source-foot__links';
73    var label = document.createElement('strong');
74    label.textContent = '官方資料來源:';
75    linksBox.appendChild(label);
76    links.forEach(function (source) {
77      var link = document.createElement('a');
78      link.href = source.url;
79      link.textContent = source.label;
80      linksBox.appendChild(link);
81    });
82    if (!links.length) linksBox.appendChild(document.createTextNode('請撥 1966 查詢'));
83
84    var meta = document.createElement('div');
85    meta.className = 'policy-source-foot__meta';
86    var checked = document.createElement('span');
87    checked.textContent = '查核日期:' + displayDate(block.dataset.policyChecked);
88    var report = document.createElement('button');
89    report.type = 'button';
90    report.setAttribute('data-feedback-open', '');
91    report.setAttribute('data-feedback-type', '政策或補助資料需要更新');
92    var heading = block.querySelector('h2, h3, h4');
93    report.setAttribute('data-feedback-message', '我想回報「' + (heading ? heading.textContent.trim() : document.title) + '」的政策或補助資料:');
94    report.textContent = '資料有更新?問題回報';
95    meta.appendChild(checked);
96    meta.appendChild(report);
97
98    foot.appendChild(linksBox);
99    foot.appendChild(meta);
100    block.parentNode.insertBefore(foot, block.nextSibling);
101  });
102}());

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.