theme.js 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /**
  2. * DO NOT EDIT THIS FILE.
  3. * See the following change record for more information,
  4. * https://www.drupal.org/node/2815083
  5. * @preserve
  6. **/
  7. (function ($, Drupal) {
  8. Drupal.theme.quickeditBackstage = function (settings) {
  9. var html = '';
  10. html += '<div id="' + settings.id + '" />';
  11. return html;
  12. };
  13. Drupal.theme.quickeditEntityToolbar = function (settings) {
  14. var html = '';
  15. html += '<div id="' + settings.id + '" class="quickedit quickedit-toolbar-container clearfix">';
  16. html += '<i class="quickedit-toolbar-pointer"></i>';
  17. html += '<div class="quickedit-toolbar-content">';
  18. html += '<div class="quickedit-toolbar quickedit-toolbar-entity clearfix icon icon-pencil">';
  19. html += '<div class="quickedit-toolbar-label" />';
  20. html += '</div>';
  21. html += '<div class="quickedit-toolbar quickedit-toolbar-field clearfix" />';
  22. html += '</div><div class="quickedit-toolbar-lining"></div></div>';
  23. return html;
  24. };
  25. Drupal.theme.quickeditEntityToolbarLabel = function (settings) {
  26. return '<span class="field">' + Drupal.checkPlain(settings.fieldLabel) + '</span>' + Drupal.checkPlain(settings.entityLabel);
  27. };
  28. Drupal.theme.quickeditEntityToolbarFence = function () {
  29. return '<div id="quickedit-toolbar-fence" />';
  30. };
  31. Drupal.theme.quickeditFieldToolbar = function (settings) {
  32. return '<div id="' + settings.id + '" />';
  33. };
  34. Drupal.theme.quickeditToolgroup = function (settings) {
  35. var classes = settings.classes || [];
  36. classes.unshift('quickedit-toolgroup');
  37. var html = '';
  38. html += '<div class="' + classes.join(' ') + '"';
  39. if (settings.id) {
  40. html += ' id="' + settings.id + '"';
  41. }
  42. html += '>';
  43. html += Drupal.theme('quickeditButtons', { buttons: settings.buttons });
  44. html += '</div>';
  45. return html;
  46. };
  47. Drupal.theme.quickeditButtons = function (settings) {
  48. var html = '';
  49. var _loop = function _loop(i) {
  50. var button = settings.buttons[i];
  51. if (!button.hasOwnProperty('type')) {
  52. button.type = 'button';
  53. }
  54. var attributes = [];
  55. var attrMap = settings.buttons[i].attributes || {};
  56. Object.keys(attrMap).forEach(function (attr) {
  57. attributes.push(attr + (attrMap[attr] ? '="' + attrMap[attr] + '"' : ''));
  58. });
  59. html += '<button type="' + button.type + '" class="' + button.classes + '" ' + attributes.join(' ') + '>' + button.label + '</button>';
  60. };
  61. for (var i = 0; i < settings.buttons.length; i++) {
  62. _loop(i);
  63. }
  64. return html;
  65. };
  66. Drupal.theme.quickeditFormContainer = function (settings) {
  67. var html = '';
  68. html += '<div id="' + settings.id + '" class="quickedit-form-container">';
  69. html += ' <div class="quickedit-form">';
  70. html += ' <div class="placeholder">';
  71. html += settings.loadingMsg;
  72. html += ' </div>';
  73. html += ' </div>';
  74. html += '</div>';
  75. return html;
  76. };
  77. })(jQuery, Drupal);