summaryrefslogtreecommitdiff
path: root/spec/public/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'spec/public/scripts')
-rw-r--r--spec/public/scripts/LICENSE-highlight24
-rw-r--r--spec/public/scripts/LICENSE-toc18
-rw-r--r--spec/public/scripts/highlight.pack.js1
-rw-r--r--spec/public/scripts/main.js57
-rw-r--r--spec/public/scripts/navigation.js70
-rw-r--r--spec/public/scripts/toc.js128
6 files changed, 228 insertions, 70 deletions
diff --git a/spec/public/scripts/LICENSE-highlight b/spec/public/scripts/LICENSE-highlight
new file mode 100644
index 0000000000..fe2f67b162
--- /dev/null
+++ b/spec/public/scripts/LICENSE-highlight
@@ -0,0 +1,24 @@
+Copyright (c) 2006, Ivan Sagalaev
+All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of highlight.js nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/spec/public/scripts/LICENSE-toc b/spec/public/scripts/LICENSE-toc
new file mode 100644
index 0000000000..4e236e8696
--- /dev/null
+++ b/spec/public/scripts/LICENSE-toc
@@ -0,0 +1,18 @@
+(The MIT License)
+Copyright (c) 2013 Greg Allen
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file
diff --git a/spec/public/scripts/highlight.pack.js b/spec/public/scripts/highlight.pack.js
new file mode 100644
index 0000000000..bfeca09abb
--- /dev/null
+++ b/spec/public/scripts/highlight.pack.js
@@ -0,0 +1 @@
+var hljs=new function(){function j(v){return v.replace(/&/gm,"&amp;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;")}function t(v){return v.nodeName.toLowerCase()}function h(w,x){var v=w&&w.exec(x);return v&&v.index==0}function r(w){var v=(w.className+" "+(w.parentNode?w.parentNode.className:"")).split(/\s+/);v=v.map(function(x){return x.replace(/^lang(uage)?-/,"")});return v.filter(function(x){return i(x)||/no(-?)highlight/.test(x)})[0]}function o(x,y){var v={};for(var w in x){v[w]=x[w]}if(y){for(var w in y){v[w]=y[w]}}return v}function u(x){var v=[];(function w(y,z){for(var A=y.firstChild;A;A=A.nextSibling){if(A.nodeType==3){z+=A.nodeValue.length}else{if(A.nodeType==1){v.push({event:"start",offset:z,node:A});z=w(A,z);if(!t(A).match(/br|hr|img|input/)){v.push({event:"stop",offset:z,node:A})}}}}return z})(x,0);return v}function q(w,y,C){var x=0;var F="";var z=[];function B(){if(!w.length||!y.length){return w.length?w:y}if(w[0].offset!=y[0].offset){return(w[0].offset<y[0].offset)?w:y}return y[0].event=="start"?w:y}function A(H){function G(I){return" "+I.nodeName+'="'+j(I.value)+'"'}F+="<"+t(H)+Array.prototype.map.call(H.attributes,G).join("")+">"}function E(G){F+="</"+t(G)+">"}function v(G){(G.event=="start"?A:E)(G.node)}while(w.length||y.length){var D=B();F+=j(C.substr(x,D[0].offset-x));x=D[0].offset;if(D==w){z.reverse().forEach(E);do{v(D.splice(0,1)[0]);D=B()}while(D==w&&D.length&&D[0].offset==x);z.reverse().forEach(A)}else{if(D[0].event=="start"){z.push(D[0].node)}else{z.pop()}v(D.splice(0,1)[0])}}return F+j(C.substr(x))}function m(y){function v(z){return(z&&z.source)||z}function w(A,z){return RegExp(v(A),"m"+(y.cI?"i":"")+(z?"g":""))}function x(D,C){if(D.compiled){return}D.compiled=true;D.k=D.k||D.bK;if(D.k){var z={};var E=function(G,F){if(y.cI){F=F.toLowerCase()}F.split(" ").forEach(function(H){var I=H.split("|");z[I[0]]=[G,I[1]?Number(I[1]):1]})};if(typeof D.k=="string"){E("keyword",D.k)}else{Object.keys(D.k).forEach(function(F){E(F,D.k[F])})}D.k=z}D.lR=w(D.l||/\b[A-Za-z0-9_]+\b/,true);if(C){if(D.bK){D.b="\\b("+D.bK.split(" ").join("|")+")\\b"}if(!D.b){D.b=/\B|\b/}D.bR=w(D.b);if(!D.e&&!D.eW){D.e=/\B|\b/}if(D.e){D.eR=w(D.e)}D.tE=v(D.e)||"";if(D.eW&&C.tE){D.tE+=(D.e?"|":"")+C.tE}}if(D.i){D.iR=w(D.i)}if(D.r===undefined){D.r=1}if(!D.c){D.c=[]}var B=[];D.c.forEach(function(F){if(F.v){F.v.forEach(function(G){B.push(o(F,G))})}else{B.push(F=="self"?D:F)}});D.c=B;D.c.forEach(function(F){x(F,D)});if(D.starts){x(D.starts,C)}var A=D.c.map(function(F){return F.bK?"\\.?("+F.b+")\\.?":F.b}).concat([D.tE,D.i]).map(v).filter(Boolean);D.t=A.length?w(A.join("|"),true):{exec:function(F){return null}}}x(y)}function c(T,L,J,R){function v(V,W){for(var U=0;U<W.c.length;U++){if(h(W.c[U].bR,V)){return W.c[U]}}}function z(V,U){if(h(V.eR,U)){return V}if(V.eW){return z(V.parent,U)}}function A(U,V){return !J&&h(V.iR,U)}function E(W,U){var V=M.cI?U[0].toLowerCase():U[0];return W.k.hasOwnProperty(V)&&W.k[V]}function w(aa,Y,X,W){var U=W?"":b.classPrefix,V='<span class="'+U,Z=X?"":"</span>";V+=aa+'">';return V+Y+Z}function N(){if(!I.k){return j(C)}var U="";var X=0;I.lR.lastIndex=0;var V=I.lR.exec(C);while(V){U+=j(C.substr(X,V.index-X));var W=E(I,V);if(W){H+=W[1];U+=w(W[0],j(V[0]))}else{U+=j(V[0])}X=I.lR.lastIndex;V=I.lR.exec(C)}return U+j(C.substr(X))}function F(){if(I.sL&&!f[I.sL]){return j(C)}var U=I.sL?c(I.sL,C,true,S):e(C);if(I.r>0){H+=U.r}if(I.subLanguageMode=="continuous"){S=U.top}return w(U.language,U.value,false,true)}function Q(){return I.sL!==undefined?F():N()}function P(W,V){var U=W.cN?w(W.cN,"",true):"";if(W.rB){D+=U;C=""}else{if(W.eB){D+=j(V)+U;C=""}else{D+=U;C=V}}I=Object.create(W,{parent:{value:I}})}function G(U,Y){C+=U;if(Y===undefined){D+=Q();return 0}var W=v(Y,I);if(W){D+=Q();P(W,Y);return W.rB?0:Y.length}var X=z(I,Y);if(X){var V=I;if(!(V.rE||V.eE)){C+=Y}D+=Q();do{if(I.cN){D+="</span>"}H+=I.r;I=I.parent}while(I!=X.parent);if(V.eE){D+=j(Y)}C="";if(X.starts){P(X.starts,"")}return V.rE?0:Y.length}if(A(Y,I)){throw new Error('Illegal lexeme "'+Y+'" for mode "'+(I.cN||"<unnamed>")+'"')}C+=Y;return Y.length||1}var M=i(T);if(!M){throw new Error('Unknown language: "'+T+'"')}m(M);var I=R||M;var S;var D="";for(var K=I;K!=M;K=K.parent){if(K.cN){D=w(K.cN,"",true)+D}}var C="";var H=0;try{var B,y,x=0;while(true){I.t.lastIndex=x;B=I.t.exec(L);if(!B){break}y=G(L.substr(x,B.index-x),B[0]);x=B.index+y}G(L.substr(x));for(var K=I;K.parent;K=K.parent){if(K.cN){D+="</span>"}}return{r:H,value:D,language:T,top:I}}catch(O){if(O.message.indexOf("Illegal")!=-1){return{r:0,value:j(L)}}else{throw O}}}function e(y,x){x=x||b.languages||Object.keys(f);var v={r:0,value:j(y)};var w=v;x.forEach(function(z){if(!i(z)){return}var A=c(z,y,false);A.language=z;if(A.r>w.r){w=A}if(A.r>v.r){w=v;v=A}});if(w.language){v.second_best=w}return v}function g(v){if(b.tabReplace){v=v.replace(/^((<[^>]+>|\t)+)/gm,function(w,z,y,x){return z.replace(/\t/g,b.tabReplace)})}if(b.useBR){v=v.replace(/\n/g,"<br>")}return v}function p(A){var B=r(A);if(/no(-?)highlight/.test(B)){return}var y;if(b.useBR){y=document.createElementNS("http://www.w3.org/1999/xhtml","div");y.innerHTML=A.innerHTML.replace(/\n/g,"").replace(/<br[ \/]*>/g,"\n")}else{y=A}var z=y.textContent;var v=B?c(B,z,true):e(z);var x=u(y);if(x.length){var w=document.createElementNS("http://www.w3.org/1999/xhtml","div");w.innerHTML=v.value;v.value=q(x,u(w),z)}v.value=g(v.value);A.innerHTML=v.value;A.className+=" hljs "+(!B&&v.language||"");A.result={language:v.language,re:v.r};if(v.second_best){A.second_best={language:v.second_best.language,re:v.second_best.r}}}var b={classPrefix:"hljs-",tabReplace:null,useBR:false,languages:undefined};function s(v){b=o(b,v)}function l(){if(l.called){return}l.called=true;var v=document.querySelectorAll("pre code");Array.prototype.forEach.call(v,p)}function a(){addEventListener("DOMContentLoaded",l,false);addEventListener("load",l,false)}var f={};var n={};function d(v,x){var w=f[v]=x(this);if(w.aliases){w.aliases.forEach(function(y){n[y]=v})}}function k(){return Object.keys(f)}function i(v){return f[v]||f[n[v]]}this.highlight=c;this.highlightAuto=e;this.fixMarkup=g;this.highlightBlock=p;this.configure=s;this.initHighlighting=l;this.initHighlightingOnLoad=a;this.registerLanguage=d;this.listLanguages=k;this.getLanguage=i;this.inherit=o;this.IR="[a-zA-Z][a-zA-Z0-9_]*";this.UIR="[a-zA-Z_][a-zA-Z0-9_]*";this.NR="\\b\\d+(\\.\\d+)?";this.CNR="(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)";this.BNR="\\b(0b[01]+)";this.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";this.BE={b:"\\\\[\\s\\S]",r:0};this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[this.BE]};this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[this.BE]};this.PWM={b:/\b(a|an|the|are|I|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such)\b/};this.CLCM={cN:"comment",b:"//",e:"$",c:[this.PWM]};this.CBCM={cN:"comment",b:"/\\*",e:"\\*/",c:[this.PWM]};this.HCM={cN:"comment",b:"#",e:"$",c:[this.PWM]};this.NM={cN:"number",b:this.NR,r:0};this.CNM={cN:"number",b:this.CNR,r:0};this.BNM={cN:"number",b:this.BNR,r:0};this.CSSNM={cN:"number",b:this.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0};this.RM={cN:"regexp",b:/\//,e:/\/[gim]*/,i:/\n/,c:[this.BE,{b:/\[/,e:/\]/,r:0,c:[this.BE]}]};this.TM={cN:"title",b:this.IR,r:0};this.UTM={cN:"title",b:this.UIR,r:0}}();hljs.registerLanguage("scala",function(d){var b={cN:"annotation",b:"@[A-Za-z]+"};var c={cN:"string",b:'u?r?"""',e:'"""',r:10};var a={cN:"symbol",b:"'\\w[\\w\\d_]*(?!')"};var e={cN:"type",b:"\\b[A-Z][A-Za-z0-9_]*",r:0};var h={cN:"title",b:/[^0-9\n\t "'(),.`{}\[\]:;][^\n\t "'(),.`{}\[\]:;]+|[^0-9\n\t "'(),.`{}\[\]:;=]/,r:0};var i={cN:"class",bK:"class object trait type",e:/[:={\[(\n;]/,c:[{cN:"keyword",bK:"extends with",r:10},h]};var g={cN:"function",bK:"def val",e:/[:={\[(\n;]/,c:[h]};var f={cN:"javadoc",b:"/\\*\\*",e:"\\*/",c:[{cN:"javadoctag",b:"@[A-Za-z]+"}],r:10};return{k:{literal:"true false null",keyword:"type yield lazy override def with val var sealed abstract private trait object if forSome for while throw finally protected extends import final return else break new catch super class case package default try this match continue throws implicit"},c:[d.CLCM,d.CBCM,c,d.QSM,a,e,g,i,d.CNM,b]}}); \ No newline at end of file
diff --git a/spec/public/scripts/main.js b/spec/public/scripts/main.js
new file mode 100644
index 0000000000..f0509aba41
--- /dev/null
+++ b/spec/public/scripts/main.js
@@ -0,0 +1,57 @@
+function currentChapter() {
+ var path = document.location.pathname;
+ var idx = path.lastIndexOf("/") + 1;
+ var chap = path.substring(idx, idx + 2);
+ return parseInt(chap, 10);
+}
+
+function heading(i, heading, $heading) {
+ var currentLevel = parseInt(heading.tagName.substring(1));
+ var result = "";
+ if (currentLevel === this.headerLevel) {
+ this.headerCounts[this.headerLevel] += 1;
+ return "" + this.headerCounts[this.headerLevel] + " " + $heading.text();
+ } else if (currentLevel < this.headerLevel) {
+ while(currentLevel < this.headerLevel) {
+ this.headerCounts[this.headerLevel] = 1;
+ this.headerLevel -= 1;
+ }
+ this.headerCounts[this.headerLevel] += 1;
+ return "" + this.headerCounts[this.headerLevel]+ " " + $heading.text();
+ } else {
+ while(currentLevel > this.headerLevel) {
+ this.headerLevel += 1;
+ this.headerCounts[this.headerLevel] = 1;
+ }
+ return "" + this.headerCounts[this.headerLevel]+ " " + $heading.text();
+ }
+}
+
+$('#toc').toc(
+ {
+ 'selectors': 'h1,h2,h3',
+ 'smoothScrolling': false,
+ 'chapter': currentChapter(),
+ 'headerLevel': 1,
+ 'headerCounts': [-1, currentChapter() - 1, 1, 1],
+ 'headerText': heading
+ }
+);
+
+// no language auto-detect so that EBNF isn't detected as scala
+hljs.configure({
+ languages: []
+});
+
+// syntax highlighting after mathjax is loaded so that mathjax can be used in code blocks
+MathJax.Hub.Queue(function () {
+ hljs.initHighlighting();
+ $("pre nobr").addClass("fixws");
+})
+
+$("#chapters a").each(function (index) {
+ if (document.location.pathname.endsWith($(this).attr("href")))
+ $(this).addClass("chapter-active");
+ else
+ $(this).removeClass("chapter-active");
+});
diff --git a/spec/public/scripts/navigation.js b/spec/public/scripts/navigation.js
deleted file mode 100644
index c046bf4d54..0000000000
--- a/spec/public/scripts/navigation.js
+++ /dev/null
@@ -1,70 +0,0 @@
-(function($){ $.fn.navigation = function() {
-
- // the TOC already contains H1 so we start at H2
- var headers = $('h2, h3, h4, h5').filter(function() {
- // exclude examples
- if (this.id.substr(0, 7) == 'example') {
- return false;
- }
-
- // get all headers with an id
- return this.id;
- });
-
- var output = $(this);
-
- var get_level = function(n) { return parseInt(n.nodeName.replace('H', ''), 10); }
-
- var back_to_top = '<span title="Return to top" class="to_top octicon octicon-chevron-up"></span>';
-
- if (headers.length && output.length) {
- var level = get_level(headers[0]);
- var current_level;
- var html = '<ol>';
-
- headers.each(function(_, header) {
- current_level = get_level(header);
-
- if (current_level === level) {
- // same level as before
- html += '<li><a href="#' + header.id + '">' + header.innerHTML + '</a>';
- } else if (current_level <= level) {
- // higher level, we go back up and chose intermediary lists
- for(i = current_level; i < level; i++) {
- html += '</li></ol>';
- }
- html += '<li><a href="#' + header.id + '">' + header.innerHTML + '</a>';
- } else if (current_level > level) {
- // lower level, we open new nested lists
- for(i = current_level; i > level; i--) {
- html += '<ol><li>';
- }
- html += '<a href="#' + header.id + '">' + header.innerHTML + '</a>';
- }
-
- var header_link = '<a class="anchor" href="#' + header.id + '"><span class="octicon octicon-link"></span></a>';
- $(header).prepend(header_link);
-
- if (!$(header).prev().is('h1')) {
- $(header).after(back_to_top);
- }
-
- level = current_level;
- });
-
- html += '</ol>';
-
- output.html(html);
- }
-
- // back to top links
- $(document).on('click', '.to_top', function() {
- $(window).scrollTop(0);
- window.location.hash = '';
- });
-
- // we add one more at the end of the document
- $('#content-container').append(back_to_top);
-
-};})(jQuery);
-
diff --git a/spec/public/scripts/toc.js b/spec/public/scripts/toc.js
new file mode 100644
index 0000000000..070d7b7a93
--- /dev/null
+++ b/spec/public/scripts/toc.js
@@ -0,0 +1,128 @@
+/*!
+ * toc - jQuery Table of Contents Plugin
+ * v0.3.2
+ * http://projects.jga.me/toc/
+ * copyright Greg Allen 2014
+ * MIT License
+*/
+(function($) {
+var verboseIdCache = {};
+$.fn.toc = function(options) {
+ var self = this;
+ var opts = $.extend({}, jQuery.fn.toc.defaults, options);
+
+ var container = $(opts.container);
+ var headings = $(opts.selectors, container);
+ var headingOffsets = [];
+ var activeClassName = opts.activeClass;
+
+ var scrollTo = function(e, callback) {
+ $('li', self).removeClass(activeClassName);
+ $(e.target).parent().addClass(activeClassName);
+ };
+
+ //highlight on scroll
+ var timeout;
+ var highlightOnScroll = function(e) {
+ if (timeout) {
+ clearTimeout(timeout);
+ }
+ timeout = setTimeout(function() {
+ var top = $(window).scrollTop(),
+ highlighted, closest = Number.MAX_VALUE, index = 0;
+
+ for (var i = 0, c = headingOffsets.length; i < c; i++) {
+ var currentClosest = Math.abs(headingOffsets[i] - top);
+ if (currentClosest < closest) {
+ index = i;
+ closest = currentClosest;
+ }
+ }
+
+ $('li', self).removeClass(activeClassName);
+ highlighted = $('li:eq('+ index +')', self).addClass(activeClassName);
+ opts.onHighlight(highlighted);
+ }, 50);
+ };
+ if (opts.highlightOnScroll) {
+ $(window).bind('scroll', highlightOnScroll);
+ highlightOnScroll();
+ }
+
+ return this.each(function() {
+ //build TOC
+ var el = $(this);
+ var ul = $(opts.listType);
+
+ headings.each(function(i, heading) {
+ var $h = $(heading);
+ headingOffsets.push($h.offset().top - opts.highlightOffset);
+
+ var anchorName = opts.anchorName(i, heading, opts.prefix);
+
+ //add anchor
+ if(heading.id !== anchorName) {
+ var anchor = $('<span/>').attr('id', anchorName).insertBefore($h);
+ }
+
+ //build TOC item
+ var a = $('<a/>')
+ .text(opts.headerText(i, heading, $h))
+ .attr('href', '#' + anchorName)
+ .bind('click', function(e) {
+ $(window).unbind('scroll', highlightOnScroll);
+ scrollTo(e, function() {
+ $(window).bind('scroll', highlightOnScroll);
+ });
+ el.trigger('selected', $(this).attr('href'));
+ });
+
+ var li = $('<li/>')
+ .addClass(opts.itemClass(i, heading, $h, opts.prefix))
+ .append(a);
+
+ ul.append(li);
+ });
+ el.html(ul);
+ });
+};
+
+
+jQuery.fn.toc.defaults = {
+ container: 'body',
+ listType: '<ul/>',
+ selectors: 'h1,h2,h3',
+ prefix: 'toc',
+ activeClass: 'toc-active',
+ onHighlight: function() {},
+ highlightOnScroll: true,
+ highlightOffset: 100,
+ anchorName: function(i, heading, prefix) {
+ if(heading.id.length) {
+ return heading.id;
+ }
+
+ var candidateId = $(heading).text().replace(/[^a-z0-9]/ig, ' ').replace(/\s+/g, '-').toLowerCase();
+ if (verboseIdCache[candidateId]) {
+ var j = 2;
+
+ while(verboseIdCache[candidateId + j]) {
+ j++;
+ }
+ candidateId = candidateId + '-' + j;
+
+ }
+ verboseIdCache[candidateId] = true;
+
+ return prefix + '-' + candidateId;
+ },
+ headerText: function(i, heading, $heading) {
+ return $heading.text();
+ },
+ itemClass: function(i, heading, $heading, prefix) {
+ return prefix + '-' + $heading[0].tagName.toLowerCase();
+ }
+
+};
+
+})(jQuery);