diff --git a/static/js/UI.js b/static/js/UI.js index 128681eca..fbce68784 100644 --- a/static/js/UI.js +++ b/static/js/UI.js @@ -174,7 +174,7 @@ pandora.UI = (function() { if (args.text) { add['texts.' + that.encode(args.text)] = Ox.map(textSettings, function(value, key) { var textsKey = 'texts.' + that.encode(args.text) + '.' + key; - return textsKey in args ? args[editextsKeytsKey] + return textsKey in args ? args[textsKey] : pandora.user.ui.texts[args.text] ? pandora.user.ui.texts[args.text][key] : value; }); diff --git a/static/js/URL.js b/static/js/URL.js index 5ca04e300..e166cbee2 100644 --- a/static/js/URL.js +++ b/static/js/URL.js @@ -65,8 +65,8 @@ pandora.URL = (function() { : [] ); } else if (pandora.user.ui.section == 'texts') { - var position = pandora.user.ui.texts[state.text] - ? pandora.user.ui.texts[state.text].position + var position = pandora.user.ui.texts[state.item] + ? pandora.user.ui.texts[state.item].position : 0; if (position) { state.span = position; @@ -199,7 +199,7 @@ pandora.URL = (function() { } else if (state.type == 'edits') { if (state.span) { - var key = 'edits.' + state.item.replace(/\./g, '\\.'); + var key = 'edits.' + pandora.UI.encode(state.item); set[key] = {}; if (Ox.isArray(state.span)) { set[key + '.clip'] = ''; @@ -217,7 +217,7 @@ pandora.URL = (function() { } else if (state.type == 'texts') { if (state.span) { - set['texts.' + state.item.replace(/\./g, '\\.') + '.position'] = state.span; + set['texts.' + pandora.UI.encode(state.item) + '.position'] = state.span; } } diff --git a/static/js/textPanel.js b/static/js/textPanel.js index cf215085a..01c5ae9a3 100644 --- a/static/js/textPanel.js +++ b/static/js/textPanel.js @@ -365,7 +365,7 @@ pandora.ui.textPDF = function(text) { }); }).open(); } else if (event == 'page') { - pandora.UI.set('texts.' + pandora.user.ui.text.replace(/\./g, '\\.') + '.position', [data.page]); + pandora.UI.set('texts.' + pandora.UI.encode(pandora.user.ui.text) + '.position', [data.page]); } }) .appendTo(that); diff --git a/static/pdf.js/embeds.js b/static/pdf.js/embeds.js index dab813d70..6e4f96851 100644 --- a/static/pdf.js/embeds.js +++ b/static/pdf.js/embeds.js @@ -2,7 +2,7 @@ Ox.load(function() { window.addEventListener('hashchange', function() { var page = document.location.hash.substring(1).split('=')[1]; page && Ox.$parent.postMessage('page', { - page: page + page: Math.round(page) }); }); Ox.$parent.onMessage(function(event, data, oxid) {