diff --git a/TODO.otl b/TODO.otl index a686dae..4b712a1 100755 --- a/TODO.otl +++ b/TODO.otl @@ -9,15 +9,17 @@ [_] 50% move some of the current configuration options to the magazine... [X] page align [_] resize settings (.no-resize class) - [_] add transition-duration editors to config page (a-la PAGES_IN_RIBBON)... - | will help tuning the system,,, - [_] Editor: add toggleEditiorMode to all editables in all versions... - | text areas, inputs, ... - [_] EXPERIMENT: Try using scroll instead of left of .magazine.... - | this might improve speed... [_] 0% add two main page themes (global/local applicable): [_] light [_] dark + [_] Editor: add toggleEditiorMode to all editables in all versions... + | text areas, inputs, ... + [_] add global credits and copyright page... + | list and link all the used software and authors... + [_] add transition-duration editors to config page (a-la PAGES_IN_RIBBON)... + | will help tuning the system,,, + [_] EXPERIMENT: Try using scroll instead of left of .magazine.... + | this might improve speed... [_] JSON: add page URLs as an alternative to direct content... | use AJAX to get remote pages and their nested content [_] JSON: add metadata section that can be downloaded separately... @@ -46,8 +48,6 @@ [X] (i) info [_] (+) new [_] (x) remove - [_] add global credits and copyright page... - | list and link all the used software and authors... [_] add default empty state to viewer, magazine and article... | use it to trigger a "New Magazine", "New Cover"/"New Article" and | "New Cover"/"New Page" actions... @@ -85,6 +85,8 @@ [_] BUG: href to existing anchors will mess up layout... | need to find out how can we disable anchor links from actually | going to the anchor... + [X] BUG: jquery does not set background to none on detached elements... + | use transparent instead!! [X] 100% add page sets.. [X] general page navigation [X] serialization diff --git a/index.html b/index.html index 1a8ed04..27ed972 100755 --- a/index.html +++ b/index.html @@ -499,7 +499,7 @@ $(document).ready(function(){ -
+

Two column

@@ -570,21 +570,21 @@ $(document).ready(function(){
-
+

Page Set Example

[PAGE NUMBER]
-
+
Page in set
[PAGE NUMBER]
-
+
Page in set
diff --git a/magazine.js b/magazine.js index 566e5cc..5e94df7 100755 --- a/magazine.js +++ b/magazine.js @@ -1032,6 +1032,8 @@ JSONMetadata = { id: 'as-is', name: 'as-is', title: 'as-is', + // NOTE: do not use background:none as jQuery refuses to set it on + // detached elements. style: 'as-is', authors: { reader: function(data){ @@ -1140,55 +1142,56 @@ function buildJSON(export_bookmarks, export_position){ // XXX this does not load page attrs correctly... function loadJSON(data, load_user_data){ - function _build(block, elem){ + function _build(parent, data){ // page... - if(elem.type == 'page'){ - var res = createPage(elem.content) - .addClass(elem['class']) - .appendTo(block) + if(data.type == 'page'){ + var res = createPage(data.content) + .addClass(data['class']) + .appendTo(parent) // cover... - } else if(elem.type == 'cover'){ - var res = createCoverPage(elem.content) - .addClass(elem['class']) - .appendTo(block) + } else if(data.type == 'cover'){ + var res = createCoverPage(data.content) + .addClass(data['class']) + .appendTo(parent) // page-set... - } else if(elem.type == 'page-set') { + } else if(data.type == 'page-set') { // buiold an article... var res = createEmptyPageSet() - .addClass(elem['class']) - .appendTo(block) + .addClass(data['class']) + .appendTo(parent) // populate article with pages... - $(elem.pages).each(function(_, e){ + $(data.pages).each(function(_, e){ _build(res, e) }) // article... - } else if(elem.type == 'article') { + } else if(data.type == 'article') { // buiold an article... var res = createEmptyArticle() - .addClass(elem['class']) - .appendTo(block) + .addClass(data['class']) + .appendTo(parent) // populate article with pages... - $(elem.pages).each(function(_, e){ + $(data.pages).each(function(_, e){ _build(res, e) }) // other... // NOTE: on a wll-formed JSON we'll never go in here, but just // in case... - } else if(elem.type == 'raw-html') { - var res = createPage(elem.content) - .addClass(elem['class']) - .appendTo(block) + } else if(data.type == 'raw-html') { + var res = createPage(data.content) + .addClass(data['class']) + .appendTo(parent) } // metadata... - // XXX still might be a bit buggy -- might not be loading some - // data correctly... - writeMetadata(elem, res) + // XXX for some reason this does not set the style attr on pages in page-set... + writeMetadata(res, data) + + return res } // check version...