diff --git a/cms/src/app.postcss b/cms/src/app.postcss index deaebf7..d00ac4a 100644 --- a/cms/src/app.postcss +++ b/cms/src/app.postcss @@ -95,4 +95,8 @@ ::-webkit-scrollbar-thumb:hover { background-color: #a8bbbf; } + + .display-none{ + display: none; + } } diff --git a/cms/src/lib/components/url.js b/cms/src/lib/components/url.js new file mode 100644 index 0000000..ce03a12 --- /dev/null +++ b/cms/src/lib/components/url.js @@ -0,0 +1,36 @@ +import { derived, writable } from 'svelte/store' + +export function createUrlStore(ssrUrl) { + // Ideally a bundler constant so that it's tree-shakable + if (typeof window === 'undefined') { + const { subscribe } = writable(ssrUrl) + return { subscribe } + } + + const href = writable(window.location.href) + + const originalPushState = history.pushState + const originalReplaceState = history.replaceState + + const updateHref = () => href.set(window.location.href) + + history.pushState = function () { + originalPushState.apply(this, arguments) + updateHref() + } + + history.replaceState = function () { + originalReplaceState.apply(this, arguments) + updateHref() + } + + window.addEventListener('popstate', updateHref) + window.addEventListener('hashchange', updateHref) + + return { + subscribe: derived(href, ($href) => new URL($href)).subscribe + } +} + +// If you're using in a pure SPA, you can return a store directly and share it everywhere +export default createUrlStore() diff --git a/cms/src/lib/data/competitive-exam.json b/cms/src/lib/data/competitive-exam.json index a51ddb6..5aa8870 100644 --- a/cms/src/lib/data/competitive-exam.json +++ b/cms/src/lib/data/competitive-exam.json @@ -11,6 +11,28 @@ "url":"/images/c1.jpg" } ], + "regi":[ + { + "title":"เจ้าพนักงานเภสัชกรรมปฏิบัติงาน", + "url":"/" + }, + { + "title":"เจ้าพนักงานทันตสาธารณสุขปฏิบัติงาน", + "url":"/" + }, + { + "title":"ผู้ช่วยทันตแพทย์ปฏิบัติงาน", + "url":"/" + }, + { + "title":"ดุริยางคศิลปินปฏิบัติงาน", + "url":"/" + }, + { + "title":"คีตศิลปินปฏิบัติงาน", + "url":"/" + } + ], "files":[ { "title":"รายละเอียดประกาศ", diff --git a/cms/src/routes/+page.svelte b/cms/src/routes/+page.svelte index 58de954..532c11a 100644 --- a/cms/src/routes/+page.svelte +++ b/cms/src/routes/+page.svelte @@ -83,7 +83,7 @@ >