Files
@ a24f02c44c73
Branch filter:
Location: SlatePermutate/scripts/displayTables.js - annotation
a24f02c44c73
5.1 KiB
text/javascript
Add a correct example course for Dordt, ENG-202, in place of ENGL-101.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | 1cb6f6105b45 1cb6f6105b45 1cb6f6105b45 1cb6f6105b45 1cb6f6105b45 1cb6f6105b45 1cb6f6105b45 1cb6f6105b45 1cb6f6105b45 1cb6f6105b45 1cb6f6105b45 1cb6f6105b45 1cb6f6105b45 1cb6f6105b45 1cb6f6105b45 1cb6f6105b45 1cb6f6105b45 1cb6f6105b45 1cb6f6105b45 711d3e94b78e 711d3e94b78e 711d3e94b78e 711d3e94b78e 711d3e94b78e 711d3e94b78e 711d3e94b78e 711d3e94b78e 711d3e94b78e 711d3e94b78e 711d3e94b78e 711d3e94b78e 711d3e94b78e 711d3e94b78e 711d3e94b78e 711d3e94b78e 711d3e94b78e 711d3e94b78e 711d3e94b78e 711d3e94b78e d882262f4f68 711d3e94b78e 711d3e94b78e d882262f4f68 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 7ce1a5a69798 7ce1a5a69798 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 7ce1a5a69798 7ce1a5a69798 7ce1a5a69798 7ce1a5a69798 7ce1a5a69798 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 6d14f4b9bc8d 6d14f4b9bc8d 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 711d3e94b78e 711d3e94b78e 711d3e94b78e ccb54e791b58 807664acef3a 807664acef3a 807664acef3a 19228cef8a8b 9fd95ed08e56 9fd95ed08e56 7c7cf7ef7bf7 7c7cf7ef7bf7 1dcc2f84c9eb 7c7cf7ef7bf7 9fd95ed08e56 9fd95ed08e56 807664acef3a bc7ff69ca589 bc7ff69ca589 bc7ff69ca589 bc7ff69ca589 bc7ff69ca589 bc7ff69ca589 9fd95ed08e56 9fd95ed08e56 9fd95ed08e56 f0d9f37354b5 f0d9f37354b5 9fd95ed08e56 807664acef3a f0d9f37354b5 f0d9f37354b5 f0d9f37354b5 f0d9f37354b5 f0d9f37354b5 f0d9f37354b5 f0d9f37354b5 45762fcd4b5a 45762fcd4b5a 45762fcd4b5a f0d9f37354b5 f0d9f37354b5 45762fcd4b5a f0d9f37354b5 f0d9f37354b5 c67f6e823b4d c67f6e823b4d c67f6e823b4d c67f6e823b4d 2fed344e05dc 2fed344e05dc 2fed344e05dc 2fed344e05dc 2fed344e05dc 2fed344e05dc 2fed344e05dc 711d3e94b78e 711d3e94b78e 807664acef3a | /*
* Copyright 2010 Nathan Gelderloos, Ethan Zonca, Nathan Phillip Brink
*
* This file is part of SlatePermutate.
*
* SlatePermutate is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SlatePermutate is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with SlatePermutate. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \brief
* Handle changes to the input elements under #show-box.
*/
function show_box_change()
{
var name = jQuery(this).attr('name');
if (name && name.indexOf('-'))
{
/* convert from 'show-prof' back to 'prof' */
var css_class = name.substr(name.indexOf('-') + 1);
if (jQuery('#' + name + ':checked').size())
{
jQuery('.' + css_class).show();
}
else
{
jQuery('.' + css_class).hide();
}
}
return false;
}
/**
* \brief
* Do an AJAX loading of data with arbitrary error handling.
*
* \param target
* The jQuery object which should be populated with an error message
* or the result of loading.
* \param data
* The data to send as a request. The school and semester keys shall
* automatically be set.
* \param handler
* A function with the signature handler(target, data) which is called upon
* a successful response. There is a default handler which uses
* .html() to load the data.data.html into target.
* \param error_handler
* A function with the signature handler(target, status_text, data)
* which is called upon an error. The default error_handler will
* store an error message in target, possibly provided by
* data.message if the HTTP request itself was successful but the
* server still claimed there is an error. The third argument, data,
* will be null if the error is at the HTTP level.
*/
function slate_permutate_load(target, data, handler, error_handler)
{
if (jQuery.type(handler) == 'undefined')
handler = function(target, data)
{
target.html(data.html);
}
if (!data.school)
data.school = slate_permutate_school;
if (!data.semester)
data.semester = slate_permutate_semester;
if (jQuery.type(error_handler) == 'undefined')
error_handler = function(target, status_text, data)
{
if (data)
if (data.message)
target.html(data.message);
else
target.html('<div class="error">Unknown error.</div>');
else
target.html('<div class="error">HTTP error: ' + status_text + '</div>');
}
jQuery.ajax({
url: 'ajax.php',
data: data,
success: function(data, status_text, xhr)
{
if (data && data.success && jQuery.type(data.data) != 'undefined')
handler(target, data.data);
else
error_handler(target, status_text, data);
},
dataType: 'json',
error: function(xhr_jq, status_text, error)
{
error_handler(target, status_text, null);
},
type: 'POST'
});
}
jQuery(document).ready( function()
{
jQuery('#show-box input').change(show_box_change);
jQuery('#show-box input').change();
jQuery("#regDialog").dialog({ modal: true, width: 550, resizable: false, draggable: false, autoOpen: false });
jQuery('#regCodes').click( function() {
jQuery('#regDialog-content').html('<p>Loading registration information...</p>');
/* hmm... why isn't this information just stored in a global JS variable? */
var tab_i = jQuery('#tabs').tabs('option','selected');
var tab_fragment_i = /-([^-]+)$/.exec(jQuery('#the-tabs li:eq(' + tab_i + ') a').attr('href'))[1];
var tab_course_data_json_selector = '#tabs-' + tab_fragment_i + ' .course-data';
var tab_course_data_json = jQuery(tab_course_data_json_selector).text();
var tab_course_data = eval('(' + tab_course_data_json + ')');
slate_permutate_load(jQuery('#regDialog-content'), {school_registration_html: true, courses: tab_course_data},
function(target, data) {
target.html(data.html);
if (data.location)
document.location.href = data.location;
});
jQuery("#regDialog").dialog('open');
return false;
});
jQuery('.qTipCell').qtip(
{
style: {
tip: true,
classes: "ui-tooltip-dark ui-tooltip-shadow ui-tooltip-rounded"
},
hide: {
event: 'mouseleave click'
},
position:{
my: 'bottom left',
at: 'top center',
}
});
jQuery(".clicktoclipboard").click( function() {
jQuery('.toclipboard', this).toggle();
});
/*
* Don't let the event bubble up if the user is clicking trying
* to select the permalink.
*/
jQuery('.toclipboard').click(function(e) {
e.stopPropagation();
});
}
);
|