Final for now

This commit is contained in:
C9 2012-09-17 00:48:19 -04:00
commit 801a5b63df
53 changed files with 2047 additions and 621 deletions

View file

@ -0,0 +1,18 @@
/*
* jQuery BBQ: Back Button & Query Library - v1.2.1 - 2/17/2010
* http://benalman.com/projects/jquery-bbq-plugin/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
(function($,p){var i,m=Array.prototype.slice,r=decodeURIComponent,a=$.param,c,l,v,b=$.bbq=$.bbq||{},q,u,j,e=$.event.special,d="hashchange",A="querystring",D="fragment",y="elemUrlAttr",g="location",k="href",t="src",x=/^.*\?|#.*$/g,w=/^.*\#/,h,C={};function E(F){return typeof F==="string"}function B(G){var F=m.call(arguments,1);return function(){return G.apply(this,F.concat(m.call(arguments)))}}function n(F){return F.replace(/^[^#]*#?(.*)$/,"$1")}function o(F){return F.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")}function f(H,M,F,I,G){var O,L,K,N,J;if(I!==i){K=F.match(H?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);J=K[3]||"";if(G===2&&E(I)){L=I.replace(H?w:x,"")}else{N=l(K[2]);I=E(I)?l[H?D:A](I):I;L=G===2?I:G===1?$.extend({},I,N):$.extend({},N,I);L=a(L);if(H){L=L.replace(h,r)}}O=K[1]+(H?"#":L||!K[1]?"?":"")+L+J}else{O=M(F!==i?F:p[g][k])}return O}a[A]=B(f,0,o);a[D]=c=B(f,1,n);c.noEscape=function(G){G=G||"";var F=$.map(G.split(""),encodeURIComponent);h=new RegExp(F.join("|"),"g")};c.noEscape(",/");$.deparam=l=function(I,F){var H={},G={"true":!0,"false":!1,"null":null};$.each(I.replace(/\+/g," ").split("&"),function(L,Q){var K=Q.split("="),P=r(K[0]),J,O=H,M=0,R=P.split("]["),N=R.length-1;if(/\[/.test(R[0])&&/\]$/.test(R[N])){R[N]=R[N].replace(/\]$/,"");R=R.shift().split("[").concat(R);N=R.length-1}else{N=0}if(K.length===2){J=r(K[1]);if(F){J=J&&!isNaN(J)?+J:J==="undefined"?i:G[J]!==i?G[J]:J}if(N){for(;M<=N;M++){P=R[M]===""?O.length:R[M];O=O[P]=M<N?O[P]||(R[M+1]&&isNaN(R[M+1])?{}:[]):J}}else{if($.isArray(H[P])){H[P].push(J)}else{if(H[P]!==i){H[P]=[H[P],J]}else{H[P]=J}}}}else{if(P){H[P]=F?i:""}}});return H};function z(H,F,G){if(F===i||typeof F==="boolean"){G=F;F=a[H?D:A]()}else{F=E(F)?F.replace(H?w:x,""):F}return l(F,G)}l[A]=B(z,0);l[D]=v=B(z,1);$[y]||($[y]=function(F){return $.extend(C,F)})({a:k,base:k,iframe:t,img:t,input:t,form:"action",link:k,script:t});j=$[y];function s(I,G,H,F){if(!E(H)&&typeof H!=="object"){F=H;H=G;G=i}return this.each(function(){var L=$(this),J=G||j()[(this.nodeName||"").toLowerCase()]||"",K=J&&L.attr(J)||"";L.attr(J,a[I](K,H,F))})}$.fn[A]=B(s,A);$.fn[D]=B(s,D);b.pushState=q=function(I,F){if(E(I)&&/^#/.test(I)&&F===i){F=2}var H=I!==i,G=c(p[g][k],H?I:{},H?F:2);p[g][k]=G+(/#/.test(G)?"":"#")};b.getState=u=function(F,G){return F===i||typeof F==="boolean"?v(F):v(G)[F]};b.removeState=function(F){var G={};if(F!==i){G=u();$.each($.isArray(F)?F:arguments,function(I,H){delete G[H]})}q(G,2)};e[d]=$.extend(e[d],{add:function(F){var H;function G(J){var I=J[D]=c();J.getState=function(K,L){return K===i||typeof K==="boolean"?l(I,K):l(I,L)[K]};H.apply(this,arguments)}if($.isFunction(F)){H=F;return G}else{H=F.handler;F.handler=G}}})})(jQuery,this);
/*
* jQuery hashchange event - v1.2 - 2/11/2010
* http://benalman.com/projects/jquery-hashchange-plugin/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
(function($,i,b){var j,k=$.event.special,c="location",d="hashchange",l="href",f=$.browser,g=document.documentMode,h=f.msie&&(g===b||g<8),e="on"+d in i&&!h;function a(m){m=m||i[c][l];return m.replace(/^[^#]*#?(.*)$/,"$1")}$[d+"Delay"]=100;k[d]=$.extend(k[d],{setup:function(){if(e){return false}$(j.start)},teardown:function(){if(e){return false}$(j.stop)}});j=(function(){var m={},r,n,o,q;function p(){o=q=function(s){return s};if(h){n=$('<iframe src="javascript:0"/>').hide().insertAfter("body")[0].contentWindow;q=function(){return a(n.document[c][l])};o=function(u,s){if(u!==s){var t=n.document;t.open().close();t[c].hash="#"+u}};o(a())}}m.start=function(){if(r){return}var t=a();o||p();(function s(){var v=a(),u=q(t);if(v!==t){o(t=v,u);$(i).trigger(d)}else{if(u!==t){i[c][l]=i[c][l].replace(/#.*/,"")+"#"+u}}r=setTimeout(s,$[d+"Delay"])})()};m.stop=function(){if(!n){r&&clearTimeout(r);r=0}};return m})()})(jQuery,this);

View file

@ -0,0 +1,135 @@
/* ========================================================
* bootstrap-tab.js v2.1.1
* http://twitter.github.com/bootstrap/javascript.html#tabs
* ========================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ======================================================== */
!function ($) {
"use strict"; // jshint ;_;
/* TAB CLASS DEFINITION
* ==================== */
var Tab = function (element) {
this.element = $(element)
}
Tab.prototype = {
constructor: Tab
, show: function () {
var $this = this.element
, $ul = $this.closest('ul:not(.dropdown-menu)')
, selector = $this.attr('data-target')
, previous
, $target
, e
if (!selector) {
selector = $this.attr('href')
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
}
if ( $this.parent('li').hasClass('active') ) return
previous = $ul.find('.active a').last()[0]
e = $.Event('show', {
relatedTarget: previous
})
$this.trigger(e)
if (e.isDefaultPrevented()) return
$target = $(selector)
this.activate($this.parent('li'), $ul)
this.activate($target, $target.parent(), function () {
$this.trigger({
type: 'shown'
, relatedTarget: previous
})
})
}
, activate: function ( element, container, callback) {
var $active = container.find('> .active')
, transition = callback
&& $.support.transition
&& $active.hasClass('fade')
function next() {
$active
.removeClass('active')
.find('> .dropdown-menu > .active')
.removeClass('active')
element.addClass('active')
if (transition) {
element[0].offsetWidth // reflow for transition
element.addClass('in')
} else {
element.removeClass('fade')
}
if ( element.parent('.dropdown-menu') ) {
element.closest('li.dropdown').addClass('active')
}
callback && callback()
}
transition ?
$active.one($.support.transition.end, next) :
next()
$active.removeClass('in')
}
}
/* TAB PLUGIN DEFINITION
* ===================== */
$.fn.tab = function ( option ) {
return this.each(function () {
var $this = $(this)
, data = $this.data('tab')
if (!data) $this.data('tab', (data = new Tab(this)))
if (typeof option == 'string') data[option]()
})
}
$.fn.tab.Constructor = Tab
/* TAB DATA-API
* ============ */
$(function () {
$('body').on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
e.preventDefault()
$(this).tab('show')
})
})
}(window.jQuery);

View file

@ -1,4 +1,4 @@
$(document).ready(function () {
function setupClicker() {
// when hovering over arrow, add highlight (only if inactive)
$("i.methodToggle").hover(function () {
if (!$("i.methodToggle").hasClass('active'))
@ -9,9 +9,20 @@ $(document).ready(function () {
}
);
// after expanding the hidden description, hide the ellipsis
$("i.methodToggle").click(function() {
var $article = $(this).closest('.article'),
function handleClick(e, linkHref) {
//if (linkHref.indexOf("nav=api&api=") >= 0)
// return;
if (linkHref == "api")
return;
e.preventDefault();
var dstElem;
if (linkHref) {
dstElem = $("article[id='" + linkHref + "']");
}
var $article = (dstElem || $(this)).closest('.article'),
$arrow = $('i.methodClicker', $article);
if (!$article.hasClass('methodToggleOpen') || this.force) {
@ -19,36 +30,37 @@ $(document).ready(function () {
$arrow.removeClass('inactive').addClass('active');
var data = $arrow[0].id.replace(/^js_/, "");
location.hash = data + "#nav=api";
//var state = {};
//state.section = data;
//$.bbq.pushState(state);
scrollTo(null, data);
}
else {
$article.removeClass('methodToggleOpen');
$arrow.removeClass('active').addClass('inactive');
}
});
}
$('.signature-call, .signature-returns', '.signature').click(function() {
var $article = $(this).closest('.article'),
$arrow = $('i.methodClicker', $article);
if (!$article.hasClass('methodToggleOpen') || this.force) {
$article.addClass('methodToggleOpen');
$arrow.removeClass('inactive').addClass('active');
var data = $arrow[0].id.replace(/^js_/, "");
location.hash = data + "#nav=api";
scrollTo(null, data);
}
else {
$article.removeClass('methodToggleOpen');
$arrow.removeClass('active').addClass('inactive');
}
});
function transformHash(e) {
// some bs to figure out link hash
var hashId = (e.srcElement ? e.srcElement.href : (e.hash || e.target.href)) || e.currentTarget.hash;
handleClick(e, hashId.substring(hashId.indexOf("#") + 1));
}
// for the arrow
$("i.methodToggle").click(handleClick);
// for the signature
$('.member-name').click(handleClick);
// for the top dropdown
$('li.memberLink a').click(transformHash);
//$('a[href^="#"]').click(transformHash);
$('.related-to', '.metaInfo').click(function(){
location.hash = $(this).find('a').attr('href').split('#')[1];
});
});
}

View file

@ -1,12 +1,22 @@
var disqus_shortname = 'aceapi';
var paths = window.location.pathname.split("/");
var fileName = paths[paths.length - 2] + "/" + paths[paths.length - 1];
var disqus_identifier = fileName;
function setupDisqus() {
var disqus_shortname = 'aceapi';
var dsqId = "disqusScript";
//var paths = window.location.pathname.split("/");
//var fileName = paths[paths.length - 2] + "/" + paths[paths.length - 1];
//var disqus_identifier = fileName;
var lochash = location.hash.substr(1);
var disqus_identifier = "api/" + (lochash.substr(lochash.indexOf('api=')).split('&')[0].split('=')[1] || "index") + ".html";
(function() {
if (document.getElementById(dsqId))
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).removeChild(document.getElementById(dsqId));
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js';
dsq.id="disqusScript";
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
})();
}

View file

@ -37,7 +37,7 @@ $(function () {
}).find('input');
});
$(document).ready(function () {
function ux() {
var d = 'a.menu, .dropdown-toggle'
function clearMenus() {
@ -121,7 +121,7 @@ $(document).ready(function () {
});
});
/*$('span.methodClicker, article.article, i.methodClicker').each(function () {
$('span.methodClicker, article.article, i.methodClicker').each(function () {
var a = $(this);
var constructorPos = a.attr("id").indexOf("new ");
@ -132,13 +132,9 @@ $(document).ready(function () {
}
a.attr("id", objName);
});*/
});
function showMethodContent() {
if (!location.hash) return;
var locationHash = location.hash.replace(/^#/, '').replace(/\./g, '\\.');
var equalsPos = location.hash.indexOf("=");
@ -155,7 +151,7 @@ $(document).ready(function () {
}
}
if (location.hash) {
if (location.hash.indexOf("section") >= 1) {
showMethodContent();
var data = location.hash;
scrollTo(null, data.substr(1));
@ -164,12 +160,12 @@ $(document).ready(function () {
window.onhashchange = function () {
showMethodContent();
}
});
};
function scrollTo(el, data) {
if (!data) {
data = el.getAttribute("data-id");
location.hash = data;
//location.hash = data;
}
var el = $("span#" + data.replace(/\./g, "\\."))[0];
if (!el) return;