Commit 2041053fe35fe928d594950ff4c629ae13445190

  • avatar
  • arvind
  • Sat Apr 14 13:04:23 IST 2012
Publish window fixes.
server/ui.js
(47 / 51)
  
5252 }
5353 },
5454
55
55
5656 clearMenu: function() {
5757 },
5858 ajax: function() {
216216 }
217217 catch (e)
218218 {
219// dump( 'error: Document tree modified during iteration ' + e );
219 // dump( 'error: Document tree modified during iteration ' + e );
220220 }
221221 },
222222 filter: function()
465465 }
466466 },
467467
468
468
469469 getLoc: function() {
470470
471 $( "#loc-select" ).autocomplete({
472 source: function(req, add){
471 $( "#loc-select" ).autocomplete({
472 source: function(req, add){
473473
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();
477477
478 //create array for response objects
479 var suggestions = [];
478 //create array for response objects
479 var suggestions = [];
480480
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 });
491491 },
492492
493493 getLang: function() {
494494 $( "#lang-select" ).autocomplete({
495 source: function(req, add){
495 source: function(req, add){
496496
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();
500500
501 //create array for response objects
502 var suggestions = [];
501 //create array for response objects
502 var suggestions = [];
503503
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 });
515515
516516
517517 },
524524 $('#icon_on_overlay').slideUp();
525525 if (a11ypi.target == false ) {
526526 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>'+
528528 '<label class="alipi" style="position:absolute;top:5%;left:110px;color:#000;">Enter few attributes of the '+
529529 'target community </label>'+
530530 '<label class="alipi" style="position:absolute;top:20%;left:125px;color:#000;">Location of the target community: </label> '+
535535 '<label class="alipi" style="position:absolute;top:35%;left:125px;color:#000;">Language of re-narration: </label> '+
536536 '<input id="lang-select" class="alipi" style="position:absolute;top:40%;left:210px;width:256px;color:#000;" '+
537537 '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;'+
539539 'top:41%;left:440px;display:none; "/> '+
540540 '<label class="alipi" style="position:absolute;top:50%;left:125px;color:#000;">Select a style of re-narration: </label> '+
541541 '<select id="style-select" class="alipi" style="position:absolute;top:55%;left:210px;width:256px;color:#000;"> '+
570570 modal: true,
571571 buttons: {
572572 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" '+
578574 ' style="color:#000"> '+
579575 '<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() {
582578 $( "#success-dialog" ).dialog({
583 modal: true,
579 modal: true,
584580 });
585 });
586 util.publish();
581 });
582 util.publish();
587583 }
588584 },
589585 close: function() {
587587 $('#element_edit_overlay').slideDown();
588588 $('#icon_on_overlay').slideDown();
589589 $( "#targetoverlay" ).hide();
590// document.removeEventListener("DOMActivate", init, false);
590 // document.removeEventListener("DOMActivate", init, false);
591591 }
592592 });
593593 });
923923 }
924924 });
925925 },
926
926
927927 highlightOnHover: function(event) {
928928 if( !($(event.target).hasClass('alipi')) ) {
929929 $(event.target).addClass('highlightElement');
  
349349
350350 publish:function (){
351351 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 )) {
353353 alert("please furnish all the details");
354354 } else {
355355 if(document.getElementById('your-check').checked)
359359 window.location.reload();
360360 }
361361 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 });
362371 $.ajax({
363372 url: 'http://dev.a11y.in/test',
364373 type: "POST",
  
77from urllib import unquote_plus
88import random
99import os.path, sys
10sys.path.insert(0,os.path.abspath(os.path.join('.', os.path.pardir))) #A hack to import modules from server dir.
10sys.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.
1111import conf
1212def application(environ, start_response):
1313 #set the headers