Advertisement
DrupalCustom

sd

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