PageSourceSearch

https://www.p-portal.go.jp/pps-web-biz/resources/app/javascript/techtouch/prod_cookieconsent_init.js?v=001

js p-portal.go.jp collected 2026-10-03 21:38:49 UTC 7,713 bytes, 185 lines download raw bytes

1// obtain plugin
2var cc = initCookieConsent();
3
4function setCookie(name, value, options = {}) {
5  options = {
6    path: "/",
7    ...options,
8  };
9
10  if (options.expires && options.expires.toUTCString) {
11    options.expires = options.expires.toUTCString();
12  }
13
14  let updatedCookie =
15    encodeURIComponent(name) + "=" + encodeURIComponent(value);
16
17  for (let optionKey in options) {
18    updatedCookie += "; " + optionKey;
19    let optionValue = options[optionKey];
20    if (optionValue !== true) {
21      updatedCookie += "=" + optionValue;
22    }
23  }
24
25  document.cookie = updatedCookie;
26}
27function deleteCookie(name, Domain) {
28  setCookie(name, "", {
29    "max-age": -1,
30    Domain: Domain,
31  });
32}
33
34function progressOnTT() {
35  if (!window.TechtouchObject) {
36    window.TechtouchObject = {};
37  }
38
39  window.TechtouchObject.analyticsEnabled = cc.allowedCategory("analytics");
40  if (!cc.allowedCategory("analytics")) {
41    var arr = document.cookie.split(/=[^;]*(?:;\s*|$)/);
42    var domains = window.location.hostname
43      .split(".")
44      .map((_, index, domains) => domains.slice(index).join("."))
45      .reverse();
46    for (let i = 0; i < arr.length; i++) {
47      var name = arr[i];
48      if (/^_tt_session_/.test(name) || name === "_tt_geuid") {
49        for (let x = 0; x < domains.length; x++) {
50          var domain = domains[x];
51          deleteCookie(name, domain);
52        }
53      }
54    }
55  }
56}
57
58// run plugin with your configuration
59cc.run({
60  current_lang: "ja", // デフォルトの言語
61  autoclear_cookies: true,
62  cookie_name: "cookieconcent_status", // 同意Cookie名
63  cookie_expiration: 91, // Cookieの有効期限、日単位(91日=3ヶ月)
64  page_scripts: true,
65  auto_language: "browser",
66
67  gui_options: {
68    consent_modal: {
69      layout: "bar", // box,bar
70      position: "bottom center", // bottom,middle,top + left,right,center
71      transition: "slide",
72    },
73    settings_modal: {
74      layout: "box", // box,bar
75      position: "left", // right,left (available only if bar layout selected)
76      transition: "slide", // zoom,slide
77    },
78  },
79
80  onFirstAction: function () {
81    if (!window.TechtouchObject) {
82      window.TechtouchObject = {};
83    }
84    window.TechtouchObject.analyticsEnabled = false;
85  },
86
87  onAccept: function (cookie) {
88    progressOnTT();
89  },
90
91  onChange: function (cookie, changed_preferences) {
92    progressOnTT();
93  },
94
95  languages: {
96    ja: {
97      consent_modal: {
98        // [日本語版]同意バナーの文言記入箇所
99        description:
100        '調達ポータルではCookie等を使用して、アクセス状況の分析や利便性向上を行っています。Cookieについての詳細は<a href="https://www.p-portal.go.jp/pps-web-biz/resources/app/html/privacy.html" class="cc-link">プライバシーポリシー</a>をご確認ください。同意いただける方は「同意する」をクリックして下さい。Cookie設定をカスタマイズするには、<button type="button" data-cc="c-settings" class="cc-link">利用するCookieについて</button>をご利用ください。',
101        primary_btn: {
102          text: "同意する",
103          role: "accept_all", // 'accept_selected' or 'accept_all'
104        },
105        secondary_btn: {
106          text: "同意しない",
107          role: "accept_necessary", // 'settings' or 'accept_necessary'
108        },
109      },
110      settings_modal: {
111        title: "",
112        save_settings_btn: "設定を保存する",
113        accept_all_btn: "同意する",
114        reject_all_btn: "同意しない",
115        close_btn_label: "Close",
116        cookie_table_headers: [
117          { col1: "名前" },
118          { col2: "ホスト" },
119          { col3: "期間" },
120          { col4: "説明" },
121        ],
122        blocks: [
123          {
124            title: "利用するCookieについて",
125            // [日本語版]同意詳細ポップアップの文言記入箇所
126            description:
127            '調達ポータルではCookieを使用して、アクセス状況の分析や利便性向上を行っています。Cookieについての詳細は<a href="https://www.p-portal.go.jp/pps-web-biz/resources/app/html/privacy.html" class="cc-link">プライバシーポリシー</a>をご確認ください。これには、テックタッチ社が提供するサービスが使用するCookieを含みます。このCookieは以下の情報を取得します。<p>・利用環境に係る情報(デバイス情報、OS情報、ブラウザ情報等)</p><p>・利用者操作に係る情報(利用者が本システム内でアクセスしたページのURL、操作内容(クリック/入力※)等)</p><p>※操作の種類に係る情報のみ取得し、入力内容については取得しません。</p><p>なお、このCookieは以下のCookie設定よりオプトアウト(機能停止)することができます。オプトアウトした場合、上記情報が送信されなくなります。</p>',
128          },
129          {
130            title: "パフォーマンスCookie",
131            toggle: {
132              value: "analytics", // there are no default categories => you specify them
133              enabled: true,
134              readonly: false,
135            },
136          },
137        ],
138      },
139    },
140    en: {
141      consent_modal: {
142        // [英語版]同意バナーの文言記入箇所
143        description:
144        'To offer you a better browsing experience, this site uses cookies. To find out more, please access to our <a href="https://www.p-portal.go.jp/pps-web-biz/resources/app/html/privacy.html" class="cc-link">Privacy Policy</a>. By clicking "Accept" you consent to the use of cookies. To customize your cookies, please access this <button type="button" data-cc="c-settings" class="cc-link">cookies setting</button>.',
145        primary_btn: {
146          text: "Accept",
147          role: "accept_all", // 'accept_selected' or 'accept_all'
148        },
149        secondary_btn: {
150          text: "Denay",
151          role: "accept_necessary", // 'settings' or 'accept_necessary'
152        },
153      },
154      settings_modal: {
155        title: "",
156        save_settings_btn: "Save settings",
157        accept_all_btn: "Accept",
158        reject_all_btn: "Denay",
159        close_btn_label: "Close",
160        cookie_table_headers: [
161          { col1: "名前" },
162          { col2: "ホスト" },
163          { col3: "期間" },
164          { col4: "説明" },
165        ],
166        blocks: [
167          {
168            title: "Cookies used",
169            // [英語版]同意詳細ポップアップの文言記入箇所
170            description:
171            'To offer you a better browsing experience, this site uses cookies. To find out more, please access to our <a href="https://www.p-portal.go.jp/pps-web-biz/resources/app/html/privacy.html" class="cc-link">Privacy Policy</a>. These cookies include cookies used by services provided by Techtouch, Inc. This cookies enable a website to remenber information below.<p>・Information about user environment (device, OS, browser etc.)</p><p>・Information about user navigation (URL of the website which user access. Operation details (click / enter※)etc.)※Cookies only remember the categories of what user enter, which means it do not remember the content.</p><p>This cookies can be opted out (disabled) from the cookies setting below. If you opt out, information above will no longer be sent.</p>',
172          },
173          {
174            title: "Performance cookie",
175            toggle: {
176              value: "analytics", // there are no default categories => you specify them
177              enabled: true,
178              readonly: false,
179            },
180          },
181        ],
182      },
183    },
184  },
185});

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.