mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-30 18:46:01 +01:00 
			
		
		
		
	fix: convert some hooks to use hooks module
re: julianlam/nodebb-plugin-markdown#130
This commit is contained in:
		| @@ -1,7 +1,7 @@ | ||||
| 'use strict'; | ||||
|  | ||||
|  | ||||
| define('forum/account/posts', ['forum/account/header', 'forum/infinitescroll'], function (header, infinitescroll) { | ||||
| define('forum/account/posts', ['forum/account/header', 'forum/infinitescroll', 'hooks'], function (header, infinitescroll, hooks) { | ||||
| 	var AccountPosts = {}; | ||||
|  | ||||
| 	var template; | ||||
| @@ -47,7 +47,7 @@ define('forum/account/posts', ['forum/account/header', 'forum/infinitescroll'], | ||||
| 			html.find('.timeago').timeago(); | ||||
| 			app.createUserTooltips(); | ||||
| 			utils.makeNumbersHumanReadable(html.find('.human-readable-number')); | ||||
| 			$(window).trigger('action:posts.loaded', { posts: posts }); | ||||
| 			hooks.fire('action:posts.loaded', { posts: posts }); | ||||
| 			callback(); | ||||
| 		}); | ||||
| 	} | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| 'use strict'; | ||||
|  | ||||
|  | ||||
| define('forum/categories', ['components', 'categorySelector'], function (components, categorySelector) { | ||||
| define('forum/categories', ['components', 'categorySelector', 'hooks'], function (components, categorySelector, hooks) { | ||||
| 	var	categories = {}; | ||||
|  | ||||
| 	$(window).on('action:ajaxify.start', function (ev, data) { | ||||
| @@ -63,7 +63,7 @@ define('forum/categories', ['components', 'categorySelector'], function (compone | ||||
| 				recentPosts.last().remove(); | ||||
| 			} | ||||
|  | ||||
| 			$(window).trigger('action:posts.loaded', { posts: [post] }); | ||||
| 			hooks.fire('action:posts.loaded', { posts: [post] }); | ||||
| 		}); | ||||
| 	} | ||||
|  | ||||
|   | ||||
| @@ -12,7 +12,12 @@ define('forum/topic', [ | ||||
| 	'sort', | ||||
| 	'components', | ||||
| 	'storage', | ||||
| ], function (infinitescroll, threadTools, postTools, events, posts, images, navigator, sort, components, storage) { | ||||
| 	'hooks', | ||||
| ], function ( | ||||
| 	infinitescroll, threadTools, postTools, | ||||
| 	events, posts, images, navigator, sort, | ||||
| 	components, storage, hooks | ||||
| ) { | ||||
| 	var	Topic = {}; | ||||
| 	var currentUrl = ''; | ||||
|  | ||||
| @@ -70,7 +75,7 @@ define('forum/topic', [ | ||||
|  | ||||
| 		handleTopicSearch(); | ||||
|  | ||||
| 		$(window).trigger('action:topic.loaded', ajaxify.data); | ||||
| 		hooks.fire('action:topic.loaded', ajaxify.data); | ||||
| 	}; | ||||
|  | ||||
| 	function handleTopicSearch() { | ||||
|   | ||||
| @@ -9,7 +9,8 @@ define('forum/topic/posts', [ | ||||
| 	'navigator', | ||||
| 	'components', | ||||
| 	'translator', | ||||
| ], function (pagination, infinitescroll, postTools, images, navigator, components, translator) { | ||||
| 	'hooks', | ||||
| ], function (pagination, infinitescroll, postTools, images, navigator, components, translator, hooks) { | ||||
| 	var Posts = { }; | ||||
|  | ||||
| 	Posts.onNewPost = function (data) { | ||||
| @@ -226,7 +227,7 @@ define('forum/topic/posts', [ | ||||
|  | ||||
| 			infinitescroll.removeExtra($('[component="post"]'), direction, Math.max(20, config.postsPerPage * 2)); | ||||
|  | ||||
| 			$(window).trigger('action:posts.loaded', { posts: data.posts }); | ||||
| 			hooks.fire('action:posts.loaded', { posts: data.posts }); | ||||
|  | ||||
| 			Posts.onNewPostsAddedToDom(html); | ||||
|  | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| 'use strict'; | ||||
|  | ||||
|  | ||||
| define('forum/topic/replies', ['navigator', 'components', 'forum/topic/posts'], function (navigator, components, posts) { | ||||
| define('forum/topic/replies', ['navigator', 'components', 'forum/topic/posts', 'hooks'], function (navigator, components, posts, hooks) { | ||||
| 	var Replies = {}; | ||||
|  | ||||
| 	Replies.init = function (button) { | ||||
| @@ -43,7 +43,7 @@ define('forum/topic/replies', ['navigator', 'components', 'forum/topic/posts'], | ||||
|  | ||||
| 					repliesEl.slideDown('fast'); | ||||
| 					posts.onNewPostsAddedToDom(html); | ||||
| 					$(window).trigger('action:posts.loaded', { posts: data }); | ||||
| 					hooks.fire('action:posts.loaded', { posts: data }); | ||||
| 				}); | ||||
| 			}); | ||||
| 		} else if (close.is(':not(.hidden)')) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user