Jquery Uncaught ReferenceError:未定义wplms

时间:2016-07-13 17:40:18

标签: javascript jquery wordpress

将我的wordpress网站从4.3.1更新到4.5.3后,我发现这个错误与一个不再是几天的插件有关。对我来说纠正这个错误非常重要。

提前感谢您的帮助

Here is the error I get in the Chrome console

this.validationResult=[],this._bindConstraints()};c.prototype={validate:function(t){return this.value=this.getValue(),this._trigger("validate"),this._trigger(this.isValid(t,this.value)?"success":"error"),this._trigger("validated"),this.validationResult},hasConstraints:function(){return 0!==this.constraints.length},needsValidation:function(t){return"undefined"==typeof t&&(t=this.getValue()),t.length||this._isRequired()||"undefined"!=typeof this.options.validateIfEmpty?!0:!1},isValid:function(t,e){if(this.refreshConstraints(),this.validationResult=!0,!this.hasConstraints())return!0;if(("undefined"==typeof e||null===e)&&(e=this.getValue()),!this.needsValidation(e)&&!0!==t)return!0;var i=["Any"];!1!==this.options.priorityEnabled&&(i=this._getConstraintsSortedPriorities());for(var n=0;n<i.length;n++)if(!0!==(this.validationResult=this.validateThroughValidator(e,this.constraints,i[n])))return!1;return!0},getValue:function(){var t;return t="function"==typeof this.options.value?this.options.value(this):"undefined"!=typeof this.options.value?this.options.value:this.$element.val(),"undefined"==typeof t||null===t?"":this._handleWhitespace(t)},refreshConstraints:function(){return this.actualizeOptions()._bindConstraints()},addConstraint:function(t,e,i,n){if("function"==typeof window.ParsleyValidator.validators[t]){var s=new f(this,t,e,i,n);"undefined"!==this.constraintsByName[s.name]&&this.removeConstraint(s.name),this.constraints.push(s),this.constraintsByName[s.name]=s}return this},removeConstraint:function(t){for(var e=0;e<this.constraints.length;e++)if(t===this.constraints[e].name){this.constraints.splice(e,1);break}return delete this.constraintsByName[t],this},updateConstraint:function(t,e,i){return this.removeConstraint(t).addConstraint(t,e,i)},_bindConstraints:function(){for(var t=[],e={},i=0;i<this.constraints.length;i++)!1===this.constraints[i].isDomConstraint&&(t.push(this.constraints[i]),e[this.constraints[i].name]=this.constraints[i]);this.constraints=t,this.constraintsByName=e;for(var n in this.options)this.addConstraint(n,this.options[n]);return this._bindHtml5Constraints()},_bindHtml5Constraints:function(){(this.$element.hasClass("required")||this.$element.attr("required"))&&this.addConstraint("required",!0,void 0,!0),"string"==typeof this.$element.attr("pattern")&&this.addConstraint("pattern",this.$element.attr("pattern"),void 0,!0),"undefined"!=typeof this.$element.attr("min")&&"undefined"!=typeof this.$element.attr("max")?this.addConstraint("range",[this.$element.attr("min"),this.$element.attr("max")],void 0,!0):"undefined"!=typeof this.$element.attr("min")?this.addConstraint("min",this.$element.attr("min"),void 0,!0):"undefined"!=typeof this.$element.attr("max")&&this.addConstraint("max",this.$element.attr("max"),void 0,!0),"undefined"!=typeof this.$element.attr("minlength")&&"undefined"!=typeof this.$element.attr("maxlength")?this.addConstraint("length",[this.$element.attr("minlength"),this.$element.attr("maxlength")],void 0,!0):"undefined"!=typeof this.$element.attr("minlength")?this.addConstraint("minlength",this.$element.attr("minlength"),void 0,!0):"undefined"!=typeof this.$element.attr("maxlength")&&this.addConstraint("maxlength",this.$element.attr("maxlength"),void 0,!0);var t=this.$element.attr("type");return"undefined"==typeof t?this:"number"===t?"undefined"==typeof this.$element.attr("step")||0===parseFloat(this.$element.attr("step"))%1?this.addConstraint("type","integer",void 0,!0):this.addConstraint("type","number",void 0,!0):/^(email|url|range)$/i.test(t)?this.addConstraint("type",t,void 0,!0):this},_isRequired:function(){return"undefined"==typeof this.constraintsByName.required?!1:!1!==this.constraintsByName.required.requirements},_trigger:function(t){return t="field:"+t,this.trigger.apply(this,arguments)},_handleWhitespace:function(t){return!0===this.options.trimValue&&r.warnOnce('data-parsley-trim-value="true" is deprecated, please use data-parsley-whitespace="trim"'),"squish"===this.options.whitespace&&(t=t.replace(/\s{2,}/g," ")),("trim"===this.options.whitespace||"squish"===this.options.whitespace||!0===this.options.trimValue)&&(t=t.replace(/^\s+|\s+$/g,"")),t},_getConstraintsSortedPriorities:function(){for(var t=[],e=0;e<this.constraints.length;e++)-1===t.indexOf(this.constraints[e].priority)&&t.push(this.constraints[e].priority);return t.sort(function(t,e){return e-t}),t}};var p=function(){this.__class__="ParsleyFieldMultiple"};p.prototype={addElement:function(t){return this.$elements.push(t),this},refreshConstraints:function(){var e;if(this.constraints=[],this.$element.is("select"))return this.actualizeOptions()._bindConstraints(),this;for(var i=0;i<this.$elements.length;i++)if(t("html").has(this.$elements[i]).length){e=this.$elements[i].data("ParsleyFieldMultiple").refreshConstraints().constraints;for(var n=0;n<e.length;n++)this.addConstraint(e[n].name,e[n].requirements,e[n].priority,e[n].isDomConstraint)}else this.$elements.splice(i,1);return this},getValue:function(){if("undefined"!=typeof this.options.value)return this.options.value;if(this.$element.is("input[type=radio]"))return this._findRelatedMultiple().filter(":checked").val()||"";if(this.$element.is("input[type=checkbox]")){var e=[];return this._findRelatedMultiple().filter(":checked").each(function(){e.push(t(this).val())}),e}return this.$element.is("select")&&null===this.$element.val()?[]:this.$element.val()},_init:function(){return this.$elements=[this.$element],this}};var m=function(e,i,n){this.$element=t(e);var s=this.$element.data("Parsley");if(s)return"undefined"!=typeof n&&s.parent===window.Parsley&&(s.parent=n,s._resetOptions(s.options)),s;if(!this.$element.length)throw new Error("You must bind Parsley on an existing element.");if("undefined"!=typeof n&&"ParsleyForm"!==n.__class__)throw new Error("Parent instance must be a ParsleyForm instance");return this.parent=n||window.Parsley,this.init(i)};m.prototype={init:function(t){return this.__class__="Parsley",this.__version__="2.1.3",this.__id__=r.generateID(),this._resetOptions(t),this.$element.is("form")||r.checkAttr(this.$element,this.options.namespace,"validate")&&!this.$element.is(this.options.inputs)?this.bind("parsleyForm"):this.isMultiple()?this.handleMultiple():this.bind("parsleyField")},isMultiple:function(){return this.$element.is("input[type=radio], input[type=checkbox]")||this.$element.is("select")&&"undefined"!=typeof this.$element.attr("multiple")},handleMultiple:function(){var e,i,n=this;if(this.options.multiple||("undefined"!=typeof this.$element.attr("name")&&this.$element.attr("name").length?this.options.multiple=e=this.$element.attr("name"):"undefined"!=typeof this.$element.attr("id")&&this.$element.attr("id").length&&(this.options.multiple=this.$element.attr("id"))),this.$element.is("select")&&"undefined"!=typeof this.$element.attr("multiple"))return this.options.multiple=this.options.multiple||this.__id__,this.bind("parsleyFieldMultiple");if(!this.options.multiple)return r.warn("To be bound by Parsley, a radio, a checkbox and a multiple select input must have either a name or a multiple option.",this.$element),this;this.options.multiple=this.options.multiple.replace(/(:|\.|\[|\]|\{|\}|\$)/g,""),"undefined"!=typeof e&&t('input[name="'+e+'"]').each(function(){t(this).is("input[type=radio], input[type=checkbox]")&&t(this).attr(n.options.namespace+"multiple",n.options.multiple)});for(var s=this._findRelatedMultiple(),a=0;a<s.length;a++)if(i=t(s.get(a)).data("Parsley"),"undefined"!=typeof i){this.$element.data("ParsleyFieldMultiple")||i.addElement(this.$element);break}return this.bind("parsleyField",!0),i||this.bind("parsleyFieldMultiple")},bind:function(e,i){var n;switch(e){case"parsleyForm":n=t.extend(new d(this.$element,this.domOptions,this.options),window.ParsleyExtend)._bindFields();break;case"parsleyField":n=t.extend(new c(this.$element,this.domOptions,this.options,this.parent),window.ParsleyExtend);break;case"parsleyFieldMultiple":n=t.extend(new c(this.$element,this.domOptions,this.options,this.parent),new p,window.ParsleyExtend)._init();break;default:throw new Error(e+"is not a supported Parsley type")}return this.options.multiple&&r.setAttr(this.$element,this.options.namespace,"multiple",this.options.multiple),"undefined"!=typeof i?(this.$element.data("ParsleyFieldMultiple",n),n):(this.$element.data("Parsley",n),n._trigger("init"),n)}};var _=t({}),g=function(){r.warnOnce("Parsley's pubsub module is deprecated; use the 'on' and 'off' methods on parsley instances or window.Parsley")},y="parsley:";t.listen=function(t,n){var s;if(g(),"object"==typeof arguments[1]&&"function"==typeof arguments[2]&&(s=arguments[1],n=arguments[2]),"function"!=typeof arguments[1])throw new Error("Wrong parameters");window.Parsley.on(i(t),e(n,s))},t.listenTo=function(t,n,s){if(g(),!(t instanceof c||t instanceof d))throw new Error("Must give Parsley instance");if("string"!=typeof n||"function"!=typeof s)throw new Error("Wrong parameters");t.on(i(n),e(s))},t.unsubscribe=function(t,e){if(g(),"string"!=typeof t||"function"!=typeof e)throw new Error("Wrong arguments");window.Parsley.off(i(t),e.parsleyAdaptedCallback)},t.unsubscribeTo=function(t,e){if(g(),!(t instanceof c||t instanceof d))throw new Error("Must give Parsley instance");t.off(i(e))},t.unsubscribeAll=function(e){g(),window.Parsley.off(i(e)),t("form,input,textarea,select").each(function(){var n=t(this).data("Parsley");n&&n.off(i(e))})},t.emit=function(t,e){g();var n=e instanceof c||e instanceof d,s=Array.prototype.slice.call(arguments,n?2:1);s.unshift(i(t)),n||(e=window.Parsley),e.trigger.apply(e,s)},window.ParsleyConfig=window.ParsleyConfig||{},window.ParsleyConfig.i18n=window.ParsleyConfig.i18n||{},window.ParsleyConfig.i18n.en=jQuery.extend(window.ParsleyConfig.i18n.en||{},{defaultMessage:"This value seems to be invalid.",type:{email:"This value should be a valid email.",url:"This value should be a valid url.",number:"This value should be a valid number.",integer:"This value should be a valid integer.",digits:"This value should be digits.",alphanum:"This value should be alphanumeric."},notblank:"This value should not be blank.",required:"This value is required.",pattern:"This value seems to be invalid.",min:"This value should be greater than or equal to %s.",max:"This value should be lower than or equal to %s.",range:"This value should be between %s and %s.",minlength:"This value is too short. It should have %s characters or more.",maxlength:"This value is too long. It should have %s characters or fewer.",length:"This value length is invalid. It should be between %s and %s characters long.",mincheck:"You must select at least %s choices.",maxcheck:"You must select %s choices or fewer.",check:"You must select between %s and %s choices.",equalto:"This value should be the same."}),"undefined"!=typeof window.ParsleyValidator&&window.ParsleyValidator.addCatalog("en",window.ParsleyConfig.i18n.en,!0);var v=t.extend(new o,{$element:t(document),actualizeOptions:null,_resetOptions:null,Factory:m,version:"2.1.3"});return t.extend(c.prototype,o.prototype),t.extend(d.prototype,o.prototype),t.extend(m.prototype,o.prototype),t.fn.parsley=t.fn.psly=function(e){if(this.length>1){var i=[];return this.each(function(){i.push(t(this).parsley(e))}),i}return t(this).length?new m(this,e):void r.warn("You must bind Parsley on an existing element.")},"undefined"==typeof window.ParsleyExtend&&(window.ParsleyExtend={}),v.options=t.extend(r.objectCreate(a),window.ParsleyConfig),window.ParsleyConfig=v.options,window.Parsley=window.psly=v,window.ParsleyUtils=r,window.ParsleyValidator=new u(window.ParsleyConfig.validators,window.ParsleyConfig.i18n),window.ParsleyUI="function"==typeof window.ParsleyConfig.ParsleyUI?(new window.ParsleyConfig.ParsleyUI).listen():(new h).listen(),!1!==window.ParsleyConfig.autoBind&&t(function(){t("[data-parsley-validate]").length&&t("[data-parsley-validate]").parsley()}),window.Parsley}),jQuery(document).ready(function(t){t(window).scroll(function(e){var i=t(this).scrollTop();if(t("header").hasClass("fix")){var n=t("header").height();i>n?t("header").addClass("fixed"):t("header").removeClass("fixed")}}),t(".show_reviews").on("click",function(){var e=t(this).parent();e.hasClass("active")?(e.removeClass("active"),t(this).text(t(this).attr("data-default"))):(e.addClass("active"),t(this).text(t(this).attr("data-less")))}),t("#item-nav").each(function(){t(this).find(".item-list-tabs ul").flexMenu({linkText:wplms.more,linkTitle:wplms.view_more,linkTextAll:wplms.menu,linkTitleAll:wplms.open_menu})}),jQuery(".instructor_more .more_description").on("click",function(){var e=t(this).attr("data-default");t(this).parent().toggleClass("active");var i=t(this).text();t(this).attr("data-default",i),t(this).text(e)}),jQuery(".ajax_unit").magnificPopup({type:"ajax",alignTop:!0,fixedContentPos:!0,fixedBgPos:!0,overflowY:"auto",closeBtnInside:!0,preloader:!1,midClick:!0,removalDelay:300,mainClass:"my-mfp-zoom-in",callbacks:{parseAjax:function(t){t.data=jQuery(t.data).find(".unit_wrap")},ajaxContentAdded:function(){jQuery("video,audio").mediaelementplayer(),jQuery(".fitvids").fitVids(),jQuery(".tip").tooltip(),jQuery(".nav-tabs li:first a").tab("show"),t("audio,video").mediaelementplayer(),jQuery(".nav-tabs li a").click(function(t){t.preventDefault(),jQuery(this).tab("show")})}}})}),jQuery(document).ready(function(t){t("#login_modern_trigger").click(function(){t("#login-modal-overlay").addClass("show"),t("#login-modal").addClass("show")}),t("#close-modal").click(function(){t("#login-modal-overlay").removeClass("show"),t("#login-modal").removeClass("show")}),t("#forgot_password_trigger").click(function(){t("#login_register_form").hasClass("slidehide")?t("#login_register_form").removeClass("slidehide"):t("#login_register_form").addClass("slidehide"),t("#forgot_password").hasClass("slideshow")?t("#forgot_password").removeClass("slideshow"):t("#forgot_password").addClass("slideshow")}),t("#create_account_trigger").click(function(){t("#login_register_form").toggleClass("slidehide"),t("#create_account").toggleClass("slideshow"),t("#create_account").trigger("active")}),t("#forgot_password .link,#create_account .link").click(function(){t(".slideshow").toggleClass("slideshow"),t("#login_register_form").toggleClass("slidehide")}),t("#logged_in_menu .hasmenu>a").click(function(e){t("#logged_in_menu .hasmenu").removeClass("active"),t(this).parent().hasClass("active")||t(this).parent().toggleClass("active")}),t("#forgot_password").find("form").each(function(){var e=t(this);t("#forgot_password_submit").on("click",function(){if(e.parent().find(".message").remove(),e.parsley().validate()){var i,n=[];e.parent().find(".form-control").each(function(){var e={id:t(this).attr("id"),value:t(this).val()};"user_email"==t(this).attr("id")&&(i=t(this).val()),n.push(e)}),t.ajax({type:"POST",url:ajaxurl,data:{action:"forgot_password",security:t("#security").val(),user_login:i,fields:JSON.stringify(n)},cache:!1,success:function(t){e.parent().prepend(t)}})}})}),t("#create_account").on("active",function(){var e=t(this).find("form");t("#create_account_button").on("click",function(){if(e.parsley().validate()){var i=t(this),n=[];i.parent().find(".form-control").each(function(){var e={id:t(this).attr("id"),value:t(this).val()};n.push(e)}),t.ajax({type:"POST",url:ajaxurl,data:{action:"create_user",security:t("#security").val(),fields:JSON.stringify(n)},cache:!1,success:function(e){t.isNumeric(e)?location.reload():i.parent().prepend('<div id="message" class="error">'+e+"</div>")}})}})})});

0 个答案:

没有答案