[NIVEL 2 AVANCE] Issues #49-#53 - Componentes Principales Verificados
Todos los componentes del NIVEL 2 ya están implementados correctamente: - ✅ Notification Bar (#49) - ✅ Navbar (#50) - ✅ Hero Section (#51) - ✅ Sidebar (#52) - ✅ Footer (#53) Solo se actualizó notification-bar.css para usar variables CSS. Próximo paso: NIVEL 3 (Refinamientos visuales) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
BIN
_planeacion/theme_referencias/_old/00 menu.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
_planeacion/theme_referencias/_old/01 wp title.png
Normal file
|
After Width: | Height: | Size: 1.5 MiB |
|
After Width: | Height: | Size: 256 KiB |
BIN
_planeacion/theme_referencias/_old/02 imagen destacada.png
Normal file
|
After Width: | Height: | Size: 1.4 MiB |
BIN
_planeacion/theme_referencias/_old/03 toc.png
Normal file
|
After Width: | Height: | Size: 1.4 MiB |
BIN
_planeacion/theme_referencias/_old/04 footer.png
Normal file
|
After Width: | Height: | Size: 311 KiB |
BIN
_planeacion/theme_referencias/_old/05 posts relacionados.png
Normal file
|
After Width: | Height: | Size: 1.6 MiB |
BIN
_planeacion/theme_referencias/_old/06 post content.png
Normal file
|
After Width: | Height: | Size: 1.8 MiB |
BIN
_planeacion/theme_referencias/_old/07 share & CTA.png
Normal file
|
After Width: | Height: | Size: 1.6 MiB |
@@ -0,0 +1 @@
|
||||
(function(){return {"error":true,"code":"wrongConfig-dataError"};})()
|
||||
@@ -0,0 +1,3 @@
|
||||
|
||||
<!-- saved from url=(0012)about:srcdoc -->
|
||||
<html lang="en-US"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><script charset="utf-8" async="" defer="true" src="https://static.olark.com/jsclient/locale/en-US.js"></script><script src="https://static.olark.com/a/assets/v0/site/5504-466-10-1887.js?cb=2025-11-04" async="" defer="" data-cfasync="false"></script><script src="https://static.olark.com/jsclient-bucket3/application2.js?v=1761152824221" async="" defer="" data-cfasync="false"></script></head><body><script data-olark="true" aria-hidden="true" tabindex="-1" src="https://static.olark.com/jsclient/app.js" async="" defer=""></script><span style="display: none;"><iframe style="display: none !important;" id="_olark_framesocket36187" src="https://static.olark.com/jsclient-bucket3/storage.html?v=1761152824221#TK6806084988706768"></iframe></span></body></html>
|
||||
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 16 KiB |
@@ -0,0 +1 @@
|
||||
!function(w,i,n,s,g,h,t){n[w]=n[w]||function(){(n[w].q=n[w].q||[]).push(arguments)};/*#code.optimize#*/n[w]("metadata",(function(){n[w]("set","_s","insights")}),!1,!0);n[w]("metadata",(function(){n[w]("set","_u","5213390")}),!1,!0);n[w]("metadata",(function(){n[w]("set","C_IS","1")}),!1,!0);if(n[w].v||n[w].t)return n[w]("event",w,"dup."+g.projectId);n[w].t=!0,(h=i.createElement(s)).async=!0,h.src="https://bat.bing.com/p/insights/s/0.8.38",(t=i.getElementsByTagName(s)[0]).parentNode.insertBefore(h,t),n[w]("start",g),n[w].q.unshift(n[w].q.pop()),n[w]("set","C_IS","1")}("webinsights",document,window,"script",{"projectId":"9m31kw9gdv","upload":"https://bat.bing.com/p/insights/c/b","expire":365,"cookies":["_uetmsclkid","_uetvid"],"track":true,"content":true,"dob":2134});
|
||||
@@ -0,0 +1,41 @@
|
||||
(function(w,d,c,k,a,b,t,e,h,s) {
|
||||
var cs = d.currentScript;
|
||||
if (cs) {
|
||||
var uo = cs.getAttribute('data-ueto');
|
||||
if (uo && w[uo] && typeof w[uo].setUserSignals === 'function') {
|
||||
w[uo].setUserSignals({'ea': c, 'kc': k, 'at': a, 'bi': b, 'pt': t, 'ec': e, 'ah': h, 'sb': s});
|
||||
}
|
||||
}
|
||||
})(window, document, false, false, false, false, false, false, false, false);
|
||||
(function(w,d,s,i) {
|
||||
var c=d.currentScript;
|
||||
if (c) {
|
||||
var uo = c.getAttribute('data-ueto');
|
||||
if (uo && w[uo] && w[uo].uetConfig && w[uo].uetConfig.deBlock === true)
|
||||
return;
|
||||
}
|
||||
var f,j; f=d.getElementsByTagName(s)[0]; j=d.createElement(s); j.async=true;
|
||||
j.src='https://bat.bing.com/p/insights/t/'+i;
|
||||
j.onload = function () {
|
||||
if (!c) return;
|
||||
var co = function(u) { return u && typeof u === 'object' && !(u instanceof Array) && u.beaconParams && u.beaconParams.mid && w.webinsights; };
|
||||
var r = 40;
|
||||
var cl = function() {
|
||||
if (r-- < 1) return;
|
||||
var uo = c.getAttribute('data-ueto');
|
||||
if (!uo) return;
|
||||
var u = w[uo];
|
||||
w.insightsuetq = w.mtagq || u;
|
||||
if (!co(u)) { setTimeout(function () { cl(); }, 250); return; }
|
||||
var m = u.beaconParams.mid;
|
||||
w.webinsights('set', '_uetmid', m);
|
||||
w.webinsights('metadata', (function () { w.webinsights('set', '_uetmid', m); }), false);
|
||||
d.addEventListener('UetEvent', function(e) {
|
||||
var nm = u.beaconParams.mid;
|
||||
if (m !== nm) { m = nm; w.webinsights('set', '_uetmid', m); }
|
||||
});
|
||||
};
|
||||
cl();
|
||||
};
|
||||
f.parentNode.insertBefore(j,f);
|
||||
})(window, document, 'script', '5213390');
|
||||
|
After Width: | Height: | Size: 3.5 KiB |
@@ -0,0 +1,9 @@
|
||||
|
||||
<!-- saved from url=(0072)https://a24704070387.cdn.optimizely.com/client_storage/a24704070387.html -->
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><script>
|
||||
|
||||
var allowedOrigins = [["^https?://(.+\\.)?www\\.provationmedical\\.com$", ""], ["^https?://(.+\\.)?gatsbyjs\\.io$", ""], ["^https?://(.+\\.)?accruent\\.com$", ""], ["^https?://(.+\\.)?www\\.dynapar\\.com$", ""], ["^https?://(.+\\.)?tek\\.com$", ""], ["^https?://(.+\\.)?fluke\\.com$", ""], ["^https?://(.+\\.)?dovermotion\\.com$", ""], ["^https?://(.+\\.)?www\\.emaint\\.com$", ""], ["^https?://(.+\\.)?www\\.intelex\\.com$", ""], ["^https?://(.+\\.)?www\\.setra\\.com$", ""], ["^https?://(.+\\.)?localhost:8000$", ""], ["^https?://(.+\\.)?www\\.gemssensors\\.com$", ""], ["^https?://(.+\\.)?flukenetworks\\.com$", ""], ["^https?://(.+\\.)?pantheonsite\\.io$", ""], ["^https?://(.+\\.)?ilxstaging\\.wpengine\\.com$", ""], ["^https?://(.+\\.)?us\\.flukecal\\.com$", ""], ["^https?://(.+\\.)?www\\.flukenetworks\\.com\\.cn$", ""], ["^https?://(.+\\.)?forms\\.office\\.com$", ""], ["^https?://(.+\\.)?censis\\.com$", ""], ["^https?://(.+\\.)?www\\.specialtyproducttechnologies\\.com$", ""], ["^https?://(.+\\.)?hengstler\\.de$", ""], ["^https?://(.+\\.)?www\\.flukeprocessinstruments\\.com$", ""], ["^https?://(.+\\.)?www\\.flukereliability\\.com$", ""], ["^https?://(.+\\.)?www\\.flukebiomedical\\.com$", ""], ["^https?://(.+\\.)?www\\.fluke\\.com\\.cn$", ""], ["^https?://(.+\\.)?$", ""], ["^https?://(.+\\.)?www\\.tek\\.com\\.cn$", ""], ["^https?://(.+\\.)?www\\.solmetric\\.com$", ""], ["^https?://(.+\\.)?www\\.fortive\\.com$", ""], ["^https?://(.+\\.)?www\\.anderson\\-negele\\.com$", ""], ["^https?://(.+\\.)?pruftechnik\\.com$", ""], ["^https?://(.+\\.)?b2clogin\\.com$", ""], ["^https?://(.+\\.)?www\\.gordian\\.com$", ""], ["^https?://(.+\\.)?psemc\\.com$", ""], ["^https?://(.+\\.)?www\\.qualitrolcorp\\.com$", ""], ["^https?://(.+\\.)?www\\.redeye\\.co$", ""], ["^https?://(.+\\.)?www\\.landauer\\.com$", ""], ["^https?://(.+\\.)?www\\.rsmeans\\.com$", ""], ["^https?://(.+\\.)?asp\\.com$", ""], ["^https?://(.+\\.)?www\\.raysafe\\.com$", ""], ["^https?://(.+\\.)?website\\.maintenanceconnection\\.com$", ""], ["^https?://(.+\\.)?www\\.emssoftware\\.com$", ""]];
|
||||
var blockedOrigins = [];
|
||||
|
||||
!function(){let k,m,t;try{k=window.localStorage}catch(b){m=b}let v;function O(e){return!v||0!==e.indexOf(v.origin)}function S(e,i){return new RegExp(i[0],i[1]).test(e)}function h(e,i){t||(e={id:"iframeerror",type:"ERROR",response:"Error accessing localStorage: "+(t=e?e.toString():"Localstorage is undefined")},i.source.postMessage(JSON.stringify(e),i.origin))}function w(e){e=e.split("$$");return 1===e.length?null:e[0].split("_")[1]}function*E(){var i=document.cookie.split(";");for(let e=0;e<i.length;e++){var[t,o]=i[e].trim().split("=");yield[t,o]}}window.addEventListener("message",function(e){let i,t,o,r=!1;for(o=0;o<allowedOrigins.length;o++)if(S(e.origin,allowedOrigins[o])){r=!0;break}if(r)for(o=0;o<blockedOrigins.length;o++)if(S(e.origin,blockedOrigins[o])){r=!1;break}if(r){v=e;try{i=JSON.parse(e.data)}catch(b){return}var n,s,a,f=e.origin+"_"+i.key;if(!k)return h(m,e);if("GET"===i.type){if(t=k.getItem(f),i.use_cookie)for(var[c,g]of E())if(c.startsWith(f)){t=g;break}}else if("PUT"===i.type)try{t=k.setItem(f,i.value),i.use_cookie&&(document.cookie=f+`=${i.value};max-age=15552000;Secure;SameSite=None;Path=/;`)}catch(b){return h(b,e)}else if("GETALL"===i.type){t={};for(const p in Object.keys(k))O(p)&&(t[p]=k.getItem(p));if(i.use_cookie)for(var[l,u]of E())O(l)&&(t[l]=u)}else{if("DELETE"!==i.type)return;for(const y in Object.keys(k))O(y)||(n=w(y))&&n!==i.visitorId&&k.removeItem(y);if(i.use_cookie)for(var[d]of E())O(d)||(s=w(d))&&s!==i.visitorId&&(document.cookie=d+"=; max-age=-42; path=/;")}"undefined"!=typeof i.id&&(a={id:i.id,response:t},e.source.postMessage(JSON.stringify(a),e.origin))}},!0),window.addEventListener("storage",function(e){v&&O(e.key)&&v.source.postMessage(JSON.stringify({type:"SYNC",response:{key:e.key,value:e.newValue}}),v.origin)},!0)}();
|
||||
</script></head><body></body></html>
|
||||
@@ -0,0 +1,35 @@
|
||||
/*!
|
||||
* jQuery UI Accordion 1.13.2
|
||||
* http://jqueryui.com
|
||||
*
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*/
|
||||
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","../version","../keycode","../unique-id","../widget"],factory);}else{factory(jQuery);}})(function($){"use strict";return $.widget("ui.accordion",{version:"1.13.2",options:{active:0,animate:{},classes:{"ui-accordion-header":"ui-corner-top","ui-accordion-header-collapsed":"ui-corner-all","ui-accordion-content":"ui-corner-bottom"},collapsible:false,event:"click",header:function(elem){return elem.find("> li > :first-child").add(elem.find("> :not(li)").even());},heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var options=this.options;this.prevShow=this.prevHide=$();this._addClass("ui-accordion","ui-widget ui-helper-reset");this.element.attr("role","tablist");if(!options.collapsible&&(options.active===false||options.active==null)){options.active=0;}
|
||||
this._processPanels();if(options.active<0){options.active+=this.headers.length;}
|
||||
this._refresh();},_getCreateEventData:function(){return{header:this.active,panel:!this.active.length?$():this.active.next()};},_createIcons:function(){var icon,children,icons=this.options.icons;if(icons){icon=$("<span>");this._addClass(icon,"ui-accordion-header-icon","ui-icon "+icons.header);icon.prependTo(this.headers);children=this.active.children(".ui-accordion-header-icon");this._removeClass(children,icons.header)._addClass(children,null,icons.activeHeader)._addClass(this.headers,"ui-accordion-icons");}},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons");this.headers.children(".ui-accordion-header-icon").remove();},_destroy:function(){var contents;this.element.removeAttr("role");this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId();this._destroyIcons();contents=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId();if(this.options.heightStyle!=="content"){contents.css("height","");}},_setOption:function(key,value){if(key==="active"){this._activate(value);return;}
|
||||
if(key==="event"){if(this.options.event){this._off(this.headers,this.options.event);}
|
||||
this._setupEvents(value);}
|
||||
this._super(key,value);if(key==="collapsible"&&!value&&this.options.active===false){this._activate(0);}
|
||||
if(key==="icons"){this._destroyIcons();if(value){this._createIcons();}}},_setOptionDisabled:function(value){this._super(value);this.element.attr("aria-disabled",value);this._toggleClass(null,"ui-state-disabled",!!value);this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!value);},_keydown:function(event){if(event.altKey||event.ctrlKey){return;}
|
||||
var keyCode=$.ui.keyCode,length=this.headers.length,currentIndex=this.headers.index(event.target),toFocus=false;switch(event.keyCode){case keyCode.RIGHT:case keyCode.DOWN:toFocus=this.headers[(currentIndex+1)%length];break;case keyCode.LEFT:case keyCode.UP:toFocus=this.headers[(currentIndex-1+length)%length];break;case keyCode.SPACE:case keyCode.ENTER:this._eventHandler(event);break;case keyCode.HOME:toFocus=this.headers[0];break;case keyCode.END:toFocus=this.headers[length-1];break;}
|
||||
if(toFocus){$(event.target).attr("tabIndex",-1);$(toFocus).attr("tabIndex",0);$(toFocus).trigger("focus");event.preventDefault();}},_panelKeyDown:function(event){if(event.keyCode===$.ui.keyCode.UP&&event.ctrlKey){$(event.currentTarget).prev().trigger("focus");}},refresh:function(){var options=this.options;this._processPanels();if((options.active===false&&options.collapsible===true)||!this.headers.length){options.active=false;this.active=$();}else if(options.active===false){this._activate(0);}else if(this.active.length&&!$.contains(this.element[0],this.active[0])){if(this.headers.length===this.headers.find(".ui-state-disabled").length){options.active=false;this.active=$();}else{this._activate(Math.max(0,options.active-1));}}else{options.active=this.headers.index(this.active);}
|
||||
this._destroyIcons();this._refresh();},_processPanels:function(){var prevHeaders=this.headers,prevPanels=this.panels;if(typeof this.options.header==="function"){this.headers=this.options.header(this.element);}else{this.headers=this.element.find(this.options.header);}
|
||||
this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default");this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide();this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content");if(prevPanels){this._off(prevHeaders.not(this.headers));this._off(prevPanels.not(this.panels));}},_refresh:function(){var maxHeight,options=this.options,heightStyle=options.heightStyle,parent=this.element.parent();this.active=this._findActive(options.active);this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed");this._addClass(this.active.next(),"ui-accordion-content-active");this.active.next().show();this.headers.attr("role","tab").each(function(){var header=$(this),headerId=header.uniqueId().attr("id"),panel=header.next(),panelId=panel.uniqueId().attr("id");header.attr("aria-controls",panelId);panel.attr("aria-labelledby",headerId);}).next().attr("role","tabpanel");this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide();if(!this.active.length){this.headers.eq(0).attr("tabIndex",0);}else{this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"});}
|
||||
this._createIcons();this._setupEvents(options.event);if(heightStyle==="fill"){maxHeight=parent.height();this.element.siblings(":visible").each(function(){var elem=$(this),position=elem.css("position");if(position==="absolute"||position==="fixed"){return;}
|
||||
maxHeight-=elem.outerHeight(true);});this.headers.each(function(){maxHeight-=$(this).outerHeight(true);});this.headers.next().each(function(){$(this).height(Math.max(0,maxHeight-
|
||||
$(this).innerHeight()+$(this).height()));}).css("overflow","auto");}else if(heightStyle==="auto"){maxHeight=0;this.headers.next().each(function(){var isVisible=$(this).is(":visible");if(!isVisible){$(this).show();}
|
||||
maxHeight=Math.max(maxHeight,$(this).css("height","").height());if(!isVisible){$(this).hide();}}).height(maxHeight);}},_activate:function(index){var active=this._findActive(index)[0];if(active===this.active[0]){return;}
|
||||
active=active||this.active[0];this._eventHandler({target:active,currentTarget:active,preventDefault:$.noop});},_findActive:function(selector){return typeof selector==="number"?this.headers.eq(selector):$();},_setupEvents:function(event){var events={keydown:"_keydown"};if(event){$.each(event.split(" "),function(index,eventName){events[eventName]="_eventHandler";});}
|
||||
this._off(this.headers.add(this.headers.next()));this._on(this.headers,events);this._on(this.headers.next(),{keydown:"_panelKeyDown"});this._hoverable(this.headers);this._focusable(this.headers);},_eventHandler:function(event){var activeChildren,clickedChildren,options=this.options,active=this.active,clicked=$(event.currentTarget),clickedIsActive=clicked[0]===active[0],collapsing=clickedIsActive&&options.collapsible,toShow=collapsing?$():clicked.next(),toHide=active.next(),eventData={oldHeader:active,oldPanel:toHide,newHeader:collapsing?$():clicked,newPanel:toShow};event.preventDefault();if((clickedIsActive&&!options.collapsible)||(this._trigger("beforeActivate",event,eventData)===false)){return;}
|
||||
options.active=collapsing?false:this.headers.index(clicked);this.active=clickedIsActive?$():clicked;this._toggle(eventData);this._removeClass(active,"ui-accordion-header-active","ui-state-active");if(options.icons){activeChildren=active.children(".ui-accordion-header-icon");this._removeClass(activeChildren,null,options.icons.activeHeader)._addClass(activeChildren,null,options.icons.header);}
|
||||
if(!clickedIsActive){this._removeClass(clicked,"ui-accordion-header-collapsed")._addClass(clicked,"ui-accordion-header-active","ui-state-active");if(options.icons){clickedChildren=clicked.children(".ui-accordion-header-icon");this._removeClass(clickedChildren,null,options.icons.header)._addClass(clickedChildren,null,options.icons.activeHeader);}
|
||||
this._addClass(clicked.next(),"ui-accordion-content-active");}},_toggle:function(data){var toShow=data.newPanel,toHide=this.prevShow.length?this.prevShow:data.oldPanel;this.prevShow.add(this.prevHide).stop(true,true);this.prevShow=toShow;this.prevHide=toHide;if(this.options.animate){this._animate(toShow,toHide,data);}else{toHide.hide();toShow.show();this._toggleComplete(data);}
|
||||
toHide.attr({"aria-hidden":"true"});toHide.prev().attr({"aria-selected":"false","aria-expanded":"false"});if(toShow.length&&toHide.length){toHide.prev().attr({"tabIndex":-1,"aria-expanded":"false"});}else if(toShow.length){this.headers.filter(function(){return parseInt($(this).attr("tabIndex"),10)===0;}).attr("tabIndex",-1);}
|
||||
toShow.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0});},_animate:function(toShow,toHide,data){var total,easing,duration,that=this,adjust=0,boxSizing=toShow.css("box-sizing"),down=toShow.length&&(!toHide.length||(toShow.index()<toHide.index())),animate=this.options.animate||{},options=down&&animate.down||animate,complete=function(){that._toggleComplete(data);};if(typeof options==="number"){duration=options;}
|
||||
if(typeof options==="string"){easing=options;}
|
||||
easing=easing||options.easing||animate.easing;duration=duration||options.duration||animate.duration;if(!toHide.length){return toShow.animate(this.showProps,duration,easing,complete);}
|
||||
if(!toShow.length){return toHide.animate(this.hideProps,duration,easing,complete);}
|
||||
total=toShow.show().outerHeight();toHide.animate(this.hideProps,{duration:duration,easing:easing,step:function(now,fx){fx.now=Math.round(now);}});toShow.hide().animate(this.showProps,{duration:duration,easing:easing,complete:complete,step:function(now,fx){fx.now=Math.round(now);if(fx.prop!=="height"){if(boxSizing==="content-box"){adjust+=fx.now;}}else if(that.options.heightStyle!=="content"){fx.now=Math.round(total-toHide.outerHeight()-adjust);adjust=0;}}});},_toggleComplete:function(data){var toHide=data.oldPanel,prev=toHide.prev();this._removeClass(toHide,"ui-accordion-content-active");this._removeClass(prev,"ui-accordion-header-active")._addClass(prev,"ui-accordion-header-collapsed");if(toHide.length){toHide.parent()[0].className=toHide.parent()[0].className;}
|
||||
this._trigger("activate",null,data);}});});
|
||||
@@ -0,0 +1,5 @@
|
||||
define(['jquery','mage/tabs'],function($,tabs){'use strict';$.widget('mage.accordion',tabs,{options:{active:[0],multipleCollapsible:false,openOnFocus:false},_callCollapsible:function(){var self=this,disabled=false,active=false;if(typeof this.options.active==='string'){this.options.active=this.options.active.split(' ').map(function(item){return parseInt(item,10);});}
|
||||
$.each(this.collapsibles,function(i){disabled=active=false;if($.inArray(i,self.options.disabled)!==-1){disabled=true;}
|
||||
if($.inArray(i,self.options.active)!==-1){active=true;}
|
||||
self._instantiateCollapsible(this,i,active,disabled);});},_toggleActivate:function(action,index){var self=this;if(Array.isArray(index&&this.options.multipleCollapsible)){$.each(index,function(){self.collapsibles.eq(this).collapsible(action);});}else if(index===undefined&&this.options.multipleCollapsible){this.collapsibles.collapsible(action);}else{this._super(action,index);}},_handleDeepLinking:function(){if(!this.options.multipleCollapsible){this._super();}},_closeOthers:function(){var self=this;if(!this.options.multipleCollapsible){$.each(this.collapsibles,function(){$(this).on('beforeOpen',function(){self.collapsibles.not(this).collapsible('deactivate');});});}
|
||||
$.each(this.collapsibles,function(){$(this).on('beforeOpen',function(){var section=$(this);section.addClass('allow').prevAll().addClass('allow');section.nextAll().removeClass('allow');});});}});return $.mage.accordion;});
|
||||
@@ -0,0 +1,7 @@
|
||||
define(['jquery','underscore','Magento_Ui/js/form/adapter/buttons'],function($,_,buttons){'use strict';var selectorPrefix='',eventPrefix;function initListener(callback,action){var selector=selectorPrefix?selectorPrefix+' '+buttons[action]:buttons[action],elem=$(selector)[0];if(!elem){return;}
|
||||
if(elem.onclick){elem.onclick=null;}
|
||||
$(elem).on('click'+eventPrefix,callback);}
|
||||
function destroyListener(action){var selector=selectorPrefix?selectorPrefix+' '+buttons[action]:buttons[action],elem=$(selector)[0];if(!elem){return;}
|
||||
if(elem.onclick){elem.onclick=null;}
|
||||
$(elem).off('click'+eventPrefix);}
|
||||
return{on:function(handlers,selectorPref,eventPref){selectorPrefix=selectorPrefix||selectorPref;eventPrefix=eventPref;_.each(handlers,initListener);selectorPrefix='';},off:function(handlers,eventPref){eventPrefix=eventPref;_.each(handlers,destroyListener);}};});
|
||||
@@ -0,0 +1,14 @@
|
||||
define(['jquery','jquery-ui-modules/widget'],function($){'use strict';$.widget('mage.addToWishlist',{options:{bundleInfo:'div.control [name^=bundle_option]',configurableInfo:'.super-attribute-select',groupedInfo:'#super-product-table input',downloadableInfo:'#downloadable-links-list input',customOptionsInfo:'.product-custom-option',qtyInfo:'#qty',actionElement:'[data-action="add-to-wishlist"]',productListWrapper:'.product-item-info',productPageWrapper:'.product-info-main'},_create:function(){this._bind();},_bind:function(){var options=this.options,dataUpdateFunc='_updateWishlistData',validateProductQty='_validateWishlistQty',changeCustomOption='change '+options.customOptionsInfo,changeQty='change '+options.qtyInfo,updateWishlist='click '+options.actionElement,events={},key;if('productType'in options){if(typeof options.productType==='string'){options.productType=[options.productType];}}else{options.productType=[];}
|
||||
events[changeCustomOption]=dataUpdateFunc;events[changeQty]=dataUpdateFunc;events[updateWishlist]=validateProductQty;for(key in options.productType){if(options.productType.hasOwnProperty(key)&&options.productType[key]+'Info'in options){events['change '+options[options.productType[key]+'Info']]=dataUpdateFunc;}}
|
||||
this._on(events);},_updateWishlistData:function(event){var dataToAdd={},isFileUploaded=false,handleObjSelector=null,self=this;if(event.handleObj.selector==this.options.qtyInfo){this._updateAddToWishlistButton({},event);event.stopPropagation();return;}
|
||||
handleObjSelector=$(event.currentTarget).closest('form').find(event.handleObj.selector);handleObjSelector.each(function(index,element){if($(element).is('input[type=text]')||$(element).is('input[type=email]')||$(element).is('input[type=number]')||$(element).is('input[type=hidden]')||$(element).is('input[type=checkbox]:checked')||$(element).is('input[type=radio]:checked')||$(element).is('textarea')||$('#'+element.id+' option:selected').length){if($(element).data('selector')||$(element).attr('name')){dataToAdd=$.extend({},dataToAdd,self._getElementData(element));}
|
||||
return;}
|
||||
if($(element).is('input[type=file]')&&$(element).val()){isFileUploaded=true;}});if(isFileUploaded){this.bindFormSubmit();}
|
||||
this._updateAddToWishlistButton(dataToAdd,event);event.stopPropagation();},_updateAddToWishlistButton:function(dataToAdd,event){var self=this,buttons=this._getAddToWishlistButton(event);buttons.each(function(index,element){var params=$(element).data('post'),currentTarget=event.currentTarget,targetElement,targetValue;if(!params){params={'data':{}};}else if($(currentTarget).data('selector')||$(currentTarget).attr('name')){targetElement=self._getElementData(currentTarget);targetValue=Object.keys(targetElement)[0];if(params.data.hasOwnProperty(targetValue)&&!dataToAdd.hasOwnProperty(targetValue)){delete params.data[targetValue];}}
|
||||
params.data=$.extend({},params.data,dataToAdd,{'qty':$(self.options.qtyInfo).val()});$(element).data('post',params);});},_getAddToWishlistButton:function(event){var productListWrapper=$(event.currentTarget).closest(this.options.productListWrapper);if(productListWrapper.length){return productListWrapper.find(this.options.actionElement);}
|
||||
return $(this.options.actionElement);},_arrayDiffByKeys:function(array1,array2){var result={};$.each(array1,function(key,value){if(key.indexOf('option')===-1){return;}
|
||||
if(!array2[key]){result[key]=value;}});return result;},_getElementData:function(element){var data,elementName,elementValue;element=$(element);data={};elementName=element.data('selector')?element.data('selector'):element.attr('name');elementValue=element.val();if(element.is('select[multiple]')&&elementValue!==null){if(elementName.substr(elementName.length-2)=='[]'){elementName=elementName.substring(0,elementName.length-2);}
|
||||
$.each(elementValue,function(key,option){data[elementName+'['+option+']']=option;});}else if(elementName.substr(elementName.length-2)=='[]'){elementName=elementName.substring(0,elementName.length-2);data[elementName+'['+elementValue+']']=elementValue;}else{data[elementName]=elementValue;}
|
||||
return data;},_removeExcessiveData:function(params,dataToAdd){var dataToRemove=this._arrayDiffByKeys(params.data,dataToAdd);$.each(dataToRemove,function(key){delete params.data[key];});},bindFormSubmit:function(){var self=this;$('[data-action="add-to-wishlist"]').on('click',function(event){var element,params,form,action;event.stopPropagation();event.preventDefault();element=$('input[type=file]'+self.options.customOptionsInfo);params=$(event.currentTarget).data('post');form=$(element).closest('form');action=params.action;if(params.data.id){$('<input>',{type:'hidden',name:'id',value:params.data.id}).appendTo(form);}
|
||||
if(params.data.uenc){action+='uenc/'+params.data.uenc;}
|
||||
$(form).attr('action',action).trigger('submit');});},_validateWishlistQty:function(event){var element=$(this.options.qtyInfo);if(!(element.validation()&&element.validation('isValid'))){event.preventDefault();event.stopPropagation();return;}}});return $.mage.addToWishlist;});
|
||||
@@ -0,0 +1 @@
|
||||
define(['ko','./customer-addresses'],function(ko,defaultProvider){'use strict';return ko.observableArray(defaultProvider.getAddressItems());});
|
||||
@@ -0,0 +1,2 @@
|
||||
define(['underscore'],function(_){'use strict';return function(addressData){var regionId;if(addressData.region['region_id']&&addressData.region['region_id']!=='0'){regionId=addressData.region['region_id']+'';}
|
||||
return{customerAddressId:addressData.id,email:addressData.email,countryId:addressData['country_id'],regionId:regionId,regionCode:addressData.region['region_code'],region:addressData.region.region,customerId:addressData['customer_id'],street:addressData.street,company:addressData.company,telephone:addressData.telephone,fax:addressData.fax,postcode:addressData.postcode,city:addressData.city,firstname:addressData.firstname,lastname:addressData.lastname,middlename:addressData.middlename,prefix:addressData.prefix,suffix:addressData.suffix,vatId:addressData['vat_id'],sameAsBilling:addressData['same_as_billing'],saveInAddressBook:addressData['save_in_address_book'],customAttributes:_.toArray(addressData['custom_attributes']).reverse(),isDefaultShipping:function(){return addressData['default_shipping'];},isDefaultBilling:function(){return addressData['default_billing'];},getAddressInline:function(){return addressData.inline;},getType:function(){return'customer-address';},getKey:function(){return this.getType()+this.customerAddressId;},getCacheKey:function(){return this.getKey();},isEditable:function(){return false;},canUseForBilling:function(){return true;}};};});
|
||||
@@ -0,0 +1 @@
|
||||
define(['ko','../template/renderer'],function(ko,renderer){'use strict';ko.bindingHandlers.afterRender={init:function(element,valueAccessor,allBindings,viewModel){var callback=valueAccessor();if(typeof callback==='function'){callback.call(viewModel,element,viewModel);}}};renderer.addAttribute('afterRender');});
|
||||
@@ -0,0 +1 @@
|
||||
define(['jquery','underscore','jquery-ui-modules/widget','Magento_Ui/js/modal/confirm','mage/translate'],function($,_){'use strict';$.widget('mage.alert',$.mage.confirm,{options:{modalClass:'confirm',title:$.mage.__('Attention'),actions:{always:function(){}},buttons:[{text:$.mage.__('OK'),class:'action-primary action-accept',click:function(){this.closeModal(true);}}]},closeModal:function(){this.options.actions.always();this.element.on('alertclosed',_.bind(this._remove,this));return this._super();}});return function(config){return $('<div></div>').html(config.content).alert(config);};});
|
||||
@@ -0,0 +1,22 @@
|
||||
define(['jquery','underscore','amShopbyHelpers','Magento_Ui/js/modal/modal','jquery-ui-modules/slider','mage/tooltip','mage/validation','mage/translate','Amasty_Shopby/js/jquery.ui.touch-punch.min','Amasty_ShopbyBase/js/chosen/chosen.jquery','amShopbyFiltersSync'],function($,_,helpers){'use strict';$.widget('mage.amShopbyFilterAbstract',{filters:{},options:{isAjax:0,collectFilters:0,activeClass:'-active',clearUrl:null,delta:[],deltaFrom:0,deltaTo:0,curRate:'1',digitsAfterDot:2},selectors:{fromToWidget:'[data-am-js="fromto-widget"]',filterForm:'form[data-amshopby-filter]',filterFormAttr:'form[data-amshopby-filter={attr}]',filterItems:'[class*="am-filter-items"]',sidebar:'.sidebar',topNav:'.catalog-topnav',filterOptionsContent:'.filter-options-content',filterOptionsItem:'.filter-options-item',ajaxOptionsSelectors:'body.page-with-filter, body.catalogsearch-result-index, body.cms-index-index',filterRequestVar:'[data-amshopby-filter-request-var="cat"]',dFrom:'df=',dTo:'dt='},classes:{active:'-active',disabled:'-disabled',savedFilterValues:'amshopby-saved-values',selected:'amshopby-link-selected'},nodes:{ranges:$('[data-amshopby-js="price-ranges"]')},getFilter:function(){return{'code':this.element.attr('amshopby-filter-code'),'value':this.element.attr('amshopby-filter-value')};},apply:function(link,clearFilter){var linkParam;try{if($.mage.amShopbyAjax){$.mage.amShopbyAjax.prototype.response=null;}
|
||||
this.options.isAjax=$.mage.amShopbyAjax!==undefined;linkParam=clearFilter?link:null;link=this.element?.parents('.price-ranges').length&&link.includes('?')?link+'&price-ranges=1':link;if(!this.options.collectFilters&&this.options.isAjax===true){this.prepareTriggerAjax(this.element,linkParam,clearFilter);}else{if(this.options.collectFilters===1){this.prepareTriggerAjax(this.element,linkParam);}else{window.location=link;}}}catch(e){window.location=link;}},prepareTriggerAjax:function(element,clearUrl,clearFilter,isSorting){var self=this,widgetInstance=$.mage.amShopbyFilterAbstract.prototype,selectors=this.selectors,forms=$(selectors.filterForm),attributeName,excludedFormSelector,existFields=[],savedFilters=[],$item,className,startPos,endPos,filterClass,isPriceType,serializeForms,isPriceExist,data,ajaxData;if(typeof this.element!=='undefined'&&clearFilter){attributeName=this.selectors.filterFormAttr.replace('{attr}',this.element.closest(selectors.filterOptionsContent).find('form').data('amshopby-filter'));excludedFormSelector=(this.element.closest(selectors.sidebar).length===0?selectors.topNav:selectors.sidebar)+' '+attributeName;forms=forms.not(excludedFormSelector);}
|
||||
forms.each(function(index,item){$item=$(item);className='';if($item.closest(selectors.filterItems).length){className=$item.closest(selectors.filterItems)[0].className;}else if($item.find(selectors.filterItems).length){className=$item.find(selectors.filterItems)[0].className;}
|
||||
startPos=className.indexOf('am-filter-items');endPos=className.indexOf(' ',startPos+1)===-1?100:className.indexOf(' ',startPos+1);filterClass=className.substring(startPos,endPos);isPriceType=$($item.closest(selectors.filterOptionsItem)).find(selectors.fromToWidget).length;if(filterClass&&existFields[filterClass]&&!isPriceType){forms[index]='';}else{existFields[filterClass]=true;}
|
||||
if($item.hasClass(self.classes.savedFilterValues)){savedFilters.push(forms[index]);forms[index]='';}});serializeForms=forms.serializeArray();isPriceExist=false;_.each(serializeForms,function(index,item){if(item.name==='amshopby[price][]'){isPriceExist=true;return false;}});if(!isPriceExist&&savedFilters){savedFilters.forEach(function(element){serializeForms.push($(element).serializeArray()[0]);});}
|
||||
data=this.normalizeData(serializeForms,isSorting,clearFilter);clearUrl=data.clearUrl?data.clearUrl:clearUrl;element=element||document;if(widgetInstance.options.delta.length){data=data.concat(widgetInstance.options.delta);}
|
||||
if($(element).parents('.price-ranges').length){data.push({name:'price-ranges',value:1});}
|
||||
data.clearUrl=clearUrl;if(this.options.collectFilters){ajaxData=_.clone(data);ajaxData.clearUrl=clearUrl;$.mage.amShopbyAjax.prototype.prevData={ajaxData:ajaxData,clearFilter,isSorting};if(!isSorting){data.isGetCounter=true;}}
|
||||
$(element).trigger('amshopby:submit_filters',{data:data,clearFilter:clearFilter,isSorting:isSorting});return data;},normalizeData:function(data,isSorting,clearFilter){var self=this,normalizedData=[],ajaxOptions=$(this.selectors.ajaxOptionsSelectors).amShopbyAjax('option'),clearUrl;_.each(data,function(item){if(item&&item.value.trim()!==''&&item.value!=='-1'){var isNormalizeItem=_.find(normalizedData,function(normalizeItem){return normalizeItem.name===item.name&&normalizeItem.value===item.value||item.name==='amshopby[price][]'&&normalizeItem.name===item.name;});if(!isNormalizeItem){if(item.name==='amshopby[price][]'){item.value=self.normalizePrice(item.value);}
|
||||
if(!ajaxOptions.isCategorySingleSelect&&item.name==='amshopby[cat][]'&&+item.value===+ajaxOptions.currentCategoryId){return;}
|
||||
normalizedData.push(item);if(ajaxOptions.isCategorySingleSelect===1&&item.name==='amshopby[cat][]'&&+item.value!==+ajaxOptions.currentCategoryId&&!clearFilter&&!isSorting){clearUrl=$('*'+self.selectors.filterRequestVar+' *[value="'+item.value+'"]').parent().find('a').attr('href');}}}});normalizedData=this.groupDataByName(normalizedData);if(clearUrl){normalizedData.clearUrl=clearUrl;}
|
||||
return normalizedData;},groupDataByName:function(formData){var hash=Object.create(null);return formData.reduce(function(result,currentValue){if(!hash[currentValue.name]){hash[currentValue.name]={};hash[currentValue.name].name=currentValue.name;result.push(hash[currentValue.name]);}
|
||||
if(hash[currentValue.name].value){hash[currentValue.name].value+=','+currentValue.value;}else{hash[currentValue.name].value=currentValue.value;}
|
||||
return result;},[]);},getHideDigitsAfterDot:function(){var value=+$('[name="amshopby[price][]"]').first().attr('data-digits-after-dot');return Number.isNaN(value)?0:value;},buildNumber:function(size){var str='1',i;for(i=1;i<=size;i++){str+='0';}
|
||||
return str;},isPrice:function(){return typeof this.options.code!='undefined'&&this.options.code==='price';},renderShowButton:function(event,element){if($.mage.amShopbyApplyFilters){$.mage.amShopbyApplyFilters.prototype.renderShowButton(event,element);}},addListenerOnCheckbox:function(checkbox,parent){checkbox.bind('click',{},function(event){event.stopPropagation();event.currentTarget.checked=!event.currentTarget.checked;parent.trigger('click');});},markAsSelected:function(element){var self=this,$element=$(element);$element.closest('li').find('a').toggleClass(self.classes.selected,$element.prop('checked'));},normalizePrice:function(value){var result=value.split('-'),i;for(i=0;i<result.length;i++){if(typeof result[i]=='undefined'){result[i]=0;}
|
||||
result[i]=this.processPrice(true,result[i]).amToFixed(2,this.getHideDigitsAfterDot());}
|
||||
return result.join('-').replace(/[ \r\n]/g,'');},isBaseCurrency:function(){return Number(this.options.curRate)===1;},processPrice:function(toBasePrice,input,delta){var rate=Number(this.options.curRate),inputPrice=Number(input);delta=typeof delta!=='undefined'?Number(delta):0;return this.isBaseCurrency()?inputPrice:(toBasePrice?(inputPrice / rate):((inputPrice*rate)+delta));},calculateDelta:function(calculatedCurrency,baseCurrency){return(Number(calculatedCurrency)-(Number(baseCurrency).toFixed(2)*Number(this.options.curRate))).toFixed(3);},getUrlWithDelta:function(link,valueFrom,from,valueTo,to,deltaFrom,deltaTo){var dFrom=this.selectors.dFrom,dTo=this.selectors.dTo;if(this.isBaseCurrency()){return link;}
|
||||
if(link.indexOf(dFrom)!==-1||link.indexOf(dTo)!==-1){link=link.replace(dFrom+parseFloat(deltaFrom).amToFixed(2,this.getHideDigitsAfterDot()),dFrom+this.calculateDelta(from,valueFrom)).replace(dTo+parseFloat(deltaTo).amToFixed(2,this.getHideDigitsAfterDot()),dTo+this.calculateDelta(to,valueTo));}else{link+=this.getDeltaParams(from,valueFrom,to,valueTo,true);}
|
||||
return link;},getDeltaParams:function(from,valueFrom,to,valueTo,isUrl){var deltaFrom=this.calculateDelta(from,valueFrom),deltaTo=this.calculateDelta(to,valueTo),params='';$.mage.amShopbyFilterAbstract.prototype.options.deltaFrom=deltaFrom;$.mage.amShopbyFilterAbstract.prototype.options.deltaTo=deltaTo;if(isUrl){if(deltaFrom%1!==0){params+='&df='+deltaFrom;}
|
||||
if(deltaTo%1!==0){params+='&dt='+deltaTo;}
|
||||
return params;}
|
||||
return[{name:'amshopby[df][]',value:deltaFrom},{name:'amshopby[dt][]',value:deltaTo}];},setDeltaParams:function(delta){$.mage.amShopbyFilterAbstract.prototype.options.delta=delta instanceof Array?delta:[];},setCurrency:function(curRate){this.options.curRate=curRate;},setCollectFilters:function(collectFilters){this.options.collectFilters=collectFilters;}});return $.mage.amShopbyFilterAbstract;});
|
||||
@@ -0,0 +1,3 @@
|
||||
define(['jquery','amShopbyFilterAbstract','amShopbyFiltersSync'],function($,amShopbyFilterAbstract){'use strict';$.widget('mage.amShopbyFilterCategory',amShopbyFilterAbstract,{options:{type:null,collectFilters:null,clearUrl:null},selectors:{items:'.items',parent:'.item',radioButton:'input[type=radio]',checkboxButton:'input[type=checkbox]',checkbox:'input[type=checkbox], input[type=radio]'},_create:function(){var self=this,parent=$(self.element.parents(self.selectors.parent)[0]),checkbox=self.element.siblings(self.selectors.checkbox);this.initEventListeners();this.addListenerOnCheckbox(checkbox,parent);this.markAsSelected(checkbox);},initEventListeners:function(){var self=this,link=self.element,parent=$(link.parents(self.selectors.parent)[0]),checkbox=link.siblings(self.selectors.checkbox),params={parent:parent,checkbox:checkbox,link:link},element,href;parent.off('click').on('click',params,function(event){element=event.data.checkbox;href=event.data.link.prop('href');event.stopPropagation();event.preventDefault();if($(this).find(self.selectors.radioButton)[0]&&location.href.indexOf('find=')!==-1){location.href=href;return;}
|
||||
element.prop('checked',!element.prop('checked'));self.triggerSync(element,!element.prop('checked'));self.renderShowButton(event,element);self.apply(href);self.togglingTree(event.data.parent,self.isTypeFolding()?false:element.prop('checked'));});checkbox.on('change',function(){self.markAsSelected($(this));});checkbox.on('amshopby:sync_change',function(){self.markAsSelected($(this));});},triggerSync:function(element,clearFilter){element.trigger('change');element.trigger('sync',[clearFilter]);},togglingTree:function(element,isChecked){if(this.isTypeFolding()){element.find(this.selectors.items+' '+this.selectors.checkboxButton).prop('checked',false);}
|
||||
element.parents(this.selectors.parent).find('> a '+this.selectors.checkboxButton).prop('checked',isChecked);},isTypeFolding:function(){return this.options.type==='labelsFolding';}});return $.mage.amShopbyFilterCategory;});
|
||||
@@ -0,0 +1,3 @@
|
||||
define(["underscore","jquery"],function(_,$){'use strict';return function(options){var beforeValue=[];$(document).on("sync","[data-amshopby-filter]",function(event,clearFilter){syncFilters(this,clearFilter);});function syncFilters(element,clearFilter){var currentForm=$(element);var attributeCode=currentForm.attr('data-amshopby-filter');$('[data-amshopby-filter="'+attributeCode+'"]').each(function(){if(this!==currentForm.get(0)||clearFilter){beforeValue=$(this).serializeArray();var data=normalizeData(currentForm.serializeArray());delete data['amshopby[attr_price_from][]'];delete data['amshopby[attr_price_to][]'];_(data).each(function(values,name){var element=$(this).find('[name="'+name+'"]');if(values[0]||clearFilter){element.val(values);element.trigger("amshopby:sync_change",[values]);element.trigger("chosen:updated");}}.bind(this));}});}
|
||||
function normalizeData(data){_(beforeValue).each(function(beforeItem){var item=_.filter(data,function(item){return item.name===beforeItem.name;});if(item.length===0){data.push({name:beforeItem.name,value:''});}});var normalizedData={};_(data).each(function(item){if(!normalizedData[item.name]){normalizedData[item.name]=[];}
|
||||
normalizedData[item.name].push(item.value);});return normalizedData;}}});
|
||||
@@ -0,0 +1 @@
|
||||
define(['jquery','matchMedia','amShopbyTopFilters','mage/tabs','domReady!'],function($,mediaCheck,amShopbyTopFilters){'use strict';mediaCheck({media:'(max-width: 768px)',entry:function(){amShopbyTopFilters.moveTopFiltersToSidebar();},exit:function(){amShopbyTopFilters.removeTopFiltersFromSidebar();}});});
|
||||
@@ -0,0 +1,3 @@
|
||||
define(['jquery'],function($){'use strict';$.widget('mage.amShopbySwatchesChoose',{options:{listSwatches:{},swatchWidgetName:'mageSwatchRenderer',newSwatchWidgetName:'mage-SwatchRenderer'},selectors:{swatchOption:'[data-role^="swatch-option"]'},observerConfig:{attributes:true,childList:false,subtree:true},observer:null,_create:function(){var self=this;if(!self.options.listSwatches.length){return;}
|
||||
self.initObserver();self.element.find(self.selectors.swatchOption).each(function(index,element){self.observer.observe(element,self.observerConfig);});},initObserver:function(){this.observer=new MutationObserver(this.observerCallback.bind(this));},observerCallback:function(mutationsList){var self=this,swatchWidget;mutationsList.forEach(function(mutation){if(mutation.type==='attributes'&&mutation.attributeName==='data-rendered'){swatchWidget=$(mutation.target).data(self.options.swatchWidgetName)||$(mutation.target).data(self.options.newSwatchWidgetName);$(self.options.listSwatches).each(function(id,attribute){if(!swatchWidget||!swatchWidget._EmulateSelected){return;}
|
||||
swatchWidget._EmulateSelected(attribute);});}});}});return $.mage.amShopbySwatchesChoose;});
|
||||
@@ -0,0 +1,8 @@
|
||||
define(['jquery'],function($){'use strict';var options={widgets:{collapsible:'{"collapsible":{"openedState": "active", "collapsible": true, "active": false, '
|
||||
+'"collateral": { "openedState": "filter-active", "element": "body" } }}',accordion:'{"accordion":{"openedState": "active", "collapsible": true, "active": false, '
|
||||
+'"multipleCollapsible": %1}}'},selectors:{sidebar:'.sidebar.sidebar-main',sidebarList:'.sidebar.sidebar-main #narrow-by-list',list:'#narrow-by-list',topNav:'.catalog-topnav',topFilterActions:'.catalog-topnav .filter-actions',topNarrowList:'.catalog-topnav #narrow-by-list',layeredFilter:'#layered-filter-block',blockFilter:'.block.filter',optionsItem:'.filter-options-item',filterTitle:'.filter-title:before',filterActions:'.block-actions.filter-actions',swatches:'.items, .swatch-attribute'},classes:{allTop:'amshopby-all-top-filters-append-left',filterTop:'amshopby-filter-top'}};return{moveTopFiltersToSidebar:function(){if($(options.selectors.sidebarList).length===0){var blockClass=$(options.selectors.layeredFilter).length?options.selectors.layeredFilter:options.selectors.blockFilter,$element=$(options.selectors.topNav+' '+blockClass).clone(),$sidebar=$(options.selectors.sidebar).first();$(options.selectors.topFilterActions).hide();$element.find(options.selectors.filterTitle).css('display','none');$element.addClass(options.classes.allTop).attr('data-mage-init',options.widgets.collapsible);$element.find(options.selectors.list).attr('data-mage-init',options.widgets.accordion.replace('%1','false'));$element.find(options.selectors.filterActions).remove();$sidebar.append($element);$sidebar.trigger('contentUpdated');return;}
|
||||
$(options.selectors.topNarrowList+' '+options.selectors.optionsItem).each(function(){var isPresent=false,classes=$(this).find(options.selectors.swatches).first().attr('class'),i;if(classes){var listClasses=classes.split(' '),currentClass='';for(i=0;i<listClasses.length;i++){if(listClasses[i].indexOf('am-filter-items-')!==-1){currentClass=listClasses[i];break;}}
|
||||
if(currentClass!==''&&$(options.selectors.sidebarList+' .'+currentClass).length>0){isPresent=true;}}
|
||||
if(isPresent){return;}
|
||||
$(this).addClass(options.classes.filterTop).appendTo($(options.selectors.sidebarList).first());});$(options.selectors.sidebar+' '+options.selectors.blockFilter).first().trigger('contentUpdated');},removeTopFiltersFromSidebar:function(){if($(options.selectors.topNav).length===0){return;}
|
||||
$(options.selectors.sidebarList+' .'+options.classes.filterTop).appendTo($(options.selectors.topNarrowList));$(options.selectors.sidebar+' .'+options.classes.allTop).remove();}};});
|
||||
@@ -0,0 +1,2 @@
|
||||
define(['jquery'],function($){'use strict';var mixin={_keydown:function(event){if(!this.active){return;}
|
||||
this._super(event);}};return function(targetWidget){$.widget('mage.menu',targetWidget.menu,mixin);return{menu:$.mage.menu,navigation:$.mage.navigation};};});
|
||||
@@ -0,0 +1 @@
|
||||
.slick-dots li button:focus,.slick-dots li button:hover,.slick-list:focus{outline:0}.slick-list,.slick-slider,.slick-track{display:block;position:relative}.slick-loading .slick-slide,.slick-loading .slick-track{visibility:hidden}.slick-list{overflow:hidden;margin:0;padding:0}.slick-list.dragging{cursor:pointer;cursor:hand}.slick-slider .slick-list,.slick-slider .slick-track{-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.slick-track{top:0;left:0;margin:0 auto}.slick-track:after,.slick-track:before{display:table;content:''}.slick-slide,.slick-slide.slick-loading img{display:none}.slick-track:after{clear:both}.slick-slide{float:left;height:100%;min-height:1px;vertical-align:middle}[dir=rtl] .slick-slide{float:right}.slick-slide.dragging img{pointer-events:none}.slick-vertical .slick-slide{display:block;height:auto;border:1px solid transparent}.slick-arrow.slick-hidden{display:none}.slick-loading .slick-list{position:relative;background:0 0}.slick-loading .slick-list:before{position:absolute;top:50%;left:50%;display:block;content:'';border-radius:100%;border-style:solid;border-width:3px;height:25px;width:25px;border-color:rgba(0,0,0,.2);border-top-color:#5c5c5c;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);animation:loading 1s infinite linear}@keyframes loading{0%{-webkit-transform:translate(-50%,-50%) rotate(0);transform:translate(-50%,-50%) rotate(0)}100%{-webkit-transform:translate(-50%,-50%) rotate(359.9deg);transform:translate(-50%,-50%) rotate(359.9deg)}}.slick-next.slick-disabled,.slick-prev.slick-disabled{opacity:.25}.slick-dotted.slick-slider{margin-bottom:30px}.slick-dots{position:absolute;left:0;display:block;width:100%;padding:0;margin:0;list-style:none;text-align:center}.slick-dots li{position:relative;display:inline-block;width:20px;height:20px;margin:0 5px;padding:0;cursor:pointer}.slick-dots li button,.slick-slider .slick-arrow{display:block;cursor:pointer;outline:0;box-shadow:none}.slick-dots li button{font-size:0;line-height:0;width:20px;height:20px;padding:5px;color:transparent;border:0;background:0 0}.slick-dots li button:focus:before,.slick-dots li button:hover:before{opacity:1}.slick-dots li button:before{font-size:16px;line-height:20px;position:absolute;top:0;left:0;width:20px;height:20px;content:'•';text-align:center;opacity:.25;color:#000;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.slick-dots li.slick-active button:before{opacity:.75;color:#000}.slick-slider{box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-touch-callout:none;-khtml-user-select:none;-ms-touch-action:pan-y;touch-action:pan-y;-webkit-tap-highlight-color:transparent;padding:0 20px}.slick-slider .slick-arrow{position:absolute;top:50%;padding:0;width:15px;height:22px;font-size:0;line-height:0;-webkit-transform:translate(0,-50%);-moz-transform:translate(0,-50%);-ms-transform:translate(0,-50%);transform:translate(0,-50%);color:transparent;border:none;background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMjIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0uMi40QTEgMSAwIDAgMSAxLjYuMmwxMiAxMGExIDEgMCAwIDEgMCAxLjZsLTEyIDEwYTEgMSAwIDAgMS0xLjItMS42TDExLjMzMyAxMSAuNCAxLjhBMSAxIDAgMCAxIC4yLjR6IiBmaWxsPSIjQzRDNEM0Ii8+PC9zdmc+) center no-repeat !important;-webkit-transition:background .3s ease;-moz-transition:background .3s ease;-ms-transition:background .3s ease;transition:background .3s ease}.slick-slider .slick-arrow:after,.slick-slider .slick-arrow:before{content:''}.slick-slider .slick-arrow:hover{background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMjIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0uMi40QTEgMSAwIDAgMSAxLjYuMmwxMiAxMGExIDEgMCAwIDEgMCAxLjZsLTEyIDEwYTEgMSAwIDAgMS0xLjItMS42TDExLjMzMyAxMSAuNCAxLjhBMSAxIDAgMCAxIC4yLjR6IiBmaWxsPSIjMTYxNjE2Ii8+PC9zdmc+) center no-repeat}.slick-slider .slick-arrow.slick-next{right:0}.slick-slider .slick-arrow.slick-prev{left:0;-webkit-transform:rotate(180deg) translate(0,50%);-moz-transform:rotate(180deg) translate(0,50%);-ms-transform:rotate(180deg) translate(0,50%);transform:rotate(180deg) translate(0,50%)}.slick-initialized .slick-slide{float:none!important;display:inline-block!important;height:auto;}.product-items.slick-slider>.slick-list{padding:15px 0}.product-items.slick-slider .slick-slide .product-item{display:block!important;margin:auto!important;max-width:205px}.sidebar.sidebar-additional{width:100%}
|
||||
@@ -0,0 +1 @@
|
||||
define(['./renderer/types','./renderer/layout','../lib/knockout/bootstrap'],function(types,layout){'use strict';return function(data,merge){types.set(data.types);layout(data.components,undefined,true,merge);};});
|
||||
@@ -0,0 +1,10 @@
|
||||
define(['underscore','./strings'],function(_,utils){'use strict';function getIndex(item,container){var index=container.indexOf(item);if(~index){return index;}
|
||||
return _.findIndex(container,function(value){return value&&value.name===item;});}
|
||||
return{toggle:function(arr,value,add){return add?this.add(arr,value):this.remove(arr,value);},remove:function(arr,value){var index=arr.indexOf(value);if(~index){arr.splice(index,1);}
|
||||
return this;},add:function(arr){var values=_.toArray(arguments).slice(1);values.forEach(function(value){if(!~arr.indexOf(value)){arr.push(value);}});return this;},insert:function(item,container,position){var currentIndex=getIndex(item,container),newIndex,target;if(typeof position==='undefined'){position=-1;}else if(typeof position==='string'){position=isNaN(+position)?position:+position;}
|
||||
newIndex=position;if(~currentIndex){target=container.splice(currentIndex,1)[0];if(typeof item==='string'){item=target;}}
|
||||
if(typeof position!=='number'){target=position.after||position.before||position;newIndex=getIndex(target,container);if(~newIndex&&(position.after||newIndex>=currentIndex)){newIndex++;}}
|
||||
if(newIndex<0){newIndex+=container.length+1;}
|
||||
container[newIndex]?container.splice(newIndex,0,item):container[newIndex]=item;return!~currentIndex?item:currentIndex!==newIndex;},formatOffset:function(elems,offset){if(utils.isEmpty(offset)){offset=-1;}
|
||||
offset=+offset;if(offset<0){offset+=elems.length+1;}
|
||||
return offset;}};});
|
||||
@@ -0,0 +1,13 @@
|
||||
define(['ko','jquery','underscore','uiRegistry','./dom-observer','Magento_Ui/js/lib/knockout/extender/bound-nodes','./bindings'],function(ko,$,_,registry,domObserver,boundedNodes){'use strict';function isDomElement(node){return typeof node==='object'&&node.tagName&&node.nodeType;}
|
||||
function parseSelector(str){var data=str.trim().split('->'),result={},componentData;if(data.length===1){if(!~data[0].indexOf(':')){result.selector=data[0];}else{componentData=data[0];}}else{componentData=data[0];result.selector=data[1];}
|
||||
if(componentData){componentData=componentData.split(':');result.component=componentData[0];result.ctx=componentData[1];}
|
||||
_.each(result,function(value,key){result[key]=value.trim();});return result;}
|
||||
function parseData(selector,ctx){var data={};if(arguments.length===2){data.selector=selector;if(isDomElement(ctx)){data.ctx=ctx;}else{data.component=ctx;data.ctx='*';}}else{data=_.isString(selector)?parseSelector(selector):selector;}
|
||||
return data;}
|
||||
function waitComponent(name){var deffer=$.Deferred();if(_.isString(name)){registry.get(name,function(component){deffer.resolve(component);});}else{deffer.resolve(name);}
|
||||
return deffer.promise();}
|
||||
function setRootListener(data,component){boundedNodes.get(component,function(root){if(!$(root).is(data.ctx||'*')){return;}
|
||||
data.selector?domObserver.get(data.selector,data.fn,root):data.fn(root);});}
|
||||
$.async=function(selector,ctx,fn){var args=_.toArray(arguments),data=parseData.apply(null,_.initial(args));data.fn=_.last(args);if(data.component){waitComponent(data.component).then(setRootListener.bind(null,data));}else{domObserver.get(data.selector,data.fn,data.ctx);}};_.extend($.async,{get:function(selector,ctx){var data=parseData.apply(null,arguments),component=data.component,nodes;if(!component){return $(data.selector,data.ctx).toArray();}else if(_.isString(component)){component=registry.get(component);}
|
||||
if(!component){return[];}
|
||||
nodes=boundedNodes.get(component);nodes=$(nodes).filter(data.ctx).toArray();return data.selector?$(data.selector,nodes).toArray():nodes;},remove:function(nodes,fn){domObserver.remove(nodes,fn);},parseSelector:parseSelector});return $;});
|
||||
@@ -0,0 +1 @@
|
||||
define(['jquery','Magento_Ui/js/modal/modal'],function($,modal){'use strict';return{modalWindow:null,createPopUp:function(element){var options={'type':'popup','modalClass':'popup-authentication','focus':'[name=username]','responsive':true,'innerScroll':true,'trigger':'.proceed-to-checkout, .trigger-auth-popup','buttons':[]};this.modalWindow=element;modal(options,$(this.modalWindow));},showModal:function(){$(this.modalWindow).modal('openModal').trigger('contentUpdated');}};});
|
||||
@@ -0,0 +1,5 @@
|
||||
define(['jquery','ko','Magento_Ui/js/form/form','Magento_Customer/js/action/login','Magento_Customer/js/customer-data','Magento_Customer/js/model/authentication-popup','mage/translate','mage/url','Magento_Ui/js/modal/alert','mage/validation'],function($,ko,Component,loginAction,customerData,authenticationPopup,$t,url,alert){'use strict';return Component.extend({registerUrl:window.authenticationPopup.customerRegisterUrl,forgotPasswordUrl:window.authenticationPopup.customerForgotPasswordUrl,autocomplete:window.authenticationPopup.autocomplete,modalWindow:null,isLoading:ko.observable(false),checkoutNewCustomerMsg:window.authenticationPopup.checkoutNewCustomerMsg,checkoutLoginMsg:window.authenticationPopup.checkoutLoginMsg,ssologinUrl:window.authenticationPopup.baseUrl
|
||||
+'mooauth/actions/sendAuthorizationRequest/?relayState='
|
||||
+window.authenticationPopup.baseUrl+'customer/account/login&app_name='
|
||||
+window.authenticationPopup.oAuthProviderName,defaults:{template:'Magento_Customer/authentication-popup'},initialize:function(){var self=this;this._super();url.setBaseUrl(window.authenticationPopup.baseUrl);loginAction.registerLoginCallback(function(){self.isLoading(false);});},setModalElement:function(element){if(authenticationPopup.modalWindow==null){authenticationPopup.createPopUp(element);}},isActive:function(){var customer=customerData.get('customer');return customer()==false;},showModal:function(){if(this.modalWindow){$(this.modalWindow).modal('openModal');}else{alert({content:$t('Guest checkout is disabled.')});}},login:function(formUiElement,event){var loginData={},formElement=$(event.currentTarget),formDataArray=formElement.serializeArray();event.stopPropagation();formDataArray.forEach(function(entry){loginData[entry.name]=entry.value;});if(formElement.validation()&&formElement.validation('isValid')){this.isLoading(true);loginAction(loginData);}
|
||||
return false;}});});
|
||||
@@ -0,0 +1,42 @@
|
||||
/*!
|
||||
* jQuery UI Autocomplete 1.13.2
|
||||
* http://jqueryui.com
|
||||
*
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*/
|
||||
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","./menu","../keycode","../position","../safe-active-element","../version","../widget"],factory);}else{factory(jQuery);}})(function($){"use strict";$.widget("ui.autocomplete",{version:"1.13.2",defaultElement:"<input>",options:{appendTo:null,autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,liveRegionTimer:null,_create:function(){var suppressKeyPress,suppressKeyPressRepeat,suppressInput,nodeName=this.element[0].nodeName.toLowerCase(),isTextarea=nodeName==="textarea",isInput=nodeName==="input";this.isMultiLine=isTextarea||!isInput&&this._isContentEditable(this.element);this.valueMethod=this.element[isTextarea||isInput?"val":"text"];this.isNewMenu=true;this._addClass("ui-autocomplete-input");this.element.attr("autocomplete","off");this._on(this.element,{keydown:function(event){if(this.element.prop("readOnly")){suppressKeyPress=true;suppressInput=true;suppressKeyPressRepeat=true;return;}
|
||||
suppressKeyPress=false;suppressInput=false;suppressKeyPressRepeat=false;var keyCode=$.ui.keyCode;switch(event.keyCode){case keyCode.PAGE_UP:suppressKeyPress=true;this._move("previousPage",event);break;case keyCode.PAGE_DOWN:suppressKeyPress=true;this._move("nextPage",event);break;case keyCode.UP:suppressKeyPress=true;this._keyEvent("previous",event);break;case keyCode.DOWN:suppressKeyPress=true;this._keyEvent("next",event);break;case keyCode.ENTER:if(this.menu.active){suppressKeyPress=true;event.preventDefault();this.menu.select(event);}
|
||||
break;case keyCode.TAB:if(this.menu.active){this.menu.select(event);}
|
||||
break;case keyCode.ESCAPE:if(this.menu.element.is(":visible")){if(!this.isMultiLine){this._value(this.term);}
|
||||
this.close(event);event.preventDefault();}
|
||||
break;default:suppressKeyPressRepeat=true;this._searchTimeout(event);break;}},keypress:function(event){if(suppressKeyPress){suppressKeyPress=false;if(!this.isMultiLine||this.menu.element.is(":visible")){event.preventDefault();}
|
||||
return;}
|
||||
if(suppressKeyPressRepeat){return;}
|
||||
var keyCode=$.ui.keyCode;switch(event.keyCode){case keyCode.PAGE_UP:this._move("previousPage",event);break;case keyCode.PAGE_DOWN:this._move("nextPage",event);break;case keyCode.UP:this._keyEvent("previous",event);break;case keyCode.DOWN:this._keyEvent("next",event);break;}},input:function(event){if(suppressInput){suppressInput=false;event.preventDefault();return;}
|
||||
this._searchTimeout(event);},focus:function(){this.selectedItem=null;this.previous=this._value();},blur:function(event){clearTimeout(this.searching);this.close(event);this._change(event);}});this._initSource();this.menu=$("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().attr({"unselectable":"on"}).menu("instance");this._addClass(this.menu.element,"ui-autocomplete","ui-front");this._on(this.menu.element,{mousedown:function(event){event.preventDefault();},menufocus:function(event,ui){var label,item;if(this.isNewMenu){this.isNewMenu=false;if(event.originalEvent&&/^mouse/.test(event.originalEvent.type)){this.menu.blur();this.document.one("mousemove",function(){$(event.target).trigger(event.originalEvent);});return;}}
|
||||
item=ui.item.data("ui-autocomplete-item");if(false!==this._trigger("focus",event,{item:item})){if(event.originalEvent&&/^key/.test(event.originalEvent.type)){this._value(item.value);}}
|
||||
label=ui.item.attr("aria-label")||item.value;if(label&&String.prototype.trim.call(label).length){clearTimeout(this.liveRegionTimer);this.liveRegionTimer=this._delay(function(){this.liveRegion.html($("<div>").text(label));},100);}},menuselect:function(event,ui){var item=ui.item.data("ui-autocomplete-item"),previous=this.previous;if(this.element[0]!==$.ui.safeActiveElement(this.document[0])){this.element.trigger("focus");this.previous=previous;this._delay(function(){this.previous=previous;this.selectedItem=item;});}
|
||||
if(false!==this._trigger("select",event,{item:item})){this._value(item.value);}
|
||||
this.term=this._value();this.close(event);this.selectedItem=item;}});this.liveRegion=$("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body);this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible");this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete");}});},_destroy:function(){clearTimeout(this.searching);this.element.removeAttr("autocomplete");this.menu.element.remove();this.liveRegion.remove();},_setOption:function(key,value){this._super(key,value);if(key==="source"){this._initSource();}
|
||||
if(key==="appendTo"){this.menu.element.appendTo(this._appendTo());}
|
||||
if(key==="disabled"&&value&&this.xhr){this.xhr.abort();}},_isEventTargetInWidget:function(event){var menuElement=this.menu.element[0];return event.target===this.element[0]||event.target===menuElement||$.contains(menuElement,event.target);},_closeOnClickOutside:function(event){if(!this._isEventTargetInWidget(event)){this.close();}},_appendTo:function(){var element=this.options.appendTo;if(element){element=element.jquery||element.nodeType?$(element):this.document.find(element).eq(0);}
|
||||
if(!element||!element[0]){element=this.element.closest(".ui-front, dialog");}
|
||||
if(!element.length){element=this.document[0].body;}
|
||||
return element;},_initSource:function(){var array,url,that=this;if(Array.isArray(this.options.source)){array=this.options.source;this.source=function(request,response){response($.ui.autocomplete.filter(array,request.term));};}else if(typeof this.options.source==="string"){url=this.options.source;this.source=function(request,response){if(that.xhr){that.xhr.abort();}
|
||||
that.xhr=$.ajax({url:url,data:request,dataType:"json",success:function(data){response(data);},error:function(){response([]);}});};}else{this.source=this.options.source;}},_searchTimeout:function(event){clearTimeout(this.searching);this.searching=this._delay(function(){var equalValues=this.term===this._value(),menuVisible=this.menu.element.is(":visible"),modifierKey=event.altKey||event.ctrlKey||event.metaKey||event.shiftKey;if(!equalValues||(equalValues&&!menuVisible&&!modifierKey)){this.selectedItem=null;this.search(null,event);}},this.options.delay);},search:function(value,event){value=value!=null?value:this._value();this.term=this._value();if(value.length<this.options.minLength){return this.close(event);}
|
||||
if(this._trigger("search",event)===false){return;}
|
||||
return this._search(value);},_search:function(value){this.pending++;this._addClass("ui-autocomplete-loading");this.cancelSearch=false;this.source({term:value},this._response());},_response:function(){var index=++this.requestIndex;return function(content){if(index===this.requestIndex){this.__response(content);}
|
||||
this.pending--;if(!this.pending){this._removeClass("ui-autocomplete-loading");}}.bind(this);},__response:function(content){if(content){content=this._normalize(content);}
|
||||
this._trigger("response",null,{content:content});if(!this.options.disabled&&content&&content.length&&!this.cancelSearch){this._suggest(content);this._trigger("open");}else{this._close();}},close:function(event){this.cancelSearch=true;this._close(event);},_close:function(event){this._off(this.document,"mousedown");if(this.menu.element.is(":visible")){this.menu.element.hide();this.menu.blur();this.isNewMenu=true;this._trigger("close",event);}},_change:function(event){if(this.previous!==this._value()){this._trigger("change",event,{item:this.selectedItem});}},_normalize:function(items){if(items.length&&items[0].label&&items[0].value){return items;}
|
||||
return $.map(items,function(item){if(typeof item==="string"){return{label:item,value:item};}
|
||||
return $.extend({},item,{label:item.label||item.value,value:item.value||item.label});});},_suggest:function(items){var ul=this.menu.element.empty();this._renderMenu(ul,items);this.isNewMenu=true;this.menu.refresh();ul.show();this._resizeMenu();ul.position($.extend({of:this.element},this.options.position));if(this.options.autoFocus){this.menu.next();}
|
||||
this._on(this.document,{mousedown:"_closeOnClickOutside"});},_resizeMenu:function(){var ul=this.menu.element;ul.outerWidth(Math.max(ul.width("").outerWidth()+1,this.element.outerWidth()));},_renderMenu:function(ul,items){var that=this;$.each(items,function(index,item){that._renderItemData(ul,item);});},_renderItemData:function(ul,item){return this._renderItem(ul,item).data("ui-autocomplete-item",item);},_renderItem:function(ul,item){return $("<li>").append($("<div>").text(item.label)).appendTo(ul);},_move:function(direction,event){if(!this.menu.element.is(":visible")){this.search(null,event);return;}
|
||||
if(this.menu.isFirstItem()&&/^previous/.test(direction)||this.menu.isLastItem()&&/^next/.test(direction)){if(!this.isMultiLine){this._value(this.term);}
|
||||
this.menu.blur();return;}
|
||||
this.menu[direction](event);},widget:function(){return this.menu.element;},_value:function(){return this.valueMethod.apply(this.element,arguments);},_keyEvent:function(keyEvent,event){if(!this.isMultiLine||this.menu.element.is(":visible")){this._move(keyEvent,event);event.preventDefault();}},_isContentEditable:function(element){if(!element.length){return false;}
|
||||
var editable=element.prop("contentEditable");if(editable==="inherit"){return this._isContentEditable(element.parent());}
|
||||
return editable==="true";}});$.extend($.ui.autocomplete,{escapeRegex:function(value){return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");},filter:function(array,term){var matcher=new RegExp($.ui.autocomplete.escapeRegex(term),"i");return $.grep(array,function(value){return matcher.test(value.label||value.value||value);});}});$.widget("ui.autocomplete",$.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(amount){return amount+(amount>1?" results are":" result is")+" available, use up and down arrow keys to navigate.";}}},__response:function(content){var message;this._superApply(arguments);if(this.options.disabled||this.cancelSearch){return;}
|
||||
if(content&&content.length){message=this.options.messages.results(content.length);}else{message=this.options.messages.noResults;}
|
||||
clearTimeout(this.liveRegionTimer);this.liveRegionTimer=this._delay(function(){this.liveRegion.html($("<div>").text(message));},100);}});return $.ui.autocomplete;});
|
||||
@@ -0,0 +1,2 @@
|
||||
define(['ko','jquery','../template/renderer'],function(ko,$,renderer){'use strict';function onFocus(e){e.target.select();}
|
||||
ko.bindingHandlers.autoselect={init:function(element,valueAccessor){var enabled=ko.unwrap(valueAccessor());if(enabled!==false){$(element).on('focus',onFocus);}}};renderer.addAttribute('autoselect');});
|
||||
@@ -0,0 +1,4 @@
|
||||
define(['ko','underscore','mage/apply/main','../template/renderer'],function(ko,_,mage,renderer){'use strict';function setHtml(el,html){ko.utils.emptyDomNode(el);html=ko.utils.unwrapObservable(html);if(!_.isNull(html)&&!_.isUndefined(html)){if(!_.isString(html)){html=html.toString();}
|
||||
el.innerHTML=html;}}
|
||||
function applyComponents(el,ctx){ko.utils.arrayForEach(el.childNodes,ko.cleanNode);ko.applyBindingsToDescendants(ctx,el);mage.apply();}
|
||||
ko.bindingHandlers.bindHtml={init:function(){return{controlsDescendantBindings:true};},update:function(el,valueAccessor,allBindings,viewModel,bindingContext){setHtml(el,valueAccessor());applyComponents(el,bindingContext);}};renderer.addAttribute('bindHtml');});
|
||||
@@ -0,0 +1,6 @@
|
||||
define(['ko','jquery','underscore'],function(ko,$,_){'use strict';function isDomElement(node){return typeof node==='object'&&node.tagName&&node.nodeType;}
|
||||
function normalize(nodes){var result;nodes=_.toArray(nodes);result=nodes.slice();nodes.forEach(function(node){if(node.nodeType===8){result=!ko.virtualElements.hasBindingValue(node)?_.without(result,node):_.difference(result,ko.virtualElements.childNodes(node));}});return result;}
|
||||
$.fn.extendCtx=function(){var nodes=normalize(this),extenders=_.toArray(arguments);nodes.forEach(function(node){var ctx=ko.contextFor(node),data=[ctx].concat(extenders);_.extend.apply(_,data);});return this;};$.fn.applyBindings=function(ctx){var nodes=normalize(this),nodeCtx;if(isDomElement(ctx)){ctx=ko.contextFor(ctx);}
|
||||
nodes.forEach(function(node){nodeCtx=ctx||ko.contextFor(node);ko.applyBindings(nodeCtx,node);});return this;};$.fn.bindings=function(data,ctx){var nodes=normalize(this),bindings=data,nodeCtx;if(isDomElement(ctx)){ctx=ko.contextFor(ctx);}
|
||||
nodes.forEach(function(node){nodeCtx=ctx||ko.contextFor(node);if(_.isFunction(data)){bindings=data(nodeCtx,node);}
|
||||
ko.applyBindingsToNode(node,bindings,nodeCtx);});return this;};});
|
||||
@@ -0,0 +1,7 @@
|
||||
define(['ko','jquery','Magento_Ui/js/lib/knockout/template/loader','mage/template'],function(ko,$,templateLoader,template){'use strict';var blockLoaderTemplatePath='ui/block-loader',blockContentLoadingClass='_block-content-loading',blockLoader,blockLoaderClass,blockLoaderElement=$.Deferred(),loaderImageHref=$.Deferred();templateLoader.loadTemplate(blockLoaderTemplatePath).done(function(blockLoaderTemplate){loaderImageHref.done(function(loaderHref){blockLoader=template(blockLoaderTemplate.trim(),{loaderImageHref:loaderHref});blockLoader=$(blockLoader);blockLoaderClass='.'+blockLoader.attr('class');blockLoaderElement.resolve();});});function isLoadingClassRequired(element){var position=element.css('position');if(position==='absolute'||position==='fixed'){return false;}
|
||||
return true;}
|
||||
function addBlockLoader(element){element.find(':focus').trigger('blur');element.find('input:disabled, select:disabled').addClass('_disabled');element.find('input, select').prop('disabled',true);if(isLoadingClassRequired(element)){element.addClass(blockContentLoadingClass);}
|
||||
element.append(blockLoader.clone());}
|
||||
function removeBlockLoader(element){if(!element.has(blockLoaderClass).length){return;}
|
||||
element.find(blockLoaderClass).remove();element.find('input:not("._disabled"), select:not("._disabled")').prop('disabled',false);element.find('input:disabled, select:disabled').removeClass('_disabled');element.removeClass(blockContentLoadingClass);}
|
||||
return function(loaderHref){loaderImageHref.resolve(loaderHref);ko.bindingHandlers.blockLoader={update:function(element,displayBlockLoader){element=$(element);if(ko.unwrap(displayBlockLoader())){blockLoaderElement.done(addBlockLoader(element));}else{blockLoaderElement.done(removeBlockLoader(element));}}};};});
|
||||
@@ -0,0 +1 @@
|
||||
define(['ko','./template/engine','knockoutjs/knockout-es5','./bindings/bootstrap','./extender/observable_array','./extender/bound-nodes','domReady!'],function(ko,templateEngine){'use strict';ko.uid=0;ko.setTemplateEngine(templateEngine);ko.applyBindings();});
|
||||
@@ -0,0 +1 @@
|
||||
define(function(require){'use strict';var renderer=require('../template/renderer');renderer.addAttribute('repeat',renderer.handlers.wrapAttribute);renderer.addAttribute('outerfasteach',{binding:'fastForEach',handler:renderer.handlers.wrapAttribute});renderer.addNode('repeat').addNode('fastForEach');return{resizable:require('./resizable'),i18n:require('./i18n'),scope:require('./scope'),range:require('./range'),mageInit:require('./mage-init'),keyboard:require('./keyboard'),optgroup:require('./optgroup'),afterRender:require('./after-render'),autoselect:require('./autoselect'),datepicker:require('./datepicker'),outerClick:require('./outer_click'),fadeVisible:require('./fadeVisible'),collapsible:require('./collapsible'),staticChecked:require('./staticChecked'),simpleChecked:require('./simple-checked'),bindHtml:require('./bind-html'),tooltip:require('./tooltip'),repeat:require('knockoutjs/knockout-repeat'),fastForEach:require('knockoutjs/knockout-fast-foreach'),colorPicker:require('./color-picker')};});
|
||||
@@ -0,0 +1 @@
|
||||
define(['jquery','mage/apply/main','Magento_Ui/js/lib/knockout/bootstrap'],function($,mage){'use strict';$.ajaxSetup({cache:false});setTimeout(mage.apply);});
|
||||
@@ -0,0 +1,15 @@
|
||||
define(['ko','underscore','mage/utils/wrapper','uiEvents'],function(ko,_,wrapper,Events){'use strict';var nodesMap=new WeakMap();function getBounded(model){return nodesMap.get(model);}
|
||||
function addBounded(model,node){var nodes=getBounded(model),isRoot;if(!nodes){nodesMap.set(model,[node]);Events.trigger.call(model,'addNode',node);return;}
|
||||
isRoot=nodes.every(function(bounded){return!bounded.contains(node);});if(isRoot){nodes.push(node);Events.trigger.call(model,'addNode',node);}}
|
||||
function removeBounded(model,node){var nodes=getBounded(model),index;if(!nodes){return;}
|
||||
index=nodes.indexOf(node);if(~index){nodes.splice(index,0);Events.trigger.call(model,'removeNode',node);}
|
||||
if(!nodes.length){nodesMap.delete(model);}}
|
||||
function getElement(node,data){var elem;while(node.nextElementSibling){node=node.nextElementSibling;if(node.nodeType===1&&ko.dataFor(node)===data){elem=node;break;}}
|
||||
return elem;}
|
||||
wrapper.extend(ko,{applyBindings:function(orig,ctx,node){var result=orig(),data=ctx&&(ctx.$data||ctx);if(node&&node.nodeType===8){node=getElement(node,data);}
|
||||
if(!node||node.nodeType!==1){return result;}
|
||||
if(data&&data.registerNodes){addBounded(data,node);}
|
||||
return result;},cleanNode:function(orig,node){var result=orig(),data;if(node.nodeType!==1){return result;}
|
||||
data=ko.dataFor(node);if(data&&data.registerNodes){removeBounded(data,node);}
|
||||
return result;}});return{get:function(model,callback){var nodes=getBounded(model)||[];if(!_.isFunction(callback)){return nodes;}
|
||||
nodes.forEach(function(node){callback(node);});this.add.apply(this,arguments);},add:function(model){var args=_.toArray(arguments).slice(1);args.unshift('addNode');Events.on.apply(model,args);},remove:function(model){var args=_.toArray(arguments).slice(1);args.unshift('removeNode');Events.on.apply(model,args);},off:function(model){var args=_.toArray(arguments).slice(1);Events.off.apply(model,args);}};});
|
||||
@@ -0,0 +1,44 @@
|
||||
/*!
|
||||
* jQuery UI Button 1.13.2
|
||||
* http://jqueryui.com
|
||||
*
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*/
|
||||
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","./controlgroup","./checkboxradio","../keycode","../widget"],factory);}else{factory(jQuery);}})(function($){"use strict";$.widget("ui.button",{version:"1.13.2",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:true},_getCreateOptions:function(){var disabled,options=this._super()||{};this.isInput=this.element.is("input");disabled=this.element[0].disabled;if(disabled!=null){options.disabled=disabled;}
|
||||
this.originalLabel=this.isInput?this.element.val():this.element.html();if(this.originalLabel){options.label=this.originalLabel;}
|
||||
return options;},_create:function(){if(!this.option.showLabel&!this.options.icon){this.options.showLabel=true;}
|
||||
if(this.options.disabled==null){this.options.disabled=this.element[0].disabled||false;}
|
||||
this.hasTitle=!!this.element.attr("title");if(this.options.label&&this.options.label!==this.originalLabel){if(this.isInput){this.element.val(this.options.label);}else{this.element.html(this.options.label);}}
|
||||
this._addClass("ui-button","ui-widget");this._setOption("disabled",this.options.disabled);this._enhance();if(this.element.is("a")){this._on({"keyup":function(event){if(event.keyCode===$.ui.keyCode.SPACE){event.preventDefault();if(this.element[0].click){this.element[0].click();}else{this.element.trigger("click");}}}});}},_enhance:function(){if(!this.element.is("button")){this.element.attr("role","button");}
|
||||
if(this.options.icon){this._updateIcon("icon",this.options.icon);this._updateTooltip();}},_updateTooltip:function(){this.title=this.element.attr("title");if(!this.options.showLabel&&!this.title){this.element.attr("title",this.options.label);}},_updateIcon:function(option,value){var icon=option!=="iconPosition",position=icon?this.options.iconPosition:value,displayBlock=position==="top"||position==="bottom";if(!this.icon){this.icon=$("<span>");this._addClass(this.icon,"ui-button-icon","ui-icon");if(!this.options.showLabel){this._addClass("ui-button-icon-only");}}else if(icon){this._removeClass(this.icon,null,this.options.icon);}
|
||||
if(icon){this._addClass(this.icon,null,value);}
|
||||
this._attachIcon(position);if(displayBlock){this._addClass(this.icon,null,"ui-widget-icon-block");if(this.iconSpace){this.iconSpace.remove();}}else{if(!this.iconSpace){this.iconSpace=$("<span> </span>");this._addClass(this.iconSpace,"ui-button-icon-space");}
|
||||
this._removeClass(this.icon,null,"ui-wiget-icon-block");this._attachIconSpace(position);}},_destroy:function(){this.element.removeAttr("role");if(this.icon){this.icon.remove();}
|
||||
if(this.iconSpace){this.iconSpace.remove();}
|
||||
if(!this.hasTitle){this.element.removeAttr("title");}},_attachIconSpace:function(iconPosition){this.icon[/^(?:end|bottom)/.test(iconPosition)?"before":"after"](this.iconSpace);},_attachIcon:function(iconPosition){this.element[/^(?:end|bottom)/.test(iconPosition)?"append":"prepend"](this.icon);},_setOptions:function(options){var newShowLabel=options.showLabel===undefined?this.options.showLabel:options.showLabel,newIcon=options.icon===undefined?this.options.icon:options.icon;if(!newShowLabel&&!newIcon){options.showLabel=true;}
|
||||
this._super(options);},_setOption:function(key,value){if(key==="icon"){if(value){this._updateIcon(key,value);}else if(this.icon){this.icon.remove();if(this.iconSpace){this.iconSpace.remove();}}}
|
||||
if(key==="iconPosition"){this._updateIcon(key,value);}
|
||||
if(key==="showLabel"){this._toggleClass("ui-button-icon-only",null,!value);this._updateTooltip();}
|
||||
if(key==="label"){if(this.isInput){this.element.val(value);}else{this.element.html(value);if(this.icon){this._attachIcon(this.options.iconPosition);this._attachIconSpace(this.options.iconPosition);}}}
|
||||
this._super(key,value);if(key==="disabled"){this._toggleClass(null,"ui-state-disabled",value);this.element[0].disabled=value;if(value){this.element.trigger("blur");}}},refresh:function(){var isDisabled=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");if(isDisabled!==this.options.disabled){this._setOptions({disabled:isDisabled});}
|
||||
this._updateTooltip();}});if($.uiBackCompat!==false){$.widget("ui.button",$.ui.button,{options:{text:true,icons:{primary:null,secondary:null}},_create:function(){if(this.options.showLabel&&!this.options.text){this.options.showLabel=this.options.text;}
|
||||
if(!this.options.showLabel&&this.options.text){this.options.text=this.options.showLabel;}
|
||||
if(!this.options.icon&&(this.options.icons.primary||this.options.icons.secondary)){if(this.options.icons.primary){this.options.icon=this.options.icons.primary;}else{this.options.icon=this.options.icons.secondary;this.options.iconPosition="end";}}else if(this.options.icon){this.options.icons.primary=this.options.icon;}
|
||||
this._super();},_setOption:function(key,value){if(key==="text"){this._super("showLabel",value);return;}
|
||||
if(key==="showLabel"){this.options.text=value;}
|
||||
if(key==="icon"){this.options.icons.primary=value;}
|
||||
if(key==="icons"){if(value.primary){this._super("icon",value.primary);this._super("iconPosition","beginning");}else if(value.secondary){this._super("icon",value.secondary);this._super("iconPosition","end");}}
|
||||
this._superApply(arguments);}});$.fn.button=(function(orig){return function(options){var isMethodCall=typeof options==="string";var args=Array.prototype.slice.call(arguments,1);var returnValue=this;if(isMethodCall){if(!this.length&&options==="instance"){returnValue=undefined;}else{this.each(function(){var methodValue;var type=$(this).attr("type");var name=type!=="checkbox"&&type!=="radio"?"button":"checkboxradio";var instance=$.data(this,"ui-"+name);if(options==="instance"){returnValue=instance;return false;}
|
||||
if(!instance){return $.error("cannot call methods on button"+" prior to initialization; "+"attempted to call method '"+options+"'");}
|
||||
if(typeof instance[options]!=="function"||options.charAt(0)==="_"){return $.error("no such method '"+options+"' for button"+" widget instance");}
|
||||
methodValue=instance[options].apply(instance,args);if(methodValue!==instance&&methodValue!==undefined){returnValue=methodValue&&methodValue.jquery?returnValue.pushStack(methodValue.get()):methodValue;return false;}});}}else{if(args.length){options=$.widget.extend.apply(null,[options].concat(args));}
|
||||
this.each(function(){var type=$(this).attr("type");var name=type!=="checkbox"&&type!=="radio"?"button":"checkboxradio";var instance=$.data(this,"ui-"+name);if(instance){instance.option(options||{});if(instance._init){instance._init();}}else{if(name==="button"){orig.call($(this),options);return;}
|
||||
$(this).checkboxradio($.extend({icon:false},options));}});}
|
||||
return returnValue;};})($.fn.button);$.fn.buttonset=function(){if(!$.ui.controlgroup){$.error("Controlgroup widget missing");}
|
||||
if(arguments[0]==="option"&&arguments[1]==="items"&&arguments[2]){return this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]);}
|
||||
if(arguments[0]==="option"&&arguments[1]==="items"){return this.controlgroup.apply(this,[arguments[0],"items.button"]);}
|
||||
if(typeof arguments[0]==="object"&&arguments[0].items){arguments[0].items={button:arguments[0].items};}
|
||||
return this.controlgroup.apply(this,arguments);};}
|
||||
return $.ui.button;});
|
||||
@@ -0,0 +1 @@
|
||||
define(function(){'use strict';return{'reset':'#reset','save':'#save','saveAndContinue':'#save_and_continue'};});
|
||||
@@ -0,0 +1 @@
|
||||
.ui-datepicker{display:none;z-index:999999 !important}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em;cursor:pointer}.ui-datepicker .ui-datepicker-next-hover span,.ui-datepicker .ui-datepicker-prev-hover span{border-color:transparent #ff8400 transparent transparent}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-5px;font-size:0px;width:0;height:0;border:solid;border-width:5px 8px 5px 0;border-color:transparent #ff9635 transparent transparent}.ui-datepicker .ui-datepicker-next span{margin-left:0;top:50%;margin-top:-5px;border-width:5px 0 5px 8px;border-color:transparent transparent transparent #ff9635}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month-year{width:100%}.ui-datepicker table{width:100%;font-size:.9em}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:4px;text-align:right;text-decoration:none;color:#000}.ui-datepicker .ui-datepicker-buttonpane button{float:right}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current{float:right}.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-timepicker-div .ui-widget-header{margin-bottom:8px}.ui-timepicker-div dl{text-align:left}.ui-timepicker-div dl dt{height:25px;margin-bottom:-22px}.ui-timepicker-div dl .ui_tpicker_time_label{margin-bottom:-25px}.ui-timepicker-div dl dd{margin:0 10px 10px 65px}.ui-timepicker-div td{font-size:90%}.ui-tpicker-grid-label{background:0 0;border:none;margin:0;padding:0}.ui-datepicker{padding:15px;border:#fff 4px solid;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#efefef;-webkit-box-shadow:5px 5px 10px 0px rgba(0,0,0,.35);box-shadow:5px 5px 10px 0px rgba(0,0,0,.35)}.ui-datepicker .ui-datepicker-header{background:0 0;border:none;padding-bottom:10px}.ui-datepicker .ui-datepicker-title .ui-datepicker-month{width:47%;margin-right:6%}.ui-datepicker .ui-datepicker-title .ui-datepicker-year{width:47%}.ui-datepicker .ui-datepicker-calendar td{border:#cfcfcf 1px solid}.ui-datepicker .ui-datepicker-calendar td a{padding:4px;display:block}.ui-datepicker .ui-datepicker-calendar td .ui-state-hover{background:#f9eae7}.ui-datepicker .ui-datepicker-calendar{background:#fff;border:#cfcfcf 1px solid;border-collapse:collapse}.ui-datepicker .ui-datepicker-calendar th{background:#efefef;border:#cfcfcf 1px solid;padding:4px;text-transform:uppercase}.ui-datepicker .ui-datepicker-calendar .ui-datepicker-week-col{text-align:center;border:#cfcfcf 1px solid}.ui-datepicker{width:auto}.ui-datepicker .ui-datepicker-calendar .ui-datepicker-today{background:#f3d7d2}.ui-datepicker .ui-datepicker-calendar .ui-state-active{background:#ffdf66}.ui-timepicker-div .ui-widget-header{margin-bottom:8px}.ui-timepicker-div dl{text-align:left}.ui-timepicker-div dl dd{margin:0 0 10px 65px}.ui-timepicker-div td{font-size:90%}.ui-tpicker-grid-label{background:0 0;border:none;margin:0;padding:0}.ui-slider{position:relative;text-align:left}.ui-slider-horizontal .ui-slider-handle{margin-left:-5px}.ui-slider .ui-slider-handle{position:absolute;z-index:2;cursor:default}.ui-slider-horizontal{height:10px;-webkit-border-radius:10px;border-radius:10px;border:none;background:#dadada}.ui-slider-handle{height:10px;width:10px;-webkit-border-radius:10px;border-radius:10px;background:#f98b25;display:block;position:absolute}.ui-timepicker-div{padding:10px 0 5px}.ui-datepicker .ui-datepicker-buttonpane{overflow:hidden;padding-top:10px;border-top:#cfcfcf 1px solid}.ui-datepicker .ui-datepicker-calendar .ui-state-disabled{background:#f9f9f9}.ui-datepicker .ui-datepicker-calendar .ui-state-disabled span{color:#959595}.ui-datepicker-cover{position:absolute;z-index:-1;filter:mask();top:-4px;left:-4px;width:200px;height:200px}.ui-timepicker-div .ui_tpicker_unit_hide{display:none}
|
||||
@@ -0,0 +1 @@
|
||||
define(['jquery','ko','Magento_Captcha/js/action/refresh'],function($,ko,refreshAction){'use strict';return function(captchaData){return{formId:captchaData.formId,imageSource:ko.observable(captchaData.imageSrc),visibility:ko.observable(false),captchaValue:ko.observable(null),isRequired:ko.observable(captchaData.isRequired),isCaseSensitive:captchaData.isCaseSensitive,imageHeight:captchaData.imageHeight,refreshUrl:captchaData.refreshUrl,isLoading:ko.observable(false),timestamp:null,getFormId:function(){return this.formId;},setFormId:function(formId){this.formId=formId;},getIsVisible:function(){return this.visibility();},setIsVisible:function(flag){this.visibility(flag);},getIsRequired:function(){return this.isRequired();},setIsRequired:function(flag){this.isRequired(flag);},getIsCaseSensitive:function(){return this.isCaseSensitive;},setIsCaseSensitive:function(flag){this.isCaseSensitive=flag;},getImageHeight:function(){return this.imageHeight;},setImageHeight:function(height){this.imageHeight=height;},getImageSource:function(){return this.imageSource;},setImageSource:function(imageSource){this.imageSource(imageSource);},getRefreshUrl:function(){return this.refreshUrl;},setRefreshUrl:function(url){this.refreshUrl=url;},getCaptchaValue:function(){return this.captchaValue;},setCaptchaValue:function(value){this.captchaValue(value);},refresh:function(){var refresh,self=this;this.isLoading(true);refresh=refreshAction(this.getRefreshUrl(),this.getFormId(),this.getImageSource());$.when(refresh).done(function(){self.isLoading(false);});}};};});
|
||||
@@ -0,0 +1 @@
|
||||
define(['jquery'],function($){'use strict';var captchaList=[];return{add:function(captcha){captchaList.push(captcha);},getCaptchaByFormId:function(formId){var captcha=null;$.each(captchaList,function(key,item){if(formId===item.formId){captcha=item;return false;}});return captcha;},getCaptchaList:function(){return captchaList;}};});
|
||||
@@ -0,0 +1 @@
|
||||
define(['uiComponent'],function(Component){'use strict';return Component.extend({getProductNameUnsanitizedHtml:function(productName){return productName;},getOptionValueUnsanitizedHtml:function(optionValue){return optionValue;}});});
|
||||
@@ -0,0 +1,2 @@
|
||||
define(['underscore','jquery','Magento_ConfigurableProduct/js/product/view/product-info-resolver'],function(_,$,productInfoResolver){'use strict';return function(widget){$.widget('mage.catalogAddToCart',widget,{ajaxSubmit:function(form){var isConfigurable=!!_.find(form.serializeArray(),function(item){return item.name.indexOf('super_attribute')!==-1;});if(isConfigurable){this.options.productInfoResolver=productInfoResolver;}
|
||||
return this._super(form);}});return $.mage.catalogAddToCart;};});
|
||||
@@ -0,0 +1,9 @@
|
||||
define(['jquery','mage/translate','underscore','Magento_Catalog/js/product/view/product-ids-resolver','Magento_Catalog/js/product/view/product-info-resolver','jquery-ui-modules/widget'],function($,$t,_,idsResolver,productInfoResolver){'use strict';$.widget('mage.catalogAddToCart',{options:{processStart:null,processStop:null,bindSubmit:true,minicartSelector:'[data-block="minicart"]',messagesSelector:'[data-placeholder="messages"]',productStatusSelector:'.stock.available',addToCartButtonSelector:'.action.tocart',addToCartButtonDisabledClass:'disabled',addToCartButtonTextWhileAdding:'',addToCartButtonTextAdded:'',addToCartButtonTextDefault:'',productInfoResolver:productInfoResolver},_create:function(){if(this.options.bindSubmit){this._bindSubmit();}
|
||||
$(this.options.addToCartButtonSelector).prop('disabled',false);},_bindSubmit:function(){var self=this;if(this.element.data('catalog-addtocart-initialized')){return;}
|
||||
this.element.data('catalog-addtocart-initialized',1);this.element.on('submit',function(e){e.preventDefault();self.submitForm($(this));});},_redirect:function(url){var urlParts,locationParts,forceReload;urlParts=url.split('#');locationParts=window.location.href.split('#');forceReload=urlParts[0]===locationParts[0];window.location.assign(url);if(forceReload){window.location.reload();}},isLoaderEnabled:function(){return this.options.processStart&&this.options.processStop;},submitForm:function(form){this.ajaxSubmit(form);},ajaxSubmit:function(form){var self=this,productIds=idsResolver(form),productInfo=self.options.productInfoResolver(form),formData;$(self.options.minicartSelector).trigger('contentLoading');self.disableAddToCartButton(form);formData=new FormData(form[0]);$.ajax({url:form.prop('action'),data:formData,type:'post',dataType:'json',cache:false,contentType:false,processData:false,beforeSend:function(){if(self.isLoaderEnabled()){$('body').trigger(self.options.processStart);}},success:function(res){var eventData,parameters;$(document).trigger('ajax:addToCart',{'sku':form.data().productSku,'productIds':productIds,'productInfo':productInfo,'form':form,'response':res});if(self.isLoaderEnabled()){$('body').trigger(self.options.processStop);}
|
||||
if(res.backUrl){eventData={'form':form,'redirectParameters':[]};$('body').trigger('catalogCategoryAddToCartRedirect',eventData);if(eventData.redirectParameters.length>0&&window.location.href.split(/[?#]/)[0]===res.backUrl){parameters=res.backUrl.split('#');parameters.push(eventData.redirectParameters.join('&'));res.backUrl=parameters.join('#');}
|
||||
self._redirect(res.backUrl);return;}
|
||||
if(res.messages){$(self.options.messagesSelector).html(res.messages);}
|
||||
if(res.minicart){$(self.options.minicartSelector).replaceWith(res.minicart);$(self.options.minicartSelector).trigger('contentUpdated');}
|
||||
if(res.product&&res.product.statusText){$(self.options.productStatusSelector).removeClass('available').addClass('unavailable').find('span').html(res.product.statusText);}
|
||||
self.enableAddToCartButton(form);},error:function(res){$(document).trigger('ajax:addToCart:error',{'sku':form.data().productSku,'productIds':productIds,'productInfo':productInfo,'form':form,'response':res});},complete:function(res){if(res.state()==='rejected'){location.reload();}}});},disableAddToCartButton:function(form){var addToCartButtonTextWhileAdding=this.options.addToCartButtonTextWhileAdding||$t('Adding...'),addToCartButton=$(form).find(this.options.addToCartButtonSelector);addToCartButton.addClass(this.options.addToCartButtonDisabledClass);addToCartButton.find('span').text(addToCartButtonTextWhileAdding);addToCartButton.prop('title',addToCartButtonTextWhileAdding);},enableAddToCartButton:function(form){var addToCartButtonTextAdded=this.options.addToCartButtonTextAdded||$t('Added'),self=this,addToCartButton=$(form).find(this.options.addToCartButtonSelector);addToCartButton.find('span').text(addToCartButtonTextAdded);addToCartButton.prop('title',addToCartButtonTextAdded);setTimeout(function(){var addToCartButtonTextDefault=self.options.addToCartButtonTextDefault||$t('Add to Cart');addToCartButton.removeClass(self.options.addToCartButtonDisabledClass);addToCartButton.find('span').text(addToCartButtonTextDefault);addToCartButton.prop('title',addToCartButtonTextDefault);},1000);}});return $.mage.catalogAddToCart;});
|
||||
@@ -0,0 +1,28 @@
|
||||
/*!
|
||||
* jQuery UI Checkboxradio 1.13.2
|
||||
* http://jqueryui.com
|
||||
*
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*/
|
||||
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","../form-reset-mixin","../labels","../widget"],factory);}else{factory(jQuery);}})(function($){"use strict";$.widget("ui.checkboxradio",[$.ui.formResetMixin,{version:"1.13.2",options:{disabled:null,label:null,icon:true,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var disabled,labels,labelContents;var options=this._super()||{};this._readType();labels=this.element.labels();this.label=$(labels[labels.length-1]);if(!this.label.length){$.error("No label found for checkboxradio widget");}
|
||||
this.originalLabel="";labelContents=this.label.contents().not(this.element[0]);if(labelContents.length){this.originalLabel+=labelContents.clone().wrapAll("<div></div>").parent().html();}
|
||||
if(this.originalLabel){options.label=this.originalLabel;}
|
||||
disabled=this.element[0].disabled;if(disabled!=null){options.disabled=disabled;}
|
||||
return options;},_create:function(){var checked=this.element[0].checked;this._bindFormResetHandler();if(this.options.disabled==null){this.options.disabled=this.element[0].disabled;}
|
||||
this._setOption("disabled",this.options.disabled);this._addClass("ui-checkboxradio","ui-helper-hidden-accessible");this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget");if(this.type==="radio"){this._addClass(this.label,"ui-checkboxradio-radio-label");}
|
||||
if(this.options.label&&this.options.label!==this.originalLabel){this._updateLabel();}else if(this.originalLabel){this.options.label=this.originalLabel;}
|
||||
this._enhance();if(checked){this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active");}
|
||||
this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus");},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus");}});},_readType:function(){var nodeName=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type;if(nodeName!=="input"||!/radio|checkbox/.test(this.type)){$.error("Can't create checkboxradio on element.nodeName="+nodeName+" and element.type="+this.type);}},_enhance:function(){this._updateIcon(this.element[0].checked);},widget:function(){return this.label;},_getRadioGroup:function(){var group;var name=this.element[0].name;var nameSelector="input[name='"+$.escapeSelector(name)+"']";if(!name){return $([]);}
|
||||
if(this.form.length){group=$(this.form[0].elements).filter(nameSelector);}else{group=$(nameSelector).filter(function(){return $(this)._form().length===0;});}
|
||||
return group.not(this.element);},_toggleClasses:function(){var checked=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",checked);if(this.options.icon&&this.type==="checkbox"){this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",checked)._toggleClass(this.icon,null,"ui-icon-blank",!checked);}
|
||||
if(this.type==="radio"){this._getRadioGroup().each(function(){var instance=$(this).checkboxradio("instance");if(instance){instance._removeClass(instance.label,"ui-checkboxradio-checked","ui-state-active");}});}},_destroy:function(){this._unbindFormResetHandler();if(this.icon){this.icon.remove();this.iconSpace.remove();}},_setOption:function(key,value){if(key==="label"&&!value){return;}
|
||||
this._super(key,value);if(key==="disabled"){this._toggleClass(this.label,null,"ui-state-disabled",value);this.element[0].disabled=value;return;}
|
||||
this.refresh();},_updateIcon:function(checked){var toAdd="ui-icon ui-icon-background ";if(this.options.icon){if(!this.icon){this.icon=$("<span>");this.iconSpace=$("<span> </span>");this._addClass(this.iconSpace,"ui-checkboxradio-icon-space");}
|
||||
if(this.type==="checkbox"){toAdd+=checked?"ui-icon-check ui-state-checked":"ui-icon-blank";this._removeClass(this.icon,null,checked?"ui-icon-blank":"ui-icon-check");}else{toAdd+="ui-icon-blank";}
|
||||
this._addClass(this.icon,"ui-checkboxradio-icon",toAdd);if(!checked){this._removeClass(this.icon,null,"ui-icon-check ui-state-checked");}
|
||||
this.icon.prependTo(this.label).after(this.iconSpace);}else if(this.icon!==undefined){this.icon.remove();this.iconSpace.remove();delete this.icon;}},_updateLabel:function(){var contents=this.label.contents().not(this.element[0]);if(this.icon){contents=contents.not(this.icon[0]);}
|
||||
if(this.iconSpace){contents=contents.not(this.iconSpace[0]);}
|
||||
contents.remove();this.label.append(this.options.label);},refresh:function(){var checked=this.element[0].checked,isDisabled=this.element[0].disabled;this._updateIcon(checked);this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",checked);if(this.options.label!==null){this._updateLabel();}
|
||||
if(isDisabled!==this.options.disabled){this._setOptions({"disabled":isDisabled});}}}]);return $.ui.checkboxradio;});
|
||||
@@ -0,0 +1,106 @@
|
||||
/*!
|
||||
Chosen, a Select Box Enhancer for jQuery and Prototype
|
||||
by Patrick Filler for Harvest, http://getharvest.com
|
||||
|
||||
Version 1.8.7
|
||||
Full source at https://github.com/harvesthq/chosen
|
||||
Copyright (c) 2011-2018 Harvest http://getharvest.com
|
||||
|
||||
MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
|
||||
This file is generated by `grunt build`, do not edit it by hand.
|
||||
*/
|
||||
define(["jquery"],function(jQuery){(function(){var $,AbstractChosen,Chosen,SelectParser,bind=function(fn,me){return function(){return fn.apply(me,arguments);};},extend=function(child,parent){for(var key in parent){if(hasProp.call(parent,key))child[key]=parent[key];}function ctor(){this.constructor=child;}ctor.prototype=parent.prototype;child.prototype=new ctor();child.__super__=parent.prototype;return child;},hasProp={}.hasOwnProperty;SelectParser=(function(){function SelectParser(){this.options_index=0;this.parsed=[];}
|
||||
SelectParser.prototype.add_node=function(child){if(child.nodeName.toUpperCase()==="OPTGROUP"){return this.add_group(child);}else{return this.add_option(child);}};SelectParser.prototype.add_group=function(group){var group_position,i,len,option,ref,results1;group_position=this.parsed.length;this.parsed.push({array_index:group_position,group:true,label:group.label,title:group.title?group.title:void 0,children:0,disabled:group.disabled,classes:group.className});ref=group.childNodes;results1=[];for(i=0,len=ref.length;i<len;i++){option=ref[i];results1.push(this.add_option(option,group_position,group.disabled));}
|
||||
return results1;};SelectParser.prototype.add_option=function(option,group_position,group_disabled){if(option.nodeName.toUpperCase()==="OPTION"){if(option.text!==""){if(group_position!=null){this.parsed[group_position].children+=1;}
|
||||
this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:option.value,text:option.text,html:option.innerHTML,title:option.title?option.title:void 0,selected:option.selected,disabled:group_disabled===true?group_disabled:option.disabled,group_array_index:group_position,group_label:group_position!=null?this.parsed[group_position].label:null,classes:option.className,style:option.style.cssText});}else{this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:true});}
|
||||
return this.options_index+=1;}};return SelectParser;})();SelectParser.select_to_array=function(select){var child,i,len,parser,ref;parser=new SelectParser();ref=select.childNodes;for(i=0,len=ref.length;i<len;i++){child=ref[i];parser.add_node(child);}
|
||||
return parser.parsed;};AbstractChosen=(function(){function AbstractChosen(form_field,options1){this.form_field=form_field;this.options=options1!=null?options1:{};this.label_click_handler=bind(this.label_click_handler,this);if(!AbstractChosen.browser_is_supported()){return;}
|
||||
this.is_multiple=this.form_field.multiple;this.set_default_text();this.set_default_values();this.setup();this.set_up_html();this.register_observers();this.on_ready();}
|
||||
AbstractChosen.prototype.set_default_values=function(){this.click_test_action=(function(_this){return function(evt){return _this.test_active_click(evt);};})(this);this.activate_action=(function(_this){return function(evt){return _this.activate_field(evt);};})(this);this.active_field=false;this.mouse_on_container=false;this.results_showing=false;this.result_highlighted=null;this.is_rtl=this.options.rtl||/\bchosen-rtl\b/.test(this.form_field.className);this.allow_single_deselect=(this.options.allow_single_deselect!=null)&&(this.form_field.options[0]!=null)&&this.form_field.options[0].text===""?this.options.allow_single_deselect:false;this.disable_search_threshold=this.options.disable_search_threshold||0;this.disable_search=this.options.disable_search||false;this.enable_split_word_search=this.options.enable_split_word_search!=null?this.options.enable_split_word_search:true;this.group_search=this.options.group_search!=null?this.options.group_search:true;this.search_contains=this.options.search_contains||false;this.single_backstroke_delete=this.options.single_backstroke_delete!=null?this.options.single_backstroke_delete:true;this.max_selected_options=this.options.max_selected_options||Infinity;this.inherit_select_classes=this.options.inherit_select_classes||false;this.display_selected_options=this.options.display_selected_options!=null?this.options.display_selected_options:true;this.display_disabled_options=this.options.display_disabled_options!=null?this.options.display_disabled_options:true;this.include_group_label_in_selected=this.options.include_group_label_in_selected||false;this.max_shown_results=this.options.max_shown_results||Number.POSITIVE_INFINITY;this.case_sensitive_search=this.options.case_sensitive_search||false;return this.hide_results_on_select=this.options.hide_results_on_select!=null?this.options.hide_results_on_select:true;};AbstractChosen.prototype.set_default_text=function(){if(this.form_field.getAttribute("data-placeholder")){this.default_text=this.form_field.getAttribute("data-placeholder");}else if(this.is_multiple){this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||AbstractChosen.default_multiple_text;}else{this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||AbstractChosen.default_single_text;}
|
||||
this.default_text=this.escape_html(this.default_text);return this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||AbstractChosen.default_no_result_text;};AbstractChosen.prototype.choice_label=function(item){if(this.include_group_label_in_selected&&(item.group_label!=null)){return"<b class='group-name'>"+(this.escape_html(item.group_label))+"</b>"+item.html;}else{return item.html;}};AbstractChosen.prototype.mouse_enter=function(){return this.mouse_on_container=true;};AbstractChosen.prototype.mouse_leave=function(){return this.mouse_on_container=false;};AbstractChosen.prototype.input_focus=function(evt){if(this.is_multiple){if(!this.active_field){return setTimeout(((function(_this){return function(){return _this.container_mousedown();};})(this)),50);}}else{if(!this.active_field){return this.activate_field();}}};AbstractChosen.prototype.input_blur=function(evt){if(!this.mouse_on_container){this.active_field=false;return setTimeout(((function(_this){return function(){return _this.blur_test();};})(this)),100);}};AbstractChosen.prototype.label_click_handler=function(evt){if(this.is_multiple){return this.container_mousedown(evt);}else{return this.activate_field();}};AbstractChosen.prototype.results_option_build=function(options){var content,data,data_content,i,len,ref,shown_results;content='';shown_results=0;ref=this.results_data;for(i=0,len=ref.length;i<len;i++){data=ref[i];data_content='';if(data.group){data_content=this.result_add_group(data);}else{data_content=this.result_add_option(data);}
|
||||
if(data_content!==''){shown_results++;content+=data_content;}
|
||||
if(options!=null?options.first:void 0){if(data.selected&&this.is_multiple){this.choice_build(data);}else if(data.selected&&!this.is_multiple){this.single_set_selected_text(this.choice_label(data));}}
|
||||
if(shown_results>=this.max_shown_results){break;}}
|
||||
return content;};AbstractChosen.prototype.result_add_option=function(option){var classes,option_el;if(!option.search_match){return'';}
|
||||
if(!this.include_option_in_results(option)){return'';}
|
||||
classes=[];if(!option.disabled&&!(option.selected&&this.is_multiple)){classes.push("active-result");}
|
||||
if(option.disabled&&!(option.selected&&this.is_multiple)){classes.push("disabled-result");}
|
||||
if(option.selected){classes.push("result-selected");}
|
||||
if(option.group_array_index!=null){classes.push("group-option");}
|
||||
if(option.classes!==""){classes.push(option.classes);}
|
||||
option_el=document.createElement("li");option_el.className=classes.join(" ");if(option.style){option_el.style.cssText=option.style;}
|
||||
option_el.setAttribute("data-option-array-index",option.array_index);option_el.innerHTML=option.highlighted_html||option.html;if(option.title){option_el.title=option.title;}
|
||||
return this.outerHTML(option_el);};AbstractChosen.prototype.result_add_group=function(group){var classes,group_el;if(!(group.search_match||group.group_match)){return'';}
|
||||
if(!(group.active_options>0)){return'';}
|
||||
classes=[];classes.push("group-result");if(group.classes){classes.push(group.classes);}
|
||||
group_el=document.createElement("li");group_el.className=classes.join(" ");group_el.innerHTML=group.highlighted_html||this.escape_html(group.label);if(group.title){group_el.title=group.title;}
|
||||
return this.outerHTML(group_el);};AbstractChosen.prototype.results_update_field=function(){this.set_default_text();if(!this.is_multiple){this.results_reset_cleanup();}
|
||||
this.result_clear_highlight();this.results_build();if(this.results_showing){return this.winnow_results();}};AbstractChosen.prototype.reset_single_select_options=function(){var i,len,ref,result,results1;ref=this.results_data;results1=[];for(i=0,len=ref.length;i<len;i++){result=ref[i];if(result.selected){results1.push(result.selected=false);}else{results1.push(void 0);}}
|
||||
return results1;};AbstractChosen.prototype.results_toggle=function(){if(this.results_showing){return this.results_hide();}else{return this.results_show();}};AbstractChosen.prototype.results_search=function(evt){if(this.results_showing){return this.winnow_results();}else{return this.results_show();}};AbstractChosen.prototype.winnow_results=function(options){var escapedQuery,fix,i,len,option,prefix,query,ref,regex,results,results_group,search_match,startpos,suffix,text;this.no_results_clear();results=0;query=this.get_search_text();escapedQuery=query.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");regex=this.get_search_regex(escapedQuery);ref=this.results_data;for(i=0,len=ref.length;i<len;i++){option=ref[i];option.search_match=false;results_group=null;search_match=null;option.highlighted_html='';if(this.include_option_in_results(option)){if(option.group){option.group_match=false;option.active_options=0;}
|
||||
if((option.group_array_index!=null)&&this.results_data[option.group_array_index]){results_group=this.results_data[option.group_array_index];if(results_group.active_options===0&&results_group.search_match){results+=1;}
|
||||
results_group.active_options+=1;}
|
||||
text=option.group?option.label:option.text;if(!(option.group&&!this.group_search)){search_match=this.search_string_match(text,regex);option.search_match=search_match!=null;if(option.search_match&&!option.group){results+=1;}
|
||||
if(option.search_match){if(query.length){startpos=search_match.index;prefix=text.slice(0,startpos);fix=text.slice(startpos,startpos+query.length);suffix=text.slice(startpos+query.length);option.highlighted_html=(this.escape_html(prefix))+"<em>"+(this.escape_html(fix))+"</em>"+(this.escape_html(suffix));}
|
||||
if(results_group!=null){results_group.group_match=true;}}else if((option.group_array_index!=null)&&this.results_data[option.group_array_index].search_match){option.search_match=true;}}}}
|
||||
this.result_clear_highlight();if(results<1&&query.length){this.update_results_content("");return this.no_results(query);}else{this.update_results_content(this.results_option_build());if(!(options!=null?options.skip_highlight:void 0)){return this.winnow_results_set_highlight();}}};AbstractChosen.prototype.get_search_regex=function(escaped_search_string){var regex_flag,regex_string;regex_string=this.search_contains?escaped_search_string:"(^|\\s|\\b)"+escaped_search_string+"[^\\s]*";if(!(this.enable_split_word_search||this.search_contains)){regex_string="^"+regex_string;}
|
||||
regex_flag=this.case_sensitive_search?"":"i";return new RegExp(regex_string,regex_flag);};AbstractChosen.prototype.search_string_match=function(search_string,regex){var match;match=regex.exec(search_string);if(!this.search_contains&&(match!=null?match[1]:void 0)){match.index+=1;}
|
||||
return match;};AbstractChosen.prototype.choices_count=function(){var i,len,option,ref;if(this.selected_option_count!=null){return this.selected_option_count;}
|
||||
this.selected_option_count=0;ref=this.form_field.options;for(i=0,len=ref.length;i<len;i++){option=ref[i];if(option.selected){this.selected_option_count+=1;}}
|
||||
return this.selected_option_count;};AbstractChosen.prototype.choices_click=function(evt){evt.preventDefault();this.activate_field();if(!(this.results_showing||this.is_disabled)){return this.results_show();}};AbstractChosen.prototype.keydown_checker=function(evt){var ref,stroke;stroke=(ref=evt.which)!=null?ref:evt.keyCode;this.search_field_scale();if(stroke!==8&&this.pending_backstroke){this.clear_backstroke();}
|
||||
switch(stroke){case 8:this.backstroke_length=this.get_search_field_value().length;break;case 9:if(this.results_showing&&!this.is_multiple){this.result_select(evt);}
|
||||
this.mouse_on_container=false;break;case 13:if(this.results_showing){evt.preventDefault();}
|
||||
break;case 27:if(this.results_showing){evt.preventDefault();}
|
||||
break;case 32:if(this.disable_search){evt.preventDefault();}
|
||||
break;case 38:evt.preventDefault();this.keyup_arrow();break;case 40:evt.preventDefault();this.keydown_arrow();break;}};AbstractChosen.prototype.keyup_checker=function(evt){var ref,stroke;stroke=(ref=evt.which)!=null?ref:evt.keyCode;this.search_field_scale();switch(stroke){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0){this.keydown_backstroke();}else if(!this.pending_backstroke){this.result_clear_highlight();this.results_search();}
|
||||
break;case 13:evt.preventDefault();if(this.results_showing){this.result_select(evt);}
|
||||
break;case 27:if(this.results_showing){this.results_hide();}
|
||||
break;case 9:case 16:case 17:case 18:case 38:case 40:case 91:break;default:this.results_search();break;}};AbstractChosen.prototype.clipboard_event_checker=function(evt){if(this.is_disabled){return;}
|
||||
return setTimeout(((function(_this){return function(){return _this.results_search();};})(this)),50);};AbstractChosen.prototype.container_width=function(){if(this.options.width!=null){return this.options.width;}else{return this.form_field.offsetWidth+"px";}};AbstractChosen.prototype.include_option_in_results=function(option){if(this.is_multiple&&(!this.display_selected_options&&option.selected)){return false;}
|
||||
if(!this.display_disabled_options&&option.disabled){return false;}
|
||||
if(option.empty){return false;}
|
||||
return true;};AbstractChosen.prototype.search_results_touchstart=function(evt){this.touch_started=true;return this.search_results_mouseover(evt);};AbstractChosen.prototype.search_results_touchmove=function(evt){this.touch_started=false;return this.search_results_mouseout(evt);};AbstractChosen.prototype.search_results_touchend=function(evt){if(this.touch_started){return this.search_results_mouseup(evt);}};AbstractChosen.prototype.outerHTML=function(element){var tmp;if(element.outerHTML){return element.outerHTML;}
|
||||
tmp=document.createElement("div");tmp.appendChild(element);return tmp.innerHTML;};AbstractChosen.prototype.get_single_html=function(){return"<a class=\"chosen-single chosen-default\">\n <span>"+this.default_text+"</span>\n <div><b></b></div>\n</a>\n<div class=\"chosen-drop\">\n <div class=\"chosen-search\">\n <input class=\"chosen-search-input\" type=\"text\" autocomplete=\"off\" />\n </div>\n <ul class=\"chosen-results\"></ul>\n</div>";};AbstractChosen.prototype.get_multi_html=function(){return"<ul class=\"chosen-choices\">\n <li class=\"search-field\">\n <input class=\"chosen-search-input\" type=\"text\" autocomplete=\"off\" value=\""+this.default_text+"\" />\n </li>\n</ul>\n<div class=\"chosen-drop\">\n <ul class=\"chosen-results\"></ul>\n</div>";};AbstractChosen.prototype.get_no_results_html=function(terms){return"<li class=\"no-results\">\n "+this.results_none_found+" <span>"+(this.escape_html(terms))+"</span>\n</li>";};AbstractChosen.browser_is_supported=function(){if("Microsoft Internet Explorer"===window.navigator.appName){return document.documentMode>=8;}
|
||||
if(/iP(od|hone)/i.test(window.navigator.userAgent)||/IEMobile/i.test(window.navigator.userAgent)||/Windows Phone/i.test(window.navigator.userAgent)||/BlackBerry/i.test(window.navigator.userAgent)||/BB10/i.test(window.navigator.userAgent)||/Android.*Mobile/i.test(window.navigator.userAgent)){return false;}
|
||||
return true;};AbstractChosen.default_multiple_text="Select Some Options";AbstractChosen.default_single_text="Select an Option";AbstractChosen.default_no_result_text="No results match";return AbstractChosen;})();$=jQuery;$.fn.extend({chosen:function(options){if(!AbstractChosen.browser_is_supported()){return this;}
|
||||
return this.each(function(input_field){var $this,chosen;$this=$(this);chosen=$this.data('chosen');if(options==='destroy'){if(chosen instanceof Chosen){chosen.destroy();}
|
||||
return;}
|
||||
if(!(chosen instanceof Chosen)){$this.data('chosen',new Chosen(this,options));}});}});Chosen=(function(superClass){extend(Chosen,superClass);function Chosen(){return Chosen.__super__.constructor.apply(this,arguments);}
|
||||
Chosen.prototype.setup=function(){this.form_field_jq=$(this.form_field);return this.current_selectedIndex=this.form_field.selectedIndex;};Chosen.prototype.set_up_html=function(){var container_classes,container_props;container_classes=["chosen-container"];container_classes.push("chosen-container-"+(this.is_multiple?"multi":"single"));if(this.inherit_select_classes&&this.form_field.className){container_classes.push(this.form_field.className);}
|
||||
if(this.is_rtl){container_classes.push("chosen-rtl");}
|
||||
container_props={'class':container_classes.join(' '),'title':this.form_field.title};if(this.form_field.id.length){container_props.id=this.form_field.id.replace(/[^\w]/g,'_')+"_chosen";}
|
||||
this.container=$("<div>",container_props);this.container.width(this.container_width());if(this.is_multiple){this.container.html(this.get_multi_html());}else{this.container.html(this.get_single_html());}
|
||||
this.form_field_jq.hide().after(this.container);this.dropdown=this.container.find('div.chosen-drop').first();this.search_field=this.container.find('input').first();this.search_results=this.container.find('ul.chosen-results').first();this.search_field_scale();this.search_no_results=this.container.find('li.no-results').first();if(this.is_multiple){this.search_choices=this.container.find('ul.chosen-choices').first();this.search_container=this.container.find('li.search-field').first();}else{this.search_container=this.container.find('div.chosen-search').first();this.selected_item=this.container.find('.chosen-single').first();}
|
||||
this.results_build();this.set_tab_index();return this.set_label_behavior();};Chosen.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this});};Chosen.prototype.register_observers=function(){this.container.on('touchstart.chosen',(function(_this){return function(evt){_this.container_mousedown(evt);};})(this));this.container.on('touchend.chosen',(function(_this){return function(evt){_this.container_mouseup(evt);};})(this));this.container.on('mousedown.chosen',(function(_this){return function(evt){_this.container_mousedown(evt);};})(this));this.container.on('mouseup.chosen',(function(_this){return function(evt){_this.container_mouseup(evt);};})(this));this.container.on('mouseenter.chosen',(function(_this){return function(evt){_this.mouse_enter(evt);};})(this));this.container.on('mouseleave.chosen',(function(_this){return function(evt){_this.mouse_leave(evt);};})(this));this.search_results.on('mouseup.chosen',(function(_this){return function(evt){_this.search_results_mouseup(evt);};})(this));this.search_results.on('mouseover.chosen',(function(_this){return function(evt){_this.search_results_mouseover(evt);};})(this));this.search_results.on('mouseout.chosen',(function(_this){return function(evt){_this.search_results_mouseout(evt);};})(this));this.search_results.on('mousewheel.chosen DOMMouseScroll.chosen',(function(_this){return function(evt){_this.search_results_mousewheel(evt);};})(this));this.search_results.on('touchstart.chosen',(function(_this){return function(evt){_this.search_results_touchstart(evt);};})(this));this.search_results.on('touchmove.chosen',(function(_this){return function(evt){_this.search_results_touchmove(evt);};})(this));this.search_results.on('touchend.chosen',(function(_this){return function(evt){_this.search_results_touchend(evt);};})(this));this.form_field_jq.on("chosen:updated.chosen",(function(_this){return function(evt){_this.results_update_field(evt);};})(this));this.form_field_jq.on("chosen:activate.chosen",(function(_this){return function(evt){_this.activate_field(evt);};})(this));this.form_field_jq.on("chosen:open.chosen",(function(_this){return function(evt){_this.container_mousedown(evt);};})(this));this.form_field_jq.on("chosen:close.chosen",(function(_this){return function(evt){_this.close_field(evt);};})(this));this.search_field.on('blur.chosen',(function(_this){return function(evt){_this.input_blur(evt);};})(this));this.search_field.on('keyup.chosen',(function(_this){return function(evt){_this.keyup_checker(evt);};})(this));this.search_field.on('keydown.chosen',(function(_this){return function(evt){_this.keydown_checker(evt);};})(this));this.search_field.on('focus.chosen',(function(_this){return function(evt){_this.input_focus(evt);};})(this));this.search_field.on('cut.chosen',(function(_this){return function(evt){_this.clipboard_event_checker(evt);};})(this));this.search_field.on('paste.chosen',(function(_this){return function(evt){_this.clipboard_event_checker(evt);};})(this));if(this.is_multiple){return this.search_choices.on('click.chosen',(function(_this){return function(evt){_this.choices_click(evt);};})(this));}else{return this.container.on('click.chosen',function(evt){evt.preventDefault();});}};Chosen.prototype.destroy=function(){$(this.container[0].ownerDocument).off('click.chosen',this.click_test_action);if(this.form_field_label.length>0){this.form_field_label.off('click.chosen');}
|
||||
if(this.search_field[0].tabIndex){this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex;}
|
||||
this.container.remove();this.form_field_jq.removeData('chosen');return this.form_field_jq.show();};Chosen.prototype.search_field_disabled=function(){this.is_disabled=this.form_field.disabled||this.form_field_jq.parents('fieldset').is(':disabled');this.container.toggleClass('chosen-disabled',this.is_disabled);this.search_field[0].disabled=this.is_disabled;if(!this.is_multiple){this.selected_item.off('focus.chosen',this.activate_field);}
|
||||
if(this.is_disabled){return this.close_field();}else if(!this.is_multiple){return this.selected_item.on('focus.chosen',this.activate_field);}};Chosen.prototype.container_mousedown=function(evt){var ref;if(this.is_disabled){return;}
|
||||
if(evt&&((ref=evt.type)==='mousedown'||ref==='touchstart')&&!this.results_showing){evt.preventDefault();}
|
||||
if(!((evt!=null)&&($(evt.target)).hasClass("search-choice-close"))){if(!this.active_field){if(this.is_multiple){this.search_field.val("");}
|
||||
$(this.container[0].ownerDocument).on('click.chosen',this.click_test_action);this.results_show();}else if(!this.is_multiple&&evt&&(($(evt.target)[0]===this.selected_item[0])||$(evt.target).parents("a.chosen-single").length)){evt.preventDefault();this.results_toggle();}
|
||||
return this.activate_field();}};Chosen.prototype.container_mouseup=function(evt){if(evt.target.nodeName==="ABBR"&&!this.is_disabled){return this.results_reset(evt);}};Chosen.prototype.search_results_mousewheel=function(evt){var delta;if(evt.originalEvent){delta=evt.originalEvent.deltaY||-evt.originalEvent.wheelDelta||evt.originalEvent.detail;}
|
||||
if(delta!=null){evt.preventDefault();if(evt.type==='DOMMouseScroll'){delta=delta*40;}
|
||||
return this.search_results.scrollTop(delta+this.search_results.scrollTop());}};Chosen.prototype.blur_test=function(evt){if(!this.active_field&&this.container.hasClass("chosen-container-active")){return this.close_field();}};Chosen.prototype.close_field=function(){$(this.container[0].ownerDocument).off("click.chosen",this.click_test_action);this.active_field=false;this.results_hide();this.container.removeClass("chosen-container-active");this.clear_backstroke();this.show_search_field_default();this.search_field_scale();return this.search_field.blur();};Chosen.prototype.activate_field=function(){if(this.is_disabled){return;}
|
||||
this.container.addClass("chosen-container-active");this.active_field=true;this.search_field.val(this.search_field.val());return this.search_field.focus();};Chosen.prototype.test_active_click=function(evt){var active_container;active_container=$(evt.target).closest('.chosen-container');if(active_container.length&&this.container[0]===active_container[0]){return this.active_field=true;}else{return this.close_field();}};Chosen.prototype.results_build=function(){this.parsing=true;this.selected_option_count=null;this.results_data=SelectParser.select_to_array(this.form_field);if(this.is_multiple){this.search_choices.find("li.search-choice").remove();}else{this.single_set_selected_text();if(this.disable_search||this.form_field.options.length<=this.disable_search_threshold){this.search_field[0].readOnly=true;this.container.addClass("chosen-container-single-nosearch");}else{this.search_field[0].readOnly=false;this.container.removeClass("chosen-container-single-nosearch");}}
|
||||
this.update_results_content(this.results_option_build({first:true}));this.search_field_disabled();this.show_search_field_default();this.search_field_scale();return this.parsing=false;};Chosen.prototype.result_do_highlight=function(el){var high_bottom,high_top,maxHeight,visible_bottom,visible_top;if(el.length){this.result_clear_highlight();this.result_highlight=el;this.result_highlight.addClass("highlighted");maxHeight=parseInt(this.search_results.css("maxHeight"),10);visible_top=this.search_results.scrollTop();visible_bottom=maxHeight+visible_top;high_top=this.result_highlight.position().top+this.search_results.scrollTop();high_bottom=high_top+this.result_highlight.outerHeight();if(high_bottom>=visible_bottom){return this.search_results.scrollTop((high_bottom-maxHeight)>0?high_bottom-maxHeight:0);}else if(high_top<visible_top){return this.search_results.scrollTop(high_top);}}};Chosen.prototype.result_clear_highlight=function(){if(this.result_highlight){this.result_highlight.removeClass("highlighted");}
|
||||
return this.result_highlight=null;};Chosen.prototype.results_show=function(){if(this.is_multiple&&this.max_selected_options<=this.choices_count()){this.form_field_jq.trigger("chosen:maxselected",{chosen:this});return false;}
|
||||
this.container.addClass("chosen-with-drop");this.results_showing=true;this.search_field.focus();this.search_field.val(this.get_search_field_value());this.winnow_results();return this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this});};Chosen.prototype.update_results_content=function(content){return this.search_results.html(content);};Chosen.prototype.results_hide=function(){if(this.results_showing){this.result_clear_highlight();this.container.removeClass("chosen-with-drop");this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this});}
|
||||
return this.results_showing=false;};Chosen.prototype.set_tab_index=function(el){var ti;if(this.form_field.tabIndex){ti=this.form_field.tabIndex;this.form_field.tabIndex=-1;return this.search_field[0].tabIndex=ti;}};Chosen.prototype.set_label_behavior=function(){this.form_field_label=this.form_field_jq.parents("label");if(!this.form_field_label.length&&this.form_field.id.length){this.form_field_label=$("label[for='"+this.form_field.id+"']");}
|
||||
if(this.form_field_label.length>0){return this.form_field_label.on('click.chosen',this.label_click_handler);}};Chosen.prototype.show_search_field_default=function(){if(this.is_multiple&&this.choices_count()<1&&!this.active_field){this.search_field.val(this.default_text);return this.search_field.addClass("default");}else{this.search_field.val("");return this.search_field.removeClass("default");}};Chosen.prototype.search_results_mouseup=function(evt){var target;target=$(evt.target).hasClass("active-result")?$(evt.target):$(evt.target).parents(".active-result").first();if(target.length){this.result_highlight=target;this.result_select(evt);return this.search_field.focus();}};Chosen.prototype.search_results_mouseover=function(evt){var target;target=$(evt.target).hasClass("active-result")?$(evt.target):$(evt.target).parents(".active-result").first();if(target){return this.result_do_highlight(target);}};Chosen.prototype.search_results_mouseout=function(evt){if($(evt.target).hasClass("active-result")||$(evt.target).parents('.active-result').first()){return this.result_clear_highlight();}};Chosen.prototype.choice_build=function(item){var choice,close_link;choice=$('<li>',{"class":"search-choice"}).html("<span>"+(this.choice_label(item))+"</span>");if(item.disabled){choice.addClass('search-choice-disabled');}else{close_link=$('<a />',{"class":'search-choice-close','data-option-array-index':item.array_index});close_link.on('click.chosen',(function(_this){return function(evt){return _this.choice_destroy_link_click(evt);};})(this));choice.append(close_link);}
|
||||
return this.search_container.before(choice);};Chosen.prototype.choice_destroy_link_click=function(evt){evt.preventDefault();evt.stopPropagation();if(!this.is_disabled){return this.choice_destroy($(evt.target));}};Chosen.prototype.choice_destroy=function(link){if(this.result_deselect(link[0].getAttribute("data-option-array-index"))){if(this.active_field){this.search_field.focus();}else{this.show_search_field_default();}
|
||||
if(this.is_multiple&&this.choices_count()>0&&this.get_search_field_value().length<1){this.results_hide();}
|
||||
link.parents('li').first().remove();return this.search_field_scale();}};Chosen.prototype.results_reset=function(){this.reset_single_select_options();this.form_field.options[0].selected=true;this.single_set_selected_text();this.show_search_field_default();this.results_reset_cleanup();this.trigger_form_field_change();if(this.active_field){return this.results_hide();}};Chosen.prototype.results_reset_cleanup=function(){this.current_selectedIndex=this.form_field.selectedIndex;return this.selected_item.find("abbr").remove();};Chosen.prototype.result_select=function(evt){var high,item;if(this.result_highlight){high=this.result_highlight;this.result_clear_highlight();if(this.is_multiple&&this.max_selected_options<=this.choices_count()){this.form_field_jq.trigger("chosen:maxselected",{chosen:this});return false;}
|
||||
if(this.is_multiple){high.removeClass("active-result");}else{this.reset_single_select_options();}
|
||||
high.addClass("result-selected");item=this.results_data[high[0].getAttribute("data-option-array-index")];item.selected=true;this.form_field.options[item.options_index].selected=true;this.selected_option_count=null;if(this.is_multiple){this.choice_build(item);}else{this.single_set_selected_text(this.choice_label(item));}
|
||||
if(this.is_multiple&&(!this.hide_results_on_select||(evt.metaKey||evt.ctrlKey))){if(evt.metaKey||evt.ctrlKey){this.winnow_results({skip_highlight:true});}else{this.search_field.val("");this.winnow_results();}}else{this.results_hide();this.show_search_field_default();}
|
||||
if(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex){this.trigger_form_field_change({selected:this.form_field.options[item.options_index].value});}
|
||||
this.current_selectedIndex=this.form_field.selectedIndex;evt.preventDefault();return this.search_field_scale();}};Chosen.prototype.single_set_selected_text=function(text){if(text==null){text=this.default_text;}
|
||||
if(text===this.default_text){this.selected_item.addClass("chosen-default");}else{this.single_deselect_control_build();this.selected_item.removeClass("chosen-default");}
|
||||
return this.selected_item.find("span").html(text);};Chosen.prototype.result_deselect=function(pos){var result_data;result_data=this.results_data[pos];if(!this.form_field.options[result_data.options_index].disabled){result_data.selected=false;this.form_field.options[result_data.options_index].selected=false;this.selected_option_count=null;this.result_clear_highlight();if(this.results_showing){this.winnow_results();}
|
||||
this.trigger_form_field_change({deselected:this.form_field.options[result_data.options_index].value});this.search_field_scale();return true;}else{return false;}};Chosen.prototype.single_deselect_control_build=function(){if(!this.allow_single_deselect){return;}
|
||||
if(!this.selected_item.find("abbr").length){this.selected_item.find("span").first().after("<abbr class=\"search-choice-close\"></abbr>");}
|
||||
return this.selected_item.addClass("chosen-single-with-deselect");};Chosen.prototype.get_search_field_value=function(){return this.search_field.val();};Chosen.prototype.get_search_text=function(){return $.trim(this.get_search_field_value());};Chosen.prototype.escape_html=function(text){return $('<div>').text(text).html();};Chosen.prototype.winnow_results_set_highlight=function(){var do_high,selected_results;selected_results=!this.is_multiple?this.search_results.find(".result-selected.active-result"):[];do_high=selected_results.length?selected_results.first():this.search_results.find(".active-result").first();if(do_high!=null){return this.result_do_highlight(do_high);}};Chosen.prototype.no_results=function(terms){var no_results_html;no_results_html=this.get_no_results_html(terms);this.search_results.append(no_results_html);return this.form_field_jq.trigger("chosen:no_results",{chosen:this});};Chosen.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove();};Chosen.prototype.keydown_arrow=function(){var next_sib;if(this.results_showing&&this.result_highlight){next_sib=this.result_highlight.nextAll("li.active-result").first();if(next_sib){return this.result_do_highlight(next_sib);}}else{return this.results_show();}};Chosen.prototype.keyup_arrow=function(){var prev_sibs;if(!this.results_showing&&!this.is_multiple){return this.results_show();}else if(this.result_highlight){prev_sibs=this.result_highlight.prevAll("li.active-result");if(prev_sibs.length){return this.result_do_highlight(prev_sibs.first());}else{if(this.choices_count()>0){this.results_hide();}
|
||||
return this.result_clear_highlight();}}};Chosen.prototype.keydown_backstroke=function(){var next_available_destroy;if(this.pending_backstroke){this.choice_destroy(this.pending_backstroke.find("a").first());return this.clear_backstroke();}else{next_available_destroy=this.search_container.siblings("li.search-choice").last();if(next_available_destroy.length&&!next_available_destroy.hasClass("search-choice-disabled")){this.pending_backstroke=next_available_destroy;if(this.single_backstroke_delete){return this.keydown_backstroke();}else{return this.pending_backstroke.addClass("search-choice-focus");}}}};Chosen.prototype.clear_backstroke=function(){if(this.pending_backstroke){this.pending_backstroke.removeClass("search-choice-focus");}
|
||||
return this.pending_backstroke=null;};Chosen.prototype.search_field_scale=function(){var div,i,len,style,style_block,styles,width;if(!this.is_multiple){return;}
|
||||
style_block={position:'absolute',left:'-1000px',top:'-1000px',display:'none',whiteSpace:'pre'};styles=['fontSize','fontStyle','fontWeight','fontFamily','lineHeight','textTransform','letterSpacing'];for(i=0,len=styles.length;i<len;i++){style=styles[i];style_block[style]=this.search_field.css(style);}
|
||||
div=$('<div>').css(style_block);div.text(this.get_search_field_value());$('body').append(div);width=div.width()+25;div.remove();if(this.container.is(':visible')){width=Math.min(this.container.outerWidth()-10,width);}
|
||||
return this.search_field.width(width);};Chosen.prototype.trigger_form_field_change=function(extra){this.form_field_jq.trigger("input",extra);return this.form_field_jq.trigger("change",extra);};return Chosen;})(AbstractChosen);}).call(this);});
|
||||
@@ -0,0 +1,6 @@
|
||||
define(['underscore','mageUtils','mage/utils/wrapper'],function(_,utils,wrapper){'use strict';var Class;function getOwn(obj,prop){return _.isObject(obj)&&obj.hasOwnProperty(prop)&&obj[prop];}
|
||||
function createConstructor(protoProps,constructor){var UiClass=constructor;if(!UiClass){UiClass=function(){var obj=this;if(!_.isObject(obj)||Object.getPrototypeOf(obj)!==UiClass.prototype){obj=Object.create(UiClass.prototype);}
|
||||
obj.initialize.apply(obj,arguments);return obj;};}
|
||||
UiClass.prototype=protoProps;UiClass.prototype.constructor=UiClass;return UiClass;}
|
||||
Class=createConstructor({initialize:function(options){this.initConfig(options);return this;},initConfig:function(options){var defaults=this.constructor.defaults,config=utils.extend({},defaults,options||{}),ignored=config.ignoreTmpls||{},cached=utils.omit(config,ignored);config=utils.template(config,this,false,true);_.each(cached,function(value,key){utils.nested(config,key,value);});return _.extend(this,config);}});_.extend(Class,{defaults:{ignoreTmpls:{templates:true}},extend:function(extender){var parent=this,parentProto=parent.prototype,childProto=Object.create(parentProto),child=createConstructor(childProto,getOwn(extender,'constructor')),defaults;extender=extender||{};defaults=extender.defaults;delete extender.defaults;_.each(extender,function(method,name){childProto[name]=wrapper.wrapSuper(parentProto[name],method);});child.defaults=utils.extend({},parent.defaults||{});if(defaults){utils.extend(child.defaults,defaults);extender.defaults=defaults;}
|
||||
return _.extend(child,{__super__:parentProto,extend:parent.extend});}});return Class;});
|
||||
@@ -0,0 +1,40 @@
|
||||
define(['jquery','jquery-ui-modules/widget','jquery-ui-modules/core','jquery/jquery-storageapi','mage/mage'],function($){'use strict';var hideProps={},showProps={};hideProps.height='hide';showProps.height='show';$.widget('mage.collapsible',{options:{active:false,disabled:false,collapsible:true,header:'[data-role=title]',content:'[data-role=content]',trigger:'[data-role=trigger]',closedState:null,openedState:null,disabledState:null,ajaxUrlElement:'[data-ajax=true]',ajaxContent:false,loadingClass:null,saveState:false,animate:false,icons:{activeHeader:null,header:null},collateral:{element:null,openedState:null}},_create:function(){this.storage=$.localStorage;this.icons=false;if(typeof this.options.icons==='string'){this.options.icons=JSON.parse(this.options.icons);}
|
||||
this._processPanels();this._processState();this._refresh();if(this.options.icons.header&&this.options.icons.activeHeader){this._createIcons();this.icons=true;}
|
||||
this.element.on('dimensionsChanged',function(e){if(e.target&&e.target.classList.contains('active')){this._scrollToTopIfNotVisible();}}.bind(this));this._bind('click');this._trigger('created');},_refresh:function(){this.trigger.attr('tabIndex',0);if(this.options.active&&!this.options.disabled){if(this.options.openedState){this.element.addClass(this.options.openedState);}
|
||||
if(this.options.collateral.element&&this.options.collateral.openedState){$(this.options.collateral.element).addClass(this.options.collateral.openedState);}
|
||||
if(this.options.ajaxContent){this._loadContent();}
|
||||
this.header.attr({'aria-selected':false});}else if(this.options.disabled){this.disable();}else{this.content.hide();if(this.options.closedState){this.element.addClass(this.options.closedState);}}},_processState:function(){var anchor=window.location.hash,isValid=$.mage.isValidSelector(anchor),urlPath=window.location.pathname.replace(/\./g,''),state;this.stateKey=encodeURIComponent(urlPath+this.element.attr('id'));if(isValid&&($(this.content.find(anchor)).length>0||this.content.attr('id')===anchor.replace('#',''))){this.element.parents('[data-collapsible=true]').collapsible('forceActivate');if(!this.options.disabled){this.options.active=true;if(this.options.saveState){this.storage.set(this.stateKey,true);}}}else if(this.options.saveState&&!this.options.disabled){state=this.storage.get(this.stateKey);if(typeof state==='undefined'||state===null){this.storage.set(this.stateKey,this.options.active);}else if(state===true){this.options.active=true;}else if(state===false){this.options.active=false;}}},_createIcons:function(){var icons=this.options.icons;if(icons){$('<span>').addClass(icons.header).attr('data-role','icons').prependTo(this.header);if(this.options.active&&!this.options.disabled){this.header.children('[data-role=icons]').removeClass(icons.header).addClass(icons.activeHeader);}}},_destroyIcons:function(){this.header.children('[data-role=icons]').remove();},_destroy:function(){var options=this.options;this.element.removeAttr('data-collapsible');this.trigger.removeAttr('tabIndex');if(options.openedState){this.element.removeClass(options.openedState);}
|
||||
if(this.options.collateral.element&&this.options.collateral.openedState){$(this.options.collateral.element).removeClass(this.options.collateral.openedState);}
|
||||
if(options.closedState){this.element.removeClass(options.closedState);}
|
||||
if(options.disabledState){this.element.removeClass(options.disabledState);}
|
||||
if(this.icons){this._destroyIcons();}},_processPanels:function(){var headers,triggers;this.element.attr('data-collapsible','true');if(typeof this.options.header==='object'){this.header=this.options.header;}else{headers=this.element.find(this.options.header);if(headers.length>0){this.header=headers.eq(0);}else{this.header=this.element;}}
|
||||
if(typeof this.options.content==='object'){this.content=this.options.content;}else{this.content=this.header.next(this.options.content).eq(0);}
|
||||
if(this.header.attr('id')){this.content.attr('aria-labelledby',this.header.attr('id'));}
|
||||
if(this.content.attr('id')){this.header.attr('aria-controls',this.content.attr('id'));}
|
||||
this.header.attr({'role':'tab','aria-selected':this.options.active,'aria-expanded':this.options.active});if(this.header.parent().attr('role')!=='presentation'){this.header.parent().attr('role','tablist');}
|
||||
this.content.attr({'role':'tabpanel','aria-hidden':!this.options.active});if(typeof this.options.trigger==='object'){this.trigger=this.options.trigger;}else{triggers=this.header.find(this.options.trigger);if(triggers.length>0){this.trigger=triggers.eq(0);}else{this.trigger=this.header;}}},_keydown:function(event){var keyCode;if(event.altKey||event.ctrlKey){return;}
|
||||
keyCode=$.ui.keyCode;switch(event.keyCode){case keyCode.SPACE:case keyCode.ENTER:this._eventHandler(event);break;}},_bind:function(event){var self=this;this.events={keydown:'_keydown'};if(event){$.each(event.split(' '),function(index,eventName){self.events[eventName]='_eventHandler';});}
|
||||
this._off(this.trigger);if(!this.options.disabled){this._on(this.trigger,this.events);}},disable:function(){this.options.disabled=true;this._off(this.trigger);this.forceDeactivate();if(this.options.disabledState){this.element.addClass(this.options.disabledState);}
|
||||
this.trigger.attr('tabIndex',-1);},enable:function(){this.options.disabled=false;this._on(this.trigger,this.events);this.forceActivate();if(this.options.disabledState){this.element.removeClass(this.options.disabledState);}
|
||||
this.trigger.attr('tabIndex',0);},_eventHandler:function(event){if(this.options.active&&this.options.collapsible){this.deactivate();}else{this.activate();}
|
||||
event.preventDefault();},_animate:function(prop){var duration,easing,animate=this.options.animate;if(typeof animate==='number'){duration=animate;}
|
||||
if(typeof animate==='string'){animate=JSON.parse(animate);}
|
||||
duration=duration||animate.duration;easing=animate.easing;this.content.animate(prop,duration,easing);},deactivate:function(){if(this.options.animate){this._animate(hideProps);}else{this.content.hide();}
|
||||
this._close();},forceDeactivate:function(){this.content.hide();this._close();},_close:function(){this.options.active=false;if(this.options.saveState){this.storage.set(this.stateKey,false);}
|
||||
if(this.options.openedState){this.element.removeClass(this.options.openedState);}
|
||||
if(this.options.collateral.element&&this.options.collateral.openedState){$(this.options.collateral.element).removeClass(this.options.collateral.openedState);}
|
||||
if(this.options.closedState){this.element.addClass(this.options.closedState);}
|
||||
if(this.icons){this.header.children('[data-role=icons]').removeClass(this.options.icons.activeHeader).addClass(this.options.icons.header);}
|
||||
this.header.attr({'aria-selected':'false','aria-expanded':'false'});this.content.attr({'aria-hidden':'true'});this.element.trigger('dimensionsChanged',{opened:false});},activate:function(){if(this.options.disabled){return;}
|
||||
if(this.options.animate){this._animate(showProps);}else{this.content.show();}
|
||||
this._open();},forceActivate:function(){if(!this.options.disabled){this.content.show();this._open();}},_open:function(){this.element.trigger('beforeOpen');this.options.active=true;if(this.options.ajaxContent){this._loadContent();}
|
||||
if(this.options.saveState){this.storage.set(this.stateKey,true);}
|
||||
if(this.options.openedState){this.element.addClass(this.options.openedState);}
|
||||
if(this.options.collateral.element&&this.options.collateral.openedState){$(this.options.collateral.element).addClass(this.options.collateral.openedState);}
|
||||
if(this.options.closedState){this.element.removeClass(this.options.closedState);}
|
||||
if(this.icons){this.header.children('[data-role=icons]').removeClass(this.options.icons.header).addClass(this.options.icons.activeHeader);}
|
||||
this.header.attr({'aria-selected':'true','aria-expanded':'true'});this.content.attr({'aria-hidden':'false'});this.element.trigger('dimensionsChanged',{opened:true});},_loadContent:function(){var url=this.element.find(this.options.ajaxUrlElement).attr('href'),that=this;if(url){that.xhr=$.get({url:url,dataType:'html'},function(){});}
|
||||
if(that.xhr&&that.xhr.statusText!=='canceled'){if(that.options.loadingClass){that.element.addClass(that.options.loadingClass);}
|
||||
that.content.attr('aria-busy','true');that.xhr.done(function(response){setTimeout(function(){that.content.html(response);},1);});that.xhr.always(function(jqXHR,status){setTimeout(function(){if(status==='abort'){that.content.stop(false,true);}
|
||||
if(that.options.loadingClass){that.element.removeClass(that.options.loadingClass);}
|
||||
that.content.removeAttr('aria-busy');if(jqXHR===that.xhr){delete that.xhr;}},1);});}},_scrollToTopIfNotVisible:function(){if(this._isElementOutOfViewport()){this.header[0].scrollIntoView();}},_isElementOutOfViewport:function(){var headerRect=this.header[0].getBoundingClientRect(),contentRect=this.content.get().length?this.content[0].getBoundingClientRect():false,headerOut,contentOut;headerOut=headerRect.bottom-headerRect.height<0||headerRect.right-headerRect.width<0||headerRect.left+headerRect.width>window.innerWidth||headerRect.top+headerRect.height>window.innerHeight;contentOut=contentRect?contentRect.bottom-contentRect.height<0||contentRect.right-contentRect.width<0||contentRect.left+contentRect.width>window.innerWidth||contentRect.top+contentRect.height>window.innerHeight:false;return headerOut?headerOut:contentOut;}});return $.mage.collapsible;});
|
||||
@@ -0,0 +1,8 @@
|
||||
define(['ko','jquery','underscore','../template/renderer'],function(ko,$,_,renderer){'use strict';var collapsible,defaults;defaults={closeOnOuter:true,onTarget:false,openClass:'_active',as:'$collapsible'};collapsible={open:function(){this.opened(true);},close:function(){this.opened(false);},toggle:function(){this.opened(!this.opened());}};function onOuterClick(container,model,e){var target=e.target;if(target!==container&&!container.contains(target)){model.close();}}
|
||||
function getClassBinding(model,name){var binding={};binding[name]=model.opened;return{css:binding};}
|
||||
function buildConfig(options){if(typeof options!=='object'){options={};}
|
||||
return _.extend({},defaults,options);}
|
||||
ko.bindingHandlers.collapsible={init:function(element,valueAccessor,allBindings,viewModel,bindingCtx){var $collapsible=Object.create(collapsible),config=buildConfig(valueAccessor()),outerClick,bindings;_.bindAll($collapsible,'open','close','toggle');$collapsible.opened=ko.observable(!!config.opened);bindingCtx[config.as]=$collapsible;if(config.closeOnOuter){outerClick=onOuterClick.bind(null,element,$collapsible);$(document).on('click',outerClick);ko.utils.domNodeDisposal.addDisposeCallback(element,function(){$(document).off('click',outerClick);});}
|
||||
if(config.openClass){bindings=getClassBinding($collapsible,config.openClass);ko.applyBindingsToNode(element,bindings,bindingCtx);}
|
||||
if(config.onTarget){$(element).on('click',$collapsible.toggle);}
|
||||
if(viewModel&&_.isFunction(viewModel.on)){viewModel.on({close:$collapsible.close,open:$collapsible.open,toggleOpened:$collapsible.toggle});}}};ko.bindingHandlers.closeCollapsible={init:function(element,valueAccessor,allBindings,viewModel,bindingCtx){var name=valueAccessor()||defaults.as,$collapsible=bindingCtx[name];if($collapsible){$(element).on('click',$collapsible.close);}}};ko.bindingHandlers.openCollapsible={init:function(element,valueAccessor,allBindings,viewModel,bindingCtx){var name=valueAccessor()||defaults.as,$collapsible=bindingCtx[name];if($collapsible){$(element).on('click',$collapsible.open);}}};ko.bindingHandlers.toggleCollapsible={init:function(element,valueAccessor,allBindings,viewModel,bindingCtx){var name=valueAccessor()||defaults.as,$collapsible=bindingCtx[name];if($collapsible){$(element).on('click',$collapsible.toggle);}}};renderer.addAttribute('collapsible').addAttribute('openCollapsible').addAttribute('closeCollapsible').addAttribute('toggleCollapsible');});
|
||||
@@ -0,0 +1,16 @@
|
||||
define(['underscore','mageUtils','uiRegistry','uiElement'],function(_,utils,registry,Element){'use strict';function compact(container){return _.values(container).filter(utils.isObject);}
|
||||
function _findIndex(item,container){var index=_.findKey(container,function(value){return value===item;});if(typeof index==='undefined'){index=_.findKey(container,function(value){return value&&value.name===item;});}
|
||||
return typeof index==='undefined'?-1:index;}
|
||||
function _insertAt(item,container,position){var currentIndex=_findIndex(item,container),newIndex,target;if(typeof position==='undefined'){position=-1;}else if(typeof position==='string'){position=isNaN(+position)?position:+position;}
|
||||
newIndex=position;if(~currentIndex){target=container.splice(currentIndex,1)[0];if(typeof item==='string'){item=target;}}
|
||||
if(typeof position!=='number'){target=position.after||position.before||position;newIndex=_findIndex(target,container);if(~newIndex&&(position.after||newIndex>=currentIndex)){newIndex++;}}
|
||||
if(newIndex<0){newIndex+=container.length+1;}
|
||||
container[newIndex]?container.splice(newIndex,0,item):container[newIndex]=item;return!~currentIndex?item:currentIndex!==newIndex;}
|
||||
return Element.extend({defaults:{template:'ui/collection',_elems:[],ignoreTmpls:{childDefaults:true}},initObservable:function(){this._super().observe({elems:[]});return this;},initElement:function(elem){elem.initContainer(this);return this;},getChild:function(index){return _.findWhere(this.elems(),{index:index});},insertChild:function(elems,position){var container=this._elems,insert=this._insert.bind(this),update;if(!Array.isArray(elems)){elems=[elems];}
|
||||
elems.map(function(item){return item.elem?_insertAt(item.elem,container,item.position):_insertAt(item,container,position);}).forEach(function(item){if(item===true){update=true;}else if(_.isString(item)){registry.get(item,insert);}else if(utils.isObject(item)){insert(item);}});if(update){this._updateCollection();}
|
||||
return this;},removeChild:function(elem,skipUpdate){if(_.isString(elem)){elem=this.getChild(elem);}
|
||||
if(elem){utils.remove(this._elems,elem);if(!skipUpdate){this._updateCollection();}}
|
||||
return this;},destroyChildren:function(){this.elems.each(function(elem){elem.destroy(true);});this._updateCollection();},clear:function(){var elems=this.elems();_.each(elems,function(elem){if(_.isFunction(elem.clear)){elem.clear();}},this);return this;},hasChild:function(index){return!!this.getChild(index);},requestChild:function(index){var name=this.formChildName(index);return this.requestModule(name);},formChildName:function(index){return this.name+'.'+index;},getRegion:function(name){var regions=this.regions=this.regions||{};if(!regions[name]){regions[name]=[];this.observe.call(regions,name);}
|
||||
return regions[name];},regionHasElements:function(name){var region=this.getRegion(name);return region().length>0;},updateRegion:function(items,name){this.getRegion(name)(items);return this;},destroy:function(){this._super();this.elems.each('destroy');},_insert:function(elem){var index=_.findKey(this._elems,function(value){return value===elem.name;});if(typeof index!=='undefined'){this._elems[index]=elem;}
|
||||
this._updateCollection().initElement(elem);},_updateCollection:function(){var _elems=compact(this._elems),grouped;grouped=_elems.filter(function(elem){return elem.displayArea&&_.isString(elem.displayArea);});grouped=_.groupBy(grouped,'displayArea');_.each(grouped,this.updateRegion,this);_.each(this.regions,function(items){var hasObsoleteComponents=items().length&&!_.intersection(_elems,items()).length;if(hasObsoleteComponents){items.removeAll();}});this.elems(_elems);return this;},delegate:function(target){var args=_.toArray(arguments);target=this[target];if(_.isFunction(target)){return target.apply(this,args.slice(1));}
|
||||
return this._delegate(args);},_delegate:function(args){var result;result=this.elems.map(function(elem){var target;if(!_.isFunction(elem.delegate)){target=elem[args[0]];if(_.isFunction(target)){return target.apply(elem,args.slice(1));}}else{return elem.delegate.apply(elem,args);}});return _.flatten(result);}});});
|
||||
@@ -0,0 +1,6 @@
|
||||
define(['ko','jquery','../template/renderer','spectrum','tinycolor'],function(ko,$,renderer,spectrum,tinycolor){'use strict';function changeColorPickerStateBasedOnViewModel(element,viewModel){$(element).spectrum(viewModel.disabled()?'disable':'enable');}
|
||||
ko.bindingHandlers.colorPicker={init:function(element,valueAccessor,allBindings,viewModel){var config=valueAccessor(),changeValue=function(value){if(value==null){value='';}
|
||||
config.value(value.toString());};config.change=changeValue;config.hide=changeValue;config.show=function(){if(!viewModel.focused()){viewModel.focused(true);}
|
||||
return true;};$(element).spectrum(config);changeColorPickerStateBasedOnViewModel(element,viewModel);},update:function(element,valueAccessor,allBindings,viewModel){var config=valueAccessor();if(config.value()===undefined){config.value('');}
|
||||
if(tinycolor(config.value()).isValid()||config.value()===''){$(element).spectrum('set',config.value());if(config.value()!==''){config.value($(element).spectrum('get').toString());}}
|
||||
changeColorPickerStateBasedOnViewModel(element,viewModel);}};renderer.addAttribute('colorPicker');});
|
||||
@@ -0,0 +1,2 @@
|
||||
define(['jquery','domReady!'],function($){'use strict';$('form[data-auto-submit="true"]').trigger('submit');$(document).on('submit','form',function(e){var formKeyElement,existingFormKeyElement,isKeyPresentInForm,isActionExternal,baseUrl=window.BASE_URL,form=$(e.target),formKey=$('input[name="form_key"]').val(),formMethod=form.prop('method'),formAction=form.prop('action');isActionExternal=formAction.indexOf(baseUrl)!==0;existingFormKeyElement=form.find('input[name="form_key"]');isKeyPresentInForm=existingFormKeyElement.length;if(isKeyPresentInForm&&existingFormKeyElement.attr('auto-added-form-key')==='1'){isKeyPresentInForm=form.find('> input[name="form_key"]').length;}
|
||||
if(formKey&&!isKeyPresentInForm&&!isActionExternal&&formMethod!=='get'){formKeyElement=document.createElement('input');formKeyElement.setAttribute('type','hidden');formKeyElement.setAttribute('name','form_key');formKeyElement.setAttribute('value',formKey);formKeyElement.setAttribute('auto-added-form-key','1');form.get(0).appendChild(formKeyElement);}});});
|
||||
@@ -0,0 +1,3 @@
|
||||
define(['uiComponent','Magento_Customer/js/customer-data','jquery','mage/mage','mage/decorate'],function(Component,customerData,$){'use strict';var sidebarInitialized=false;function initSidebar(){if(sidebarInitialized){return;}
|
||||
sidebarInitialized=true;$('[data-role=compare-products-sidebar]').decorate('list',true);}
|
||||
return Component.extend({initialize:function(){this._super();this.compareProducts=customerData.get('compare-products');initSidebar();}});});
|
||||
@@ -0,0 +1,18 @@
|
||||
define(['underscore','mage/utils/objects'],function(_,utils){'use strict';var result=[];function equalArrays(keepOrder,target){var args=_.toArray(arguments),arrays;if(!Array.isArray(keepOrder)){arrays=args.slice(2);}else{target=keepOrder;keepOrder=false;arrays=args.slice(1);}
|
||||
if(!arrays.length){return true;}
|
||||
return arrays.every(function(array){if(array===target){return true;}else if(array.length!==target.length){return false;}else if(!keepOrder){return!_.difference(target,array).length;}
|
||||
return array.every(function(value,index){return target[index]===value;});});}
|
||||
function isDifferent(a,b){var oldIsPrimitive=utils.isPrimitive(a);if(Array.isArray(a)&&Array.isArray(b)){return!equalArrays(true,a,b);}
|
||||
return oldIsPrimitive?a!==b:true;}
|
||||
function getPath(prefix,part){return prefix?prefix+'.'+part:part;}
|
||||
function hasOwn(obj,key){return Object.prototype.hasOwnProperty.call(obj,key);}
|
||||
function getContainers(changes){var containers={},indexed=_.indexBy(changes,'path');_.each(indexed,function(change,name){var path;name.split('.').forEach(function(part){path=getPath(path,part);if(path in indexed){return;}
|
||||
(containers[path]=containers[path]||[]).push(change);});});return containers;}
|
||||
function addChange(path,name,type,newValue,oldValue){var data;data={path:path,name:name,type:type};if(type!=='remove'){data.value=newValue;data.oldValue=oldValue;}else{data.oldValue=newValue;}
|
||||
result.push(data);}
|
||||
function setAll(ns,name,type,iterator,placeholder){var key;if(arguments.length>4){type==='add'?addChange(ns,name,'update',iterator,placeholder):addChange(ns,name,'update',placeholder,iterator);}else{addChange(ns,name,type,iterator);}
|
||||
if(!utils.isObject(iterator)){return;}
|
||||
for(key in iterator){if(hasOwn(iterator,key)){setAll(getPath(ns,key),key,type,iterator[key]);}}}
|
||||
function compare(old,current,ns,name){var key,oldIsObj=utils.isObject(old),newIsObj=utils.isObject(current);if(oldIsObj&&newIsObj){for(key in old){if(hasOwn(old,key)&&!hasOwn(current,key)){setAll(getPath(ns,key),key,'remove',old[key]);}}
|
||||
for(key in current){if(hasOwn(current,key)){hasOwn(old,key)?compare(old[key],current[key],getPath(ns,key),key):setAll(getPath(ns,key),key,'add',current[key]);}}}else if(oldIsObj){setAll(ns,name,'remove',old,current);}else if(newIsObj){setAll(ns,name,'add',current,old);}else if(isDifferent(old,current)){addChange(ns,name,'update',current,old);}}
|
||||
return{compare:function(){var changes;compare.apply(null,arguments);changes=result.splice(0);return{containers:getContainers(changes),changes:changes,equal:!changes.length};},equalArrays:equalArrays};});
|
||||
@@ -0,0 +1 @@
|
||||
define(['jquery-ui-modules/core','jquery-ui-modules/accordion','jquery-ui-modules/autocomplete','jquery-ui-modules/button','jquery-ui-modules/datepicker','jquery-ui-modules/dialog','jquery-ui-modules/draggable','jquery-ui-modules/droppable','jquery-ui-modules/effect-blind','jquery-ui-modules/effect-bounce','jquery-ui-modules/effect-clip','jquery-ui-modules/effect-drop','jquery-ui-modules/effect-explode','jquery-ui-modules/effect-fade','jquery-ui-modules/effect-fold','jquery-ui-modules/effect-highlight','jquery-ui-modules/effect-scale','jquery-ui-modules/effect-pulsate','jquery-ui-modules/effect-shake','jquery-ui-modules/effect-slide','jquery-ui-modules/effect-transfer','jquery-ui-modules/effect','jquery-ui-modules/menu','jquery-ui-modules/mouse','jquery-ui-modules/position','jquery-ui-modules/progressbar','jquery-ui-modules/resizable','jquery-ui-modules/selectable','jquery-ui-modules/slider','jquery-ui-modules/sortable','jquery-ui-modules/spinner','jquery-ui-modules/tabs','jquery-ui-modules/timepicker','jquery-ui-modules/tooltip','jquery-ui-modules/widget'],function(){console.warn('Fallback to JQueryUI Compat activated. '+'Your store is missing a dependency for a '+'jQueryUI widget. Identifying and addressing the dependency '+'will drastically improve the performance of your site.');});
|
||||
@@ -0,0 +1,2 @@
|
||||
define(['jquery','underscore','mage/translate','jquery-ui-modules/widget','Magento_Ui/js/modal/modal'],function($,_,$t){'use strict';$.widget('mage.confirm',$.mage.modal,{options:{modalClass:'confirm',title:'',focus:'.action-accept',actions:{always:function(){},confirm:function(){},cancel:function(){}},buttons:[{text:$t('Cancel'),class:'action-secondary action-dismiss',click:function(event){this.closeModal(event);}},{text:$t('OK'),class:'action-primary action-accept',click:function(event){this.closeModal(event,true);}}]},_create:function(){this._super();this.modal.find(this.options.modalCloseBtn).off().on('click',_.bind(this.closeModal,this));this.openModal();},_remove:function(){this.modal.remove();},openModal:function(){return this._super();},closeModal:function(event,result){result=result||false;if(result){this.options.actions.confirm(event);}else{this.options.actions.cancel(event);}
|
||||
this.options.actions.always(event);this.element.on('confirmclosed',_.bind(this._remove,this));return this._super();}});return function(config){return $('<div></div>').html(config.content).confirm(config);};});
|
||||
@@ -0,0 +1,4 @@
|
||||
define(['./logger','./entry-factory','./console-output-handler','./formatter','./message-pool','./levels-pool','Magento_Ui/js/lib/core/storage/local','underscore','./logger-utils'],function(Logger,entryFactory,ConsoleHandler,Formatter,messagePoll,levelsPoll,storage,_,LoggerUtils){'use strict';var STORAGE_NAMESPACE='CONSOLE_LOGGER';function ConsoleLogger(){var formatter=new Formatter(),consoleHandler=new ConsoleHandler(formatter),savedLevel=storage.get(STORAGE_NAMESPACE),utils=new LoggerUtils(this);Logger.call(this,consoleHandler,entryFactory);if(savedLevel){this.displayLevel_=savedLevel;}
|
||||
this.utils=utils;this.messages=messagePoll;this.levels=levelsPoll.getLevels();}
|
||||
_.extend(ConsoleLogger,Logger);ConsoleLogger.prototype=Object.create(Logger.prototype);ConsoleLogger.prototype.constructor=ConsoleLogger;ConsoleLogger.prototype.setDisplayLevel=function(level){Logger.prototype.setDisplayLevel.call(this,level);storage.set(STORAGE_NAMESPACE,level);};ConsoleLogger.prototype.createEntry_=function(message,level,data){var code;if(messagePoll.hasMessage(message)){data=data||{};code=message;message=messagePoll.getMessage(code);data.messageCode=code;}
|
||||
return Logger.prototype.createEntry_.call(this,message,level,data);};return new ConsoleLogger();});
|
||||
@@ -0,0 +1,2 @@
|
||||
define(['./levels-pool'],function(logLevels){'use strict';var levels=logLevels.getLevels();function ConsoleOutputHandler(formatter){this.formatter_=formatter;}
|
||||
ConsoleOutputHandler.prototype.show=function(entry){var displayString=this.formatter_.process(entry);switch(entry.level){case levels.ERROR:console.error(displayString);break;case levels.WARN:console.warn(displayString);break;case levels.INFO:console.info(displayString);break;case levels.DEBUG:console.log(displayString);break;}};ConsoleOutputHandler.prototype.dump=function(entries){entries.forEach(this.show,this);};return ConsoleOutputHandler;});
|
||||
@@ -0,0 +1,21 @@
|
||||
/*!
|
||||
* jQuery UI Controlgroup 1.13.2
|
||||
* http://jqueryui.com
|
||||
*
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*/
|
||||
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","../widget"],factory);}else{factory(jQuery);}})(function($){"use strict";var controlgroupCornerRegex=/ui-corner-([a-z]){2,6}/g;return $.widget("ui.controlgroup",{version:"1.13.2",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:true,items:{"button":"input[type=button], input[type=submit], input[type=reset], button, a","controlgroupLabel":".ui-controlgroup-label","checkboxradio":"input[type='checkbox'], input[type='radio']","selectmenu":"select","spinner":".ui-spinner-input"}},_create:function(){this._enhance();},_enhance:function(){this.element.attr("role","toolbar");this.refresh();},_destroy:function(){this._callChildMethod("destroy");this.childWidgets.removeData("ui-controlgroup-data");this.element.removeAttr("role");if(this.options.items.controlgroupLabel){this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap();}},_initWidgets:function(){var that=this,childWidgets=[];$.each(this.options.items,function(widget,selector){var labels;var options={};if(!selector){return;}
|
||||
if(widget==="controlgroupLabel"){labels=that.element.find(selector);labels.each(function(){var element=$(this);if(element.children(".ui-controlgroup-label-contents").length){return;}
|
||||
element.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>");});that._addClass(labels,null,"ui-widget ui-widget-content ui-state-default");childWidgets=childWidgets.concat(labels.get());return;}
|
||||
if(!$.fn[widget]){return;}
|
||||
if(that["_"+widget+"Options"]){options=that["_"+widget+"Options"]("middle");}else{options={classes:{}};}
|
||||
that.element.find(selector).each(function(){var element=$(this);var instance=element[widget]("instance");var instanceOptions=$.widget.extend({},options);if(widget==="button"&&element.parent(".ui-spinner").length){return;}
|
||||
if(!instance){instance=element[widget]()[widget]("instance");}
|
||||
if(instance){instanceOptions.classes=that._resolveClassesValues(instanceOptions.classes,instance);}
|
||||
element[widget](instanceOptions);var widgetElement=element[widget]("widget");$.data(widgetElement[0],"ui-controlgroup-data",instance?instance:element[widget]("instance"));childWidgets.push(widgetElement[0]);});});this.childWidgets=$($.uniqueSort(childWidgets));this._addClass(this.childWidgets,"ui-controlgroup-item");},_callChildMethod:function(method){this.childWidgets.each(function(){var element=$(this),data=element.data("ui-controlgroup-data");if(data&&data[method]){data[method]();}});},_updateCornerClass:function(element,position){var remove="ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all";var add=this._buildSimpleOptions(position,"label").classes.label;this._removeClass(element,null,remove);this._addClass(element,null,add);},_buildSimpleOptions:function(position,key){var direction=this.options.direction==="vertical";var result={classes:{}};result.classes[key]={"middle":"","first":"ui-corner-"+(direction?"top":"left"),"last":"ui-corner-"+(direction?"bottom":"right"),"only":"ui-corner-all"}[position];return result;},_spinnerOptions:function(position){var options=this._buildSimpleOptions(position,"ui-spinner");options.classes["ui-spinner-up"]="";options.classes["ui-spinner-down"]="";return options;},_buttonOptions:function(position){return this._buildSimpleOptions(position,"ui-button");},_checkboxradioOptions:function(position){return this._buildSimpleOptions(position,"ui-checkboxradio-label");},_selectmenuOptions:function(position){var direction=this.options.direction==="vertical";return{width:direction?"auto":false,classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(direction?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(direction?"top":"left")},last:{"ui-selectmenu-button-open":direction?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(direction?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[position]};},_resolveClassesValues:function(classes,instance){var result={};$.each(classes,function(key){var current=instance.options.classes[key]||"";current=String.prototype.trim.call(current.replace(controlgroupCornerRegex,""));result[key]=(current+" "+classes[key]).replace(/\s+/g," ");});return result;},_setOption:function(key,value){if(key==="direction"){this._removeClass("ui-controlgroup-"+this.options.direction);}
|
||||
this._super(key,value);if(key==="disabled"){this._callChildMethod(value?"disable":"enable");return;}
|
||||
this.refresh();},refresh:function(){var children,that=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction);if(this.options.direction==="horizontal"){this._addClass(null,"ui-helper-clearfix");}
|
||||
this._initWidgets();children=this.childWidgets;if(this.options.onlyVisible){children=children.filter(":visible");}
|
||||
if(children.length){$.each(["first","last"],function(index,value){var instance=children[value]().data("ui-controlgroup-data");if(instance&&that["_"+instance.widgetName+"Options"]){var options=that["_"+instance.widgetName+"Options"](children.length===1?"only":value);options.classes=that._resolveClassesValues(options.classes,instance);instance.element[instance.widgetName](options);}else{that._updateCornerClass(children[value](),value);}});this._callChildMethod("refresh");}}});});
|
||||
@@ -0,0 +1 @@
|
||||
define(['jquery','Magento_Ui/js/modal/modal','mage/translate'],function($,modal){'use strict';$.widget('mage.cookieStatus',{options:{type:'popup',responsive:true,innerScroll:true,autoOpen:true,buttons:[{text:$.mage.__('Close'),class:'cookie-status',click:function(){this.closeModal();}}]},_init:function(){if(!navigator.cookieEnabled){modal(this.options,$('#cookie-status'));}}});return $.mage.cookieStatus;});
|
||||
@@ -0,0 +1,10 @@
|
||||
define(['jquery','mage/mage','jquery/jquery.cookie'],function($){'use strict';var CookieHelper=function(){this.defaults={expires:null,path:'/',domain:null,secure:false,lifetime:null,samesite:'lax'};function lifetimeToExpires(options,defaults){var expires,lifetime;lifetime=options.lifetime||defaults.lifetime;if(lifetime&&lifetime>0){expires=options.expires||new Date();return new Date(expires.getTime()+lifetime*1000);}
|
||||
return null;}
|
||||
this.set=function(name,value,options){var expires,path,domain,secure,samesite;options=$.extend({},this.defaults,options||{});expires=lifetimeToExpires(options,this.defaults)||options.expires;path=options.path;domain=options.domain;secure=options.secure;samesite=options.samesite;document.cookie=name+'='+encodeURIComponent(value)+
|
||||
(expires?'; expires='+expires.toUTCString():'')+
|
||||
(path?'; path='+path:'')+
|
||||
(domain?'; domain='+domain:'')+
|
||||
(secure?'; secure':'')+'; samesite='+(samesite?samesite:'lax');};this.get=function(name){var arg=name+'=',aLength=arg.length,cookie=document.cookie,cLength=cookie.length,i=0,j=0;while(i<cLength){j=i+aLength;if(cookie.substring(i,j)===arg){return this.getCookieVal(j);}
|
||||
i=cookie.indexOf(' ',i)+1;if(i===0){break;}}
|
||||
return null;};this.clear=function(name){if(this.get(name)){this.set(name,'',{expires:new Date('Jan 01 1970 00:00:01 GMT')});}};this.getCookieVal=function(offset){var cookie=document.cookie,endstr=cookie.indexOf(';',offset);if(endstr===-1){endstr=cookie.length;}
|
||||
return decodeURIComponent(cookie.substring(offset,endstr));};return this;};$.extend(true,$,{mage:{cookies:new CookieHelper()}});return function(pageOptions){$.extend($.mage.cookies.defaults,pageOptions);$.extend($.cookie.defaults,$.mage.cookies.defaults);};});
|
||||
@@ -0,0 +1 @@
|
||||
(function(){"use strict";define(["jquery","./data","./disable-selection","./focusable","./form","./ie","./keycode","./labels","./jquery-patch","./plugin","./safe-active-element","./safe-blur","./scroll-parent","./tabbable","./unique-id","./version"]);})();
|
||||
@@ -0,0 +1,162 @@
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-stretch: 100%;
|
||||
src: url(https://fonts.gstatic.com/s/roboto/v49/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3GUBGEe.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-stretch: 100%;
|
||||
src: url(https://fonts.gstatic.com/s/roboto/v49/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3iUBGEe.woff2) format('woff2');
|
||||
unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* greek-ext */
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-stretch: 100%;
|
||||
src: url(https://fonts.gstatic.com/s/roboto/v49/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3CUBGEe.woff2) format('woff2');
|
||||
unicode-range: U+1F00-1FFF;
|
||||
}
|
||||
/* greek */
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-stretch: 100%;
|
||||
src: url(https://fonts.gstatic.com/s/roboto/v49/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3-UBGEe.woff2) format('woff2');
|
||||
unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
|
||||
}
|
||||
/* math */
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-stretch: 100%;
|
||||
src: url(https://fonts.gstatic.com/s/roboto/v49/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMawCUBGEe.woff2) format('woff2');
|
||||
unicode-range: U+0302-0303, U+0305, U+0307-0308, U+0310, U+0312, U+0315, U+031A, U+0326-0327, U+032C, U+032F-0330, U+0332-0333, U+0338, U+033A, U+0346, U+034D, U+0391-03A1, U+03A3-03A9, U+03B1-03C9, U+03D1, U+03D5-03D6, U+03F0-03F1, U+03F4-03F5, U+2016-2017, U+2034-2038, U+203C, U+2040, U+2043, U+2047, U+2050, U+2057, U+205F, U+2070-2071, U+2074-208E, U+2090-209C, U+20D0-20DC, U+20E1, U+20E5-20EF, U+2100-2112, U+2114-2115, U+2117-2121, U+2123-214F, U+2190, U+2192, U+2194-21AE, U+21B0-21E5, U+21F1-21F2, U+21F4-2211, U+2213-2214, U+2216-22FF, U+2308-230B, U+2310, U+2319, U+231C-2321, U+2336-237A, U+237C, U+2395, U+239B-23B7, U+23D0, U+23DC-23E1, U+2474-2475, U+25AF, U+25B3, U+25B7, U+25BD, U+25C1, U+25CA, U+25CC, U+25FB, U+266D-266F, U+27C0-27FF, U+2900-2AFF, U+2B0E-2B11, U+2B30-2B4C, U+2BFE, U+3030, U+FF5B, U+FF5D, U+1D400-1D7FF, U+1EE00-1EEFF;
|
||||
}
|
||||
/* symbols */
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-stretch: 100%;
|
||||
src: url(https://fonts.gstatic.com/s/roboto/v49/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMaxKUBGEe.woff2) format('woff2');
|
||||
unicode-range: U+0001-000C, U+000E-001F, U+007F-009F, U+20DD-20E0, U+20E2-20E4, U+2150-218F, U+2190, U+2192, U+2194-2199, U+21AF, U+21E6-21F0, U+21F3, U+2218-2219, U+2299, U+22C4-22C6, U+2300-243F, U+2440-244A, U+2460-24FF, U+25A0-27BF, U+2800-28FF, U+2921-2922, U+2981, U+29BF, U+29EB, U+2B00-2BFF, U+4DC0-4DFF, U+FFF9-FFFB, U+10140-1018E, U+10190-1019C, U+101A0, U+101D0-101FD, U+102E0-102FB, U+10E60-10E7E, U+1D2C0-1D2D3, U+1D2E0-1D37F, U+1F000-1F0FF, U+1F100-1F1AD, U+1F1E6-1F1FF, U+1F30D-1F30F, U+1F315, U+1F31C, U+1F31E, U+1F320-1F32C, U+1F336, U+1F378, U+1F37D, U+1F382, U+1F393-1F39F, U+1F3A7-1F3A8, U+1F3AC-1F3AF, U+1F3C2, U+1F3C4-1F3C6, U+1F3CA-1F3CE, U+1F3D4-1F3E0, U+1F3ED, U+1F3F1-1F3F3, U+1F3F5-1F3F7, U+1F408, U+1F415, U+1F41F, U+1F426, U+1F43F, U+1F441-1F442, U+1F444, U+1F446-1F449, U+1F44C-1F44E, U+1F453, U+1F46A, U+1F47D, U+1F4A3, U+1F4B0, U+1F4B3, U+1F4B9, U+1F4BB, U+1F4BF, U+1F4C8-1F4CB, U+1F4D6, U+1F4DA, U+1F4DF, U+1F4E3-1F4E6, U+1F4EA-1F4ED, U+1F4F7, U+1F4F9-1F4FB, U+1F4FD-1F4FE, U+1F503, U+1F507-1F50B, U+1F50D, U+1F512-1F513, U+1F53E-1F54A, U+1F54F-1F5FA, U+1F610, U+1F650-1F67F, U+1F687, U+1F68D, U+1F691, U+1F694, U+1F698, U+1F6AD, U+1F6B2, U+1F6B9-1F6BA, U+1F6BC, U+1F6C6-1F6CF, U+1F6D3-1F6D7, U+1F6E0-1F6EA, U+1F6F0-1F6F3, U+1F6F7-1F6FC, U+1F700-1F7FF, U+1F800-1F80B, U+1F810-1F847, U+1F850-1F859, U+1F860-1F887, U+1F890-1F8AD, U+1F8B0-1F8BB, U+1F8C0-1F8C1, U+1F900-1F90B, U+1F93B, U+1F946, U+1F984, U+1F996, U+1F9E9, U+1FA00-1FA6F, U+1FA70-1FA7C, U+1FA80-1FA89, U+1FA8F-1FAC6, U+1FACE-1FADC, U+1FADF-1FAE9, U+1FAF0-1FAF8, U+1FB00-1FBFF;
|
||||
}
|
||||
/* vietnamese */
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-stretch: 100%;
|
||||
src: url(https://fonts.gstatic.com/s/roboto/v49/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3OUBGEe.woff2) format('woff2');
|
||||
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-stretch: 100%;
|
||||
src: url(https://fonts.gstatic.com/s/roboto/v49/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3KUBGEe.woff2) format('woff2');
|
||||
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-stretch: 100%;
|
||||
src: url(https://fonts.gstatic.com/s/roboto/v49/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3yUBA.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
font-stretch: 100%;
|
||||
src: url(https://fonts.gstatic.com/s/roboto/v49/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3GUBGEe.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
font-stretch: 100%;
|
||||
src: url(https://fonts.gstatic.com/s/roboto/v49/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3iUBGEe.woff2) format('woff2');
|
||||
unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* greek-ext */
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
font-stretch: 100%;
|
||||
src: url(https://fonts.gstatic.com/s/roboto/v49/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3CUBGEe.woff2) format('woff2');
|
||||
unicode-range: U+1F00-1FFF;
|
||||
}
|
||||
/* greek */
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
font-stretch: 100%;
|
||||
src: url(https://fonts.gstatic.com/s/roboto/v49/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3-UBGEe.woff2) format('woff2');
|
||||
unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
|
||||
}
|
||||
/* math */
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
font-stretch: 100%;
|
||||
src: url(https://fonts.gstatic.com/s/roboto/v49/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMawCUBGEe.woff2) format('woff2');
|
||||
unicode-range: U+0302-0303, U+0305, U+0307-0308, U+0310, U+0312, U+0315, U+031A, U+0326-0327, U+032C, U+032F-0330, U+0332-0333, U+0338, U+033A, U+0346, U+034D, U+0391-03A1, U+03A3-03A9, U+03B1-03C9, U+03D1, U+03D5-03D6, U+03F0-03F1, U+03F4-03F5, U+2016-2017, U+2034-2038, U+203C, U+2040, U+2043, U+2047, U+2050, U+2057, U+205F, U+2070-2071, U+2074-208E, U+2090-209C, U+20D0-20DC, U+20E1, U+20E5-20EF, U+2100-2112, U+2114-2115, U+2117-2121, U+2123-214F, U+2190, U+2192, U+2194-21AE, U+21B0-21E5, U+21F1-21F2, U+21F4-2211, U+2213-2214, U+2216-22FF, U+2308-230B, U+2310, U+2319, U+231C-2321, U+2336-237A, U+237C, U+2395, U+239B-23B7, U+23D0, U+23DC-23E1, U+2474-2475, U+25AF, U+25B3, U+25B7, U+25BD, U+25C1, U+25CA, U+25CC, U+25FB, U+266D-266F, U+27C0-27FF, U+2900-2AFF, U+2B0E-2B11, U+2B30-2B4C, U+2BFE, U+3030, U+FF5B, U+FF5D, U+1D400-1D7FF, U+1EE00-1EEFF;
|
||||
}
|
||||
/* symbols */
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
font-stretch: 100%;
|
||||
src: url(https://fonts.gstatic.com/s/roboto/v49/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMaxKUBGEe.woff2) format('woff2');
|
||||
unicode-range: U+0001-000C, U+000E-001F, U+007F-009F, U+20DD-20E0, U+20E2-20E4, U+2150-218F, U+2190, U+2192, U+2194-2199, U+21AF, U+21E6-21F0, U+21F3, U+2218-2219, U+2299, U+22C4-22C6, U+2300-243F, U+2440-244A, U+2460-24FF, U+25A0-27BF, U+2800-28FF, U+2921-2922, U+2981, U+29BF, U+29EB, U+2B00-2BFF, U+4DC0-4DFF, U+FFF9-FFFB, U+10140-1018E, U+10190-1019C, U+101A0, U+101D0-101FD, U+102E0-102FB, U+10E60-10E7E, U+1D2C0-1D2D3, U+1D2E0-1D37F, U+1F000-1F0FF, U+1F100-1F1AD, U+1F1E6-1F1FF, U+1F30D-1F30F, U+1F315, U+1F31C, U+1F31E, U+1F320-1F32C, U+1F336, U+1F378, U+1F37D, U+1F382, U+1F393-1F39F, U+1F3A7-1F3A8, U+1F3AC-1F3AF, U+1F3C2, U+1F3C4-1F3C6, U+1F3CA-1F3CE, U+1F3D4-1F3E0, U+1F3ED, U+1F3F1-1F3F3, U+1F3F5-1F3F7, U+1F408, U+1F415, U+1F41F, U+1F426, U+1F43F, U+1F441-1F442, U+1F444, U+1F446-1F449, U+1F44C-1F44E, U+1F453, U+1F46A, U+1F47D, U+1F4A3, U+1F4B0, U+1F4B3, U+1F4B9, U+1F4BB, U+1F4BF, U+1F4C8-1F4CB, U+1F4D6, U+1F4DA, U+1F4DF, U+1F4E3-1F4E6, U+1F4EA-1F4ED, U+1F4F7, U+1F4F9-1F4FB, U+1F4FD-1F4FE, U+1F503, U+1F507-1F50B, U+1F50D, U+1F512-1F513, U+1F53E-1F54A, U+1F54F-1F5FA, U+1F610, U+1F650-1F67F, U+1F687, U+1F68D, U+1F691, U+1F694, U+1F698, U+1F6AD, U+1F6B2, U+1F6B9-1F6BA, U+1F6BC, U+1F6C6-1F6CF, U+1F6D3-1F6D7, U+1F6E0-1F6EA, U+1F6F0-1F6F3, U+1F6F7-1F6FC, U+1F700-1F7FF, U+1F800-1F80B, U+1F810-1F847, U+1F850-1F859, U+1F860-1F887, U+1F890-1F8AD, U+1F8B0-1F8BB, U+1F8C0-1F8C1, U+1F900-1F90B, U+1F93B, U+1F946, U+1F984, U+1F996, U+1F9E9, U+1FA00-1FA6F, U+1FA70-1FA7C, U+1FA80-1FA89, U+1FA8F-1FAC6, U+1FACE-1FADC, U+1FADF-1FAE9, U+1FAF0-1FAF8, U+1FB00-1FBFF;
|
||||
}
|
||||
/* vietnamese */
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
font-stretch: 100%;
|
||||
src: url(https://fonts.gstatic.com/s/roboto/v49/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3OUBGEe.woff2) format('woff2');
|
||||
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
font-stretch: 100%;
|
||||
src: url(https://fonts.gstatic.com/s/roboto/v49/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3KUBGEe.woff2) format('woff2');
|
||||
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
font-stretch: 100%;
|
||||
src: url(https://fonts.gstatic.com/s/roboto/v49/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3yUBA.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
define(['jquery','ko','./customer/address'],function($,ko,Address){'use strict';var isLoggedIn=ko.observable(window.isCustomerLoggedIn);return{getAddressItems:function(){var items=[],customerData=window.customerData;if(isLoggedIn()){if(Object.keys(customerData).length){$.each(customerData.addresses,function(key,item){items.push(new Address(item));});}}
|
||||
return items;}};});
|
||||
@@ -0,0 +1,3 @@
|
||||
define(['jquery','mage/utils/wrapper'],function($,wrapper){'use strict';var mixin={getExpiredSectionNames:function(originFn){var expiredSections=originFn(),storage=$.initNamespaceStorage('mage-cache-storage').localStorage,currentTimestamp=Math.floor(Date.now()/ 1000),persistentIndex=expiredSections.indexOf('persistent'),persistentLifeTime=0,sectionData;if(window.persistent!==undefined&&window.persistent.expirationLifetime!==undefined){persistentLifeTime=window.persistent.expirationLifetime;}
|
||||
if(persistentIndex!==-1){sectionData=storage.get('persistent');if(typeof sectionData==='object'&§ionData['data_id']+persistentLifeTime>=currentTimestamp){expiredSections.splice(persistentIndex,1);}}
|
||||
return expiredSections;}};return function(target){return wrapper.extend(target,mixin);};});
|
||||
@@ -0,0 +1,6 @@
|
||||
define(['jquery','underscore','ko','Magento_Customer/js/section-config','mage/url','mage/storage','jquery/jquery-storageapi'],function($,_,ko,sectionConfig,url){'use strict';var options={},storage,storageInvalidation,invalidateCacheBySessionTimeOut,invalidateCacheByCloseCookieSession,dataProvider,buffer,customerData,deferred=$.Deferred();url.setBaseUrl(window.BASE_URL);options.sectionLoadUrl=url.build('customer/section/load');invalidateCacheBySessionTimeOut=function(invalidateOptions){var date;if(new Date($.localStorage.get('mage-cache-timeout'))<new Date()){storage.removeAll();}
|
||||
date=new Date(Date.now()+parseInt(invalidateOptions.cookieLifeTime,10)*1000);$.localStorage.set('mage-cache-timeout',date);};invalidateCacheByCloseCookieSession=function(){if(!$.cookieStorage.isSet('mage-cache-sessid')){$.cookieStorage.set('mage-cache-sessid',true);storage.removeAll();}};dataProvider={getFromStorage:function(sectionNames){var result={};_.each(sectionNames,function(sectionName){result[sectionName]=storage.get(sectionName);});return result;},getFromServer:function(sectionNames,forceNewSectionTimestamp){var parameters;sectionNames=sectionConfig.filterClientSideSections(sectionNames);parameters=_.isArray(sectionNames)&§ionNames.indexOf('*')<0?{sections:sectionNames.join(',')}:[];parameters['force_new_section_timestamp']=forceNewSectionTimestamp;return $.getJSON(options.sectionLoadUrl,parameters).fail(function(jqXHR){throw new Error(jqXHR);});}};ko.extenders.disposableCustomerData=function(target,sectionName){var sectionDataIds,newSectionDataIds={};target.subscribe(function(){setTimeout(function(){storage.remove(sectionName);sectionDataIds=$.cookieStorage.get('section_data_ids')||{};_.each(sectionDataIds,function(data,name){if(name!==sectionName){newSectionDataIds[name]=data;}});$.cookieStorage.set('section_data_ids',newSectionDataIds);},3000);});return target;};buffer={data:{},bind:function(sectionName){this.data[sectionName]=ko.observable({});},get:function(sectionName){if(!this.data[sectionName]){this.bind(sectionName);}
|
||||
return this.data[sectionName];},keys:function(){return _.keys(this.data);},notify:function(sectionName,sectionData){if(!this.data[sectionName]){this.bind(sectionName);}
|
||||
this.data[sectionName](sectionData);},update:function(sections){var sectionId=0,sectionDataIds=$.cookieStorage.get('section_data_ids')||{};_.each(sections,function(sectionData,sectionName){sectionId=sectionData['data_id'];sectionDataIds[sectionName]=sectionId;storage.set(sectionName,sectionData);storageInvalidation.remove(sectionName);buffer.notify(sectionName,sectionData);});$.cookieStorage.set('section_data_ids',sectionDataIds);},remove:function(sections){_.each(sections,function(sectionName){storage.remove(sectionName);if(!sectionConfig.isClientSideSection(sectionName)){storageInvalidation.set(sectionName,true);}});}};customerData={init:function(){var expiredSectionNames=this.getExpiredSectionNames();if(expiredSectionNames.length>0){_.each(dataProvider.getFromStorage(storage.keys()),function(sectionData,sectionName){buffer.notify(sectionName,sectionData);});this.reload(expiredSectionNames,false);}else{_.each(dataProvider.getFromStorage(storage.keys()),function(sectionData,sectionName){buffer.notify(sectionName,sectionData);});if(!_.isEmpty(storageInvalidation.keys())){this.reload(storageInvalidation.keys(),false);}}
|
||||
if(!_.isEmpty($.cookieStorage.get('section_data_clean'))){this.reload(sectionConfig.getSectionNames(),true);$.cookieStorage.set('section_data_clean','');}},initStorage:function(){$.cookieStorage.setConf({path:'/',expires:new Date(Date.now()+parseInt(options.cookieLifeTime,10)*1000)});storage=$.initNamespaceStorage('mage-cache-storage').localStorage;storageInvalidation=$.initNamespaceStorage('mage-cache-storage-section-invalidation').localStorage;},getExpiredSectionNames:function(){var expiredSectionNames=[],cookieSectionTimestamps=$.cookieStorage.get('section_data_ids')||{},sectionLifetime=options.expirableSectionLifetime*60,currentTimestamp=Math.floor(Date.now()/ 1000),sectionData;_.each(options.expirableSectionNames,function(sectionName){sectionData=storage.get(sectionName);if(typeof sectionData==='object'&§ionData['data_id']+sectionLifetime<=currentTimestamp){expiredSectionNames.push(sectionName);}});_.each(cookieSectionTimestamps,function(cookieSectionTimestamp,sectionName){sectionData=storage.get(sectionName);if(typeof sectionData==='undefined'||typeof sectionData==='object'&&cookieSectionTimestamp!==sectionData['data_id']){expiredSectionNames.push(sectionName);}});expiredSectionNames=_.intersection(expiredSectionNames,sectionConfig.getSectionNames());return _.uniq(expiredSectionNames);},needReload:function(){var expiredSectionNames=this.getExpiredSectionNames();return expiredSectionNames.length>0;},getExpiredKeys:function(){return this.getExpiredSectionNames();},get:function(sectionName){return buffer.get(sectionName);},set:function(sectionName,sectionData){var data={};data[sectionName]=sectionData;buffer.update(data);},reload:function(sectionNames,forceNewSectionTimestamp){return dataProvider.getFromServer(sectionNames,forceNewSectionTimestamp).done(function(sections){$(document).trigger('customer-data-reload',[sectionNames]);buffer.update(sections);});},invalidate:function(sectionNames){var sectionDataIds,sectionsNamesForInvalidation;sectionsNamesForInvalidation=_.contains(sectionNames,'*')?sectionConfig.getSectionNames():sectionNames;$(document).trigger('customer-data-invalidate',[sectionsNamesForInvalidation]);buffer.remove(sectionsNamesForInvalidation);sectionDataIds=$.cookieStorage.get('section_data_ids')||{};_.each(sectionsNamesForInvalidation,function(sectionName){if(!sectionConfig.isClientSideSection(sectionName)){sectionDataIds[sectionName]+=1000;}});$.cookieStorage.set('section_data_ids',sectionDataIds);},getInitCustomerData:function(){return deferred.promise();},onAjaxComplete:function(jsonResponse,settings){var sections,redirects;if(settings.type.match(/post|put|delete/i)){sections=sectionConfig.getAffectedSections(settings.url);if(sections&§ions.length){this.invalidate(sections);redirects=['redirect','backUrl'];if(_.isObject(jsonResponse)&&!_.isEmpty(_.pick(jsonResponse,redirects))){return;}
|
||||
this.reload(sections,true);}}},'Magento_Customer/js/customer-data':function(settings){options=settings;customerData.initStorage();invalidateCacheBySessionTimeOut(settings);invalidateCacheByCloseCookieSession();customerData.init();deferred.resolve();}};$(document).on('ajaxComplete',function(event,xhr,settings){customerData.onAjaxComplete(xhr.responseJSON,settings);});$(document).on('submit',function(event){var sections;if(event.target.method.match(/post|put|delete/i)){sections=sectionConfig.getAffectedSections(event.target.action);if(sections){customerData.invalidate(sections);}}});return customerData;});
|
||||
@@ -0,0 +1 @@
|
||||
define(['jquery'],function($){'use strict';return function(){$.validator.addMethod('validate-email-plus',function(value,element){var pattern=/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*(\.[a-zA-Z]{2,12})$/;var result=pattern.test(value);return result;},$.mage.__('Invalid email'))}});
|
||||
@@ -0,0 +1,10 @@
|
||||
define(['jquery','ko','underscore','./address-list'],function($,ko,_,addressList){'use strict';var isLoggedIn=ko.observable(window.isCustomerLoggedIn),customerData={};if(isLoggedIn()){customerData=window.customerData;}else{customerData={};}
|
||||
return{customerData:customerData,customerDetails:{},isLoggedIn:isLoggedIn,setIsLoggedIn:function(flag){isLoggedIn(flag);},getBillingAddressList:function(){return addressList();},getShippingAddressList:function(){return addressList();},setDetails:function(fieldName,value){if(fieldName){this.customerDetails[fieldName]=value;}},getDetails:function(fieldName){if(fieldName){if(this.customerDetails.hasOwnProperty(fieldName)){return this.customerDetails[fieldName];}
|
||||
return undefined;}
|
||||
return this.customerDetails;},addCustomerAddress:function(address){var fields=['customer_id','country_id','street','company','telephone','fax','postcode','city','firstname','lastname','middlename','prefix','suffix','vat_id','default_billing','default_shipping'],customerAddress={},hasAddress=0,existingAddress;if(!this.customerData.addresses){this.customerData.addresses=[];}
|
||||
customerAddress=_.pick(address,fields);if(address.hasOwnProperty('region_id')){customerAddress.region={'region_id':address['region_id'],region:address.region};}
|
||||
for(existingAddress in this.customerData.addresses){if(this.customerData.addresses.hasOwnProperty(existingAddress)){if(_.isEqual(this.customerData.addresses[existingAddress],customerAddress)){hasAddress=existingAddress;break;}}}
|
||||
if(hasAddress===0){return this.customerData.addresses.push(customerAddress)-1;}
|
||||
return hasAddress;},setAddressAsDefaultBilling:function(addressId){if(this.customerData.addresses[addressId]){this.customerData.addresses[addressId]['default_billing']=1;return true;}
|
||||
return false;},setAddressAsDefaultShipping:function(addressId){if(this.customerData.addresses[addressId]){this.customerData.addresses[addressId]['default_shipping']=1;return true;}
|
||||
return false;}};});
|
||||
@@ -0,0 +1 @@
|
||||
define(['uiComponent','Magento_Customer/js/customer-data'],function(Component,customerData){'use strict';return Component.extend({initialize:function(){this._super();this.customer=customerData.get('customer');}});});
|
||||
@@ -0,0 +1,8 @@
|
||||
define(['jquery','underscore','ko','mageUtils','Magento_Catalog/js/product/query-builder','Magento_Customer/js/customer-data','jquery/jquery-storageapi'],function($,_,ko,utils,queryBuilder,customerData){'use strict';function getParsedDataFromServer(data){var result={};_.each(data.items,function(item){if(item.id){result[item.id]=item;}});return{items:result};}
|
||||
function setLocalStorageItem(namespace,data){try{window.localStorage.setItem(namespace,JSON.stringify(data));}catch(e){console.warn('localStorage is unavailable - skipping local caching of product data');console.error(e);}}
|
||||
return{name:'DataStorage',request:{},customerDataProvider:'product_data_storage',initialize:function(){if(!this.data){this.data=ko.observable({});}
|
||||
this.initLocalStorage().initCustomerDataReloadListener().cachesDataFromLocalStorage().initDataListener().initProvideStorage().initProviderListener();return this;},initCustomerDataReloadListener:function(){$(document).on('customer-data-invalidate',this._flushProductStorage.bind(this));return this;},_flushProductStorage:function(event,sections){if(_.isEmpty(sections)||_.contains(sections,'product_data_storage')){this.localStorage.removeAll();}},initDataListener:function(){this.data.subscribe(this.dataHandler.bind(this));return this;},initProvideStorage:function(){this.providerHandler(customerData.get(this.customerDataProvider)());return this;},dataHandler:function(data){if(_.isEmpty(data)){this.localStorage.removeAll();}else{setLocalStorageItem(this.namespace,data);}},providerHandler:function(data){var currentData=utils.copy(this.data()),ids=_.keys(data.items);if(data.items&&ids.length){data=data.items;this.data(_.extend(data,currentData));}},setIds:function(currency,store,ids){if(!this.hasInCache(currency,store,ids)){this.loadDataFromServer(currency,store,ids);}else{this.data.valueHasMutated();}},getDataByIdentifiers:function(currency,store,productIdentifiers){var data={},dataCollection=this.data(),id;for(id in productIdentifiers){if(productIdentifiers.hasOwnProperty(id)){data[id]=dataCollection[id];}}
|
||||
return data;},hasInCache:function(currency,store,ids){var data=this.data(),id;for(id in ids){if(!data.hasOwnProperty(id)||data[id]['currency_code']!==currency||~~data[id]['store_id']!==~~store){return false;}}
|
||||
return true;},loadDataFromServer:function(currency,store,ids){var idsArray=_.keys(ids),prepareAjaxParams={'entity_id':idsArray.join(',')};if(this.request.sent&&this.hasIdsInSentRequest(ids)){return;}
|
||||
this.request={sent:true,data:ids};this.updateRequestConfig.data=queryBuilder.buildQuery(prepareAjaxParams);this.updateRequestConfig.data['store_id']=store;this.updateRequestConfig.data['currency_code']=currency;$.ajax(this.updateRequestConfig).done(function(data){this.request={};this.providerHandler(getParsedDataFromServer(data));}.bind(this));},addDataFromPageCache:function(data){this.providerHandler(getParsedDataFromServer(data));},hasIdsInSentRequest:function(ids){var sentDataIds,currentDataIds;if(this.request.data){sentDataIds=_.keys(this.request.data);currentDataIds=_.keys(ids);_.each(currentDataIds,function(id){if(_.lastIndexOf(sentDataIds,id)===-1){return false;}});return true;}
|
||||
return false;},initProviderListener:function(){customerData.get(this.customerDataProvider).subscribe(this.providerHandler.bind(this));return this;},cachesDataFromLocalStorage:function(){this.data(this.getDataFromLocalStorage());return this;},getDataFromLocalStorage:function(){return this.localStorage.get();},initLocalStorage:function(){this.localStorage=$.initNamespaceStorage(this.namespace).localStorage;return this;}};});
|
||||