diff --git a/app/assets/images/sprite.svg b/app/assets/images/sprite.svg index 1af804920..cfafff8b1 100644 --- a/app/assets/images/sprite.svg +++ b/app/assets/images/sprite.svg @@ -1,5 +1,5 @@ - + 1 Created with Sketch (http://www.bohemiancoding.com/sketch) @@ -190,8 +190,8 @@ - - - + + + \ No newline at end of file diff --git a/app/assets/javascripts/app/controllers/_click_catcher.js.coffee b/app/assets/javascripts/app/controllers/_click_catcher.js.coffee new file mode 100644 index 000000000..56378fa9a --- /dev/null +++ b/app/assets/javascripts/app/controllers/_click_catcher.js.coffee @@ -0,0 +1,20 @@ +class App.clickCatcher extends Spine.Controller + # clickCatcher has no template because it's a plain
+ className: 'clickCatcher' + + constructor: (holder, callback, zIndexScale) -> + super + @render() if @callback and @holder + + triggerCallback: (event) => + event.stopPropagation() + @callback() + @remove() + + render: -> + @el.addClass("zIndex-#{ @zIndexScale }") if @zIndexScale + @el.on('click', @triggerCallback) + @el.appendTo(@holder) + + remove: -> + @el.remove() \ No newline at end of file diff --git a/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee b/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee index 1e6c81660..3447539ef 100644 --- a/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee +++ b/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee @@ -185,10 +185,10 @@ class App.TicketCreate extends App.Controller ) # show template UI - new App.WidgetTemplate( - el: @el.find('.ticket_template') - template_id: template['id'] - ) + # new App.WidgetTemplate( + # el: @el.find('.ticket_template') + # template_id: template['id'] + # ) @formDefault = @formParam( @el.find('.ticket-create') ) @@ -197,6 +197,8 @@ class App.TicketCreate extends App.Controller el: @el.find('.ticket-create').find('textarea') ) + $('#tags').tokenfield() + # start auto save @autosave() diff --git a/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee b/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee index 5686e02db..eb8f428a0 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee @@ -317,21 +317,37 @@ class Sidebar extends App.Controller class Edit extends App.Controller + elements: + 'textarea' : 'textarea' + '.edit-control-item' : 'editControlItem' + '.edit-controls': 'editControls' + '.recipient-picker': 'recipientPicker' + '.recipient-list': 'recipientList' + '.recipient-list .list-arrow': 'recipientListArrow' + '.js-attachment': 'attachmentHolder' + '.js-attachment-text': 'attachmentText' + '.bubble-placeholder-hint': 'bubblePlaceholderHint' + events: 'click .submit': 'update' 'click [data-type="reset"]': 'reset' - 'click .visibility.toggle': 'toggle_visibility' + 'click .visibility-toggle': 'toggle_visibility' 'click .pop-selectable': 'select_type' 'click .pop-selected': 'show_selectable_types' - 'focus textarea': 'show_controls' - 'blur textarea': 'hide_controls' + 'focus textarea': 'open_textarea' + 'input textarea': 'detect_empty_textarea' 'click .recipient-picker': 'toggle_recipients' 'click .recipient-list': 'stopPropagation' - 'click .list-entry-type div': 'change_recipient_type' + 'click .list-entry-type div': 'change_type' 'submit .recipient-list form': 'add_recipient' constructor: -> super + + @textareaHeight = + open: 148 + closed: 38 + @render() stopPropagation: (e) -> @@ -446,7 +462,7 @@ class Edit extends App.Controller # show text module UI if !@isRole('Customer') textModule = new App.WidgetTextModule( - el: @el.find('textarea') + el: @textarea data: ticket: ticket ) @@ -457,51 +473,63 @@ class Edit extends App.Controller @subscribeIdTextModule = ticket.subscribe( callback ) toggle_recipients: => - padding = 15 - toggle = @el.find('.recipient-picker') - list = @el.find('.recipient-list') - arrow = list.find('.list-arrow') - - if toggle.hasClass('state--open') - toggle.removeClass('state--open') - list.velocity - properties: - scale: [ 0, 1 ] - opacity: [ 0, 1 ] - options: - speed: 300 - easing: [ 500, 20 ] - complete: -> list.addClass('hide') + if !@pickRecipientsCatcher + @show_recipients() else - toggle.addClass('state--open') - list.removeClass('hide') + @hide_recipients() - toggleDimensions = toggle.get(0).getBoundingClientRect() - availableHeight = toggle.scrollParent().outerHeight() + show_recipients: -> + padding = 15 - top = toggleDimensions.height/2 - list.height()/2 - bottomDistance = availableHeight - padding - (toggleDimensions.top + top + list.height()) + @recipientPicker.addClass('is-open') + @recipientList.removeClass('hide') - if bottomDistance < 0 - top += bottomDistance + pickerDimensions = @recipientPicker.get(0).getBoundingClientRect() + availableHeight = @recipientPicker.scrollParent().outerHeight() - arrowCenter = -top + toggleDimensions.height/2 + top = pickerDimensions.height/2 - @recipientList.height()/2 + bottomDistance = availableHeight - padding - (pickerDimensions.top + top + @recipientList.height()) - arrow.css('top', arrowCenter) - list.css('top', top) + if bottomDistance < 0 + top += bottomDistance - $.Velocity.hook(list, 'transformOriginX', "0") - $.Velocity.hook(list, 'transformOriginY', "#{ arrowCenter }px") + arrowCenter = -top + pickerDimensions.height/2 - list.velocity - properties: - scale: [ 1, 0 ] - opacity: [ 1, 0 ] - options: - speed: 300 - easing: [ 0.34, 1.61, 0.7, 1 ] + @recipientListArrow.css('top', arrowCenter) + @recipientList.css('top', top) - change_recipient_type: (e) -> + $.Velocity.hook(@recipientList, 'transformOriginX', "0") + $.Velocity.hook(@recipientList, 'transformOriginY', "#{ arrowCenter }px") + + @recipientList.velocity + properties: + scale: [ 1, 0 ] + opacity: [ 1, 0 ] + options: + speed: 300 + easing: [ 0.34, 1.61, 0.7, 1 ] + + @pickRecipientsCatcher = new App.clickCatcher + holder: @el.offsetParent() + callback: @hide_recipients + zIndexScale: 6 + + hide_recipients: => + @pickRecipientsCatcher.remove() + @pickRecipientsCatcher = null + + @recipientPicker.removeClass('is-open') + + @recipientList.velocity + properties: + scale: [ 0, 1 ] + opacity: [ 0, 1 ] + options: + speed: 300 + easing: [ 500, 20 ] + complete: -> @recipientList.addClass('hide') + + change_type: (e) -> $(e.target).addClass('active').siblings('.active').removeClass('active') # store $(this).data('value') @@ -512,18 +540,28 @@ class Edit extends App.Controller # store recipient toggle_visibility: -> - if @el.hasClass('state--public') - @el.removeClass('state--public') - @el.addClass('state--internal') + if @el.hasClass('is-public') + @el.removeClass('is-public') + @el.addClass('is-internal') else - @el.addClass('state--public') - @el.removeClass('state--internal') + @el.addClass('is-public') + @el.removeClass('is-internal') show_selectable_types: => @el.find('.pop-selector').removeClass('hide') + @selectTypeCatcher = new App.clickCatcher + holder: @el.offsetParent() + callback: @hide_type + zIndexScale: 6 + select_type: (e) => @set_type $(e.target).data('value') + @hide_type() + @selectTypeCatcher.remove() + @selectTypeCatcher = null + + hide_type: => @el.find('.pop-selector').addClass('hide') set_type: (type) -> @@ -533,14 +571,92 @@ class Edit extends App.Controller @type = type typeIcon.addClass @type - show_controls: => - @el.addClass('mode--edit') - # scroll to bottom - @el.scrollParent().scrollTop(99999) + detect_empty_textarea: => + if !@textarea.val() + @add_textarea_catcher() + else + @remove_textarea_catcher() - hide_controls: => - if !@el.find('textarea').val() - @el.removeClass('mode--edit') + open_textarea: => + if !@textareaCatcher and !@textarea.val() + @el.addClass('is-open') + + @textarea.velocity + properties: + height: "#{ @textareaHeight.open - 38 }px" + marginBottom: 38 + options: + duration: 300 + easing: 'easeOutQuad' + + # scroll to bottom + @textarea.velocity "scroll", + container: @textarea.scrollParent() + offset: 99999 + duration: 300 + easing: 'easeOutQuad' + queue: false + + @editControlItem.velocity "transition.slideRightIn", + duration: 300 + stagger: 50 + drag: true + + # move attachment text to the left bottom (bottom happens automatically) + + @attachmentHolder.velocity + properties: + translateX: -@attachmentText.position().left + "px" + options: + duration: 300 + easing: 'easeOutQuad' + + @bubblePlaceholderHint.velocity + properties: + opacity: 0 + options: + duration: 300 + + @add_textarea_catcher() + + add_textarea_catcher: -> + @textareaCatcher = new App.clickCatcher + holder: @el.offsetParent() + callback: @close_textarea + zIndexScale: 4 + + remove_textarea_catcher: -> + return if !@textareaCatcher + @textareaCatcher.remove() + @textareaCatcher = null + + close_textarea: => + @remove_textarea_catcher() + if !@textarea.val() + + @textarea.velocity + properties: + height: "#{ @textareaHeight.closed }px" + marginBottom: 0 + options: + duration: 300 + easing: 'easeOutQuad' + complete: => @el.removeClass('is-open') + + @attachmentHolder.velocity + properties: + translateX: 0 + options: + duration: 300 + easing: 'easeOutQuad' + + @bubblePlaceholderHint.velocity + properties: + opacity: 1 + options: + duration: 300 + + @editControlItem.css('display', 'none') autosaveStop: => @clearInterval( 'autosave' ) diff --git a/app/assets/javascripts/app/controllers/widget/template.js.coffee b/app/assets/javascripts/app/controllers/widget/template.js.coffee index 9367285ea..7c12c8109 100644 --- a/app/assets/javascripts/app/controllers/widget/template.js.coffee +++ b/app/assets/javascripts/app/controllers/widget/template.js.coffee @@ -23,7 +23,7 @@ class App.WidgetTemplate extends App.ControllerDrox # insert data @html @template( file: 'widget/template' - header: 'Templates' + header: 'Select Template:' params: template: template ) diff --git a/app/assets/javascripts/app/lib/animations/velocity.min.js b/app/assets/javascripts/app/lib/animations/velocity.min.js new file mode 100644 index 000000000..8454789cb --- /dev/null +++ b/app/assets/javascripts/app/lib/animations/velocity.min.js @@ -0,0 +1,4 @@ +/*! VelocityJS.org (1.0.0). (C) 2014 Julian Shapiro. MIT @license: en.wikipedia.org/wiki/MIT_License */ +/*! VelocityJS.org jQuery Shim (1.0.0-rc1). (C) 2014 The jQuery Foundation. MIT @license: en.wikipedia.org/wiki/MIT_License. */ +!function(e){function t(e){var t=e.length,r=$.type(e);return"function"===r||$.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===r||0===t||"number"==typeof t&&t>0&&t-1 in e}if(!e.jQuery){var $=function(e,t){return new $.fn.init(e,t)};$.isWindow=function(e){return null!=e&&e==e.window},$.type=function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?a[o.call(e)]||"object":typeof e},$.isArray=Array.isArray||function(e){return"array"===$.type(e)},$.isPlainObject=function(e){var t;if(!e||"object"!==$.type(e)||e.nodeType||$.isWindow(e))return!1;try{if(e.constructor&&!n.call(e,"constructor")&&!n.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}for(t in e);return void 0===t||n.call(e,t)},$.each=function(e,r,a){var n,o=0,i=e.length,s=t(e);if(a){if(s)for(;i>o&&(n=r.apply(e[o],a),n!==!1);o++);else for(o in e)if(n=r.apply(e[o],a),n===!1)break}else if(s)for(;i>o&&(n=r.call(e[o],o,e[o]),n!==!1);o++);else for(o in e)if(n=r.call(e[o],o,e[o]),n===!1)break;return e},$.data=function(e,t,a){if(void 0===a){var n=e[$.expando],o=n&&r[n];if(void 0===t)return o;if(o&&t in o)return o[t]}else if(void 0!==t){var n=e[$.expando]||(e[$.expando]=++$.uuid);return r[n]=r[n]||{},r[n][t]=a,a}},$.removeData=function(e,t){var a=e[$.expando],n=a&&r[a];n&&$.each(t,function(e,t){delete n[t]})},$.extend=function(){var e,t,r,a,n,o,i=arguments[0]||{},s=1,l=arguments.length,u=!1;for("boolean"==typeof i&&(u=i,i=arguments[s]||{},s++),"object"!=typeof i&&"function"!==$.type(i)&&(i={}),s===l&&(i=this,s--);l>s;s++)if(null!=(n=arguments[s]))for(a in n)e=i[a],r=n[a],i!==r&&(u&&r&&($.isPlainObject(r)||(t=$.isArray(r)))?(t?(t=!1,o=e&&$.isArray(e)?e:[]):o=e&&$.isPlainObject(e)?e:{},i[a]=$.extend(u,o,r)):void 0!==r&&(i[a]=r));return i},$.queue=function(e,r,a){function n(e,r){var a=r||[];return null!=e&&(t(Object(e))?!function(e,t){for(var r=+t.length,a=0,n=e.length;r>a;)e[n++]=t[a++];if(r!==r)for(;void 0!==t[a];)e[n++]=t[a++];return e.length=n,e}(a,"string"==typeof e?[e]:e):[].push.call(a,e)),a}if(e){r=(r||"fx")+"queue";var o=$.data(e,r);return a?(!o||$.isArray(a)?o=$.data(e,r,n(a)):o.push(a),o):o||[]}},$.dequeue=function(e,t){$.each(e.nodeType?[e]:e,function(e,r){t=t||"fx";var a=$.queue(r,t),n=a.shift();"inprogress"===n&&(n=a.shift()),n&&("fx"===t&&a.unshift("inprogress"),n.call(r,function(){$.dequeue(r,t)}))})},$.fn=$.prototype={init:function(e){if(e.nodeType)return this[0]=e,this;throw new Error("Not a DOM node.")},offset:function(){var t=this[0].getBoundingClientRect();return{top:t.top+(e.pageYOffset||document.scrollTop||0)-(document.clientTop||0),left:t.left+(e.pageXOffset||document.scrollLeft||0)-(document.clientLeft||0)}},position:function(){function e(){for(var e=this.offsetParent||document;e&&"html"===!e.nodeType.toLowerCase&&"static"===e.style.position;)e=e.offsetParent;return e||document}var t=this[0],e=e.apply(t),r=this.offset(),a=/^(?:body|html)$/i.test(e.nodeName)?{top:0,left:0}:$(e).offset();return r.top-=parseFloat(t.style.marginTop)||0,r.left-=parseFloat(t.style.marginLeft)||0,e.style&&(a.top+=parseFloat(e.style.borderTopWidth)||0,a.left+=parseFloat(e.style.borderLeftWidth)||0),{top:r.top-a.top,left:r.left-a.left}}};var r={};$.expando="velocity"+(new Date).getTime(),$.uuid=0;for(var a={},n=a.hasOwnProperty,o=a.toString,i="Boolean Number String Function Array Date RegExp Object Error".split(" "),s=0;sn;++n){var o=u(r,e,a);if(0===o)return r;var i=l(r,e,a)-t;r-=i/o}return r}function p(){for(var t=0;b>t;++t)w[t]=l(t*x,e,a)}function f(t,r,n){var o,i,s=0;do i=r+(n-r)/2,o=l(i,e,a)-t,o>0?n=i:r=i;while(Math.abs(o)>h&&++s=y?c(t,s):0==l?s:f(t,r,r+x)}function g(){V=!0,(e!=r||a!=n)&&p()}var m=4,y=.001,h=1e-7,v=10,b=11,x=1/(b-1),S="Float32Array"in t;if(4!==arguments.length)return!1;for(var P=0;4>P;++P)if("number"!=typeof arguments[P]||isNaN(arguments[P])||!isFinite(arguments[P]))return!1;e=Math.min(e,1),a=Math.min(a,1),e=Math.max(e,0),a=Math.max(a,0);var w=S?new Float32Array(b):new Array(b),V=!1,C=function(t){return V||g(),e===r&&a===n?t:0===t?0:1===t?1:l(d(t),r,n)};C.getControlPoints=function(){return[{x:e,y:r},{x:a,y:n}]};var T="generateBezier("+[e,r,a,n]+")";return C.toString=function(){return T},C}function u(e,t){var r=e;return g.isString(e)?v.Easings[e]||(r=!1):r=g.isArray(e)&&1===e.length?s.apply(null,e):g.isArray(e)&&2===e.length?b.apply(null,e.concat([t])):g.isArray(e)&&4===e.length?l.apply(null,e):!1,r===!1&&(r=v.Easings[v.defaults.easing]?v.defaults.easing:h),r}function c(e){if(e)for(var t=(new Date).getTime(),r=0,n=v.State.calls.length;n>r;r++)if(v.State.calls[r]){var o=v.State.calls[r],s=o[0],l=o[2],u=o[3];u||(u=v.State.calls[r][3]=t-16);for(var f=Math.min((t-u)/l.duration,1),d=0,m=s.length;m>d;d++){var y=s[d],h=y.element;if(i(h)){var b=!1;if(l.display!==a&&null!==l.display&&"none"!==l.display){if("flex"===l.display){var S=["-webkit-box","-moz-box","-ms-flexbox","-webkit-flex"];$.each(S,function(e,t){x.setPropertyValue(h,"display",t)})}x.setPropertyValue(h,"display",l.display)}l.visibility&&"hidden"!==l.visibility&&x.setPropertyValue(h,"visibility",l.visibility);for(var w in y)if("element"!==w){var V=y[w],C,T=g.isString(V.easing)?v.Easings[V.easing]:V.easing;if(C=1===f?V.endValue:V.startValue+(V.endValue-V.startValue)*T(f),V.currentValue=C,x.Hooks.registered[w]){var k=x.Hooks.getRoot(w),A=i(h).rootPropertyValueCache[k];A&&(V.rootPropertyValue=A)}var F=x.setPropertyValue(h,w,V.currentValue+(0===parseFloat(C)?"":V.unitType),V.rootPropertyValue,V.scrollData);x.Hooks.registered[w]&&(i(h).rootPropertyValueCache[k]=x.Normalizations.registered[k]?x.Normalizations.registered[k]("extract",null,F[1]):F[1]),"transform"===F[0]&&(b=!0)}l.mobileHA&&i(h).transformCache.translate3d===a&&(i(h).transformCache.translate3d="(0px, 0px, 0px)",b=!0),b&&x.flushTransformCache(h)}}l.display!==a&&"none"!==l.display&&(v.State.calls[r][2].display=!1),l.visibility&&"hidden"!==l.visibility&&(v.State.calls[r][2].visibility=!1),l.progress&&l.progress.call(o[1],o[1],f,Math.max(0,u+l.duration-t),u),1===f&&p(r)}v.State.isTicking&&P(c)}function p(e,t){if(!v.State.calls[e])return!1;for(var r=v.State.calls[e][0],n=v.State.calls[e][1],o=v.State.calls[e][2],s=v.State.calls[e][4],l=!1,u=0,c=r.length;c>u;u++){var p=r[u].element;if(t||o.loop||("none"===o.display&&x.setPropertyValue(p,"display",o.display),"hidden"===o.visibility&&x.setPropertyValue(p,"visibility",o.visibility)),($.queue(p)[1]===a||!/\.velocityQueueEntryFlag/i.test($.queue(p)[1]))&&i(p)){i(p).isAnimating=!1,i(p).rootPropertyValueCache={};var f=!1;$.each(x.Lists.transforms3D,function(e,t){var r=/^scale/.test(t)?1:0,n=i(p).transformCache[t];i(p).transformCache[t]!==a&&new RegExp("^\\("+r+"[^.]").test(n)&&(f=!0,delete i(p).transformCache[t])}),o.mobileHA&&(f=!0,delete i(p).transformCache.translate3d),f&&x.flushTransformCache(p),x.Values.removeClass(p,"velocity-animating")}if(!t&&o.complete&&!o.loop&&u===c-1)try{o.complete.call(n,n)}catch(d){setTimeout(function(){throw d},1)}s&&o.loop!==!0&&s(n),o.loop!==!0||t||($.each(i(p).tweensContainer,function(e,t){/^rotate/.test(e)&&360===parseFloat(t.endValue)&&(t.endValue=0,t.startValue=360)}),v(p,"reverse",{loop:!0,delay:o.delay})),o.queue!==!1&&$.dequeue(p,o.queue)}v.State.calls[e]=!1;for(var g=0,m=v.State.calls.length;m>g;g++)if(v.State.calls[g]!==!1){l=!0;break}l===!1&&(v.State.isTicking=!1,delete v.State.calls,v.State.calls=[])}var f=function(){if(r.documentMode)return r.documentMode;for(var e=7;e>4;e--){var t=r.createElement("div");if(t.innerHTML="",t.getElementsByTagName("span").length)return t=null,e}return a}(),d=function(){var e=0;return t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||function(t){var r=(new Date).getTime(),a;return a=Math.max(0,16-(r-e)),e=r+a,setTimeout(function(){t(r+a)},a)}}(),g={isString:function(e){return"string"==typeof e},isArray:Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},isFunction:function(e){return"[object Function]"===Object.prototype.toString.call(e)},isNode:function(e){return e&&e.nodeType},isNodeList:function(e){return"object"==typeof e&&/^\[object (HTMLCollection|NodeList|Object)\]$/.test(Object.prototype.toString.call(e))&&e.length!==a&&(0===e.length||"object"==typeof e[0]&&e[0].nodeType>0)},isWrapped:function(e){return e&&(e.jquery||t.Zepto&&t.Zepto.zepto.isZ(e))},isSVG:function(e){return t.SVGElement&&e instanceof SVGElement},isEmptyObject:function(e){var t;for(t in e)return!1;return!0}},$,m=!1;if(e.fn&&e.fn.jquery?($=e,m=!0):$=t.Velocity.Utilities,8>=f&&!m)throw new Error("Velocity: IE8 and below require jQuery to be loaded before Velocity.");if(7>=f)return void(jQuery.fn.velocity=jQuery.fn.animate);var y=400,h="swing",v={State:{isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),isAndroid:/Android/i.test(navigator.userAgent),isGingerbread:/Android 2\.3\.[3-7]/i.test(navigator.userAgent),isChrome:t.chrome,isFirefox:/Firefox/i.test(navigator.userAgent),prefixElement:r.createElement("div"),prefixMatches:{},scrollAnchor:null,scrollPropertyLeft:null,scrollPropertyTop:null,isTicking:!1,calls:[]},CSS:{},Utilities:$,Sequences:{},Easings:{},Promise:t.Promise,defaults:{queue:"",duration:y,easing:h,begin:null,complete:null,progress:null,display:a,loop:!1,delay:!1,mobileHA:!0,_cacheValues:!0},init:function(e){$.data(e,"velocity",{isSVG:g.isSVG(e),isAnimating:!1,computedStyle:null,tweensContainer:null,rootPropertyValueCache:{},transformCache:{}})},animate:null,hook:null,mock:!1,version:{major:1,minor:0,patch:0},debug:!1};t.pageYOffset!==a?(v.State.scrollAnchor=t,v.State.scrollPropertyLeft="pageXOffset",v.State.scrollPropertyTop="pageYOffset"):(v.State.scrollAnchor=r.documentElement||r.body.parentNode||r.body,v.State.scrollPropertyLeft="scrollLeft",v.State.scrollPropertyTop="scrollTop");var b=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,r,a){var n={x:t.x+a.dx*r,v:t.v+a.dv*r,tension:t.tension,friction:t.friction};return{dx:n.v,dv:e(n)}}function r(r,a){var n={dx:r.v,dv:e(r)},o=t(r,.5*a,n),i=t(r,.5*a,o),s=t(r,a,i),l=1/6*(n.dx+2*(o.dx+i.dx)+s.dx),u=1/6*(n.dv+2*(o.dv+i.dv)+s.dv);return r.x=r.x+l*a,r.v=r.v+u*a,r}return function a(e,t,n){var o={x:-1,v:0,tension:null,friction:null},i=[0],s=0,l=1e-4,u=.016,c,p,f;for(e=parseFloat(e)||500,t=parseFloat(t)||20,n=n||null,o.tension=e,o.friction=t,c=null!==n,c?(s=a(e,t),p=s/n*u):p=u;;)if(f=r(f||o,p),i.push(1+f.x),s+=16,!(Math.abs(f.x)>l&&Math.abs(f.v)>l))break;return c?function(e){return i[e*(i.length-1)|0]}:s}}();v.Easings={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},spring:function(e){return 1-Math.cos(4.5*e*Math.PI)*Math.exp(6*-e)}},$.each([["ease",[.25,.1,.25,1]],["ease-in",[.42,0,1,1]],["ease-out",[0,0,.58,1]],["ease-in-out",[.42,0,.58,1]],["easeInSine",[.47,0,.745,.715]],["easeOutSine",[.39,.575,.565,1]],["easeInOutSine",[.445,.05,.55,.95]],["easeInQuad",[.55,.085,.68,.53]],["easeOutQuad",[.25,.46,.45,.94]],["easeInOutQuad",[.455,.03,.515,.955]],["easeInCubic",[.55,.055,.675,.19]],["easeOutCubic",[.215,.61,.355,1]],["easeInOutCubic",[.645,.045,.355,1]],["easeInQuart",[.895,.03,.685,.22]],["easeOutQuart",[.165,.84,.44,1]],["easeInOutQuart",[.77,0,.175,1]],["easeInQuint",[.755,.05,.855,.06]],["easeOutQuint",[.23,1,.32,1]],["easeInOutQuint",[.86,0,.07,1]],["easeInExpo",[.95,.05,.795,.035]],["easeOutExpo",[.19,1,.22,1]],["easeInOutExpo",[1,0,0,1]],["easeInCirc",[.6,.04,.98,.335]],["easeOutCirc",[.075,.82,.165,1]],["easeInOutCirc",[.785,.135,.15,.86]]],function(e,t){v.Easings[t[0]]=l.apply(null,t[1])});var x=v.CSS={RegEx:{isHex:/^#([A-f\d]{3}){1,2}$/i,valueUnwrap:/^[A-z]+\((.*)\)$/i,wrappedValueAlreadyExtracted:/[0-9.]+ [0-9.]+ [0-9.]+( [0-9.]+)?/,valueSplit:/([A-z]+\(.+\))|(([A-z0-9#-.]+?)(?=\s|$))/gi},Lists:{colors:["fill","stroke","stopColor","color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],transformsBase:["translateX","translateY","scale","scaleX","scaleY","skewX","skewY","rotateZ"],transforms3D:["transformPerspective","translateZ","scaleZ","rotateX","rotateY"]},Hooks:{templates:{textShadow:["Color X Y Blur","black 0px 0px 0px"],boxShadow:["Color X Y Blur Spread","black 0px 0px 0px 0px"],clip:["Top Right Bottom Left","0px 0px 0px 0px"],backgroundPosition:["X Y","0% 0%"],transformOrigin:["X Y Z","50% 50% 0px"],perspectiveOrigin:["X Y","50% 50%"]},registered:{},register:function(){for(var e=0;e=f)switch(e){case"name":return"filter";case"extract":var a=r.toString().match(/alpha\(opacity=(.*)\)/i);return r=a?a[1]/100:1;case"inject":return t.style.zoom=1,parseFloat(r)>=1?"":"alpha(opacity="+parseInt(100*parseFloat(r),10)+")"}else switch(e){case"name":return"opacity";case"extract":return r;case"inject":return r}}},register:function(){9>=f||v.State.isGingerbread||(x.Lists.transformsBase=x.Lists.transformsBase.concat(x.Lists.transforms3D));for(var e=0;en&&(n=1),o=!/(\d)$/i.test(n);break;case"skew":o=!/(deg|\d)$/i.test(n);break;case"rotate":o=!/(deg|\d)$/i.test(n)}return o||(i(r).transformCache[t]="("+n+")"),i(r).transformCache[t]}}}();for(var e=0;e=f||3!==o.split(" ").length||(o+=" 1"),o;case"inject":return 8>=f?4===n.split(" ").length&&(n=n.split(/\s+/).slice(0,3).join(" ")):3===n.split(" ").length&&(n+=" 1"),(8>=f?"rgb":"rgba")+"("+n.replace(/\s+/g,",").replace(/\.(\d)+(?=,)/g,"")+")"}}}()}},Names:{camelCase:function(e){return e.replace(/-(\w)/g,function(e,t){return t.toUpperCase()})},SVGAttribute:function(e){var t="width|height|x|y|cx|cy|r|rx|ry|x1|x2|y1|y2";return(f||v.State.isAndroid&&!v.State.isChrome)&&(t+="|transform"),new RegExp("^("+t+")$","i").test(e)},prefixCheck:function(e){if(v.State.prefixMatches[e])return[v.State.prefixMatches[e],!0];for(var t=["","Webkit","Moz","ms","O"],r=0,a=t.length;a>r;r++){var n;if(n=0===r?e:t[r]+e.replace(/^\w/,function(e){return e.toUpperCase()}),g.isString(v.State.prefixElement.style[n]))return v.State.prefixMatches[e]=n,[n,!0]}return[e,!1]}},Values:{hexToRgb:function(e){var t=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,a;return e=e.replace(t,function(e,t,r,a){return t+t+r+r+a+a}),a=r.exec(e),a?[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)]:[0,0,0]},isCSSNullValue:function(e){return 0==e||/^(none|auto|transparent|(rgba\(0, ?0, ?0, ?0\)))$/i.test(e)},getUnitType:function(e){return/^(rotate|skew)/i.test(e)?"deg":/(^(scale|scaleX|scaleY|scaleZ|alpha|flexGrow|flexHeight|zIndex|fontWeight)$)|((opacity|red|green|blue|alpha)$)/i.test(e)?"":"px"},getDisplayType:function(e){var t=e.tagName.toString().toLowerCase();return/^(b|big|i|small|tt|abbr|acronym|cite|code|dfn|em|kbd|strong|samp|var|a|bdo|br|img|map|object|q|script|span|sub|sup|button|input|label|select|textarea)$/i.test(t)?"inline":/^(li)$/i.test(t)?"list-item":/^(tr)$/i.test(t)?"table-row":"block"},addClass:function(e,t){e.classList?e.classList.add(t):e.className+=(e.className.length?" ":"")+t},removeClass:function(e,t){e.classList?e.classList.remove(t):e.className=e.className.toString().replace(new RegExp("(^|\\s)"+t.split(" ").join("|")+"(\\s|$)","gi")," ")}},getPropertyValue:function(e,r,n,o){function s(e,r){function n(){u&&x.setPropertyValue(e,"display","none")}var l=0;if(8>=f)l=$.css(e,r);else{var u=!1;if(/^(width|height)$/.test(r)&&0===x.getPropertyValue(e,"display")&&(u=!0,x.setPropertyValue(e,"display",x.Values.getDisplayType(e))),!o){if("height"===r&&"border-box"!==x.getPropertyValue(e,"boxSizing").toString().toLowerCase()){var c=e.offsetHeight-(parseFloat(x.getPropertyValue(e,"borderTopWidth"))||0)-(parseFloat(x.getPropertyValue(e,"borderBottomWidth"))||0)-(parseFloat(x.getPropertyValue(e,"paddingTop"))||0)-(parseFloat(x.getPropertyValue(e,"paddingBottom"))||0);return n(),c}if("width"===r&&"border-box"!==x.getPropertyValue(e,"boxSizing").toString().toLowerCase()){var p=e.offsetWidth-(parseFloat(x.getPropertyValue(e,"borderLeftWidth"))||0)-(parseFloat(x.getPropertyValue(e,"borderRightWidth"))||0)-(parseFloat(x.getPropertyValue(e,"paddingLeft"))||0)-(parseFloat(x.getPropertyValue(e,"paddingRight"))||0);return n(),p}}var d;d=i(e)===a?t.getComputedStyle(e,null):i(e).computedStyle?i(e).computedStyle:i(e).computedStyle=t.getComputedStyle(e,null),(f||v.State.isFirefox)&&"borderColor"===r&&(r="borderTopColor"),l=9===f&&"filter"===r?d.getPropertyValue(r):d[r],(""===l||null===l)&&(l=e.style[r]),n()}if("auto"===l&&/^(top|right|bottom|left)$/i.test(r)){var g=s(e,"position");("fixed"===g||"absolute"===g&&/top|left/i.test(r))&&(l=$(e).position()[r]+"px")}return l}var l;if(x.Hooks.registered[r]){var u=r,c=x.Hooks.getRoot(u);n===a&&(n=x.getPropertyValue(e,x.Names.prefixCheck(c)[0])),x.Normalizations.registered[c]&&(n=x.Normalizations.registered[c]("extract",e,n)),l=x.Hooks.extractValue(u,n)}else if(x.Normalizations.registered[r]){var p,d;p=x.Normalizations.registered[r]("name",e),"transform"!==p&&(d=s(e,x.Names.prefixCheck(p)[0]),x.Values.isCSSNullValue(d)&&x.Hooks.templates[r]&&(d=x.Hooks.templates[r][1])),l=x.Normalizations.registered[r]("extract",e,d)}return/^[\d-]/.test(l)||(l=i(e)&&i(e).isSVG&&x.Names.SVGAttribute(r)?/^(height|width)$/i.test(r)?e.getBBox()[r]:e.getAttribute(r):s(e,x.Names.prefixCheck(r)[0])),x.Values.isCSSNullValue(l)&&(l=0),v.debug>=2&&console.log("Get "+r+": "+l),l},setPropertyValue:function(e,r,a,n,o){var s=r;if("scroll"===r)o.container?o.container["scroll"+o.direction]=a:"Left"===o.direction?t.scrollTo(a,o.alternateValue):t.scrollTo(o.alternateValue,a);else if(x.Normalizations.registered[r]&&"transform"===x.Normalizations.registered[r]("name",e))x.Normalizations.registered[r]("inject",e,a),s="transform",a=i(e).transformCache[r];else{if(x.Hooks.registered[r]){var l=r,u=x.Hooks.getRoot(r);n=n||x.getPropertyValue(e,u),a=x.Hooks.injectValue(l,a,n),r=u}if(x.Normalizations.registered[r]&&(a=x.Normalizations.registered[r]("inject",e,a),r=x.Normalizations.registered[r]("name",e)),s=x.Names.prefixCheck(r)[0],8>=f)try{e.style[s]=a}catch(c){v.debug&&console.log("Browser does not support ["+a+"] for ["+s+"]")}else i(e)&&i(e).isSVG&&x.Names.SVGAttribute(r)?e.setAttribute(r,a):e.style[s]=a;v.debug>=2&&console.log("Set "+r+" ("+s+"): "+a)}return[s,a]},flushTransformCache:function(e){function t(t){return parseFloat(x.getPropertyValue(e,t))}var r="";if((f||v.State.isAndroid&&!v.State.isChrome)&&i(e).isSVG){var a={translate:[t("translateX"),t("translateY")],skewX:[t("skewX")],skewY:[t("skewY")],scale:1!==t("scale")?[t("scale"),t("scale")]:[t("scaleX"),t("scaleY")],rotate:[t("rotateZ"),0,0]};$.each(i(e).transformCache,function(e){/^translate/i.test(e)?e="translate":/^scale/i.test(e)?e="scale":/^rotate/i.test(e)&&(e="rotate"),a[e]&&(r+=e+"("+a[e].join(" ")+") ",delete a[e])})}else{var n,o;$.each(i(e).transformCache,function(t){return n=i(e).transformCache[t],"transformPerspective"===t?(o=n,!0):(9===f&&"rotateZ"===t&&(t="rotate"),void(r+=t+n+" "))}),o&&(r="perspective"+o+" "+r)}x.setPropertyValue(e,"transform",r)}};x.Hooks.register(),x.Normalizations.register(),v.hook=function(e,t,r){var n=a;return e=o(e),$.each(e,function(e,o){if(i(o)===a&&v.init(o),r===a)n===a&&(n=v.CSS.getPropertyValue(o,t));else{var s=v.CSS.setPropertyValue(o,t,r);"transform"===s[0]&&v.CSS.flushTransformCache(o),n=s}}),n};var S=function(){function e(){return f?k.promise||null:d}function s(){function e(e){function f(e,t){var r=a,n=a,i=a;return g.isArray(e)?(r=e[0],!g.isArray(e[1])&&/^[\d-]/.test(e[1])||g.isFunction(e[1])||x.RegEx.isHex.test(e[1])?i=e[1]:(g.isString(e[1])&&!x.RegEx.isHex.test(e[1])||g.isArray(e[1]))&&(n=t?e[1]:u(e[1],s.duration),e[2]!==a&&(i=e[2]))):r=e,t||(n=n||s.easing),g.isFunction(r)&&(r=r.call(o,V,w)),g.isFunction(i)&&(i=i.call(o,V,w)),[r||0,n,i]}function d(e,t){var r,a;return a=(t||0).toString().toLowerCase().replace(/[%A-z]+$/,function(e){return r=e,""}),r||(r=x.Values.getUnitType(e)),[a,r]}function m(){var e={myParent:o.parentNode||r.body,position:x.getPropertyValue(o,"position"),fontSize:x.getPropertyValue(o,"fontSize")},a=e.position===L.lastPosition&&e.myParent===L.lastParent,n=e.fontSize===L.lastFontSize;L.lastParent=e.myParent,L.lastPosition=e.position,L.lastFontSize=e.fontSize;var s=100,l={};if(n&&a)l.emToPx=L.lastEmToPx,l.percentToPxWidth=L.lastPercentToPxWidth,l.percentToPxHeight=L.lastPercentToPxHeight;else{var u=i(o).isSVG?r.createElementNS("http://www.w3.org/2000/svg","rect"):r.createElement("div");v.init(u),e.myParent.appendChild(u),$.each(["overflow","overflowX","overflowY"],function(e,t){v.CSS.setPropertyValue(u,t,"hidden")}),v.CSS.setPropertyValue(u,"position",e.position),v.CSS.setPropertyValue(u,"fontSize",e.fontSize),v.CSS.setPropertyValue(u,"boxSizing","content-box"),$.each(["minWidth","maxWidth","width","minHeight","maxHeight","height"],function(e,t){v.CSS.setPropertyValue(u,t,s+"%")}),v.CSS.setPropertyValue(u,"paddingLeft",s+"em"),l.percentToPxWidth=L.lastPercentToPxWidth=(parseFloat(x.getPropertyValue(u,"width",null,!0))||1)/s,l.percentToPxHeight=L.lastPercentToPxHeight=(parseFloat(x.getPropertyValue(u,"height",null,!0))||1)/s,l.emToPx=L.lastEmToPx=(parseFloat(x.getPropertyValue(u,"paddingLeft"))||1)/s,e.myParent.removeChild(u)}return null===L.remToPx&&(L.remToPx=parseFloat(x.getPropertyValue(r.body,"fontSize"))||16),null===L.vwToPx&&(L.vwToPx=parseFloat(t.innerWidth)/100,L.vhToPx=parseFloat(t.innerHeight)/100),l.remToPx=L.remToPx,l.vwToPx=L.vwToPx,l.vhToPx=L.vhToPx,v.debug>=1&&console.log("Unit ratios: "+JSON.stringify(l),o),l}if(s.begin&&0===V)try{s.begin.call(h,h)}catch(y){setTimeout(function(){throw y},1)}if("scroll"===A){var S=/^x$/i.test(s.axis)?"Left":"Top",C=parseFloat(s.offset)||0,T,F,E;s.container?g.isWrapped(s.container)||g.isNode(s.container)?(s.container=s.container[0]||s.container,T=s.container["scroll"+S],E=T+$(o).position()[S.toLowerCase()]+C):s.container=null:(T=v.State.scrollAnchor[v.State["scrollProperty"+S]],F=v.State.scrollAnchor[v.State["scrollProperty"+("Left"===S?"Top":"Left")]],E=$(o).offset()[S.toLowerCase()]+C),l={scroll:{rootPropertyValue:!1,startValue:T,currentValue:T,endValue:E,unitType:"",easing:s.easing,scrollData:{container:s.container,direction:S,alternateValue:F}},element:o},v.debug&&console.log("tweensContainer (scroll): ",l.scroll,o)}else if("reverse"===A){if(!i(o).tweensContainer)return void $.dequeue(o,s.queue);"none"===i(o).opts.display&&(i(o).opts.display="auto"),"hidden"===i(o).opts.visibility&&(i(o).opts.visibility="visible"),i(o).opts.loop=!1,i(o).opts.begin=null,i(o).opts.complete=null,P.easing||delete s.easing,P.duration||delete s.duration,s=$.extend({},i(o).opts,s);var j=$.extend(!0,{},i(o).tweensContainer);for(var H in j)if("element"!==H){var N=j[H].startValue;j[H].startValue=j[H].currentValue=j[H].endValue,j[H].endValue=N,g.isEmptyObject(P)||(j[H].easing=s.easing),v.debug&&console.log("reverse tweensContainer ("+H+"): "+JSON.stringify(j[H]),o)}l=j}else if("start"===A){var j;i(o).tweensContainer&&i(o).isAnimating===!0&&(j=i(o).tweensContainer),$.each(b,function(e,t){if(RegExp("^"+x.Lists.colors.join("$|^")+"$").test(e)){var r=f(t,!0),n=r[0],o=r[1],i=r[2];if(x.RegEx.isHex.test(n)){for(var s=["Red","Green","Blue"],l=x.Values.hexToRgb(n),u=i?x.Values.hexToRgb(i):a,c=0;c1e4&&(v.State.calls=n(v.State.calls)),v.State.calls.push([O,h,s,null,k.resolver]),v.State.isTicking===!1&&(v.State.isTicking=!0,c())):V++)}var o=this,s=$.extend({},v.defaults,P),l={},p;if(i(o)===a&&v.init(o),parseFloat(s.delay)&&s.queue!==!1&&$.queue(o,s.queue,function(e){v.velocityQueueEntryFlag=!0,i(o).delayTimer={setTimeout:setTimeout(e,parseFloat(s.delay)),next:e}}),v.mock===!0)s.duration=1;else switch(s.duration.toString().toLowerCase()){case"fast":s.duration=200;break;case"normal":s.duration=y;break;case"slow":s.duration=600;break;default:s.duration=parseFloat(s.duration)||1}s.easing=u(s.easing,s.duration),s.begin&&!g.isFunction(s.begin)&&(s.begin=null),s.progress&&!g.isFunction(s.progress)&&(s.progress=null),s.complete&&!g.isFunction(s.complete)&&(s.complete=null),s.display!==a&&null!==s.display&&(s.display=s.display.toString().toLowerCase(),"auto"===s.display&&(s.display=v.CSS.Values.getDisplayType(o))),s.visibility&&(s.visibility=s.visibility.toString().toLowerCase()),s.mobileHA=s.mobileHA&&v.State.isMobile&&!v.State.isGingerbread,s.queue===!1?s.delay?setTimeout(e,s.delay):e():$.queue(o,s.queue,function(t,r){return r===!0?(k.promise&&k.resolver(h),!0):(v.velocityQueueEntryFlag=!0,void e(t))}),""!==s.queue&&"fx"!==s.queue||"inprogress"===$.queue(o)[0]||$.dequeue(o)}var l=arguments[0]&&($.isPlainObject(arguments[0].properties)&&!arguments[0].properties.names||g.isString(arguments[0].properties)),f,d,m,h,b,P;if(g.isWrapped(this)?(f=!1,m=0,h=this,d=this):(f=!0,m=1,h=l?arguments[0].elements:arguments[0]),h=o(h)){l?(b=arguments[0].properties,P=arguments[0].options):(b=arguments[m],P=arguments[m+1]);var w=h.length,V=0;if("stop"!==b&&!$.isPlainObject(P)){var C=m+1;P={};for(var T=C;Tq;q++){var R={delay:E.delay};q===z-1&&(R.display=E.display,R.visibility=E.visibility,R.complete=E.complete),S(h,"reverse",R)}return e()}};v=$.extend(S,v),v.animate=S;var P=t.requestAnimationFrame||d;return v.State.isMobile||r.hidden===a||r.addEventListener("visibilitychange",function(){r.hidden?(P=function(e){return setTimeout(function(){e(!0)},16)},c()):P=t.requestAnimationFrame||d}),e.Velocity=v,e!==t&&(e.fn.velocity=S,e.fn.velocity.defaults=v.defaults),$.each(["Down","Up"],function(e,t){v.Sequences["slide"+t]=function(e,r,n,o,i,s){var l=$.extend({},r),u=l.begin,c=l.complete,p={height:"",marginTop:"",marginBottom:"",paddingTop:"",paddingBottom:""},f={};l.display===a&&(l.display="Down"===t?"inline"===v.CSS.Values.getDisplayType(e)?"inline-block":"block":"none"),l.begin=function(){u&&u.call(i,i),f.overflow=e.style.overflow,e.style.overflow="hidden";for(var r in p){f[r]=e.style[r];var a=v.CSS.getPropertyValue(e,r);p[r]="Down"===t?[a,0]:[0,a]}},l.complete=function(){for(var t in f)e.style[t]=f[t];c&&c.call(i,i),s&&s.resolver(i)},v(e,p,l)}}),$.each(["In","Out"],function(e,t){v.Sequences["fade"+t]=function(e,r,n,o,i,s){var l=$.extend({},r),u={opacity:"In"===t?1:0},c=l.complete;l.complete=n!==o-1?l.begin=null:function(){c&&c.call(i,i),s&&s.resolver(i)},l.display===a&&(l.display="In"===t?"auto":"none"),v(this,u,l)}}),v}(window.jQuery||window.Zepto||window,window,document)}); \ No newline at end of file diff --git a/app/assets/javascripts/app/lib/animations/velocity.ui.js b/app/assets/javascripts/app/lib/animations/velocity.ui.js new file mode 100644 index 000000000..2f4aee8ef --- /dev/null +++ b/app/assets/javascripts/app/lib/animations/velocity.ui.js @@ -0,0 +1,672 @@ +/********************** + Velocity UI Pack +**********************/ + +/* VelocityJS.org UI Pack (4.1.4). (C) 2014 Julian Shapiro. MIT @license: en.wikipedia.org/wiki/MIT_License. Portions copyright Daniel Eden, Christian Pucci. */ + +;(function (factory) { + /* CommonJS module. */ + if (typeof module === "object" && typeof module.exports === "object") { + module.exports = factory(); + /* AMD module. */ + } else if (typeof define === "function" && define.amd) { + define([ "velocity" ], factory); + /* Browser globals. */ + } else { + factory(); + } +}(function() { +return function (global, window, document, undefined) { + + /************** + Checks + **************/ + + if (!global.Velocity || !global.Velocity.Utilities) { + window.console && console.log("Velocity UI Pack: Velocity must be loaded first. Aborting."); + return; + } else if (!global.Velocity.version || (global.Velocity.version.major <= 0 && global.Velocity.version.minor <= 11 && global.Velocity.version.patch < 8)) { + var abortError = "Velocity UI Pack: You need to update Velocity (jquery.velocity.js) to a newer version. Visit http://github.com/julianshapiro/velocity."; + + alert(abortError); + throw new Error(abortError); + } + + /****************** + Register UI + ******************/ + + global.Velocity.RegisterUI = function (effectName, properties) { + /* Animate the expansion/contraction of the elements' parent's height for In/Out effects. */ + function animateParentHeight (elements, direction, totalDuration, stagger) { + var totalHeightDelta = 0, + parentNode; + + /* Sum the total height (including padding and margin) of all targeted elements. */ + global.Velocity.Utilities.each(elements.nodeType ? [ elements ] : elements, function(i, element) { + if (stagger) { + /* Increase the totalDuration by the successive delay amounts produced by the stagger option. */ + totalDuration += i * stagger; + } + + parentNode = element.parentNode; + + global.Velocity.Utilities.each([ "height", "paddingTop", "paddingBottom", "marginTop", "marginBottom"], function(i, property) { + totalHeightDelta += parseFloat(global.Velocity.CSS.getPropertyValue(element, property)); + }); + }); + + /* Animate the parent element's height adjustment (with a varying duration multiplier for aesthetic benefits). */ + global.Velocity.animate( + parentNode, + { height: (direction === "In" ? "+" : "-") + "=" + totalHeightDelta }, + { queue: false, easing: "ease-in-out", duration: totalDuration * (direction === "In" ? 0.6 : 1) } + ); + } + + /* Register a custom sequence for each effect. */ + global.Velocity.Sequences[effectName] = function (element, sequenceOptions, elementsIndex, elementsSize, elements, promiseData) { + var finalElement = (elementsIndex === elementsSize - 1); + + /* Iterate through each effect's call array. */ + for (var callIndex = 0; callIndex < properties.calls.length; callIndex++) { + var call = properties.calls[callIndex], + propertyMap = call[0], + sequenceDuration = (sequenceOptions.duration || properties.defaultDuration || 1000), + durationPercentage = call[1], + callOptions = call[2] || {}, + opts = {}; + + /* Assign the whitelisted per-call options. */ + opts.duration = sequenceDuration * (durationPercentage || 1); + opts.queue = sequenceOptions.queue || ""; + opts.easing = callOptions.easing || "ease"; + opts.delay = callOptions.delay || 0; + opts._cacheValues = callOptions._cacheValues || true; + + /* Special processing for the first effect call. */ + if (callIndex === 0) { + /* If a delay was passed into the sequence, combine it with the first call's delay. */ + opts.delay += (sequenceOptions.delay || 0); + + if (elementsIndex === 0) { + opts.begin = function() { + /* Only trigger a begin callback on the first effect call with the first element in the set. */ + sequenceOptions.begin && sequenceOptions.begin.call(elements, elements); + + /* Only trigger animateParentHeight() if we're using an In/Out transition. */ + var direction = effectName.match(/(In|Out)$/); + if (sequenceOptions.animateParentHeight && direction) { + animateParentHeight(elements, direction[0], sequenceDuration + opts.delay, sequenceOptions.stagger); + } + } + } + + /* If the user isn't overriding the display option, default to "auto" for "In"-suffixed transitions. */ + if (sequenceOptions.display !== null) { + if (sequenceOptions.display !== undefined && sequenceOptions.display !== "none") { + opts.display = sequenceOptions.display; + } else if (/In$/.test(effectName)) { + /* Inline elements cannot be subjected to transforms, so we switch them to inline-block. */ + var defaultDisplay = global.Velocity.CSS.Values.getDisplayType(element); + opts.display = (defaultDisplay === "inline") ? "inline-block" : defaultDisplay; + } + } + + if (sequenceOptions.visibility && sequenceOptions.visibility !== "hidden") { + opts.visibility = sequenceOptions.visibility; + } + } + + /* Special processing for the last effect call. */ + if (callIndex === properties.calls.length - 1) { + /* Append promise resolving onto the user's sequence callback. */ + function injectFinalCallbacks () { + if ((sequenceOptions.display === undefined || sequenceOptions.display === "none") && /Out$/.test(effectName)) { + global.Velocity.Utilities.each(elements.nodeType ? [ elements ] : elements, function(i, element) { + global.Velocity.CSS.setPropertyValue(element, "display", "none"); + }); + } + + sequenceOptions.complete && sequenceOptions.complete.call(elements, elements); + + if (promiseData) { + promiseData.resolver(elements || element); + } + } + + opts.complete = function() { + if (properties.reset) { + for (var resetProperty in properties.reset) { + var resetValue = properties.reset[resetProperty]; + + /* Format each non-array value in the reset property map to [ value, value ] so that changes apply + immediately and DOM querying is avoided (via forcefeeding). */ + if (typeof resetValue === "string" || typeof resetValue === "number") { + properties.reset[resetProperty] = [ properties.reset[resetProperty], properties.reset[resetProperty] ]; + } + } + + /* So that the reset values are applied instantly upon the next rAF tick, use a zero duration and parallel queueing. */ + var resetOptions = { duration: 0, queue: false }; + + /* Since the reset option uses up the complete callback, we trigger the user's complete callback at the end of ours. */ + if (finalElement) { + resetOptions.complete = injectFinalCallbacks; + } + + global.Velocity.animate(element, properties.reset, resetOptions); + /* Only trigger the user's complete callback on the last effect call with the last element in the set. */ + } else if (finalElement) { + injectFinalCallbacks(); + } + }; + + if (sequenceOptions.visibility === "hidden") { + opts.visibility = sequenceOptions.visibility; + } + } + + global.Velocity.animate(element, propertyMap, opts); + } + }; + + /* Return the Velocity object so that RegisterUI calls can be chained. */ + return global.Velocity; + }; + + /********************* + Packaged Effects + *********************/ + + /* Externalize the packagedEffects data so that they can optionally be modified and re-registered. */ + /* Support: <=IE8: Callouts will have no effect, and transitions will simply fade in/out. IE9/Android 2.3: Most effects are fully supported, the rest fade in/out. All other browsers: full support. */ + global.Velocity.RegisterUI.packagedEffects = + { + /* Animate.css */ + "callout.bounce": { + defaultDuration: 550, + calls: [ + [ { translateY: -30 }, 0.25 ], + [ { translateY: 0 }, 0.125 ], + [ { translateY: -15 }, 0.125 ], + [ { translateY: 0 }, 0.25 ] + ] + }, + /* Animate.css */ + "callout.shake": { + defaultDuration: 800, + calls: [ + [ { translateX: -11 }, 0.125 ], + [ { translateX: 11 }, 0.125 ], + [ { translateX: -11 }, 0.125 ], + [ { translateX: 11 }, 0.125 ], + [ { translateX: -11 }, 0.125 ], + [ { translateX: 11 }, 0.125 ], + [ { translateX: -11 }, 0.125 ], + [ { translateX: 0 }, 0.125 ] + ] + }, + /* Animate.css */ + "callout.flash": { + defaultDuration: 1100, + calls: [ + [ { opacity: [ 0, "easeInOutQuad", 1 ] }, 0.25 ], + [ { opacity: [ 1, "easeInOutQuad" ] }, 0.25 ], + [ { opacity: [ 0, "easeInOutQuad" ] }, 0.25 ], + [ { opacity: [ 1, "easeInOutQuad" ] }, 0.25 ] + ] + }, + /* Animate.css */ + "callout.pulse": { + defaultDuration: 825, + calls: [ + [ { scaleX: 1.1, scaleY: 1.1 }, 0.50 ], + [ { scaleX: 1, scaleY: 1 }, 0.50 ] + ] + }, + /* Animate.css */ + "callout.swing": { + defaultDuration: 950, + calls: [ + [ { rotateZ: 15 }, 0.20 ], + [ { rotateZ: -10 }, 0.20 ], + [ { rotateZ: 5 }, 0.20 ], + [ { rotateZ: -5 }, 0.20 ], + [ { rotateZ: 0 }, 0.20 ] + ] + }, + /* Animate.css */ + "callout.tada": { + defaultDuration: 1000, + calls: [ + [ { scaleX: 0.9, scaleY: 0.9, rotateZ: -3 }, 0.10 ], + [ { scaleX: 1.1, scaleY: 1.1, rotateZ: 3 }, 0.10 ], + [ { scaleX: 1.1, scaleY: 1.1, rotateZ: -3 }, 0.10 ], + [ "reverse", 0.125 ], + [ "reverse", 0.125 ], + [ "reverse", 0.125 ], + [ "reverse", 0.125 ], + [ "reverse", 0.125 ], + [ { scaleX: 1, scaleY: 1, rotateZ: 0 }, 0.20 ] + ] + }, + "transition.fadeIn": { + defaultDuration: 500, + calls: [ + [ { opacity: [ 1, 0 ] } ] + ] + }, + "transition.fadeOut": { + defaultDuration: 500, + calls: [ + [ { opacity: [ 0, 1 ] } ] + ] + }, + /* Support: Loses rotation in IE9/Android 2.3 (fades only). */ + "transition.flipXIn": { + defaultDuration: 700, + calls: [ + [ { opacity: [ 1, 0 ], transformPerspective: [ 800, 800 ], rotateY: [ 0, -55 ] } ] + ], + reset: { transformPerspective: 0 } + }, + /* Support: Loses rotation in IE9/Android 2.3 (fades only). */ + "transition.flipXOut": { + defaultDuration: 700, + calls: [ + [ { opacity: [ 0, 1 ], transformPerspective: [ 800, 800 ], rotateY: 55 } ] + ], + reset: { transformPerspective: 0, rotateY: 0 } + }, + /* Support: Loses rotation in IE9/Android 2.3 (fades only). */ + "transition.flipYIn": { + defaultDuration: 800, + calls: [ + [ { opacity: [ 1, 0 ], transformPerspective: [ 800, 800 ], rotateX: [ 0, -45 ] } ] + ], + reset: { transformPerspective: 0 } + }, + /* Support: Loses rotation in IE9/Android 2.3 (fades only). */ + "transition.flipYOut": { + defaultDuration: 800, + calls: [ + [ { opacity: [ 0, 1 ], transformPerspective: [ 800, 800 ], rotateX: 25 } ] + ], + reset: { transformPerspective: 0, rotateX: 0 } + }, + /* Animate.css */ + /* Support: Loses rotation in IE9/Android 2.3 (fades only). */ + "transition.flipBounceXIn": { + defaultDuration: 900, + calls: [ + [ { opacity: [ 0.725, 0 ], transformPerspective: [ 400, 400 ], rotateY: [ -10, 90 ] }, 0.50 ], + [ { opacity: 0.80, rotateY: 10 }, 0.25 ], + [ { opacity: 1, rotateY: 0 }, 0.25 ] + ], + reset: { transformPerspective: 0 } + }, + /* Animate.css */ + /* Support: Loses rotation in IE9/Android 2.3 (fades only). */ + "transition.flipBounceXOut": { + defaultDuration: 800, + calls: [ + [ { opacity: [ 0.9, 1 ], transformPerspective: [ 400, 400 ], rotateY: -10 }, 0.50 ], + [ { opacity: 0, rotateY: 90 }, 0.50 ] + ], + reset: { transformPerspective: 0, rotateY: 0 } + }, + /* Animate.css */ + /* Support: Loses rotation in IE9/Android 2.3 (fades only). */ + "transition.flipBounceYIn": { + defaultDuration: 850, + calls: [ + [ { opacity: [ 0.725, 0 ], transformPerspective: [ 400, 400 ], rotateX: [ -10, 90 ] }, 0.50 ], + [ { opacity: 0.80, rotateX: 10 }, 0.25 ], + [ { opacity: 1, rotateX: 0 }, 0.25 ] + ], + reset: { transformPerspective: 0 } + }, + /* Animate.css */ + /* Support: Loses rotation in IE9/Android 2.3 (fades only). */ + "transition.flipBounceYOut": { + defaultDuration: 800, + calls: [ + [ { opacity: [ 0.9, 1 ], transformPerspective: [ 400, 400 ], rotateX: -15 }, 0.50 ], + [ { opacity: 0, rotateX: 90 }, 0.50 ] + ], + reset: { transformPerspective: 0, rotateX: 0 } + }, + /* Magic.css */ + "transition.swoopIn": { + defaultDuration: 850, + calls: [ + [ { opacity: [ 1, 0 ], transformOriginX: [ "100%", "50%" ], transformOriginY: [ "100%", "100%" ], scaleX: [ 1, 0 ], scaleY: [ 1, 0 ], translateX: [ 0, -700 ], translateZ: 0 } ] + ], + reset: { transformOriginX: "50%", transformOriginY: "50%" } + }, + /* Magic.css */ + "transition.swoopOut": { + defaultDuration: 850, + calls: [ + [ { opacity: [ 0, 1 ], transformOriginX: [ "50%", "100%" ], transformOriginY: [ "100%", "100%" ], scaleX: 0, scaleY: 0, translateX: -700, translateZ: 0 } ] + ], + reset: { transformOriginX: "50%", transformOriginY: "50%", scaleX: 1, scaleY: 1, translateX: 0 } + }, + /* Magic.css */ + /* Support: Loses rotation in IE9/Android 2.3. (Fades and scales only.) */ + "transition.whirlIn": { + defaultDuration: 900, + calls: [ + [ { opacity: [ 1, 0 ], transformOriginX: [ "50%", "50%" ], transformOriginY: [ "50%", "50%" ], scaleX: [ 1, 0 ], scaleY: [ 1, 0 ], rotateY: [ 0, 160 ] } ] + ] + }, + /* Magic.css */ + /* Support: Loses rotation in IE9/Android 2.3. (Fades and scales only.) */ + "transition.whirlOut": { + defaultDuration: 900, + calls: [ + [ { opacity: [ 0, 1 ], transformOriginX: [ "50%", "50%" ], transformOriginY: [ "50%", "50%" ], scaleX: 0, scaleY: 0, rotateY: 160 } ] + ], + reset: { scaleX: 1, scaleY: 1, rotateY: 0 } + }, + "transition.shrinkIn": { + defaultDuration: 700, + calls: [ + [ { opacity: [ 1, 0 ], transformOriginX: [ "50%", "50%" ], transformOriginY: [ "50%", "50%" ], scaleX: [ 1, 1.5 ], scaleY: [ 1, 1.5 ], translateZ: 0 } ] + ] + }, + "transition.shrinkOut": { + defaultDuration: 650, + calls: [ + [ { opacity: [ 0, 1 ], transformOriginX: [ "50%", "50%" ], transformOriginY: [ "50%", "50%" ], scaleX: 1.3, scaleY: 1.3, translateZ: 0 } ] + ], + reset: { scaleX: 1, scaleY: 1 } + }, + "transition.expandIn": { + defaultDuration: 700, + calls: [ + [ { opacity: [ 1, 0 ], transformOriginX: [ "50%", "50%" ], transformOriginY: [ "50%", "50%" ], scaleX: [ 1, 0.625 ], scaleY: [ 1, 0.625 ], translateZ: 0 } ] + ] + }, + "transition.expandOut": { + defaultDuration: 700, + calls: [ + [ { opacity: [ 0, 1 ], transformOriginX: [ "50%", "50%" ], transformOriginY: [ "50%", "50%" ], scaleX: 0.5, scaleY: 0.5, translateZ: 0 } ] + ], + reset: { scaleX: 1, scaleY: 1 } + }, + /* Animate.css */ + "transition.bounceIn": { + defaultDuration: 800, + calls: [ + [ { opacity: [ 1, 0 ], scaleX: [ 1.05, 0.3 ], scaleY: [ 1.05, 0.3 ] }, 0.40 ], + [ { scaleX: 0.9, scaleY: 0.9, translateZ: 0 }, 0.20 ], + [ { scaleX: 1, scaleY: 1 }, 0.50 ] + ] + }, + /* Animate.css */ + "transition.bounceOut": { + defaultDuration: 800, + calls: [ + [ { scaleX: 0.95, scaleY: 0.95 }, 0.40 ], + [ { scaleX: 1.1, scaleY: 1.1, translateZ: 0 }, 0.40 ], + [ { opacity: [ 0, 1 ], scaleX: 0.3, scaleY: 0.3 }, 0.20 ] + ], + reset: { scaleX: 1, scaleY: 1 } + }, + /* Animate.css */ + "transition.bounceUpIn": { + defaultDuration: 800, + calls: [ + [ { opacity: [ 1, 0 ], translateY: [ -30, 1000 ] }, 0.60, { easing: "easeOutCirc" } ], + [ { translateY: 10 }, 0.20 ], + [ { translateY: 0 }, 0.20 ] + ] + }, + /* Animate.css */ + "transition.bounceUpOut": { + defaultDuration: 1000, + calls: [ + [ { translateY: 20 }, 0.20 ], + [ { opacity: [ 0, "easeInCirc", 1 ], translateY: -1000 }, 0.80 ] + ], + reset: { translateY: 0 } + }, + /* Animate.css */ + "transition.bounceDownIn": { + defaultDuration: 800, + calls: [ + [ { opacity: [ 1, 0 ], translateY: [ 30, -1000 ] }, 0.60, { easing: "easeOutCirc" } ], + [ { translateY: -10 }, 0.20 ], + [ { translateY: 0 }, 0.20 ] + ] + }, + /* Animate.css */ + "transition.bounceDownOut": { + defaultDuration: 1000, + calls: [ + [ { translateY: -20 }, 0.20 ], + [ { opacity: [ 0, "easeInCirc", 1 ], translateY: 1000 }, 0.80 ] + ], + reset: { translateY: 0 } + }, + /* Animate.css */ + "transition.bounceLeftIn": { + defaultDuration: 750, + calls: [ + [ { opacity: [ 1, 0 ], translateX: [ 30, -1250 ] }, 0.60, { easing: "easeOutCirc" } ], + [ { translateX: -10 }, 0.20 ], + [ { translateX: 0 }, 0.20 ] + ] + }, + /* Animate.css */ + "transition.bounceLeftOut": { + defaultDuration: 750, + calls: [ + [ { translateX: 30 }, 0.20 ], + [ { opacity: [ 0, "easeInCirc", 1 ], translateX: -1250 }, 0.80 ] + ], + reset: { translateX: 0 } + }, + /* Animate.css */ + "transition.bounceRightIn": { + defaultDuration: 750, + calls: [ + [ { opacity: [ 1, 0 ], translateX: [ -30, 1250 ] }, 0.60, { easing: "easeOutCirc" } ], + [ { translateX: 10 }, 0.20 ], + [ { translateX: 0 }, 0.20 ] + ] + }, + /* Animate.css */ + "transition.bounceRightOut": { + defaultDuration: 750, + calls: [ + [ { translateX: -30 }, 0.20 ], + [ { opacity: [ 0, "easeInCirc", 1 ], translateX: 1250 }, 0.80 ] + ], + reset: { translateX: 0 } + }, + "transition.slideUpIn": { + defaultDuration: 900, + calls: [ + [ { opacity: [ 1, 0 ], translateY: [ 0, 20 ], translateZ: 0 } ] + ] + }, + "transition.slideUpOut": { + defaultDuration: 900, + calls: [ + [ { opacity: [ 0, 1 ], translateY: -20, translateZ: 0 } ] + ], + reset: { translateY: 0 } + }, + "transition.slideDownIn": { + defaultDuration: 900, + calls: [ + [ { opacity: [ 1, 0 ], translateY: [ 0, -20 ], translateZ: 0 } ] + ] + }, + "transition.slideDownOut": { + defaultDuration: 900, + calls: [ + [ { opacity: [ 0, 1 ], translateY: 20, translateZ: 0 } ] + ], + reset: { translateY: 0 } + }, + "transition.slideLeftIn": { + defaultDuration: 1000, + calls: [ + [ { opacity: [ 1, 0 ], translateX: [ 0, -20 ], translateZ: 0 } ] + ] + }, + "transition.slideLeftOut": { + defaultDuration: 1050, + calls: [ + [ { opacity: [ 0, 1 ], translateX: -20, translateZ: 0 } ] + ], + reset: { translateX: 0 } + }, + "transition.slideRightIn": { + defaultDuration: 1000, + calls: [ + [ { opacity: [ 1, 0 ], translateX: [ 0, 20 ], translateZ: 0 } ] + ] + }, + "transition.slideRightOut": { + defaultDuration: 1050, + calls: [ + [ { opacity: [ 0, 1 ], translateX: 20, translateZ: 0 } ] + ], + reset: { translateX: 0 } + }, + "transition.slideUpBigIn": { + defaultDuration: 850, + calls: [ + [ { opacity: [ 1, 0 ], translateY: [ 0, 75 ], translateZ: 0 } ] + ] + }, + "transition.slideUpBigOut": { + defaultDuration: 800, + calls: [ + [ { opacity: [ 0, 1 ], translateY: -75, translateZ: 0 } ] + ], + reset: { translateY: 0 } + }, + "transition.slideDownBigIn": { + defaultDuration: 850, + calls: [ + [ { opacity: [ 1, 0 ], translateY: [ 0, -75 ], translateZ: 0 } ] + ] + }, + "transition.slideDownBigOut": { + defaultDuration: 800, + calls: [ + [ { opacity: [ 0, 1 ], translateY: 75, translateZ: 0 } ] + ], + reset: { translateY: 0 } + }, + "transition.slideLeftBigIn": { + defaultDuration: 800, + calls: [ + [ { opacity: [ 1, 0 ], translateX: [ 0, -75 ], translateZ: 0 } ] + ] + }, + "transition.slideLeftBigOut": { + defaultDuration: 750, + calls: [ + [ { opacity: [ 0, 1 ], translateX: -75, translateZ: 0 } ] + ], + reset: { translateX: 0 } + }, + "transition.slideRightBigIn": { + defaultDuration: 800, + calls: [ + [ { opacity: [ 1, 0 ], translateX: [ 0, 75 ], translateZ: 0 } ] + ] + }, + "transition.slideRightBigOut": { + defaultDuration: 750, + calls: [ + [ { opacity: [ 0, 1 ], translateX: 75, translateZ: 0 } ] + ], + reset: { translateX: 0 } + }, + /* Magic.css */ + "transition.perspectiveUpIn": { + defaultDuration: 800, + calls: [ + [ { opacity: [ 1, 0 ], transformPerspective: [ 800, 800 ], transformOriginX: [ 0, 0 ], transformOriginY: [ "100%", "100%" ], rotateX: [ 0, -180 ] } ] + ], + reset: { transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%" } + }, + /* Magic.css */ + /* Support: Loses rotation in IE9/Android 2.3 (fades only). */ + "transition.perspectiveUpOut": { + defaultDuration: 850, + calls: [ + [ { opacity: [ 0, 1 ], transformPerspective: [ 800, 800 ], transformOriginX: [ 0, 0 ], transformOriginY: [ "100%", "100%" ], rotateX: -180 } ] + ], + reset: { transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%", rotateX: 0 } + }, + /* Magic.css */ + /* Support: Loses rotation in IE9/Android 2.3 (fades only). */ + "transition.perspectiveDownIn": { + defaultDuration: 800, + calls: [ + [ { opacity: [ 1, 0 ], transformPerspective: [ 800, 800 ], transformOriginX: [ 0, 0 ], transformOriginY: [ 0, 0 ], rotateX: [ 0, 180 ] } ] + ], + reset: { transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%" } + }, + /* Magic.css */ + /* Support: Loses rotation in IE9/Android 2.3 (fades only). */ + "transition.perspectiveDownOut": { + defaultDuration: 850, + calls: [ + [ { opacity: [ 0, 1 ], transformPerspective: [ 800, 800 ], transformOriginX: [ 0, 0 ], transformOriginY: [ 0, 0 ], rotateX: 180 } ] + ], + reset: { transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%", rotateX: 0 } + }, + /* Magic.css */ + /* Support: Loses rotation in IE9/Android 2.3 (fades only). */ + "transition.perspectiveLeftIn": { + defaultDuration: 950, + calls: [ + [ { opacity: [ 1, 0 ], transformPerspective: [ 2000, 2000 ], transformOriginX: [ 0, 0 ], transformOriginY: [ 0, 0 ], rotateY: [ 0, -180 ] } ] + ], + reset: { transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%" } + }, + /* Magic.css */ + /* Support: Loses rotation in IE9/Android 2.3 (fades only). */ + "transition.perspectiveLeftOut": { + defaultDuration: 950, + calls: [ + [ { opacity: [ 0, 1 ], transformPerspective: [ 2000, 2000 ], transformOriginX: [ 0, 0 ], transformOriginY: [ 0, 0 ], rotateY: -180 } ] + ], + reset: { transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%", rotateY: 0 } + }, + /* Magic.css */ + /* Support: Loses rotation in IE9/Android 2.3 (fades only). */ + "transition.perspectiveRightIn": { + defaultDuration: 950, + calls: [ + [ { opacity: [ 1, 0 ], transformPerspective: [ 2000, 2000 ], transformOriginX: [ "100%", "100%" ], transformOriginY: [ 0, 0 ], rotateY: [ 0, 180 ] } ] + ], + reset: { transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%" } + }, + /* Magic.css */ + /* Support: Loses rotation in IE9/Android 2.3 (fades only). */ + "transition.perspectiveRightOut": { + defaultDuration: 950, + calls: [ + [ { opacity: [ 0, 1 ], transformPerspective: [ 2000, 2000 ], transformOriginX: [ "100%", "100%" ], transformOriginY: [ 0, 0 ], rotateY: 180 } ] + ], + reset: { transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%", rotateY: 0 } + } + }; + + /* Register the packaged effects. */ + for (var effectName in global.Velocity.RegisterUI.packagedEffects) { + global.Velocity.RegisterUI(effectName, global.Velocity.RegisterUI.packagedEffects[effectName]); + } +}((window.jQuery || window.Zepto || window), window, document); +})); \ No newline at end of file diff --git a/app/assets/javascripts/app/lib/core/jquery.velocity.min.js b/app/assets/javascripts/app/lib/core/jquery.velocity.min.js deleted file mode 100644 index 6ce2749cd..000000000 --- a/app/assets/javascripts/app/lib/core/jquery.velocity.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! VelocityJS.org (0.11.9). (C) 2014 Julian Shapiro. MIT @license: en.wikipedia.org/wiki/MIT_License */ -!function(e){"object"==typeof module&&"object"==typeof module.exports?module.exports=e(window.Velocity?window.jQuery:require("jquery")):"function"==typeof define&&define.amd?window.Velocity?define(e):define(["jquery"],e):e(window.jQuery)}(function(e){return function(t,r,a,i){function o(e){for(var t=-1,r=e?e.length:0,a=[];++ti;++i){var o=u(r,e,a);if(0===o)return r;var n=l(r,e,a)-t;r-=n/o}return r}function p(){for(var t=0;x>t;++t)P[t]=l(t*b,e,a)}function d(t,r,i){var o,n,s=0;do n=r+(i-r)/2,o=l(n,e,a)-t,o>0?i=n:r=n;while(Math.abs(o)>h&&++s=y?c(t,s):0==l?s:d(t,r,r+b)}function g(){w=!0,(e!=t||a!=i)&&p()}var m=4,y=.001,h=1e-7,v=10,x=11,b=1/(x-1),S="Float32Array"in r;if(4!==arguments.length)return!1;for(var V=0;4>V;++V)if("number"!=typeof arguments[V]||isNaN(arguments[V])||!isFinite(arguments[V]))return!1;e=Math.min(e,1),a=Math.min(a,1),e=Math.max(e,0),a=Math.max(a,0);var P=S?new Float32Array(x):new Array(x),w=!1,C=function(r){return w||g(),e===t&&a===i?r:0===r?0:1===r?1:l(f(r),t,i)};C.getControlPoints=function(){return[{x:e,y:t},{x:a,y:i}]};var T="generateBezier("+[e,t,a,i]+")";return C.toString=function(){return T},C}function c(e,t){var r=e;return m.isString(e)?v.Easings[e]||(r=!1):r=m.isArray(e)&&1===e.length?l.apply(null,e):m.isArray(e)&&2===e.length?x.apply(null,e.concat([t])):m.isArray(e)&&4===e.length?u.apply(null,e):!1,r===!1&&(r=v.Easings[v.defaults.easing]?v.defaults.easing:h),r}function p(e){if(e)for(var t=(new Date).getTime(),r=0,a=v.State.calls.length;a>r;r++)if(v.State.calls[r]){var o=v.State.calls[r],n=o[0],l=o[2],u=o[3];u||(u=v.State.calls[r][3]=t-16);for(var c=Math.min((t-u)/l.duration,1),g=0,y=n.length;y>g;g++){var h=n[g],x=h.element;if(s(x)){var S=!1;l.display!==i&&null!==l.display&&"none"!==l.display&&("flex"===l.display&&b.setPropertyValue(x,"display",(f?"-ms-":"-webkit-")+l.display),b.setPropertyValue(x,"display",l.display)),l.visibility&&"hidden"!==l.visibility&&b.setPropertyValue(x,"visibility",l.visibility);for(var P in h)if("element"!==P){var w=h[P],C,T=m.isString(w.easing)?v.Easings[w.easing]:w.easing;if(C=1===c?w.endValue:w.startValue+(w.endValue-w.startValue)*T(c),w.currentValue=C,b.Hooks.registered[P]){var k=b.Hooks.getRoot(P),A=s(x).rootPropertyValueCache[k];A&&(w.rootPropertyValue=A)}var E=b.setPropertyValue(x,P,w.currentValue+(0===parseFloat(C)?"":w.unitType),w.rootPropertyValue,w.scrollData);b.Hooks.registered[P]&&(s(x).rootPropertyValueCache[k]=b.Normalizations.registered[k]?b.Normalizations.registered[k]("extract",null,E[1]):E[1]),"transform"===E[0]&&(S=!0)}l.mobileHA&&s(x).transformCache.translate3d===i&&(s(x).transformCache.translate3d="(0px, 0px, 0px)",S=!0),S&&b.flushTransformCache(x)}}l.display!==i&&"none"!==l.display&&(v.State.calls[r][2].display=!1),l.visibility&&"hidden"!==l.visibility&&(v.State.calls[r][2].visibility=!1),l.progress&&l.progress.call(o[1],o[1],c,Math.max(0,u+l.duration-t),u),1===c&&d(r)}v.State.isTicking&&V(p)}function d(e,t){if(!v.State.calls[e])return!1;for(var r=v.State.calls[e][0],a=v.State.calls[e][1],o=v.State.calls[e][2],n=v.State.calls[e][4],l=!1,u=0,c=r.length;c>u;u++){var p=r[u].element;if(t||o.loop||("none"===o.display&&b.setPropertyValue(p,"display",o.display),"hidden"===o.visibility&&b.setPropertyValue(p,"visibility",o.visibility)),($.queue(p)[1]===i||!/\.velocityQueueEntryFlag/i.test($.queue(p)[1]))&&s(p)){s(p).isAnimating=!1,s(p).rootPropertyValueCache={};var d=!1;$.each(b.Lists.transforms3D,function(e,t){var r=/^scale/.test(t)?1:0,a=s(p).transformCache[t];s(p).transformCache[t]!==i&&new RegExp("^\\("+r+"[^.]").test(a)&&(d=!0,delete s(p).transformCache[t])}),o.mobileHA&&(d=!0,delete s(p).transformCache.translate3d),d&&b.flushTransformCache(p),b.Values.removeClass(p,"velocity-animating")}if(!t&&o.complete&&!o.loop&&u===c-1)try{o.complete.call(a,a)}catch(f){setTimeout(function(){throw f},1)}n&&o.loop!==!0&&n(a),o.loop!==!0||t||v(p,"reverse",{loop:!0,delay:o.delay}),o.queue!==!1&&$.dequeue(p,o.queue)}v.State.calls[e]=!1;for(var g=0,m=v.State.calls.length;m>g;g++)if(v.State.calls[g]!==!1){l=!0;break}l===!1&&(v.State.isTicking=!1,delete v.State.calls,v.State.calls=[])}var f=function(){if(a.documentMode)return a.documentMode;for(var e=7;e>4;e--){var t=a.createElement("div");if(t.innerHTML="",t.getElementsByTagName("span").length)return t=null,e}return i}(),g=function(){var e=0;return r.webkitRequestAnimationFrame||r.mozRequestAnimationFrame||function(t){var r=(new Date).getTime(),a;return a=Math.max(0,16-(r-e)),e=r+a,setTimeout(function(){t(r+a)},a)}}(),m={isString:function(e){return"string"==typeof e},isArray:Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},isFunction:function(e){return"[object Function]"===Object.prototype.toString.call(e)},isNode:function(e){return e&&e.nodeType},isNodeList:function(e){return"object"==typeof e&&/^\[object (HTMLCollection|NodeList|Object)\]$/.test(Object.prototype.toString.call(e))&&e.length!==i&&(0===e.length||"object"==typeof e[0]&&e[0].nodeType>0)},isWrapped:function(e){return e&&(e.jquery||r.Zepto&&r.Zepto.zepto.isZ(e))},isSVG:function(e){return r.SVGElement&&e instanceof SVGElement},isEmptyObject:function(e){var t;for(t in e)return!1;return!0}},$;if(e&&e.fn!==i?$=e:r.Velocity&&r.Velocity.Utilities&&($=r.Velocity.Utilities),!$)throw new Error("Velocity: Either jQuery or Velocity's jQuery shim must first be loaded.");if(t.Velocity!==i&&t.Velocity.Utilities==i)throw new Error("Velocity: Namespace is occupied.");if(7>=f){if(e)return void(e.fn.velocity=e.fn.animate);throw new Error("Velocity: In IE<=7, Velocity falls back to jQuery, which must first be loaded.")}if(8===f&&!e)throw new Error("Velocity: In IE8, Velocity requires jQuery proper to be loaded; Velocity's jQuery shim does not work with IE8.");var y=400,h="swing",v={State:{isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),isAndroid:/Android/i.test(navigator.userAgent),isGingerbread:/Android 2\.3\.[3-7]/i.test(navigator.userAgent),isChrome:r.chrome,isFirefox:/Firefox/i.test(navigator.userAgent),prefixElement:a.createElement("div"),prefixMatches:{},scrollAnchor:null,scrollPropertyLeft:null,scrollPropertyTop:null,isTicking:!1,calls:[]},CSS:{},Utilities:$,Sequences:{},Easings:{},Promise:r.Promise,defaults:{queue:"",duration:y,easing:h,begin:null,complete:null,progress:null,display:i,loop:!1,delay:!1,mobileHA:!0,_cacheValues:!0},init:function(e){$.data(e,"velocity",{isSVG:m.isSVG(e),isAnimating:!1,computedStyle:null,tweensContainer:null,rootPropertyValueCache:{},transformCache:{}})},animate:null,hook:null,mock:!1,version:{major:0,minor:11,patch:9},debug:!1};r.pageYOffset!==i?(v.State.scrollAnchor=r,v.State.scrollPropertyLeft="pageXOffset",v.State.scrollPropertyTop="pageYOffset"):(v.State.scrollAnchor=a.documentElement||a.body.parentNode||a.body,v.State.scrollPropertyLeft="scrollLeft",v.State.scrollPropertyTop="scrollTop");var x=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,r,a){var i={x:t.x+a.dx*r,v:t.v+a.dv*r,tension:t.tension,friction:t.friction};return{dx:i.v,dv:e(i)}}function r(r,a){var i={dx:r.v,dv:e(r)},o=t(r,.5*a,i),n=t(r,.5*a,o),s=t(r,a,n),l=1/6*(i.dx+2*(o.dx+n.dx)+s.dx),u=1/6*(i.dv+2*(o.dv+n.dv)+s.dv);return r.x=r.x+l*a,r.v=r.v+u*a,r}return function a(e,t,i){var o={x:-1,v:0,tension:null,friction:null},n=[0],s=0,l=1e-4,u=.016,c,p,d;for(e=parseFloat(e)||500,t=parseFloat(t)||20,i=i||null,o.tension=e,o.friction=t,c=null!==i,c?(s=a(e,t),p=s/i*u):p=u;;)if(d=r(d||o,p),n.push(1+d.x),s+=16,!(Math.abs(d.x)>l&&Math.abs(d.v)>l))break;return c?function(e){return n[e*(n.length-1)|0]}:s}}();v.Easings={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},spring:function(e){return 1-Math.cos(4.5*e*Math.PI)*Math.exp(6*-e)}},$.each([["ease",[.25,.1,.25,1]],["ease-in",[.42,0,1,1]],["ease-out",[0,0,.58,1]],["ease-in-out",[.42,0,.58,1]],["easeInSine",[.47,0,.745,.715]],["easeOutSine",[.39,.575,.565,1]],["easeInOutSine",[.445,.05,.55,.95]],["easeInQuad",[.55,.085,.68,.53]],["easeOutQuad",[.25,.46,.45,.94]],["easeInOutQuad",[.455,.03,.515,.955]],["easeInCubic",[.55,.055,.675,.19]],["easeOutCubic",[.215,.61,.355,1]],["easeInOutCubic",[.645,.045,.355,1]],["easeInQuart",[.895,.03,.685,.22]],["easeOutQuart",[.165,.84,.44,1]],["easeInOutQuart",[.77,0,.175,1]],["easeInQuint",[.755,.05,.855,.06]],["easeOutQuint",[.23,1,.32,1]],["easeInOutQuint",[.86,0,.07,1]],["easeInExpo",[.95,.05,.795,.035]],["easeOutExpo",[.19,1,.22,1]],["easeInOutExpo",[1,0,0,1]],["easeInCirc",[.6,.04,.98,.335]],["easeOutCirc",[.075,.82,.165,1]],["easeInOutCirc",[.785,.135,.15,.86]]],function(e,t){v.Easings[t[0]]=u.apply(null,t[1])});var b=v.CSS={RegEx:{isHex:/^#([A-f\d]{3}){1,2}$/i,valueUnwrap:/^[A-z]+\((.*)\)$/i,wrappedValueAlreadyExtracted:/[0-9.]+ [0-9.]+ [0-9.]+( [0-9.]+)?/,valueSplit:/([A-z]+\(.+\))|(([A-z0-9#-.]+?)(?=\s|$))/gi},Lists:{colors:["fill","stroke","stopColor","color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],transformsBase:["translateX","translateY","scale","scaleX","scaleY","skewX","skewY","rotateZ"],transforms3D:["transformPerspective","translateZ","scaleZ","rotateX","rotateY"]},Hooks:{templates:{textShadow:["Color X Y Blur","black 0px 0px 0px"],boxShadow:["Color X Y Blur Spread","black 0px 0px 0px 0px"],clip:["Top Right Bottom Left","0px 0px 0px 0px"],backgroundPosition:["X Y","0% 0%"],transformOrigin:["X Y Z","50% 50% 0px"],perspectiveOrigin:["X Y","50% 50%"]},registered:{},register:function(){for(var e=0;e=f)switch(e){case"name":return"filter";case"extract":var a=r.toString().match(/alpha\(opacity=(.*)\)/i);return r=a?a[1]/100:1;case"inject":return t.style.zoom=1,parseFloat(r)>=1?"":"alpha(opacity="+parseInt(100*parseFloat(r),10)+")"}else switch(e){case"name":return"opacity";case"extract":return r;case"inject":return r}}},register:function(){9>=f||v.State.isGingerbread||(b.Lists.transformsBase=b.Lists.transformsBase.concat(b.Lists.transforms3D));for(var e=0;ea&&(a=1),o=!/(\d)$/i.test(a);break;case"skew":o=!/(deg|\d)$/i.test(a);break;case"rotate":o=!/(deg|\d)$/i.test(a)}return o||(s(r).transformCache[t]="("+a+")"),s(r).transformCache[t]}}}();for(var e=0;e=f||3!==o.split(" ").length||(o+=" 1"),o;case"inject":return 8>=f?4===a.split(" ").length&&(a=a.split(/\s+/).slice(0,3).join(" ")):3===a.split(" ").length&&(a+=" 1"),(8>=f?"rgb":"rgba")+"("+a.replace(/\s+/g,",").replace(/\.(\d)+(?=,)/g,"")+")"}}}()}},Names:{camelCase:function(e){return e.replace(/-(\w)/g,function(e,t){return t.toUpperCase()})},SVGAttribute:function(e){var t="width|height|x|y|cx|cy|r|rx|ry|x1|x2|y1|y2";return(f||v.State.isAndroid&&!v.State.isChrome)&&(t+="|transform"),new RegExp("^("+t+")$","i").test(e)},prefixCheck:function(e){if(v.State.prefixMatches[e])return[v.State.prefixMatches[e],!0];for(var t=["","Webkit","Moz","ms","O"],r=0,a=t.length;a>r;r++){var i;if(i=0===r?e:t[r]+e.replace(/^\w/,function(e){return e.toUpperCase()}),m.isString(v.State.prefixElement.style[i]))return v.State.prefixMatches[e]=i,[i,!0]}return[e,!1]}},Values:{hexToRgb:function(e){var t=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,a;return e=e.replace(t,function(e,t,r,a){return t+t+r+r+a+a}),a=r.exec(e),a?[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)]:[0,0,0]},isCSSNullValue:function(e){return 0==e||/^(none|auto|transparent|(rgba\(0, ?0, ?0, ?0\)))$/i.test(e)},getUnitType:function(e){return/^(rotate|skew)/i.test(e)?"deg":/(^(scale|scaleX|scaleY|scaleZ|alpha|flexGrow|flexHeight|zIndex|fontWeight)$)|((opacity|red|green|blue|alpha)$)/i.test(e)?"":"px"},getDisplayType:function(e){var t=e.tagName.toString().toLowerCase();return/^(b|big|i|small|tt|abbr|acronym|cite|code|dfn|em|kbd|strong|samp|var|a|bdo|br|img|map|object|q|script|span|sub|sup|button|input|label|select|textarea)$/i.test(t)?"inline":/^(li)$/i.test(t)?"list-item":/^(tr)$/i.test(t)?"table-row":"block"},addClass:function(e,t){e.classList?e.classList.add(t):e.className+=(e.className.length?" ":"")+t},removeClass:function(e,t){e.classList?e.classList.remove(t):e.className=e.className.toString().replace(new RegExp("(^|\\s)"+t.split(" ").join("|")+"(\\s|$)","gi")," ")}},getPropertyValue:function(e,t,a,o){function n(e,t){function a(){u&&b.setPropertyValue(e,"display","none")}var l=0;if(8>=f)l=$.css(e,t);else{var u=!1;if(/^(width|height)$/.test(t)&&0===b.getPropertyValue(e,"display")&&(u=!0,b.setPropertyValue(e,"display",b.Values.getDisplayType(e))),!o){if("height"===t&&"border-box"!==b.getPropertyValue(e,"boxSizing").toString().toLowerCase()){var c=e.offsetHeight-(parseFloat(b.getPropertyValue(e,"borderTopWidth"))||0)-(parseFloat(b.getPropertyValue(e,"borderBottomWidth"))||0)-(parseFloat(b.getPropertyValue(e,"paddingTop"))||0)-(parseFloat(b.getPropertyValue(e,"paddingBottom"))||0);return a(),c}if("width"===t&&"border-box"!==b.getPropertyValue(e,"boxSizing").toString().toLowerCase()){var p=e.offsetWidth-(parseFloat(b.getPropertyValue(e,"borderLeftWidth"))||0)-(parseFloat(b.getPropertyValue(e,"borderRightWidth"))||0)-(parseFloat(b.getPropertyValue(e,"paddingLeft"))||0)-(parseFloat(b.getPropertyValue(e,"paddingRight"))||0);return a(),p}}var d;d=s(e)===i?r.getComputedStyle(e,null):s(e).computedStyle?s(e).computedStyle:s(e).computedStyle=r.getComputedStyle(e,null),(f||v.State.isFirefox)&&"borderColor"===t&&(t="borderTopColor"),l=9===f&&"filter"===t?d.getPropertyValue(t):d[t],(""===l||null===l)&&(l=e.style[t]),a()}if("auto"===l&&/^(top|right|bottom|left)$/i.test(t)){var g=n(e,"position");("fixed"===g||"absolute"===g&&/top|left/i.test(t))&&(l=$(e).position()[t]+"px")}return l}var l;if(b.Hooks.registered[t]){var u=t,c=b.Hooks.getRoot(u);a===i&&(a=b.getPropertyValue(e,b.Names.prefixCheck(c)[0])),b.Normalizations.registered[c]&&(a=b.Normalizations.registered[c]("extract",e,a)),l=b.Hooks.extractValue(u,a)}else if(b.Normalizations.registered[t]){var p,d;p=b.Normalizations.registered[t]("name",e),"transform"!==p&&(d=n(e,b.Names.prefixCheck(p)[0]),b.Values.isCSSNullValue(d)&&b.Hooks.templates[t]&&(d=b.Hooks.templates[t][1])),l=b.Normalizations.registered[t]("extract",e,d)}return/^[\d-]/.test(l)||(l=s(e)&&s(e).isSVG&&b.Names.SVGAttribute(t)?/^(height|width)$/i.test(t)?e.getBBox()[t]:e.getAttribute(t):n(e,b.Names.prefixCheck(t)[0])),b.Values.isCSSNullValue(l)&&(l=0),v.debug>=2&&console.log("Get "+t+": "+l),l},setPropertyValue:function(e,t,a,i,o){var n=t;if("scroll"===t)o.container?o.container["scroll"+o.direction]=a:"Left"===o.direction?r.scrollTo(a,o.alternateValue):r.scrollTo(o.alternateValue,a);else if(b.Normalizations.registered[t]&&"transform"===b.Normalizations.registered[t]("name",e))b.Normalizations.registered[t]("inject",e,a),n="transform",a=s(e).transformCache[t];else{if(b.Hooks.registered[t]){var l=t,u=b.Hooks.getRoot(t);i=i||b.getPropertyValue(e,u),a=b.Hooks.injectValue(l,a,i),t=u}if(b.Normalizations.registered[t]&&(a=b.Normalizations.registered[t]("inject",e,a),t=b.Normalizations.registered[t]("name",e)),n=b.Names.prefixCheck(t)[0],8>=f)try{e.style[n]=a}catch(c){v.debug&&console.log("Browser does not support ["+a+"] for ["+n+"]")}else s(e)&&s(e).isSVG&&b.Names.SVGAttribute(t)?e.setAttribute(t,a):e.style[n]=a;v.debug>=2&&console.log("Set "+t+" ("+n+"): "+a)}return[n,a]},flushTransformCache:function(e){function t(t){return parseFloat(b.getPropertyValue(e,t))}var r="";if((f||v.State.isAndroid&&!v.State.isChrome)&&s(e).isSVG){var a={translate:[t("translateX"),t("translateY")],skewX:[t("skewX")],skewY:[t("skewY")],scale:1!==t("scale")?[t("scale"),t("scale")]:[t("scaleX"),t("scaleY")],rotate:[t("rotateZ"),0,0]};$.each(s(e).transformCache,function(e){/^translate/i.test(e)?e="translate":/^scale/i.test(e)?e="scale":/^rotate/i.test(e)&&(e="rotate"),a[e]&&(r+=e+"("+a[e].join(" ")+") ",delete a[e])})}else{var i,o;$.each(s(e).transformCache,function(t){return i=s(e).transformCache[t],"transformPerspective"===t?(o=i,!0):(9===f&&"rotateZ"===t&&(t="rotate"),void(r+=t+i+" "))}),o&&(r="perspective"+o+" "+r)}b.setPropertyValue(e,"transform",r)}};b.Hooks.register(),b.Normalizations.register(),v.hook=function(e,t,r){var a=i;return m.isWrapped(e)&&(e=[].slice.call(e)),$.each(n(e),function(e,o){if(s(o)===i&&v.init(o),r===i)a===i&&(a=v.CSS.getPropertyValue(o,t));else{var n=v.CSS.setPropertyValue(o,t,r);"transform"===n[0]&&v.CSS.flushTransformCache(o),a=n}}),a};var S=function(){function e(){return u?T.promise||null:f}function t(){function e(e){function d(e,r){var a=i,o=i,s=i;return m.isArray(e)?(a=e[0],!m.isArray(e[1])&&/^[\d-]/.test(e[1])||m.isFunction(e[1])||b.RegEx.isHex.test(e[1])?s=e[1]:(m.isString(e[1])&&!b.RegEx.isHex.test(e[1])||m.isArray(e[1]))&&(o=r?e[1]:c(e[1],n.duration),e[2]!==i&&(s=e[2]))):a=e,r||(o=o||n.easing),m.isFunction(a)&&(a=a.call(t,P,V)),m.isFunction(s)&&(s=s.call(t,P,V)),[a||0,o,s]}function f(e,t){var r,a;return a=(t||0).toString().toLowerCase().replace(/[%A-z]+$/,function(e){return r=e,""}),r||(r=b.Values.getUnitType(e)),[a,r]}function g(){var e={myParent:t.parentNode||a.body,position:b.getPropertyValue(t,"position"),fontSize:b.getPropertyValue(t,"fontSize")},i=e.position===j.lastPosition&&e.myParent===j.lastParent,o=e.fontSize===j.lastFontSize;j.lastParent=e.myParent,j.lastPosition=e.position,j.lastFontSize=e.fontSize;var n=100,l={};if(o&&i)l.emToPx=j.lastEmToPx,l.percentToPxWidth=j.lastPercentToPxWidth,l.percentToPxHeight=j.lastPercentToPxHeight;else{var u=s(t).isSVG?a.createElementNS("http://www.w3.org/2000/svg","rect"):a.createElement("div");v.init(u),e.myParent.appendChild(u),$.each(["overflow","overflowX","overflowY"],function(e,t){v.CSS.setPropertyValue(u,t,"hidden")}),v.CSS.setPropertyValue(u,"position",e.position),v.CSS.setPropertyValue(u,"fontSize",e.fontSize),v.CSS.setPropertyValue(u,"boxSizing","content-box"),$.each(["minWidth","maxWidth","width","minHeight","maxHeight","height"],function(e,t){v.CSS.setPropertyValue(u,t,n+"%")}),v.CSS.setPropertyValue(u,"paddingLeft",n+"em"),l.percentToPxWidth=j.lastPercentToPxWidth=(parseFloat(b.getPropertyValue(u,"width",null,!0))||1)/n,l.percentToPxHeight=j.lastPercentToPxHeight=(parseFloat(b.getPropertyValue(u,"height",null,!0))||1)/n,l.emToPx=j.lastEmToPx=(parseFloat(b.getPropertyValue(u,"paddingLeft"))||1)/n,e.myParent.removeChild(u)}return null===j.remToPx&&(j.remToPx=parseFloat(b.getPropertyValue(a.body,"fontSize"))||16),null===j.vwToPx&&(j.vwToPx=parseFloat(r.innerWidth)/100,j.vhToPx=parseFloat(r.innerHeight)/100),l.remToPx=j.remToPx,l.vwToPx=j.vwToPx,l.vhToPx=j.vhToPx,v.debug>=1&&console.log("Unit ratios: "+JSON.stringify(l),t),l}if(n.begin&&0===P)try{n.begin.call(h,h)}catch(y){setTimeout(function(){throw y},1)}if("scroll"===k){var w=/^x$/i.test(n.axis)?"Left":"Top",C=parseFloat(n.offset)||0,A,E,F;n.container?m.isWrapped(n.container)||m.isNode(n.container)?(n.container=n.container[0]||n.container,A=n.container["scroll"+w],F=A+$(t).position()[w.toLowerCase()]+C):n.container=null:(A=v.State.scrollAnchor[v.State["scrollProperty"+w]],E=v.State.scrollAnchor[v.State["scrollProperty"+("Left"===w?"Top":"Left")]],F=$(t).offset()[w.toLowerCase()]+C),l={scroll:{rootPropertyValue:!1,startValue:A,currentValue:A,endValue:F,unitType:"",easing:n.easing,scrollData:{container:n.container,direction:w,alternateValue:E}},element:t},v.debug&&console.log("tweensContainer (scroll): ",l.scroll,t)}else if("reverse"===k){if(!s(t).tweensContainer)return void $.dequeue(t,n.queue);"none"===s(t).opts.display&&(s(t).opts.display="auto"),"hidden"===s(t).opts.visibility&&(s(t).opts.visibility="visible"),s(t).opts.loop=!1,s(t).opts.begin=null,s(t).opts.complete=null,S.easing||delete n.easing,S.duration||delete n.duration,n=$.extend({},s(t).opts,n);var H=$.extend(!0,{},s(t).tweensContainer);for(var N in H)if("element"!==N){var z=H[N].startValue;H[N].startValue=H[N].currentValue=H[N].endValue,H[N].endValue=z,m.isEmptyObject(S)||(H[N].easing=n.easing),v.debug&&console.log("reverse tweensContainer ("+N+"): "+JSON.stringify(H[N]),t)}l=H}else if("start"===k){var H;s(t).tweensContainer&&s(t).isAnimating===!0&&(H=s(t).tweensContainer),$.each(x,function(e,t){if(RegExp("^"+b.Lists.colors.join("$|^")+"$").test(e)){var r=d(t,!0),a=r[0],o=r[1],n=r[2];if(b.RegEx.isHex.test(a)){for(var s=["Red","Green","Blue"],l=b.Values.hexToRgb(a),u=n?b.Values.hexToRgb(n):i,c=0;c1e4&&(v.State.calls=o(v.State.calls)),v.State.calls.push([L,h,n,null,T.resolver]),v.State.isTicking===!1&&(v.State.isTicking=!0,p())):P++)}var t=this,n=$.extend({},v.defaults,S),l={},u;if(s(t)===i&&v.init(t),parseFloat(n.delay)&&n.queue!==!1&&$.queue(t,n.queue,function(e){v.velocityQueueEntryFlag=!0,s(t).delayTimer={setTimeout:setTimeout(e,parseFloat(n.delay)),next:e}}),v.mock===!0)n.duration=1;else switch(n.duration.toString().toLowerCase()){case"fast":n.duration=200;break;case"normal":n.duration=y;break;case"slow":n.duration=600;break;default:n.duration=parseFloat(n.duration)||1}n.easing=c(n.easing,n.duration),n.begin&&!m.isFunction(n.begin)&&(n.begin=null),n.progress&&!m.isFunction(n.progress)&&(n.progress=null),n.complete&&!m.isFunction(n.complete)&&(n.complete=null),n.display!==i&&null!==n.display&&(n.display=n.display.toString().toLowerCase(),"auto"===n.display&&(n.display=v.CSS.Values.getDisplayType(t))),n.visibility&&(n.visibility=n.visibility.toString().toLowerCase()),n.mobileHA=n.mobileHA&&v.State.isMobile&&!v.State.isGingerbread,n.queue===!1?n.delay?setTimeout(e,n.delay):e():$.queue(t,n.queue,function(t,r){return r===!0?(T.promise&&T.resolver(h),!0):(v.velocityQueueEntryFlag=!0,void e(t))}),""!==n.queue&&"fx"!==n.queue||"inprogress"===$.queue(t)[0]||$.dequeue(t)}var l=arguments[0]&&($.isPlainObject(arguments[0].properties)&&!arguments[0].properties.names||m.isString(arguments[0].properties)),u,f,g,h,x,S;if(m.isWrapped(this)?(u=!1,g=0,h=this,f=this):(u=!0,g=1,h=l?arguments[0].elements:arguments[0]),h=m.isWrapped(h)?[].slice.call(h):h){l?(x=arguments[0].properties,S=arguments[0].options):(x=arguments[g],S=arguments[g+1]);var V=m.isArray(h)||m.isNodeList(h)?h.length:1,P=0;if("stop"!==x&&!$.isPlainObject(S)){var w=g+1;S={};for(var C=w;CR;R++){var q={delay:E.delay};R===z-1&&(q.display=E.display,q.visibility=E.visibility,q.complete=E.complete),v(h,"reverse",q)}return e()}};v=$.extend(S,v),v.animate=S;var V=r.requestAnimationFrame||g;v.State.isMobile||a.hidden===i||a.addEventListener("visibilitychange",function(){a.hidden?(V=function(e){return setTimeout(function(){e(!0)},16)},p()):V=r.requestAnimationFrame||g});var P;return e&&e.fn!==i?P=e:r.Zepto&&(P=r.Zepto),(P||r).Velocity=v,P&&(P.fn.velocity=S,P.fn.velocity.defaults=v.defaults),$.each(["Down","Up"],function(e,t){v.Sequences["slide"+t]=function(e,r,a,o,n,s){var l=$.extend({},r),u=l.begin,c=l.complete,p={height:"",marginTop:"",marginBottom:"",paddingTop:"",paddingBottom:""},d={};l.display===i&&(l.display="Down"===t?"inline"===v.CSS.Values.getDisplayType(e)?"inline-block":"block":"none"),l.begin=function(e){u&&u.call(e,e),d.overflowY=e.style.overflowY,e.style.overflowY="hidden";for(var r in p){d[r]=e.style[r];var a=v.CSS.getPropertyValue(e,r);p[r]="Down"===t?[a,0]:[0,a]}},l.complete=function(e){for(var t in d)e.style[t]=d[t];c&&c.call(e,e),s&&s.resolver(n||e)},v(e,p,l)}}),$.each(["In","Out"],function(e,t){v.Sequences["fade"+t]=function(e,r,a,o,n,s){var l=$.extend({},r),u={opacity:"In"===t?1:0},c=l.complete;l.complete=a!==o-1?l.begin=null:function(){c&&c.call(e,e),s&&s.resolver(n||e)},l.display===i&&(l.display="In"===t?"auto":"none"),v(this,u,l)}}),v}(e||window,window,document)}); \ No newline at end of file diff --git a/app/assets/javascripts/app/views/agent_ticket_create.jst.eco b/app/assets/javascripts/app/views/agent_ticket_create.jst.eco index 49facbffc..fd1c859e5 100644 --- a/app/assets/javascripts/app/views/agent_ticket_create.jst.eco +++ b/app/assets/javascripts/app/views/agent_ticket_create.jst.eco @@ -1,24 +1,211 @@ -
+
+
+
+ -
-
- -
-
-   + -
- - \ No newline at end of file diff --git a/app/assets/javascripts/app/views/agent_ticket_view/navbar.jst.eco b/app/assets/javascripts/app/views/agent_ticket_view/navbar.jst.eco index f3d4eb867..b9378d406 100644 --- a/app/assets/javascripts/app/views/agent_ticket_view/navbar.jst.eco +++ b/app/assets/javascripts/app/views/agent_ticket_view/navbar.jst.eco @@ -3,7 +3,7 @@ <% for item in @items: %>
  • class="active"<% end %>> - <%- @T(item.name) %> + <%- @T(item.name) %> <%= item.count %>
  • diff --git a/app/assets/javascripts/app/views/dashboard.jst.eco b/app/assets/javascripts/app/views/dashboard.jst.eco index d979e0648..64c2e8c89 100644 --- a/app/assets/javascripts/app/views/dashboard.jst.eco +++ b/app/assets/javascripts/app/views/dashboard.jst.eco @@ -15,8 +15,8 @@
    -
    My handling time: 25 minutes
    -
    Average: 13%
    +
    My handling time: 25 minutes
    +
    Average: 13%
    @@ -25,8 +25,8 @@
    -
    3% of my tickets escalated.
    -
    Average: 17%
    +
    3% of my tickets escalated.
    +
    Average: 17%
    @@ -90,8 +90,8 @@
    -
    Tickets of my Group: 78 of 234
    -
    Average: 22%
    +
    Tickets of my Group: 78 of 234
    +
    Average: 22%
    @@ -100,8 +100,8 @@
    -
    74% are currently in process
    -
    Average: 62%
    +
    74% are currently in process
    +
    Average: 62%
    @@ -110,8 +110,8 @@
    -
    7% are being reopened
    -
    Average: 6%
    +
    7% are being reopened
    +
    Average: 6%
    diff --git a/app/assets/javascripts/app/views/generic/drox.jst.eco b/app/assets/javascripts/app/views/generic/drox.jst.eco index cba06c21f..82d0b03c6 100644 --- a/app/assets/javascripts/app/views/generic/drox.jst.eco +++ b/app/assets/javascripts/app/views/generic/drox.jst.eco @@ -1,11 +1,11 @@
    -

    +

    <%- @T( @header ) %> <% if @edit: %> <% end %> -

    +
    diff --git a/app/assets/javascripts/app/views/getting_started.jst.eco b/app/assets/javascripts/app/views/getting_started.jst.eco index a673232bb..a70ad3bd0 100644 --- a/app/assets/javascripts/app/views/getting_started.jst.eco +++ b/app/assets/javascripts/app/views/getting_started.jst.eco @@ -1,9 +1,9 @@
      -
    1. <%- @T( 'Create Admin' ) %>
    2. -
    3. <%- @T( 'Invite Agents' ) %>
    4. -
    5. <%- @T( 'Configure Channels' ) %>
    6. +
    7. <%- @T( 'Create Admin' ) %>
    8. +
    9. <%- @T( 'Invite Agents' ) %>
    10. +
    11. <%- @T( 'Configure Channels' ) %>
    <% if @master_user: %>
    diff --git a/app/assets/javascripts/app/views/navigation.jst.eco b/app/assets/javascripts/app/views/navigation.jst.eco index 2fc7d29dc..6ea97d6ea 100644 --- a/app/assets/javascripts/app/views/navigation.jst.eco +++ b/app/assets/javascripts/app/views/navigation.jst.eco @@ -11,7 +11,7 @@ -
    +
    <% if !_.isEmpty(@user): %> diff --git a/app/assets/javascripts/app/views/navigation/personal.jst.eco b/app/assets/javascripts/app/views/navigation/personal.jst.eco index a3316d2b9..9abfd83e1 100644 --- a/app/assets/javascripts/app/views/navigation/personal.jst.eco +++ b/app/assets/javascripts/app/views/navigation/personal.jst.eco @@ -20,7 +20,7 @@ <% end %>
  • - <%- @T( item.name ) %> + <%- @T( item.name ) %> <% if item['count'] isnt undefined: %><%= item['count'] %><% end %> <% if item.iconClass: %><% end %> diff --git a/app/assets/javascripts/app/views/navigation/result.jst.eco b/app/assets/javascripts/app/views/navigation/result.jst.eco index d61d971d2..891c707ad 100644 --- a/app/assets/javascripts/app/views/navigation/result.jst.eco +++ b/app/assets/javascripts/app/views/navigation/result.jst.eco @@ -4,7 +4,7 @@
  • -
    <%= item.display %>
    +
    <%= item.display %>
  • <% end %> diff --git a/app/assets/javascripts/app/views/popover/ticket.jst.eco b/app/assets/javascripts/app/views/popover/ticket.jst.eco index 4ad92d225..47e5f9d6c 100644 --- a/app/assets/javascripts/app/views/popover/ticket.jst.eco +++ b/app/assets/javascripts/app/views/popover/ticket.jst.eco @@ -11,25 +11,25 @@ <%- @P( @ticket.customer ) %>

    -
    +

    #

    -
    <%- @P( @ticket.number ) %>
    +
    <%- @P( @ticket.number ) %>

    <%- @T( 'State' ) %>

    -
    <%- @P( @ticket.state.name ) %>
    +
    <%- @P( @ticket.state.name ) %>

    <%- @T( 'Priority' ) %>

    -
    <%- @T( @ticket.priority.name ) %>
    +
    <%- @T( @ticket.priority.name ) %>

    <%- @T( 'Age' ) %>

    -
    <%- @P( @ticket.humanTime ) %>
    +
    <%- @P( @ticket.humanTime ) %>

    <%- @T( 'Group' ) %>

    -
    <%- @P( @ticket.group ) %>
    +
    <%- @P( @ticket.group ) %>
    \ No newline at end of file diff --git a/app/assets/javascripts/app/views/task_widget_tasks.jst.eco b/app/assets/javascripts/app/views/task_widget_tasks.jst.eco index bed3ad73b..42f12db8d 100644 --- a/app/assets/javascripts/app/views/task_widget_tasks.jst.eco +++ b/app/assets/javascripts/app/views/task_widget_tasks.jst.eco @@ -3,7 +3,7 @@
    -
    <%= item.data.head %>
    +
    <%= item.data.head %>
    diff --git a/app/assets/javascripts/app/views/ticket_zoom.jst.eco b/app/assets/javascripts/app/views/ticket_zoom.jst.eco index 155c9159d..19e6bbd7b 100644 --- a/app/assets/javascripts/app/views/ticket_zoom.jst.eco +++ b/app/assets/javascripts/app/views/ticket_zoom.jst.eco @@ -1,7 +1,7 @@
    -
    +
    -