first import

This commit is contained in:
Bachir Soussi Chiadmi
2015-04-08 11:40:19 +02:00
commit 1bc61b12ad
8435 changed files with 1582817 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
/**
* Attach handlers to toggle the twitter message field and inform the number
* of characters remaining to achieve the max length
*/
(function ($) {
Drupal.behaviors.twitter_post = {
attach: function (context, settings) {
$("#twitter-textfield", context).keyup(function() {
var charsLeft = (140 - $(this).val().length);
var descDiv = $(this).next();
$(descDiv).html("<strong>" + charsLeft + "</strong> characters remaining");
if (charsLeft < 0) {
$(descDiv).addClass("negative");
} else {
$(descDiv).removeClass("negative");
}
});
if (!$("#twitter-toggle").attr("checked")) {
$(".form-item-twitter-status").hide();
}
$("#twitter-toggle").bind("click", function() {
if ($("#twitter-toggle").attr("checked")) {
$(".form-item-twitter-status").show();
}
else {
$(".form-item-twitter-status").hide();
}
});
}
};
}(jQuery));