diff --git a/GruntFile.js b/GruntFile.js index 5e84105..86df856 100644 --- a/GruntFile.js +++ b/GruntFile.js @@ -1,11 +1,12 @@ -module.exports = function(grunt) { +module.exports = function( grunt ) +{ - grunt.initConfig({ - pkg: grunt.file.readJSON('package.json'), + grunt.initConfig( { + pkg: grunt.file.readJSON( 'package.json' ), clean: { debug: ['debug'], - doc: ['doc'], + doc : ['doc'], build: ['dist'] }, @@ -21,41 +22,42 @@ module.exports = function(grunt) { // - PhantomJS // - IE (only Windows) // CLI --browsers Chrome,Firefox,Safari - browsers: ['PhantomJS'], - verbose: true, - logLevel: 'WARN' + browsers : ['PhantomJS'], + verbose : true, + logLevel : 'WARN' } }, htmlConvert: { - options: { - base: 'src/partials/', + options : { + base : 'src/partials/', module: 'TemplateCache' }, templates: { - src: ['src/partials/**/*.html'], + src : ['src/partials/**/*.html'], dest: 'tmp/templates.js' } }, concat: { debug: { - src: [ 'libs/mustache.min.js', 'src/helpers/*.js', 'tmp/templates.js', 'src/plentyFramework.js', 'src/partials/**/*.js', 'src/factories/*.js', 'src/services/*.js', 'src/directives/*.js', 'src/plentyFrameworkCompiler.js'], + src : ['libs/mustache.min.js', 'src/helpers/*.js', 'tmp/templates.js', 'src/plentyFramework.js', 'src/partials/**/*.js', 'src/factories/*.js', 'src/services/*.js', 'src/directives/*.js', 'src/plentyFrameworkCompiler.js'], dest: 'debug/<%= pkg.name %>-<%= pkg.version %>.js' } }, uglify: { - compress:{ - "pure_funcs": [ 'console.log' ], - unused: true, - "join_vars": true + compress: { + "pure_funcs": ['console.log'], + unused : true, + "join_vars" : true }, - options: { - banner: '/**\n * Licensed under AGPL v3\n * (https://github.com/plentymarkets/plenty-cms-library/blob/master/LICENSE)\n * =====================================================================================\n * @copyright Copyright (c) 2015, plentymarkets GmbH (http://www.plentymarkets.com)\n * @author Felix Dausch \n * =====================================================================================\n*/' + options : { + sourceMap: true, + banner : '/**\n * Licensed under AGPL v3\n * (https://github.com/plentymarkets/plenty-cms-library/blob/master/LICENSE)\n * =====================================================================================\n * @copyright Copyright (c) 2015, plentymarkets GmbH (http://www.plentymarkets.com)\n * @author Felix Dausch \n * =====================================================================================\n*/' }, - build: { - src: 'debug/<%= pkg.name %>-<%= pkg.version %>.js', + build : { + src : 'debug/<%= pkg.name %>-<%= pkg.version %>.js', dest: 'dist/<%= pkg.name %>-<%= pkg.version %>.min.js' } }, @@ -63,7 +65,7 @@ module.exports = function(grunt) { yuidoc: { doc: { options: { - paths: 'src/', + paths : 'src/', outdir: 'doc/' } } @@ -72,30 +74,30 @@ module.exports = function(grunt) { copy: { debug: { expand: true, - src: 'lang/*', - dest: 'debug/' + src : 'lang/*', + dest : 'debug/' }, build: { expand: true, - cwd: 'debug/', - src: '**', - dest: 'dist/' + cwd : 'debug/', + src : '**', + dest : 'dist/' } } - }); + } ); - grunt.loadNpmTasks('grunt-contrib-clean'); - grunt.loadNpmTasks('grunt-contrib-concat'); - grunt.loadNpmTasks('grunt-contrib-uglify'); - grunt.loadNpmTasks('grunt-contrib-yuidoc'); - grunt.loadNpmTasks('grunt-contrib-copy'); - grunt.loadNpmTasks('grunt-karma'); - grunt.loadNpmTasks('grunt-html-convert'); + grunt.loadNpmTasks( 'grunt-contrib-clean' ); + grunt.loadNpmTasks( 'grunt-contrib-concat' ); + grunt.loadNpmTasks( 'grunt-contrib-uglify' ); + grunt.loadNpmTasks( 'grunt-contrib-yuidoc' ); + grunt.loadNpmTasks( 'grunt-contrib-copy' ); + grunt.loadNpmTasks( 'grunt-karma' ); + grunt.loadNpmTasks( 'grunt-html-convert' ); - grunt.registerTask('debug', ['clean:debug', 'copy:debug', 'htmlConvert', 'concat:debug']); - grunt.registerTask('doc', ['clean:doc', 'yuidoc:doc']); - grunt.registerTask('build', ['debug', 'doc', 'karma', 'clean:build', 'uglify:build', 'copy:build']); - grunt.registerTask('build-skip-tests', ['debug', 'doc', 'clean:build', 'uglify:build', 'copy:build']); - grunt.registerTask('default', ['debug']); + grunt.registerTask( 'debug', ['clean:debug', 'copy:debug', 'htmlConvert', 'concat:debug'] ); + grunt.registerTask( 'doc', ['clean:doc', 'yuidoc:doc'] ); + grunt.registerTask( 'build', ['debug', 'doc', 'karma', 'clean:build', 'uglify:build', 'copy:build'] ); + grunt.registerTask( 'build-skip-tests', ['debug', 'doc', 'clean:build', 'uglify:build', 'copy:build'] ); + grunt.registerTask( 'default', ['debug'] ); }; \ No newline at end of file diff --git a/dist/lang/de_DE.json b/dist/lang/de_DE.json index 98a1169..686dee2 100644 --- a/dist/lang/de_DE.json +++ b/dist/lang/de_DE.json @@ -1,4 +1,5 @@ { + "OK": "OK", "Close": "Schließen", "Cancel": "Abbrechen", "Confirm": "Bestätigen", @@ -9,5 +10,7 @@ "Select order parameters": "Bestellmerkmale wählen", "Edit order parameters": "Bestellmerkmale ändern", "Packstations and post offices in your area": "Packstationen und Postfilialen in der Nähe", - "Please enter a ZIP code and/or a city.": "Bitte geben Sie eine Postleitzahl und/oder einen Ort an." + "Please enter a ZIP code and/or a city.": "Bitte geben Sie eine Postleitzahl und/oder einen Ort an.", + "Your session has expired.": "Sie sind nicht mehr angemeldet.", + "Please log in again to continue shopping.": "Bitte melden Sie sich erneut an, um weiter einzukaufen." } \ No newline at end of file diff --git a/dist/lang/en_EN.json b/dist/lang/en_EN.json index d67956c..bdba365 100644 --- a/dist/lang/en_EN.json +++ b/dist/lang/en_EN.json @@ -1,4 +1,5 @@ { + "OK": "OK", "Close": "Close", "Cancel": "Cancel", "Confirm": "Confirm", @@ -9,5 +10,7 @@ "Select order parameters": "Select order parameters", "Edit order parameters": "Edit order parameters", "Packstations and post offices in your area": "Packstations and post offices in your area", - "Please enter a ZIP code and/or a city.": "Please enter a ZIP code and/or a city." + "Please enter a ZIP code and/or a city.": "Please enter a ZIP code and/or a city.", + "Your session has expired.": "Your session has expired.", + "Please log in again to continue shopping.": "Please log in again to continue shopping." } \ No newline at end of file diff --git a/dist/plentymarketsCMStools-1.0.3.min.js b/dist/plentymarketsCMStools-1.0.3.min.js deleted file mode 100644 index 9c6bf00..0000000 --- a/dist/plentymarketsCMStools-1.0.3.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Licensed under AGPL v3 - * (https://github.com/plentymarkets/plenty-cms-library/blob/master/LICENSE) - * ===================================================================================== - * @copyright Copyright (c) 2015, plentymarkets GmbH (http://www.plentymarkets.com) - * @author Felix Dausch - * ===================================================================================== -*/!function(a,b){"object"==typeof exports&&exports&&"string"!=typeof exports.nodeName?b(exports):"function"==typeof define&&define.amd?define(["exports"],b):(a.Mustache={},b(Mustache))}(this,function(a){function b(a){return"function"==typeof a}function c(a){return p(a)?"array":typeof a}function d(a){return a.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function e(a,b){return null!=a&&"object"==typeof a&&b in a}function f(a,b){return q.call(a,b)}function g(a){return!f(r,a)}function h(a){return String(a).replace(/[&<>"'\/]/g,function(a){return s[a]})}function i(b,c){function e(){if(r&&!s)for(;q.length;)delete o[q.pop()];else q=[];r=!1,s=!1}function f(a){if("string"==typeof a&&(a=a.split(u,2)),!p(a)||2!==a.length)throw new Error("Invalid tags: "+a);h=new RegExp(d(a[0])+"\\s*"),i=new RegExp("\\s*"+d(a[1])),m=new RegExp("\\s*"+d("}"+a[1]))}if(!b)return[];var h,i,m,n=[],o=[],q=[],r=!1,s=!1;f(c||a.tags);for(var y,z,A,B,C,D,E=new l(b);!E.eos();){if(y=E.pos,A=E.scanUntil(h))for(var F=0,G=A.length;G>F;++F)B=A.charAt(F),g(B)?q.push(o.length):s=!0,o.push(["text",B,y,y+1]),y+=1,"\n"===B&&e();if(!E.scan(h))break;if(r=!0,z=E.scan(x)||"name",E.scan(t),"="===z?(A=E.scanUntil(v),E.scan(v),E.scanUntil(i)):"{"===z?(A=E.scanUntil(m),E.scan(w),E.scanUntil(i),z="&"):A=E.scanUntil(i),!E.scan(i))throw new Error("Unclosed tag at "+E.pos);if(C=[z,A,y,E.pos],o.push(C),"#"===z||"^"===z)n.push(C);else if("/"===z){if(D=n.pop(),!D)throw new Error('Unopened section "'+A+'" at '+y);if(D[1]!==A)throw new Error('Unclosed section "'+D[1]+'" at '+y)}else"name"===z||"{"===z||"&"===z?s=!0:"="===z&&f(A)}if(D=n.pop())throw new Error('Unclosed section "'+D[1]+'" at '+E.pos);return k(j(o))}function j(a){for(var b,c,d=[],e=0,f=a.length;f>e;++e)b=a[e],b&&("text"===b[0]&&c&&"text"===c[0]?(c[1]+=b[1],c[3]=b[3]):(d.push(b),c=b));return d}function k(a){for(var b,c,d=[],e=d,f=[],g=0,h=a.length;h>g;++g)switch(b=a[g],b[0]){case"#":case"^":e.push(b),f.push(b),e=b[4]=[];break;case"/":c=f.pop(),c[5]=b[2],e=f.length>0?f[f.length-1][4]:d;break;default:e.push(b)}return d}function l(a){this.string=a,this.tail=a,this.pos=0}function m(a,b){this.view=a,this.cache={".":this.view},this.parent=b}function n(){this.cache={}}var o=Object.prototype.toString,p=Array.isArray||function(a){return"[object Array]"===o.call(a)},q=RegExp.prototype.test,r=/\S/,s={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},t=/\s*/,u=/\s+/,v=/\s*=/,w=/\s*\}/,x=/#|\^|\/|>|\{|&|=|!/;l.prototype.eos=function(){return""===this.tail},l.prototype.scan=function(a){var b=this.tail.match(a);if(!b||0!==b.index)return"";var c=b[0];return this.tail=this.tail.substring(c.length),this.pos+=c.length,c},l.prototype.scanUntil=function(a){var b,c=this.tail.search(a);switch(c){case-1:b=this.tail,this.tail="";break;case 0:b="";break;default:b=this.tail.substring(0,c),this.tail=this.tail.substring(c)}return this.pos+=b.length,b},m.prototype.push=function(a){return new m(a,this)},m.prototype.lookup=function(a){var c,d=this.cache;if(d.hasOwnProperty(a))c=d[a];else{for(var f,g,h=this,i=!1;h;){if(a.indexOf(".")>0)for(c=h.view,f=a.split("."),g=0;null!=c&&gi;++i)g=void 0,e=a[i],f=e[0],"#"===f?g=this.renderSection(e,b,c,d):"^"===f?g=this.renderInverted(e,b,c,d):">"===f?g=this.renderPartial(e,b,c,d):"&"===f?g=this.unescapedValue(e,b):"name"===f?g=this.escapedValue(e,b):"text"===f&&(g=this.rawValue(e)),void 0!==g&&(h+=g);return h},n.prototype.renderSection=function(a,c,d,e){function f(a){return g.render(a,c,d)}var g=this,h="",i=c.lookup(a[1]);if(i){if(p(i))for(var j=0,k=i.length;k>j;++j)h+=this.renderTokens(a[4],c.push(i[j]),d,e);else if("object"==typeof i||"string"==typeof i||"number"==typeof i)h+=this.renderTokens(a[4],c.push(i),d,e);else if(b(i)){if("string"!=typeof e)throw new Error("Cannot use higher-order sections without the original template");i=i.call(c.view,e.slice(a[3],a[5]),f),null!=i&&(h+=i)}else h+=this.renderTokens(a[4],c,d,e);return h}},n.prototype.renderInverted=function(a,b,c,d){var e=b.lookup(a[1]);return!e||p(e)&&0===e.length?this.renderTokens(a[4],b,c,d):void 0},n.prototype.renderPartial=function(a,c,d){if(d){var e=b(d)?d(a[1]):d[a[1]];return null!=e?this.renderTokens(this.parse(e),c,d,e):void 0}},n.prototype.unescapedValue=function(a,b){var c=b.lookup(a[1]);return null!=c?c:void 0},n.prototype.escapedValue=function(b,c){var d=c.lookup(b[1]);return null!=d?a.escape(d):void 0},n.prototype.rawValue=function(a){return a[1]},a.name="mustache.js",a.version="2.1.3",a.tags=["{{","}}"];var y=new n;a.clearCache=function(){return y.clearCache()},a.parse=function(a,b){return y.parse(a,b)},a.render=function(a,b,d){if("string"!=typeof a)throw new TypeError('Invalid template! Template should be a "string" but "'+c(a)+'" was given as the first argument for mustache#render(template, view, partials)');return y.render(a,b,d)},a.to_html=function(c,d,e,f){var g=a.render(c,d,e);return b(f)?void f(g):g},a.escape=h,a.Scanner=l,a.Context=m,a.Writer=n}),Object.equals=function(a,b){if(a===b)return!0;if(!(a instanceof Object&&b instanceof Object))return!1;if(a.constructor!==b.constructor)return!1;for(var c in a)if(a.hasOwnProperty(c)){if(!b.hasOwnProperty(c))return!1;if(a[c]!==b[c]){if("object"!=typeof a[c])return!1;if(!Object.equals(a[c],b[c]))return!1}}for(var c in b)if(b.hasOwnProperty(c)&&!a.hasOwnProperty(c))return!1;return!0};var TemplateCache={};TemplateCache["addressSuggestions/addressDoctor.html"]='',TemplateCache["addressSuggestions/postFinder.html"]='{{#addresses}}\n
\n
\n \n
\n
\n{{/addresses}}\n',TemplateCache["error/errorMessage.html"]='
\n Code {{code}}:\n {{{message}}}\n
\n',TemplateCache["error/errorPopup.html"]='
\n \n
\n
\n
\n',TemplateCache["modal/modal.html"]='\n',TemplateCache["waitscreen/waitscreen.html"]='
',function(a){function b(a,b,c,d){a.on(b,function(a){return h.push(a),c.apply(null,d)})}function c(b){var c=a(b);c.is('input[type="checkbox"]')&&c.on("change",function(){c.is(":checked")?c.trigger("check"):c.trigger("uncheck")}),c.is('input[type="radio"]')&&c.on("change",function(){var b=c.attr("name");a('input[type="radio"][name="'+b+'"]').each(function(b,c){var d=a(c);d.is(":checked")?d.trigger("check"):d.trigger("uncheck")})})}function d(a,b){for(var c=/^(([\w]+):)?([\w]+)\.([\w]+)(\((.*)\))?$/,d=a.split(";"),e=[],f=0;f0)for(var j=h[6].match(/(['][^']+['])|([\w-]+)|(["][^"]+["])/g),k=0;k=c&&f.services.hasOwnProperty(i)){PlentyFramework.prototype.hasOwnProperty(i)||e(f.services[i],2,d),g.push(PlentyFramework.prototype[i]);continue}if(1>=c&&f.directives.hasOwnProperty(i)){PlentyFramework.directives.hasOwnProperty(i)||e(f.directives[i],1,d),g.push(PlentyFramework.directives[i]);continue}console.error('Cannot inject dependency "'+i+'": Object not found.')}else console.error("Cyclic dependency injection: "+d.join(" -> ")+" -> "+i)}3==c?PlentyFramework.factories[b.name]=b.setup.apply(null,g):2==c?PlentyFramework.prototype[b.name]=b.setup.apply(null,g):1==c&&(PlentyFramework.directives[b.name]=b.setup.apply(null,g))}var f={factories:{},services:{},directives:{}};PlentyFramework=function(){};var g=null;PlentyFramework.getInstance=function(){return g=g||new PlentyFramework},PlentyFramework.partials={},PlentyFramework.globals={},PlentyFramework.setGlobal=function(a,b){return PlentyFramework.globals.hasOwnProperty(a)?(console.error('Global variable "'+a+'" already exists and cannot be overridden.'),null):(PlentyFramework.globals[a]=b,PlentyFramework.globals[a])},PlentyFramework.getGlobal=function(a){return PlentyFramework.globals[a]},PlentyFramework.directives={},PlentyFramework.directive=function(a,b,c){return"string"!=typeof a?void console.error("Type mismatch: Expect first parameter to be a 'string', '"+typeof a+"' given."):"function"!=typeof b?void console.error("Type mismatch: Expect second parameter to be a 'function', '"+typeof b+"' given."):(c=c||[],void(f.directives[a]={name:a,dependencies:c,setup:b}))},PlentyFramework.prototype.bindDirectives=function(e){e=e||"html",a(e).find("[data-plenty]").each(function(e,f){var g=d(a(f).attr("data-plenty"),a(f));if(!(g.length<=0)){c(f);for(var e=0;e=0;c--)if(a==h[c].type)return h[c];return null},PlentyFramework.pushEvent=function(a){h.push(a)},PlentyFramework.service=function(a,b,c){return"string"!=typeof a?void console.error("Type mismatch: Expect first parameter to be a 'string', '"+typeof a+"' given."):"function"!=typeof b?void console.error("Type mismatch: Expect second parameter to be a 'function', '"+typeof b+"' given."):(c=c||[],void(f.services[a]={name:a,dependencies:c,setup:b}))},PlentyFramework.factories={},PlentyFramework.factory=function(a,b,c){return"string"!=typeof a?void console.error("Type mismatch: Expect first parameter to be a 'string', '"+typeof a+"' given."):"function"!=typeof b?void console.error("Type mismatch: Expect second parameter to be a 'function', '"+typeof b+"' given."):(c=c||[],void(f.factories[a]={name:a,dependencies:c,setup:b}))},PlentyFramework.compileTemplate=function(a,b){return b=b||{},b.translate=function(){return function(a,b){return b(PlentyFramework.translate(a))}},Mustache.render(TemplateCache[a],b)},PlentyFramework.scriptPath="",PlentyFramework.Strings={},PlentyFramework.loadLanguageFile=function(b){a.get(PlentyFramework.scriptPath+b).done(function(a){PlentyFramework.Strings=a})},PlentyFramework.translate=function(a,b){var c;return PlentyFramework.Strings.hasOwnProperty(a)?c=PlentyFramework.Strings[a]:(c=a,console.warn('No translation found for "'+c+'".')),b&&(c=Mustache.render(c,b)),c},PlentyFramework.compile=function(){for(var a in f.factories)PlentyFramework.factories.hasOwnProperty(a)||e(f.factories[a],3);for(var b in f.services)PlentyFramework.prototype.hasOwnProperty(b)||e(f.services[b],2);for(var c in f.directives)PlentyFramework.directives.hasOwnProperty(c)||e(f.directives[c],1);var d=document.getElementsByTagName("SCRIPT");d.length>0&&(PlentyFramework.scriptPath=d[d.length-1].src.match(/(.*)\/(.*)\.js(\?\S*)?$/)[1])}}(jQuery),PlentyFramework.cssClasses={active:"active"},function(a,b){b.partials.Error={init:function(b){a(b).find(".close").click(function(){b.hide(),b.find(".plentyErrorBoxInner").html("")})},addError:function(b,c){var d=a(c).attr("data-plenty-error-code");a(b).find('[data-plenty-error-code="'+d+'"]').length<=0&&a(b).find(".plentyErrorBoxInner").append(c)},show:function(b){a(b).show()}}}(jQuery,PlentyFramework),function(a,b){b.partials.Modal={init:function(a,b){a.on("hidden.bs.modal",function(){b.hide(),a.remove()}),b.timeout>0&&(a.on("hide.bs.modal",b.stopTimeout),a.find(".modal-content").hover(function(){b.pauseTimeout()},function(){a.is(".in")&&b.continueTimeout()}))},show:function(a){a.modal("show")},hide:function(a){a.modal("hide")},isModal:function(b){return a(b).filter(".modal").length+a(b).find(".modal").length>0},getModal:function(b){var c=a(b);return c.length>1&&(c=a(b).filter(".modal")||a(b).find(".modal")),c}}}(jQuery,PlentyFramework),function(a){a(document).on("initPartials",function(b,c){a(c).find('[data-toggle="tooltip"]').tooltip({container:"body"})})}(jQuery),function(a,b){b.partials.WaitScreen={show:function(a){a.addClass("in")},hide:function(a){a.removeClass("in")}}}(jQuery,PlentyFramework),function(a,b){b.factory("APIFactory",function(b){function c(c){try{var d=a.parseJSON(c.responseText);b.printErrors(d.error.error_stack)}catch(e){b.throwError(c.status,c.statusText)}}function d(d,e,f,g,h){return g||b.showWaitScreen(),a.ajax(d,{type:"GET",data:e,dataType:"json",async:!h,error:function(a){f||c(a)}}).always(function(){g||b.hideWaitScreen()})}function e(d,e,f,g){var h={type:"POST",dataType:"json",error:function(a){f||c(a)}};return e&&e.isFile?(h.cache=e.cache,h.processData=e.processData,h.data=e.data,h.contentType=!1):(h.data=JSON.stringify(e),h.contentType="application/json"),g||b.showWaitScreen(),a.ajax(d,h).always(function(){g||b.hideWaitScreen()})}function f(d,e,f,g){return g||b.showWaitScreen(),a.ajax(d,{type:"PUT",data:JSON.stringify(e),dataType:"json",contentType:"application/json",error:function(a){f||c(a)}}).always(function(){g||b.hideWaitScreen()})}function g(d,e,f,g){return g||b.showWaitScreen(),a.ajax(d,{type:"DELETE",data:JSON.stringify(e),dataType:"json",contentType:"application/json",error:function(a){f||c(a)}}).always(function(){g||b.hideWaitScreen()})}function h(){return a.Deferred().resolve()}return{get:d,post:e,put:f,"delete":g,idle:h}},["UIFactory"])}(jQuery,PlentyFramework),function(a){a.factory("CMSFactory",function(a){function b(b,c){function d(d){return a.get("/rest/"+d.toLowerCase()+"/container_"+b.toLowerCase()+"/",c)}return{from:d}}function c(b,c){function d(d){return a.get("/rest/"+d.toLowerCase()+"/"+b.toLowerCase()+"/",c)}return{from:d}}function d(b){return a.get("/rest/categoryview/categorycontentbody/?categoryID="+b)}return{getContainer:b,getParams:c,getCategoryContent:d}},["APIFactory"])}(PlentyFramework),function(a){a.factory("CheckoutFactory",function(b,c,d){function e(){return l}function f(a){return m&&l||g(!0),a?$.extend(!0,{},l):m}function g(a){return b.get("/rest/checkout/",null,!1,!1,a).done(function(a){a?(l=a.data,m=new e):d.throwError(0,'Could not receive checkout data [GET "/rest/checkout/" receives null value]')})}function h(){return b.put("/rest/checkout",m).done(function(a){a?(l=a.data,m=new e):d.throwError(0,'Could not receive checkout data [GET "/rest/checkout/" receives null value]')})}function i(b){return c.getContainer("checkout"+b).from("checkout").done(function(c){$('[data-plenty-checkout-template="'+b+'"]').each(function(b,d){$(d).html(c.data[0]),a.getInstance().bindDirectives(d),$(window).trigger("contentChanged")})})}function j(b){return c.getCategoryContent(b).done(function(c){$('[data-plenty-checkout-catcontent="'+b+'"]').each(function(b,d){$(d).html(c.data[0]),a.getInstance().bindDirectives(d),$(window).trigger("contentChanged")})})}function k(b){return c.getContainer("itemview"+b).from("itemview").done(function(c){$('[data-plenty-itemview-template="'+b+'"]').each(function(b,d){$(d).html(c.data[0]),a.getInstance().bindDirectives(d),$(window).trigger("contentChanged")})})}var l,m;return{getCheckout:f,setCheckout:h,loadCheckout:g,reloadContainer:i,reloadCatContent:j,reloadItemContainer:k}},["APIFactory","CMSFactory","UIFactory"])}(PlentyFramework),function(a,b){b.factory("ModalFactory",function(){function c(a){return PlentyFramework.partials.Modal.isModal(a)}function d(){return new e}function e(){function d(a){return s.title=a,this}function e(a){return s.cssClass=a,this}function f(a){return s.content=a,this}function g(a){return s.labelConfirm=a,this}function h(a){return s.labelDismiss=a,this}function i(a){return s.onConfirm=a,this}function j(a){return s.onDismiss=a,this}function k(a){return s.container=a,this}function l(a){return s.timeout=a,this}function m(){t=c(s.content)?PlentyFramework.partials.Modal.getModal(s.content):a(PlentyFramework.compileTemplate("modal/modal.html",s)),a(s.container).append(t);var b=a(s.content).filter("script");b.length>0&&b.each(function(b,c){var d=document.createElement("script");d.type="text/javascript",d.innerHTML=a(c).text(),a(s.container).append(d)}),PlentyFramework.partials.Modal.init(t,s),t.find('[data-plenty-modal="confirm"]').click(function(){var a=s.onConfirm();"undefined"==typeof a&&(a=!0),a&&n(!0)}),PlentyFramework.partials.Modal.show(t),s.timeout>0&&o()}function n(a){PlentyFramework.partials.Modal.hide(t),a||s.onDismiss()}function o(){w=s.timeout,x=(new Date).getTime(),u=window.setTimeout(function(){window.clearInterval(v),n()},s.timeout),t.find('[data-plenty-modal="timer"]').text(w/1e3),v=window.setInterval(function(){if(!y){var a=w-(new Date).getTime()+x;a=Math.round(a/1e3),t.find('[data-plenty-modal="timer"]').text(a)}},1e3)}function p(){y=!0,w-=(new Date).getTime()-x,window.clearTimeout(u)}function q(){y=!1,x=(new Date).getTime(),u=window.setTimeout(function(){n(),window.clearInterval(v)},w)}function r(){window.clearTimeout(u),window.clearInterval(v)}var s=this;s.title="",s.cssClass="",s.content="",s.labelDismiss=b.translate("Cancel"),s.labelConfirm=b.translate("Confirm"),s.onConfirm=function(){},s.onDismiss=function(){},s.container="body",s.timeout=-1,s.hide=n,s.startTimeout=o,s.stopTimeout=r,s.pauseTimeout=p,s.continueTimeout=q;var t,u,v,w,x,y=!1;return{setTitle:d,setClass:e,setContent:f,setContainer:k,setLabelConfirm:g,setLabelDismiss:h,onConfirm:i,onDismiss:j,setTimeout:l,show:m,hide:n}}return{prepare:d,isModal:c}})}(jQuery,PlentyFramework),function(a,b){b.factory("UIFactory",function(){function c(a,b){d([{code:a,message:b}])}function d(c){(!i||a("body").has(i).length<=0)&&(i=a(b.compileTemplate("error/errorPopup.html")),a("body").append(i),b.partials.Error.init(i)),a.each(c,function(c,d){b.partials.Error.addError(i,a(b.compileTemplate("error/errorMessage.html",d)))}),b.partials.Error.show(i),f(!0)}function e(){return h=h||0,(!g||a("body").has(g).length<=0)&&(g=a(b.compileTemplate("waitscreen/waitscreen.html")),a("body").append(g)),b.partials.WaitScreen.show(g),h++,h}function f(a){return h--,(0>=h||a)&&(h=0,b.partials.WaitScreen.hide(g)),h}var g,h=0,i=null;return{throwError:c,printErrors:d,showWaitScreen:e,hideWaitScreen:f}})}(jQuery,PlentyFramework),function(a,b){b.service("AddressDoctorService",function(c){function d(b){var c=!0;return b=b||"[data-plenty-address-doctor]",a(b).filter("[data-plenty-address-doctor]:visible").each(function(b,d){var f=new e(d),g=a(d).attr("data-plenty-address-doctor").replace(/\s/g,"").split(",");f.isValid(g)||(c=!1)}),c}function e(c){function d(a){return i()?!0:(j=new f(l.getFormValues()),k=a,e(),1==j.getAddresses().length)}function e(){a(".suggestion-list").remove();for(var b=!1,c=0;cc;c++){var d=a.data[c],f=e(d);f?f.HouseNo.push(d.HouseNo):(d.HouseNo=[d.HouseNo],j.push(d))}})}function e(a){for(var b=j.length,c=0;b>c;c++)if(a.Street==j[c].Street&&j.ZIP==j[c].ZIP&&a.City==j[c].City)return j[c];return null}function f(){return j}function g(b){for(var c=[],d=j.length,e=0;d>e;e++){var f=j[e];a.inArray(f[b],c)<0&&c.push(f[b])}return c}function h(a){for(var b=[],c=j.length,d=0;c>d;d++){var e=j[d];(a.Street&&a.Street==e.Street||a.ZIP&&a.ZIP==e.ZIP||a.City&&a.City==e.City)&&b.push(e)}j=b}function i(a){a=parseInt(a);for(var b=j.length,c=0;b>c;c++)for(var d=j[c],e=0;e=f[0]&&a<=f[1])return!0}return!1}var j=[];return d(),{getAddresses:f,getList:g,filter:h,houseNoAllowed:i}}return{validateAddress:d}},["APIFactory"])}(jQuery,PlentyFramework),function(a,b){b.service("AuthenticationService",function(c,d,e){function f(){var b=a('[data-plenty-checkout="lostPasswordForm"]');if(b.validateForm()){var d=b.getFormValues(),e={Email:d.Email};return c.post("/rest/checkout/lostpassword/",e).done(function(b){1==b.data.IsMailSend&&(a('[data-plenty-checkout="lostPasswordTextContainer"]').hide(),a('[data-plenty-checkout="lostPasswordSuccessMessage"]').show())})}}function g(a){if(a.validateForm()){var b=a.getFormValues(),d={Email:b.loginMail,Password:b.loginPassword};return e.showWaitScreen(),c.post("/rest/checkout/login/",d).done(function(){window.location.assign(a.attr("action"))})}}function h(a){return c.post("/rest/checkout/customerinvoiceaddress/",a).done(function(a){d.getCheckout().CustomerInvoiceAddress=a.data})}function i(){var c=a('[data-plenty-checkout-form="customerRegistration"]');if(c.validateForm()&&b.getInstance().AddressDoctorService.validateAddress()){var d=c.getFormValues(),e={LoginType:2,FormOfAddressID:d.FormOfAddressID,Company:d.Company,FirstName:d.FirstName,LastName:d.LastName,Street:d.Street,HouseNo:d.HouseNo,AddressAdditional:d.AddressAdditional,ZIP:d.ZIP,City:d.City,CountryID:d.CountryID,VATNumber:d.VATNumber,Email:d.Email,EmailRepeat:d.EmailRepeat,BirthDay:d.BirthDay,BirthMonth:d.BirthMonth,BirthYear:d.BirthYear,Password:d.Password,PasswordRepeat:d.PasswordRepeat,PhoneNumber:d.PhoneNumber,MobileNumber:d.MobileNumber,FaxNumber:d.FaxNumber,Postnummer:d.Postnummer};return e.CustomerPropertiesList=e.CustomerPropertiesList||[],c.find("[data-plenty-property-id]").each(function(b,c){e.CustomerPropertiesList.push({PropertyID:a(c).attr("data-plenty-property-id"),PropertyValue:a(c).val()})}),h(e).done(function(){window.location.assign(c.attr("action"))})}}return{resetPassword:f,customerLogin:g,setInvoiceAddress:h,registerCustomer:i}},["APIFactory","CheckoutFactory","UIFactory"])}(jQuery,PlentyFramework),function(a,b){b.service("BasketService",function(c,d,e,f,g){function h(d){d&&c.get("/rest/checkout/container_"+"CheckoutOrderParamsList".toLowerCase()+"/",{itemID:d[0].BasketItemItemID,quantity:d[0].BasketItemQuantity},!1,!0).done(function(c){c.data[0].indexOf("form-group")>0?g.prepare().setContent(c.data[0]).setTitle(b.translate("Select order parameters")).setLabelConfirm(b.translate("Save")).onConfirm(function(){return a('[data-plenty-checkout-form="OrderParamsForm"]').validateForm()?(j(i(d)),!0):!1}).show():j(d)})}function i(b){var c,d=a('[data-plenty-checkout-form="OrderParamsForm"]'),e={},f="";return d.find('[name^="ParamGroup"]').each(function(){c=this.name.match(/^ParamGroup\[(\d+)]\[(\d+)]$/),b=m(b,c[1],a(this).val(),a(this).val())}),d.find('[name^="ParamValue"]').each(function(){if(e=a(this),f=e.attr("type"),("checkbox"==f&&e.is(":checked")||"radio"==f&&e.is(":checked")||"radio"!=f&&"checkbox"!=f)&&"file"!=f&&"hidden"!=f){var c=e[0].name.match(/^ParamValue\[(\d+)]\[(\d+)]$/);b=m(b,c[1],c[2],e.val())}else if("file"==f)if(e[0].files&&e[0].files.length>0)b=l(e,b);else{var c=e[0].name.match(/^ParamValueFile\[(\d+)]\[(\d+)]$/),d=a('input[type="hidden"][name="ParamValue['+c[1]+"]["+c[2]+']"]').val();b=m(b,c[1],c[2],d)}}),b}function j(a){c.post("/rest/checkout/basketitemslist/",a,!0).done(function(){f.loadCheckout().done(function(){s(),e.getContainer("ItemViewItemToBasketConfirmationOverlay",{ArticleID:a[0].BasketItemItemID}).from("ItemView").done(function(a){g.prepare().setContent(a.data[0]).setTimeout(5e3).show()})})}).fail(function(a){d.printErrors(JSON.parse(a.responseText).error.error_stack)})}function k(a){c.put("/rest/checkout/basketitemslist/",a).done(function(){f.reloadCatContent(b.getGlobal("basketCatID")),f.loadCheckout().done(function(){s()})})}function l(a,b){var d,e,f=a[0].id,g={},h=[],i={type:"POST",data:{},isFile:!0,cache:!1,dataType:"json",processData:!1,contentType:!1};g[f]=a[0].files,-1==h.indexOf(f)&&h.push(f);for(var j=0,k=h.length;k>j;++j)d=new FormData,e=g[h[j]],d.append("0",e[0],e[0].name),i.data=d,c.post("/rest/checkout/orderparamfile/",i);var l=a[0].name.match(/^ParamValueFile\[(\d+)]\[(\d+)]$/);return m(b,l[1],l[2],a.val())}function m(b,c,d,e){return c>0&&void 0==b[c]&&(b[c]=a.extend(!0,{},b[0]),b[c].BasketItemOrderParamsList=[]),void 0!=b[c]&&(b[c].BasketItemQuantity=1,void 0==b[c].BasketItemOrderParamsList&&(b[c].BasketItemOrderParamsList=[]),e&&b[c].BasketItemOrderParamsList.push({BasketItemOrderParamID:d,BasketItemOrderParamValue:e})),b}function n(b){var c=a('[data-plenty-basket-item="'+b+'"');c.modal("show"),c.find('[data-plenty-modal="confirm"]').on("click",function(){var d=p(b),e=[];c.find('select, .PlentyFormContainer.AttrImage > input[type="hidden"]').each(function(b,c){var d=c.name.match(/^ArticleAttribute\[\d+]\[\d+]\[(\d+)]$/);d&&d[1]&&e.push({BasketItemAttributeID:d[1],BasketItemAttributeValueID:a(c).val()})}),0!=e.length&&(d.BasketItemAttributesList=e),k([d])})}function o(d){var e=p(d);e.BasketItemOrderParamsList=[],c.get("/rest/checkout/container_"+"CheckoutOrderParamsList".toLowerCase()+"/",{itemID:e.BasketItemItemID,quantity:e.BasketItemQuantity,basketItemID:d}).done(function(c){g.prepare().setContent(c.data[0]).setTitle(b.translate("Edit order parameters")).setLabelConfirm(b.translate("Save")).onConfirm(function(){return a('[data-plenty-checkout-form="OrderParamsForm"]').validateForm()?(k(i([e])),!0):!1}).show()})}function p(a){for(var b=f.getCheckout().BasketItemsList,c=0;c"+b.translate('Do you really want to remove "{{item}}" from your basket?',{item:j})+"

").onDismiss(function(){i.reject()}).onConfirm(function(){h()}).setLabelConfirm(b.translate("Delete")).show(),i}function r(d,e){if(0>=e)return q(d);for(var g,h,i=a.Deferred(),j=f.getCheckout().BasketItemsList,k=0;k0&&f.reloadContainer("Totals")}return{addItem:h,removeItem:q,getItem:p,setItemQuantity:r,editItemAttributes:n,editOrderParams:o,addCoupon:t,removeCoupon:u}},["APIFactory","UIFactory","CMSFactory","CheckoutFactory","ModalFactory"])}(jQuery,PlentyFramework),function(a,b){b.service("CheckoutService",function(c,d,e,f){function g(){e.loadCheckout(!0)}function h(){var b=a('[data-plenty-checkout-form="details"]'),d=b.getFormValues();return e.getCheckout().CheckoutCustomerSign||(e.getCheckout().CheckoutCustomerSign=""),e.getCheckout().CheckoutOrderInfoText||(e.getCheckout().CheckoutOrderInfoText=""),e.getCheckout().CheckoutCustomerSign!==d.CustomerSign&&a(b).find('[name="CustomerSign"]').length>0||e.getCheckout().CheckoutOrderInfoText!==d.OrderInfoText&&a(b).find('[name="OrderInfoText"]').length>0?(e.getCheckout().CheckoutCustomerSign=d.CustomerSign,e.getCheckout().CheckoutOrderInfoText=d.OrderInfoText,e.setCheckout()):c.idle()}function i(d){var f=a('[data-plenty-checkout-form="shippingAddress"]');if(!d&&!f.validateForm())return!1;if(!d&&!b.getInstance().AddressDoctorService.validateAddress(f))return!1;var g=f.getFormValues(),h=a('[name="shippingAddressID"]:checked').val();if(a("#shippingAdressSelect").modal("hide"),0>h){var i=g;return k(i,e.getCheckout().CustomerShippingAddress)?c.idle():("PACKSTATION"==i.Street?(i.IsPackstation=1,i.PackstationNo=i.HouseNo):"POSTFILIALE"==i.Street&&(i.IsPostfiliale=1,i.PostfilialNo=i.HouseNo),c.post("/rest/checkout/customershippingaddress/",i).done(function(a){e.getCheckout().CheckoutCustomerShippingAddressID=a.data.ID,e.getCheckout().CheckoutShippingCountryID=a.data.CountryID,delete e.getCheckout().CheckoutMethodOfPaymentID,delete e.getCheckout().CheckoutShippingProfileID,e.setCheckout().done(function(){e.reloadContainer("MethodsOfPaymentList"),e.reloadContainer("ShippingProfilesList"),2==e.getCheckout().CustomerInvoiceAddress.LoginType&&e.reloadContainer("CustomerShippingAddress")})}))}return h!=e.getCheckout().CheckoutCustomerShippingAddressID?(e.getCheckout().CheckoutCustomerShippingAddressID=h,delete e.getCheckout().CheckoutMethodOfPaymentID,delete e.getCheckout().CheckoutShippingProfileID,e.setCheckout().done(function(){e.reloadContainer("MethodsOfPaymentList"),e.reloadContainer("ShippingProfilesList"),2==e.getCheckout().CustomerInvoiceAddress.LoginType&&e.reloadContainer("CustomerShippingAddress")})):c.idle()}function j(){var b=a('[data-plenty-checkout-form="guestRegistration"]'),d=b.getFormValues();return d.LoginType=1,d.CustomerPropertiesList=d.CustomerPropertiesList||[],b.find("[data-plenty-property-id]").each(function(b,c){d.CustomerPropertiesList.push({PropertyID:a(c).attr("data-plenty-property-id"),PropertyValue:a(c).val()})}),k(d,e.getCheckout().CustomerInvoiceAddress)?i():c.post("/rest/checkout/customerinvoiceaddress/",d).done(function(a){i().done(function(){e.loadCheckout()})})}function k(a,b){for(var c in a)if(a[c]+""!=b[c]+""&&"EmailRepeat"!==c)return!1;return!0}function l(){var b=a('[data-plenty-checkout-form="shippingProfileSelect"]').getFormValues();return e.getCheckout().CheckoutShippingProfileID=b.ShippingProfileID,delete e.getCheckout().CheckoutCustomerShippingAddressID,delete e.getCheckout().CheckoutMethodOfPaymentID,e.setCheckout().done(function(){e.reloadContainer("MethodsOfPaymentList")})}function m(){return c.post("/rest/checkout/preparepayment/",null).done(function(b){if(""!=b.data.CheckoutMethodOfPaymentRedirectURL)document.location.assign(b.data.CheckoutMethodOfPaymentRedirectURL);else if(b.data.CheckoutMethodOfPaymentAdditionalContent){var c=a(b.data.CheckoutMethodOfPaymentAdditionalContent).find('[data-plenty-checkout-form="bankDetails"]').length>0;f.prepare().setContent(b.data.CheckoutMethodOfPaymentAdditionalContent).onConfirm(function(){return c?p():r()}).show()}})}function n(b){return b=b||a('[data-plenty-checkout-form="methodOfPayment"]').getFormValues().MethodOfPaymentID,e.getCheckout().CheckoutMethodOfPaymentID=b,delete e.getCheckout().CheckoutCustomerShippingAddressID,delete e.getCheckout().CheckoutShippingProfileID,e.setCheckout().done(function(){e.reloadContainer("ShippingProfilesList")})}function o(){d.getContainer("CheckoutPaymentInformationBankDetails").from("Checkout").done(function(b){f.prepare().setContent(b.data[0]).onDismiss(function(){a('input[name="MethodOfPaymentID"]').each(function(b,c){a(c).val()==e.getCheckout().CheckoutMethodOfPaymentID?a(c).attr("checked","checked"):a(c).removeAttr("checked")})}).onConfirm(function(){return p()}).show()})}function p(){var b=a('[data-plenty-checkout-form="bankDetails"]');if(b.validateForm()){var d=b.getFormValues().checkout.customerBankDetails,f={CustomerBankName:d.bankName,CustomerBLZ:d.blz,CustomerAccountNumber:d.accountNo,CustomerAccountOwner:d.accountOwner,CustomerIBAN:d.iban,CustomerBIC:d.bic};return c.post("/rest/checkout/paymentinformationbankdetails/",f).done(function(){e.loadCheckout().done(function(){n(3),e.reloadContainer("MethodsOfPaymentList")})}),!0}return!1}function q(){d.getContainer("CheckoutPaymentInformationCreditCard").from("Checkout").done(function(b){f.prepare().setContent(b.data[0]).onDismiss(function(){a('input[name="MethodOfPaymentID"]').each(function(b,c){a(c).val()==e.getCheckout().CheckoutMethodOfPaymentID?a(c).attr("checked","checked"):a(c).removeAttr("checked")})}).onConfirm(function(){return r()}).show()})}function r(){var b=a('[data-plenty-checkout-form="creditCard"]');if(b.validateForm()){var d=b.getFormValues().checkout.paymentInformationCC,f={Owner:d.owner,Cvv2:d.cvv2,Number:d.number,Year:d.year,Month:d.month,Provider:d.provider};return c.post("/rest/checkout/paymentinformationcreditcard/",f).done(function(){e.loadCheckout()}),!0}return!1}function s(b){if(2==e.getCheckout().CustomerInvoiceAddress.LoginType)var c=a('[data-plenty-checkout-form="shippingAddress"]').getFormValues();else var c=a('[data-plenty-checkout-form="guestRegistration"]').getFormValues();var g={street:c.Street,houseNo:c.HouseNo,ZIP:c.ZIP,city:c.City,postnummer:c.Postnummer,suggestionType:"postfinder"};d.getContainer("CheckoutAddressSuggestionResultsList",g).from("Checkout").done(function(a){f.prepare().setContent(a.data[0]).show()})}function t(){var b=a('[data-plenty-checkout-form="placeOrder"]');if(b.validateForm()){var d=b.getFormValues(),e={TermsAndConditionsCheck:d.termsAndConditionsCheck||0,WithdrawalCheck:d.withdrawalCheck||0,PrivacyPolicyCheck:d.privacyPolicyCheck||0,AgeRestrictionCheck:d.ageRestrictionCheck||0,NewsletterCheck:d.newsletterCheck||0,KlarnaTermsAndConditionsCheck:d.klarnaTermsAndConditionsCheck||0,PayoneDirectDebitMandateCheck:d.payoneDirectDebitMandateCheck||0,PayoneInvoiceCheck:d.payoneInvoiceCheck||0};return c.post("/rest/checkout/placeorder/",e).done(function(a){""!=a.data.MethodOfPaymentRedirectURL?window.location.assign(a.data.MethodOfPaymentRedirectURL):""!=a.data.MethodOfPaymentAdditionalContent?f.prepare().setContent(a.data.MethodOfPaymentAdditionalContent).setLabelDismiss("").onDismiss(function(){window.location.assign(b.attr("action"))}).onConfirm(function(){window.location.assign(b.attr("action"))}).show():window.location.assign(b.attr("action"))})}}return{init:g,setCustomerSignAndInfo:h,registerGuest:j,setShippingProfile:l,saveShippingAddress:i,loadAddressSuggestion:s,preparePayment:m,setMethodOfPayment:n,editBankDetails:o,editCreditCard:q,placeOrder:t}},["APIFactory","CMSFactory","CheckoutFactory","ModalFactory"])}(jQuery,PlentyFramework),function(a,b){b.service("FeedbackService",function(a){function b(){function b(a,b){return e.dateStart=a,e.dateEnd=b,this}function c(b,c,f){var g={ReferenceId:c,FromDate:e.dateStart,ToDate:e.dateEnd,FeedbackType:f||d().COMMENTS_AND_RATINGS};return a.get("/rest/feedback/"+b+"/",g)}var e={dateStart:null,dateEnd:null};return{between:b,"for":c}}function c(){function b(a){return f.Rating=a,this}function c(a){return f.Text=a,this}function d(a,b,c){return f.Author=a,b&&(f.Email=b),c&&(f.CustomerId=c),this}function e(b,c){return a.post("/rest/feedback/"+b+"/",f)}var f={Rating:1,Text:"",Author:"",Email:"",CustomerId:0};return{withRating:b,withComment:c,withAuthor:d,to:e}}function d(){return{COMMENTS_ONLY:"comments_only",RATINGS_ONLY:"ratings_only",COMMENTS_AND_RATINGS:"comments_with_ratings"}}function e(){return{ITEM:"item",CATEGORY:"category",BLOG:"blog"}}return{getFeedbacks:b,addFeedback:c,ArticleTypes:e(),FeedbackTypes:d()}},["APIFactory"])}(jQuery,PlentyFramework),function(a,b){b.service("MediaSizeService",function(){function b(){return e&&c(),e}function c(){var b;if(b=window.matchMedia?window.matchMedia("(min-width:1200px)").matches?"lg":window.matchMedia("(min-width:992px)").matches?"md":window.matchMedia("(min-width:768px)").matches?"sm":"xs":a(window).width()>=1200?"lg":a(window).width()>=992?"md":a(window).width()>=768?"sm":"xs",b!=e){var c=e;e=b,a(window).trigger("sizeChange",[e,c])}}function d(a){for(var b=a.replace(/\s/g,"").split(","),c=0;c li'),r=a('[data-plenty-checkout="container"] > div'),u=a('[data-plenty-checkout="next"]'),t=a('[data-plenty-checkout="prev"]'),q.length==r.length&&r.length>0){d.getCheckout();r.hide(),q.each(function(b,c){a(c).addClass("disabled"),a(c).click(function(){a(this).is(".disabled")||j(b)})}),u.attr("disabled","disabled"),u.click(function(){m()}),t.attr("disabled","disabled"),t.click(function(){n()}),window.addEventListener("hashchange",function(){window.location.hash.length>0?o(window.location.hash):j(0)},!1),a.urlParam=function(a){var b=new RegExp("[?&]"+a+"=([^&#]*)").exec(window.location.href);return null==b?null:b[1]||0};var c=a.urlParam("gototab");0==window.location.hash.length&&c&&a('[data-plenty-checkout-id="'+c+'"]').length>0?window.location.hash=c:j(!o(window.location.hash)&&s>=0?s:0),p(),a(window).on("sizeChange",p),a(window).resize(function(){"xs"==b.getInstance().MediaSizeService.interval()&&p()})}}function f(){return s>=0?{id:a(r[s]).attr("data-plenty-checkout-id"),index:s}:null}function g(a){return v.beforeChange.push(a),b.getInstance().NavigatorService}function h(a){return v.afterChange.push(a),b.getInstance().NavigatorService}function i(b,c){var d=!0;if(s>=0||"afterChange"===b){var e=f(),g={index:c,id:a(r[c]).attr("data-plenty-checkout-id")};a.each(v[b],function(a,b){return b(e,g)===!1?(d=!1,!1):void 0})}return d}function j(e,f){var g=s!==e;(!g||f||i("beforeChange",e))&&(s=e,!Object.equals(w[s],d.getCheckout(!0))&&g&&a(r[s]).attr("data-plenty-checkout-content")?(w[s]=d.getCheckout(!0),c.getCategoryContent(a(r[s]).attr("data-plenty-checkout-content")).done(function(c){a(r[s]).html(c.data[0]),k(g),b.getInstance().bindDirectives(r[s]),a(window).trigger("contentChanged")})):k(g))}function k(b){a(r).hide(),a(q).each(function(b,c){a(c).removeClass("disabled active"),a(c).find('[role="tab"]').attr("aria-selected","false"),s>b?a(c).addClass("visited"):b==s?(a(c).addClass("active visited"),a(c).find('[role="tab"]').attr("aria-selected","true")):b>s&&!a(c).is(".visited")&&a(c).addClass("disabled")}),p(),0>=s?a(t).attr("disabled","disabled"):a(t).removeAttr("disabled"),s+1==q.length?a(u).attr("disabled","disabled"):a(u).removeAttr("disabled"),a(r[s]).show(),s>0?window.location.hash=a(r[s]).attr("data-plenty-checkout-id"):window.location.hash.length>0&&(window.location.hash=""),b&&i("afterChange",s)}function l(a){j(a.index,!0)}function m(){s0&&j(s-1)}function o(b){return"next"==b?(m(),!0):"prev"==b?(n(),!0):(b=b.replace("#",""),a(r).each(function(c,d){return a(d).attr("data-plenty-checkout-id")==b?(j(c),!0):void 0}),!1)}function p(){var b=q.length;if(!(0>=b)){a(q).removeAttr("style"),a(q).children("span").removeAttr("style"),a(u).removeAttr("style"),a(t).removeAttr("style");var c=a(t).outerWidth()c?a(d).children("span").css({paddingLeft:g+"px",paddingRight:h+"px"}):a(d).children("span").css({paddingLeft:j+"px",paddingRight:k+"px"})})}}var q=[],r=[],s=-1,t={},u={},v={beforeChange:[],afterChange:[]},w=[];return{init:e,getCurrentContainer:f,goTo:j,beforeChange:g,afterChange:h,continueChange:l,next:m,previous:n,goToID:o,fillNavigation:p}},["CMSFactory","CheckoutFactory"])}(jQuery,PlentyFramework),function(a,b){b.service("PostfinderService",function(c,d,e){function f(){var b=a('input[name="Street"]').val();return"PACKSTATION"==b.toUpperCase()||"POSTFILIALE"==b.toUpperCase()}function g(){j={PostfinderItemStreet:a('input[name="Street"]','[data-plenty-checkout-form="shippingAddress"]'),PostfinderItemZIP:a('input[name="ZIP"]','[data-plenty-checkout-form="shippingAddress"]'),PostfinderItemCity:a('input[name="City"]','[data-plenty-checkout-form="shippingAddress"]'),PostfinderItemHouseNo:a('input[name="HouseNo"]','[data-plenty-checkout-form="shippingAddress"]')},j.PostfinderItemStreet.val(""),j.PostfinderItemZIP.val().length>2||j.PostfinderItemCity.val().length>2?c.get("/rest/checkout/shippingaddresspostfinderlist/",{suggestionType:"postfinder",zip:j.PostfinderItemZIP.val(),city:j.PostfinderItemCity.val()}).done(function(c){l=c.data,k=l.length,0==k&&h();for(var e={addresses:[]},f=0;k>f;f++){var g="km",m=l[f].PostfinderItemDistance,n=m/1e3;n=(Math.round(100*n)/100).toFixed(2).replace(".",","),1e3>m&&(n=m,g="m"),e.addresses.push({index:f,dimension:g,type:l[f].PostfinderItemIsPackstation?"Packstation":"Postfiliale",number:l[f].PostfinderItemIsPackstation?l[f].PostfinderItemPackstationNo:l[f].PostfinderItemPostfilialNo,street:l[f].PostfinderItemStreet,houseNo:l[f].PostfinderItemHouseNo,zip:l[f].PostfinderItemZIP,city:l[f].PostfinderItemCity,district:l[f].PostfinderItemDistrict,distance:n,remark:l[f].PostfinderItemRemark})}var o=b.compileTemplate("addressSuggestions/postFinder.html",e);d.prepare().setTitle(b.translate("Packstations and post offices in your area")).setContent(o).setClass("checkout").onConfirm(function(){return j.PostfinderItemCity.removeClass("has-error").addClass("has-success"),a('label[for="'+j.PostfinderItemCity.attr("id")+'"]').removeClass("has-error").addClass("has-success"),j.PostfinderItemZIP.removeClass("has-error").addClass("has-success"),a('label[for="'+j.PostfinderItemZIP.attr("id")+'"]').removeClass("has-error").addClass("has-success"),j.PostfinderItemStreet.removeClass("has-error").addClass("has-success"),a('label[for="'+j.PostfinderItemStreet.attr("id")+'"]').removeClass("has-error").addClass("has-success"),j.PostfinderItemHouseNo.removeClass("has-error").addClass("has-success"),a('label[for="'+j.PostfinderItemHouseNo.attr("id")+'"]').removeClass("has-error").addClass("has-success"),i=a('input[type="radio"][name="postfinder"]:checked').val(),l[i].PostfinderItemIsPackstation?(a(j.PostfinderItemStreet).val("PACKSTATION"),a(j.PostfinderItemHouseNo).val(l[i].PostfinderItemPackstationNo)):(a(j.PostfinderItemStreet).val("POSTFILIALE"),a(j.PostfinderItemHouseNo).val(l[i].PostfinderItemPostfilialNo)),a(j.PostfinderItemStreet).trigger("change"),a(j.PostfinderItemCity).val(l[i].PostfinderItemCity),a(j.PostfinderItemZIP).val(l[i].PostfinderItemZIP),!0}).show()}):h()}function h(){e.throwError(0,b.translate("Please enter a ZIP code and/or a city.")),j.PostfinderItemCity.removeClass("has-success").addClass("has-error"),a('label[for="'+j.PostfinderItemCity.attr("id")+'"]').removeClass("has-success").addClass("has-error"),j.PostfinderItemZIP.removeClass("has-success").addClass("has-error"),a('label[for="'+j.PostfinderItemZIP.attr("id")+'"]').removeClass("has-success").addClass("has-error"),j.PostfinderItemCity.focus(function(){a(this).removeClass("has-error");var b=a(this).attr("id");a(this).closest(".form-group").find('[for="'+b+'"]').removeClass("has-error")}),j.PostfinderItemZIP.focus(function(){a(this).removeClass("has-error");var b=a(this).attr("id");a(this).closest(".form-group").find('[for="'+b+'"]').removeClass("has-error")})}var i="",j={},k={},l={};return{openPostfinderModal:g,isPackstation:f}},["APIFactory","ModalFactory","UIFactory"])}(jQuery,PlentyFramework),function(a,b){b.service("SocialShareService",function(){function b(a){var b={"facebook-like":'',"facebook-recommend":'',twitter:'',"google-plus":'
'};return b[a]}function c(){var b=document.location.href,c=a("link[rel=canonical]").attr("href");return c&&c.length>0&&(c.indexOf("http")<0&&(c=document.location.protocol+"//"+document.location.host+c),b=c),b}function d(b){var c=a('meta[name="'+b+'"]').attr("content");return c||""}function e(){var b=d("DC.title"),c=d("DC.creator");return b.length>0&&c.length>0?b+=" - "+c:b=a("title").text(),encodeURIComponent(b)}return"undefined"==typeof socialLangLocale&&(socialLangLocale="en_US"),"undefined"==typeof socialLang&&(socialLang="en"),{getSocialService:b}})}(jQuery,PlentyFramework),function($,pm){pm.service("ValidationService",function(){function getFormControl(a){return a=$(a),a.is("input")||a.is("select")||a.is("textarea")?a:a.find("input").length>0?a.find("input"):a.find("select").length>0?a.find("select"):a.find("textarea").length>0?a.find("textarea"):null}function validateText(a){return a.is("input")||a.is("select")||a.is("textarea")?$.trim(a.val()).length>0:(console.error("Validation Error: Cannot validate Text for <"+a.prop("tagName")+">"),!1)}function validateMail(a){var b=/[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/;return validateText(a)?b.test($.trim(a.val())):!1}function validateNumber(a){return validateText(a)?$.isNumeric($.trim(a.val())):!1}function validateValue(a,b){return $(b).length>0?$.trim(a.val())==$.trim($(b).val()):$.trim(a.val())==b}function visibility(a){return a.is(":visible")}function isEnabled(a){return a.is(":enabled")}function validate(form,errorClass){var formControl,formControls,validationKey,currentHasError,group,checked,checkedMin,checkedMax,attrValidate,validationKeys,formControlAttrType,$form=$(form);errorClass=errorClass||"has-error";var missingFields=[],hasError=!1;$form.find("[data-plenty-validate], input.Required").each(function(i,elem){attrValidate=$(elem).attr("data-plenty-validate"),formControls=getFormControl(elem),validationKeys=attrValidate?attrValidate:"text",validationKeys=validationKeys.split(",");for(var i=0,length=formControls.length;length>i;i++){if(formControl=$(formControls[i]),formControlAttrType=formControl.attr("type"),!visibility(formControl)||!isEnabled(formControl))return;if(validationKey=validationKeys[i].trim()||validationKeys[0].trim(),currentHasError=!1,formControl.is("input")&&"radio"!=formControlAttrType&&"checkbox"!=formControlAttrType||formControl.is("textarea"))switch(validationKey){case"text":currentHasError=!validateText(formControl);break;case"mail":currentHasError=!validateMail(formControl);break;case"number":currentHasError=!validateNumber(formControl);break;case"value":currentHasError=!validateValue(formControl,$(elem).attr("data-plenty-validation-value"));break;case"none":break;default:console.error('Form validation error: unknown validate property: "'+attrValidate+'"')}else if(!formControl.is("input")||"radio"!=formControlAttrType&&"checkbox"!=formControlAttrType){if(!formControl.is("select"))return void console.error("Form validation error: "+$(elem).prop("tagName")+" does not contain an form element");currentHasError=""==formControl.val()||"-1"==formControl.val()}else group=formControl.attr("name"),checked=$form.find('input[name="'+group+'"]:checked').length,"radio"==formControlAttrType?(checkedMin=1,checkedMax=1):(eval("var minMax = "+attrValidate),checkedMin=minMax?minMax.min:1,checkedMax=minMax?minMax.max:1),currentHasError=checkedMin>checked||checked>checkedMax;currentHasError&&(hasError=!0,missingFields.push(formControl),formControls.length>1?(formControl.addClass(errorClass),$form.find('label[for="'+formControl.attr("id")+'"]').addClass(errorClass)):$(elem).addClass(errorClass))}}),$form.on("validationFailed",function(){var a=50,b=$form.find("."+errorClass).first(),c=b.offset().top,d=$("html, body");$form.parents(".modal").length>0?(d=$form.parents(".modal").find(".modal-body"),c=d.scrollTop()-(d.offset().top-b.offset().top)):$form.is(".modal")&&(d=$form.find(".modal-body"),c=d.scrollTop()-(d.offset().top-b.offset().top)),(c-awindow.pageYOffset+window.innerHeight)&&d.animate({scrollTop:c-a})}),hasError&&($form.find("."+errorClass).each(function(a,b){formControl=$(getFormControl(b)),formControl.on("focus click",function(){var a=$(b);a.removeClass(errorClass),$form.find('label[for="'+$(this).attr("id")+'"]').removeClass(errorClass)})}),$form.trigger("validationFailed",[missingFields]));var callback=$form.attr("data-plenty-callback");if(!hasError&&callback&&"submit"!=callback&&"function"==typeof window[callback]){var fields={};return $form.find("input, textarea, select").each(function(){"checkbox"==$(this).attr("type")?fields[$(this).attr("name")]=$(this).is(":checked"):fields[$(this).attr("name")]=$(this).val()}),window[callback](fields),!1}return!hasError}return{validate:validate}}),$.fn.validateForm=function(){return pm.getInstance().ValidationService.validate(this)},$.fn.getFormValues=function(){function a(a,b){var d=a.match(/^([^\[]+)(.*)/);if(d[2]){var e,f=/\[([^\]]+)]/g,g=[];for(g[0]=d[1];null!==(e=f.exec(d[2]));)g.push(e[1]);for(var h=g.length-1;h>=0;h--){var i={};i[g[h]]=b,b=i}c=$.extend(!0,c,b)}else c[d[1]]=b}var b=this,c={};return b.find("input, select, textarea").each(function(c,d){if($(d).attr("name"))if("checkbox"==$(d).attr("type")){var e=[];$(b).find('[name="'+$(d).attr("name")+'"]:checked').each(function(a,b){e.push($(b).val())}),a($(d).attr("name"),e)}else"radio"==$(d).attr("type")?$(d).is(":checked")&&a($(d).attr("name"),$(d).val()):a($(d).attr("name"),$(d).val())}),c}}(jQuery,PlentyFramework),function(a,b){b.directive("Authentication",function(c){function d(d){b.getRecentEvent().preventDefault(),c.customerLogin(a(d))}return{login:d}},["AuthenticationService"])}(jQuery,PlentyFramework),function(a,b){b.directive("Basket",function(c){function d(d){b.getRecentEvent().preventDefault();var e={},f=a(d),g=f.parents("form");e.BasketItemItemID=g.find('[name="ArticleID"]').val(),e.BasketItemPriceID=g.find('[name="SYS_P_ID"]').val(),e.BasketItemQuantity=g.find('[name="ArticleQuantity"]').val(),e.BasketItemBranchID=g.find('[name="source_category"]').val();var h=g.find('[name^="ArticleAttribute"]'),i=[];a.each(h,function(b,c){var d=c.name.match(/^ArticleAttribute\[\d+]\[\d+]\[(\d+)]$/);d&&d[1]&&i.push({BasketItemAttributeID:d[1],BasketItemAttributeValueID:a(c).val()})}),0!=i.length&&(e.BasketItemAttributesList=i),c.addItem([e])}function e(b,c){var d=a(b),e=d.parent().find("input"),f=parseInt(e.attr("maxlength"))||5,g=parseInt(e.val())+c,h=d.parents("[data-basket-item-id]").length>0;if(h){(g+"").length<=f&&g>=0&&e.val(g);var i=d.data("timeout");i&&window.clearTimeout(i),i=window.setTimeout(function(){e.trigger("change")},1e3),d.data("timeout",i)}else(g+"").length<=f&&g>=1&&e.val(g)}function f(b,d){c.setItemQuantity(b,parseInt(a(d).val())).fail(function(){var e=c.getItem(b);a(d).val(e.BasketItemQuantity)})}return{addBasketItem:d,changeItemQuantity:e,setItemQuantity:f}},["BasketService"])}(jQuery,PlentyFramework),function(a,b){b.directive("MobileDropdown",function(c){function d(){a(window).on("orientationchange sizeChange",function(){e(j),e(k)}),a("html").on("click touchstart",function(a){e(k,a)})}function e(b,c){for(var d,e=0;e0?window.location.assign(a(c).attr("href")):window.location.assign(c))}function e(a){c.goToID(a)}return{to:d,toCheckoutTab:e}},["MediaSizeService","NavigatorService"])}(jQuery,PlentyFramework),function(a,b){b.directive("Tab",function(c){function d(b){a(b).tab("show")}function e(a,b,c){j[c]||(j[c]=new h),j[c].getTab(b)||j[c].addTab(b),j[c].getTab(b).addLabel(a)}function f(a,b,c){j[c]||(j[c]=new h),j[c].getTab(b)||j[c].addTab(b),j[c].getTab(b).setContent(a)}function g(a,d,e){c.isInterval(e)&&(b.getRecentEvent().preventDefault(),j[d]&&j[d].getTab(a)&&j[d].showTab(a))}function h(){function b(a){return g[a]=new i(a),g[a]}function c(b){var c=0;if(f)c=parseInt(f.getContent().parent().css("zIndex")),f.hide(),f.getContent().parent().css("zIndex",c-1);else{for(var d in g)if(g[d].getContent()){var h=parseInt(g[d].getContent().parent().css("zIndex"));(0==c||c>h)&&(c=h),g[d].hide()}for(var d in g)g[d].getContent()&&g[d].getContent().parent().css("zIndex",c-1);a(window).on("sizeChange",e)}f=g[b],f.getContent().parent().css("zIndex",c),f.show()}function d(a){return g[a]}function e(){for(var a in g)g[a].getContent()&&g[a].show();f=null}var f,g={};return{addTab:b,showTab:c,getTab:d,resetTabs:e}}function i(a){function b(){return j}function c(a){return i.push(a),this}function d(a){return h=a,this}function e(){return h}function f(){for(var a=0;a0&&(a(document).scrollTop()>100?u(w,"addClass","visible"):u(w,"removeClass","visible"))})}function f(b){a(b).owlCarousel({navigation:!0,navigationText:!1,slideSpeed:1e3,paginationSpeed:1e3,singleItem:!0,autoPlay:6e3,stopOnHover:!0,afterMove:function(b){a(b).find('img[data-plenty-rel="lazyload"]').trigger("appear")}})}function g(b,d,e){var f=a(b),g=0,h={},i=f.find('[data-plenty-rel="equal-target"]').length>0?f.find('[data-plenty-rel="equal-target"]'):f.children();e!==!0&&v.push(b);for(var j=i.length;j>=0;j--)h=a(i[j]),h.css("height",""),h.outerHeight(!0)>g&&(g=h.outerHeight(!0));(!d||c.isInterval(d))&&i.height(g)}function h(b){var c=a(b);c.click(function(){return a("html, body").animate({scrollTop:0},400),!1}),a.inArray(c,w)&&w.push(c)}function i(b,c){var d=a(b);d.lazyload({effect:c}),d.on("loaded",function(){d.css("display","inline-block")})}function j(b){console.log(b);var c=a(b),d=c.parent();d.addClass("animating"),c.siblings("ul").slideToggle(200,function(){d.is(".open")?d.removeClass("open"):d.addClass("open"),c.siblings("ul").removeAttr("style"),d.removeClass("animating")})}function k(b,c){var d=a(b),e=a(d.attr("data-plenty-rel"));if(d.is('input[type="radio"]')){var f=a('input[type="radio"][name="'+d.attr("name")+'"]'),g=!c||"checked"==c;f.change(function(){var b=a(this);e.parents('[data-plenty-rel="equal-target"]').css("height","auto"),b.is(":checked")&&b[0]===d[0]&&1==g?e.slideDown(400,function(){t()}):e.slideUp(400,function(){t()})})}else d.click(function(){d.addClass("animating"),e.slideToggle(400,function(){d.removeClass("animating"),d.toggleClass("active"),t()})})}function l(b,c){o(a(b),c,"slideDown")}function m(b,c){o(a(b),c,"slideUp")}function n(b,c){o(a(b),c,"slideToggle")}function o(a,b,c){b=b||400,a.parents('[data-plenty-rel="equal-target"]').css("height","auto"),a[c](b,function(){t()})}function p(b,c){var e=a(b),f=e.find('[data-plenty-rel="social-switch"]');e.append(''),f.is("off, on")||f.addClass("off"),f.on("click",function(){f.hasClass("off")&&("tooltip"==e.attr("data-toggle")&&e.tooltip("destroy"),f.removeClass("off").addClass("on"),e.find('[data-plenty-rel="social-placeholder"]').hide(),e.find(".social-container").append(d.getSocialService(c)))})}function q(d,e,f){var g=a(e);if(g.parents(".navbar-main").length>0){var h=g.children("span");return b.directives.MobileDropdown.slideDropdown(h),!0}if(e&&d&&(!f||c.isInterval(f))){var i=b.getRecentEvent();return i&&i.preventDefault(),g.toggleClass(d),!1}}function r(d,e,f){if(e&&d&&(!f||c.isInterval(f))){var g=b.getRecentEvent();return g&&g.preventDefault(),a(e).addClass(d),!1}}function s(d,e,f){if(e&&d&&(!f||c.isInterval(f))){var g=b.getRecentEvent();return g&&g.preventDefault(),a(e).removeClass(d),!1}}function t(){for(var a=v.length-1;a>=0;a--)g(v[a],"",!0)}function u(a,b,c){for(var d=a.length-1;d>=0;d--)a[d][b](c)}var v=[],w=[];return{initUIWindowEvents:e,addContentPageSlider:f,equalHeight:g,initToTop:h,initLazyload:i,initSlideToggle:k,slideDown:l,slideUp:m,slideToggle:n,toggleHideShow:j,toggleSocialShare:p,toggleClass:q,addClass:r,removeClass:s -}},["MediaSizeService","SocialShareService"])}(jQuery,PlentyFramework),function(a,b){b.directive("Validator",function(a){function b(b,c){return a.validate(b,c)}return{validate:b}},["ValidationService"])}(jQuery,PlentyFramework),PlentyFramework.compile();var plenty=PlentyFramework.getInstance();jQuery(document).ready(function(){plenty.bindDirectives()}); \ No newline at end of file diff --git a/dist/plentymarketsCMStools-1.0.3.js b/dist/plentymarketsCMStools-1.0.4.js similarity index 95% rename from dist/plentymarketsCMStools-1.0.3.js rename to dist/plentymarketsCMStools-1.0.4.js index 9f0d009..814ea21 100644 --- a/dist/plentymarketsCMStools-1.0.3.js +++ b/dist/plentymarketsCMStools-1.0.4.js @@ -346,18 +346,18 @@ TemplateCache["waitscreen/waitscreen.html"] = "
= 0; i-- ) + for ( var i = lastEventIdx; i >= 0; i-- ) { - if( eventType == eventStack[i].type ) - { - return eventStack[i]; - } + if ( eventType == eventStack[i].type ) + { + return eventStack[i]; + } } } @@ -370,7 +370,6 @@ TemplateCache["waitscreen/waitscreen.html"] = "
* Can be prevented by setting the requests last parameter to false. @@ -1048,7 +1093,7 @@ PlentyFramework.cssClasses = { url, { type : 'GET', - data: params, + data : params, dataType: 'json', async : !sync, error : function( jqXHR ) @@ -1065,6 +1110,7 @@ PlentyFramework.cssClasses = { { UI.hideWaitScreen(); } + renewLoginSession(); } ); } @@ -1123,6 +1169,7 @@ PlentyFramework.cssClasses = { { UI.hideWaitScreen(); } + renewLoginSession(); } ); } @@ -1151,8 +1198,8 @@ PlentyFramework.cssClasses = { url, { type : 'PUT', - data: JSON.stringify( data ), - dataType: 'json', + data : JSON.stringify( data ), + dataType : 'json', contentType: 'application/json', error : function( jqXHR ) { @@ -1168,6 +1215,7 @@ PlentyFramework.cssClasses = { { UI.hideWaitScreen(); } + renewLoginSession(); } ); } @@ -1197,8 +1245,8 @@ PlentyFramework.cssClasses = { url, { type : 'DELETE', - data: JSON.stringify( data ), - dataType: 'json', + data : JSON.stringify( data ), + dataType : 'json', contentType: 'application/json', error : function( jqXHR ) { @@ -1214,6 +1262,7 @@ PlentyFramework.cssClasses = { { UI.hideWaitScreen(); } + renewLoginSession(); } ); } @@ -1228,7 +1277,7 @@ PlentyFramework.cssClasses = { return $.Deferred().resolve(); } - }, ['UIFactory'] ); + }, ['UIFactory', 'ModalFactory'] ); }( jQuery, PlentyFramework )); /** * Licensed under AGPL v3 @@ -1330,7 +1379,6 @@ PlentyFramework.cssClasses = { */ function getCategoryContent( categoryID ) { - return API.get( '/rest/categoryview/categorycontentbody/?categoryID=' + categoryID ); } @@ -1841,7 +1889,7 @@ PlentyFramework.cssClasses = { { var close = modal.onConfirm(); - if( typeof close == "undefined" ) + if ( typeof close == "undefined" ) { close = true; } @@ -2104,8 +2152,8 @@ PlentyFramework.cssClasses = { function validateAddress( addressForms ) { var addressIsValid = true; - addressForms = addressForms || '[data-plenty-address-doctor]'; - $( addressForms ).filter('[data-plenty-address-doctor]:visible').each( function( i, form ) + addressForms = addressForms || '[data-plenty-address-doctor]'; + $( addressForms ).filter( '[data-plenty-address-doctor]:visible' ).each( function( i, form ) { var addressDoctor = new AddressDoctor( form ); var requiredFields = $( form ).attr( 'data-plenty-address-doctor' ).replace( /\s/g, '' ).split( ',' ); @@ -2167,7 +2215,7 @@ PlentyFramework.cssClasses = { } } - if ( suggestions.houseNoAllowed( $inputs.HouseNo.val() ) ) + if ( suggestions.houseNoAllowed( $inputs.HouseNo.val() ) || suggestions.getAddresses().length == 1 ) { $inputs.HouseNo.removeClass( 'has-error' ); $form.find( 'label[for="' + $inputs.HouseNo.attr( 'id' ) + '"]' ).removeClass( 'has-error' ); @@ -2218,7 +2266,10 @@ PlentyFramework.cssClasses = { $inputs[key].addClass( 'has-error' ); $form.find( 'label[for="' + $inputs[key].attr( 'id' ) + '"]' ).addClass( 'has-error' ); - if( !suggestionListVisible ) buildSuggestionList( $inputs[key], valueList ); + if ( !suggestionListVisible ) + { + buildSuggestionList( $inputs[key], valueList ); + } $inputs[key].off( 'focus' ); $inputs[key].focus(); return false; @@ -2226,16 +2277,27 @@ PlentyFramework.cssClasses = { } } + function positionSuggestionList( $parent, suggestionKey ) + { + $suggestionContainer[suggestionKey].css( { + 'width': $parent.outerWidth( true ), + 'left' : $parent.position().left, + 'top' : $parent.position().top + $parent.outerHeight( true ) + } ); + } + function buildSuggestionList( $parent, values ) { var suggestionKey = $parent.attr( 'name' ); // render html content $suggestionContainer[suggestionKey] = $( pm.compileTemplate( 'addressSuggestions/addressDoctor.html', {values: values} ) ); - $suggestionContainer[suggestionKey].css( { - 'width': $parent.outerWidth( true ), - 'left' : $parent.position().left, - 'top' : $parent.position().top + $parent.outerHeight( true ) + + positionSuggestionList( $parent, suggestionKey ); + + $( window ).on( 'sizeChange', function() + { + positionSuggestionList( $parent, suggestionKey ); } ); // bind click event to list elements @@ -2494,7 +2556,6 @@ PlentyFramework.cssClasses = { Password: values.loginPassword }; - UI.showWaitScreen(); return API.post( "/rest/checkout/login/", params ) .done( function() @@ -2539,47 +2600,29 @@ PlentyFramework.cssClasses = { if ( form.validateForm() && pm.getInstance().AddressDoctorService.validateAddress() ) { - var values = form.getFormValues(); + var values = form.getFormValues(); + values.LoginType = 2; - // create new invoice address - var invoiceAddress = { - LoginType : 2, - FormOfAddressID : values.FormOfAddressID, - Company : values.Company, - FirstName : values.FirstName, - LastName : values.LastName, - Street : values.Street, - HouseNo : values.HouseNo, - AddressAdditional: values.AddressAdditional, - ZIP : values.ZIP, - City : values.City, - CountryID : values.CountryID, - VATNumber : values.VATNumber, - Email : values.Email, - EmailRepeat : values.EmailRepeat, - BirthDay : values.BirthDay, - BirthMonth : values.BirthMonth, - BirthYear : values.BirthYear, - Password : values.Password, - PasswordRepeat : values.PasswordRepeat, - PhoneNumber : values.PhoneNumber, - MobileNumber : values.MobileNumber, - FaxNumber : values.FaxNumber, - Postnummer : values.Postnummer - }; - - invoiceAddress.CustomerPropertiesList = invoiceAddress.CustomerPropertiesList || []; - - form.find( "[data-plenty-property-id]" ).each( function( i, propertyInput ) + if ( values.checkout + && values.checkout.customerInvoiceAddress + && values.checkout.customerInvoiceAddress.CustomerProperty ) { + var tmpProperties = values.checkout.customerInvoiceAddress.CustomerProperty; + values.CustomerPropertiesList = values.CustomerPropertiesList || []; - invoiceAddress.CustomerPropertiesList.push( { - PropertyID : $( propertyInput ).attr( 'data-plenty-property-id' ), - PropertyValue: $( propertyInput ).val() - } ); - } ); + for ( var property in tmpProperties ) + { + if ( tmpProperties[property] ) + { + values.CustomerPropertiesList.push( { + PropertyID : property, + PropertyValue: tmpProperties[property] + } ); + } + } + } - return setInvoiceAddress( invoiceAddress ) + return setInvoiceAddress( values ) .done( function() { window.location.assign( form.attr( 'action' ) ); @@ -2661,7 +2704,7 @@ PlentyFramework.cssClasses = { .onConfirm( function() { // validate form - if ( $('[data-plenty-checkout-form="OrderParamsForm"]').validateForm() ) + if ( $( '[data-plenty-checkout-form="OrderParamsForm"]' ).validateForm() ) { // save order params addArticle( saveOrderParams( article ) ); @@ -2717,20 +2760,20 @@ PlentyFramework.cssClasses = { (attrType != 'radio' && attrType != 'checkbox')) && attrType != 'file' && attrType != 'hidden' ) { - var match = $self[0].name.match( /^ParamValue\[(\d+)]\[(\d+)]$/ ); + var match = $self[0].name.match( /^ParamValue\[(\d+)]\[(\d+)]$/ ); articleWithParams = addOrderParamValue( articleWithParams, match[1], match[2], $self.val() ); } else if ( attrType == 'file' ) { - if( $self[0].files && $self[0].files.length > 0 ) + if ( $self[0].files && $self[0].files.length > 0 ) { articleWithParams = orderParamFileUpload( $self, articleWithParams ); } else { - var match = $self[0].name.match( /^ParamValueFile\[(\d+)]\[(\d+)]$/ ); - var paramValue = $( 'input[type="hidden"][name="ParamValue[' + match[1] + '][' + match[2] + ']"]' ).val(); + var match = $self[0].name.match( /^ParamValueFile\[(\d+)]\[(\d+)]$/ ); + var paramValue = $( 'input[type="hidden"][name="ParamValue[' + match[1] + '][' + match[2] + ']"]' ).val(); articleWithParams = addOrderParamValue( articleWithParams, match[1], match[2], paramValue ); } } @@ -2861,7 +2904,7 @@ PlentyFramework.cssClasses = { function editItemAttributes( BasketItemID ) { - var modal = $( '[data-plenty-basket-item="' + BasketItemID + '"' ); + var modal = $( '[data-plenty-basket-item="' + BasketItemID + '"]' ); modal.modal( 'show' ); modal.find( '[data-plenty-modal="confirm"]' ).on( 'click', function() { @@ -2914,7 +2957,7 @@ PlentyFramework.cssClasses = { .onConfirm( function() { // validate form - if ( $('[data-plenty-checkout-form="OrderParamsForm"]').validateForm() ) + if ( $( '[data-plenty-checkout-form="OrderParamsForm"]' ).validateForm() ) { // save order params updateArticle( saveOrderParams( [basketItem] ) ); @@ -3314,8 +3357,8 @@ PlentyFramework.cssClasses = { Checkout.setCheckout().done( function() { - Checkout.reloadContainer("MethodsOfPaymentList"); - Checkout.reloadContainer("ShippingProfilesList"); + Checkout.reloadContainer( "MethodsOfPaymentList" ); + Checkout.reloadContainer( "ShippingProfilesList" ); if ( Checkout.getCheckout().CustomerInvoiceAddress.LoginType == 2 ) { Checkout.reloadContainer( 'CustomerShippingAddress' ); @@ -3341,8 +3384,8 @@ PlentyFramework.cssClasses = { return Checkout.setCheckout().done( function() { - Checkout.reloadContainer("MethodsOfPaymentList"); - Checkout.reloadContainer("ShippingProfilesList"); + Checkout.reloadContainer( "MethodsOfPaymentList" ); + Checkout.reloadContainer( "ShippingProfilesList" ); if ( Checkout.getCheckout().CustomerInvoiceAddress.LoginType == 2 ) { Checkout.reloadContainer( 'CustomerShippingAddress' ); @@ -3761,14 +3804,16 @@ PlentyFramework.cssClasses = { /** * @module Services */ -(function($, pm) { +(function( $, pm ) +{ - pm.service('FeedbackService', function( API ) { + pm.service( 'FeedbackService', function( API ) + { return { - getFeedbacks: getFeedbacks, - addFeedback: addFeedback, - ArticleTypes: articleTypes(), + getFeedbacks : getFeedbacks, + addFeedback : addFeedback, + ArticleTypes : articleTypes(), FeedbackTypes: feedbackTypes() }; @@ -3777,32 +3822,35 @@ PlentyFramework.cssClasses = { .getFeedbacks().between('2014-12-03', '2015-07-01') .for( FeedbackService.ArticleTypes.ITEM, 2732, FeedbackService.FeedbackTypes.COMMENTS_ONLY ); */ - function getFeedbacks() { + function getFeedbacks() + { var feedbackInterval = { dateStart: null, - dateEnd: null + dateEnd : null }; return { between: setFeedbackInterval, - for: listFeedbacks + for : listFeedbacks }; - function setFeedbackInterval( start, end ) { + function setFeedbackInterval( start, end ) + { feedbackInterval.dateStart = start; - feedbackInterval.dateEnd = end; + feedbackInterval.dateEnd = end; return this; } - function listFeedbacks( articleType, referenceId, feedbackType ) { + function listFeedbacks( articleType, referenceId, feedbackType ) + { var params = { - ReferenceId: referenceId, - FromDate: feedbackInterval.dateStart, - ToDate: feedbackInterval.dateEnd, + ReferenceId : referenceId, + FromDate : feedbackInterval.dateStart, + ToDate : feedbackInterval.dateEnd, FeedbackType: feedbackType || feedbackTypes().COMMENTS_AND_RATINGS }; - return API.get( '/rest/feedback/'+articleType+'/', params ); + return API.get( '/rest/feedback/' + articleType + '/', params ); } } @@ -3815,67 +3863,78 @@ PlentyFramework.cssClasses = { .withAuthor( 'Felix', 'felix.dausch@plentymarkets.com', 123456 ) .to( FeedbackService.ArticleTypes.ITEM, 2732 ); */ - function addFeedback() { + function addFeedback() + { var params = { - Rating: 1.0, - Text: '', - Author: '', - Email: '', + Rating : 1.0, + Text : '', + Author : '', + Email : '', CustomerId: 0 }; return { - withRating: withRating, + withRating : withRating, withComment: withComment, - withAuthor: withAuthor, - to: sendFeedback + withAuthor : withAuthor, + to : sendFeedback }; - function withRating( rating ) { + function withRating( rating ) + { params.Rating = rating; return this; } - function withComment( comment ) { + function withComment( comment ) + { params.Text = comment; return this; } - function withAuthor( author, mail, customerID ) { + function withAuthor( author, mail, customerID ) + { params.Author = author; - if( !!mail ) params.Email = mail; - if( !!customerID ) params.CustomerId = customerID; + if ( !!mail ) + { + params.Email = mail; + } + if ( !!customerID ) + { + params.CustomerId = customerID; + } return this; } - function sendFeedback( articleType, referenceId ) { - return API.post( '/rest/feedback/'+articleType+'/', params ); + function sendFeedback( articleType, referenceId ) + { + return API.post( '/rest/feedback/' + articleType + '/', params ); } } - function feedbackTypes() { + function feedbackTypes() + { return { - COMMENTS_ONLY: 'comments_only', - RATINGS_ONLY: 'ratings_only', - COMMENTS_AND_RATINGS: 'comments_with_ratings' + COMMENTS_ONLY : 'comments_only', + RATINGS_ONLY : 'ratings_only', + COMMENTS_AND_RATINGS: 'comments_with_ratings' } } - function articleTypes() { + function articleTypes() + { return { - ITEM: 'item', - CATEGORY: 'category', - BLOG: 'blog' + ITEM : 'item', + CATEGORY: 'category', + BLOG : 'blog' } } - - - }, ['APIFactory']); -}(jQuery, PlentyFramework)); + }, ['APIFactory'] ); +}( jQuery, PlentyFramework )); /** * Licensed under AGPL v3 * (https://github.com/plentymarkets/plenty-cms-library/blob/master/LICENSE) @@ -3977,7 +4036,7 @@ PlentyFramework.cssClasses = { size = 'xs'; } } - if ( size != bsInterval ) + if ( size != bsInterval || size === 'xs' ) { var oldValue = bsInterval; bsInterval = size; @@ -4309,30 +4368,32 @@ PlentyFramework.cssClasses = { $( container ).hide(); // refresh navigation elements + var $elem; $( navigation ).each( function( i, elem ) { - $( elem ).removeClass( 'disabled active' ); + $elem = $( elem ); + $elem.removeClass( 'disabled active' ); - $( elem ).find( '[role="tab"]' ).attr( 'aria-selected', 'false' ); + $elem.find( '[role="tab"]' ).attr( 'aria-selected', 'false' ); if ( i < current ) { // set current element as active - $( elem ).addClass( 'visited' ); + $elem.addClass( 'visited' ); } else { if ( i == current ) { - $( elem ).addClass( 'active visited' ); - $( elem ).find( '[role="tab"]' ).attr( 'aria-selected', 'true' ); + $elem.addClass( 'active visited' ); + $elem.find( '[role="tab"]' ).attr( 'aria-selected', 'true' ); } else { - if ( i > current && !$( elem ).is( '.visited' ) ) + if ( i > current && !$elem.is( '.visited' ) ) { // disable elements behind active - $( elem ).addClass( 'disabled' ); + $elem.addClass( 'disabled' ); } } } @@ -4342,21 +4403,21 @@ PlentyFramework.cssClasses = { // hide "previous"-button if first content container is shown if ( current <= 0 ) { - $( buttonPrev ).attr( "disabled", "disabled" ); + buttonPrev.attr( "disabled", "disabled" ); } else { - $( buttonPrev ).removeAttr( "disabled" ); + buttonPrev.removeAttr( "disabled" ); } // hide "next"-button if last content container is shown if ( current + 1 == navigation.length ) { - $( buttonNext ).attr( "disabled", "disabled" ); + buttonNext.attr( "disabled", "disabled" ); } else { - $( buttonNext ).removeAttr( "disabled" ); + buttonNext.removeAttr( "disabled" ); } // show current content container @@ -4695,17 +4756,19 @@ PlentyFramework.cssClasses = { shippingFields.PostfinderItemZIP.removeClass( 'has-success' ).addClass( 'has-error' ); $( 'label[for="' + shippingFields.PostfinderItemZIP.attr( 'id' ) + '"]' ).removeClass( 'has-success' ).addClass( 'has-error' ); - shippingFields.PostfinderItemCity.focus(function() { - $(this).removeClass('has-error'); - var inputId = $(this).attr('id'); - $(this).closest('.form-group').find('[for="' + inputId + '"]').removeClass('has-error'); - }); + shippingFields.PostfinderItemCity.focus( function() + { + $( this ).removeClass( 'has-error' ); + var inputId = $( this ).attr( 'id' ); + $( this ).closest( '.form-group' ).find( '[for="' + inputId + '"]' ).removeClass( 'has-error' ); + } ); - shippingFields.PostfinderItemZIP.focus(function() { - $(this).removeClass('has-error'); - var inputId = $(this).attr('id'); - $(this).closest('.form-group').find('[for="' + inputId + '"]').removeClass('has-error'); - }); + shippingFields.PostfinderItemZIP.focus( function() + { + $( this ).removeClass( 'has-error' ); + var inputId = $( this ).attr( 'id' ); + $( this ).closest( '.form-group' ).find( '[for="' + inputId + '"]' ).removeClass( 'has-error' ); + } ); } }, ['APIFactory', 'ModalFactory', 'UIFactory'] ); @@ -5217,7 +5280,7 @@ PlentyFramework.cssClasses = { formControl = $( getFormControl( elem ) ); formControl.on( 'focus click', function() { - var $errorElement = $(elem); + var $errorElement = $( elem ); $errorElement.removeClass( errorClass ); $form.find( 'label[for="' + $( this ).attr( 'id' ) + '"]' ).removeClass( errorClass ); } ); @@ -5426,10 +5489,10 @@ PlentyFramework.cssClasses = { function changeItemQuantity( elem, increment ) { - var $elem = $( elem ); + var $elem = $( elem ); var $quantityInput = $elem.parent().find( 'input' ); - var maxLength = parseInt( $quantityInput.attr( 'maxlength' ) ) || 5; - var value = parseInt( $quantityInput.val() ) + increment; + var maxLength = parseInt( $quantityInput.attr( 'maxlength' ) ) || 5; + var value = parseInt( $quantityInput.val() ) + increment; var isBasketView = $elem.parents( '[data-basket-item-id]' ).length > 0; @@ -5454,7 +5517,8 @@ PlentyFramework.cssClasses = { $elem.data( 'timeout', timeout ); } - else { + else + { if ( (value + '').length <= maxLength && value >= 1 ) { $quantityInput.val( value ); @@ -5668,7 +5732,7 @@ PlentyFramework.cssClasses = { { if ( MediaSizeService.interval() != 'xs' ) { - if ( $( href ).length > 0 ) + if ( typeof href === 'string' && href.indexOf('/') == -1 && $( href ).length > 0 ) { window.location.assign( $( href ).attr( 'href' ) ); } @@ -5737,7 +5801,7 @@ PlentyFramework.cssClasses = { function showRemoteTab( tabID, groupID, interval ) { - if( MediaSize.isInterval( interval ) ) + if ( MediaSize.isInterval( interval ) ) { pm.getRecentEvent().preventDefault(); @@ -5755,9 +5819,9 @@ PlentyFramework.cssClasses = { var activeTab; return { - addTab : addTab, - showTab: showTab, - getTab : getTab, + addTab : addTab, + showTab : showTab, + getTab : getTab, resetTabs: resetTabs }; @@ -5782,7 +5846,7 @@ PlentyFramework.cssClasses = { // activeTab not set before for ( var tab in tabs ) { - if( !!tabs[tab].getContent() ) + if ( !!tabs[tab].getContent() ) { var currentZ = parseInt( tabs[tab].getContent().parent().css( 'zIndex' ) ); if ( zIndex == 0 || currentZ < zIndex ) @@ -5795,13 +5859,13 @@ PlentyFramework.cssClasses = { for ( var tab in tabs ) { - if( !!tabs[tab].getContent() ) + if ( !!tabs[tab].getContent() ) { tabs[tab].getContent().parent().css( 'zIndex', zIndex - 1 ); } } - $(window ).on('sizeChange', resetTabs); + $( window ).on( 'sizeChange', resetTabs ); } activeTab = tabs[tabID]; @@ -5818,7 +5882,7 @@ PlentyFramework.cssClasses = { { for ( var tab in tabs ) { - if( !!tabs[tab].getContent() ) + if ( !!tabs[tab].getContent() ) { tabs[tab].show(); } @@ -5830,9 +5894,9 @@ PlentyFramework.cssClasses = { function Tab( id ) { - var $labels = []; var $content; - var tabID = id; + var $labels = []; + var tabID = id; return { addLabel : addLabel, @@ -6165,20 +6229,21 @@ PlentyFramework.cssClasses = { function slideDown( target, duration ) { - slideAction($( target ), duration, 'slideDown'); + slideAction( $( target ), duration, 'slideDown' ); } function slideUp( target, duration ) { - slideAction($( target ), duration, 'slideUp'); + slideAction( $( target ), duration, 'slideUp' ); } function slideToggle( target, duration ) { - slideAction($( target ), duration, 'slideToggle'); + slideAction( $( target ), duration, 'slideToggle' ); } - function slideAction ($target, duration, callbackString) { + function slideAction( $target, duration, callbackString ) + { duration = duration || 400; $target.parents( '[data-plenty-rel="equal-target"]' ).css( 'height', 'auto' ); $target[callbackString]( duration, function() diff --git a/dist/plentymarketsCMStools-1.0.4.min.js b/dist/plentymarketsCMStools-1.0.4.min.js new file mode 100644 index 0000000..9c80097 --- /dev/null +++ b/dist/plentymarketsCMStools-1.0.4.min.js @@ -0,0 +1,12 @@ +/** + * Licensed under AGPL v3 + * (https://github.com/plentymarkets/plenty-cms-library/blob/master/LICENSE) + * ===================================================================================== + * @copyright Copyright (c) 2015, plentymarkets GmbH (http://www.plentymarkets.com) + * @author Felix Dausch + * ===================================================================================== +*/ +!function(a,b){"object"==typeof exports&&exports&&"string"!=typeof exports.nodeName?b(exports):"function"==typeof define&&define.amd?define(["exports"],b):(a.Mustache={},b(Mustache))}(this,function(a){function b(a){return"function"==typeof a}function c(a){return p(a)?"array":typeof a}function d(a){return a.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function e(a,b){return null!=a&&"object"==typeof a&&b in a}function f(a,b){return q.call(a,b)}function g(a){return!f(r,a)}function h(a){return String(a).replace(/[&<>"'\/]/g,function(a){return s[a]})}function i(b,c){function e(){if(r&&!s)for(;q.length;)delete o[q.pop()];else q=[];r=!1,s=!1}function f(a){if("string"==typeof a&&(a=a.split(u,2)),!p(a)||2!==a.length)throw new Error("Invalid tags: "+a);h=new RegExp(d(a[0])+"\\s*"),i=new RegExp("\\s*"+d(a[1])),m=new RegExp("\\s*"+d("}"+a[1]))}if(!b)return[];var h,i,m,n=[],o=[],q=[],r=!1,s=!1;f(c||a.tags);for(var y,z,A,B,C,D,E=new l(b);!E.eos();){if(y=E.pos,A=E.scanUntil(h))for(var F=0,G=A.length;G>F;++F)B=A.charAt(F),g(B)?q.push(o.length):s=!0,o.push(["text",B,y,y+1]),y+=1,"\n"===B&&e();if(!E.scan(h))break;if(r=!0,z=E.scan(x)||"name",E.scan(t),"="===z?(A=E.scanUntil(v),E.scan(v),E.scanUntil(i)):"{"===z?(A=E.scanUntil(m),E.scan(w),E.scanUntil(i),z="&"):A=E.scanUntil(i),!E.scan(i))throw new Error("Unclosed tag at "+E.pos);if(C=[z,A,y,E.pos],o.push(C),"#"===z||"^"===z)n.push(C);else if("/"===z){if(D=n.pop(),!D)throw new Error('Unopened section "'+A+'" at '+y);if(D[1]!==A)throw new Error('Unclosed section "'+D[1]+'" at '+y)}else"name"===z||"{"===z||"&"===z?s=!0:"="===z&&f(A)}if(D=n.pop())throw new Error('Unclosed section "'+D[1]+'" at '+E.pos);return k(j(o))}function j(a){for(var b,c,d=[],e=0,f=a.length;f>e;++e)b=a[e],b&&("text"===b[0]&&c&&"text"===c[0]?(c[1]+=b[1],c[3]=b[3]):(d.push(b),c=b));return d}function k(a){for(var b,c,d=[],e=d,f=[],g=0,h=a.length;h>g;++g)switch(b=a[g],b[0]){case"#":case"^":e.push(b),f.push(b),e=b[4]=[];break;case"/":c=f.pop(),c[5]=b[2],e=f.length>0?f[f.length-1][4]:d;break;default:e.push(b)}return d}function l(a){this.string=a,this.tail=a,this.pos=0}function m(a,b){this.view=a,this.cache={".":this.view},this.parent=b}function n(){this.cache={}}var o=Object.prototype.toString,p=Array.isArray||function(a){return"[object Array]"===o.call(a)},q=RegExp.prototype.test,r=/\S/,s={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},t=/\s*/,u=/\s+/,v=/\s*=/,w=/\s*\}/,x=/#|\^|\/|>|\{|&|=|!/;l.prototype.eos=function(){return""===this.tail},l.prototype.scan=function(a){var b=this.tail.match(a);if(!b||0!==b.index)return"";var c=b[0];return this.tail=this.tail.substring(c.length),this.pos+=c.length,c},l.prototype.scanUntil=function(a){var b,c=this.tail.search(a);switch(c){case-1:b=this.tail,this.tail="";break;case 0:b="";break;default:b=this.tail.substring(0,c),this.tail=this.tail.substring(c)}return this.pos+=b.length,b},m.prototype.push=function(a){return new m(a,this)},m.prototype.lookup=function(a){var c,d=this.cache;if(d.hasOwnProperty(a))c=d[a];else{for(var f,g,h=this,i=!1;h;){if(a.indexOf(".")>0)for(c=h.view,f=a.split("."),g=0;null!=c&&gi;++i)g=void 0,e=a[i],f=e[0],"#"===f?g=this.renderSection(e,b,c,d):"^"===f?g=this.renderInverted(e,b,c,d):">"===f?g=this.renderPartial(e,b,c,d):"&"===f?g=this.unescapedValue(e,b):"name"===f?g=this.escapedValue(e,b):"text"===f&&(g=this.rawValue(e)),void 0!==g&&(h+=g);return h},n.prototype.renderSection=function(a,c,d,e){function f(a){return g.render(a,c,d)}var g=this,h="",i=c.lookup(a[1]);if(i){if(p(i))for(var j=0,k=i.length;k>j;++j)h+=this.renderTokens(a[4],c.push(i[j]),d,e);else if("object"==typeof i||"string"==typeof i||"number"==typeof i)h+=this.renderTokens(a[4],c.push(i),d,e);else if(b(i)){if("string"!=typeof e)throw new Error("Cannot use higher-order sections without the original template");i=i.call(c.view,e.slice(a[3],a[5]),f),null!=i&&(h+=i)}else h+=this.renderTokens(a[4],c,d,e);return h}},n.prototype.renderInverted=function(a,b,c,d){var e=b.lookup(a[1]);return!e||p(e)&&0===e.length?this.renderTokens(a[4],b,c,d):void 0},n.prototype.renderPartial=function(a,c,d){if(d){var e=b(d)?d(a[1]):d[a[1]];return null!=e?this.renderTokens(this.parse(e),c,d,e):void 0}},n.prototype.unescapedValue=function(a,b){var c=b.lookup(a[1]);return null!=c?c:void 0},n.prototype.escapedValue=function(b,c){var d=c.lookup(b[1]);return null!=d?a.escape(d):void 0},n.prototype.rawValue=function(a){return a[1]},a.name="mustache.js",a.version="2.1.3",a.tags=["{{","}}"];var y=new n;a.clearCache=function(){return y.clearCache()},a.parse=function(a,b){return y.parse(a,b)},a.render=function(a,b,d){if("string"!=typeof a)throw new TypeError('Invalid template! Template should be a "string" but "'+c(a)+'" was given as the first argument for mustache#render(template, view, partials)');return y.render(a,b,d)},a.to_html=function(c,d,e,f){var g=a.render(c,d,e);return b(f)?void f(g):g},a.escape=h,a.Scanner=l,a.Context=m,a.Writer=n}),Object.equals=function(a,b){if(a===b)return!0;if(!(a instanceof Object&&b instanceof Object))return!1;if(a.constructor!==b.constructor)return!1;for(var c in a)if(a.hasOwnProperty(c)){if(!b.hasOwnProperty(c))return!1;if(a[c]!==b[c]){if("object"!=typeof a[c])return!1;if(!Object.equals(a[c],b[c]))return!1}}for(var c in b)if(b.hasOwnProperty(c)&&!a.hasOwnProperty(c))return!1;return!0};var TemplateCache={};TemplateCache["addressSuggestions/addressDoctor.html"]='',TemplateCache["addressSuggestions/postFinder.html"]='{{#addresses}}\n
\n
\n \n
\n
\n{{/addresses}}\n',TemplateCache["error/errorMessage.html"]='
\n Code {{code}}:\n {{{message}}}\n
\n',TemplateCache["error/errorPopup.html"]='
\n \n
\n
\n
\n',TemplateCache["modal/modal.html"]='\n',TemplateCache["waitscreen/waitscreen.html"]='
',function(a){function b(a,b,c,d){a.on(b,function(a){return h.push(a),c.apply(null,d)})}function c(b){var c=a(b);c.is('input[type="checkbox"]')&&c.on("change",function(){c.is(":checked")?c.trigger("check"):c.trigger("uncheck")}),c.is('input[type="radio"]')&&c.on("change",function(){var b=c.attr("name");a('input[type="radio"][name="'+b+'"]').each(function(b,c){var d=a(c);d.is(":checked")?d.trigger("check"):d.trigger("uncheck")})})}function d(a,b){for(var c=/^(([\w]+):)?([\w]+)\.([\w]+)(\((.*)\))?$/,d=a.split(";"),e=[],f=0;f0)for(var j=h[6].match(/(['][^']+['])|([\w-]+)|(["][^"]+["])/g),k=0;k=c&&f.services.hasOwnProperty(i)){PlentyFramework.prototype.hasOwnProperty(i)||e(f.services[i],2,d),g.push(PlentyFramework.prototype[i]);continue}if(1>=c&&f.directives.hasOwnProperty(i)){PlentyFramework.directives.hasOwnProperty(i)||e(f.directives[i],1,d),g.push(PlentyFramework.directives[i]);continue}console.error('Cannot inject dependency "'+i+'": Object not found.')}else console.error("Cyclic dependency injection: "+d.join(" -> ")+" -> "+i)}3==c?PlentyFramework.factories[b.name]=b.setup.apply(null,g):2==c?PlentyFramework.prototype[b.name]=b.setup.apply(null,g):1==c&&(PlentyFramework.directives[b.name]=b.setup.apply(null,g))}var f={factories:{},services:{},directives:{}};PlentyFramework=function(){};var g=null;PlentyFramework.getInstance=function(){return g=g||new PlentyFramework},PlentyFramework.partials={},PlentyFramework.globals={},PlentyFramework.setGlobal=function(a,b){return PlentyFramework.globals.hasOwnProperty(a)?(console.error('Global variable "'+a+'" already exists and cannot be overridden.'),null):(PlentyFramework.globals[a]=b,PlentyFramework.globals[a])},PlentyFramework.getGlobal=function(a){return PlentyFramework.globals[a]},PlentyFramework.directives={},PlentyFramework.directive=function(a,b,c){return"string"!=typeof a?void console.error("Type mismatch: Expect first parameter to be a 'string', '"+typeof a+"' given."):"function"!=typeof b?void console.error("Type mismatch: Expect second parameter to be a 'function', '"+typeof b+"' given."):(c=c||[],void(f.directives[a]={name:a,dependencies:c,setup:b}))},PlentyFramework.prototype.bindDirectives=function(e){e=e||"html",a(e).find("[data-plenty]").each(function(e,f){var g=d(a(f).attr("data-plenty"),a(f));if(!(g.length<=0)){c(f);for(var e=0;e=0;c--)if(a==h[c].type)return h[c];return null},PlentyFramework.pushEvent=function(a){h.push(a)},PlentyFramework.service=function(a,b,c){return"string"!=typeof a?void console.error("Type mismatch: Expect first parameter to be a 'string', '"+typeof a+"' given."):"function"!=typeof b?void console.error("Type mismatch: Expect second parameter to be a 'function', '"+typeof b+"' given."):(c=c||[],void(f.services[a]={name:a,dependencies:c,setup:b}))},PlentyFramework.factories={},PlentyFramework.factory=function(a,b,c){return"string"!=typeof a?void console.error("Type mismatch: Expect first parameter to be a 'string', '"+typeof a+"' given."):"function"!=typeof b?void console.error("Type mismatch: Expect second parameter to be a 'function', '"+typeof b+"' given."):(c=c||[],void(f.factories[a]={name:a,dependencies:c,setup:b}))},PlentyFramework.compileTemplate=function(a,b){return b=b||{},b.translate=function(){return function(a,b){return b(PlentyFramework.translate(a))}},Mustache.render(TemplateCache[a],b)},PlentyFramework.scriptPath="",PlentyFramework.Strings={},PlentyFramework.loadLanguageFile=function(b){a.get(PlentyFramework.scriptPath+b).done(function(a){PlentyFramework.Strings=a})},PlentyFramework.translate=function(a,b){var c;return PlentyFramework.Strings.hasOwnProperty(a)?c=PlentyFramework.Strings[a]:(c=a,console.warn('No translation found for "'+c+'".')),b&&(c=Mustache.render(c,b)),c},PlentyFramework.compile=function(){for(var a in f.factories)PlentyFramework.factories.hasOwnProperty(a)||e(f.factories[a],3);for(var b in f.services)PlentyFramework.prototype.hasOwnProperty(b)||e(f.services[b],2);for(var c in f.directives)PlentyFramework.directives.hasOwnProperty(c)||e(f.directives[c],1);var d=document.getElementsByTagName("SCRIPT");d.length>0&&(PlentyFramework.scriptPath=d[d.length-1].src.match(/(.*)\/(.*)\.js(\?\S*)?$/)[1])}}(jQuery),PlentyFramework.cssClasses={active:"active"},function(a,b){b.partials.Error={init:function(b){a(b).find(".close").click(function(){b.hide(),b.find(".plentyErrorBoxInner").html("")})},addError:function(b,c){var d=a(c).attr("data-plenty-error-code");a(b).find('[data-plenty-error-code="'+d+'"]').length<=0&&a(b).find(".plentyErrorBoxInner").append(c)},show:function(b){a(b).show()}}}(jQuery,PlentyFramework),function(a,b){b.partials.Modal={init:function(a,b){a.on("hidden.bs.modal",function(){b.hide(),a.remove()}),b.timeout>0&&(a.on("hide.bs.modal",b.stopTimeout),a.find(".modal-content").hover(function(){b.pauseTimeout()},function(){a.is(".in")&&b.continueTimeout()}))},show:function(a){a.modal("show")},hide:function(a){a.modal("hide")},isModal:function(b){return a(b).filter(".modal").length+a(b).find(".modal").length>0},getModal:function(b){var c=a(b);return c.length>1&&(c=a(b).filter(".modal")||a(b).find(".modal")),c}}}(jQuery,PlentyFramework),function(a){a(document).on("initPartials",function(b,c){a(c).find('[data-toggle="tooltip"]').tooltip({container:"body"})})}(jQuery),function(a,b){b.partials.WaitScreen={show:function(a){a.addClass("in")},hide:function(a){a.removeClass("in")}}}(jQuery,PlentyFramework),function(a,b){b.factory("APIFactory",function(c,d){function e(){b.getGlobal("LoginSession")&&(l&&clearTimeout(l),l=setTimeout(function(){a(window).trigger("login-expired"),"Checkout"===b.getGlobal("PageDesign")&&d.prepare().setTitle(b.translate("Your session has expired.")).setContent(b.translate("Please log in again to continue shopping.")).setLabelDismiss(null).setLabelConfirm(b.translate("OK")).onConfirm(function(){window.location.assign("/")}).onDismiss(function(){window.location.assign("/")}).show()},b.getGlobal("LoginSessionExpiration")))}function f(b){try{var d=a.parseJSON(b.responseText);c.printErrors(d.error.error_stack)}catch(e){c.throwError(b.status,b.statusText)}}function g(b,d,g,h,i){return h||c.showWaitScreen(),a.ajax(b,{type:"GET",data:d,dataType:"json",async:!i,error:function(a){g||f(a)}}).always(function(){h||c.hideWaitScreen(),e()})}function h(b,d,g,h){var i={type:"POST",dataType:"json",error:function(a){g||f(a)}};return d&&d.isFile?(i.cache=d.cache,i.processData=d.processData,i.data=d.data,i.contentType=!1):(i.data=JSON.stringify(d),i.contentType="application/json"),h||c.showWaitScreen(),a.ajax(b,i).always(function(){h||c.hideWaitScreen(),e()})}function i(b,d,g,h){return h||c.showWaitScreen(),a.ajax(b,{type:"PUT",data:JSON.stringify(d),dataType:"json",contentType:"application/json",error:function(a){g||f(a)}}).always(function(){h||c.hideWaitScreen(),e()})}function j(b,d,g,h){return h||c.showWaitScreen(),a.ajax(b,{type:"DELETE",data:JSON.stringify(d),dataType:"json",contentType:"application/json",error:function(a){g||f(a)}}).always(function(){h||c.hideWaitScreen(),e()})}function k(){return a.Deferred().resolve()}var l=null;return a(document).ready(function(){e()}),{get:g,post:h,put:i,"delete":j,idle:k}},["UIFactory","ModalFactory"])}(jQuery,PlentyFramework),function(a){a.factory("CMSFactory",function(a){function b(b,c){function d(d){return a.get("/rest/"+d.toLowerCase()+"/container_"+b.toLowerCase()+"/",c)}return{from:d}}function c(b,c){function d(d){return a.get("/rest/"+d.toLowerCase()+"/"+b.toLowerCase()+"/",c)}return{from:d}}function d(b){return a.get("/rest/categoryview/categorycontentbody/?categoryID="+b)}return{getContainer:b,getParams:c,getCategoryContent:d}},["APIFactory"])}(PlentyFramework),function(a){a.factory("CheckoutFactory",function(b,c,d){function e(){return l}function f(a){return m&&l||g(!0),a?$.extend(!0,{},l):m}function g(a){return b.get("/rest/checkout/",null,!1,!1,a).done(function(a){a?(l=a.data,m=new e):d.throwError(0,'Could not receive checkout data [GET "/rest/checkout/" receives null value]')})}function h(){return b.put("/rest/checkout",m).done(function(a){a?(l=a.data,m=new e):d.throwError(0,'Could not receive checkout data [GET "/rest/checkout/" receives null value]')})}function i(b){return c.getContainer("checkout"+b).from("checkout").done(function(c){$('[data-plenty-checkout-template="'+b+'"]').each(function(b,d){$(d).html(c.data[0]),a.getInstance().bindDirectives(d),$(window).trigger("contentChanged")})})}function j(b){return c.getCategoryContent(b).done(function(c){$('[data-plenty-checkout-catcontent="'+b+'"]').each(function(b,d){$(d).html(c.data[0]),a.getInstance().bindDirectives(d),$(window).trigger("contentChanged")})})}function k(b){return c.getContainer("itemview"+b).from("itemview").done(function(c){$('[data-plenty-itemview-template="'+b+'"]').each(function(b,d){$(d).html(c.data[0]),a.getInstance().bindDirectives(d),$(window).trigger("contentChanged")})})}var l,m;return{getCheckout:f,setCheckout:h,loadCheckout:g,reloadContainer:i,reloadCatContent:j,reloadItemContainer:k}},["APIFactory","CMSFactory","UIFactory"])}(PlentyFramework),function(a,b){b.factory("ModalFactory",function(){function c(a){return PlentyFramework.partials.Modal.isModal(a)}function d(){return new e}function e(){function d(a){return s.title=a,this}function e(a){return s.cssClass=a,this}function f(a){return s.content=a,this}function g(a){return s.labelConfirm=a,this}function h(a){return s.labelDismiss=a,this}function i(a){return s.onConfirm=a,this}function j(a){return s.onDismiss=a,this}function k(a){return s.container=a,this}function l(a){return s.timeout=a,this}function m(){t=c(s.content)?PlentyFramework.partials.Modal.getModal(s.content):a(PlentyFramework.compileTemplate("modal/modal.html",s)),a(s.container).append(t);var b=a(s.content).filter("script");b.length>0&&b.each(function(b,c){var d=document.createElement("script");d.type="text/javascript",d.innerHTML=a(c).text(),a(s.container).append(d)}),PlentyFramework.partials.Modal.init(t,s),t.find('[data-plenty-modal="confirm"]').click(function(){var a=s.onConfirm();"undefined"==typeof a&&(a=!0),a&&n(!0)}),PlentyFramework.partials.Modal.show(t),s.timeout>0&&o()}function n(a){PlentyFramework.partials.Modal.hide(t),a||s.onDismiss()}function o(){w=s.timeout,x=(new Date).getTime(),u=window.setTimeout(function(){window.clearInterval(v),n()},s.timeout),t.find('[data-plenty-modal="timer"]').text(w/1e3),v=window.setInterval(function(){if(!y){var a=w-(new Date).getTime()+x;a=Math.round(a/1e3),t.find('[data-plenty-modal="timer"]').text(a)}},1e3)}function p(){y=!0,w-=(new Date).getTime()-x,window.clearTimeout(u)}function q(){y=!1,x=(new Date).getTime(),u=window.setTimeout(function(){n(),window.clearInterval(v)},w)}function r(){window.clearTimeout(u),window.clearInterval(v)}var s=this;s.title="",s.cssClass="",s.content="",s.labelDismiss=b.translate("Cancel"),s.labelConfirm=b.translate("Confirm"),s.onConfirm=function(){},s.onDismiss=function(){},s.container="body",s.timeout=-1,s.hide=n,s.startTimeout=o,s.stopTimeout=r,s.pauseTimeout=p,s.continueTimeout=q;var t,u,v,w,x,y=!1;return{setTitle:d,setClass:e,setContent:f,setContainer:k,setLabelConfirm:g,setLabelDismiss:h,onConfirm:i,onDismiss:j,setTimeout:l,show:m,hide:n}}return{prepare:d,isModal:c}})}(jQuery,PlentyFramework),function(a,b){b.factory("UIFactory",function(){function c(a,b){d([{code:a,message:b}])}function d(c){(!i||a("body").has(i).length<=0)&&(i=a(b.compileTemplate("error/errorPopup.html")),a("body").append(i),b.partials.Error.init(i)),a.each(c,function(c,d){b.partials.Error.addError(i,a(b.compileTemplate("error/errorMessage.html",d)))}),b.partials.Error.show(i),f(!0)}function e(){return h=h||0,(!g||a("body").has(g).length<=0)&&(g=a(b.compileTemplate("waitscreen/waitscreen.html")),a("body").append(g)),b.partials.WaitScreen.show(g),h++,h}function f(a){return h--,(0>=h||a)&&(h=0,b.partials.WaitScreen.hide(g)),h}var g,h=0,i=null;return{throwError:c,printErrors:d,showWaitScreen:e,hideWaitScreen:f}})}(jQuery,PlentyFramework),function(a,b){b.service("AddressDoctorService",function(c){function d(b){var c=!0;return b=b||"[data-plenty-address-doctor]",a(b).filter("[data-plenty-address-doctor]:visible").each(function(b,d){var f=new e(d),g=a(d).attr("data-plenty-address-doctor").replace(/\s/g,"").split(",");f.isValid(g)||(c=!1)}),c}function e(c){function d(a){return j()?!0:(k=new f(m.getFormValues()),l=a,e(),1==k.getAddresses().length)}function e(){a(".suggestion-list").remove();for(var b=!1,c=0;cc;c++){var d=a.data[c],f=e(d);f?f.HouseNo.push(d.HouseNo):(d.HouseNo=[d.HouseNo],j.push(d))}})}function e(a){for(var b=j.length,c=0;b>c;c++)if(a.Street==j[c].Street&&j.ZIP==j[c].ZIP&&a.City==j[c].City)return j[c];return null}function f(){return j}function g(b){for(var c=[],d=j.length,e=0;d>e;e++){var f=j[e];a.inArray(f[b],c)<0&&c.push(f[b])}return c}function h(a){for(var b=[],c=j.length,d=0;c>d;d++){var e=j[d];(a.Street&&a.Street==e.Street||a.ZIP&&a.ZIP==e.ZIP||a.City&&a.City==e.City)&&b.push(e)}j=b}function i(a){a=parseInt(a);for(var b=j.length,c=0;b>c;c++)for(var d=j[c],e=0;e=f[0]&&a<=f[1])return!0}return!1}var j=[];return d(),{getAddresses:f,getList:g,filter:h,houseNoAllowed:i}}return{validateAddress:d}},["APIFactory"])}(jQuery,PlentyFramework),function(a,b){b.service("AuthenticationService",function(c,d,e){function f(){var b=a('[data-plenty-checkout="lostPasswordForm"]');if(b.validateForm()){var d=b.getFormValues(),e={Email:d.Email};return c.post("/rest/checkout/lostpassword/",e).done(function(b){1==b.data.IsMailSend&&(a('[data-plenty-checkout="lostPasswordTextContainer"]').hide(),a('[data-plenty-checkout="lostPasswordSuccessMessage"]').show())})}}function g(a){if(a.validateForm()){var b=a.getFormValues(),d={Email:b.loginMail,Password:b.loginPassword};return e.showWaitScreen(),c.post("/rest/checkout/login/",d).done(function(){window.location.assign(a.attr("action"))})}}function h(a){return c.post("/rest/checkout/customerinvoiceaddress/",a).done(function(a){d.getCheckout().CustomerInvoiceAddress=a.data})}function i(){var c=a('[data-plenty-checkout-form="customerRegistration"]');if(c.validateForm()&&b.getInstance().AddressDoctorService.validateAddress()){var d=c.getFormValues();if(d.LoginType=2,d.checkout&&d.checkout.customerInvoiceAddress&&d.checkout.customerInvoiceAddress.CustomerProperty){var e=d.checkout.customerInvoiceAddress.CustomerProperty;d.CustomerPropertiesList=d.CustomerPropertiesList||[];for(var f in e)e[f]&&d.CustomerPropertiesList.push({PropertyID:f,PropertyValue:e[f]})}return h(d).done(function(){window.location.assign(c.attr("action"))})}}return{resetPassword:f,customerLogin:g,setInvoiceAddress:h,registerCustomer:i}},["APIFactory","CheckoutFactory","UIFactory"])}(jQuery,PlentyFramework),function(a,b){b.service("BasketService",function(c,d,e,f,g){function h(d){d&&c.get("/rest/checkout/container_"+"CheckoutOrderParamsList".toLowerCase()+"/",{itemID:d[0].BasketItemItemID,quantity:d[0].BasketItemQuantity},!1,!0).done(function(c){c.data[0].indexOf("form-group")>0?g.prepare().setContent(c.data[0]).setTitle(b.translate("Select order parameters")).setLabelConfirm(b.translate("Save")).onConfirm(function(){return a('[data-plenty-checkout-form="OrderParamsForm"]').validateForm()?(j(i(d)),!0):!1}).show():j(d)})}function i(b){var c,d=a('[data-plenty-checkout-form="OrderParamsForm"]'),e={},f="";return d.find('[name^="ParamGroup"]').each(function(){c=this.name.match(/^ParamGroup\[(\d+)]\[(\d+)]$/),b=m(b,c[1],a(this).val(),a(this).val())}),d.find('[name^="ParamValue"]').each(function(){if(e=a(this),f=e.attr("type"),("checkbox"==f&&e.is(":checked")||"radio"==f&&e.is(":checked")||"radio"!=f&&"checkbox"!=f)&&"file"!=f&&"hidden"!=f){var c=e[0].name.match(/^ParamValue\[(\d+)]\[(\d+)]$/);b=m(b,c[1],c[2],e.val())}else if("file"==f)if(e[0].files&&e[0].files.length>0)b=l(e,b);else{var c=e[0].name.match(/^ParamValueFile\[(\d+)]\[(\d+)]$/),d=a('input[type="hidden"][name="ParamValue['+c[1]+"]["+c[2]+']"]').val();b=m(b,c[1],c[2],d)}}),b}function j(a){c.post("/rest/checkout/basketitemslist/",a,!0).done(function(){f.loadCheckout().done(function(){s(),e.getContainer("ItemViewItemToBasketConfirmationOverlay",{ArticleID:a[0].BasketItemItemID}).from("ItemView").done(function(a){g.prepare().setContent(a.data[0]).setTimeout(5e3).show()})})}).fail(function(a){d.printErrors(JSON.parse(a.responseText).error.error_stack)})}function k(a){c.put("/rest/checkout/basketitemslist/",a).done(function(){f.reloadCatContent(b.getGlobal("basketCatID")),f.loadCheckout().done(function(){s()})})}function l(a,b){var d,e,f=a[0].id,g={},h=[],i={type:"POST",data:{},isFile:!0,cache:!1,dataType:"json",processData:!1,contentType:!1};g[f]=a[0].files,-1==h.indexOf(f)&&h.push(f);for(var j=0,k=h.length;k>j;++j)d=new FormData,e=g[h[j]],d.append("0",e[0],e[0].name),i.data=d,c.post("/rest/checkout/orderparamfile/",i);var l=a[0].name.match(/^ParamValueFile\[(\d+)]\[(\d+)]$/);return m(b,l[1],l[2],a.val())}function m(b,c,d,e){return c>0&&void 0==b[c]&&(b[c]=a.extend(!0,{},b[0]),b[c].BasketItemOrderParamsList=[]),void 0!=b[c]&&(b[c].BasketItemQuantity=1,void 0==b[c].BasketItemOrderParamsList&&(b[c].BasketItemOrderParamsList=[]),e&&b[c].BasketItemOrderParamsList.push({BasketItemOrderParamID:d,BasketItemOrderParamValue:e})),b}function n(b){var c=a('[data-plenty-basket-item="'+b+'"]');c.modal("show"),c.find('[data-plenty-modal="confirm"]').on("click",function(){var d=p(b),e=[];c.find('select, .PlentyFormContainer.AttrImage > input[type="hidden"]').each(function(b,c){var d=c.name.match(/^ArticleAttribute\[\d+]\[\d+]\[(\d+)]$/);d&&d[1]&&e.push({BasketItemAttributeID:d[1],BasketItemAttributeValueID:a(c).val()})}),0!=e.length&&(d.BasketItemAttributesList=e),k([d])})}function o(d){var e=p(d);e.BasketItemOrderParamsList=[],c.get("/rest/checkout/container_"+"CheckoutOrderParamsList".toLowerCase()+"/",{itemID:e.BasketItemItemID,quantity:e.BasketItemQuantity,basketItemID:d}).done(function(c){g.prepare().setContent(c.data[0]).setTitle(b.translate("Edit order parameters")).setLabelConfirm(b.translate("Save")).onConfirm(function(){return a('[data-plenty-checkout-form="OrderParamsForm"]').validateForm()?(k(i([e])),!0):!1}).show()})}function p(a){for(var b=f.getCheckout().BasketItemsList,c=0;c"+b.translate('Do you really want to remove "{{item}}" from your basket?',{item:j})+"

").onDismiss(function(){i.reject()}).onConfirm(function(){h()}).setLabelConfirm(b.translate("Delete")).show(),i}function r(d,e){if(0>=e)return q(d);for(var g,h,i=a.Deferred(),j=f.getCheckout().BasketItemsList,k=0;k0&&f.reloadContainer("Totals")}return{addItem:h,removeItem:q,getItem:p,setItemQuantity:r,editItemAttributes:n,editOrderParams:o,addCoupon:t,removeCoupon:u}},["APIFactory","UIFactory","CMSFactory","CheckoutFactory","ModalFactory"])}(jQuery,PlentyFramework),function(a,b){b.service("CheckoutService",function(c,d,e,f){function g(){e.loadCheckout(!0)}function h(){var b=a('[data-plenty-checkout-form="details"]'),d=b.getFormValues();return e.getCheckout().CheckoutCustomerSign||(e.getCheckout().CheckoutCustomerSign=""),e.getCheckout().CheckoutOrderInfoText||(e.getCheckout().CheckoutOrderInfoText=""),e.getCheckout().CheckoutCustomerSign!==d.CustomerSign&&a(b).find('[name="CustomerSign"]').length>0||e.getCheckout().CheckoutOrderInfoText!==d.OrderInfoText&&a(b).find('[name="OrderInfoText"]').length>0?(e.getCheckout().CheckoutCustomerSign=d.CustomerSign,e.getCheckout().CheckoutOrderInfoText=d.OrderInfoText,e.setCheckout()):c.idle()}function i(d){var f=a('[data-plenty-checkout-form="shippingAddress"]');if(!d&&!f.validateForm())return!1;if(!d&&!b.getInstance().AddressDoctorService.validateAddress(f))return!1;var g=f.getFormValues(),h=a('[name="shippingAddressID"]:checked').val();if(a("#shippingAdressSelect").modal("hide"),0>h){var i=g;return k(i,e.getCheckout().CustomerShippingAddress)?c.idle():("PACKSTATION"==i.Street?(i.IsPackstation=1,i.PackstationNo=i.HouseNo):"POSTFILIALE"==i.Street&&(i.IsPostfiliale=1,i.PostfilialNo=i.HouseNo),c.post("/rest/checkout/customershippingaddress/",i).done(function(a){e.getCheckout().CheckoutCustomerShippingAddressID=a.data.ID,e.getCheckout().CheckoutShippingCountryID=a.data.CountryID,delete e.getCheckout().CheckoutMethodOfPaymentID,delete e.getCheckout().CheckoutShippingProfileID,e.setCheckout().done(function(){e.reloadContainer("MethodsOfPaymentList"),e.reloadContainer("ShippingProfilesList"),2==e.getCheckout().CustomerInvoiceAddress.LoginType&&e.reloadContainer("CustomerShippingAddress")})}))}return h!=e.getCheckout().CheckoutCustomerShippingAddressID?(e.getCheckout().CheckoutCustomerShippingAddressID=h,delete e.getCheckout().CheckoutMethodOfPaymentID,delete e.getCheckout().CheckoutShippingProfileID,e.setCheckout().done(function(){e.reloadContainer("MethodsOfPaymentList"),e.reloadContainer("ShippingProfilesList"),2==e.getCheckout().CustomerInvoiceAddress.LoginType&&e.reloadContainer("CustomerShippingAddress")})):c.idle()}function j(){var b=a('[data-plenty-checkout-form="guestRegistration"]'),d=b.getFormValues();return d.LoginType=1,d.CustomerPropertiesList=d.CustomerPropertiesList||[],b.find("[data-plenty-property-id]").each(function(b,c){d.CustomerPropertiesList.push({PropertyID:a(c).attr("data-plenty-property-id"),PropertyValue:a(c).val()})}),k(d,e.getCheckout().CustomerInvoiceAddress)?i():c.post("/rest/checkout/customerinvoiceaddress/",d).done(function(a){i().done(function(){e.loadCheckout()})})}function k(a,b){for(var c in a)if(a[c]+""!=b[c]+""&&"EmailRepeat"!==c)return!1;return!0}function l(){var b=a('[data-plenty-checkout-form="shippingProfileSelect"]').getFormValues();return e.getCheckout().CheckoutShippingProfileID=b.ShippingProfileID,delete e.getCheckout().CheckoutCustomerShippingAddressID,delete e.getCheckout().CheckoutMethodOfPaymentID,e.setCheckout().done(function(){e.reloadContainer("MethodsOfPaymentList")})}function m(){return c.post("/rest/checkout/preparepayment/",null).done(function(b){if(""!=b.data.CheckoutMethodOfPaymentRedirectURL)document.location.assign(b.data.CheckoutMethodOfPaymentRedirectURL);else if(b.data.CheckoutMethodOfPaymentAdditionalContent){var c=a(b.data.CheckoutMethodOfPaymentAdditionalContent).find('[data-plenty-checkout-form="bankDetails"]').length>0;f.prepare().setContent(b.data.CheckoutMethodOfPaymentAdditionalContent).onConfirm(function(){return c?p():r()}).show()}})}function n(b){return b=b||a('[data-plenty-checkout-form="methodOfPayment"]').getFormValues().MethodOfPaymentID,e.getCheckout().CheckoutMethodOfPaymentID=b,delete e.getCheckout().CheckoutCustomerShippingAddressID,delete e.getCheckout().CheckoutShippingProfileID,e.setCheckout().done(function(){e.reloadContainer("ShippingProfilesList")})}function o(){d.getContainer("CheckoutPaymentInformationBankDetails").from("Checkout").done(function(b){f.prepare().setContent(b.data[0]).onDismiss(function(){a('input[name="MethodOfPaymentID"]').each(function(b,c){a(c).val()==e.getCheckout().CheckoutMethodOfPaymentID?a(c).attr("checked","checked"):a(c).removeAttr("checked")})}).onConfirm(function(){return p()}).show()})}function p(){var b=a('[data-plenty-checkout-form="bankDetails"]');if(b.validateForm()){var d=b.getFormValues().checkout.customerBankDetails,f={CustomerBankName:d.bankName,CustomerBLZ:d.blz,CustomerAccountNumber:d.accountNo,CustomerAccountOwner:d.accountOwner,CustomerIBAN:d.iban,CustomerBIC:d.bic};return c.post("/rest/checkout/paymentinformationbankdetails/",f).done(function(){e.loadCheckout().done(function(){n(3),e.reloadContainer("MethodsOfPaymentList")})}),!0}return!1}function q(){d.getContainer("CheckoutPaymentInformationCreditCard").from("Checkout").done(function(b){f.prepare().setContent(b.data[0]).onDismiss(function(){a('input[name="MethodOfPaymentID"]').each(function(b,c){a(c).val()==e.getCheckout().CheckoutMethodOfPaymentID?a(c).attr("checked","checked"):a(c).removeAttr("checked")})}).onConfirm(function(){return r()}).show()})}function r(){var b=a('[data-plenty-checkout-form="creditCard"]');if(b.validateForm()){var d=b.getFormValues().checkout.paymentInformationCC,f={Owner:d.owner,Cvv2:d.cvv2,Number:d.number,Year:d.year,Month:d.month,Provider:d.provider};return c.post("/rest/checkout/paymentinformationcreditcard/",f).done(function(){e.loadCheckout()}),!0}return!1}function s(b){if(2==e.getCheckout().CustomerInvoiceAddress.LoginType)var c=a('[data-plenty-checkout-form="shippingAddress"]').getFormValues();else var c=a('[data-plenty-checkout-form="guestRegistration"]').getFormValues();var g={street:c.Street,houseNo:c.HouseNo,ZIP:c.ZIP,city:c.City,postnummer:c.Postnummer,suggestionType:"postfinder"};d.getContainer("CheckoutAddressSuggestionResultsList",g).from("Checkout").done(function(a){f.prepare().setContent(a.data[0]).show()})}function t(){var b=a('[data-plenty-checkout-form="placeOrder"]');if(b.validateForm()){var d=b.getFormValues(),e={TermsAndConditionsCheck:d.termsAndConditionsCheck||0,WithdrawalCheck:d.withdrawalCheck||0,PrivacyPolicyCheck:d.privacyPolicyCheck||0,AgeRestrictionCheck:d.ageRestrictionCheck||0,NewsletterCheck:d.newsletterCheck||0,KlarnaTermsAndConditionsCheck:d.klarnaTermsAndConditionsCheck||0,PayoneDirectDebitMandateCheck:d.payoneDirectDebitMandateCheck||0,PayoneInvoiceCheck:d.payoneInvoiceCheck||0};return c.post("/rest/checkout/placeorder/",e).done(function(a){""!=a.data.MethodOfPaymentRedirectURL?window.location.assign(a.data.MethodOfPaymentRedirectURL):""!=a.data.MethodOfPaymentAdditionalContent?f.prepare().setContent(a.data.MethodOfPaymentAdditionalContent).setLabelDismiss("").onDismiss(function(){window.location.assign(b.attr("action"))}).onConfirm(function(){window.location.assign(b.attr("action"))}).show():window.location.assign(b.attr("action"))})}}return{init:g,setCustomerSignAndInfo:h,registerGuest:j,setShippingProfile:l,saveShippingAddress:i,loadAddressSuggestion:s,preparePayment:m,setMethodOfPayment:n,editBankDetails:o,editCreditCard:q,placeOrder:t}},["APIFactory","CMSFactory","CheckoutFactory","ModalFactory"])}(jQuery,PlentyFramework),function(a,b){b.service("FeedbackService",function(a){function b(){function b(a,b){return e.dateStart=a,e.dateEnd=b,this}function c(b,c,f){var g={ReferenceId:c,FromDate:e.dateStart,ToDate:e.dateEnd,FeedbackType:f||d().COMMENTS_AND_RATINGS};return a.get("/rest/feedback/"+b+"/",g)}var e={dateStart:null,dateEnd:null};return{between:b,"for":c}}function c(){function b(a){return f.Rating=a,this}function c(a){return f.Text=a,this}function d(a,b,c){return f.Author=a,b&&(f.Email=b),c&&(f.CustomerId=c),this}function e(b,c){return a.post("/rest/feedback/"+b+"/",f)}var f={Rating:1,Text:"",Author:"",Email:"",CustomerId:0};return{withRating:b,withComment:c,withAuthor:d,to:e}}function d(){return{COMMENTS_ONLY:"comments_only",RATINGS_ONLY:"ratings_only",COMMENTS_AND_RATINGS:"comments_with_ratings"}}function e(){return{ITEM:"item",CATEGORY:"category",BLOG:"blog"}}return{getFeedbacks:b,addFeedback:c,ArticleTypes:e(),FeedbackTypes:d()}},["APIFactory"])}(jQuery,PlentyFramework),function(a,b){b.service("MediaSizeService",function(){function b(){return e&&c(),e}function c(){var b;if(b=window.matchMedia?window.matchMedia("(min-width:1200px)").matches?"lg":window.matchMedia("(min-width:992px)").matches?"md":window.matchMedia("(min-width:768px)").matches?"sm":"xs":a(window).width()>=1200?"lg":a(window).width()>=992?"md":a(window).width()>=768?"sm":"xs",b!=e||"xs"===b){var c=e;e=b,a(window).trigger("sizeChange",[e,c])}}function d(a){for(var b=a.replace(/\s/g,"").split(","),c=0;c li'),r=a('[data-plenty-checkout="container"] > div'),u=a('[data-plenty-checkout="next"]'),t=a('[data-plenty-checkout="prev"]'),q.length==r.length&&r.length>0){d.getCheckout();r.hide(),q.each(function(b,c){a(c).addClass("disabled"),a(c).click(function(){a(this).is(".disabled")||j(b)})}),u.attr("disabled","disabled"),u.click(function(){m()}),t.attr("disabled","disabled"),t.click(function(){n()}),window.addEventListener("hashchange",function(){window.location.hash.length>0?o(window.location.hash):j(0)},!1),a.urlParam=function(a){var b=new RegExp("[?&]"+a+"=([^&#]*)").exec(window.location.href);return null==b?null:b[1]||0};var c=a.urlParam("gototab");0==window.location.hash.length&&c&&a('[data-plenty-checkout-id="'+c+'"]').length>0?window.location.hash=c:j(!o(window.location.hash)&&s>=0?s:0),p(),a(window).on("sizeChange",p),a(window).resize(function(){"xs"==b.getInstance().MediaSizeService.interval()&&p()})}}function f(){return s>=0?{id:a(r[s]).attr("data-plenty-checkout-id"),index:s}:null}function g(a){return v.beforeChange.push(a),b.getInstance().NavigatorService}function h(a){return v.afterChange.push(a),b.getInstance().NavigatorService}function i(b,c){var d=!0;if(s>=0||"afterChange"===b){var e=f(),g={index:c,id:a(r[c]).attr("data-plenty-checkout-id")};a.each(v[b],function(a,b){return b(e,g)===!1?(d=!1,!1):void 0})}return d}function j(e,f){var g=s!==e;(!g||f||i("beforeChange",e))&&(s=e,!Object.equals(w[s],d.getCheckout(!0))&&g&&a(r[s]).attr("data-plenty-checkout-content")?(w[s]=d.getCheckout(!0),c.getCategoryContent(a(r[s]).attr("data-plenty-checkout-content")).done(function(c){a(r[s]).html(c.data[0]),k(g),b.getInstance().bindDirectives(r[s]),a(window).trigger("contentChanged")})):k(g))}function k(b){a(r).hide();var c;a(q).each(function(b,d){c=a(d),c.removeClass("disabled active"),c.find('[role="tab"]').attr("aria-selected","false"),s>b?c.addClass("visited"):b==s?(c.addClass("active visited"),c.find('[role="tab"]').attr("aria-selected","true")):b>s&&!c.is(".visited")&&c.addClass("disabled")}),p(),0>=s?t.attr("disabled","disabled"):t.removeAttr("disabled"),s+1==q.length?u.attr("disabled","disabled"):u.removeAttr("disabled"),a(r[s]).show(),s>0?window.location.hash=a(r[s]).attr("data-plenty-checkout-id"):window.location.hash.length>0&&(window.location.hash=""),b&&i("afterChange",s)}function l(a){j(a.index,!0)}function m(){s0&&j(s-1)}function o(b){return"next"==b?(m(),!0):"prev"==b?(n(),!0):(b=b.replace("#",""),a(r).each(function(c,d){return a(d).attr("data-plenty-checkout-id")==b?(j(c),!0):void 0}),!1)}function p(){var b=q.length;if(!(0>=b)){a(q).removeAttr("style"),a(q).children("span").removeAttr("style"),a(u).removeAttr("style"),a(t).removeAttr("style");var c=a(t).outerWidth()c?a(d).children("span").css({paddingLeft:g+"px",paddingRight:h+"px"}):a(d).children("span").css({paddingLeft:j+"px",paddingRight:k+"px"})})}}var q=[],r=[],s=-1,t={},u={},v={beforeChange:[],afterChange:[]},w=[];return{init:e,getCurrentContainer:f,goTo:j,beforeChange:g,afterChange:h,continueChange:l,next:m,previous:n,goToID:o,fillNavigation:p}},["CMSFactory","CheckoutFactory"])}(jQuery,PlentyFramework),function(a,b){b.service("PostfinderService",function(c,d,e){function f(){var b=a('input[name="Street"]').val();return"PACKSTATION"==b.toUpperCase()||"POSTFILIALE"==b.toUpperCase()}function g(){j={PostfinderItemStreet:a('input[name="Street"]','[data-plenty-checkout-form="shippingAddress"]'),PostfinderItemZIP:a('input[name="ZIP"]','[data-plenty-checkout-form="shippingAddress"]'),PostfinderItemCity:a('input[name="City"]','[data-plenty-checkout-form="shippingAddress"]'),PostfinderItemHouseNo:a('input[name="HouseNo"]','[data-plenty-checkout-form="shippingAddress"]')},j.PostfinderItemStreet.val(""),j.PostfinderItemZIP.val().length>2||j.PostfinderItemCity.val().length>2?c.get("/rest/checkout/shippingaddresspostfinderlist/",{suggestionType:"postfinder",zip:j.PostfinderItemZIP.val(),city:j.PostfinderItemCity.val()}).done(function(c){l=c.data,k=l.length,0==k&&h();for(var e={addresses:[]},f=0;k>f;f++){var g="km",m=l[f].PostfinderItemDistance,n=m/1e3;n=(Math.round(100*n)/100).toFixed(2).replace(".",","),1e3>m&&(n=m,g="m"),e.addresses.push({index:f,dimension:g,type:l[f].PostfinderItemIsPackstation?"Packstation":"Postfiliale",number:l[f].PostfinderItemIsPackstation?l[f].PostfinderItemPackstationNo:l[f].PostfinderItemPostfilialNo,street:l[f].PostfinderItemStreet,houseNo:l[f].PostfinderItemHouseNo,zip:l[f].PostfinderItemZIP,city:l[f].PostfinderItemCity,district:l[f].PostfinderItemDistrict,distance:n,remark:l[f].PostfinderItemRemark})}var o=b.compileTemplate("addressSuggestions/postFinder.html",e);d.prepare().setTitle(b.translate("Packstations and post offices in your area")).setContent(o).setClass("checkout").onConfirm(function(){return j.PostfinderItemCity.removeClass("has-error").addClass("has-success"),a('label[for="'+j.PostfinderItemCity.attr("id")+'"]').removeClass("has-error").addClass("has-success"),j.PostfinderItemZIP.removeClass("has-error").addClass("has-success"),a('label[for="'+j.PostfinderItemZIP.attr("id")+'"]').removeClass("has-error").addClass("has-success"),j.PostfinderItemStreet.removeClass("has-error").addClass("has-success"),a('label[for="'+j.PostfinderItemStreet.attr("id")+'"]').removeClass("has-error").addClass("has-success"),j.PostfinderItemHouseNo.removeClass("has-error").addClass("has-success"),a('label[for="'+j.PostfinderItemHouseNo.attr("id")+'"]').removeClass("has-error").addClass("has-success"),i=a('input[type="radio"][name="postfinder"]:checked').val(),l[i].PostfinderItemIsPackstation?(a(j.PostfinderItemStreet).val("PACKSTATION"),a(j.PostfinderItemHouseNo).val(l[i].PostfinderItemPackstationNo)):(a(j.PostfinderItemStreet).val("POSTFILIALE"),a(j.PostfinderItemHouseNo).val(l[i].PostfinderItemPostfilialNo)),a(j.PostfinderItemStreet).trigger("change"),a(j.PostfinderItemCity).val(l[i].PostfinderItemCity),a(j.PostfinderItemZIP).val(l[i].PostfinderItemZIP),!0}).show()}):h()}function h(){e.throwError(0,b.translate("Please enter a ZIP code and/or a city.")),j.PostfinderItemCity.removeClass("has-success").addClass("has-error"),a('label[for="'+j.PostfinderItemCity.attr("id")+'"]').removeClass("has-success").addClass("has-error"),j.PostfinderItemZIP.removeClass("has-success").addClass("has-error"),a('label[for="'+j.PostfinderItemZIP.attr("id")+'"]').removeClass("has-success").addClass("has-error"),j.PostfinderItemCity.focus(function(){a(this).removeClass("has-error");var b=a(this).attr("id");a(this).closest(".form-group").find('[for="'+b+'"]').removeClass("has-error")}),j.PostfinderItemZIP.focus(function(){a(this).removeClass("has-error");var b=a(this).attr("id");a(this).closest(".form-group").find('[for="'+b+'"]').removeClass("has-error")})}var i="",j={},k={},l={};return{openPostfinderModal:g,isPackstation:f}},["APIFactory","ModalFactory","UIFactory"])}(jQuery,PlentyFramework),function(a,b){b.service("SocialShareService",function(){function b(a){var b={"facebook-like":'',"facebook-recommend":'',twitter:'',"google-plus":'
'};return b[a]}function c(){var b=document.location.href,c=a("link[rel=canonical]").attr("href");return c&&c.length>0&&(c.indexOf("http")<0&&(c=document.location.protocol+"//"+document.location.host+c),b=c),b}function d(b){var c=a('meta[name="'+b+'"]').attr("content");return c||""}function e(){var b=d("DC.title"),c=d("DC.creator");return b.length>0&&c.length>0?b+=" - "+c:b=a("title").text(),encodeURIComponent(b)}return"undefined"==typeof socialLangLocale&&(socialLangLocale="en_US"),"undefined"==typeof socialLang&&(socialLang="en"),{getSocialService:b}})}(jQuery,PlentyFramework),function($,pm){pm.service("ValidationService",function(){function getFormControl(a){return a=$(a),a.is("input")||a.is("select")||a.is("textarea")?a:a.find("input").length>0?a.find("input"):a.find("select").length>0?a.find("select"):a.find("textarea").length>0?a.find("textarea"):null}function validateText(a){return a.is("input")||a.is("select")||a.is("textarea")?$.trim(a.val()).length>0:(console.error("Validation Error: Cannot validate Text for <"+a.prop("tagName")+">"),!1)}function validateMail(a){var b=/[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/;return validateText(a)?b.test($.trim(a.val())):!1}function validateNumber(a){return validateText(a)?$.isNumeric($.trim(a.val())):!1}function validateValue(a,b){return $(b).length>0?$.trim(a.val())==$.trim($(b).val()):$.trim(a.val())==b}function visibility(a){return a.is(":visible")}function isEnabled(a){return a.is(":enabled")}function validate(form,errorClass){var formControl,formControls,validationKey,currentHasError,group,checked,checkedMin,checkedMax,attrValidate,validationKeys,formControlAttrType,$form=$(form);errorClass=errorClass||"has-error";var missingFields=[],hasError=!1;$form.find("[data-plenty-validate], input.Required").each(function(i,elem){attrValidate=$(elem).attr("data-plenty-validate"),formControls=getFormControl(elem),validationKeys=attrValidate?attrValidate:"text",validationKeys=validationKeys.split(",");for(var i=0,length=formControls.length;length>i;i++){if(formControl=$(formControls[i]),formControlAttrType=formControl.attr("type"),!visibility(formControl)||!isEnabled(formControl))return;if(validationKey=validationKeys[i].trim()||validationKeys[0].trim(),currentHasError=!1,formControl.is("input")&&"radio"!=formControlAttrType&&"checkbox"!=formControlAttrType||formControl.is("textarea"))switch(validationKey){case"text":currentHasError=!validateText(formControl);break;case"mail":currentHasError=!validateMail(formControl);break;case"number":currentHasError=!validateNumber(formControl);break;case"value":currentHasError=!validateValue(formControl,$(elem).attr("data-plenty-validation-value"));break;case"none":break;default:console.error('Form validation error: unknown validate property: "'+attrValidate+'"')}else if(!formControl.is("input")||"radio"!=formControlAttrType&&"checkbox"!=formControlAttrType){if(!formControl.is("select"))return void console.error("Form validation error: "+$(elem).prop("tagName")+" does not contain an form element");currentHasError=""==formControl.val()||"-1"==formControl.val()}else group=formControl.attr("name"),checked=$form.find('input[name="'+group+'"]:checked').length,"radio"==formControlAttrType?(checkedMin=1,checkedMax=1):(eval("var minMax = "+attrValidate),checkedMin=minMax?minMax.min:1,checkedMax=minMax?minMax.max:1),currentHasError=checkedMin>checked||checked>checkedMax;currentHasError&&(hasError=!0,missingFields.push(formControl),formControls.length>1?(formControl.addClass(errorClass),$form.find('label[for="'+formControl.attr("id")+'"]').addClass(errorClass)):$(elem).addClass(errorClass))}}),$form.on("validationFailed",function(){var a=50,b=$form.find("."+errorClass).first(),c=b.offset().top,d=$("html, body");$form.parents(".modal").length>0?(d=$form.parents(".modal").find(".modal-body"),c=d.scrollTop()-(d.offset().top-b.offset().top)):$form.is(".modal")&&(d=$form.find(".modal-body"),c=d.scrollTop()-(d.offset().top-b.offset().top)),(c-awindow.pageYOffset+window.innerHeight)&&d.animate({scrollTop:c-a})}),hasError&&($form.find("."+errorClass).each(function(a,b){formControl=$(getFormControl(b)),formControl.on("focus click",function(){var a=$(b);a.removeClass(errorClass),$form.find('label[for="'+$(this).attr("id")+'"]').removeClass(errorClass)})}),$form.trigger("validationFailed",[missingFields]));var callback=$form.attr("data-plenty-callback");if(!hasError&&callback&&"submit"!=callback&&"function"==typeof window[callback]){var fields={};return $form.find("input, textarea, select").each(function(){"checkbox"==$(this).attr("type")?fields[$(this).attr("name")]=$(this).is(":checked"):fields[$(this).attr("name")]=$(this).val()}),window[callback](fields),!1}return!hasError}return{validate:validate}}),$.fn.validateForm=function(){return pm.getInstance().ValidationService.validate(this)},$.fn.getFormValues=function(){function a(a,b){var d=a.match(/^([^\[]+)(.*)/);if(d[2]){var e,f=/\[([^\]]+)]/g,g=[];for(g[0]=d[1];null!==(e=f.exec(d[2]));)g.push(e[1]);for(var h=g.length-1;h>=0;h--){var i={};i[g[h]]=b,b=i}c=$.extend(!0,c,b)}else c[d[1]]=b}var b=this,c={};return b.find("input, select, textarea").each(function(c,d){if($(d).attr("name"))if("checkbox"==$(d).attr("type")){var e=[];$(b).find('[name="'+$(d).attr("name")+'"]:checked').each(function(a,b){e.push($(b).val())}),a($(d).attr("name"),e)}else"radio"==$(d).attr("type")?$(d).is(":checked")&&a($(d).attr("name"),$(d).val()):a($(d).attr("name"),$(d).val())}),c}}(jQuery,PlentyFramework),function(a,b){b.directive("Authentication",function(c){function d(d){b.getRecentEvent().preventDefault(),c.customerLogin(a(d))}return{login:d}},["AuthenticationService"])}(jQuery,PlentyFramework),function(a,b){b.directive("Basket",function(c){function d(d){b.getRecentEvent().preventDefault();var e={},f=a(d),g=f.parents("form");e.BasketItemItemID=g.find('[name="ArticleID"]').val(),e.BasketItemPriceID=g.find('[name="SYS_P_ID"]').val(),e.BasketItemQuantity=g.find('[name="ArticleQuantity"]').val(),e.BasketItemBranchID=g.find('[name="source_category"]').val();var h=g.find('[name^="ArticleAttribute"]'),i=[];a.each(h,function(b,c){var d=c.name.match(/^ArticleAttribute\[\d+]\[\d+]\[(\d+)]$/);d&&d[1]&&i.push({BasketItemAttributeID:d[1],BasketItemAttributeValueID:a(c).val()})}),0!=i.length&&(e.BasketItemAttributesList=i),c.addItem([e])}function e(b,c){var d=a(b),e=d.parent().find("input"),f=parseInt(e.attr("maxlength"))||5,g=parseInt(e.val())+c,h=d.parents("[data-basket-item-id]").length>0;if(h){(g+"").length<=f&&g>=0&&e.val(g);var i=d.data("timeout");i&&window.clearTimeout(i),i=window.setTimeout(function(){e.trigger("change")},1e3),d.data("timeout",i)}else(g+"").length<=f&&g>=1&&e.val(g)}function f(b,d){c.setItemQuantity(b,parseInt(a(d).val())).fail(function(){var e=c.getItem(b);a(d).val(e.BasketItemQuantity)})}return{addBasketItem:d,changeItemQuantity:e,setItemQuantity:f}},["BasketService"])}(jQuery,PlentyFramework),function(a,b){b.directive("MobileDropdown",function(c){function d(){a(window).on("orientationchange sizeChange",function(){e(j),e(k)}),a("html").on("click touchstart",function(a){e(k,a)})}function e(b,c){for(var d,e=0;e0?window.location.assign(a(c).attr("href")):window.location.assign(c))}function e(a){c.goToID(a)}return{to:d,toCheckoutTab:e}},["MediaSizeService","NavigatorService"])}(jQuery,PlentyFramework),function(a,b){b.directive("Tab",function(c){function d(b){a(b).tab("show")}function e(a,b,c){j[c]||(j[c]=new h),j[c].getTab(b)||j[c].addTab(b),j[c].getTab(b).addLabel(a)}function f(a,b,c){j[c]||(j[c]=new h),j[c].getTab(b)||j[c].addTab(b),j[c].getTab(b).setContent(a)}function g(a,d,e){c.isInterval(e)&&(b.getRecentEvent().preventDefault(),j[d]&&j[d].getTab(a)&&j[d].showTab(a))}function h(){function b(a){return g[a]=new i(a),g[a]}function c(b){var c=0;if(f)c=parseInt(f.getContent().parent().css("zIndex")),f.hide(),f.getContent().parent().css("zIndex",c-1);else{for(var d in g)if(g[d].getContent()){var h=parseInt(g[d].getContent().parent().css("zIndex"));(0==c||c>h)&&(c=h),g[d].hide()}for(var d in g)g[d].getContent()&&g[d].getContent().parent().css("zIndex",c-1);a(window).on("sizeChange",e)}f=g[b],f.getContent().parent().css("zIndex",c),f.show()}function d(a){return g[a]}function e(){for(var a in g)g[a].getContent()&&g[a].show();f=null}var f,g={};return{addTab:b,showTab:c,getTab:d,resetTabs:e}}function i(a){function b(){return j}function c(a){return i.push(a),this}function d(a){return h=a,this}function e(){return h}function f(){for(var a=0;a0&&(a(document).scrollTop()>100?u(w,"addClass","visible"):u(w,"removeClass","visible"))})}function f(b){a(b).owlCarousel({navigation:!0,navigationText:!1,slideSpeed:1e3,paginationSpeed:1e3,singleItem:!0,autoPlay:6e3,stopOnHover:!0,afterMove:function(b){a(b).find('img[data-plenty-rel="lazyload"]').trigger("appear")}})}function g(b,d,e){var f=a(b),g=0,h={},i=f.find('[data-plenty-rel="equal-target"]').length>0?f.find('[data-plenty-rel="equal-target"]'):f.children();e!==!0&&v.push(b);for(var j=i.length;j>=0;j--)h=a(i[j]),h.css("height",""),h.outerHeight(!0)>g&&(g=h.outerHeight(!0));(!d||c.isInterval(d))&&i.height(g)}function h(b){var c=a(b);c.click(function(){return a("html, body").animate({scrollTop:0},400),!1}),a.inArray(c,w)&&w.push(c)}function i(b,c){var d=a(b);d.lazyload({effect:c}),d.on("loaded",function(){d.css("display","inline-block")})}function j(b){console.log(b);var c=a(b),d=c.parent();d.addClass("animating"),c.siblings("ul").slideToggle(200,function(){d.is(".open")?d.removeClass("open"):d.addClass("open"),c.siblings("ul").removeAttr("style"),d.removeClass("animating")})}function k(b,c){var d=a(b),e=a(d.attr("data-plenty-rel"));if(d.is('input[type="radio"]')){var f=a('input[type="radio"][name="'+d.attr("name")+'"]'),g=!c||"checked"==c;f.change(function(){var b=a(this);e.parents('[data-plenty-rel="equal-target"]').css("height","auto"),b.is(":checked")&&b[0]===d[0]&&1==g?e.slideDown(400,function(){t()}):e.slideUp(400,function(){t()})})}else d.click(function(){d.addClass("animating"),e.slideToggle(400,function(){d.removeClass("animating"),d.toggleClass("active"),t()})})}function l(b,c){o(a(b),c,"slideDown")}function m(b,c){o(a(b),c,"slideUp")}function n(b,c){o(a(b),c,"slideToggle")}function o(a,b,c){b=b||400,a.parents('[data-plenty-rel="equal-target"]').css("height","auto"),a[c](b,function(){t()})}function p(b,c){var e=a(b),f=e.find('[data-plenty-rel="social-switch"]');e.append(''),f.is("off, on")||f.addClass("off"),f.on("click",function(){f.hasClass("off")&&("tooltip"==e.attr("data-toggle")&&e.tooltip("destroy"),f.removeClass("off").addClass("on"),e.find('[data-plenty-rel="social-placeholder"]').hide(),e.find(".social-container").append(d.getSocialService(c)))})}function q(d,e,f){var g=a(e);if(g.parents(".navbar-main").length>0){var h=g.children("span");return b.directives.MobileDropdown.slideDropdown(h),!0}if(e&&d&&(!f||c.isInterval(f))){var i=b.getRecentEvent();return i&&i.preventDefault(),g.toggleClass(d),!1}}function r(d,e,f){if(e&&d&&(!f||c.isInterval(f))){var g=b.getRecentEvent();return g&&g.preventDefault(),a(e).addClass(d),!1}}function s(d,e,f){if(e&&d&&(!f||c.isInterval(f))){var g=b.getRecentEvent();return g&&g.preventDefault(),a(e).removeClass(d),!1}}function t(){for(var a=v.length-1;a>=0;a--)g(v[a],"",!0)}function u(a,b,c){ +for(var d=a.length-1;d>=0;d--)a[d][b](c)}var v=[],w=[];return{initUIWindowEvents:e,addContentPageSlider:f,equalHeight:g,initToTop:h,initLazyload:i,initSlideToggle:k,slideDown:l,slideUp:m,slideToggle:n,toggleHideShow:j,toggleSocialShare:p,toggleClass:q,addClass:r,removeClass:s}},["MediaSizeService","SocialShareService"])}(jQuery,PlentyFramework),function(a,b){b.directive("Validator",function(a){function b(b,c){return a.validate(b,c)}return{validate:b}},["ValidationService"])}(jQuery,PlentyFramework),PlentyFramework.compile();var plenty=PlentyFramework.getInstance();jQuery(document).ready(function(){plenty.bindDirectives()}); +//# sourceMappingURL=plentymarketsCMStools-1.0.4.min.js.map \ No newline at end of file diff --git a/dist/plentymarketsCMStools-1.0.4.min.js.map b/dist/plentymarketsCMStools-1.0.4.min.js.map new file mode 100644 index 0000000..05cf6c3 --- /dev/null +++ b/dist/plentymarketsCMStools-1.0.4.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"plentymarketsCMStools-1.0.4.min.js","sources":["plentymarketsCMStools-1.0.4.js"],"names":["global","factory","exports","nodeName","define","amd","Mustache","this","mustache","isFunction","object","typeStr","obj","isArray","escapeRegExp","string","replace","hasProperty","propName","testRegExp","re","regExpTest","call","isWhitespace","nonSpaceRe","escapeHtml","String","s","entityMap","parseTemplate","template","tags","stripSpace","hasTag","nonSpace","spaces","length","tokens","pop","compileTags","tagsToCompile","split","spaceRe","Error","openingTagRe","RegExp","closingTagRe","closingCurlyRe","sections","start","type","value","chr","token","openSection","scanner","Scanner","eos","pos","scanUntil","i","valueLength","charAt","push","scan","tagRe","whiteRe","equalsRe","curlyRe","nestTokens","squashTokens","lastToken","squashedTokens","numTokens","section","nestedTokens","collector","tail","Context","view","parentContext","cache",".","parent","Writer","objectToString","Object","prototype","toString","Array","test","&","<",">","\"","'","/","match","index","substring","search","lookup","name","hasOwnProperty","names","context","lookupHit","indexOf","clearCache","parse","render","partials","renderTokens","originalTemplate","symbol","buffer","undefined","renderSection","renderInverted","renderPartial","unescapedValue","escapedValue","rawValue","subRender","self","j","slice","escape","version","defaultWriter","TypeError","to_html","send","result","equals","a","b","constructor","key","TemplateCache","$","bindEventCallback","$elem","eventType","callback","params","on","event","eventStack","apply","addCustomEvents","element","is","trigger","radioGroup","attr","each","radio","$radio","parseDirectives","input","thisValue","directivePattern","expressions","directives","expression","trim","console","error","directive","class","method","param","isNaN","parseFloat","toLowerCase","compileComponent","component","componentLevel","dependencyStack","compiledDependencies","dependencies","dependency","inArray","components","factories","PlentyFramework","services","join","setup","instance","getInstance","globals","setGlobal","identifier","getGlobal","directiveName","directiveFunctions","bindDirectives","rootElement","find","document","getRecentEvent","lastEventIdx","pushEvent","service","serviceName","serviceFunctions","factoryName","factoryFunctions","compileTemplate","data","translate","text","scriptPath","Strings","loadLanguageFile","fileName","get","done","response","localeString","warn","compile","scripts","getElementsByTagName","src","jQuery","cssClasses","active","pm","init","popup","click","hide","html","addError","errorCode","append","show","Modal","modal","remove","timeout","stopTimeout","hover","pauseTimeout","continueTimeout","isModal","filter","getModal","e","root","tooltip","container","WaitScreen","addClass","removeClass","UI","renewLoginSession","sessionExpirationTimeout","clearTimeout","setTimeout","window","prepare","setTitle","setContent","setLabelDismiss","setLabelConfirm","onConfirm","location","assign","onDismiss","handleError","jqXHR","responseText","parseJSON","printErrors","error_stack","throwError","status","statusText","_get","url","ignoreErrors","runInBackground","sync","showWaitScreen","ajax","dataType","async","always","hideWaitScreen","_post","isFile","processData","contentType","JSON","stringify","_put","_delete","_idle","Deferred","resolve","ready","post","put","delete","idle","API","getContainer","containerName","from","layoutGroup","getParams","getCategoryContent","categoryID","CMS","Checkout","checkoutData","getCheckout","copy","checkout","loadCheckout","extend","setCheckout","reloadContainer","elem","reloadCatContent","catId","reloadItemContainer","title","setClass","cssClass","content","label","labelConfirm","labelDismiss","setContainer","bsModal","script","createElement","innerHTML","close","startTimeout","confirmed","timeRemaining","timeStart","Date","getTime","clearInterval","interval","setInterval","paused","secondsRemaining","Math","round","code","msg","message","errorMessages","errorPopup","has","waitScreenCount","waitScreen","forceClose","validateAddress","addressForms","addressIsValid","form","addressDoctor","AddressDoctor","requiredFields","isValid","fields","isPackstation","suggestions","AddressList","$form","getFormValues","refreshView","getAddresses","suggestionListVisible","validateInput","houseNoAllowed","$inputs","HouseNo","val","valueList","getList","$suggestionContainer","buildSuggestionList","off","focus","positionSuggestionList","$parent","suggestionKey","css","width","outerWidth","left","position","top","outerHeight","values","filterAddress","Street","toUpperCase","ZIP","City","addressInput","suggestionType","street","city","houseNo","country","CountryID","responseLength","currentResponse","address","getAddress","addresses","suggestion","addressCount","results","filteredAddresses","parseInt","range","resetPassword","validateForm","Email","IsMailSend","customerLogin","loginMail","Password","loginPassword","setInvoiceAddress","invoiceAddress","CustomerInvoiceAddress","registerCustomer","AddressDoctorService","LoginType","customerInvoiceAddress","CustomerProperty","tmpProperties","CustomerPropertiesList","property","PropertyID","PropertyValue","addBasketItem","article","itemID","BasketItemItemID","quantity","BasketItemQuantity","resp","addArticle","saveOrderParams","articleWithParams","orderParamsForm","$self","attrType","addOrderParamValue","files","orderParamFileUpload","paramValue","refreshBasketPreview","ArticleID","fail","updateArticle","$input","formData","fileData","id","orderParamUploadFiles","orderParamFileIdStack","FormData","basketList","paramId","BasketItemOrderParamsList","BasketItemOrderParamID","BasketItemOrderParamValue","editItemAttributes","BasketItemID","basketItem","getBasketItem","attributesList","attributeSelect","BasketItemAttributeID","BasketItemAttributeValueID","BasketItemAttributesList","editOrderParams","basketItemID","basketItems","BasketItemsList","removeBasketItem","forceDelete","doDelete","deferred","itemName","BasketItemNameMap","item","reject","setItemQuantity","basketItemIndex","toggleClass","itemQuantityTotal","Totals","TotalsItemSum","addCoupon","CouponActiveCouponCode","updateContainer","removeCoupon","Coupon","addItem","removeItem","getItem","setCustomerSignAndInfo","CheckoutCustomerSign","CheckoutOrderInfoText","CustomerSign","OrderInfoText","saveShippingAddress","shippingAddressID","shippingAddress","addressesAreEqual","CustomerShippingAddress","IsPackstation","PackstationNo","IsPostfiliale","PostfilialNo","CheckoutCustomerShippingAddressID","ID","CheckoutShippingCountryID","CheckoutMethodOfPaymentID","CheckoutShippingProfileID","registerGuest","propertyInput","address1","address2","setShippingProfile","ShippingProfileID","preparePayment","CheckoutMethodOfPaymentRedirectURL","CheckoutMethodOfPaymentAdditionalContent","isBankDetails","saveBankDetails","saveCreditCard","setMethodOfPayment","paymentID","MethodOfPaymentID","editBankDetails","removeAttr","customerBankDetails","bankDetails","CustomerBankName","bankName","CustomerBLZ","blz","CustomerAccountNumber","accountNo","CustomerAccountOwner","accountOwner","CustomerIBAN","iban","CustomerBIC","bic","editCreditCard","paymentInformationCC","creditCard","Owner","owner","Cvv2","cvv2","Number","number","Year","year","Month","month","Provider","provider","loadAddressSuggestion","postnummer","Postnummer","placeOrder","TermsAndConditionsCheck","termsAndConditionsCheck","WithdrawalCheck","withdrawalCheck","PrivacyPolicyCheck","privacyPolicyCheck","AgeRestrictionCheck","ageRestrictionCheck","NewsletterCheck","newsletterCheck","KlarnaTermsAndConditionsCheck","klarnaTermsAndConditionsCheck","PayoneDirectDebitMandateCheck","payoneDirectDebitMandateCheck","PayoneInvoiceCheck","payoneInvoiceCheck","MethodOfPaymentRedirectURL","MethodOfPaymentAdditionalContent","getFeedbacks","setFeedbackInterval","end","feedbackInterval","dateStart","dateEnd","listFeedbacks","articleType","referenceId","feedbackType","ReferenceId","FromDate","ToDate","FeedbackType","feedbackTypes","COMMENTS_AND_RATINGS","between","for","addFeedback","withRating","rating","Rating","withComment","comment","Text","withAuthor","author","mail","customerID","Author","CustomerId","sendFeedback","to","COMMENTS_ONLY","RATINGS_ONLY","articleTypes","ITEM","CATEGORY","BLOG","ArticleTypes","FeedbackTypes","getInterval","bsInterval","calculateMediaSize","size","matchMedia","matches","oldValue","isInterval","intervalList","resize","navigation","buttonNext","buttonPrev","goTo","next","previous","addEventListener","hash","goToID","urlParam","exec","href","current","fillNavigation","MediaSizeService","getCurrentContainer","beforeChange","interceptor","interceptors","NavigatorService","afterChange","resolveInterceptors","continueTabChange","currentContainer","targetContainer","ignoreInterceptors","contentChanged","checkoutStates","proceedTabChange","continueChange","containerID","navigationCount","children","buttonWidth","padding","tabWidth","paddingLeft","paddingRight","paddingEachItem","paddingLastLeft","paddingLastRight","paddingLastItem","UIFactory","openPostfinderModal","shippingFields","PostfinderItemStreet","PostfinderItemZIP","PostfinderItemCity","PostfinderItemHouseNo","zip","numberOfResults","showErrorMessage","dimension","distInMeters","PostfinderItemDistance","distInKilometers","toFixed","PostfinderItemIsPackstation","PostfinderItemPackstationNo","PostfinderItemPostfilialNo","district","PostfinderItemDistrict","distance","remark","PostfinderItemRemark","packstationID","inputId","closest","getService","facebook-like","socialLangLocale","encodeURIComponent","getURI","facebook-recommend","twitter","getTweetText","google-plus","socialLang","uri","canonical","protocol","host","getMeta","metaContent","creator","getSocialService","getFormControl","validateText","formControl","prop","validateMail","mailRegExp","validateNumber","isNumeric","validateValue","reference","visibility","isEnabled","validate","errorClass","formControls","validationKey","currentHasError","group","checked","checkedMin","checkedMax","attrValidate","validationKeys","formControlAttrType","missingFields","hasError","eval","minMax","min","max","distanceTop","$error","first","errorOffset","offset","$scrollTarget","parents","scrollTop","pageYOffset","innerHeight","animate","$errorElement","fn","ValidationService","inject","child","exp","groupValues","checkbox","AuthenticationService","login","preventDefault","BasketService","basketItemsList","parentForm","BasketItemPriceID","BasketItemBranchID","attributeInputsList","idx","changeItemQuantity","increment","$quantityInput","maxLength","isBasketView","MediaSize","initDropdowns","resetDropdowns","dropdownElements","closableDropdownElements","dropdownList","$current","target","openDropdown","alwaysClickable","Modernizr","touch","showDropdownHideOthers","avoidRedirectinStopPropagation","not","stopPropagation","slideDropdown","$elemParent","siblings","slideToggle","toCheckoutTab","tabID","showTab","tabSelector","tab","initRemoteLabel","groupID","tabGroups","TabGroup","getTab","addTab","addLabel","initRemoteTab","showRemoteTab","tabs","Tab","zIndex","activeTab","getContent","currentZ","resetTabs","getID","$labels","$content","SocialShareService","initUIWindowEvents","fireEqualHeight","toTopButtonList","doToArrayElements","addContentPageSlider","owlCarousel","navigationText","slideSpeed","paginationSpeed","singleItem","autoPlay","stopOnHover","afterMove","equalHeight","mediaSizes","elementExists","maxHeight","$equalTarget","$equalTargetList","equalHeightElementList","height","initToTop","initLazyload","effect","lazyload","toggleHideShow","log","initSlideToggle","$targetElement","$radioGroupList","visibleOnChecked","change","slideDown","slideUp","duration","slideAction","$target","callbackString","toggleSocialShare","socialShareService","$toggle","hasClass","array","func","plenty"],"mappings":";;;;;;;;CAAA,SAAyBA,EAAOC,GAA6B,gBAAVC,UAAoBA,SAAmC,gBAAnBA,SAAQC,SAAqBF,EAAQC,SAAiC,kBAATE,SAAqBA,OAAOC,IAAKD,QAAQ,WAAWH,IAAcD,EAAOM,YAAYL,EAAQK,YAAaC,KAAK,SAAyBC,GAA0K,QAASC,GAAWC,GAAQ,MAAuB,kBAATA,GAAoB,QAASC,GAAQC,GAAK,MAAOC,GAAQD,GAAK,cAAeA,GAAI,QAASE,GAAaC,GAAQ,MAAOA,GAAOC,QAAQ,8BAA8B,QAAQ,QAASC,GAAYL,EAAIM,GAAU,MAAY,OAALN,GAAwB,gBAANA,IAAgBM,IAAYN,GAAyC,QAASO,GAAWC,EAAGL,GAAQ,MAAOM,GAAWC,KAAKF,EAAGL,GAA4B,QAASQ,GAAaR,GAAQ,OAAOI,EAAWK,EAAWT,GAAgG,QAASU,GAAWV,GAAQ,MAAOW,QAAOX,GAAQC,QAAQ,aAAa,SAAuBW,GAAG,MAAOC,GAAUD,KAAgH,QAASE,GAAcC,EAASC,GAA4G,QAASC,KAAa,GAAGC,IAASC,EAAU,KAAMC,EAAOC,cAAcC,GAAOF,EAAOG,WAAYH,KAAUF,IAAO,EAAMC,GAAS,EAAmD,QAASK,GAAYC,GAA+F,GAAtD,gBAAhBA,KAAyBA,EAAcA,EAAcC,MAAMC,EAAQ,KAAO7B,EAAQ2B,IAAuC,IAAvBA,EAAcJ,OAAW,KAAM,IAAIO,OAAM,iBAAiBH,EAAeI,GAAa,GAAIC,QAAO/B,EAAa0B,EAAc,IAAI,QAAQM,EAAa,GAAID,QAAO,OAAO/B,EAAa0B,EAAc,KAAKO,EAAe,GAAIF,QAAO,OAAO/B,EAAa,IAAI0B,EAAc,KAAjrB,IA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OAAS,EAAGwB,GAAK,EAAGA,IAErDmyB,EAAaM,EAAuBzyB,GAAI,IAAI,GAIpD,QAASyxB,GAAmBuC,EAAOC,EAAM5uB;AAErC,IAAM,GAAIrF,GAAIg0B,EAAMx1B,OAAS,EAAGwB,GAAK,EAAGA,IAEpCg0B,EAAMh0B,GAAGi0B,GAAO5uB,GA3bxB,GAAIotB,MACAjB,IAEJ,QACIF,mBAAsBA,EACtBI,qBAAsBA,EACtBS,YAAsBA,EACtBQ,UAAsBA,EACtBC,aAAsBA,EACtBK,gBAAsBA,EACtBK,UAAsBA,EACtBC,QAAsBA,EACtB3D,YAAsBA,EACtBmD,eAAsBA,EACtBa,kBAAsBA,EACtB/X,YAAsBA,EACtBzP,SAAsBA,EACtBC,YAAsBA,KA8a1B,mBAAoB,wBACzB9B,OAAQzC,iBACV,SAAU9C,EAAG0F,GAEVA,EAAG7D,UAAW,YAAa,SAAUumB,GAOjC,QAAS/B,GAAUhY,EAAMiY,GAErB,MAAO8B,GAAkB/B,SAAUhY,EAAMiY,GAN7C,OACID,SAAUA,KAQd,uBACL9gB,OAAQzC,iBAUXA,gBAAgBqC,SAGhB,IAAI+pB,QAASpsB,gBAAgBK,aAQ7BoC,QAAQ1B,UAAWuG,MAAO,WAEtB8kB,OAAOxrB"} \ No newline at end of file diff --git a/lang/de_DE.json b/lang/de_DE.json index 98a1169..686dee2 100644 --- a/lang/de_DE.json +++ b/lang/de_DE.json @@ -1,4 +1,5 @@ { + "OK": "OK", "Close": "Schließen", "Cancel": "Abbrechen", "Confirm": "Bestätigen", @@ -9,5 +10,7 @@ "Select order parameters": "Bestellmerkmale wählen", "Edit order parameters": "Bestellmerkmale ändern", "Packstations and post offices in your area": "Packstationen und Postfilialen in der Nähe", - "Please enter a ZIP code and/or a city.": "Bitte geben Sie eine Postleitzahl und/oder einen Ort an." + "Please enter a ZIP code and/or a city.": "Bitte geben Sie eine Postleitzahl und/oder einen Ort an.", + "Your session has expired.": "Sie sind nicht mehr angemeldet.", + "Please log in again to continue shopping.": "Bitte melden Sie sich erneut an, um weiter einzukaufen." } \ No newline at end of file diff --git a/lang/en_EN.json b/lang/en_EN.json index d67956c..bdba365 100644 --- a/lang/en_EN.json +++ b/lang/en_EN.json @@ -1,4 +1,5 @@ { + "OK": "OK", "Close": "Close", "Cancel": "Cancel", "Confirm": "Confirm", @@ -9,5 +10,7 @@ "Select order parameters": "Select order parameters", "Edit order parameters": "Edit order parameters", "Packstations and post offices in your area": "Packstations and post offices in your area", - "Please enter a ZIP code and/or a city.": "Please enter a ZIP code and/or a city." + "Please enter a ZIP code and/or a city.": "Please enter a ZIP code and/or a city.", + "Your session has expired.": "Your session has expired.", + "Please log in again to continue shopping.": "Please log in again to continue shopping." } \ No newline at end of file diff --git a/package.json b/package.json index e6d1849..395aaf7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "plentymarketsCMStools", "license": "AGPL-3.0", - "version": "1.0.3", + "version": "1.0.4", "repository": "https://github.com/plentymarkets/plenty-cms-library.git", "devDependencies": { "grunt": "^0.4.5", diff --git a/src/directives/Basket.js b/src/directives/Basket.js index cf6f909..940a20e 100644 --- a/src/directives/Basket.js +++ b/src/directives/Basket.js @@ -50,10 +50,10 @@ function changeItemQuantity( elem, increment ) { - var $elem = $( elem ); + var $elem = $( elem ); var $quantityInput = $elem.parent().find( 'input' ); - var maxLength = parseInt( $quantityInput.attr( 'maxlength' ) ) || 5; - var value = parseInt( $quantityInput.val() ) + increment; + var maxLength = parseInt( $quantityInput.attr( 'maxlength' ) ) || 5; + var value = parseInt( $quantityInput.val() ) + increment; var isBasketView = $elem.parents( '[data-basket-item-id]' ).length > 0; @@ -78,7 +78,8 @@ $elem.data( 'timeout', timeout ); } - else { + else + { if ( (value + '').length <= maxLength && value >= 1 ) { $quantityInput.val( value ); diff --git a/src/directives/Redirect.js b/src/directives/Redirect.js index 3cf521d..17fcb33 100644 --- a/src/directives/Redirect.js +++ b/src/directives/Redirect.js @@ -12,7 +12,7 @@ { if ( MediaSizeService.interval() != 'xs' ) { - if ( $( href ).length > 0 ) + if ( typeof href === 'string' && href.indexOf('/') == -1 && $( href ).length > 0 ) { window.location.assign( $( href ).attr( 'href' ) ); } diff --git a/src/directives/Tab.js b/src/directives/Tab.js index 2114f91..e04a782 100644 --- a/src/directives/Tab.js +++ b/src/directives/Tab.js @@ -49,7 +49,7 @@ function showRemoteTab( tabID, groupID, interval ) { - if( MediaSize.isInterval( interval ) ) + if ( MediaSize.isInterval( interval ) ) { pm.getRecentEvent().preventDefault(); @@ -67,9 +67,9 @@ var activeTab; return { - addTab : addTab, - showTab: showTab, - getTab : getTab, + addTab : addTab, + showTab : showTab, + getTab : getTab, resetTabs: resetTabs }; @@ -94,7 +94,7 @@ // activeTab not set before for ( var tab in tabs ) { - if( !!tabs[tab].getContent() ) + if ( !!tabs[tab].getContent() ) { var currentZ = parseInt( tabs[tab].getContent().parent().css( 'zIndex' ) ); if ( zIndex == 0 || currentZ < zIndex ) @@ -107,13 +107,13 @@ for ( var tab in tabs ) { - if( !!tabs[tab].getContent() ) + if ( !!tabs[tab].getContent() ) { tabs[tab].getContent().parent().css( 'zIndex', zIndex - 1 ); } } - $(window ).on('sizeChange', resetTabs); + $( window ).on( 'sizeChange', resetTabs ); } activeTab = tabs[tabID]; @@ -130,7 +130,7 @@ { for ( var tab in tabs ) { - if( !!tabs[tab].getContent() ) + if ( !!tabs[tab].getContent() ) { tabs[tab].show(); } @@ -142,9 +142,9 @@ function Tab( id ) { - var $labels = []; var $content; - var tabID = id; + var $labels = []; + var tabID = id; return { addLabel : addLabel, diff --git a/src/directives/UI.js b/src/directives/UI.js index c91a194..8918364 100644 --- a/src/directives/UI.js +++ b/src/directives/UI.js @@ -268,20 +268,21 @@ function slideDown( target, duration ) { - slideAction($( target ), duration, 'slideDown'); + slideAction( $( target ), duration, 'slideDown' ); } function slideUp( target, duration ) { - slideAction($( target ), duration, 'slideUp'); + slideAction( $( target ), duration, 'slideUp' ); } function slideToggle( target, duration ) { - slideAction($( target ), duration, 'slideToggle'); + slideAction( $( target ), duration, 'slideToggle' ); } - function slideAction ($target, duration, callbackString) { + function slideAction( $target, duration, callbackString ) + { duration = duration || 400; $target.parents( '[data-plenty-rel="equal-target"]' ).css( 'height', 'auto' ); $target[callbackString]( duration, function() diff --git a/src/factories/APIFactory.js b/src/factories/APIFactory.js index 56946ad..c3fb474 100644 --- a/src/factories/APIFactory.js +++ b/src/factories/APIFactory.js @@ -23,9 +23,15 @@ * @class APIFactory * @static */ - pm.factory( 'APIFactory', function( UI ) + pm.factory( 'APIFactory', function( UI, Modal ) { + var sessionExpirationTimeout = null; + $( document ).ready( function() + { + renewLoginSession(); + } ); + return { get : _get, post : _post, @@ -34,6 +40,43 @@ idle : _idle }; + function renewLoginSession() + { + if ( !pm.getGlobal( 'LoginSession' ) ) + { + return; + } + + if ( !!sessionExpirationTimeout ) + { + clearTimeout( sessionExpirationTimeout ); + } + + sessionExpirationTimeout = setTimeout( function() + { + $( window ).trigger( 'login-expired' ); + + if ( pm.getGlobal( 'PageDesign' ) === "Checkout" ) + { + Modal.prepare() + .setTitle( pm.translate( 'Your session has expired.' ) ) + .setContent( pm.translate( 'Please log in again to continue shopping.' ) ) + .setLabelDismiss( null ) + .setLabelConfirm( pm.translate( 'OK' ) ) + .onConfirm( function() + { + window.location.assign( '/' ); + } ) + .onDismiss( function() + { + window.location.assign( '/' ); + } ) + .show(); + } + + }, pm.getGlobal( 'LoginSessionExpiration' ) ); + } + /** * Is called by default if a request failed.
* Can be prevented by setting the requests last parameter to false. @@ -82,7 +125,7 @@ url, { type : 'GET', - data: params, + data : params, dataType: 'json', async : !sync, error : function( jqXHR ) @@ -99,6 +142,7 @@ { UI.hideWaitScreen(); } + renewLoginSession(); } ); } @@ -157,6 +201,7 @@ { UI.hideWaitScreen(); } + renewLoginSession(); } ); } @@ -185,8 +230,8 @@ url, { type : 'PUT', - data: JSON.stringify( data ), - dataType: 'json', + data : JSON.stringify( data ), + dataType : 'json', contentType: 'application/json', error : function( jqXHR ) { @@ -202,6 +247,7 @@ { UI.hideWaitScreen(); } + renewLoginSession(); } ); } @@ -231,8 +277,8 @@ url, { type : 'DELETE', - data: JSON.stringify( data ), - dataType: 'json', + data : JSON.stringify( data ), + dataType : 'json', contentType: 'application/json', error : function( jqXHR ) { @@ -248,6 +294,7 @@ { UI.hideWaitScreen(); } + renewLoginSession(); } ); } @@ -262,5 +309,5 @@ return $.Deferred().resolve(); } - }, ['UIFactory'] ); + }, ['UIFactory', 'ModalFactory'] ); }( jQuery, PlentyFramework )); \ No newline at end of file diff --git a/src/factories/CMSFactory.js b/src/factories/CMSFactory.js index 66703f4..ddd7769 100644 --- a/src/factories/CMSFactory.js +++ b/src/factories/CMSFactory.js @@ -98,7 +98,6 @@ */ function getCategoryContent( categoryID ) { - return API.get( '/rest/categoryview/categorycontentbody/?categoryID=' + categoryID ); } diff --git a/src/factories/ModalFactory.js b/src/factories/ModalFactory.js index a454187..bff03b6 100644 --- a/src/factories/ModalFactory.js +++ b/src/factories/ModalFactory.js @@ -306,7 +306,7 @@ { var close = modal.onConfirm(); - if( typeof close == "undefined" ) + if ( typeof close == "undefined" ) { close = true; } diff --git a/src/plentyFramework.js b/src/plentyFramework.js index a3acd7d..bfe0978 100644 --- a/src/plentyFramework.js +++ b/src/plentyFramework.js @@ -205,18 +205,18 @@ PlentyFramework.getRecentEvent = function( eventType ) { var lastEventIdx = eventStack.length - 1; - if( !eventType ) + if ( !eventType ) { - return eventStack[ lastEventIdx ]; + return eventStack[lastEventIdx]; } else { - for( var i = lastEventIdx; i >= 0; i-- ) + for ( var i = lastEventIdx; i >= 0; i-- ) { - if( eventType == eventStack[i].type ) - { - return eventStack[i]; - } + if ( eventType == eventStack[i].type ) + { + return eventStack[i]; + } } } @@ -229,7 +229,6 @@ eventStack.push( event ); }; - /** * Bind event to element by eventType. * If cms says "click:Foo.bar(this, event)" eventType is "click". @@ -253,41 +252,44 @@ var $elem = $( element ); - if( $elem.is('input[type="checkbox"]') ) + if ( $elem.is( 'input[type="checkbox"]' ) ) { - $elem.on('change', function() { + $elem.on( 'change', function() + { - if( $elem.is(':checked') ) + if ( $elem.is( ':checked' ) ) { - $elem.trigger('check'); + $elem.trigger( 'check' ); } else { - $elem.trigger('uncheck'); + $elem.trigger( 'uncheck' ); } - }); + } ); } - if( $elem.is('input[type="radio"]') ) + if ( $elem.is( 'input[type="radio"]' ) ) { - $elem.on('change', function() { + $elem.on( 'change', function() + { - var radioGroup = $elem.attr('name'); + var radioGroup = $elem.attr( 'name' ); - $( 'input[type="radio"][name="' + radioGroup + '"]' ).each(function( i, radio ) { + $( 'input[type="radio"][name="' + radioGroup + '"]' ).each( function( i, radio ) + { var $radio = $( radio ); - if( $radio.is(':checked') ) + if ( $radio.is( ':checked' ) ) { - $radio.trigger('check'); + $radio.trigger( 'check' ); } else { - $radio.trigger('uncheck'); + $radio.trigger( 'uncheck' ); } - }); + } ); - }); + } ); } } @@ -581,7 +583,7 @@ // resolve dependencies var compiledDependencies = []; - for( var i = 0; i < component.dependencies.length; i++ ) + for ( var i = 0; i < component.dependencies.length; i++ ) { var dependency = component.dependencies[i]; if ( $.inArray( dependency, dependencyStack ) < 0 ) @@ -634,15 +636,15 @@ } // compile component - if( componentLevel == 3 ) + if ( componentLevel == 3 ) { PlentyFramework.factories[component.name] = component.setup.apply( null, compiledDependencies ); } - else if( componentLevel == 2 ) + else if ( componentLevel == 2 ) { PlentyFramework.prototype[component.name] = component.setup.apply( null, compiledDependencies ); } - else if( componentLevel == 1 ) + else if ( componentLevel == 1 ) { PlentyFramework.directives[component.name] = component.setup.apply( null, compiledDependencies ); } diff --git a/src/services/AddressDoctorService.js b/src/services/AddressDoctorService.js index 83b5d86..73cb060 100644 --- a/src/services/AddressDoctorService.js +++ b/src/services/AddressDoctorService.js @@ -18,8 +18,8 @@ function validateAddress( addressForms ) { var addressIsValid = true; - addressForms = addressForms || '[data-plenty-address-doctor]'; - $( addressForms ).filter('[data-plenty-address-doctor]:visible').each( function( i, form ) + addressForms = addressForms || '[data-plenty-address-doctor]'; + $( addressForms ).filter( '[data-plenty-address-doctor]:visible' ).each( function( i, form ) { var addressDoctor = new AddressDoctor( form ); var requiredFields = $( form ).attr( 'data-plenty-address-doctor' ).replace( /\s/g, '' ).split( ',' ); @@ -81,7 +81,7 @@ } } - if ( suggestions.houseNoAllowed( $inputs.HouseNo.val() ) ) + if ( suggestions.houseNoAllowed( $inputs.HouseNo.val() ) || suggestions.getAddresses().length == 1 ) { $inputs.HouseNo.removeClass( 'has-error' ); $form.find( 'label[for="' + $inputs.HouseNo.attr( 'id' ) + '"]' ).removeClass( 'has-error' ); @@ -132,7 +132,10 @@ $inputs[key].addClass( 'has-error' ); $form.find( 'label[for="' + $inputs[key].attr( 'id' ) + '"]' ).addClass( 'has-error' ); - if( !suggestionListVisible ) buildSuggestionList( $inputs[key], valueList ); + if ( !suggestionListVisible ) + { + buildSuggestionList( $inputs[key], valueList ); + } $inputs[key].off( 'focus' ); $inputs[key].focus(); return false; @@ -140,16 +143,27 @@ } } + function positionSuggestionList( $parent, suggestionKey ) + { + $suggestionContainer[suggestionKey].css( { + 'width': $parent.outerWidth( true ), + 'left' : $parent.position().left, + 'top' : $parent.position().top + $parent.outerHeight( true ) + } ); + } + function buildSuggestionList( $parent, values ) { var suggestionKey = $parent.attr( 'name' ); // render html content $suggestionContainer[suggestionKey] = $( pm.compileTemplate( 'addressSuggestions/addressDoctor.html', {values: values} ) ); - $suggestionContainer[suggestionKey].css( { - 'width': $parent.outerWidth( true ), - 'left' : $parent.position().left, - 'top' : $parent.position().top + $parent.outerHeight( true ) + + positionSuggestionList( $parent, suggestionKey ); + + $( window ).on( 'sizeChange', function() + { + positionSuggestionList( $parent, suggestionKey ); } ); // bind click event to list elements diff --git a/src/services/AuthenticationService.js b/src/services/AuthenticationService.js index 37e8f61..b0d9dad 100644 --- a/src/services/AuthenticationService.js +++ b/src/services/AuthenticationService.js @@ -88,7 +88,6 @@ Password: values.loginPassword }; - UI.showWaitScreen(); return API.post( "/rest/checkout/login/", params ) .done( function() @@ -133,47 +132,29 @@ if ( form.validateForm() && pm.getInstance().AddressDoctorService.validateAddress() ) { - var values = form.getFormValues(); - - // create new invoice address - var invoiceAddress = { - LoginType : 2, - FormOfAddressID : values.FormOfAddressID, - Company : values.Company, - FirstName : values.FirstName, - LastName : values.LastName, - Street : values.Street, - HouseNo : values.HouseNo, - AddressAdditional: values.AddressAdditional, - ZIP : values.ZIP, - City : values.City, - CountryID : values.CountryID, - VATNumber : values.VATNumber, - Email : values.Email, - EmailRepeat : values.EmailRepeat, - BirthDay : values.BirthDay, - BirthMonth : values.BirthMonth, - BirthYear : values.BirthYear, - Password : values.Password, - PasswordRepeat : values.PasswordRepeat, - PhoneNumber : values.PhoneNumber, - MobileNumber : values.MobileNumber, - FaxNumber : values.FaxNumber, - Postnummer : values.Postnummer - }; - - invoiceAddress.CustomerPropertiesList = invoiceAddress.CustomerPropertiesList || []; + var values = form.getFormValues(); + values.LoginType = 2; - form.find( "[data-plenty-property-id]" ).each( function( i, propertyInput ) + if ( values.checkout + && values.checkout.customerInvoiceAddress + && values.checkout.customerInvoiceAddress.CustomerProperty ) { + var tmpProperties = values.checkout.customerInvoiceAddress.CustomerProperty; + values.CustomerPropertiesList = values.CustomerPropertiesList || []; - invoiceAddress.CustomerPropertiesList.push( { - PropertyID : $( propertyInput ).attr( 'data-plenty-property-id' ), - PropertyValue: $( propertyInput ).val() - } ); - } ); + for ( var property in tmpProperties ) + { + if ( tmpProperties[property] ) + { + values.CustomerPropertiesList.push( { + PropertyID : property, + PropertyValue: tmpProperties[property] + } ); + } + } + } - return setInvoiceAddress( invoiceAddress ) + return setInvoiceAddress( values ) .done( function() { window.location.assign( form.attr( 'action' ) ); diff --git a/src/services/BasketService.js b/src/services/BasketService.js index e3665ed..2bcb904 100644 --- a/src/services/BasketService.js +++ b/src/services/BasketService.js @@ -70,7 +70,7 @@ .onConfirm( function() { // validate form - if ( $('[data-plenty-checkout-form="OrderParamsForm"]').validateForm() ) + if ( $( '[data-plenty-checkout-form="OrderParamsForm"]' ).validateForm() ) { // save order params addArticle( saveOrderParams( article ) ); @@ -126,20 +126,20 @@ (attrType != 'radio' && attrType != 'checkbox')) && attrType != 'file' && attrType != 'hidden' ) { - var match = $self[0].name.match( /^ParamValue\[(\d+)]\[(\d+)]$/ ); + var match = $self[0].name.match( /^ParamValue\[(\d+)]\[(\d+)]$/ ); articleWithParams = addOrderParamValue( articleWithParams, match[1], match[2], $self.val() ); } else if ( attrType == 'file' ) { - if( $self[0].files && $self[0].files.length > 0 ) + if ( $self[0].files && $self[0].files.length > 0 ) { articleWithParams = orderParamFileUpload( $self, articleWithParams ); } else { - var match = $self[0].name.match( /^ParamValueFile\[(\d+)]\[(\d+)]$/ ); - var paramValue = $( 'input[type="hidden"][name="ParamValue[' + match[1] + '][' + match[2] + ']"]' ).val(); + var match = $self[0].name.match( /^ParamValueFile\[(\d+)]\[(\d+)]$/ ); + var paramValue = $( 'input[type="hidden"][name="ParamValue[' + match[1] + '][' + match[2] + ']"]' ).val(); articleWithParams = addOrderParamValue( articleWithParams, match[1], match[2], paramValue ); } } @@ -270,7 +270,7 @@ function editItemAttributes( BasketItemID ) { - var modal = $( '[data-plenty-basket-item="' + BasketItemID + '"' ); + var modal = $( '[data-plenty-basket-item="' + BasketItemID + '"]' ); modal.modal( 'show' ); modal.find( '[data-plenty-modal="confirm"]' ).on( 'click', function() { @@ -323,7 +323,7 @@ .onConfirm( function() { // validate form - if ( $('[data-plenty-checkout-form="OrderParamsForm"]').validateForm() ) + if ( $( '[data-plenty-checkout-form="OrderParamsForm"]' ).validateForm() ) { // save order params updateArticle( saveOrderParams( [basketItem] ) ); diff --git a/src/services/CheckoutService.js b/src/services/CheckoutService.js index 5d0df6b..9740322 100644 --- a/src/services/CheckoutService.js +++ b/src/services/CheckoutService.js @@ -148,8 +148,8 @@ Checkout.setCheckout().done( function() { - Checkout.reloadContainer("MethodsOfPaymentList"); - Checkout.reloadContainer("ShippingProfilesList"); + Checkout.reloadContainer( "MethodsOfPaymentList" ); + Checkout.reloadContainer( "ShippingProfilesList" ); if ( Checkout.getCheckout().CustomerInvoiceAddress.LoginType == 2 ) { Checkout.reloadContainer( 'CustomerShippingAddress' ); @@ -175,8 +175,8 @@ return Checkout.setCheckout().done( function() { - Checkout.reloadContainer("MethodsOfPaymentList"); - Checkout.reloadContainer("ShippingProfilesList"); + Checkout.reloadContainer( "MethodsOfPaymentList" ); + Checkout.reloadContainer( "ShippingProfilesList" ); if ( Checkout.getCheckout().CustomerInvoiceAddress.LoginType == 2 ) { Checkout.reloadContainer( 'CustomerShippingAddress' ); diff --git a/src/services/FeedbackService.js b/src/services/FeedbackService.js index 3054f0e..ee76596 100644 --- a/src/services/FeedbackService.js +++ b/src/services/FeedbackService.js @@ -10,14 +10,16 @@ /** * @module Services */ -(function($, pm) { +(function( $, pm ) +{ - pm.service('FeedbackService', function( API ) { + pm.service( 'FeedbackService', function( API ) + { return { - getFeedbacks: getFeedbacks, - addFeedback: addFeedback, - ArticleTypes: articleTypes(), + getFeedbacks : getFeedbacks, + addFeedback : addFeedback, + ArticleTypes : articleTypes(), FeedbackTypes: feedbackTypes() }; @@ -26,32 +28,35 @@ .getFeedbacks().between('2014-12-03', '2015-07-01') .for( FeedbackService.ArticleTypes.ITEM, 2732, FeedbackService.FeedbackTypes.COMMENTS_ONLY ); */ - function getFeedbacks() { + function getFeedbacks() + { var feedbackInterval = { dateStart: null, - dateEnd: null + dateEnd : null }; return { between: setFeedbackInterval, - for: listFeedbacks + for : listFeedbacks }; - function setFeedbackInterval( start, end ) { + function setFeedbackInterval( start, end ) + { feedbackInterval.dateStart = start; - feedbackInterval.dateEnd = end; + feedbackInterval.dateEnd = end; return this; } - function listFeedbacks( articleType, referenceId, feedbackType ) { + function listFeedbacks( articleType, referenceId, feedbackType ) + { var params = { - ReferenceId: referenceId, - FromDate: feedbackInterval.dateStart, - ToDate: feedbackInterval.dateEnd, + ReferenceId : referenceId, + FromDate : feedbackInterval.dateStart, + ToDate : feedbackInterval.dateEnd, FeedbackType: feedbackType || feedbackTypes().COMMENTS_AND_RATINGS }; - return API.get( '/rest/feedback/'+articleType+'/', params ); + return API.get( '/rest/feedback/' + articleType + '/', params ); } } @@ -64,64 +69,75 @@ .withAuthor( 'Felix', 'felix.dausch@plentymarkets.com', 123456 ) .to( FeedbackService.ArticleTypes.ITEM, 2732 ); */ - function addFeedback() { + function addFeedback() + { var params = { - Rating: 1.0, - Text: '', - Author: '', - Email: '', + Rating : 1.0, + Text : '', + Author : '', + Email : '', CustomerId: 0 }; return { - withRating: withRating, + withRating : withRating, withComment: withComment, - withAuthor: withAuthor, - to: sendFeedback + withAuthor : withAuthor, + to : sendFeedback }; - function withRating( rating ) { + function withRating( rating ) + { params.Rating = rating; return this; } - function withComment( comment ) { + function withComment( comment ) + { params.Text = comment; return this; } - function withAuthor( author, mail, customerID ) { + function withAuthor( author, mail, customerID ) + { params.Author = author; - if( !!mail ) params.Email = mail; - if( !!customerID ) params.CustomerId = customerID; + if ( !!mail ) + { + params.Email = mail; + } + if ( !!customerID ) + { + params.CustomerId = customerID; + } return this; } - function sendFeedback( articleType, referenceId ) { - return API.post( '/rest/feedback/'+articleType+'/', params ); + function sendFeedback( articleType, referenceId ) + { + return API.post( '/rest/feedback/' + articleType + '/', params ); } } - function feedbackTypes() { + function feedbackTypes() + { return { - COMMENTS_ONLY: 'comments_only', - RATINGS_ONLY: 'ratings_only', - COMMENTS_AND_RATINGS: 'comments_with_ratings' + COMMENTS_ONLY : 'comments_only', + RATINGS_ONLY : 'ratings_only', + COMMENTS_AND_RATINGS: 'comments_with_ratings' } } - function articleTypes() { + function articleTypes() + { return { - ITEM: 'item', - CATEGORY: 'category', - BLOG: 'blog' + ITEM : 'item', + CATEGORY: 'category', + BLOG : 'blog' } } - - - }, ['APIFactory']); -}(jQuery, PlentyFramework)); \ No newline at end of file + }, ['APIFactory'] ); +}( jQuery, PlentyFramework )); \ No newline at end of file diff --git a/src/services/MediaSizeService.js b/src/services/MediaSizeService.js index 0802d61..edb4ed7 100644 --- a/src/services/MediaSizeService.js +++ b/src/services/MediaSizeService.js @@ -99,7 +99,7 @@ size = 'xs'; } } - if ( size != bsInterval ) + if ( size != bsInterval || size === 'xs' ) { var oldValue = bsInterval; bsInterval = size; diff --git a/src/services/NavigatorService.js b/src/services/NavigatorService.js index 2cb4514..d55d6bc 100644 --- a/src/services/NavigatorService.js +++ b/src/services/NavigatorService.js @@ -306,30 +306,32 @@ $( container ).hide(); // refresh navigation elements + var $elem; $( navigation ).each( function( i, elem ) { - $( elem ).removeClass( 'disabled active' ); + $elem = $( elem ); + $elem.removeClass( 'disabled active' ); - $( elem ).find( '[role="tab"]' ).attr( 'aria-selected', 'false' ); + $elem.find( '[role="tab"]' ).attr( 'aria-selected', 'false' ); if ( i < current ) { // set current element as active - $( elem ).addClass( 'visited' ); + $elem.addClass( 'visited' ); } else { if ( i == current ) { - $( elem ).addClass( 'active visited' ); - $( elem ).find( '[role="tab"]' ).attr( 'aria-selected', 'true' ); + $elem.addClass( 'active visited' ); + $elem.find( '[role="tab"]' ).attr( 'aria-selected', 'true' ); } else { - if ( i > current && !$( elem ).is( '.visited' ) ) + if ( i > current && !$elem.is( '.visited' ) ) { // disable elements behind active - $( elem ).addClass( 'disabled' ); + $elem.addClass( 'disabled' ); } } } @@ -339,21 +341,21 @@ // hide "previous"-button if first content container is shown if ( current <= 0 ) { - $( buttonPrev ).attr( "disabled", "disabled" ); + buttonPrev.attr( "disabled", "disabled" ); } else { - $( buttonPrev ).removeAttr( "disabled" ); + buttonPrev.removeAttr( "disabled" ); } // hide "next"-button if last content container is shown if ( current + 1 == navigation.length ) { - $( buttonNext ).attr( "disabled", "disabled" ); + buttonNext.attr( "disabled", "disabled" ); } else { - $( buttonNext ).removeAttr( "disabled" ); + buttonNext.removeAttr( "disabled" ); } // show current content container diff --git a/src/services/PostfinderService.js b/src/services/PostfinderService.js index ad3b671..7d71099 100644 --- a/src/services/PostfinderService.js +++ b/src/services/PostfinderService.js @@ -150,17 +150,19 @@ shippingFields.PostfinderItemZIP.removeClass( 'has-success' ).addClass( 'has-error' ); $( 'label[for="' + shippingFields.PostfinderItemZIP.attr( 'id' ) + '"]' ).removeClass( 'has-success' ).addClass( 'has-error' ); - shippingFields.PostfinderItemCity.focus(function() { - $(this).removeClass('has-error'); - var inputId = $(this).attr('id'); - $(this).closest('.form-group').find('[for="' + inputId + '"]').removeClass('has-error'); - }); - - shippingFields.PostfinderItemZIP.focus(function() { - $(this).removeClass('has-error'); - var inputId = $(this).attr('id'); - $(this).closest('.form-group').find('[for="' + inputId + '"]').removeClass('has-error'); - }); + shippingFields.PostfinderItemCity.focus( function() + { + $( this ).removeClass( 'has-error' ); + var inputId = $( this ).attr( 'id' ); + $( this ).closest( '.form-group' ).find( '[for="' + inputId + '"]' ).removeClass( 'has-error' ); + } ); + + shippingFields.PostfinderItemZIP.focus( function() + { + $( this ).removeClass( 'has-error' ); + var inputId = $( this ).attr( 'id' ); + $( this ).closest( '.form-group' ).find( '[for="' + inputId + '"]' ).removeClass( 'has-error' ); + } ); } }, ['APIFactory', 'ModalFactory', 'UIFactory'] ); diff --git a/src/services/ValidationService.js b/src/services/ValidationService.js index 06913ce..ac86c47 100644 --- a/src/services/ValidationService.js +++ b/src/services/ValidationService.js @@ -360,7 +360,7 @@ formControl = $( getFormControl( elem ) ); formControl.on( 'focus click', function() { - var $errorElement = $(elem); + var $errorElement = $( elem ); $errorElement.removeClass( errorClass ); $form.find( 'label[for="' + $( this ).attr( 'id' ) + '"]' ).removeClass( errorClass ); } );