-/*
-this seems to be causing a disable when we don't want it
-*/
function do_init() {
- if ($('#id_code')[0].tagName == 'SELECT') {
+ if ($('#id_code').attr('tagName') == 'SELECT') {
// code is a SELECT, so we add a callback to lookup titles.
$('#id_code').change(function() {
$('#id_title')[0].disabled=true;
- $.getJSON('/syrup/course/new/ajax_title', {course_code: $(this).val()},
+ $.getJSON(ROOT + '/course/new/ajax_title', {course_code: $(this).val()},
function(resp) {
$('#id_title').val(resp.title)
$('#id_title')[0].disabled=false;
<xi:include href="components/course.xhtml"/>
<head>
<title>${title}</title>
- <!--
- Disabling this title lookup for now, something goes amiss in the browser interaction
- and the title field is disabled when it shouldn't be - art
- -->
- <!--
<script type="text/javascript" src="${ROOT}/static/edit_course.js"/>
- -->
</head>
<body>
<div py:if="instance.id">${course_banner(instance)}</div>
py:with="t=list(select('title/text()'))">
<title>${app_name}<py:if test="t">: ${t}</py:if></title>
<link rel="stylesheet" type="text/css" href="${ROOT}/static/main.css"/>
+ <!-- !We set the webapp ROOT (script name) here, for use in static javascript libraries. -->
+ <script type="text/javascript">
+ var ROOT = '${ROOT}';
+ </script>
<!--
using the trunk version of jquery to get around some IE 8 problems
-->