Sunday, 15 April 2012

meteorite - trouble with filepicker script loading in meteor -


There is not much luck to load the filepicker package in my meteor project yet

What did I do :

  $ cd ~ / myMeteorProject add $ mrt filepicker & gt; & Gt; & Gt; Smart Package $ $ smart smart.json & gt; & Gt; & Gt; ; {"Package": {"Router": {}, "File Picker": {}}} $ MRT & gt; & Gt; & Gt; Stand back, while the silence talks about it, it's okay to install smart packages, everything is ready, here comes the meteorite! [[[~ ~ / MyMeteorProject]]]]]]] => Inverted server is running: http: // localhost: 3000 /   

So at this point I feel as if I expected (I also doubled the contents of the filepicker package and in it All that I expected was the same URL for loading the source, as is found on the filepicker.io site.)

However, when I run the following (compiled from coffeescript) Try:

  if (Meteor.isClient) {Meteor.startup (function () {return filepicker.setKey ('A9FiXXdu5RB ^ GYujfDPwlz'); // My Vastu I do not have a key, do not worry}}}   

I get: unwanted reference references: file picker is not defined

So, it's kind of a bummer Any idea? I have tried to delete coffeescript and filepicker and add it again. Is there a load-order problem? I think if the file fails to load then there is a warning in filepicker-load.js, which I do not Seeing ...

your syntin Looks good and uses what's in my app - I am thinking that since the filepicor script loads the script by scribbling the element, then you have a timing problem (calling the set before the script loads)

It may prevent the user from setting the key unless something does not, such as

  filepicker.setKey ("key"); Filepicker.pickAndStore ({...}, function (error) {...});   

or set it with a timeout

  Meteor.setTimeout (function () {filepicker.setKey ("KEY");}, 1000) ; You can also use an interval to check if desired (more tolerant of long load time) - you can adjust it to leave after some time < / P> 
  var filepickerInterval = Meteor.setInterval (function () {if (filepicker) {Meteor.clearInterval (filepickerInterval); filepicker.setKey ("key");}}, 100);    

No comments:

Post a Comment