theme.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. for (var i = 0; i < settings.buttons.length; 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. for (var attr in attrMap) {
  57. if (attrMap.hasOwnProperty(attr)) {
  58. attributes.push(attr + (attrMap[attr] ? '="' + attrMap[attr] + '"' : ''));
  59. }
  60. }
  61. html += '<button type="' + button.type + '" class="' + button.classes + '"' + (' ' + attributes.join(' ') + '>');
  62. html += button.label;
  63. html += '</button>';
  64. }
  65. return html;
  66. };
  67. Drupal.theme.quickeditFormContainer = function (settings) {
  68. var html = '';
  69. html += '<div id="' + settings.id + '" class="quickedit-form-container">';
  70. html += ' <div class="quickedit-form">';
  71. html += ' <div class="placeholder">';
  72. html += settings.loadingMsg;
  73. html += ' </div>';
  74. html += ' </div>';
  75. html += '</div>';
  76. return html;
  77. };
  78. })(jQuery, Drupal);