Skip to content
Browse files

tweaks for columns

* auto column fill so short articles look right (before it was balancing)
* turn off hypenation since that dies on large articles
* temp tweak to image url fixing
  • Loading branch information...
1 parent b539e30 commit 4ed01c1a03b7bb50059e3f01ee221abe4c3fa8b0 @brion committed Apr 21, 2012
Showing with 10 additions and 2 deletions.
  1. +3 −2 WikipediaMetroTest/default.html
  2. +7 −0 WikipediaMetroTest/js/default.js
View
5 WikipediaMetroTest/default.html
@@ -37,8 +37,9 @@
-ms-overflow-y: none;
column-width: 320px;
column-gap: 20px;
- -ms-hyphens: auto;
- text-align: justify;
+/* -ms-hyphens: auto;
+ text-align: justify; */
+ column-fill: auto;
}
#content h2 {
break-before: column;
View
7 WikipediaMetroTest/js/default.js
@@ -182,15 +182,22 @@
*/
$('#content').empty();
data.mobileview.sections.forEach(function (section) {
+ if (!section.text) {
+ return;
+ }
var html = section.text;
+ // hack for protocol-relative images (unsafe)
+ html = html.replace(/"\/\/upload\.wikimedia\.org/g, '"https://upload.wikimedia.org');
var $div = $('<div>');
MSApp.execUnsafeLocalFunction(function () {
$div.append(html);
});
+ /*
$div.find('img').each(function () {
// hack for protocol-relative images
$(this).attr('src', 'https:' + $(this).attr('src'));
});
+ */
$div.on('click', 'a', function (event) {
var url = $(this).attr('href');
console.log(url);

0 comments on commit 4ed01c1

Please sign in to comment.
Something went wrong with that request. Please try again.