mirror of
				https://github.com/flynx/PortableMag.git
				synced 2025-11-04 05:50:19 +00:00 
			
		
		
		
	some cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									8e6c1be0ec
								
							
						
					
					
						commit
						f76e4a3887
					
				
							
								
								
									
										10
									
								
								TODO.otl
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								TODO.otl
									
									
									
									
									
								
							@ -1,13 +1,13 @@
 | 
				
			|||||||
Priority work
 | 
					Priority work
 | 
				
			||||||
	[_] 5% basic features
 | 
						[_] 10% basic features
 | 
				
			||||||
		[_] 42% basic article navigation
 | 
							[_] 85% basic article navigation
 | 
				
			||||||
			[X] next page
 | 
								[X] next page
 | 
				
			||||||
			[X] prev page
 | 
								[X] prev page
 | 
				
			||||||
			[X] show previews
 | 
								[X] show previews
 | 
				
			||||||
			[_] show global navigation bar
 | 
								[_] show global navigation bar
 | 
				
			||||||
			[_] go home
 | 
								[X] go home
 | 
				
			||||||
			[_] go to article start
 | 
								[X] go to prev article
 | 
				
			||||||
			[_] go to article end
 | 
								[X] go to next article
 | 
				
			||||||
		[_] global navigation bar
 | 
							[_] global navigation bar
 | 
				
			||||||
		[_] real previews
 | 
							[_] real previews
 | 
				
			||||||
		| use zoom to show a ribbon...
 | 
							| use zoom to show a ribbon...
 | 
				
			||||||
 | 
				
			|||||||
@ -24,8 +24,7 @@ $(document).ready(function(){
 | 
				
			|||||||
			},
 | 
								},
 | 
				
			||||||
			click: function(evt, elem){
 | 
								click: function(evt, elem){
 | 
				
			||||||
				if($(elem).hasClass('page')){
 | 
									if($(elem).hasClass('page')){
 | 
				
			||||||
					var pages = $('.page')
 | 
										setCurrentPage(elem)
 | 
				
			||||||
					setCurrentPage(pages.index(elem))
 | 
					 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
				return true
 | 
									return true
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
@ -57,7 +56,7 @@ function swipeUpdate(evt, phase, direction, distance){
 | 
				
			|||||||
		mag.css({'-webkit-transition-duration': orig_duration})
 | 
							mag.css({'-webkit-transition-duration': orig_duration})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	} else if ( phase == 'cancel') {
 | 
						} else if ( phase == 'cancel') {
 | 
				
			||||||
		setCurrentPage(pages.index($('.current.page')))
 | 
							setCurrentPage()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	} else if ( phase =='end' ) {
 | 
						} else if ( phase =='end' ) {
 | 
				
			||||||
		// see which page is closer to the middle of the screen and set it...
 | 
							// see which page is closer to the middle of the screen and set it...
 | 
				
			||||||
@ -75,11 +74,15 @@ function swipeUpdate(evt, phase, direction, distance){
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function setCurrentPage(n){
 | 
					function setCurrentPage(n){
 | 
				
			||||||
 | 
						var cur
 | 
				
			||||||
	if(n == null){
 | 
						if(n == null){
 | 
				
			||||||
		cur = $('.current.page')
 | 
							cur = $('.current.page')
 | 
				
			||||||
 | 
							n = $('.page').index(cur) 
 | 
				
			||||||
 | 
						} else if(typeof(n) == typeof(1)) {
 | 
				
			||||||
 | 
							cur = $($('.page')[n])
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		var pages = $('.page')
 | 
							cur = n
 | 
				
			||||||
		var cur = $(pages[n])
 | 
							n = $('.page').index(cur) 
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	$('.current.page').removeClass('current')
 | 
						$('.current.page').removeClass('current')
 | 
				
			||||||
@ -104,27 +107,31 @@ function prevPage(){
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function goToMagazineCover(){
 | 
				
			||||||
 | 
						setCurrentPage(0)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					function goToArticleCover(){
 | 
				
			||||||
 | 
						setCurrentPage($('.current.page').parents('.article').children('.page').first())
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function nextArticle(){
 | 
					function nextArticle(){
 | 
				
			||||||
	var pages = $('.page')
 | 
					 | 
				
			||||||
	var cur = $('.current.page').parents('.article')
 | 
						var cur = $('.current.page').parents('.article')
 | 
				
			||||||
	// we are at the magazine cover cover...
 | 
						// we are at the magazine cover cover...
 | 
				
			||||||
	if(cur.length == 0){
 | 
						if(cur.length == 0){
 | 
				
			||||||
		var a = $('.article .page:first-child').first()
 | 
							return setCurrentPage(
 | 
				
			||||||
		return setCurrentPage(pages.index(a))
 | 
								$('.article .page:first-child').first())
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	// just find the next one...
 | 
						// just find the next one...
 | 
				
			||||||
	var articles = $('.article')
 | 
						var articles = $('.article')
 | 
				
			||||||
	return setCurrentPage(
 | 
						return setCurrentPage(
 | 
				
			||||||
		pages.index(
 | 
					 | 
				
			||||||
		$(articles[Math.min(articles.index(cur)+1, articles.length-1)])
 | 
							$(articles[Math.min(articles.index(cur)+1, articles.length-1)])
 | 
				
			||||||
			.children('.page')
 | 
								.children('.page')
 | 
				
			||||||
				.first()))
 | 
								.first())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
// XXX this is almost exactly the same as nextArticle...
 | 
					// XXX this is almost exactly the same as nextArticle...
 | 
				
			||||||
function prevArticle(){
 | 
					function prevArticle(){
 | 
				
			||||||
	var pages = $('.page')
 | 
					 | 
				
			||||||
	var cur = $('.current.page').parents('.article')
 | 
						var cur = $('.current.page').parents('.article')
 | 
				
			||||||
	// we are at the magazine cover cover...
 | 
						// we are at the magazine cover cover...
 | 
				
			||||||
	if(cur.length == 0){
 | 
						if(cur.length == 0){
 | 
				
			||||||
@ -133,10 +140,9 @@ function prevArticle(){
 | 
				
			|||||||
	// just find the prev one...
 | 
						// just find the prev one...
 | 
				
			||||||
	var articles = $('.article')
 | 
						var articles = $('.article')
 | 
				
			||||||
	return setCurrentPage(
 | 
						return setCurrentPage(
 | 
				
			||||||
		pages.index(
 | 
					 | 
				
			||||||
		$(articles[Math.max(articles.index(cur)-1, 0)])
 | 
							$(articles[Math.max(articles.index(cur)-1, 0)])
 | 
				
			||||||
			.children('.page')
 | 
								.children('.page')
 | 
				
			||||||
				.first()))
 | 
								.first())
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -189,6 +195,8 @@ function fitNPages(n){
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// XXX create magazine...
 | 
					// XXX create magazine...
 | 
				
			||||||
function createMagazine(){
 | 
					function createMagazine(){
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user