diff --git a/gradle/docs.gradle b/gradle/docs.gradle index 1772212c507b..e0be846ea400 100644 --- a/gradle/docs.gradle +++ b/gradle/docs.gradle @@ -3,7 +3,16 @@ configurations { } dependencies { - asciidoctorExt("io.spring.asciidoctor:spring-asciidoctor-extensions:0.2.0.RELEASE") + asciidoctorExt("io.spring.asciidoctor:spring-asciidoctor-extensions-block-switch:0.4.0.RELEASE") +} + +repositories { + maven { + url "https://repo.spring.io/release" + mavenContent { + group "io.spring.asciidoctor" + } + } } /** diff --git a/src/docs/asciidoc/docinfo-footer.html b/src/docs/asciidoc/docinfo-footer.html index dad243ed6f94..a7a58d584ad9 100644 --- a/src/docs/asciidoc/docinfo-footer.html +++ b/src/docs/asciidoc/docinfo-footer.html @@ -1,3 +1,2 @@ - \ No newline at end of file diff --git a/src/docs/asciidoc/js/switch-language.js b/src/docs/asciidoc/js/switch-language.js deleted file mode 100644 index c3ba7a85608c..000000000000 --- a/src/docs/asciidoc/js/switch-language.js +++ /dev/null @@ -1,43 +0,0 @@ -function globalSwitch() { - - var SPRING_LANGUAGES = ["Java", "Kotlin"]; - var preferredLanguage = initPreferredLanguage(); - - function initPreferredLanguage() { - var lang = window.localStorage.getItem("preferred-spring-language"); - if (SPRING_LANGUAGES.indexOf(lang) === -1) { - window.localStorage.setItem("preferred-spring-language", SPRING_LANGUAGES[0]); - lang = SPRING_LANGUAGES[0]; - } - return lang; - } - - function switchItem(text, index) { - if (SPRING_LANGUAGES.indexOf(text) !== -1) { - window.localStorage.setItem("preferred-spring-language", text); - } - $(".switch--item").filter(function() { return ($(this).text() === text) }).each(function() { - $(this).addClass('selected'); - $(this).siblings().removeClass('selected'); - var selectedContent = $(this).parent().siblings(".content").eq(index) - selectedContent.removeClass('hidden'); - selectedContent.siblings().addClass('hidden'); - }); - } - - $('.switch--item').each(function() { - $(this).off('click'); - $(this).on('click', function() { - var selectedText = $(this).text() - var selectedIndex = $(this).index() - switchItem(selectedText, selectedIndex); - }); - }); - - var languageIndex = SPRING_LANGUAGES.indexOf(preferredLanguage); - if (languageIndex != 0) { - switchItem(preferredLanguage, languageIndex); - } -} - -$(globalSwitch); \ No newline at end of file