r103252 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103251‎ | r103252 | r103253 >
Date:22:56, 15 November 2011
Author:brion
Status:deferred
Tags:
Comment:
some more workingish links
Modified paths:
  • /trunk/mockups/athena/athena.js (modified) (history)

Diff [purge]

Index: trunk/mockups/athena/athena.js
@@ -129,12 +129,45 @@
130130 init: function() {
131131 embed.init();
132132
 133+ /*
133134 $('.button-main').click(function() {
134135 // temp hack
135136 // toggle the floating state
136137 $('.bar').toggleClass('bar-float');
137138 });
 139+ */
138140
 141+ $('.button-main').click(function() {
 142+ app.loadPage('Main Page');
 143+ });
 144+ $('.button-you').click(function() {
 145+ app.loadPage('User:Jorm (WMF)');
 146+ });
 147+
 148+ var linkMap = {
 149+ main: 'Main Page',
 150+ you: 'User:Jorm (WMF)',
 151+ notifications: 'User talk:Jorm (WMF)',
 152+ contributions: 'Special:Contributions',
 153+ preferences: 'Special:Preferences',
 154+ help: 'Help:Contents',
 155+ contents: 'Portal:Contents',
 156+ featured: 'Portal:Featured content',
 157+ current: 'Portal:Current events',
 158+ community: 'Wikipedia:Community portal',
 159+ upload: 'Special:Upload'
 160+ };
 161+ $('a').click(function(event) {
 162+ var $a = $(this),
 163+ href = $a.attr('href');
 164+ if (href.substr(0, 1) == '#') {
 165+ var target = href.substr(1);
 166+ if (target in linkMap) {
 167+ app.loadPage(linkMap[target]);
 168+ event.preventDefault();
 169+ }
 170+ }
 171+ });
139172 app.loadPage('While My Guitar Gently Weeps');
140173 },
141174

Status & tagging log