From: Vincent Vanwaelscappel Date: Wed, 26 Sep 2018 15:53:51 +0000 (+0200) Subject: wip #2208 @5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=5840ba43f5e15fd996feecc1dce60031ece20be8;p=fluidbook-html5.git wip #2208 @5 --- diff --git a/js/libs/fluidbook/fluidbook.js b/js/libs/fluidbook/fluidbook.js index 3052da2d..e994c88e 100644 --- a/js/libs/fluidbook/fluidbook.js +++ b/js/libs/fluidbook/fluidbook.js @@ -65,7 +65,9 @@ Fluidbook.prototype = { this.form = new FluidbookBulleForm(this); } else if (this.datas.form == 'bourbon') { this.form = new FluidbookBourbonForm(this); - } else { + } else if(this.datas.form=='avery'){ + this.form = new FluidbookAveryForm(this); + }else{ this.form == false; } this.privacy = new FluidbookPrivacy(this); diff --git a/js/libs/fluidbook/forms/fluidbook.form.avery.js b/js/libs/fluidbook/forms/fluidbook.form.avery.js index 24f95d87..4d443b3b 100644 --- a/js/libs/fluidbook/forms/fluidbook.form.avery.js +++ b/js/libs/fluidbook/forms/fluidbook.form.avery.js @@ -3,6 +3,26 @@ function FluidbookAveryForm(fluidbook) { this.locales = { en: { + title: 'Discover what our full Avery Dennison portfolio can do for you', + subtitle: 'Register using this form for access to our current and future digital catalogues.', + company: 'Company', + country: 'Country', + activity: 'Activity', + printer: 'Printer', + installer: 'Installer', + designer: 'Designer / Agency', + brandowner: 'Brand owner', + other: 'Other', + email_address: 'E-mail address', + receive: 'Do you want to receive our free monthly e-newsletter', + yes: 'Yes', + no: 'No', + consent: 'I have read and agree to the Avery Dennison Legal and Privacy Notices', + submit: 'Submit', + nothanks: 'No, thanks', + choose_country: 'Please choose a country', + }, + fr: { title: 'Discover what our full Avery Dennison portfolio can do for you', subtitle: 'Register using this form for access to our current and future digital catalogues.', company: 'Company', @@ -23,8 +43,7 @@ function FluidbookAveryForm(fluidbook) { } }; - this.locale = this.locales[this.fluidbook.datas.lang]; - + this.locale = this.locales[this.fluidbook.l10n.getActiveLang()]; this.formInstance; this.init(); @@ -34,6 +53,12 @@ FluidbookAveryForm.prototype = { init: function () { var $this = this; + $(this.fluidbook).on('fluidbook.splash.hide', function () { + $this.openForm('', '', function () { + + }); + }); + $(document).on('click', '.avery-form .submit', function () { $this.formInstance = $(".avery-form").parsley(); if ($this.formInstance.validate()) { @@ -44,40 +69,50 @@ FluidbookAveryForm.prototype = { }, - openSuggest: function (p1, p2, callback) { - var view = '
' + this.closeButton() + '

' + this.locale.title + '

'; + openForm: function (p1, p2, callback) { + var $this = this; + var view = '
' + $this.fluidbook.menu.closeButton() + '

' + $this.locale.title + '

'; view += '
'; view += '
'; view += '
'; - view += '
'; - view += ''; + view += ''; view += '
'; view += '
'; - $("#view").append('
' + view + '
'); + $("#view").append('
' + view + '
'); + + var options = ['']; + $.each(this.fluidbook.datas.countries, function (code, name) { + options.push(''); + }); + $(".mview select[name='country']").html(options.join('')); + + this.fluidbook.menu.openingView(function () { + callback(); + }); - callback(); }, submitForm: function () { var $this = this;