diff --git a/pandora/config.0xdb.jsonc b/pandora/config.0xdb.jsonc index c6263a752..fbdc013d5 100644 --- a/pandora/config.0xdb.jsonc +++ b/pandora/config.0xdb.jsonc @@ -776,6 +776,7 @@ "showSitePosters": false, "showTimeline": true, "sidebarSize": 256, + "textPositions": {}, "theme": "oxdark", "updateAdvancedFind": false, "videoMuted": false, diff --git a/pandora/config.indiancinema.jsonc b/pandora/config.indiancinema.jsonc index 2ef1ca72c..9d3be41e1 100644 --- a/pandora/config.indiancinema.jsonc +++ b/pandora/config.indiancinema.jsonc @@ -782,6 +782,7 @@ "showSitePosters": false, "showTimeline": true, "sidebarSize": 256, + "textPositions": {}, "theme": "oxmedium", "updateAdvancedFind": false, "videoMuted": false, diff --git a/pandora/config.padma.jsonc b/pandora/config.padma.jsonc index 266ec4bb8..346f16b7b 100644 --- a/pandora/config.padma.jsonc +++ b/pandora/config.padma.jsonc @@ -698,6 +698,7 @@ "showSitePosters": false, "showTimeline": true, "sidebarSize": 256, + "textPositions": {}, "theme": "oxlight", "updateAdvancedFind": false, "videoMuted": false, diff --git a/static/js/pandora/UI.js b/static/js/pandora/UI.js index 7754b9051..e5b9bf8f1 100644 --- a/static/js/pandora/UI.js +++ b/static/js/pandora/UI.js @@ -54,6 +54,7 @@ pandora.UI = (function() { self.previousUI = Ox.clone(pandora.user.ui, true); self.previousUI._list = pandora.getListState(self.previousUI.find); + if (args.section == 'texts') { trigger['section'] = args['section']; trigger['text'] = args['text']; diff --git a/static/js/pandora/URL.js b/static/js/pandora/URL.js index 7bc4bda97..b0d94c67d 100644 --- a/static/js/pandora/URL.js +++ b/static/js/pandora/URL.js @@ -30,26 +30,31 @@ pandora.URL = (function() { state.view = pandora.user.ui.itemView; state.sort = pandora.user.ui.itemSort; } - } - - if (state.view == 'map') { - state.span = pandora.user.ui.mapFind - ? '@' + pandora.user.ui.mapFind - : pandora.user.ui.mapSelection - ? '@' + pandora.user.ui.mapSelection - : ''; - } else if (state.view == 'calendar') { - // ... - } else if (['timeline', 'player', 'editor'].indexOf(state.view) > -1) { - var videoPoints = pandora.user.ui.videoPoints[state.item] || {}; - state.span = videoPoints.annotation || [].concat( - videoPoints.position - ? videoPoints.position - : [], - videoPoints['in'] || videoPoints.out - ? [videoPoints['in'], videoPoints.out] - : [] - ); + if (state.view == 'map') { + state.span = pandora.user.ui.mapFind + ? '@' + pandora.user.ui.mapFind + : pandora.user.ui.mapSelection + ? '@' + pandora.user.ui.mapSelection + : ''; + } else if (state.view == 'calendar') { + // ... + } else if (['timeline', 'player', 'editor'].indexOf(state.view) > -1) { + var videoPoints = pandora.user.ui.videoPoints[state.item] || {}; + state.span = videoPoints.annotation || [].concat( + videoPoints.position + ? videoPoints.position + : [], + videoPoints['in'] || videoPoints.out + ? [videoPoints['in'], videoPoints.out] + : [] + ); + } + } else if (pandora.user.ui.section == 'texts') { + state.view = 'text'; + var position = pandora.user.ui.textPositions[pandora.user.ui.text]; + if (position) { + state.span = position; + } } } @@ -160,6 +165,10 @@ pandora.URL = (function() { set.find = pandora.site.user.ui.find; } } + } else if (state.type == 'texts') { + if (state.span) { + set['textPositions.' + state.item] = state.span; + } } Ox.Request.cancel(); @@ -275,7 +284,9 @@ pandora.URL = (function() { } spanType['texts'] = { list: [], - item: {} + item: { + 'text': 'number' + } } sortKeys['texts'] = { list: {}, diff --git a/static/js/pandora/textPanel.js b/static/js/pandora/textPanel.js index 88cf86334..ec8824900 100644 --- a/static/js/pandora/textPanel.js +++ b/static/js/pandora/textPanel.js @@ -326,18 +326,20 @@ pandora.ui.textHTML = function(text) { pandora.ui.textPDF = function(text) { var that = Ox.Element(), - $iframe; + $iframe, + page = pandora.user.ui.textPositions[pandora.user.ui.text] ? + pandora.user.ui.textPositions[pandora.user.ui.text][0] : 1, + url = '/texts/' + pandora.user.ui.text + '/text.pdf.html#page=' + page; if (text.uploaded) { $iframe = Ox.Element('