Skip to content
Extraits de code Groupes Projets
view.js 3,22 ko
Newer Older
  • Learn to ignore specific revisions
  • $(document).ready(function(){
    	tinyMCE.init({
    
    			mode : "exact",
    			elements: "blog_editor",
    
    			theme : "advanced",
    			plugins : "emotions,spellchecker,advhr,insertdatetime,preview",	
    
    			// Theme options - button# indicated the row# only
    
    		theme_advanced_buttons1 : "newdocument,|,bold,italic,underline,|,justifyleft,justifycenter,justifyright,fontsizeselect,formatselect",
    		theme_advanced_buttons2 : "cut,copy,paste|,bullist,numlist,|,outdent,indent|,undo,redo,|,link,unlink,anchor,image,|,preview,|,forecolor,backcolor",
    		theme_advanced_buttons3 : "insertdate,inserttime,|,spellchecker,|,sub,sup,|,charmap,emotions",	
    
    		theme_advanced_toolbar_location : "top",
    		theme_advanced_toolbar_align : "left",
    		//theme_advanced_resizing : true //leave this out as there is an intermittent bug.
    	});
    
    maxwell's avatar
    maxwell a validé
    
    	
    	$('.comment_set').each(function(index) {
    	    if($(this).children().length > 1) {
    			$(this).parent().show();
    			var show_comments_toggle = $(this).parent().prev().children(".show_post_comments");
    			show_comments_toggle.html("hide comments ("+ ($(this).children().length - 1) + ")");
    		};
    
    danielvincent's avatar
    danielvincent a validé
      });
    
    maxwell's avatar
    maxwell a validé
    
    
    maxwell's avatar
    maxwell a validé
    	$('#debug_info').click(function() {
    		$('#debug_more').toggle('fast', function() {
    			
    		});
    	});
    	
    
    maxwell's avatar
    maxwell a validé
    	
    
      $('#flash_notice, #flash_error, #flash_alert').delay(1500).slideUp(130);
    
    Raphael's avatar
    Raphael a validé
      $("#stream li").live('mouseover',function() {
    
        $(this).children(".destroy_link").fadeIn(0);
      });
    
    
    Raphael's avatar
    Raphael a validé
      $("#stream li").live('mouseout',function() {
        $(this).children(".destroy_link").fadeOut(0);
      });
    
      $(".show_post_comments").live('click', function(event) {
        event.preventDefault();
    
    maxwell's avatar
    maxwell a validé
        if( $(this).hasClass( "visible")) {
    
          $(this).html($(this).html().replace("hide", "show"));
          $(this).parents("li").children(".comments").fadeOut(100);
        } else {
          $(this).html($(this).html().replace("show", "hide"));
          $(this).parents("li").children(".comments").fadeIn(100);
        }
        $(this).toggleClass( "visible" );
      });
    
    
    maxwell's avatar
    maxwell a validé
    //Called with $(selector).clearForm()
    	$.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;
    
    Raphael's avatar
    Raphael a validé
    		$(this).blur();
        });
    
    
    maxwell's avatar
    maxwell a validé
    	};
    
    
      $("div.image_cycle").cycle({
        fx: 'fade',
        random: 1,
        timeout: 2000,
        speed: 3000
      });
    
    
    
      $("#add_album_button").fancybox();
      $("#add_group_button").fancybox();
      $("#add_request_button").fancybox();
    
    
      pane_toggler_button("photo");
    
      $("input[type='submit']").addClass("button");
    
    
    ilya's avatar
    ilya a validé
      $(".image_thumb img").load( function() {
        $(this).fadeIn("slow");
      });
    
    
    ilya's avatar
    ilya a validé
      $(".image_cycle img").load( function() {
        $(this).fadeIn("slow");
      });
    
    
    danielvincent's avatar
    danielvincent a validé
      $(".delete").hover(function(){
        $(this).toggleClass("button");
      });
    
    });//end document ready
    
        $("#add_" + name + "_button").toggle(
        function(evt){
          evt.preventDefault();
          $("#add_" + name + "_pane").fadeIn(300);
        },function(evt){
          evt.preventDefault();
          $("#add_" + name +"_pane").fadeOut(200);
        }
      );
    }