Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-pipeline
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
django-pipeline
Commits
49c46d90
Commit
49c46d90
authored
Sep 26, 2011
by
Timothée Peignier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improved support for font-face CSS hacks
parent
b1e2da20
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
7 deletions
+6
-7
pipeline/compressors/__init__.py
+2
-5
tests/static/css/urls.css
+1
-0
tests/tests/compressor.py
+3
-2
No files found.
pipeline/compressors/__init__.py
View file @
49c46d90
...
...
@@ -11,7 +11,7 @@ from pipeline.utils import to_class
MAX_IMAGE_SIZE
=
32700
EMBEDDABLE
=
r'[/]?embed/'
URL_DETECTOR
=
r'url\([\'"]?([^\s)]+\.[a-z]+[
#?]?[^\s)
]*)[\'"]?\)'
URL_DETECTOR
=
r'url\([\'"]?([^\s)]+\.[a-z]+[
\?\#\d\w
]*)[\'"]?\)'
URL_REPLACER
=
r'url\(__EMBED__(.+?)(\?\d+)?\)'
MHTML_START
=
"/*
\r\n
Content-Type: multipart/related; boundary=
\"
MHTML_MARK
\"\r\n\r\n
"
...
...
@@ -126,10 +126,7 @@ class Compressor(object):
return
"__EMBED__
%
s"
%
public_path
if
not
os
.
path
.
isabs
(
asset_path
):
asset_path
=
self
.
relative_path
(
public_path
)
return
urlparse
.
urljoin
(
settings
.
PIPELINE_URL
,
asset_path
[
1
:]
)
return
settings
.
PIPELINE_URL
+
asset_path
[
1
:]
def
embeddable
(
self
,
path
,
variant
):
"""Is the asset embeddable ?"""
...
...
tests/static/css/urls.css
View file @
49c46d90
@font-face
{
font-family
:
'Pipeline'
;
src
:
url('../fonts/pipeline.eot')
;
src
:
url('../fonts/pipeline.eot?#iefix')
format
(
'embedded-opentype'
);
src
:
local
(
'☺'
),
url('../fonts/pipeline.woff')
format
(
'woff'
),
url('../fonts/pipeline.ttf')
format
(
'truetype'
),
url('../fonts/pipeline.svg#IyfZbseF')
format
(
'svg'
);
font-weight
:
normal
;
font-style
:
normal
;
...
...
tests/tests/compressor.py
View file @
49c46d90
...
...
@@ -86,8 +86,9 @@ class CompressorTest(TestCase):
])
self
.
assertMultiLineEqual
(
"""@font-face {
font-family: 'Pipeline';
src: url(http://localhost/static/fonts/pipeline.eot');
src: local('☺'), url(http://localhost/static/fonts/pipeline.woff') format('woff'), url(http://localhost/static/fonts/pipeline.ttf') format('truetype'), url(http://localhost/static/fonts/pipeline.svg#IyfZbseF') format('svg');
src: url(http://localhost/static/fonts/pipeline.eot);
src: url(http://localhost/static/fonts/pipeline.eot?#iefix) format('embedded-opentype');
src: local('☺'), url(http://localhost/static/fonts/pipeline.woff) format('woff'), url(http://localhost/static/fonts/pipeline.ttf) format('truetype'), url(http://localhost/static/fonts/pipeline.svg#IyfZbseF) format('svg');
font-weight: normal;
font-style: normal;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment