Skip to content

Instantly share code, notes, and snippets.

View awjrichards-zz's full-sized avatar

Arthur Richards awjrichards-zz

  • Wikimedia Foundation
View GitHub Profile
<!doctype html>
<html lang="en" dir="ltr" class="specialPage">
<head>
<title>Changes - mw_testing0</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex,nofollow" /> <meta name="viewport" content="initial-scale=1.0, user-scalable=yes">
<script type="text/javascript">
var mwMobileFrontendConfig = {"settings":{"action":"","authenticated":true,"photo-upload-endpoint":"https:\/\/m.virtualbot.com\/testing\/core\/api.php","scriptPath":"\/testing\/core","pageUrl":"\/testing\/core\/index.php\/$1","imagesDisabled":false,"alpha":true,"beta":true,"namespace":-1,"title":"Special:MobileDiff\/579","variant":"en","useFormatCookieName":"mf_mobileFormat","useFormatCookieDuration":-1,"useFormatCookieDomain":"m.virtualbot.com","useFormatCookiePath":"\/","stopMobileRedirectCookieName":"stopMobileRedirect","stopMobileRedirectCookieDuration":15552000,"stopMobileRedirectCookieDomain":".virtualbot.com","hookOptions":"","username":"Arthur","can_edit":fals
@awjrichards-zz
awjrichards-zz / gist:3125706
Created July 16, 2012 23:12
Still broken photo desc template
diff --git a/assets/www/index.html b/assets/www/index.html
index 924be98..6974e56 100644
--- a/assets/www/index.html
+++ b/assets/www/index.html
@@ -80,6 +80,31 @@
</div>
</script>
+ <script type="text/html" id="upload-photo-description">
+ =={{int:filedesc}}==
@awjrichards-zz
awjrichards-zz / formatUploadDescription-with-template.patch
Created July 13, 2012 01:24
An attempt at using a template in formatUploadDescription()
diff --git a/assets/www/js/upload.js b/assets/www/js/upload.js
index 5074a0a..1576a8a 100644
--- a/assets/www/js/upload.js
+++ b/assets/www/js/upload.js
@@ -47,49 +47,45 @@ function dateYMD() {
}
function formatUploadDescription( monument, campaignConfig, username ) {
- var idTemplate = campaignConfig.idField,
- idField = idTemplate.replace( '$1', monument.id ),
@awjrichards-zz
awjrichards-zz / ApiBase.php
Created July 12, 2012 23:29
First pass at admin_tree api - diffs from r741
Index: api/includes/ApiBase.php
===================================================================
--- api/includes/ApiBase.php (revision 741)
+++ api/includes/ApiBase.php (working copy)
@@ -62,7 +62,7 @@
}
}
} elseif ( $p == 'integer' ) {
- $i = intval( $_GET[$name] );
+ $i = intval( $_GET[$name] ); // @fixme this will return 0 on failure, or 1 if it's a non-empty array... is this desired?
=={{int:filedesc}}==
{{Information
|description={{en|1=Barrio Santa Rosa}}
{{NRHP|11000683}}
|date=2012-07-12
|source={{own}}
|author=[[User:awjrichards]]
|permission=
|other_versions=
|other_fields=
@awjrichards-zz
awjrichards-zz / campaign-data.js
Created July 11, 2012 16:38
Updated generate_campaigns.py to get full json object of all wlm campaigns, and resulting js/json output
window.CAMPAIGNS = [
{
"isenabled": 1,
"desc": "Andorra",
"config": {
"idFieldLabel": "",
"idField": "{{B\u00e9ns Andorra|$1}}",
"headerLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-ad-header/$1",
"defaultCategories": [
"Cultural heritage monuments in Andorra"
@awjrichards-zz
awjrichards-zz / gist:1880368
Created February 22, 2012 01:11
Brew install sshfs FAIL!
$ brew install sshfs
==> Cloning https://github.com/fuse4x/sshfs.git
Updating /Users/awjrichards/Library/Caches/Homebrew/sshfs--git
==> Checking out tag sshfs_2_3_0
==> /usr/bin/autoreconf --force --install
==> ./configure --disable-debug --prefix=/usr/local/Cellar/sshfs/2.3.0
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no