now either title or name attrs are used for naming magazines and articles...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2013-02-05 21:14:07 +04:00
parent e649f0c384
commit a9f7bf1cba
2 changed files with 13 additions and 7 deletions

View File

@ -245,7 +245,7 @@ $(document).ready(function(){
<div class="scaler">
<div class="aligner">
<div class="magazine" title="PortableMag">
<div class="magazine" name="PortableMag">
<div class="cover page current">
<div class="content">
<!--h1 style="color:gray;font-size:125px;margin-bottom:-35px; margin-top: 160px">PortableMag</h1>

View File

@ -718,14 +718,17 @@ function saveURLState(){
return anchor
}
}
// set the #URL to current mapge number...
if(UPDATE_HASH_URL_POSITION){
window.location.hash = n
// push history state...
} else if(FULL_HISTORY_ENABLED){
// XXX add option to disable history altogether...
window.history.pushState(null, null, '#' + n)
} else {
// clear the url if it does not match the current page...
// XXX should this be here?
} else {
if(n != parseInt(anchor)){
window.location.hash = ''
}
@ -736,7 +739,8 @@ function saveURLState(){
// local storage state managers...
function loadStorageState(){
var title = $('.magazine').attr('title')
var title = ($('.magazine').attr('title')
|| $('.magazine').attr('name'))
var data = $.jStorage.get(title, {})
// set the defaults...
if(data.current_page == null){
@ -748,14 +752,16 @@ function loadStorageState(){
return data
}
function saveStorageState(){
var title = $('.magazine').attr('title')
var title = ($('.magazine').attr('title')
|| $('.magazine').attr('name'))
$.jStorage.set(title, {
current_page: getPageNumber(),
bookmarks: buildBookmarkList()
})
}
function resetStorageState(){
var title = $('.magazine').attr('title')
var title = ($('.magazine').attr('title')
|| $('.magazine').attr('name'))
$.jStorage.deleteKey(title)
}