{style} {literal} .ow_forum_attachment_icon { display: inline-block; background-repeat: no-repeat; cursor: pointer; width: 14px; height: 17px; } .forum_attachments_label { margin: 15px 0 5px; padding-left: 5px; font-weight: bold; } .forum_add_post .jhtmlarea { margin: 0px auto; } .post_content img { max-width: 100%; } .post_content { overflow: hidden; } {/literal} {/style} {script} {literal} $('#toggle_attach_link').click(function(){ $('#attach_file_inputs').toggle(); }); $('#toggle_attach_edit_link').click(function(){ $('#attach_edit_file_inputs').toggle(); }); $(".ow_forum_attachment").hover( function(){ $(this).find("a.forum_delete_attachment").show(); }, function(){ $(this).find("a.forum_delete_attachment").hide(); } ); $("a.forum_delete_attachment").each(function(){ var container_handler = $(this).parent(); $(this).click(function(){ if ( confirm(OW.getLanguageText('forum', 'confirm_delete_attachment')) ) { var attachment_id = $(this).attr("rel"); var params = {}; var url = '{/literal}{url_for_route for='forum_delete_attachment'}{literal}'; params['attachmentId'] = attachment_id; $.ajaxSetup({dataType: 'json'}); $.post(url, params, function(data){ if ( data.result == true ) { OW.info(data.msg); container_handler.remove(); } else if (data.error != undefined) { OW.warning(data.error); } }); } else { return false; } }); }); {/literal} {/script} {if $isHidden}