/**
* IPS Community Suite 4
* (c) 2013 Invision Power Services - http://www.invisionpower.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();
// Trigger event on the table to hide unread markets
this.triggerOn( 'core.global.core.table', 'markTableRead' );
// Hide the link we've just clicked
ips.utils.anim.go( 'fadeOut', $( e.currentTarget ) );
// Do request to do the marking
ips.getAjax()( $( e.currentTarget ).attr('href'), {
bypassRedirect: true
} )
.done( function () {
ips.ui.flashMsg.show( ips.getString('forumMarkedRead') );
});
}
});
}(jQuery, _));
/**
* IPS Community Suite 4
* (c) 2013 Invision Power Services - http://www.invisionpower.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, _));
/**
* IPS Community Suite 4
* (c) 2013 Invision Power Services - http://www.invisionpower.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, _));
/**
* IPS Community Suite 4
* (c) 2013 Invision Power Services - http://www.invisionpower.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