@@ -13,16 +13,6 @@ const _CURRENT_PREFIX = (() => {
13
13
return window . location . pathname . split ( '/' , _NUM_PREFIX_PARTS ) . join ( '/' ) + '/' ;
14
14
} ) ( ) ;
15
15
16
- // Parses versions in URL segments like:
17
- const _VERSION_PATTERN = (
18
- '((?:'
19
- + '(?:\\d)' // e.g. "3"
20
- + '|(?:\\d\\.\\d[\\w\\d\\.]*)' // e.g. "3.6rc2"
21
- + '|(?:dev)' // e.g. "dev"
22
- + '|(?:release/\\d.\\d[\\x\\d\\.]*)' // e.g. "release/2.7"
23
- + ')/)'
24
- ) ;
25
-
26
16
const all_versions = $VERSIONS ;
27
17
const all_languages = $LANGUAGES ;
28
18
@@ -120,26 +110,6 @@ const _on_language_switch = () => {
120
110
}
121
111
} ;
122
112
123
- // Returns the path segment of the language as a string, like 'fr/'
124
- // or '' if not found.
125
- function language_segment_from_url ( ) {
126
- const path = window . location . pathname ;
127
- const language_regexp =
128
- '/((?:' + Object . keys ( all_languages ) . join ( '|' ) + ')/)' ;
129
- const match = path . match ( language_regexp ) ;
130
- if ( match !== null ) return match [ 1 ] ;
131
- return '' ;
132
- }
133
-
134
- // Returns the path segment of the version as a string, like '3.6/'
135
- // or '' if not found.
136
- function version_segment_from_url ( ) {
137
- const path = window . location . pathname ;
138
- const version_regexp = language_segment_from_url ( ) + _VERSION_PATTERN ;
139
- const match = path . match ( version_regexp ) ;
140
- if ( match !== null ) return match [ 1 ] ;
141
- return '' ;
142
- }
143
113
const _initialise_switchers = ( ) => {
144
114
const version_select = _create_version_select ( _CURRENT_VERSION ) ;
145
115
document
0 commit comments