{"version":3,"sources":["tipi.component.form.unified-checkbox/tipi.component.form.unified-checkbox.js","tipi.component.form.unified-radio/tipi.component.form.unified-radio.js","tipi.component.form.unified-select/tipi.component.form.unified-select.js","tipi.component.form.unified-selection-list/tipi.component.form.unified-selection-list.js","tipi.component.form.uploader/tipi.component.form.uploader.js","tipi.component.tabs/tipi.component.tabs.js","tipi.component.top-bar/tipi.component.top-bar.js","tipi.component.touch-menu/tipi.component.touch-menu.js","categories-dropdown.js","collapsible-description.js","collapsible-trigger.js","confirm-delete.js","datepicker.js","selection-list-group.js","uploader-widget.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACvIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACpIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACxMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACtcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACjDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC1LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AChPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC7RA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC/DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"tipi.js","sourcesContent":["/*\n\tTipi Component - Unified Checkbox\n\n\tCreated by: ToolbarThomas\n\tBuild: 18.04.16\n*/\n\nfunction setUnifiedCheckbox() {\n\tvar unifiedCheckboxElements = {\n\t\troot \t\t: 'checkbox',\n\t\tlabel\t\t: 'label',\n\t\tinput\t\t: 'input[type=\"checkbox\"]',\n\t\tform\t\t: 'form',\n\t};\n\n\tvar unifiedCheckboxStates = {\n\t\tready \t\t: '__checkbox--ready',\n\t\tfocus \t\t: '__checkbox--focus',\n\t\tchecked \t: '__checkbox--checked',\n\t\tdisabled \t: '__checkbox--disabled',\n\t\tplaceholder : '__checkbox--placeholder'\n\t};\n\n\tvar unifiedCheckbox = $('.' + unifiedCheckboxElements.root).not('.' + unifiedCheckboxStates.ready);\n\tif(unifiedCheckbox.length > 0) {\n\t\tunifiedCheckbox.each(function() {\n\t\t\tvar unifiedCheckboxEach = $(this);\n\t\t\tvar unifiedCheckboxLabel = getUnifiedCheckboxElement(unifiedCheckboxEach, 'label', unifiedCheckboxElements);\n\t\t\tvar unifiedCheckboxInput = getUnifiedCheckboxElement(unifiedCheckboxEach, 'input', unifiedCheckboxElements);\n\t\t\tvar unifiedCheckboxForm = getUnifiedCheckboxElement(unifiedCheckboxEach, 'form', unifiedCheckboxElements);\n\n\t\t\tif(unifiedCheckboxLabel.length > 0 && unifiedCheckboxInput.length > 0) {\n\n\t\t\t\t//Set the disabled state on the .checkbox container.\n\t\t\t\tif(unifiedCheckboxInput.prop('disabled') === true) {\n\t\t\t\t\tunifiedCheckboxEach.addClass(unifiedCheckboxStates.disabled);\n\t\t\t\t} else {\n\t\t\t\t\tunifiedCheckboxEach.removeClass(unifiedCheckboxStates.disabled);\n\t\t\t\t}\n\n\t\t\t\tif(typeof unifiedCheckboxForm != 'undefined') {\n\t\t\t\t\tunifiedCheckboxForm.on({\n\t\t\t\t\t\treset : function() {\n\t\t\t\t\t\t\tunifiedCheckboxInput.not('[disabled]').prop('checked', false).trigger('change');\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tunifiedCheckboxInput.on({\n\t\t\t\t\tclick : function(event) {\n\t\t\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t\t\t},\n\t\t\t\t\tfocus : function(event) {\n\t\t\t\t\t\tvar unifiedCheckbox = getUnifiedCheckboxElement($(this), 'root', unifiedCheckboxElements);\n\t\t\t\t\t\tunifiedCheckbox.addClass(unifiedCheckboxStates.focus);\n\t\t\t\t\t},\n\t\t\t\t\tblur : function(event) {\n\t\t\t\t\t\tvar unifiedCheckbox = getUnifiedCheckboxElement($(this), 'root', unifiedCheckboxElements);\n\t\t\t\t\t\tunifiedCheckbox.removeClass(unifiedCheckboxStates.focus);\n\t\t\t\t\t},\n\t\t\t\t\tchange : function(event) {\n\t\t\t\t\t\tchangeUnifiedCheckbox($(this), unifiedCheckboxElements, unifiedCheckboxStates);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tunifiedCheckboxEach.on({\n\t\t\t\t\tclick : function(event) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tevent.stopPropagation();\n\n\t\t\t\t\t\tvar unifiedCheckboxInput = getUnifiedCheckboxElement($(this), 'input', unifiedCheckboxElements);\n\n\t\t\t\t\t\tif(unifiedCheckboxInput.prop('disabled') === false) {\n\t\t\t\t\t\t\tif(unifiedCheckboxInput.prop('checked')) {\n\t\t\t\t\t\t\t\tunifiedCheckboxInput.prop('checked', false);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tunifiedCheckboxInput.prop('checked', true);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tunifiedCheckboxInput.trigger('change');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tunifiedCheckboxEach.addClass(unifiedCheckboxStates.ready);\n\t\t\t\tsetUnifiedCheckboxAttributes(unifiedCheckboxEach, unifiedCheckboxInput, unifiedCheckboxStates);\n\t\t\t}\n\t\t});\n\t}\n}\n\nfunction setUnifiedCheckboxAttributes(unifiedCheckbox, unifiedCheckboxInput, unifiedCheckboxStates) {\n\tif(unifiedCheckboxInput.prop('checked') === true) {\n\t\tunifiedCheckbox.addClass(unifiedCheckboxStates.checked);\n\t}\n}\n\nfunction changeUnifiedCheckbox(unifiedCheckboxInput, unifiedCheckboxElements, unifiedCheckboxStates) {\n\tvar unifiedCheckbox = getUnifiedCheckboxElement(unifiedCheckboxInput, 'root', unifiedCheckboxElements);\n\n\tif(unifiedCheckboxInput.prop('checked')) {\n\t\tunifiedCheckbox.addClass(unifiedCheckboxStates.checked);\n\t} else {\n\t\tunifiedCheckbox.removeClass(unifiedCheckboxStates.checked);\n\t}\n\n}\n\nfunction getUnifiedCheckboxElement(origin, unifiedCheckboxType, unifiedCheckboxElements) {\n\tif(typeof origin != 'undefined' && typeof unifiedCheckboxType != 'undefined') {\n\t\tvar element;\n\n\t\tswitch(unifiedCheckboxType) {\n\t\t\tcase 'root':\n\t\t\t\telement = origin.parents('.' + unifiedCheckboxElements.root).first();\n\t\t\tbreak;\n\t\t\tcase 'roots':\n\t\t\t\telement = origin.parents('.' + unifiedCheckboxElements.container).first().find('.' + unifiedCheckboxElements.root);\n\t\t\tbreak;\n\t\t\tcase 'label':\n\t\t\t\telement = origin.find(unifiedCheckboxElements.label).first();\n\t\t\tbreak;\n\t\t\tcase 'input':\n\t\t\t\telement = origin.find(unifiedCheckboxElements.input).first();\n\t\t\tbreak;\n\t\t\tcase 'form':\n\t\t\t\telement = origin.parents(unifiedCheckboxElements.form).first();\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\telement = undefined;\n\t\t}\n\n\t\treturn element;\n\t}\n}","function setUnifiedRadio() {\n\tvar unifiedRadioElements = {\n\t\troot \t\t: 'radio',\n\t\tcontainer\t: 'radio-group',\n\t\tlabel\t\t: 'label',\n\t\tinput\t\t: 'input[type=\"radio\"]',\n\t\tform\t\t: 'form',\n\t};\n\n\tvar unifiedRadioStates = {\n\t\tready \t\t: '__radio--ready',\n\t\tfocus \t\t: '__radio--focus',\n\t\tchecked \t: '__radio--checked',\n\t\tdisabled \t: '__radio--disabled',\n\t\tplaceholder : '__radio--placeholder'\n\t};\n\n\tvar unifiedRadio = $('.' + unifiedRadioElements.root).not('.' + unifiedRadioStates.ready);\n\tif(unifiedRadio.length > 0) {\n\t\tunifiedRadio.each(function() {\n\t\t\tvar unifiedRadioEach = $(this);\n\t\t\tvar unifiedRadioLabel = getUnifiedRadioElement(unifiedRadioEach, 'label', unifiedRadioElements);\n\t\t\tvar unifiedRadioInput = getUnifiedRadioElement(unifiedRadioEach, 'input', unifiedRadioElements);\n\t\t\tvar unifiedRadioForm = getUnifiedRadioElement(unifiedRadioEach, 'form', unifiedRadioElements);\n\n\t\t\tif(unifiedRadioLabel.length > 0 && unifiedRadioInput.length > 0) {\n\n\t\t\t\t//Set the disabled state on the .radio container.\n\t\t\t\tif(unifiedRadioInput.prop('disabled') === true) {\n\t\t\t\t\tunifiedRadioEach.addClass(unifiedRadioStates.disabled);\n\t\t\t\t} else {\n\t\t\t\t\tunifiedRadioEach.removeClass(unifiedRadioStates.disabled);\n\t\t\t\t}\n\n\t\t\t\tif(typeof unifiedRadioForm != 'undefined') {\n\t\t\t\t\tunifiedRadioForm.on({\n\t\t\t\t\t\treset : function() {\n\t\t\t\t\t\t\tunifiedRadioInput.not('[disabled]').prop('checked', false).trigger('change');\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tunifiedRadioInput.on({\n\t\t\t\t\tclick : function(event) {\n\t\t\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t\t\t},\n\t\t\t\t\tfocus : function(event) {\n\t\t\t\t\t\tvar unifiedRadio = getUnifiedRadioElement($(this), 'root', unifiedRadioElements);\n\t\t\t\t\t\tunifiedRadioEach.addClass(unifiedRadioStates.focus);\n\t\t\t\t\t},\n\t\t\t\t\tblur : function(event) {\n\t\t\t\t\t\tvar unifiedRadio = getUnifiedRadioElement($(this), 'root', unifiedRadioElements);\n\t\t\t\t\t\tunifiedRadioEach.removeClass(unifiedRadioStates.focus);\n\t\t\t\t\t},\n\t\t\t\t\tchange : function(event) {\n\t\t\t\t\t\tvar unifiedRadio = getUnifiedRadioElement($(this), 'root', unifiedRadioElements);\n\t\t\t\t\t\tunifiedRadioEach.trigger('tipi.ui.unified.radio.change', [$(this)]);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tunifiedRadioEach.on({\n\t\t\t\t\tclick : function(event) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tevent.stopPropagation();\n\n\t\t\t\t\t\tvar unifiedRadioInput = getUnifiedRadioElement($(this), 'input', unifiedRadioElements);\n\n\t\t\t\t\t\tif(unifiedRadioInput.prop('disabled') === false) {\n\t\t\t\t\t\t\tunifiedRadioInput.prop('checked', true);\n\t\t\t\t\t\t\tunifiedRadioInput.trigger('change');\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t'tipi.ui.unified.radio.change' : function(event, input) {\n\t\t\t\t\t\tchangeUnifiedRadio(input, unifiedRadioElements, unifiedRadioStates);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tunifiedRadioEach.addClass(unifiedRadioStates.ready);\n\t\t\t\tsetUnifiedRadioAttributes(unifiedRadioEach, unifiedRadioInput, unifiedRadioStates);\n\t\t\t}\n\t\t});\n\t}\n}\n\nfunction setUnifiedRadioAttributes(unifiedRadio, unifiedRadioInput, unifiedRadioStates) {\n\tif(unifiedRadioInput.prop('checked') === true) {\n\t\tunifiedRadio.addClass(unifiedRadioStates.checked);\n\t}\n}\n\nfunction changeUnifiedRadio(unifiedRadioInput, unifiedRadioElements, unifiedRadioStates, firstRun) {\n\tvar unifiedRadio = getUnifiedRadioElement(unifiedRadioInput, 'root', unifiedRadioElements);\n\tvar unifiedRadios = getUnifiedRadioElement(unifiedRadioInput, 'roots', unifiedRadioElements);\n\n\tunifiedRadios.removeClass(unifiedRadioStates.checked);\n\n\tif(unifiedRadioInput.prop('checked') === true) {\n\t\tunifiedRadio.addClass(unifiedRadioStates.checked);\n\t} else {\n\t\tunifiedRadio.removeClass(unifiedRadioStates.checked);\n\t}\n}\n\nfunction getUnifiedRadioElement(origin, unifiedRadioType, unifiedRadioElements) {\n\tif(typeof origin != 'undefined' && typeof unifiedRadioType != 'undefined') {\n\t\tvar element;\n\n\t\tswitch(unifiedRadioType) {\n\t\t\tcase 'container':\n\t\t\t\telement = origin.parents('.' + unifiedRadioElements.container).first();\n\t\t\tbreak;\n\t\t\tcase 'root':\n\t\t\t\telement = origin.parents('.' + unifiedRadioElements.root).first();\n\t\t\tbreak;\n\t\t\tcase 'roots':\n\t\t\t\telement = origin.parents('.' + unifiedRadioElements.container).first().find('.' + unifiedRadioElements.root);\n\t\t\tbreak;\n\t\t\tcase 'label':\n\t\t\t\telement = origin.find(unifiedRadioElements.label).first();\n\t\t\tbreak;\n\t\t\tcase 'input':\n\t\t\t\telement = origin.find(unifiedRadioElements.input).first();\n\t\t\tbreak;\n\t\t\tcase 'form':\n\t\t\t\telement = origin.parents(unifiedRadioElements.form).first();\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\telement = undefined;\n\t\t}\n\n\t\treturn element;\n\t}\n}","function setUnifiedSelect()\n{\n\tvar data = {\n\t\telements : {\n\t\t\troot \t\t: 'select',\n\t\t\tvalue\t\t: 'select-value',\n\t\t\tselect\t\t: 'select',\n\t\t\toption\t\t: 'option',\n\t\t\tform \t\t: 'form'\n\t\t},\n\t\tstates: {\n\t\t\tready \t\t: '__select--ready',\n\t\t\tfocus \t\t: '__select--focus',\n\t\t\tchecked \t: '__select--checked',\n\t\t\tdisabled \t: '__select--disabled',\n\t\t\tplaceholder : '__select--placeholder'\n\t\t},\n\t\tattributes: {\n\t\t\tdisabled: 'disabled',\n\t\t\tselected : 'select-selected',\n\t\t\tplaceholder : 'select-placeholder'\n\t\t}\n\t}\n\n\tvar unified_select = $('.' + data.elements.root).not('.' + data.states.ready);\n\tif(unified_select.length == 0)\n\t{\n\t\treturn;\n\t}\n\n\tunified_select.on({\n\t\t'tipi.unified-select.reset' : function(event, unified_select) {\n\t\t\tsetUnifiedSelectDefaultSelectedOption(unified_select, data);\n\t\t\tsetUnifiedSelectDisabledState(unified_select, data);\n\t\t\tsetUnifiedSelectPlaceholder(unified_select, data);\n\t\t},\n\t\t'tipi.unified-select.change' : function(event, unified_select) {\n\t\t\tchangeUnifiedSelectValue(unified_select, data);\n\t\t}\n\t});\n\n\tunified_select.each(function() {\n\t\tvar unified_select = $(this);\n\t\tvar unified_select_value = getUnifiedSelectElement(unified_select, 'select-value', data);\n\t\tvar select = getUnifiedSelectElement(unified_select, 'select', data);\n\t\tvar option = getUnifiedSelectElement(select, 'option', data);\n\t\tvar form = getUnifiedSelectElement(unified_select, 'form', data);\n\n\t\tif(unified_select_value.length == 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tif(select.length == 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tif(option.length == 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tform.on({\n\t\t\treset : function() {\n\t\t\t\tunified_select.trigger('tipi.unified-select.reset', [unified_select]);\n\t\t\t}\n\t\t});\n\n\t\tselect.on({\n\t\t\tfocus : function() {\n\t\t\t\tvar unified_select = getUnifiedSelectElement($(this), 'root', data);\n\t\t\t\tunified_select.addClass(data.states.focus);\n\t\t\t},\n\t\t\tblur : function() {\n\t\t\t\tvar unified_select = getUnifiedSelectElement($(this), 'root', data);\n\t\t\t\tunified_select.removeClass(data.states.focus);\n\t\t\t},\n\t\t\tkeyup: function() {\n\t\t\t\t$(this).blur().focus();\n\t\t\t},\n\t\t\tchange: function() {\n\t\t\t\tvar unified_select = getUnifiedSelectElement($(this), 'root', data);\n\t\t\t\tunified_select.trigger('tipi.unified-select.change', [unified_select]);\n\t\t\t}\n\t\t});\n\n\t\tunified_select.trigger('tipi.unified-select.reset', [unified_select]);\n\n\t\tunified_select.addClass(data.states.ready);\n\t});\n}\n\n//Set the selected option for the select\nfunction setUnifiedSelectDefaultSelectedOption(unified_select, data)\n{\n\tvar option = getUnifiedSelectElement(unified_select, 'option', data);\n\tvar selected_index = option.filter(':selected').first().index();\n\n\tif(selected_index < 0)\n\t{\n\t\tselected_index = option.not(':disabled').first().index();\n\t}\n\n\toption.prop('selected', false).eq(selected_index).prop('selected', true);\n}\n\n//Toggle the Disabled classname on the container element\nfunction setUnifiedSelectDisabledState(unified_select, data)\n{\n\tvar select = getUnifiedSelectElement(unified_select, 'select', data);\n\tif(typeof select == 'undefined')\n\t{\n\t\treturn;\n\t}\n\n\tif(select.prop(data.attributes.disabled))\n\t{\n\t\tunified_select.addClass(data.states.disabled);\n\t}\n\telse\n\t{\n\t\tunified_select.removeClass(data.states.disabled);\n\t}\n}\n\n//Set the placeholder to the select\nfunction setUnifiedSelectPlaceholder(unified_select, data)\n{\n\tvar placeholder = unified_select.data(data.attributes.placeholder);\n\n\tvar unified_select_value = getUnifiedSelectElement(unified_select, 'select-value', data);\n\tvar select = getUnifiedSelectElement(unified_select, 'select', data);\n\tvar option = getUnifiedSelectElement(select, 'option', data);\n\n\t//Use the value of the first option as placeholder fallback\n\tif(typeof placeholder == 'undefined') {\n\t\tplaceholder = option.filter(':selected').first().text();\n\t}\n\n\tunified_select.addClass(data.states.placeholder);\n\n\tunified_select_value.html(placeholder);\n}\n\n//Change innerHtml of the the value container\nfunction changeUnifiedSelectValue(unified_select, data)\n{\n\tvar unified_select_value = getUnifiedSelectElement(unified_select, 'select-value', data);\n\tvar select = getUnifiedSelectElement(unified_select, 'select', data);\n\tvar option = getUnifiedSelectElement(select, 'option', data);\n\tvar selected = option.filter(':selected').first();\n\n\tif(selected.length == 0)\n\t{\n\t\treturn;\n\t}\n\n\tunified_select.removeClass(data.states.placeholder);\n\n\tunified_select_value.html(selected.text());\n}\n\nfunction getUnifiedSelectElement(origin, type, data)\n{\n\tif(typeof origin == 'undefined')\n\t{\n\t\treturn;\n\t}\n\n\tif(origin.length == 0)\n\t{\n\t\treturn;\n\t}\n\n\tif(typeof data.elements == 'undefined')\n\t{\n\t\treturn;\n\t}\n\n\tvar element;\n\n\tswitch(type) {\n\t\tcase 'root':\n\t\t\telement = origin.parents('.' + data.elements.root).first();\n\t\tbreak;\n\t\tcase 'select-value':\n\t\t\telement = origin.find('.' + data.elements.value).first();\n\t\tbreak;\n\t\tcase 'select':\n\t\t\telement = origin.find(data.elements.select).first();\n\t\tbreak;\n\t\tcase 'option':\n\t\t\telement = origin.find(data.elements.option);\n\t\tbreak;\n\t\tcase 'form':\n\t\t\telement = origin.parents(data.elements.form).first();\n\t\tbreak;\n\t\tdefault:\n\t\t\telement = null;\n\t}\n\n\treturn element;\n}","(function(win, doc, $) {\n var data = {\n classes : {\n selection_list : 'selection-list',\n selection_list_toggle : 'selection-list-toggle',\n selection_list_toggle_label : 'selection-list-toggle-label',\n selection_list_checkbox : 'selection-list-checkbox',\n selection_list_checkbox_label : 'selection-list-checkbox-label',\n selection_list_selections : 'selection-list-selections',\n selection_list_selection : 'selection-list-selection',\n selection_list_selection_remove : 'selection-list-selection-remove'\n },\n states : {\n ready : '__selection-list--ready',\n active : '__selection-list--active',\n checkbox_focus : '__selection-list-checkbox--focus',\n checkbox_checked : '__selection-list-checkbox--checked',\n selections_active : '__selection-list-selections--active',\n selection_checked : '__selection-list-selection--checked'\n },\n attributes : {\n checkbox_index : 'selection-list-checkbox-index',\n checkbox_label : 'selection-list-checkbox-label',\n selection_label : 'selection-list-selection-label',\n selection_label_prefix : 'selection-list-selection-label-prefix',\n selection_label_suffix : 'selection-list-selection-label-suffix'\n }\n };\n\n /**\n * Selection List - Javascript function written with jQuery for creating a selection list with checkboxes\n */\n\n window.setUnifiedSelectionList = function()\n {\n var selection_list = $('.' + data.classes.selection_list).not('.' + data.states.ready);\n\n if(selection_list.length === 0)\n {\n return;\n }\n\n //Define the events we need to use so they can be shared by other scripts\n $(document).off('tipi.UnifiedSelectionList.open tipi.unifiedSelectionList.close tipi.unifiedSelectionList.toggle tipi.unifiedSelectionList.toggle tipi.unifiedSelectionList.focus tipi.unifiedSelectionList.blur tipi.unifiedSelectionList.change tipi.selectionList.update tipi.selectionList.init').on({\n 'tipi.UnifiedSelectionList.open' : function(event, selection_list)\n {\n openUnifiedSelectionList(selection_list);\n },\n 'tipi.unifiedSelectionList.close' : function(event, selection_list)\n {\n closeUnifiedSelectionList(selection_list);\n },\n 'tipi.unifiedSelectionList.toggle' : function(event, input)\n {\n toggleUnifiedSelectionListCheckbox(input);\n },\n 'tipi.unifiedSelectionList.focus' : function(event, input)\n {\n focusUnifiedSelectionListCheckbox(input);\n },\n 'tipi.unifiedSelectionList.blur' : function(event, input)\n {\n blurUnifiedSelectionListCheckbox(input, selection_list);\n },\n 'tipi.unifiedSelectionList.change' : function(event, selection_list, input)\n {\n changeUnifiedSelectionListCheckbox(input);\n updateUnifiedSelectionListSelections(input, selection_list);\n countUnifiedSelectionListSelection(selection_list);\n },\n 'tipi.selectionList.update' : function(event, selection_list)\n {\n generateSelectionListSelections(selection_list);\n },\n 'tipi.selectionList.init' : function(event, selection_list, input)\n {\n generateUnifiedSelectionListCheckboxIndex(selection_list);\n generateSelectionListSelections(selection_list);\n changeUnifiedSelectionListCheckbox(input);\n updateUnifiedSelectionListSelections(input, selection_list);\n countUnifiedSelectionListSelection(selection_list);\n }\n });\n\n $('body').on({\n click : function(event)\n {\n clickedWithinUnifiedSelectionList(event, selection_list);\n }\n });\n\n selection_list.each(function() {\n var selection_list = $(this);\n var selection_list_toggle = selection_list.find('.' + data.classes.selection_list_toggle);\n var selection_list_checkbox = selection_list.find('.' + data.classes.selection_list_checkbox);\n var selection_list_label = selection_list.find('label');\n var selection_list_input = selection_list.find('input:checkbox');\n\n if(selection_list_toggle.length === 0 || selection_list_checkbox.length === 0)\n {\n return;\n }\n\n selection_list_toggle.on({\n click : function(event) {\n event.preventDefault();\n\n var toggle = $(this);\n var selection_list = toggle.closest('.' + data.classes.selection_list);\n\n if(selection_list.hasClass(data.states.active))\n {\n $(document).trigger('tipi.unifiedSelectionList.close', [selection_list]);\n }\n else\n {\n $(document).trigger('tipi.UnifiedSelectionList.open', [selection_list]);\n }\n }\n });\n\n selection_list_checkbox.on({\n click : function(event) {\n var checkbox = $(this);\n var input = checkbox.find('input:checkbox');\n\n $(document).trigger('tipi.unifiedSelectionList.toggle', [input]);\n }\n });\n\n selection_list_label.on({\n click : function(event) {\n event.preventDefault();\n }\n });\n\n selection_list_input.on({\n click : function(event) {\n event.stopImmediatePropagation();\n },\n focus : function() {\n var input = $(this);\n var selection_list = input.closest('.' + data.classes.selection_list);\n\n $(document).trigger('tipi.UnifiedSelectionList.open', [selection_list]);\n $(document).trigger('tipi.unifiedSelectionList.focus', [input, selection_list]);\n },\n blur : function() {\n var input = $(this);\n var selection_list = input.closest('.' + data.classes.selection_list);\n\n $(document).trigger('tipi.unifiedSelectionList.blur', [input, selection_list]);\n },\n change : function() {\n var input = $(this);\n var selection_list = input.closest('.' + data.classes.selection_list);\n\n $(document).trigger('tipi.unifiedSelectionList.change', [selection_list, input]);\n }\n });\n\n //Define our ready class so we can add styling within the top_bar\n selection_list.addClass(data.states.ready);\n\n //Init the current selection_list\n $(document).trigger('tipi.selectionList.init', [selection_list, selection_list_input]);\n });\n\n }\n\n function openUnifiedSelectionList(selection_list)\n {\n selection_list.addClass(data.states.active);\n }\n\n function closeUnifiedSelectionList(selection_list)\n {\n selection_list.removeClass(data.states.active);\n\n var input = selection_list.find('input:checkbox');\n if(input.length === 0)\n {\n return;\n }\n }\n\n function toggleUnifiedSelectionListCheckbox(input)\n {\n if(input.prop('checked'))\n {\n input.prop('checked', false).blur();\n }\n else\n {\n input.prop('checked', true).focus();\n }\n\n input.trigger('change');\n }\n\n function focusUnifiedSelectionListCheckbox(input)\n {\n var checkbox = input.closest('.' + data.classes.selection_list_checkbox);\n\n if(checkbox.length === 0)\n {\n return;\n }\n\n checkbox.addClass(data.states.checkbox_focus);\n }\n\n function blurUnifiedSelectionListCheckbox(input)\n {\n var checkbox = input.closest('.' + data.classes.selection_list_checkbox);\n\n if(checkbox.length === 0)\n {\n return;\n }\n\n checkbox.removeClass(data.states.checkbox_focus);\n }\n\n function changeUnifiedSelectionListCheckbox(input)\n {\n input.each(function() {\n var input = $(this);\n var checkbox = input.closest('.' + data.classes.selection_list_checkbox);\n\n if(checkbox.length === 0)\n {\n return;\n }\n\n if(input.prop('disabled'))\n {\n return;\n }\n\n if(input.prop('checked'))\n {\n checkbox.addClass(data.states.checkbox_checked);\n } else {\n checkbox.removeClass(data.states.checkbox_checked);\n }\n });\n }\n\n function getSelectionListCheckboxIndex(checkbox, selection_list)\n {\n var index = checkbox.data(data.attributes.checkbox_index);\n\n //Check if we have an actual index\n if(typeof index == 'undefined')\n {\n generateUnifiedSelectionListCheckboxIndex(selection_list);\n index = checkbox.data(data.attributs.checkbox_index);\n }\n\n if(isNaN(parseFloat(index)))\n {\n return;\n }\n\n return index;\n }\n\n function generateUnifiedSelectionListCheckboxIndex(selection_list)\n {\n selection_list_checkbox = selection_list.find('input:checkbox');\n\n if(selection_list_checkbox.length === 0)\n {\n return;\n }\n\n //Generate a index on each checkbox so we can select the correct selection_list_selection item\n selection_list_checkbox.each(function(index) {\n var checkbox = $(this);\n checkbox.data(data.attributes.checkbox_index, index);\n });\n }\n\n function generateSelectionListSelections(selection_list)\n {\n //Check if we have a selection list selections container and empty it so we can regenerate the items, or generate a empty one\n var selection_list_selections = selection_list.find('.' + data.classes.selection_list_selections);\n if(selection_list_selections.length === 0)\n {\n selection_list.after('
');\n selection_list_selections = selection_list.find('.' + data.classes.selection_list_selections);\n }\n else\n {\n selection_list_selections.empty();\n }\n\n //Generate our selections based on the available input toggles\n var selection_list_checkbox = selection_list.find('.' + data.classes.selection_list_checkbox);\n var input = selection_list.find('input:checkbox');\n\n if(selection_list_checkbox.length === 0)\n {\n return;\n }\n\n selection_list_checkbox.each(function(index) {\n var toggle = $(this);\n\n //Define a label we can use for setting the selections\n var label = toggle.data(data.attributes.checkbox_label);\n if(typeof label === 'undefined')\n {\n label = toggle.find('.' + data.classes.selection_list_checkbox_label).text();\n }\n\n selection_list_selections.append('
' + label + '
');\n });\n\n //Bind the click event so we can uncheck the connected checkbox\n var selection_list_selection_remove = selection_list.find('.' + data.classes.selection_list_selection_remove);\n if(selection_list_selection_remove.length === 0)\n {\n return;\n }\n\n selection_list_selection_remove.on({\n click : function(event)\n {\n event.preventDefault();\n var selection = $(this).closest('.' + data.classes.selection_list_selection);\n var index = selection.index();\n\n if(input.prop('disabled'))\n {\n return;\n }\n\n //Unchecked the connected checkbox\n input.eq(index).prop('checked', false).trigger('change');\n }\n });\n }\n\n function updateUnifiedSelectionListSelections(input, selection_list)\n {\n input.each(function() {\n var input = $(this);\n var index = getSelectionListCheckboxIndex(input, selection_list);\n\n if(typeof index === 'undefined')\n {\n return;\n }\n\n var selection_list_selection = selection_list.find('.' + data.classes.selection_list_selection).eq(index);\n if(selection_list_selection.length === 0)\n {\n return;\n }\n\n if(input.prop('checked'))\n {\n selection_list_selection.addClass(data.states.selection_checked);\n }\n else\n {\n selection_list_selection.removeClass(data.states.selection_checked);\n }\n });\n }\n\n function countUnifiedSelectionListSelection(selection_list)\n {\n var toggle_label = selection_list.find('.' + data.classes.selection_list_toggle_label);\n if(toggle_label.length === 0)\n {\n return;\n }\n\n var label = selection_list.data(data.attributes.selection_label);\n //Check if we have defined a label with a data attribute, or use the label from innerHtml and cache it!\n if(typeof label === 'undefined')\n {\n label = toggle_label.text();\n selection_list.data(data.attributes.selection_label, label);\n }\n\n var prefix = selection_list.data(data.attributes.selection_label_prefix);\n if(typeof prefix === 'undefined')\n {\n prefix = '';\n }\n\n var suffix = selection_list.data(data.attributes.selection_label_suffix);\n if(typeof suffix === 'undefined')\n {\n suffix = '';\n }\n\n var input = selection_list.find('input:checkbox');\n var count = input.filter(':checked').length;\n\n if(count === 0)\n {\n toggle_label.text(label);\n\n selection_list.removeClass(data.states.selections_active);\n }\n else\n {\n toggle_label.text(' ' + label + prefix + count + suffix);\n\n selection_list.addClass(data.states.selections_active);\n }\n }\n\n function clickedWithinUnifiedSelectionList(event, selection_list)\n {\n var target = event.target;\n\n if(typeof target === 'undefined')\n {\n return;\n }\n\n //Convert target to a jquery Selector\n var target = $(target);\n\n var clicked_within = false;\n\n //Check if we clicked the selection_list\n if(target.hasClass(data.classes.selection_list)) {\n clicked_within = true;\n }\n\n //Check if we clicked any selection_list chilc\n if(target.closest('.' + data.classes.selection_list).length > 0)\n {\n clicked_within = true;\n }\n\n //Don't do anything if we clicked within the selection_list\n if(clicked_within)\n {\n return;\n }\n\n selection_list.each(function() {\n $(document).trigger('tipi.unifiedSelectionList.close', [$(this)]);\n });\n }\n\n})( window.jQuery(window), window.jQuery(document), window.jQuery);","function setUploader() {\n\tvar uploader = $('.uploader');\n\tif(uploader.length > 0) {\n\t\tuploader.each(function() {\n\t\t\tvar uploaderEach = $(this);\n\t\t\tvar uploaderInput = uploaderEach.find('.uploader-input');\n\t\t\tvar uploaderLabel = uploaderEach.find('.uploader-label');\n\t\t\tvar uploaderLabelName = uploaderEach.find('.uploader-label-name');\n\n\t\t\tif(uploaderInput.length > 0 && uploaderLabel.length > 0 && uploaderLabelName.length > 0) {\n\t\t\t\tvar label = uploaderLabelName.html();\n\n\t\t\t\tuploaderEach.addClass('__uploader--ready');\n\t\t\t\tuploaderInput.on({\n\t\t\t\t\tchange : function(e) {\n\t\t\t\t\t\tvar fileName = '';\n\n\t\t\t\t\t\tif(this.files && this.files.length > 1) {\n\t\t\t\t\t\t\t//Combine the files with our uploader data attribute;\n\t\t\t\t\t\t\tfileName = ( this.getAttribute( 'data-uploader-multiple-name' ) || '' ).replace( '{files}', this.files.length );\n\t\t\t\t\t\t} else if(e.target.value){\n\t\t\t\t\t\t\t//Show the selected file\n\t\t\t\t\t\t\tfileName = e.target.value.split( '\\\\' ).pop();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(fileName !== '') {\n\t\t\t\t\t\t\t//Set the new name on the label\n\t\t\t\t\t\t\tuploaderLabelName.html(fileName);\n\t\t\t\t\t\t\tuploaderEach.addClass('__uploader--queued');\n\n\t\t\t\t\t\t\t//Fire a custom trigger when the input has a file\n\t\t\t\t\t\t\tuploaderInput.trigger('tipi.uploader.queued');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t//Reset the name of the label\n\t\t\t\t\t\t\tuploaderLabelName.html(label);\n\t\t\t\t\t\t\tuploaderEach.removeClass('__uploader--queued');\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tfocus : function() {\n\t\t\t\t\t\tuploaderEach.addClass('__uploader--focus');\n\t\t\t\t\t},\n\t\t\t\t\tblur : function() {\n\t\t\t\t\t\tuploaderEach.removeClass('__uploader--focus');\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t});\n\t}\n}","(function(win, doc, $) {\n\twindow.setTabs = function()\n\t{\n\t\tvar data = {\n\t\t\telements : {\n\t\t\t\troot : 'tabs',\n\t\t\t\ttoggles : 'tabs-toggles',\n\t\t\t\ttoggle : 'tabs-toggle',\n\t\t\t\titems : 'tabs-items',\n\t\t\t\titem : 'tabs-item'\n\t\t\t},\n\t\t\tstates : {\n\t\t\t\tready : '__tabs--ready',\n\t\t\t\titem_ready : '__tabs-item--ready',\n\t\t\t\titem_active : '__tabs-item--active',\n\t\t\t\ttoggle_active : '__tabs-toggle--active'\n\t\t\t},\n\t\t\tattributes : {\n\t\t\t\tstart_at : 'tabs-start-at',\n\t\t\t\ttoggle_index : 'tabs-toggle-index'\n\t\t\t}\n\t\t}\n\n\t\tvar tabs = $('.' + data.elements.root).not('.' + data.states.ready);\n\n\t\tif(tabs.length === 0)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tdoc.on({\n\t\t\t'tipi.tabs.toggle' : function(event, tabs, index, options) {\n\t\t\t\ttoggleTabsToggle(tabs, index, data, options);\n\t\t\t\ttoggleTabsItem(tabs, index, data, options);\n\t\t\t}\n\t\t});\n\n\t\ttabs.each(function() {\n\t\t\tvar tabs = $(this);\n\t\t\tvar toggles = getTabsElement(tabs, 'toggles', data);\n\t\t\tvar toggle = getTabsElement(tabs, 'toggle', data);\n\t\t\tvar items = getTabsElement(tabs, 'items', data);\n\t\t\tvar item = getTabsElement(tabs, 'item', data);\n\n\t\t\tif(toggle.length === 0 || item.length === 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//Set the options for each accordion\n\t\t\tvar options = getTabsOptions(tabs, data);\n\n\t\t\ttoggle.each(function(index) {\n\t\t\t\t$(this).data(data.attributes.toggle_index, index);\n\t\t\t});\n\n\t\t\ttoggle.on({\n\t\t\t\tclick : function(event)\n\t\t\t\t{\n\t\t\t\t\tvar toggle = $(this);\n\t\t\t\t\tvar tabs = getTabsElement(toggle, 'root', data);\n\n\t\t\t\t\t//Don't proceed if the accordion is not ready\n\t\t\t\t\tif(!tabs.hasClass(data.states.ready))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tvar index = toggle.data(data.attributes.toggle_index);\n\n\t\t\t\t\tdoc.trigger('tipi.tabs.toggle', [tabs, index, options]);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tif(options.start_at >= 0) {\n\t\t\t\tdoc.trigger('tipi.tabs.toggle', [tabs, options.start_at, options]);\n\t\t\t}\n\n\t\t\t//Add the ready classes\n\t\t\ttabs.addClass(data.states.ready);\n\t\t\titems.addClass(data.states.items_ready);\n\t\t\titem.addClass(data.states.item_ready);\n\t\t});\n\t}\n\n\tfunction toggleTabsToggle(tabs, index, data, options)\n\t{\n\t\tvar toggle = getTabsElement(tabs, 'toggle', data);\n\n\t\tif(toggle.length === 0)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\ttoggle.removeClass(data.states.toggle_active).eq(index).addClass(data.states.toggle_active);\n\t}\n\n\tfunction toggleTabsItem(tabs, index, data, options)\n\t{\n\t\tvar item = getTabsElement(tabs, 'item', data);\n\n\t\tif(item.length === 0)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\titem.removeClass(data.states.item_active).eq(index).addClass(data.states.item_active);\n\t}\n\n\tfunction getTabsOptions(tabs, data)\n\t{\n\t\tvar options = {\n\t\t\tstart_at : 0\n\t\t}\n\n\t\tif(typeof tabs.data(data.attributes.start_at) != 'undefined')\n\t\t{\n\t\t\tvar starting_index = tabs.data(data.attributes.start_at);\n\n\t\t\tif(!isNaN(parseFloat(starting_index)))\n\t\t\t{\n\t\t\t\toptions.start_at = starting_index;\n\t\t\t}\n\t\t}\n\n\t\treturn options;\n\t}\n\n\tfunction getTabsElement(origin, type, data)\n\t{\n\t\tif(typeof origin == 'undefined' || typeof data.elements == 'undefined')\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tvar element = $();\n\n\t\tswitch(type) {\n\t\t\tcase 'root' :\n\t\t\t\telement = origin.parents('.' + data.elements.root).first();\n\t\t\t\tbreak;\n\t\t\tcase 'toggles' :\n\t\t\t\tvar toggles = origin.find('.' + data.elements.toggles);\n\n\t\t\t\ttoggles.each(function() {\n\t\t\t\t\tvar tabs = $(this).parents('.' + data.elements.root).first();\n\n\t\t\t\t\tif(!tabs.is(origin))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\telement = element.add($(this));\n\t\t\t\t});\n\n\t\t\t\tbreak;\n\t\t\tcase 'toggle' :\n\t\t\t\tvar toggle = origin.find('.' + data.elements.toggle);\n\n\t\t\t\ttoggle.each(function() {\n\t\t\t\t\tvar tabs = $(this).parents('.' + data.elements.root).first();\n\n\t\t\t\t\tif(!tabs.is(origin))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\telement = element.add($(this));\n\t\t\t\t});\n\n\t\t\t\tbreak;\n\t\t\tcase 'items' :\n\t\t\t\telement = origin.find('.' + data.elements.items).first();\n\n\t\t\t\tbreak;\n\t\t\tcase 'item' :\n\t\t\t\telement = origin.find('.' + data.elements.item).first().siblings().addBack();\n\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t}\n\n\t\treturn element;\n\t}\n\n})( window.jQuery(window), window.jQuery(document), window.jQuery);","(function(win, doc, $) {\n\tvar data = {\n\t\tclasses : {\n\t\t\ttop_bar : 'top-bar',\n\t\t\tpush_fallback : 'top-bar-push-fallback',\n\t\t\ttrigger_fallback : 'top-bar-trigger-fallback'\n\t\t},\n\t\tstates : {\n\t\t\tready : '__top-bar--ready',\n\t\t\tsmall : '__top-bar--small',\n\t\t\thidden : '__top-bar--hidden',\n\t\t\tpeek : '__top-bar--peek',\n\t\t\treset : '__top-bar--reset',\n\t\t\tupwards : '__top-bar-upwards'\n\t\t},\n\t\tattributes : {\n\t\t\tposition : 'top-bar-position',\n\t\t\toriginal_height : 'top-bar-original-height'\n\t\t},\n\t\telements : {}\n\t};\n\n\t/**\n\t * TopBar - Javascript function written with jQuery for creating a sticky top-bar\n\t * @param {[object]} push_element [Accepts any jQuery object to define a custom push_element (usefull if you need the height in multiple places)]\n\t * @param {[object]} trigger_element [Accepts any jQuery object to define a custom trigger_element position (usefull if you wan't to override the default trigger position)]\n\t */\n\n\twindow.setTopBar = function(push_element, trigger_element)\n\t{\n\t\tvar top_bar = $('.' + data.classes.top_bar).not('.' + data.states.ready);\n\n\t\tif(top_bar.length === 0)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t//Add top_bar element to the data collection\n\t\tdata.elements['top_bar'] = top_bar;\n\n\t\t//Define the top bar push\n\t\tvar top_bar_push = defineTopBarPush(data, push_element);\n\t\t//Add push element to the data collection\n\t\tdata.elements['push'] = top_bar_push;\n\n\t\t//Define the top bar trigger\n\t\tvar top_bar_trigger = defineTopBarTrigger(data, trigger_element);\n\t\t//Add trigger element to the data collection\n\t\tdata.elements['trigger'] = top_bar_trigger;\n\n\t\t//Define the events we need to use so they can be shared by other scripts\n\t\t$(document).on({\n\t\t\t'tipi.topBar.resize' : function(event) {\n\t\t\t\tresizeTopBarPush(data);\n\t\t\t},\n\t\t\t'tipi.topBar.toggle' : function(event) {\n\t\t\t\ttoggleTopBar(data);\n\t\t\t}\n\t\t});\n\n\t\t//Define our resize event so we can update the push and trigger\n\t\t//Define our document width so we only have to update if our document width changes\n\t\tvar resize;\n\t\tvar document_width = $(document).width();\n\t\t$(window).on({\n\t\t\t'resize' : function() {\n\t\t\t\tclearTimeout(resize);\n\t\t\t\tresize = setTimeout(function() {\n\t\t\t\t\tif(document_width != $(document).width()) {\n\t\t\t\t\t\ttop_bar.trigger('tipi.topBar.resize');\n\t\t\t\t\t\ttop_bar.trigger('tipi.topBar.toggle');\n\t\t\t\t\t}\n\n\t\t\t\t\tdocument_width = $(document).width();\n\t\t\t\t}, 250);\n\t\t\t},\n\t\t\t'scroll' : function() {\n\t\t\t\t$(document).trigger('tipi.topBar.toggle');\n\t\t\t}\n\t\t});\n\n\t\t//Define our ready class so we can add styling within the top_bar\n\t\ttop_bar.addClass(data.states.ready);\n\n\t\t//Define our ready class so we can add styling to the page outside the top_bar\n\t\t$('html').addClass(data.states.ready);\n\n\t\t\t\t//Set the default position to 0 since our document will be loaded\n\t\t\t\t// top_bar.data(topBarDataAttributes.position, $(window).scroll);\n\n\t\ttop_bar.trigger('tipi.topBar.resize');\n\t\ttop_bar.trigger('tipi.topBar.toggle');\n\t}\n\n\tfunction defineTopBarPush(data, push_element)\n\t{\n\t\t//Check if the push fallback has been defined or create one directly after the top bar.\n\t\tvar top_bar_push_fallback = $('.' + data.classes.push_fallback);\n\t\tif(top_bar_push_fallback.length === 0)\n\t\t{\n\t\t\tdata.elements.top_bar.after('
');\n\t\t\ttop_bar_push_fallback = $('.' + data.classes.push_fallback);\n\t\t}\n\n\t\t//Define the push element with our push fallback as default selector\n\t\tvar top_bar_push = top_bar_push_fallback;\n\n\t\t//Override the push if we have defined a push_element\n\t\tif(typeof push_element !== 'undefined')\n\t\t{\n\t\t\tif(push_element.length > 0)\n\t\t\t{\n\t\t\t\ttop_bar_push = push_element;\n\t\t\t}\n\t\t}\n\n\t\treturn top_bar_push;\n\t}\n\n\tfunction defineTopBarTrigger(data, trigger_element)\n\t{\n\t\t//Check if the trigger fallback has been defined or create one directly after the top bar.\n\t\tvar top_bar_trigger_fallback = $('.' + data.classes.trigger_fallback);\n\t\tif(top_bar_trigger_fallback.length === 0)\n\t\t{\n\t\t\tdata.elements.push.after('
');\n\t\t\ttop_bar_trigger_fallback = $('.' + data.classes.trigger_fallback);\n\t\t}\n\n\t\t//Define the push element with our push fallback as default selector\n\t\tvar top_bar_trigger = top_bar_trigger_fallback;\n\n\t\t//Override the push if we have defined a push_element\n\t\tif(typeof trigger_element !== 'undefined')\n\t\t{\n\t\t\tif(trigger_element.length > 0)\n\t\t\t{\n\t\t\t\ttop_bar_trigger = trigger_element;\n\t\t\t}\n\t\t}\n\n\t\treturn top_bar_trigger;\n\t}\n\n\tfunction resizeTopBarPush(data)\n\t{\n\t\tvar html = $('html');\n\n\t\t//Set our reset class so the height will be set without a css transition to prevent wrong calculations\n\t\tdata.elements.top_bar.addClass(data.states.reset);\n\t\thtml.addClass(data.states.reset);\n\n\t\t//Remove our small class so we can define the current height without class modifications\n\t\tdata.elements.top_bar.removeClass(data.states.small);\n\t\thtml.removeClass(data.states.small);\n\n\t\t//Define the original height and cache it so we can use it later\n\t\tvar top_bar_height = data.elements.top_bar.outerHeight();\n\t\tdata.elements.top_bar.data(data.attributes.original_height, top_bar_height);\n\n\t\t//Set our height value as an empty string if our height is 0\n\t\tif(top_bar_height <= 0)\n\t\t{\n\t\t\ttop_bar_height = '';\n\t\t}\n\n\t\t//Update our push height\n\t\tdata.elements.push.css({\n\t\t\t'height' : top_bar_height\n\t\t});\n\n\t\t//Remove our reset classes\n\t\tdata.elements.top_bar.removeClass(data.states.reset);\n\t\thtml.removeClass(data.states.reset);\n\t}\n\n\tfunction toggleTopBar(data)\n\t{\n\t\tvar html = $('html');\n\t\tvar scroll_top = Math.ceil($(window).scrollTop());\n\t\tvar trigger = Math.ceil(data.elements.trigger.position().top);\n\n\t\t//Get our previous position that has been set on our previous scroll\n\t\tvar previous_position = parseInt(Math.ceil(data.elements.top_bar.data(data.attributes.position)));\n\n\t\t//Set our current position by updating the data attribute\n\t\tdata.elements.top_bar.data(data.attributes.position, $(window).scrollTop());\n\n\t\t//When the scrollTop of the Window is higher than the position + height of the top bar then we can we make it smaller.\n\t\tif(scroll_top >= trigger)\n\t\t{\n\t\t\tdata.elements.top_bar.addClass(data.states.small);\n\t\t\thtml.addClass(data.states.small);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdata.elements.top_bar.removeClass(data.states.small);\n\t\t\thtml.removeClass(data.states.small);\n\t\t}\n\n\t\t//Hide our top_bar if our scrollTop 2 times higher than our trigger\n\t\tif(scroll_top >= (trigger + data.elements.top_bar.outerHeight()))\n\t\t{\n\t\t\tif(false === data.elements.top_bar.hasClass(data.states.upwards))\n\t\t\t{\n\t\t\t\tdata.elements.top_bar.addClass(data.states.hidden);\n\t\t\t\thtml.addClass(data.states.hidden);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdata.elements.top_bar.removeClass(data.states.hidden);\n\t\t\thtml.removeClass(data.states.hidden);\n\t\t}\n\n\t\t//Set the peek state on the top-bar when the user scrolls upwards\n\t\tif(scroll_top < previous_position)\n\t\t{\n\t\t\tdata.elements.top_bar.addClass(data.states.peek);\n\t\t\tdata.elements.top_bar.addClass(data.states.upwards);\n\n\t\t\thtml.addClass(data.states.peek);\n\t\t\thtml.addClass(data.states.upwards);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdata.elements.top_bar.removeClass(data.states.peek);\n\t\t\tdata.elements.top_bar.removeClass(data.states.upwards);\n\n\t\t\thtml.removeClass(data.states.peek);\n\t\t\thtml.removeClass(data.states.upwards);\n\t\t}\n\n\t\t//Reset the top bar when we've reached the top of the document\n\t\tif(scroll_top <= 0)\n\t\t{\n\t\t\tdata.elements.top_bar.data(data.attributes.position, 0).removeClass(data.states.upwards);\n\t\t}\n\t}\n\n})( window.jQuery(window), window.jQuery(document), window.jQuery);","(function(win, doc, $) {\n\tvar data = {\n\t\telements : {\n\t\t\ttoggle : 'touch-menu-toggle',\n\t\t\tdrawer : 'touch-menu-drawer',\n\t\t\thelper : 'touch-menu-document-helper',\n\t\t\thelperWrapper : 'touch-menu-document-helper-wrapper'\n\t\t},\n\t\tattributes : {\n\t\t\tdrawer : 'touch-menu-drawer',\n\t\t\trelated_toggles : 'touch-menu-related-toggles',\n\t\t\tregistered_drawer : 'touch-menu-registered-drawer'\n\t\t},\n\t\tstates : {\n\t\t\tready : '__touch-menu--ready',\n\t\t\tactive : '__touch-menu--active',\n\t\t\ttoggle_ready : '__touch-menu-toggle--ready',\n\t\t\ttoggle_active : '__touch-menu-toggle--active',\n\t\t\tdrawer_ready : '__touch-menu-drawer--ready',\n\t\t\tdrawer_active : '__touch-menu-drawer--active'\n\t\t}\n\t};\n\n\n\twindow.setTouchMenu = function()\n\t{\n\t\tvar touch_menu_toggle = $('.' + data.elements.toggle).not(data.states.toggle_ready);\n\n\t\t$(document).on({\n\t\t\t'tipi.touchMenu.init' : function(event, elements) {\n\t\t\t\tinitTouchMenu(elements);\n\t\t\t},\n\t\t\t'tipi.touchMenu.open' : function(event, elements) {\n\t\t\t\topenTouchMenu(elements);\n\t\t\t},\n\t\t\t'tipi.touchMenu.close' : function(event, elements) {\n\t\t\t\tcloseTouchMenu(elements);\n\t\t\t},\n\t\t\t'tipi.touchMenu.resize' : function(event, elements) {\n\t\t\t\tsetTouchMenuDrawerHeight(elements);\n\t\t\t\tcheckTouchMenuToggleVisibility(elements);\n\t\t\t}\n\t\t});\n\n\t\tvar resize;\n\t\t$(window).on({\n\t\t\tresize : function()\n\t\t\t{\n\t\t\t\tclearTimeout(resize);\n\t\t\t\tresize = setTimeout(function() {\n\t\t\t\t\t$(document).trigger('tipi.touchMenu.resize', [{\n\t\t\t\t\t\ttoggles : touch_menu_toggle\n\t\t\t\t\t}]);\n\t\t\t\t}, 250);\n\t\t\t}\n\t\t});\n\n\t\ttouch_menu_toggle.each(function() {\n\t\t\tvar toggle = $(this);\n\n\t\t\tvar drawer = getTouchMenuDrawer(toggle);\n\t\t\tif(drawer.length === 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//Add the drawer to it's attributes so we activate all toggles withing the page\n\t\t\ttoggle.data(data.attributes.registered_drawer, drawer);\n\n\t\t\ttoggle.on({\n\t\t\t\tclick : function(event) {\n\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\tvar toggle = $(this);\n\t\t\t\t\tvar toggles = getRelatedTouchMenuToggles(touch_menu_toggle, toggle);\n\n\t\t\t\t\tif(toggles.length === 0)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(toggle.hasClass(data.states.toggle_active))\n\t\t\t\t\t{\n\t\t\t\t\t\t$(document).trigger('tipi.touchMenu.close', [{\n\t\t\t\t\t\t\ttoggles : toggles,\n\t\t\t\t\t\t\tdrawer : drawer\n\t\t\t\t\t\t}]);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$(document).trigger('tipi.touchMenu.open', [{\n\t\t\t\t\t\t\ttoggles : toggles,\n\t\t\t\t\t\t\tdrawer : drawer\n\t\t\t\t\t\t}]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t$(document).trigger('tipi.touchMenu.init', [{\n\t\t\t\ttoggle : toggle,\n\t\t\t\tdrawer : drawer\n\t\t\t}]);\n\n\t\t\t$(document).trigger('tipi.touchMenu.resize', [{\n\t\t\t\ttoggles: toggle\n\t\t\t}]);\n\t\t});\n\t}\n\n\tfunction initTouchMenu(elements)\n\t{\n\t\tif(typeof elements === 'undefined')\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\telements.toggle.addClass(data.states.toggle_ready);\n\t\telements.drawer.addClass(data.states.drawer_ready);\n\n\t\t$('html').addClass(data.states.ready);\n\t}\n\n\tfunction openTouchMenu(elements)\n\t{\n\t\tif(typeof elements === 'undefined')\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\telements.toggles.addClass(data.states.toggle_active);\n\t\telements.drawer.addClass(data.states.drawer_active);\n\n\t\t$('html').addClass(data.states.active);\n\t}\n\n\tfunction closeTouchMenu(elements)\n\t{\n\t\tif(typeof elements === 'undefined')\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\telements.toggles.removeClass(data.states.toggle_active);\n\t\telements.drawer.removeClass(data.states.drawer_active);\n\n\t\t$('html').removeClass(data.states.active);\n\t}\n\n\tfunction setTouchMenuDrawerHeight(elements)\n\t{\n\t\tif (typeof elements === 'undefined') {\n\t\t\treturn;\n\t\t}\n\n\t\tvar viewport_height = $(window).height();\n\n\t\telements.toggles.each(function () {\n\t\t\tvar toggle = $(this);\n\t\t\tvar drawer = getTouchMenuDrawer(toggle);\n\n\t\t\tif (drawer.length === 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Reset the height of the drawer\n\t\t\tdrawer.css({\n\t\t\t\t'min-height' : '',\n\t\t\t\t'bottom' : ''\n\t\t\t});\n\n\t\t\tvar drawer_height = drawer.height();\n\n\t\t\t// Continue if our drawer height is larger than the viewport\n\t\t\tif (drawer_height > viewport_height)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdrawer.css({\n\t\t\t\t'height': viewport_height,\n\t\t\t\t'bottom': 'auto'\n\t\t\t});\n\t\t});\n\t}\n\n\tfunction checkTouchMenuToggleVisibility(elements)\n\t{\n\t\tif(typeof elements === 'undefined')\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\telements.toggles.each(function() {\n\t\t\tvar toggle = $(this);\n\t\t\tvar toggles = getRelatedTouchMenuToggles(elements.toggles, toggle);\n\t\t\tvar drawer = getTouchMenuDrawer(toggle);\n\n\t\t\tif(drawer.length === 0 || toggles.length === 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar visible = false;\n\t\t\ttoggles.each(function() {\n\t\t\t\tif($(this).is(':visible'))\n\t\t\t\t{\n\t\t\t\t\tvisible = true;\n\t\t\t\t}\n\t\t\t});\n\n\n\t\t\tif(visible)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$(document).trigger('tipi.touchMenu.close', [{\n\t\t\t\ttoggles : toggles,\n\t\t\t\tdrawer : drawer\n\t\t\t}]);\n\t\t});\n\t}\n\n\tfunction getRelatedTouchMenuToggles(toggles, toggle)\n\t{\n\t\tvar related_toggles = toggle.data(data.attributes.related_toggles);\n\t\tif(typeof related_toggles === 'undefined')\n\t\t{\n\t\t\t//Create an empty jQuery object where we can add the related toggles\n\t\t\trelated_toggles = $();\n\n\t\t\t//Get the registered drawer we've added previously\n\t\t\tvar registered_drawer = toggle.data(data.attributes.registered_drawer);\n\t\t\tif(typeof registered_drawer === 'undefined')\n\t\t\t{\n\t\t\t\trelated_toggles = related_toggles.add(toggle);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttoggles.each(function() {\n\t\t\t\t\tvar current_toggle = $(this);\n\t\t\t\t\tvar current_registered_drawer = current_toggle.data(data.attributes.registered_drawer);\n\n\t\t\t\t\tif(!registered_drawer.is(current_registered_drawer))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\trelated_toggles = related_toggles.add(current_toggle);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\ttoggle.data(data.attributes.related_toggles, related_toggles);\n\t\t}\n\n\t\treturn related_toggles;\n\t}\n\n\tfunction getTouchMenuDrawer(toggle)\n\t{\n\t\tif(typeof toggle === 'undefined')\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif(toggle.length === 0)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t//Set the default output\n\t\tvar drawer = $('.' + data.elements.drawer);\n\t\tvar filter = toggle.data(data.attributes.drawer);\n\n\t\tif(typeof filter === 'undefined') {\n\t\t\tdrawer = drawer.first();\n\t\t}\n\t\telse {\n\t\t\tdrawer = drawer.filter(filter).first();\n\t\t}\n\n\t\treturn drawer;\n\t}\n\n})( window.jQuery(window), window.jQuery(document), window.jQuery);","(function ($){\n\n window.setCategoriesDropdown = function()\n {\n let categoriesDropdown = $('.js-main-category');\n\n if (categoriesDropdown.length === 0) {\n return;\n }\n\n categoriesDropdown.each(function (){\n let categoriesDropdown = $(this);\n\n categoriesDropdown.on('click', (event) => {\n if (!$(event.target).hasClass('js-category-action')){\n let categorieSubCategories = $(event.currentTarget).next('ul');\n categorieSubCategories.toggle();\n }\n });\n });\n\n }\n})(window.jQuery);\n","function setCollapsibleDescription() {\n let toggleButtons = $('.js-toggle-description');\n\n $.each(toggleButtons, function() {\n $('.collapsible-content').css('max-height', '0');\n\n $(this).on('click', function() {\n let collapsibleContent = $(this).next('.collapsible-content');\n\n let description = collapsibleContent.prev('.post-card__description').text();\n\n let textarea = collapsibleContent.find('#js-description-textarea');\n\n textarea.val(description);\n\n collapsibleContent.toggleClass('post-card__collapsible--expanded');\n\n if (collapsibleContent.css('max-height')) {\n collapsibleContent.css('max-height', '');\n } else {\n collapsibleContent.css('max-height', collapsibleContent.scrollHeight + 'px');\n }\n });\n });\n}","function setCollapsibleTrigger() {\n var coll = document.getElementsByClassName('collapsible-trigger');\n var i;\n\n for (i = 0; i < coll.length; i++) {\n coll[i].addEventListener('click', function (event) {\n this.classList.toggle('active');\n event.preventDefault();\n var content = this.nextElementSibling;\n if (content.style.maxHeight) {\n content.style.maxHeight = null;\n } else {\n content.style.maxHeight = content.scrollHeight + 'px';\n }\n });\n }\n};","(function (win, doc, $) {\n\n window.setConfirmDelete = function () {\n var confirm_delete = $(\".js-confirm-delete\");\n\n confirm_delete.on({\n click: function (e) {\n if (! confirm(\"Weet je zeker dat je dit wilt verwijderen?\")) {\n e.preventDefault();\n }\n }\n });\n }\n\n})(window.jQuery(window), window.jQuery(document), window.jQuery);\n","function setDatepicker() {\n var datepicker = $('.datepicker input');\n\n if(datepicker.length == 0)\n {\n return;\n }\n\n datepicker.pickadate({\n today: '',\n clear: '',\n close: '',\n firstDay: true,\n monthsFull: [\n 'januari',\n 'februari',\n 'maart',\n 'april',\n 'mei',\n 'juni',\n 'juli',\n 'augustus',\n 'september',\n 'oktober',\n 'november',\n 'december'\n ],\n weekdaysShort: [\n 'zo',\n 'ma',\n 'di',\n 'wo',\n 'do',\n 'vr',\n 'za'\n ],\n format: 'dd-mm-yyyy',\n formatSubmit: 'yyyy-mm-dd',\n onClose: function() {\n //Remove focus on datepicker after closing it\n $(document.activeElement).blur();\n },\n });\n}","(function (win, doc, $){\n\n\twindow.setSelectionGroup = function() {\n\t\tvar selection_list_group = $('.selection-list-group');\n\t\tvar selection_list_group_toggle = $('.selection-list-group-toggle');\n\n\t\tif (selection_list_group_toggle.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tselection_list_group_toggle.on({\n\t\t\tclick : function(event) {\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\tvar selection_list_group = $(this).closest('.selection-list-group');\n\n\t\t\t\tselection_list_group.toggleClass('__selection-list-group--dropdown-active');\n\t\t\t}\n\t\t})\n\t}\n\n\t// Show each checkbox group when filtering with the textfield\n\twindow.setSelectionGroupFilterLogic = function() {\n\t\tvar selection_list = $('.selection-list').not('.__selection-list--ready');\n\n\t\tif (selection_list.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Iterate trough each selection list and check if we have any children\n\t\tselection_list.each(function() {\n\t\t\tvar selection_list = $(this);\n\t\t\tvar nested_selection_list_group = selection_list.find('.selection-list-group .selection-list-group');\n\n\t\t\tif (nested_selection_list_group.length === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar selection_list_group = selection_list.find('.selection-list-group ');\n\t\t\tvar selection_list_filter_input = selection_list.find('.selection-list-filter-input');\n\n\t\t\tif (selection_list_filter_input.length === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tselection_list_filter_input.on({\n\t\t\t\t'keyup keydown' : function(event) {\n\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t$(selection_list_group.get().reverse()).each(function() {\n\t\t\t\t\t\tvar $this = $(this);\n\t\t\t\t\t\tvar selection_list_checkbox = $this.first('selection-list-group-header').find('.selection-list-checkbox');\n\n\t\t\t\t\t\t// All are hidden\n\t\t\t\t\t\tif (selection_list_checkbox.length === selection_list_checkbox.filter('.__selection-list-checkbox--hide')) {\n\t\t\t\t\t\t\t$this.parents('.selection-list-group').addBack().addClass('selection-list-groupp--force-show');\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n})(window.jQuery(window), window.jQuery(document), window.jQuery);","(function (win, doc, $){\n\n // Add reverse support\n if (typeof $.fn.reverse != 'function')\n {\n $.fn.reverse = [].reverse;\n }\n\n window.setUploaderWidget = function()\n {\n var uploader_widget = $('.uploader-widget').not('.__uploader-widget--ready');\n\n if (uploader_widget.length === 0)\n {\n return;\n }\n\n // Check the browser compatiblity for the required API's and give a message if we miss a feature\n if(!browser_is_compatible)\n {\n window.alert('Your browser is not compatible with this upload tool');\n return;\n }\n\n uploader_widget.each(function(index) {\n var uploader_widget = $(this);\n var uploader_widget_file_input = uploader_widget.find('input:file');\n\n if (uploader_widget_file_input.length === 0)\n {\n return;\n }\n\n var data = {\n album_id: uploader_widget.data('uploader-widget-album-id'),\n uploader_id: 'uploader-widget-' + index,\n file_upload_count: -1,\n file_upload_position: 0,\n interval: undefined,\n files: new Array(),\n post_raw_data_route: uploader_widget.data('uploader-widget-post-raw-data-route'), // Route to post the files to\n get_data_status_route: uploader_widget.data('uploader-widget-get-data-status-route'), // Route to check the processing status\n queue: new Array(), // The queued files\n queue_position: -1, // The current index of the queue\n queue_limit: 1, // The amount of files we wan't to post async,\n queue_amount: 0,\n queue_running: false,\n queue_timeout: undefined, // Flag to check if the queue is running\n failed_entries: new Array() // Array of files that didn't passed the validations\n };\n\n // Check if we have an album id\n if(isNaN(parseFloat(data.album_id)))\n {\n return;\n }\n\n // Check if the post routes is defined\n if (typeof data.post_raw_data_route != 'string')\n {\n return;\n }\n\n uploader_widget_file_input.on({\n change : function(event) {\n event.preventDefault();\n\n // Prevent multiple queues\n if (data.queue_running) {\n window.alert('The upload process has already been started, you can upload new files when the process has finished.');\n return;\n }\n\n // Increase the count of the fileupload\n data.file_upload_count++;\n\n var input = $(this);\n\n prepareUploaderData(input, event, data);\n\n //Reset the current value so we can upload new files\n input.val('');\n }\n });\n\n // Our uploader widget is ready!s\n uploader_widget.addClass('__uploader-widget--ready');\n });\n }\n\n // Check the browser compatiblity for the required API's and give a message if we miss a feature\n function browser_is_compatible()\n {\n var browser_is_compatible = true;\n\n // Check if we can acces html5 formData API\n if (typeof window.FormData === 'undefined') {\n browser_is_compatible = false;\n }\n\n // Drag & drop support\n // if (!this.checkEvent('drop', this.element) || !this.checkEvent('dragstart', this.element)) {\n // this.settings.onFallbackMode.call(this.element, 'Browser doesn\\'t support Ajax Drag and Drop');\n\n // return false;\n // }\n\n return browser_is_compatible;\n }\n\n function prepareUploaderData(input, event, data)\n {\n var uploader_widget = input.closest('.uploader-widget');\n\n data.files = event.target.files;\n\n // Check if we have some files\n if (typeof data.files === 'undefined')\n {\n window.alert('Er zijn geen bestanden geselecteerd');\n return;\n }\n\n // Hide the proceed button\n unsetUploadWidgetProceed(uploader_widget);\n\n for (var index = 0; index < data.files.length; index++) {\n var file = data.files[index];\n\n var file_is_valid = checkUploaderDataValidation(file);\n if (file_is_valid)\n {\n // Push the actual file to the queue\n data.queue.push(file);\n // appendUploaderDataAsFile(uploader_widget, file);\n }\n else\n {\n // Our file is not valid and will not be queued\n data.failed_entries.push(file);\n }\n }\n\n initUploaderQueue(uploader_widget, data);\n }\n\n function checkUploaderDataValidation(file)\n {\n //@TODO File validation logic goes here. e.g. file type, extension & filesize\n return true;\n }\n\n // Fire up the uploader queue\n function initUploaderQueue(uploader_widget, data)\n {\n // Abort if we have no queue\n if (data.queue.length === 0)\n {\n window.alert('The upload process won\\'t start since we have no files');\n return;\n }\n\n // Prevent multiple queues\n if(data.queue_running)\n {\n window.alert('The upload process has already been started, you can upload new files when the process has finished.');\n return;\n }\n\n data.queue_running = true;\n\n // Append the files container to put the file(s) in\n appendUploaderFilesWrapper(uploader_widget);\n\n // Append the file to the queue\n for (var index = 0; index < data.queue.length; index++) {\n appendUploaderDataAsFile(uploader_widget, data, index);\n }\n\n processUploaderQueue(uploader_widget, data);\n }\n\n function processUploaderQueue(uploader_widget, data)\n {\n // Prevent overload with ajax calls\n if (data.queue_amount < data.queue_limit)\n {\n //Increase the amount so we can queue multiple files simultaneously\n data.queue_amount++;\n\n // Increase the current queue position\n data.queue_position++;\n\n // Build the file to post\n var file = data.queue[data.queue_position];\n\n if (! file) {\n return;\n }\n\n // Form Data\n var form_data = new FormData();\n form_data.append('photo', file);\n // form_data.append('album_id', data.album_id);\n\n // Select the file we want to use\n var uploader_widget_file = getUploaderWidgetFile(uploader_widget, data);\n\n //Ready the upload\n setUploaderFileReadyFlag(uploader_widget_file);\n\n // Post the queued file\n $.ajax({\n url: data.post_raw_data_route + '?album_id=' + data.album_id,\n type: 'POST',\n data: form_data,\n cache: false,\n processData: false,\n forceSync: false,\n contentType: false,\n xhr: function () {\n var xhrobj = $.ajaxSettings.xhr();\n\n if (xhrobj.upload) {\n xhrobj.upload.addEventListener('progress', function (event) {\n var percentage = 0;\n var position = event.loaded || event.position;\n var total = event.total || event.totalSize;\n\n if (event.lengthComputable) {\n percentage = Math.ceil(position / total * 100);\n\n setUploaderFilePercentage(uploader_widget_file, percentage);\n }\n\n // Set process flag\n if (percentage === 100) {\n setUploaderFileProcessFlag(uploader_widget_file);\n }\n }, false);\n }\n\n return xhrobj;\n },\n success: function (data, status, xhr) {\n setUploaderFileSuccessFlag(uploader_widget_file);\n setUploaderSuccessResponseMessage(xhr);\n },\n error: function (xhr, status, message) {\n setUploaderFileErrorFlag(uploader_widget_file);\n setUploaderResponseMessage(xhr);\n },\n complete: function (xhr, textStatus) {\n unsetUploaderFileProcessFlag(uploader_widget_file);\n data.queue_amount--;\n\n processUploaderQueue(uploader_widget, data);\n\n if (data.queue_position == data.queue.length) {\n data.file_upload_position++;\n resetUploaderData(data);\n setUploadWidgetProceed(uploader_widget);\n }\n\n }\n });\n }\n }\n\n // Set the progress bar percentage width\n function setUploaderFilePercentage(uploader_widget_file, percentage)\n {\n if (typeof uploader_widget_file === 'undefined')\n {\n return;\n }\n\n var uploader_widget_progress_bar_fill = uploader_widget_file.find('.uploader-widget-progress-bar-fill');\n if (uploader_widget_progress_bar_fill.length === 0)\n {\n return;\n }\n\n uploader_widget_progress_bar_fill.css({\n 'width' : percentage + '%'\n });\n }\n\n function setUploadWidgetProceed(uploader_widget)\n {\n var uploader_widget_file = uploader_widget.find('.uploader-widget-file');\n\n if (uploader_widget_file.not('.__uploader-widget-file--error').length == 0) {\n return;\n }\n\n uploader_widget.addClass('__uploader-widget--proceed');\n }\n\n function unsetUploadWidgetProceed(uploader_widget)\n {\n uploader_widget.removeClass('__uploader-widget--proceed');\n }\n\n function setUploaderFileReadyFlag(uploader_widget_file) {\n uploader_widget_file.addClass('__uploader-widget-file--ready');\n }\n\n function unsetUploaderFileReadyFlag(uploader_widget_file) {\n uploader_widget_file.removeClass('__uploader-widget-file--ready');\n }\n\n function setUploaderFileSuccessFlag(uploader_widget_file)\n {\n uploader_widget_file.addClass('__uploader-widget-file--success');\n }\n\n function setUploaderFileErrorFlag(uploader_widget_file)\n {\n uploader_widget_file.addClass('__uploader-widget-file--error');\n }\n\n function setUploaderFileProcessFlag(uploader_widget_file)\n {\n uploader_widget_file.addClass('__uploader-widget-file--process');\n }\n\n\n function setUploaderSuccessResponseMessage(xhr) {\n if (typeof xhr.responseText == 'undefined') {\n return;\n }\n\n var json;\n try {\n json = JSON.parse(xhr.responseText);\n } catch (error) {\n return;\n }\n\n // Get the key of the first entry of our json array\n var key = Object.keys(json)[0];\n\n // Validate if json has data\n if(json[key].length == 0 || key !== 'messages') {\n return;\n }\n var messages = [];\n for (var index = 0; index < json[key].length; index++) {\n messages.push(json[key][index] + '\\n');\n }\n\n window.alert(messages);\n }\n\n function setUploaderResponseMessage(xhr) {\n if (typeof xhr.responseText == 'undefined') {\n return;\n }\n\n var json;\n try {\n json = JSON.parse(xhr.responseText);\n } catch (error) {\n return;\n }\n\n // Get the key of the first entry of our json array\n var key = Object.keys(json)[0];\n\n // Validate if json has data\n if(json[key].length == 0) {\n return;\n }\n\n window.alert(json[key]);\n }\n\n function unsetUploaderFileProcessFlag(uploader_widget_file) {\n uploader_widget_file.removeClass('__uploader-widget-file--process');\n }\n\n function appendUploaderFilesWrapper(uploader_widget)\n {\n var uploader_widget_files = uploader_widget.find('.uploader-widget-files').first();\n\n if(uploader_widget_files.length === 0)\n {\n return;\n }\n\n uploader_widget_files.prepend('
');\n }\n\n // Render the HTML for the current file\n function appendUploaderDataAsFile(uploader_widget, data, index)\n {\n var uploader_widget_files_wrapper = uploader_widget.find('.uploader-widget-files-wrapper').reverse().eq(data.file_upload_count);\n\n var output = '
';\n output += '' + data.queue[index].name + '';\n output += '
';\n output += '
';\n output += '
';\n\n uploader_widget_files_wrapper.append(output);\n }\n\n // Get uploader widget file\n function getUploaderWidgetFile(uploader_widget, data)\n {\n if (isNaN(parseFloat(data.queue_position)))\n {\n return;\n }\n\n uploader_widget_file = uploader_widget.find('.uploader-widget-files-wrapper').reverse().eq(data.file_upload_position).find('.uploader-widget-file').eq(data.queue_position);\n\n return uploader_widget_file;\n }\n\n function resetUploaderData(data)\n {\n data.files = new Array();\n data.queue = new Array();\n data.queue_position = -1;\n data.queue_amount = 0;\n data.queue_running = false;\n data.failed_entries = new Array();\n }\n\n})(window.jQuery(window), window.jQuery(document), window.jQuery);\n\n\n"]}