Git Product home page Git Product logo

parsleyjs-meteor's People

Contributors

amrali avatar em0ney avatar rootedsoftware avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

parsleyjs-meteor's Issues

Error with Meteor 1.0.1 Security Update

Can you post an example

Can you post an example with the js file and the HTML files? I'm having trouble knowing if I've got all the pieces in place to really make this work. Also, so far many of the part of my validation aren't working at all or aren't working right. If you have any forms that also use bootstrap for the error styling that would be great to see.

Thanks

Infinite loop when deployed

Problem:
Meteor projects with parsley.js get stuck in an infinite loop when deployed to meteor.com.

Reproduce:

  1. Create a new project: meteor create xxx
  2. mrt add parsley.js
  3. meteor deploy xxx.meteor.com

Additional information:
The console keeps spitting out this line:
[Error] TypeError: 'undefined' is not a function (evaluating 'e({})') (anonymous function) (dafc4383c652b6f17d22782ef02fafa568724d64.js, line 7)

Package doesn't work

Your references are not working.
installing from mrt you get :

error: File not found: parsleyjs/parsley.js
error: File not found: parsleyjs/parsley.extend.js

Uncaught TypeError: undefined is not a function parsley.min.js:9

I'm getting this error in the console on startup.
"Uncaught TypeError: undefined is not a function parsley.min.js:9"
Not sure what's going with it. The only dependency is jquery and the package.js lists it as a dependency, so it should be getting loaded first.
No code written to actually use the package yet, although I attempted to bind a form manually from the console and it throws the same error.

Use jquery in package

Package should look like this right? I'm seeing a $.extend is not defined.

Package.describe({
  summary: "Javascript forms validation. Powerful, UX aware, and dead simple."
});

Package.on_use(function (api) {
  api.use('jquery', 'client');
  api.add_files('parsley.min.js', 'client');
  api.add_files('parsley.remote.min.js', 'client');
});

Please update the package

For some reason the tagged version (v2.0.2) doesn't seem to have an updated package.js file with the api.use('jquery', 'client') call in it.

The code in master is correct, so I can't really pull request to fix it.

my onFieldError listener runs twice on fields of type email

This is great, thanks for wrapping up this JS library.

I am seeing the onFieldError listener execute twice on a single field failure.

Example: A form which has one required field, e.g.

<input class="form-control" data-required="true" data-type="email" data-required-message="{{errorEmailRequired}}"...

The form is setup in the rendered callback:

parsleyOptions = {
  // Sets success and error class to Bootstrap class names
  successClass: '',//'has-success',
  errorClass: 'has-error has-feedback',
  trigger: 'change',

  // Bootsrap needs success/error class to be set on parent element
  errors: {
   classHandler: function ( elem, isRadioOrCheckbox ) {
     // specify where parsley error-success classes are set
     return $(elem).parents(".form-group");
   },
   // Set these to empty to make sure the default Parsley elements are not rendered
   errorsWrapper: '',
   errorElem: ''
  },

  listeners: {
   onFieldValidate: function ( elem ) {
     // remove the X from onFieldError if it's there
     elem.next( ".glyphicon-remove" ).remove();
   },

   onFieldError: function ( elem, constraints, parsleyField ) {
     // add the Bootstrap X glyphicon to the right side of the form element
     elem.after( '<span class="glyphicon glyphicon-remove form-control-feedback"></span>' );
     // access the data-required-message="xx" attribute on the field
     throwError( 000, "", elem.data('required-message' ) );
    },

    // onFieldSuccess: function(elem, constraints, parsleyField) {
    //   elem.next().remove( 'form-control-feedback' );
    // }
  }
};
Template.contactsAddOrEdit.rendered = function() {
  $( '#contactsAddOrEditForm' ).parsley( parsleyOptions );
};

When the field failure happens, onFieldError is called twice resulting in two errors to the user. (throwError goes to a local errors collection, straight from the Meteor book example.)

parsley1

Any thoughts?

Please add a license so that others can use this package

Could you please add a license so that others can use this package? Publishing software without a license means that anyone attempting to use it would be in violation of copyright. If you could please add a MIT or other distribution-friendly license, that would be appreciated!

Thanks

mrt error

when trying to add the package I'm getting the following error message

/usr/local/lib/node_modules/meteorite/lib/dependencies/package.js:63
throw('No version ' + version + ' of package ' + self.name + ' was found

radio buttons wrapping

Probably a parsleyjs thing, but in bootstrap 4 "toggle button bar" styled radio buttons will stack the radio buttons vertically i.e.
You want (to appear as buttons):

radio1 radio2 radio 3

becomes

radio 1
radio2 radio 3

The code:

<div class="btn-group" data-toggle="buttons">
  <label class="btn btn-success-outline active">
     <input type="radio" name="scheduleType" id="scheduleType1" autocomplete="off">Flexible
 </label> 
 <label class="btn btn-success-outline checkbox-inline">
    <input type="radio" name="scheduleType" id="scheduleType2" autocomplete="off">Fixed
  </label>
</div>

Looking at the html, it appears parsley inserts a

<ul id='parsley-id-multiple-RADIONAME'> 

after the first radio, which breaks the layout.

The workaround, unless there is a way to skip validation on a control, is to put

Template.THEAFFECTEDTEMPLATE.onRendered(function (){
$('#parsley-id-multiple-scheduleType').remove();
});

Seems to work, but haven't fully tested it

Error while building package

I get the following error after installing the most recent version of this package:

=> Errors while scanning packages:

While building package parsley.js:
parsley.remote.min.js:6:1: Unexpected token <

Error Building

After executing mrt add parsley.js i got the following message

=> Errors while scanning packages:

While building package parsley.js:
error: File not found: parsleyjs/parsley.js
error: File not found: parsleyjs/parsley.extend.js

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.