mirror of
https://github.com/scrapy/scrapy.git
synced 2025-02-27 12:04:37 +00:00
--HG-- rename : sites/dev.scrapy.org/htdocs/asc.png => sites/static.scrapy.org/asc.png rename : sites/dev.scrapy.org/htdocs/attachment.png => sites/static.scrapy.org/attachment.png rename : sites/dev.scrapy.org/htdocs/changeset.png => sites/static.scrapy.org/changeset.png rename : sites/dev.scrapy.org/htdocs/closedticket.png => sites/static.scrapy.org/closedticket.png rename : sites/dev.scrapy.org/htdocs/collapsed.png => sites/static.scrapy.org/collapsed.png rename : sites/dev.scrapy.org/htdocs/css/about.css => sites/static.scrapy.org/css/about.css rename : sites/dev.scrapy.org/htdocs/css/admin.css => sites/static.scrapy.org/css/admin.css rename : sites/dev.scrapy.org/htdocs/css/browser.css => sites/static.scrapy.org/css/browser.css rename : sites/dev.scrapy.org/htdocs/css/changeset.css => sites/static.scrapy.org/css/changeset.css rename : sites/dev.scrapy.org/htdocs/css/code.css => sites/static.scrapy.org/css/code.css rename : sites/dev.scrapy.org/htdocs/css/diff.css => sites/static.scrapy.org/css/diff.css rename : sites/dev.scrapy.org/htdocs/css/prefs.css => sites/static.scrapy.org/css/prefs.css rename : sites/dev.scrapy.org/htdocs/css/report.css => sites/static.scrapy.org/css/report.css rename : sites/dev.scrapy.org/htdocs/css/roadmap.css => sites/static.scrapy.org/css/roadmap.css rename : sites/dev.scrapy.org/htdocs/css/search.css => sites/static.scrapy.org/css/search.css rename : sites/dev.scrapy.org/htdocs/css/ticket.css => sites/static.scrapy.org/css/ticket.css rename : sites/dev.scrapy.org/htdocs/css/timeline.css => sites/static.scrapy.org/css/timeline.css rename : sites/dev.scrapy.org/htdocs/css/trac-0.11rc2.css.diff => sites/static.scrapy.org/css/trac-0.11rc2.css.diff rename : sites/dev.scrapy.org/htdocs/css/trac.css => sites/static.scrapy.org/css/trac.css rename : sites/dev.scrapy.org/htdocs/css/wiki.css => sites/static.scrapy.org/css/wiki.css rename : sites/dev.scrapy.org/htdocs/desc.png => sites/static.scrapy.org/desc.png rename : sites/dev.scrapy.org/htdocs/dots.gif => sites/static.scrapy.org/dots.gif rename : sites/dev.scrapy.org/htdocs/draft.png => sites/static.scrapy.org/draft.png rename : sites/dev.scrapy.org/htdocs/edit_toolbar.png => sites/static.scrapy.org/edit_toolbar.png rename : sites/dev.scrapy.org/htdocs/editedticket.png => sites/static.scrapy.org/editedticket.png rename : sites/dev.scrapy.org/htdocs/envelope.png => sites/static.scrapy.org/envelope.png rename : sites/dev.scrapy.org/htdocs/expanded.png => sites/static.scrapy.org/expanded.png rename : sites/dev.scrapy.org/htdocs/expander_normal.png => sites/static.scrapy.org/expander_normal.png rename : sites/dev.scrapy.org/htdocs/expander_normal_hover.png => sites/static.scrapy.org/expander_normal_hover.png rename : sites/dev.scrapy.org/htdocs/expander_open.png => sites/static.scrapy.org/expander_open.png rename : sites/dev.scrapy.org/htdocs/expander_open_hover.png => sites/static.scrapy.org/expander_open_hover.png rename : sites/dev.scrapy.org/htdocs/extlink.gif => sites/static.scrapy.org/extlink.gif rename : sites/dev.scrapy.org/htdocs/feed.png => sites/static.scrapy.org/feed.png rename : sites/dev.scrapy.org/htdocs/file.png => sites/static.scrapy.org/file.png rename : sites/dev.scrapy.org/htdocs/folder.png => sites/static.scrapy.org/folder.png rename : sites/dev.scrapy.org/htdocs/guide/basic-workflow.png => sites/static.scrapy.org/guide/basic-workflow.png rename : sites/dev.scrapy.org/htdocs/guide/original-workflow.png => sites/static.scrapy.org/guide/original-workflow.png rename : sites/dev.scrapy.org/htdocs/ics.png => sites/static.scrapy.org/ics.png rename : sites/dev.scrapy.org/htdocs/imggrid.png => sites/static.scrapy.org/imggrid.png rename : sites/dev.scrapy.org/htdocs/js/blame.js => sites/static.scrapy.org/js/blame.js rename : sites/dev.scrapy.org/htdocs/js/diff.js => sites/static.scrapy.org/js/diff.js rename : sites/dev.scrapy.org/htdocs/js/expand_dir.js => sites/static.scrapy.org/js/expand_dir.js rename : sites/dev.scrapy.org/htdocs/js/folding.js => sites/static.scrapy.org/js/folding.js rename : sites/dev.scrapy.org/htdocs/js/ie_pre7_hacks.js => sites/static.scrapy.org/js/ie_pre7_hacks.js rename : sites/dev.scrapy.org/htdocs/js/jquery.js => sites/static.scrapy.org/js/jquery.js rename : sites/dev.scrapy.org/htdocs/js/keyboard_nav.js => sites/static.scrapy.org/js/keyboard_nav.js rename : sites/dev.scrapy.org/htdocs/js/noconflict.js => sites/static.scrapy.org/js/noconflict.js rename : sites/dev.scrapy.org/htdocs/js/query.js => sites/static.scrapy.org/js/query.js rename : sites/dev.scrapy.org/htdocs/js/search.js => sites/static.scrapy.org/js/search.js rename : sites/dev.scrapy.org/htdocs/js/suggest.js => sites/static.scrapy.org/js/suggest.js rename : sites/dev.scrapy.org/htdocs/js/trac.js => sites/static.scrapy.org/js/trac.js rename : sites/dev.scrapy.org/htdocs/js/wikitoolbar.js => sites/static.scrapy.org/js/wikitoolbar.js rename : sites/dev.scrapy.org/htdocs/loading.gif => sites/static.scrapy.org/loading.gif rename : sites/dev.scrapy.org/htdocs/lock-locked.png => sites/static.scrapy.org/lock-locked.png rename : sites/dev.scrapy.org/htdocs/logo.jpg => sites/static.scrapy.org/logo.jpg rename : sites/dev.scrapy.org/htdocs/main-bg.jpg => sites/static.scrapy.org/main-bg.jpg rename : sites/dev.scrapy.org/htdocs/milestone.png => sites/static.scrapy.org/milestone.png rename : sites/dev.scrapy.org/htdocs/newticket.png => sites/static.scrapy.org/newticket.png rename : sites/dev.scrapy.org/htdocs/parent.png => sites/static.scrapy.org/parent.png rename : sites/dev.scrapy.org/htdocs/python.png => sites/static.scrapy.org/python.png rename : sites/dev.scrapy.org/htdocs/topbar_gradient.png => sites/static.scrapy.org/topbar_gradient.png rename : sites/dev.scrapy.org/htdocs/topbar_gradient2.png => sites/static.scrapy.org/topbar_gradient2.png rename : sites/dev.scrapy.org/htdocs/trac.ico => sites/static.scrapy.org/trac.ico rename : sites/dev.scrapy.org/htdocs/trac_banner.png => sites/static.scrapy.org/trac_banner.png rename : sites/dev.scrapy.org/htdocs/trac_logo_mini.png => sites/static.scrapy.org/trac_logo_mini.png rename : sites/dev.scrapy.org/htdocs/vgradient.png => sites/static.scrapy.org/vgradient.png rename : sites/dev.scrapy.org/htdocs/wiki.png => sites/static.scrapy.org/wiki.png extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%4023
75 lines
2.1 KiB
JavaScript
75 lines
2.1 KiB
JavaScript
(function($){
|
|
|
|
$.fn.addAnchor = function(title) {
|
|
title = title || "Link here";
|
|
return this.filter("*[@id]").each(function() {
|
|
$("<a class='anchor'> \u00B6</a>").attr("href", "#" + this.id)
|
|
.attr("title", title).appendTo(this);
|
|
});
|
|
}
|
|
|
|
$.fn.checked = function(checked) {
|
|
if (checked == undefined) { // getter
|
|
if (!this.length) return false;
|
|
return this.get(0).checked;
|
|
} else { // setter
|
|
return this.each(function() {
|
|
this.checked = checked;
|
|
});
|
|
}
|
|
}
|
|
|
|
$.fn.enable = function(enabled) {
|
|
if (enabled == undefined) enabled = true;
|
|
return this.each(function() {
|
|
this.disabled = !enabled;
|
|
var label = $(this).parents("label");
|
|
if (!label.length && this.id) {
|
|
label = $("label[@for='" + this.id + "']");
|
|
}
|
|
if (!enabled) {
|
|
label.addClass("disabled");
|
|
} else {
|
|
label.removeClass("disabled");
|
|
}
|
|
});
|
|
}
|
|
|
|
$.loadStyleSheet = function(href, type) {
|
|
type = type || "text/css";
|
|
$(document).ready(function() {
|
|
if (document.createStyleSheet) { // MSIE
|
|
document.createStyleSheet(href);
|
|
} else {
|
|
$("<link rel='stylesheet' type='" + type + "' href='" + href + "' />")
|
|
.appendTo("head");
|
|
}
|
|
});
|
|
}
|
|
|
|
// Used for dynamically updating the height of a textarea
|
|
window.resizeTextArea = function (id, rows) {
|
|
var textarea = $("#" + id).get(0);
|
|
if (!textarea || textarea.rows == undefined) return;
|
|
textarea.rows = rows;
|
|
}
|
|
|
|
// The following are defined for backwards compatibility with releases prior
|
|
// to Trac 0.11
|
|
|
|
window.addEvent = function(elem, type, func) {
|
|
$(elem).bind(type, func);
|
|
}
|
|
window.addHeadingLinks = function(container, title) {
|
|
$.each(["h1", "h2", "h3", "h4", "h5", "h6"], function() {
|
|
$(this, container).addAnchor(title);
|
|
});
|
|
}
|
|
window.enableControl = function(id, enabled) {
|
|
$("#" + id).enable(enabled);
|
|
}
|
|
window.getAncestorByTagName = function(elem, tagName) {
|
|
return $(elem).parents(tagName).get(0);
|
|
}
|
|
|
|
})(jQuery); |