2 * JQuery Case Insensitive :icontains selector
4 $
.expr
[':'].icontains
= function(obj
, index
, meta
, stack
){
5 return (obj
.textContent
.replace(/\
[[0-9]+\
]/g
, "") || obj
.innerText
.replace(/\
[[0-9]+\
]/g
, "") ||
jQuery(obj
).text().replace(/\
[[0-9]+\
]/g
, "") ||
'').toLowerCase().indexOf(meta
[3].toLowerCase()) >= 0;
10 * Add folding and filtering facilities to class description page.
12 $
(document
).ready(function() {
15 * Highlight the spoted element
17 highlightBlock(currentAnchor());
26 $
(document
.createElement("a"))
30 .css("cursor", "pointer")
32 if($
(this).find("a.fold").html() == "+") {
33 $
(this).find("a.fold").html("-");
35 $
(this).find("a.fold").html("+");
37 $
(this).nextAll().toggle();
40 // Instert search field
43 $
(document
.createElement("li"))
45 $
(document
.createElement("form"))
47 $
(document
.createElement("input"))
51 value
: "quick search..."
55 $
(this).parent().parent().find("ul li:not(:icontains('" + $
(this).val() + "'))").addClass("hide");
56 $
(this).parent().parent().find("ul li:icontains('" + $
(this).val() + "')").removeClass("hide");
58 .focusout(function() {
59 if($
(this).val() == "") {
60 $
(this).addClass("notUsed");
61 $
(this).val("quick search...");
65 if($
(this).val() == "quick search...") {
66 $
(this).removeClass("notUsed");
72 if($
("#search").val().length
== 0)
75 window
.location
= "full-index.html#q=" + $
("#search").val();
76 if(window
.location
.href
.indexOf("full-index.html") > -1) {
87 $
("a[href^='#']").click( function() {
88 var a
= $
(this).attr("href").replace(/#
/, "");
92 // Insert filter field
93 $
("article.filterable h2, nav.filterable h3")
95 $
(document
.createElement("div"))
98 $
(document
.createElement("input"))
105 $
(this).parent().parent().find("ul li:not(:icontains('" + $
(this).val() + "'))").addClass("hide");
106 $
(this).parent().parent().find("ul li:icontains('" + $
(this).val() + "')").removeClass("hide");
108 .focusout(function() {
109 if($
(this).val() == "") {
110 $
(this).addClass("notUsed");
111 $
(this).val("filter...");
114 .focusin(function() {
115 if($
(this).val() == "filter...") {
116 $
(this).removeClass("notUsed");
123 // Filter toggle between H I R in nav porperties list
124 $
("nav.properties.filterable .filter")
126 $
(document
.createElement("a"))
129 title
: "hide inherited properties"
132 if($
(this).hasClass("hidden")) {
133 $
(this).parent().parent().find("li.inherit").show();
135 $
(this).parent().parent().find("li.inherit").hide();
138 $
(this).toggleClass("hidden");
142 $
(document
.createElement("a"))
145 title
: "hide redefined properties"
148 if($
(this).hasClass("hidden")) {
149 $
(this).parent().parent().find("li.redef").show();
151 $
(this).parent().parent().find("li.redef").hide();
154 $
(this).toggleClass("hidden");
158 $
(document
.createElement("a"))
161 title
: "hide introduced properties"
164 if($
(this).hasClass("hidden")) {
165 $
(this).parent().parent().find("li.intro").show();
167 $
(this).parent().parent().find("li.intro").hide();
170 $
(this).toggleClass("hidden");
174 // Filter toggle between I R in
175 $
("article.properties.filterable .filter, article.classes.filterable .filter")
177 $
(document
.createElement("a"))
180 title
: "hide introduced properties"
183 if($
(this).hasClass("hidden")) {
184 $
(this).parent().parent().find("li.intro").show();
186 $
(this).parent().parent().find("li.intro").hide();
189 $
(this).toggleClass("hidden");
193 $
(document
.createElement("a"))
196 title
: "hide redefined properties"
199 if($
(this).hasClass("hidden")) {
200 $
(this).parent().parent().find("li.redef").show();
202 $
(this).parent().parent().find("li.redef").hide();
205 $
(this).toggleClass("hidden");
209 //Preload filter fields with query string
213 /* Parse current URL and return anchor name */
214 function currentAnchor() {
215 var index
= document
.location
.hash
.indexOf("#");
217 return document
.location
.hash
.substring(index
+ 1);
222 /* Prealod filters field using search query */
223 function preloadFilters() {
224 // Parse URL and get query string
225 var search
= currentAnchor();
227 if(search
== null || search
.indexOf("q=") == -1)
230 search
= search
.substring(2, search
.length
);
232 if(search
== "" || search
== "undefined")
235 $
(":text").val(search
);
237 .removeClass("notUsed")
242 /* Hightlight the spoted block */
243 function highlightBlock(a
) {
248 $
(".highlighted").removeClass("highlighted");
250 var target
= $
("#" + a
);
252 if(target
.is("article")) {
253 target
.parent().addClass("highlighted");
256 target
.addClass("highlighted");