From 7c0b7865e793153c61df4b98a10e2fd6d600aa1f Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Tue, 3 Dec 2013 14:32:15 -0800 Subject: [PATCH] 1.0.0 --- bower.json | 2 +- dist/jquery/toolkit-accordion.min.js | 4 +-- dist/jquery/toolkit-blackout.min.js | 2 +- dist/jquery/toolkit-carousel.min.js | 4 +-- dist/jquery/toolkit-dropdown.min.js | 4 +-- dist/jquery/toolkit-flyout.min.js | 4 +-- dist/jquery/toolkit-lazyload.min.js | 4 +-- dist/jquery/toolkit-matrix.min.js | 4 +-- dist/jquery/toolkit-modal.min.js | 4 +-- dist/jquery/toolkit-pin.min.js | 4 +-- dist/jquery/toolkit-popover.min.js | 4 +-- dist/jquery/toolkit-showcase.min.js | 4 +-- dist/jquery/toolkit-stalker.min.js | 4 +-- dist/jquery/toolkit-tabs.min.js | 4 +-- dist/jquery/toolkit-tooltip.min.js | 4 +-- dist/jquery/toolkit-typeahead.min.js | 4 +-- dist/jquery/toolkit.min.js | 6 ++-- dist/mootools/toolkit-accordion.min.js | 2 +- dist/mootools/toolkit-blackout.min.js | 2 +- dist/mootools/toolkit-carousel.min.js | 2 +- dist/mootools/toolkit-class.cache.min.js | 2 +- dist/mootools/toolkit-class.timers.min.js | 2 +- dist/mootools/toolkit-dropdown.min.js | 2 +- dist/mootools/toolkit-flyout.min.js | 2 +- dist/mootools/toolkit-lazyload.min.js | 2 +- dist/mootools/toolkit-matrix.min.js | 2 +- dist/mootools/toolkit-modal.min.js | 4 +-- dist/mootools/toolkit-pin.min.js | 2 +- dist/mootools/toolkit-popover.min.js | 2 +- dist/mootools/toolkit-showcase.min.js | 2 +- dist/mootools/toolkit-stalker.min.js | 2 +- dist/mootools/toolkit-tabs.min.js | 2 +- dist/mootools/toolkit-tooltip.min.js | 2 +- dist/mootools/toolkit-typeahead.min.js | 4 +-- dist/mootools/toolkit.min.js | 6 ++-- dist/toolkit-jquery.min.js | 34 +++++++++++------------ dist/toolkit-mootools.min.js | 10 +++---- dist/toolkit.min.css | 8 +++--- package.json | 2 +- readme.md | 2 +- toolkit.gemspec | 2 +- version.md | 2 +- 42 files changed, 85 insertions(+), 85 deletions(-) diff --git a/bower.json b/bower.json index 6977b370..d05cfc98 100644 --- a/bower.json +++ b/bower.json @@ -1,5 +1,5 @@ { - "version": "1.0.0-rc.3", + "version": "1.0.0", "name": "titon-toolkit", "description": "A collection of extensible front-end UI components for the responsive web.", "keywords": [ diff --git a/dist/jquery/toolkit-accordion.min.js b/dist/jquery/toolkit-accordion.min.js index f478b946..b86f7d51 100644 --- a/dist/jquery/toolkit-accordion.min.js +++ b/dist/jquery/toolkit-accordion.min.js @@ -1,6 +1,6 @@ /*! - * Titon Toolkit v1.0.0-rc.3 + * Titon Toolkit v1.0.0 * Copyright 2010-2013, The Titon Project - http://titon.io * BSD-2 - https://github.com/titon/toolkit/blob/master/license.md */ -!function(a){"use strict";Toolkit.Accordion=Toolkit.Component.create(function(b,c){this.options=this.setOptions(Toolkit.Accordion.options,c),this.element=this.setElement(b,this.options),this.headers=[],this.sections=[],this.previousIndex=0,this.currentIndex=0,this.node=null,this.enabled=!0,this.initialize=function(){var b=this.options,c=this.element.find(b.contentElement),d=this.element.find(b.headerElement),e=d[0];this.headers=d,this.sections=c,d[b.defaultIndex]&&(e=d[b.defaultIndex]),this.element.children("li").removeClass("is-active"),d.each(function(b){a(this).data("index",b)}),c.each(function(){var b=a(this);b.data("height",b.height()).conceal()}),this.show(e),d.on("click"===this.options.mode?"click":"mouseover",this.__show.bind(this)),this.fireEvent("init")},this.jump=function(a){return a>=this.headers.length?a=0:0>a&&(a=this.headers.length-1),this.fireEvent("jump",a),this.show(this.headers[a])},this.show=function(b){b=a(b);var c=this.options,d=b.parent(),e=b.next(c.contentElement),f=b.data("index"),g=parseInt(e.data("height"),10);if("click"===c.mode&&(c.multiple||c.collapsible&&this.node&&this.node[0]===b[0]))e.is(":shown")&&this.node?(e.css("max-height",0).conceal(),d.removeClass("is-active")):(e.css("max-height",g).reveal(),d.addClass("is-active"));else{if(this.node===b)return this;this.sections.css("max-height",0).conceal(),e.css("max-height",g).reveal(),this.element.children("li").removeClass("is-active"),d.addClass("is-active")}return this.previousIndex=this.currentIndex,this.currentIndex=f,this.node=b,this.fireEvent("show",e),this},this.__show=function(a){a.preventDefault(),this.show(a.currentTarget)},this.element.length&&this.initialize()}),Toolkit.Accordion.options={mode:"click",defaultIndex:0,multiple:!1,collapsible:!1,headerElement:".accordion-head",contentElement:".accordion-handle"},a.fn.accordion=function(a){return this.each(function(){this.$accordion||(this.$accordion=new Toolkit.Accordion(this,a))})}}(jQuery); \ No newline at end of file +!function(a){"use strict";Toolkit.Accordion=Toolkit.Component.create(function(b,c){this.options=this.setOptions(Toolkit.Accordion.options,c),this.element=this.setElement(b,this.options),this.headers=[],this.sections=[],this.previousIndex=0,this.currentIndex=0,this.node=null,this.enabled=!0,this.initialize=function(){var b=this.options,c=this.element.find(b.contentElement),d=this.element.find(b.headerElement),e=d.item(0);this.headers=d,this.sections=c,d[b.defaultIndex]&&(e=d[b.defaultIndex]),this.element.children("li").removeClass("is-active"),d.each(function(b){a(this).data("index",b)}),c.each(function(){var b=a(this);b.data("height",b.height()).conceal()}),this.show(e),d.on("click"===this.options.mode?"click":"mouseover",this.__show.bind(this)),this.fireEvent("init")},this.jump=function(a){return a>=this.headers.length?a=0:0>a&&(a=this.headers.length-1),this.fireEvent("jump",a),this.show(this.headers[a])},this.show=function(b){b=a(b);var c=this.options,d=b.parent(),e=b.next(c.contentElement),f=b.data("index"),g=parseInt(e.data("height"),10),h=this.node&&this.node.is(b);if("click"===c.mode&&(c.multiple||c.collapsible&&h))e.is(":shown")&&this.node?(e.css("max-height",0).conceal(),d.removeClass("is-active")):(e.css("max-height",g).reveal(),d.addClass("is-active"));else{if(h)return this;this.sections.css("max-height",0).conceal(),e.css("max-height",g).reveal(),this.element.children("li").removeClass("is-active"),d.addClass("is-active")}return this.previousIndex=this.currentIndex,this.currentIndex=f,this.node=b,this.fireEvent("show",e),this},this.__show=function(a){a.preventDefault(),this.show(a.currentTarget)},this.element.length&&this.initialize()}),Toolkit.Accordion.options={mode:"click",defaultIndex:0,multiple:!1,collapsible:!1,headerElement:".accordion-head",contentElement:".accordion-handle"},a.fn.accordion=function(b){return this.each(function(){a(this).addData("toolkit.accordion",function(){return new Toolkit.Accordion(this,b)})})}}(jQuery); \ No newline at end of file diff --git a/dist/jquery/toolkit-blackout.min.js b/dist/jquery/toolkit-blackout.min.js index b6be58d7..73be6212 100644 --- a/dist/jquery/toolkit-blackout.min.js +++ b/dist/jquery/toolkit-blackout.min.js @@ -1,5 +1,5 @@ /*! - * Titon Toolkit v1.0.0-rc.3 + * Titon Toolkit v1.0.0 * Copyright 2010-2013, The Titon Project - http://titon.io * BSD-2 - https://github.com/titon/toolkit/blob/master/license.md */ diff --git a/dist/jquery/toolkit-carousel.min.js b/dist/jquery/toolkit-carousel.min.js index 5aeeedf9..3fb00a63 100644 --- a/dist/jquery/toolkit-carousel.min.js +++ b/dist/jquery/toolkit-carousel.min.js @@ -1,6 +1,6 @@ /*! - * Titon Toolkit v1.0.0-rc.3 + * Titon Toolkit v1.0.0 * Copyright 2010-2013, The Titon Project - http://titon.io * BSD-2 - https://github.com/titon/toolkit/blob/master/license.md */ -!function(a){"use strict";Toolkit.Carousel=Toolkit.Component.create(function(b,c){this.options=this.setOptions(Toolkit.Carousel.options,c),this.element=this.setElement(b,this.options),this.stopped=!1,this.itemsWrapper=null,this.itemsList=null,this.items=[],this.tabsWrapper=null,this.tabs=[],this.prevButton=null,this.nextButton=null,this.previousIndex=0,this.currentIndex=0,this.timer=null,this.enabled=!0,this.initialize=function(){var b=this.options;if(this.itemsWrapper=this.element.find(b.itemsElement),this.itemsList=this.itemsWrapper.children("ul, ol"),this.items=this.itemsWrapper.find(b.itemElement),this.tabsWrapper=this.element.find(b.tabsElement),this.tabs=this.tabsWrapper.find(b.tabElement),this.nextButton=this.element.find(b.nextElement),this.prevButton=this.element.find(b.prevElement),this.items.length<=1)return this.tabsWrapper.hide(),this.nextButton.hide(),this.prevButton.hide(),void 0;switch(b.animation){case"fade":a(this.items[0]).reveal();break;case"slide":this.itemsList.css("width",100*this.items.length+"%"),this.items.css("width",100/this.items.length+"%")}this.tabs.each(function(b){a(this).data("index",b)}),a(window).on("keydown",function(b){switch(a.inArray(b.keyCode,[37,38,39,40])>=0&&b.preventDefault(),b.keyCode){case 37:this.prev();break;case 38:this.jump(0);break;case 39:this.next();break;case 40:this.jump(-1)}}.bind(this)),b.stopOnHover&&this.element.on("mouseenter",this.stop.bind(this)).on("mouseleave",this.start.bind(this)),this.element.on("swipeleft",this.next.bind(this)).on("swiperight",this.prev.bind(this)),this.tabs.on("click",this.__jump.bind(this)),this.nextButton.on("click",this.next.bind(this)),this.prevButton.on("click",this.prev.bind(this)),this.start().reset(),this.fireEvent("init")},this.jump=function(b){switch(b>=this.items.length?b=0:0>b&&(b=this.items.length-1),this.previousIndex=this.currentIndex,this.currentIndex=b,this.tabs.length&&(this.tabs.removeClass("is-active"),a(this.tabs[b]).addClass("is-active")),this.options.animation){case"fade":this.items.removeClass("show"),a(this.items[b]).reveal();break;case"slide-up":this.itemsList.css("top",-(100*b)+"%");break;default:this.itemsList.css("left",-(100*b)+"%")}return this.reset(),this.fireEvent("jump",b),this},this.next=function(){return this.jump(this.currentIndex+1),this},this.prev=function(){return this.jump(this.currentIndex-1),this},this.reset=function(){return this.options.autoCycle&&(clearInterval(this.timer),this.timer=setInterval(this.__cycle.bind(this),this.options.duration)),this},this.start=function(){return this.element.removeClass("is-stopped"),this.stopped=!1,this.fireEvent("start"),this},this.stop=function(){return this.element.addClass("is-stopped"),this.stopped=!0,this.fireEvent("stop"),this},this.__cycle=function(){this.enabled&&(this.stopped||(this.fireEvent("cycle"),this.next()))},this.__jump=function(b){b.preventDefault(),b.stopPropagation(),this.enabled&&this.jump(a(b.target).data("index")||0)},this.element.length&&this.initialize()}),Toolkit.Carousel.options={animation:"slide",duration:5e3,autoCycle:!0,stopOnHover:!0,itemsElement:".carousel-items",itemElement:"li",tabsElement:".carousel-tabs",tabElement:"a",nextElement:".carousel-next",prevElement:".carousel-prev"},a.fn.carousel=function(a){return this.each(function(){this.$carousel||(this.$carousel=new Toolkit.Carousel(this,a))})}}(jQuery); \ No newline at end of file +!function(a){"use strict";Toolkit.Carousel=Toolkit.Component.create(function(b,c){this.options=this.setOptions(Toolkit.Carousel.options,c),this.element=this.setElement(b,this.options),this.stopped=!1,this.itemsWrapper=null,this.itemsList=null,this.items=[],this.tabsWrapper=null,this.tabs=[],this.prevButton=null,this.nextButton=null,this.previousIndex=0,this.currentIndex=0,this.timer=null,this.enabled=!0,this.initialize=function(){var b=this.options;if(this.itemsWrapper=this.element.find(b.itemsElement),this.itemsList=this.itemsWrapper.children("ul, ol"),this.items=this.itemsWrapper.find(b.itemElement),this.tabsWrapper=this.element.find(b.tabsElement),this.tabs=this.tabsWrapper.find(b.tabElement),this.nextButton=this.element.find(b.nextElement),this.prevButton=this.element.find(b.prevElement),this.items.length<=1)return this.tabsWrapper.hide(),this.nextButton.hide(),this.prevButton.hide(),void 0;switch(b.animation){case"fade":this.items.item(0).reveal();break;case"slide":this.itemsList.css("width",100*this.items.length+"%"),this.items.css("width",100/this.items.length+"%")}this.tabs.each(function(b){a(this).data("index",b)}),a(window).on("keydown",function(b){switch(a.inArray(b.keyCode,[37,38,39,40])>=0&&b.preventDefault(),b.keyCode){case 37:this.prev();break;case 38:this.jump(0);break;case 39:this.next();break;case 40:this.jump(-1)}}.bind(this)),b.stopOnHover&&this.element.on("mouseenter",this.stop.bind(this)).on("mouseleave",this.start.bind(this)),this.element.on("swipeleft",this.next.bind(this)).on("swiperight",this.prev.bind(this)),this.tabs.on("click",this.__jump.bind(this)),this.nextButton.on("click",this.next.bind(this)),this.prevButton.on("click",this.prev.bind(this)),this.start().reset(),this.fireEvent("init")},this.jump=function(a){switch(a>=this.items.length?a=0:0>a&&(a=this.items.length-1),this.previousIndex=this.currentIndex,this.currentIndex=a,this.tabs.length&&this.tabs.removeClass("is-active").item(a).addClass("is-active"),this.options.animation){case"fade":this.items.removeClass("show").item(a).reveal();break;case"slide-up":this.itemsList.css("top",-(100*a)+"%");break;default:this.itemsList.css("left",-(100*a)+"%")}return this.reset(),this.fireEvent("jump",a),this},this.next=function(){return this.jump(this.currentIndex+1),this},this.prev=function(){return this.jump(this.currentIndex-1),this},this.reset=function(){return this.options.autoCycle&&(clearInterval(this.timer),this.timer=setInterval(this.__cycle.bind(this),this.options.duration)),this},this.start=function(){return this.element.removeClass("is-stopped"),this.stopped=!1,this.fireEvent("start"),this},this.stop=function(){return this.element.addClass("is-stopped"),this.stopped=!0,this.fireEvent("stop"),this},this.__cycle=function(){this.enabled&&(this.stopped||(this.fireEvent("cycle"),this.next()))},this.__jump=function(b){b.preventDefault(),b.stopPropagation(),this.enabled&&this.jump(a(b.target).data("index")||0)},this.element.length&&this.initialize()}),Toolkit.Carousel.options={animation:"slide",duration:5e3,autoCycle:!0,stopOnHover:!0,itemsElement:".carousel-items",itemElement:"li",tabsElement:".carousel-tabs",tabElement:"a",nextElement:".carousel-next",prevElement:".carousel-prev"},a.fn.carousel=function(b){return this.each(function(){a(this).addData("toolkit.carousel",function(){return new Toolkit.Carousel(this,b)})})}}(jQuery); \ No newline at end of file diff --git a/dist/jquery/toolkit-dropdown.min.js b/dist/jquery/toolkit-dropdown.min.js index cbdcb470..c47328cf 100644 --- a/dist/jquery/toolkit-dropdown.min.js +++ b/dist/jquery/toolkit-dropdown.min.js @@ -1,6 +1,6 @@ /*! - * Titon Toolkit v1.0.0-rc.3 + * Titon Toolkit v1.0.0 * Copyright 2010-2013, The Titon Project - http://titon.io * BSD-2 - https://github.com/titon/toolkit/blob/master/license.md */ -!function(a){"use strict";Toolkit.Dropdown=Toolkit.Component.create(function(b,c){this.options=this.setOptions(Toolkit.Dropdown.options,c),this.nodes=a(b),this.element=null,this.node=null,this.enabled=!0,this.initialize=function(){a(window).on("click",this.hide.bind(this)),a(this.options.context||document).on("click"===this.options.mode?"click":"mouseenter",this.nodes.selector,this.__show.bind(this)),this.fireEvent("init")},this.hide=function(){return this.element&&this.element.is(":shown")&&(this.element.conceal(),this.node.removeClass("is-active"),this.fireEvent("hide")),this},this.show=function(b){return this.element.reveal(),this.node=a(b),this.node.addClass("is-active"),this.fireEvent("show"),this},this.__show=function(b){if(b.preventDefault(),b.stopPropagation(),this.enabled){var c=a(b.target),d=this.readValue(c,this.options.getTarget);d&&"#"===d.substr(0,1)&&(this.options.hideOpened&&this.node&&this.node[0]!==c[0]&&this.hide(),this.element=a(d),this.node=c,this.element.is(":shown")?this.hide():this.show(c))}},this.initialize()}),Toolkit.Dropdown.options={mode:"click",context:null,getTarget:"data-dropdown",hideOpened:!0},a.fn.dropdown=function(a){var b=new Toolkit.Dropdown(this,a);return this.each(function(){this.$dropdown||(this.$dropdown=b)})}}(jQuery); \ No newline at end of file +!function(a){"use strict";Toolkit.Dropdown=Toolkit.Component.create(function(b,c){this.options=this.setOptions(Toolkit.Dropdown.options,c),this.nodes=a(b),this.element=null,this.node=null,this.enabled=!0,this.initialize=function(){a(window).on("click",this.hide.bind(this)),a(this.options.context||document).on("click"===this.options.mode?"click":"mouseenter",this.nodes.selector,this.__show.bind(this)),this.fireEvent("init")},this.hide=function(){return this.element&&this.element.is(":shown")&&(this.element.conceal(),this.node.removeClass("is-active"),this.fireEvent("hide")),this},this.show=function(b){return this.element.reveal(),this.node=a(b),this.node.addClass("is-active"),this.fireEvent("show"),this},this.__show=function(b){if(b.preventDefault(),b.stopPropagation(),this.enabled){var c=a(b.target),d=this.readValue(c,this.options.getTarget);d&&"#"===d.substr(0,1)&&(this.options.hideOpened&&this.node&&!this.node.is(c)&&this.hide(),this.element=a(d),this.node=c,this.element.is(":shown")?this.hide():this.show(c))}},this.initialize()}),Toolkit.Dropdown.options={mode:"click",context:null,getTarget:"data-dropdown",hideOpened:!0},a.fn.dropdown=function(b){var c=new Toolkit.Dropdown(this,b);return this.each(function(){a(this).addData("toolkit.dropdown",c)})}}(jQuery); \ No newline at end of file diff --git a/dist/jquery/toolkit-flyout.min.js b/dist/jquery/toolkit-flyout.min.js index f2297a12..f5e7551d 100644 --- a/dist/jquery/toolkit-flyout.min.js +++ b/dist/jquery/toolkit-flyout.min.js @@ -1,6 +1,6 @@ /*! - * Titon Toolkit v1.0.0-rc.3 + * Titon Toolkit v1.0.0 * Copyright 2010-2013, The Titon Project - http://titon.io * BSD-2 - https://github.com/titon/toolkit/blob/master/license.md */ -!function(a){"use strict";Toolkit.Flyout=Toolkit.Component.create(function(b,c,d){this.options=this.setOptions(Toolkit.Flyout.options,d),this.nodes=a(b),this.node=null,this.element=null,this.current=null,this.menus={},this.data=[],this.dataMap={},this.timers={},this.enabled=!0,this.initialize=function(){if(!c)throw new Error("Flyout URL required to download sitemap JSON");a.ajax({url:c,dataType:"json",success:this.load.bind(this)});var b=this.options;"hover"===b.mode&&a(b.context||document).on("mouseenter",this.nodes.selector,function(){this.clearTimer("hide").startTimer("show",b.showDelay)}.bind(this)).on("mouseleave",this.nodes.selector,function(){this.clearTimer("show").startTimer("hide",b.showDelay)}.bind(this)),a(b.context||document).on("click"===b.mode?"click":"mouseenter",this.nodes.selector,this.__show.bind(this)),this.fireEvent("init")},this.clearTimer=function(a){return window.clearTimeout(this.timers[a]),delete this.timers[a],this},this.hide=function(){return this.node.removeClass("is-active"),this.current&&this.isVisible()?(this.menus[this.current].conceal(),this.fireEvent("hide"),this.current=null,this):this},this.isVisible=function(){return this.current&&this.menus[this.current]&&(this.element=this.menus[this.current]),this.element&&this.element.is(":shown")},this.load=function(a,b){if(b=b||0,0===b&&(this.data=a),this.dataMap[a.url]=a,a.children)for(var c=0,d=a.children.length;d>c;c++)this.load(a.children[c],b+1);return this},this.position=function(){var b=this.current,c=this.options;if(!this.menus[b])return this;var d=this.menus[b],e=d.outerHeight(),f=this.node.offset(),g=f.left+c.xOffset,h=f.top+c.yOffset+this.node.outerHeight(),i=a(window).height();return h>i/2&&(h=f.top-c.yOffset-e),d.css({left:g,top:h}).reveal(),this.fireEvent("show"),this},this.show=function(b){var c=this._getTarget(b);return this.current&&c!==this.current&&(this.hide(),this.startTimer("show",this.options.showDelay)),this.node=a(b),this._getMenu()?(this.fireEvent("load",b),this.node.addClass("is-active"),"click"===this.options.mode&&this.position(),this):this},this.startTimer=function(a,b,c){this.clearTimer(a);var d;return d="show"===a?this.position.bind(this):this.hide.bind(this),d&&(this.timers[a]=window.setTimeout(function(){d.apply(this,c||[])}.bind(this),b)),this},this._buildMenu=function(b,c){if(!c.children||!c.children.length)return null;var d,e,f,g=a(this.options.template),h=[],i=this.options.contentElement,j=this.options.itemLimit;this.options.className&&g.addClass(this.options.className),b[0]===a("body")[0]&&g.addClass("is-root"),j&&c.children.length>j?h=c.children.chunk(j):h.push(c.children);for(var k,l=0;k=h[l];l++){d=a("