/* globals $ */
$(function () {
  'use strict'
  $(document).foundation()

  $('.top-bar > .top-bar-right > .menu > li > button.hollow').click(function (ev) {
  })

  $('button.logout').click(function (ev) {
    $.ajax({
      url: '/_session',
      method: 'DELETE',
      complete: function () { window.location = '/_utils/groupe2016.html' }
    })
  })
})



@@ -46,117 +46,1572 @@
 '%0A  
-$(document).foundation()%0A%0A  $('.top-bar %3E .top-bar-right %3E .menu %3E li %3E button.hollow').click(function (ev) %7B
+const $passwordButton = $('.top-bar %3E .top-bar-right %3E .menu %3E li %3E button.hollow')%0A  if ($passwordButton.length) %7B%0A    $passwordButton.attr('data-open', 'changePassword')%0A    $('body').append(%5B%0A      '%3Cdiv class=%22reveal%22 id=%22changePassword%22 data-reveal%3E',%0A      '%3Cform class=%22shake%22%3E',%0A      '%3Ch2%3EChanger votre mot de passe%3C/h2%3E',%0A      '%3Clabel%3ENouveau mot de passe:',%0A      '%3Cinput required type=%22text%22 name=%22password%22%3E',%0A      '%3C/label%3E',%0A      '%3Clabel%3ER%C3%A9p%C3%A9tez le mot de passe:',%0A      '%3Cinput required type=%22text%22 name=%22password2%22%3E',%0A      '%3C/label%3E',%0A      '%3Cinput class=%22button alert%22 type=%22submit%22 value=%22Remplacez mon mot de passe%22%3E',%0A      ' %3Cbutton type=%22button%22 class=%22button warning%22 data-close%3EAnnuler%3C/button%3E',%0A      '%3C/form%3E',%0A      '%3Cbutton class=%22close-button%22 data-close aria-label=%22Annuler%22 type=%22button%22%3E',%0A      '%3Cspan aria-hidden=%22true%22%3E&times;%3C/span%3E',%0A      '%3C/button%3E',%0A      '%3C/div%3E'%0A    %5D.join(''))%0A  %7D%0A  $(document).foundation()%0A%0A  $('body').on('submit', '#changePassword %3E form', function (ev) %7B%0A    ev.preventDefault()%0A    const $form = $(this)%0A    const pwds = $form.serializeArray()%0A      .map(function (i) %7B return i.value %7D)%0A      .slice(0, 2)%0A      .filter(function (i) %7B return i %7D)%0A%0A    if (pwds.length !== 2 %7C%7C pwds%5B0%5D !== pwds%5B1%5D) %7B%0A      $form.addClass('shake-horizontal shake-constant')%0A      setTimeout(function () %7B%0A        $form.removeClass('shake-horizontal shake-constant')%0A      %7D, 500)%0A      return%0A    %7D%0A    console.log('Ready to change password!')%0A    // get user doc%0A    // set password field%0A    // put user doc
 %0A  %7D
@@ -1808,10 +1808,8 @@
   %7D)%0A%7D)%0A
-%0A%0A

Change password dialog, for admin.