/** * Invision Community * (c) Invision Power Services, Inc. - https://www.invisioncommunity.com * * ips.forum.forumPage.js - Forum page controller * * Author: Rikki Tissier */ ;( function($, _, undefined){ "use strict"; ips.controller.register('forums.front.forum.forumPage', { initialize: function () { this.on( 'click', '[data-action="markForumRead"]', this.markForumRead ); }, /** * Marks all topics in a forum table as read, triggering an event on the table * * @param {event} e Event object * @returns {void} */ markForumRead: function (e) { e.preventDefault(); var self = this; ips.ui.alert.show( { type: 'confirm', icon: 'question', message: ips.getString('markForumAsReadConfirm'), subText: '', callbacks: { ok: function () { var url = $( e.currentTarget ).attr('href'); ips.getAjax()( url, { showLoading: true, bypassRedirect: true }) .done( function () { // Trigger event on the table to hide unread markets self.triggerOn( 'core.global.core.table', 'markTableRead' ); // Hide the link we've just clicked ips.utils.anim.go( 'fadeOut', $( e.currentTarget ) ); ips.ui.flashMsg.show( ips.getString('forumMarkedRead') ); }) .fail( function (jqXHR, textStatus, errorThrown) { window.location = url; }); } } }); } }); }(jQuery, _)); /** * Invision Community * (c) Invision Power Services, Inc. - https://www.invisioncommunity.com * * ips.forum.hovercard.js - Topic hovercard in forum view * * Author: Rikki Tissier */ ;( function($, _, undefined){ "use strict"; ips.controller.register('forums.front.forum.hovercard', { initialize: function () { this.on( 'click', '[data-action="markTopicRead"]', this.markTopicRead ); }, /** * Marks a topic read from inside a hovercard * * @param {event} e Event object * @returns {void} */ markTopicRead: function (e) { e.preventDefault(); // Ignore if we've already done this if( $( e.currentTarget ).attr('data-disabled') ){ return; } // Trigger event for table to mark the row this.trigger( 'markTableRowRead', { tableID: 'topics', rowID: this.scope.attr('data-topicID') }); // Let the user know ips.ui.flashMsg.show( ips.getString('topicMarkedRead') ); // And do the actual request ips.getAjax()( $( e.currentTarget ).attr('href'), { bypassRedirect: true }); // Hide the link $( e.currentTarget ).addClass('ipsFaded').attr('data-disabled'); } }); }(jQuery, _)); /** * Invision Community * (c) Invision Power Services, Inc. - https://www.invisioncommunity.com * * ips.topic.reply.js - Topic reply controller for "Reply" button * * Author: Rikki Tissier */ ;( function($, _, undefined){ "use strict"; ips.controller.register('forums.front.topic.reply', { initialize: function () { this.on( 'click', '[data-action="replyToTopic"]', this.replyToTopic ); }, /** * Handles a click on the reply to topic button. Triggers an event caught by the main topic view controller. * * @param {event} e Event object * @returns {void} */ replyToTopic: function (e) { e.preventDefault(); $( document ).trigger( 'replyToTopic' ); } }); }(jQuery, _)); /** * Invision Community * (c) Invision Power Services, Inc. - https://www.invisioncommunity.com * * ips.topic.view.js - Topic view controller * * Author: Rikki Tissier */ ;( function($, _, undefined){ "use strict"; ips.controller.register('forums.front.topic.view', { initialize: function () { $( document ).on( 'replyToTopic', _.bind( this.replyToTopic, this ) ); }, /** * Triggers the initialize event on the editor * * @param {event} e Event object * @returns {void} */ replyToTopic: function (e) { var editorID = this.scope.find('[data-role="replyArea"] [data-role="contentEditor"]').attr('name'); if( editorID ){ this.trigger('initializeEditor', { editorID: editorID } ); } } }); }(jQuery, _)); templates common/ips.loader.js common/ui common/utils common controllers underscore jquery mustache jstz Debug.js app.js jquery.js jquery.history.js jquery.transform.js linkify.min.js linkify-jquery.min.js