diff --git a/index.html b/index.html index cadd84b..6e0fcea 100755 --- a/index.html +++ b/index.html @@ -11,48 +11,6 @@ /* this is needed only for live resize... */ var PAGES_VISIBLE = 1 var PAGES_IN_RIBBON = 6 - -$(document).ready(function(){ - $(window).resize(function() { - fitNPages(PAGES_VISIBLE) - }) - - $('.viewer') - .swipe({ - swipeStatus: swipeUpdate, - // XXX change this to pinch... - swipeUp: function(){ - togglePageView('off') - }, - // XXX change this to pinch... - swipeDown: function(){ - togglePageView('on') - }, - // XXX for some reason this deos not bubble up the nested elements... - click: function(evt, elem){ - if($(elem).hasClass('page')){ - setCurrentPage(elem) - } else if($(elem).hasClass('content')){ - setCurrentPage($(elem).parents('.page').first()) - } - return true - } - }) - $('.button.cover').swipe({click: goToMagazineCover}) - $('.button.next-article').swipe({click: nextArticle}) - $('.button.prev-article').swipe({click: prevArticle}) - - loadState() - - togglePageView('on') - - - // XXX add splash screen... - // XXX - -}) - - /*********************************************************************/ // XXX move to generic lib... @@ -118,6 +76,42 @@ function createCSSClassToggler(elem, css_class, callback_a, callback_b){ } +// show a jQuary opject in viewer overlay... +// XXX need to set .scrollTop(0) when showing different UI... +// ...and not set it when the UI is the same +// XXX this must create it's own overlay... +function showInOverlay(obj){ + obj.click(function(){ return false }) + // XXX + $('.viewer').addClass('overlay-mode') + // clean things up... + $('.overlay .content').children().remove() + // put it in the overlay... + $('.overlay .content').append(obj) + // prepare the overlay... + $('.overlay') + .one('click', function(){ + $('.overlay') + .fadeOut(function(){ + $('.overlay .content') + .children() + .remove() + $('.overlay-mode').removeClass('overlay-mode') + }) + }) + .fadeIn() + return obj +} + + + +function overlayMessage(text){ + return showInOverlay($('
')) +} + + + + // XXX might be good to use apply here... function doWithoutTransitions(obj, func, time){ if(time == null){ @@ -479,6 +473,52 @@ function createPage(article, template){ } + + @@ -486,6 +526,15 @@ function createPage(article, template){
+ loading...+ |