| 20 |
var $submit = $('#edit-submit', source.annotationForm); |
var $submit = $('#edit-submit', source.annotationForm); |
| 21 |
var $edit = $('#edit-comment', source.annotationForm).focus().keyup(function() { |
var $edit = $('#edit-comment', source.annotationForm).focus().keyup(function() { |
| 22 |
if ($(this).attr('value') === '') { |
if ($(this).attr('value') === '') { |
| 23 |
$submit.attr('disabled', 'disabled'); |
$submit.attr('disabled', 'disabled'); |
| 24 |
} |
} |
| 25 |
else { |
else { |
| 26 |
$submit.removeAttr('disabled'); |
$submit.removeAttr('disabled'); |
| 59 |
// Edit annotation link. |
// Edit annotation link. |
| 60 |
$('a[href*=#annotation-edit]', source.annotationBox).click(function() { |
$('a[href*=#annotation-edit]', source.annotationBox).click(function() { |
| 61 |
var comment = Drupal.settings.annotationCommentsSource[source.attr('class').match(/\bannotation-(cid-\d+)\b/)[1]]; |
var comment = Drupal.settings.annotationCommentsSource[source.attr('class').match(/\bannotation-(cid-\d+)\b/)[1]]; |
| 62 |
source.annotate({ |
source.annotate(jQuery.extend({ |
| 63 |
comment: comment |
comment: comment |
| 64 |
}); |
}, eval('Drupal.' + comment.annotation.options))); |
| 65 |
return false; |
return false; |
| 66 |
}); |
}); |
| 67 |
} |
} |
| 141 |
} |
} |
| 142 |
|
|
| 143 |
jQuery.fn.annotate = function(options) { |
jQuery.fn.annotate = function(options) { |
| 144 |
var opts = jQuery.extend(jQuery.annotation.defaults, options); |
var opts = jQuery.extend({}, jQuery.annotation.defaults, options); |
| 145 |
jQuery.annotation.active = true; |
jQuery.annotation.active = true; |
| 146 |
|
|
| 147 |
if (opts.comment !== undefined) { |
if (opts.comment !== undefined) { |