3
$.fn.addAnchor = function(title) {
4
title = title || "Link here";
5
return this.filter("*[id]").each(function() {
6
$("<a class='anchor'> \u00B6</a>").attr("href", "#" + this.id)
7
.attr("title", title).appendTo(this);
11
$.fn.checked = function(checked) {
12
if (checked == undefined) { // getter
13
if (!this.length) return false;
14
return this.get(0).checked;
16
return this.each(function() {
17
this.checked = checked;
22
$.fn.enable = function(enabled) {
23
if (enabled == undefined) enabled = true;
24
return this.each(function() {
25
this.disabled = !enabled;
26
var label = $(this).parents("label");
27
if (!label.length && this.id) {
28
label = $("label[for='" + this.id + "']");
31
label.addClass("disabled");
33
label.removeClass("disabled");
38
$.loadStyleSheet = function(href, type) {
39
type = type || "text/css";
40
$(document).ready(function() {
41
if (document.createStyleSheet) { // MSIE
42
document.createStyleSheet(href);
44
$("<link rel='stylesheet' type='" + type + "' href='" + href + "' />")
50
// Used for dynamically updating the height of a textarea
51
window.resizeTextArea = function (id, rows) {
52
var textarea = $("#" + id).get(0);
53
if (!textarea || textarea.rows == undefined) return;
57
// The following are defined for backwards compatibility with releases prior
60
window.addEvent = function(elem, type, func) {
61
$(elem).bind(type, func);
63
window.addHeadingLinks = function(container, title) {
64
$.each(["h1", "h2", "h3", "h4", "h5", "h6"], function() {
65
$(this, container).addAnchor(title);
68
window.enableControl = function(id, enabled) {
69
$("#" + id).enable(enabled);
71
window.getAncestorByTagName = function(elem, tagName) {
72
return $(elem).parents(tagName).get(0);
b'\\ No newline at end of file'