Skip to content

Commit 3cad50f

Browse files
authored
Merge pull request #190 from sboldyreva/php-updates
Update PHP
2 parents 69e5281 + e533305 commit 3cad50f

File tree

3 files changed

+1032
-274
lines changed

3 files changed

+1032
-274
lines changed
Lines changed: 80 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,100 @@
11
<script setup>
2-
import { ref, computed, useSlots } from 'vue'
2+
import { ref, computed, useSlots, onMounted, watch, nextTick } from 'vue'
33
44
const slots = useSlots()
55
const tabKeys = Object.keys(slots)
66
const activeTab = ref(tabKeys[0] ?? '')
77
const currentTab = computed(() => activeTab.value)
8+
const wrapperRef = ref(null)
9+
10+
function formatKey(key) {
11+
return key.replace(/[__]/g, ' ')
12+
}
13+
14+
defineProps({
15+
label: {
16+
type: String,
17+
default: ''
18+
}
19+
})
20+
21+
onMounted(() => {
22+
const hash = decodeURIComponent(window.location.hash.slice(1))
23+
if (tabKeys.includes(hash)) {
24+
activeTab.value = hash
25+
nextTick(() => {
26+
const el = wrapperRef.value
27+
if (el) {
28+
const offset = 80
29+
const top = el.getBoundingClientRect().top + window.scrollY - offset
30+
window.scrollTo({ top, behavior: 'smooth' })
31+
}
32+
})
33+
}
34+
})
35+
36+
watch(activeTab, (newVal) => {
37+
if (newVal) {
38+
history.replaceState(null, '', `#${encodeURIComponent(newVal)}`)
39+
}
40+
})
841
</script>
942
1043
<template>
11-
<div class="table-tabs mt-8 border rounded-lg overflow-hidden text-sm">
12-
<div class="bg-gray-50 flex justify-between items-center border-b">
13-
<!-- <span class="font-medium text-gray-700">Optional Text:span> -->
14-
<select
15-
v-model="activeTab"
16-
class="bg-white text-gray-800 text-sm rounded border-gray-300 focus:outline-none focus:ring-1 focus:ring-blue-500"
17-
>
44+
<div ref="wrapperRef" class="table-tabs" :id="activeTab">
45+
<div class="tab-header">
46+
<span v-if="label" class="label-text">
47+
{{ label }}
48+
</span>
49+
<select v-model="activeTab" class="tab-select">
1850
<option v-for="key in tabKeys" :key="key" :value="key">
19-
{{ key }}
51+
{{ formatKey(key) }}
2052
</option>
2153
</select>
2254
</div>
2355
24-
<div class="tab-content prose prose-sm max-w-none">
56+
<div class="tab-content">
2557
<slot :name="currentTab" />
2658
</div>
59+
60+
<div class="bottom-line" />
2761
</div>
2862
</template>
2963
3064
65+
<style scoped>
66+
.table-tabs {
67+
background: #fff;
68+
scroll-margin-top: 4rem;
69+
}
70+
71+
.tab-header {
72+
border-top: 1px solid #d1d5db;
73+
padding: 1rem 0;
74+
}
75+
76+
.label-text {
77+
color: #314659;
78+
}
79+
80+
.tab-select {
81+
background-color: #fff;
82+
color: #314659;
83+
font-size: 0.9rem;
84+
padding: 0.25rem 0.25rem;
85+
border: 1px solid #d1d5db;
86+
border-radius: 0.5rem;
87+
outline: none;
88+
}
89+
90+
.tab-select:focus {
91+
border-color: #5897fb;
92+
box-shadow: 0 0 0 1px #5897fb;
93+
}
94+
95+
.bottom-line {
96+
border-top: 1px solid #d1d5db;
97+
margin-top: 1rem;
98+
}
99+
</style>
100+

docs/.vuepress/routes.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,16 @@
2929
"/extended-lifecycle-support": "/els-for-os/",
3030
"/els-for-languages/php/#download-tuxcare-php-windows": "/els-for-languages/php/#download-and-install-tuxcare-php-windows",
3131
"/els-for-languages/php/#configure-php": "/els-for-languages/php/#download-and-install-tuxcare-php-windows",
32-
"/els-for-languages/php/#add-php-to-the-system-path": "/els-for-languages/php/#download-and-install-tuxcare-php-windows"
32+
"/els-for-languages/php/#add-php-to-the-system-path": "/els-for-languages/php/#download-and-install-tuxcare-php-windows",
33+
"/els-for-languages/php/#additional-configurations-optional": "/els-for-languages/php/#Enabling_a_module",
34+
"/els-for-languages/php/#enabling-a-module-through-default-ini": "/els-for-languages/php/#Enabling_a_module",
35+
"/els-for-languages/php/#enabling-a-module-through-the-configuration-files": "/els-for-languages/php/#Enabling_a_module",
36+
"/els-for-languages/php/#enabling-a-module-through-the-cli": "/els-for-languages/php/#Enabling_a_module",
37+
"/els-for-languages/php/#listing-enabled-modules-on-a-specific-version": "/els-for-languages/php/#Listing_enabled_modules_on_a_specific_version",
38+
"/els-for-languages/php/#location-of-default-ini": "/els-for-languages/php/#Location_of_default.ini",
39+
"/els-for-languages/php/#location-of-ini-config-files": "/els-for-languages/php/#Location_of_ini_config_files",
40+
"/els-for-languages/php/#running-code-on-a-specific-version-through-the-cli": "/els-for-languages/php/#Running_code_on_a_specific_version_through_the_CLI",
41+
"/els-for-languages/php/#modules-and-pecl-extensions": "/els-for-languages/php/#Modules_and_pecl_extensions",
42+
"/els-for-languages/php/#the-bin-files": "/els-for-languages/php/#The_bin_files",
43+
"/els-for-languages/php/#how-to-use-php-els": "/els-for-languages/php/#Increase_upload_or_memory_limits"
3344
}

0 commit comments

Comments
 (0)