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,31 @@
(function ($) {
/**
* Attach views php clickable variables behavior.
*/
Drupal.behaviors.viewsPHPVariables = {
attach: function (context) {
$('.views-php-variables', context).delegate('a', 'click', function() {
var textarea = $(this.href.replace(/^.*#/, '#'))[0];
var text = $(this).text();
textarea.focus();
if (!isNaN(textarea.selectionStart)) {
textarea.value = textarea.value.substring(0, textarea.selectionStart) + text + textarea.value.substring(textarea.selectionEnd);
textarea.selectionStart = textarea.selectionStart + text.length;
textarea.selectionEnd = textarea.selectionEnd + text.length;
}
// IE support.
else if (document.selection) {
document.selection.createRange().text = text;
}
else {
textarea.value += text;
}
textarea.focus();
return false;
});
}
};
})(jQuery);