Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcf7766b

Browse files
committed
wip
1 parente0ff2f3 commitcf7766b

File tree

7 files changed

+172
-160
lines changed

7 files changed

+172
-160
lines changed

‎_includes/scripts.html‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060

6161
<script>
6262
constcommandbarSegment=IS_GITOPS_DOC_COOKIE_SET ?'43836ac3':'3033bf7f'
63+
console.log(commandbarSegment,'segment!!!!')
6364

6465
varo=commandbarSegment,n=["Object.assign","Symbol","Symbol.for"].join("%2C"),a=window;functionr(o,n){void0===n&&(n=!1),"complete"!==document.readyState&&window.addEventListener("load",r.bind(null,o,n),{capture:!1,once:!0});vara=document.createElement("script");a.type="text/javascript",a.async=n,a.src=o,document.head.appendChild(a)}functiont(){varn;if(void0===a.CommandBar){deletea.__CommandBarBootstrap__;vart=Symbol.for("CommandBar::configuration"),e=Symbol.for("CommandBar::orgConfig"),i=Symbol.for("CommandBar::disposed"),c=Symbol.for("CommandBar::isProxy"),m=Symbol.for("CommandBar::queue"),d=Symbol.for("CommandBar::unwrap"),l=Symbol.for("CommandBar::eventSubscriptions"),s=[],u=localStorage.getItem("commandbar.lc"),f=u&&u.includes("local")?"http://localhost:8000":"https://api.commandbar.com",p=Object.assign(((n={})[t]={uuid:o},n[e]={},n[i]=!1,n[c]=!0,n[m]=newArray,n[d]=function(){returnp},n[l]=void0,n),a.CommandBar),b=["addCommand","boot","addEventSubscriber","addRecordAction","setFormFactor"],y=p;Object.assign(p,{shareCallbacks:function(){return{}},shareContext:function(){return{}}}),a.CommandBar=newProxy(p,{get:function(o,n){returnniny?p[n]:"then"!==n?b.includes(n)?function(){varo=Array.prototype.slice.call(arguments);returnnewPromise((function(a,r){o.unshift(n,a,r),p[m].push(o)}))}:function(){varo=Array.prototype.slice.call(arguments);o.unshift(n),p[m].push(o)}:void0}}),null!==u&&s.push("lc=".concat(u)),s.push("version=2"),r("".concat(f,"/latest/").concat(o,"?").concat(s.join("&")),!0)}}void0===Object.assign||"undefined"==typeofSymbol||void0===Symbol.for?(a.__CommandBarBootstrap__=t,r("https://polyfill.io/v3/polyfill.min.js?version=3.101.0&callback=__CommandBarBootstrap__&features="+n)):t();
6566
window.CommandBar.setThemeMode('dark_mode')
@@ -70,6 +71,7 @@
7071
);
7172

7273
document.addEventListener("keydown",function(event){
74+
console.log('here')
7375
constisMac=navigator.userAgent.includes('Mac');
7476
if((event.key==="k")&&((isMac&&event.metaKey)||(!isMac&&event.ctrlKey))){
7577
event.preventDefault();

‎assets/css/docs.min.css‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎assets/css/docs.min.css.map‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎assets/js/docs.min.js‎

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎assets/js/src/argohub-redirect.js‎

Lines changed: 141 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -1,178 +1,175 @@
1-
(()=>{
2-
/* global SITE_BASE_URL, SITE_GITOPS_COLLECTION, SITE_IS_GITOPS_COLLECTION */
1+
/* eslint-disable no-implicit-globals, strict */
2+
/* global SITE_BASE_URL, SITE_GITOPS_COLLECTION, SITE_IS_GITOPS_COLLECTION */
33

4-
'use strict'
4+
constGITOPS_DOC_COOKIE='cfdoctype=gitops'
5+
constIS_GITOPS_DOC_COOKIE_SET=document.cookie.includes(GITOPS_DOC_COOKIE)
56

6-
constGITOPS_DOC_COOKIE='cfdoctype=gitops'
7-
constIS_GITOPS_DOC_COOKIE_SET=document.cookie.includes(GITOPS_DOC_COOKIE)
7+
handleRedirect()
88

9-
handleRedirect()
9+
asyncfunctiongetArgoHubRedirectURL(currentPath){
10+
currentPath=currentPath.replace(SITE_BASE_URL,'')
1011

11-
asyncfunctiongetArgoHubRedirectURL(currentPath){
12-
currentPath=currentPath.replace(SITE_BASE_URL,'')
13-
14-
constredirectMap=awaitfetchRedirectMap()
15-
constnewPath=redirectMap[currentPath]
16-
if(!newPath){
17-
returnnull
18-
}
19-
20-
constnewURL=
21-
newPath===`/${SITE_GITOPS_COLLECTION}/`
22-
?`${location.href}${SITE_GITOPS_COLLECTION}`
23-
:location.href.replace(currentPath,newPath)
24-
25-
returnnewURL
12+
constredirectMap=awaitfetchRedirectMap()
13+
constnewPath=redirectMap[currentPath]
14+
if(!newPath){
15+
returnnull
2616
}
2717

28-
asyncfunctionhandleRedirect(){
29-
if(SITE_IS_GITOPS_COLLECTION||!IS_GITOPS_DOC_COOKIE_SET){
30-
return
31-
}
18+
constnewURL=
19+
newPath===`/${SITE_GITOPS_COLLECTION}/`
20+
?`${location.href}${SITE_GITOPS_COLLECTION}`
21+
:location.href.replace(currentPath,newPath)
3222

33-
constargoHubRedirectURL=awaitgetArgoHubRedirectURL(location.pathname)
34-
if(!argoHubRedirectURL){
35-
return
36-
}
23+
returnnewURL
24+
}
3725

38-
location.href=argoHubRedirectURL
26+
asyncfunctionhandleRedirect(){
27+
if(SITE_IS_GITOPS_COLLECTION||!IS_GITOPS_DOC_COOKIE_SET){
28+
return
3929
}
4030

41-
asyncfunctionfetchRedirectMap(){
42-
constresponse=awaitfetch(`${SITE_BASE_URL}/assets/js/src/argohub-redirect-mapping.json`)
43-
if(!response.ok){
44-
thrownewError('Failed to fetch the collections redirect map.')
45-
}
46-
returnresponse.json()
31+
constargoHubRedirectURL=awaitgetArgoHubRedirectURL(location.pathname)
32+
if(!argoHubRedirectURL){
33+
return
4734
}
4835

49-
functionsetGitOpsDocumentationCookie(){
50-
constmaxAge=2592000
51-
configureGitOpsDocumentationCookie(maxAge)
52-
}
36+
location.href=argoHubRedirectURL
37+
}
5338

54-
functionremoveGitOpsDocumentationCookie(){
55-
configureGitOpsDocumentationCookie(0)
39+
asyncfunctionfetchRedirectMap(){
40+
constresponse=awaitfetch(`${SITE_BASE_URL}/assets/js/src/argohub-redirect-mapping.json`)
41+
if(!response.ok){
42+
thrownewError('Failed to fetch the collections redirect map.')
5643
}
44+
returnresponse.json()
45+
}
5746

58-
functionconfigureGitOpsDocumentationCookie(maxAge){
59-
letcookie=`${GITOPS_DOC_COOKIE}; Max-Age=${maxAge}; Path=/; SameSite=Strict`
47+
functionsetGitOpsDocumentationCookie(){
48+
constmaxAge=2592000
49+
configureGitOpsDocumentationCookie(maxAge)
50+
}
6051

61-
if(location.protocol==='https:'){
62-
cookie+='; Secure'
63-
}
52+
functionremoveGitOpsDocumentationCookie(){
53+
configureGitOpsDocumentationCookie(0)
54+
}
6455

65-
if(location.hostname==='codefresh.io'){
66-
cookie+='; Domain=.codefresh.io'
67-
}
56+
functionconfigureGitOpsDocumentationCookie(maxAge){
57+
letcookie=`${GITOPS_DOC_COOKIE}; Max-Age=${maxAge}; Path=/; SameSite=Strict`
6858

69-
document.cookie=cookie
59+
if(location.protocol==='https:'){
60+
cookie+='; Secure'
7061
}
7162

72-
functiontoggleSegmentDropdown(){
73-
constselect=document.querySelector('.custom-select')
74-
select.classList.toggle('open')
63+
if(location.hostname==='codefresh.io'){
64+
cookie+='; Domain=.codefresh.io'
7565
}
7666

77-
// eslint-disable-next-line no-unused-vars
78-
functionhandleDropdownKeydown(event){
79-
constselect=document.querySelector('.custom-select')
80-
constoptions=select.querySelectorAll('.option')
81-
constisOpen=select.classList.contains('open')
82-
83-
switch(event.key){
84-
case'Enter':
85-
case' ':
86-
event.preventDefault()
67+
document.cookie=cookie
68+
}
69+
70+
functiontoggleSegmentDropdown(){
71+
constselect=document.querySelector('.custom-select')
72+
select.classList.toggle('open')
73+
}
74+
75+
// eslint-disable-next-line no-unused-vars
76+
functionhandleDropdownKeydown(event){
77+
constselect=document.querySelector('.custom-select')
78+
constoptions=select.querySelectorAll('.option')
79+
constisOpen=select.classList.contains('open')
80+
81+
switch(event.key){
82+
case'Enter':
83+
case' ':
84+
event.preventDefault()
85+
toggleSegmentDropdown()
86+
break
87+
case'ArrowDown':
88+
event.preventDefault()
89+
if(!isOpen){
8790
toggleSegmentDropdown()
88-
break
89-
case'ArrowDown':
90-
event.preventDefault()
91-
if(!isOpen){
92-
toggleSegmentDropdown()
93-
}
94-
options[0].focus()
95-
break
96-
case'Escape':
97-
if(isOpen){
98-
toggleSegmentDropdown()
99-
}
100-
break
101-
default:
102-
break
103-
}
104-
}
105-
106-
// eslint-disable-next-line no-unused-vars
107-
functionhandleOptionKeydown(event,option,selectedValue){
108-
constselect=document.querySelector('.custom-select')
109-
constoptions=select.querySelectorAll('.option')
110-
constcurrentIndex=Array.from(options).indexOf(option)
111-
112-
switch(event.key){
113-
case'Enter':
114-
case' ':
115-
event.preventDefault()
116-
selectSegmentOption(option,selectedValue)
117-
break
118-
case'ArrowDown':
119-
event.preventDefault()
120-
if(currentIndex<options.length-1){
121-
options[currentIndex+1].focus()
122-
}
123-
break
124-
case'ArrowUp':
125-
event.preventDefault()
126-
if(currentIndex>0){
127-
options[currentIndex-1].focus()
128-
}
129-
break
130-
case'Escape':
131-
select.classList.remove('open')
132-
select.querySelector('.select-display').focus()
133-
break
134-
default:
135-
break
136-
}
91+
}
92+
options[0].focus()
93+
break
94+
case'Escape':
95+
if(isOpen){
96+
toggleSegmentDropdown()
97+
}
98+
break
99+
default:
100+
break
137101
}
102+
}
138103

139-
asyncfunctionselectSegmentOption(option,selectedValue){
140-
constselectDisplay=document.querySelector('.select-display')
141-
selectDisplay.textContent=option.textContent
104+
asyncfunctionselectSegmentOption(option,selectedValue){
105+
constselectDisplay=document.querySelector('.select-display')
106+
selectDisplay.textContent=option.textContent
142107

143-
constredirectMap=awaitfetchRedirectMap()
144-
constpathname=window.location.pathname
145-
constcurrentPath=pathname.replace(SITE_BASE_URL,'')
108+
constredirectMap=awaitfetchRedirectMap()
109+
constpathname=window.location.pathname
110+
constcurrentPath=pathname.replace(SITE_BASE_URL,'')
146111

147-
if(selectedValue==='enterprise'){
148-
removeGitOpsDocumentationCookie()
112+
if(selectedValue==='enterprise'){
113+
removeGitOpsDocumentationCookie()
149114

150-
constenterprisePath=Object.keys(redirectMap).find(
151-
(key)=>redirectMap[key]===currentPath
152-
)
115+
constenterprisePath=Object.keys(redirectMap).find(
116+
(key)=>redirectMap[key]===currentPath
117+
)
153118

154-
if(enterprisePath){
155-
window.location.href=`${SITE_BASE_URL}${enterprisePath}`
156-
}else{
157-
window.location.href=`${SITE_BASE_URL}/`
158-
}
159-
}elseif(selectedValue==='gitops'){
160-
setGitOpsDocumentationCookie()
119+
if(enterprisePath){
120+
window.location.href=`${SITE_BASE_URL}${enterprisePath}`
121+
}else{
122+
window.location.href=`${SITE_BASE_URL}/`
123+
}
124+
}elseif(selectedValue==='gitops'){
125+
setGitOpsDocumentationCookie()
161126

162-
constgitOpsPath=redirectMap[currentPath]
127+
constgitOpsPath=redirectMap[currentPath]
163128

164-
if(gitOpsPath){
165-
window.location.href=`${SITE_BASE_URL}${gitOpsPath}`
166-
}else{
167-
window.location.href=`${SITE_BASE_URL}/${SITE_GITOPS_COLLECTION}/`
168-
}
129+
if(gitOpsPath){
130+
window.location.href=`${SITE_BASE_URL}${gitOpsPath}`
131+
}else{
132+
window.location.href=`${SITE_BASE_URL}/${SITE_GITOPS_COLLECTION}/`
169133
}
170134
}
171-
172-
document.addEventListener('click',(e)=>{
173-
constselect=document.querySelector('.custom-select')
174-
if(!select.contains(e.target)){
135+
}
136+
137+
// eslint-disable-next-line no-unused-vars
138+
functionhandleOptionKeydown(event,option,selectedValue){
139+
constselect=document.querySelector('.custom-select')
140+
constoptions=select.querySelectorAll('.option')
141+
constcurrentIndex=Array.from(options).indexOf(option)
142+
143+
switch(event.key){
144+
case'Enter':
145+
case' ':
146+
event.preventDefault()
147+
selectSegmentOption(option,selectedValue)
148+
break
149+
case'ArrowDown':
150+
event.preventDefault()
151+
if(currentIndex<options.length-1){
152+
options[currentIndex+1].focus()
153+
}
154+
break
155+
case'ArrowUp':
156+
event.preventDefault()
157+
if(currentIndex>0){
158+
options[currentIndex-1].focus()
159+
}
160+
break
161+
case'Escape':
175162
select.classList.remove('open')
176-
}
177-
})
178-
})()
163+
select.querySelector('.select-display').focus()
164+
break
165+
default:
166+
break
167+
}
168+
}
169+
170+
document.addEventListener('click',(e)=>{
171+
constselect=document.querySelector('.custom-select')
172+
if(!select.contains(e.target)){
173+
select.classList.remove('open')
174+
}
175+
})

‎assets/scss/custom-overrides.scss‎

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
1-
//.row > * {
2-
// flex-shrink: 0;
3-
// width: 100%;
4-
// padding-right: calc(var(--bs-gutter-x) * .5);
5-
// padding-left: calc(var(--bs-gutter-x) * .5);
6-
// margin-top: var(--bs-gutter-y);
7-
//}
1+
@mixinmake-container($padding-x:$container-padding-x) {
2+
width:100%;
3+
padding-right:$padding-x;
4+
padding-left:$padding-x;
5+
margin-right:auto;
6+
margin-left:auto;
7+
}
8+
9+
@mixinmake-container-max-widths($max-widths:$container-max-widths,$breakpoints:$grid-breakpoints) {
10+
@each$breakpoint,$container-max-widthin$max-widths {
11+
@includemedia-breakpoint-up($breakpoint,$breakpoints) {
12+
max-width:$container-max-width;
13+
}
14+
}
15+
}
16+
17+
.custom-container {
18+
@includemake-container();
19+
@includemake-container-max-widths();
20+
}

‎index.html‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<mainclass="bd-masthead bd-masthead-home"id="content"role="main">
66
<divclass="banner-home-inner">
7-
<divclass="container max-width-none">
7+
<divclass="custom-container">
88
<divclass="row align-items-center">
99
<!--<div class="mx-auto col-md-5 order-md-2 d-none d-sm-none d-md-block d-lg-block d-xlg-block">-->
1010
<!--<img class="img-fluid mb-3 mb-md-0" src="{{ site.baseurl }}/assets/img/favicons/android-chrome-512x512.png" alt="" width="288" height="288" />-->
@@ -81,7 +81,7 @@ <h2 class="mb-3 bd-text-white text-uppercase">
8181
</main>
8282

8383
<divclass="masthead-followup row m-0 border border-white">
84-
<divclass="container max-width-none">
84+
<divclass="custom-container">
8585
<divclass="row">
8686
{% for homeContent in site.data.home-content %}
8787
<divclass="col-12 col-md-3 p-4 p-md-4 followup-card-item border border-white">

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp