-
Notifications
You must be signed in to change notification settings - Fork 1
/
initialize.js
46 lines (43 loc) · 972 Bytes
/
initialize.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//blog config
if (Meteor.isServer) {
Blog.config({
adminRole: 'blogAdmin',
authorRole: 'blogAuthor',
rss: {
title: 'Meteor中文實戰手冊',
description: '一個介紹meteor framework技術、介紹與實作的Blog'
}
});
}
else {
Blog.config({
syntaxHighlighting: true,
pageSize: 30,
comments: {
useSideComments: true,
allowAnonymous: true
}
});
//auto disconnect
var AutoDisconnect = _.debounce(
function() {
Meteor.disconnect();
},
60000
);
Meteor.startup(function() {
$('body').on('mouseover', function() {
if (Meteor.status().status === 'connected') {
AutoDisconnect();
}
else if (Meteor.status().status === 'offline') {
Meteor.reconnect();
}
});
Deps.autorun(function() {
if (Meteor.status().status === 'connected') {
AutoDisconnect();
}
});
});
}