Changeset 80545d in indico
- Timestamp:
- 06/24/11 14:31:51 (2 years ago)
- Branches:
- master, hello-world-walkthrough, ipv6, v0.98-series, v0.98.2, v0.98.3, v0.98b2, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, 0da0c1403bae8e51d8229f460181c71b9e6dda72
- Children:
- 84a01a
- Parents:
- 0e0d7e
- git-author:
- Adrian Moennich <jerome.ernst.monnich@…> (06/17/11 17:28:38)
- git-committer:
- Pedro Ferreira <jose.pedro.ferreira@…> (06/24/11 14:31:51)
- Files:
-
- 1 deleted
- 13 edited
-
etc/js/jquery.cfg (modified) (1 diff)
-
indico/MaKaC/webinterface/pages/base.py (modified) (1 diff)
-
indico/MaKaC/webinterface/tpls/ConfModifBadgeDesign.tpl (modified) (27 diffs)
-
indico/MaKaC/webinterface/tpls/ConfModifPosterDesign.tpl (modified) (29 diffs)
-
indico/MaKaC/webinterface/tpls/RoomBookingBlockingForm.tpl (modified) (4 diffs)
-
indico/MaKaC/webinterface/tpls/RoomBookingBlockingList.tpl (modified) (2 diffs)
-
indico/MaKaC/webinterface/tpls/RoomBookingBlockingsForMyRooms.tpl (modified) (2 diffs)
-
indico/MaKaC/webinterface/tpls/RoomBookingBookingForm.tpl (modified) (7 diffs)
-
indico/MaKaC/webinterface/tpls/RoomBookingPeriodForm.tpl (modified) (2 diffs)
-
indico/MaKaC/webinterface/tpls/RoomBookingSearch4Bookings.tpl (modified) (5 diffs)
-
indico/MaKaC/webinterface/tpls/RoomBookingSearch4Rooms.tpl (modified) (9 diffs)
-
indico/htdocs/js/indico/Legacy/Widgets.js (modified) (1 diff)
-
indico/htdocs/js/indico/Legacy/validation.js (modified) (7 diffs)
-
indico/htdocs/js/jquery/jquery-compat.js (deleted)
Legend:
- Unmodified
- Added
- Removed
-
etc/js/jquery.cfg
r86d723 r80545d 4 4 underscore.js 5 5 jquery.js 6 jquery-compat.js7 6 jquery-ui.js 8 7 jquery.custom.js -
indico/MaKaC/webinterface/pages/base.py
r86d723 r80545d 54 54 def _includeJQuery(self): 55 55 info = HelperMaKaCInfo().getMaKaCInfoInstance() 56 files = ['underscore', 'jquery', 'jquery- compat', 'jquery-ui', 'jquery.custom', 'jquery.daterange']56 files = ['underscore', 'jquery', 'jquery-ui', 'jquery.custom', 'jquery.daterange'] 57 57 if info.isDebugActive(): 58 58 # We can't use Loader.js as jQuery is included before any indico js -
indico/MaKaC/webinterface/tpls/ConfModifBadgeDesign.tpl
r0ca8eb r80545d 86 86 itemId++; 87 87 88 var newDiv = $ j('<div/>', {88 var newDiv = $('<div/>', { 89 89 id: itemId 90 90 }).css({ … … 118 118 var newDiv = createDiv(); 119 119 // We set the inner html of the div depending on the type of item inserted 120 switch($ j('#elementList').val()) {120 switch($('#elementList').val()) { 121 121 ${ switchCases } 122 122 } … … 133 133 items[lastSelectedDiv.attr('id')] = false; 134 134 lastSelectedDiv.remove(); 135 $ j('#selection_text').html('');135 $('#selection_text').html(''); 136 136 lastSelectedDiv = null; 137 $ j('#removeButton').prop('disabled', true);137 $('#removeButton').prop('disabled', true); 138 138 } 139 139 } … … 142 142 // Change the text that says which item is selected 143 143 var id = newSelectedDiv.attr('id'); 144 $ j('#selection_text').html(translate[items[id].key]);144 $('#selection_text').html(translate[items[id].key]); 145 145 146 146 // TODO: add check to see if there's a table inside and not an image … … 157 157 newSelectedDiv.html(newSelectedItem.toHTML()); 158 158 lastSelectedDiv = newSelectedDiv; 159 $ j('#removeButton').prop('disabled', false);159 $('#removeButton').prop('disabled', false); 160 160 161 161 // Change the selectors so that they match the properties of the item 162 $ j('#alignment_selector').prop('selectedIndex', newSelectedItem.textAlignIndex);163 $ j('#font_selector').prop('selectedIndex', newSelectedItem.fontFamilyIndex);164 $ j('#size_selector').prop('selectedIndex', newSelectedItem.fontSizeIndex);165 $ j('#style_selector').prop('selectedIndex', newSelectedItem.styleIndex);166 $ j('#color_selector').prop('selectedIndex', newSelectedItem.colorIndex);167 $ j('#width_field').val(newSelectedItem.width / pixelsPerCm);162 $('#alignment_selector').prop('selectedIndex', newSelectedItem.textAlignIndex); 163 $('#font_selector').prop('selectedIndex', newSelectedItem.fontFamilyIndex); 164 $('#size_selector').prop('selectedIndex', newSelectedItem.fontSizeIndex); 165 $('#style_selector').prop('selectedIndex', newSelectedItem.styleIndex); 166 $('#color_selector').prop('selectedIndex', newSelectedItem.colorIndex); 167 $('#width_field').val(newSelectedItem.width / pixelsPerCm); 168 168 if (newSelectedItem.key == "Fixed Text") { 169 $ j('#fixed_text_field').val(newSelectedItem.text).prop('disabled', false);170 $ j('#changeText').prop('disabled', false);169 $('#fixed_text_field').val(newSelectedItem.text).prop('disabled', false); 170 $('#changeText').prop('disabled', false); 171 171 } else { 172 $ j('#fixed_text_field').val("").prop('disabled', true);173 $ j('#changeText').prop('disabled', true);172 $('#fixed_text_field').val("").prop('disabled', true); 173 $('#changeText').prop('disabled', true); 174 174 } 175 175 } … … 177 177 function updateRulers() { 178 178 if (templateDimensions.width > previousTemplateDimensions.width) { 179 var hRuler = $ j('#horizontal_ruler');179 var hRuler = $('#horizontal_ruler'); 180 180 for (var i = Math.ceil(previousTemplateDimensions.width / pixelsPerCm); i < Math.ceil(templateDimensions.width / pixelsPerCm); i++) { 181 $ j('<td/>', {181 $('<td/>', { 182 182 id: 'rulerh' + i 183 183 }).html('<img src="${ baseURL }/images/ruler/rulerh' + i + '.png" align="center"/>').appendTo(hRuler); … … 186 186 else if (templateDimensions.width < previousTemplateDimensions.width) { 187 187 for (var i = Math.ceil(previousTemplateDimensions.width / pixelsPerCm); i > Math.ceil(templateDimensions.width / pixelsPerCm); i--) { 188 $ j('#rulerh' + (i - 1)).remove();188 $('#rulerh' + (i - 1)).remove(); 189 189 } 190 190 } 191 191 192 192 if (templateDimensions.height > previousTemplateDimensions.height) { 193 var vRuler = $ j('#vertical_ruler');193 var vRuler = $('#vertical_ruler'); 194 194 for (var i = Math.ceil(previousTemplateDimensions.height / pixelsPerCm); i < Math.ceil(templateDimensions.height / pixelsPerCm); i++) { 195 $ j('<tr/>', {195 $('<tr/>', { 196 196 id: 'rulerv' + i 197 197 }).append('<td><img src="${ baseURL }//images/ruler/rulerv' + i + '.png" align="center"/></td>').appendTo(vRuler); … … 200 200 else if (templateDimensions.height < previousTemplateDimensions.height) { 201 201 for (i = Math.ceil(previousTemplateDimensions.height / pixelsPerCm); i > Math.ceil(templateDimensions.height / pixelsPerCm); i--) { 202 $ j('#rulerv' + (i - 1)).remove();202 $('#rulerv' + (i - 1)).remove(); 203 203 } 204 204 } … … 208 208 // If there are already some items being displayed, it does not erase them 209 209 function displayItems() { 210 $ j.each(items, function(i, item) {210 $.each(items, function(i, item) { 211 211 var newDiv = createDiv(); 212 212 newDiv.css({ … … 223 223 224 224 function changeTemplateSize() { 225 var tpl = $ j('#templateDiv');226 tpl.width($ j('#badge_width').val() * pixelsPerCm);227 tpl.height($ j('#badge_height').val() * pixelsPerCm);225 var tpl = $('#templateDiv'); 226 tpl.width($('#badge_width').val() * pixelsPerCm); 227 tpl.height($('#badge_height').val() * pixelsPerCm); 228 228 previousTemplateDimensions.width = templateDimensions.width; 229 229 previousTemplateDimensions.height = templateDimensions.height; 230 templateDimensions = new Dimensions($ j('#badge_width').val() * pixelsPerCm, $j('#badge_height').val() * pixelsPerCm);230 templateDimensions = new Dimensions($('#badge_width').val() * pixelsPerCm, $('#badge_height').val() * pixelsPerCm); 231 231 updateRulers(); 232 232 if (backgroundId != -1) { 233 var url = $ j('#background').attr('src');234 $ j('#background').remove();233 var url = $('#background').attr('src'); 234 $('#background').remove(); 235 235 displayBackground(url); 236 236 } … … 276 276 if (lastSelectedDiv) { 277 277 var item = items[lastSelectedDiv.attr('id')]; 278 item.fontFamily = $ j('#font_selector').val();279 item.fontFamilyIndex = $ j('#font_selector').prop('selectedIndex');278 item.fontFamily = $('#font_selector').val(); 279 item.fontFamilyIndex = $('#font_selector').prop('selectedIndex'); 280 280 lastSelectedDiv.html(item.toHTML()); 281 281 } … … 284 284 if (lastSelectedDiv) { 285 285 var item = items[lastSelectedDiv.attr('id')]; 286 item.color = $ j('#color_selector').val();287 item.colorIndex = $ j('#color_selector').prop('selectedIndex');286 item.color = $('#color_selector').val(); 287 item.colorIndex = $('#color_selector').prop('selectedIndex'); 288 288 lastSelectedDiv.html(item.toHTML()); 289 289 } … … 292 292 if (lastSelectedDiv) { 293 293 var item = items[lastSelectedDiv.attr('id')]; 294 item.textAlign = $ j('#alignment_selector').val();295 item.textAlignIndex = $ j('#alignment_selector').prop('selectedIndex');294 item.textAlign = $('#alignment_selector').val(); 295 item.textAlignIndex = $('#alignment_selector').prop('selectedIndex'); 296 296 lastSelectedDiv.html(item.toHTML()); 297 297 } … … 300 300 if (lastSelectedDiv) { 301 301 var item = items[lastSelectedDiv.attr('id')]; 302 item.fontSize = $ j('#size_selector').val();303 item.fontSizeIndex = $ j('#size_selector').prop('selectedIndex');302 item.fontSize = $('#size_selector').val(); 303 item.fontSizeIndex = $('#size_selector').prop('selectedIndex'); 304 304 lastSelectedDiv.html(item.toHTML()); 305 305 } … … 308 308 if (lastSelectedDiv) { 309 309 var item = items[lastSelectedDiv.attr('id')]; 310 switch($ j('#style_selector').val()) {310 switch($('#style_selector').val()) { 311 311 case "normal": 312 312 item.bold = false; … … 329 329 } 330 330 331 item.styleIndex = $ j('#style_selector').prop('selectedIndex');331 item.styleIndex = $('#style_selector').prop('selectedIndex'); 332 332 lastSelectedDiv.html(item.toHTML()); 333 333 } … … 336 336 if (lastSelectedDiv) { 337 337 var item = items[lastSelectedDiv.attr('id')]; 338 item.text = unescapeHTML($ j('#fixed_text_field').val());339 $ j('#fixed_text_field').val(item.text);338 item.text = unescapeHTML($('#fixed_text_field').val()); 339 $('#fixed_text_field').val(item.text); 340 340 lastSelectedDiv.html(item.toHTML()); 341 341 } … … 344 344 if (lastSelectedDiv) { 345 345 var item = items[lastSelectedDiv.attr('id')]; 346 item.width = $ j('#width_field').val() * pixelsPerCm;346 item.width = $('#width_field').val() * pixelsPerCm; 347 347 lastSelectedDiv.html(item.toHTML()); 348 348 } … … 352 352 353 353 function save() { 354 if ($ j('#template_name').val() == '') {354 if ($('#template_name').val() == '') { 355 355 alert("Please choose a name for the template"); 356 356 return; 357 357 } 358 358 var template = []; 359 template.push($ j('#template_name').val());359 template.push($('#template_name').val()); 360 360 template.push(templateDimensions, pixelsPerCm); 361 361 template.push(backgroundId); 362 362 363 363 template.push(items); 364 $ j('#templateData').val(Json.write(template));365 $ j('#saveForm').submit();364 $('#templateData').val(Json.write(template)); 365 $('#saveForm').submit(); 366 366 } 367 367 … … 371 371 } 372 372 else { 373 var iframeDocument = $ j('#uploadTarget')[0].contentDocument || $j('#uploadTarget')[0].contentWindow;373 var iframeDocument = $('#uploadTarget')[0].contentDocument || $('#uploadTarget')[0].contentWindow; 374 374 if (iframeDocument.document) { 375 375 iframeDocument = iframeDocument.document; … … 378 378 try { 379 379 if (backgroundId != -1) { 380 $ j('#background').remove();380 $('#background').remove(); 381 381 } 382 backgroundId = $ j('#background_id', iframeDocument).html();383 var backgroundURL = $ j('#background_url', iframeDocument).html();382 backgroundId = $('#background_id', iframeDocument).html(); 383 var backgroundURL = $('#background_url', iframeDocument).html(); 384 384 displayBackground(backgroundURL); 385 385 } 386 386 catch (err) { 387 $ j('#loadingIcon').hide();387 $('#loadingIcon').hide(); 388 388 } 389 389 } … … 391 391 392 392 function displayBackground(backgroundURL) { 393 $ j('<img/>', {393 $('<img/>', { 394 394 id: 'background', 395 395 src: backgroundURL … … 402 402 zIndex: 5 403 403 }).load(function() { 404 $ j('#loadingIcon').hide();404 $('#loadingIcon').hide(); 405 405 }).appendTo('#templateDiv'); 406 406 } … … 409 409 if (backgroundId != -1) { 410 410 backgroundId = -1; 411 $ j('#background').remove();411 $('#background').remove(); 412 412 } 413 413 } … … 418 418 } 419 419 420 $ j(document).ready(function() {420 $(document).ready(function() { 421 421 // select items on mousedown 422 $ j('#templateDiv > div').live('mousedown', function() {423 markSelected($ j(this));422 $('#templateDiv > div').live('mousedown', function() { 423 markSelected($(this)); 424 424 }); 425 425 426 426 // toggle grid/snap mode 427 $ j('#snap_checkbox').change(function() {427 $('#snap_checkbox').change(function() { 428 428 snapToGrid = this.checked; 429 429 }).change(); 430 430 431 431 // show a throbber when uploading a background 432 $ j('#bgForm').submit(function() {433 $ j('#loadingIcon').show();434 }); 435 436 $ j('#removeBackground').click(function(e) {432 $('#bgForm').submit(function() { 433 $('#loadingIcon').show(); 434 }); 435 436 $('#removeBackground').click(function(e) { 437 437 e.preventDefault(); 438 438 removeBackground(); 439 439 }); 440 440 441 $ j('.moveButton').click(function(e) {441 $('.moveButton').click(function(e) { 442 442 e.preventDefault(); 443 var dir = $ j(this).data('direction');443 var dir = $(this).data('direction'); 444 444 moveFuncs[dir](); 445 445 }); 446 446 447 $ j('.attrButton').click(function(e) {447 $('.attrButton').click(function(e) { 448 448 e.preventDefault(); 449 var attr = $ j(this).data('attr');449 var attr = $(this).data('attr'); 450 450 attrFuncs[attr](); 451 451 }); 452 452 453 $ j('.attrSelect').change(function() {454 var attr = $ j(this).data('attr');453 $('.attrSelect').change(function() { 454 var attr = $(this).data('attr'); 455 455 attrFuncs[attr](); 456 456 }); 457 457 458 $ j('#changeTemplateSize').click(function(e) {458 $('#changeTemplateSize').click(function(e) { 459 459 e.preventDefault(); 460 460 changeTemplateSize(); 461 461 }); 462 462 463 $ j('#insertButton').click(function(e) {463 $('#insertButton').click(function(e) { 464 464 e.preventDefault(); 465 465 insertElement(); 466 466 }); 467 467 468 $ j('#removeButton').click(function(e) {468 $('#removeButton').click(function(e) { 469 469 e.preventDefault(); 470 470 removeElement(); 471 471 }); 472 472 473 $ j('#saveButton').click(function(e) {473 $('#saveButton').click(function(e) { 474 474 e.preventDefault(); 475 475 save(); 476 476 }); 477 477 478 $ j('#uploadTarget').load(sent);478 $('#uploadTarget').load(sent); 479 479 }); 480 480 </script> … … 793 793 if (${ editingTemplate }) { 794 794 var template = ${ templateData }; 795 $ j('#template_name').val(template[0]);796 $ j('#templateDiv').width(template[1].width).height(template[1].height);795 $('#template_name').val(template[0]); 796 $('#templateDiv').width(template[1].width).height(template[1].height); 797 797 items = template[4]; 798 798 // We give the toHTML() method to each of the items 799 $ j.each(items, function(i, item) {799 $.each(items, function(i, item) { 800 800 item.toHTML = Item.prototype.toHTML; 801 801 }); … … 807 807 previousTemplateDimensions = new Dimensions(0,0); 808 808 809 $ j('#badge_width').val(templateDimensions.width / pixelsPerCm);810 $ j('#badge_height').val(templateDimensions.height / pixelsPerCm);809 $('#badge_width').val(templateDimensions.width / pixelsPerCm); 810 $('#badge_height').val(templateDimensions.height / pixelsPerCm); 811 811 812 812 updateRulers(); // creates the initial rulers -
indico/MaKaC/webinterface/tpls/ConfModifPosterDesign.tpl
r0ca8eb r80545d 89 89 itemId++; 90 90 91 var newDiv = $ j('<div/>', {91 var newDiv = $('<div/>', { 92 92 id: itemId 93 93 }).css({ … … 121 121 var newDiv = createDiv(); 122 122 // We set the inner html of the div depending on the type of item inserted 123 switch($ j('#elementList').val()) {123 switch($('#elementList').val()) { 124 124 ${ switchCases } 125 125 } … … 136 136 items[lastSelectedDiv.attr('id')] = false; 137 137 lastSelectedDiv.remove(); 138 $ j('#selection_text').html('');138 $('#selection_text').html(''); 139 139 lastSelectedDiv = null; 140 $ j('#removeButton').prop('disabled', true);140 $('#removeButton').prop('disabled', true); 141 141 } 142 142 } … … 145 145 // Change the text that says which item is selected 146 146 var id = newSelectedDiv.attr('id'); 147 $ j('#selection_text').html(translate[items[id].key]);147 $('#selection_text').html(translate[items[id].key]); 148 148 149 149 // TODO: add check to see if there's a table inside and not an image … … 160 160 newSelectedDiv.html(newSelectedItem.toHTML()); 161 161 lastSelectedDiv = newSelectedDiv; 162 $ j('#removeButton').prop('disabled', false);162 $('#removeButton').prop('disabled', false); 163 163 164 164 // Change the selectors so that they match the properties of the item 165 $ j('#alignment_selector').prop('selectedIndex', newSelectedItem.textAlignIndex);166 $ j('#font_selector').prop('selectedIndex', newSelectedItem.fontFamilyIndex);167 $ j('#size_selector').prop('selectedIndex', newSelectedItem.fontSizeIndex);168 $ j('#style_selector').prop('selectedIndex', newSelectedItem.styleIndex);169 $ j('#color_selector').prop('selectedIndex', newSelectedItem.colorIndex);170 $ j('#width_field').val(newSelectedItem.width / pixelsPerCm);165 $('#alignment_selector').prop('selectedIndex', newSelectedItem.textAlignIndex); 166 $('#font_selector').prop('selectedIndex', newSelectedItem.fontFamilyIndex); 167 $('#size_selector').prop('selectedIndex', newSelectedItem.fontSizeIndex); 168 $('#style_selector').prop('selectedIndex', newSelectedItem.styleIndex); 169 $('#color_selector').prop('selectedIndex', newSelectedItem.colorIndex); 170 $('#width_field').val(newSelectedItem.width / pixelsPerCm); 171 171 if (newSelectedItem.key == "Fixed Text") { 172 $ j('#fixed_text_field').val(newSelectedItem.text).prop('disabled', false);173 $ j('#changeText').prop('disabled', false);172 $('#fixed_text_field').val(newSelectedItem.text).prop('disabled', false); 173 $('#changeText').prop('disabled', false); 174 174 } else { 175 $ j('#fixed_text_field').val("").prop('disabled', true);176 $ j('#changeText').prop('disabled', true);175 $('#fixed_text_field').val("").prop('disabled', true); 176 $('#changeText').prop('disabled', true); 177 177 } 178 178 } … … 180 180 function updateRulers() { 181 181 if (templateDimensions.width > previousTemplateDimensions.width) { 182 var hRuler = $ j('#horizontal_ruler');182 var hRuler = $('#horizontal_ruler'); 183 183 for (var i = Math.ceil(previousTemplateDimensions.width / pixelsPerCm); i < Math.ceil(templateDimensions.width / pixelsPerCm); i++) { 184 $ j('<div/>', {184 $('<div/>', { 185 185 id: 'rulerh' + i 186 186 }).css({ … … 200 200 else if (templateDimensions.width < previousTemplateDimensions.width) { 201 201 for (var i = Math.ceil(previousTemplateDimensions.width / pixelsPerCm); i > Math.ceil(templateDimensions.width / pixelsPerCm); i--) { 202 $ j('#horizontal_ruler > #rulerh' + (i - 1)).remove();202 $('#horizontal_ruler > #rulerh' + (i - 1)).remove(); 203 203 } 204 204 } 205 205 206 206 if (templateDimensions.height > previousTemplateDimensions.height) { 207 var vRuler = $ j('#vertical_ruler');207 var vRuler = $('#vertical_ruler'); 208 208 for (var i = Math.ceil(previousTemplateDimensions.height / pixelsPerCm); i < Math.ceil(templateDimensions.height / pixelsPerCm); i++) { 209 $ j('<div/>', {209 $('<div/>', { 210 210 id: 'rulerv' + i 211 211 }).css({ … … 225 225 else if (templateDimensions.height < previousTemplateDimensions.height) { 226 226 for (i = Math.ceil(previousTemplateDimensions.height / pixelsPerCm); i > Math.ceil(templateDimensions.height / pixelsPerCm); i--) { 227 $ j('#vertical_ruler > #rulerv' + (i - 1)).remove();227 $('#vertical_ruler > #rulerv' + (i - 1)).remove(); 228 228 } 229 229 } … … 233 233 // If there are already some items being displayed, it does not erase them 234 234 function displayItems() { 235 $ j.each(items, function(i, item) {235 $.each(items, function(i, item) { 236 236 var newDiv = createDiv(); 237 237 newDiv.css({ … … 249 249 250 250 function changeTemplateSize() { 251 var tpl = $ j('#templateDiv');252 tpl.width($ j('#poster_width').val() * pixelsPerCm);253 tpl.height($ j('#poster_height').val() * pixelsPerCm);251 var tpl = $('#templateDiv'); 252 tpl.width($('#poster_width').val() * pixelsPerCm); 253 tpl.height($('#poster_height').val() * pixelsPerCm); 254 254 previousTemplateDimensions.width = templateDimensions.width; 255 255 previousTemplateDimensions.height = templateDimensions.height; 256 templateDimensions = new Dimensions($ j('#poster_width').val() * pixelsPerCm, $j('#poster_height').val() * pixelsPerCm);256 templateDimensions = new Dimensions($('#poster_width').val() * pixelsPerCm, $('#poster_height').val() * pixelsPerCm); 257 257 updateRulers(); 258 258 if (backgroundId != -1) { 259 var url = $ j('#background').attr('src');260 $ j('#background').remove();259 var url = $('#background').attr('src'); 260 $('#background').remove(); 261 261 displayBackground(url); 262 262 } … … 302 302 if (lastSelectedDiv) { 303 303 var item = items[lastSelectedDiv.attr('id')]; 304 item.fontFamily = $ j('#font_selector').val();305 item.fontFamilyIndex = $ j('#font_selector').prop('selectedIndex');304 item.fontFamily = $('#font_selector').val(); 305 item.fontFamilyIndex = $('#font_selector').prop('selectedIndex'); 306 306 lastSelectedDiv.html(item.toHTML()); 307 307 } … … 310 310 if (lastSelectedDiv) { 311 311 var item = items[lastSelectedDiv.attr('id')]; 312 item.color = $ j('#color_selector').val();313 item.colorIndex = $ j('#color_selector').prop('selectedIndex');312 item.color = $('#color_selector').val(); 313 item.colorIndex = $('#color_selector').prop('selectedIndex'); 314 314 lastSelectedDiv.html(item.toHTML()); 315 315 } … … 318 318 if (lastSelectedDiv) { 319 319 var item = items[lastSelectedDiv.attr('id')]; 320 item.textAlign = $ j('#alignment_selector').val();321 item.textAlignIndex = $ j('#alignment_selector').prop('selectedIndex');320 item.textAlign = $('#alignment_selector').val(); 321 item.textAlignIndex = $('#alignment_selector').prop('selectedIndex'); 322 322 lastSelectedDiv.html(item.toHTML()); 323 323 } … … 326 326 if (lastSelectedDiv) { 327 327 var item = items[lastSelectedDiv.attr('id')]; 328 item.fontSize = zoom_font(zoom_factor, $ j('#size_selector').val());329 item.fontSizeIndex = $ j('#size_selector').prop('selectedIndex');328 item.fontSize = zoom_font(zoom_factor, $('#size_selector').val()); 329 item.fontSizeIndex = $('#size_selector').prop('selectedIndex'); 330 330 lastSelectedDiv.html(item.toHTML()); 331 331 } … … 334 334 if (lastSelectedDiv) { 335 335 var item = items[lastSelectedDiv.attr('id')]; 336 switch($ j('#style_selector').val()) {336 switch($('#style_selector').val()) { 337 337 case "normal": 338 338 item.bold = false; … … 355 355 } 356 356 357 item.styleIndex = $ j('#style_selector').prop('selectedIndex');357 item.styleIndex = $('#style_selector').prop('selectedIndex'); 358 358 lastSelectedDiv.html(item.toHTML()); 359 359 } … … 362 362 if (lastSelectedDiv) { 363 363 var item = items[lastSelectedDiv.attr('id')]; 364 item.text = unescapeHTML($ j('#fixed_text_field').val());365 $ j('#fixed_text_field').val(item.text);364 item.text = unescapeHTML($('#fixed_text_field').val()); 365 $('#fixed_text_field').val(item.text); 366 366 lastSelectedDiv.html(item.toHTML()); 367 367 } … … 370 370 if (lastSelectedDiv) { 371 371 var item = items[lastSelectedDiv.attr('id')]; 372 item.width = $ j('#width_field').val() * pixelsPerCm;372 item.width = $('#width_field').val() * pixelsPerCm; 373 373 lastSelectedDiv.html(item.toHTML()); 374 374 } … … 383 383 384 384 function save() { 385 if ($ j('#template_name').val() == '') {385 if ($('#template_name').val() == '') { 386 386 alert("Please choose a name for the template"); 387 387 return; 388 388 } 389 389 var template = []; 390 template.push($ j('#template_name').val());390 template.push($('#template_name').val()); 391 391 template.push(templateDimensions, pixelsPerCm); 392 392 template.push(backgroundId); 393 393 394 $ j.each(items, function(i, item) {394 $.each(items, function(i, item) { 395 395 if (item != false) { 396 396 item.fontSize = zoom_font(1/zoom_factor, item.fontSize); … … 399 399 400 400 template.push(items); 401 $ j('#templateData').val(Json.write(template));402 $ j('#saveForm').submit();401 $('#templateData').val(Json.write(template)); 402 $('#saveForm').submit(); 403 403 } 404 404 … … 408 408 } 409 409 else { 410 var iframeDocument = $ j('#uploadTarget')[0].contentDocument || $j('#uploadTarget')[0].contentWindow;410 var iframeDocument = $('#uploadTarget')[0].contentDocument || $('#uploadTarget')[0].contentWindow; 411 411 if (iframeDocument.document) { 412 412 iframeDocument = iframeDocument.document; … … 415 415 try { 416 416 if (backgroundId != -1) { 417 $ j('#background').remove();417 $('#background').remove(); 418 418 } 419 backgroundId = $ j('#background_id', iframeDocument).html();420 var backgroundURL = $ j('#background_url', iframeDocument).html();421 backgroundPos = $ j('#background_pos', iframeDocument).html();419 backgroundId = $('#background_id', iframeDocument).html(); 420 var backgroundURL = $('#background_url', iframeDocument).html(); 421 backgroundPos = $('#background_pos', iframeDocument).html(); 422 422 displayBackground(backgroundURL); 423 423 } 424 424 catch (err) { 425 $ j('#loadingIcon').hide();425 $('#loadingIcon').hide(); 426 426 } 427 427 } … … 429 429 430 430 function setBackgroundPos(mode) { 431 var background = $ j('#background');432 var hiddenField = $ j('#bgPosition');433 var bgPosStretch = $ j('#bgPosStretch');434 var bgPosCenter = $ j('#bgPosCenter');431 var background = $('#background'); 432 var hiddenField = $('#bgPosition'); 433 var bgPosStretch = $('#bgPosStretch'); 434 var bgPosCenter = $('#bgPosCenter'); 435 435 436 436 if (mode == 'Stretch') { … … 485 485 486 486 function displayBackground(backgroundURL) { 487 $ j('<img/>', {487 $('<img/>', { 488 488 id: 'background', 489 489 src: backgroundURL … … 496 496 zIndex: 5 497 497 }).load(function() { 498 $ j('#loadingIcon').hide();498 $('#loadingIcon').hide(); 499 499 setBackgroundPos(backgroundPos); 500 500 }).appendTo('#templateDiv'); … … 504 504 if (backgroundId != -1) { 505 505 backgroundId = -1; 506 $ j('#background').remove();506 $('#background').remove(); 507 507 } 508 508 } … … 513 513 } 514 514 515 $ j(document).ready(function() {515 $(document).ready(function() { 516 516 // select items on mousedown 517 $ j('#templateDiv > div').live('mousedown', function() {518 markSelected($ j(this));517 $('#templateDiv > div').live('mousedown', function() { 518 markSelected($(this)); 519 519 }); 520 520 521 521 // toggle grid/snap mode 522 $ j('#snap_checkbox').change(function() {522 $('#snap_checkbox').change(function() { 523 523 snapToGrid = this.checked; 524 524 }).change(); 525 525 526 526 // show a throbber when uploading a background 527 $ j('#bgForm').submit(function() {528 $ j('#loadingIcon').show();529 }); 530 531 $ j('#removeBackground').click(function(e) {527 $('#bgForm').submit(function() { 528 $('#loadingIcon').show(); 529 }); 530 531 $('#removeBackground').click(function(e) { 532 532 e.preventDefault(); 533 533 removeBackground(); 534 534 }); 535 535 536 $ j('.moveButton').click(function(e) {536 $('.moveButton').click(function(e) { 537 537 e.preventDefault(); 538 var dir = $ j(this).data('direction');538 var dir = $(this).data('direction'); 539 539 moveFuncs[dir](); 540 540 }); 541 541 542 $ j('.attrButton').click(function(e) {542 $('.attrButton').click(function(e) { 543 543 e.preventDefault(); 544 var attr = $ j(this).data('attr');544 var attr = $(this).data('attr'); 545 545 attrFuncs[attr](); 546 546 }); 547 547 548 $ j('.attrSelect').change(function() {549 var attr = $ j(this).data('attr');548 $('.attrSelect').change(function() { 549 var attr = $(this).data('attr'); 550 550 attrFuncs[attr](); 551 551 }); 552 552 553 $ j('#changeTemplateSize').click(function(e) {553 $('#changeTemplateSize').click(function(e) { 554 554 e.preventDefault(); 555 555 changeTemplateSize(); 556 556 }); 557 557 558 $ j('#insertButton').click(function(e) {558 $('#insertButton').click(function(e) { 559 559 e.preventDefault(); 560 560 insertElement(); 561 561 }); 562 562 563 $ j('#removeButton').click(function(e) {563 $('#removeButton').click(function(e) { 564 564 e.preventDefault(); 565 565 removeElement(); 566 566 }); 567 567 568 $ j('#saveButton').click(function(e) {568 $('#saveButton').click(function(e) { 569 569 e.preventDefault(); 570 570 save(); 571 571 }); 572 572 573 $ j('#uploadTarget').load(sent);573 $('#uploadTarget').load(sent); 574 574 }); 575 575 </script> … … 896 896 if (${ editingTemplate }) { 897 897 var template = ${ templateData }; 898 $ j('#template_name').val(template[0]);899 $ j('#templateDiv').width(template[1].width).height(template[1].height);898 $('#template_name').val(template[0]); 899 $('#templateDiv').width(template[1].width).height(template[1].height); 900 900 items = template[4]; 901 901 // We give the toHTML() method to each of the items 902 $ j.each(items, function(i, item) {902 $.each(items, function(i, item) { 903 903 item.toHTML = Item.prototype.toHTML; 904 904 }); … … 910 910 previousTemplateDimensions = new Dimensions(0,0); 911 911 912 $ j('#poster_width').val(templateDimensions.width / pixelsPerCm);913 $ j('#poster_height').val(templateDimensions.height / pixelsPerCm);912 $('#poster_width').val(templateDimensions.width / pixelsPerCm); 913 $('#poster_height').val(templateDimensions.height / pixelsPerCm); 914 914 915 915 updateRulers(); // creates the initial rulers -
indico/MaKaC/webinterface/tpls/RoomBookingBlockingForm.tpl
rc180c2 r80545d 90 90 91 91 <script type="text/javascript"> 92 jQuery(document).ready(function($) {92 $(document).ready(function() { 93 93 $('#dateRange').daterange({ 94 94 % if not rh._createNew: … … 123 123 124 124 var serializeACL = function() { 125 $ j('#allowedUsers').val(Json.write(principalField.getUsers()));125 $('#allowedUsers').val(Json.write(principalField.getUsers())); 126 126 } 127 127 … … 132 132 }); 133 133 hasRooms = (roomGuids.length > 0); 134 $ j('#blockedRooms').val(Json.write(roomGuids));134 $('#blockedRooms').val(Json.write(roomGuids)); 135 135 } 136 136 … … 168 168 $E('roomChooser').set(roomChooser.draw(), addRoomButton); 169 169 // sort by room name. we cannot do it serverside since objects are not ordered 170 $ j('#roomChooser select > option').detach().sort(function(a, b) {171 return strnatcmp($ j(a).text().toLowerCase(), $j(b).text().toLowerCase());172 }).appendTo($ j('#roomChooser select'));170 $('#roomChooser select > option').detach().sort(function(a, b) { 171 return strnatcmp($(a).text().toLowerCase(), $(b).text().toLowerCase()); 172 }).appendTo($('#roomChooser select')); 173 173 }) 174 174 var addRoomButton = Html.input("button", {style:{marginRight: pixels(5)}}, $T('Add Room') ); -
indico/MaKaC/webinterface/tpls/RoomBookingBlockingList.tpl
rfb6f28 r80545d 41 41 42 42 <script type="text/javascript"> 43 (function($) {44 43 $('.blockingShowRooms').toggle(function(e) { 45 44 e.preventDefault(); … … 53 52 $this.closest('tbody').removeClass('hasRoomList'); 54 53 }); 55 })(jQuery);56 54 </script> 57 55 % else: -
indico/MaKaC/webinterface/tpls/RoomBookingBlockingsForMyRooms.tpl
rfb6f28 r80545d 61 61 62 62 <script type="text/javascript"> 63 (function($) {64 63 $('.processRoomBlocking').click(function(e) { 65 64 e.preventDefault(); … … 88 87 }); 89 88 }); 90 })(jQuery);91 89 </script> 92 90 % else: -
indico/MaKaC/webinterface/tpls/RoomBookingBookingForm.tpl
r870828 r80545d 8 8 9 9 // Init, clean up (make all textboxes white again) 10 var bookingForm = $ j('#bookingForm');11 $ j(':input', bookingForm).removeClass('invalid');10 var bookingForm = $('#bookingForm'); 11 $(':input', bookingForm).removeClass('invalid'); 12 12 13 13 var isValid = true; … … 15 15 isValid = required_fields(['bookedForName', 'contactEmail', 'reason']) && isValid; 16 16 17 if (!Util.Validation.isEmailList($ j('#contactEmail').val())) {17 if (!Util.Validation.isEmailList($('#contactEmail').val())) { 18 18 isValid = false; 19 $ j('#contactEmail').addClass('invalid');19 $('#contactEmail').addClass('invalid'); 20 20 } 21 21 … … 23 23 if (isValid && !onSubmit) { 24 24 var lastDateInfo = bookingForm.data('lastDateInfo'); 25 var dateInfo = $ j('#sDay, #sMonth, #sYear, #eDay, #eMonth, #eYear').serialize();25 var dateInfo = $('#sDay, #sMonth, #sYear, #eDay, #eMonth, #eYear').serialize(); 26 26 if (dateInfo != lastDateInfo) { 27 27 bookingForm.data('lastDateInfo', dateInfo); … … 38 38 % if candResv.room.needsAVCSetup: 39 39 var vcIsValid = true; 40 if ($ j('#usesAVC').is(':checked')) {41 vcIsValid = $ j('input.videoConferenceOption').is(':checked');42 } 43 $ j('#vcSystemList').toggleClass('invalid', !vcIsValid);40 if ($('#usesAVC').is(':checked')) { 41 vcIsValid = $('input.videoConferenceOption').is(':checked'); 42 } 43 $('#vcSystemList').toggleClass('invalid', !vcIsValid); 44 44 isValid = isValid && vcIsValid; 45 45 % endif … … 49 49 50 50 51 $ j(window).load(function() {51 $(window).load(function() { 52 52 % if candResv.room.needsAVCSetup: 53 $ j('.videoConferenceOption, #needsAVCSupport').change(function() {53 $('.videoConferenceOption, #needsAVCSupport').change(function() { 54 54 if(this.checked) { 55 $ j('#usesAVC').prop('checked', true);55 $('#usesAVC').prop('checked', true); 56 56 } 57 57 }); 58 $ j('#usesAVC').change(function() {58 $('#usesAVC').change(function() { 59 59 if(!this.checked) { 60 $ j('.videoConferenceOption, #needsAVCSupport').prop('checked', false);60 $('.videoConferenceOption, #needsAVCSupport').prop('checked', false); 61 61 } 62 62 }); … … 67 67 } 68 68 69 $ j('#bookingForm').delegate(':input', 'keyup change', function() {69 $('#bookingForm').delegate(':input', 'keyup change', function() { 70 70 forms_are_valid(); 71 71 }).submit(function(e) { … … 75 75 }; 76 76 }).keydown(function(e) { 77 if(e.which == 13 && !$ j(e.target).is('textarea, :submit')) {77 if(e.which == 13 && !$(e.target).is('textarea, :submit')) { 78 78 e.preventDefault(); 79 $ j('#saveBooking').click();79 $('#saveBooking').click(); 80 80 } 81 81 }); 82 82 83 $ j('#saveBooking').click(function(e) {84 $ j('#bookingForm').attr('action', '${saveBookingUH.getURL(conf)}');83 $('#saveBooking').click(function(e) { 84 $('#bookingForm').attr('action', '${saveBookingUH.getURL(conf)}'); 85 85 }); 86 $ j('#checkBooking').click(function(e) {87 $ j('#bookingForm').attr('action', '${bookingFormURL}#conflicts');88 if (!validate_period($ j('#bookingForm')[0], true, ${ allowPast })) {86 $('#checkBooking').click(function(e) { 87 $('#bookingForm').attr('action', '${bookingFormURL}#conflicts'); 88 if (!validate_period($('#bookingForm')[0], true, ${ allowPast })) { 89 89 alert(${_("'There are errors in the form. Please correct fields with red background.'")}); 90 90 e.preventDefault(); -
indico/MaKaC/webinterface/tpls/RoomBookingPeriodForm.tpl
r870828 r80545d 5 5 function set_repeatition_comment() { 6 6 var s = ''; 7 var repType = parseInt($ j('#repeatability').val(), 10);7 var repType = parseInt($('#repeatability').val(), 10); 8 8 if(repType > 0) { 9 var date = new Date(parseInt($ j('#sYear').val(), 10), parseInt($j('#sMonth').val()-1, 10), parseInt($j('#sDay').val(), 10));9 var date = new Date(parseInt($('#sYear').val(), 10), parseInt($('#sMonth').val()-1, 10), parseInt($('#sDay').val(), 10)); 10 10 var weekDays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; 11 11 s = 'on ' + weekDays[date.getDay()]; … … 17 17 } 18 18 } 19 $ j('#repComment').html(s);19 $('#repComment').html(s); 20 20 } 21 21 -
indico/MaKaC/webinterface/tpls/RoomBookingSearch4Bookings.tpl
r870828 r80545d 5 5 // Displays div with dates and hours 6 6 function all_date_fields_are_blank() { 7 return ($ j('#sDay').val()=='' && $j('#sMonth').val()=='' && $j('#sYear').val()=='' && $j('#sdate').val()=='' &&8 $ j('#eDay').val()=='' && $j('#eMonth').val()=='' && $j('#eYear').val()=='' && $j('#edate').val()=='');7 return ($('#sDay').val()=='' && $('#sMonth').val()=='' && $('#sYear').val()=='' && $('#sdate').val()=='' && 8 $('#eDay').val()=='' && $('#eMonth').val()=='' && $('#eYear').val()=='' && $('#edate').val()==''); 9 9 } 10 10 function all_time_fields_are_blank() { 11 return $ j('#sTime').val() == '' && $j('#eTime').val() == '';11 return $('#sTime').val() == '' && $('#eTime').val() == ''; 12 12 } 13 13 … … 20 20 21 21 // Clean up - make all textboxes white again 22 var searchForm = $ j('#searchForm');23 $ j(':input', searchForm).removeClass('invalid');22 var searchForm = $('#searchForm'); 23 $(':input', searchForm).removeClass('invalid'); 24 24 25 25 // Init … … 37 37 if (isValid && !onSubmit) { 38 38 var lastDateInfo = searchForm.data('lastDateInfo'); 39 var dateInfo = $ j('#sDay, #sMonth, #sYear, #eDay, #eMonth, #eYear').serialize();39 var dateInfo = $('#sDay, #sMonth, #sYear, #eDay, #eMonth, #eYear').serialize(); 40 40 if (dateInfo != lastDateInfo) { 41 41 searchForm.data('lastDateInfo', dateInfo); … … 54 54 55 55 function confirm_search() { 56 if ($ j('#onlyMy').is(':checked')) {56 if ($('#onlyMy').is(':checked')) { 57 57 return true; 58 58 } 59 if ($ j('#roomGUID').val() !== null) {59 if ($('#roomGUID').val() !== null) { 60 60 return true; 61 61 } 62 try { if ($ j('#ofMyRooms').is(':checked')) { return true; } } catch (err) {}62 try { if ($('#ofMyRooms').is(':checked')) { return true; } } catch (err) {} 63 63 alert('Please select a room (or several rooms).'); 64 64 return false; 65 65 } 66 66 67 $ j(window).load(function() {67 $(window).load(function() { 68 68 var startDate = IndicoUI.Widgets.Generic.dateField_sdate(false, null, ['sDay', 'sMonth', 'sYear']); 69 69 $E('sDatePlace').set(startDate); … … 97 97 % endif 98 98 99 $ j('#onlyBookings').change(function() {99 $('#onlyBookings').change(function() { 100 100 if(this.checked) { 101 $ j('#onlyPrebookings').prop('checked', false);102 } 103 }); 104 105 $ j('#onlyPrebookings').change(function() {101 $('#onlyPrebookings').prop('checked', false); 102 } 103 }); 104 105 $('#onlyPrebookings').change(function() { 106 106 if(this.checked) { 107 $ j('#onlyBookings').prop('checked', false);108 } 109 }); 110 111 $ j('#searchForm').delegate(':input', 'keyup change', function() {107 $('#onlyBookings').prop('checked', false); 108 } 109 }); 110 111 $('#searchForm').delegate(':input', 'keyup change', function() { 112 112 forms_are_valid(); 113 113 }).submit(function(e) { -
indico/MaKaC/webinterface/tpls/RoomBookingSearch4Rooms.tpl
r870828 r80545d 4 4 // Displays div with dates and hours 5 5 function display_availability(bool) { 6 $ j('#sdatesTR, #edatesTR, #hoursTR, #repTypeTR, #includePrebookingsTR, #includePendingBlockingsTR').toggle(bool);6 $('#sdatesTR, #edatesTR, #hoursTR, #repTypeTR, #includePrebookingsTR, #includePendingBlockingsTR').toggle(bool); 7 7 } 8 8 // Reds out the invalid textboxes and returns false if something is invalid. … … 14 14 15 15 // Clean up - make all textboxes white again 16 var searchForm = $ j('#searchForm');17 $ j(':input', searchForm).removeClass('invalid');16 var searchForm = $('#searchForm'); 17 $(':input', searchForm).removeClass('invalid'); 18 18 // Init 19 19 var isValid = true; … … 21 21 // Simple search ------------------------------------- 22 22 // Availability 23 if (!$ j('input[name="availability"]', searchForm).is(':checked')) { // only if NOT "Don't care"23 if (!$('input[name="availability"]', searchForm).is(':checked')) { // only if NOT "Don't care" 24 24 isValid = validate_period(searchForm[0]); 25 25 } 26 26 // capacity 27 if ($ j('#capacity').val().length > 0 && parseInt($j('#capacity').val(), 10).toString() == 'NaN') {28 $ j('#capacity').addClass('invalid');27 if ($('#capacity').val().length > 0 && parseInt($('#capacity').val(), 10).toString() == 'NaN') { 28 $('#capacity').addClass('invalid'); 29 29 isValid = false; 30 30 } … … 33 33 if (isValid && !onSubmit) { 34 34 var lastDateInfo = searchForm.data('lastDateInfo'); 35 var dateInfo = $ j('#sDay, #sMonth, #sYear, #eDay, #eMonth, #eYear').serialize();35 var dateInfo = $('#sDay, #sMonth, #sYear, #eDay, #eMonth, #eYear').serialize(); 36 36 if (dateInfo != lastDateInfo) { 37 37 searchForm.data('lastDateInfo', dateInfo); … … 46 46 } 47 47 48 if (!$ j('#sdate').val()) {49 $ j('#sdate').addClass('invalid');48 if (!$('#sdate').val()) { 49 $('#sdate').addClass('invalid'); 50 50 isValid = false; 51 51 } 52 52 53 if (!$ j('#edate').val()) {54 $ j('#edate').addClass('invalid');53 if (!$('#edate').val()) { 54 $('#edate').addClass('invalid'); 55 55 isValid = false; 56 56 } … … 62 62 function isBookable() { 63 63 // Get the selected option in the SELECT 64 var selectedURL = $ j('#roomName').val();64 var selectedURL = $('#roomName').val(); 65 65 var roomLocationPattern = /roomLocation=([a-zA-Z0-9\-]*)(?:&|$)/; 66 66 var roomIDPattern = /roomID=([a-zA-Z0-9\-]*)(?:&|$)/; … … 96 96 } 97 97 98 $ j(window).load(function() {99 $ j('#searchForm').delegate(':input', 'keyup change', function() {98 $(window).load(function() { 99 $('#searchForm').delegate(':input', 'keyup change', function() { 100 100 forms_are_valid(); 101 101 }).submit(function(e) { … … 109 109 set_repeatition_comment(); 110 110 } 111 if ($ j('#searchForm input[name="availability"]').is(':checked')) { // if "Don't care" about availability111 if ($('#searchForm input[name="availability"]').is(':checked')) { // if "Don't care" about availability 112 112 display_availability(false); 113 113 } 114 $ j('#searchForm input[name="availability"]').change(function() {115 display_availability($ j(this).data('showAvailability'));114 $('#searchForm input[name="availability"]').change(function() { 115 display_availability($(this).data('showAvailability')); 116 116 }); 117 $ j('#freeSearch').focus();117 $('#freeSearch').focus(); 118 118 }); 119 119 … … 228 228 % endif 229 229 % if not forNewBooking: 230 <input class="btn" type="button" value="${ _("Room details")}" onclick="document.location = $ j('#roomName').val(); return false;" />230 <input class="btn" type="button" value="${ _("Room details")}" onclick="document.location = $('#roomName').val(); return false;" /> 231 231 % endif 232 232 -
indico/htdocs/js/indico/Legacy/Widgets.js
r6282c5 r80545d 931 931 if (update && p.inputField) { 932 932 p.inputField.value = cal.date.print(p.ifFormat); 933 $ j(p.inputField).trigger('change');933 $(p.inputField).trigger('change'); 934 934 } 935 935 if (update && p.displayArea) -
indico/htdocs/js/indico/Legacy/validation.js
r870828 r80545d 82 82 for (var i = 0; i < fieldNames.length; ++i) { 83 83 fieldName = fieldNames[i]; 84 if (trim($ j('#' + fieldName).val()).length == 0) {85 $ j('#' + fieldName).addClass('invalid');84 if (trim($('#' + fieldName).val()).length == 0) { 85 $('#' + fieldName).addClass('invalid'); 86 86 isValid = false; 87 87 } … … 151 151 { 152 152 // sDate 153 if ( !is_valid_date( $ j('#sDay').val(), $j('#sMonth').val(), $j('#sYear').val() ) )153 if ( !is_valid_date( $('#sDay').val(), $('#sMonth').val(), $('#sYear').val() ) ) 154 154 { 155 155 f1.sDay.className = f1.sMonth.className = f1.sYear.className = f1.sdate.className = 'invalid'; … … 157 157 } 158 158 // eDate 159 if ( !is_valid_date( $ j('#eDay').val(), $j('#eMonth').val(), $j('#eYear').val() ) )159 if ( !is_valid_date( $('#eDay').val(), $('#eMonth').val(), $('#eYear').val() ) ) 160 160 { 161 161 f1.eDay.className = f1.eMonth.className = f1.eYear.className = f1.edate.className = 'invalid'; … … 164 164 165 165 // sDate < eDate 166 var sDate = new Date( parseInt( $ j('#sYear').val(), 10 ), parseInt( $j('#sMonth').val(), 10 ) - 1, parseInt( $j('#sDay').val(), 10 ) );167 var eDate = new Date( parseInt( $ j('#eYear').val(), 10 ), parseInt( $j('#eMonth').val(), 10 ) - 1, parseInt( $j('#eDay').val(), 10 ) );166 var sDate = new Date( parseInt( $('#sYear').val(), 10 ), parseInt( $('#sMonth').val(), 10 ) - 1, parseInt( $('#sDay').val(), 10 ) ); 167 var eDate = new Date( parseInt( $('#eYear').val(), 10 ), parseInt( $('#eMonth').val(), 10 ) - 1, parseInt( $('#eDay').val(), 10 ) ); 168 168 if ( isValid ) 169 169 { … … 181 181 { 182 182 // sTime 183 if ( !is_valid_time( $ j('#sTime').val() ) )183 if ( !is_valid_time( $('#sTime').val() ) ) 184 184 { 185 185 f1.sTime.className = 'invalid'; … … 187 187 } 188 188 // eTime 189 if ( !is_valid_time( $ j('#eTime').val() ) )189 if ( !is_valid_time( $('#eTime').val() ) ) 190 190 { 191 191 f1.eTime.className = 'invalid'; isValid = false; 192 192 } 193 193 // sTime < eTime 194 if ( !isBefore( $ j('#sTime').val(), $j('#eTime').val() ) )194 if ( !isBefore( $('#sTime').val(), $('#eTime').val() ) ) 195 195 { 196 196 f1.sTime.className = f1.eTime.className = 'invalid'; isValid = false; … … 203 203 var isRepeatabilityValid = true; 204 204 205 switch($ j('#repeatability').val()) {205 switch($('#repeatability').val()) { 206 206 // Single Day 207 207 case "None":
Note: See TracChangeset
for help on using the changeset viewer.
