minor cleanup...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2013-01-27 03:40:00 +04:00
parent 5994158f24
commit 36e2a53a4d

View File

@ -1,4 +1,7 @@
/********************************************************************** /**********************************************************************
*
* XXX add copyright and licence info...
*
**********************************************************************/ **********************************************************************/
//var DEBUG = DEBUG != null ? DEBUG : true //var DEBUG = DEBUG != null ? DEBUG : true
@ -82,6 +85,7 @@ function hashChangeHandler(e){
// do the work for us... // do the work for us...
// XXX revise... // XXX revise...
if(r == 'back'){ if(r == 'back'){
// we shift by 2 to combensate for the back/forward URL itself...
window.history.go(-2) window.history.go(-2)
} else if(r == 'forward'){ } else if(r == 'forward'){
window.history.go(2) window.history.go(2)
@ -90,6 +94,8 @@ function hashChangeHandler(e){
} }
} }
// window resize event handler...
function viewResizeHandler(){ function viewResizeHandler(){
// XXX might be good to compensate for document zoom... // XXX might be good to compensate for document zoom...
if(document.width/$(document).width() != 1){ if(document.width/$(document).width() != 1){
@ -166,7 +172,6 @@ function swipeHandler(evt, phase, direction, distance, duration, fingers){
/********************************************************** layout ***/ /********************************************************** layout ***/
// XXX for some magical reason this is not called...
function fitNPages(n, fit_to_content){ function fitNPages(n, fit_to_content){
if(n == null){ if(n == null){
n = 1 n = 1
@ -186,6 +191,9 @@ function fitNPages(n, fit_to_content){
var rW = cW var rW = cW
var scale = getPageScale() var scale = getPageScale()
// to compensate for transitions, to data sampling should be beyound
// this point, as next we will start changing things...
if(fit_to_content){ if(fit_to_content){
page.width(cW) page.width(cW)
page.height(cH) page.height(cH)
@ -293,7 +301,6 @@ function nextArticle(){
$(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())
} }
function prevArticle(){ function prevArticle(){
var cur = $('.current.page').parents('.article') var cur = $('.current.page').parents('.article')
@ -340,7 +347,6 @@ function loadURLState(){
// history... // history...
// NOTE: these are handled by hashChangeHandler() // NOTE: these are handled by hashChangeHandler()
// XXX revise...
} else if(anchor == 'back') { } else if(anchor == 'back') {
return anchor return anchor
} else if(anchor == 'forward') { } else if(anchor == 'forward') {
@ -441,18 +447,24 @@ function saveState(){
/********************************************************** editor ***/ /********************************************************** editor ***/
// XXX create magazine... // XXX create magazine...
// - magazine
// - cover
function createMagazine(){ function createMagazine(){
} }
// XXX create article (magazine, title, position)... // XXX create article (magazine, title, position)...
// - article
// - cover
function createArticle(magazine, title){ function createArticle(magazine, title){
} }
// XXX create page (article, template, position)... // XXX create page (article, template, position)...
// - page
// - content
function createPage(article, template){ function createPage(article, template){
} }