File tree Expand file tree Collapse file tree 3 files changed +29
-26
lines changed
Resources/Public/JavaScript/MultiView Expand file tree Collapse file tree 3 files changed +29
-26
lines changed Original file line number Diff line number Diff line change 6767 kitodo-pageView-searchInDocument = EXT:dlf/Resources/Public/JavaScript/PageView/SearchInDocument.js
6868 kitodo-pageView-pageView = EXT:dlf/Resources/Public/JavaScript/PageView/PageView.js
6969 kitodo-pageView-teiParser = EXT:dlf/Resources/Public/JavaScript/PageView/TeiParser.js
70- kitodo-pageview-multiViewAddSource = EXT:dlf/Resources/Public/JavaScript/MultiView/MultViewAddSource .js
70+ kitodo-pageview-multiViewAddSource = EXT:dlf/Resources/Public/JavaScript/MultiView/MultiViewAddSource .js
7171 kitodo-search-suggest = EXT:dlf/Resources/Public/JavaScript/Search/Suggester.js
7272 }
7373}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ /**
2+ * (c) Kitodo. Key to digital objects e.V. <contact@kitodo.org>
3+ *
4+ * This file is part of the Kitodo and TYPO3 projects.
5+ *
6+ * @license GNU General Public License version 3 or later.
7+ * For the full copyright and license information, please read the
8+ * LICENSE.txt file that was distributed with this source code.
9+ */
10+
11+ const multiViewAddSource = document . querySelector ( '.multiViewAddSource' ) ;
12+ if ( multiViewAddSource ) {
13+ document . querySelector ( '.multiViewAddSource' ) . addEventListener ( 'submit' , function ( e ) {
14+ e . preventDefault ( ) ;
15+ const url = new URL ( window . location . href ) ;
16+ const params = [ ...url . searchParams . keys ( ) ] ;
17+ const multiview = params . filter ( p => p . startsWith ( "tx_dlf[multiview]" ) ) ;
18+ if ( multiview . length === 0 ) {
19+ url . searchParams . append ( "tx_dlf[multiview]" , 1 ) ;
20+ }
21+ const multiViewSources = params . filter ( p => p . startsWith ( "tx_dlf[multiViewSource][" ) ) ;
22+ const nextIndex = multiViewSources . length ;
23+ const urlValue = document . getElementById ( 'location-field' ) . value . trim ( ) ;
24+ url . searchParams . append ( `tx_dlf[multiViewSource][${ nextIndex } ]` , urlValue ) ;
25+ // eslint-disable-next-line
26+ window . location . href = url . toString ( ) ;
27+ } ) ;
28+ }
You can’t perform that action at this time.
0 commit comments