Skip to content
Extraits de code Groupes Projets
view.js 2,01 ko
Newer Older
  • Learn to ignore specific revisions
  • /*   Copyright 2010 Diaspora Inc.
     *
     *   This file is part of Diaspora.
     *
     *   Diaspora is free software: you can redistribute it and/or modify
     *   it under the terms of the GNU Affero General Public License as published by
     *   the Free Software Foundation, either version 3 of the License, or
     *   (at your option) any later version.
     *
     *   Diaspora is distributed in the hope that it will be useful,
     *   but WITHOUT ANY WARRANTY; without even the implied warranty of
     *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     *   GNU Affero General Public License for more details.
     *
     *   You should have received a copy of the GNU Affero General Public License
     *   along with Diaspora.  If not, see <http://www.gnu.org/licenses/>.
     */
    
    
    
    $(document).ready(function(){
    
    maxwell's avatar
    maxwell a validé
    	
    
    maxwell's avatar
    maxwell a validé
    	$('#debug_info').click(function() {
    
    		$('#debug_more').toggle('fast');
    
    maxwell's avatar
    maxwell a validé
    	});
    	
    
      $("label").inFieldLabels();
    
    maxwell's avatar
    maxwell a validé
    	
    
    danielvincent's avatar
    danielvincent a validé
      $('#flash_notice, #flash_error, #flash_alert').delay(2500).slideUp(130);
    
      $("div.image_cycle").cycle({
        fx: 'fade',
        random: 1,
        timeout: 2000,
        speed: 3000
      });
    
    
    Raphael's avatar
    Raphael a validé
      $("#add_aspect_button").fancybox({ 'titleShow' : false });
    
      $("#add_request_button").fancybox({ 'titleShow': false });
    
      $(".add_request_button").fancybox({ 'titleShow': false });
    
      $("input[type='submit']").addClass("button");
    
    
    ilya's avatar
    ilya a validé
      $(".image_cycle img").load( function() {
        $(this).fadeIn("slow");
      });
    
    Daniel Vincent Grippi's avatar
    Daniel Vincent Grippi a validé
      $("#global_search").hover(
        function() {
          $(this).fadeTo('fast', '1');
        },
        function() {
          $(this).fadeTo('fast', '0.5');
    
    Daniel Vincent Grippi's avatar
    Daniel Vincent Grippi a validé
      );
    
    Daniel Vincent Grippi's avatar
    Daniel Vincent Grippi a validé
    });//end document ready
    
    
    //Called with $(selector).clearForm()
    
    Daniel Vincent Grippi's avatar
    Daniel Vincent Grippi a validé
    $.fn.clearForm = function() {
      return this.each(function() {
      var type = this.type, tag = this.tagName.toLowerCase();
      if (tag == 'form')
        return $(':input',this).clearForm();
      if (type == 'text' || type == 'password' || tag == 'textarea')
        this.value = '';
      //else if (type == 'checkbox' || type == 'radio')
        //this.checked = false;
      else if (tag == 'select')
        this.selectedIndex = -1;
      $(this).blur();
      });
    };