Using BookJS with CSS Regions in the editor, experiences from Fidus Writer

30 views
Skip to first unread message

Johannes Wilm

unread,
Jun 21, 2013, 11:22:03 AM6/21/13
to booktype-dev, Booktype, Gideon Lehmann, Internal Aloha Editor Dev
Hey guys,

I would like to share something from the Fidus Writer experience of using BookJS within the editor directly:

-- The way it's set up right now, when CSS regions are not available, it puts footnotes in the right margin and not overlapping. By changing 1-2 lines of code, the same should be doable for margin notes.

-- There are issues of editing speed when one gets above something between 30 and 90 pages. Typing individual letters is fine, but typing 5-6 letters directly after oneanother causes the editor to go into a spin and it takes several seconds for it to get out of it again. The reason for this is not entirely clear to me, but after tests I suspect it to be somewhere in the space between CSS Regions, Flexboxes and contenteditable. Almost all of the time is spent by browser-internal functions and not in the Javascript. 

-- Some of the above-mentioned issue will likely go away soon automatically. Currently we check for mutations in the contents to decide whether we should check for the need of creating new pages. This means that with every letter, it is checked whether new pages are needed and the browser-internal function that checks for the need of new pages takes a lot of time. The CSS spec recently gained a new event which is triggered when there is a change in the amount of regions needed. Once that is implemented in Blink, we can instead switch to listening to that.

-- The speed issues are not expeirenced when using BookJS without CSS Regions (meaning: when it is shown as one large page with footnotes in the right margin).

-- It is currently not possibly to switch the page-based view off on the fly -- it is either on or off when BookJS is loaded. This would likely be a good option to have in any case. Unless someone protests, I will implement this after I am done with the BookJS 1.0 todo list.

-- It looks as if CSS Regions will become a permanent part of Blink. The hcromium people previously made some comments which suggested they would not want to include it, but there has now been some recent work to switch the column system to use CSS Regions internally. Until now Chromium lagged behind all other browsers in that it had very bad clumn support -- for example; they don't print. of course it is theoretically possible for Chromium to have the CSS Regions code, but only to use it within the column code and not expose it to the javascript, but that does not seem very likely to me.

I hope this information is interesting to you guys and will help in deciding how to go forward with the Booktype editor. :)


--
Johannes Wilm
BookJS Developer


skype: johanneswilm

Aco Erkalovic

unread,
Jun 21, 2013, 11:45:35 AM6/21/13
to Johannes Wilm, booktype-dev, Booktype, Gideon Lehmann, Internal Aloha Editor Dev
On Fri, Jun 21, 2013 at 5:22 PM, Johannes Wilm <johann...@sourcefabric.org> wrote:
-- It is currently not possibly to switch the page-based view off on the fly -- it is either on or off when BookJS is loaded. This would likely be a good option to have in any case. Unless someone protests, I will implement this after I am done with the BookJS 1.0 todo list.


Manual switch of pagination is a must for the editing environment, and it is kind of obvious feature if you want to be able to switch preview for different devices/outputs in your editing environment.

Aco

-- 
Aleksandar Erkalović
Booktype Developer
aleksandar...@sourcefabric.org

www.sourcefabric.org

mobile: +385-(0)91-6425220
twitter: @aerkalov | skype: aerkalov

Johannes Wilm

unread,
Jun 21, 2013, 11:50:28 AM6/21/13
to Aco Erkalovic, booktype-dev, Booktype, Gideon Lehmann, Internal Aloha Editor Dev
On Fri, Jun 21, 2013 at 11:45 AM, Aco Erkalovic <aleksandar...@sourcefabric.org> wrote:
On Fri, Jun 21, 2013 at 5:22 PM, Johannes Wilm <johann...@sourcefabric.org> wrote:
-- It is currently not possibly to switch the page-based view off on the fly -- it is either on or off when BookJS is loaded. This would likely be a good option to have in any case. Unless someone protests, I will implement this after I am done with the BookJS 1.0 todo list.


Manual switch of pagination is a must for the editing environment, and it is kind of obvious feature if you want to be able to switch preview for different devices/outputs in your editing environment.

Yepp, agreed. Last instructions were that we will not use BookJs in the Booktype editor, but I would still like to make it possible to do this some time in the future at least.
 

Aco

-- 
Aleksandar Erkalović
Booktype Developer
aleksandar...@sourcefabric.org

www.sourcefabric.org

mobile: +385-(0)91-6425220
twitter: @aerkalov | skype: aerkalov

Reply all
Reply to author
Forward
0 new messages