meteor npm install –save bcrypt

Note: you are using a pure-JavaScript implementation of bcrypt.
While this implementation will work correctly, it is known to be
approximately three times slower than the native implementation.
In order to use the native implementation instead, run
meteor npm install –save bcrypt
in the root directory of your application.

I have seen many people ask about this error on the Meteor forums unanswered. Seems like a simple solution given, but that npm install can also lead an anther error.

Continue reading “meteor npm install –save bcrypt”

Find Meteor collection with two different fields

I do my happy dace every time I work something out in Meteor that I couldnt find online. Trying to create a function in a helper that true or false, by searching a collection in Meteor with more than one field. Simply put a coma after the first field. Boom.

connected: function() 
{
return collection.findOne({userA:Meteor.user().username,UserB:this.user.username});
}

Hide Bootstrap nav on click: Meteor

Seen a few comments about the version of Bootstrap commonly used by Meteor developments, the menu toggle doesnt close when a user clicks on a link.

 

The solution below is added to the JavaScript associated with whatever the template for the nav-bar is called. When a user clicks anywhere, the nab-bar collapse is hidden.

 

Just makes the UI better.

Template.nav.events({
‘click .addInterest’:function(){
//$(".create-pattern-box").css(‘visibility’, ‘visible’);
$(".create-pattern-box").removeClass("hidden");
},
‘click’:function(){
$(".navbar-collapse").collapse(‘hide’);
}
})

 

 

 

Custom CSS for loginbuttons from accounts-ui Meteor package

Using MeteorJS, it is really easy to just add a simple login accounts system using packages. The problem arises when we try to customise the CSS to our will. Some complex solutions can be found olnine, but I found it easier to just right-click and “inspect” the CSS from web developer tools in Chromium Browser.

 

Below is the CSS I used to customise loginbuttons, just copy and paste this into your own apps style sheet and change as you see fit.

#login-buttons .login-close-text, #login-buttons .additional-link{
  color: #000;
  text-transform: lowercase;
  font-family: 'Source Code Pro';
}

#login-buttons .login-link-text, .accounts-dialog label, .accounts-dialog .title{
    text-transform: lowercase;
    font-family: 'Source Code Pro';
}

#login-buttons .login-button, .accounts-dialog .login-button{
    color: #000;
    background: #c9cacc;
    border: 1px solid #c9cacc;
    border-radius: 4px;
    text-transform: lowercase;
}