meteor

Touch events in Meteor

*爱你&永不变心* 提交于 2019-12-24 00:57:46
问题 The first thing I started to do with Meteor was start writing a touch-based web application for mobile/tablets. Here's how you reproduce the problem: First step: create a blank project meteor create touch_example cd touch_example meteor Second, add these things to the .js file This first bit spits out an alert for touch devices and because they have no console. Meteor.log = function(input){ if (typeof console !== 'undefined' && typeof Touch !== "object") console.log(input); else alert(input);

Meteor: Disable button based on data context?

☆樱花仙子☆ 提交于 2019-12-24 00:55:43
问题 I have a multi-tenant Meteor app and want to allow users with access to more than one organization's account to switch between organizations. The ability to switch organizations is working, but I now want to be able to disable the button for the user's current organization, so they can not switch to the same organization they are already in. Right now I'm trying to retrieve each button's value based on a data-domain attribute, but it comes back undefined . Also, console.log(this); comes back

document creator as username or userId

风流意气都作罢 提交于 2019-12-24 00:55:39
问题 In a meteor collection for a document I have a creator attribute. Is it advisable to store the username (more intuitive) or userId (which is user._id) as creator attribute? What is the more standard practice? 回答1: With document databases, the answer is commonly, "both". Storing the userId is required as it is the only field that is guaranteed to not change (as others have pointed out). It's often worth it to store "denormalized" data as well. In some cases, its actually required. Take for

Meteor.js return innerHTML in helper

六眼飞鱼酱① 提交于 2019-12-24 00:47:38
问题 is there any way I can return innerHTML in helper? I mean something like this: text: function(){ return "<p>It's working!</p>" } There would be more of those records since I loop them through {{#each}} loop and I tried to do it throught JQuery but had hard times naming classes/ID's so I would appreciate if someone could tell me how to do it with helper 回答1: You can use Handlebars.SafeString: text: function(){ return new Handlebars.SafeString("<p>It's working!</p>"); } It will produce safe

Meteor How to export Meteor.publish and Meteor.method code from within a Meteor package

為{幸葍}努か 提交于 2019-12-24 00:47:24
问题 Here is a package.js file Package.describe({ summary: 'Client Collection Paging Class designed for use with Meteor' }); Package.on_use(function (api) { api.use( 'underscore', [ 'client', 'server' ] ) ; api.use( 'ejson', [ 'client', 'server' ] ) ; api.add_files( 'lib/pageMan.js', 'client' ) ; //api.add_files( 'lib/pageMan_publish.js', 'server' ) ; //api.add_files( 'lib/pageMan_method.js', [ 'client', 'server' ] ) ; if ( typeof api.export !== 'undefined' ) { api.use( 'webapp', 'server' ) ; Npm

readAsDataURL does not process file from captureAudio

女生的网名这么多〃 提交于 2019-12-24 00:38:59
问题 My FileReader object is working perfectly to upload images. I'm tracking onload as well as other events, these all happen when I upload images: fileReader = new FileReader(); fileReader.onloadstart = (e) => { window.alert('fileReader onloadstart'); window.alert(e); }; // ... and the same for onprogress, onabort, onerror, then finally: fileReader.onload = (e) => { window.alert('arrived to fileReader.onload!'); // ... }; I added cordova-plugin-media-capture to capture audio. I now need to use

“Login Forbidden” when using Meteor's Accounts.validateLoginAttempt(func)

我是研究僧i 提交于 2019-12-24 00:35:23
问题 I have a basic Meteor method that I am trying to call whenever the user attempts to sign in. Accounts.validateLoginAttempt(function (options) { Meteor.call('method', true, function (error, result) { // do nothing }); }); However, whenever I try to sign in, I receive "Login Forbidden" as an error. The same happens upon sign up. I am guessing I need to be returning something for the function, but do not know what. Your help would be greatly appreciated! 回答1: From the docs http://docs.meteor.com

Meteor Social Login - Blank page on oauth2 login using Facebook or Google

纵饮孤独 提交于 2019-12-24 00:32:41
问题 I am working on a mobile app using Meteor and Facebook or Google login. On Android devices it works great. But on iOS devices I get a blank page after successful authentication.The user has to click on a "Done" button to close the page and get the app regain control. Meteor version 1.3.4.4 and latest accounts-facebook , accounts-google packages. This is the code I am using for login: //Oauth login with Facebook. this.loginFB = function() { Meteor.loginWithFacebook({ requestPermissions: [

Meteor router doesn't render the template

旧时模样 提交于 2019-12-24 00:02:23
问题 I created a route and gave it a path to a template. But when I run the application, it says that 'there is no route'. Router simply doesn't follow the path. (I am sure the router package is installed because if I don't create and specify any route, on the main page appears the default message how to use a router) HTML: <head> <title>todos</title> </head> <body> {{>todos}} </body> <template name="register"> <h2>Register</h2> </template> route.js: Router.route('/register'); 回答1: Creating a new

meteor; not sorting on client immediately after publication

妖精的绣舞 提交于 2019-12-23 23:34:53
问题 I am trying to make a very simple application where one can publish posts. I want each entry on the post page to be sorted by { createdAt: -1 } . When I first visit the page, this works. However, when I make a new post, it appends to the bottom of the page. (notice latest post is at bottom). When I reload the page, it does seem to work and sort correctly, but immediately after submitting, it goes to the bottom. My serverside code is as follows ( /server/publications.js ): Meteor.publish(