mirror of
https://github.com/flynx/PortableMag.git
synced 2025-12-23 12:01:48 +00:00
more history related work, still not done...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
9fb001c6b4
commit
232576b158
3
TODO.otl
3
TODO.otl
@ -6,6 +6,9 @@
|
||||
[_] BUG: no drag threshold on excludedElements (TouchSwipe)
|
||||
| stalled...
|
||||
[_] 67% general todo
|
||||
[_] add separate history manager...
|
||||
| might be a virtual history rather than browser history which
|
||||
| tends to slow things down -- just a simple stack...
|
||||
[_] move some of the current configuration options to the magazine...
|
||||
| same idea as .no-resize class...
|
||||
[_] add option to align page to right or left screen border
|
||||
|
||||
10
index.html
10
index.html
@ -668,6 +668,14 @@ $(document).ready(function(){
|
||||
<button id="UPDATE_HASH_URL_POSITION" onclick="toggleSetting(this)"></button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Full navigation gistory:
|
||||
</td>
|
||||
<td>
|
||||
<button id="FULL_HISTORY_ENABLED" onclick="toggleSetting(this)"></button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Reset stored data:
|
||||
@ -738,6 +746,7 @@ $(document).ready(function(){
|
||||
DRAG_FULL_PAGE = $('#DRAG_FULL_PAGE').text() == 'true' ? true : false
|
||||
USE_REAL_PAGE_SIZES = $('#USE_REAL_PAGE_SIZES').text() == 'true' ? true : false
|
||||
UPDATE_HASH_URL_POSITION = $('#UPDATE_HASH_URL_POSITION').text() == 'true' ? true : false
|
||||
FULL_HISTORY_ENABLED = $('#FULL_HISTORY_ENABLED').text() == 'true' ? true : false
|
||||
}
|
||||
function loadSettings(){
|
||||
$('#PAGES_IN_RIBBON').attr('value', PAGES_IN_RIBBON)
|
||||
@ -746,6 +755,7 @@ $(document).ready(function(){
|
||||
$('#DRAG_FULL_PAGE').text(DRAG_FULL_PAGE)
|
||||
$('#USE_REAL_PAGE_SIZES').text(USE_REAL_PAGE_SIZES)
|
||||
$('#UPDATE_HASH_URL_POSITION').text(UPDATE_HASH_URL_POSITION)
|
||||
$('#FULL_HISTORY_ENABLED').text(FULL_HISTORY_ENABLED)
|
||||
|
||||
$('#FingersSupported').text($.fn.swipe.fingers.ALL)
|
||||
var b = $('#BrowserInfo')
|
||||
|
||||
22
magazine.js
22
magazine.js
@ -30,8 +30,17 @@ var USE_REAL_PAGE_SIZES = false
|
||||
|
||||
// if true this will make each page flip update the hash url...
|
||||
// if false, only direct linking will update the url.
|
||||
// XXX this if false, will break the layer hide/show toggle...
|
||||
var UPDATE_HASH_URL_POSITION = true
|
||||
// NOTE: this can slow down navigation...
|
||||
// XXX BUG this if false, will break the layer hide/show toggle...
|
||||
var UPDATE_HASH_URL_POSITION = false
|
||||
|
||||
// if true this will enable history for local page navigation regardless
|
||||
// of weather UPDATE_HASH_URL_POSITION state.
|
||||
// NOTE: UPDATE_HASH_URL_POSITION implicitly enables full browser history
|
||||
// based navigation.
|
||||
// NOTE: this can slow down navigation...
|
||||
// NOTE: partial history navigation over links will still work.
|
||||
var FULL_HISTORY_ENABLED = false
|
||||
|
||||
|
||||
|
||||
@ -680,6 +689,12 @@ function loadURLState(){
|
||||
.addClass('hidden')
|
||||
.removeClass('shown')
|
||||
}
|
||||
if(!UPDATE_HASH_URL_POSITION){
|
||||
// push current position...
|
||||
// NOTE: this will enable partial history navigation, but only
|
||||
// on actions envolving actual links...
|
||||
window.history.pushState(null, null, '#' + getPageNumber())
|
||||
}
|
||||
return n
|
||||
}
|
||||
}
|
||||
@ -705,6 +720,9 @@ function saveURLState(){
|
||||
}
|
||||
if(UPDATE_HASH_URL_POSITION){
|
||||
window.location.hash = n
|
||||
} else if(FULL_HISTORY_ENABLED){
|
||||
// XXX add option to disable history altogether...
|
||||
window.history.pushState(null, null, '#' + n)
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user