Merge pull request #45932 from marcoroth/migrate-guides-to-turbo

Migrate Rails Guides from `Turbolinks` to `Turbo`
This commit is contained in:
Rafael Mendonça França 2022-11-14 18:33:44 -05:00 committed by GitHub
commit b85296efe6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 3886 additions and 36 deletions

View File

@ -21,6 +21,7 @@ nd
ned
noone
objekt
optin
ot
overthere
reenable

View File

@ -1,2 +1,2 @@
clipboard.js linguist-vendored
turbolinks.js linguist-vendored
turbo.js linguist-vendored

View File

@ -23,10 +23,7 @@
for(var i = 0; i < array.length; i++) callback(array[i]);
}
// Viewable on local
if (window.location.protocol === "file:") Turbolinks.supported = false;
document.addEventListener("turbolinks:load", function() {
document.addEventListener("turbo:load", function() {
var guidesMenu = document.getElementById("guidesMenu");
var guides = document.getElementById("guides");
@ -52,11 +49,7 @@
guidesIndexItem.value = currentGuidePath.substring(currentGuidePath.lastIndexOf("/") + 1) || 'index.html';
guidesIndexItem.addEventListener("change", function(e) {
if (Turbolinks.supported) {
Turbolinks.visit(e.target.value);
} else {
window.location = e.target.value;
}
Turbo.visit(e.target.value);
});
var moreInfoButton = document.querySelector(".more-info-button");

3862
guides/assets/javascripts/turbo.js vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -12,4 +12,4 @@ Import advanced style sheet
@import url("reset.css");
@import url("main.css");
@import url("dark.css");
@import url("turbolinks.css");
@import url("turbo.css");

View File

@ -1,3 +1,3 @@
.turbolinks-progress-bar {
.turbo-progress-bar {
background-color: #c52f24;
}

View File

@ -16,17 +16,17 @@
<% end %>
<p>
The guides for earlier releases:
<a href="https://guides.rubyonrails.org/v7.0/" data-turbolinks="false">Rails 7.0</a>,
<a href="https://guides.rubyonrails.org/v6.1/" data-turbolinks="false">Rails 6.1</a>,
<a href="https://guides.rubyonrails.org/v6.0/" data-turbolinks="false">Rails 6.0</a>,
<a href="https://guides.rubyonrails.org/v5.2/" data-turbolinks="false">Rails 5.2</a>,
<a href="https://guides.rubyonrails.org/v5.1/" data-turbolinks="false">Rails 5.1</a>,
<a href="https://guides.rubyonrails.org/v5.0/" data-turbolinks="false">Rails 5.0</a>,
<a href="https://guides.rubyonrails.org/v4.2/" data-turbolinks="false">Rails 4.2</a>,
<a href="https://guides.rubyonrails.org/v4.1/" data-turbolinks="false">Rails 4.1</a>,
<a href="https://guides.rubyonrails.org/v4.0/" data-turbolinks="false">Rails 4.0</a>,
<a href="https://guides.rubyonrails.org/v3.2/" data-turbolinks="false">Rails 3.2</a>,
<a href="https://guides.rubyonrails.org/v3.1/" data-turbolinks="false">Rails 3.1</a>,
<a href="https://guides.rubyonrails.org/v3.0/" data-turbolinks="false">Rails 3.0</a>, and
<a href="https://guides.rubyonrails.org/v2.3/" data-turbolinks="false">Rails 2.3</a>.
<a href="https://guides.rubyonrails.org/v7.0/" data-turbo="false">Rails 7.0</a>,
<a href="https://guides.rubyonrails.org/v6.1/" data-turbo="false">Rails 6.1</a>,
<a href="https://guides.rubyonrails.org/v6.0/" data-turbo="false">Rails 6.0</a>,
<a href="https://guides.rubyonrails.org/v5.2/" data-turbo="false">Rails 5.2</a>,
<a href="https://guides.rubyonrails.org/v5.1/" data-turbo="false">Rails 5.1</a>,
<a href="https://guides.rubyonrails.org/v5.0/" data-turbo="false">Rails 5.0</a>,
<a href="https://guides.rubyonrails.org/v4.2/" data-turbo="false">Rails 4.2</a>,
<a href="https://guides.rubyonrails.org/v4.1/" data-turbo="false">Rails 4.1</a>,
<a href="https://guides.rubyonrails.org/v4.0/" data-turbo="false">Rails 4.0</a>,
<a href="https://guides.rubyonrails.org/v3.2/" data-turbo="false">Rails 3.2</a>,
<a href="https://guides.rubyonrails.org/v3.1/" data-turbo="false">Rails 3.1</a>,
<a href="https://guides.rubyonrails.org/v3.0/" data-turbo="false">Rails 3.0</a>, and
<a href="https://guides.rubyonrails.org/v2.3/" data-turbo="false">Rails 2.3</a>.
</p>

View File

@ -4,13 +4,13 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><%= yield(:page_title) %></title>
<link rel="stylesheet" type="text/css" href="stylesheets/style.css" data-turbolinks-track="reload">
<link rel="stylesheet" type="text/css" href="stylesheets/style.css" data-turbo-track="reload">
<link rel="stylesheet" type="text/css" href="stylesheets/print.css" media="print">
<link rel="stylesheet" type="text/css" href="stylesheets/highlight.css" data-turbolinks-track="reload">
<link rel="stylesheet" type="text/css" href="stylesheets/highlight.css" data-turbo-track="reload">
<link href="images/favicon.ico" rel="icon" type="image/x-icon" />
<script src="javascripts/turbolinks.js" data-turbolinks-track="reload"></script>
<script src="javascripts/clipboard.js" data-turbolinks-track="reload"></script>
<script src="javascripts/guides.js" data-turbolinks-track="reload"></script>
<script src="javascripts/turbo.js" data-turbo-track="reload"></script>
<script src="javascripts/clipboard.js" data-turbo-track="reload"></script>
<script src="javascripts/guides.js" data-turbo-track="reload"></script>
<meta property="og:title" content="<%= yield(:page_title) %>" />
<meta name="description" content="<%= yield(:description) %>" />
<meta property="og:description" content="<%= yield(:description) %>" />