File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1026,7 +1026,7 @@ $(function() {
10261026 }
10271027
10281028 if ( selectedFormat ) {
1029- window . open ( '/read/' + bookId + '/' + selectedFormat , '_blank' ) ;
1029+ window . open ( window . scriptRoot + '/read/' + bookId + '/' + selectedFormat , '_blank' ) ;
10301030 } else {
10311031 window . location . href = $link . attr ( 'href' ) ;
10321032 }
@@ -1050,7 +1050,7 @@ $(function() {
10501050 var isCurrentlyRead = $readBadge . length > 0 ;
10511051
10521052 $ . ajax ( {
1053- url : '/ajax/toggleread/' + bookId ,
1053+ url : window . scriptRoot + '/ajax/toggleread/' + bookId ,
10541054 type : 'POST' ,
10551055 headers : {
10561056 'X-Requested-With' : 'XMLHttpRequest'
@@ -1154,7 +1154,7 @@ $(function() {
11541154
11551155 // Use /send_selected endpoint but only send to primary email
11561156 $ . ajax ( {
1157- url : '/send_selected/' + bookId ,
1157+ url : window . scriptRoot + '/send_selected/' + bookId ,
11581158 type : 'POST' ,
11591159 headers : {
11601160 'X-Requested-With' : 'XMLHttpRequest'
@@ -1215,7 +1215,7 @@ $(function() {
12151215 }
12161216
12171217 // Navigate to the edit page in the same tab
1218- var editUrl = '/admin/book/' + bookId ;
1218+ var editUrl = window . scriptRoot + '/admin/book/' + bookId ;
12191219 window . location . href = editUrl ;
12201220 }
12211221
Original file line number Diff line number Diff line change @@ -335,6 +335,8 @@ <h4 class="modal-title" id="bookDetailsModalLabel">{{_('Book Details')}}</h4>
335335 < script src ="{{ url_for('static', filename='js/libs/compromise.min.js') }} "> </ script >
336336 < script src ="{{ url_for('static', filename='js/libs/readmore.min.js') }} "> </ script >
337337 < script >
338+ // Make script root available for JS
339+ window . scriptRoot = "{{ request.script_root }}" ;
338340 // Make user email data available for quick actions
339341 window . cwaUserData = { } ;
340342 { % if current_user . kindle_mail and current_user . kindle_mail . strip ( ) % }
You can’t perform that action at this time.
0 commit comments