Skip to content

Commit

Permalink
Update README (and add some cosmetic changes).
Browse files Browse the repository at this point in the history
  • Loading branch information
satorumurmur committed Nov 6, 2019
1 parent 321008b commit 0239801
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 43 deletions.
9 changes: 5 additions & 4 deletions .gitignore
@@ -1,10 +1,11 @@
/__archives
/__dist/**
!/__dist/bibi-bookshelf
/__dist/bibi-bookshelf/**
!/__dist/bibi-bookshelf/.gitignore
/__dist
/__src/bibi/wardrobe/DRESS-TEMPLATE-*

/archives
/bib
/dev-bib

node_modules
npm-debug.log

Expand Down
27 changes: 16 additions & 11 deletions README.md
Expand Up @@ -131,43 +131,48 @@ How to Arrange Development Environment
2. $ `cd <the local repository>`
3. $ `npm install`

And files and folders are generated in `__dist` folder.



### How to Develop

1. $ `npm start`
1. webpack generates development version of Bibi, and start to watch changes of the files.
1. webpack generates development version of Bibi to `__dist` folder, and start to watch changes of the files in `__src` folder.
2. BrowserSync webserver launches and navigate your browser to `http://localhost:61671/bibi/?book=`.
2. Edit source files.
1. webpack watches your modification and updates development version of the file(s) with sourcemaps.
1. If you modify source files in `__src` folder, development version of the file(s) are updated in `__dist` folder automaticaly.
2. BrowserSync reloads your browser(s) or inject changes of CSS.

Files in `__dist` folder generated with `npm start` are development version.
Please don't forget to run `npm run build` and build production version before you upload.

| Distribution | Source |
| --------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `__dist/bibi/index.html` | `__src/bibi/index.html` |
| `__dist/bibi/*.html` | `__src/bibi/*.html` |
| `__dist/bibi/and/jo.js` | `__src/bibi/and/jo.js` + `__src/bibi/and/jo.scss` |
| `__dist/bibi/extensions/**` | `__src/bibi/extensions/**` |
| `__dist/bibi/presets/*.js` | `__src/bibi/presets/*.js` |
| `__dist/bibi/resources/scripts/bibi.js` | `__src/bibi/resources/scripts/*.js` + `__src/bibi/resources/scripts/bibi.book.scss` |
| `__dist/bibi/resources/styles/bibi.css` | `__src/bibi/resources/styles/*.scss` |
| `__dist/bibi/wardrobe/**/*.css` | Read documents in `__src/bibi/wardrobe/README-DRESS_ja` (Sorry..., currently README is Japanese only) |

* Files in `__dist/bibi-bookshelf/` are not processed (this directory contains `.gitkeep`)

Files in the `Distribution` column of the table are overwritten with the files updated by `npm start` or `npm run build`.
If you want to modify them, please edit files in the `Source` column instead of editing these files in `__dist` directly.


### How to Build

* $ `npm run build`
- webpack generates production version of Bibi.

- webpack generates production version of Bibi to `__dist` folder.
- You can upload them to your online webserver.


### How to Make a Ditribution
### How to Make a Ditribution Package

* $ `npm run make:distribution`
1. webpack generates production version of Bibi.
2. gulp generates zipped archive.
* $ `npm run make:distribution-package`
1. webpack generates production version of Bibi to `__dist` folder.
2. gulp generates zipped archive to `__archives` folder.



Expand Down
38 changes: 11 additions & 27 deletions __src/bibi/resources/scripts/bibi.heart.js
Expand Up @@ -62,7 +62,7 @@ Bibi.initialize = () => {
if(Lan == 'en') break;
} return 'en';
})()));
// Device & Event;
// Device & Event
if(O.TouchOS = (sML.OS.iOS || sML.OS.Android)) {
O.HTML.classList.add('touch');
if(sML.OS.iOS) {
Expand All @@ -77,8 +77,8 @@ Bibi.initialize = () => {
H.initialize();
U.initialize();
S.initialize();
// Say Bye-bye
if(sML.UA.Trident && !(sML.UA.Trident[0] >= 7)) {
// Say Bye-bye
I.note(`Your Browser Is Not Compatible`, 99999999999, 'ErrorOccured');
return O.error(I.Veil.byebye({
'en': `<span>Sorry....</span> <span>Your Browser Is</span> <span>Not Compatible.</span>`,
Expand Down Expand Up @@ -205,7 +205,7 @@ Bibi.loadBook = (BookDataParam) => Promise.resolve().then(() => {
});
}).then(() => {
if(S['use-cookie']) {
const BibiCookie = O.Cookie.remember(O.RootPath);
const BibiCookie = O.Cookie.remember(O.Path);
const BookCookie = O.Cookie.remember(B.ID);
if(BibiCookie) {
if(!U['reader-view-mode'] && BibiCookie.RVM ) S['reader-view-mode'] = BibiCookie.RVM;
Expand Down Expand Up @@ -1315,21 +1315,14 @@ R.layOutSpread = (Spread) => new Promise(resolve => {
// Paired Mixed Items
if(R.Stage.Width > Spread.Items[0].Box.offsetWidth + Spread.Items[1].Box.offsetWidth) {
// horizontal layout
console.log(`== R.layOutSpread ======================================= Mixed:A ==`);
SpreadSize.Width = Spread.Items[0].Box.offsetWidth + Spread.Items[1].Box.offsetWidth;
SpreadSize.Height = Math.max(Spread.Items[0].Box.offsetHeight, Spread.Items[1].Box.style.offsetHeight);
console.log(`» R.layOutSpread › Mixed:H › R.Spreads[${ Spread.Index }]`, Spread);
} else {
// vertical layout
console.log(`== R.layOutSpread ======================================= Mixed:B ==`);
SpreadSize.Width = Math.max(Spread.Items[0].Box.offsetWidth, Spread.Items[1].Box.offsetWidth);
SpreadSize.Height = Spread.Items[0].Box.offsetHeight + Spread.Items[1].Box.offsetHeight;
} /**/ {
console.log(`--------------------------------------------------------------------`);
console.log(`The Structure of this EPUB File is Rare.`);
console.log(`If This File is Yours and You Can Send It,`);
console.log(`Please Send It as a Sample to the Author of Bibi.`);
console.log(`It will Help Improving Bibi So Much !`);
console.log(`====================================================================`);
console.log(`» R.layOutSpread › Mixed:V › R.Spreads[${ Spread.Index }]`, Spread);
}
}
if(O.Scrollbars.Height && S.SLA == 'vertical' && S.ARA != 'vertical') {
Expand Down Expand Up @@ -1888,7 +1881,7 @@ R.changeView = (Par, Opt = {}) => {
L.play();
}
if(S['use-cookie']) {
O.Cookie.eat(O.RootPath, {
O.Cookie.eat(O.Path, {
'RVM': Par.Mode
});
}
Expand Down Expand Up @@ -2531,7 +2524,7 @@ I.Menu = { create: () => {
if(IsActive) O.HTML.classList.add( 'book-full-breadth');
else O.HTML.classList.remove('book-full-breadth');
if(S.RVM == 'horizontal' || S.RVM == 'vertical') R.changeView({ Mode: S.RVM, Force: true });
if(S['use-cookie']) O.Cookie.eat(O.RootPath, { 'FBL': S['full-breadth-layout-in-scroll'] });
if(S['use-cookie']) O.Cookie.eat(O.Path, { 'FBL': S['full-breadth-layout-in-scroll'] });
}
}]
}]
Expand Down Expand Up @@ -2701,7 +2694,7 @@ I.FontSizeChanger = { create: () => {
const FontSizeChanger = I.FontSizeChanger = {};
if(typeof S['font-size-scale-per-step'] != 'number' || S['font-size-scale-per-step'] <= 1) S['font-size-scale-per-step'] = 1.25;
if(S['use-font-size-changer'] && S['use-cookie']) {
const BibiCookie = O.Cookie.remember(O.RootPath);
const BibiCookie = O.Cookie.remember(O.Path);
if(BibiCookie && BibiCookie.FontSize && BibiCookie.FontSize.Step != undefined) FontSizeChanger.Step = BibiCookie.FontSize.Step * 1;
}
if(typeof FontSizeChanger.Step != 'number' || FontSizeChanger.Step < -2 || 2 < FontSizeChanger.Step) FontSizeChanger.Step = 0;
Expand Down Expand Up @@ -2759,7 +2752,7 @@ I.FontSizeChanger = { create: () => {
if(typeof Actions.before == 'function') Actions.before();
FontSizeChanger.Step = Step;
if(S['use-font-size-changer'] && S['use-cookie']) {
O.Cookie.eat(O.RootPath, { FontSize: { Step: Step } });
O.Cookie.eat(O.Path, { FontSize: { Step: Step } });
}
setTimeout(() => {
R.layOut({
Expand Down Expand Up @@ -5095,12 +5088,7 @@ O.getOrigin = (Win = window) => { const Loc = Win.location;

O.Origin = O.getOrigin();

O.Path = (DCS => {
if(DCS) return DCS.src;
return document.getElementById('bibi-script').src;
})(document.currentScript);

O.RootPath = O.Path.replace(/\/res\/scripts\/.+$/, '');
O.Path = document.currentScript.src;


O.Cookie = {
Expand Down Expand Up @@ -5304,11 +5292,7 @@ X.load = (Xtn) => new Promise((resolve, reject) => {
const XO = new URL(Xtn['src']).origin;
if(!S['trustworthy-origins'].includes(XO)) return reject(`The Origin Is Not Allowed. ("${ Xtn['src'] }")`);
Xtn.Script = document.head.appendChild(sML.create('script', { className: 'bibi-extension-script', src: Xtn['src'], Extension: Xtn, resolve: resolve, reject: function() { reject(); document.head.removeChild(this); } }));
})/*.then(DefinedExtension =>
DefinedExtension['id'] + ': ' + O.getPath(O.RootPath, DefinedExtension['src'])
).catch(Msg =>
Msg
)*/;
});

X.add = (XMeta) => {
const XScript = document.currentScript;
Expand Down
2 changes: 1 addition & 1 deletion bibi.info.js
Expand Up @@ -83,7 +83,7 @@ Bibi.Banners = {

// -----------------------------------------------------------------------------------------------------------------------------

'/jo.js': _banner(`Jo | Partner of Bibi who embeds Bibi frame in webpage.`, 'default', null, true),
'/jo.js': _banner(`Jo | Helper for Embedding Bibi-Frames in Webpage.`, 'default', null, true),

// -----------------------------------------------------------------------------------------------------------------------------

Expand Down

0 comments on commit 0239801

Please sign in to comment.