Advertisement
DrupalCustom

postjs

Feb 10th, 2012
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.    (function$){
  2.  
  3.    $(document).ready(function () {
  4.       $("#edit-status-list").change(function() {
  5.       var selectedStatus = $(this).find(":selected").text();
  6.       var charExists = ((window.location.href).indexOf('?') >= 0) ? true : false;
  7.      
  8.      if(charExists){
  9.      var split = (window.location.href).split('?');
  10.      var loc = split[0];
  11.      
  12.      loc = loc+"?status="+selectedStatus;  
  13.      self.location.href= loc;
  14.      
  15.      }
  16.      
  17.      else{
  18.       var locf = window.location.href+"?status="+selectedStatus;  
  19.       self.location.href= locf;
  20.      
  21.       }
  22.      
  23.       });
  24.      
  25.       $("#create-freeway-project").submit(function() {
  26.         $(":submit", this).attr("disabled", "disabled");
  27.            
  28.       });
  29.      
  30.      $(".common_link_class").click(function() {
  31.             //alert("Hello");
  32.          
  33.           var count = ($(this).data("clicks") || 0) + 1;
  34.           $(this).data("clicks", count);
  35.          
  36.          
  37.           if ($(this).data("clicks") >= 1) {
  38.          
  39.           }
  40.          
  41.          
  42.           if ($(this).data("clicks") >= 2) {
  43.            
  44.             return false;
  45.           }
  46.         });
  47.        
  48.        
  49.           $("#edit-analysis-code-one").change(function () {
  50.             // Get the configs and split them.
  51.             var cfgs = _get_configs("edit-custRef");
  52.             var split_cfgs = cfgs.split('/');
  53.            
  54.             // Create some new configs and put it back into the configs textfield.
  55.             //var new_cfgs = $(this).val() +"/"+ cfgs[1];
  56.             var new_cfgs = $("#edit-analysis-code-one option:selected").text() +"/"+ cfgs[1];
  57.            
  58.             $("#edit-custRef").val(new_cfgs);
  59.           });
  60.          
  61.           $("#edit-analysis-code-two").change(function () {
  62.             // Get the configs and split them.
  63.             var cfgs = _get_configs("edit-custRef");
  64.             var split_cfgs = cfgs.split('/');
  65.            
  66.             // Create some new configs and put it back into the configs textfield.
  67.             //var new_cfgs = cfgs[0] +"/"+ $(this).val();
  68.             var new_cfgs = cfgs[0] +"/"+ $("#edit-analysis-code-two option:selected").text()
  69.             $("#edit-custRef").val(new_cfgs);
  70.          });
  71.        
  72.    
  73.     });
  74.    
  75. })(jQuery);
  76.  
  77.  
  78. (function$){
  79. function _get_configs(id) {
  80.  
  81.   return $("#"+ id).val();
  82.  
  83. }  
  84. })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement