Skip to content

Commit 971c9eb

Browse files
committed
Merge branch 'release/8.1.0'
2 parents 6006c00 + a812b00 commit 971c9eb

File tree

5 files changed

+15
-22
lines changed

5 files changed

+15
-22
lines changed

HISTORY.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ History
44
-------
55

66

7+
8.1.0 (2017-01-12)
8+
++++++++++++++++++
9+
10+
* Rolled back subresource integrity (see #353)
11+
* Documentation fix (thanks @clokep)
12+
13+
714
8.0.0 (2017-01-06)
815
++++++++++++++++++
916

bootstrap3/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# -*- coding: utf-8 -*-
22

3-
__version__ = '8.0.0'
3+
__version__ = '8.1.0'

bootstrap3/templatetags/bootstrap3.py

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
from math import floor
66

77
from django import template
8-
from django.contrib.messages import constants as message_constants
98
from django.contrib.messages import constants as DEFAULT_MESSAGE_LEVELS
9+
from django.contrib.messages import constants as message_constants
1010
from django.template import Context
1111
from django.utils.safestring import mark_safe
1212

@@ -31,12 +31,6 @@
3131
DEFAULT_MESSAGE_LEVELS.ERROR: "alert alert-danger",
3232
}
3333

34-
INTEGRITY = {
35-
"css": r"sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u",
36-
"theme": r"sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp",
37-
"javascript": r"sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa",
38-
}
39-
4034
register = template.Library()
4135

4236

@@ -195,11 +189,9 @@ def bootstrap_css():
195189
196190
{% bootstrap_css %}
197191
"""
198-
rendered_urls = render_link_tag(
199-
bootstrap_css_url(), integrity=INTEGRITY['css'])
192+
rendered_urls = [render_link_tag(bootstrap_css_url()), ]
200193
if bootstrap_theme_url():
201-
rendered_urls.append(
202-
render_link_tag(bootstrap_css_url(), integrity=INTEGRITY['theme']))
194+
rendered_urls.append(render_link_tag(bootstrap_css_url()))
203195
return mark_safe(''.join([url for url in rendered_urls]))
204196

205197

@@ -245,9 +237,6 @@ def bootstrap_javascript(jquery=None):
245237
url = bootstrap_javascript_url()
246238
if url:
247239
attrs = {'src': url}
248-
if INTEGRITY['javascript']:
249-
attrs['integrity'] = INTEGRITY['javascript']
250-
attrs['crossorigin'] = 'anonymous'
251240
javascript += render_tag('script', attrs=attrs)
252241
return mark_safe(javascript)
253242

@@ -432,7 +421,7 @@ def bootstrap_field(*args, **kwargs):
432421
433422
set_disabled
434423
When set to ``True`` then the ``disabled`` attribute is set on the rendered field. This only
435-
works up to Django 1.8. Higher Django versions handle ``required`` natively.
424+
works up to Django 1.8. Higher Django versions handle ``disabled`` natively.
436425
437426
:default: ``False``
438427

bootstrap3/tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,15 +203,15 @@ def test_bootstrap_javascript_tag(self):
203203
res = render_template_with_form('{% bootstrap_javascript %}')
204204
self.assertEqual(
205205
res.strip(),
206-
'<script crossorigin="anonymous" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>'
206+
'<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>'
207207
)
208208

209209
def test_bootstrap_css_tag(self):
210210
self.maxDiff = None
211211
res = render_template_with_form('{% bootstrap_css %}')
212212
self.assertEqual(
213213
res.strip(),
214-
'<link crossorigin="anonymous" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" rel="stylesheet">'
214+
'<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">'
215215
)
216216

217217
def test_settings_filter(self):

bootstrap3/utils.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,17 +112,14 @@ def remove_css_class(css_classes, css_class):
112112
return ' '.join(classes_list)
113113

114114

115-
def render_link_tag(url, rel='stylesheet', integrity=None, media=None):
115+
def render_link_tag(url, rel='stylesheet', media=None):
116116
"""
117117
Build a link tag
118118
"""
119119
attrs = {
120120
'href': url,
121121
'rel': rel,
122122
}
123-
if integrity:
124-
attrs['integrity'] = integrity
125-
attrs['crossorigin'] = 'anonymous'
126123
if media:
127124
attrs['media'] = media
128125
return render_tag('link', attrs=attrs, close=False)

0 commit comments

Comments
 (0)