/**
* 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.activity.js - Topic activity controller
*
* Author: Rikki Tissier
*/
;( function($, _, undefined){
"use strict";
ips.controller.register('forums.front.topic.activity', {
initialize: function () {
this.on('click', '[data-action="toggleOverview"]', this.toggleOverview );
},
toggleOverview: function (e) {
e.preventDefault();
if( this.scope.hasClass('cTopicOverview--expanded') ){
this.scope.find('[data-role="preview"]').removeClass('ipsHide');
this.scope.find('[data-role="overview"]').addClass('ipsHide');
this.scope.removeClass('cTopicOverview--expanded');
} else {
this.scope.find('[data-role="preview"]').addClass('ipsHide');
this.scope.find('[data-role="overview"]').removeClass('ipsHide');
this.scope.addClass('cTopicOverview--expanded');
}
}
});
}(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) {
$( 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 ) );
this.on( 'click', '[data-action="showMoreActivity"]', this.showActivity );
this.on( 'click', '[data-action="closeMoreActivity"]', this.hideActivity );
},
/**
* Opens up the activity box when placed under the first post
*
* @param {event} e Event object
* @returns {void}
*/
showActivity: function (e) {
e.preventDefault();
this.scope.find('[data-role="moreActivity"]').show();
this.scope.find('[data-action="showMoreActivity"]').hide();
this.scope.find('[data-action="closeMoreActivity"]').show();
},
/**
* Closes the activity box when placed under the first post
*
* @param {event} e Event object
* @returns {void}
*/
hideActivity: function (e) {
e.preventDefault();
this.scope.find('[data-role="moreActivity"]').hide();
this.scope.find('[data-action="showMoreActivity"]').show();
this.scope.find('[data-action="closeMoreActivity"]').hide();
},
/**
* Triggers the initialize event on the editor
*
* @param {event} e Event object
* @returns {void}
*/
replyToTopic: function (e) {
ips.ui.editor.getObjWithInit( this.scope.find('[data-role="replyArea"] [data-ipsEditor]'), function(editor){
editor.unminimize(function(){
editor.focus();
});
} );
}
});
}(jQuery, _));
templates
common/ips.loader.js
common/ui
common/utils
common
controllers
underscore
jquery
mustache
jstz
IntersectionObserver
Debug.js
app.js
jquery.js
jquery-migrate.js
jquery.history.js
jquery.transform.js
linkify.min.js
linkify-jquery.min.js