Skip to content

Instantly share code, notes, and snippets.

View jdlrobson's full-sized avatar

Jon Robson jdlrobson

View GitHub Profile
@jdlrobson
jdlrobson / index.html
Created August 11, 2011 10:42
Riots vs deprived data mashup. See http://jonrobson.me.uk/riots/index.html
<!DOCTYPE HTML>
<html xmlns:og="http://opengraphprotocol.org/schema/">
<head>
<meta charset="utf-8" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="image_src" href="http://jonrobson.me.uk/riots/riotmap.png" />
<meta property="og:image" content="http://jonrobson.me.uk/riots/riotmap.png" />
<title>Riots in London - correlation with deprived areas</title>
<style type="text/css">
#map {
@jdlrobson
jdlrobson / toucan.js
Created September 8, 2011 22:18
Toucan Creature (Javascript jungle)
/**
* @see https://github.com/asyncjs/Javascript-Jungle/wiki/api
*/
//TODO: add to creatures.js instead..
var creature = jj.createCreature('toucan', function (layer) {
$ = jj.jQuery;
var jungle = $(layer.el).parent();
var jungleWidth = jungle.width();
var jungleHeight = jungle.height();
var jungleBounds = { left: 0 - 50, right: jungleWidth + 50 }
@jdlrobson
jdlrobson / angrybirdjungle.js
Created September 10, 2011 20:59
angrybirdjungle
/**
* @see https://github.com/asyncjs/Javascript-Jungle/wiki/api
*/
var dataURI = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBB
@jdlrobson
jdlrobson / angrybirdjungle.js
Created September 10, 2011 21:12
angrybirdjungle
/**
* @see https://github.com/asyncjs/Javascript-Jungle/wiki/api
*/
var creature = jj.createCreature('angrybird', function (layer) {
var dataURI = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAg
@jdlrobson
jdlrobson / notification.js
Created December 13, 2011 12:15
A script using cookies to create a dismissable notification bar at the top of a webpage
// A script to create a dismissable notification bar at the top of a webpage
// uses cookies but would be good to use localStorage where possible.
$(document).ready(function() {
var NOTIFICATION_NAME = "HAS_DISMISSED_NOTIFICATION_3"; // give this a unique name
// this looks at the url and if encounters /en/ prints a english message
// if /es/ prints a spanish message
// on the root / it uses english by default
var isEnglish = window.location.pathname.indexOf("/en/") > -1 || window.location.pathname === "/";
var isSpanish = window.location.pathname.indexOf("/es/") > -1;
diff --git a/MobileFormatter.php b/MobileFormatter.php
index 69f4fcc..34e8260 100644
--- a/MobileFormatter.php
+++ b/MobileFormatter.php
@@ -193,7 +193,7 @@ class MobileFormatter extends HtmlFormatter {
$backToTop = $this->msg( 'mobile-frontend-back-to-top-of-section' );
$this->headings++;
// Back to top link
- $base = Html::openElement( 'div',
+ $backToTop = Html::openElement( 'div',
/* the following definitions exist to deal with certain inline styles
present in wikitext
and MediaWiki:Common.css definitions
This file should not need to exist
*/
.navbox .hlist dd,
.navbox .hlist dt,
.navbox .hlist li {
white-space: pre-wrap !important;
diff --git a/stylesheets/contact-us.css b/stylesheets/contact-us.css
index 5f19ea1..6244f99 100644
--- a/stylesheets/contact-us.css
+++ b/stylesheets/contact-us.css
@@ -23,12 +23,12 @@ Change-Id: I57557fd2e359264853efadc1e5da1c9cbe6a0d97
cursor: pointer;
}
-#feedback input#mw-input-wpsubject {
+#mw-input-wpsubject {
@jdlrobson
jdlrobson / gist:2428322
Created April 20, 2012 13:01
Dynamic Sections in Wikipedia Mobile Site
diff --git a/MobileFormatter.php b/MobileFormatter.php
index 597b211..487121f 100644
--- a/MobileFormatter.php
+++ b/MobileFormatter.php
@@ -207,9 +207,11 @@ class MobileFormatter extends HtmlFormatter {
$base = Html::openElement( 'div', array( 'class' => 'section' ) );
if ( $this->expandableSections ) {
$h2OnClick = 'javascript:wm_toggle_section(' . $this->headings . ');';
+ $headingId = $this->headings;
$base .= Html::openElement( 'h2',
@jdlrobson
jdlrobson / gist:2431740
Created April 20, 2012 20:38
wildcard css for mahemoff
<!DOCTYPE HTML>
<html>
<head>
<title>css fun</title>
<style type="text/css">
[class^="when-"] {
display: block;
}
[class^="when-not-"] {
display: none;