Mercurial > hg > isophonics-drupal-site
comparison core/modules/quickedit/js/theme.js @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children | 1fec387a4317 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4c8ae668cc8c |
---|---|
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 | |
8 (function ($, Drupal) { | |
9 Drupal.theme.quickeditBackstage = function (settings) { | |
10 var html = ''; | |
11 html += '<div id="' + settings.id + '" />'; | |
12 return html; | |
13 }; | |
14 | |
15 Drupal.theme.quickeditEntityToolbar = function (settings) { | |
16 var html = ''; | |
17 html += '<div id="' + settings.id + '" class="quickedit quickedit-toolbar-container clearfix">'; | |
18 html += '<i class="quickedit-toolbar-pointer"></i>'; | |
19 html += '<div class="quickedit-toolbar-content">'; | |
20 html += '<div class="quickedit-toolbar quickedit-toolbar-entity clearfix icon icon-pencil">'; | |
21 html += '<div class="quickedit-toolbar-label" />'; | |
22 html += '</div>'; | |
23 html += '<div class="quickedit-toolbar quickedit-toolbar-field clearfix" />'; | |
24 html += '</div><div class="quickedit-toolbar-lining"></div></div>'; | |
25 return html; | |
26 }; | |
27 | |
28 Drupal.theme.quickeditEntityToolbarLabel = function (settings) { | |
29 return '<span class="field">' + Drupal.checkPlain(settings.fieldLabel) + '</span>' + Drupal.checkPlain(settings.entityLabel); | |
30 }; | |
31 | |
32 Drupal.theme.quickeditEntityToolbarFence = function () { | |
33 return '<div id="quickedit-toolbar-fence" />'; | |
34 }; | |
35 | |
36 Drupal.theme.quickeditFieldToolbar = function (settings) { | |
37 return '<div id="' + settings.id + '" />'; | |
38 }; | |
39 | |
40 Drupal.theme.quickeditToolgroup = function (settings) { | |
41 var classes = settings.classes || []; | |
42 classes.unshift('quickedit-toolgroup'); | |
43 var html = ''; | |
44 html += '<div class="' + classes.join(' ') + '"'; | |
45 if (settings.id) { | |
46 html += ' id="' + settings.id + '"'; | |
47 } | |
48 html += '>'; | |
49 html += Drupal.theme('quickeditButtons', { buttons: settings.buttons }); | |
50 html += '</div>'; | |
51 return html; | |
52 }; | |
53 | |
54 Drupal.theme.quickeditButtons = function (settings) { | |
55 var html = ''; | |
56 for (var i = 0; i < settings.buttons.length; i++) { | |
57 var button = settings.buttons[i]; | |
58 if (!button.hasOwnProperty('type')) { | |
59 button.type = 'button'; | |
60 } | |
61 | |
62 var attributes = []; | |
63 var attrMap = settings.buttons[i].attributes || {}; | |
64 for (var attr in attrMap) { | |
65 if (attrMap.hasOwnProperty(attr)) { | |
66 attributes.push(attr + (attrMap[attr] ? '="' + attrMap[attr] + '"' : '')); | |
67 } | |
68 } | |
69 html += '<button type="' + button.type + '" class="' + button.classes + '"' + (' ' + attributes.join(' ') + '>'); | |
70 html += button.label; | |
71 html += '</button>'; | |
72 } | |
73 return html; | |
74 }; | |
75 | |
76 Drupal.theme.quickeditFormContainer = function (settings) { | |
77 var html = ''; | |
78 html += '<div id="' + settings.id + '" class="quickedit-form-container">'; | |
79 html += ' <div class="quickedit-form">'; | |
80 html += ' <div class="placeholder">'; | |
81 html += settings.loadingMsg; | |
82 html += ' </div>'; | |
83 html += ' </div>'; | |
84 html += '</div>'; | |
85 return html; | |
86 }; | |
87 })(jQuery, Drupal); |