1 |
85ad3d82
|
Assos Assos
|
|
2 |
|
|
|
3 |
|
|
|
4 |
|
|
|
5 |
|
|
|
6 |
|
|
(function ($) {
|
7 |
|
|
|
8 |
|
|
|
9 |
|
|
|
10 |
|
|
|
11 |
|
|
Drupal.behaviors.overlayChild = {
|
12 |
|
|
attach: function (context, settings) {
|
13 |
|
|
|
14 |
|
|
if (this.processed) {
|
15 |
|
|
return;
|
16 |
|
|
}
|
17 |
|
|
this.processed = true;
|
18 |
|
|
|
19 |
|
|
|
20 |
|
|
if (!parent.Drupal || !parent.Drupal.overlay) {
|
21 |
|
|
window.location = window.location.href.replace(/([?&]?)render=overlay&?/g, '$1').replace(/\?$/, '');
|
22 |
|
|
}
|
23 |
|
|
|
24 |
|
|
var settings = settings.overlayChild || {};
|
25 |
|
|
|
26 |
|
|
|
27 |
|
|
|
28 |
|
|
if (settings.refreshPage) {
|
29 |
|
|
parent.Drupal.overlay.refreshPage = true;
|
30 |
|
|
}
|
31 |
|
|
|
32 |
|
|
|
33 |
|
|
|
34 |
|
|
if (settings.closeOverlay) {
|
35 |
|
|
parent.Drupal.overlay.bindChild(window, true);
|
36 |
|
|
|
37 |
|
|
|
38 |
|
|
setTimeout(function () {
|
39 |
|
|
if (typeof settings.redirect == 'string') {
|
40 |
|
|
parent.Drupal.overlay.redirect(settings.redirect);
|
41 |
|
|
}
|
42 |
|
|
else {
|
43 |
|
|
parent.Drupal.overlay.close();
|
44 |
|
|
}
|
45 |
|
|
}, 1);
|
46 |
|
|
return;
|
47 |
|
|
}
|
48 |
|
|
|
49 |
|
|
|
50 |
|
|
|
51 |
|
|
if (settings.refreshRegions) {
|
52 |
|
|
parent.Drupal.overlay.refreshRegions(settings.refreshRegions);
|
53 |
|
|
}
|
54 |
|
|
|
55 |
|
|
|
56 |
|
|
parent.Drupal.overlay.bindChild(window);
|
57 |
|
|
|
58 |
|
|
|
59 |
|
|
window.scrollTo(window.scrollX, window.scrollY);
|
60 |
|
|
|
61 |
|
|
|
62 |
|
|
Drupal.overlayChild.attachBehaviors(context, settings);
|
63 |
|
|
|
64 |
|
|
|
65 |
|
|
|
66 |
|
|
|
67 |
|
|
$('#overlay-disable-message', context)
|
68 |
|
|
.focusin(function () {
|
69 |
|
|
$(this).addClass('overlay-disable-message-focused');
|
70 |
|
|
$('a.element-focusable', this).removeClass('element-invisible');
|
71 |
|
|
})
|
72 |
|
|
.focusout(function () {
|
73 |
|
|
$(this).removeClass('overlay-disable-message-focused');
|
74 |
|
|
$('a.element-focusable', this).addClass('element-invisible');
|
75 |
|
|
});
|
76 |
|
|
}
|
77 |
|
|
};
|
78 |
|
|
|
79 |
|
|
|
80 |
|
|
|
81 |
|
|
|
82 |
|
|
Drupal.overlayChild = Drupal.overlayChild || {
|
83 |
|
|
behaviors: {}
|
84 |
|
|
};
|
85 |
|
|
|
86 |
|
|
Drupal.overlayChild.prototype = {};
|
87 |
|
|
|
88 |
|
|
|
89 |
|
|
|
90 |
|
|
|
91 |
|
|
Drupal.overlayChild.attachBehaviors = function (context, settings) {
|
92 |
|
|
$.each(this.behaviors, function () {
|
93 |
|
|
this(context, settings);
|
94 |
|
|
});
|
95 |
|
|
};
|
96 |
|
|
|
97 |
|
|
|
98 |
|
|
|
99 |
|
|
|
100 |
|
|
|
101 |
|
|
|
102 |
|
|
|
103 |
|
|
|
104 |
|
|
Drupal.overlayChild.behaviors.addClickHandler = function (context, settings) {
|
105 |
|
|
$(document).bind('click.drupal-overlay mouseup.drupal-overlay', $.proxy(parent.Drupal.overlay, 'eventhandlerOverrideLink'));
|
106 |
|
|
};
|
107 |
|
|
|
108 |
|
|
|
109 |
|
|
|
110 |
|
|
|
111 |
|
|
|
112 |
|
|
|
113 |
|
|
|
114 |
|
|
Drupal.overlayChild.behaviors.parseForms = function (context, settings) {
|
115 |
|
|
$('form', context).once('overlay', function () {
|
116 |
|
|
|
117 |
|
|
var action = $(this).attr('action');
|
118 |
|
|
|
119 |
|
|
if (action == undefined || (action.indexOf('http') != 0 && action.indexOf('https') != 0)) {
|
120 |
|
|
action += (action.indexOf('?') > -1 ? '&' : '?') + 'render=overlay';
|
121 |
|
|
$(this).attr('action', action);
|
122 |
|
|
}
|
123 |
|
|
|
124 |
|
|
else {
|
125 |
|
|
$(this).attr('target', '_new');
|
126 |
|
|
}
|
127 |
|
|
});
|
128 |
|
|
};
|
129 |
|
|
|
130 |
|
|
|
131 |
|
|
|
132 |
|
|
|
133 |
|
|
Drupal.overlayChild.behaviors.loading = function (context, settings) {
|
134 |
|
|
var $title;
|
135 |
|
|
var text = Drupal.t('Loading');
|
136 |
|
|
var dots = '';
|
137 |
|
|
|
138 |
|
|
$(document).bind('drupalOverlayBeforeLoad.drupal-overlay.drupal-overlay-child-loading', function () {
|
139 |
|
|
$title = $('#overlay-title').text(text);
|
140 |
|
|
var id = setInterval(function () {
|
141 |
|
|
dots = (dots.length > 10) ? '' : dots + '.';
|
142 |
|
|
$title.text(text + dots);
|
143 |
|
|
}, 500);
|
144 |
|
|
});
|
145 |
|
|
};
|
146 |
|
|
|
147 |
|
|
|
148 |
|
|
|
149 |
|
|
|
150 |
|
|
Drupal.overlayChild.behaviors.tabs = function (context, settings) {
|
151 |
|
|
var $tabsLinks = $('#overlay-tabs > li > a');
|
152 |
|
|
|
153 |
|
|
$('#overlay-tabs > li > a').bind('click.drupal-overlay', function () {
|
154 |
|
|
var active_tab = Drupal.t('(active tab)');
|
155 |
|
|
$tabsLinks.parent().siblings().removeClass('active').find('element-invisible:contains(' + active_tab + ')').appendTo(this);
|
156 |
|
|
$(this).parent().addClass('active');
|
157 |
|
|
});
|
158 |
|
|
};
|
159 |
|
|
|
160 |
|
|
|
161 |
|
|
|
162 |
|
|
|
163 |
|
|
Drupal.overlayChild.behaviors.shortcutAddLink = function (context, settings) {
|
164 |
|
|
|
165 |
|
|
$('#overlay-titlebar').find('.add-or-remove-shortcuts').remove();
|
166 |
|
|
|
167 |
|
|
var $addToShortcuts = $('.add-or-remove-shortcuts');
|
168 |
|
|
if ($addToShortcuts.length) {
|
169 |
|
|
$addToShortcuts.insertAfter('#overlay-title');
|
170 |
|
|
}
|
171 |
|
|
|
172 |
|
|
$(document).bind('drupalOverlayBeforeLoad.drupal-overlay.drupal-overlay-child-loading', function () {
|
173 |
|
|
$('#overlay-titlebar').find('.add-or-remove-shortcuts').remove();
|
174 |
|
|
});
|
175 |
|
|
};
|
176 |
|
|
|
177 |
|
|
|
178 |
|
|
|
179 |
|
|
|
180 |
|
|
Drupal.overlayChild.behaviors.alterTableHeaderOffset = function (context, settings) {
|
181 |
|
|
if (Drupal.settings.tableHeaderOffset) {
|
182 |
|
|
Drupal.overlayChild.prevTableHeaderOffset = Drupal.settings.tableHeaderOffset;
|
183 |
|
|
}
|
184 |
|
|
Drupal.settings.tableHeaderOffset = 'Drupal.overlayChild.tableHeaderOffset';
|
185 |
|
|
};
|
186 |
|
|
|
187 |
|
|
|
188 |
|
|
|
189 |
|
|
|
190 |
|
|
Drupal.overlayChild.tableHeaderOffset = function () {
|
191 |
|
|
var topOffset = Drupal.overlayChild.prevTableHeaderOffset ? eval(Drupal.overlayChild.prevTableHeaderOffset + '()') : 0;
|
192 |
|
|
|
193 |
|
|
return topOffset + parseInt($(document.body).css('marginTop'));
|
194 |
|
|
};
|
195 |
|
|
|
196 |
|
|
})(jQuery); |