Same name in other branches
- 5.0.x advagg_validator/src/Form/JsHintForm.php \Drupal\advagg_validator\Form\JsHintForm
- 8.x-2.x advagg_validator/src/Form/JsHintForm.php \Drupal\advagg_validator\Form\JsHintForm
- 8.x-3.x advagg_validator/src/Form/JsHintForm.php \Drupal\advagg_validator\Form\JsHintForm
- 8.x-4.x advagg_validator/src/Form/JsHintForm.php \Drupal\advagg_validator\Form\JsHintForm
Configure form for JsHint validation of JavaScript files.
Hierarchy
- class \Drupal\advagg\Form\AdvaggFormBase extends \Drupal\Core\Form\ConfigFormBase
- class \Drupal\advagg_validator\Form\BaseValidatorForm extends \Drupal\advagg\Form\AdvaggFormBase
- class \Drupal\advagg_validator\Form\JsHintForm extends \Drupal\advagg_validator\Form\BaseValidatorForm
- class \Drupal\advagg_validator\Form\BaseValidatorForm extends \Drupal\advagg\Form\AdvaggFormBase
Expanded class hierarchy of JsHintForm
1 file declares its use of JsHintForm
- JsHintFormTest.php in advagg_validator/
tests/ src/ Kernel/ Form/ JsHintFormTest.php
1 string reference to 'JsHintForm'
- advagg_validator.routing.yml in advagg_validator/
advagg_validator.routing.yml - advagg_validator/advagg_validator.routing.yml
File
-
advagg_validator/
src/ Form/ JsHintForm.php, line 10
Namespace
Drupal\advagg_validator\FormView source
class JsHintForm extends BaseValidatorForm {
/**
* {@inheritdoc}
*/
public function getFormId() {
return 'advagg_validator_jshint';
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
$form = parent::generateForm('js');
$form['#attached']['library'][] = 'advagg_validator/jshint';
$ignore_list = $this->config('advagg_validator.settings')
->get('jshint_ignore');
if (is_array($ignore_list)) {
$ignore_list = implode(',', $ignore_list);
}
$form['#attached']['drupalSettings']['jshint'] = [
'browser' => TRUE,
'curly' => TRUE,
'eqeqeq' => TRUE,
'forin' => TRUE,
'latedef' => TRUE,
'newcap' => TRUE,
'noarg' => TRUE,
'strict' => TRUE,
'trailing' => TRUE,
'undef' => TRUE,
'unused' => TRUE,
'predef' => [
'Drupal' => FALSE,
'drupalSettings' => FALSE,
'domready' => FALSE,
'jQuery' => FALSE,
'_' => FALSE,
'matchMedia' => FALSE,
'Backbone' => FALSE,
'Modernizr' => FALSE,
'VIE' => FALSE,
'CKEDITOR' => FALSE,
],
'ignore' => $ignore_list,
];
$form = parent::buildForm($form, $form_state);
unset($form['actions']);
return $form;
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title | Overrides |
---|---|---|---|---|---|
AdvaggFormBase::isAjax | protected | function | Checks if the form was submitted by AJAX. | ||
BaseValidatorForm::$streamWrapperManager | protected | property | The StreamWrapper manage. | ||
BaseValidatorForm::create | public static | function | Overrides AdvaggFormBase::create | 1 | |
BaseValidatorForm::domExtractor | protected | function | Extract info from the DOMNode Object. | ||
BaseValidatorForm::generateForm | public | function | Generate a hierarchical form sorted by path from asset files. | ||
BaseValidatorForm::getEditableConfigNames | protected | function | |||
BaseValidatorForm::getElement | protected | function | Get array element that corresponds to directory. | ||
BaseValidatorForm::hideGoodFiles | protected | function | Do not display info on a file if it is valid. | ||
BaseValidatorForm::scanAllDirs | protected | function | Recursively scan the drupal webroot for files matching the given extension. | ||
BaseValidatorForm::scanDirectory | protected | function | Finds all files that match a given mask in a given directory. | ||
BaseValidatorForm::testFiles | protected | function | Perform server side test(s) on all given files. | 1 | |
JsHintForm::buildForm | public | function | |||
JsHintForm::getFormId | public | function |