Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
adffff79
Kaydet (Commit)
adffff79
authored
Tem 16, 2015
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Allowed installing closure with pip for admin JavaScript compression.
üst
28ee511b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
7 deletions
+16
-7
compress.py
django/contrib/admin/bin/compress.py
+8
-1
javascript.txt
docs/internals/contributing/writing-code/javascript.txt
+8
-6
No files found.
django/contrib/admin/bin/compress.py
Dosyayı görüntüle @
adffff79
...
...
@@ -4,6 +4,13 @@ import os
import
subprocess
import
sys
try
:
import
closure
except
ImportError
:
closure_compiler
=
None
else
:
closure_compiler
=
os
.
path
.
join
(
os
.
path
.
dirname
(
closure
.
__file__
),
'closure.jar'
)
js_path
=
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
dirname
(
__file__
)),
'static'
,
'admin'
,
'js'
)
...
...
@@ -21,7 +28,7 @@ Compiler library and Java version 6 or later."""
action
=
"store_false"
,
dest
=
"verbose"
)
options
=
parser
.
parse_args
()
compiler
=
os
.
path
.
expanduser
(
options
.
compiler
)
compiler
=
closure_compiler
if
closure_compiler
else
os
.
path
.
expanduser
(
options
.
compiler
)
if
not
os
.
path
.
exists
(
compiler
):
sys
.
exit
(
"Google Closure compiler jar file
%
s not found. Please use the -c "
...
...
docs/internals/contributing/writing-code/javascript.txt
Dosyayı görüntüle @
adffff79
...
...
@@ -45,15 +45,17 @@ Compressing JavaScript
To simplify the process of providing optimized JavaScript code, Django
includes a handy Python script which should be used to create a "minified"
version. To run it:
:
version. To run it:
python django/contrib/admin/bin/compress.py
.. code-block:: console
$ pip install closure
$ python django/contrib/admin/bin/compress.py
Behind the scenes, ``compress.py`` is a front-end for Google's
`Closure Compiler`_ which is written in Java. However, the Closure Compiler
library is not bundled with Django directly, so those wishing to contribute
complete JavaScript patches will need to download and install the library
independently. The Closure Compiler library requires `Java`_ 7 or higher.
`Closure Compiler`_ which is written in Java. The Closure Compiler library is
not bundled with Django, but you can install it using pip as done above. The
Closure Compiler library requires `Java`_ 7 or higher.
Please don't forget to run ``compress.py`` and include the ``diff`` of the
minified scripts when submitting patches for Django's JavaScript.
...
...
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