Skip to content

Commit

Permalink
Various bug fixes, mobile-friendly nav, rm unsupported projects from …
Browse files Browse the repository at this point in the history
…site map
  • Loading branch information
MusikAnimal committed Dec 3, 2016
1 parent 7ab9750 commit d506a65
Show file tree
Hide file tree
Showing 37 changed files with 782 additions and 447 deletions.
14 changes: 14 additions & 0 deletions javascripts/pageviews.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,20 @@ class PageViews extends mix(Pv).with(ChartHelpers) {
}
}

/**
* Removes chart, messages, and resets site selections
* @param {boolean} [select2] whether or not to clear the Select2 input
* @param {boolean} [clearMessages] whether or not to clear any exisitng errors from view
* @override
*/
resetView(select2 = false, clearMessages = true) {
super.resetView(select2, clearMessages);
$('.output-list').html('');
$('.single-page-ranking').html('');
$('.single-page-stats').html('');
$('.single-page-legend').html('');
}

/**
* Calls parent setupProjectInput and updates the view if validations passed
* reverting to the old value if the new one is invalid
Expand Down
3 changes: 1 addition & 2 deletions javascripts/shared/pv.js
Original file line number Diff line number Diff line change
Expand Up @@ -1272,7 +1272,7 @@ class Pv extends PvConfig {
$(this.config.projectInput).on('focusin', function() {
this.dataset.value = this.value;
});
$(this.config.projectInput).on('change', e => this.validateProject(e));
$(this.config.projectInput).on('change', () => this.validateProject());
}

/**
Expand Down Expand Up @@ -1546,7 +1546,6 @@ class Pv extends PvConfig {
);
project = projectInput.dataset.value;
} else if (siteDomains.includes(project)) {
this.clearMessages();
this.updateInterAppLinks();
valid = true;
} else {
Expand Down
54 changes: 1 addition & 53 deletions javascripts/shared/site_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -811,97 +811,45 @@ const siteMap = {
'zuwiki': 'zu.wikipedia.org',
'zuwiktionary': 'zu.wiktionary.org',
'zuwikibooks': 'zu.wikibooks.org',
'advisorywiki': 'advisory.wikimedia.org',
'arwikimedia': 'ar.wikimedia.org',
'arbcom_dewiki': 'arbcom-de.wikipedia.org',
'arbcom_enwiki': 'arbcom-en.wikipedia.org',
'arbcom_fiwiki': 'arbcom-fi.wikipedia.org',
'arbcom_nlwiki': 'arbcom-nl.wikipedia.org',
'auditcomwiki': 'auditcom.wikimedia.org',
'bdwikimedia': 'bd.wikimedia.org',
'bewikimedia': 'be.wikimedia.org',
'betawikiversity': 'beta.wikiversity.org',
'boardwiki': 'board.wikimedia.org',
'boardgovcomwiki': 'boardgovcom.wikimedia.org',
'brwikimedia': 'br.wikimedia.org',
'cawikimedia': 'ca.wikimedia.org',
'chairwiki': 'chair.wikimedia.org',
'chapcomwiki': 'affcom.wikimedia.org',
'checkuserwiki': 'checkuser.wikimedia.org',
'cnwikimedia': 'cn.wikimedia.org',
'cowikimedia': 'co.wikimedia.org',
'collabwiki': 'collab.wikimedia.org',
'commonswiki': 'commons.wikimedia.org',
'dkwikimedia': 'dk.wikimedia.org',
'donatewiki': 'donate.wikimedia.org',
'etwikimedia': 'ee.wikimedia.org',
'execwiki': 'exec.wikimedia.org',
'fdcwiki': 'fdc.wikimedia.org',
'fiwikimedia': 'fi.wikimedia.org',
'foundationwiki': 'wikimediafoundation.org',
'grantswiki': 'grants.wikimedia.org',
'iegcomwiki': 'iegcom.wikimedia.org',
'ilwikimedia': 'il.wikimedia.org',
'incubatorwiki': 'incubator.wikimedia.org',
'internalwiki': 'internal.wikimedia.org',
'labswiki': 'wikitech.wikimedia.org',
'labtestwiki': 'labtestwikitech.wikimedia.org',
'legalteamwiki': 'legalteam.wikimedia.org',
'loginwiki': 'login.wikimedia.org',
'mediawikiwiki': 'mediawiki.org',
'metawiki': 'meta.wikimedia.org',
'mkwikimedia': 'mk.wikimedia.org',
'movementroleswiki': 'movementroles.wikimedia.org',
'mxwikimedia': 'mx.wikimedia.org',
'nlwikimedia': 'nl.wikimedia.org',
'nowikimedia': 'no.wikimedia.org',
'noboard_chapterswikimedia': 'noboard-chapters.wikimedia.org',
'nostalgiawiki': 'nostalgia.wikipedia.org',
'nycwikimedia': 'nyc.wikimedia.org',
'nzwikimedia': 'nz.wikimedia.org',
'officewiki': 'office.wikimedia.org',
'ombudsmenwiki': 'ombudsmen.wikimedia.org',
'otrs_wikiwiki': 'otrs-wiki.wikimedia.org',
'outreachwiki': 'outreach.wikimedia.org',
'pa_uswikimedia': 'pa-us.wikimedia.org',
'plwikimedia': 'pl.wikimedia.org',
'qualitywiki': 'quality.wikimedia.org',
'rswikimedia': 'rs.wikimedia.org',
'ruwikimedia': 'ru.wikimedia.org',
'sewikimedia': 'se.wikimedia.org',
'searchcomwiki': 'searchcom.wikimedia.org',
'sourceswiki': 'wikisource.org',
'spcomwiki': 'spcom.wikimedia.org',
'specieswiki': 'species.wikimedia.org',
'stewardwiki': 'steward.wikimedia.org',
'strategywiki': 'strategy.wikimedia.org',
'tenwiki': 'ten.wikipedia.org',
'testwiki': 'test.wikipedia.org',
'test2wiki': 'test2.wikipedia.org',
'testwikidatawiki': 'test.wikidata.org',
'trwikimedia': 'tr.wikimedia.org',
'transitionteamwiki': 'transitionteam.wikimedia.org',
'uawikimedia': 'ua.wikimedia.org',
'ukwikimedia': 'uk.wikimedia.org',
'usabilitywiki': 'usability.wikimedia.org',
'votewiki': 'vote.wikimedia.org',
'wg_enwiki': 'wg-en.wikipedia.org',
'wikidatawiki': 'wikidata.org',
'wikimania2005wiki': 'wikimania2005.wikimedia.org',
'wikimania2006wiki': 'wikimania2006.wikimedia.org',
'wikimania2007wiki': 'wikimania2007.wikimedia.org',
'wikimania2008wiki': 'wikimania2008.wikimedia.org',
'wikimania2009wiki': 'wikimania2009.wikimedia.org',
'wikimania2010wiki': 'wikimania2010.wikimedia.org',
'wikimania2011wiki': 'wikimania2011.wikimedia.org',
'wikimania2012wiki': 'wikimania2012.wikimedia.org',
'wikimania2013wiki': 'wikimania2013.wikimedia.org',
'wikimania2014wiki': 'wikimania2014.wikimedia.org',
'wikimania2015wiki': 'wikimania2015.wikimedia.org',
'wikimania2016wiki': 'wikimania2016.wikimedia.org',
'wikimania2017wiki': 'wikimania2017.wikimedia.org',
'wikimaniateamwiki': 'wikimaniateam.wikimedia.org',
'zerowiki': 'zero.wikimedia.org'
'wikidatawiki': 'wikidata.org'
};

module.exports = siteMap;
4 changes: 2 additions & 2 deletions javascripts/topviews/topviews.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,8 @@ class TopViews extends Pv {
* reverting to the old value if the new one is invalid
* @override
*/
validateProject(e) {
if (super.validateProject(e)) {
validateProject() {
if (super.validateProject()) {
this.resetView(true);
this.processInput();
}
Expand Down
48 changes: 28 additions & 20 deletions public_html/_header.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<nav class="top-nav">
<a class="home-link" href="<?php echo '/pageviews'; ?>"></a>
<nav class="top-nav navbar">
<button class="navbar-toggle collapsed pull-left" data-toggle="collapse" data-target=".interapp-navigation" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="pull-right nav-buttons">
<button class="btn btn-default btn-sm btn-settings js-test-settings" data-target="#settings-modal" data-toggle="modal">
<span class="glyphicon glyphicon-wrench"></span>
Expand Down Expand Up @@ -58,25 +63,28 @@
</ul>
</span>
</span>
<ul class="interapp-links nav nav-tabs">
<?php $apps = [ 'pageviews', 'langviews', 'topviews', 'siteviews', 'massviews', 'redirectviews' ]; ?>
<?php foreach( $apps as $app ) { ?>
<?php $i18nName = $app === 'pageviews' ? '' : $app . '-'; ?>
<?php if ( $app === $currentApp ) { ?>
<li class="active" role="presentation">
<a class="interapp-link" class="interapp-link--<?php echo $app; ?>" href="/<?php echo $app; ?>">
<?php echo $I18N->msg( $app ); ?>
</a>
</li>
<?php } else { ?>
<li role="presentation">
<a class="interapp-link" class="interapp-link--<?php echo $app; ?>" href="/<?php echo $app; ?>">
<?php echo $I18N->msg( $app ); ?>
</a>
</li>
<div class="navbar-collapse collapse interapp-navigation">
<a class="home-link pull-left" href="<?php echo '/pageviews'; ?>"></a>
<ul class="interapp-links nav navbar-nav navbar-left">
<?php $apps = [ 'pageviews', 'langviews', 'topviews', 'siteviews', 'massviews', 'redirectviews' ]; ?>
<?php foreach( $apps as $app ) { ?>
<?php $i18nName = $app === 'pageviews' ? '' : $app . '-'; ?>
<?php if ( $app === $currentApp ) { ?>
<li class="active" role="presentation">
<a class="interapp-link" class="interapp-link--<?php echo $app; ?>" href="/<?php echo $app; ?>">
<?php echo $I18N->msg( $app ); ?>
</a>
</li>
<?php } else { ?>
<li role="presentation">
<a class="interapp-link" class="interapp-link--<?php echo $app; ?>" href="/<?php echo $app; ?>">
<?php echo $I18N->msg( $app ); ?>
</a>
</li>
<?php } ?>
<?php } ?>
<?php } ?>
</ul>
</ul>
</div>
</nav>
<header class="site-header">
<h4 class="text-center">
Expand Down
2 changes: 1 addition & 1 deletion public_html/application.css

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions public_html/application.js

Large diffs are not rendered by default.

65 changes: 46 additions & 19 deletions public_html/faq/application.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public_html/langviews/application.css

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions public_html/langviews/application.js

Large diffs are not rendered by default.

Loading

0 comments on commit d506a65

Please sign in to comment.