+ '#description' => t('The relationship can only create one context, but multiple items can be related. Please type in the number you want. The first one will be 0.'),
+ * Module implementing field collection field type.
+ */
+
+/**
+ * Implements hook_help().
+ */
+function field_collection_help($path, $arg) {
+ switch ($path) {
+ case 'admin/help#field_collection':
+ $output = '';
+ $output .= '<h3>' . t('About') . '</h3>';
+ $output .= '<p>' . t('The field collection module provides a field, to which any number of fields can be attached. See the <a href="@field-help">Field module help page</a> for more information about fields.', array('@field-help' => url('admin/help/field'))) . '</p>';
+ // As field_ui_default_value_widget() does, we change the #parents so that
+ // the value below is writing to $instance in the right location.
+ '#parents' => array('instance'),
+ );
+ // Be sure to set the default value to NULL, e.g. to repair old fields
+ // that still have one.
+ $element['fieldset']['default_value'] = array(
+ '#type' => 'value',
+ '#value' => NULL,
+ );
+ $element['fieldset']['content'] = array(
+ '#pre' => '<p>',
+ '#markup' => t('To specify a default value, configure it via the regular default value setting of each field that is part of the field collection. To do so, go to the <a href="!url">Manage fields</a> screen of the field collection.', array('!url' => url('admin/structure/field-collections/' . strtr($field['field_name'], array('_' => '-')) . '/fields'))),
+ '#suffix' => '</p>',
+ );
+ return $element;
+}
+
+/**
+ * Returns the base path to use for field collection items.
+ '#description' => t("A blank item is always added to any unlimited valued field's form. If checked, any additional blank items are hidden except of the first item which is always shown."),
+ list ($node, $entity) = $this->createNodeWithFieldCollection();
+ $node = node_load($node->nid, NULL, TRUE);
+ $this->assertEqual($entity->item_id, $node->{$this->field_name}[LANGUAGE_NONE][0]['value'], 'A field_collection has been successfully created and referenced.');
+ $this->assertEqual($entity->revision_id, $node->{$this->field_name}[LANGUAGE_NONE][0]['revision_id'], 'A field_collection has been successfully created and referenced.');
+
+ // Test adding an additional field_collection during node edit.
+ $this->assertTrue(!empty($entity2->item_id) && !empty($entity2->revision_id), 'Field_collection has been saved.');
+ $this->assertEqual($entity->item_id, $node->{$this->field_name}[LANGUAGE_NONE][0]['value'], 'Existing reference has been kept during update.');
+ $this->assertEqual($entity->revision_id, $node->{$this->field_name}[LANGUAGE_NONE][0]['revision_id'], 'Existing reference has been kept during update (revision).');
+ $this->assertEqual($entity2->item_id, $node->{$this->field_name}[LANGUAGE_NONE][1]['value'], 'New field_collection has been properly referenced');
+ $this->assertEqual($entity2->revision_id, $node->{$this->field_name}[LANGUAGE_NONE][1]['revision_id'], 'New field_collection has been properly referenced (revision)');
+
+ // Make sure deleting the field_collection removes the reference.
+ $this->assertNotEqual($item->revision_id, $item_updated->revision_id, 'Creating a new host entity revision creates a new field collection revision.');
+
+ // Test saving a new revision with a new field collection item.
+ $node->revision = TRUE;
+
+ // Test saving the node without creating a new revision.
+ $this->assertEqual($item->revision_id, $item_updated->revision_id, 'Updating a new host entity without creating a new revision does not create a new field collection revision.');
+
+ // Create a new revision of the node, such we have a non default node and
+ // field collection revision. Then test using it.
+ $this->assertNotEqual($item_revision_id, $item_updated->revision_id, 'Creating a new host entity revision creates a new field collection revision.');
+ $this->assertTrue($item_updated->isDefaultRevision(), 'Field collection of default host entity revision is default too.');
+ $this->assertEqual($item_updated->hostEntityId(), $node->nid, 'Can access host entity ID of default field collection revision.');
+ $this->assertTrue(!empty($node->{$this->field_name}[LANGUAGE_NONE][0]['value']), 'A field_collection has been successfully created.');
+ $this->assertTrue(!empty($node->{$this->field_name}[LANGUAGE_NONE][0]['revision_id']), 'A field_collection has been successfully created (revision).');
+
+ // Now try making use of the field collection in rules.
+ '#description' => t('The delta allows you to select which item in a multiple value field to key the relationship off of. Select "1" to use the first item, "2" for the second item, and so on. If you select "All", each item in the field will create a new row, which may appear to cause duplicates.'),
+ 0 => t('The video progress bar and player controls will be visible throughout the video.'),
+ 1 => t('Automatically slide the video progress bar and the player controls out of view a couple of seconds after the video starts playing. They will only reappear if the user moves her mouse over the video player or presses a keyboard key.'),
+ 2 => t('The video progress bar will fade out but the player controls (play button, volume control, etc.) remain visible.'),
+ ),
+ '#title' => t('Autohide progress bar and the player controls'),
+ '#description' => t('Controls the autohide behavior of the youtube player controls.'),
+ '#default_value' => $defaults['autohide'],
+ );
+
+ return $form;
+}
+
+/**
+ * Helper function to get the Vimeo video's ID
+ *
+ * @param string $url
+ * A Vimeo video URL to get the ID of
+ *
+ * @return integer|false $id
+ * The video ID, or FALSE if unable to get the video ID
+A site administrator at [site:name] has created an account for you. You may now log in by clicking this link or copying and pasting it to your browser:
+
+[user:one-time-login-url]
+
+This link can only be used once to log in and will lead you to a page where you can set your password.
+
+After setting your password, you will be able to log in at [site:login-url] in the future using:
- * Theme comment controls box where the user can change the default display mode and display order of comments.
- *
- * @param $form
- * The form structure.
- * @ingroup themeable
- */
-function inigui_comment_controls($form) {
- $output = '<div class="container-inline">';
- $output .= drupal_render($form);
- $output .= '</div>';
- $output .= '<div class="description">'. t('Select your preferred way to display the comments and click "Save settings" to activate your changes.') .'</div>';
+ d="m -6576.334,-901.716 5.712,0 0,-4.676 -5.712,0 c -0.952,0 -1.764,-0.784 -1.764,-1.736 0,-0.952 0.812,-1.764 1.764,-1.764 l 5.712,0 0,-4.648 -5.712,0 c -0.952,0 -1.764,-0.812 -1.764,-1.764 0,-0.952 0.812,-1.736 1.764,-1.736 l 5.712,0 0,-4.676 -5.712,0 c -3.556,0 -6.412,2.884 -6.412,6.412 0,1.54 0.56,2.968 1.456,4.088 -0.896,1.12 -1.456,2.548 -1.456,4.088 0,3.556 2.856,6.412 6.412,6.412 z"
+ style="fill:url(#SVGID_396_)"
+ inkscape:connector-curvature="0" />
+ <linearGradient
+ y2="-852.42212"
+ x2="-6145.293"
+ y1="-936.43042"
+ x1="-6730.3516"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient47877">
+ <stop
+ id="stop47879"
+ style="stop-color:#7C146B"
+ offset="0" />
+ <stop
+ id="stop47881"
+ style="stop-color:#722D70"
+ offset="0.1339" />
+ <stop
+ id="stop47883"
+ style="stop-color:#52537E"
+ offset="0.4232" />
+ <stop
+ id="stop47885"
+ style="stop-color:#006F81"
+ offset="0.8425" />
+ <stop
+ id="stop47887"
+ style="stop-color:#00747D"
+ offset="1" />
+ </linearGradient>
+ <path
+ id="path10305"
+ d="m -6551.499,-908.128 c 0,-1.54 -0.56,-2.968 -1.484,-4.088 0.924,-1.12 1.484,-2.548 1.484,-4.088 0,-3.528 -2.884,-6.412 -6.412,-6.412 l -8.064,0 0,21 8.064,0 c 3.529,0 6.412,-2.856 6.412,-6.412 z m -6.411,1.736 -3.388,0 0,-3.5 3.388,0 c 0.952,0 1.736,0.812 1.736,1.764 0,0.952 -0.784,1.736 -1.736,1.736 z m 0,-8.148 -3.388,0 0,-3.5 3.388,0 c 0.952,0 1.736,0.784 1.736,1.736 0,0.952 -0.784,1.764 -1.736,1.764 z"
+ style="fill:url(#SVGID_397_)"
+ inkscape:connector-curvature="0" />
+ <linearGradient
+ y2="-854.85468"
+ x2="-6144.9438"
+ y1="-938.86298"
+ x1="-6730.0024"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient47890">
+ <stop
+ id="stop47892"
+ style="stop-color:#7C146B"
+ offset="0" />
+ <stop
+ id="stop47894"
+ style="stop-color:#722D70"
+ offset="0.1339" />
+ <stop
+ id="stop47896"
+ style="stop-color:#52537E"
+ offset="0.4232" />
+ <stop
+ id="stop47898"
+ style="stop-color:#006F81"
+ offset="0.8425" />
+ <stop
+ id="stop47900"
+ style="stop-color:#00747D"
+ offset="1" />
+ </linearGradient>
+ <path
+ id="path10318"
+ d="m -6542.146,-922.716 -5.152,0 0,21 5.152,0 c 5.152,0 9.324,-4.676 9.324,-10.5 0,-5.796 -4.173,-10.5 -9.324,-10.5 z m 0,16.324 -0.476,0 0,-11.648 0.476,0 c 2.548,0 4.648,2.604 4.648,5.824 0,3.22 -2.101,5.824 -4.648,5.824 z"
+ style="fill:url(#SVGID_398_)"
+ inkscape:connector-curvature="0" />
+ <linearGradient
+ y2="-857.98022"
+ x2="-6144.4951"
+ y1="-941.98853"
+ x1="-6729.5537"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient47903">
+ <stop
+ id="stop47905"
+ style="stop-color:#7C146B"
+ offset="0" />
+ <stop
+ id="stop47907"
+ style="stop-color:#722D70"
+ offset="0.1339" />
+ <stop
+ id="stop47909"
+ style="stop-color:#52537E"
+ offset="0.4232" />
+ <stop
+ id="stop47911"
+ style="stop-color:#006F81"
+ offset="0.8425" />
+ <stop
+ id="stop47913"
+ style="stop-color:#00747D"
+ offset="1" />
+ </linearGradient>
+ <path
+ id="path10331"
+ d="m -6522.211,-923.192 c -3.864,0 -7,3.136 -7,7 l 0,7.952 c 0,3.864 3.136,7 7,7 3.892,0 7,-3.136 7,-7 l 0,-7.952 c 0,-3.864 -3.108,-7 -7,-7 z m 2.352,14.952 c 0,1.288 -1.064,2.324 -2.352,2.324 -1.288,0 -2.324,-1.036 -2.324,-2.324 l 0,-7.952 c 0,-1.26 1.036,-2.324 2.324,-2.324 1.288,0 2.352,1.064 2.352,2.324 l 0,7.952 z"
+ style="fill:url(#SVGID_399_)"
+ inkscape:connector-curvature="0" />
+ <linearGradient
+ y2="-860.60687"
+ x2="-6144.1182"
+ y1="-944.61517"
+ x1="-6729.1768"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient47916">
+ <stop
+ id="stop47918"
+ style="stop-color:#7C146B"
+ offset="0" />
+ <stop
+ id="stop47920"
+ style="stop-color:#722D70"
+ offset="0.1339" />
+ <stop
+ id="stop47922"
+ style="stop-color:#52537E"
+ offset="0.4232" />
+ <stop
+ id="stop47924"
+ style="stop-color:#006F81"
+ offset="0.8425" />
+ <stop
+ id="stop47926"
+ style="stop-color:#00747D"
+ offset="1" />
+ </linearGradient>
+ <path
+ id="path10344"
+ d="m -6503.535,-901.24 c 3.22,0 5.936,-2.184 6.748,-5.152 l -5.348,0 c -0.392,0.308 -0.868,0.476 -1.4,0.476 -1.288,0 -2.324,-1.036 -2.324,-2.324 l 0,-7.952 c 0,-1.26 1.036,-2.324 2.324,-2.324 0.532,0 1.008,0.168 1.4,0.476 l 5.348,0 c -0.812,-2.968 -3.528,-5.152 -6.748,-5.152 -3.864,0 -7,3.136 -7,7 l 0,7.952 c 0,3.864 3.136,7 7,7 z"
+ style="fill:url(#SVGID_400_)"
+ inkscape:connector-curvature="0" />
+ <linearGradient
+ y2="-863.29321"
+ x2="-6143.7324"
+ y1="-947.30151"
+ x1="-6728.791"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient47929">
+ <stop
+ id="stop47931"
+ style="stop-color:#7C146B"
+ offset="0" />
+ <stop
+ id="stop47933"
+ style="stop-color:#722D70"
+ offset="0.1339" />
+ <stop
+ id="stop47935"
+ style="stop-color:#52537E"
+ offset="0.4232" />
+ <stop
+ id="stop47937"
+ style="stop-color:#006F81"
+ offset="0.8425" />
+ <stop
+ id="stop47939"
+ style="stop-color:#00747D"
+ offset="1" />
+ </linearGradient>
+ <path
+ id="path10357"
+ d="m -6483.683,-908.24 c 0,1.288 -1.064,2.324 -2.352,2.324 -1.288,0 -2.324,-1.036 -2.324,-2.324 l 0,-14.476 -4.676,0 0,14.476 c 0,3.864 3.136,7 7,7 3.892,0 7,-3.136 7,-7 l 0,-14.476 -4.648,0 0,14.476 z"
+ d="m -6675.873,-889.116 -7.644,21 4.956,0 1.232,-3.5 7.7,0 1.232,3.5 4.956,0 -7.616,-21 -4.816,0 z m 0.196,12.824 2.212,-6.244 2.212,6.244 -4.424,0 z"
+ style="fill:url(#SVGID_414_)"
+ inkscape:connector-curvature="0" />
+ <linearGradient
+ y2="-807.14581"
+ x2="-6151.7944"
+ y1="-891.15411"
+ x1="-6736.853"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient48111">
+ <stop
+ id="stop48113"
+ style="stop-color:#7C146B"
+ offset="0" />
+ <stop
+ id="stop48115"
+ style="stop-color:#722D70"
+ offset="0.1339" />
+ <stop
+ id="stop48117"
+ style="stop-color:#52537E"
+ offset="0.4232" />
+ <stop
+ id="stop48119"
+ style="stop-color:#006F81"
+ offset="0.8425" />
+ <stop
+ id="stop48121"
+ style="stop-color:#00747D"
+ offset="1" />
+ </linearGradient>
+ <path
+ id="path10539"
+ d="m -6647.257,-889.116 -5.152,0 0,21 5.152,0 c 5.152,0 9.324,-4.676 9.324,-10.5 0,-5.796 -4.172,-10.5 -9.324,-10.5 z m 0,16.324 -0.476,0 0,-11.648 0.476,0 c 2.548,0 4.648,2.604 4.648,5.824 0,3.22 -2.1,5.824 -4.648,5.824 z"
+ style="fill:url(#SVGID_415_)"
+ inkscape:connector-curvature="0" />
+ <linearGradient
+ y2="-810.27081"
+ x2="-6151.3457"
+ y1="-894.27911"
+ x1="-6736.4043"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient48124">
+ <stop
+ id="stop48126"
+ style="stop-color:#7C146B"
+ offset="0" />
+ <stop
+ id="stop48128"
+ style="stop-color:#722D70"
+ offset="0.1339" />
+ <stop
+ id="stop48130"
+ style="stop-color:#52537E"
+ offset="0.4232" />
+ <stop
+ id="stop48132"
+ style="stop-color:#006F81"
+ offset="0.8425" />
+ <stop
+ id="stop48134"
+ style="stop-color:#00747D"
+ offset="1" />
+ </linearGradient>
+ <path
+ id="path10552"
+ d="m -6627.322,-889.592 c -3.864,0 -7,3.136 -7,7 l 0,7.952 c 0,3.864 3.136,7 7,7 3.892,0 7,-3.136 7,-7 l 0,-7.952 c 0,-3.864 -3.108,-7 -7,-7 z m 2.352,14.952 c 0,1.288 -1.064,2.324 -2.352,2.324 -1.288,0 -2.324,-1.036 -2.324,-2.324 l 0,-7.952 c 0,-1.26 1.036,-2.324 2.324,-2.324 1.288,0 2.352,1.064 2.352,2.324 l 0,7.952 z"
+ style="fill:url(#SVGID_416_)"
+ inkscape:connector-curvature="0" />
+ <linearGradient
+ y2="-812.89789"
+ x2="-6150.9688"
+ y1="-896.90619"
+ x1="-6736.0273"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient48137">
+ <stop
+ id="stop48139"
+ style="stop-color:#7C146B"
+ offset="0" />
+ <stop
+ id="stop48141"
+ style="stop-color:#722D70"
+ offset="0.1339" />
+ <stop
+ id="stop48143"
+ style="stop-color:#52537E"
+ offset="0.4232" />
+ <stop
+ id="stop48145"
+ style="stop-color:#006F81"
+ offset="0.8425" />
+ <stop
+ id="stop48147"
+ style="stop-color:#00747D"
+ offset="1" />
+ </linearGradient>
+ <path
+ id="path10565"
+ d="m -6608.646,-884.916 c 0.532,0 1.008,0.168 1.4,0.476 l 5.348,0 c -0.812,-2.968 -3.528,-5.152 -6.748,-5.152 -3.864,0 -7,3.136 -7,7 l 0,7.952 c 0,3.864 3.136,7 7,7 3.22,0 5.936,-2.184 6.748,-5.152 l -5.348,0 c -0.392,0.308 -0.868,0.476 -1.4,0.476 -1.288,0 -2.324,-1.036 -2.324,-2.324 l 0,-7.952 c 0,-1.26 1.036,-2.324 2.324,-2.324 z"
+ d="m -6535.594,-882.704 c 0,1.54 0.56,2.968 1.456,4.088 -0.896,1.12 -1.456,2.548 -1.456,4.088 0,3.556 2.856,6.412 6.412,6.412 l 5.712,0 0,-4.676 -5.712,0 c -0.952,0 -1.764,-0.784 -1.764,-1.736 0,-0.952 0.812,-1.764 1.764,-1.764 l 5.712,0 0,-4.648 -5.712,0 c -0.952,0 -1.764,-0.812 -1.764,-1.764 0,-0.952 0.812,-1.736 1.764,-1.736 l 5.712,0 0,-4.676 -5.712,0 c -3.556,0 -6.412,2.884 -6.412,6.412 z"
+ style="fill:url(#SVGID_422_)"
+ inkscape:connector-curvature="0" />
+ <linearGradient
+ y2="-827.66937"
+ x2="-6148.8477"
+ y1="-911.67767"
+ x1="-6733.9062"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient48215">
+ <stop
+ id="stop48217"
+ style="stop-color:#7C146B"
+ offset="0" />
+ <stop
+ id="stop48219"
+ style="stop-color:#722D70"
+ offset="0.1339" />
+ <stop
+ id="stop48221"
+ style="stop-color:#52537E"
+ offset="0.4232" />
+ <stop
+ id="stop48223"
+ style="stop-color:#006F81"
+ offset="0.8425" />
+ <stop
+ id="stop48225"
+ style="stop-color:#00747D"
+ offset="1" />
+ </linearGradient>
+ <path
+ id="path10643"
+ d="m -6503.647,-880.94 c -1.288,0 -2.352,-0.896 -2.352,-1.988 0,-1.092 1.064,-1.988 2.352,-1.988 0.56,0 1.092,0.196 1.484,0.476 l 5.32,0 c -0.728,-2.94 -3.5,-5.152 -6.804,-5.152 -3.892,0 -7,2.996 -7,6.664 0,3.668 3.108,6.636 7,6.636 1.26,0 2.324,0.896 2.324,1.988 0,1.092 -1.064,1.988 -2.324,1.988 -0.588,0 -1.12,-0.196 -1.512,-0.476 l -5.32,0 c 0.728,2.94 3.5,5.152 6.832,5.152 3.864,0 7,-2.996 7,-6.664 0,-3.668 -3.136,-6.636 -7,-6.636 z"
+ style="fill:url(#SVGID_423_)"
+ inkscape:connector-curvature="0" />
+ <linearGradient
+ y2="-830.12872"
+ x2="-6148.4941"
+ y1="-914.13702"
+ x1="-6733.5527"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient48228">
+ <stop
+ id="stop48230"
+ style="stop-color:#7C146B"
+ offset="0" />
+ <stop
+ id="stop48232"
+ style="stop-color:#722D70"
+ offset="0.1339" />
+ <stop
+ id="stop48234"
+ style="stop-color:#52537E"
+ offset="0.4232" />
+ <stop
+ id="stop48236"
+ style="stop-color:#006F81"
+ offset="0.8425" />
+ <stop
+ id="stop48238"
+ style="stop-color:#00747D"
+ offset="1" />
+ </linearGradient>
+ <path
+ id="path10656"
+ d="m -6486.175,-889.592 c -3.864,0 -7,3.136 -7,7 l 0,7.952 c 0,3.864 3.136,7 7,7 3.892,0 7,-3.136 7,-7 l 0,-7.952 c 0,-3.864 -3.108,-7 -7,-7 z m 2.352,14.952 c 0,1.288 -1.064,2.324 -2.352,2.324 -1.288,0 -2.324,-1.036 -2.324,-2.324 l 0,-7.952 c 0,-1.26 1.036,-2.324 2.324,-2.324 1.288,0 2.352,1.064 2.352,2.324 l 0,7.952 z"
+ style="fill:url(#SVGID_424_)"
+ inkscape:connector-curvature="0" />
+ <linearGradient
+ y2="-832.75562"
+ x2="-6148.1172"
+ y1="-916.76392"
+ x1="-6733.1758"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient48241">
+ <stop
+ id="stop48243"
+ style="stop-color:#7C146B"
+ offset="0" />
+ <stop
+ id="stop48245"
+ style="stop-color:#722D70"
+ offset="0.1339" />
+ <stop
+ id="stop48247"
+ style="stop-color:#52537E"
+ offset="0.4232" />
+ <stop
+ id="stop48249"
+ style="stop-color:#006F81"
+ offset="0.8425" />
+ <stop
+ id="stop48251"
+ style="stop-color:#00747D"
+ offset="1" />
+ </linearGradient>
+ <path
+ id="path10669"
+ d="m -6467.5,-884.916 c 0.532,0 1.008,0.168 1.4,0.476 l 5.348,0 c -0.812,-2.968 -3.528,-5.152 -6.748,-5.152 -3.864,0 -7,3.136 -7,7 l 0,7.952 c 0,3.864 3.136,7 7,7 3.22,0 5.936,-2.184 6.748,-5.152 l -5.348,0 c -0.392,0.308 -0.868,0.476 -1.4,0.476 -1.288,0 -2.324,-1.036 -2.324,-2.324 l 0,-7.952 c 10e-4,-1.26 1.037,-2.324 2.324,-2.324 z"
+ style="fill:url(#SVGID_425_)"
+ inkscape:connector-curvature="0" />
+ <linearGradient
+ y2="-834.56201"
+ x2="-6147.8579"
+ y1="-918.57031"
+ x1="-6732.9165"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient48254">
+ <stop
+ id="stop48256"
+ style="stop-color:#7C146B"
+ offset="0" />
+ <stop
+ id="stop48258"
+ style="stop-color:#722D70"
+ offset="0.1339" />
+ <stop
+ id="stop48260"
+ style="stop-color:#52537E"
+ offset="0.4232" />
+ <stop
+ id="stop48262"
+ style="stop-color:#006F81"
+ offset="0.8425" />
+ <stop
+ id="stop48264"
+ style="stop-color:#00747D"
+ offset="1" />
+ </linearGradient>
+ <rect
+ id="rect10682"
+ height="21"
+ width="4.6760001"
+ y="-889.11603"
+ x="-6456.999"
+ style="fill:url(#SVGID_426_)" />
+ <linearGradient
+ y2="-836.00372"
+ x2="-6147.6509"
+ y1="-920.01202"
+ x1="-6732.7095"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient48267">
+ <stop
+ id="stop48269"
+ style="stop-color:#7C146B"
+ offset="0" />
+ <stop
+ id="stop48271"
+ style="stop-color:#722D70"
+ offset="0.1339" />
+ <stop
+ id="stop48273"
+ style="stop-color:#52537E"
+ offset="0.4232" />
+ <stop
+ id="stop48275"
+ style="stop-color:#006F81"
+ offset="0.8425" />
+ <stop
+ id="stop48277"
+ style="stop-color:#00747D"
+ offset="1" />
+ </linearGradient>
+ <path
+ id="path10695"
+ d="m -6443,-889.116 -7.644,21 4.956,0 1.232,-3.5 7.7,0 1.232,3.5 4.956,0 -7.616,-21 -4.816,0 z m 0.196,12.824 2.212,-6.244 2.212,6.244 -4.424,0 z"
+FastClick is a simple, easy-to-use library for eliminating the 300ms delay between a physical tap and the firing of a `click` event on mobile browsers. The aim is to make your application feel less laggy and more responsive while avoiding any interference with your current logic.
+
+FastClick is developed by [FT Labs](http://labs.ft.com/), part of the Financial Times.
+
+[Explication en français](http://maxime.sh/2013/02/supprimer-le-lag-des-clics-sur-mobile-avec-fastclick/).
+According to [Google](https://developers.google.com/mobile/articles/fast_buttons):
+
+> ...mobile browsers will wait approximately 300ms from the time that you tap the button to fire the click event. The reason for this is that the browser is waiting to see if you are actually performing a double tap.
+
+## Compatibility ##
+
+The library has been deployed as part of the [FT Web App](http://app.ft.com/) and is tried and tested on the following mobile browsers:
+
+* Mobile Safari on iOS 3 and upwards
+* Chrome on iOS 5 and upwards
+* Chrome on Android (ICS)
+* Opera Mobile 11.5 and upwards
+* Android Browser since Android 2
+* PlayBook OS 1 and upwards
+
+## When it isn't needed ##
+
+FastClick doesn't attach any listeners on desktop browsers.
+
+Chrome 32+ on Android with `width=device-width` in the [viewport meta tag](https://developer.mozilla.org/en-US/docs/Mobile/Viewport_meta_tag) doesn't have a 300ms delay, therefore listeners aren't attached.
+Same goes for Chrome on Android (all versions) with `user-scalable=no` in the viewport meta tag. But be aware that `user-scalable=no` also disables pinch zooming, which may be an accessibility concern.
+
+For IE10, you can use `-ms-touch-action: none` to disable double-tap-to-zoom on certain elements (like links and buttons) as described in [this MSDN blog post](http://blogs.msdn.com/b/askie/archive/2013/01/06/how-to-implement-the-ms-touch-action-none-property-to-disable-double-tap-zoom-on-touch-devices.aspx).
+
+## Usage ##
+
+Include fastclick.js in your JavaScript bundle or add it to your HTML page like this:
+The script must be loaded prior to instantiating FastClick on any element of the page.
+
+To instantiate FastClick on the `body`, which is the recommended method of use:
+
+```js
+window.addEventListener('load', function() {
+ FastClick.attach(document.body);
+}, false);
+```
+
+Don't forget to add a [shim](https://developer.mozilla.org/en-US/docs/DOM/EventTarget.removeEventListener#Compatibility) for `addEventListener` if you want to support IE8 and below.
+
+Otherwise, if you're using jQuery:
+
+```js
+$(function() {
+ FastClick.attach(document.body);
+});
+```
+
+If you're using Browserify or another CommonJS-style module system, the `FastClick.attach` function will be returned when you call `require('fastclick')`. As a result, the easiest way to use FastClick with these loaders is as follows:
+
+```js
+var attachFastClick = require('fastclick');
+attachFastClick(document.body);
+```
+
+### Minified ###
+
+Run `make` to build a minified version of FastClick using the Closure Compiler REST API. The minified file is saved to `build/fastclick.min.js` or you can [download a pre-minified version](http://build.origami.ft.com/bundles/js?modules=fastclick).
+
+### AMD ###
+
+FastClick has AMD (Asynchronous Module Definition) support. This allows it to be lazy-loaded with an AMD loader, such as [RequireJS](http://requirejs.org/). Note that when using the AMD style require, the full `FastClick` object will be returned, _not_ `FastClick.attach`
+
+```js
+var FastClick = require('fastclick');
+FastClick.attach(document.body);
+```
+
+### Package managers ###
+
+You can install FastClick using [Component](https://github.com/component/component), [npm](https://npmjs.org/package/fastclick) or [Bower](http://bower.io/).
+
+For Ruby, there's a third-party gem called [fastclick-rails](http://rubygems.org/gems/fastclick-rails). For .NET there's a [NuGet package](http://nuget.org/packages/FastClick).
+
+## Advanced ##
+
+### Ignore certain elements with `needsclick` ###
+
+Sometimes you need FastClick to ignore certain elements. You can do this easily by adding the `needsclick` class.
+```html
+<a class="needsclick">Ignored by FastClick</a>
+```
+
+#### Use case 1: non-synthetic click required ####
+
+Internally, FastClick uses `document.createEvent` to fire a synthetic `click` event as soon as `touchend` is fired by the browser. It then suppresses the additional `click` event created by the browser after that. In some cases, the non-synthetic `click` event created by the browser is required, as described in the [triggering focus example](http://ftlabs.github.com/fastclick/examples/focus.html).
+
+This is where the `needsclick` class comes in. Add the class to any element that requires a non-synthetic click.
+
+#### Use case 2: Twitter Bootstrap 2.2.2 dropdowns ####
+
+Another example of when to use the `needsclick` class is with dropdowns in Twitter Bootstrap 2.2.2. Bootstrap add its own `touchstart` listener for dropdowns, so you want to tell FastClick to ignore those. If you don't, touch devices will automatically close the dropdown as soon as it is clicked, because both FastClick and Bootstrap execute the synthetic click, one opens the dropdown, the second closes it immediately after.
+FastClick is designed to cope with many different browser oddities. Here are some examples to illustrate this:
+
+* [basic use](http://ftlabs.github.com/fastclick/examples/layer.html) showing the increase in perceived responsiveness
+* [triggering focus](http://ftlabs.github.com/fastclick/examples/focus.html) on an input element from a `click` handler
+* [input element](http://ftlabs.github.com/fastclick/examples/input.html) which never receives clicks but gets fast focus
+
+## Tests ##
+
+There are no automated tests. The files in `tests/` are manual reduced test cases. We've had a think about how best to test these cases, but they tend to be very browser/device specific and sometimes subjective which means it's not so trivial to test.
+
+## Credits and collaboration ##
+
+FastClick is maintained by [Rowan Beentje](http://twitter.com/rowanbeentje), [Matthew Caruana Galizia](http://twitter.com/mcaruanagalizia) and [Matthew Andrews](http://twitter.com/andrewsmatt) at [FT Labs](http://labs.ft.com). All open source code released by FT Labs is licenced under the MIT licence. We welcome comments, feedback and suggestions. Please feel free to raise an issue or pull request.
+ // Issue #160: on iOS 7, some input elements (e.g. date datetime) throw a vague TypeError on setSelectionRange. These elements don't have an integer value for the selectionStart and selectionEnd properties, but unfortunately that can't be used for detection because accessing the properties also throws a TypeError. Just check the type instead. Filed as Apple bug #15122724.
+ // Case 1: If the touch started a while ago (best guess is 100ms based on tests for issue #36) then focus will be triggered anyway. Return early and unset the target element reference so that the subsequent click will be allowed through.
+ // Case 2: Without this exception for input elements tapped when the document is contained in an iframe, then any inputted text won't be visible even though the value attribute is updated as the user types (issue #37).
+ if (!this.needsClick(this.targetElement) || this.cancelNextClick) {
+
+ // Prevent any user-added listeners declared on FastClick element from being fired.
+ if (event.stopImmediatePropagation) {
+ event.stopImmediatePropagation();
+ } else {
+
+ // Part of the hack for browsers that don't support Event#stopImmediatePropagation (e.g. Android 2)
+ event.propagationStopped = true;
+ }
+
+ // Cancel the event
+ event.stopPropagation();
+ event.preventDefault();
+
+ return false;
+ }
+
+ // If the mouse event is permitted, return true for the action to go through.
+ return true;
+};
+
+
+/**
+ * On actual clicks, determine whether this is a touch-generated click, a click action occurring
+ * naturally after a delay after a touch (which needs to be cancelled to avoid duplication), or
+ * an actual click which should be permitted.
+ *
+ * @param {Event} event
+ * @returns {boolean}
+ */
+FastClick.prototype.onClick = function(event) {
+ 'use strict';
+ var permitted;
+
+ // It's possible for another FastClick-like library delivered with third-party code to fire a click event before FastClick does (issue #44). In that case, set the click-tracking flag back to false and return early. This will cause onTouchEnd to return early.
+ if (this.trackingClick) {
+ this.targetElement = null;
+ this.trackingClick = false;
+ return true;
+ }
+
+ // Very odd behaviour on iOS (issue #18): if a submit element is present inside a form and the user hits enter in the iOS simulator or clicks the Go button on the pop-up OS keyboard the a kind of 'fake' click event will be triggered with the submit-type input element as the target.
+ if (event.target.type === 'submit' && event.detail === 0) {
+ return true;
+ }
+
+ permitted = this.onMouse(event);
+
+ // Only unset targetElement if the click is not permitted. This will ensure that the check for !targetElement in onMouse fails and the browser's click doesn't go through.
+ if (!permitted) {
+ this.targetElement = null;
+ }
+
+ // If clicks are permitted, return true for the action to go through.