Changeset 996 for trunk/web-app
- Timestamp:
- Oct 26, 2010, 3:19:22 PM (12 years ago)
- Location:
- trunk/web-app
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web-app/css/templateEditor.css
r959 r996 82 82 } 83 83 84 /* Please wait dialog */ 85 #wait { /* Transparency, see http://hungred.com/how-to/css-opacity-cross-browser-compatible/ */ 86 filter: alpha(opacity:0.5); 87 KHTMLOpacity: 0.5; 88 MozOpacity: 0.5; 89 -khtml-opacity:.50; 90 -ms-filter:âalpha(opacity=50)â; 91 -moz-opacity:.50; 92 filter:alpha(opacity=50); 93 opacity:.50; 94 } 95 #wait { position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: 100; background-color: #f2f5f7; } 96 .wait_text { position: absolute; left: 50%; top: 50%; margin-left: -100px; margin-top: -20px; width: 200px; height: 40px; text-align: center; font-weight: bold; background-color: white; border: 1px solid #006DBA; padding-top: 13px; vertical-align: center; } 97 .wait { display: none; } 98 84 99 /* Add Ontology dialog */ 85 100 #addOntology { list-style-type: none; padding-left: 0; } -
trunk/web-app/js/templateEditor.js
r959 r996 61 61 var formEl = $( '#template_' + id + '_form' ); 62 62 63 showWaiting(); 64 63 65 // Update the field 64 66 $.ajax({ … … 73 75 error: function( request ) { 74 76 alert( "Could not create template: " + request.responseText ); 75 } 77 }, 78 complete: function( request, textStatus ) { 79 hideWaiting(); 80 } 76 81 }); 77 82 } … … 82 87 function updateTemplate( id ) { 83 88 var formEl = $( '#template_' + id + '_form' ); 89 90 showWaiting(); 84 91 85 92 // Update the field … … 95 102 error: function( request ) { 96 103 alert( "Could not update template: " + request.responseText ); 97 } 104 }, 105 complete: function( request, textStatus ) { 106 hideWaiting(); 107 } 98 108 }); 99 109 } … … 103 113 */ 104 114 function deleteTemplate( id ) { 105 // Update the field 115 116 showWaiting(); 117 118 // Update the field 106 119 $.ajax({ 107 120 url: baseUrl + '/templateEditor/deleteTemplate', … … 116 129 error: function( request ) { 117 130 alert( "Could not delete template: " + request.responseText ); 118 } 131 }, 132 complete: function( request, textStatus ) { 133 hideWaiting(); 134 } 119 135 }); 120 136 121 137 return true; 138 } 139 140 /** 141 * Clones a template using AJAX 142 */ 143 function cloneTemplate( id ) { 144 showWaiting(); 145 146 // Update the field 147 $.ajax({ 148 url: baseUrl + '/templateEditor/cloneTemplate/' + id, 149 dataType: 'json', 150 type: "POST", 151 success: function(data, textStatus, request) { 152 addTemplateListItem( data.id, data.html ); 153 }, 154 error: function( request ) { 155 alert( "Could not clone template: " + request.responseText ); 156 }, 157 complete: function( request, textStatus ) { 158 hideWaiting(); 159 } 160 }); 122 161 } 123 162 … … 203 242 var templateId = $('#templateSelect').val(); 204 243 244 showWaiting(); 245 205 246 // Update the field 206 247 $.ajax({ … … 215 256 error: function( request ) { 216 257 alert( "Could not add template field: " + request.responseText ); 217 } 258 }, 259 complete: function( request, textStatus ) { 260 hideWaiting(); 261 } 218 262 }); 219 263 } … … 224 268 function updateTemplateField( id ) { 225 269 var formEl = $( '#templateField_' + id + '_form' ); 270 271 showWaiting(); 226 272 227 273 // Update the field … … 237 283 error: function( request ) { 238 284 alert( "Could not update template field: " + request.responseText ); 239 } 285 }, 286 complete: function( request, textStatus ) { 287 hideWaiting(); 288 } 240 289 }); 241 290 } … … 245 294 */ 246 295 function deleteTemplateField( id ) { 296 showWaiting(); 297 247 298 // Delete the field 248 299 $.ajax({ … … 258 309 error: function( request ) { 259 310 alert( "Could not delete template field: " + request.responseText ); 260 } 311 }, 312 complete: function( request, textStatus ) { 313 hideWaiting(); 314 } 261 315 }); 262 316 … … 266 320 /** 267 321 * Is triggered when an item from the templatefields has been moved and 268 * shoul ebe updated322 * should be updated 269 323 */ 270 324 function updateTemplateFieldPosition( event, ui ) { … … 279 333 return true; 280 334 } 335 281 336 // Find the new position of the element in the list 282 337 // http://stackoverflow.com/questions/2979643/jquery-ui-sortable-position 283 338 // 284 // Because there is also a hidden 'empty template' list item in the list,285 // the number is decreased by 1 286 var newposition = ui.item.index() - 1;339 // There is also a hidden 'empty template' list item in the list. This is 340 // the last item in the list, so it doesn't matter in this computation 341 var newposition = ui.item.index(); 287 342 288 343 // Find the ID of the templateField and template … … 296 351 // Disable sorting until this move has been saved (in order to prevent collisions 297 352 $( '#templateFields' ).sortable( 'disable' ); 353 354 showWaiting(); 298 355 299 356 // Move the item … … 310 367 undoMove(); 311 368 alert( "Could not move template field: " + request.responseText ); 312 } 369 }, 370 complete: function( request, textStatus ) { 371 hideWaiting(); 372 } 313 373 }); 314 374 } … … 345 405 var templateId = $('#templateSelect').val(); 346 406 407 showWaiting(); 408 347 409 // Update the field 348 410 $.ajax({ … … 369 431 370 432 alert( "Could not add template field: " + request.responseText ); 371 } 433 }, 434 complete: function( request, textStatus ) { 435 hideWaiting(); 436 } 372 437 }); 373 438 … … 397 462 var templateId = $('#templateSelect').val(); 398 463 464 showWaiting(); 465 399 466 // Update the field 400 467 $.ajax({ … … 420 487 421 488 alert( "Could not delete template field: " + request.responseText ); 422 } 489 }, 490 complete: function( request, textStatus ) { 491 hideWaiting(); 492 } 423 493 }); 424 494 … … 514 584 } 515 585 } 586 587 function showWaiting() { $( '.wait' ).show() } 588 function hideWaiting() { $( '.wait' ).hide() } 516 589 517 590 /************************************
Note: See TracChangeset
for help on using the changeset viewer.