[%# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. #%] [% PROCESS global/variables.none.tmpl %] [% items = [ { id => '', name => 'splendidest gear', }, { id => '#157454S', name => 'very splendid package, men, s' }, { id => '#157454M', name => 'very splendid package, men, m' }, { id => '#157454L', name => 'very splendid package, men, l' }, { id => '#157454X', name => 'very splendid package, men, xl' }, { id => '#157452S', name => 'very splendid package, women, s' }, { id => '#157452M', name => 'very splendid package, women, m' }, { id => '#157452L', name => 'very splendid package, women, l' }, { id => '#157452X', name => 'very splendid package, women, xl' }, { id => '#157451S', name => 'most splendid package, s' }, { id => '#157451M', name => 'most splendid package, m ' }, { id => '#157451L', name => 'most splendid package, l' }, { id => '#157451X', name => 'most splendid package, xl' }, { id => '#155415S', name => 'sweatshirt, s' }, { id => '#155415M', name => 'sweatshirt, m' }, { id => '#155415L', name => 'sweatshirt, l' }, { id => '#155415X', name => 'sweatshirt, xl' }, { id => '#1554152', name => 'sweatshirt, 2x' }, { id => '#155749', name => 'rickshaw messenger bag' }, { id => '#155752', name => 'moleskine notebook (black)' }, { id => '', name => 'splendider gear', }, { id => '#155341S', name => 'unisex t, poppy, s' }, { id => '#155341M', name => 'unisex t, poppy, m' }, { id => '#155341L', name => 'unisex t, poppy, l' }, { id => '#155341X', name => 'unisex t, poppy, xl' }, { id => '#1553412', name => 'unisex t, poppy, 2x' }, { id => '#155344S', name => 'ladies t, poppy, s' }, { id => '#155344M', name => 'ladies t, poppy, m' }, { id => '#155344L', name => 'ladies t, poppy, l' }, { id => '#155342S', name => 'unisex t, navy, s' }, { id => '#155342M', name => 'unisex t, navy, m' }, { id => '#155342L', name => 'unisex t, navy, l' }, { id => '#155342X', name => 'unisex t, navy, xl' }, { id => '#1553422', name => 'unisex t, navy, 2x' }, { id => '#1553423', name => 'unisex t, navy, 3x' }, { id => '#155413S', name => 'ladies t, navy, s' }, { id => '#155413M', name => 'ladies t, navy, m' }, { id => '#155413L', name => 'ladies t, navy, l' }, { id => '#155413X', name => 'ladies t, navy, xl' }, { id => '#155343M', name => 'unisex t, lapis, m' }, { id => '#155343L', name => 'unisex t, lapis, l' }, { id => '#155343X', name => 'unisex t, lapis, xl' }, { id => '#155414S', name => 'ladies t, lapis, s' }, { id => '#155414M', name => 'ladies t, lapis, m' }, { id => '#155414L', name => 'ladies t, lapis, l' }, { id => '#155339', name => 'black cap w/tote' }, { id => '#155340', name => 'beanie' }, { id => '#155751', name => 'drawstring tote' }, { id => '#155758', name => 'glossy finish ceramic mug' }, { id => '', name => 'splendid gear', }, { id => '#155755', name => 'vertical laminated badge' }, { id => '#155754', name => 'lanyard w/bulldog clip' }, { id => '#155756', name => 'silicone wristband' }, { id => '#155753', name => '3" round stickers (single)' }, { id => '#155757', name => 'mozilla tattoos (pkg 50)' }, ] %] [% mozspaces = [ { name => 'Berlin', address1 => 'MZ Denmark ApS - Germany', address2 => 'Rungestrasse 22 - 24', city => 'Berlin', state => 'Germany', country => 'Germany', postcode => '10179', }, { name => 'London', address1 => 'Mozilla London', address2 => '101 St. Martin\'s Lane, 3rd Floor', city => 'London', state => 'Greater London', country => 'UK', postcode => 'WC2N 4AZ', }, { name => 'Mountain View', address1 => 'Mozilla', address2 => '650 Castro St., Suite 300', city => 'Mountain View', state => 'CA', country => 'USA', postcode => '94041-2072', }, { name => 'Paris', address1 => 'Mozilla', address2 => '16 bis Boulevard Montmartre', city => 'Paris', state => 'Paris', country => 'France', postcode => '75009', }, { name => 'Portland', address1 => 'Mozilla Portland', address2 => 'Brewery Block 2, 1120 NW Couch St. Suite 320', city => 'Portland', state => 'OR', country => 'USA', postcode => '97209', }, { name => 'San Francisco', address1 => 'Mozilla', address2 => '2 Harrison Street, Suite 175', city => 'San Francisco', state => 'CA', country => 'USA', postcode => '94105', }, { name => 'Toronto', address1 => 'Mozilla Canada', address2 => '366 Adelaide Street W, Suite 500', city => 'Toronto', state => 'Ontario', country => 'Canada', postcode => 'M5V 1R9', }, { name => 'Vancouver', address1 => 'Mozilla Canada', address2 => '163 West Hastings Street, Suite 209', city => 'Vancouver', state => 'BC', country => 'Canada', postcode => 'V6B 1H5', }, ] %] [% inline_style = BLOCK %] #gear_form th { text-align: right; font-weight: normal; } #gear_form .heading { text-align: left; font-weight: bold; border-top: 2px dotted #969696; } .mandatory { color: red; } [% END %] [% inline_javascript = BLOCK %] var Dom = YAHOO.util.Dom; var needed = { [% FOREACH item = items %] [% NEXT UNLESS item.id %] '[% item.id FILTER js %]': 0[% ',' UNLESS loop.last %] [% END %] }; var needed_freeform = []; var gear = [ [% FOREACH item = items %] { id: '[% item.id FILTER js %]', name: '[% item.name FILTER js %]' } [% ',' UNLESS loop.last %] [% END %] ]; var mozspaces = { [% FOREACH space = mozspaces %] '[% space.name FILTER js %]': { [% FOREACH key = space.keys.sort %] '[% key FILTER js %]': '[% space.$key FILTER js %]'[% ',' UNLESS loop.last %] [% END %] }[% ',' UNLESS loop.last %] [% END %] }; [%# implemented this way to allow for dynamic updating of mandatory fields #%] var fields = [ { id: 'firstname', mandatory: true }, { id: 'lastname', mandatory: true }, { id: 'email', mandatory: true }, { id: 'mozspace', mandatory: false }, { id: 'teamcode', mandatory: true }, { id: 'purpose', mandatory: true }, { id: 'purpose_other', mandatory: false }, { id: 'date_required', mandatory: false }, { id: 'items', mandatory: true }, { id: 'shiptofirstname', mandatory: true }, { id: 'shiptolastname', mandatory: true }, { id: 'shiptoemail', mandatory: true }, { id: 'shiptoaddress1', mandatory: true }, { id: 'shiptoaddress2', mandatory: false }, { id: 'shiptocity', mandatory: true }, { id: 'shiptostate', mandatory: true }, { id: 'shiptocountry', mandatory: true }, { id: 'shiptopostcode', mandatory: true }, { id: 'shiptophone', mandatory: true }, { id: 'shiptoidrut', mandatory: false }, { id: 'comment', mandatory: false } ]; function initFields() { [%# find fields in the form, and update the fields array #%] var rows = Dom.get('gear_form').getElementsByTagName('TR'); for (var i = 0, l = rows.length; i < l; i++) { var row = rows[i]; var field = firstChild(row, 'INPUT') || firstChild(row, 'SELECT') || firstChild(row, 'TEXTAREA'); if (!field || field.type == 'submit') continue; var id = field.id; var label = firstChild(row, 'TH'); for (var j = 0, m = fields.length; j < m; j++) { if (fields[j].id == id) { fields[j].field = field; fields[j].label = label; fields[j].caption = label.textContent; break; } } } createCalendar('date_required'); } function tagMandatoryFields() { [%# add or remove the "* mandatory" marker from fields #%] for (var i = 0, l = fields.length; i < l; i++) { var f = fields[i]; if (!f.label) continue; var caption = f.caption; if (f.mandatory) caption = caption + ' *'; f.label.innerHTML = caption; } } function validateAndSubmit() { var alert_text = ''; for(var i = 0, l = fields.length; i < l; i++) { var f = fields[i]; if (f.mandatory && !isFilledOut(f.id)) if (f.field.nodeName == 'SELECT') { alert_text += 'Please select the ' + f.caption + ".\n"; } else { alert_text += 'Please enter the ' + f.caption + ".\n"; } } if (isFilledOut('email') && !isValidEmail(Dom.get('email').value)) alert_text += "Please enter a valid Email Address.\n"; if (isFilledOut('shiptoemail') && !isValidEmail(Dom.get('shiptoemail').value)) alert_text += "Please enter a valid Shipping Email Address.\n"; if (alert_text != '') { alert(alert_text); return false; } Dom.get('short_desc').value = 'Mozilla Gear - ' + Dom.get('firstname').value + ' ' + Dom.get('lastname').value; return true; } function onPurposeChange() { var value = Dom.get('purpose').value; var other = Dom.get('purpose_other'); if (value == 'Event') { getField('purpose_other').mandatory = true; other.placeholder = 'link to wiki' Dom.removeClass('purpose_other_row', 'bz_default_hidden'); Dom.addClass('recognition_row', 'bz_default_hidden'); } else if (value == 'Gear Space Stock') { getField('purpose_other').mandatory = true; other.placeholder = 'indicate space' Dom.removeClass('purpose_other_row', 'bz_default_hidden'); Dom.addClass('recognition_row', 'bz_default_hidden'); } else if (value == 'Other') { getField('purpose_other').mandatory = true; other.placeholder = 'more information'; Dom.removeClass('purpose_other_row', 'bz_default_hidden'); Dom.addClass('recognition_row', 'bz_default_hidden'); } else if (value == 'Mozillian Recognition') { getField('purpose_other').mandatory = false; Dom.addClass('purpose_other_row', 'bz_default_hidden'); Dom.removeClass('recognition_row', 'bz_default_hidden'); onRecognitionChange(); } else { getField('purpose_other').mandatory = false; Dom.addClass('purpose_other_row', 'bz_default_hidden'); Dom.addClass('recognition_row', 'bz_default_hidden'); } onRecognitionChange(); } function onRecognitionChange() { var mandatory = Dom.get('purpose').value != 'Mozillian Recognition' || !Dom.get('recognition_shipping').checked; getField('shiptoaddress1').mandatory = mandatory; getField('shiptocity').mandatory = mandatory; getField('shiptostate').mandatory = mandatory; getField('shiptocountry').mandatory = mandatory; getField('shiptopostcode').mandatory = mandatory; getField('shiptophone').mandatory = mandatory; tagMandatoryFields(); } function onMozSpaceChange() { if (Dom.get('mozspace').value) { Dom.removeClass('shipto_mozspace_container', 'bz_default_hidden'); } else { Dom.addClass('shipto_mozspace_container', 'bz_default_hidden'); } onShipToMozSpaceClick(); } function onShipToMozSpaceClick() { var address1 = address2 = city = state = country = postcode = ''; if (Dom.get('shipto_mozspace').checked) { var space = Dom.get('mozspace').value; address1 = mozspaces[space].address1; address2 = mozspaces[space].address2; city = mozspaces[space].city; state = mozspaces[space].state; country = mozspaces[space].country; postcode = mozspaces[space].postcode; } Dom.get('shiptoaddress1').value = address1; Dom.get('shiptoaddress2').value = address2; Dom.get('shiptocity').value = city; Dom.get('shiptostate').value = state; Dom.get('shiptocountry').value = country; Dom.get('shiptopostcode').value = postcode; Dom.get('shiptophone').value = ''; Dom.get('shiptoidrut').value = ''; onRecognitionChange(); } function onAddGearChange(focusInput) { var add_gear = Dom.get('add_gear').value; var isFreeform = add_gear == 'custom' || add_gear == 'other'; if (isFreeform) { Dom.addClass('quantity', 'bz_default_hidden'); resetFreeform(); Dom.get('freeform_quantity').value = Dom.get('quantity').value; Dom.removeClass('freeform_quantity', 'bz_default_hidden'); Dom.removeClass('add_freeform', 'bz_default_hidden'); if (focusInput) Dom.get('freeform_add').focus(); } else { Dom.get('quantity').value = Dom.get('freeform_quantity').value; Dom.removeClass('quantity', 'bz_default_hidden'); Dom.addClass('freeform_quantity', 'bz_default_hidden'); Dom.addClass('add_freeform', 'bz_default_hidden'); } } function firstChild(parent, name) { var a = parent.getElementsByTagName(name); return a.length == 0 ? false : a[0]; } function getField(id) { for(var i = 0, l = fields.length; i < l; i++) { if (fields[i].id == id) return fields[i]; } return false; } function addGear() { var id = Dom.get('add_gear').value; if (id == 'custom' || id == 'other') { var quantity = parseInt(Dom.get('freeform_quantity').value, 10); var name = Dom.get('freeform_add').value; if (!quantity || !name) return; needed_freeform.push({ 'type': id, 'quantity': quantity, 'name': name }); Dom.get('add_gear').value = ''; resetFreeform(); onAddGearChange(); } else { var quantity = parseInt(Dom.get('quantity').value, 10); if (!quantity || !id) return; needed[id] += quantity; } showGear(); } function resetFreeform() { Dom.get('freeform_quantity').value = '1'; Dom.get('freeform_add').value = ''; } function removeGear(id) { if (!id) return; needed[id] = 0; showGear(); } function removeFreeform(index) { needed_freeform.splice(index, 1); showGear(); } function showGear() { var html = '
' + needed[id] + ' x | ' + '' + YAHOO.lang.escapeHTML(item.name) + ' | ' + '' + ' |
' + item.quantity + ' x | ' + '(' + item.type + ') ' + YAHOO.lang.escapeHTML(item.name) + ' | ' + '' + ' |
No gear selected. |
Want gear? Here's what to do:
Check the gear wiki for more information about gear, including approved uses and the list of available gear.
Gear requests for Rep-driven events and campaigns should continue to be submitted through their existing process.
* Required Field
Requests will only be visible to the person who submitted it, authorized members of the Mozilla Engagement team, and our Staples Customer Service rep. We do this to help protect the personal identifying information in this [% terms.bugs %].
[% PROCESS global/footer.html.tmpl %]