Skip to content

Instantly share code, notes, and snippets.

Avatar

Jon Robson jdlrobson

View GitHub Profile
@jdlrobson
jdlrobson / index.js
Created Dec 9, 2020
Generating client error reports
View index.js
npm install csv
mkdir csv
# manual work
# visit https://logstash.wikimedia.org/goto/1def4b2013f38bdcd40dfd51e831254c
# export formatted in " file uri split"
# copy the download to the csv folder
node index.js
@jdlrobson
jdlrobson / Template:Main_Page_Minerva.css
Last active Jun 2, 2020
A MediaWiki compatibility stylesheet for responsive Minerva support
View Template:Main_Page_Minerva.css
/* This template is loaded on the main page to address T32405
Please feel free to adapt the code, translate this message.
Updates can be found in https://gist.github.com/jdlrobson/dbb124296ed2a1fc7242018c7b589059 */
@media screen and ( max-width: 720px ) {
body.skin-minerva td,
body.skin-minerva tr,
body.skin-minerva .mp-column,
body.skin-minerva .floatleft,
body.skin-minerva .floatright,
body.skin-minerva tbody,
@jdlrobson
jdlrobson / core.diff
Last active Mar 17, 2020
Allow skins to opt out of sortable and collapsible
View core.diff
diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php
index 44a9eb09a9..c90d4b0da2 100644
--- a/includes/skins/Skin.php
+++ b/includes/skins/Skin.php
@@ -164,6 +164,40 @@ abstract class Skin extends ContextSource {
*/
public function initPage( OutputPage $out ) {
$this->preloadExistence();
+ $out->addJsConfigVars( [
+ 'wgCollapsible' => $this->supportsFeature( 'table-sorting' ),
View changes.diff
diff --git a/src/mobile.notifications.overlay/NotificationsOverlay.js b/src/mobile.notifications.overlay/NotificationsOverlay.js
index 06de6c4b2..b893a5e53 100644
--- a/src/mobile.notifications.overlay/NotificationsOverlay.js
+++ b/src/mobile.notifications.overlay/NotificationsOverlay.js
@@ -2,28 +2,26 @@ var Overlay = require( '../mobile.startup/Overlay' ),
util = require( '../mobile.startup/util' ),
View = require( '../mobile.startup/View' ),
promisedView = require( '../mobile.startup/promisedView' ),
- mfExtend = require( '../mobile.startup/mfExtend' ),
Anchor = require( '../mobile.startup/Anchor' );
@jdlrobson
jdlrobson / gist:e516699c2b78009139e5c69a5cac518c
Created Mar 13, 2019
How to submit a MobileFrontend patch.md
View gist:e516699c2b78009139e5c69a5cac518c

Welcome brave explorer to your Wikimedia adventure....

To become a Wikipedia mobile developer you must first, pass 3 brave quests!

Quest 1 - Get a working local version of MobileFrontend

Your first challenge is to clone the three essential repos that you need to get the Wikipedia mobile site showing on your local machine. Imagine these are three crystals that will unlock the power of mobile (or something like that!)

To do this, follow these steps:

View preact.diff
diff --git a/package.json b/package.json
index 1a709407c..fb4b9072f 100644
--- a/package.json
+++ b/package.json
@@ -44,6 +44,7 @@
"nyc": "13.0.1",
"oojs": "2.2.2",
"pre-commit": "1.2.2",
+ "preact": "8.4.2",
"qunit": "2.7.0",
View proxy.js
const express = require('express');
const wikiApis = require('express-wikimedia-api-proxy');
const app = express();
const cors = require('cors');
const PORT = 8090
const base = '/api/';
app.use(cors())
wikiApis(app, base, true);
app.listen(PORT)
View proxy.js
const express = require('express');
const wikiApis = require('express-wikimedia-api-proxy');
const app = express();
const cors = require('cors');
const PORT = 8090
const base = '/api/';
app.use(cors())
wikiApis(app, base, true);
app.listen(PORT)
@jdlrobson
jdlrobson / CategoryOverlay.js
Created Apr 3, 2018
Ideas for category rewrite
View CategoryOverlay.js
const Tabs = () => {
// to be implemented but would deal with all the tab magic.
};
const Header = ( { title, actions } ) => {
// to be implemented
}
// CategoryOverlay becomes an Overlay without any async properties.
// Very easy to test and easier to tweak
View chinese.json
{"words":{"土":"soil/earth","水":"water","山":"mountain","瓜":"melon","花":"flower","果":"fruit","苦":"bitter","西":"west","西瓜":"watermelon","苦瓜":"bitter gourd","虹":"rainbow","虫":"insect","工":"work","火山":"volcano","火":"fire","云":"cloud","萝卜":"radish","风":"wind","冬":"winter","电":"electricity","夏":"summer","桃":"peach","木":"wood","瀑":"waterfall/shower","土豆":"potato","豆":"beans/pea","苹果":"apple","茄":"eggplant","子":"son","茄子":"eggplant","星":"star","日":"sun (☀️)","生":"give birth","星期一":"monday","期":"period(time)","一":"one","星期二":"tuesday","二":"two","香蕉":"banana","香":"fragrant","饭团":"rice ball","团":"group","饭":"meal/food","杏":"apricot","口":"mouth","饼":"pastry/cake","鱼":"fish","海鲜":"seafood","海":"sea","面包":"bread","陨石":"aerolite","石":"stone","陨":"fall from sky","石榴":"pomegranate","田":"field","糕点":"pastry","饺":"dumpling","大":"big","人":"person","夫人":"madam","夫":"man","天":"sky","天人":"heaven","森":"forest","林":"in the woods","本":"foundation","玉":"jade","女":"woman/daughter","羊":"sheep","牛":"cow","白":"white","雨":"rain","士":"soldier