first import 7.x-2.x-dev

Signed-off-by: bachy <git@g-u-i.net>
This commit is contained in:
bachy
2012-11-20 16:21:31 +01:00
commit f3be35fe5e
21 changed files with 2421 additions and 0 deletions
+72
View File
@@ -0,0 +1,72 @@
(function ($) {
/**
* Attach auto-submit to admin view form.
*/
Drupal.behaviors.feedbackAdminForm = {
attach: function (context) {
$('#feedback-admin-view-form', context).once('feedback', function () {
$(this).find('fieldset.feedback-messages :input[type="checkbox"]').click(function () {
this.form.submit();
});
});
}
};
/**
* Attach collapse behavior to the feedback form block.
*/
Drupal.behaviors.feedbackForm = {
attach: function (context) {
$('#block-feedback-form', context).once('feedback', function () {
var $block = $(this);
$block.find('span.feedback-link')
.prepend('<span id="feedback-form-toggle">[ + ]</span> ')
.css('cursor', 'pointer')
.toggle(function () {
Drupal.feedbackFormToggle($block, false);
},
function() {
Drupal.feedbackFormToggle($block, true);
}
);
$block.find('form').hide();
$block.show();
});
}
};
/**
* Re-collapse the feedback form after every successful form submission.
*/
Drupal.behaviors.feedbackFormSubmit = {
attach: function (context) {
var $context = $(context);
if (!$context.is('#feedback-status-message')) {
return;
}
// Collapse the form.
$('#block-feedback-form .feedback-link').click();
// Blend out and remove status message.
window.setTimeout(function () {
$context.fadeOut('slow', function () {
$context.remove();
});
}, 3000);
}
};
/**
* Collapse or uncollapse the feedback form block.
*/
Drupal.feedbackFormToggle = function ($block, enable) {
$block.find('form').slideToggle('medium');
if (enable) {
$('#feedback-form-toggle', $block).html('[ + ]');
}
else {
$('#feedback-form-toggle', $block).html('[ &minus; ]');
}
};
})(jQuery);