Commit 2041053fe35fe928d594950ff4c629ae13445190
- Diff rendering mode:
- inline
- side by side
server/ui.js
(47 / 51)
  | |||
52 | 52 | } | |
53 | 53 | }, | |
54 | 54 | ||
55 | |||
55 | |||
56 | 56 | clearMenu: function() { | |
57 | 57 | }, | |
58 | 58 | ajax: function() { | |
… | … | ||
216 | 216 | } | |
217 | 217 | catch (e) | |
218 | 218 | { | |
219 | // dump( 'error: Document tree modified during iteration ' + e ); | ||
219 | // dump( 'error: Document tree modified during iteration ' + e ); | ||
220 | 220 | } | |
221 | 221 | }, | |
222 | 222 | filter: function() | |
… | … | ||
465 | 465 | } | |
466 | 466 | }, | |
467 | 467 | ||
468 | |||
468 | |||
469 | 469 | getLoc: function() { | |
470 | 470 | ||
471 | $( "#loc-select" ).autocomplete({ | ||
472 | source: function(req, add){ | ||
471 | $( "#loc-select" ).autocomplete({ | ||
472 | source: function(req, add){ | ||
473 | 473 | ||
474 | //pass request to server | ||
475 | $.getJSON("http://dev.a11y.in/web/getLoc?", req, function(data) { | ||
476 | $('#loc-img').hide(); | ||
474 | //pass request to server | ||
475 | $.getJSON("http://dev.a11y.in/web/getLoc?", req, function(data) { | ||
476 | $('#loc-img').hide(); | ||
477 | 477 | ||
478 | //create array for response objects | ||
479 | var suggestions = []; | ||
478 | //create array for response objects | ||
479 | var suggestions = []; | ||
480 | 480 | ||
481 | //process response | ||
482 | $.each(data['return'], function(i,val){ | ||
483 | suggestions.push(val['name']+', '+val['country_name']); | ||
484 | }); | ||
485 | //pass array to callback | ||
486 | add(suggestions); | ||
487 | }); | ||
488 | $('#loc-img').show(); | ||
489 | }, | ||
490 | }); | ||
481 | //process response | ||
482 | $.each(data['return'], function(i,val){ | ||
483 | suggestions.push(val['name']+', '+val['country_name']); | ||
484 | }); | ||
485 | //pass array to callback | ||
486 | add(suggestions); | ||
487 | }); | ||
488 | $('#loc-img').show(); | ||
489 | }, | ||
490 | }); | ||
491 | 491 | }, | |
492 | 492 | ||
493 | 493 | getLang: function() { | |
494 | 494 | $( "#lang-select" ).autocomplete({ | |
495 | source: function(req, add){ | ||
495 | source: function(req, add){ | ||
496 | 496 | ||
497 | //pass request to server | ||
498 | $.getJSON("http://dev.a11y.in/web/getLang?", req, function(data) { | ||
499 | $('#lang-img').hide(); | ||
497 | //pass request to server | ||
498 | $.getJSON("http://dev.a11y.in/web/getLang?", req, function(data) { | ||
499 | $('#lang-img').hide(); | ||
500 | 500 | ||
501 | //create array for response objects | ||
502 | var suggestions = []; | ||
501 | //create array for response objects | ||
502 | var suggestions = []; | ||
503 | 503 | ||
504 | //process response | ||
505 | $.each(data['return'], function(i, val){ | ||
506 | //suggestions.push(val.country); | ||
507 | suggestions.push(val['name']); | ||
508 | }); | ||
509 | //pass array to callback | ||
510 | add(suggestions); | ||
511 | }); | ||
512 | $('#lang-img').show(); | ||
513 | }, | ||
514 | }); | ||
504 | //process response | ||
505 | $.each(data['return'], function(i, val){ | ||
506 | //suggestions.push(val.country); | ||
507 | suggestions.push(val['name']); | ||
508 | }); | ||
509 | //pass array to callback | ||
510 | add(suggestions); | ||
511 | }); | ||
512 | $('#lang-img').show(); | ||
513 | }, | ||
514 | }); | ||
515 | 515 | ||
516 | 516 | ||
517 | 517 | }, | |
… | … | ||
524 | 524 | $('#icon_on_overlay').slideUp(); | |
525 | 525 | if (a11ypi.target == false ) { | |
526 | 526 | var publish_template = '<div id="targetoverlay" title="Who are you narrating to??" class="alipi ui-widget-header ui-corner-all"> '+ | |
527 | // '<div id="infovis" class="alipi"> </div>'+ | ||
527 | // '<div id="infovis" class="alipi"> </div>'+ | ||
528 | 528 | '<label class="alipi" style="position:absolute;top:5%;left:110px;color:#000;">Enter few attributes of the '+ | |
529 | 529 | 'target community </label>'+ | |
530 | 530 | '<label class="alipi" style="position:absolute;top:20%;left:125px;color:#000;">Location of the target community: </label> '+ | |
… | … | ||
535 | 535 | '<label class="alipi" style="position:absolute;top:35%;left:125px;color:#000;">Language of re-narration: </label> '+ | |
536 | 536 | '<input id="lang-select" class="alipi" style="position:absolute;top:40%;left:210px;width:256px;color:#000;" '+ | |
537 | 537 | 'placeholder="Type language name"/>'+ | |
538 | '<img id="lang-img" src="http://localhost/wsgi/images/db_loading.gif" style="width:25px;height:18px;position:absolute;'+ | ||
538 | '<img id="lang-img" src="http://dev.a11y.in/wsgi/images/db_loading.gif" style="width:25px;height:18px;position:absolute;'+ | ||
539 | 539 | 'top:41%;left:440px;display:none; "/> '+ | |
540 | 540 | '<label class="alipi" style="position:absolute;top:50%;left:125px;color:#000;">Select a style of re-narration: </label> '+ | |
541 | 541 | '<select id="style-select" class="alipi" style="position:absolute;top:55%;left:210px;width:256px;color:#000;"> '+ | |
… | … | ||
570 | 570 | modal: true, | |
571 | 571 | buttons: { | |
572 | 572 | Publish: function() { | |
573 | $( "#targetoverlay" ).dialog('close'); | ||
574 | $('#pub_overlay').slideUp(); | ||
575 | $('#element_edit_overlay').slideUp(); | ||
576 | $('#icon_on_overlay').slideUp(); | ||
577 | var success_template = '<div id="success-dialog" title="Posting your changes" class="alipi ui-widget-header ui-corner-all" '+ | ||
573 | var success_template = '<div id="success-dialog" title="Posting your changes" class="alipi ui-widget-header ui-corner-all" '+ | ||
578 | 574 | ' style="color:#000"> '+ | |
579 | 575 | '<p><b>Please wait !!!</b></p><p>Your contribution is being posted</p></div>'; | |
580 | $('body').append(success_template); | ||
581 | $(function() { | ||
576 | $('body').append(success_template); | ||
577 | $(function() { | ||
582 | 578 | $( "#success-dialog" ).dialog({ | |
583 | modal: true, | ||
579 | modal: true, | ||
584 | 580 | }); | |
585 | }); | ||
586 | util.publish(); | ||
581 | }); | ||
582 | util.publish(); | ||
587 | 583 | } | |
588 | 584 | }, | |
589 | 585 | close: function() { | |
… | … | ||
587 | 587 | $('#element_edit_overlay').slideDown(); | |
588 | 588 | $('#icon_on_overlay').slideDown(); | |
589 | 589 | $( "#targetoverlay" ).hide(); | |
590 | // document.removeEventListener("DOMActivate", init, false); | ||
590 | // document.removeEventListener("DOMActivate", init, false); | ||
591 | 591 | } | |
592 | 592 | }); | |
593 | 593 | }); | |
… | … | ||
923 | 923 | } | |
924 | 924 | }); | |
925 | 925 | }, | |
926 | |||
926 | |||
927 | 927 | highlightOnHover: function(event) { | |
928 | 928 | if( !($(event.target).hasClass('alipi')) ) { | |
929 | 929 | $(event.target).addClass('highlightElement'); |
server/wsgi/pageEditor.js
(10 / 1)
  | |||
349 | 349 | ||
350 | 350 | publish:function (){ | |
351 | 351 | var result; | |
352 | if ($('#loc-select').val() == '' || $('#lang-select').val() == '' || $('#auth-select').val() == '' && ($('#your-check').attr('checked') == undefined || $('#our-check').attr('checked') == undefined )) { | ||
352 | if ($('#loc-select').val() == '' || $('#lang-select').val() == '' || $('#auth-select').val() == '' || ($('#your-check').attr('checked') == undefined && $('#our-check').attr('checked') == undefined )) { | ||
353 | 353 | alert("please furnish all the details"); | |
354 | 354 | } else { | |
355 | 355 | if(document.getElementById('your-check').checked) | |
… | … | ||
359 | 359 | window.location.reload(); | |
360 | 360 | } | |
361 | 361 | else{ | |
362 | $(function(){ | ||
363 | $( "#targetoverlay" ).dialog('close'); | ||
364 | $('#pub_overlay').slideUp(); | ||
365 | $('#element_edit_overlay').slideUp(); | ||
366 | $('#icon_on_overlay').slideUp(); | ||
367 | $( "#success-dialog" ).dialog({ | ||
368 | modal: true, | ||
369 | }); | ||
370 | }); | ||
362 | 371 | $.ajax({ | |
363 | 372 | url: 'http://dev.a11y.in/test', | |
364 | 373 | type: "POST", |
wsgi/test.wsgi
(1 / 1)
  | |||
7 | 7 | from urllib import unquote_plus | |
8 | 8 | import random | |
9 | 9 | import os.path, sys | |
10 | sys.path.insert(0,os.path.abspath(os.path.join('.', os.path.pardir))) #A hack to import modules from server dir. | ||
10 | sys.path.insert(0,(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)))+'/server') #A hack to import modules from server dir. | ||
11 | 11 | import conf | |
12 | 12 | def application(environ, start_response): | |
13 | 13 | #set the headers |