From: Vincent Vanwaelscappel Date: Mon, 16 Apr 2018 15:49:07 +0000 (+0200) Subject: wip #1927 @3 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=dbab00ee45d9b795d937fb6e3ed48299211f966a;p=fluidbook-html5.git wip #1927 @3 --- diff --git a/js/libs/fluidbook/cart/fluidbook.cart.remarkable.js b/js/libs/fluidbook/cart/fluidbook.cart.remarkable.js index 46f9ab25..e3e97423 100644 --- a/js/libs/fluidbook/cart/fluidbook.cart.remarkable.js +++ b/js/libs/fluidbook/cart/fluidbook.cart.remarkable.js @@ -3,6 +3,7 @@ function FluidbookCartRemarkable(cart) { this.cart = cart; this.fluidbook = this.cart.fluidbook; this.items = this.cart.getSavedData(); + this.formInstance; this.database; $.each(this.fluidbook.datas.basketReferences, function (k, v) { $this.database = {}; @@ -26,6 +27,19 @@ FluidbookCartRemarkable.prototype = { $this.updateCart(); return true; }); + + $(document).on('click', '.cart-shipping-form .submit', function () { + $this.saveShipping(); + if ($this.formInstance.validate()) { + $this.sendOrder(function (data) { + window.location.hash = "#/cart/confirm"; + }, function (data) { + window.location.hash = "#/cart/error"; + }); + + } + return false; + }); }, addToCart: function (ref, quantity) { this.setQuantity(ref, quantity, 'add'); @@ -66,10 +80,13 @@ FluidbookCartRemarkable.prototype = { }, openMenu: function (p1, p2, callback) { + this.fluidbook.menu.quickCloseView(); if (p1 == 'shipping') { return this.openShipping(p2, callback); } else if (p1 == 'confirm') { return this.openConfirm(p2, callback); + } else if (p1 == 'error') { + return this.openError(p2, callback); } else { return this.openCart(p2, callback); } @@ -128,6 +145,12 @@ FluidbookCartRemarkable.prototype = { content += ''; content += 'Total TTC' + $this.formatPrice(totalttcfp, 'TTC') + ''; content += ''; + + content += ''; + return content; }, @@ -159,13 +182,81 @@ FluidbookCartRemarkable.prototype = { }, openShipping: function (p2, callback) { - var content = ''; - this._endMenu(this.fluidbook.l10n.__('your contact details'), content, callback); + var $this = this; + this._endMenu(this.fluidbook.l10n.__('your contact details'), this.getShippingContent(), function () { + callback(); + var saved = $this.fluidbook.cache.get('shipping-details', {}); + $(".cart-shipping-form input").each(function () { + if (saved[$(this).attr('name')] != null) { + $(this).val(saved[$(this).attr('name')]); + } + }); + $this.formInstance = $(".cart-shipping-form").parsley(); + }); + }, + + getShippingContent: function () { + var res = '
'; + res += '
'; + res += ''; + res += ''; + res += '

Adresse de facturation :

'; + res += ''; + res += ''; + res += ''; + res += ''; + res += '
'; + + res += '
'; + res += ''; + res += ''; + res += '

Adresse de livraison - Enseigne (si différente) :

'; + res += ''; + res += ''; + res += ''; + res += ''; + res += '
'; + + res += ''; + res += '
'; + return res; + }, + saveShipping: function () { + var data = {}; + $(".cart-shipping-form input").each(function () { + data[$(this).attr('name')] = $(this).val(); + }); + this.fluidbook.cache.set('shipping-details', data); }, openConfirm: function (p2, callback) { - var content = ''; - this._endMenu(this.fluidbook.l10n.__('confirmation'), content, callback); + var content = '
'; + content += "Nous vous remercions pour votre commande, elle sera traitée dans les plus brefs délais.
\n" + + "
\n" + + "Pour toute information complémentaire, contactez-nous au 04 67 59 12 81.
\n" + + "
\n" + + "
\n" + + "LIVRAISON
\n" + + "Livraison 48 h par transporteur
\n" + + "
\n" + + "
\n" + + "
\n" + + "MODES DE REGLEMENT
\n" + + "
\n" + + "Attendez de recevoir votre commande pour régler votre facture.
\n" + + "
\n" + + "Par chèque : à retourner à l’adresse indiquée.
\n" + + "
\n" + + "Par virement : toutes les informations en bas de la facture"; + content += "
"; + this._endMenu('Confirmation', content, callback); + }, + + openError: function (p2, callback) { + var content = '
'; + content += "Une erreur s'est produite. Votre commande n'a pas pu être transmise."; + content += "
"; + this._endMenu('Erreur', content, callback); }, _endMenu: function (title, content, callback) { @@ -175,6 +266,41 @@ FluidbookCartRemarkable.prototype = { view += ''; $("#view").append('
' + view + '
'); callback(); - } + }, + + sendOrder: function (success, error) { + var $this = this; + var items = []; + var totalttc = 0; + var totalht = 0; + $.each(this.items, function (ref, quantity) { + var item = $this.getItemData(ref); + var ht = item.price * quantity; + var ttc = ht * (1 + item.tax); + items.push([ref, item.name, $this.formatPrice(item.price), quantity, $this.formatPrice(ht)]); + totalttc += ttc; + totalht += ht; + }); + + var fp = 0; + var fpv = 'OFFERTS'; + if (totalht < 99) { + fp = 8.3; + fpv = this.formatPrice(fp); + } + var totalttcfp = totalttc + (fpv * 1.2); + + $.ajax({ + url: 'https://workshop.fluidbook.com/services/orderRemarkable', + method: 'post', + data: {'items': items, 'fpv': fpv, 'details': this.fluidbook.cache.get('shipping-details')}, + success: function (data) { + success(data); + }, + error: function (data) { + error(data); + } + }); + }, }; \ No newline at end of file diff --git a/js/libs/fluidbook/fluidbook.menu.js b/js/libs/fluidbook/fluidbook.menu.js index 10135ca8..44898945 100644 --- a/js/libs/fluidbook/fluidbook.menu.js +++ b/js/libs/fluidbook/fluidbook.menu.js @@ -363,6 +363,10 @@ FluidbookMenu.prototype = { resize(); }, + quickCloseView: function () { + $("#view .mview").remove(); + }, + resize: function (ww, hh) { if (ww == undefined) { ww = this.fluidbook.resize.ww; @@ -572,7 +576,8 @@ FluidbookMenu.prototype = { var ratio = $("#archivesview img").width() / w; $("#archivesview .links").transform({scale: [ratio]}); } - }, + } + , resizePopupAudios: function () { $(".mview audio").each(function () { @@ -585,14 +590,16 @@ FluidbookMenu.prototype = { margin: '40px auto' }); }); - }, + } + , hideOverlay: function () { $("#viewOverlay").css('opacity', 0); setTimeout(function () { $("#viewOverlay").hide(); }, 400); - }, + } + , showOverlay: function () { $("#viewOverlay").css('opacity', 0).show(); @@ -600,4 +607,5 @@ FluidbookMenu.prototype = { $("#viewOverlay").css('opacity', 1); }, 10); } -}; \ No newline at end of file +} +; \ No newline at end of file diff --git a/js/libs/parsley.min.js b/js/libs/parsley.min.js new file mode 100644 index 00000000..19f288a1 --- /dev/null +++ b/js/libs/parsley.min.js @@ -0,0 +1,18 @@ +/*! +* Parsley.js +* Version 2.8.1 - built Sat, Feb 3rd 2018, 2:27 pm +* http://parsleyjs.org +* Guillaume Potier - +* Marc-Andre Lafortune - +* MIT Licensed +*/ +function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t + * @license MIT + */ +function n(){var t=this,i=window||global;_extends(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(i){t.isNativeEvent(i)&&e(i.target).trigger("input")},misbehaves:function(i){t.isNativeEvent(i)&&(t.behavesOk(i),e(document).on("change.inputevent",i.data.selector,t.fakeInputEvent),t.fakeInputEvent(i))},behavesOk:function(i){t.isNativeEvent(i)&&e(document).off("input.inputevent",i.data.selector,t.behavesOk).off("change.inputevent",i.data.selector,t.misbehaves)},install:function(){if(!i.inputEventPatched){i.inputEventPatched="0.0.3";for(var n=["select",'input[type="checkbox"]','input[type="radio"]','input[type="file"]'],r=0;r1)throw Error("Second argument not supported");if("object"!=typeof t)throw TypeError("Argument must be an object");e.prototype=t;var i=new e;return e.prototype=null,i}}(),_SubmitSelector:'input[type="submit"], button:submit'},o={namespace:"data-parsley-",inputs:"input, textarea, select",excluded:"input[type=button], input[type=submit], input[type=reset], input[type=hidden]",priorityEnabled:!0,multiple:null,group:null,uiEnabled:!0,validationThreshold:3,focus:"first",trigger:!1,triggerAfterFailure:"input",errorClass:"parsley-error",successClass:"parsley-success",classHandler:function(e){},errorsContainer:function(e){},errorsWrapper:'
    ',errorTemplate:"
  • "},l=function(){this.__id__=a.generateID()};l.prototype={asyncSupport:!0,_pipeAccordingToValidationResult:function(){var t=this,i=function(){var i=e.Deferred();return!0!==t.validationResult&&i.reject(),i.resolve().promise()};return[i,i]},actualizeOptions:function(){return a.attr(this.element,this.options.namespace,this.domOptions),this.parent&&this.parent.actualizeOptions&&this.parent.actualizeOptions(),this},_resetOptions:function(e){this.domOptions=a.objectCreate(this.parent.options),this.options=a.objectCreate(this.domOptions);for(var t in e)e.hasOwnProperty(t)&&(this.options[t]=e[t]);this.actualizeOptions()},_listeners:null,on:function(e,t){this._listeners=this._listeners||{};var i=this._listeners[e]=this._listeners[e]||[];return i.push(t),this},subscribe:function(t,i){e.listenTo(this,t.toLowerCase(),i)},off:function(e,t){var i=this._listeners&&this._listeners[e];if(i)if(t)for(var n=i.length;n--;)i[n]===t&&i.splice(n,1);else delete this._listeners[e];return this},unsubscribe:function(t,i){e.unsubscribeTo(this,t.toLowerCase())},trigger:function(e,t,i){t=t||this;var n,r=this._listeners&&this._listeners[e];if(r)for(var s=r.length;s--;)if(n=r[s].call(t,t,i),n===!1)return n;return!this.parent||this.parent.trigger(e,t,i)},asyncIsValid:function(e,t){return a.warnOnce("asyncIsValid is deprecated; please use whenValid instead"),this.whenValid({group:e,force:t})},_findRelated:function(){return this.options.multiple?e(this.parent.element.querySelectorAll("["+this.options.namespace+'multiple="'+this.options.multiple+'"]')):this.$element}};var u=function(e,t){var i=e.match(/^\s*\[(.*)\]\s*$/);if(!i)throw'Requirement is not an array: "'+e+'"';var n=i[1].split(",").map(a.trimString);if(n.length!==t)throw"Requirement has "+n.length+" values when "+t+" are needed";return n},d=function(e,t,i){var n=null,r={};for(var s in e)if(s){var o=i(s);"string"==typeof o&&(o=a.parseRequirement(e[s],o)),r[s]=o}else n=a.parseRequirement(e[s],t);return[n,r]},h=function(t){e.extend(!0,this,t)};h.prototype={validate:function(e,t){if(this.fn)return arguments.length>3&&(t=[].slice.call(arguments,1,-1)),this.fn(e,t);if(Array.isArray(e)){if(!this.validateMultiple)throw"Validator `"+this.name+"` does not handle multiple values";return this.validateMultiple.apply(this,arguments)}var i=arguments[arguments.length-1];if(this.validateDate&&i._isDateInput())return arguments[0]=a.parse.date(arguments[0]),null!==arguments[0]&&this.validateDate.apply(this,arguments);if(this.validateNumber)return!isNaN(e)&&(arguments[0]=parseFloat(arguments[0]),this.validateNumber.apply(this,arguments));if(this.validateString)return this.validateString.apply(this,arguments);throw"Validator `"+this.name+"` only handles multiple values"},parseRequirements:function(t,i){if("string"!=typeof t)return Array.isArray(t)?t:[t];var n=this.requirementType;if(Array.isArray(n)){for(var r=u(t,n.length),s=0;s1?n-1:0),s=1;s0},validateString:function(e){return/\S/.test(e)},priority:512},type:{validateString:function(e,t){var i=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],n=i.step,r=void 0===n?"any":n,s=i.base,a=void 0===s?0:s,o=c[t];if(!o)throw new Error("validator type `"+t+"` is not supported");if(!o.test(e))return!1;if("number"===t&&!/^any$/i.test(r||"")){var l=Number(e),u=Math.max(f(r),f(a));if(f(l)>u)return!1;var d=function(e){return Math.round(e*Math.pow(10,u))};if((d(l)-d(a))%d(r)!=0)return!1}return!0},requirementType:{"":"string",step:"string",base:"number"},priority:256},pattern:{validateString:function(e,t){return t.test(e)},requirementType:"regexp",priority:64},minlength:{validateString:function(e,t){return e.length>=t},requirementType:"integer",priority:30},maxlength:{validateString:function(e,t){return e.length<=t},requirementType:"integer",priority:30},length:{validateString:function(e,t,i){return e.length>=t&&e.length<=i},requirementType:["integer","integer"],priority:30},mincheck:{validateMultiple:function(e,t){return e.length>=t},requirementType:"integer",priority:30},maxcheck:{validateMultiple:function(e,t){return e.length<=t},requirementType:"integer",priority:30},check:{validateMultiple:function(e,t,i){return e.length>=t&&e.length<=i},requirementType:["integer","integer"],priority:30},min:v(function(e,t){return e>=t}),max:v(function(e,t){return e<=t}),range:v(function(e,t,i){return e>=t&&e<=i}),equalto:{validateString:function(t,i){var n=e(i);return n.length?t===n.val():t===i},priority:256}}};var y={},_=function k(e,t,i){for(var n=[],r=[],s=0;s0&&"undefined"==typeof t.options.noFocus&&(this._focusedField=t.$element,"first"===this.options.focus))break}return null===this._focusedField?null:this._focusedField.focus()},_destroyUI:function(){this.$element.off(".Parsley")}},y.Field={_reflowUI:function(){if(this._buildUI(),this._ui){var e=_(this.validationResult,this._ui.lastValidationResult);this._ui.lastValidationResult=this.validationResult,this._manageStatusClass(),this._manageErrorsMessages(e),this._actualizeTriggers(),!e.kept.length&&!e.added.length||this._failedOnce||(this._failedOnce=!0,this._actualizeTriggers())}},getErrorsMessages:function(){if(!0===this.validationResult)return[];for(var e=[],t=0;t0?this._errorClass():this._resetClass()},_manageErrorsMessages:function(t){if("undefined"==typeof this.options.errorsMessagesDisabled){if("undefined"!=typeof this.options.errorMessage)return t.added.length||t.kept.length?(this._insertErrorWrapper(),0===this._ui.$errorsWrapper.find(".parsley-custom-error-message").length&&this._ui.$errorsWrapper.append(e(this.options.errorTemplate).addClass("parsley-custom-error-message")),this._ui.$errorsWrapper.addClass("filled").find(".parsley-custom-error-message").html(this.options.errorMessage)):this._ui.$errorsWrapper.removeClass("filled").find(".parsley-custom-error-message").remove();for(var i=0;i').appendTo(this.$element)),i.attr({name:t.getAttribute("name"),value:t.getAttribute("value")})}this.$element.trigger(_extends(e.Event("submit"),{parsley:!0}))}},validate:function(t){if(arguments.length>=1&&!e.isPlainObject(t)){a.warnOnce("Calling validate on a parsley form without passing arguments as an object is deprecated.");var i=_slice.call(arguments),n=i[0],r=i[1],s=i[2];t={group:n,force:r,event:s}}return b[this.whenValidate(t).state()]},whenValidate:function(){var t,i=this,n=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],r=n.group,s=n.force,o=n.event;this.submitEvent=o,o&&(this.submitEvent=_extends({},o,{preventDefault:function(){a.warnOnce("Using `this.submitEvent.preventDefault()` is deprecated; instead, call `this.validationResult = false`"),i.validationResult=!1}})),this.validationResult=!0,this._trigger("validate"),this._refreshFields();var l=this._withoutReactualizingFormOptions(function(){return e.map(i.fields,function(e){return e.whenValidate({force:s,group:r})})});return(t=a.all(l).done(function(){i._trigger("success")}).fail(function(){i.validationResult=!1,i.focus(),i._trigger("error")}).always(function(){i._trigger("validated")})).pipe.apply(t,_toConsumableArray(this._pipeAccordingToValidationResult()))},isValid:function(t){if(arguments.length>=1&&!e.isPlainObject(t)){a.warnOnce("Calling isValid on a parsley form without passing arguments as an object is deprecated.");var i=_slice.call(arguments),n=i[0],r=i[1];t={group:n,force:r}}return b[this.whenValid(t).state()]},whenValid:function(){var t=this,i=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=i.group,r=i.force;this._refreshFields();var s=this._withoutReactualizingFormOptions(function(){return e.map(t.fields,function(e){return e.whenValid({group:n,force:r})})});return a.all(s)},refresh:function(){return this._refreshFields(),this},reset:function(){for(var e=0;e=1&&!e.isPlainObject(t)&&(a.warnOnce("Calling validate on a parsley field without passing arguments as an object is deprecated."),t={options:t});var i=this.whenValidate(t);if(!i)return!0;switch(i.state()){case"pending":return null;case"resolved":return!0;case"rejected":return this.validationResult}},whenValidate:function(){var e,t=this,i=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=i.force,r=i.group;if(this.refresh(),!r||this._isInGroup(r))return this.value=this.getValue(),this._trigger("validate"),(e=this.whenValid({force:n,value:this.value,_refreshed:!0}).always(function(){t._reflowUI()}).done(function(){t._trigger("success")}).fail(function(){t._trigger("error")}).always(function(){t._trigger("validated")})).pipe.apply(e,_toConsumableArray(this._pipeAccordingToValidationResult()))},hasConstraints:function(){return 0!==this.constraints.length},needsValidation:function(e){return"undefined"==typeof e&&(e=this.getValue()),!(!e.length&&!this._isRequired()&&"undefined"==typeof this.options.validateIfEmpty)},_isInGroup:function(t){return Array.isArray(this.options.group)?-1!==e.inArray(t,this.options.group):this.options.group===t},isValid:function(t){if(arguments.length>=1&&!e.isPlainObject(t)){a.warnOnce("Calling isValid on a parsley field without passing arguments as an object is deprecated.");var i=_slice.call(arguments),n=i[0],r=i[1];t={force:n,value:r}}var s=this.whenValid(t);return!s||E[s.state()]},whenValid:function(){var t=this,i=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=i.force,r=void 0!==n&&n,s=i.value,o=i.group,l=i._refreshed;if(l||this.refresh(),!o||this._isInGroup(o)){if(this.validationResult=!0,!this.hasConstraints())return e.when();if("undefined"!=typeof s&&null!==s||(s=this.getValue()),!this.needsValidation(s)&&!0!==r)return e.when();var u=this._getGroupedConstraints(),d=[];return e.each(u,function(i,n){var r=a.all(e.map(n,function(e){return t._validateConstraint(s,e)}));if(d.push(r),"rejected"===r.state())return!1}),a.all(d)}},_validateConstraint:function(t,i){var n=this,r=i.validate(t,this);return!1===r&&(r=e.Deferred().reject()),a.all([r]).fail(function(e){n.validationResult instanceof Array||(n.validationResult=[]),n.validationResult.push({assert:i,errorMessage:"string"==typeof e&&e})})},getValue:function(){var e;return e="function"==typeof this.options.value?this.options.value(this):"undefined"!=typeof this.options.value?this.options.value:this.$element.val(),"undefined"==typeof e||null===e?"":this._handleWhitespace(e)},reset:function(){return this._resetUI(),this._trigger("reset")},destroy:function(){this._destroyUI(),this.$element.removeData("Parsley"),this.$element.removeData("FieldMultiple"),this._trigger("destroy")},refresh:function(){return this._refreshConstraints(),this},_refreshConstraints:function(){return this.actualizeOptions()._bindConstraints()},refreshConstraints:function(){return a.warnOnce("Parsley's refreshConstraints is deprecated. Please use refresh"),this.refresh()},addConstraint:function(e,t,i,n){if(window.Parsley._validatorRegistry.validators[e]){var r=new F(this,e,t,i,n);"undefined"!==this.constraintsByName[r.name]&&this.removeConstraint(r.name),this.constraints.push(r),this.constraintsByName[r.name]=r}return this},removeConstraint:function(e){for(var t=0;t1){var i=[];return this.each(function(){i.push(e(this).parsley(t))}),i}if(0!=this.length)return new P(this[0],t)},"undefined"==typeof window.ParsleyExtend&&(window.ParsleyExtend={}),T.options=_extends(a.objectCreate(o),window.ParsleyConfig),window.ParsleyConfig=T.options,window.Parsley=window.psly=T,T.Utils=a,window.ParsleyUtils={},e.each(a,function(e,t){"function"==typeof t&&(window.ParsleyUtils[e]=function(){return a.warnOnce("Accessing `window.ParsleyUtils` is deprecated. Use `window.Parsley.Utils` instead."),a[e].apply(a,arguments)})});var O=window.Parsley._validatorRegistry=new p(window.ParsleyConfig.validators,window.ParsleyConfig.i18n);window.ParsleyValidator={},e.each("setLocale addCatalog addMessage addMessages getErrorMessage formatMessage addValidator updateValidator removeValidator hasValidator".split(" "),function(e,t){window.Parsley[t]=function(){return O[t].apply(O,arguments)},window.ParsleyValidator[t]=function(){var e;return a.warnOnce("Accessing the method '"+t+"' through Validator is deprecated. Simply call 'window.Parsley."+t+"(...)'"),(e=window.Parsley)[t].apply(e,arguments)}}),window.Parsley.UI=y,window.ParsleyUI={removeError:function(e,t,i){var n=!0!==i;return a.warnOnce("Accessing UI is deprecated. Call 'removeError' on the instance directly. Please comment in issue 1073 as to your need to call this method."),e.removeError(t,{updateClass:n})},getErrorsMessages:function(e){return a.warnOnce("Accessing UI is deprecated. Call 'getErrorsMessages' on the instance directly."),e.getErrorsMessages()}},e.each("addError updateError".split(" "),function(e,t){window.ParsleyUI[t]=function(e,i,n,r,s){var o=!0!==s;return a.warnOnce("Accessing UI is deprecated. Call '"+t+"' on the instance directly. Please comment in issue 1073 as to your need to call this method."),e[t](i,{message:n,assert:r,updateClass:o})}}),!1!==window.ParsleyConfig.autoBind&&e(function(){e("[data-parsley-validate]").length&&e("[data-parsley-validate]").parsley()});var M=e({}),R=function(){a.warnOnce("Parsley's pubsub module is deprecated; use the 'on' and 'off' methods on parsley instances or window.Parsley")},D="parsley:";e.listen=function(e,n){var r;if(R(),"object"==typeof arguments[1]&&"function"==typeof arguments[2]&&(r=arguments[1],n=arguments[2]),"function"!=typeof n)throw new Error("Wrong parameters");window.Parsley.on(i(e),t(n,r))},e.listenTo=function(e,n,r){if(R(),!(e instanceof x||e instanceof w))throw new Error("Must give Parsley instance");if("string"!=typeof n||"function"!=typeof r)throw new Error("Wrong parameters");e.on(i(n),t(r))},e.unsubscribe=function(e,t){if(R(),"string"!=typeof e||"function"!=typeof t)throw new Error("Wrong arguments");window.Parsley.off(i(e),t.parsleyAdaptedCallback)},e.unsubscribeTo=function(e,t){if(R(),!(e instanceof x||e instanceof w))throw new Error("Must give Parsley instance");e.off(i(t))},e.unsubscribeAll=function(t){R(),window.Parsley.off(i(t)),e("form,input,textarea,select").each(function(){var n=e(this).data("Parsley");n&&n.off(i(t))})},e.emit=function(e,t){var n;R();var r=t instanceof x||t instanceof w,s=Array.prototype.slice.call(arguments,r?2:1);s.unshift(i(e)),r||(t=window.Parsley),(n=t).trigger.apply(n,_toConsumableArray(s))};e.extend(!0,T,{asyncValidators:{"default":{fn:function(e){return e.status>=200&&e.status<300},url:!1},reverse:{fn:function(e){return e.status<200||e.status>=300},url:!1}},addAsyncValidator:function(e,t,i,n){return T.asyncValidators[e]={fn:t,url:i||!1,options:n||{}},this}}),T.addValidator("remote",{requirementType:{"":"string",validator:"string",reverse:"boolean",options:"object"},validateString:function(t,i,n,r){var s,a,o={},l=n.validator||(!0===n.reverse?"reverse":"default");if("undefined"==typeof T.asyncValidators[l])throw new Error("Calling an undefined async validator: `"+l+"`");i=T.asyncValidators[l].url||i,i.indexOf("{value}")>-1?i=i.replace("{value}",encodeURIComponent(t)):o[r.element.getAttribute("name")||r.element.getAttribute("id")]=t;var u=e.extend(!0,n.options||{},T.asyncValidators[l].options);s=e.extend(!0,{},{url:i,data:o,type:"GET"},u),r.trigger("field:ajaxoptions",r,s),a=e.param(s),"undefined"==typeof T._remoteCache&&(T._remoteCache={});var d=T._remoteCache[a]=T._remoteCache[a]||e.ajax(s),h=function(){var t=T.asyncValidators[l].fn.call(r,d,i,n);return t||(t=e.Deferred().reject()),e.when(t)};return d.then(h,h)},priority:-1}),T.on("form:submit",function(){T._remoteCache={}}),l.prototype.addAsyncValidator=function(){return a.warnOnce("Accessing the method `addAsyncValidator` through an instance is deprecated. Simply call `Parsley.addAsyncValidator(...)`"),T.addAsyncValidator.apply(T,arguments)},T.addMessages("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."}),T.setLocale("en");var I=new n;I.install();var q=T;return q}); +//# sourceMappingURL=parsley.min.js.map diff --git a/style/fluidbook.less b/style/fluidbook.less index ed813cd6..37633444 100644 --- a/style/fluidbook.less +++ b/style/fluidbook.less @@ -926,7 +926,7 @@ a.bookmark { &.cart-totals { width: 250px; - margin: 18px; + margin: 18px 18px 50px; float: right; clear: both; td.hr { @@ -947,6 +947,69 @@ a.bookmark { } } + .cart-footer { + clear: both; + width: 100%; + text-align: left; + p { + float: left; + width: 450px; + font-size: 0.8em; + margin-top: 10px; + margin-left: 30px; + } + + .fonctions { + float: right; + width: 450px; + } + } + + .cart-shipping-form { + .col { + width: 441px; + margin-top: 30px; + display: inline-block; + text-align: left; + position: relative; + input { + width: 100%; + padding: 18px 15px; + background-color: #fff; + margin-bottom: 25px; + font-size: 1.1em; + border: 2px solid #fff; + + &.parsley-error { + border-color: #cc0000; + } + } + + p { + text-align: left; + padding: 15px 10px 15px 10px; + } + + &.col-left { + left: -5px; + margin-right: 80px; + } + } + + .cart-footer { + margin-top: 10px; + } + + .parsley-errors-list { + display: none; + } + } + + .cart-confirmation { + margin: 50px 0; + text-align: left; + padding: 0 30px; + } } // Hack for #1433