old_contents: /**
   * Patterns checkedflag - Add checked flag to checkbox labels
   *
   * Copyright 2013 Simplon B.V. - Wichert Akkerman
   * Copyright 2013 Florian Friesdorf
   */
  define([
      "jquery",
      "../registry",
      "../utils"
  ], function($, patterns, utils) {
      var select_option = {
          name: "select-option",
          trigger: "label select",
  
          init: function($el) {
              $el.on("change.pat-select-option", select_option._onChange);
              select_option._onChange.call(this);
              return $el;
          },
  
          destroy: function($el) {
              return $el.off(".pat-select-option");
          },
  
          _onChange: function() {
              var label = utils.findLabel(this);
              if (label !== null) {
                  $(label).attr('data-option', $(this).val() || "");
              }
          }
      };
  
      patterns.register(select_option);
      return select_option;
  });
  
new_contents: /**
   * Patterns checkedflag - Add checked flag to checkbox labels
   *
   * Copyright 2013 Simplon B.V. - Wichert Akkerman
   * Copyright 2013 Florian Friesdorf
   */
  define([
      "jquery",
      "../registry"
  ], function($, patterns) {
      var select_option = {
          name: "select-option",
          trigger: "select",
  
          init: function($el) {
              $el.each(function() {
                  var $el = $(this);
                  // create parent span if not direct child of a label
                  if ($el.parent('label').length === 0) {
                      $el.wrap('<span />');
                  }
                  $el.parent().attr('data-option', $el.val() || "");
              }).on("change.pat-select-option", function() {
                  $(this).parent().attr('data-option', $el.val() || "");
              });
          },
  
          destroy: function($el) {
              return $el.off(".pat-select-option");
          }
      };
  
      patterns.register(select_option);
      return select_option;
  });
  
subject: create span parent if select has no label parent