added .story-page page-break, improved ui document selection

This commit is contained in:
Bachir Soussi Chiadmi
2017-04-29 16:25:51 +02:00
parent 7cb28d4fb3
commit c4c954e4e8
4 changed files with 36 additions and 18 deletions
+23 -15
View File
@@ -1,28 +1,36 @@
$(function() {
$('select[name="document"]').change(function(e){
console.log("document selection",this);
$('iframe').attr('src', this.value);
});
$.getJSON('build/toc.json', function(data){
// console.log(data);
for (book of data) {
// console.log(book);
// var $optgroup = $('<optgroup>').attr('label', book.label);
// for (page of book.pages) {
console.log(data);
for (book in data) {
console.log(data[book]);
// var $optgroup = $('<optgroup>').attr('label', data[book].label);
// for (page of data[book].pages) {
// // console.log(page);
// $optgroup.append($('<option>').attr('value', book.label+'/'+page.file).text(book.label+' : '+page.label));
// $optgroup.append($('<option>').attr('value', data[book].label+'/'+page.file).text(data[book].label+' : '+page.label));
// }
$('[name="document"]').append(
$('<option>')
.attr('value', book.file).text(book.label)
.attr('value', data[book].file).text(data[book].label)
);
}
})
$('select[name="document"]').change(function(e){
// console.log(e);
// var optionSelected = $("option:selected", this);
// var valueSelected = ;
// console.log(this.value);
$('iframe').attr('src', this.value);
});
console.log(window.location.hash);
var hash = parseInt(window.location.hash.replace('#',''));
console.log(hash);
var value = $('[name="document"] option:eq('+hash+')').attr('value');
console.log('value', value);
$('[name="document"]').val(value).change();
})
// activate toolbar events when iframe is loaded
$('iframe').load(function() {
+2 -2
View File
@@ -1,3 +1,3 @@
nb_page = 5;
cropmarks = true;
nb_page = 100;
cropmarks = false;