Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
15 additions
and
188 deletions.
There are no files selected for viewing
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,173 +0,0 @@ | ||
;(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
/** | ||
* Errors | ||
*/ | ||
module.exports = { | ||
|
||
required: 'This field is required', | ||
digits: 'Must be only digits', | ||
name: 'Must be at least 3 characters long and must only contain letters', | ||
email: 'Must be a valid email', | ||
username: 'Must be at between 4 and 32 characters long and start with a letter. You may use letters, numbers, underscores, and one dot', | ||
pass: 'Must be at least 6 characters long, and contain at least one number, one uppercase and one lowercase letter', | ||
strongpass: 'Must be at least 8 characters long and contain at least one uppercase and one lowercase letter and one number or special character', | ||
phone: 'Must be a valid phone number', | ||
zip: 'Must be a valid zip code', | ||
url: 'Must be a valid URL', | ||
number: 'Must be a number', | ||
range: 'Must be a number between {0} and {1}', | ||
min: 'Must be at least {0} characters long', | ||
max: 'Must be under {0} characters', | ||
minoption: 'Select at least {0} options', | ||
maxoption: 'Select no more than {0} options', | ||
minmax: 'Must be between {0} and {1} characters long', | ||
select: 'Select an option', | ||
extension: 'File(s) must have a valid extension ({*})', | ||
equalto: 'Must have the same value as the "{0}" field', | ||
date: 'Must be a valid date {0}' | ||
|
||
}; | ||
|
||
},{}],2:[function(require,module,exports){ | ||
/** | ||
* Adaptive | ||
*/ | ||
module.exports = { | ||
|
||
name: 'adaptive', | ||
|
||
options: { | ||
adaptiveWidth: $('<p class="idealforms-field-width"/>').appendTo('body').css('width').replace('px','') | ||
}, | ||
|
||
methods: { | ||
|
||
// @extend | ||
_init: function () { | ||
|
||
var self = this; | ||
|
||
function adapt() { | ||
|
||
var formWidth = self.$form.outerWidth() | ||
, isAdaptive = self.opts.adaptiveWidth > formWidth; | ||
|
||
self.$form.toggleClass('adaptive', isAdaptive); | ||
|
||
if (self._hasExtension('steps')) { | ||
self.$stepsContainer.toggleClass('adaptive', isAdaptive); | ||
} | ||
|
||
$('#ui-datepicker-div').hide(); | ||
} | ||
|
||
$(window).resize(adapt); | ||
adapt(); | ||
|
||
this.$form.find('select, .datepicker').each(function() { | ||
self._getField(this).find(self.opts.error).addClass('hidden'); | ||
}); | ||
|
||
$('p.idealforms-field-width').remove(); | ||
} | ||
|
||
} | ||
}; | ||
|
||
},{}],3:[function(require,module,exports){ | ||
module.exports = { | ||
|
||
name: 'ajax', | ||
|
||
methods: { | ||
|
||
// @extend | ||
_init: function() { | ||
|
||
$.extend($.idealforms, { _requests: {} }); | ||
|
||
$.idealforms.errors.ajax = $.idealforms.errors.ajax || 'Loading...'; | ||
|
||
$.extend($.idealforms.rules, { | ||
|
||
ajax: function(input) { | ||
|
||
var self = this | ||
, $field = this._getField(input) | ||
, url = $(input).data('idealforms-ajax') | ||
, userError = $.idealforms._getKey('errors.'+ input.name +'.ajaxError', self.opts) | ||
, requests = $.idealforms._requests | ||
, data = {}; | ||
|
||
data[input.name] = input.value; | ||
|
||
$field.addClass('ajax'); | ||
|
||
if (requests[input.name]) requests[input.name].abort(); | ||
|
||
requests[input.name] = $.post(url, data, function(resp) { | ||
|
||
if (resp === true) { | ||
$field.data('idealforms-valid', true); | ||
self._handleError(input); | ||
self._handleStyle(input); | ||
} else { | ||
self._handleError(input, userError); | ||
} | ||
|
||
$field.removeClass('ajax'); | ||
|
||
}, 'json'); | ||
|
||
return false; | ||
} | ||
}); | ||
}, | ||
|
||
// @extend | ||
_validate: function(input, rule) { | ||
if (rule != 'ajax' && $.idealforms._requests[input.name]) { | ||
$.idealforms._requests[input.name].abort(); | ||
this._getField(input).removeClass('ajax'); | ||
} | ||
} | ||
|
||
} | ||
}; | ||
|
||
},{}],4:[function(require,module,exports){ | ||
require('./idealfile'); | ||
require('./idealradiocheck'); | ||
|
||
module.exports = { | ||
|
||
name: 'customInputs', | ||
|
||
options: { | ||
customInputs: { | ||
i18n: { | ||
open: 'Open' | ||
} | ||
} | ||
}, | ||
|
||
methods: { | ||
|
||
// @extend | ||
_init: function() { | ||
this._buildCustomInputs(); | ||
}, | ||
|
||
addFields: function() { | ||
this._buildCustomInputs(); | ||
}, | ||
|
||
_buildCustomInputs: function() { | ||
this.$form.find(':file').idealfile(this.opts.customInputs.i18n); | ||
this.$form.find(':checkbox, :radio').idealradiocheck(); | ||
} | ||
|
||
} | ||
}; | ||
|
||
},{"./idealfile":5,"./idealradiocheck":6}] | ||
Oops, something went wrong.