Proyectos de Subversion Moodle

Rev

Autoría | Ultima modificación | Ver Log |

/**
 * This module is the highest level module for the calendar. It is
 * responsible for initialising all of the components required for
 * the calendar to run. It also coordinates the interaction between
 * components by listening for and responding to different events
 * triggered within the calendar UI.
 *
 * @module     mod_forum/posts_list
 * @copyright  2019 Peter Dias
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
define("mod_forum/posts_list",["jquery","core/templates","core/notification","core/pending","mod_forum/selectors","mod_forum/inpage_reply","core_form/changechecker"],(function($,Templates,Notification,Pending,Selectors,InPageReply,FormChangeChecker){return{init:function(root,throttlingwarningmsg){!function(root,throttlingwarningmsg){root.on("click",Selectors.post.inpageReplyLink,(function(e){if(e.preventDefault(),window.location.hash){var url=window.location.href.split("#")[0];history.pushState({},document.title,url)}var pending=new Pending("inpage-reply"),currentTarget=$(e.currentTarget).parents(Selectors.post.forumCoreContent),currentSubject=currentTarget.find(Selectors.post.forumSubject),currentRoot=$(e.currentTarget).parents(Selectors.post.forumContent),context={postid:$(currentRoot).data("post-id"),reply_url:$(e.currentTarget).attr("href"),sesskey:M.cfg.sesskey,parentsubject:currentSubject.data("replySubject"),canreplyprivately:$(e.currentTarget).data("can-reply-privately"),postformat:InPageReply.CONTENT_FORMATS.MOODLE,throttlingwarningmsg:throttlingwarningmsg};if(currentRoot.find(Selectors.post.inpageReplyContent).length){var form=currentRoot.find(Selectors.post.inpageReplyContent);form.slideToggle(300,pending.resolve),form.is(":visible")&&form.find("textarea").focus()}else Templates.render("mod_forum/inpage_reply",context).then((function(html,js){return Templates.appendNodeContents(currentTarget,html,js)})).then((function(){return currentRoot.find(Selectors.post.inpageReplyContent).slideToggle(300,pending.resolve).find("textarea").focus()})).then((function(){FormChangeChecker.watchFormById("inpage-reply-".concat(context.postid))})).catch(Notification.exception)}))}(root,throttlingwarningmsg),InPageReply.init(root)}}}));

//# sourceMappingURL=posts_list.min.js.map