diff options
author | Priyanka Bhagwat | 2014-08-25 17:49:49 +0530 |
---|---|---|
committer | Priyanka Bhagwat | 2014-08-25 17:49:49 +0530 |
commit | 31114b20bd84976186e35e534104a8c57ccfe03a (patch) | |
tree | 63476266d3379da38b1f3a7ba5b6eae25604aff2 | |
parent | df339f2977d430a8e00078cb1611e1c6c07bb737 (diff) | |
download | scilab_textbook_companion-31114b20bd84976186e35e534104a8c57ccfe03a.tar.gz scilab_textbook_companion-31114b20bd84976186e35e534104a8c57ccfe03a.tar.bz2 scilab_textbook_companion-31114b20bd84976186e35e534104a8c57ccfe03a.zip |
added search for AICTE books
-rwxr-xr-x | js/textbook_companion.js | 22 | ||||
-rwxr-xr-x | js/textbook_companion.js~ | 95 | ||||
-rwxr-xr-x | textbook_companion.module | 14 |
3 files changed, 31 insertions, 100 deletions
diff --git a/js/textbook_companion.js b/js/textbook_companion.js index ea607df..660ccdf 100755 --- a/js/textbook_companion.js +++ b/js/textbook_companion.js @@ -1,5 +1,27 @@ $( document ).ready(function() { + $('#searchtext').keyup(function(event) { + var search_text = $('#searchtext').val(); + var rg = new RegExp(search_text,'i'); + $('#aicte-list-wrapper .title , .form-item' ).each(function(){ + if($.trim($(this).html()).search(rg) == -1) { + //alert("one"); + $(this).parent('div').css('background-color', '#ffffff'); + $(this).css('display', 'none'); + $(this).next().css('display', 'none'); + $(this).next().next().css('display', 'none'); + } + else { + //alert("two"); + $(this).parent('div').css('background-color', '#ffffff'); + $(this).css('display', ''); + $(this).next().css('display', ''); + $(this).next().next().css('display', ''); + } + }); + }); + + $('#edit-same-address').click(function() { var temp = $('#edit-chq-address').val(); $('#edit-temp-chq-address').val(temp); diff --git a/js/textbook_companion.js~ b/js/textbook_companion.js~ deleted file mode 100755 index de0bbec..0000000 --- a/js/textbook_companion.js~ +++ /dev/null @@ -1,95 +0,0 @@ -$( document ).ready(function() { - -$('#edit-same-address').click(function() { - var temp = $('#edit-chq-address').val(); - $('#edit-temp-chq-address').val(temp); - var temp1 = $('#edit-perm-city').val(); - $('#edit-temp-city').val(temp1); - var temp1 = $('#edit-perm-pincode').val(); - $('#edit-temp-pincode').val(temp1); - var temp1 = $('#edit-perm-state').val(); - $('#edit-temp-state').val(temp1); - - $("#edit-cheque-sent").datepicker(); - - - $("#edit-cheque-cleared").datepicker(); - -}); - -$("#edit-perm-pincode").blur(function() - { - var string_length,string_val; - string_val = $("#edit-perm-pincode").val(); - string_length = $("#edit-perm-pincode").text().length; - //$("#username_warning").empty(); - - if ((isNaN(string_val))&&(string_length < 6)) - alert("Not A Valid Zip Code!!"); - - // $("#username_warning").append("Username is too short"); - }); -$("#edit-temp-pincode").blur(function() - { - var string_length1,string_val1; - string_val = $("#edit-temp-pincode").val(); - string_length = $("#edit-temp-pincode").text().length; - //$("#username_warning").empty(); - - if ((isNaN(string_val))&&(string_length1 < 6)) - alert("Not A Valid Zip Code!!"); - - // $("#username_warning").append("Username is too short"); - }); - -$("#edit-mobileno1").blur(function() - { - var string_length3,string_val3; - string_val3 = $("#edit-mobileno1").val(); - string_length3 = $("#edit-mobileno1").text().length; - //$("#username_warning").empty(); - - if (isNaN(string_val3)) - { - alert("Mobile No should be a number!!"); - // $("#username_warning").append("Username is too short"); - } - if((string_length3 > 0)&&(string_length3 < 11)) - { - alert("Not A Valid Mobile No!!"); - } - }); - -$("#edit-mobileno2").blur(function() - { - var string_length4,string_val4; - string_val4 = $("#edit-mobileno2").val(); - string_length4 = $("#edit-mobileno2").text().length; - //$("#username_warning").empty(); - - if (isNaN(string_val4)) - { - alert("Mobile No should be a number!!"); - // $("#username_warning").append("Username is too short"); - } - if((string_length4 > 0)&&(string_length4 < 11)) - { - alert("Not A Valid Mobile No!!"); - } - }); -$('#edit-older-wrapper').hide(); -$('#edit-version').change(function() { - var selected = $(this).val(); - //$('#edit-older-wrapper').hide(); - if(selected == 'olderversion'){ - $('#edit-older-wrapper').show(); - } - else - { - $('#edit-older-wrapper').hide(); - } - -}); -}); - - diff --git a/textbook_companion.module b/textbook_companion.module index ef51500..aaea2b2 100755 --- a/textbook_companion.module +++ b/textbook_companion.module @@ -579,6 +579,8 @@ function textbook_companion_aicte_proposal_form($form_state) { $form["wrapper"][$row->id] = array( "#type" => "checkbox", "#title" => $title, + "#prefix" => "<div class='title>", + "#suffix" => "</div>", ); } } @@ -694,8 +696,9 @@ function textbook_companion_aicte_proposal_all() { $page_content .= "<li>These are the list of books available for <em>Textbook Companion</em> proposal.</li>"; $page_content .= "<li>Please <a href='/user'><b><u>Login</u></b></a> to create a proposal.</li>"; $page_content .= "<li>Unable to propose particular book: <a id='aicte-report' href='#'>Click here</a></li>"; - $page_content .= "<li>Do not wish to propose any of the above books: <a id='aicte-report' href='http://fossee.in/feedback/scilab-aicte' target = _blank>Click here</a></li>"; + $page_content .= "<li>Do not wish to propose any of the below books: <a id='aicte-report' href='http://fossee.in/feedback/scilab-aicte' target = _blank>Click here</a></li>"; $page_content .= "</ul>"; + $page_content .= "Search :<input type='text' id='searchtext' style='width:90%'/>"; $page_content .= "<div id='aicte-list-wrapper'>"; $num_rows = mysql_num_rows($result); if ($num_rows > 0) { @@ -752,7 +755,7 @@ function textbook_companion_aicte_proposal_all() { break; default: drupal_set_message(t('Invalid proposal state. Please contact site administrator for further information.'), 'error'); - drupal_goto(''); + drupal_goto(''); return; break; } @@ -760,9 +763,10 @@ function textbook_companion_aicte_proposal_all() { } variable_del("aicte_".$user->uid); - $page_content .= "<h5><b>* Please select any 3 books from the below available list.</b></h5>"; - $page_content .= "Unable to propose particular book: <a id='aicte-report' href='#'>Click here</a></br>"; - $page_content .= "Do not wish to propose any of the above books: <a id='aicte-report' href='http://fossee.in/feedback/scilab-aicte' target = _blank>Click here</a>"; + $page_content .= "<h5><b>* Please select any 3 books from the below available list.</b></h5></br>"; + $page_content .= "Unable to propose particular book: <a id='aicte-report' href='#'>Click here</a></br></br>"; + $page_content .= "Do not wish to propose any of the below books: <a id='aicte-report' href='http://fossee.in/feedback/scilab-aicte' target = _blank>Click here</a></br></br>"; + $page_content .= "Search : <input type='text' id='searchtext' style='width:90%;/></br>"; $page_content .= drupal_get_form("textbook_companion_aicte_report_form"); $page_content .= drupal_get_form("textbook_companion_aicte_proposal_form"); return $page_content; |