<commit_before><% menu :posts %>
<% atom_link_header(space, Post.new) %>

<% content_for :headers do  -%>
  <%= javascript_include_tag 'jquery.filestyle' %>
<% end -%>

<% content_for :javascript do %>

/*
 *  Expand and collapse thread
 */
  extend_thread = function(id){
	  $("#parent_" + id + " .extended_thread").show();
		$("#parent_" + id + " .extend_thread").hide();
		$("#parent_" + id + " .collapse_thread").show();
		
	}
	
	collapse_thread = function(id){
    $("#parent_" + id + " .extended_thread").hide();
		$("#parent_" + id + " .extend_thread").show();
    $("#parent_" + id + " .collapse_thread").hide();
	
  }  

/*
 *  New thread panel
 */

/* Submit without ajax until it will be posible to render message errors when a post with attachment fail*/
/*$("#thread-form").postsForm('<%= space_posts_url(@space) %>');*/

$(".new_thread_options").click(function(){
  $(".new_thread_options").removeClass("selected");
  $(this).addClass("selected");
});

style_file_input();

/*
 *  Reply panel
 */

$("#new_comment_link").livequery('click',function () { 
  $("#new_photo_form").hide();
	return false;
});

$("#new_photo_link").livequery('click',function () {
  $("#new_photo_form").show(); 
	return false;
});

$("#new_doc_link").livequery('click',function () {
  $("#new_photo_form").show();
	return false;
});

/*
 *  Replace with Ajax links
 */

$("a.reply_to_link").click(function(){
  var route = "<%= space_posts_path(@space) %>" + "/" + $(this).attr("name");
  $.get(route,
      {authenticity_token: "<%=form_authenticity_token()%>"},
      function(data){
        $("#sidebar").children("div:last").replaceWith(data);
				
				/* Reply panel javascript*/
				/*$("#reply-form").postsForm('<%= space_posts_url(@space) %>');*/
				
        $(".new_reply_options").click(function(){
        $(".new_reply_options").removeClass("selected");
        $(this).addClass("selected");});
				style_file_input();
				var destination = $('#add').offset().top;
				$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, 1100, function() {
					window.location.hash = '#add'
				});
				setTimeout(function() {
			           $("#new_reply").effect("highlight", {color:"#F5DF51"}, 3000);
				}, 1000);
				
				$("a#big_new_reply").fancybox({
          'hideOnContentClick' : false,
					'callbackOnShow' : function(){
			      $(".big_post_text").val($(".small_post_text").val());
			      big_textarea();
			      $("#fancy_outer").width($("#new_thread_big").width() + 50);
				  $("#fancy_outer").height($("#new_thread_big").height() + 80);
			      $(window).resize();
			    },
			    'callbackOnClose' : function(){
          var oEditor = FCKeditorAPI.GetInstance('post[text]') ;
          var data = oEditor.GetHTML();
          $(".small_post_text").val(data);
        }
        });
      }
    );
	return false;
});

$("a.edit_post_link").click(function(){
  var route = "<%= space_posts_path(@space) %>" + "/" + $(this).attr("name") + "?edit=true";
  $.get(route,
      {authenticity_token: "<%=form_authenticity_token()%>"},
      function(data){
        $("#sidebar").children("div:last").replaceWith(data);
				
				 /*Edit thread*/
				 /*$("#edit-form").postsForm('<%= space_posts_url(@space) %>');*/

         $(".edit_thread_options").click(function(){
         $(".edit_thread_options").removeClass("selected");
         $(this).addClass("selected");});
				 
		 /*Edit reply*/
		 $(".edit_reply_options").click(function(){
		 $(".edit_reply_options").removeClass("selected");
		 $(this).addClass("selected");});
		 
		 style_file_input();
		 
		 /*Scroll to the edit form*/
		 var destination = $('#add').offset().top;
		 $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, 1100, function() {
		 window.location.hash = '#add'
		 
		 /*Extract form fancbox*/ 
		 $("a#big_edit_thread").fancybox({
        'hideOnContentClick' : false,
        'callbackOnShow' : function(){
          $(".big_post_text").val($(".small_post_text").val());
          big_textarea();
          $("#fancy_outer").width($("#new_thread_big").width() + 50);
		  $("#fancy_outer").height($("#new_thread_big").height() + 80);
          $(window).resize();
        },
        'callbackOnClose' : function(){
				  var oEditor = FCKeditorAPI.GetInstance('post[text]') ;
          var data = oEditor.GetHTML();
          $(".small_post_text").val(data);
				}
		  });
	});
	
	setTimeout(function() {
	  $("#edit_reply").effect("highlight", {color:"#F5DF51"}, 3000);
		$("#edit_thread").effect("highlight", {color:"#F5DF51"}, 3000);
		}, 1000);	
	});
	
	return false;
});

	$("#query").click(function(){
	  if(this.value == "Search Posts..."){
		  this.value="";
		}
	});
	
	
	/*Extended post creation*/
	
	/*New thread*/
	
	  $("a#big_new_thread").fancybox({
    'hideOnContentClick' : false,
    'callbackOnShow' : function(){
      $(".big_post_title").val($(".small_post_title").val());
      $(".big_post_text").val($(".small_post_text").val());
      big_textarea();
      $("#fancy_outer").width($("#new_thread_big").width() + 50);
	  $("#fancy_outer").height($("#new_thread_big").height() + 80);
      $(window).resize();
    },
    'callbackOnClose' : function(){
      $(".small_post_title").val($(".big_post_title").val());
      /*close_lightbox();*/
			var oEditor = FCKeditorAPI.GetInstance('post[text]') ;
      var data = oEditor.GetHTML();
      $(".small_post_text").val(data);
    }    
  });

  $("a.new_thread_big_options").livequery("click", function(){
    var route = $(this).attr("href");
    var oEditor = FCKeditorAPI.GetInstance('post[text]') ;
    var data = oEditor.GetHTML();
    $.get(route,
          {authenticity_token: "<%=form_authenticity_token()%>",
           post_title: $(".big_post_title").val(),
           post_text: data
          },
          function(data){
            $("#fancy_ajax").children().remove();
			$("#fancy_ajax").append(data);
            big_textarea();
			$("#fancy_outer").height($("#new_thread_big").height() + 80);
            $(window).resize(); 
          }
        );
    return false;
  });
  
/*Reply*/

	$("#new_comment_big_link").livequery('click',function () {
	  $(".big_options").removeClass("selected");
    $(this).addClass("selected"); 
	  $("#new_photo_big_form").hide();
		$("#fancy_outer").height($("#new_thread_big").height() + 80);
		$(window).resize();
	  return false;
	});
	
	$("#new_photo_big_link").livequery('click',function () {
	  $(".big_options").removeClass("selected");
    $(this).addClass("selected");
		$("#new_photo_big_form").show();
		$("#fancy_outer").height($("#new_thread_big").height() + 80);
		$(window).resize();
	  return false;
	});
	
	$("#new_doc_big_link").livequery('click',function () {
	  $(".big_options").removeClass("selected");
    $(this).addClass("selected");
	  $("#new_photo_big_form").show();
		$("#fancy_outer").height($("#new_thread_big").height() + 80);
		$(window).resize();
	  return false;
	});


<commit_msg>with fckeditor again<commit_after><% menu :posts %>
<% atom_link_header(space, Post.new) %>

<% content_for :headers do  -%>
  <%= javascript_include_tag 'jquery.filestyle', 'fckeditor/fckeditor' %>
<% end -%>

<% content_for :javascript do %>

/*
 *  Expand and collapse thread
 */
  extend_thread = function(id){
	  $("#parent_" + id + " .extended_thread").show();
		$("#parent_" + id + " .extend_thread").hide();
		$("#parent_" + id + " .collapse_thread").show();
		
	}
	
	collapse_thread = function(id){
    $("#parent_" + id + " .extended_thread").hide();
		$("#parent_" + id + " .extend_thread").show();
    $("#parent_" + id + " .collapse_thread").hide();
	
  }  

/*
 *  New thread panel
 */

/* Submit without ajax until it will be posible to render message errors when a post with attachment fail*/
/*$("#thread-form").postsForm('<%= space_posts_url(@space) %>');*/

$(".new_thread_options").click(function(){
  $(".new_thread_options").removeClass("selected");
  $(this).addClass("selected");
});

style_file_input();

/*
 *  Reply panel
 */

$("#new_comment_link").livequery('click',function () { 
  $("#new_photo_form").hide();
	return false;
});

$("#new_photo_link").livequery('click',function () {
  $("#new_photo_form").show(); 
	return false;
});

$("#new_doc_link").livequery('click',function () {
  $("#new_photo_form").show();
	return false;
});

/*
 *  Replace with Ajax links
 */

$("a.reply_to_link").click(function(){
  var route = "<%= space_posts_path(@space) %>" + "/" + $(this).attr("name");
  $.get(route,
      {authenticity_token: "<%=form_authenticity_token()%>"},
      function(data){
        $("#sidebar").children("div:last").replaceWith(data);
				
				/* Reply panel javascript*/
				/*$("#reply-form").postsForm('<%= space_posts_url(@space) %>');*/
				
        $(".new_reply_options").click(function(){
        $(".new_reply_options").removeClass("selected");
        $(this).addClass("selected");});
				style_file_input();
				var destination = $('#add').offset().top;
				$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, 1100, function() {
					window.location.hash = '#add'
				});
				setTimeout(function() {
			           $("#new_reply").effect("highlight", {color:"#F5DF51"}, 3000);
				}, 1000);
				
				$("a#big_new_reply").fancybox({
          'hideOnContentClick' : false,
					'callbackOnShow' : function(){
			      $(".big_post_text").val($(".small_post_text").val());
			      big_textarea();
			      $("#fancy_outer").width($("#new_thread_big").width() + 50);
				  $("#fancy_outer").height($("#new_thread_big").height() + 80);
			      $(window).resize();
			    },
			    'callbackOnClose' : function(){
          var oEditor = FCKeditorAPI.GetInstance('post[text]') ;
          var data = oEditor.GetHTML();
          $(".small_post_text").val(data);
        }
        });
      }
    );
	return false;
});

$("a.edit_post_link").click(function(){
  var route = "<%= space_posts_path(@space) %>" + "/" + $(this).attr("name") + "?edit=true";
  $.get(route,
      {authenticity_token: "<%=form_authenticity_token()%>"},
      function(data){
        $("#sidebar").children("div:last").replaceWith(data);
				
				 /*Edit thread*/
				 /*$("#edit-form").postsForm('<%= space_posts_url(@space) %>');*/

         $(".edit_thread_options").click(function(){
         $(".edit_thread_options").removeClass("selected");
         $(this).addClass("selected");});
				 
		 /*Edit reply*/
		 $(".edit_reply_options").click(function(){
		 $(".edit_reply_options").removeClass("selected");
		 $(this).addClass("selected");});
		 
		 style_file_input();
		 
		 /*Scroll to the edit form*/
		 var destination = $('#add').offset().top;
		 $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, 1100, function() {
		 window.location.hash = '#add'
		 
		 /*Extract form fancbox*/ 
		 $("a#big_edit_thread").fancybox({
        'hideOnContentClick' : false,
        'callbackOnShow' : function(){
          $(".big_post_text").val($(".small_post_text").val());
          big_textarea();
          $("#fancy_outer").width($("#new_thread_big").width() + 50);
		  $("#fancy_outer").height($("#new_thread_big").height() + 80);
          $(window).resize();
        },
        'callbackOnClose' : function(){
				  var oEditor = FCKeditorAPI.GetInstance('post[text]') ;
          var data = oEditor.GetHTML();
          $(".small_post_text").val(data);
				}
		  });
	});
	
	setTimeout(function() {
	  $("#edit_reply").effect("highlight", {color:"#F5DF51"}, 3000);
		$("#edit_thread").effect("highlight", {color:"#F5DF51"}, 3000);
		}, 1000);	
	});
	
	return false;
});

	$("#query").click(function(){
	  if(this.value == "Search Posts..."){
		  this.value="";
		}
	});
	
	
	/*Extended post creation*/
	
	/*New thread*/
	
	  $("a#big_new_thread").fancybox({
    'hideOnContentClick' : false,
    'callbackOnShow' : function(){
      $(".big_post_title").val($(".small_post_title").val());
      $(".big_post_text").val($(".small_post_text").val());
      big_textarea();
      $("#fancy_outer").width($("#new_thread_big").width() + 50);
	  $("#fancy_outer").height($("#new_thread_big").height() + 80);
      $(window).resize();
    },
    'callbackOnClose' : function(){
      $(".small_post_title").val($(".big_post_title").val());
      /*close_lightbox();*/
			var oEditor = FCKeditorAPI.GetInstance('post[text]') ;
      var data = oEditor.GetHTML();
      $(".small_post_text").val(data);
    }    
  });

  $("a.new_thread_big_options").livequery("click", function(){
    var route = $(this).attr("href");
    var oEditor = FCKeditorAPI.GetInstance('post[text]') ;
    var data = oEditor.GetHTML();
    $.get(route,
          {authenticity_token: "<%=form_authenticity_token()%>",
           post_title: $(".big_post_title").val(),
           post_text: data
          },
          function(data){
            $("#fancy_ajax").children().remove();
			$("#fancy_ajax").append(data);
            big_textarea();
			$("#fancy_outer").height($("#new_thread_big").height() + 80);
            $(window).resize(); 
          }
        );
    return false;
  });
  
/*Reply*/

	$("#new_comment_big_link").livequery('click',function () {
	  $(".big_options").removeClass("selected");
    $(this).addClass("selected"); 
	  $("#new_photo_big_form").hide();
		$("#fancy_outer").height($("#new_thread_big").height() + 80);
		$(window).resize();
	  return false;
	});
	
	$("#new_photo_big_link").livequery('click',function () {
	  $(".big_options").removeClass("selected");
    $(this).addClass("selected");
		$("#new_photo_big_form").show();
		$("#fancy_outer").height($("#new_thread_big").height() + 80);
		$(window).resize();
	  return false;
	});
	
	$("#new_doc_big_link").livequery('click',function () {
	  $(".big_options").removeClass("selected");
    $(this).addClass("selected");
	  $("#new_photo_big_form").show();
		$("#fancy_outer").height($("#new_thread_big").height() + 80);
		$(window).resize();
	  return false;
	});

<%= render :partial => 'fckeditor_functions' %>

{'fraction_non_alphanumeric': 0.2343316497118873, 'fraction_numerical': 0.008109838514619052, 'mean_word_length': 3.5583657587548636, 'pattern_counts': {'":': 0, '<': 32, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5976720', 'n_tokens_mistral': 4998, 'n_tokens_neox': 4488, 'n_words': 614}