@@ -13,16 +13,6 @@ const _CURRENT_PREFIX = (() => {
1313 return window . location . pathname . split ( '/' , _NUM_PREFIX_PARTS ) . join ( '/' ) + '/' ;
1414} ) ( ) ;
1515
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-
2616const all_versions = $VERSIONS ;
2717const all_languages = $LANGUAGES ;
2818
@@ -120,26 +110,6 @@ const _on_language_switch = () => {
120110 }
121111} ;
122112
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- }
143113const _initialise_switchers = ( ) => {
144114 const version_select = _create_version_select ( _CURRENT_VERSION ) ;
145115 document
0 commit comments