3 * Provides theme functions for image Quick Edit's client-side HTML.
11 * Theme function for validation errors of the Image in-place editor.
13 * @param {object} settings
14 * Settings object used to construct the markup.
15 * @param {string} settings.errors
16 * Already escaped HTML representing error messages.
19 * The corresponding HTML.
21 Drupal.theme.quickeditImageErrors = function (settings) {
22 return '<div class="quickedit-image-errors">' + settings.errors + '</div>';
26 * Theme function for the dropzone element of the Image module's in-place
29 * @param {object} settings
30 * Settings object used to construct the markup.
31 * @param {string} settings.state
32 * State of the upload.
33 * @param {string} settings.text
34 * Text to display inline with the dropzone element.
37 * The corresponding HTML.
39 Drupal.theme.quickeditImageDropzone = function (settings) {
40 return '<div class="quickedit-image-dropzone ' + settings.state + '">' +
41 ' <i class="quickedit-image-icon"></i>' +
42 ' <span class="quickedit-image-text">' + settings.text + '</span>' +
47 * Theme function for the toolbar of the Image module's in-place editor.
49 * @param {object} settings
50 * Settings object used to construct the markup.
51 * @param {bool} settings.alt_field
52 * Whether or not the "Alt" field is enabled for this field.
53 * @param {bool} settings.alt_field_required
54 * Whether or not the "Alt" field is required for this field.
55 * @param {string} settings.alt
56 * The current value for the "Alt" field.
57 * @param {bool} settings.title_field
58 * Whether or not the "Title" field is enabled for this field.
59 * @param {bool} settings.title_field_required
60 * Whether or not the "Title" field is required for this field.
61 * @param {string} settings.title
62 * The current value for the "Title" field.
65 * The corresponding HTML.
67 Drupal.theme.quickeditImageToolbar = function (settings) {
68 var html = '<form class="quickedit-image-field-info">';
69 if (settings.alt_field) {
71 ' <label for="alt" class="' + (settings.alt_field_required ? 'required' : '') + '">' + Drupal.t('Alternative text') + '</label>' +
72 ' <input type="text" placeholder="' + settings.alt + '" value="' + settings.alt + '" name="alt" ' + (settings.alt_field_required ? 'required' : '') + '/>' +
75 if (settings.title_field) {
77 ' <label for="title" class="' + (settings.title_field_required ? 'form-required' : '') + '">' + Drupal.t('Title') + '</label>' +
78 ' <input type="text" placeholder="' + settings.title + '" value="' + settings.title + '" name="title" ' + (settings.title_field_required ? 'required' : '') + '/>' +