
/* Merged Plone Javascript file
 * This file is dynamically assembled from separate parts.
 * Some of these parts have 3rd party licenses or copyright information attached
 * Such information is valid for that section,
 * not for the entire composite file
 * originating files are separated by - filename.js -
 */

/* - ++resource++ordersupportui.js - */
// http://www.ospfe.it/portal_javascripts/++resource++ordersupportui.js?original=1
jQuery.alternative_orderui={messages:{en:"Fill the new position for the content thats now is at position ",it:"Inserisci la nuova posizione per l'elemento alla posizione "}};jq(document).ready(function(){var js_baseurl=jq("head base").attr('href');var lang=jq("html").attr('lang')||'en';var querystring=window.location.search;var qspos=querystring.indexOf("pagenumber");var qsn='';var pageNumber=1;if(qspos>-1){pageNumber=parseInt(querystring.substr(qspos+11,qspos+12),10);qsn="&pagenumber="+pageNumber}
var previous=jq("#folderlisting-main-table .previous a").text();var pageSize=20;if(previous){var pageSizeRegExp=/\d+/;pageSize=parseInt(previous.match(pageSizeRegExp),10)}
jq("#listing-table tbody tr").each(function(i){var index=0;if(pageNumber>1){index=i+(pageNumber-1) * pageSize}
else{index=i}
var row=jq(this);row.find("td.notDraggable input:first").after('&nbsp;<span class="discreet order-index">'+(index+1)+'</span>');var controlCell=row.find("td.draggable",row);var elId=row.children("td.notDraggable").find(":checkbox").attr("id").replace("cb_","");var title=jq.trim(row.children("td.notDraggable").next(":first").find("a").text());controlCell.empty().append('&nbsp;<a href="javascript:;" class="reorder-cmd">'+'<img alt="" src="++resource++move_16x16.gif" />'+'</a>');jq(".reorder-cmd",controlCell).click(function(event){var choosen=prompt(jq.alternative_orderui.messages[lang]+(index+1)+" ("+title+")","");if(choosen!==null){var v=parseInt(choosen,10)-1;var upOrDown=(v<index?'up':'down');var delta=(v<index?-(v-index):(v-index));var show_all="";if(querystring.indexOf("show_all=true")>-1){show_all="&show_all=true"}
window.location.href=js_baseurl+"folder_position?position="+upOrDown+"&amp;id="+elId+"&delta="+delta+show_all+qsn}})})});if(window.kukit&&window.kukit.actionsGlobalRegistry&&window.kukit.actionsGlobalRegistry.content){kukit.actionsGlobalRegistry.content['plone-initDragAndDrop']=function(){}}


/* - ++resource++plone.app.discussion.javascripts/comments.js - */
// http://www.ospfe.it/portal_javascripts/++resource++plone.app.discussion.javascripts/comments.js?original=1
(function($){$.createReplyForm=function(comment_div){var comment_id=comment_div.attr("id");var reply_button=comment_div.find(".reply-to-comment-button");var reply_div=$("#commenting").clone(true);reply_div.find("#formfield-form-widgets-captcha").find("script").remove();reply_div.appendTo(comment_div).css("display","none");reply_div.removeAttr("id");$(reply_button).css("display","none");var reply_form=reply_div.find("form");reply_form.find("input[name='form.widgets.in_reply_to']").val(comment_id);var cancel_reply_button=reply_div.find(".cancelreplytocomment");cancel_reply_button.attr("id",comment_id);reply_form.find("input[name='form.buttons.cancel']").css("display","inline");reply_div.slideDown("slow");cancel_reply_button.css("display","inline")};$.clearForm=function(form_div){form_div.find(".error").removeClass("error");form_div.find(".fieldErrorBox").remove();form_div.find("input[type='text']").attr("value","");form_div.find("textarea").attr("value","")};$(window).load(function(){var post_comment_div=$("#commenting");var in_reply_to_field=post_comment_div.find("input[name='form.widgets.in_reply_to']");if(in_reply_to_field.val()!==""){var current_reply_id="#"+in_reply_to_field.val();var current_reply_to_div=$(".discussion").find(current_reply_id);$.createReplyForm(current_reply_to_div);$.clearForm(post_comment_div)}
$(".reply-to-comment-button").bind("click", function(e){var comment_div=$(this).parents().filter(".comment");$.createReplyForm(comment_div);$.clearForm(comment_div)});$("#commenting #form-buttons-cancel").bind("click", function(e){e.preventDefault();var reply_to_comment_button=$(this).
parents().
filter(".comment").
find(".reply-to-comment-button");$.reply_to_comment_form=$(this).parents().filter(".reply");$.reply_to_comment_form.slideUp("slow", function(){$(this).remove()});reply_to_comment_button.css("display","inline")});$("input[name='form.button.PublishComment']").live('click', function(){var trigger=this;var form=$(this).parents("form");var data=$(form).serialize();var form_url=$(form).attr("action");$.ajax({type:"GET",url:form_url,data:"workflow_action=publish",context:trigger,success: function(msg){form.find("input[name='form.button.PublishComment']").remove();form.parents(".state-pending").toggleClass('state-pending').toggleClass('state-published')},error: function(msg){return true}});return false});$(".reply").find("input[name='form.buttons.reply']").css("display","none");$(".reply").find("input[name='form.buttons.cancel']").css("display","none");$(".reply-to-comment-button").css("display","inline")})}(jQuery));

