Applied style rules to genocide all \t characters

This commit is contained in:
Stefan Zermatten
2022-10-09 16:01:36 +02:00
parent de598c70a7
commit 2fa913b09a
208 changed files with 6027 additions and 5801 deletions

View File

@@ -6,7 +6,7 @@ import { SyncedCron } from 'meteor/littledata:synced-cron';
Meteor.startup(() => {
const collections = [
CreatureProperties,
LibraryNodes,
LibraryNodes,
];
/**
@@ -14,15 +14,15 @@ Meteor.startup(() => {
* and were not restored
* @return {Number} Number of documents removed
*/
const deleteOldSoftRemovedDocs = function(){
const deleteOldSoftRemovedDocs = function () {
const now = new Date();
const yesterday = new Date(now.getTime() - (24 * 60 * 60 * 1000));
const yesterday = new Date(now.getTime() - (24 * 60 * 60 * 1000));
collections.forEach(collection => {
collection.remove({
removed: true,
removedAt: {$lt: yesterday} // dates *before* yesterday
}, function(error){
if (error){
removedAt: { $lt: yesterday } // dates *before* yesterday
}, function (error) {
if (error) {
console.error(JSON.stringify(error, null, 2));
}
});
@@ -31,7 +31,7 @@ Meteor.startup(() => {
SyncedCron.add({
name: 'deleteSoftRemovedDocs',
schedule: function(parser) {
schedule: function (parser) {
return parser.text('every 10 minutes');
},
job: deleteOldSoftRemovedDocs,
@@ -42,7 +42,7 @@ Meteor.startup(() => {
// Add a method to manually trigger removal
Meteor.methods({
deleteOldSoftRemovedDocs() {
assertAdmin(this.userId);
assertAdmin(this.userId);
this.unblock();
deleteOldSoftRemovedDocs();
},

View File

@@ -1,16 +1,16 @@
import Icons from '/imports/api/icons/Icons.js';
Meteor.publish('sampleIcons', function(){
return Icons.find({}, {limit: 50});
Meteor.publish('sampleIcons', function () {
return Icons.find({}, { limit: 50 });
});
Meteor.publish('searchIcons', function(searchValue) {
Meteor.publish('searchIcons', function (searchValue) {
// Don't publish anything if there's no search value
if (!searchValue) {
return [];
}
return Icons.find(
{ $text: {$search: searchValue} },
{ $text: { $search: searchValue } },
{
// relevant documents have a higher score.
fields: {

View File

@@ -2,31 +2,33 @@ import SimpleSchema from 'simpl-schema';
import '/imports/api/users/Users.js';
import Invites from '/imports/api/users/Invites.js';
Meteor.publish('user', function(){
return [
Meteor.users.find(this.userId, {fields: {
roles: 1,
username: 1,
apiKey: 1,
darkMode: 1,
subscribedLibraries: 1,
subscribedLibraryCollections: 1,
fileStorageUsed: 1,
profile: 1,
preferences: 1,
'services.patreon.id': 1,
'services.patreon.entitledCents': 1,
'services.patreon.entitledCentsOverride': 1,
'services.google.id': 1,
'services.google.picture': 1,
'services.google.name': 1,
'services.google.email': 1,
'services.google.locale': 1,
}}),
Meteor.publish('user', function () {
return [
Meteor.users.find(this.userId, {
fields: {
roles: 1,
username: 1,
apiKey: 1,
darkMode: 1,
subscribedLibraries: 1,
subscribedLibraryCollections: 1,
fileStorageUsed: 1,
profile: 1,
preferences: 1,
'services.patreon.id': 1,
'services.patreon.entitledCents': 1,
'services.patreon.entitledCentsOverride': 1,
'services.google.id': 1,
'services.google.picture': 1,
'services.google.name': 1,
'services.google.email': 1,
'services.google.locale': 1,
}
}),
Invites.find({
$or: [
{inviter: this.userId},
{invitee: this.userId}
{ inviter: this.userId },
{ invitee: this.userId }
],
}, {
fields: {
@@ -41,19 +43,19 @@ let userIdsSchema = new SimpleSchema({
type: Array,
optional: true,
},
'ids.$':{
'ids.$': {
type: String,
regEx: SimpleSchema.RegEx.Id,
}
})
Meteor.publish('userPublicProfiles', function(ids){
userIdsSchema.validate({ids});
if (!this.userId || !ids) return this.ready();
return Meteor.users.find({
_id: {$in: ids}
},{
fields: {username: 1},
sort: {username: 1},
});
Meteor.publish('userPublicProfiles', function (ids) {
userIdsSchema.validate({ ids });
if (!this.userId || !ids) return this.ready();
return Meteor.users.find({
_id: { $in: ids }
}, {
fields: { username: 1 },
sort: { username: 1 },
});
});