Projet

Général

Profil

Révision 74f6bef0

Ajouté par Assos Assos il y a plus de 10 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/themes/adaptivetheme/at_core/inc/forms/settings.polyfills.inc
6 6
 *
7 7
 * TODO: review documentation and provide links to help pages.
8 8
 */
9
function at_core_polyfills_form(&$form, $theme_name) {
10
  $form['at-settings']['polyfills'] = array(
11
    '#type' => 'fieldset',
12
    '#title' => t('Polyfills'),
13
    '#description' => t('<h3>Polyfills</h3><p>Here you can enable commonly used Polyfills supplied with the core theme. Adaptivetheme also supports loading <a href="!docspage" target="_blank">scripts and CSS for Internet Explorer</a> using your sub-themes info file.', array('!docspage' => 'http://adaptivethemes.com/documentation/ie-styles-and-scripts')),
14
  );
9 15

  
10
$form['at-settings']['polyfills'] = array(
11
  '#type' => 'fieldset',
12
  '#title' => t('Polyfills'),
13
  '#description' => t('<h3>Polyfills</h3><p>Here you can enable commonly used Polyfills supplied with the core theme. Adaptivetheme also supports loading <a href="!docspage" target="_blank">scripts and CSS for Internet Explorer</a> using your sub-themes info file.', array('!docspage' => 'http://adaptivethemes.com/documentation/ie-styles-and-scripts')),
14
);
16
  $form['at-settings']['polyfills']['fills'] = array(
17
    '#type' => 'fieldset',
18
    '#title' => t('Polyfills'),
19
  );
15 20

  
16
$form['at-settings']['polyfills']['fills'] = array(
17
  '#type' => 'fieldset',
18
  '#title' => t('Polyfills'),
19
);
21
  // HTML5 shiv
22
  $form['at-settings']['polyfills']['fills']['load_html5js'] = array(
23
    '#type' => 'checkbox',
24
    '#title' => t('HTML5 support in IE'),
25
    '#description' => t('By checking this setting the site will load the <a href="!html5shiv_link" target="_blank">html5shiv</a>. Turning this off will be bad news for IE6-8.', array('!html5shiv_link' => '//github.com/aFarkas/html5shiv')),
26
    '#default_value' => at_get_setting('load_html5js'),
27
  );
20 28

  
21
// HTML5 shiv
22
$form['at-settings']['polyfills']['fills']['load_html5js'] = array(
23
  '#type' => 'checkbox',
24
  '#title' => t('HTML5 support in IE'),
25
  '#description' => t('By checking this setting the site will load the <a href="!html5shiv_link" target="_blank">html5shiv</a>. Turning this off will be bad news for IE6-8.', array('!html5shiv_link' => '//github.com/aFarkas/html5shiv')),
26
  '#default_value' => at_get_setting('load_html5js'),
27
);
29
  // matchMedia polyfill: https://github.com/paulirish/matchMedia.js
30
  $form['at-settings']['polyfills']['fills']['load_matchmediajs'] = array(
31
    '#type' => 'checkbox',
32
    '#title' => t('matchMedia.js Polyfill'),
33
    '#description' => t('Backport matchMedia support to unsupporting browsers - see <a href="!matchmedia_link" target="_blank">github.com/paulirish/matchMedia</a>. If using the Menu Toggle extension you need this if supporting Android 2.3 or earlier is important. Do not enable this if you are using respond.js (see <em>Media query support for IE6-8</em>, below) or Modernizr. A number of other libraries load this polyfill also - it\'s worth checking, although its also a very small polyfill.', array('!matchmedia_link' => '//github.com/paulirish/matchMedia.js')),
34
    '#default_value' => at_get_setting('load_matchmediajs'),
35
  );
28 36

  
29
// OnMediaQuery.js
30
$script_filepath = '/' . $theme_name . '/scripts/media_queries.js';
31
$form['at-settings']['polyfills']['fills']['load_onmediaqueryjs'] = array(
32
  '#type' => 'checkbox',
33
  '#title' => t('Responsive JavaScript <sup>beta</sup>'),
34
  '#description' => t('Load the <a href="!onmediaquery_link" target="_blank">JS Media Queries</a> plugin to enable responsive JavaScript. See <code>@script_filepath</code> for instructions on how to use. This is an alternative to using matchMedia and hard coding breakpoints in JavaScript. This is bleeding edge and must be considered beta, but its wickedly cool, and useful.', array('!onmediaquery_link' => '//github.com/JoshBarr/js-media-queries', '@script_filepath' => $script_filepath)),
35
  '#default_value' => at_get_setting('load_onmediaqueryjs'),
36
);
37
  // OnMediaQuery.js
38
  $script_filepath = '/' . $theme_name . '/scripts/media_queries.js';
39
  $form['at-settings']['polyfills']['fills']['load_onmediaqueryjs'] = array(
40
    '#type' => 'checkbox',
41
    '#title' => t('Responsive JavaScript <sup>(deprecated)</sup>'),
42
    '#description' => t('This is deprecated because AT Core now loads it\'s media queries into Drupals JS settings - see <code>menu-toggle.js</code> in the core theme for an example of how this can be used with matchMedia. This legacy feature loads the <a href="!onmediaquery_link" target="_blank">JS Media Queries</a> plugin to enable responsive JavaScript. See <code>@script_filepath</code> for instructions on how to use. This is an alternative to using matchMedia.', array('!onmediaquery_link' => '//github.com/JoshBarr/js-media-queries', '@script_filepath' => $script_filepath)),
43
    '#default_value' => at_get_setting('load_onmediaqueryjs'),
44
  );
37 45

  
38
// Rounding error fix (CSS)
39
$form['at-settings']['polyfills']['fills']['load_ltie8css'] = array(
40
  '#type' => 'checkbox',
41
  '#title' => t('Fix CSS rounding errors in IE6-7'),
42
  '#description' => t('Load a stylesheet that fixes percentage rounding errors in IE6-7. You need this if you are using Gpanels or Panels layouts.'),
43
  '#default_value' => at_get_setting('load_ltie8css'),
44
);
46
  // Rounding error fix (CSS)
47
  $form['at-settings']['polyfills']['fills']['load_ltie8css'] = array(
48
    '#type' => 'checkbox',
49
    '#title' => t('Fix CSS rounding errors in IE6-7'),
50
    '#description' => t('Load a stylesheet that fixes percentage rounding errors in IE6-7. You need this if you are using Gpanels or Panels layouts.'),
51
    '#default_value' => at_get_setting('load_ltie8css'),
52
  );
45 53

  
46
// Respond.js
47
$form['at-settings']['polyfills']['fills']['load_respondjs'] = array(
48
  '#type' => 'checkbox',
49
  '#title' => t('Media query support for IE6-8'),
50
  '#description' => t('By checking this setting IE6, 7 and 8 will rely on <a href="!respondjs_link" target="_blank">respond.js</a> to set the layout.', array('!respondjs_link' => '//github.com/scottjehl/Respond')),
51
  '#default_value' => at_get_setting('load_respondjs'),
52
  '#states' => array(
53
    'invisible' => array('input[name="disable_responsive_styles"]' => array('checked' => TRUE)),
54
  ),
55
);
54
  // Respond.js
55
  $form['at-settings']['polyfills']['fills']['load_respondjs'] = array(
56
    '#type' => 'checkbox',
57
    '#title' => t('Media query support for IE6-8 (respond.js)'),
58
    '#description' => t('By checking this setting IE6, 7 and 8 will rely on <a href="!respondjs_link" target="_blank">respond.js</a> to set the layout.', array('!respondjs_link' => '//github.com/scottjehl/Respond')),
59
    '#default_value' => at_get_setting('load_respondjs'),
60
    '#states' => array(
61
      'invisible' => array('input[name="disable_responsive_styles"]' => array('checked' => TRUE)),
62
    ),
63
  );
56 64

  
57
// Scalefix
58
$form['at-settings']['polyfills']['fills']['load_scalefixjs'] = array(
59
  '#type' => 'checkbox',
60
  '#title' => t('Scalefix for iOS'),
61
  '#description' => t('Fixes the iOS Orientationchange zoom bug.'),
62
  '#default_value' => at_get_setting('load_scalefixjs'),
63
  '#states' => array(
64
    'invisible' => array('input[name="disable_responsive_styles"]' => array('checked' => TRUE)),
65
  ),
66
);
65
  // Scalefix
66
  $form['at-settings']['polyfills']['fills']['load_scalefixjs'] = array(
67
    '#type' => 'checkbox',
68
    '#title' => t('Scalefix for iOS'),
69
    '#description' => t('Fixes the iOS Orientationchange zoom bug. See <a href="!scalefix_link" target="_blank">github.com/scottjehl/iOS-Orientationchange-Fix</a>.', array('!scalefix_link' => 'https://github.com/scottjehl/iOS-Orientationchange-Fix')),
70
    '#default_value' => at_get_setting('load_scalefixjs'),
71
    '#states' => array(
72
      'invisible' => array('input[name="disable_responsive_styles"]' => array('checked' => TRUE)),
73
    ),
74
  );
75
}

Formats disponibles : Unified diff