diff --git a/doc/_themes/odoodoc/static/app.js b/doc/_themes/odoodoc/static/app.js index 3619cd9cff1..a03d3b2ad27 100644 --- a/doc/_themes/odoodoc/static/app.js +++ b/doc/_themes/odoodoc/static/app.js @@ -25,6 +25,76 @@ $(function () { }); }, 100); + // lang switcher + function findSheet(pattern, fromSheet) { + if (fromSheet) { + for(var i=0; i .highlight' + ].join(''); + sheet.deleteRule(lastIndex); + sheet.insertRule(sel + '{' + content + '}', lastIndex); + }); + })(); } + // Config ZeroClipboard ZeroClipboard.config({ moviePath: '_static/ZeroClipboard.swf', diff --git a/doc/_themes/odoodoc/static/style.css b/doc/_themes/odoodoc/static/style.css index 3ea44b5e02d..fba330944dd 100644 --- a/doc/_themes/odoodoc/static/style.css +++ b/doc/_themes/odoodoc/static/style.css @@ -6757,8 +6757,43 @@ td.field-body > ul { border-left: 1px solid #777777; } } -.stripe .switchable > .highlight, -.stripe [class*=only-] { +.stripe .switcher { + color: white; + width: auto !important; + float: none !important; + position: fixed; + display: -webkit-flex; + display: flex; + -webkit-justify-content: flex-end; + justify-content: flex-end; + right: 0.5em; + list-style: none; + padding: 0; + margin: 0; + z-index: 5; +} +.stripe .switcher li { + background-color: #0f131a; + padding: 0.4em 1em; + border: 1px solid #333; + border-left-width: 0; + cursor: pointer; +} +.stripe .switcher li:first-child { + border-left-width: 1px; + border-radius: 5px 0 0 5px; +} +.stripe .switcher li:last-child { + border-radius: 0 5px 5px 0; +} +.stripe .switcher li:hover { + background-color: #222; +} +.stripe .switcher li.active { + background-color: #333; +} +.stripe [class*=only-], +.stripe .switchable > .highlight { display: none; } .stripe .only-python, diff --git a/doc/_themes/odoodoc/static/style.less b/doc/_themes/odoodoc/static/style.less index 182b81d25d7..71076470e7b 100644 --- a/doc/_themes/odoodoc/static/style.less +++ b/doc/_themes/odoodoc/static/style.less @@ -593,9 +593,49 @@ td.field-body { } } } + + .switcher { + color: white; + width: auto !important; + float: none !important; + + position: fixed; + display: -webkit-flex; + display: flex; + -webkit-justify-content: flex-end; + justify-content: flex-end; + + right: 0.5em; + list-style: none; + padding: 0; + margin: 0; + z-index: 5; + + li { + background-color: #0f131a; + padding: 0.4em 1em; + border: 1px solid #333; + border-left-width: 0; + cursor: pointer; + &:first-child { + border-left-width: 1px; + border-radius: 5px 0 0 5px; + } + &:last-child { + border-radius: 0 5px 5px 0; + } + &:hover { + background-color: #222; + } + &.active { + background-color: #333; + } + } + } + // === show/hide code snippets === - .switchable > .highlight, - [class*=only-] { + [class*=only-], + .switchable > .highlight { display: none; } // must be final rule of page