commit
e5ca5b88fa
@ -1,6 +0,0 @@ |
||||
Template.roomNotFound.helpers |
||||
data: -> |
||||
return Session.get 'roomNotFound' |
||||
|
||||
name: -> |
||||
return Blaze._escape(this.name) |
||||
@ -0,0 +1,8 @@ |
||||
Template.roomNotFound.helpers({ |
||||
data() { |
||||
return Session.get('roomNotFound'); |
||||
}, |
||||
name() { |
||||
return Blaze._escape(this.name); |
||||
} |
||||
}); |
||||
@ -1,5 +0,0 @@ |
||||
Template.burger.helpers |
||||
unread: -> |
||||
return Session.get 'unread' |
||||
isMenuOpen: -> |
||||
if Session.equals('isMenuOpen', true) then 'menu-opened' |
||||
@ -0,0 +1,10 @@ |
||||
Template.burger.helpers({ |
||||
unread() { |
||||
return Session.get('unread'); |
||||
}, |
||||
isMenuOpen() { |
||||
if (Session.equals('isMenuOpen', true)) { |
||||
return 'menu-opened'; |
||||
} |
||||
} |
||||
}); |
||||
@ -1,5 +0,0 @@ |
||||
Template.home.helpers |
||||
title: -> |
||||
return RocketChat.settings.get 'Layout_Home_Title' |
||||
body: -> |
||||
return RocketChat.settings.get 'Layout_Home_Body' |
||||
@ -0,0 +1,8 @@ |
||||
Template.home.helpers({ |
||||
title() { |
||||
return RocketChat.settings.get('Layout_Home_Title'); |
||||
}, |
||||
body() { |
||||
return RocketChat.settings.get('Layout_Home_Body'); |
||||
} |
||||
}); |
||||
@ -1,10 +0,0 @@ |
||||
Template.roomSearch.helpers |
||||
roomIcon: -> |
||||
return 'icon-at' if this.type is 'u' |
||||
|
||||
if this.type is 'r' |
||||
return RocketChat.roomTypes.getIcon this.t |
||||
|
||||
userStatus: -> |
||||
if this.type is 'u' |
||||
return 'status-' + this.status |
||||
@ -0,0 +1,15 @@ |
||||
Template.roomSearch.helpers({ |
||||
roomIcon() { |
||||
if (this.type === 'u') { |
||||
return 'icon-at'; |
||||
} |
||||
if (this.type === 'r') { |
||||
return RocketChat.roomTypes.getIcon(this.t); |
||||
} |
||||
}, |
||||
userStatus() { |
||||
if (this.type === 'u') { |
||||
return `status-${ this.status }`; |
||||
} |
||||
} |
||||
}); |
||||
@ -1,23 +0,0 @@ |
||||
Template.secretURL.helpers |
||||
registrationAllowed: -> |
||||
return RocketChat.settings.get('Accounts_RegistrationForm') is 'Secret URL' and Template.instance().hashIsValid?.get() |
||||
|
||||
ready: -> |
||||
return Template.instance().subscriptionsReady?() and Template.instance().hashReady?.get() |
||||
|
||||
|
||||
Template.secretURL.onCreated -> |
||||
@hashIsValid = new ReactiveVar false |
||||
@hashReady = new ReactiveVar false |
||||
|
||||
Meteor.call 'checkRegistrationSecretURL', FlowRouter.getParam('hash'), (err, success) => |
||||
@hashReady.set true |
||||
if success |
||||
Session.set 'loginDefaultState', 'register' |
||||
KonchatNotification.getDesktopPermission() |
||||
@hashIsValid.set true |
||||
else |
||||
@hashIsValid.set false |
||||
|
||||
Template.secretURL.onRendered -> |
||||
$('#initial-page-loading').remove() |
||||
@ -0,0 +1,29 @@ |
||||
/* globals KonchatNotification */ |
||||
Template.secretURL.helpers({ |
||||
registrationAllowed() { |
||||
const {hashIsValid} = Template.instance(); |
||||
return RocketChat.settings.get('Accounts_RegistrationForm') === 'Secret URL' && hashIsValid && hashIsValid.get(); |
||||
}, |
||||
ready() { |
||||
const {subscriptionsReady, hashReady} = Template.instance(); |
||||
return typeof subscriptionsReady === 'function' && subscriptionsReady() && hashReady && hashReady.get(); |
||||
} |
||||
}); |
||||
|
||||
Template.secretURL.onCreated(function() { |
||||
this.hashIsValid = new ReactiveVar(false); |
||||
this.hashReady = new ReactiveVar(false); |
||||
Meteor.call('checkRegistrationSecretURL', FlowRouter.getParam('hash'), (err, success) => { |
||||
this.hashReady.set(true); |
||||
if (success) { |
||||
Session.set('loginDefaultState', 'register'); |
||||
KonchatNotification.getDesktopPermission(); |
||||
return this.hashIsValid.set(true); |
||||
} |
||||
return this.hashIsValid.set(false); |
||||
}); |
||||
}); |
||||
|
||||
Template.secretURL.onRendered(function() { |
||||
return $('#initial-page-loading').remove(); |
||||
}); |
||||
@ -1,16 +0,0 @@ |
||||
Template.cmsPage.onCreated -> |
||||
@page = new ReactiveVar '' |
||||
Meteor.autorun => |
||||
if Session.get('cmsPage')? |
||||
@page.set RocketChat.settings.get Session.get('cmsPage') |
||||
|
||||
Template.cmsPage.helpers |
||||
page: -> |
||||
return Template.instance().page.get() |
||||
|
||||
Template.cmsPage.events |
||||
'click .cms-page-close': -> |
||||
FlowRouter.go('/') |
||||
|
||||
Template.cmsPage.onRendered -> |
||||
$('#initial-page-loading').remove() |
||||
@ -0,0 +1,25 @@ |
||||
Template.cmsPage.onCreated(function() { |
||||
this.page = new ReactiveVar(''); |
||||
return Meteor.autorun(() => { |
||||
const cmsPage = Session.get('cmsPage'); |
||||
if (cmsPage != null) { |
||||
return this.page.set(RocketChat.settings.get(cmsPage)); |
||||
} |
||||
}); |
||||
}); |
||||
|
||||
Template.cmsPage.helpers({ |
||||
page() { |
||||
return Template.instance().page.get(); |
||||
} |
||||
}); |
||||
|
||||
Template.cmsPage.events({ |
||||
'click .cms-page-close'() { |
||||
return FlowRouter.go('/'); |
||||
} |
||||
}); |
||||
|
||||
Template.cmsPage.onRendered(function() { |
||||
return $('#initial-page-loading').remove(); |
||||
}); |
||||
@ -1,20 +0,0 @@ |
||||
Template.fxOsInstallPrompt.onRendered -> |
||||
showPrompt = () -> |
||||
request = window.navigator.mozApps.install 'http://' + location.host + '/manifest.webapp' |
||||
request.onsuccess = () -> |
||||
# Save the App object that is returned |
||||
appRecord = this.result |
||||
BlazeLayout.render 'fxOsInstallDone' |
||||
|
||||
request.onerror = () -> |
||||
# Display the error information from the DOMError object |
||||
BlazeLayout.render 'fxOsInstallError', {installError: this.error.name} |
||||
|
||||
setTimeout(showPrompt, 2000); |
||||
$('#initial-page-loading').remove() |
||||
|
||||
Template.fxOsInstallDone.onRendered -> |
||||
$('#initial-page-loading').remove() |
||||
|
||||
Template.fxOsInstallError.onRendered -> |
||||
$('#initial-page-loading').remove() |
||||
@ -0,0 +1,19 @@ |
||||
Template.fxOsInstallPrompt.onRendered(function() { |
||||
|
||||
const showPrompt = function() { |
||||
const request = window.navigator.mozApps.install(`http://${ location.host }/manifest.webapp`); |
||||
request.onsuccess = function() { |
||||
BlazeLayout.render('fxOsInstallDone'); |
||||
}; |
||||
request.onerror = function() { |
||||
BlazeLayout.render('fxOsInstallError', { |
||||
installError: this.error.name |
||||
}); |
||||
}; |
||||
}; |
||||
setTimeout(showPrompt, 2000); |
||||
return $('#initial-page-loading').remove(); |
||||
}); |
||||
|
||||
Template.fxOsInstallDone.onRendered(() => $('#initial-page-loading').remove()); |
||||
Template.fxOsInstallError.onRendered(() => $('#initial-page-loading').remove()); |
||||
@ -1 +0,0 @@ |
||||
Template.modal.rendered = -> |
||||
@ -0,0 +1 @@ |
||||
Template.modal.rendered = function() {}; |
||||
Loading…
Reference in new issue