Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
howto-cards
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Marie Fossepre
howto-cards
Commits
f9974faf
Verified
Commit
f9974faf
authored
3 years ago
by
Laurent Heirendt
Browse files
Options
Downloads
Patches
Plain Diff
remove autoredirect
parent
b1a971ad
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.ci/.autoRedirect
+0
-96
0 additions, 96 deletions
.ci/.autoRedirect
with
0 additions
and
96 deletions
.ci/.autoRedirect
deleted
100644 → 0
+
0
−
96
View file @
b1a971ad
<html>
<head>
<script
type=
"text/javascript"
src=
"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"
></script>
<script
type=
"text/javascript"
>
function
UrlExists
(
url
,
cb
){
jQuery
.
ajax
({
url
:
url
,
dataType
:
'
text
'
,
type
:
'
GET
'
,
cache
:
false
,
complete
:
function
(
xhr
){
if
(
typeof
cb
===
'
function
'
)
cb
.
apply
(
this
,
[
xhr
.
status
]);
}
});
}
function
GetShortcutDestination
()
{
var
s
=
window
.
location
.
href
;
var
pathArray
=
s
.
split
(
'
?
'
);
// Cut the query if it exists
if
(
pathArray
.
length
>
1
)
{
return
pathArray
[
1
];
}
else
{
return
''
;
}
}
function
RedirectTo
(
newLocation
)
{
document
.
location
.
replace
(
newLocation
);
}
// Pick the shortcut link destination from URL, like: `category:subcategory:card-name`
var
sub
=
GetShortcutDestination
();
// Define URLs
var
internalPortalURL
=
'
https://r3-core.pages.uni.lu/howto-cards-internal
'
;
var
externalPortalURL
=
'
https://r3.pages.uni.lu/howto-cards
'
;
// First, check whether internal pages are accessible...
var
internalIndexURL
=
internalPortalURL
+
'
/index.html
'
;
UrlExists
(
internalIndexURL
,
function
(
status
){
if
(
status
===
200
){
// If the internal pages are accessible, try to redirect into correct page
if
(
sub
.
length
>
0
)
{
var
internalCardURL
=
internalPortalURL
+
'
/stable/internal/cards/
'
+
sub
;
UrlExists
(
internalCardURL
,
function
(
status
){
if
(
status
==
200
)
{
// The sub-card is internal, and is accessible
RedirectTo
(
internalCardURL
);
}
else
{
UrlExists
(
internalPortalURL
+
'
/stable/external/cards/
'
+
sub
,
function
(
status
){
if
(
status
==
200
)
{
// if sub-card is internal in the external directory and exists
RedirectTo
(
internalPortalURL
+
'
/stable/external/cards/
'
+
sub
);
}
else
{
RedirectTo
(
internalPortalURL
+
'
/stable/404.html
'
);
}
});
}
});
}
else
{
// The user did not request specific card, redirect him just to the stable index
var
internalPortalIndexURL
=
internalPortalURL
+
'
/stable
'
;
var
internalPortal404URL
=
internalPortalURL
+
'
/stable/404.html
'
;
UrlExists
(
internalPortalIndexURL
,
function
(
status
){
if
(
status
==
200
)
{
// if page is accessible
RedirectTo
(
internalPortalIndexURL
);
}
else
{
RedirectTo
(
internalPortal404URL
);
}
});
}
}
else
{
// The internal pages are not accessible, therefore the user is redirected into correct external page
if
(
sub
.
length
>
0
)
{
sub
=
'
external/cards/
'
+
sub
;
}
var
externalPortalCardURL
=
externalPortalURL
+
'
/stable/
'
+
sub
;
var
externalPortal404URL
=
externalPortalURL
+
'
/stable/404.html
'
;
UrlExists
(
externalPortalURL
+
'
/stable/
'
+
sub
,
function
(
status
){
if
(
status
==
200
)
{
// if sub-card is internal and exists
RedirectTo
(
externalPortalCardURL
);
}
else
{
RedirectTo
(
externalPortal404URL
);
}
});
}
});
</script>
</head>
<body>
<p>
Please follow to
<a
href=
"https://r3.pages.uni.lu/howto-cards/stable"
>
https://r3.pages.uni.lu/howto-cards/stable
</a>
!
</p>
</body>
</html>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment