Skip to content

Instantly share code, notes, and snippets.

Jon Robson jdlrobson

Block or report user

Report or block jdlrobson

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
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
View patch.diff
diff --git a/includes/BookRenderingMediator.php b/includes/BookRenderingMediator.php
index 9d30550..400aec7 100644
--- a/includes/BookRenderingMediator.php
+++ b/includes/BookRenderingMediator.php
@@ -192,10 +192,7 @@ class BookRenderingMediator implements LoggerAwareInterface {
'electron' => ElectronVirtualRestService::class,
];
foreach ( $modules as $module => $class ) {
- if ( !isset( $config['modules'][$module] ) ) {
- throw new Exception( "VirtualRESTService module $module is not configured propely" );
View p.diff
diff --git a/includes/specials/SpecialMobileLanguages.php b/includes/specials/SpecialMobileLanguages.php
index 735645e..d30655c 100644
--- a/includes/specials/SpecialMobileLanguages.php
+++ b/includes/specials/SpecialMobileLanguages.php
@@ -22,22 +22,11 @@ class SpecialMobileLanguages extends MobileSpecialPage {
* @return array
*/
private function getLanguages() {
- $api = new ApiMain(
- new DerivativeRequest(
@jdlrobson
jdlrobson / CustomElement.html
Created Aug 18, 2017
CustomElement.html - autocomplete
View CustomElement.html
<!DOCTYPE HTML>
<html>
<head>
<title>Custom element autocomplete</title>
</head>
<body>
<h1>CustomElement AutoComplete</h1>
<p>
Upgrades a standard select element to work like an autocomplete by using CustomElements.
It will degrade on older browsers that do not support elements to a select dropdown.
You can’t perform that action at this time.