mirror of
				https://github.com/flynx/PortableMag.git
				synced 2025-10-30 19:40:12 +00:00 
			
		
		
		
	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:
		
							parent
							
								
									e649f0c384
								
							
						
					
					
						commit
						a9f7bf1cba
					
				| @ -245,7 +245,7 @@ $(document).ready(function(){ | |||||||
| 
 | 
 | ||||||
| <div class="scaler"> | <div class="scaler"> | ||||||
| <div class="aligner"> | <div class="aligner"> | ||||||
| 	<div class="magazine" title="PortableMag"> | 	<div class="magazine" name="PortableMag"> | ||||||
| 		<div class="cover page current"> | 		<div class="cover page current"> | ||||||
| 			<div class="content"> | 			<div class="content"> | ||||||
| 				<!--h1 style="color:gray;font-size:125px;margin-bottom:-35px; margin-top: 160px">PortableMag</h1> | 				<!--h1 style="color:gray;font-size:125px;margin-bottom:-35px; margin-top: 160px">PortableMag</h1> | ||||||
|  | |||||||
							
								
								
									
										18
									
								
								magazine.js
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								magazine.js
									
									
									
									
									
								
							| @ -718,14 +718,17 @@ function saveURLState(){ | |||||||
| 			return anchor | 			return anchor | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  | 
 | ||||||
|  | 	// set the #URL to current mapge number...
 | ||||||
| 	if(UPDATE_HASH_URL_POSITION){ | 	if(UPDATE_HASH_URL_POSITION){ | ||||||
| 		window.location.hash = n | 		window.location.hash = n | ||||||
|  | 
 | ||||||
|  | 	// push history state...
 | ||||||
| 	} else if(FULL_HISTORY_ENABLED){ | 	} else if(FULL_HISTORY_ENABLED){ | ||||||
| 		// XXX add option to disable history altogether...
 |  | ||||||
| 		window.history.pushState(null, null, '#' + n) | 		window.history.pushState(null, null, '#' + n) | ||||||
| 	} else { | 
 | ||||||
| 	// clear the url if it does not match the current page...
 | 	// clear the url if it does not match the current page...
 | ||||||
| 		// XXX should this be here?
 | 	} else { | ||||||
| 		if(n != parseInt(anchor)){ | 		if(n != parseInt(anchor)){ | ||||||
| 			window.location.hash = '' | 			window.location.hash = '' | ||||||
| 		} | 		} | ||||||
| @ -736,7 +739,8 @@ function saveURLState(){ | |||||||
| 
 | 
 | ||||||
| // local storage state managers...
 | // local storage state managers...
 | ||||||
| function loadStorageState(){ | function loadStorageState(){ | ||||||
| 	var title = $('.magazine').attr('title') | 	var title = ($('.magazine').attr('title')  | ||||||
|  | 					|| $('.magazine').attr('name')) | ||||||
| 	var data = $.jStorage.get(title, {}) | 	var data = $.jStorage.get(title, {}) | ||||||
| 	// set the defaults...
 | 	// set the defaults...
 | ||||||
| 	if(data.current_page == null){ | 	if(data.current_page == null){ | ||||||
| @ -748,14 +752,16 @@ function loadStorageState(){ | |||||||
| 	return data | 	return data | ||||||
| } | } | ||||||
| function saveStorageState(){ | function saveStorageState(){ | ||||||
| 	var title = $('.magazine').attr('title') | 	var title = ($('.magazine').attr('title')  | ||||||
|  | 					|| $('.magazine').attr('name')) | ||||||
| 	$.jStorage.set(title, { | 	$.jStorage.set(title, { | ||||||
| 			current_page: getPageNumber(), | 			current_page: getPageNumber(), | ||||||
| 			bookmarks: buildBookmarkList() | 			bookmarks: buildBookmarkList() | ||||||
| 	}) | 	}) | ||||||
| } | } | ||||||
| function resetStorageState(){ | function resetStorageState(){ | ||||||
| 	var title = $('.magazine').attr('title') | 	var title = ($('.magazine').attr('title') | ||||||
|  | 					|| $('.magazine').attr('name')) | ||||||
| 	$.jStorage.deleteKey(title) | 	$.jStorage.deleteKey(title) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user