From: Chris Oyler Date: Tue, 15 Dec 2015 19:04:04 +0000 (-0800) Subject: updates to remove conflicts X-Git-Tag: v6.1.0~4^2^2~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=553cbb7f376b385951ceb7e76dc65c7bffb51041;p=thirdparty%2Ffoundation%2Ffoundation-sites.git updates to remove conflicts ; --- 553cbb7f376b385951ceb7e76dc65c7bffb51041 diff --cc js/foundation.abide.js index 38dac44ae,b7f9b22dd..cd82c0dd1 --- a/js/foundation.abide.js +++ b/js/foundation.abide.js @@@ -11,12 -11,12 +11,12 @@@ function Abide(element, options) { this.$element = element; this.options = $.extend({}, Abide.defaults, this.$element.data(), options); -- this.$window = $(window); -- this.name = 'Abide'; -- this.attr = 'data-abide'; ++ // this.$window = $(window); ++ // this.name = 'Abide'; ++ // this.attr = 'data-abide'; this._init(); -- this._events(); ++ Foundation.registerPlugin(this); } @@@ -30,6 -30,6 +30,7 @@@ inputErrorClass: 'is-invalid-input', formErrorSelector: '.form-error', formErrorClass: 'is-visible', ++ patterns: { alpha : /^[a-zA-Z]+$/, alpha_numeric : /^[a-zA-Z0-9]+$/, @@@ -61,10 -61,10 +62,11 @@@ // #FFF or #FFFFFF color : /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/ }, ++ validators: { - equalTo: function ($el, required, parent) { - var from = $('#'+$el.attr('data-equalto')).val(), - to = $el.val(), + equalTo: function (el, required, parent) { + var from = document.getElementById(el.getAttribute(this.add_namespace('data-equalto'))).value, + to = el.value, valid = (from === to); return valid; @@@ -77,7 -77,7 +79,8 @@@ * Initializes the Abide plugin and calls functions to get Abide functioning on load. * @private */ -- Abide.prototype._init = function() { ++ Abide.prototype._init = function(){ ++ this._events(); }; /** @@@ -126,11 -129,9 +129,12 @@@ * @param {Object} element - jQuery object to check for required attribute * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty */ + var counter = 0; Abide.prototype.requiredCheck = function($el) { switch ($el[0].type) { ++ case 'text': + case 'password': if ($el.attr('required') && !$el.val()) { // requirement check does not pass return false; @@@ -138,21 -139,20 +142,17 @@@ return true; } break; ++ case 'checkbox': - // if ($el.attr('required') && !$el.is(':checked')) { - // return false; - // } else { - // return true; - // } - // break; - if ($el.attr('required') && !$el.is(':checked')) { - return false; - } else { - return true; - } - break; case 'radio': + console.log($el[0].type, counter++); if ($el.attr('required') && !$el.is(':checked')) { return false; } else { return true; } break; ++ default: if ($el.attr('required') && (!$el.val() || !$el.val().length)) { return false;