Open desb42 opened 5 years ago
I have said it before and I'll say it again,I am mightily impressed with xowa
I've said it before, but I'll say it again. Thanks for all the kind words as well as all the bug reports. :)
In all due seriousness, I did spend some time to make sure I get the look and feel of online Wikipedia. It's not a mirror image, but I like to think it's pretty close.
Tracking down what I think is the equivalent in xowa, I have come across Xoh_file_wrt__basic.java In it at line 186 I add +2 to the div_width at the end of the line and this seems to fix the problem!
Nice sleuthing. I wrote this code a while ago, and I don't remember a +2 at the time. The MediaWiki history seems like it changed recently: https://github.com/wikimedia/mediawiki/blame/master/includes/Linker.php
At any rate, this would be the proper place to put it. There should only be one "HTML writer for files" and that would be the Xoh_file_wtr__basic. I'll plug it in sometime this weekend and try to write some tests.
The second issue (the word 'Contents' moving) seems to be related to changes in how the 'hide'/'show' trigger operates
I don't have Wikiquote available now, but the behavior looks the same for Wikipedia. I inspected the HTML, and it looks like Wikimedia has changed the CSS class for the Table of Contents. I think the "moving Contents" is related to the spacing. See the red boxes in the attached image below (but there may be other padding / spacing in play).
I'll look at this later, but tracking down CSS tweaks is always a bit of a hunt and peck thing.
Anyway, hope this helps.
I have been investigating (off and on) the word 'Contents' moving and after some work I have found that those clever chaps over at mediawiki have been tireless in their progress. That is, they have revamped how the Table of Contents hide/show works Significant changes in Linker.php have led me to make changes to the mediawiki.toc.js, some java changes and most concerning of all a mediawiki.toc.styles(.css) that is language sensitive
The style sheet is part of a bundle of styles that mediawiki downloads depending on what is on the page An example of which for en.wikipedia.org/wiki/Norman_McMahon is
https://en.wikipedia.org/w/load.php?lang=en&modules=ext.3d.styles%7Cext.cite.styles%7Cext.uls.interlanguage%7Cext.visualEditor.desktopArticleTarget.noscript%7Cext.wikimediaBadges%7Cmediawiki.legacy.commonPrint%2Cshared%7Cmediawiki.skinning.interface%7Cmediawiki.toc.styles%7Cskins.vector.styles%7Cwikibase.client.init&only=styles&skin=vector
This can be trimmed down (as an example) to
https://en.wikipedia.org/w/load.php?lang=en&modules=mediawiki.toc.styles&only=styles&skin=vector
A subset of the css returned is
.toctogglelabel:after{content:'show'}
And should I change the language code to german (de) then that subset becomes
.toctogglelabel:after{content:'Anzeigen'}
I currently add this css to xowa_wiki.css (which is not strictly the correct place) Please see my branch toc for the changes I made.
As mentioned elsewhere the whole initialisation of javascript and download of css probably needs a rework - although I think that would be no small effort
Given the changes suggested and implemented above, if I now compare, I get
There are always going to be differences but I like the convergence
Cool. The changes look pretty straightforward. I have some personal events this weekend, but let me try to get this one done no matter what.
Thanks for the commit at https://github.com/desb42/xowa/commits/toc
It's probably the late hour, but I couldn't get this to work.
Specifically, I tried the mediawiki.toc.js at https://github.com/desb42/xowa/commit/025725f88796d492161336ff5c74bf3ba02e73f3#diff-30fa49406aaf03649f622e55df220140 . It gets called by DOMContentLoaded.js but it fails when calling functions like mw.msg and mw.cookie.
I think you said you were experimenting with a bunch of javascript changes on your side. Did you provide some basic implementations for them? Or am I missing something basic here?
Yes, I have some logic for mw.msg and mw.cookie in core.js core.zip
this is sort of the tip of an iceberg I have made quite a few other changes
Cool. That looks pretty interesting. I went through it quickly now, and have no real objections (the xo.cfg may have to call a new dedicated cookie API but will look into it later)
I'll work on integrating your core.js changes. Feel free to drop the rest of the iceberg whenever you're ready. :)
As I mainly use the http_server version of xowa I can compare the results of xowa and the real wiki. I have said it before and I'll say it again,I am mightily impressed with xowa
Hopefully the animated gif gives an idea of the differences
I would not want to stare at that image for too long!
The two things I want to draw your attention to are: 1) The image moves from left to right 1) The word 'Contents' moves from left to right
The other things moving are not relevant here
To take the first issue. I have tracked this down to the fact that the outer frame of the thumbnail for wiki is 222px whereas for xowa it is 220px I could find no direct reference to 222px in the Mediawiki source; however I also check for a
+2
This yielded Linker.php which has references to +2 egTracking down what I think is the equivalent in xowa, I have come across Xoh_file_wrt__basic.java In it at line 186 I add
+2
to thediv_width
at the end of the line and this seems to fix the problem! (I am not sure if there are other places)The second issue (the word 'Contents' moving) seems to be related to changes in how the 'hide'/'show' trigger operates I have not been able to determine how this works yet.