Showing with 157 additions and 95 deletions.
  1. +0 −1 .travis.yml
  2. +2 −2 jest.config.js
  3. +1 −2 jinja2/includes/config.html
  4. +1 −3 kuma/attachments/jinja2/attachments/includes/attachment_list.html
  5. +1 −3 kuma/dashboards/jinja2/dashboards/includes/revision_dashboard_body.html
  6. +14 −9 kuma/settings/common.py
  7. +21 −0 kuma/static/js/components/codepen-iex/codepen-iex.js
  8. +0 −10 kuma/static/js/wiki-compat-trigger.js
  9. +23 −0 kuma/static/styles/components/codepen-iex/codepen-iex.scss
  10. +9 −0 kuma/static/styles/includes/_mixins.scss
  11. +9 −3 kuma/static/styles/locales/ja.scss
  12. +9 −3 kuma/static/styles/locales/ko.scss
  13. +9 −3 kuma/static/styles/locales/zh-CN.scss
  14. +9 −2 kuma/static/styles/locales/zh-TW.scss
  15. +0 −5 kuma/static/styles/wiki-compat-tables.scss
  16. +4 −0 kuma/wiki/constants.py
  17. +4 −0 kuma/wiki/jinja2/wiki/base.html
  18. +2 −6 kuma/wiki/jinja2/wiki/confirm_document_delete.html
  19. +1 −3 kuma/wiki/jinja2/wiki/confirm_revision_revert.html
  20. +1 −3 kuma/wiki/jinja2/wiki/document.html
  21. +2 −4 kuma/wiki/jinja2/wiki/edit.html
  22. +3 −5 kuma/wiki/jinja2/wiki/includes/document_macros.html
  23. +1 −3 kuma/wiki/jinja2/wiki/list/revisions.html
  24. +0 −14 kuma/wiki/kumascript.py
  25. +1 −0 kuma/wiki/managers.py
  26. +5 −5 kuma/wiki/tasks.py
  27. +1 −1 kumascript
  28. +1 −1 locale
  29. +6 −3 requirements/default.txt
  30. +1 −1 {__tests__ → tests/js}/payments-handler-utils.test.js
  31. 0 {__tests__ → tests}/sass/mdn/_a11y-helpers-mixins-test.scss
  32. +15 −0 tests/sass/mdn/_button-states-mixins-test.scss
  33. 0 {__tests__ → tests}/sass/mdn/_typography-mixin-test.scss
  34. 0 __tests__/sass/test-sass.js → tests/sass/test-sass.test.js
  35. +1 −0 {__tests__ → tests}/sass/test.scss
@@ -11,7 +11,6 @@ cache:
language: python
services:
- docker
- memcached
- mysql
- redis
env:
@@ -24,7 +24,7 @@ module.exports = {
// collectCoverageFrom: null,

// The directory where Jest should output its coverage files
coverageDirectory: 'coverage'
coverageDirectory: 'coverage',

// An array of regexp pattern strings used to skip coverage collection
// coveragePathIgnorePatterns: [
@@ -74,7 +74,7 @@ module.exports = {
// moduleNameMapper: {},

// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
// modulePathIgnorePatterns: [],
modulePathIgnorePatterns: ['kumascript'],

// Activates notifications for test results
// notify: false,
@@ -31,8 +31,7 @@
},
js: {
'syntax-prism': [{% javascript 'syntax-prism' %}],
'wiki-compat-tables': [{% javascript 'wiki-compat-tables' %}],
'wiki-compat-table-survey': [{% javascript 'wiki-compat-table-survey' %}]
'wiki-compat-tables': [{% javascript 'wiki-compat-tables' %}]
}
};

@@ -112,9 +112,7 @@ <h3 class="page-attachments">
</td>
<td>{{ datetimeformat(attachment.file.modified, format='datetime') }}</td>
<td>
<a href="{{ attachment.file.current_revision.creator.get_absolute_url() }}"
{%- if not attachment.file.current_revision.creator.is_active %} rel="nofollow"{% endif -%}
>{{ user_display(attachment.file.current_revision.creator) }}</a>
<a href="{{ attachment.file.current_revision.creator.get_absolute_url() }}" rel="nofollow">{{ user_display(attachment.file.current_revision.creator) }}</a>
</td>
<td>
{% if is_original %}
@@ -45,9 +45,7 @@
{{ format_comment(revision) }}
</td>
<td class="dashboard-author">
<a href="{{ revision.creator.get_absolute_url() }}"
{%- if not revision.creator.is_active %} rel="nofollow"{% endif -%}
>{{ revision.creator }}</a><br>
<a href="{{ revision.creator.get_absolute_url() }}" rel="nofollow">{{ revision.creator }}</a><br>
{% if show_ips %}
{% set revision_ip = revision.revisionip_set.first() %}
{% if revision_ip %}
@@ -642,7 +642,7 @@ def _get_locales():
]

PUENTE = {
'VERSION': '2018.17',
'VERSION': '2019.01',
'BASE_DIR': BASE_DIR,
'TEXT_DOMAIN': 'django',
# Tells the extract script what files to look for l10n in and what function
@@ -697,6 +697,12 @@ def pipeline_one_scss(slug, **kwargs):
'output_filename': 'build/styles/mdn.css',
'variant': 'datauri',
},
'codepen-iex': {
'source_filenames': (
'styles/components/codepen-iex/codepen-iex.scss',
),
'output_filename': 'build/styles/codepen-iex.css',
},
'jquery-ui': {
'source_filenames': (
'js/libs/jquery-ui-1.10.3.custom/css/ui-lightness/jquery-ui-1.10.3.custom.min.css',
@@ -748,7 +754,6 @@ def pipeline_one_scss(slug, **kwargs):
'wiki-compat-tables': {
'source_filenames': (
'styles/wiki-compat-tables.scss',
'styles/compat-table/components/compat-table-survey.scss',
),
'output_filename': 'build/styles/wiki-compat-tables.css',
'template_name': 'pipeline/javascript-array.jinja',
@@ -932,6 +937,12 @@ def pipeline_one_scss(slug, **kwargs):
'async': True,
},
},
'codepen-iex': {
'source_filenames': (
'js/components/codepen-iex/codepen-iex.js',
),
'output_filename': 'build/js/codepen-iex.js',
},
'dashboard': {
'source_filenames': (
'js/dashboard.js',
@@ -1041,13 +1052,6 @@ def pipeline_one_scss(slug, **kwargs):
'output_filename': 'build/js/wiki-compat-tables.js',
'template_name': 'pipeline/javascript-array.jinja',
},
'wiki-compat-table-survey': {
'source_filenames': (
'js/compat-table/components/compat-table-survey.js',
),
'output_filename': 'build/js/wiki-compat-table-survey.js',
'template_name': 'pipeline/javascript-array.jinja',
},
'task-completion': {
'source_filenames': (
'js/task-completion.js',
@@ -1295,6 +1299,7 @@ def parse_iframe_url(url):
CSP_SCRIPT_SRC = [
SITE_URL,
"www.google-analytics.com",
"static.codepen.io",
# TODO fix things so that we don't need this
"'unsafe-inline'",
]
@@ -0,0 +1,21 @@
(function() {
'use strict';
var sampleCodeContainer = document.querySelector('.codepen-iex');

/* only execute the rest of the code if there
is a `sampleCodeContainer` on the page */
if (sampleCodeContainer) {
var tryItButton = document.createElement('button');
tryItButton.classList.add('tryit');
tryItButton.textContent = gettext('Try it live!');
sampleCodeContainer.appendChild(tryItButton);

// when the button is clicked
tryItButton.addEventListener('click', function() {
// call codepen to load the editor
window.__CPEmbed('.codepen-iex');
// hide the button
tryItButton.classList.add('hidden');
});
}
})();
@@ -31,17 +31,7 @@
dataType: 'script',
cache: true
}).then(function() {
var compatSurveyJS = mdn.assets.js['wiki-compat-table-survey'][0];
$('.bc-table').mozCompatTable();

// now load the survey JS
$.ajax({
url: compatSurveyJS,
dataType: 'script',
cache: true
}).fail(function(jqXHR, textStatus, errorThrown) {
console.error('Failed to load BCD survey JS: ' + textStatus + ': ', errorThrown);
});
});

}).appendTo(doc.head);
@@ -0,0 +1,23 @@
@import '../../includes/vars';
@import '../../includes/mixins';

.codepen-iex {
position: relative;

.tryit {
position: absolute;
top: 10px;
right: 10px;
background-color: #fff;
border: 3px solid #3d7e9a;
height: 2rem;
font-size: 1rem;
cursor: pointer;

&:hover,
&:focus,
&:active {
@include active-button-state();
}
}
}
@@ -149,6 +149,15 @@ Links
}
}

/*
Button states
====================================================================== */
/* Used for :hover, :active, :focus states
When changing the values of this mixin, remember to also update the
relevant test at __tests__/sass/mdn/_button-states-mixins-test.scss */
@mixin active-button-state() {
box-shadow: 1px 1px 5px #212121, -1px -1px 5px #bdbdbd;
}

/*
Colours
@@ -45,11 +45,17 @@ Styles for Japanese
}

/* Bug 973171 */

/* stylelint-disable declaration-no-important */
* {
/* !important required for locale specific override */
font-style: normal !important; /* stylelint-disable-line declaration-no-important */
font-style: normal !important;
}


/* Bug 1522385 */
.syntaxbox {
var,
em {
font-style: italic !important;
}
}
/* stylelint-enable */
@@ -26,12 +26,18 @@ Styles for Korean
local('Malgun Gothic Bold');
}


/* Bug 973171 */

/* stylelint-disable declaration-no-important */
* {
/* !important required for locale specific override */
font-style: normal !important; /* stylelint-disable-line declaration-no-important */
font-style: normal !important;
}

/* Bug 1522385 */
.syntaxbox {
var,
em {
font-style: italic !important;
}
}
/* stylelint-enable */
@@ -29,12 +29,18 @@ Styles for Chinese (Simplified)
local(DroidSansFallbackFull);
}


/* Bug 973171 */

/* stylelint-disable declaration-no-important */
* {
/* !important required for locale specific override */
font-style: normal !important; /* stylelint-disable-line declaration-no-important */
font-style: normal !important;
}

/* Bug 1522385 */
.syntaxbox {
var,
em {
font-style: italic !important;
}
}
/* stylelint-enable */
@@ -30,10 +30,17 @@ Styles for Tiwanese
}

/* Bug 973171 */

/* stylelint-disable declaration-no-important */
* {
/* !important required for locale specific override */
font-style: normal !important; /* stylelint-disable-line declaration-no-important */
font-style: normal !important;
}

/* Bug 1522385 */
.syntaxbox {
var,
em {
font-style: italic !important;
}
}
/* stylelint-enable */
@@ -40,8 +40,3 @@ Footnotes & Legend
GitHub link
====================================================================== */
@import 'components/compat-tables/bc-github-link';

/*
Survey
====================================================================== */
@import 'compat-table/components/compat-table-survey';
@@ -80,6 +80,10 @@
ALLOWED_ATTRIBUTES['meter'] += ['max', 'min', 'value', 'low', 'high', 'optimum',
'form']
ALLOWED_ATTRIBUTES['details'] += ['open']
# attributes required for codepen-iex
ALLOWED_ATTRIBUTES['div'] += ['data-prefill', 'data-height', 'data-editable',
'data-default-tab', 'data-theme-id']
ALLOWED_ATTRIBUTES['pre'] += ['data-lang']
# MathML
ALLOWED_ATTRIBUTES.update(dict((x, ['encoding', 'src']) for x in (
'annotation', 'annotation-xml')))
@@ -16,12 +16,16 @@
{{ super() }}

{% stylesheet 'wiki' %}
{% stylesheet 'codepen-iex' %}

{% endblock %}

{% block site_js %}
{{ super() }}

{% javascript 'wiki' %}
{% javascript 'codepen-iex' %}

<script async src="https://static.codepen.io/assets/embed/ei.js"></script>

{% endblock %}
@@ -16,17 +16,13 @@
<h1>{{ _('Delete') }} <a href="{{ document.get_absolute_url() }}">{{ document.title }}</a></h1>

<strong>{{ _('Creator') }}</strong>
<p><a href="{{ revision.creator.get_absolute_url() }}"
{%- if not revision.creator.is_active %} rel="nofollow"{% endif -%}
>{{ user_display(revision.creator) }}</a></p>
<p><a href="{{ revision.creator.get_absolute_url() }}" rel="nofollow">{{ user_display(revision.creator) }}</a></p>

<strong>{{ _('Creation Date') }}</strong>
<p>{{ datetimeformat(revision.created, format='longdatetime') }}</p>

<strong>{{ _('Last Change By') }}</strong>
<p><a href="{{ document.current_revision.creator.get_absolute_url() }}"
{%- if not document.current_revision.creator.is_active %} rel="nofollow"{% endif -%}
>{{ user_display(document.current_revision.creator) }}</a></p>
<p><a href="{{ document.current_revision.creator.get_absolute_url() }}" rel="nofollow">{{ user_display(document.current_revision.creator) }}</a></p>

<strong>{{ _('Last Change Date') }}</strong>
<p>{{ datetimeformat(document.current_revision.created, format='longdatetime') }}</p>
@@ -20,9 +20,7 @@ <h1>{{ _('Are you sure you want to revert to this revision?') }}</h1>
<div>{{ document.title }}</div>

<label><strong>{{ _('Creator') }}</strong></label>
<div><a href="{{ revision.creator.get_absolute_url() }}"
{%- if not revision.creator.is_active %} rel="nofollow"{% endif -%}
>{{ revision.creator }}</a></div>
<div><a href="{{ revision.creator.get_absolute_url() }}" rel="nofollow">{{ revision.creator }}</a></div>
<label><strong>{{ _('Date') }}</strong></label>
<div>{{ datetimeformat(revision.created, format='longdatetime') }}</div>
<label><strong>{{ _('Content') }}</strong></label>
@@ -243,9 +243,7 @@ <h2 class="offscreen">{{ _('Document Tags and Contributors') }}</h2>
<div class="contributors-sub">
{% include 'includes/icons/general/clock.svg' %}
<strong>{{ _('Last updated by:') }}</strong>
<a href="{{ current_revision.creator.get_absolute_url() }}"
{%- if not current_revision.creator.is_active %} rel="nofollow"{% endif -%}
>{{ current_revision.creator }}</a>,
<a href="{{ current_revision.creator.get_absolute_url() }}" rel="nofollow">{{ current_revision.creator }}</a>,
{{ datetimeformat(current_revision.created, format='datetime') }}
</div>
{% endif %}
@@ -54,10 +54,9 @@ <h3>{{ _('Your Changes') }}</h3>
<p>
{% trans id=original_revision.id,
user_profile_url=original_revision.creator.get_absolute_url(),
rel='' if original_revision.creator.is_active else 'rel="nofollow"',
user=original_revision.creator,
date=datetimeformat(original_revision.created, format='longdatetime') %}
Revision {{ id }} by <a href="{{ user_profile_url }}" {{ rel }}>{{ user }}</a> on {{ date }}
Revision {{ id }} by <a href="{{ user_profile_url }}" rel="nofollow">{{ user }}</a> on {{ date }}
{% endtrans %}
</p>
</div>
@@ -71,9 +70,8 @@ <h3>
{% trans id=current_revision.id,
user_profile_url=current_revision.creator.get_absolute_url(),
user=current_revision.creator,
rel='' if current_revision.creator.is_active else 'rel="nofollow"',
date=datetimeformat(current_revision.created, format='longdatetime') %}
Revision {{ id }} by <a href="{{ user_profile_url }}" {{ rel }}>{{ user }}</a> on {{ date }}
Revision {{ id }} by <a href="{{ user_profile_url }}" rel="nofollow">{{ user }}</a> on {{ date }}
{% endtrans %}
</p>
</div>