Skip to content

Commit fcdbb83

Browse files
committed
Merge branch 'bibi/develop' into bibi/master
2 parents cd1c97b + f6ba3d8 commit fcdbb83

File tree

8 files changed

+61
-29
lines changed

8 files changed

+61
-29
lines changed

__src/bibi/and/jo.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
(() => {
22
'use strict';
33
if(window['bibi:jo']) return;
4+
if(!Array.prototype.includes) Array.prototype.includes = function(I) { for(let l = this.length, i = 0; i < l; i++) if(this[i] == I) return true; return false; };
45
const Jo = window['bibi:jo'] = { 'version': '____Bibi-Version____',
56
CSS: require('./jo.scss'),
67
Status: '',

__src/bibi/resources/scripts/bibi.heart.js

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -472,8 +472,14 @@ L.wait = () => {
472472
};
473473

474474

475+
L.openNewWindow = (Href) => {
476+
const WO = window.open(Href);
477+
return WO ? WO : location.href = Href;
478+
};
479+
480+
475481
L.play = () => {
476-
if(S['start-in-new-window']) return window.open(location.href);
482+
if(S['start-in-new-window']) return L.openNewWindow(location.href);
477483
L.Played = true;
478484
R.resetStage();
479485
L.wait.resolve();
@@ -944,7 +950,7 @@ L.coordinateLinkages = (BasePath, RootElement, InNav) => {
944950
if(A.Destination) new Promise(resolve => A.InNav ? I.Panel.toggle().then(resolve) : resolve()).then(() => {
945951
if(L.Opened) return R.focusOn({ Destination: A.Destination, Duration: 0 }).then(Destination => I.History.add({ UI: B, SumUp: false, Destination: Destination }));
946952
if(!L.Waiting) return false;
947-
if(S['start-in-new-window']) return window.open(location.href + (location.hash ? ',' : '#') + 'jo(nav:' + A.NavANumber + ')');
953+
if(S['start-in-new-window']) return L.openNewWindow(location.href + (location.hash ? ',' : '#') + 'jo(nav:' + A.NavANumber + ')');
948954
S['to'] = A.Destination;
949955
L.play();
950956
});
@@ -1005,31 +1011,37 @@ L.loadItem = (Item, Opt = {}) => { // !!!! Don't Call Directly. Use L.loadSpread
10051011
}
10061012
ItemBox.classList.remove('loaded');
10071013
return new Promise((resolve, reject) => {
1008-
if(Item.BlobURL) return resolve({});
1014+
if(Item.BlobURL) { resolve({}); return; }
10091015
if(/\.(html?|xht(ml)?|xml)$/i.test(Item.Path)) { // (X)HTML
1010-
if(!B.ExtractionPolicy) return resolve({ // Extracted
1011-
URL: O.fullPath(Item.Path)
1012-
});
1013-
return O.file(Item, { Preprocess: true }).then(Item => resolve({ // Archived
1014-
HTML: Item.Content.replace(/^<\?.+?\?>/, '')
1015-
})).catch(reject);
1016+
if(!B.ExtractionPolicy /*!!!!!!!!*/ && !sML.UA.Gecko /*!!!!!!!!*/ ) { // Extracted (exclude Gecko from here, because of such books as styled only with -webkit/epub- prefixed properties. It's NOT Gecko's fault.)
1017+
resolve({
1018+
URL: O.fullPath(Item.Path)
1019+
}); return;
1020+
}
1021+
O.file(Item, { Preprocess: true }).then(Item => { // Archived (or Gecko. It's NOT Gecko's fault...)
1022+
resolve({
1023+
HTML: Item.Content.replace(/^<\?.+?\?>/, '')
1024+
})
1025+
}).catch(reject); return;
10161026
}
10171027
if(/\.(gif|jpe?g|png)$/i.test(Item.Path)) { // Bitmap-in-Spine
1018-
return O.file(Item, { URI: true }).then(Item => resolve({
1019-
Head: (Item.Ref['rendition:layout'] == 'pre-paginated' && B.ICBViewport) ? `<meta name="viewport" content="width=${ B.ICBViewport.Width }, height=${ B.ICBViewport.Height }" />` : '',
1020-
Body: `<img class="bibi-spine-item-image" alt="" src="${ Item.URI }" />` // URI is BlobURL or URI
1021-
})).catch(reject)
1028+
O.file(Item, { URI: true }).then(Item => {
1029+
resolve({
1030+
Head: (Item.Ref['rendition:layout'] == 'pre-paginated' && B.ICBViewport) ? `<meta name="viewport" content="width=${ B.ICBViewport.Width }, height=${ B.ICBViewport.Height }" />` : '',
1031+
Body: `<img class="bibi-spine-item-image" alt="" src="${ Item.URI }" />` // URI is BlobURL or URI
1032+
})
1033+
}).catch(reject); return;
10221034
}
10231035
if(/\.(svg)$/i.test(Item.Path)) { // SVG-in-Spine
1024-
return O.file(Item, { Preprocess: true }).then(Item => {
1036+
O.file(Item, { Preprocess: true }).then(Item => {
10251037
const StyleSheetRE = /<\?xml-stylesheet\s*(.+?)\s*\?>/g, MatchedStyleSheets = Item.Content.match(StyleSheetRE);
10261038
let StyleSheets = '', Content = Item.Content;
10271039
if(MatchedStyleSheets) StyleSheets = MatchedStyleSheets.map(SS => SS.replace(StyleSheetRE, `<link rel="stylesheet" $1 />`)).join(''), Content = Content.replace(StyleSheetRE, '');
10281040
resolve({
10291041
Head: (!B.ExtractionPolicy ? `<base href="${ O.fullPath(Item.Path) }" />` : '') + StyleSheets,
10301042
Body: Content
10311043
});
1032-
}).catch(reject)
1044+
}).catch(reject); return;
10331045
}
10341046
resolve({});
10351047
}).then(Source => new Promise(resolve => {
@@ -1432,9 +1444,9 @@ R.renderReflowableItem = (Item) => {
14321444
let PaginateWith = '';
14331445
if(!Item.Outsourcing) {
14341446
if(O.PaginateWithCSSShapes) {
1435-
if(S.RVM == 'paged' && Item.HTML['offset'+ C.L_SIZE_L] > PageCL) PaginateWith = 'S'; // VM:Paged WM:Vertical LA:Horizontal
1436-
else if( Item.HTML['offset'+ C.L_SIZE_B] > PageCB) PaginateWith = 'C'; // VM:Paged/Horizontal WM:Horizontal LA:Horizontal / VM:Vertical WM:Vertical LA:Vertical
1437-
} else if(S.RVM == 'paged' || Item.HTML['offset'+ C.L_SIZE_B] > PageCB) PaginateWith = 'C'; // VM:Paged/Horizontal WM:Horizontal LA:Horizontal / VM:Paged/Vertical WM:Vertical LA:Vertical
1447+
if(S.RVM == 'paged' && Item.HTML['offset'+ C.L_SIZE_L] > PageCL) PaginateWith = 'S'; // VM:Paged WM:Vertical LA:Horizontal
1448+
else if( Item.HTML['offset'+ C.L_SIZE_B] > PageCB) PaginateWith = 'C'; // VM:Paged/Horizontal WM:Horizontal LA:Horizontal // VM: Vertical WM:Vertical LA:Vertical
1449+
} else if(S.RVM == 'paged' || Item.HTML['offset'+ C.L_SIZE_B] > PageCB) PaginateWith = 'C'; // VM:Paged/Horizontal WM:Horizontal LA:Horizontal // VM:Paged/Vertical WM:Vertical LA:Vertical
14381450
}
14391451
switch(PaginateWith) {
14401452
case 'S':
@@ -3593,7 +3605,7 @@ I.BookmarkManager = { create: () => { if(!S['use-bookmarks']) return;
35933605
action: () => {
35943606
if(L.Opened) return R.focusOn({ Destination: Bmk }).then(Destination => I.History.add({ UI: BookmarkManager, SumUp: false/*true*/, Destination: Destination }));
35953607
if(!L.Waiting) return false;
3596-
if(S['start-in-new-window']) return window.open(location.href + (location.hash ? ',' : '#') + 'jo(si-ppis:' + Bmk['SI-PPiS'] + ')');
3608+
if(S['start-in-new-window']) return L.openNewWindow(location.href + (location.hash ? ',' : '#') + 'jo(si-ppis:' + Bmk['SI-PPiS'] + ')');
35973609
S['to'] = { 'SI-PPiS': Bmk['SI-PPiS'] };
35983610
L.play();
35993611
},

__src/bibi/resources/scripts/bibi.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,22 @@ document.addEventListener('DOMContentLoaded', () => {
2424
break;
2525
} else BookStyleElement = BookStyleElement.nextElementSibling;
2626
}
27-
Bibi.BookStyleURL = URL.createObjectURL(new Blob([BookStyleCSS], { type: 'text/css' }))
28-
Bibi.hello();
27+
Bibi.BookStyleURL = URL.createObjectURL(new Blob([BookStyleCSS], { type: 'text/css' }));
28+
if(!sML.UA.Trident) Bibi.hello(); else {
29+
const BibiStyles = document.head.querySelectorAll('#bibi-style, #bibi-dress');
30+
document.documentElement.style.display = 'none';
31+
sML.forEach(BibiStyles)(BibiStyle => {
32+
BibiStyle.OriginalHref = BibiStyle.getAttribute('href');
33+
BibiStyle.href = '';
34+
});
35+
setTimeout(() => {
36+
sML.forEach(BibiStyles)(BibiStyle => {
37+
BibiStyle.href = BibiStyle.OriginalHref;
38+
delete BibiStyle.OriginalHref;
39+
});
40+
document.documentElement.style.display = '';
41+
Bibi.hello();
42+
}, 0);
43+
}
2944
});
3045
});

__src/bibi/resources/styles/_#globals.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ $INVARIABLE__Spinner_ZIndex: 99999999999;
116116

117117
@mixin GLOBAL__FontIcon_BaseStyles($SCOPED__FamilyName, $SCOPED__FontSize: 100%, $SCOPED__LineHeight: 1) {
118118
font: #{$SCOPED__FontSize} / #{$SCOPED__LineHeight} $SCOPED__FamilyName;
119-
-ms-font-feature-settings: 'liga' 1; font-feature-settings: 'liga'; text-transform: none;
119+
font-feature-settings: "kern", "liga", "clig", "calt"; -ms-font-feature-settings: "kern", "liga", "clig", "calt"; text-transform: none;
120120
-webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizelegibility;
121121
speak: none; direction: ltr; letter-spacing: 0; white-space: nowrap; word-wrap: normal; overflow-wrap: normal;
122122
}

__src/bibi/wardrobe/_dress-codes/_stage.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ $PoweredBy_Height: 39px;
5050
$PoweredBy_BackgroundColor__VeilOpened: rgba(white, .6);
5151
$PoweredBy-A-Logo_OpacityOfWhite__VeilOpened: 0;
5252
$PoweredBy-A-Logo_OpacityOfBlack__VeilOpened: .69;
53-
$PoweredBy-A_BackgroundColor__VeilOpened: rgba(white, 0);
53+
$PoweredBy-A_BackgroundColor__VeilOpened: rgba(white, .84);
5454
$PoweredBy-A-Logo_OpacityOfWhite__VeilOpened__Hover: 0;
5555
$PoweredBy-A-Logo_OpacityOfBlack__VeilOpened__Hover: .96;
5656
$PoweredBy-A_BackgroundColor__VeilOpened__Hover: rgba(white, 1);

__src__back-compat/bib/i.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bibi.info.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/*!
2-
* ()
2+
* (邃 )
33
* # Additional Webpack Config for Bibi
44
*
55
*/
66

77
'use strict';
88

99
const Bibi = {
10-
'version': '1.0.0',
10+
'version': '1.0.1',
1111
'author': {
1212
'name': 'Satoru MATSUSHIMA'
1313
},
@@ -31,7 +31,7 @@ Bibi.WithBCK = (Bibi.Arguments['bc'] || Bibi.ForPack);
3131
// =============================================================================================================================
3232

3333
const _banner = (Name, Credit, Extra, Mark) => '/*!' + `
34-
*` + (!Mark ? '' : ` ()`) + `
34+
*` + (!Mark ? '' : ` (邃 )`) + `
3535
* # ${ Name }
3636
*` + (!Credit ? '' : (Credit == 'default' ? `
3737
* * Copyright (c) ${ Bibi.author.name } - ${ Bibi.homepage }
@@ -95,7 +95,11 @@ Bibi.Banners = {
9595
// -----------------------------------------------------------------------------------------------------------------------------
9696

9797
'/and/jo.js': _banner(`Jo | Helper for Embedding Bibi-Frames in Webpage.`, 'default', null, true),
98-
'^bib/i.js': _banner(`Jo | Helper for Embedding Bibi-Frames in Webpage.`, 'default', null, true),
98+
99+
'^bib/i.js': _banner(`bib/i.js (BCK)`, `
100+
* * Calling:
101+
* - Jo | Helper for Embedding Bibi-Frames in Webpage. - bibi/and/jo.js
102+
`, null, true),
99103

100104
// -----------------------------------------------------------------------------------------------------------------------------
101105

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bibi",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"author": {
55
"name": "Satoru MATSUSHIMA"
66
},

0 commit comments

Comments
 (0)