function FluidbookChapters(fluidbook, chapters) {\r
this.fluidbook = fluidbook;\r
this.chapters = chapters;\r
+ this.style = 'classic';\r
+ if (this.fluidbook.datas.mobileChaptersStyle) {\r
+ this.style = this.fluidbook.datas.mobileChaptersStyle;\r
+ }\r
this.html = '';\r
this.lastColor;\r
}\r
}\r
this.html = $(h).get(0).outerHTML;\r
\r
- $(document).on('click', 'ul.chapters a', function() {\r
- var li = $(this).parent();\r
- var subnav = $(li).children('ul');\r
- if ($(subnav).length) {\r
- $(subnav).slideToggle();\r
- return false;\r
- } else {\r
- return true;\r
- }\r
- });\r
+\r
+ if (this.style == 'classic') {\r
+ $(document).on('click', 'ul.chapters a', function() {\r
+\r
+ var li = $(this).parent();\r
+ var subnav = $(li).children('ul');\r
+ if ($(subnav).length) {\r
+ $(subnav).slideToggle();\r
+ return false;\r
+ } else {\r
+ return true;\r
+ }\r
+ });\r
+ } else if (this.style == 'ina') {\r
+ $(document).on('click', 'ul.chapters a .right', function(e) {\r
+ var p = $(this).data('page');\r
+ if (p != '') {\r
+ $this.fluidbook.setCurrentPage(p);\r
+ e.stopImmediatePropagation();\r
+ e.stopPropagation();\r
+ e.preventDefault();\r
+ return false;\r
+ }\r
+\r
+ });\r
+\r
+ $(document).on('click', 'ul.chapters a', function() {\r
+ var li = $(this).parent();\r
+ var subnav = $(li).children('ul');\r
+ if ($(subnav).length) {\r
+ $(subnav).slideToggle();\r
+ return false;\r
+ } else {\r
+ return true;\r
+ }\r
+ });\r
+ }\r
},\r
makeClassicMenu: function() {\r
var $this = this;\r
\r
if (chapter.label.substr(0, 3) == '!!!') {\r
chapter.label = chapter.label.substring(3);\r
- chapter.level='-1';\r
+ chapter.level = '-1';\r
}\r
\r
+ var p = (this.fluidbook.virtualToPhysical(chapter.page));\r
\r
-\r
- var res = '<li data-level="' + chapter.level + '"><a href="#/page/' + (this.fluidbook.virtualToPhysical(chapter.page)) + '" class="level' + chapter.level + '">';\r
+ var res = '';\r
+ if (this.style == 'classic') {\r
+ res += '<li data-level="' + chapter.level + '"><a href="#/page/' + p + '" class="level' + chapter.level + '">';\r
+ } else if (this.style == 'ina') {\r
+ res += '<li style="background-color:#' + color + ';" data-level="' + chapter.level + '"><a href="#/page/' + p + '" class="nodark level' + chapter.level + '">';\r
+ }\r
res += chapter.label;\r
- res += '<div class="right">';\r
- if (color == '') {\r
- res += chapter.page;\r
+ res += '<div class="right" data-page="' + p + '">';\r
+\r
+ if (this.style == 'classic') {\r
+ if (color == '') {\r
+ if (chapter.page != '') {\r
+ res += '<span class="pagen">' + chapter.page + '</span>';\r
+ }\r
+ } else {\r
+ res += '<div class="puce" style="background-color:#' + color + ';"></div>';\r
+ }\r
} else {\r
- res += '<div class="puce" style="background-color:#' + color + ';"></div>';\r
+ if (chapter.page != '') {\r
+ res += '<span class="pagen">' + chapter.page + '</span>';\r
+ }\r
+ res += '<div class="puce noshadow"></div>';\r
}\r
res += '</div>'\r
res += '</a></li>';\r
}\r
\r
/* Chapters */\r
+ul.chapters>li{\r
+ clear: both;\r
+}\r
+\r
ul.chapters a{\r
display:block;\r
text-align: left;\r
list-style: none;\r
}\r
\r
-ul.chapters a .right{\r
+ul.chapters .right{\r
+ float:right;\r
+ display: inline-block;\r
+}\r
+\r
+ul.chapters .right .puce.noshadow{\r
+ border-radius: 0px;\r
+ -moz-border-radius: 0px;\r
+ -webkit-border-radius: 0px;\r
+ -ms-border-radius: 0px;\r
+ -o-border-radius: 0px;\r
+\r
+ box-shadow: 2px 2px 4px rgba(0,0,0,0);\r
+ -moz-box-shadow: 2px 2px 4px rgba(0,0,0,0);\r
+ -webkit-box-shadow: 2px 2px 4px rgba(0,0,0,0);\r
+ -ms-box-shadow: 2px 2px 4px rgba(0,0,0,0);\r
+ -o-box-shadow: 2px 2px 4px rgba(0,0,0,0);\r
+ \r
+ margin: 0 0 0 15px;\r
float:right;\r
}\r
\r
-ul.chapters a .right .puce{\r
+ul.chapters .right .puce{\r
width:25px;\r
height:25px;\r
\r
background-repeat: no-repeat;\r
}\r
\r
+ul.chapters a.nodark{\r
+ background-image: none !important;\r
+ border-top:1px solid rgba(255,255,255,0.25);\r
+}\r
+\r
ul.chapters a.level0 .right .puce{\r
margin:2px 0 0 0;\r
}\r