Former-commit-id: 4a46063ad87fa375e32ce43e23b8b485591e328e [formerly bc146310feea284ada8b7d488edb627ec56be644]
Former-commit-id: a782917b671a4632676d8d0671c197752c569da5
This commit is contained in:
Jaifroid 2017-07-12 08:45:20 +01:00
parent 1b06158623
commit 164ca48c80
18 changed files with 345 additions and 36 deletions

View File

@ -123,7 +123,6 @@
<Content Include="www\-\s\css_modules\mediawiki.page.gallery.styles.css" />
<Content Include="www\-\s\css_modules\mediawiki.toc.css" />
<Content Include="www\-\s\css_modules\mobile.css" />
<Content Include="www\-\s\css_modules\skins.minerva.base.reset!skins.minerva.content.styles!ext.cite.style!mediawiki.page.gallery.styles!mobile.app.pagestyles.android!mediawiki.skinning.content.parsoid.css" />
<Content Include="www\-\s\style-mobile.css" />
<Content Include="www\-\s\style.css" />
<Content Include="www\A\dummyArticle.html" />

View File

@ -21,6 +21,6 @@
<WindowsPhoneEmulatorID>F0AB49D8-754C-4531-A635-E6B4395FD39A;Mobile Emulator 10.0.15063.0 QHD 5.2 inch 3GB</WindowsPhoneEmulatorID>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DebuggerFlavor>AppHostLocalDebugger</DebuggerFlavor>
<DebuggerFlavor>AppHostDeviceDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>

View File

@ -45,6 +45,7 @@
</Applications>
<Capabilities>
<Capability Name="internetClient" />
<Capability Name="privateNetworkClientServer" />
<uap:Capability Name="removableStorage" />
<DeviceCapability Name="location" />
</Capabilities>

Binary file not shown.

View File

@ -20,7 +20,7 @@
<WindowsSdkPath>
</WindowsSdkPath>
<LayoutDir>C:\Users\geoff\Source\Repos\kiwix-js-windows\bin\Release\AppX</LayoutDir>
<RegisteredManifestChecksum>9B4FA2C6D43297D8009F6D2EAD9B98BE3D00DC06E24A883C19470665453793EF</RegisteredManifestChecksum>
<RegisteredManifestChecksum>00754D6125E60AC59A83C9D77EC64724575CDA5EC7DF4D589E854AABEFC854A5</RegisteredManifestChecksum>
<RegisteredPackageMoniker>a1a5e0b9-13d4-41fb-810d-518949f03df4_0.5.1.0_neutral__zfxmafgedzx24</RegisteredPackageMoniker>
<RegisteredUserModeAppID>a1a5e0b9-13d4-41fb-810d-518949f03df4_zfxmafgedzx24!App</RegisteredUserModeAppID>
<RegisteredPackageID>a1a5e0b9-13d4-41fb-810d-518949f03df4</RegisteredPackageID>
@ -32,7 +32,7 @@
<AppXManifest Include="C:\Users\geoff\Source\Repos\kiwix-js-windows\bin\Release\AppxManifest.xml">
<PackagePath>AppxManifest.xml</PackagePath>
<ReRegisterAppIfChanged>true</ReRegisterAppIfChanged>
<Modified>2017-07-10T19:34:13.265</Modified>
<Modified>2017-07-12T07:35:00.063</Modified>
</AppXManifest>
</ItemGroup>
<ItemGroup>
@ -289,37 +289,49 @@
<PackagePath>www\img\Kiwix_icon_transparent_600x600.png</PackagePath>
<Modified>2017-06-16T16:31:46.863</Modified>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Users\geoff\Source\Repos\kiwix-js-windows\www\-\s\css_modules\content.parsoid.css">
<PackagePath>www\-\s\css_modules\content.parsoid.css</PackagePath>
<Modified>2017-07-11T14:01:12.775</Modified>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Users\geoff\Source\Repos\kiwix-js-windows\www\-\s\css_modules\ext.cite.a11y.css">
<PackagePath>www\-\s\css_modules\ext.cite.a11y.css</PackagePath>
<Modified>2017-07-09T20:04:14.062</Modified>
<Modified>2017-07-11T05:58:27.225</Modified>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Users\geoff\Source\Repos\kiwix-js-windows\www\-\s\css_modules\ext.cite.styles.css">
<PackagePath>www\-\s\css_modules\ext.cite.styles.css</PackagePath>
<Modified>2017-07-09T20:07:35.865</Modified>
<Modified>2017-07-11T05:58:27.226</Modified>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Users\geoff\Source\Repos\kiwix-js-windows\www\-\s\css_modules\ext.scribunto.logs.css">
<PackagePath>www\-\s\css_modules\ext.scribunto.logs.css</PackagePath>
<Modified>2017-07-10T16:53:20.370</Modified>
<Modified>2017-07-11T05:58:27.228</Modified>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Users\geoff\Source\Repos\kiwix-js-windows\www\-\s\css_modules\ext.timeline.styles.css">
<PackagePath>www\-\s\css_modules\ext.timeline.styles.css</PackagePath>
<Modified>2017-07-10T16:45:46.762</Modified>
<Modified>2017-07-11T05:58:27.229</Modified>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Users\geoff\Source\Repos\kiwix-js-windows\www\-\s\css_modules\inserted_style_mobile.css">
<PackagePath>www\-\s\css_modules\inserted_style_mobile.css</PackagePath>
<Modified>2017-07-11T14:02:27.062</Modified>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Users\geoff\Source\Repos\kiwix-js-windows\www\-\s\css_modules\mediawiki.page.gallery.styles.css">
<PackagePath>www\-\s\css_modules\mediawiki.page.gallery.styles.css</PackagePath>
<Modified>2017-07-10T16:59:16.695</Modified>
<Modified>2017-07-11T05:58:27.230</Modified>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Users\geoff\Source\Repos\kiwix-js-windows\www\-\s\css_modules\mediawiki.toc.css">
<PackagePath>www\-\s\css_modules\mediawiki.toc.css</PackagePath>
<Modified>2017-07-09T20:06:05.109</Modified>
<Modified>2017-07-11T05:58:27.232</Modified>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Users\geoff\Source\Repos\kiwix-js-windows\www\-\s\css_modules\mobile.css">
<PackagePath>www\-\s\css_modules\mobile.css</PackagePath>
<Modified>2017-07-11T14:04:35.506</Modified>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Users\geoff\Source\Repos\kiwix-js-windows\www\-\s\style-mobile.css">
<PackagePath>www\-\s\style-mobile.css</PackagePath>
<Modified>2017-06-24T18:35:29.978</Modified>
<Modified>2017-07-11T06:22:06.593</Modified>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Users\geoff\Source\Repos\kiwix-js-windows\www\-\s\style.css">
<PackagePath>www\-\s\style.css</PackagePath>
<Modified>2017-07-09T11:19:06.503</Modified>
<Modified>2017-07-11T05:58:27.243</Modified>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Users\geoff\Source\Repos\kiwix-js-windows\www\css\app.css">
<PackagePath>www\css\app.css</PackagePath>
@ -339,7 +351,7 @@
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Users\geoff\Source\Repos\kiwix-js-windows\www\index.html">
<PackagePath>www\index.html</PackagePath>
<Modified>2017-06-21T19:37:19.038</Modified>
<Modified>2017-07-12T07:15:37.575</Modified>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Users\geoff\Source\Repos\kiwix-js-windows\www\favicon.ico">
<PackagePath>www\favicon.ico</PackagePath>
@ -371,11 +383,11 @@
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Users\geoff\Source\Repos\kiwix-js-windows\www\js\app.js">
<PackagePath>www\js\app.js</PackagePath>
<Modified>2017-07-10T17:08:27.704</Modified>
<Modified>2017-07-12T07:39:35.655</Modified>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Users\geoff\Source\Repos\kiwix-js-windows\www\js\init.js">
<PackagePath>www\js\init.js</PackagePath>
<Modified>2017-07-10T19:27:56.859</Modified>
<Modified>2017-07-12T06:21:08.600</Modified>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Users\geoff\Source\Repos\kiwix-js-windows\www\js\lib\abstractFilesystemAccess.js">
<PackagePath>www\js\lib\abstractFilesystemAccess.js</PackagePath>
@ -411,7 +423,7 @@
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Users\geoff\Source\Repos\kiwix-js-windows\www\js\lib\util.js">
<PackagePath>www\js\lib\util.js</PackagePath>
<Modified>2017-07-05T15:38:29.047</Modified>
<Modified>2017-07-11T05:58:27.374</Modified>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Users\geoff\Source\Repos\kiwix-js-windows\www\js\lib\xzdec.js">
<PackagePath>www\js\lib\xzdec.js</PackagePath>
@ -423,7 +435,7 @@
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Users\geoff\Source\Repos\kiwix-js-windows\www\js\lib\zimArchive.js">
<PackagePath>www\js\lib\zimArchive.js</PackagePath>
<Modified>2017-07-05T15:38:29.087</Modified>
<Modified>2017-07-11T05:58:27.405</Modified>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Users\geoff\Source\Repos\kiwix-js-windows\www\js\lib\zimArchiveLoader.js">
<PackagePath>www\js\lib\zimArchiveLoader.js</PackagePath>
@ -435,12 +447,12 @@
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Users\geoff\Source\Repos\kiwix-js-windows\www\js\lib\zimfile.js">
<PackagePath>www\js\lib\zimfile.js</PackagePath>
<Modified>2017-07-05T15:38:29.139</Modified>
<Modified>2017-07-11T05:58:27.436</Modified>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Users\geoff\Source\Repos\kiwix-js-windows\bin\Release\ReverseMap\resources.pri">
<PackagePath>resources.pri</PackagePath>
<ReRegisterAppIfChanged>true</ReRegisterAppIfChanged>
<Modified>2017-07-10T19:28:05.021</Modified>
<Modified>2017-07-12T07:34:59.985</Modified>
</AppxPackagedFile>
</ItemGroup>
<ItemGroup>

View File

@ -0,0 +1,153 @@
/**
* Style Parsoid HTML+RDFa output consistent with wikitext from PHP parser.
* Source here :; https://github.com/voidlinux/void-wiki/blob/master/resources/src/mediawiki.skinning/content.parsoid.less
* converted from less to css
*/
/*csslint regex-selectors:false */
/*
* Auto-numbered external links
* Parsoid renders those as link without content, and lets CSS do the
* counting. This way the counting style can be customized, and counts update
* automatically when content is modified.
*/
.mw-body-content {
counter-reset: mw-numbered-ext-link;
}
.mw-body-content a[rel~='mw:ExtLink']:empty:after {
content: '[' counter(mw-numbered-ext-link) ']';
counter-increment: mw-numbered-ext-link;
}
/**
* References
*
* Parser and Extension:Cite output reference numbers for <sup>[1]</sup> for <ref> tags.
*
* Markup:
* Cake is good<sup>[2]</sup>
* The cake is a lie<span class="reference">[1]</span>
*
* Styleguide 1.1.
*/
span.reference {
font-size: 80%;
line-height: 1;
vertical-align: super;
unicode-bidi: -moz-isolate;
unicode-bidi: isolate;
}
sup,
sub {
line-height: 1;
}
/**
* Block media items
*/
figure[typeof*='mw:Image'],
figure[typeof*='mw:Video'],
figure[typeof*='mw:Audio'] {
margin: 0;
}
figure[typeof*='mw:Image'] a,
figure[typeof*='mw:Video'] a,
figure[typeof*='mw:Audio'] a {
border: 0;
}
figure[typeof*='mw:Image'].mw-halign-right,
figure[typeof*='mw:Video'].mw-halign-right,
figure[typeof*='mw:Audio'].mw-halign-right {
/* @noflip */
margin: 0.5em 0 1.3em 1.4em;
/* @noflip */
clear: right;
/* @noflip */
float: right;
}
figure[typeof*='mw:Image'].mw-halign-left,
figure[typeof*='mw:Video'].mw-halign-left,
figure[typeof*='mw:Audio'].mw-halign-left {
/* @noflip */
margin: 0.5em 1.4em 1.3em 0;
/* @noflip */
clear: left;
/* @noflip */
float: left;
}
figure[typeof*='mw:Image'].mw-halign-none,
figure[typeof*='mw:Video'].mw-halign-none,
figure[typeof*='mw:Audio'].mw-halign-none {
margin: 0;
clear: none;
float: none;
}
figure[typeof*='mw:Image'].mw-halign-center,
figure[typeof*='mw:Video'].mw-halign-center,
figure[typeof*='mw:Audio'].mw-halign-center {
margin: 0 auto 0.5em auto;
display: table;
clear: none;
float: none;
}
figure[typeof*='mw:Image'] > figcaption,
figure[typeof*='mw:Video'] > figcaption,
figure[typeof*='mw:Audio'] > figcaption {
display: table-caption;
caption-side: bottom;
/* In mw-core the font-size is duplicated, 94% in thumbiner
* and again 94% in thumbcaption. 88.4% for font size of the
* caption results in the same behavior. */
font-size: 88.4%;
line-height: 1.4em;
text-align: left;
border: 1px solid #c8ccd1;
border-top: 0;
/* taken from .thumbcaption, plus .thumbinner */
padding: 0 6px 6px 6px;
background-color: #f8f9fa;
}
figure[typeof*='mw:Image'] > figcaption table,
figure[typeof*='mw:Video'] > figcaption table,
figure[typeof*='mw:Audio'] > figcaption table {
/* reset caption side for tables inside figcaptions */
caption-side: top;
}
figure[typeof~='mw:Image/Thumb'],
figure[typeof~='mw:Video/Thumb'],
figure[typeof~='mw:Audio/Thumb'],
figure[typeof~='mw:Image/Frame'],
figure[typeof~='mw:Video/Frame'],
figure[typeof~='mw:Audio/Frame'] {
display: table;
overflow: auto;
text-align: center;
border: 1px solid #c8ccd1;
border-bottom: 0;
border-collapse: collapse;
background-color: #f8f9fa;
margin: 0.5em 0 1.3em 1.4em;
clear: right;
float: right;
}
figure[typeof~='mw:Image/Thumb'] > *:first-child > img,
figure[typeof~='mw:Video/Thumb'] > *:first-child > video,
figure[typeof~='mw:Audio/Thumb'] > *:first-child > video,
figure[typeof~='mw:Image/Frame'] > *:first-child > img,
figure[typeof~='mw:Video/Frame'] > *:first-child > video,
figure[typeof~='mw:Audio/Frame'] > *:first-child > video {
border: 1px solid #c8ccd1;
margin: 3px;
background: #fff;
}
/* Same as img.thumbborder in content.css */
.mw-image-border > *:first-child > img,
.mw-image-border > *:first-child > video {
border: 1px solid #eaecf0;
}
/* Hide the caption for frameless and plain floated images */
figure[typeof~='mw:Image/Frameless'] > figcaption,
figure[typeof~='mw:Video/Frameless'] > figcaption,
figure[typeof~='mw:Audio/Frameless'] > figcaption,
figure[typeof~='mw:Image'] > figcaption,
figure[typeof~='mw:Video'] > figcaption,
figure[typeof~='mw:Audio'] > figcaption {
display: none;
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,44 @@
/**
* Custom style meant to match the design of mwoffliner mobile version to the mobile version of wikipedia
*/
.mw-body-content {
font-family: 'Helvetica Neue','Helvetica','Nimbus Sans L','Arial','Liberation Sans',sans-serif;
font-size: 16px;
line-height: 26px;
}
.mw-body-content p {
margin: 0.5em 0 1em 0;
}
.mw-body h2, .mw-body h3, .mw-body h4, .mw-body h5, .mw-body h6 {
padding: 0.5em 0;
}
.mw-body h3, .mw-body h2 {
clear: both;
width: 100%;
margin-bottom: 0.5em;
border-bottom: solid 1px #eaecf0;
font-family: 'Linux Libertine','Georgia','Times',serif;
}
.mw-body h1 {
font-size: 42px;
}
.mw-body h2 {
font-size: 24px;
}
.mw-body h3 {
border-bottom: 0px solid #eaecf0;
font-size: 19px;
font-weight: bold;
}
.mw-body h4 {
border-bottom: 0px solid #eaecf0;
font-size: 16px;
}
h1[tabindex="0"].collapsible-heading > .indicator {
display: none; /* hide the "v" icone for the main title */
}
@media all and (min-width: 720px) {
.client-js .collapsible-heading .indicator {
display: none !important; /* this is to hide to "v" icone next to titles in desktop */
}
}

File diff suppressed because one or more lines are too long

View File

@ -201,13 +201,22 @@
<br /> Click <a id="btnRescanDeviceStorage">here</a> to rescan your SD Cards and internal memory
</div>
<br />
<h2>Display settings</h2>
<div id="cssSettingsDiv">
Please select the display style: <br />
<input type="radio" name="cssInjectionMode" value="local" id="cssModeLocalRadio" checked><label for="cssModeLocalRadio">&nbsp; Use locally cached display styles</label> (faster if using a Wikipedia ZIM file, falls back to the styles stored in the ZIM)
<br />
<input type="radio" name="cssInjectionMode" value="mobile" id="cssModeMobileRadio"><label for="cssModeMobileRadio">&nbsp; Use Wikipedia mobile display style</label> (only works with standard Wikipedia ZIM files)
<br />
<input type="radio" name="cssInjectionMode" value="zimfile" id="cssModeZIMfileRadio"><label for="cssModeZIMfileRadio">&nbsp; Use styles embedded in the ZIM file</label> (slower retrieval, uses more memory if accessing large Wikipedia ZIMs)
</div>
<h2>Expert settings</h2>
<div id="contentInjectionModeDiv">
Do not touch unless you know what you're doing. <br />
Content injection mode : <br />
<input type="radio" name="contentInjectionMode" value="jquery" id="jQueryModeRadio" checked><label for="jQueryModeRadio">JQuery</label> (slow and memory hungry, but safer)
<input type="radio" name="contentInjectionMode" value="jquery" id="jQueryModeRadio" checked><label for="jQueryModeRadio">&nbsp; JQuery</label> (slow and memory hungry, but safer)
<br>
<input type="radio" name="contentInjectionMode" value="serviceworker" id="serviceworkerModeRadio"><label for="serviceworkerModeRadio">ServiceWorker</label> (faster but unstable, and not supported by all platforms. In particular, Firefox extensions do not allow ServiceWorkers for now)
<input type="radio" name="contentInjectionMode" value="serviceworker" id="serviceworkerModeRadio"><label for="serviceworkerModeRadio">&nbsp; ServiceWorker</label> (faster but unstable, and not supported by all platforms. In particular, Firefox extensions do not allow ServiceWorkers for now)
</div>
<div id="serviceWorkerStatus"></div>
<div id="messageChannelStatus"></div>

View File

@ -191,7 +191,9 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies','abstractFiles
else {
setContentInjectionMode('jquery');
}
});
$('input:radio[name=cssInjectionMode]').on('change', function (e) {
params['cssSource'] = this.value;
});
/**
@ -784,6 +786,7 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies','abstractFiles
//Set up blobArray of promises
var cssArray = htmlArticle.match(regexpSheetHref);
var blobArray = [];
cssSource = params['cssSource'];
getBLOB(cssArray);
//Extract CSS URLs from given array of links
@ -793,21 +796,30 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies','abstractFiles
regexpSheetHref.lastIndex = 0; //Reset start position for next loop
if (regexpMetadataUrl.test(linkArray[2])) { //It's a CSS file contained in ZIM
var zimLink = decodeURIComponent(uiUtil.removeUrlParameters(linkArray[2]));
//If this is a standard Wikipedia css stylesheet cached in the filesystem...
if ((module.config().cssSource != "zimfile") &&
//If this is a standard Wikipedia css use stylesheet cached in the filesystem...
if ((cssSource != "zimfile") &&
(zimLink.match(/-\/s\/style\.css/i) ||
zimLink.match(/-\/s\/css_modules\/mediawiki\.toc\.css/i) ||
zimLink.match(/-\/s\/css_modules\/ext\.cite\.styles\.css/i) ||
zimLink.match(/-\/s\/css_modules\/ext\.timeline\.styles\.css/i) ||
zimLink.match(/-\/s\/css_modules\/ext\.scribunto\.logs\.css/i) ||
zimLink.match(/-\/s\/css_modules\/mediawiki\.page\.gallery\.styles\.css/i) ||
zimLink.match(/-\/s\/css_modules\/ext\.cite\.a11y\.css/i))) {
blobArray[i] = zimLink.match(/-\/s\/style\.css/i) && module.config().cssSource == "mobile" ? "../-/s/style-mobile.css" : zimLink;
zimLink.match(/-\/s\/css_modules\/mediawiki\.toc\.css/i) ||
zimLink.match(/-\/s\/css_modules\/ext\.cite\.styles\.css/i) ||
zimLink.match(/-\/s\/css_modules\/ext\.timeline\.styles\.css/i) ||
zimLink.match(/-\/s\/css_modules\/ext\.scribunto\.logs\.css/i) ||
zimLink.match(/-\/s\/css_modules\/mediawiki\.page\.gallery\.styles\.css/i) ||
zimLink.match(/-\/s\/css_modules\/ext\.cite\.a11y\.css/i) ||
zimLink.match(/-\/s\/css_modules\/content\.parsoid\.css/i) ||
zimLink.match(/-\/s\/css_modules\/inserted_style_mobile\.css/i) ||
zimLink.match(/-\/s\/css_modules\/mobile\.css/i) ||
zimLink.match(/-\/s\/css_modules\/skins\.minerva\.base\.reset\|skins\.minerva\.content\.styles\|ext\.cite\.style\|mediawiki\.page\.gallery\.styles\|mobile\.app\.pagestyles\.android\|mediawiki\.skinning\.content\.parsoid\.css/i)
)) {
if ((cssSource == "mobile") || (zimLink.match(/minerva/))) { //If user has selected mobile display mode or mobile is built into ZIM, substitute main stylesheet
blobArray[i] = zimLink.match(/(-\/s\/style\.css)|(minerva)/i) ? "../-/s/style-mobile.css" : zimLink;
}
blobArray[i] = zimLink.replace(/\|/ig, "_"); //Replace "|" with "_" (legacy for some stylesheets with pipes in filename)
console.log("Matched #" + i + " [" + blobArray[i] + "] from local filesystem");
injectCSS();
} else { //Try to get the stylesheet from the ZIM file
var linkURL = zimLink.match(regexpMetadataUrl)[1];
console.log("Attempting to resolve CSS link #" + i + " [" + linkURL + "] from ZIM file...");
console.log("Attempting to resolve CSS link #" + i + " [" + linkURL + "] from ZIM file..." +
"\n(Consider adding file #" + i + " to the local filesystem)");
resolveCSS(linkURL, i); //Pass link and index
}
} else {
@ -841,6 +853,15 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies','abstractFiles
}
htmlArticle = htmlArticle.replace(regexpSheetHref, ""); //Void existing stylesheets
var cssArray$ = "\r\n" + cssArray.join("\r\n") + "\r\n";
if (cssSource == "mobile") { //If user has selected mobile display mode, insert extra stylesheets
cssArray$ += cssArray$.match(/-\/s\/css_modules\/content\.parsoid\.css/i) ? "" : '<link href="../-/s/css_modules/content.parsoid.css" rel="stylesheet" type="text/css">\r\n';
cssArray$ += cssArray$.match(/-\/s\/css_modules\/mobile\.css/i) ? "" : '<link href="../-/s/css_modules/mobile.css" rel="stylesheet" type="text/css">\r\n';
cssArray$ += cssArray$.match(/-\/s\/css_modules\/inserted_style_mobile\.css/i) ? "" : '<link href="../-/s/css_modules/inserted_style_mobile.css" rel="stylesheet" type="text/css">\r\n';
htmlArticle = htmlArticle.replace(/class\s*=\s*["']\s*thumb\s+tright\s*["']\s*/ig, 'style="float: right; clear: right; margin-left: 1.4em;"');
htmlArticle = htmlArticle.replace(/class\s*=\s*["']\s*thumb\s+tleft\s*["']\s*/ig, 'style="float: left; clear: left; margin-right: 1.4em;"');
htmlArticle = htmlArticle.replace(/class\s*=\s*["']\s*thumbcaption\s*["']\s*/ig, 'style="margin: 0.5em 0 0; font-size: 0.8em; line-height: 1.5; padding: 0 !important; color: #54595d; width: auto !important;"');
htmlArticle = htmlArticle.replace(/(table\s+(?=[^>]*class\s*=\s*["'][^"']*infobox)[^>]*style\s*=\s*["'][^"']+[^;'"]);?\s*["']/ig, '$1; position: relative; border: 1px solid #eaecf0; text-align: left; background-color: #f8f9fa;"');
}
htmlArticle = htmlArticle.replace(/\s*(<\/head>)/i, cssArray$ + "$1");
console.log("All CSS resolved");
injectHTML(htmlArticle); //This passes the revised HTML to the image and JS subroutine...

View File

@ -23,7 +23,7 @@
'use strict';
var params = {};
var results = params['results'] || 10; //Number of search results to display
var cssSource = params['cssSource'] || "zimfile"; //One of "zimfile", "local" or "mobile""
var cssSource = params['cssSource'] || "local"; //One of "zimfile", "local" or "mobile""
require.config({
baseUrl: 'js/lib',

View File

@ -45,6 +45,7 @@
</Applications>
<Capabilities>
<Capability Name="internetClient" />
<Capability Name="privateNetworkClientServer" />
<uap:Capability Name="removableStorage" />
<DeviceCapability Name="location" />
</Capabilities>

View File

@ -226,6 +226,9 @@
<AppxPackagedFile Include="C:\Users\geoff\Source\Repos\kiwix-js-windows\www\img\Kiwix_icon_transparent_600x600.png">
<PackagePath>www\img\Kiwix_icon_transparent_600x600.png</PackagePath>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Users\geoff\Source\Repos\kiwix-js-windows\www\-\s\css_modules\content.parsoid.css">
<PackagePath>www\-\s\css_modules\content.parsoid.css</PackagePath>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Users\geoff\Source\Repos\kiwix-js-windows\www\-\s\css_modules\ext.cite.a11y.css">
<PackagePath>www\-\s\css_modules\ext.cite.a11y.css</PackagePath>
</AppxPackagedFile>
@ -238,12 +241,18 @@
<AppxPackagedFile Include="C:\Users\geoff\Source\Repos\kiwix-js-windows\www\-\s\css_modules\ext.timeline.styles.css">
<PackagePath>www\-\s\css_modules\ext.timeline.styles.css</PackagePath>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Users\geoff\Source\Repos\kiwix-js-windows\www\-\s\css_modules\inserted_style_mobile.css">
<PackagePath>www\-\s\css_modules\inserted_style_mobile.css</PackagePath>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Users\geoff\Source\Repos\kiwix-js-windows\www\-\s\css_modules\mediawiki.page.gallery.styles.css">
<PackagePath>www\-\s\css_modules\mediawiki.page.gallery.styles.css</PackagePath>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Users\geoff\Source\Repos\kiwix-js-windows\www\-\s\css_modules\mediawiki.toc.css">
<PackagePath>www\-\s\css_modules\mediawiki.toc.css</PackagePath>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Users\geoff\Source\Repos\kiwix-js-windows\www\-\s\css_modules\mobile.css">
<PackagePath>www\-\s\css_modules\mobile.css</PackagePath>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Users\geoff\Source\Repos\kiwix-js-windows\www\-\s\style-mobile.css">
<PackagePath>www\-\s\style-mobile.css</PackagePath>
</AppxPackagedFile>

Binary file not shown.

View File

@ -201,13 +201,22 @@
<br /> Click <a id="btnRescanDeviceStorage">here</a> to rescan your SD Cards and internal memory
</div>
<br />
<h2>Display settings</h2>
<div id="cssSettingsDiv">
Please select the display style: <br />
<input type="radio" name="cssInjectionMode" value="local" id="cssModeLocalRadio" checked><label for="cssModeLocalRadio">&nbsp; Use locally cached display styles</label> (faster if using a Wikipedia ZIM file, falls back to the styles stored in the ZIM)
<br />
<input type="radio" name="cssInjectionMode" value="mobile" id="cssModeMobileRadio"><label for="cssModeMobileRadio">&nbsp; Use Wikipedia mobile display style</label> (only works with standard Wikipedia ZIM files)
<br />
<input type="radio" name="cssInjectionMode" value="zimfile" id="cssModeZIMfileRadio"><label for="cssModeZIMfileRadio">&nbsp; Use styles embedded in the ZIM file</label> (slower retrieval, uses more memory if accessing large Wikipedia ZIMs)
</div>
<h2>Expert settings</h2>
<div id="contentInjectionModeDiv">
Do not touch unless you know what you're doing. <br />
Content injection mode : <br />
<input type="radio" name="contentInjectionMode" value="jquery" id="jQueryModeRadio" checked><label for="jQueryModeRadio">JQuery</label> (slow and memory hungry, but safer)
<input type="radio" name="contentInjectionMode" value="jquery" id="jQueryModeRadio" checked><label for="jQueryModeRadio">&nbsp; JQuery</label> (slow and memory hungry, but safer)
<br>
<input type="radio" name="contentInjectionMode" value="serviceworker" id="serviceworkerModeRadio"><label for="serviceworkerModeRadio">ServiceWorker</label> (faster but unstable, and not supported by all platforms. In particular, Firefox extensions do not allow ServiceWorkers for now)
<input type="radio" name="contentInjectionMode" value="serviceworker" id="serviceworkerModeRadio"><label for="serviceworkerModeRadio">&nbsp; ServiceWorker</label> (faster but unstable, and not supported by all platforms. In particular, Firefox extensions do not allow ServiceWorkers for now)
</div>
<div id="serviceWorkerStatus"></div>
<div id="messageChannelStatus"></div>

View File

@ -48,12 +48,15 @@ images\Wide310x150Logo.scale-125.png
images\Wide310x150Logo.scale-150.png
images\Wide310x150Logo.scale-200.png
images\Wide310x150Logo.scale-400.png
www\-\s\css_modules\content.parsoid.css
www\-\s\css_modules\ext.cite.a11y.css
www\-\s\css_modules\ext.cite.styles.css
www\-\s\css_modules\ext.scribunto.logs.css
www\-\s\css_modules\ext.timeline.styles.css
www\-\s\css_modules\inserted_style_mobile.css
www\-\s\css_modules\mediawiki.page.gallery.styles.css
www\-\s\css_modules\mediawiki.toc.css
www\-\s\css_modules\mobile.css
www\-\s\style.css
www\-\s\style-mobile.css
www\A\dummyArticle.html

View File

@ -48,12 +48,15 @@ images\Wide310x150Logo.scale-125.png
images\Wide310x150Logo.scale-150.png
images\Wide310x150Logo.scale-200.png
images\Wide310x150Logo.scale-400.png
www\-\s\css_modules\content.parsoid.css
www\-\s\css_modules\ext.cite.a11y.css
www\-\s\css_modules\ext.cite.styles.css
www\-\s\css_modules\ext.scribunto.logs.css
www\-\s\css_modules\ext.timeline.styles.css
www\-\s\css_modules\inserted_style_mobile.css
www\-\s\css_modules\mediawiki.page.gallery.styles.css
www\-\s\css_modules\mediawiki.toc.css
www\-\s\css_modules\mobile.css
www\-\s\style.css
www\-\s\style-mobile.css
www\A\dummyArticle.html