ts-glitter 18.3.3 → 18.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -845,6 +845,23 @@ export class Language {
845
845
  { key: 'chat', tw: '聊聊', cn: '聊聊', en: 'chat' },
846
846
  { key: 'collect', tw: '收藏', cn: '收藏', en: 'collect' },
847
847
  { key: 'h_collect', tw: '已收藏', cn: '已收藏', en: 'collected' },
848
+ { key: 'cookie_use', tw: `
849
+ 本網站中使用 cookie,欲查詢有關本網站使用 cookie 方式之詳情,及若您不希望在電腦上使用 cookie 時應如何變更電腦的 cookie 設定,請參閱本網站「 <a class="fw-bold" style="font-size:16px;color:${window.glitter.share.globalValue['theme_color.0.solid-button-text']};" href="/privacy">
850
+ 隱私權條款
851
+ </a> 」之 Cookie 聲明。您繼續使用本網站即表示您同意本公司得按本網站使用條款之 Cookie 聲明使用 cookie。
852
+ `, en: `
853
+ This website uses cookies. To learn more about how this website uses cookies and how to change your computer's cookie settings if you do not wish to use cookies, please refer to the Cookie Statement in our <a class="fw-bold"
854
+ style="color:${window.glitter.share.globalValue['theme_color.0.solid-button-text']};font-size:16px;"
855
+ href="/privacy">
856
+ Privacy Policy
857
+ </a>. By continuing to use this website, you agree to our use of cookies as described in the Cookie Statement of our Terms of Use.
858
+ `, cn: `
859
+ 本网站使用 Cookie。欲了解本网站如何使用 Cookie,以及如果您不希望在计算机上使用 Cookie 时应如何更改计算机的 Cookie 设置,请参阅本网站『
860
+ <a href="/privacy"
861
+ style="color:${window.glitter.share.globalValue['theme_color.0.solid-button-text']};font-size:16px;"
862
+ >隐私政策</a>
863
+ 』**中的 Cookie 声明。您继续使用本网站即表示您同意本公司按照本网站使用条款中的 Cookie 声明使用 Cookie。
864
+ ` }
848
865
  ];
849
866
  }
850
867
  static getLanguageCustomText(text) {
@@ -853,6 +853,23 @@ export class Language {
853
853
  { key: 'chat', tw: '聊聊', cn: '聊聊', en: 'chat' },
854
854
  { key: 'collect', tw: '收藏', cn: '收藏', en: 'collect' },
855
855
  { key: 'h_collect', tw: '已收藏', cn: '已收藏', en: 'collected' },
856
+ {key: 'cookie_use',tw:`
857
+ 本網站中使用 cookie,欲查詢有關本網站使用 cookie 方式之詳情,及若您不希望在電腦上使用 cookie 時應如何變更電腦的 cookie 設定,請參閱本網站「 <a class="fw-bold" style="font-size:16px;color:${(window as any).glitter.share.globalValue['theme_color.0.solid-button-text']};" href="/privacy">
858
+ 隱私權條款
859
+ </a> 」之 Cookie 聲明。您繼續使用本網站即表示您同意本公司得按本網站使用條款之 Cookie 聲明使用 cookie。
860
+ `,en:`
861
+ This website uses cookies. To learn more about how this website uses cookies and how to change your computer's cookie settings if you do not wish to use cookies, please refer to the Cookie Statement in our <a class="fw-bold"
862
+ style="color:${(window as any).glitter.share.globalValue['theme_color.0.solid-button-text']};font-size:16px;"
863
+ href="/privacy">
864
+ Privacy Policy
865
+ </a>. By continuing to use this website, you agree to our use of cookies as described in the Cookie Statement of our Terms of Use.
866
+ `,cn: `
867
+ 本网站使用 Cookie。欲了解本网站如何使用 Cookie,以及如果您不希望在计算机上使用 Cookie 时应如何更改计算机的 Cookie 设置,请参阅本网站『
868
+ <a href="/privacy"
869
+ style="color:${(window as any).glitter.share.globalValue['theme_color.0.solid-button-text']};font-size:16px;"
870
+ >隐私政策</a>
871
+ 』**中的 Cookie 声明。您继续使用本网站即表示您同意本公司按照本网站使用条款中的 Cookie 声明使用 Cookie。
872
+ `}
856
873
  ];
857
874
  }
858
875
 
@@ -11,6 +11,7 @@ import { init } from '../GVController.js';
11
11
  import { TriggerEvent } from "./trigger-event.js";
12
12
  import { GlobalUser } from "../../glitter-base/global/global-user.js";
13
13
  import { FirstBanner } from "../../public-components/banner/first-banner.js";
14
+ import { Language } from "../../glitter-base/global/language.js";
14
15
  init(import.meta.url, (gvc, glitter, gBundle) => {
15
16
  var _a, _b, _c, _d;
16
17
  glitter.share.htmlExtension = (_a = glitter.share.htmlExtension) !== null && _a !== void 0 ? _a : {};
@@ -89,7 +90,7 @@ init(import.meta.url, (gvc, glitter, gBundle) => {
89
90
  }
90
91
  return {
91
92
  onCreateView: () => {
92
- var _a, _b, _c, _d, _e, _f, _g, _h;
93
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
93
94
  FirstBanner.main({ gvc: gvc });
94
95
  if (gBundle.page_config.seo && (gBundle.page_config.seo.type === "custom") && gBundle.page_config.seo.title) {
95
96
  glitter.setUrlParameter('', undefined, [
@@ -275,6 +276,23 @@ init(import.meta.url, (gvc, glitter, gBundle) => {
275
276
  }, 50);
276
277
  },
277
278
  }));
279
+ if ((localStorage.getItem('cookie_accept') != 'true') && ((_j = window.store_info.cookie_check) !== null && _j !== void 0 ? _j : true)) {
280
+ map.push(`
281
+ <div class="position-fixed rounded-3 d-flex align-items-center flex-column flex-sm-row p-3 privacy-notice" style="width:852px;max-width:calc(100vw - 30px);background: ${glitter.share.globalValue['theme_color.0.solid-button-bg']};
282
+ color: ${glitter.share.globalValue['theme_color.0.solid-button-text']};
283
+ z-index: 99999;bottom: 30px;transform: translateX(-50%);left: 50%;">
284
+ <div style="font-size: 14px;
285
+ ">${Language.text('cookie_use')}</div>
286
+ <div class="d-sm-none w-100 border-top my-3"></div>
287
+ <div class="d-flex align-items-center justify-content-center fw-bold" style="min-width: 150px;cursor: pointer;" onclick="${gvc.event(() => {
288
+ localStorage.setItem('cookie_accept', 'true');
289
+ for (const b of document.querySelectorAll('.privacy-notice')) {
290
+ b.remove();
291
+ }
292
+ })}">我知道了</div>
293
+ </div>
294
+ `);
295
+ }
278
296
  return map.join('');
279
297
  }
280
298
  };
@@ -3,6 +3,7 @@ import {TriggerEvent} from "./trigger-event.js";
3
3
  import {EditorConfig} from "../../editor-config.js";
4
4
  import {GlobalUser} from "../../glitter-base/global/global-user.js";
5
5
  import {FirstBanner} from "../../public-components/banner/first-banner.js";
6
+ import {Language} from "../../glitter-base/global/language.js";
6
7
 
7
8
  init(import.meta.url, (gvc, glitter, gBundle) => {
8
9
  glitter.share.htmlExtension = glitter.share.htmlExtension ?? {};
@@ -14,7 +15,7 @@ init(import.meta.url, (gvc, glitter, gBundle) => {
14
15
  mainView: ''
15
16
  };
16
17
 
17
- console.log(`the-page`,gvc.glitter.getUrlParameter('page'))
18
+ console.log(`the-page`, gvc.glitter.getUrlParameter('page'))
18
19
  console.log(`waitCreateView-time:`, (window as any).renderClock.stop())
19
20
 
20
21
  async function load() {
@@ -66,32 +67,32 @@ init(import.meta.url, (gvc, glitter, gBundle) => {
66
67
  }
67
68
  })
68
69
  };
69
- if(!gBundle.data){
70
- gBundle.data={}
70
+ if (!gBundle.data) {
71
+ gBundle.data = {}
71
72
  }
72
73
  return {
73
74
  onCreateView: () => {
74
- FirstBanner.main({gvc:gvc})
75
+ FirstBanner.main({gvc: gvc})
75
76
  //定義SEO TITLE
76
- if(gBundle.page_config.seo && (gBundle.page_config.seo.type==="custom") && gBundle.page_config.seo.title){
77
- glitter.setUrlParameter('',undefined,[
77
+ if (gBundle.page_config.seo && (gBundle.page_config.seo.type === "custom") && gBundle.page_config.seo.title) {
78
+ glitter.setUrlParameter('', undefined, [
78
79
  gBundle.page_config.seo.title_prefix ?? "",
79
80
  gBundle.page_config.seo.title ?? '',
80
81
  gBundle.page_config.seo.title_suffix ?? "",
81
82
  ].join(''))
82
- }else{
83
- glitter.setUrlParameter('',undefined,[
83
+ } else {
84
+ glitter.setUrlParameter('', undefined, [
84
85
  (window as any).home_seo.title_prefix ?? "",
85
86
  (window as any).home_seo.title ?? '',
86
87
  (window as any).home_seo.title_suffix ?? "",
87
88
  ].join(''))
88
89
  }
89
90
  //判斷如果是帳號頁面,且未登入則重新導向
90
- if(gvc.glitter.getUrlParameter('page')==='account_userinfo' && !GlobalUser.token){
91
- gvc.glitter.href='/login'
91
+ if (gvc.glitter.getUrlParameter('page') === 'account_userinfo' && !GlobalUser.token) {
92
+ gvc.glitter.href = '/login'
92
93
  return ``
93
94
  }
94
- document.querySelector('body')!.style.background=gBundle.app_config._background || glitter.share.globalValue[`theme_color.0.background`];
95
+ document.querySelector('body')!.style.background = gBundle.app_config._background || glitter.share.globalValue[`theme_color.0.background`];
95
96
  console.log(`onCreateView-time:`, (window as any).renderClock.stop())
96
97
  const mainId = glitter.getUUID()
97
98
  let map = [];
@@ -135,14 +136,14 @@ init(import.meta.url, (gvc, glitter, gBundle) => {
135
136
  style: ``,
136
137
  app_config: gBundle.app_config,
137
138
  page_config: gBundle.page_config,
138
- onCreate:()=>{
139
+ onCreate: () => {
139
140
  console.log(`createRender`)
140
141
  }
141
142
  }))
142
143
  } else {
143
144
  vm.loading = false
144
145
  }
145
- let toggle_d_none=true
146
+ let toggle_d_none = true
146
147
  map.push(gvc.bindView({
147
148
  bind: mainId,
148
149
  view: () => {
@@ -155,6 +156,7 @@ init(import.meta.url, (gvc, glitter, gBundle) => {
155
156
  if (gBundle.page_config.template) {
156
157
  (window as any).glitterInitialHelper.getPageData(gBundle.page_config.template, (data: any) => {
157
158
  const template_config = JSON.parse(JSON.stringify(data.response.result[0].config))
159
+
158
160
  function findContainer(set: any) {
159
161
  set.map((dd: any, index: number) => {
160
162
  if (dd.type === 'glitter_article') {
@@ -199,6 +201,7 @@ init(import.meta.url, (gvc, glitter, gBundle) => {
199
201
  }
200
202
  });
201
203
  }
204
+
202
205
  findContainer(template_config);
203
206
  resolve(new glitter.htmlGenerate(template_config, [], gBundle.data, true).render(gvc, {
204
207
  class: ``,
@@ -227,7 +230,7 @@ init(import.meta.url, (gvc, glitter, gBundle) => {
227
230
  style: ``,
228
231
  app_config: gBundle.app_config,
229
232
  page_config: gBundle.page_config,
230
- is_page:true
233
+ is_page: true
231
234
  })
232
235
  ));
233
236
  }
@@ -236,9 +239,9 @@ is_page:true
236
239
  })
237
240
 
238
241
  },
239
- divCreate: ()=>{
242
+ divCreate: () => {
240
243
  return {
241
- class: glitter.htmlGenerate.styleEditor(gBundle.page_config).class()+((toggle_d_none) ? ' d-none':''),
244
+ class: glitter.htmlGenerate.styleEditor(gBundle.page_config).class() + ((toggle_d_none) ? ' d-none' : ''),
242
245
  style: `overflow-x:hidden;min-height: 100%;min-width: 100%;${glitter.htmlGenerate.styleEditor(gBundle.page_config).style()}`
243
246
  }
244
247
  },
@@ -251,13 +254,31 @@ is_page:true
251
254
  }
252
255
  }
253
256
  })
254
- toggle_d_none=false
255
- setTimeout(()=>{
257
+ toggle_d_none = false
258
+ setTimeout(() => {
256
259
  $('.new_page_loading').addClass('d-none');
257
260
  (document.querySelector(`[gvc-id='${gvc.id(mainId)}']`) as any).classList.remove('d-none')
258
- },50)
261
+ }, 50)
259
262
  },
260
263
  }))
264
+ if ((localStorage.getItem('cookie_accept') != 'true') && ( (window as any).store_info.cookie_check ?? true)) {
265
+ map.push(`
266
+ <div class="position-fixed rounded-3 d-flex align-items-center flex-column flex-sm-row p-3 privacy-notice" style="width:852px;max-width:calc(100vw - 30px);background: ${glitter.share.globalValue['theme_color.0.solid-button-bg']};
267
+ color: ${glitter.share.globalValue['theme_color.0.solid-button-text']};
268
+ z-index: 99999;bottom: 30px;transform: translateX(-50%);left: 50%;">
269
+ <div style="font-size: 14px;
270
+ ">${Language.text('cookie_use')}</div>
271
+ <div class="d-sm-none w-100 border-top my-3"></div>
272
+ <div class="d-flex align-items-center justify-content-center fw-bold" style="min-width: 150px;cursor: pointer;" onclick="${gvc.event(() => {
273
+ localStorage.setItem('cookie_accept', 'true')
274
+ for (const b of document.querySelectorAll('.privacy-notice')) {
275
+ b.remove()
276
+ }
277
+ })}">我知道了</div>
278
+ </div>
279
+ `)
280
+ }
281
+
261
282
  return map.join('');
262
283
 
263
284
  }
@@ -724,7 +724,7 @@ Setting_editor.menuItems = () => {
724
724
  icon: '',
725
725
  page: 'shop_informationV2',
726
726
  group: '商店設定',
727
- title: '商店訊息',
727
+ title: '全站設定',
728
728
  appName: 'cms_system',
729
729
  groupIcon: 'https://d3jnmi1tfjgtti.cloudfront.net/file/252530754/1716566571091-Property 1=gear-regular.svg',
730
730
  moduleName: '商店設計',
@@ -29,7 +29,7 @@ export class Setting_editor {
29
29
  icon: '',
30
30
  page: 'shop_informationV2',
31
31
  group: '商店設定',
32
- title: '商店訊息',
32
+ title: '全站設定',
33
33
  appName: 'cms_system',
34
34
  groupIcon: 'https://d3jnmi1tfjgtti.cloudfront.net/file/252530754/1716566571091-Property 1=gear-regular.svg',
35
35
  moduleName: '商店設計',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-glitter",
3
- "version": "18.3.3",
3
+ "version": "18.3.4",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {