mirror of
https://github.com/flynx/PortableMag.git
synced 2025-10-29 19:20:09 +00:00
bug with loadJSON turned out to be a quirk in jQuery that refuses to set background:none on just created but not attached elements...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
785bada4a4
commit
0ab4ff3c85
18
TODO.otl
18
TODO.otl
@ -9,15 +9,17 @@
|
|||||||
[_] 50% move some of the current configuration options to the magazine...
|
[_] 50% move some of the current configuration options to the magazine...
|
||||||
[X] page align
|
[X] page align
|
||||||
[_] resize settings (.no-resize class)
|
[_] 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):
|
[_] 0% add two main page themes (global/local applicable):
|
||||||
[_] light
|
[_] light
|
||||||
[_] dark
|
[_] 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...
|
[_] JSON: add page URLs as an alternative to direct content...
|
||||||
| use AJAX to get remote pages and their nested content
|
| use AJAX to get remote pages and their nested content
|
||||||
[_] JSON: add metadata section that can be downloaded separately...
|
[_] JSON: add metadata section that can be downloaded separately...
|
||||||
@ -46,8 +48,6 @@
|
|||||||
[X] (i) info
|
[X] (i) info
|
||||||
[_] (+) new
|
[_] (+) new
|
||||||
[_] (x) remove
|
[_] (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...
|
[_] add default empty state to viewer, magazine and article...
|
||||||
| use it to trigger a "New Magazine", "New Cover"/"New Article" and
|
| use it to trigger a "New Magazine", "New Cover"/"New Article" and
|
||||||
| "New Cover"/"New Page" actions...
|
| "New Cover"/"New Page" actions...
|
||||||
@ -85,6 +85,8 @@
|
|||||||
[_] BUG: href to existing anchors will mess up layout...
|
[_] BUG: href to existing anchors will mess up layout...
|
||||||
| need to find out how can we disable anchor links from actually
|
| need to find out how can we disable anchor links from actually
|
||||||
| going to the anchor...
|
| 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] 100% add page sets..
|
||||||
[X] general page navigation
|
[X] general page navigation
|
||||||
[X] serialization
|
[X] serialization
|
||||||
|
|||||||
@ -499,7 +499,7 @@ $(document).ready(function(){
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="page">
|
<div class="page" style="background: black; color: white;">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<h1>Two column</h1>
|
<h1>Two column</h1>
|
||||||
<div style="float:left; width: 45%; height: 100%; margin: 10px;">
|
<div style="float:left; width: 45%; height: 100%; margin: 10px;">
|
||||||
@ -570,21 +570,21 @@ $(document).ready(function(){
|
|||||||
<div class="article">
|
<div class="article">
|
||||||
<!-- page set -->
|
<!-- page set -->
|
||||||
<div class="page-set" style="background: url(img.jpg) no-repeat right top; background-size: 100% auto; color: white;">
|
<div class="page-set" style="background: url(img.jpg) no-repeat right top; background-size: 100% auto; color: white;">
|
||||||
<div class="page cover no-resize page-align-left" style="background:none">
|
<div class="page cover no-resize page-align-left" style="background:transparent">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<h1>Page Set Example</h1>
|
<h1>Page Set Example</h1>
|
||||||
|
|
||||||
<div class="page-number-text">[PAGE NUMBER]</div>
|
<div class="page-number-text">[PAGE NUMBER]</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="page no-resize" style="background:none">
|
<div class="page no-resize" style="background:transparent">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
Page in set<br>
|
Page in set<br>
|
||||||
|
|
||||||
<div class="page-number-text">[PAGE NUMBER]</div>
|
<div class="page-number-text">[PAGE NUMBER]</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="page no-resize page-align-right" style="background:none">
|
<div class="page no-resize page-align-right" style="background:transparent">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
Page in set<br>
|
Page in set<br>
|
||||||
|
|
||||||
|
|||||||
51
magazine.js
51
magazine.js
@ -1032,6 +1032,8 @@ JSONMetadata = {
|
|||||||
id: 'as-is',
|
id: 'as-is',
|
||||||
name: 'as-is',
|
name: 'as-is',
|
||||||
title: 'as-is',
|
title: 'as-is',
|
||||||
|
// NOTE: do not use background:none as jQuery refuses to set it on
|
||||||
|
// detached elements.
|
||||||
style: 'as-is',
|
style: 'as-is',
|
||||||
authors: {
|
authors: {
|
||||||
reader: function(data){
|
reader: function(data){
|
||||||
@ -1140,55 +1142,56 @@ function buildJSON(export_bookmarks, export_position){
|
|||||||
|
|
||||||
// XXX this does not load page attrs correctly...
|
// XXX this does not load page attrs correctly...
|
||||||
function loadJSON(data, load_user_data){
|
function loadJSON(data, load_user_data){
|
||||||
function _build(block, elem){
|
function _build(parent, data){
|
||||||
|
|
||||||
// page...
|
// page...
|
||||||
if(elem.type == 'page'){
|
if(data.type == 'page'){
|
||||||
var res = createPage(elem.content)
|
var res = createPage(data.content)
|
||||||
.addClass(elem['class'])
|
.addClass(data['class'])
|
||||||
.appendTo(block)
|
.appendTo(parent)
|
||||||
|
|
||||||
// cover...
|
// cover...
|
||||||
} else if(elem.type == 'cover'){
|
} else if(data.type == 'cover'){
|
||||||
var res = createCoverPage(elem.content)
|
var res = createCoverPage(data.content)
|
||||||
.addClass(elem['class'])
|
.addClass(data['class'])
|
||||||
.appendTo(block)
|
.appendTo(parent)
|
||||||
|
|
||||||
// page-set...
|
// page-set...
|
||||||
} else if(elem.type == 'page-set') {
|
} else if(data.type == 'page-set') {
|
||||||
// buiold an article...
|
// buiold an article...
|
||||||
var res = createEmptyPageSet()
|
var res = createEmptyPageSet()
|
||||||
.addClass(elem['class'])
|
.addClass(data['class'])
|
||||||
.appendTo(block)
|
.appendTo(parent)
|
||||||
// populate article with pages...
|
// populate article with pages...
|
||||||
$(elem.pages).each(function(_, e){
|
$(data.pages).each(function(_, e){
|
||||||
_build(res, e)
|
_build(res, e)
|
||||||
})
|
})
|
||||||
|
|
||||||
// article...
|
// article...
|
||||||
} else if(elem.type == 'article') {
|
} else if(data.type == 'article') {
|
||||||
// buiold an article...
|
// buiold an article...
|
||||||
var res = createEmptyArticle()
|
var res = createEmptyArticle()
|
||||||
.addClass(elem['class'])
|
.addClass(data['class'])
|
||||||
.appendTo(block)
|
.appendTo(parent)
|
||||||
// populate article with pages...
|
// populate article with pages...
|
||||||
$(elem.pages).each(function(_, e){
|
$(data.pages).each(function(_, e){
|
||||||
_build(res, e)
|
_build(res, e)
|
||||||
})
|
})
|
||||||
|
|
||||||
// other...
|
// other...
|
||||||
// NOTE: on a wll-formed JSON we'll never go in here, but just
|
// NOTE: on a wll-formed JSON we'll never go in here, but just
|
||||||
// in case...
|
// in case...
|
||||||
} else if(elem.type == 'raw-html') {
|
} else if(data.type == 'raw-html') {
|
||||||
var res = createPage(elem.content)
|
var res = createPage(data.content)
|
||||||
.addClass(elem['class'])
|
.addClass(data['class'])
|
||||||
.appendTo(block)
|
.appendTo(parent)
|
||||||
}
|
}
|
||||||
|
|
||||||
// metadata...
|
// metadata...
|
||||||
// XXX still might be a bit buggy -- might not be loading some
|
// XXX for some reason this does not set the style attr on pages in page-set...
|
||||||
// data correctly...
|
writeMetadata(res, data)
|
||||||
writeMetadata(elem, res)
|
|
||||||
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
// check version...
|
// check version...
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user