Skip to content

Instantly share code, notes, and snippets.

@pedrokoblitz
Created August 7, 2015 13:29
Show Gist options
  • Select an option

  • Save pedrokoblitz/980fcf09b077e98e4631 to your computer and use it in GitHub Desktop.

Select an option

Save pedrokoblitz/980fcf09b077e98e4631 to your computer and use it in GitHub Desktop.
(function(exports) {
function WPForm() {
this.formEl = '';
this.messagesEl = '';
this.validationRules = {};
this.payload = {};
this.messages = [];
}
WPForm.prototype.serialize = function() {
};
WPForm.prototype.validate = function() {
};
WPForm.prototype.post = function() {
};
WPForm.prototype.handleResponse = function() {
};
WPForm.prototype.addMessage = function(message) {
this.messages.push(message);
};
WPForm.prototype.displayMessages = function() {
};
function exposed_func_name() {
var form = new WPForm();
}
var wpForm = {
WPForm: WPForm,
exposed_func_name: exposed_func_name
};
if (typeof define === 'function' && define.amd) {
/* AMD support */
define(function() {
return wpForm;
});
} else {
exports.wpForm = wpForm;
}
})(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment