Override admin base template with a custom one that has some JS to resize textaeras, useful when editing an article

--HG--
extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%40108
This commit is contained in:
Matias Aguirre 2008-07-25 15:17:43 +00:00
parent ee8d9a594a
commit 56e110af78
1 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,39 @@
{% extends "admin/base.html" %}
{% block footer %}
<script type="text/javascript">
/* <![CDATA[ */
function textarea_resize() {
//
// Resize all textareas
//
textareas = document.getElementsByTagName("textarea");
for (var i = 0; i <= textareas.length-1; i++) {
try {
textarea = textareas[i];
try {
rows = textarea.firstChild.data.split("\n").length;
if (rows > 30) {
rows = 30;
}
} catch(e) {
rows = 30;
}
textarea.rows = rows;
} catch (e) {
alert("textarea_resize() error:" + e);
}
}
}
textarea_resize()
/* ]]> */
</script>
<style type="text/css">
textarea {
font-family: monospace;
}
.colM .aligned .vLargeTextField, .colM .aligned .vXMLLargeTextField {
width:80%;
}
</style>
{% endblock %}