Now all modules are in core modules folder

This commit is contained in:
Manuel Cillero 2017-08-08 12:14:45 +02:00
parent 5ba1cdfa0b
commit 05b6a91b0c
1907 changed files with 0 additions and 0 deletions

51
modules/token/token.js Normal file
View file

@ -0,0 +1,51 @@
(function ($) {
Drupal.behaviors.tokenTree = function() {
$('table.token-tree').each(function() {
$(this).treeTable();
});
};
Drupal.behaviors.tokenInsert = function() {
// Keep track of which textfield was last selected/focused.
$('textarea, input[type="text"]').focus(function() {
Drupal.settings.tokenFocusedField = this;
});
$('.token-click-insert .token-key').each(function() {
var newThis = $('<a href="javascript:void(0);" title="' + Drupal.t('Insert this token into your form') + '">' + $(this).html() + '</a>').click(function(){
if (typeof Drupal.settings.tokenFocusedField == 'undefined') {
alert(Drupal.t('First click a text field to insert your tokens into.'));
}
else {
var myField = Drupal.settings.tokenFocusedField;
var myValue = $(this).text();
//IE support
if (document.selection) {
myField.focus();
sel = document.selection.createRange();
sel.text = myValue;
}
//MOZILLA/NETSCAPE support
else if (myField.selectionStart || myField.selectionStart == '0') {
var startPos = myField.selectionStart;
var endPos = myField.selectionEnd;
myField.value = myField.value.substring(0, startPos)
+ myValue
+ myField.value.substring(endPos, myField.value.length);
} else {
myField.value += myValue;
}
$('html,body').animate({scrollTop: $(myField).offset().top}, 500);
}
return false;
});
$(this).html(newThis);
});
};
})(jQuery);