Skip to content

Instantly share code, notes, and snippets.

@lancecarlson
Last active August 29, 2015 14:03
Show Gist options
  • Save lancecarlson/1c32c598a961f5d0b132 to your computer and use it in GitHub Desktop.
Save lancecarlson/1c32c598a961f5d0b132 to your computer and use it in GitHub Desktop.
jquery dependencies
$ git grep '$\.'
README.md:Card renders with default values for card `name`, `number`, `expiry`, and `cvc`. To override these values, you can either pass in a `values` object or set `$.card.values` before initializing `card`. Do
README.md:// setting $.card.values is one way to override
README.md:$.card.values = {
README.md:To render the card with the strings in a different language, you can either pass in a `messages` object or set `$.card.messages` before initializing `card`. Do one or the other, not both.
README.md:// setting $.card.messages is one way to override
README.md:$.card.messages = {
lib/js/card.js: $.payment = {};
lib/js/card.js: $.payment.fn = {};
lib/js/card.js: $.fn.payment = function() {
lib/js/card.js: return $.payment.fn[method].apply(this, args);
lib/js/card.js: value = $.payment.formatCardNumber(value);
lib/js/card.js: cardType = $.payment.cardType(val) || 'unknown';
lib/js/card.js: $.payment.fn.formatCardCVC = function() {
lib/js/card.js: $.payment.fn.formatCardExpiry = function() {
lib/js/card.js: $.payment.fn.formatCardNumber = function() {
lib/js/card.js: $.payment.fn.restrictNumeric = function() {
lib/js/card.js: $.payment.fn.cardExpiryVal = function() {
lib/js/card.js: return $.payment.cardExpiryVal($(this).val());
lib/js/card.js: $.payment.cardExpiryVal = function(value) {
lib/js/card.js: $.payment.validateCardNumber = function(num) {
lib/js/card.js: $.payment.validateCardExpiry = (function(_this) {
lib/js/card.js: month = $.trim(month);
lib/js/card.js: year = $.trim(year);
lib/js/card.js: $.payment.validateCardCVC = function(cvc, type) {
lib/js/card.js: cvc = $.trim(cvc);
lib/js/card.js: $.payment.cardType = function(num) {
lib/js/card.js: $.payment.formatCardNumber = function(num) {
lib/js/card.js:$.card = {};
lib/js/card.js:$.card.fn = {};
lib/js/card.js:$.fn.card = function(opts) {
lib/js/card.js: return $.card.fn.construct.apply(this, opts);
lib/js/card.js: this.options = $.extend(true, {}, this.defaults, opts);
lib/js/card.js: $.extend(this.options.messages, $.card.messages);
lib/js/card.js: $.extend(this.options.values, $.card.values);
lib/js/card.js: this.$container.append(this.template(this.cardTemplate, $.extend({}, this.options.messages, this.options.values)));
lib/js/card.js: $.each(this.options.cardSelectors, (function(_this) {
lib/js/card.js: $.each(this.options.formSelectors, (function(_this) {
lib/js/card.js: return $.each(this.options.formSelectors, (function(_this) {
lib/js/card.js: objVal = $.payment.cardExpiryVal(val);
lib/js/card.js: return $.payment.validateCardExpiry(objVal.month, objVal.year);
lib/js/card.js: return $.payment.validateCardCVC(val, _this.cardType);
lib/js/card.js: return $.payment.validateCardNumber(val);
lib/js/card.js: if (!$.payment.validateCardExpiry(val.month, val.year)) {
lib/js/card.js: $.fn.bindVal = function(out, opts) {
lib/js/card.js:$.fn.extend({
src/coffee/card.coffee:$.card = {}
src/coffee/card.coffee:$.card.fn = {}
src/coffee/card.coffee:$.fn.card = (opts) ->
src/coffee/card.coffee: $.card.fn.construct.apply(this, opts)
src/coffee/card.coffee: @options = $.extend(true, {}, @defaults, opts)
src/coffee/card.coffee: $.extend @options.messages, $.card.messages
src/coffee/card.coffee: $.extend @options.values, $.card.values
src/coffee/card.coffee: $.extend({}, @options.messages, @options.values)
src/coffee/card.coffee: $.each @options.cardSelectors, (name, selector) =>
src/coffee/card.coffee: $.each @options.formSelectors, (name, selector) =>
src/coffee/card.coffee: $.each @options.formSelectors, (name, selector) =>
src/coffee/card.coffee: objVal = $.payment.cardExpiryVal val
src/coffee/card.coffee: $.payment.validateCardExpiry objVal.month, objVal.year
src/coffee/card.coffee: isValid = (val) => $.payment.validateCardCVC val, @cardType
src/coffee/card.coffee: isValid = (val) -> $.payment.validateCardNumber val
src/coffee/card.coffee: e.preventDefault() if !$.payment.validateCardExpiry(val.month, val.year)
src/coffee/card.coffee: $.fn.bindVal = (out, opts={}) ->
src/coffee/card.coffee:$.fn.extend card: (option, args...) ->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment